@skill-map/cli 0.36.0 → 0.37.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.
@@ -0,0 +1,317 @@
1
+ import{c as mn}from"./chunk-VFYNKTSB.js";import{a as Sa,b as Bi,c as Ia,d as Ta,e as v0,f as C0,g as x0,h as b0}from"./chunk-UMCC32EJ.js";import{b as Z_,e as ua,f as Q_,j as Ze,k as We,l as p0,m as xa,n as ba,o as wa,p as h0,q as m0,r as g0,s as ah,t as Mo,u as Di,w as _0,x as Oi}from"./chunk-S2NIJM7Z.js";import{c as ya,d as va,e as y0}from"./chunk-UK5YFHL3.js";import{c as l0,d as u0,h as Ni,i as Ri,m as Ai,p as Fi,q as Li}from"./chunk-5CFY2K3Y.js";import{$ as gt,$a as Hn,$b as Wn,Aa as ve,Ab as K_,Ba as be,Bc as Ei,Eb as yt,Fb as Xe,Fc as r0,Gb as ne,Gc as a0,Hb as we,Hc as s0,Ib as jn,Ic as un,J as C,Jb as Jt,Jc as fn,K as xi,Ka as U,Lc as pa,M as he,N as bi,Na as E,O as u,Oa as P,Oc as ha,Pa as eh,Pc as ma,Qa as Te,Qb as Un,R as j_,Ra as Z,S as cn,Sa as Q,Sb as Bt,T as G,Ta as M,Tb as D,Tc as d0,U as H,Ua as p,V as it,Va as m,Vc as zt,W as Qp,Wa as L,Wb as Ge,Wc as ga,X as ot,Xa as K,Xb as F,Y as Jr,Ya as Y,Yb as ze,Z as rt,Za as dn,Zb as da,_a as Gn,_b as ih,aa as Vn,ab as Ii,bb as ra,bd as Pi,cb as aa,cc as Ce,cd as Mi,da as j,db as de,dc as et,ea as pe,eb as th,fa as wi,fb as $,fd as _a,g as S,ga as ie,gd as ki,hb as g,hd as f0,ia as Be,ib as Zt,id as pn,ja as ea,jb as Ae,jd as rh,ka as U_,kb as sa,la as Eo,mb as St,mc as Y_,md as Ca,n as G_,na as ta,nb as It,nc as X_,nd as hn,oa as l,ob as nh,oc as la,pa as na,pb as Ot,pc as Ti,qa as W_,qb as _t,qc as ln,ra as $_,rb as Qt,sa as Jp,sb as ft,ta as ia,tb as se,u as H_,ub as ca,vb as Fe,wa as J,wb as y,xa as Si,xb as x,ya as De,yb as Le,za as oa,zb as Po}from"./chunk-LTQTJU54.js";import{C as oh,Da as c0,I as n0,K as i0,W as o0,b as J_,k as e0,p as fa,u as t0}from"./chunk-3SI3TVER.js";import{a as ae,b as Xt,c as Ci,e as _,g as iD}from"./chunk-VB56BUGO.js";var av=_((Dne,rv)=>{"use strict";function SL(){this.__data__=[],this.size=0}rv.exports=SL});var si=_((One,sv)=>{"use strict";function IL(t,n){return t===n||t!==t&&n!==n}sv.exports=IL});var vr=_((Nne,cv)=>{"use strict";var TL=si();function EL(t,n){for(var e=t.length;e--;)if(TL(t[e][0],n))return e;return-1}cv.exports=EL});var lv=_((Rne,dv)=>{"use strict";var PL=vr(),ML=Array.prototype,kL=ML.splice;function DL(t){var n=this.__data__,e=PL(n,t);if(e<0)return!1;var i=n.length-1;return e==i?n.pop():kL.call(n,e,1),--this.size,!0}dv.exports=DL});var fv=_((Ane,uv)=>{"use strict";var OL=vr();function NL(t){var n=this.__data__,e=OL(n,t);return e<0?void 0:n[e][1]}uv.exports=NL});var hv=_((Fne,pv)=>{"use strict";var RL=vr();function AL(t){return RL(this.__data__,t)>-1}pv.exports=AL});var gv=_((Lne,mv)=>{"use strict";var FL=vr();function LL(t,n){var e=this.__data__,i=FL(e,t);return i<0?(++this.size,e.push([t,n])):e[i][1]=n,this}mv.exports=LL});var Cr=_((Bne,_v)=>{"use strict";var BL=av(),zL=lv(),qL=fv(),VL=hv(),GL=gv();function so(t){var n=-1,e=t==null?0:t.length;for(this.clear();++n<e;){var i=t[n];this.set(i[0],i[1])}}so.prototype.clear=BL;so.prototype.delete=zL;so.prototype.get=qL;so.prototype.has=VL;so.prototype.set=GL;_v.exports=so});var vv=_((zne,yv)=>{"use strict";var HL=Cr();function jL(){this.__data__=new HL,this.size=0}yv.exports=jL});var xv=_((qne,Cv)=>{"use strict";function UL(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e}Cv.exports=UL});var wv=_((Vne,bv)=>{"use strict";function WL(t){return this.__data__.get(t)}bv.exports=WL});var Iv=_((Gne,Sv)=>{"use strict";function $L(t){return this.__data__.has(t)}Sv.exports=$L});var zm=_((Hne,Tv)=>{"use strict";var KL=typeof global=="object"&&global&&global.Object===Object&&global;Tv.exports=KL});var Pt=_((jne,Ev)=>{"use strict";var YL=zm(),XL=typeof self=="object"&&self&&self.Object===Object&&self,ZL=YL||XL||Function("return this")();Ev.exports=ZL});var ci=_((Une,Pv)=>{"use strict";var QL=Pt(),JL=QL.Symbol;Pv.exports=JL});var Ov=_((Wne,Dv)=>{"use strict";var Mv=ci(),kv=Object.prototype,e3=kv.hasOwnProperty,t3=kv.toString,xr=Mv?Mv.toStringTag:void 0;function n3(t){var n=e3.call(t,xr),e=t[xr];try{t[xr]=void 0;var i=!0}catch{}var o=t3.call(t);return i&&(n?t[xr]=e:delete t[xr]),o}Dv.exports=n3});var Rv=_(($ne,Nv)=>{"use strict";var i3=Object.prototype,o3=i3.toString;function r3(t){return o3.call(t)}Nv.exports=r3});var Mn=_((Kne,Lv)=>{"use strict";var Av=ci(),a3=Ov(),s3=Rv(),c3="[object Null]",d3="[object Undefined]",Fv=Av?Av.toStringTag:void 0;function l3(t){return t==null?t===void 0?d3:c3:Fv&&Fv in Object(t)?a3(t):s3(t)}Lv.exports=l3});var Ct=_((Yne,Bv)=>{"use strict";function u3(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}Bv.exports=u3});var co=_((Xne,zv)=>{"use strict";var f3=Mn(),p3=Ct(),h3="[object AsyncFunction]",m3="[object Function]",g3="[object GeneratorFunction]",_3="[object Proxy]";function y3(t){if(!p3(t))return!1;var n=f3(t);return n==m3||n==g3||n==h3||n==_3}zv.exports=y3});var Vv=_((Zne,qv)=>{"use strict";var v3=Pt(),C3=v3["__core-js_shared__"];qv.exports=C3});var jv=_((Qne,Hv)=>{"use strict";var qm=Vv(),Gv=(function(){var t=/[^.]+$/.exec(qm&&qm.keys&&qm.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function x3(t){return!!Gv&&Gv in t}Hv.exports=x3});var Vm=_((Jne,Uv)=>{"use strict";var b3=Function.prototype,w3=b3.toString;function S3(t){if(t!=null){try{return w3.call(t)}catch{}try{return t+""}catch{}}return""}Uv.exports=S3});var $v=_((eie,Wv)=>{"use strict";var I3=co(),T3=jv(),E3=Ct(),P3=Vm(),M3=/[\\^$.*+?()[\]{}|]/g,k3=/^\[object .+?Constructor\]$/,D3=Function.prototype,O3=Object.prototype,N3=D3.toString,R3=O3.hasOwnProperty,A3=RegExp("^"+N3.call(R3).replace(M3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function F3(t){if(!E3(t)||T3(t))return!1;var n=I3(t)?A3:k3;return n.test(P3(t))}Wv.exports=F3});var Yv=_((tie,Kv)=>{"use strict";function L3(t,n){return t?.[n]}Kv.exports=L3});var kn=_((nie,Xv)=>{"use strict";var B3=$v(),z3=Yv();function q3(t,n){var e=z3(t,n);return B3(e)?e:void 0}Xv.exports=q3});var Bf=_((iie,Zv)=>{"use strict";var V3=kn(),G3=Pt(),H3=V3(G3,"Map");Zv.exports=H3});var br=_((oie,Qv)=>{"use strict";var j3=kn(),U3=j3(Object,"create");Qv.exports=U3});var tC=_((rie,eC)=>{"use strict";var Jv=br();function W3(){this.__data__=Jv?Jv(null):{},this.size=0}eC.exports=W3});var iC=_((aie,nC)=>{"use strict";function $3(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}nC.exports=$3});var rC=_((sie,oC)=>{"use strict";var K3=br(),Y3="__lodash_hash_undefined__",X3=Object.prototype,Z3=X3.hasOwnProperty;function Q3(t){var n=this.__data__;if(K3){var e=n[t];return e===Y3?void 0:e}return Z3.call(n,t)?n[t]:void 0}oC.exports=Q3});var sC=_((cie,aC)=>{"use strict";var J3=br(),eB=Object.prototype,tB=eB.hasOwnProperty;function nB(t){var n=this.__data__;return J3?n[t]!==void 0:tB.call(n,t)}aC.exports=nB});var dC=_((die,cC)=>{"use strict";var iB=br(),oB="__lodash_hash_undefined__";function rB(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=iB&&n===void 0?oB:n,this}cC.exports=rB});var uC=_((lie,lC)=>{"use strict";var aB=tC(),sB=iC(),cB=rC(),dB=sC(),lB=dC();function lo(t){var n=-1,e=t==null?0:t.length;for(this.clear();++n<e;){var i=t[n];this.set(i[0],i[1])}}lo.prototype.clear=aB;lo.prototype.delete=sB;lo.prototype.get=cB;lo.prototype.has=dB;lo.prototype.set=lB;lC.exports=lo});var hC=_((uie,pC)=>{"use strict";var fC=uC(),uB=Cr(),fB=Bf();function pB(){this.size=0,this.__data__={hash:new fC,map:new(fB||uB),string:new fC}}pC.exports=pB});var gC=_((fie,mC)=>{"use strict";function hB(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}mC.exports=hB});var wr=_((pie,_C)=>{"use strict";var mB=gC();function gB(t,n){var e=t.__data__;return mB(n)?e[typeof n=="string"?"string":"hash"]:e.map}_C.exports=gB});var vC=_((hie,yC)=>{"use strict";var _B=wr();function yB(t){var n=_B(this,t).delete(t);return this.size-=n?1:0,n}yC.exports=yB});var xC=_((mie,CC)=>{"use strict";var vB=wr();function CB(t){return vB(this,t).get(t)}CC.exports=CB});var wC=_((gie,bC)=>{"use strict";var xB=wr();function bB(t){return xB(this,t).has(t)}bC.exports=bB});var IC=_((_ie,SC)=>{"use strict";var wB=wr();function SB(t,n){var e=wB(this,t),i=e.size;return e.set(t,n),this.size+=e.size==i?0:1,this}SC.exports=SB});var zf=_((yie,TC)=>{"use strict";var IB=hC(),TB=vC(),EB=xC(),PB=wC(),MB=IC();function uo(t){var n=-1,e=t==null?0:t.length;for(this.clear();++n<e;){var i=t[n];this.set(i[0],i[1])}}uo.prototype.clear=IB;uo.prototype.delete=TB;uo.prototype.get=EB;uo.prototype.has=PB;uo.prototype.set=MB;TC.exports=uo});var PC=_((vie,EC)=>{"use strict";var kB=Cr(),DB=Bf(),OB=zf(),NB=200;function RB(t,n){var e=this.__data__;if(e instanceof kB){var i=e.__data__;if(!DB||i.length<NB-1)return i.push([t,n]),this.size=++e.size,this;e=this.__data__=new OB(i)}return e.set(t,n),this.size=e.size,this}EC.exports=RB});var Sr=_((Cie,MC)=>{"use strict";var AB=Cr(),FB=vv(),LB=xv(),BB=wv(),zB=Iv(),qB=PC();function fo(t){var n=this.__data__=new AB(t);this.size=n.size}fo.prototype.clear=FB;fo.prototype.delete=LB;fo.prototype.get=BB;fo.prototype.has=zB;fo.prototype.set=qB;MC.exports=fo});var qf=_((xie,kC)=>{"use strict";function VB(t,n){for(var e=-1,i=t==null?0:t.length;++e<i&&n(t[e],e,t)!==!1;);return t}kC.exports=VB});var Gm=_((bie,DC)=>{"use strict";var GB=kn(),HB=(function(){try{var t=GB(Object,"defineProperty");return t({},"",{}),t}catch{}})();DC.exports=HB});var Ir=_((wie,NC)=>{"use strict";var OC=Gm();function jB(t,n,e){n=="__proto__"&&OC?OC(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}NC.exports=jB});var Tr=_((Sie,RC)=>{"use strict";var UB=Ir(),WB=si(),$B=Object.prototype,KB=$B.hasOwnProperty;function YB(t,n,e){var i=t[n];(!(KB.call(t,n)&&WB(i,e))||e===void 0&&!(n in t))&&UB(t,n,e)}RC.exports=YB});var po=_((Iie,AC)=>{"use strict";var XB=Tr(),ZB=Ir();function QB(t,n,e,i){var o=!e;e||(e={});for(var r=-1,a=n.length;++r<a;){var s=n[r],c=i?i(e[s],t[s],s,e,t):void 0;c===void 0&&(c=t[s]),o?ZB(e,s,c):XB(e,s,c)}return e}AC.exports=QB});var LC=_((Tie,FC)=>{"use strict";function JB(t,n){for(var e=-1,i=Array(t);++e<t;)i[e]=n(e);return i}FC.exports=JB});var Ft=_((Eie,BC)=>{"use strict";function ez(t){return t!=null&&typeof t=="object"}BC.exports=ez});var qC=_((Pie,zC)=>{"use strict";var tz=Mn(),nz=Ft(),iz="[object Arguments]";function oz(t){return nz(t)&&tz(t)==iz}zC.exports=oz});var ho=_((Mie,HC)=>{"use strict";var VC=qC(),rz=Ft(),GC=Object.prototype,az=GC.hasOwnProperty,sz=GC.propertyIsEnumerable,cz=VC((function(){return arguments})())?VC:function(t){return rz(t)&&az.call(t,"callee")&&!sz.call(t,"callee")};HC.exports=cz});var Ue=_((kie,jC)=>{"use strict";var dz=Array.isArray;jC.exports=dz});var WC=_((Die,UC)=>{"use strict";function lz(){return!1}UC.exports=lz});var di=_((Er,mo)=>{"use strict";var uz=Pt(),fz=WC(),YC=typeof Er=="object"&&Er&&!Er.nodeType&&Er,$C=YC&&typeof mo=="object"&&mo&&!mo.nodeType&&mo,pz=$C&&$C.exports===YC,KC=pz?uz.Buffer:void 0,hz=KC?KC.isBuffer:void 0,mz=hz||fz;mo.exports=mz});var Pr=_((Oie,XC)=>{"use strict";var gz=9007199254740991,_z=/^(?:0|[1-9]\d*)$/;function yz(t,n){var e=typeof t;return n=n??gz,!!n&&(e=="number"||e!="symbol"&&_z.test(t))&&t>-1&&t%1==0&&t<n}XC.exports=yz});var Vf=_((Nie,ZC)=>{"use strict";var vz=9007199254740991;function Cz(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=vz}ZC.exports=Cz});var JC=_((Rie,QC)=>{"use strict";var xz=Mn(),bz=Vf(),wz=Ft(),Sz="[object Arguments]",Iz="[object Array]",Tz="[object Boolean]",Ez="[object Date]",Pz="[object Error]",Mz="[object Function]",kz="[object Map]",Dz="[object Number]",Oz="[object Object]",Nz="[object RegExp]",Rz="[object Set]",Az="[object String]",Fz="[object WeakMap]",Lz="[object ArrayBuffer]",Bz="[object DataView]",zz="[object Float32Array]",qz="[object Float64Array]",Vz="[object Int8Array]",Gz="[object Int16Array]",Hz="[object Int32Array]",jz="[object Uint8Array]",Uz="[object Uint8ClampedArray]",Wz="[object Uint16Array]",$z="[object Uint32Array]",Ne={};Ne[zz]=Ne[qz]=Ne[Vz]=Ne[Gz]=Ne[Hz]=Ne[jz]=Ne[Uz]=Ne[Wz]=Ne[$z]=!0;Ne[Sz]=Ne[Iz]=Ne[Lz]=Ne[Tz]=Ne[Bz]=Ne[Ez]=Ne[Pz]=Ne[Mz]=Ne[kz]=Ne[Dz]=Ne[Oz]=Ne[Nz]=Ne[Rz]=Ne[Az]=Ne[Fz]=!1;function Kz(t){return wz(t)&&bz(t.length)&&!!Ne[xz(t)]}QC.exports=Kz});var Mr=_((Aie,ex)=>{"use strict";function Yz(t){return function(n){return t(n)}}ex.exports=Yz});var Gf=_((kr,go)=>{"use strict";var Xz=zm(),tx=typeof kr=="object"&&kr&&!kr.nodeType&&kr,Dr=tx&&typeof go=="object"&&go&&!go.nodeType&&go,Zz=Dr&&Dr.exports===tx,Hm=Zz&&Xz.process,Qz=(function(){try{var t=Dr&&Dr.require&&Dr.require("util").types;return t||Hm&&Hm.binding&&Hm.binding("util")}catch{}})();go.exports=Qz});var _o=_((Fie,ox)=>{"use strict";var Jz=JC(),eq=Mr(),nx=Gf(),ix=nx&&nx.isTypedArray,tq=ix?eq(ix):Jz;ox.exports=tq});var jm=_((Lie,rx)=>{"use strict";var nq=LC(),iq=ho(),oq=Ue(),rq=di(),aq=Pr(),sq=_o(),cq=Object.prototype,dq=cq.hasOwnProperty;function lq(t,n){var e=oq(t),i=!e&&iq(t),o=!e&&!i&&rq(t),r=!e&&!i&&!o&&sq(t),a=e||i||o||r,s=a?nq(t.length,String):[],c=s.length;for(var d in t)(n||dq.call(t,d))&&!(a&&(d=="length"||o&&(d=="offset"||d=="parent")||r&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||aq(d,c)))&&s.push(d);return s}rx.exports=lq});var Or=_((Bie,ax)=>{"use strict";var uq=Object.prototype;function fq(t){var n=t&&t.constructor,e=typeof n=="function"&&n.prototype||uq;return t===e}ax.exports=fq});var Um=_((zie,sx)=>{"use strict";function pq(t,n){return function(e){return t(n(e))}}sx.exports=pq});var dx=_((qie,cx)=>{"use strict";var hq=Um(),mq=hq(Object.keys,Object);cx.exports=mq});var Hf=_((Vie,lx)=>{"use strict";var gq=Or(),_q=dx(),yq=Object.prototype,vq=yq.hasOwnProperty;function Cq(t){if(!gq(t))return _q(t);var n=[];for(var e in Object(t))vq.call(t,e)&&e!="constructor"&&n.push(e);return n}lx.exports=Cq});var jt=_((Gie,ux)=>{"use strict";var xq=co(),bq=Vf();function wq(t){return t!=null&&bq(t.length)&&!xq(t)}ux.exports=wq});var nn=_((Hie,fx)=>{"use strict";var Sq=jm(),Iq=Hf(),Tq=jt();function Eq(t){return Tq(t)?Sq(t):Iq(t)}fx.exports=Eq});var hx=_((jie,px)=>{"use strict";var Pq=po(),Mq=nn();function kq(t,n){return t&&Pq(n,Mq(n),t)}px.exports=kq});var gx=_((Uie,mx)=>{"use strict";function Dq(t){var n=[];if(t!=null)for(var e in Object(t))n.push(e);return n}mx.exports=Dq});var yx=_((Wie,_x)=>{"use strict";var Oq=Ct(),Nq=Or(),Rq=gx(),Aq=Object.prototype,Fq=Aq.hasOwnProperty;function Lq(t){if(!Oq(t))return Rq(t);var n=Nq(t),e=[];for(var i in t)i=="constructor"&&(n||!Fq.call(t,i))||e.push(i);return e}_x.exports=Lq});var Dn=_(($ie,vx)=>{"use strict";var Bq=jm(),zq=yx(),qq=jt();function Vq(t){return qq(t)?Bq(t,!0):zq(t)}vx.exports=Vq});var xx=_((Kie,Cx)=>{"use strict";var Gq=po(),Hq=Dn();function jq(t,n){return t&&Gq(n,Hq(n),t)}Cx.exports=jq});var Wm=_((Nr,yo)=>{"use strict";var Uq=Pt(),Ix=typeof Nr=="object"&&Nr&&!Nr.nodeType&&Nr,bx=Ix&&typeof yo=="object"&&yo&&!yo.nodeType&&yo,Wq=bx&&bx.exports===Ix,wx=Wq?Uq.Buffer:void 0,Sx=wx?wx.allocUnsafe:void 0;function $q(t,n){if(n)return t.slice();var e=t.length,i=Sx?Sx(e):new t.constructor(e);return t.copy(i),i}yo.exports=$q});var $m=_((Yie,Tx)=>{"use strict";function Kq(t,n){var e=-1,i=t.length;for(n||(n=Array(i));++e<i;)n[e]=t[e];return n}Tx.exports=Kq});var Km=_((Xie,Ex)=>{"use strict";function Yq(t,n){for(var e=-1,i=t==null?0:t.length,o=0,r=[];++e<i;){var a=t[e];n(a,e,t)&&(r[o++]=a)}return r}Ex.exports=Yq});var Ym=_((Zie,Px)=>{"use strict";function Xq(){return[]}Px.exports=Xq});var jf=_((Qie,kx)=>{"use strict";var Zq=Km(),Qq=Ym(),Jq=Object.prototype,e5=Jq.propertyIsEnumerable,Mx=Object.getOwnPropertySymbols,t5=Mx?function(t){return t==null?[]:(t=Object(t),Zq(Mx(t),function(n){return e5.call(t,n)}))}:Qq;kx.exports=t5});var Ox=_((Jie,Dx)=>{"use strict";var n5=po(),i5=jf();function o5(t,n){return n5(t,i5(t),n)}Dx.exports=o5});var Uf=_((eoe,Nx)=>{"use strict";function r5(t,n){for(var e=-1,i=n.length,o=t.length;++e<i;)t[o+e]=n[e];return t}Nx.exports=r5});var Rr=_((toe,Rx)=>{"use strict";var a5=Um(),s5=a5(Object.getPrototypeOf,Object);Rx.exports=s5});var Xm=_((noe,Ax)=>{"use strict";var c5=Uf(),d5=Rr(),l5=jf(),u5=Ym(),f5=Object.getOwnPropertySymbols,p5=f5?function(t){for(var n=[];t;)c5(n,l5(t)),t=d5(t);return n}:u5;Ax.exports=p5});var Lx=_((ioe,Fx)=>{"use strict";var h5=po(),m5=Xm();function g5(t,n){return h5(t,m5(t),n)}Fx.exports=g5});var Zm=_((ooe,Bx)=>{"use strict";var _5=Uf(),y5=Ue();function v5(t,n,e){var i=n(t);return y5(t)?i:_5(i,e(t))}Bx.exports=v5});var Qm=_((roe,zx)=>{"use strict";var C5=Zm(),x5=jf(),b5=nn();function w5(t){return C5(t,b5,x5)}zx.exports=w5});var Vx=_((aoe,qx)=>{"use strict";var S5=Zm(),I5=Xm(),T5=Dn();function E5(t){return S5(t,T5,I5)}qx.exports=E5});var Hx=_((soe,Gx)=>{"use strict";var P5=kn(),M5=Pt(),k5=P5(M5,"DataView");Gx.exports=k5});var Ux=_((coe,jx)=>{"use strict";var D5=kn(),O5=Pt(),N5=D5(O5,"Promise");jx.exports=N5});var Jm=_((doe,Wx)=>{"use strict";var R5=kn(),A5=Pt(),F5=R5(A5,"Set");Wx.exports=F5});var Kx=_((loe,$x)=>{"use strict";var L5=kn(),B5=Pt(),z5=L5(B5,"WeakMap");$x.exports=z5});var ui=_((uoe,tb)=>{"use strict";var eg=Hx(),tg=Bf(),ng=Ux(),ig=Jm(),og=Kx(),eb=Mn(),vo=Vm(),Yx="[object Map]",q5="[object Object]",Xx="[object Promise]",Zx="[object Set]",Qx="[object WeakMap]",Jx="[object DataView]",V5=vo(eg),G5=vo(tg),H5=vo(ng),j5=vo(ig),U5=vo(og),li=eb;(eg&&li(new eg(new ArrayBuffer(1)))!=Jx||tg&&li(new tg)!=Yx||ng&&li(ng.resolve())!=Xx||ig&&li(new ig)!=Zx||og&&li(new og)!=Qx)&&(li=function(t){var n=eb(t),e=n==q5?t.constructor:void 0,i=e?vo(e):"";if(i)switch(i){case V5:return Jx;case G5:return Yx;case H5:return Xx;case j5:return Zx;case U5:return Qx}return n});tb.exports=li});var ib=_((foe,nb)=>{"use strict";var W5=Object.prototype,$5=W5.hasOwnProperty;function K5(t){var n=t.length,e=new t.constructor(n);return n&&typeof t[0]=="string"&&$5.call(t,"index")&&(e.index=t.index,e.input=t.input),e}nb.exports=K5});var rg=_((poe,ob)=>{"use strict";var Y5=Pt(),X5=Y5.Uint8Array;ob.exports=X5});var Wf=_((hoe,ab)=>{"use strict";var rb=rg();function Z5(t){var n=new t.constructor(t.byteLength);return new rb(n).set(new rb(t)),n}ab.exports=Z5});var cb=_((moe,sb)=>{"use strict";var Q5=Wf();function J5(t,n){var e=n?Q5(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}sb.exports=J5});var lb=_((goe,db)=>{"use strict";var eV=/\w*$/;function tV(t){var n=new t.constructor(t.source,eV.exec(t));return n.lastIndex=t.lastIndex,n}db.exports=tV});var mb=_((_oe,hb)=>{"use strict";var ub=ci(),fb=ub?ub.prototype:void 0,pb=fb?fb.valueOf:void 0;function nV(t){return pb?Object(pb.call(t)):{}}hb.exports=nV});var ag=_((yoe,gb)=>{"use strict";var iV=Wf();function oV(t,n){var e=n?iV(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}gb.exports=oV});var yb=_((voe,_b)=>{"use strict";var rV=Wf(),aV=cb(),sV=lb(),cV=mb(),dV=ag(),lV="[object Boolean]",uV="[object Date]",fV="[object Map]",pV="[object Number]",hV="[object RegExp]",mV="[object Set]",gV="[object String]",_V="[object Symbol]",yV="[object ArrayBuffer]",vV="[object DataView]",CV="[object Float32Array]",xV="[object Float64Array]",bV="[object Int8Array]",wV="[object Int16Array]",SV="[object Int32Array]",IV="[object Uint8Array]",TV="[object Uint8ClampedArray]",EV="[object Uint16Array]",PV="[object Uint32Array]";function MV(t,n,e){var i=t.constructor;switch(n){case yV:return rV(t);case lV:case uV:return new i(+t);case vV:return aV(t,e);case CV:case xV:case bV:case wV:case SV:case IV:case TV:case EV:case PV:return dV(t,e);case fV:return new i;case pV:case gV:return new i(t);case hV:return sV(t);case mV:return new i;case _V:return cV(t)}}_b.exports=MV});var sg=_((Coe,Cb)=>{"use strict";var kV=Ct(),vb=Object.create,DV=(function(){function t(){}return function(n){if(!kV(n))return{};if(vb)return vb(n);t.prototype=n;var e=new t;return t.prototype=void 0,e}})();Cb.exports=DV});var cg=_((xoe,xb)=>{"use strict";var OV=sg(),NV=Rr(),RV=Or();function AV(t){return typeof t.constructor=="function"&&!RV(t)?OV(NV(t)):{}}xb.exports=AV});var wb=_((boe,bb)=>{"use strict";var FV=ui(),LV=Ft(),BV="[object Map]";function zV(t){return LV(t)&&FV(t)==BV}bb.exports=zV});var Eb=_((woe,Tb)=>{"use strict";var qV=wb(),VV=Mr(),Sb=Gf(),Ib=Sb&&Sb.isMap,GV=Ib?VV(Ib):qV;Tb.exports=GV});var Mb=_((Soe,Pb)=>{"use strict";var HV=ui(),jV=Ft(),UV="[object Set]";function WV(t){return jV(t)&&HV(t)==UV}Pb.exports=WV});var Nb=_((Ioe,Ob)=>{"use strict";var $V=Mb(),KV=Mr(),kb=Gf(),Db=kb&&kb.isSet,YV=Db?KV(Db):$V;Ob.exports=YV});var dg=_((Toe,Lb)=>{"use strict";var XV=Sr(),ZV=qf(),QV=Tr(),JV=hx(),e4=xx(),t4=Wm(),n4=$m(),i4=Ox(),o4=Lx(),r4=Qm(),a4=Vx(),s4=ui(),c4=ib(),d4=yb(),l4=cg(),u4=Ue(),f4=di(),p4=Eb(),h4=Ct(),m4=Nb(),g4=nn(),_4=Dn(),y4=1,v4=2,C4=4,Rb="[object Arguments]",x4="[object Array]",b4="[object Boolean]",w4="[object Date]",S4="[object Error]",Ab="[object Function]",I4="[object GeneratorFunction]",T4="[object Map]",E4="[object Number]",Fb="[object Object]",P4="[object RegExp]",M4="[object Set]",k4="[object String]",D4="[object Symbol]",O4="[object WeakMap]",N4="[object ArrayBuffer]",R4="[object DataView]",A4="[object Float32Array]",F4="[object Float64Array]",L4="[object Int8Array]",B4="[object Int16Array]",z4="[object Int32Array]",q4="[object Uint8Array]",V4="[object Uint8ClampedArray]",G4="[object Uint16Array]",H4="[object Uint32Array]",Me={};Me[Rb]=Me[x4]=Me[N4]=Me[R4]=Me[b4]=Me[w4]=Me[A4]=Me[F4]=Me[L4]=Me[B4]=Me[z4]=Me[T4]=Me[E4]=Me[Fb]=Me[P4]=Me[M4]=Me[k4]=Me[D4]=Me[q4]=Me[V4]=Me[G4]=Me[H4]=!0;Me[S4]=Me[Ab]=Me[O4]=!1;function $f(t,n,e,i,o,r){var a,s=n&y4,c=n&v4,d=n&C4;if(e&&(a=o?e(t,i,o,r):e(t)),a!==void 0)return a;if(!h4(t))return t;var f=u4(t);if(f){if(a=c4(t),!s)return n4(t,a)}else{var h=s4(t),v=h==Ab||h==I4;if(f4(t))return t4(t,s);if(h==Fb||h==Rb||v&&!o){if(a=c||v?{}:l4(t),!s)return c?o4(t,e4(a,t)):i4(t,JV(a,t))}else{if(!Me[h])return o?t:{};a=d4(t,h,s)}}r||(r=new XV);var b=r.get(t);if(b)return b;r.set(t,a),m4(t)?t.forEach(function(k){a.add($f(k,n,e,k,t,r))}):p4(t)&&t.forEach(function(k,O){a.set(O,$f(k,n,e,O,t,r))});var w=d?c?a4:r4:c?_4:g4,T=f?void 0:w(t);return ZV(T||t,function(k,O){T&&(O=k,k=t[O]),QV(a,O,$f(k,n,e,O,t,r))}),a}Lb.exports=$f});var zb=_((Eoe,Bb)=>{"use strict";var j4=dg(),U4=4;function W4(t){return j4(t,U4)}Bb.exports=W4});var Kf=_((Poe,qb)=>{"use strict";function $4(t){return function(){return t}}qb.exports=$4});var Gb=_((Moe,Vb)=>{"use strict";function K4(t){return function(n,e,i){for(var o=-1,r=Object(n),a=i(n),s=a.length;s--;){var c=a[t?s:++o];if(e(r[c],c,r)===!1)break}return n}}Vb.exports=K4});var Yf=_((koe,Hb)=>{"use strict";var Y4=Gb(),X4=Y4();Hb.exports=X4});var Xf=_((Doe,jb)=>{"use strict";var Z4=Yf(),Q4=nn();function J4(t,n){return t&&Z4(t,n,Q4)}jb.exports=J4});var Wb=_((Ooe,Ub)=>{"use strict";var eG=jt();function tG(t,n){return function(e,i){if(e==null)return e;if(!eG(e))return t(e,i);for(var o=e.length,r=n?o:-1,a=Object(e);(n?r--:++r<o)&&i(a[r],r,a)!==!1;);return e}}Ub.exports=tG});var Ar=_((Noe,$b)=>{"use strict";var nG=Xf(),iG=Wb(),oG=iG(nG);$b.exports=oG});var On=_((Roe,Kb)=>{"use strict";function rG(t){return t}Kb.exports=rG});var lg=_((Aoe,Yb)=>{"use strict";var aG=On();function sG(t){return typeof t=="function"?t:aG}Yb.exports=sG});var ug=_((Foe,Xb)=>{"use strict";var cG=qf(),dG=Ar(),lG=lg(),uG=Ue();function fG(t,n){var e=uG(t)?cG:dG;return e(t,lG(n))}Xb.exports=fG});var fg=_((Loe,Zb)=>{"use strict";Zb.exports=ug()});var Jb=_((Boe,Qb)=>{"use strict";var pG=Ar();function hG(t,n){var e=[];return pG(t,function(i,o,r){n(i,o,r)&&e.push(i)}),e}Qb.exports=hG});var tw=_((zoe,ew)=>{"use strict";var mG="__lodash_hash_undefined__";function gG(t){return this.__data__.set(t,mG),this}ew.exports=gG});var iw=_((qoe,nw)=>{"use strict";function _G(t){return this.__data__.has(t)}nw.exports=_G});var pg=_((Voe,ow)=>{"use strict";var yG=zf(),vG=tw(),CG=iw();function Zf(t){var n=-1,e=t==null?0:t.length;for(this.__data__=new yG;++n<e;)this.add(t[n])}Zf.prototype.add=Zf.prototype.push=vG;Zf.prototype.has=CG;ow.exports=Zf});var aw=_((Goe,rw)=>{"use strict";function xG(t,n){for(var e=-1,i=t==null?0:t.length;++e<i;)if(n(t[e],e,t))return!0;return!1}rw.exports=xG});var hg=_((Hoe,sw)=>{"use strict";function bG(t,n){return t.has(n)}sw.exports=bG});var mg=_((joe,cw)=>{"use strict";var wG=pg(),SG=aw(),IG=hg(),TG=1,EG=2;function PG(t,n,e,i,o,r){var a=e&TG,s=t.length,c=n.length;if(s!=c&&!(a&&c>s))return!1;var d=r.get(t),f=r.get(n);if(d&&f)return d==n&&f==t;var h=-1,v=!0,b=e&EG?new wG:void 0;for(r.set(t,n),r.set(n,t);++h<s;){var w=t[h],T=n[h];if(i)var k=a?i(T,w,h,n,t,r):i(w,T,h,t,n,r);if(k!==void 0){if(k)continue;v=!1;break}if(b){if(!SG(n,function(O,A){if(!IG(b,A)&&(w===O||o(w,O,e,i,r)))return b.push(A)})){v=!1;break}}else if(!(w===T||o(w,T,e,i,r))){v=!1;break}}return r.delete(t),r.delete(n),v}cw.exports=PG});var lw=_((Uoe,dw)=>{"use strict";function MG(t){var n=-1,e=Array(t.size);return t.forEach(function(i,o){e[++n]=[o,i]}),e}dw.exports=MG});var Qf=_((Woe,uw)=>{"use strict";function kG(t){var n=-1,e=Array(t.size);return t.forEach(function(i){e[++n]=i}),e}uw.exports=kG});var gw=_(($oe,mw)=>{"use strict";var fw=ci(),pw=rg(),DG=si(),OG=mg(),NG=lw(),RG=Qf(),AG=1,FG=2,LG="[object Boolean]",BG="[object Date]",zG="[object Error]",qG="[object Map]",VG="[object Number]",GG="[object RegExp]",HG="[object Set]",jG="[object String]",UG="[object Symbol]",WG="[object ArrayBuffer]",$G="[object DataView]",hw=fw?fw.prototype:void 0,gg=hw?hw.valueOf:void 0;function KG(t,n,e,i,o,r,a){switch(e){case $G:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case WG:return!(t.byteLength!=n.byteLength||!r(new pw(t),new pw(n)));case LG:case BG:case VG:return DG(+t,+n);case zG:return t.name==n.name&&t.message==n.message;case GG:case jG:return t==n+"";case qG:var s=NG;case HG:var c=i&AG;if(s||(s=RG),t.size!=n.size&&!c)return!1;var d=a.get(t);if(d)return d==n;i|=FG,a.set(t,n);var f=OG(s(t),s(n),i,o,r,a);return a.delete(t),f;case UG:if(gg)return gg.call(t)==gg.call(n)}return!1}mw.exports=KG});var vw=_((Koe,yw)=>{"use strict";var _w=Qm(),YG=1,XG=Object.prototype,ZG=XG.hasOwnProperty;function QG(t,n,e,i,o,r){var a=e&YG,s=_w(t),c=s.length,d=_w(n),f=d.length;if(c!=f&&!a)return!1;for(var h=c;h--;){var v=s[h];if(!(a?v in n:ZG.call(n,v)))return!1}var b=r.get(t),w=r.get(n);if(b&&w)return b==n&&w==t;var T=!0;r.set(t,n),r.set(n,t);for(var k=a;++h<c;){v=s[h];var O=t[v],A=n[v];if(i)var V=a?i(A,O,v,n,t,r):i(O,A,v,t,n,r);if(!(V===void 0?O===A||o(O,A,e,i,r):V)){T=!1;break}k||(k=v=="constructor")}if(T&&!k){var q=t.constructor,X=n.constructor;q!=X&&"constructor"in t&&"constructor"in n&&!(typeof q=="function"&&q instanceof q&&typeof X=="function"&&X instanceof X)&&(T=!1)}return r.delete(t),r.delete(n),T}yw.exports=QG});var Ew=_((Yoe,Tw)=>{"use strict";var _g=Sr(),JG=mg(),eH=gw(),tH=vw(),Cw=ui(),xw=Ue(),bw=di(),nH=_o(),iH=1,ww="[object Arguments]",Sw="[object Array]",Jf="[object Object]",oH=Object.prototype,Iw=oH.hasOwnProperty;function rH(t,n,e,i,o,r){var a=xw(t),s=xw(n),c=a?Sw:Cw(t),d=s?Sw:Cw(n);c=c==ww?Jf:c,d=d==ww?Jf:d;var f=c==Jf,h=d==Jf,v=c==d;if(v&&bw(t)){if(!bw(n))return!1;a=!0,f=!1}if(v&&!f)return r||(r=new _g),a||nH(t)?JG(t,n,e,i,o,r):eH(t,n,c,e,i,o,r);if(!(e&iH)){var b=f&&Iw.call(t,"__wrapped__"),w=h&&Iw.call(n,"__wrapped__");if(b||w){var T=b?t.value():t,k=w?n.value():n;return r||(r=new _g),o(T,k,e,i,r)}}return v?(r||(r=new _g),tH(t,n,e,i,o,r)):!1}Tw.exports=rH});var yg=_((Xoe,kw)=>{"use strict";var aH=Ew(),Pw=Ft();function Mw(t,n,e,i,o){return t===n?!0:t==null||n==null||!Pw(t)&&!Pw(n)?t!==t&&n!==n:aH(t,n,e,i,Mw,o)}kw.exports=Mw});var Ow=_((Zoe,Dw)=>{"use strict";var sH=Sr(),cH=yg(),dH=1,lH=2;function uH(t,n,e,i){var o=e.length,r=o,a=!i;if(t==null)return!r;for(t=Object(t);o--;){var s=e[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<r;){s=e[o];var c=s[0],d=t[c],f=s[1];if(a&&s[2]){if(d===void 0&&!(c in t))return!1}else{var h=new sH;if(i)var v=i(d,f,c,t,n,h);if(!(v===void 0?cH(f,d,dH|lH,i,h):v))return!1}}return!0}Dw.exports=uH});var vg=_((Qoe,Nw)=>{"use strict";var fH=Ct();function pH(t){return t===t&&!fH(t)}Nw.exports=pH});var Aw=_((Joe,Rw)=>{"use strict";var hH=vg(),mH=nn();function gH(t){for(var n=mH(t),e=n.length;e--;){var i=n[e],o=t[i];n[e]=[i,o,hH(o)]}return n}Rw.exports=gH});var Cg=_((ere,Fw)=>{"use strict";function _H(t,n){return function(e){return e==null?!1:e[t]===n&&(n!==void 0||t in Object(e))}}Fw.exports=_H});var Bw=_((tre,Lw)=>{"use strict";var yH=Ow(),vH=Aw(),CH=Cg();function xH(t){var n=vH(t);return n.length==1&&n[0][2]?CH(n[0][0],n[0][1]):function(e){return e===t||yH(e,t,n)}}Lw.exports=xH});var fi=_((nre,zw)=>{"use strict";var bH=Mn(),wH=Ft(),SH="[object Symbol]";function IH(t){return typeof t=="symbol"||wH(t)&&bH(t)==SH}zw.exports=IH});var ep=_((ire,qw)=>{"use strict";var TH=Ue(),EH=fi(),PH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,MH=/^\w*$/;function kH(t,n){if(TH(t))return!1;var e=typeof t;return e=="number"||e=="symbol"||e=="boolean"||t==null||EH(t)?!0:MH.test(t)||!PH.test(t)||n!=null&&t in Object(n)}qw.exports=kH});var Hw=_((ore,Gw)=>{"use strict";var Vw=zf(),DH="Expected a function";function xg(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new TypeError(DH);var e=function(){var i=arguments,o=n?n.apply(this,i):i[0],r=e.cache;if(r.has(o))return r.get(o);var a=t.apply(this,i);return e.cache=r.set(o,a)||r,a};return e.cache=new(xg.Cache||Vw),e}xg.Cache=Vw;Gw.exports=xg});var Uw=_((rre,jw)=>{"use strict";var OH=Hw(),NH=500;function RH(t){var n=OH(t,function(i){return e.size===NH&&e.clear(),i}),e=n.cache;return n}jw.exports=RH});var $w=_((are,Ww)=>{"use strict";var AH=Uw(),FH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LH=/\\(\\)?/g,BH=AH(function(t){var n=[];return t.charCodeAt(0)===46&&n.push(""),t.replace(FH,function(e,i,o,r){n.push(o?r.replace(LH,"$1"):i||e)}),n});Ww.exports=BH});var Fr=_((sre,Kw)=>{"use strict";function zH(t,n){for(var e=-1,i=t==null?0:t.length,o=Array(i);++e<i;)o[e]=n(t[e],e,t);return o}Kw.exports=zH});var eS=_((cre,Jw)=>{"use strict";var Yw=ci(),qH=Fr(),VH=Ue(),GH=fi(),HH=1/0,Xw=Yw?Yw.prototype:void 0,Zw=Xw?Xw.toString:void 0;function Qw(t){if(typeof t=="string")return t;if(VH(t))return qH(t,Qw)+"";if(GH(t))return Zw?Zw.call(t):"";var n=t+"";return n=="0"&&1/t==-HH?"-0":n}Jw.exports=Qw});var bg=_((dre,tS)=>{"use strict";var jH=eS();function UH(t){return t==null?"":jH(t)}tS.exports=UH});var Lr=_((lre,nS)=>{"use strict";var WH=Ue(),$H=ep(),KH=$w(),YH=bg();function XH(t,n){return WH(t)?t:$H(t,n)?[t]:KH(YH(t))}nS.exports=XH});var Co=_((ure,iS)=>{"use strict";var ZH=fi(),QH=1/0;function JH(t){if(typeof t=="string"||ZH(t))return t;var n=t+"";return n=="0"&&1/t==-QH?"-0":n}iS.exports=JH});var Br=_((fre,oS)=>{"use strict";var ej=Lr(),tj=Co();function nj(t,n){n=ej(n,t);for(var e=0,i=n.length;t!=null&&e<i;)t=t[tj(n[e++])];return e&&e==i?t:void 0}oS.exports=nj});var aS=_((pre,rS)=>{"use strict";var ij=Br();function oj(t,n,e){var i=t==null?void 0:ij(t,n);return i===void 0?e:i}rS.exports=oj});var cS=_((hre,sS)=>{"use strict";function rj(t,n){return t!=null&&n in Object(t)}sS.exports=rj});var wg=_((mre,dS)=>{"use strict";var aj=Lr(),sj=ho(),cj=Ue(),dj=Pr(),lj=Vf(),uj=Co();function fj(t,n,e){n=aj(n,t);for(var i=-1,o=n.length,r=!1;++i<o;){var a=uj(n[i]);if(!(r=t!=null&&e(t,a)))break;t=t[a]}return r||++i!=o?r:(o=t==null?0:t.length,!!o&&lj(o)&&dj(a,o)&&(cj(t)||sj(t)))}dS.exports=fj});var Sg=_((gre,lS)=>{"use strict";var pj=cS(),hj=wg();function mj(t,n){return t!=null&&hj(t,n,pj)}lS.exports=mj});var fS=_((_re,uS)=>{"use strict";var gj=yg(),_j=aS(),yj=Sg(),vj=ep(),Cj=vg(),xj=Cg(),bj=Co(),wj=1,Sj=2;function Ij(t,n){return vj(t)&&Cj(n)?xj(bj(t),n):function(e){var i=_j(e,t);return i===void 0&&i===n?yj(e,t):gj(n,i,wj|Sj)}}uS.exports=Ij});var Ig=_((yre,pS)=>{"use strict";function Tj(t){return function(n){return n?.[t]}}pS.exports=Tj});var mS=_((vre,hS)=>{"use strict";var Ej=Br();function Pj(t){return function(n){return Ej(n,t)}}hS.exports=Pj});var _S=_((Cre,gS)=>{"use strict";var Mj=Ig(),kj=mS(),Dj=ep(),Oj=Co();function Nj(t){return Dj(t)?Mj(Oj(t)):kj(t)}gS.exports=Nj});var Ut=_((xre,yS)=>{"use strict";var Rj=Bw(),Aj=fS(),Fj=On(),Lj=Ue(),Bj=_S();function zj(t){return typeof t=="function"?t:t==null?Fj:typeof t=="object"?Lj(t)?Aj(t[0],t[1]):Rj(t):Bj(t)}yS.exports=zj});var Tg=_((bre,vS)=>{"use strict";var qj=Km(),Vj=Jb(),Gj=Ut(),Hj=Ue();function jj(t,n){var e=Hj(t)?qj:Vj;return e(t,Gj(n,3))}vS.exports=jj});var xS=_((wre,CS)=>{"use strict";var Uj=Object.prototype,Wj=Uj.hasOwnProperty;function $j(t,n){return t!=null&&Wj.call(t,n)}CS.exports=$j});var Eg=_((Sre,bS)=>{"use strict";var Kj=xS(),Yj=wg();function Xj(t,n){return t!=null&&Yj(t,n,Kj)}bS.exports=Xj});var SS=_((Ire,wS)=>{"use strict";var Zj=Hf(),Qj=ui(),Jj=ho(),eU=Ue(),tU=jt(),nU=di(),iU=Or(),oU=_o(),rU="[object Map]",aU="[object Set]",sU=Object.prototype,cU=sU.hasOwnProperty;function dU(t){if(t==null)return!0;if(tU(t)&&(eU(t)||typeof t=="string"||typeof t.splice=="function"||nU(t)||oU(t)||Jj(t)))return!t.length;var n=Qj(t);if(n==rU||n==aU)return!t.size;if(iU(t))return!Zj(t).length;for(var e in t)if(cU.call(t,e))return!1;return!0}wS.exports=dU});var Pg=_((Tre,IS)=>{"use strict";function lU(t){return t===void 0}IS.exports=lU});var Mg=_((Ere,TS)=>{"use strict";var uU=Ar(),fU=jt();function pU(t,n){var e=-1,i=fU(t)?Array(t.length):[];return uU(t,function(o,r,a){i[++e]=n(o,r,a)}),i}TS.exports=pU});var kg=_((Pre,ES)=>{"use strict";var hU=Fr(),mU=Ut(),gU=Mg(),_U=Ue();function yU(t,n){var e=_U(t)?hU:gU;return e(t,mU(n,3))}ES.exports=yU});var MS=_((Mre,PS)=>{"use strict";function vU(t,n,e,i){var o=-1,r=t==null?0:t.length;for(i&&r&&(e=t[++o]);++o<r;)e=n(e,t[o],o,t);return e}PS.exports=vU});var DS=_((kre,kS)=>{"use strict";function CU(t,n,e,i,o){return o(t,function(r,a,s){e=i?(i=!1,r):n(e,r,a,s)}),e}kS.exports=CU});var Dg=_((Dre,OS)=>{"use strict";var xU=MS(),bU=Ar(),wU=Ut(),SU=DS(),IU=Ue();function TU(t,n,e){var i=IU(t)?xU:SU,o=arguments.length<3;return i(t,wU(n,4),e,o,bU)}OS.exports=TU});var RS=_((Ore,NS)=>{"use strict";var EU=Mn(),PU=Ue(),MU=Ft(),kU="[object String]";function DU(t){return typeof t=="string"||!PU(t)&&MU(t)&&EU(t)==kU}NS.exports=DU});var FS=_((Nre,AS)=>{"use strict";var OU=Ig(),NU=OU("length");AS.exports=NU});var BS=_((Rre,LS)=>{"use strict";var RU="\\ud800-\\udfff",AU="\\u0300-\\u036f",FU="\\ufe20-\\ufe2f",LU="\\u20d0-\\u20ff",BU=AU+FU+LU,zU="\\ufe0e\\ufe0f",qU="\\u200d",VU=RegExp("["+qU+RU+BU+zU+"]");function GU(t){return VU.test(t)}LS.exports=GU});var $S=_((Are,WS)=>{"use strict";var qS="\\ud800-\\udfff",HU="\\u0300-\\u036f",jU="\\ufe20-\\ufe2f",UU="\\u20d0-\\u20ff",WU=HU+jU+UU,$U="\\ufe0e\\ufe0f",KU="["+qS+"]",Og="["+WU+"]",Ng="\\ud83c[\\udffb-\\udfff]",YU="(?:"+Og+"|"+Ng+")",VS="[^"+qS+"]",GS="(?:\\ud83c[\\udde6-\\uddff]){2}",HS="[\\ud800-\\udbff][\\udc00-\\udfff]",XU="\\u200d",jS=YU+"?",US="["+$U+"]?",ZU="(?:"+XU+"(?:"+[VS,GS,HS].join("|")+")"+US+jS+")*",QU=US+jS+ZU,JU="(?:"+[VS+Og+"?",Og,GS,HS,KU].join("|")+")",zS=RegExp(Ng+"(?="+Ng+")|"+JU+QU,"g");function eW(t){for(var n=zS.lastIndex=0;zS.test(t);)++n;return n}WS.exports=eW});var YS=_((Fre,KS)=>{"use strict";var tW=FS(),nW=BS(),iW=$S();function oW(t){return nW(t)?iW(t):tW(t)}KS.exports=oW});var ZS=_((Lre,XS)=>{"use strict";var rW=Hf(),aW=ui(),sW=jt(),cW=RS(),dW=YS(),lW="[object Map]",uW="[object Set]";function fW(t){if(t==null)return 0;if(sW(t))return cW(t)?dW(t):t.length;var n=aW(t);return n==lW||n==uW?t.size:rW(t).length}XS.exports=fW});var JS=_((Bre,QS)=>{"use strict";var pW=qf(),hW=sg(),mW=Xf(),gW=Ut(),_W=Rr(),yW=Ue(),vW=di(),CW=co(),xW=Ct(),bW=_o();function wW(t,n,e){var i=yW(t),o=i||vW(t)||bW(t);if(n=gW(n,4),e==null){var r=t&&t.constructor;o?e=i?new r:[]:xW(t)?e=CW(r)?hW(_W(t)):{}:e={}}return(o?pW:mW)(t,function(a,s,c){return n(e,a,s,c)}),e}QS.exports=wW});var iI=_((zre,nI)=>{"use strict";var eI=ci(),SW=ho(),IW=Ue(),tI=eI?eI.isConcatSpreadable:void 0;function TW(t){return IW(t)||SW(t)||!!(tI&&t&&t[tI])}nI.exports=TW});var tp=_((qre,rI)=>{"use strict";var EW=Uf(),PW=iI();function oI(t,n,e,i,o){var r=-1,a=t.length;for(e||(e=PW),o||(o=[]);++r<a;){var s=t[r];n>0&&e(s)?n>1?oI(s,n-1,e,i,o):EW(o,s):i||(o[o.length]=s)}return o}rI.exports=oI});var sI=_((Vre,aI)=>{"use strict";function MW(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}aI.exports=MW});var Rg=_((Gre,dI)=>{"use strict";var kW=sI(),cI=Math.max;function DW(t,n,e){return n=cI(n===void 0?t.length-1:n,0),function(){for(var i=arguments,o=-1,r=cI(i.length-n,0),a=Array(r);++o<r;)a[o]=i[n+o];o=-1;for(var s=Array(n+1);++o<n;)s[o]=i[o];return s[n]=e(a),kW(t,this,s)}}dI.exports=DW});var fI=_((Hre,uI)=>{"use strict";var OW=Kf(),lI=Gm(),NW=On(),RW=lI?function(t,n){return lI(t,"toString",{configurable:!0,enumerable:!1,value:OW(n),writable:!0})}:NW;uI.exports=RW});var hI=_((jre,pI)=>{"use strict";var AW=800,FW=16,LW=Date.now;function BW(t){var n=0,e=0;return function(){var i=LW(),o=FW-(i-e);if(e=i,o>0){if(++n>=AW)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}pI.exports=BW});var Ag=_((Ure,mI)=>{"use strict";var zW=fI(),qW=hI(),VW=qW(zW);mI.exports=VW});var zr=_((Wre,gI)=>{"use strict";var GW=On(),HW=Rg(),jW=Ag();function UW(t,n){return jW(HW(t,n,GW),t+"")}gI.exports=UW});var Fg=_(($re,_I)=>{"use strict";function WW(t,n,e,i){for(var o=t.length,r=e+(i?1:-1);i?r--:++r<o;)if(n(t[r],r,t))return r;return-1}_I.exports=WW});var vI=_((Kre,yI)=>{"use strict";function $W(t){return t!==t}yI.exports=$W});var xI=_((Yre,CI)=>{"use strict";function KW(t,n,e){for(var i=e-1,o=t.length;++i<o;)if(t[i]===n)return i;return-1}CI.exports=KW});var wI=_((Xre,bI)=>{"use strict";var YW=Fg(),XW=vI(),ZW=xI();function QW(t,n,e){return n===n?ZW(t,n,e):YW(t,XW,e)}bI.exports=QW});var II=_((Zre,SI)=>{"use strict";var JW=wI();function e6(t,n){var e=t==null?0:t.length;return!!e&&JW(t,n,0)>-1}SI.exports=e6});var EI=_((Qre,TI)=>{"use strict";function t6(t,n,e){for(var i=-1,o=t==null?0:t.length;++i<o;)if(e(n,t[i]))return!0;return!1}TI.exports=t6});var MI=_((Jre,PI)=>{"use strict";function n6(){}PI.exports=n6});var DI=_((eae,kI)=>{"use strict";var Lg=Jm(),i6=MI(),o6=Qf(),r6=1/0,a6=Lg&&1/o6(new Lg([,-0]))[1]==r6?function(t){return new Lg(t)}:i6;kI.exports=a6});var NI=_((tae,OI)=>{"use strict";var s6=pg(),c6=II(),d6=EI(),l6=hg(),u6=DI(),f6=Qf(),p6=200;function h6(t,n,e){var i=-1,o=c6,r=t.length,a=!0,s=[],c=s;if(e)a=!1,o=d6;else if(r>=p6){var d=n?null:u6(t);if(d)return f6(d);a=!1,o=l6,c=new s6}else c=n?[]:s;e:for(;++i<r;){var f=t[i],h=n?n(f):f;if(f=e||f!==0?f:0,a&&h===h){for(var v=c.length;v--;)if(c[v]===h)continue e;n&&c.push(h),s.push(f)}else o(c,h,e)||(c!==s&&c.push(h),s.push(f))}return s}OI.exports=h6});var Bg=_((nae,RI)=>{"use strict";var m6=jt(),g6=Ft();function _6(t){return g6(t)&&m6(t)}RI.exports=_6});var FI=_((iae,AI)=>{"use strict";var y6=tp(),v6=zr(),C6=NI(),x6=Bg(),b6=v6(function(t){return C6(y6(t,1,x6,!0))});AI.exports=b6});var BI=_((oae,LI)=>{"use strict";var w6=Fr();function S6(t,n){return w6(n,function(e){return t[e]})}LI.exports=S6});var zg=_((rae,zI)=>{"use strict";var I6=BI(),T6=nn();function E6(t){return t==null?[]:I6(t,T6(t))}zI.exports=E6});var xt=_((aae,qI)=>{"use strict";var np;if(typeof Ci=="function")try{np={clone:zb(),constant:Kf(),each:fg(),filter:Tg(),has:Eg(),isArray:Ue(),isEmpty:SS(),isFunction:co(),isUndefined:Pg(),keys:nn(),map:kg(),reduce:Dg(),size:ZS(),transform:JS(),union:FI(),values:zg()}}catch{}np||(np=window._);qI.exports=np});var ip=_((cae,jI)=>{"use strict";var oe=xt();jI.exports=le;var P6="\0",pi="\0",VI="";function le(t){this._isDirected=oe.has(t,"directed")?t.directed:!0,this._isMultigraph=oe.has(t,"multigraph")?t.multigraph:!1,this._isCompound=oe.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=oe.constant(void 0),this._defaultEdgeLabelFn=oe.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[pi]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}le.prototype._nodeCount=0;le.prototype._edgeCount=0;le.prototype.isDirected=function(){return this._isDirected};le.prototype.isMultigraph=function(){return this._isMultigraph};le.prototype.isCompound=function(){return this._isCompound};le.prototype.setGraph=function(t){return this._label=t,this};le.prototype.graph=function(){return this._label};le.prototype.setDefaultNodeLabel=function(t){return oe.isFunction(t)||(t=oe.constant(t)),this._defaultNodeLabelFn=t,this};le.prototype.nodeCount=function(){return this._nodeCount};le.prototype.nodes=function(){return oe.keys(this._nodes)};le.prototype.sources=function(){var t=this;return oe.filter(this.nodes(),function(n){return oe.isEmpty(t._in[n])})};le.prototype.sinks=function(){var t=this;return oe.filter(this.nodes(),function(n){return oe.isEmpty(t._out[n])})};le.prototype.setNodes=function(t,n){var e=arguments,i=this;return oe.each(t,function(o){e.length>1?i.setNode(o,n):i.setNode(o)}),this};le.prototype.setNode=function(t,n){return oe.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=pi,this._children[t]={},this._children[pi][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};le.prototype.node=function(t){return this._nodes[t]};le.prototype.hasNode=function(t){return oe.has(this._nodes,t)};le.prototype.removeNode=function(t){var n=this;if(oe.has(this._nodes,t)){var e=function(i){n.removeEdge(n._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],oe.each(this.children(t),function(i){n.setParent(i)}),delete this._children[t]),oe.each(oe.keys(this._in[t]),e),delete this._in[t],delete this._preds[t],oe.each(oe.keys(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};le.prototype.setParent=function(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(oe.isUndefined(n))n=pi;else{n+="";for(var e=n;!oe.isUndefined(e);e=this.parent(e))if(e===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this};le.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};le.prototype.parent=function(t){if(this._isCompound){var n=this._parent[t];if(n!==pi)return n}};le.prototype.children=function(t){if(oe.isUndefined(t)&&(t=pi),this._isCompound){var n=this._children[t];if(n)return oe.keys(n)}else{if(t===pi)return this.nodes();if(this.hasNode(t))return[]}};le.prototype.predecessors=function(t){var n=this._preds[t];if(n)return oe.keys(n)};le.prototype.successors=function(t){var n=this._sucs[t];if(n)return oe.keys(n)};le.prototype.neighbors=function(t){var n=this.predecessors(t);if(n)return oe.union(n,this.successors(t))};le.prototype.isLeaf=function(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0};le.prototype.filterNodes=function(t){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var e=this;oe.each(this._nodes,function(r,a){t(a)&&n.setNode(a,r)}),oe.each(this._edgeObjs,function(r){n.hasNode(r.v)&&n.hasNode(r.w)&&n.setEdge(r,e.edge(r))});var i={};function o(r){var a=e.parent(r);return a===void 0||n.hasNode(a)?(i[r]=a,a):a in i?i[a]:o(a)}return this._isCompound&&oe.each(n.nodes(),function(r){n.setParent(r,o(r))}),n};le.prototype.setDefaultEdgeLabel=function(t){return oe.isFunction(t)||(t=oe.constant(t)),this._defaultEdgeLabelFn=t,this};le.prototype.edgeCount=function(){return this._edgeCount};le.prototype.edges=function(){return oe.values(this._edgeObjs)};le.prototype.setPath=function(t,n){var e=this,i=arguments;return oe.reduce(t,function(o,r){return i.length>1?e.setEdge(o,r,n):e.setEdge(o,r),r}),this};le.prototype.setEdge=function(){var t,n,e,i,o=!1,r=arguments[0];typeof r=="object"&&r!==null&&"v"in r?(t=r.v,n=r.w,e=r.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=r,n=arguments[1],e=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,oe.isUndefined(e)||(e=""+e);var a=qr(this._isDirected,t,n,e);if(oe.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=i),this;if(!oe.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),this._edgeLabels[a]=o?i:this._defaultEdgeLabelFn(t,n,e);var s=M6(this._isDirected,t,n,e);return t=s.v,n=s.w,Object.freeze(s),this._edgeObjs[a]=s,GI(this._preds[n],t),GI(this._sucs[t],n),this._in[n][a]=s,this._out[t][a]=s,this._edgeCount++,this};le.prototype.edge=function(t,n,e){var i=arguments.length===1?qg(this._isDirected,arguments[0]):qr(this._isDirected,t,n,e);return this._edgeLabels[i]};le.prototype.hasEdge=function(t,n,e){var i=arguments.length===1?qg(this._isDirected,arguments[0]):qr(this._isDirected,t,n,e);return oe.has(this._edgeLabels,i)};le.prototype.removeEdge=function(t,n,e){var i=arguments.length===1?qg(this._isDirected,arguments[0]):qr(this._isDirected,t,n,e),o=this._edgeObjs[i];return o&&(t=o.v,n=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],HI(this._preds[n],t),HI(this._sucs[t],n),delete this._in[n][i],delete this._out[t][i],this._edgeCount--),this};le.prototype.inEdges=function(t,n){var e=this._in[t];if(e){var i=oe.values(e);return n?oe.filter(i,function(o){return o.v===n}):i}};le.prototype.outEdges=function(t,n){var e=this._out[t];if(e){var i=oe.values(e);return n?oe.filter(i,function(o){return o.w===n}):i}};le.prototype.nodeEdges=function(t,n){var e=this.inEdges(t,n);if(e)return e.concat(this.outEdges(t,n))};function GI(t,n){t[n]?t[n]++:t[n]=1}function HI(t,n){--t[n]||delete t[n]}function qr(t,n,e,i){var o=""+n,r=""+e;if(!t&&o>r){var a=o;o=r,r=a}return o+VI+r+VI+(oe.isUndefined(i)?P6:i)}function M6(t,n,e,i){var o=""+n,r=""+e;if(!t&&o>r){var a=o;o=r,r=a}var s={v:o,w:r};return i&&(s.name=i),s}function qg(t,n){return qr(t,n.v,n.w,n.name)}});var WI=_((dae,UI)=>{"use strict";UI.exports="2.1.8"});var KI=_((lae,$I)=>{"use strict";$I.exports={Graph:ip(),version:WI()}});var XI=_((uae,YI)=>{"use strict";var Wt=xt(),k6=ip();YI.exports={write:D6,read:R6};function D6(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:O6(t),edges:N6(t)};return Wt.isUndefined(t.graph())||(n.value=Wt.clone(t.graph())),n}function O6(t){return Wt.map(t.nodes(),function(n){var e=t.node(n),i=t.parent(n),o={v:n};return Wt.isUndefined(e)||(o.value=e),Wt.isUndefined(i)||(o.parent=i),o})}function N6(t){return Wt.map(t.edges(),function(n){var e=t.edge(n),i={v:n.v,w:n.w};return Wt.isUndefined(n.name)||(i.name=n.name),Wt.isUndefined(e)||(i.value=e),i})}function R6(t){var n=new k6(t.options).setGraph(t.value);return Wt.each(t.nodes,function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)}),Wt.each(t.edges,function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),n}});var QI=_((fae,ZI)=>{"use strict";var op=xt();ZI.exports=A6;function A6(t){var n={},e=[],i;function o(r){op.has(n,r)||(n[r]=!0,i.push(r),op.each(t.successors(r),o),op.each(t.predecessors(r),o))}return op.each(t.nodes(),function(r){i=[],o(r),i.length&&e.push(i)}),e}});var Vg=_((pae,e1)=>{"use strict";var JI=xt();e1.exports=Mt;function Mt(){this._arr=[],this._keyIndices={}}Mt.prototype.size=function(){return this._arr.length};Mt.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Mt.prototype.has=function(t){return JI.has(this._keyIndices,t)};Mt.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority};Mt.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Mt.prototype.add=function(t,n){var e=this._keyIndices;if(t=String(t),!JI.has(e,t)){var i=this._arr,o=i.length;return e[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1};Mt.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Mt.prototype.decrease=function(t,n){var e=this._keyIndices[t];if(n>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[e].priority+" New: "+n);this._arr[e].priority=n,this._decrease(e)};Mt.prototype._heapify=function(t){var n=this._arr,e=2*t,i=e+1,o=t;e<n.length&&(o=n[e].priority<n[o].priority?e:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))};Mt.prototype._decrease=function(t){for(var n=this._arr,e=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<e));)this._swap(t,i),t=i};Mt.prototype._swap=function(t,n){var e=this._arr,i=this._keyIndices,o=e[t],r=e[n];e[t]=r,e[n]=o,i[r.key]=t,i[o.key]=n}});var Gg=_((hae,t1)=>{"use strict";var F6=xt(),L6=Vg();t1.exports=z6;var B6=F6.constant(1);function z6(t,n,e,i){return q6(t,String(n),e||B6,i||function(o){return t.outEdges(o)})}function q6(t,n,e,i){var o={},r=new L6,a,s,c=function(d){var f=d.v!==a?d.v:d.w,h=o[f],v=e(d),b=s.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+d+" Weight: "+v);b<h.distance&&(h.distance=b,h.predecessor=a,r.decrease(f,b))};for(t.nodes().forEach(function(d){var f=d===n?0:Number.POSITIVE_INFINITY;o[d]={distance:f},r.add(d,f)});r.size()>0&&(a=r.removeMin(),s=o[a],s.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return o}});var i1=_((mae,n1)=>{"use strict";var V6=Gg(),G6=xt();n1.exports=H6;function H6(t,n,e){return G6.transform(t.nodes(),function(i,o){i[o]=V6(t,o,n,e)},{})}});var Hg=_((gae,r1)=>{"use strict";var o1=xt();r1.exports=j6;function j6(t){var n=0,e=[],i={},o=[];function r(a){var s=i[a]={onStack:!0,lowlink:n,index:n++};if(e.push(a),t.successors(a).forEach(function(f){o1.has(i,f)?i[f].onStack&&(s.lowlink=Math.min(s.lowlink,i[f].index)):(r(f),s.lowlink=Math.min(s.lowlink,i[f].lowlink))}),s.lowlink===s.index){var c=[],d;do d=e.pop(),i[d].onStack=!1,c.push(d);while(a!==d);o.push(c)}}return t.nodes().forEach(function(a){o1.has(i,a)||r(a)}),o}});var s1=_((_ae,a1)=>{"use strict";var U6=xt(),W6=Hg();a1.exports=$6;function $6(t){return U6.filter(W6(t),function(n){return n.length>1||n.length===1&&t.hasEdge(n[0],n[0])})}});var d1=_((yae,c1)=>{"use strict";var K6=xt();c1.exports=X6;var Y6=K6.constant(1);function X6(t,n,e){return Z6(t,n||Y6,e||function(i){return t.outEdges(i)})}function Z6(t,n,e){var i={},o=t.nodes();return o.forEach(function(r){i[r]={},i[r][r]={distance:0},o.forEach(function(a){r!==a&&(i[r][a]={distance:Number.POSITIVE_INFINITY})}),e(r).forEach(function(a){var s=a.v===r?a.w:a.v,c=n(a);i[r][s]={distance:c,predecessor:r}})}),o.forEach(function(r){var a=i[r];o.forEach(function(s){var c=i[s];o.forEach(function(d){var f=c[r],h=a[d],v=c[d],b=f.distance+h.distance;b<v.distance&&(v.distance=b,v.predecessor=h.predecessor)})})}),i}});var jg=_((vae,u1)=>{"use strict";var Vr=xt();u1.exports=l1;l1.CycleException=rp;function l1(t){var n={},e={},i=[];function o(r){if(Vr.has(e,r))throw new rp;Vr.has(n,r)||(e[r]=!0,n[r]=!0,Vr.each(t.predecessors(r),o),delete e[r],i.push(r))}if(Vr.each(t.sinks(),o),Vr.size(n)!==t.nodeCount())throw new rp;return i}function rp(){}rp.prototype=new Error});var h1=_((Cae,p1)=>{"use strict";var f1=jg();p1.exports=Q6;function Q6(t){try{f1(t)}catch(n){if(n instanceof f1.CycleException)return!1;throw n}return!0}});var Ug=_((xae,g1)=>{"use strict";var ap=xt();g1.exports=J6;function J6(t,n,e){ap.isArray(n)||(n=[n]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),o=[],r={};return ap.each(n,function(a){if(!t.hasNode(a))throw new Error("Graph does not have node: "+a);m1(t,a,e==="post",r,i,o)}),o}function m1(t,n,e,i,o,r){ap.has(i,n)||(i[n]=!0,e||r.push(n),ap.each(o(n),function(a){m1(t,a,e,i,o,r)}),e&&r.push(n))}});var y1=_((bae,_1)=>{"use strict";var e$=Ug();_1.exports=t$;function t$(t,n){return e$(t,n,"post")}});var C1=_((wae,v1)=>{"use strict";var n$=Ug();v1.exports=i$;function i$(t,n){return n$(t,n,"pre")}});var w1=_((Sae,b1)=>{"use strict";var x1=xt(),o$=ip(),r$=Vg();b1.exports=a$;function a$(t,n){var e=new o$,i={},o=new r$,r;function a(c){var d=c.v===r?c.w:c.v,f=o.priority(d);if(f!==void 0){var h=n(c);h<f&&(i[d]=r,o.decrease(d,h))}}if(t.nodeCount()===0)return e;x1.each(t.nodes(),function(c){o.add(c,Number.POSITIVE_INFINITY),e.setNode(c)}),o.decrease(t.nodes()[0],0);for(var s=!1;o.size()>0;){if(r=o.removeMin(),x1.has(i,r))e.setEdge(r,i[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return e}});var I1=_((Iae,S1)=>{"use strict";S1.exports={components:QI(),dijkstra:Gg(),dijkstraAll:i1(),findCycles:s1(),floydWarshall:d1(),isAcyclic:h1(),postorder:y1(),preorder:C1(),prim:w1(),tarjan:Hg(),topsort:jg()}});var P1=_((Tae,E1)=>{"use strict";var T1=KI();E1.exports={Graph:T1.Graph,json:XI(),alg:I1(),version:T1.version}});var kt=_((Eae,M1)=>{"use strict";var sp;if(typeof Ci=="function")try{sp=P1()}catch{}sp||(sp=window.graphlib);M1.exports=sp});var D1=_((Mae,k1)=>{"use strict";var s$=dg(),c$=1,d$=4;function l$(t){return s$(t,c$|d$)}k1.exports=l$});var Gr=_((kae,O1)=>{"use strict";var u$=si(),f$=jt(),p$=Pr(),h$=Ct();function m$(t,n,e){if(!h$(e))return!1;var i=typeof n;return(i=="number"?f$(e)&&p$(n,e.length):i=="string"&&n in e)?u$(e[n],t):!1}O1.exports=m$});var A1=_((Dae,R1)=>{"use strict";var g$=zr(),_$=si(),y$=Gr(),v$=Dn(),N1=Object.prototype,C$=N1.hasOwnProperty,x$=g$(function(t,n){t=Object(t);var e=-1,i=n.length,o=i>2?n[2]:void 0;for(o&&y$(n[0],n[1],o)&&(i=1);++e<i;)for(var r=n[e],a=v$(r),s=-1,c=a.length;++s<c;){var d=a[s],f=t[d];(f===void 0||_$(f,N1[d])&&!C$.call(t,d))&&(t[d]=r[d])}return t});R1.exports=x$});var L1=_((Oae,F1)=>{"use strict";var b$=Ut(),w$=jt(),S$=nn();function I$(t){return function(n,e,i){var o=Object(n);if(!w$(n)){var r=b$(e,3);n=S$(n),e=function(s){return r(o[s],s,o)}}var a=t(n,e,i);return a>-1?o[r?n[a]:a]:void 0}}F1.exports=I$});var z1=_((Nae,B1)=>{"use strict";var T$=/\s/;function E$(t){for(var n=t.length;n--&&T$.test(t.charAt(n)););return n}B1.exports=E$});var V1=_((Rae,q1)=>{"use strict";var P$=z1(),M$=/^\s+/;function k$(t){return t&&t.slice(0,P$(t)+1).replace(M$,"")}q1.exports=k$});var U1=_((Aae,j1)=>{"use strict";var D$=V1(),G1=Ct(),O$=fi(),H1=NaN,N$=/^[-+]0x[0-9a-f]+$/i,R$=/^0b[01]+$/i,A$=/^0o[0-7]+$/i,F$=parseInt;function L$(t){if(typeof t=="number")return t;if(O$(t))return H1;if(G1(t)){var n=typeof t.valueOf=="function"?t.valueOf():t;t=G1(n)?n+"":n}if(typeof t!="string")return t===0?t:+t;t=D$(t);var e=R$.test(t);return e||A$.test(t)?F$(t.slice(2),e?2:8):N$.test(t)?H1:+t}j1.exports=L$});var Wg=_((Fae,$1)=>{"use strict";var B$=U1(),W1=1/0,z$=17976931348623157e292;function q$(t){if(!t)return t===0?t:0;if(t=B$(t),t===W1||t===-W1){var n=t<0?-1:1;return n*z$}return t===t?t:0}$1.exports=q$});var Y1=_((Lae,K1)=>{"use strict";var V$=Wg();function G$(t){var n=V$(t),e=n%1;return n===n?e?n-e:n:0}K1.exports=G$});var Z1=_((Bae,X1)=>{"use strict";var H$=Fg(),j$=Ut(),U$=Y1(),W$=Math.max;function $$(t,n,e){var i=t==null?0:t.length;if(!i)return-1;var o=e==null?0:U$(e);return o<0&&(o=W$(i+o,0)),H$(t,j$(n,3),o)}X1.exports=$$});var J1=_((zae,Q1)=>{"use strict";var K$=L1(),Y$=Z1(),X$=K$(Y$);Q1.exports=X$});var $g=_((qae,eT)=>{"use strict";var Z$=tp();function Q$(t){var n=t==null?0:t.length;return n?Z$(t,1):[]}eT.exports=Q$});var nT=_((Vae,tT)=>{"use strict";var J$=Yf(),e8=lg(),t8=Dn();function n8(t,n){return t==null?t:J$(t,e8(n),t8)}tT.exports=n8});var oT=_((Gae,iT)=>{"use strict";function i8(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}iT.exports=i8});var aT=_((Hae,rT)=>{"use strict";var o8=Ir(),r8=Xf(),a8=Ut();function s8(t,n){var e={};return n=a8(n,3),r8(t,function(i,o,r){o8(e,o,n(i,o,r))}),e}rT.exports=s8});var cp=_((jae,sT)=>{"use strict";var c8=fi();function d8(t,n,e){for(var i=-1,o=t.length;++i<o;){var r=t[i],a=n(r);if(a!=null&&(s===void 0?a===a&&!c8(a):e(a,s)))var s=a,c=r}return c}sT.exports=d8});var dT=_((Uae,cT)=>{"use strict";function l8(t,n){return t>n}cT.exports=l8});var uT=_((Wae,lT)=>{"use strict";var u8=cp(),f8=dT(),p8=On();function h8(t){return t&&t.length?u8(t,p8,f8):void 0}lT.exports=h8});var Kg=_(($ae,fT)=>{"use strict";var m8=Ir(),g8=si();function _8(t,n,e){(e!==void 0&&!g8(t[n],e)||e===void 0&&!(n in t))&&m8(t,n,e)}fT.exports=_8});var mT=_((Kae,hT)=>{"use strict";var y8=Mn(),v8=Rr(),C8=Ft(),x8="[object Object]",b8=Function.prototype,w8=Object.prototype,pT=b8.toString,S8=w8.hasOwnProperty,I8=pT.call(Object);function T8(t){if(!C8(t)||y8(t)!=x8)return!1;var n=v8(t);if(n===null)return!0;var e=S8.call(n,"constructor")&&n.constructor;return typeof e=="function"&&e instanceof e&&pT.call(e)==I8}hT.exports=T8});var Yg=_((Yae,gT)=>{"use strict";function E8(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}gT.exports=E8});var yT=_((Xae,_T)=>{"use strict";var P8=po(),M8=Dn();function k8(t){return P8(t,M8(t))}_T.exports=k8});var ST=_((Zae,wT)=>{"use strict";var vT=Kg(),D8=Wm(),O8=ag(),N8=$m(),R8=cg(),CT=ho(),xT=Ue(),A8=Bg(),F8=di(),L8=co(),B8=Ct(),z8=mT(),q8=_o(),bT=Yg(),V8=yT();function G8(t,n,e,i,o,r,a){var s=bT(t,e),c=bT(n,e),d=a.get(c);if(d){vT(t,e,d);return}var f=r?r(s,c,e+"",t,n,a):void 0,h=f===void 0;if(h){var v=xT(c),b=!v&&F8(c),w=!v&&!b&&q8(c);f=c,v||b||w?xT(s)?f=s:A8(s)?f=N8(s):b?(h=!1,f=D8(c,!0)):w?(h=!1,f=O8(c,!0)):f=[]:z8(c)||CT(c)?(f=s,CT(s)?f=V8(s):(!B8(s)||L8(s))&&(f=R8(c))):h=!1}h&&(a.set(c,f),o(f,c,i,r,a),a.delete(c)),vT(t,e,f)}wT.exports=G8});var ET=_((Qae,TT)=>{"use strict";var H8=Sr(),j8=Kg(),U8=Yf(),W8=ST(),$8=Ct(),K8=Dn(),Y8=Yg();function IT(t,n,e,i,o){t!==n&&U8(n,function(r,a){if(o||(o=new H8),$8(r))W8(t,n,a,e,IT,i,o);else{var s=i?i(Y8(t,a),r,a+"",t,n,o):void 0;s===void 0&&(s=r),j8(t,a,s)}},K8)}TT.exports=IT});var MT=_((Jae,PT)=>{"use strict";var X8=zr(),Z8=Gr();function Q8(t){return X8(function(n,e){var i=-1,o=e.length,r=o>1?e[o-1]:void 0,a=o>2?e[2]:void 0;for(r=t.length>3&&typeof r=="function"?(o--,r):void 0,a&&Z8(e[0],e[1],a)&&(r=o<3?void 0:r,o=1),n=Object(n);++i<o;){var s=e[i];s&&t(n,s,i,r)}return n})}PT.exports=Q8});var DT=_((ese,kT)=>{"use strict";var J8=ET(),e7=MT(),t7=e7(function(t,n,e){J8(t,n,e)});kT.exports=t7});var Xg=_((tse,OT)=>{"use strict";function n7(t,n){return t<n}OT.exports=n7});var RT=_((nse,NT)=>{"use strict";var i7=cp(),o7=Xg(),r7=On();function a7(t){return t&&t.length?i7(t,r7,o7):void 0}NT.exports=a7});var FT=_((ise,AT)=>{"use strict";var s7=cp(),c7=Ut(),d7=Xg();function l7(t,n){return t&&t.length?s7(t,c7(n,2),d7):void 0}AT.exports=l7});var BT=_((ose,LT)=>{"use strict";var u7=Pt(),f7=function(){return u7.Date.now()};LT.exports=f7});var VT=_((rse,qT)=>{"use strict";var p7=Tr(),h7=Lr(),m7=Pr(),zT=Ct(),g7=Co();function _7(t,n,e,i){if(!zT(t))return t;n=h7(n,t);for(var o=-1,r=n.length,a=r-1,s=t;s!=null&&++o<r;){var c=g7(n[o]),d=e;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(o!=a){var f=s[c];d=i?i(f,c,s):void 0,d===void 0&&(d=zT(f)?f:m7(n[o+1])?[]:{})}p7(s,c,d),s=s[c]}return t}qT.exports=_7});var HT=_((ase,GT)=>{"use strict";var y7=Br(),v7=VT(),C7=Lr();function x7(t,n,e){for(var i=-1,o=n.length,r={};++i<o;){var a=n[i],s=y7(t,a);e(s,a)&&v7(r,C7(a,t),s)}return r}GT.exports=x7});var UT=_((sse,jT)=>{"use strict";var b7=HT(),w7=Sg();function S7(t,n){return b7(t,n,function(e,i){return w7(t,i)})}jT.exports=S7});var $T=_((cse,WT)=>{"use strict";var I7=$g(),T7=Rg(),E7=Ag();function P7(t){return E7(T7(t,void 0,I7),t+"")}WT.exports=P7});var YT=_((dse,KT)=>{"use strict";var M7=UT(),k7=$T(),D7=k7(function(t,n){return t==null?{}:M7(t,n)});KT.exports=D7});var ZT=_((lse,XT)=>{"use strict";var O7=Math.ceil,N7=Math.max;function R7(t,n,e,i){for(var o=-1,r=N7(O7((n-t)/(e||1)),0),a=Array(r);r--;)a[i?r:++o]=t,t+=e;return a}XT.exports=R7});var JT=_((use,QT)=>{"use strict";var A7=ZT(),F7=Gr(),Zg=Wg();function L7(t){return function(n,e,i){return i&&typeof i!="number"&&F7(n,e,i)&&(e=i=void 0),n=Zg(n),e===void 0?(e=n,n=0):e=Zg(e),i=i===void 0?n<e?1:-1:Zg(i),A7(n,e,i,t)}}QT.exports=L7});var tE=_((fse,eE)=>{"use strict";var B7=JT(),z7=B7();eE.exports=z7});var iE=_((pse,nE)=>{"use strict";function q7(t,n){var e=t.length;for(t.sort(n);e--;)t[e]=t[e].value;return t}nE.exports=q7});var aE=_((hse,rE)=>{"use strict";var oE=fi();function V7(t,n){if(t!==n){var e=t!==void 0,i=t===null,o=t===t,r=oE(t),a=n!==void 0,s=n===null,c=n===n,d=oE(n);if(!s&&!d&&!r&&t>n||r&&a&&c&&!s&&!d||i&&a&&c||!e&&c||!o)return 1;if(!i&&!r&&!d&&t<n||d&&e&&o&&!i&&!r||s&&e&&o||!a&&o||!c)return-1}return 0}rE.exports=V7});var cE=_((mse,sE)=>{"use strict";var G7=aE();function H7(t,n,e){for(var i=-1,o=t.criteria,r=n.criteria,a=o.length,s=e.length;++i<a;){var c=G7(o[i],r[i]);if(c){if(i>=s)return c;var d=e[i];return c*(d=="desc"?-1:1)}}return t.index-n.index}sE.exports=H7});var lE=_((gse,dE)=>{"use strict";var Qg=Fr(),j7=Br(),U7=Ut(),W7=Mg(),$7=iE(),K7=Mr(),Y7=cE(),X7=On(),Z7=Ue();function Q7(t,n,e){n.length?n=Qg(n,function(r){return Z7(r)?function(a){return j7(a,r.length===1?r[0]:r)}:r}):n=[X7];var i=-1;n=Qg(n,K7(U7));var o=W7(t,function(r,a,s){var c=Qg(n,function(d){return d(r)});return{criteria:c,index:++i,value:r}});return $7(o,function(r,a){return Y7(r,a,e)})}dE.exports=Q7});var pE=_((_se,fE)=>{"use strict";var J7=tp(),eK=lE(),tK=zr(),uE=Gr(),nK=tK(function(t,n){if(t==null)return[];var e=n.length;return e>1&&uE(t,n[0],n[1])?n=[]:e>2&&uE(n[0],n[1],n[2])&&(n=[n[0]]),eK(t,J7(n,1),[])});fE.exports=nK});var mE=_((yse,hE)=>{"use strict";var iK=bg(),oK=0;function rK(t){var n=++oK;return iK(t)+n}hE.exports=rK});var _E=_((vse,gE)=>{"use strict";function aK(t,n,e){for(var i=-1,o=t.length,r=n.length,a={};++i<o;){var s=i<r?n[i]:void 0;e(a,t[i],s)}return a}gE.exports=aK});var vE=_((Cse,yE)=>{"use strict";var sK=Tr(),cK=_E();function dK(t,n){return cK(t||[],n||[],sK)}yE.exports=dK});var Re=_((xse,CE)=>{"use strict";var dp;if(typeof Ci=="function")try{dp={cloneDeep:D1(),constant:Kf(),defaults:A1(),each:fg(),filter:Tg(),find:J1(),flatten:$g(),forEach:ug(),forIn:nT(),has:Eg(),isUndefined:Pg(),last:oT(),map:kg(),mapValues:aT(),max:uT(),merge:DT(),min:RT(),minBy:FT(),now:BT(),pick:YT(),range:tE(),reduce:Dg(),sortBy:pE(),uniqueId:mE(),values:zg(),zipObject:vE()}}catch{}dp||(dp=window._);CE.exports=dp});var wE=_((wse,bE)=>{"use strict";bE.exports=lp;function lp(){var t={};t._next=t._prev=t,this._sentinel=t}lp.prototype.dequeue=function(){var t=this._sentinel,n=t._prev;if(n!==t)return xE(n),n};lp.prototype.enqueue=function(t){var n=this._sentinel;t._prev&&t._next&&xE(t),t._next=n._next,n._next._prev=t,n._next=t,t._prev=n};lp.prototype.toString=function(){for(var t=[],n=this._sentinel,e=n._prev;e!==n;)t.push(JSON.stringify(e,lK)),e=e._prev;return"["+t.join(", ")+"]"};function xE(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function lK(t,n){if(t!=="_next"&&t!=="_prev")return n}});var IE=_((Sse,SE)=>{"use strict";var on=Re(),uK=kt().Graph,fK=wE();SE.exports=hK;var pK=on.constant(1);function hK(t,n){if(t.nodeCount()<=1)return[];var e=gK(t,n||pK),i=mK(e.graph,e.buckets,e.zeroIdx);return on.flatten(on.map(i,function(o){return t.outEdges(o.v,o.w)}),!0)}function mK(t,n,e){for(var i=[],o=n[n.length-1],r=n[0],a;t.nodeCount();){for(;a=r.dequeue();)Jg(t,n,e,a);for(;a=o.dequeue();)Jg(t,n,e,a);if(t.nodeCount()){for(var s=n.length-2;s>0;--s)if(a=n[s].dequeue(),a){i=i.concat(Jg(t,n,e,a,!0));break}}}return i}function Jg(t,n,e,i,o){var r=o?[]:void 0;return on.forEach(t.inEdges(i.v),function(a){var s=t.edge(a),c=t.node(a.v);o&&r.push({v:a.v,w:a.w}),c.out-=s,e_(n,e,c)}),on.forEach(t.outEdges(i.v),function(a){var s=t.edge(a),c=a.w,d=t.node(c);d.in-=s,e_(n,e,d)}),t.removeNode(i.v),r}function gK(t,n){var e=new uK,i=0,o=0;on.forEach(t.nodes(),function(s){e.setNode(s,{v:s,in:0,out:0})}),on.forEach(t.edges(),function(s){var c=e.edge(s.v,s.w)||0,d=n(s),f=c+d;e.setEdge(s.v,s.w,f),o=Math.max(o,e.node(s.v).out+=d),i=Math.max(i,e.node(s.w).in+=d)});var r=on.range(o+i+3).map(function(){return new fK}),a=i+1;return on.forEach(e.nodes(),function(s){e_(r,a,e.node(s))}),{graph:e,buckets:r,zeroIdx:a}}function e_(t,n,e){e.out?e.in?t[e.out-e.in+n].enqueue(e):t[t.length-1].enqueue(e):t[0].enqueue(e)}});var EE=_((Ise,TE)=>{"use strict";var hi=Re(),_K=IE();TE.exports={run:yK,undo:CK};function yK(t){var n=t.graph().acyclicer==="greedy"?_K(t,e(t)):vK(t);hi.forEach(n,function(i){var o=t.edge(i);t.removeEdge(i),o.forwardName=i.name,o.reversed=!0,t.setEdge(i.w,i.v,o,hi.uniqueId("rev"))});function e(i){return function(o){return i.edge(o).weight}}}function vK(t){var n=[],e={},i={};function o(r){hi.has(i,r)||(i[r]=!0,e[r]=!0,hi.forEach(t.outEdges(r),function(a){hi.has(e,a.w)?n.push(a):o(a.w)}),delete e[r])}return hi.forEach(t.nodes(),o),n}function CK(t){hi.forEach(t.edges(),function(n){var e=t.edge(n);if(e.reversed){t.removeEdge(n);var i=e.forwardName;delete e.reversed,delete e.forwardName,t.setEdge(n.w,n.v,e,i)}})}});var dt=_((Tse,DE)=>{"use strict";var ge=Re(),PE=kt().Graph;DE.exports={addDummyNode:ME,simplify:xK,asNonCompoundGraph:bK,successorWeights:wK,predecessorWeights:SK,intersectRect:IK,buildLayerMatrix:TK,normalizeRanks:EK,removeEmptyRanks:PK,addBorderNode:MK,maxRank:kE,partition:kK,time:DK,notime:OK};function ME(t,n,e,i){var o;do o=ge.uniqueId(i);while(t.hasNode(o));return e.dummy=n,t.setNode(o,e),o}function xK(t){var n=new PE().setGraph(t.graph());return ge.forEach(t.nodes(),function(e){n.setNode(e,t.node(e))}),ge.forEach(t.edges(),function(e){var i=n.edge(e.v,e.w)||{weight:0,minlen:1},o=t.edge(e);n.setEdge(e.v,e.w,{weight:i.weight+o.weight,minlen:Math.max(i.minlen,o.minlen)})}),n}function bK(t){var n=new PE({multigraph:t.isMultigraph()}).setGraph(t.graph());return ge.forEach(t.nodes(),function(e){t.children(e).length||n.setNode(e,t.node(e))}),ge.forEach(t.edges(),function(e){n.setEdge(e,t.edge(e))}),n}function wK(t){var n=ge.map(t.nodes(),function(e){var i={};return ge.forEach(t.outEdges(e),function(o){i[o.w]=(i[o.w]||0)+t.edge(o).weight}),i});return ge.zipObject(t.nodes(),n)}function SK(t){var n=ge.map(t.nodes(),function(e){var i={};return ge.forEach(t.inEdges(e),function(o){i[o.v]=(i[o.v]||0)+t.edge(o).weight}),i});return ge.zipObject(t.nodes(),n)}function IK(t,n){var e=t.x,i=t.y,o=n.x-e,r=n.y-i,a=t.width/2,s=t.height/2;if(!o&&!r)throw new Error("Not possible to find intersection inside of the rectangle");var c,d;return Math.abs(r)*a>Math.abs(o)*s?(r<0&&(s=-s),c=s*o/r,d=s):(o<0&&(a=-a),c=a,d=a*r/o),{x:e+c,y:i+d}}function TK(t){var n=ge.map(ge.range(kE(t)+1),function(){return[]});return ge.forEach(t.nodes(),function(e){var i=t.node(e),o=i.rank;ge.isUndefined(o)||(n[o][i.order]=e)}),n}function EK(t){var n=ge.min(ge.map(t.nodes(),function(e){return t.node(e).rank}));ge.forEach(t.nodes(),function(e){var i=t.node(e);ge.has(i,"rank")&&(i.rank-=n)})}function PK(t){var n=ge.min(ge.map(t.nodes(),function(r){return t.node(r).rank})),e=[];ge.forEach(t.nodes(),function(r){var a=t.node(r).rank-n;e[a]||(e[a]=[]),e[a].push(r)});var i=0,o=t.graph().nodeRankFactor;ge.forEach(e,function(r,a){ge.isUndefined(r)&&a%o!==0?--i:i&&ge.forEach(r,function(s){t.node(s).rank+=i})})}function MK(t,n,e,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=e,o.order=i),ME(t,"border",o,n)}function kE(t){return ge.max(ge.map(t.nodes(),function(n){var e=t.node(n).rank;if(!ge.isUndefined(e))return e}))}function kK(t,n){var e={lhs:[],rhs:[]};return ge.forEach(t,function(i){n(i)?e.lhs.push(i):e.rhs.push(i)}),e}function DK(t,n){var e=ge.now();try{return n()}finally{console.log(t+" time: "+(ge.now()-e)+"ms")}}function OK(t,n){return n()}});var RE=_((Ese,NE)=>{"use strict";var OE=Re(),NK=dt();NE.exports={run:RK,undo:FK};function RK(t){t.graph().dummyChains=[],OE.forEach(t.edges(),function(n){AK(t,n)})}function AK(t,n){var e=n.v,i=t.node(e).rank,o=n.w,r=t.node(o).rank,a=n.name,s=t.edge(n),c=s.labelRank;if(r!==i+1){t.removeEdge(n);var d,f,h;for(h=0,++i;i<r;++h,++i)s.points=[],f={width:0,height:0,edgeLabel:s,edgeObj:n,rank:i},d=NK.addDummyNode(t,"edge",f,"_d"),i===c&&(f.width=s.width,f.height=s.height,f.dummy="edge-label",f.labelpos=s.labelpos),t.setEdge(e,d,{weight:s.weight},a),h===0&&t.graph().dummyChains.push(d),e=d;t.setEdge(e,o,{weight:s.weight},a)}}function FK(t){OE.forEach(t.graph().dummyChains,function(n){var e=t.node(n),i=e.edgeLabel,o;for(t.setEdge(e.edgeObj,i);e.dummy;)o=t.successors(n)[0],t.removeNode(n),i.points.push({x:e.x,y:e.y}),e.dummy==="edge-label"&&(i.x=e.x,i.y=e.y,i.width=e.width,i.height=e.height),n=o,e=t.node(n)})}});var Hr=_((Pse,AE)=>{"use strict";var up=Re();AE.exports={longestPath:LK,slack:BK};function LK(t){var n={};function e(i){var o=t.node(i);if(up.has(n,i))return o.rank;n[i]=!0;var r=up.min(up.map(t.outEdges(i),function(a){return e(a.w)-t.edge(a).minlen}));return(r===Number.POSITIVE_INFINITY||r===void 0||r===null)&&(r=0),o.rank=r}up.forEach(t.sources(),e)}function BK(t,n){return t.node(n.w).rank-t.node(n.v).rank-t.edge(n).minlen}});var t_=_((Mse,FE)=>{"use strict";var fp=Re(),zK=kt().Graph,pp=Hr().slack;FE.exports=qK;function qK(t){var n=new zK({directed:!1}),e=t.nodes()[0],i=t.nodeCount();n.setNode(e,{});for(var o,r;VK(n,t)<i;)o=GK(n,t),r=n.hasNode(o.v)?pp(t,o):-pp(t,o),HK(n,t,r);return n}function VK(t,n){function e(i){fp.forEach(n.nodeEdges(i),function(o){var r=o.v,a=i===r?o.w:r;!t.hasNode(a)&&!pp(n,o)&&(t.setNode(a,{}),t.setEdge(i,a,{}),e(a))})}return fp.forEach(t.nodes(),e),t.nodeCount()}function GK(t,n){return fp.minBy(n.edges(),function(e){if(t.hasNode(e.v)!==t.hasNode(e.w))return pp(n,e)})}function HK(t,n,e){fp.forEach(t.nodes(),function(i){n.node(i).rank+=e})}});var jE=_((kse,HE)=>{"use strict";var rn=Re(),jK=t_(),UK=Hr().slack,WK=Hr().longestPath,$K=kt().alg.preorder,KK=kt().alg.postorder,YK=dt().simplify;HE.exports=mi;mi.initLowLimValues=i_;mi.initCutValues=n_;mi.calcCutValue=BE;mi.leaveEdge=qE;mi.enterEdge=VE;mi.exchangeEdges=GE;function mi(t){t=YK(t),WK(t);var n=jK(t);i_(n),n_(n,t);for(var e,i;e=qE(n);)i=VE(n,t,e),GE(n,t,e,i)}function n_(t,n){var e=KK(t,t.nodes());e=e.slice(0,e.length-1),rn.forEach(e,function(i){XK(t,n,i)})}function XK(t,n,e){var i=t.node(e),o=i.parent;t.edge(e,o).cutvalue=BE(t,n,e)}function BE(t,n,e){var i=t.node(e),o=i.parent,r=!0,a=n.edge(e,o),s=0;return a||(r=!1,a=n.edge(o,e)),s=a.weight,rn.forEach(n.nodeEdges(e),function(c){var d=c.v===e,f=d?c.w:c.v;if(f!==o){var h=d===r,v=n.edge(c).weight;if(s+=h?v:-v,QK(t,e,f)){var b=t.edge(e,f).cutvalue;s+=h?-b:b}}}),s}function i_(t,n){arguments.length<2&&(n=t.nodes()[0]),zE(t,{},1,n)}function zE(t,n,e,i,o){var r=e,a=t.node(i);return n[i]=!0,rn.forEach(t.neighbors(i),function(s){rn.has(n,s)||(e=zE(t,n,e,s,i))}),a.low=r,a.lim=e++,o?a.parent=o:delete a.parent,e}function qE(t){return rn.find(t.edges(),function(n){return t.edge(n).cutvalue<0})}function VE(t,n,e){var i=e.v,o=e.w;n.hasEdge(i,o)||(i=e.w,o=e.v);var r=t.node(i),a=t.node(o),s=r,c=!1;r.lim>a.lim&&(s=a,c=!0);var d=rn.filter(n.edges(),function(f){return c===LE(t,t.node(f.v),s)&&c!==LE(t,t.node(f.w),s)});return rn.minBy(d,function(f){return UK(n,f)})}function GE(t,n,e,i){var o=e.v,r=e.w;t.removeEdge(o,r),t.setEdge(i.v,i.w,{}),i_(t),n_(t,n),ZK(t,n)}function ZK(t,n){var e=rn.find(t.nodes(),function(o){return!n.node(o).parent}),i=$K(t,e);i=i.slice(1),rn.forEach(i,function(o){var r=t.node(o).parent,a=n.edge(o,r),s=!1;a||(a=n.edge(r,o),s=!0),n.node(o).rank=n.node(r).rank+(s?a.minlen:-a.minlen)})}function QK(t,n,e){return t.hasEdge(n,e)}function LE(t,n,e){return e.low<=n.lim&&n.lim<=e.lim}});var KE=_((Dse,$E)=>{"use strict";var JK=Hr(),WE=JK.longestPath,e9=t_(),t9=jE();$E.exports=n9;function n9(t){switch(t.graph().ranker){case"network-simplex":UE(t);break;case"tight-tree":o9(t);break;case"longest-path":i9(t);break;default:UE(t)}}var i9=WE;function o9(t){WE(t),e9(t)}function UE(t){t9(t)}});var XE=_((Ose,YE)=>{"use strict";var o_=Re();YE.exports=r9;function r9(t){var n=s9(t);o_.forEach(t.graph().dummyChains,function(e){for(var i=t.node(e),o=i.edgeObj,r=a9(t,n,o.v,o.w),a=r.path,s=r.lca,c=0,d=a[c],f=!0;e!==o.w;){if(i=t.node(e),f){for(;(d=a[c])!==s&&t.node(d).maxRank<i.rank;)c++;d===s&&(f=!1)}if(!f){for(;c<a.length-1&&t.node(d=a[c+1]).minRank<=i.rank;)c++;d=a[c]}t.setParent(e,d),e=t.successors(e)[0]}})}function a9(t,n,e,i){var o=[],r=[],a=Math.min(n[e].low,n[i].low),s=Math.max(n[e].lim,n[i].lim),c,d;c=e;do c=t.parent(c),o.push(c);while(c&&(n[c].low>a||s>n[c].lim));for(d=c,c=i;(c=t.parent(c))!==d;)r.push(c);return{path:o.concat(r.reverse()),lca:d}}function s9(t){var n={},e=0;function i(o){var r=e;o_.forEach(t.children(o),i),n[o]={low:r,lim:e++}}return o_.forEach(t.children(),i),n}});var JE=_((Nse,QE)=>{"use strict";var an=Re(),r_=dt();QE.exports={run:c9,cleanup:u9};function c9(t){var n=r_.addDummyNode(t,"root",{},"_root"),e=d9(t),i=an.max(an.values(e))-1,o=2*i+1;t.graph().nestingRoot=n,an.forEach(t.edges(),function(a){t.edge(a).minlen*=o});var r=l9(t)+1;an.forEach(t.children(),function(a){ZE(t,n,o,r,i,e,a)}),t.graph().nodeRankFactor=o}function ZE(t,n,e,i,o,r,a){var s=t.children(a);if(!s.length){a!==n&&t.setEdge(n,a,{weight:0,minlen:e});return}var c=r_.addBorderNode(t,"_bt"),d=r_.addBorderNode(t,"_bb"),f=t.node(a);t.setParent(c,a),f.borderTop=c,t.setParent(d,a),f.borderBottom=d,an.forEach(s,function(h){ZE(t,n,e,i,o,r,h);var v=t.node(h),b=v.borderTop?v.borderTop:h,w=v.borderBottom?v.borderBottom:h,T=v.borderTop?i:2*i,k=b!==w?1:o-r[a]+1;t.setEdge(c,b,{weight:T,minlen:k,nestingEdge:!0}),t.setEdge(w,d,{weight:T,minlen:k,nestingEdge:!0})}),t.parent(a)||t.setEdge(n,c,{weight:0,minlen:o+r[a]})}function d9(t){var n={};function e(i,o){var r=t.children(i);r&&r.length&&an.forEach(r,function(a){e(a,o+1)}),n[i]=o}return an.forEach(t.children(),function(i){e(i,1)}),n}function l9(t){return an.reduce(t.edges(),function(n,e){return n+t.edge(e).weight},0)}function u9(t){var n=t.graph();t.removeNode(n.nestingRoot),delete n.nestingRoot,an.forEach(t.edges(),function(e){var i=t.edge(e);i.nestingEdge&&t.removeEdge(e)})}});var nP=_((Rse,tP)=>{"use strict";var a_=Re(),f9=dt();tP.exports=p9;function p9(t){function n(e){var i=t.children(e),o=t.node(e);if(i.length&&a_.forEach(i,n),a_.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var r=o.minRank,a=o.maxRank+1;r<a;++r)eP(t,"borderLeft","_bl",e,o,r),eP(t,"borderRight","_br",e,o,r)}}a_.forEach(t.children(),n)}function eP(t,n,e,i,o,r){var a={width:0,height:0,rank:r,borderType:n},s=o[n][r-1],c=f9.addDummyNode(t,"border",a,e);o[n][r]=c,t.setParent(c,i),s&&t.setEdge(s,c,{weight:1})}});var aP=_((Ase,rP)=>{"use strict";var $t=Re();rP.exports={adjust:h9,undo:m9};function h9(t){var n=t.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&oP(t)}function m9(t){var n=t.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&g9(t),(n==="lr"||n==="rl")&&(_9(t),oP(t))}function oP(t){$t.forEach(t.nodes(),function(n){iP(t.node(n))}),$t.forEach(t.edges(),function(n){iP(t.edge(n))})}function iP(t){var n=t.width;t.width=t.height,t.height=n}function g9(t){$t.forEach(t.nodes(),function(n){s_(t.node(n))}),$t.forEach(t.edges(),function(n){var e=t.edge(n);$t.forEach(e.points,s_),$t.has(e,"y")&&s_(e)})}function s_(t){t.y=-t.y}function _9(t){$t.forEach(t.nodes(),function(n){c_(t.node(n))}),$t.forEach(t.edges(),function(n){var e=t.edge(n);$t.forEach(e.points,c_),$t.has(e,"x")&&c_(e)})}function c_(t){var n=t.x;t.x=t.y,t.y=n}});var cP=_((Fse,sP)=>{"use strict";var sn=Re();sP.exports=y9;function y9(t){var n={},e=sn.filter(t.nodes(),function(s){return!t.children(s).length}),i=sn.max(sn.map(e,function(s){return t.node(s).rank})),o=sn.map(sn.range(i+1),function(){return[]});function r(s){if(!sn.has(n,s)){n[s]=!0;var c=t.node(s);o[c.rank].push(s),sn.forEach(t.successors(s),r)}}var a=sn.sortBy(e,function(s){return t.node(s).rank});return sn.forEach(a,r),o}});var lP=_((Lse,dP)=>{"use strict";var Nn=Re();dP.exports=v9;function v9(t,n){for(var e=0,i=1;i<n.length;++i)e+=C9(t,n[i-1],n[i]);return e}function C9(t,n,e){for(var i=Nn.zipObject(e,Nn.map(e,function(d,f){return f})),o=Nn.flatten(Nn.map(n,function(d){return Nn.sortBy(Nn.map(t.outEdges(d),function(f){return{pos:i[f.w],weight:t.edge(f).weight}}),"pos")}),!0),r=1;r<e.length;)r<<=1;var a=2*r-1;r-=1;var s=Nn.map(new Array(a),function(){return 0}),c=0;return Nn.forEach(o.forEach(function(d){var f=d.pos+r;s[f]+=d.weight;for(var h=0;f>0;)f%2&&(h+=s[f+1]),f=f-1>>1,s[f]+=d.weight;c+=d.weight*h})),c}});var pP=_((Bse,fP)=>{"use strict";var uP=Re();fP.exports=x9;function x9(t,n){return uP.map(n,function(e){var i=t.inEdges(e);if(i.length){var o=uP.reduce(i,function(r,a){var s=t.edge(a),c=t.node(a.v);return{sum:r.sum+s.weight*c.order,weight:r.weight+s.weight}},{sum:0,weight:0});return{v:e,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:e}})}});var mP=_((zse,hP)=>{"use strict";var bt=Re();hP.exports=b9;function b9(t,n){var e={};bt.forEach(t,function(o,r){var a=e[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:r};bt.isUndefined(o.barycenter)||(a.barycenter=o.barycenter,a.weight=o.weight)}),bt.forEach(n.edges(),function(o){var r=e[o.v],a=e[o.w];!bt.isUndefined(r)&&!bt.isUndefined(a)&&(a.indegree++,r.out.push(e[o.w]))});var i=bt.filter(e,function(o){return!o.indegree});return w9(i)}function w9(t){var n=[];function e(r){return function(a){a.merged||(bt.isUndefined(a.barycenter)||bt.isUndefined(r.barycenter)||a.barycenter>=r.barycenter)&&S9(r,a)}}function i(r){return function(a){a.in.push(r),--a.indegree===0&&t.push(a)}}for(;t.length;){var o=t.pop();n.push(o),bt.forEach(o.in.reverse(),e(o)),bt.forEach(o.out,i(o))}return bt.map(bt.filter(n,function(r){return!r.merged}),function(r){return bt.pick(r,["vs","i","barycenter","weight"])})}function S9(t,n){var e=0,i=0;t.weight&&(e+=t.barycenter*t.weight,i+=t.weight),n.weight&&(e+=n.barycenter*n.weight,i+=n.weight),t.vs=n.vs.concat(t.vs),t.barycenter=e/i,t.weight=i,t.i=Math.min(n.i,t.i),n.merged=!0}});var yP=_((qse,_P)=>{"use strict";var jr=Re(),I9=dt();_P.exports=T9;function T9(t,n){var e=I9.partition(t,function(f){return jr.has(f,"barycenter")}),i=e.lhs,o=jr.sortBy(e.rhs,function(f){return-f.i}),r=[],a=0,s=0,c=0;i.sort(E9(!!n)),c=gP(r,o,c),jr.forEach(i,function(f){c+=f.vs.length,r.push(f.vs),a+=f.barycenter*f.weight,s+=f.weight,c=gP(r,o,c)});var d={vs:jr.flatten(r,!0)};return s&&(d.barycenter=a/s,d.weight=s),d}function gP(t,n,e){for(var i;n.length&&(i=jr.last(n)).i<=e;)n.pop(),t.push(i.vs),e++;return e}function E9(t){return function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:t?e.i-n.i:n.i-e.i}}});var xP=_((Vse,CP)=>{"use strict";var Rn=Re(),P9=pP(),M9=mP(),k9=yP();CP.exports=vP;function vP(t,n,e,i){var o=t.children(n),r=t.node(n),a=r?r.borderLeft:void 0,s=r?r.borderRight:void 0,c={};a&&(o=Rn.filter(o,function(w){return w!==a&&w!==s}));var d=P9(t,o);Rn.forEach(d,function(w){if(t.children(w.v).length){var T=vP(t,w.v,e,i);c[w.v]=T,Rn.has(T,"barycenter")&&O9(w,T)}});var f=M9(d,e);D9(f,c);var h=k9(f,i);if(a&&(h.vs=Rn.flatten([a,h.vs,s],!0),t.predecessors(a).length)){var v=t.node(t.predecessors(a)[0]),b=t.node(t.predecessors(s)[0]);Rn.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+b.order)/(h.weight+2),h.weight+=2}return h}function D9(t,n){Rn.forEach(t,function(e){e.vs=Rn.flatten(e.vs.map(function(i){return n[i]?n[i].vs:i}),!0)})}function O9(t,n){Rn.isUndefined(t.barycenter)?(t.barycenter=n.barycenter,t.weight=n.weight):(t.barycenter=(t.barycenter*t.weight+n.barycenter*n.weight)/(t.weight+n.weight),t.weight+=n.weight)}});var wP=_((Gse,bP)=>{"use strict";var Ur=Re(),N9=kt().Graph;bP.exports=R9;function R9(t,n,e){var i=A9(t),o=new N9({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(function(r){return t.node(r)});return Ur.forEach(t.nodes(),function(r){var a=t.node(r),s=t.parent(r);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(r),o.setParent(r,s||i),Ur.forEach(t[e](r),function(c){var d=c.v===r?c.w:c.v,f=o.edge(d,r),h=Ur.isUndefined(f)?0:f.weight;o.setEdge(d,r,{weight:t.edge(c).weight+h})}),Ur.has(a,"minRank")&&o.setNode(r,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),o}function A9(t){for(var n;t.hasNode(n=Ur.uniqueId("_root")););return n}});var IP=_((Hse,SP)=>{"use strict";var F9=Re();SP.exports=L9;function L9(t,n,e){var i={},o;F9.forEach(e,function(r){for(var a=t.parent(r),s,c;a;){if(s=t.parent(a),s?(c=i[s],i[s]=a):(c=o,o=a),c&&c!==a){n.setEdge(c,a);return}a=s}})}});var kP=_((jse,MP)=>{"use strict";var An=Re(),B9=cP(),z9=lP(),q9=xP(),V9=wP(),G9=IP(),H9=kt().Graph,TP=dt();MP.exports=j9;function j9(t){var n=TP.maxRank(t),e=EP(t,An.range(1,n+1),"inEdges"),i=EP(t,An.range(n-1,-1,-1),"outEdges"),o=B9(t);PP(t,o);for(var r=Number.POSITIVE_INFINITY,a,s=0,c=0;c<4;++s,++c){U9(s%2?e:i,s%4>=2),o=TP.buildLayerMatrix(t);var d=z9(t,o);d<r&&(c=0,a=An.cloneDeep(o),r=d)}PP(t,a)}function EP(t,n,e){return An.map(n,function(i){return V9(t,i,e)})}function U9(t,n){var e=new H9;An.forEach(t,function(i){var o=i.graph().root,r=q9(i,o,e,n);An.forEach(r.vs,function(a,s){i.node(a).order=s}),G9(i,e,r.vs)})}function PP(t,n){An.forEach(n,function(e){An.forEach(e,function(i,o){t.node(i).order=o})})}});var qP=_((Use,zP)=>{"use strict";var re=Re(),W9=kt().Graph,$9=dt();zP.exports={positionX:X9,findType1Conflicts:DP,findType2Conflicts:OP,addConflict:d_,hasConflict:NP,verticalAlignment:RP,horizontalCompaction:AP,alignCoordinates:LP,findSmallestWidthAlignment:FP,balance:BP};function DP(t,n){var e={};function i(o,r){var a=0,s=0,c=o.length,d=re.last(r);return re.forEach(r,function(f,h){var v=K9(t,f),b=v?t.node(v).order:c;(v||f===d)&&(re.forEach(r.slice(s,h+1),function(w){re.forEach(t.predecessors(w),function(T){var k=t.node(T),O=k.order;(O<a||b<O)&&!(k.dummy&&t.node(w).dummy)&&d_(e,T,w)})}),s=h+1,a=b)}),r}return re.reduce(n,i),e}function OP(t,n){var e={};function i(r,a,s,c,d){var f;re.forEach(re.range(a,s),function(h){f=r[h],t.node(f).dummy&&re.forEach(t.predecessors(f),function(v){var b=t.node(v);b.dummy&&(b.order<c||b.order>d)&&d_(e,v,f)})})}function o(r,a){var s=-1,c,d=0;return re.forEach(a,function(f,h){if(t.node(f).dummy==="border"){var v=t.predecessors(f);v.length&&(c=t.node(v[0]).order,i(a,d,h,s,c),d=h,s=c)}i(a,d,a.length,c,r.length)}),a}return re.reduce(n,o),e}function K9(t,n){if(t.node(n).dummy)return re.find(t.predecessors(n),function(e){return t.node(e).dummy})}function d_(t,n,e){if(n>e){var i=n;n=e,e=i}var o=t[n];o||(t[n]=o={}),o[e]=!0}function NP(t,n,e){if(n>e){var i=n;n=e,e=i}return re.has(t[n],e)}function RP(t,n,e,i){var o={},r={},a={};return re.forEach(n,function(s){re.forEach(s,function(c,d){o[c]=c,r[c]=c,a[c]=d})}),re.forEach(n,function(s){var c=-1;re.forEach(s,function(d){var f=i(d);if(f.length){f=re.sortBy(f,function(T){return a[T]});for(var h=(f.length-1)/2,v=Math.floor(h),b=Math.ceil(h);v<=b;++v){var w=f[v];r[d]===d&&c<a[w]&&!NP(e,d,w)&&(r[w]=d,r[d]=o[d]=o[w],c=a[w])}}})}),{root:o,align:r}}function AP(t,n,e,i,o){var r={},a=Y9(t,n,e,o),s=o?"borderLeft":"borderRight";function c(h,v){for(var b=a.nodes(),w=b.pop(),T={};w;)T[w]?h(w):(T[w]=!0,b.push(w),b=b.concat(v(w))),w=b.pop()}function d(h){r[h]=a.inEdges(h).reduce(function(v,b){return Math.max(v,r[b.v]+a.edge(b))},0)}function f(h){var v=a.outEdges(h).reduce(function(w,T){return Math.min(w,r[T.w]-a.edge(T))},Number.POSITIVE_INFINITY),b=t.node(h);v!==Number.POSITIVE_INFINITY&&b.borderType!==s&&(r[h]=Math.max(r[h],v))}return c(d,a.predecessors.bind(a)),c(f,a.successors.bind(a)),re.forEach(i,function(h){r[h]=r[e[h]]}),r}function Y9(t,n,e,i){var o=new W9,r=t.graph(),a=Z9(r.nodesep,r.edgesep,i);return re.forEach(n,function(s){var c;re.forEach(s,function(d){var f=e[d];if(o.setNode(f),c){var h=e[c],v=o.edge(h,f);o.setEdge(h,f,Math.max(a(t,d,c),v||0))}c=d})}),o}function FP(t,n){return re.minBy(re.values(n),function(e){var i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return re.forIn(e,function(r,a){var s=Q9(t,a)/2;i=Math.max(r+s,i),o=Math.min(r-s,o)}),i-o})}function LP(t,n){var e=re.values(n),i=re.min(e),o=re.max(e);re.forEach(["u","d"],function(r){re.forEach(["l","r"],function(a){var s=r+a,c=t[s],d;if(c!==n){var f=re.values(c);d=a==="l"?i-re.min(f):o-re.max(f),d&&(t[s]=re.mapValues(c,function(h){return h+d}))}})})}function BP(t,n){return re.mapValues(t.ul,function(e,i){if(n)return t[n.toLowerCase()][i];var o=re.sortBy(re.map(t,i));return(o[1]+o[2])/2})}function X9(t){var n=$9.buildLayerMatrix(t),e=re.merge(DP(t,n),OP(t,n)),i={},o;re.forEach(["u","d"],function(a){o=a==="u"?n:re.values(n).reverse(),re.forEach(["l","r"],function(s){s==="r"&&(o=re.map(o,function(h){return re.values(h).reverse()}));var c=(a==="u"?t.predecessors:t.successors).bind(t),d=RP(t,o,e,c),f=AP(t,o,d.root,d.align,s==="r");s==="r"&&(f=re.mapValues(f,function(h){return-h})),i[a+s]=f})});var r=FP(t,i);return LP(i,r),BP(i,t.graph().align)}function Z9(t,n,e){return function(i,o,r){var a=i.node(o),s=i.node(r),c=0,d;if(c+=a.width/2,re.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":d=-a.width/2;break;case"r":d=a.width/2;break}if(d&&(c+=e?d:-d),d=0,c+=(a.dummy?n:t)/2,c+=(s.dummy?n:t)/2,c+=s.width/2,re.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}return d&&(c+=e?d:-d),d=0,c}}function Q9(t,n){return t.node(n).width}});var HP=_((Wse,GP)=>{"use strict";var Wr=Re(),VP=dt(),J9=qP().positionX;GP.exports=eY;function eY(t){t=VP.asNonCompoundGraph(t),tY(t),Wr.forEach(J9(t),function(n,e){t.node(e).x=n})}function tY(t){var n=VP.buildLayerMatrix(t),e=t.graph().ranksep,i=0;Wr.forEach(n,function(o){var r=Wr.max(Wr.map(o,function(a){return t.node(a).height}));Wr.forEach(o,function(a){t.node(a).y=i+r/2}),i+=r+e})}});var YP=_(($se,KP)=>{"use strict";var ce=Re(),jP=EE(),UP=RE(),nY=KE(),iY=dt().normalizeRanks,oY=XE(),rY=dt().removeEmptyRanks,WP=JE(),aY=nP(),$P=aP(),sY=kP(),cY=HP(),Fn=dt(),dY=kt().Graph;KP.exports=lY;function lY(t,n){var e=n&&n.debugTiming?Fn.time:Fn.notime;e("layout",function(){var i=e(" buildLayoutGraph",function(){return xY(t)});e(" runLayout",function(){uY(i,e)}),e(" updateInputGraph",function(){fY(t,i)})})}function uY(t,n){n(" makeSpaceForEdgeLabels",function(){bY(t)}),n(" removeSelfEdges",function(){DY(t)}),n(" acyclic",function(){jP.run(t)}),n(" nestingGraph.run",function(){WP.run(t)}),n(" rank",function(){nY(Fn.asNonCompoundGraph(t))}),n(" injectEdgeLabelProxies",function(){wY(t)}),n(" removeEmptyRanks",function(){rY(t)}),n(" nestingGraph.cleanup",function(){WP.cleanup(t)}),n(" normalizeRanks",function(){iY(t)}),n(" assignRankMinMax",function(){SY(t)}),n(" removeEdgeLabelProxies",function(){IY(t)}),n(" normalize.run",function(){UP.run(t)}),n(" parentDummyChains",function(){oY(t)}),n(" addBorderSegments",function(){aY(t)}),n(" order",function(){sY(t)}),n(" insertSelfEdges",function(){OY(t)}),n(" adjustCoordinateSystem",function(){$P.adjust(t)}),n(" position",function(){cY(t)}),n(" positionSelfEdges",function(){NY(t)}),n(" removeBorderNodes",function(){kY(t)}),n(" normalize.undo",function(){UP.undo(t)}),n(" fixupEdgeLabelCoords",function(){PY(t)}),n(" undoCoordinateSystem",function(){$P.undo(t)}),n(" translateGraph",function(){TY(t)}),n(" assignNodeIntersects",function(){EY(t)}),n(" reversePoints",function(){MY(t)}),n(" acyclic.undo",function(){jP.undo(t)})}function fY(t,n){ce.forEach(t.nodes(),function(e){var i=t.node(e),o=n.node(e);i&&(i.x=o.x,i.y=o.y,n.children(e).length&&(i.width=o.width,i.height=o.height))}),ce.forEach(t.edges(),function(e){var i=t.edge(e),o=n.edge(e);i.points=o.points,ce.has(o,"x")&&(i.x=o.x,i.y=o.y)}),t.graph().width=n.graph().width,t.graph().height=n.graph().height}var pY=["nodesep","edgesep","ranksep","marginx","marginy"],hY={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},mY=["acyclicer","ranker","rankdir","align"],gY=["width","height"],_Y={width:0,height:0},yY=["minlen","weight","width","height","labeloffset"],vY={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},CY=["labelpos"];function xY(t){var n=new dY({multigraph:!0,compound:!0}),e=u_(t.graph());return n.setGraph(ce.merge({},hY,l_(e,pY),ce.pick(e,mY))),ce.forEach(t.nodes(),function(i){var o=u_(t.node(i));n.setNode(i,ce.defaults(l_(o,gY),_Y)),n.setParent(i,t.parent(i))}),ce.forEach(t.edges(),function(i){var o=u_(t.edge(i));n.setEdge(i,ce.merge({},vY,l_(o,yY),ce.pick(o,CY)))}),n}function bY(t){var n=t.graph();n.ranksep/=2,ce.forEach(t.edges(),function(e){var i=t.edge(e);i.minlen*=2,i.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})}function wY(t){ce.forEach(t.edges(),function(n){var e=t.edge(n);if(e.width&&e.height){var i=t.node(n.v),o=t.node(n.w),r={rank:(o.rank-i.rank)/2+i.rank,e:n};Fn.addDummyNode(t,"edge-proxy",r,"_ep")}})}function SY(t){var n=0;ce.forEach(t.nodes(),function(e){var i=t.node(e);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,n=ce.max(n,i.maxRank))}),t.graph().maxRank=n}function IY(t){ce.forEach(t.nodes(),function(n){var e=t.node(n);e.dummy==="edge-proxy"&&(t.edge(e.e).labelRank=e.rank,t.removeNode(n))})}function TY(t){var n=Number.POSITIVE_INFINITY,e=0,i=Number.POSITIVE_INFINITY,o=0,r=t.graph(),a=r.marginx||0,s=r.marginy||0;function c(d){var f=d.x,h=d.y,v=d.width,b=d.height;n=Math.min(n,f-v/2),e=Math.max(e,f+v/2),i=Math.min(i,h-b/2),o=Math.max(o,h+b/2)}ce.forEach(t.nodes(),function(d){c(t.node(d))}),ce.forEach(t.edges(),function(d){var f=t.edge(d);ce.has(f,"x")&&c(f)}),n-=a,i-=s,ce.forEach(t.nodes(),function(d){var f=t.node(d);f.x-=n,f.y-=i}),ce.forEach(t.edges(),function(d){var f=t.edge(d);ce.forEach(f.points,function(h){h.x-=n,h.y-=i}),ce.has(f,"x")&&(f.x-=n),ce.has(f,"y")&&(f.y-=i)}),r.width=e-n+a,r.height=o-i+s}function EY(t){ce.forEach(t.edges(),function(n){var e=t.edge(n),i=t.node(n.v),o=t.node(n.w),r,a;e.points?(r=e.points[0],a=e.points[e.points.length-1]):(e.points=[],r=o,a=i),e.points.unshift(Fn.intersectRect(i,r)),e.points.push(Fn.intersectRect(o,a))})}function PY(t){ce.forEach(t.edges(),function(n){var e=t.edge(n);if(ce.has(e,"x"))switch((e.labelpos==="l"||e.labelpos==="r")&&(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset;break}})}function MY(t){ce.forEach(t.edges(),function(n){var e=t.edge(n);e.reversed&&e.points.reverse()})}function kY(t){ce.forEach(t.nodes(),function(n){if(t.children(n).length){var e=t.node(n),i=t.node(e.borderTop),o=t.node(e.borderBottom),r=t.node(ce.last(e.borderLeft)),a=t.node(ce.last(e.borderRight));e.width=Math.abs(a.x-r.x),e.height=Math.abs(o.y-i.y),e.x=r.x+e.width/2,e.y=i.y+e.height/2}}),ce.forEach(t.nodes(),function(n){t.node(n).dummy==="border"&&t.removeNode(n)})}function DY(t){ce.forEach(t.edges(),function(n){if(n.v===n.w){var e=t.node(n.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:n,label:t.edge(n)}),t.removeEdge(n)}})}function OY(t){var n=Fn.buildLayerMatrix(t);ce.forEach(n,function(e){var i=0;ce.forEach(e,function(o,r){var a=t.node(o);a.order=r+i,ce.forEach(a.selfEdges,function(s){Fn.addDummyNode(t,"selfedge",{width:s.label.width,height:s.label.height,rank:a.rank,order:r+ ++i,e:s.e,label:s.label},"_se")}),delete a.selfEdges})})}function NY(t){ce.forEach(t.nodes(),function(n){var e=t.node(n);if(e.dummy==="selfedge"){var i=t.node(e.e.v),o=i.x+i.width/2,r=i.y,a=e.x-o,s=i.height/2;t.setEdge(e.e,e.label),t.removeNode(n),e.label.points=[{x:o+2*a/3,y:r-s},{x:o+5*a/6,y:r-s},{x:o+a,y:r},{x:o+5*a/6,y:r+s},{x:o+2*a/3,y:r+s}],e.label.x=e.x,e.label.y=e.y}})}function l_(t,n){return ce.mapValues(ce.pick(t,n),Number)}function u_(t){var n={};return ce.forEach(t,function(e,i){n[i.toLowerCase()]=e}),n}});var ZP=_((Kse,XP)=>{"use strict";var hp=Re(),RY=dt(),AY=kt().Graph;XP.exports={debugOrdering:FY};function FY(t){var n=RY.buildLayerMatrix(t),e=new AY({compound:!0,multigraph:!0}).setGraph({});return hp.forEach(t.nodes(),function(i){e.setNode(i,{label:i}),e.setParent(i,"layer"+t.node(i).rank)}),hp.forEach(t.edges(),function(i){e.setEdge(i.v,i.w,{},i.name)}),hp.forEach(n,function(i,o){var r="layer"+o;e.setNode(r,{rank:"same"}),hp.reduce(i,function(a,s){return e.setEdge(a,s,{style:"invis"}),s})}),e}});var JP=_((Yse,QP)=>{"use strict";QP.exports="0.8.5"});var tM=_((Xse,eM)=>{"use strict";eM.exports={graphlib:kt(),layout:YP(),debug:ZP(),util:{time:dt().time,notime:dt().notime},version:JP()}});var w0=`
2
+ .p-popover {
3
+ margin-block-start: dt('popover.gutter');
4
+ background: dt('popover.background');
5
+ color: dt('popover.color');
6
+ border: 1px solid dt('popover.border.color');
7
+ border-radius: dt('popover.border.radius');
8
+ box-shadow: dt('popover.shadow');
9
+ will-change: transform;
10
+ }
11
+
12
+ .p-popover-content {
13
+ padding: dt('popover.content.padding');
14
+ }
15
+
16
+ .p-popover-flipped {
17
+ margin-block-start: calc(dt('popover.gutter') * -1);
18
+ margin-block-end: dt('popover.gutter');
19
+ }
20
+
21
+ .p-popover:after,
22
+ .p-popover:before {
23
+ bottom: 100%;
24
+ left: calc(dt('popover.arrow.offset') + dt('popover.arrow.left'));
25
+ content: ' ';
26
+ height: 0;
27
+ width: 0;
28
+ position: absolute;
29
+ pointer-events: none;
30
+ }
31
+
32
+ .p-popover:after {
33
+ border-width: calc(dt('popover.gutter') - 2px);
34
+ margin-left: calc(-1 * (dt('popover.gutter') - 2px));
35
+ border-style: solid;
36
+ border-color: transparent;
37
+ border-bottom-color: dt('popover.background');
38
+ }
39
+
40
+ .p-popover:before {
41
+ border-width: dt('popover.gutter');
42
+ margin-left: calc(-1 * dt('popover.gutter'));
43
+ border-style: solid;
44
+ border-color: transparent;
45
+ border-bottom-color: dt('popover.border.color');
46
+ }
47
+
48
+ .p-popover-flipped:after,
49
+ .p-popover-flipped:before {
50
+ bottom: auto;
51
+ top: 100%;
52
+ }
53
+
54
+ .p-popover.p-popover-flipped:after {
55
+ border-bottom-color: transparent;
56
+ border-top-color: dt('popover.background');
57
+ }
58
+
59
+ .p-popover.p-popover-flipped:before {
60
+ border-bottom-color: transparent;
61
+ border-top-color: dt('popover.border.color');
62
+ }
63
+ `;var aD=["content"],sD=["*"],cD=t=>({closeCallback:t});function dD(t,n){}function lD(t,n){t&1&&be(0,dD,0,0,"ng-template")}function uD(t,n){if(t&1){let e=de();p(0,"div",1),$("click",function(o){G(e);let r=g();return H(r.onOverlayClick(o))})("pMotionOnEnter",function(o){G(e);let r=g();return H(r.onAnimationStart(o))})("pMotionOnAfterLeave",function(){G(e);let o=g();return H(o.onAnimationEnd())}),p(1,"div",2),$("click",function(o){G(e);let r=g();return H(r.onContentClick(o))})("mousedown",function(o){G(e);let r=g();return H(r.onContentClick(o))}),Ae(2),be(3,lD,1,0,null,3),m()()}if(t&2){let e=g();ca(e.sx("root")),Fe(e.cn(e.cx("root"),e.styleClass)),M("pBind",e.ptm("root"))("ngStyle",e.style)("pMotion",e.overlayVisible)("pMotionAppear",!0)("pMotionOptions",e.computedMotionOptions()),U("aria-modal",e.overlayVisible)("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy),l(),Fe(e.cx("content")),M("pBind",e.ptm("content")),l(2),M("ngTemplateOutlet",e.contentTemplate||e._contentTemplate)("ngTemplateOutletContext",Jt(17,cD,e.onCloseClick.bind(e)))}}var fD={root:()=>({position:"absolute"})},pD={root:"p-popover p-component",content:"p-popover-content"},S0=(()=>{class t extends pa{name="popover";style=w0;classes=pD;inlineStyles=fD;static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),I0=new he("POPOVER_INSTANCE"),sh=(()=>{class t extends ma{componentName="Popover";$pcPopover=u(I0,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=u(zt,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm("host"))}ariaLabel;ariaLabelledBy;dismissable=!0;style;styleClass;appendTo=F("body");autoZIndex=!0;ariaCloseLabel;baseZIndex=0;focusOnShow=!0;showTransitionOptions=".12s cubic-bezier(0, 0, 0.2, 1)";hideTransitionOptions=".1s linear";motionOptions=F(void 0);computedMotionOptions=D(()=>ae(ae({},this.ptm("motion")),this.motionOptions()));onShow=new gt;onHide=new gt;$appendTo=D(()=>this.appendTo()||this.config.overlayAppendTo());container;overlayVisible=!1;render=!1;selfClick=!1;documentClickListener;target;willHide;scrollHandler;documentResizeListener;contentTemplate;templates;_contentTemplate;destroyCallback;overlayEventListener;overlaySubscription;_componentStyle=u(S0);zone=u(Vn);overlayService=u(r0);onAfterContentInit(){this.templates.forEach(e=>{e.getType()==="content"&&(this._contentTemplate=e.template)})}bindDocumentClickListener(){if(ln(this.platformId)&&!this.documentClickListener){let e=n0()?"touchstart":"click",i=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentClickListener=this.renderer.listen(i,e,o=>{this.dismissable&&(!this.container?.contains(o.target)&&this.target!==o.target&&!this.target.contains(o.target)&&!this.selfClick&&this.hide(),this.selfClick=!1,this.cd.markForCheck())})}}unbindDocumentClickListener(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null,this.selfClick=!1)}toggle(e,i){this.overlayVisible?(this.hasTargetChanged(e,i)&&(this.destroyCallback=()=>{this.show(null,i||e.currentTarget||e.target)}),this.hide()):this.show(e,i)}show(e,i){i&&e&&e.stopPropagation(),this.container&&!this.overlayVisible&&(this.container=null),this.target=i||e.currentTarget||e.target,this.overlayVisible=!0,this.render=!0,this.cd.markForCheck()}onOverlayClick(e){this.overlayService.add({originalEvent:e,target:this.el.nativeElement}),this.selfClick=!0}onContentClick(e){let i=e.target;this.selfClick=e.offsetX<i.clientWidth&&e.offsetY<i.clientHeight}hasTargetChanged(e,i){return this.target!=null&&this.target!==(i||e.currentTarget||e.target)}appendOverlay(){this.$appendTo()&&this.$appendTo()!=="self"&&(this.$appendTo()==="body"?fa(this.document.body,this.container):fa(this.$appendTo(),this.container))}restoreAppend(){this.container&&this.$appendTo()&&this.$appendTo()!=="self"&&fa(this.el.nativeElement,this.container)}setZIndex(){this.autoZIndex&&_a.set("overlay",this.container,this.baseZIndex+this.config.zIndex.overlay)}align(){if(this.target&&this.container){e0(this.container,this.target,!1);let e=oh(this.container),i=oh(this.target),o=this.document.defaultView?.getComputedStyle(this.container).getPropertyValue("border-radius"),r=0;e.left<i.left&&(r=i.left-e.left-parseFloat(o)*2),this.container.style.setProperty(c0("popover.arrow.left").name,`${r}px`),e.top<i.top&&(this.container.setAttribute("data-p-popover-flipped","true"),!this.$unstyled()&&J_(this.container,"p-popover-flipped"))}}onAnimationStart(e){this.container=e.element,this.container?.setAttribute(this.$attrSelector,""),this.appendOverlay(),this.align(),this.setZIndex(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener(),this.focusOnShow&&this.focus(),this.overlayEventListener=i=>{this.container&&this.container.contains(i.target)&&(this.selfClick=!0)},this.overlaySubscription=this.overlayService.clickObservable.subscribe(this.overlayEventListener),this.onShow.emit(null)}onAnimationEnd(){this.overlayVisible||(this.destroyCallback&&(this.destroyCallback(),this.destroyCallback=null),this.overlaySubscription&&this.overlaySubscription.unsubscribe(),this.autoZIndex&&_a.clear(this.container),this.onContainerDestroy(),this.onHide.emit({}),this.render=!1,this.container=null)}focus(){let e=t0(this.container,"[autofocus]");e&&this.zone.runOutsideAngular(()=>{setTimeout(()=>e.focus(),5)})}hide(){this.overlayVisible=!1,this.cd.markForCheck()}onCloseClick(e){this.hide(),e.preventDefault()}onEscapeKeydown(e){this.hide()}onWindowResize(){this.overlayVisible&&!i0()&&this.hide()}bindDocumentResizeListener(){if(ln(this.platformId)&&!this.documentResizeListener){let e=this.document.defaultView;this.documentResizeListener=this.renderer.listen(e,"resize",this.onWindowResize.bind(this))}}unbindDocumentResizeListener(){this.documentResizeListener&&(this.documentResizeListener(),this.documentResizeListener=null)}bindScrollListener(){ln(this.platformId)&&(this.scrollHandler||(this.scrollHandler=new d0(this.target,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener())}unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}onContainerDestroy(){this.cd.destroyed||(this.target=null),this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener()}onDestroy(){this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.container&&this.autoZIndex&&_a.clear(this.container),this.cd.destroyed||(this.target=null),this.destroyCallback=null,this.container&&(this.restoreAppend(),this.onContainerDestroy()),this.overlaySubscription&&this.overlaySubscription.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["p-popover"]],contentQueries:function(i,o,r){if(i&1&&sa(r,aD,4)(r,un,4),i&2){let a;St(a=It())&&(o.contentTemplate=a.first),St(a=It())&&(o.templates=a)}},hostBindings:function(i,o){i&1&&$("keydown.escape",function(a){return o.onEscapeKeydown(a)},ta)},inputs:{ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",dismissable:[2,"dismissable","dismissable",Ce],style:"style",styleClass:"styleClass",appendTo:[1,"appendTo"],autoZIndex:[2,"autoZIndex","autoZIndex",Ce],ariaCloseLabel:"ariaCloseLabel",baseZIndex:[2,"baseZIndex","baseZIndex",et],focusOnShow:[2,"focusOnShow","focusOnShow",Ce],showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",motionOptions:[1,"motionOptions"]},outputs:{onShow:"onShow",onHide:"onHide"},features:[we([S0,{provide:I0,useExisting:t},{provide:ha,useExisting:t}]),oa([zt]),ve],ngContentSelectors:sD,decls:1,vars:1,consts:[["role","dialog","pMotionName","p-anchored-overlay",3,"pBind","class","style","ngStyle","pMotion","pMotionAppear","pMotionOptions"],["role","dialog","pMotionName","p-anchored-overlay",3,"click","pMotionOnEnter","pMotionOnAfterLeave","pBind","ngStyle","pMotion","pMotionAppear","pMotionOptions"],[3,"click","mousedown","pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(i,o){i&1&&(Zt(),E(0,uD,4,19,"div",0)),i&2&&P(o.render?0:-1)},dependencies:[Ti,la,X_,fn,zt,u0,l0],encapsulation:2,changeDetection:0})}return t})(),T0=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Si({type:t});static \u0275inj=xi({imports:[sh,fn,fn]})}return t})();var $n=class{constructor(n,e,i,o,r){this.center=n,this.radiusX=e,this.radiusY=i,this.startAngle=o,this.endAngle=r}},B=class t{static castToPoint(n){return n||t.initialize()}static initialize(n=0,e=0){return{x:n,y:e}}static copy(n){return t.initialize(n.x,n.y)}static isEqual(n,e){return n.x===e.x&&n.y===e.y}static sum(n,e){return{x:n.x+e.x,y:n.y+e.y}}static sub(n,e){return{x:n.x-e.x,y:n.y-e.y}}static div(n,e){return{x:n.x/e,y:n.y/e}}static mult(n,e){return{x:n.x*e,y:n.y*e}}static interpolatePoints(n,e,i){let o=1-i;return t.initialize(n.x*o+e.x*i,n.y*o+e.y*i)}static roundTo(n,e){let i=Math.trunc(n.x/e),o=Math.trunc(n.y/e);return{x:i*e,y:o*e}}static hypotenuse(n,e){let i=e.x-n.x,o=e.y-n.y;return Math.abs(Math.sqrt(i*i+o*o))}static distance(n,e){let i=n.x-e.x,o=n.y-e.y;return Math.sqrt(i*i+o*o)}static getMinimum(n,e){return t.initialize(Math.min(n.x,e.x),Math.min(n.y,e.y))}static getMaximum(n,e){return t.initialize(Math.max(n.x,e.x),Math.max(n.y,e.y))}static matrixTransform(n,e){let i=t.initialize(n.x,n.y),o=e.getScreenCTM();if(o){let r=e.createSVGPoint();r.x=n.x,r.y=n.y,i=r.matrixTransform(o.inverse())}return i}static elementTransform(n,e){let i=t.initialize(n.x,n.y),o=e.getBoundingClientRect();return i=t.sub(i,t.initialize(o.left,o.top)),i}},ee=class t{constructor(n=0,e=0){this.x=n,this.y=e}static fromPoint(n){return new t(n.x,n.y)}add(n){let e=B.sum(this,n);return t.fromPoint(e)}sub(n){let e=B.sub(this,n);return t.fromPoint(e)}subNumber(n){let e=B.sub(this,new t(n,n));return t.fromPoint(e)}div(n){let e=B.div(this,n);return t.fromPoint(e)}mult(n){let e=B.mult(this,n);return t.fromPoint(e)}matrixTransform(n){let e=B.matrixTransform(this,n);return t.fromPoint(e)}elementTransform(n){let e=B.elementTransform(this,n);return t.fromPoint(e)}},ko=class{static initialize(n=B.initialize(),e=B.initialize()){return{point1:n,point2:e}}static copy(n){return{point1:n.point1,point2:n.point2}}static hypotenuse(n){return Math.sqrt(Math.pow(n.point1.x-n.point2.x,2)+Math.pow(n.point1.y-n.point2.y,2))}},Kn=class{constructor(n,e){this.point1=n,this.point2=e}},W=class t{static initialize(n=0,e=0,i=0,o=0){i<0&&(n=n+i,i=-i),o<0&&(e=e+o,o=-o);let r=B.initialize(n+i/2,e+o/2);return{x:n,y:e,width:i,height:o,gravityCenter:r}}static copy(n){return t.initialize(n.x,n.y,n.width,n.height)}static fromElement(n){let{x:e,y:i,width:o,height:r}=n.getBoundingClientRect();return t.initialize(e,i,o,r)}static isIncludePoint(n,e){return e.x>=t.left(n)&&e.x<=t.right(n)&&e.y>=t.top(n)&&e.y<=t.bottom(n)}static intersectionWithRect(n,e){return!(n.x+n.width<e.x||e.x+e.width<n.x||n.y+n.height<e.y||e.y+e.height<n.y)}static left(n){return n.x}static top(n){return n.y}static right(n){return n.x+n.width}static bottom(n){return n.y+n.height}static addPoint(n,e){let i=t.copy(n);return i.x+=e.x,i.y+=e.y,this.initialize(i.x,i.y,i.width,i.height)}static mult(n,e){let i=t.copy(n);return i.x*=e,i.y*=e,i.width*=e,i.height*=e,this.initialize(i.x,i.y,i.width,i.height)}static div(n,e){let i=t.copy(n);return i.x/=e,i.y/=e,i.width/=e,i.height/=e,this.initialize(i.x,i.y,i.width,i.height)}static addPointToSize(n,e){let i=t.copy(n);return i.width+=e.x,i.height+=e.y,this.initialize(i.x,i.y,i.width,i.height)}static union(n){return!n||n.length===0?null:n.reduce((e,i)=>{let o=Math.min(e.x,i.x),r=Math.min(e.y,i.y),a=Math.max(e.x+e.width,i.x+i.width),s=Math.max(e.y+e.height,i.y+i.height);return t.initialize(o,r,a-o,s-r)},n[0])}static elementTransform(n,e){let i=e.getBoundingClientRect(),o=B.sub(n,B.initialize(i.left,i.top));return t.initialize(o.x,o.y,n.width,n.height)}static updateIsNotFinite(n){return!Number.isFinite(n.width)||!Number.isFinite(n.height)||!Number.isFinite(n.x)||!Number.isFinite(n.y)?t.initialize(0,0,0,0):n}};function E0(t,n){let e=Math.max(t.width,n),i=Math.max(t.height,n),o=(e-t.width)/2,r=(i-t.height)/2;return W.initialize(t.x-o,t.y-r,e,i)}function dh(t,n){t=W.updateIsNotFinite(t),n.setAttribute("x",t.x.toString()),n.setAttribute("y",t.y.toString()),n.setAttribute("width",t.width.toString()),n.setAttribute("height",t.height.toString())}function P0(t,n){t=W.updateIsNotFinite(t),n.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}var He=class t{constructor(n=0,e=0,i=0,o=0,r=0,a=0,s=0,c=0){this.x=n,this.y=e,this.width=i,this.height=o,this.radius1=r,this.radius2=a,this.radius3=s,this.radius4=c,this.gravityCenter=B.initialize(),this.gravityCenter=this.calculateGravityCenter(this)}calculateGravityCenter(n){return new ee(n.x+n.width/2,n.y+n.height/2)}static fromRect(n){return new t(n.x,n.y,n.width,n.height)}static fromRoundedRect(n){return new t(n.x,n.y,n.width,n.height,n.radius1,n.radius2,n.radius3,n.radius4)}static fromCenter(n,e,i){return new t(n.gravityCenter.x-e/2,n.gravityCenter.y-i/2,e,i,n.radius1,n.radius2,n.radius3,n.radius4)}static fromPoint(n){return new t(n.x,n.y)}addPoint(n){let e=t.fromRoundedRect(this);return e.x+=n.x,e.y+=n.y,e.gravityCenter=this.calculateGravityCenter(e),e}},st=class t{static initialize(n=0,e=0){return{width:n,height:e}}static isEqual(n,e){return n.width===e.width&&n.height===e.height}static offsetFromElement(n){if(n instanceof SVGGraphicsElement){let e=n.getBBox();return t.initialize(e.width,e.height)}else if(n instanceof HTMLElement)return t.initialize(n.offsetWidth,n.offsetHeight)}};function mD(){return{position:B.initialize(),scaledPosition:B.initialize(),scale:1,rotate:0}}function gD(t){let n;if(t){t=t.replace("matrix(",""),t=t.replace(")","");let e=t.split(" ");n={position:{x:Number(e[4]),y:Number(e[5])},scaledPosition:B.initialize(),scale:Number(e[0]),rotate:0}}return n}var gn=class{static toString(n){let e=B.sum(n.position,n.scaledPosition);return`matrix(${n.scale}, 0, 0, ${n.scale}, ${e.x}, ${e.y})`}static fromString(n){return gD(n)}static default(){return mD()}},pt=class t{static initialize(n=0,e=0){return B.initialize(n,e)}static fromPoints(n,e){return t.initialize(e.x-n.x,e.y-n.y)}static vectorLength(n){return Math.sqrt(t.magnitudeSquared(n))}static magnitudeSquared(n){return n.x*n.x+n.y*n.y}static dotProduct(n,e){return n.x*e.x+n.y*e.y}static crossProduct(n,e){return n.x*e.y-n.y*e.x}static subtract(n,e){return t.initialize(n.x-e.x,n.y-e.y)}static add(n,e){return t.initialize(n.x+e.x,n.y+e.y)}static scale(n,e){return t.initialize(n.x*e,n.y*e)}static angle(n,e){let i=Math.acos(Math.max(-1,Math.min(t.dotProduct(n,e)/(t.vectorLength(n)*t.vectorLength(e)),1)));return t.crossProduct(n,e)<0?-i:i}},ch=class{static parseRoundedRect(n){let e=Math.PI*.5,i=n.x,o=n.y,r=n.x+n.width,a=n.y+n.height,s=n.x+n.radius1,c=n.y+n.radius1,d=n.x+n.width-n.radius2,f=n.y+n.radius2,h=n.x+n.width-n.radius3,v=n.y+n.height-n.radius3,b=n.x+n.radius4,w=n.y+n.height-n.radius4;return[new $n({x:s,y:c},n.radius1,n.radius1,2*e,3*e),new Kn({x:s,y:o},{x:d,y:o}),new $n({x:d,y:f},n.radius2,n.radius2,3*e,4*e),new Kn({x:r,y:f},{x:r,y:v}),new $n({x:h,y:v},n.radius3,n.radius3,0,e),new Kn({x:h,y:a},{x:b,y:a}),new $n({x:b,y:w},n.radius4,n.radius4,e,2*e),new Kn({x:i,y:w},{x:i,y:c})]}},zi=class{static getRoundedRectIntersections(n,e,i){let o=ch.parseRoundedRect(i);for(let r of o)if(r instanceof $n){let a=this.intersectArcWithLine(r,n,e);if(a.length>0)return a}else if(r instanceof Kn){let a=this.intersectLineSegments(n,e,r.point1,r.point2);if(a)return[a]}return[]}static getRoundedRectIntersectionsWithSVGPath(n,e){let i=n.getTotalLength(),o=[];for(let r=0;r<=i;r+=1){let a=n.getPointAtLength(r);o.push({x:a.x,y:a.y})}for(let r=1;r<o.length;r++){let a=this.getRoundedRectIntersections(o[r-1],o[r],e);if(a.length>0)return a}return[]}static intersectArcWithLine(n,e,i){return this.filterPointsWithinArc(this.findEllipseLineIntersections(n.center,n.radiusX,n.radiusY,e,i),n)}static intersectLineSegments(n,e,i,o){let r=e.x-n.x,a=e.y-n.y,s=o.x-i.x,c=o.y-i.y,d=(-a*(n.x-i.x)+r*(n.y-i.y))/(-s*a+r*c),f=(s*(n.y-i.y)-c*(n.x-i.x))/(-s*a+r*c);return d>=0&&d<=1&&f>=0&&f<=1?{x:n.x+f*r,y:n.y+f*a}:null}static filterPointsWithinArc(n,e){let{center:i,startAngle:o,endAngle:r}=e;if(n.length===0)return n;r<o&&([o,r]=[r,o]),(o<0||r<0)&&(o+=2*Math.PI,r+=2*Math.PI);let a=[];for(let s of n){let c=this.normalizeAngle(pt.angle(pt.initialize(1,0),pt.initialize(s.x-i.x,s.y-i.y)));c<o&&(c+=2*Math.PI),o<=c&&c<=r&&a.push(s)}return a}static normalizeAngle(n){let e=n%(2*Math.PI);return e<0?e+2*Math.PI:e}static findEllipseLineIntersections(n,e,i,o,r){let a=pt.initialize(o.x,o.y),s=pt.fromPoints(o,r),c=pt.initialize(n.x,n.y),d=pt.subtract(a,c),f=pt.initialize(s.x/(e*e),s.y/(i*i)),h=pt.initialize(d.x/(e*e),d.y/(i*i)),v=pt.dotProduct(s,f),b=pt.dotProduct(s,h),w=pt.dotProduct(d,h)-1,T=b*b-v*w;return T<0?[]:this.calculateIntersectionPoints(T,v,b,o,r)}static calculateIntersectionPoints(n,e,i,o,r){let a=[];if(n>0){let s=Math.sqrt(n),c=(-i-s)/e,d=(-i+s)/e;c>=0&&c<=1&&a.push(B.interpolatePoints(o,r,c)),d>=0&&d<=1&&a.push(B.interpolatePoints(o,r,d))}else{let s=-i/e;s>=0&&s<=1&&a.push(B.interpolatePoints(o,r,s))}return a}};var lh=class{handle(n,e){let i=!0;if(this.validator&&(i=e.get(this.validator).handle(n)),!!i)return e.get(this.execution).handle(n)}execute(n,e){return e.get(this.execution).handle(n)}setValidator(n){this.validator=n}setExecution(n){this.execution=n}},R=class t{constructor(){this._injector=u(ot)}static registerPipeline(n,e,i){if(!n||!n.fToken)throw new Error("Type must have a fToken static property.");let o=this.pipelines.get(n.fToken)||new lh;i?o.setValidator(e):o.setExecution(e),this.pipelines.set(n.fToken,o)}send(n){let e=t.pipelines.get(n.constructor.fToken);if(e)return e.handle(n,this._injector);throw new Error("Handler not registered for request type.")}execute(n){return t.pipelines.get(n.constructor.fToken).execute(n,this._injector)}};R.pipelines=new Map;R.\u0275fac=function(n){return new(n||R)};R.\u0275prov=C({token:R,factory:R.\u0275fac});function I(t){return function(n){R.registerPipeline(t,n,!1)}}var _D=(()=>{class t{setItem(e,i){localStorage.setItem(e,i)}getItem(e){return localStorage.getItem(e)}removeItem(e){localStorage.removeItem(e)}clear(){localStorage.clear()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),yD=(()=>{class t{storage={};setItem(e,i){this.storage[e]=i}getItem(e){return this.storage[e]||null}removeItem(e){delete this.storage[e]}clear(){this.storage={}}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),vD=new he("F_LOCAL_STORAGE",{providedIn:"root",factory:()=>ln(u(ea))?u(_D):u(yD)}),CD=(()=>{class t{getComputedStyle(e){return window.getComputedStyle(e)}get innerWidth(){return window.innerWidth}get innerHeight(){return window.innerHeight}get pageXOffset(){return window.pageXOffset}get pageYOffset(){return window.pageYOffset}isMediaQuery(e){return window.matchMedia(e).matches}requestAnimationFrame(e){return window.requestAnimationFrame(e)}get location(){return window.location}open(e,i,o){window.open(e,i,o)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),xD=(()=>{class t{getComputedStyle(e){return new Proxy({getPropertyValue:i=>"0"},{get:(i,o)=>o==="getPropertyValue"?i.getPropertyValue:"0"})}get innerWidth(){return 0}get innerHeight(){return 0}get pageXOffset(){return 0}get pageYOffset(){return 0}isMediaQuery(e){return!1}requestAnimationFrame(e){return setTimeout(e,0)}get location(){return{href:"",pathname:"",search:"",hash:"",origin:""}}open(e,i,o){}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),bD=new he("F_WINDOW",{providedIn:"root",factory:()=>ln(u(ea))?u(CD):u(xD)}),_n=(function(t){return t.MAC_OS="macos",t.IOS="ios",t.WINDOWS="windows",t.ANDROID="android",t.LINUX="linux",t})(_n||{}),uh;try{uh=typeof Intl<"u"&&Intl.v8BreakIterator}catch{uh=!1}var fh=(()=>{class t{_platformId;isBrowser=!1;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!!(window.chrome||uh)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(e){this._platformId=e,this.isBrowser=this._platformId?ln(this._platformId):typeof document=="object"&&!!document}getOS(){let e=navigator.userAgent.toLowerCase(),i=/(macintosh|macintel|macppc|mac68k|macos)/i,o=/(win32|win64|windows|wince)/i,r;return i.test(e)?r=_n.MAC_OS:this.IOS?r=_n.IOS:o.test(e)?r=_n.WINDOWS:this.ANDROID?r=_n.ANDROID:!r&&/linux/.test(e)&&(r=_n.LINUX),r}static \u0275fac=function(i){return new(i||t)(bi(ea))};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),je=(()=>{class t{injectedDocument;windowService;localStorageService;platformService;constructor(e,i,o,r){this.injectedDocument=e,this.windowService=i,this.localStorageService=o,this.platformService=r}isBrowser(){return this.platformService.isBrowser}get window(){return this.windowService}get localStorage(){return this.localStorageService}get document(){return this.injectedDocument}toPixels(e,i,o,r){if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("%")){let a=parseFloat(e)/100;return Math.max(i,o)*a}else{if(e.endsWith("em"))return parseFloat(e)*parseFloat(r);if(e.endsWith("rem"))return parseFloat(e)*parseFloat(getComputedStyle(this.document.documentElement).fontSize);if(e.endsWith("vh")){let a=this.window.innerHeight/100;return parseFloat(e)*a}else if(e.endsWith("vw")){let a=this.window.innerWidth/100;return parseFloat(e)*a}}return parseFloat(e)||0}static \u0275fac=function(i){return new(i||t)(bi(Jr),bi(bD),bi(vD),bi(fh))};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function ph(t,n){return t.reduce((e,i)=>[...e,...n(i)],[])}function hh(t){let n=t.cloneNode(!0),e=n.querySelectorAll("[id]"),i=t.nodeName.toLowerCase();n.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return i==="canvas"?D0(t,n):(i==="input"||i==="select"||i==="textarea")&&k0(t,n),M0("canvas",t,n,D0),M0("input, textarea, select",t,n,k0),n}function M0(t,n,e,i){let o=n.querySelectorAll(t);if(o.length){let r=e.querySelectorAll(t);for(let a=0;a<o.length;a++)i(o[a],r[a])}}var wD=0;function k0(t,n){n.type!=="file"&&(n.value=t.value),n.type==="radio"&&n.name&&(n.name=`mat-clone-${n.name}-${wD++}`)}function D0(t,n){let e=n.getContext("2d");if(e)try{e.drawImage(t,0,0)}catch{}}function mh(t,n,e){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];o?t.setProperty(i,o,e?.has(i)?"important":""):t.removeProperty(i)}return t}function O0(t){mh(t.style,{"touch-action":"none","-webkit-user-drag":"none","-webkit-tap-highlight-color":"transparent","user-select":"none","-ms-user-select":"none","-webkit-user-select":"none","-moz-user-select":"none"})}function N0(t,n,e){return SD(t,e).dataset[n]}function SD(t,n){return t.closest(n)}function gh(t,n){let e=t.rootNodes;if(e.length===1&&e[0].nodeType===n.ELEMENT_NODE)return e[0];let i=n.createElement("div");return e.forEach(o=>i.appendChild(o)),i}function Do(t,n){let e=ID(t,n);return!!e&&!e.classList.contains(n+"-disabled")}function ID(t,n){return t.closest(n)}function en(t){return t.match(/^[a-zA-Z_]/)||(t="_"+t),t.replace(/[^a-zA-Z0-9_\-:.]/g,"_")}function qi(t,n,e){let i=e[t.toUpperCase()]||TD(e,t.toLowerCase());if(i===void 0)throw new Error(`Unknown ${n}: ${t}. Accepted values: ${Object.keys(e).join(", ")}`);return i}function TD(t,n){return Object.keys(t).find(e=>t[e]===n)}var ED=["markerElement"],PD=["fConnectionGradientRenderer",""],MD=["f-connection-path",""],kD=["fConnectionSelection",""],DD=["f-connection-drag-handle-start",""],OD=["f-connection-drag-handle-end",""],ND=["defs"],RD=["*"],AD=["fGroupsContainer"],FD=["fNodesContainer"],LD=["fConnectionsContainer"],BD=[[["","fGroup",""],["","fGroups",""]],[["f-snap-connection"]],[["f-connection"],["","fConnections",""]],[["f-connection-for-create"]],[["","fNode",""],["","fNodes",""]]],zD=["[fGroup], [fGroups]","f-snap-connection","f-connection, [fConnections]","f-connection-for-create","[fNode], [fNodes]"],qD=[[["svg","fMarker",""]],[["f-connection-marker-circle"],["f-connection-marker-arrow"]],[["f-connection-gradient"]],[["f-connection-waypoints"]],[["","fConnectionContent",""]]],VD=["svg[fMarker]","f-connection-marker-circle, f-connection-marker-arrow","f-connection-gradient","f-connection-waypoints","[fConnectionContent]"];function GD(t,n){t&1&&(it(),L(0,"linearGradient",3)),t&2&&M("fConnectionGradientRendererFor",n)}function HD(t,n){t&1&&(it(),L(0,"circle",6))}function jD(t,n){t&1&&Ae(0,4)}var UD="[_nghost-%COMP%]{display:block;position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}",WD=[[["","fDefinitions",""]],[["f-background"]],[["f-line-alignment"]],[["f-canvas"]],[["f-selection-area"]],"*"],$D=["[fDefinitions]","f-background","f-line-alignment","f-canvas","f-selection-area","*"],xh=new he("F_BACKGROUND_PATTERN"),Qd=class{fPattern;static fToken=Symbol("AddPatternToBackgroundRequest");constructor(n){this.fPattern=n}},Ui=class{_items=[];_byId=new Map;get(n){return this._byId.get(n)}require(n){let e=this._byId.get(n);if(!e)throw new Error(`${this.kind} not found: ${n}`);return e}has(n){return this._byId.has(n)}getAll(){return this._items}size(){return this._items.length}add(n){let e=n.fId();if(this._byId.has(e))throw new Error(`${this.kind} already exists: ${e}`);this._items.push(n),this._byId.set(e,n)}addMany(n){for(let e of n)this.add(e)}remove(n){let e=n.fId(),i=this._byId.get(e);if(!i)return!1;this._byId.delete(e);let o=this._items.indexOf(i);return o>=0&&this._items.splice(o,1),!0}removeById(n){let e=this._byId.get(n);if(!e)return;this._byId.delete(n);let i=this._items.indexOf(e);return i>=0&&this._items.splice(i,1),e}clear(){this._items.length=0,this._byId.clear()}};function Yn(t){return{name:t}}var bh=class{_instances=new Map;get(n){return this._instances.get(n.name)}require(n){let e=this.get(n);if(!e)throw new Error(`Instance not found: ${n.name}`);return e}has(n){return this._instances.has(n.name)}add(n,e){if(this._instances.has(n.name))throw new Error(`${n.name} already exists`);this._instances.set(n.name,e)}remove(n){if(!this._instances.has(n.name))throw new Error(`${n.name} does not exist`);return this._instances.delete(n.name),!0}clear(){this._instances.clear()}},No=class extends Ui{kind;constructor(n){super(),this.kind=n}},wh=class extends Ui{kind="Connection Marker"},Sh=class extends Ui{kind="Connection";_instancesForCreate;_instancesForSnap;getForSnap(){return this._instancesForSnap}getForCreate(){return this._instancesForCreate}addForCreate(n){this._instancesForCreate=n}addForSnap(n){this._instancesForSnap=n}removeInstanceForCreate(){this._instancesForCreate=void 0}removeInstanceForSnap(){this._instancesForSnap=void 0}},Ih=class extends Ui{kind="Node"},Gi=class{notifyOnSubscribe;static fToken=Symbol("ListenConnectionsChangesRequest");constructor(n=!0){this.notifyOnSubscribe=n}};function KD(){return t=>{let n=null,e=null,i=()=>{n!==null&&cancelAnimationFrame(n),e!==null&&cancelAnimationFrame(e),n=e=null};return{callback:()=>{i(),n=requestAnimationFrame(()=>{n=null,e=requestAnimationFrame(()=>{e=null,t()})})},cleanup:i}}}function YD(){return t=>{let n=null;return{callback:()=>{n!==null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{n=null,t()})},cleanup:()=>{n!==null&&cancelAnimationFrame(n),n=null}}}}function Jd(t){return n=>{let e=null;return{callback:()=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,n()},t)},cleanup:()=>{e!==null&&clearTimeout(e),e=null}}}}var Tt=class{_listeners=new Set;notify(){this._listeners.forEach(n=>n())}listen(n){return this._listeners.add(n),()=>this.stop(n)}stop(n){this._listeners.delete(n)}},Th=class extends Tt{_htmlElement;_observer=new ResizeObserver(()=>this.notify());_isObserving=!1;constructor(n){super(),this._htmlElement=n}listen(n){return this._isObserving||(this._observer.observe(this._htmlElement),this._isObserving=!0),super.listen(n)}stop(n){super.stop(n),this._listeners.size===0&&this._disconnect()}_disconnect(){this._observer.unobserve(this._htmlElement),this._observer.disconnect(),this._isObserving=!1}},Vt=class t{_channels=[];_operators=[];constructor(...n){this._channels=[...n]}pipe(...n){let e=new t(...this._channels);return e._operators=[...this._operators,...n],e}listen(n,e){let i=e,o=[],r=[],a=[];for(let h of[...this._operators].reverse()){let v=h(i);i=v.callback,v.cleanup&&o.push(v.cleanup),v.onSubscribe&&r.push(v.onSubscribe),v.setTeardown&&a.push(v.setTeardown)}let s=this._channels.map(h=>h.listen(()=>i())),c=null,d=!1,f=()=>{d||(d=!0,c?.(),c=null,s.forEach(h=>h()),o.forEach(h=>h()))};a.slice().reverse().forEach(h=>h(f)),r.slice().reverse().forEach(h=>h(i)),c=n.onDestroy(f)}};function kf(){return t=>{let n=!0;return{callback:t,onSubscribe:e=>{queueMicrotask(()=>{n&&e()})},cleanup:()=>{n=!1}}}}function R0(){return t=>{let n=!1,e=null;return{setTeardown:i=>e=i,callback:()=>{if(!n){n=!0;try{t()}finally{e?.()}}}}}}var XD=(()=>{let t=class Ma{_store=u(N);handle({notifyOnSubscribe:e}){return e?new Vt(this._store.connectionsChanges$).pipe(kf(),Jd(1)):new Vt(this._store.connectionsChanges$).pipe(Jd(1))}static \u0275fac=function(i){return new(i||Ma)};static \u0275prov=C({token:Ma,factory:Ma.\u0275fac})};return t=S([I(Gi)],t),t})(),Eh=class{static fToken=Symbol("ListenNodesChangesRequest")},ZD=(()=>{let t=class ka{_store=u(N);handle(e){return new Vt(this._store.nodesChanges$)}static \u0275fac=function(i){return new(i||ka)};static \u0275prov=C({token:ka,factory:ka.\u0275fac})};return t=S([I(Eh)],t),t})(),el=class{static fToken=Symbol("ListenTransformChangesRequest")},QD=(()=>{let t=class Da{_store=u(N);handle(e){return new Vt(this._store.transformChanges$,this._store.connectionsChanges$,this._store.nodesChanges$)}static \u0275fac=function(i){return new(i||Da)};static \u0275prov=C({token:Da,factory:Da.\u0275fac})};return t=S([I(el)],t),t})(),Xn=class{static fToken=Symbol("EmitConnectionsChangesRequest")},JD=(()=>{let t=class Oa{_store=u(N);handle(e){this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||Oa)};static \u0275prov=C({token:Oa,factory:Oa.\u0275fac})};return t=S([I(Xn)],t),t})(),xn=class{static fToken=Symbol("NotifyTransformChangedRequest")},N=(()=>{class t{transformChanges$=new Tt;viewportAnimationChanges$=new Tt;connectionsChanges$=new Tt;_connectionsRevision=0;connectionsRenderedChanges$=new Tt;_connectionsRenderedRevision=0;_connectionsRenderedNodesRevision=0;_viewportAnimationCount=0;nodesChanges$=new Tt;_nodesRevision=0;progressiveRenderChanges$=new Tt;_pendingProgressiveRenderCount=0;get connectionsRevision(){return this._connectionsRevision}get connectionsRenderedRevision(){return this._connectionsRenderedRevision}get connectionsRenderedNodesRevision(){return this._connectionsRenderedNodesRevision}get nodesRevision(){return this._nodesRevision}get hasPendingProgressiveRender(){return this._pendingProgressiveRenderCount>0}get isViewportAnimating(){return this._viewportAnimationCount>0}get flowHost(){return this.fFlow?.hostElement}fFlow;fCanvas;get transform(){return this.fCanvas?.transform}nodes=new Ih;connections=new Sh;connectionMarkers=new wh;outputs=new No("Output");inputs=new No("Input");outlets=new No("Outlet");instances=new bh;fDraggable;emitNodeChanges(){this._nodesRevision++,this.nodesChanges$.notify()}emitConnectionChanges(){this._connectionsRevision++,this.connectionsChanges$.notify()}completeConnectionsRender(e,i){e<this._connectionsRenderedRevision||e===this._connectionsRenderedRevision&&i<=this._connectionsRenderedNodesRevision||(this._connectionsRenderedRevision=Math.min(e,this._connectionsRevision),this._connectionsRenderedNodesRevision=i,this.connectionsRenderedChanges$.notify())}beginProgressiveRender(){this._pendingProgressiveRenderCount++,this.progressiveRenderChanges$.notify()}endProgressiveRender(){this._pendingProgressiveRenderCount&&(this._pendingProgressiveRenderCount--,this.progressiveRenderChanges$.notify())}transformChanged(){this.transformChanges$.notify()}beginViewportAnimation(){this._viewportAnimationCount++,this.viewportAnimationChanges$.notify()}endViewportAnimation(){this._viewportAnimationCount&&(this._viewportAnimationCount--,this.viewportAnimationChanges$.notify())}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),Pe={MAGNETIC_LINES:Yn("magnetic-lines"),MAGNETIC_RECTS:Yn("magnetic-rects"),ZOOM:Yn("zoom-controls"),BACKGROUND:Yn("background"),SELECTION_AREA:Yn("selection-area"),MINIMAP:Yn("minimap"),AUTO_PAN:Yn("auto-pan")},eO=(()=>{let t=class Na{_store=u(N);handle(e){this._store.transformChanged()}static \u0275fac=function(i){return new(i||Na)};static \u0275prov=C({token:Na,factory:Na.\u0275fac})};return t=S([I(xn)],t),t})(),bn=class{key;instance;static fToken=Symbol("RegisterPluginInstanceRequest");constructor(n,e){this.key=n,this.instance=e}},tO=(()=>{let t=class Ra{_store=u(N);handle({key:e,instance:i}){this._store.instances.add(e,i)}static \u0275fac=function(i){return new(i||Ra)};static \u0275prov=C({token:Ra,factory:Ra.\u0275fac})};return t=S([I(bn)],t),t})(),wn=class{key;static fToken=Symbol("RemovePluginInstanceRequest");constructor(n){this.key=n}},nO=(()=>{let t=class Aa{_store=u(N);handle({key:e}){this._store.instances.remove(e)}static \u0275fac=function(i){return new(i||Aa)};static \u0275prov=C({token:Aa,factory:Aa.\u0275fac})};return t=S([I(wn)],t),t})(),iO=[N,ZD,XD,QD,JD,eO,tO,nO],oO=0,rO=(()=>{let t=class Fa{_store=u(N);_browser=u(je);get _backgroundElement(){return this._store.instances.get(Pe.BACKGROUND)?.hostElement}handle(e){let i=this._getPatterns(e.fPattern?.hostElement);if(!i?.length)return;let o=ji("defs",this._browser);if(e.fPattern?.hostElement.remove(),i.forEach(r=>{o.append(r)}),i.length){this._backgroundElement?.firstChild?.appendChild(o),i[i.length-1].id="f-background-pattern-"+oO++;let r=i[i.length-1].id,a=ji("rect",this._browser);a.setAttribute("fill","url(#"+r+")"),a.setAttribute("width","100%"),a.setAttribute("height","100%"),this._backgroundElement?.firstChild?.appendChild(a);let s=this._store.fCanvas?.transform||gn.default();e.fPattern?.setTransform(s)}}_getPatterns(e){return Array.from(e?.getElementsByTagName("pattern")||[])}static \u0275fac=function(i){return new(i||Fa)};static \u0275prov=C({token:Fa,factory:Fa.\u0275fac})};return t=S([I(Qd)],t),t})(),Ro=class{fTransform;static fToken=Symbol("SetBackgroundTransformRequest");constructor(n){this.fTransform=n}},aO=(()=>{let t=class La{_store=u(N);handle(e){this._store.instances.get(Pe.BACKGROUND)?.setTransform(e.fTransform)}static \u0275fac=function(i){return new(i||La)};static \u0275prov=C({token:La,factory:La.\u0275fac})};return t=S([I(Ro)],t),t})(),sO=[rO,aO],tl=class{instance;static fToken=Symbol("AddCanvasToStoreRequest");constructor(n){this.instance=n}},cO=(()=>{let t=class Ba{_store=u(N);handle({instance:e}){this._store.fCanvas=e}static \u0275fac=function(i){return new(i||Ba)};static \u0275prov=C({token:Ba,factory:Ba.\u0275fac})};return t=S([I(tl)],t),t})(),nl=class{id;animated;static fToken=Symbol("CenterGroupOrNodeRequest");constructor(n,e){this.id=n,this.animated=e}},dO=(()=>{let t=class za{_store=u(N);_mediator=u(R);get _transform(){return this._store.transform}handle({id:e,animated:i}){let o=this._store.nodes.get(e);o&&(this._toCenter(this._getNodeRect(o),this._getFlowRect(),o._position),this._mediator.execute(new Wi(i,Zn.VIEWPORT_ONLY)))}_toCenter(e,i,o){this._transform.scaledPosition=B.initialize(),this._transform.position=B.initialize((i.width-e.width)/2-o.x*this._transform.scale,(i.height-e.height)/2-o.y*this._transform.scale)}_getNodeRect(e){return W.fromElement(e.hostElement)}_getFlowRect(){return W.fromElement(this._store.flowHost)}static \u0275fac=function(i){return new(i||za)};static \u0275prov=C({token:za,factory:za.\u0275fac})};return t=S([I(nl)],t),t})(),il=class{toCenter;animated;static fToken=Symbol("FitToFlowRequest");constructor(n,e){this.toCenter=n,this.animated=e}},lO=(()=>{let t=class qa{_store=u(N);get _transform(){return this._store.transform}_mediator=u(R);handle({toCenter:e,animated:i}){let o=this._mediator.execute(new Ji)||W.initialize();o.width===0||o.height===0||(this.fitToParent(o,W.fromElement(this._store.flowHost),this._store.nodes.getAll().map(r=>r._position),e),this._mediator.execute(new Wi(i,Zn.VIEWPORT_ONLY)))}fitToParent(e,i,o,r){this._transform.scaledPosition=B.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let a=e.width/this._transform.scale+r.x,s=e.height/this._transform.scale+r.y;(a>i.width||s>i.height||a<i.width&&s<i.height)&&(this._transform.scale=Math.min(i.width/a,i.height/s));let c=(i.width-a*this._transform.scale)/2-this._transform.position.x*this._transform.scale,d=(i.height-s*this._transform.scale)/2-this._transform.position.y*this._transform.scale;this._transform.position=B.initialize(c+r.x/2*this._transform.scale,d+r.y/2*this._transform.scale)}_getZeroPositionWithoutScale(e){let i=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return B.initialize(i,o)}static \u0275fac=function(i){return new(i||qa)};static \u0275prov=C({token:qa,factory:qa.\u0275fac})};return t=S([I(il)],t),t})(),ol=class{transform;position;static fToken=Symbol("InputCanvasPositionRequest");constructor(n,e){this.transform=n,this.position=e}},uO=(()=>{let t=class Va{_store=u(N);handle({transform:e,position:i}){i&&(B.isEqual(this._calculateTransformPosition(e),i)||(e.position=i,e.scaledPosition=B.initialize(),this._store.fCanvas?.redraw()))}_calculateTransformPosition(e){return B.sum(e.position,e.scaledPosition)}static \u0275fac=function(i){return new(i||Va)};static \u0275prov=C({token:Va,factory:Va.\u0275fac})};return t=S([I(ol)],t),t})(),rl=class{transform;scale;static fToken=Symbol("InputCanvasScaleRequest");constructor(n,e){this.transform=n,this.scale=e}},fO=(()=>{let t=class Ga{_store=u(N);handle(e){!e.scale&&e.scale!==0||(e.transform.scale=e.scale,this._store.fCanvas?.redraw())}static \u0275fac=function(i){return new(i||Ga)};static \u0275prov=C({token:Ga,factory:Ga.\u0275fac})};return t=S([I(rl)],t),t})(),Zn=(function(t){return t.VIEWPORT_ONLY="VIEWPORT_ONLY",t.WITH_CONNECTION_CHANGES="WITH_CONNECTION_CHANGES",t})(Zn||{}),Wi=class{animated;context;static fToken=Symbol("RedrawCanvasWithAnimationRequest");constructor(n,e=Zn.WITH_CONNECTION_CHANGES){this.animated=n,this.context=e}};function sy(t,n){let e=i=>{i.propertyName==="transform"&&(t.removeEventListener("transitionend",e),n(i))};t.addEventListener("transitionend",e)}var pO=(()=>{let t=class Ha{_store=u(N);get _canvas(){return this._store.fCanvas}handle(e){e.animated?this._redrawWithAnimation(e.context):this._redraw(e.context),this._canvas?.emitCanvasChangeEvent()}_redrawWithAnimation(e){this._store.beginViewportAnimation(),this._canvas?.redrawWithAnimation(),sy(this._canvas.hostElement,()=>{this._store.endViewportAnimation(),e===Zn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()})}_redraw(e){this._canvas?.redraw(),e===Zn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||Ha)};static \u0275prov=C({token:Ha,factory:Ha.\u0275fac})};return t=S([I(Wi)],t),t})(),al=class{static fToken=Symbol("RemoveCanvasFromStoreRequest")},hO=(()=>{let t=class ja{_store=u(N);handle(e){this._store.fCanvas=void 0}static \u0275fac=function(i){return new(i||ja)};static \u0275prov=C({token:ja,factory:ja.\u0275fac})};return t=S([I(al)],t),t})(),sl=class{static fToken=Symbol("ResetScaleRequest")},mO=(()=>{let t=class Ua{_store=u(N);get _transform(){return this._store.transform}handle(e){this._transform.scale=1,this._transform.scaledPosition=B.initialize()}static \u0275fac=function(i){return new(i||Ua)};static \u0275prov=C({token:Ua,factory:Ua.\u0275fac})};return t=S([I(sl)],t),t})(),cl=class{animated;static fToken=Symbol("ResetScaleAndCenterRequest");constructor(n){this.animated=n}},gO=(()=>{let t=class Wa{_mediator=u(R);_store=u(N);get _transform(){return this._store.transform}handle({animated:e}){let i=this._mediator.execute(new Ji)||W.initialize();i.width===0||i.height===0||(this._oneToOneCentering(i,W.fromElement(this._store.flowHost),this._store.nodes.getAll().map(o=>o._position)),this._mediator.execute(new Wi(e,Zn.VIEWPORT_ONLY)))}_oneToOneCentering(e,i,o){this._transform.scaledPosition=B.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let r=(i.width-e.width/this._transform.scale)/2-this._transform.position.x,a=(i.height-e.height/this._transform.scale)/2-this._transform.position.y;this._transform.scale=1,this._transform.position=B.initialize(r,a)}_getZeroPositionWithoutScale(e){let i=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return B.initialize(i,o)}static \u0275fac=function(i){return new(i||Wa)};static \u0275prov=C({token:Wa,factory:Wa.\u0275fac})};return t=S([I(cl)],t),t})(),dl=class{scale;toPosition;static fToken=Symbol("UpdateScaleRequest");constructor(n,e){this.scale=n,this.toPosition=e}},_O=(()=>{let t=class $a{_store=u(N);get _transform(){return this._store.transform}handle({scale:e,toPosition:i}){if(e===this._transform.scale)return;let o=B.sum(this._transform.scaledPosition,this._transform.position),r=i.x-(i.x-o.x)*e/this._transform.scale,a=i.y-(i.y-o.y)*e/this._transform.scale;this._transform.scale=e,this._transform.scaledPosition=B.sub(B.initialize(r,a),this._transform.position)}static \u0275fac=function(i){return new(i||$a)};static \u0275prov=C({token:$a,factory:$a.\u0275fac})};return t=S([I(dl)],t),t})(),yO=[cO,dO,lO,uO,fO,pO,hO,mO,gO,_O],Ph=class{connection;static fToken=Symbol("AddConnectionForCreateToStoreRequest");constructor(n){this.connection=n}},vO=(()=>{let t=class Ka{_store=u(N);handle({connection:e}){this._store.connections.addForCreate(e)}static \u0275fac=function(i){return new(i||Ka)};static \u0275prov=C({token:Ka,factory:Ka.\u0275fac})};return t=S([I(Ph)],t),t})(),ll=class{instance;static fToken=Symbol("AddConnectionMarkerToStoreRequest");constructor(n){this.instance=n}},CO=(()=>{let t=class Ya{_store=u(N);handle({instance:e}){this._store.connectionMarkers.add(e),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||Ya)};static \u0275prov=C({token:Ya,factory:Ya.\u0275fac})};return t=S([I(ll)],t),t})(),ul=class{connection;static fToken=Symbol("AddConnectionToStoreRequest");constructor(n){this.connection=n}},xO=(()=>{let t=class Xa{_store=u(N);handle({connection:e}){this._store.connections.add(e),this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||Xa)};static \u0275prov=C({token:Xa,factory:Xa.\u0275fac})};return t=S([I(ul)],t),t})(),Mh=class{connection;static fToken=Symbol("AddSnapConnectionToStoreRequest");constructor(n){this.connection=n}},bO=(()=>{let t=class Za{_store=u(N);handle({connection:e}){this._store.connections.addForSnap(e)}static \u0275fac=function(i){return new(i||Za)};static \u0275prov=C({token:Za,factory:Za.\u0275fac})};return t=S([I(Mh)],t),t})(),$i=class{connection;static fToken=Symbol("CreateConnectionMarkersRequest");constructor(n){this.connection=n}},A0=new he("F_CONNECTION_CONTENT");var fl=class t{points;cumulativeLengths;segmentTangents;totalLength;constructor(n){let e=t._removeConsecutiveDuplicates(n);if(e.length<2){this.points=[{x:0,y:0},{x:1,y:0}],this.cumulativeLengths=[0,1],this.segmentTangents=[{x:1,y:0}],this.totalLength=1;return}this.points=e;let i=this.points.length,o=i-1,r=new Array(i).fill(0),a=new Array(o),s=0;for(let c=0;c<o;c++){let d=this.points[c+1].x-this.points[c].x,f=this.points[c+1].y-this.points[c].y,h=Math.hypot(d,f),v=h?d/h:1,b=h?f/h:0;a[c]={x:v,y:b},s+=h,r[c+1]=s}this.cumulativeLengths=r,this.segmentTangents=a,this.totalLength=s||1}static from(n){return new t(n.map(e=>({x:e.x,y:e.y})))}static _removeConsecutiveDuplicates(n){let e=[];for(let i of n){let o=e[e.length-1];(!o||o.x!==i.x||o.y!==i.y)&&e.push({x:i.x,y:i.y})}return e}},kh=class t{_polyline;constructor(n=[]){this._polyline=new fl(n)}updatePoints(n){return this._polyline=new fl(n),this._polyline.totalLength}calculateTotalLength(n){return this.updatePoints(n)}get totalLength(){return this._polyline.totalLength}getPointAtProgress(n){let{points:e,cumulativeLengths:i,segmentTangents:o,totalLength:r}=this._polyline,s=t._clamp(n,0,1)*r,c=.5;if(s<=c)return{point:e[0],tangent:o[0]??{x:1,y:0},atEdge:!0};if(r-s<=c){let A=e.length-1;return{point:e[A],tangent:o[A-1]??{x:1,y:0},atEdge:!0}}let d=t._findRightIndex(i,s),f=Math.max(1,d),h=i[f-1],v=i[f],b=t._safeRatio(s-h,v-h),w=e[f-1],T=e[f],k={x:t._lerp(w.x,T.x,b),y:t._lerp(w.y,T.y,b)},O=o[f-1]??{x:1,y:0};return{point:k,tangent:O,atEdge:!1}}getPointAtLength(n){return this.getPointAtProgress(n)}getPointAtDistance(n){let e=this._polyline.totalLength?n/this._polyline.totalLength:0;return this.getPointAtProgress(e)}static _findRightIndex(n,e){let i=0,o=n.length-1;for(;i<o;){let r=i+o>>1;n[r]<e?i=r+1:o=r}return i}static _lerp(n,e,i){return n+(e-n)*i}static _clamp(n,e,i){return n<e?e:n>i?i:n}static _safeRatio(n,e){let i=Math.abs(e)<1e-6?1e-6:e;return n/i}},cy=(function(t){return t.NONE="none",t.ALONG="along",t})(cy||{}),Dh=class{compute(n,e){let i=this._clamp01(e.position()),{point:o,tangent:r}=n.getPointAtLength(i),a={x:-r.y,y:r.x},s=e.offset()??0,c=o.x+a.x*s,d=o.y+a.y*s,h=this._sizeAlongDirection(e.hostElement,r)*.5,v=i*n.totalLength,b=n.totalLength-v,w=this._applyEdgeGuard(c,d,r,v,b,h),T=this._calculateContentRotation(e.align(),r);return{position:w,rotationDeg:T}}_clamp01(n){return n<=0?0:n>=1?1:n}_applyEdgeGuard(n,e,i,o,r,a){if(o<=a){let s=a-o;return{x:n+i.x*s,y:e+i.y*s}}if(r<=a){let s=a-r;return{x:n-i.x*s,y:e-i.y*s}}return{x:n,y:e}}_sizeAlongDirection(n,e){let i=W.fromElement(n);return Math.abs(e.x)*i.width+Math.abs(e.y)*i.height}_normalize180(n){let e=(n+180)%360;return e<0&&(e+=360),e-180}_keepUpright(n){let e=this._normalize180(n);return e>90?e-=180:e<-90&&(e+=180),e}_calculateContentRotation(n,e){let i=0;return n===cy.ALONG&&(i=Math.atan2(e.y,e.x)*180/Math.PI,i=this._keepUpright(i)),i}},Oh=class{_placement;constructor(n=new Dh){this._placement=n}layout(n,e){let i=new kh(n),o=i.totalLength;for(let r of e){let{position:a,rotationDeg:s}=this._placement.compute(i,r);r.hostElement.style.transform=this._createTransformString(a,s)}return o}_createTransformString(n,e){return`translate3d(${n.x}px, ${n.y}px, 0) translate(-50%, -50%) rotate(${e}deg)`}};var F0=new he("F_CONNECTION_WAYPOINTS");function dy(t,n,e){return(t.x-n.x)**2+(t.y-n.y)**2<=e**2}function wO(t,n){let e=t.fWaypoints(),i=e?.radius()||8;return e?.candidates().find(o=>dy(n,o,i))}function SO(t,n){let e=t.fWaypoints(),i=e?.radius()||8;return e?.waypoints().find(o=>dy(n,o,i))}function IO(t,n){for(let e of t){let i=SO(e,n);if(i&&e.fWaypoints()?.visibility())return{connection:e,waypoint:i};let o=wO(e,n);if(o&&e.fWaypoints()?.visibility())return{connection:e,candidate:o}}}var Df=new he("F_CONNECTION_COMPONENTS_PARENT");var xe=(function(t){return t.START="f-connection-marker-start",t.END="f-connection-marker-end",t.SELECTED_START="f-connection-selected-marker-start",t.SELECTED_END="f-connection-selected-marker-end",t.START_ALL_STATES="f-connection-marker-start-all-states",t.END_ALL_STATES="f-connection-marker-end-all-states",t})(xe||{}),pl=new he("F_CONNECTION_MARKER"),TO=0,hl=class{fId=j(`f-marker-${TO++}`);hostElement=u(Be).nativeElement};function ly(t,n=xe.START){if(typeof t!="string")return n;let e=t.trim().toLowerCase();return e?EO(e)??n:n}function EO(t){switch(t){case"start":case"f-connection-marker-start":return xe.START;case"end":case"f-connection-marker-end":return xe.END;case"selected-start":case"f-connection-selected-marker-start":return xe.SELECTED_START;case"selected-end":case"f-connection-selected-marker-end":return xe.SELECTED_END;case"start-all-states":case"f-connection-marker-start-all-states":case"start-all":case"all-start":return xe.START_ALL_STATES;case"end-all-states":case"f-connection-marker-end-all-states":case"end-all":case"all-end":return xe.END_ALL_STATES;default:return null}}var uy=(()=>{class t extends hl{_markerElement=ze.required("markerElement");_type=F(xe.END_ALL_STATES,{alias:"type",transform:e=>ly(e,xe.END_ALL_STATES)});get markerElement(){return this._markerElement().nativeElement}width=6;height=7;refX=5.5;refY=3.5;get type(){return this._type()}orient="auto";markerUnits="strokeWidth";static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-connection-marker-arrow"]],viewQuery:function(i,o){i&1&&Ot(o._markerElement,ED,5),i&2&&_t()},hostAttrs:[1,"f-component",2,"display","none"],inputs:{_type:[1,"type","_type"]},features:[we([{provide:pl,useExisting:t}]),ve],decls:3,vars:0,consts:[["markerElement",""],["viewBox","0 0 6 6",1,"f-marker"],["d","M0,0 L6,3 0,6Z"]],template:function(i,o){i&1&&(it(),K(0,"svg",1,0),dn(2,"path",2),Y())},encapsulation:2})}return t})();var fy=(()=>{class t extends hl{_mediator=u(R);markerElement=this.hostElement;width=0;height=0;refX=0;refY=0;type=xe.START;orient="auto";markerUnits="strokeWidth";ngOnInit(){this.hostElement.style.display="none",this._mediator.execute(new ll(this))}ngOnDestroy(){this._mediator.execute(new Ll(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,selectors:[["svg","fMarker",""]],hostAttrs:[1,"f-component","f-marker"],inputs:{width:"width",height:"height",refX:"refX",refY:"refY",type:[2,"type","type",e=>ly(e,xe.START)],orient:"orient",markerUnits:"markerUnits"},standalone:!1,features:[we([{provide:pl,useExisting:t}]),ve]})}return t})(),vn=(function(t){return t.FIXED="fixed",t.FIXED_CENTER="fixed_center",t.FLOATING="floating",t})(vn||{}),Ee=(function(t){return t.DEFAULT="default",t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right",t.CALCULATE="calculate",t.CALCULATE_HORIZONTAL="calculate_horizontal",t.CALCULATE_VERTICAL="calculate_vertical",t})(Ee||{});function PO({sourceRect:t,targetRect:n}){return{point1:t.gravityCenter,point2:n.gravityCenter}}var z=(function(t){return t.LEFT="left",t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.CALCULATE="calculate",t.CALCULATE_HORIZONTAL="calculate_horizontal",t.CALCULATE_VERTICAL="calculate_vertical",t.AUTO="auto",t})(z||{}),Vi=(function(t){return t.SEGMENT="segment",t.STRAIGHT="straight",t.BEZIER="bezier",t.ADAPTIVE_CURVE="adaptive-curve",t})(Vi||{});function MO({sourceRect:t,sourceConnectableSide:n,targetRect:e,targetConnectableSide:i}){return{point1:L0(t,n===z.AUTO?z.BOTTOM:n),point2:L0(e,i===z.AUTO?z.TOP:i)}}function L0(t,n){switch(n){case z.TOP:return{x:t.x+t.width/2,y:t.y};case z.BOTTOM:return{x:t.x+t.width/2,y:t.y+t.height};case z.LEFT:return{x:t.x,y:t.y+t.height/2};case z.RIGHT:return{x:t.x+t.width,y:t.y+t.height/2};default:throw new Error(`Unknown side: ${n}`)}}function py(t,n,e,i){if(!i||!i.rotationDeg)return zi.getRoundedRectIntersections(t,n,e)[0];let o=Qa(t,-i.rotationDeg,i.pivot),r=Qa(n,-i.rotationDeg,i.pivot),a=kO(e,-i.rotationDeg,i.pivot),s=zi.getRoundedRectIntersections(o,r,a)[0];return s?Qa(s,i.rotationDeg,i.pivot):void 0}function kO(t,n,e){let i=Qa(DO(t),n,e);return new He(i.x-t.width/2,i.y-t.height/2,t.width,t.height,t.radius1,t.radius2,t.radius3,t.radius4)}function DO(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Qa(t,n,e){let i=t.x-e.x,o=t.y-e.y,r=n*Math.PI/180,a=Math.cos(r),s=Math.sin(r);return{x:i*a-o*s+e.x,y:i*s+o*a+e.y}}function OO({sourceRect:t,targetRect:n,sourceRotationContext:e,targetRotationContext:i}){return AO(NO(t,n,e),RO(t,n,i),t,n)}function NO(t,n,e){return py(t.gravityCenter,n.gravityCenter,t,e)}function RO(t,n,e){return py(n.gravityCenter,t.gravityCenter,n,e)}function AO(t,n,e,i){return{point1:t||e.gravityCenter,point2:n||i.gravityCenter}}var Ea=.5,FO={[vn.FLOATING]:OO,[vn.FIXED_CENTER]:PO,[vn.FIXED]:MO},ro=(()=>{class t{handle(e){let i=this._calculateDirectionalVectors(e.sourceRect.gravityCenter.x,e.sourceRect.gravityCenter.y,e.targetRect.gravityCenter.x,e.targetRect.gravityCenter.y),o=this._determineSourceSide(e,i),r=this._determineTargetSide(e,i);return e.connection._applyResolvedSidesToConnection(o,r),this._getBehaviorHandler(e.connection.fBehavior)({sourceRect:e.sourceRect,targetRect:e.targetRect,sourceConnectableSide:o,targetConnectableSide:r,sourceRotationContext:e.sourceRotationContext,targetRotationContext:e.targetRotationContext})}_calculateDirectionalVectors(e,i,o,r){let a=o-e,s=r-i;return{sourceToTargetX:a,sourceToTargetY:s,targetToSourceX:-a,targetToSourceY:-s}}_determineSourceSide(e,i){return this._resolveConnectableSide(e.connection.fOutputSide(),i.sourceToTargetX,i.sourceToTargetY,e.sourceConnectableSide)}_determineTargetSide(e,i){return this._resolveConnectableSide(e.connection.fInputSide(),i.targetToSourceX,i.targetToSourceY,e.targetConnectableSide)}_resolveConnectableSide(e,i,o,r){if(e===Ee.DEFAULT)return r;let a=Math.abs(i),s=Math.abs(o);if(a<Ea&&s<Ea)return r;let d=a>=s;switch(e){case Ee.CALCULATE:return d?i>=0?z.RIGHT:z.LEFT:o>=0?z.BOTTOM:z.TOP;case Ee.CALCULATE_HORIZONTAL:return a<Ea?r:i>=0?z.RIGHT:z.LEFT;case Ee.CALCULATE_VERTICAL:return s<Ea?r:o>=0?z.BOTTOM:z.TOP;case Ee.TOP:return z.TOP;case Ee.BOTTOM:return z.BOTTOM;case Ee.LEFT:return z.LEFT;case Ee.RIGHT:return z.RIGHT;default:return r}}_getBehaviorHandler(e){let i=FO[e];if(!i)throw new Error(`[Behavior] No handler for behavior: ${e}`);return i}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),At=class{sourceRect;targetRect;connection;sourceConnectableSide;targetConnectableSide;sourceRotationContext;targetRotationContext;constructor(n,e,i,o,r,a,s){this.sourceRect=n,this.targetRect=e,this.connection=i,this.sourceConnectableSide=o,this.targetConnectableSide=r,this.sourceRotationContext=a,this.targetRotationContext=s}};function Of(t,n,e){return[t,...e??[],n]}function LO(t,n){let e=Math.abs(n.x-t.x)/2,i=n.x<t.x?n.x+e:n.x-e,o=Math.abs(n.y-t.y)/2,r=n.y<t.y?n.y+o:n.y-o;return{x:i,y:r}}function BO(t,n=32){let e=new Array(n+1);e[0]=ae({},t[0]);for(let i=1;i<=n;i++)e[i]=hy(t[0],t[1],t[2],t[3],i/n);return e}function hy(t,n,e,i,o){let r=1-o,a=o*o,s=r*r,c=s*r,d=a*o;return{x:c*t.x+3*s*o*n.x+3*r*a*e.x+d*i.x,y:c*t.y+3*s*o*n.y+3*r*a*e.y+d*i.y}}function my(t){return t.map(n=>hy(n.p0,n.c1,n.c2,n.p3,.5))}function zO(t){if(t.length<2)throw new Error("Polylines must be at least two points");let n=qO(t);return n<=0?[ae({},t[0])]:[VO(t,n/2)]}function qO(t){let n=0;for(let e=0;e<t.length-1;e++)n+=gy(t[e],t[e+1]);return n}function VO(t,n){let e=0;for(let o=0;o<t.length-1;o++){let r=t[o],a=t[o+1],s=gy(r,a);if(!(s<=0)){if(e+s>=n){let c=(n-e)/s;return{x:r.x+(a.x-r.x)*c,y:r.y+(a.y-r.y)*c}}e+=s}}let i=t[t.length-1];return{x:i.x,y:i.y}}function gy(t,n){return Math.hypot(n.x-t.x,n.y-t.y)}function GO(t){let n=[];for(let e of t)for(let i of e){let o=n[n.length-1];(!o||o.x!==i.x||o.y!==i.y)&&n.push(i)}return n}function _y(t){if(!t.length)return"";let n=`M ${t[0].p0.x} ${t[0].p0.y}`;for(let e=0;e<t.length;e++){let i=t[e],o=e===t.length-1,r=o?i.p3.x+2e-4:i.p3.x,a=o?i.p3.y+2e-4:i.p3.y;n+=` C ${i.c1.x} ${i.c1.y}, ${i.c2.x} ${i.c2.y}, ${r} ${a}`}return n}function yy(t,n=16){if(!t.length)return[];let e=[];for(let i=0;i<t.length;i++){let o=t[i],r=BO([o.p0,o.c1,o.c2,o.p3],n);i>0&&r.shift(),e.push(...r)}return e}function HO(t,n=1e-6){let e=t.length;if(e<=2)return t;let i=[];i.push(t[0]);for(let r=1;r<e;r++){let a=t[r],s=i[i.length-1];(Math.abs(a.x-s.x)>n||Math.abs(a.y-s.y)>n)&&i.push(a)}if(i.length<=2)return i;let o=[];o.push(i[0]);for(let r=1;r<i.length-1;r++){let a=o[o.length-1],s=i[r],c=i[r+1],d=Math.abs(a.x-s.x)<=n&&Math.abs(s.x-c.x)<=n,f=Math.abs(a.y-s.y)<=n&&Math.abs(s.y-c.y)<=n;!d&&!f&&o.push(s)}return o.push(i[i.length-1]),o}var Nh=class t{static _dir(n){switch(n){case z.LEFT:return{x:-1,y:0};case z.RIGHT:return{x:1,y:0};case z.TOP:return{x:0,y:-1};case z.BOTTOM:return{x:0,y:1};case z.AUTO:return{x:0,y:0}}return{x:0,y:0}}static _isHorizontal(n){return n===z.LEFT||n===z.RIGHT}static _handleLength(n,e,i,o){let r=Math.abs(e.x-n.x),a=Math.abs(e.y-n.y),s=Math.hypot(r,a),c=i===z.AUTO?Math.max(r,a):this._isHorizontal(i)?r:a,d=Math.max(8,o),f=o+.5*s,h=o*1.05+c*.3;return Math.min(f,Math.max(d,h))}static _softControl(n,e,i,o){let r=this._dir(n),a=i.x-e.x,s=i.y-e.y,c=Math.hypot(a,s)||1,d=a/c,f=s/c;if(n===z.AUTO)return{x:e.x+d*o,y:e.y+f*o};let h=r.x*d+r.y*f,v=.12,b=Math.max(0,-h)*.08,w=Math.min(.2,v+b),T=r.x*(1-w)+d*w,k=r.y*(1-w)+f*w,O=Math.hypot(T,k)||1;return{x:e.x+T/O*o,y:e.y+k/O*o}}handle({source:n,sourceSide:e,target:i,targetSide:o,offset:r,waypoints:a}){let s=Math.max(0,r??0),c=Of(n,i,a),d=[];for(let h=0;h<c.length-1;h++){let v=c[h],b=c[h+1],w=t._handleLength(v,b,e,s),T=t._handleLength(b,v,o,s),k=t._softControl(e,v,b,w),O=t._softControl(o,b,v,T);d.push({p0:v,c1:k,c2:O,p3:b,chainIndex:h})}let f=yy(d,12);return{path:_y(d),secondPoint:d[0]?.c1??n,penultimatePoint:d[d.length-1]?.c2??i,points:f,candidates:my(d)}}},Rh=class{handle({source:n,sourceSide:e,target:i,targetSide:o,offset:r,waypoints:a}){let s=Of(n,i,a),c=[];for(let f=0;f<s.length-1;f++){let h=s[f],v=s[f+1],b=B0(e,h,v,r??0),w=B0(o,v,h,r??0);c.push({p0:h,c1:b,c2:w,p3:v,chainIndex:f})}let d=yy(c,12);return{path:_y(c),secondPoint:c[0]?.c1??n,penultimatePoint:c[c.length-1]?.c2??i,points:d,candidates:my(c)}}};function B0(t,n,e,i){let o={x:n.x,y:n.y};switch(t){case z.LEFT:o.x-=Pa(n.x-e.x,i);break;case z.RIGHT:o.x+=Pa(e.x-n.x,i);break;case z.TOP:o.y-=Pa(n.y-e.y,i);break;case z.BOTTOM:o.y+=Pa(e.y-n.y,i);break;case z.AUTO:break}return o}function Pa(t,n){return t>=n?t:n*Math.sqrt(n-t)}function jO(t){let{axis:n,source:e,target:i,sourceSide:o,targetSide:r,sourceGap:a,targetGap:s,sourceDir:c,targetDir:d,currentDir:f,offset:h,sourceGapOffset:v,targetGapOffset:b}=t,w=UO(a,s),T=WO(n,c,f,w);return o===r?$O(n,e,i,h,c,f,a,s,v,b):T=KO(n,c,d,a,s,w,T),T}function UO(t,n){return{sourceTarget:[{x:t.x,y:n.y}],targetSource:[{x:n.x,y:t.y}]}}function WO(t,n,e,i){return t==="x"?n.x===e?i.targetSource:i.sourceTarget:n.y===e?i.sourceTarget:i.targetSource}function $O(t,n,e,i,o,r,a,s,c,d){let f=Math.abs(n[t]-e[t]);if(f>i)return;let h=Math.min(i-1,i-f);h<=0||(o[t]===r?c[t]=(a[t]>n[t]?-1:1)*h:d[t]=(s[t]>e[t]?-1:1)*h)}function KO(t,n,e,i,o,r,a){let s=t==="x"?"y":"x",c=n[t]===e[s],d=i[s]>o[s],f=i[s]<o[s];return n[t]===1&&(!c&&d||c&&f)||n[t]!==1&&(!c&&f||c&&d)?t==="x"?r.sourceTarget:r.targetSource:a}var Oo=1e-6,z0=2e-4,YO=.75;function XO(t,n){let e=t.length,i=[];i.push(`M ${t[0].x} ${t[0].y}`);for(let r=1;r<e-1;r++)i.push(ZO(t[r-1],t[r],t[r+1],n));let o=t[e-1];return i.push(`L ${o.x+z0} ${o.y+z0}`),i.join(" ")}function ZO(t,n,e,i){let o=n.x,r=n.y;if(i<=0)return`L ${o} ${r}`;let a=Math.abs(t.x-o)<=Oo&&Math.abs(o-e.x)<=Oo,s=Math.abs(t.y-r)<=Oo&&Math.abs(r-e.y)<=Oo;if(a||s)return`L ${o} ${r}`;let c=Math.hypot(o-t.x,r-t.y),d=Math.hypot(e.x-o,e.y-r),f=Math.min(c*.5,d*.5,i);if(f<YO)return`L ${o} ${r}`;if(Math.abs(t.y-r)<=Oo){let k=t.x<e.x?-1:1,O=t.y<e.y?1:-1,A=o+f*k,V=r+f*O;return`L ${A} ${r} Q ${o} ${r} ${o} ${V}`}let v=t.x<e.x?1:-1,b=t.y<e.y?-1:1,w=r+f*b,T=o+f*v;return`L ${o} ${w} Q ${o} ${r} ${T} ${r}`}var q0={[z.LEFT]:B.initialize(-1,0),[z.RIGHT]:B.initialize(1,0),[z.TOP]:B.initialize(0,-1),[z.BOTTOM]:B.initialize(0,1),[z.AUTO]:B.initialize(0,0)},Ah=class{handle({source:n,sourceSide:e,target:i,targetSide:o,waypoints:r,offset:a,radius:s}){let c=Of(n,i,r),d=[],f=[];for(let w=0;w<c.length-1;w++){let T=c[w],k=c[w+1],O=this._getPathPoints(T,e,k,o,a??0);d.push(O),f.push(...zO(O))}let h=HO(GO(d)),v=h.length>1?h[h.length-2]:n,b=h.length>1?h[1]:i;return{path:XO(h,s??0),penultimatePoint:v,secondPoint:b,points:h,candidates:f}}_getPathPoints(n,e,i,o,r){let a=q0[e],s=q0[o],c={x:n.x+a.x*r,y:n.y+a.y*r},d={x:i.x+s.x*r,y:i.y+s.y*r},f=this._getDirection(c,e,d),h=f.x!==0?"x":"y",v=f[h],b=[],w=B.initialize(),T=B.initialize(),k=LO(n,i);if(a[h]*s[h]===-1){let O=[{x:k.x,y:c.y},{x:k.x,y:d.y}],A=[{x:c.x,y:k.y},{x:d.x,y:k.y}];a[h]===v?b=h==="x"?O:A:b=h==="x"?A:O}else b=jO({axis:h,source:n,target:i,sourceSide:e,targetSide:o,sourceGap:c,targetGap:d,sourceDir:a,targetDir:s,currentDir:v,offset:r,sourceGapOffset:w,targetGapOffset:T});return[n,{x:c.x+w.x,y:c.y+w.y},...b,{x:d.x+T.x,y:d.y+T.y},i]}_getDirection(n,e,i){return e===z.LEFT||e===z.RIGHT?n.x<i.x?B.initialize(1,0):B.initialize(-1,0):n.y<i.y?B.initialize(0,1):B.initialize(0,-1)}},V0=2e-4,Fh=class{handle(n){let e=Of(n.source,n.target,n.waypoints),i=e.length,o=e[0],r=`M ${o.x} ${o.y}`,a=new Array(i-1);for(let s=0;s<i-1;s++){let c=e[s],d=e[s+1],f=s===i-2,h=f?d.x+V0:d.x,v=f?d.y+V0:d.y;r+=` L ${h} ${v}`,a[s]={x:(c.x+d.x)*.5,y:(c.y+d.y)*.5}}return{path:r,candidates:a,points:e,secondPoint:e[1]??n.target,penultimatePoint:e[i-2]??n.source}}},QO=new he("F_CONNECTION_BUILDERS"),vy=(()=>{class t{_builtinBuilders={[Vi.STRAIGHT]:new Fh,[Vi.BEZIER]:new Rh,[Vi.ADAPTIVE_CURVE]:new Nh,[Vi.SEGMENT]:new Ah};_providedBuilders;_builders;constructor(){this._providedBuilders=u(QO,{optional:!0})||{},this._builders=ae(ae({},this._builtinBuilders),this._providedBuilders)}handle({type:e,payload:i}){let o=this._builders[e];if(!o)throw this._createBuilderNotFoundError(e);return o.handle(i)}_createBuilderNotFoundError(e){let i=Object.keys(this._builtinBuilders).sort(),o=Object.keys(this._providedBuilders).sort(),r=Object.keys(this._builders).sort(),a=i.filter(c=>c in this._providedBuilders).sort(),s=[`Connection Builder Error: builder type "${e}" not found.`,`Registered types: ${r.length?r.join(", "):"(none)"}`,`Built-in types: ${i.length?i.join(", "):"(none)"}`,`Provided (F_CONNECTION_BUILDERS) types: ${o.length?o.join(", "):"(none)"}`,a.length?`Overridden built-ins: ${a.join(", ")}`:null,"Tip: ensure you pass a valid Connection Type or provide a builder via F_CONNECTION_BUILDERS."].filter(Boolean);return new Error(s.join(`
64
+ `))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})();function JO(t,n,e){return en("connection_"+t+n+e)}function eN(t,n,e){return en("connection_for_selection_"+t+n+e)}function Cy(t){return en("connection_gradient_"+t)}function tN(t){return`url(#${Cy(t)})`}var nN=(()=>{class t{_connection=u(Df);_hostElement=u(Be).nativeElement;_injector=u(ot);_hostAttributes=new Map;_startColor;_endColor;gradientId=D(()=>Cy(this._connection.fId()));ngOnInit(){this._listenColorChanges()}_listenColorChanges(){pe(()=>{this.gradient().fStartColor(),this.gradient().fEndColor(),Bt(()=>{this._updateGradient()})},{injector:this._injector})}get stop1Element(){return this._hostElement.children.item(0)}get stop2Element(){return this._hostElement.children.item(1)}redraw(e){let i=e.point2.x-e.point1.x,o=e.point2.y-e.point1.y,r=Math.sqrt(i*i+o*o)||.01,a=new ee(.5-.5*i/r,.5-.5*o/r);this._setHostAttribute("x1",a.x.toString()),this._setHostAttribute("y1",a.y.toString());let s=new ee(.5+.5*i/r,.5+.5*o/r);this._setHostAttribute("x2",s.x.toString()),this._setHostAttribute("y2",s.y.toString()),this._updateGradient()}_updateGradient(){let e=this.gradient();this._setFromColor(e.fStartColor()),this._setToColor(e.fEndColor())}_setFromColor(e){let i=e||"transparent";this._startColor!==i&&(this._startColor=i,this.stop1Element.setAttribute("stop-color",i),this.stop1Element.style.setProperty("stop-color",i))}_setToColor(e){let i=e||"transparent";this._endColor!==i&&(this._endColor=i,this.stop2Element.setAttribute("stop-color",i),this.stop2Element.style.setProperty("stop-color",i))}_setHostAttribute(e,i){this._hostAttributes.get(e)!==i&&(this._hostAttributes.set(e,i),this._hostElement.setAttribute(e,i))}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,standalone:!1})}return t})(),Lh=(()=>{class t extends nN{gradient=F.required({alias:"fConnectionGradientRendererFor"});static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["linearGradient","fConnectionGradientRenderer",""]],hostVars:1,hostBindings:function(i,o){i&2&&U("id",o.gradientId())},inputs:{gradient:[1,"fConnectionGradientRendererFor","gradient"]},features:[ve],attrs:PD,decls:3,vars:0,consts:[[0,"xmlns","svg","http://www.w3.org/2000/svg"],["offset","0%"],["offset","100%"]],template:function(i,o){i&1&&(ra(0,0),it(),dn(1,"stop",1)(2,"stop",2),aa())},encapsulation:2,changeDetection:0})}return t})(),G0=new he("F_CONNECTION_GRADIENT");var Bh=new he("F_CONNECTION_PATH"),zh=class{hostElement=u(Be).nativeElement},iN=(()=>{class t extends zh{_connection=u(Df);useGradient=F(!1);linkToGradient=D(()=>this.useGradient()?tN(this._connection.fId()):null);get fPathId(){return this._connection.fId()}get attrConnectionId(){return JO(this._connection.fId(),this._connection.fOutputId(),this._connection.fInputId())}initialize(){this.deselect()}setPath(e){this.hostElement.setAttribute("d",`${e}`)}select(){this.hostElement.setAttribute("marker-start",`url(#${aN(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${sN(this._connection.fId())})`)}deselect(){this.hostElement.setAttribute("marker-start",`url(#${oN(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${rN(this._connection.fId())})`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["path","f-connection-path",""]],hostAttrs:[1,"f-component","f-connection-path"],hostVars:4,hostBindings:function(i,o){i&2&&(U("id",o.attrConnectionId)("data-f-path-id",o.fPathId),ft("stroke",o.linkToGradient()))},inputs:{useGradient:[1,"useGradient"]},standalone:!1,features:[we([{provide:Bh,useExisting:t}]),ve],attrs:MD,decls:0,vars:0,template:function(i,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})();function oN(t){return en(`f-connection-marker-start-${t}`)}function rN(t){return en(`f-connection-marker-end-${t}`)}function aN(t){return en(`f-connection-selected-marker-start-${t}`)}function sN(t){return en(`f-connection-selected-marker-end-${t}`)}var qh=new he("F_CONNECTION_SELECTION"),Vh=class{hostElement=u(Be).nativeElement},cN=(()=>{class t extends Vh{_connection=u(Df);get connectionForSelectionId(){return eN(this._connection.fId(),this._connection.fOutputId(),this._connection.fInputId())}setPath(e){this.hostElement.setAttribute("d",`${e}`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["path","fConnectionSelection",""]],hostAttrs:[1,"f-component","f-connection-selection"],hostVars:1,hostBindings:function(i,o){i&2&&U("id",o.connectionForSelectionId)},standalone:!1,features:[we([{provide:qh,useExisting:t}]),ve],attrs:kD,decls:0,vars:0,template:function(i,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})(),Gh=new he("F_CONNECTION_DRAG_HANDLE_END"),Hh=new he("F_CONNECTION_DRAG_HANDLE_START"),ml=class{hostElement=u(Be).nativeElement;point=B.initialize();class="f-connection-drag-handle";calculateCircleCenter(n,e,i){let o={x:e.x-n.x,y:e.y-n.y},r=Math.sqrt(o.x*o.x+o.y*o.y)||1,a={x:o.x/r,y:o.y/r},s={x:a.x*i,y:a.y*i};return{x:e.x-s.x,y:e.y-s.y}}},dN=(()=>{class t extends ml{redraw(e,i){this.point=this.calculateCircleCenter(e,i,8),this.hostElement.setAttribute("cx",this.point.x.toString()),this.hostElement.setAttribute("cy",this.point.y.toString())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["circle","f-connection-drag-handle-start",""]],hostVars:2,hostBindings:function(i,o){i&2&&Fe(o.class)},standalone:!1,features:[we([{provide:Hh,useExisting:t}]),ve],attrs:DD,decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0})}return t})(),lN=(()=>{class t extends ml{redraw(e,i){this.point=this.calculateCircleCenter(e,i,8),this.hostElement.setAttribute("cx",this.point.x.toString()),this.hostElement.setAttribute("cy",this.point.y.toString())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["circle","f-connection-drag-handle-end",""]],hostVars:2,hostBindings:function(i,o){i&2&&Fe(o.class)},standalone:!1,features:[we([{provide:Gh,useExisting:t}]),ve],attrs:OD,decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0})}return t})(),_h="f-selected";function xy(t){return class extends t{fId=j("");fSelectionDisabled=j(!1);unmarkAsSelected(){this.unmarkChildrenAsSelected?.(),this.hostElement.classList.remove(_h)}markAsSelected(){this.markChildrenAsSelected?.(),this.isSelected()||this.hostElement.classList.add(_h)}isSelected(){return this.hostElement.classList.contains(_h)}markChildrenAsSelected(){}unmarkChildrenAsSelected(){}constructor(...n){super(...n)}}}function uN(t){return class extends t{show(){this.hostElement.style.display="unset"}hide(){this.hostElement.style.display="none"}constructor(...n){super(...n)}}}var fN=xy(uN(class{hostElement;constructor(t){this.hostElement=t}})),pN=(()=>{class t extends fN{_fConnectionBuilder=u(vy);path="";line=ko.initialize();fReassignableStart=j(!1);fDraggingDisabled=j(!1);fSelectionDisabled=j(!1);fDefs=ze.required("defs");fPath=ze.required(Bh);fDragHandleStart=ze(Hh);fDragHandleEnd=ze.required(Gh);fSelection=ze.required(qh);fContents=ih(A0,{descendants:!0});fMarkers=ih(pl,{descendants:!0});fGradient=da(G0);_fGradientRenderer=ze(Lh);fWaypoints=da(F0);fInputSide=j(Ee.DEFAULT);_contentLayoutEngine=new Oh;_sourceSide=z.AUTO;fOutputSide=j(Ee.DEFAULT);_targetSide=z.AUTO;_penultimatePoint=B.initialize();_secondPoint=B.initialize();constructor(){super(u(Be).nativeElement)}initialize(){this.redraw(),this.isSelected()?this.markChildrenAsSelected():this.unmarkChildrenAsSelected()}isContains(e){return(this.hostElement.firstChild?.lastChild).contains(e)||Array.from(this.fContents()?.values()??[]).some(i=>i.hostElement?.contains(e))||this.fWaypoints()?.hostElement?.contains(e)}setLine({point1:e,point2:i}){this.line=ko.initialize(e,i);let{path:o,points:r,penultimatePoint:a,secondPoint:s,candidates:c}=this._getPathResult(e,i);this.path=o,this._penultimatePoint=a||e,this._secondPoint=s||i,this.fWaypoints()?.candidates.set(c||[]),this._contentLayoutEngine.layout(r||[],this._contents())}_contents(){return Array.from(this.fContents()?.values()??[])}_getPathResult(e,i){return this._fConnectionBuilder.handle({type:this.fType,payload:{source:e,sourceSide:this._sourceSide,target:i,targetSide:this._targetSide,radius:this.fRadius,offset:this.fOffset,waypoints:this.fWaypoints()?.waypoints()||[]}})}markChildrenAsSelected(){this.fPath().select()}unmarkChildrenAsSelected(){this.fPath().deselect()}redraw(){this.fPath().setPath(this.path),this.fSelection().setPath(this.path),this.fDragHandleEnd().redraw(this._penultimatePoint,this.line.point2),this.fDragHandleStart()?.redraw(this._secondPoint,this.line.point1),this._fGradientRenderer()?.redraw(this.line)}getResolvedSides(){return{sourceSide:this._sourceSide,targetSide:this._targetSide}}_applyResolvedSidesToConnection(e,i){this._sourceSide=e,this._targetSide=i}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,contentQueries:function(i,o,r){i&1&&nh(r,o.fContents,A0,5)(r,o.fMarkers,pl,5)(r,o.fGradient,G0,5)(r,o.fWaypoints,F0,5),i&2&&_t(4)},viewQuery:function(i,o){i&1&&Ot(o.fDefs,ND,5)(o.fPath,Bh,5)(o.fDragHandleStart,Hh,5)(o.fDragHandleEnd,Gh,5)(o.fSelection,qh,5)(o._fGradientRenderer,Lh,5),i&2&&_t(6)},standalone:!1,features:[ve]})}return t})(),hN=(()=>{let t=class Ja{_browser=u(je);_markerCache=new WeakMap;handle({connection:e}){let i=this._findConnectionMarkers(e),o=e.fDefs();if(!o)return!1;let r=mN(i),a=this._markerCache.get(e);if(a?.signature===r&&a.defsElement===o.nativeElement)return!1;let s=wy("defs",this._browser);return i.forEach(c=>{by(c.type).forEach(d=>{let f=gN(d,c,e.fId(),this._browser),h=c.markerElement.cloneNode(!0);h.setAttribute("height",`${c.height}`),h.setAttribute("width",`${c.width}`),h.removeAttribute("markerUnits"),h.style.display="unset",f.append(h),s.append(f)})}),o.nativeElement.innerHTML=s.innerHTML,this._markerCache.set(e,{signature:r,defsElement:o.nativeElement}),this._makeSafariCompatible(e),!0}_findConnectionMarkers(e){return Array.from(e.fMarkers()??[])}_makeSafariCompatible(e){e.fPath().hostElement.replaceWith(e.fPath().hostElement)}static \u0275fac=function(i){return new(i||Ja)};static \u0275prov=C({token:Ja,factory:Ja.\u0275fac})};return t=S([I($i)],t),t})();function mN(t){return t.map(n=>[...by(n.type),n.width,n.height,n.refX,n.refY,n.orient,n.markerUnits,n.markerElement.outerHTML].join("|")).join("||")}function gN(t,n,e,i){let o=wy("marker",i);return o.setAttribute("id",en(t+"-"+e)),o.setAttribute("markerHeight",`${n.height}`),o.setAttribute("markerWidth",`${n.width}`),o.setAttribute("orient",`${n.orient}`),o.setAttribute("refX",`${n.refX}`),o.setAttribute("refY",`${n.refY}`),o.setAttribute("markerUnits",`${n.markerUnits}`),o}function by(t){switch(t){case xe.START:return[xe.START];case xe.END:return[xe.END];case xe.SELECTED_START:return[xe.SELECTED_START];case xe.SELECTED_END:return[xe.SELECTED_END];case xe.START_ALL_STATES:return[xe.START,xe.SELECTED_START];case xe.END_ALL_STATES:return[xe.END,xe.SELECTED_END];default:return[]}}function wy(t,n){return n.document.createElementNS("http://www.w3.org/2000/svg",t)}var Nf=(()=>{class t{renderTicket=0;_connectedInPreviousRender=new Set;beginRender(){return++this.renderTicket}resetConnectedConnectors(){for(let e of this._connectedInPreviousRender)e.resetConnected();this._connectedInPreviousRender.clear()}trackConnectedConnectors(e,i){this._connectedInPreviousRender.add(e),this._connectedInPreviousRender.add(i)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),_N=String.raw`
65
+ const EPSILON = 0.5;
66
+
67
+ addEventListener('message', (event) => {
68
+ const data = event?.data;
69
+ const requestId = data?.requestId;
70
+ const items = Array.isArray(data?.items) ? data.items : [];
71
+
72
+ try {
73
+ const results = items.map((item) => calculateItem(item));
74
+ postMessage({ requestId, results });
75
+ } catch (error) {
76
+ const message = error instanceof Error ? error.message : 'Connection worker failed.';
77
+ postMessage({ requestId, error: message });
78
+ }
79
+ });
80
+
81
+ function calculateItem(item) {
82
+ const sourceCenterX = item.sourceRect.x + item.sourceRect.width / 2;
83
+ const sourceCenterY = item.sourceRect.y + item.sourceRect.height / 2;
84
+ const targetCenterX = item.targetRect.x + item.targetRect.width / 2;
85
+ const targetCenterY = item.targetRect.y + item.targetRect.height / 2;
86
+
87
+ const sourceSide = resolveConnectableSide(
88
+ item.outputSide,
89
+ targetCenterX - sourceCenterX,
90
+ targetCenterY - sourceCenterY,
91
+ item.sourceConnectableSide,
92
+ );
93
+
94
+ const targetSide = resolveConnectableSide(
95
+ item.inputSide,
96
+ sourceCenterX - targetCenterX,
97
+ sourceCenterY - targetCenterY,
98
+ item.targetConnectableSide,
99
+ );
100
+
101
+ if (item.behavior === 'fixed_center') {
102
+ return {
103
+ originalIndex: item.originalIndex,
104
+ supported: true,
105
+ sourceSide,
106
+ targetSide,
107
+ line: {
108
+ point1: { x: sourceCenterX, y: sourceCenterY },
109
+ point2: { x: targetCenterX, y: targetCenterY },
110
+ },
111
+ };
112
+ }
113
+
114
+ if (item.sourceRotation || item.targetRotation) {
115
+ return { originalIndex: item.originalIndex, supported: false };
116
+ }
117
+
118
+ if (item.behavior !== 'fixed') {
119
+ if (item.behavior !== 'floating') {
120
+ return { originalIndex: item.originalIndex, supported: false };
121
+ }
122
+
123
+ if (hasRoundedCorners(item.sourceRect) || hasRoundedCorners(item.targetRect)) {
124
+ return { originalIndex: item.originalIndex, supported: false };
125
+ }
126
+
127
+ return {
128
+ originalIndex: item.originalIndex,
129
+ supported: true,
130
+ sourceSide,
131
+ targetSide,
132
+ line: buildFloatingLine(item.sourceRect, item.targetRect),
133
+ };
134
+ }
135
+
136
+ const line = buildFixedLine(item.sourceRect, item.targetRect, sourceSide, targetSide);
137
+ if (!line) {
138
+ return { originalIndex: item.originalIndex, supported: false };
139
+ }
140
+
141
+ return {
142
+ originalIndex: item.originalIndex,
143
+ supported: true,
144
+ sourceSide,
145
+ targetSide,
146
+ line,
147
+ };
148
+ }
149
+
150
+ function resolveConnectableSide(requestedSide, deltaX, deltaY, fallbackSide) {
151
+ if (requestedSide === 'default') {
152
+ return fallbackSide;
153
+ }
154
+
155
+ const absX = Math.abs(deltaX);
156
+ const absY = Math.abs(deltaY);
157
+ const nearZero = absX < EPSILON && absY < EPSILON;
158
+
159
+ if (nearZero) {
160
+ return fallbackSide;
161
+ }
162
+
163
+ const horizontalDominant = absX >= absY;
164
+
165
+ switch (requestedSide) {
166
+ case 'calculate':
167
+ return horizontalDominant ? (deltaX >= 0 ? 'right' : 'left') : deltaY >= 0 ? 'bottom' : 'top';
168
+
169
+ case 'calculate_horizontal':
170
+ if (absX < EPSILON) {
171
+ return fallbackSide;
172
+ }
173
+
174
+ return deltaX >= 0 ? 'right' : 'left';
175
+
176
+ case 'calculate_vertical':
177
+ if (absY < EPSILON) {
178
+ return fallbackSide;
179
+ }
180
+
181
+ return deltaY >= 0 ? 'bottom' : 'top';
182
+
183
+ case 'top':
184
+ case 'bottom':
185
+ case 'left':
186
+ case 'right':
187
+ return requestedSide;
188
+
189
+ default:
190
+ return fallbackSide;
191
+ }
192
+ }
193
+
194
+ function buildFixedLine(sourceRect, targetRect, sourceSide, targetSide) {
195
+ const sourceAnchor = sourceSide === 'auto' ? 'bottom' : sourceSide;
196
+ const targetAnchor = targetSide === 'auto' ? 'top' : targetSide;
197
+
198
+ const point1 = getSidePoint(sourceRect, sourceAnchor);
199
+ const point2 = getSidePoint(targetRect, targetAnchor);
200
+
201
+ if (!point1 || !point2) {
202
+ return null;
203
+ }
204
+
205
+ return { point1, point2 };
206
+ }
207
+
208
+ function buildFloatingLine(sourceRect, targetRect) {
209
+ const sourceCenter = getRectCenter(sourceRect);
210
+ const targetCenter = getRectCenter(targetRect);
211
+
212
+ return {
213
+ point1: getRectBorderIntersection(sourceRect, sourceCenter, targetCenter),
214
+ point2: getRectBorderIntersection(targetRect, targetCenter, sourceCenter),
215
+ };
216
+ }
217
+
218
+ function hasRoundedCorners(rect) {
219
+ return !!(rect.radius1 || rect.radius2 || rect.radius3 || rect.radius4);
220
+ }
221
+
222
+ function getRectCenter(rect) {
223
+ return {
224
+ x: rect.x + rect.width / 2,
225
+ y: rect.y + rect.height / 2,
226
+ };
227
+ }
228
+
229
+ function getRectBorderIntersection(rect, from, to) {
230
+ const halfWidth = rect.width / 2;
231
+ const halfHeight = rect.height / 2;
232
+ const center = getRectCenter(rect);
233
+
234
+ const dx = to.x - from.x;
235
+ const dy = to.y - from.y;
236
+
237
+ if (Math.abs(dx) < EPSILON && Math.abs(dy) < EPSILON) {
238
+ return center;
239
+ }
240
+
241
+ const scaleX = Math.abs(dx) < EPSILON ? Number.POSITIVE_INFINITY : halfWidth / Math.abs(dx);
242
+ const scaleY = Math.abs(dy) < EPSILON ? Number.POSITIVE_INFINITY : halfHeight / Math.abs(dy);
243
+ const scale = Math.min(scaleX, scaleY);
244
+
245
+ return {
246
+ x: center.x + dx * scale,
247
+ y: center.y + dy * scale,
248
+ };
249
+ }
250
+
251
+ function getSidePoint(rect, side) {
252
+ const centerX = rect.x + rect.width / 2;
253
+ const centerY = rect.y + rect.height / 2;
254
+
255
+ switch (side) {
256
+ case 'top':
257
+ return { x: centerX, y: rect.y };
258
+
259
+ case 'right':
260
+ return { x: rect.x + rect.width, y: centerY };
261
+
262
+ case 'bottom':
263
+ return { x: centerX, y: rect.y + rect.height };
264
+
265
+ case 'left':
266
+ return { x: rect.x, y: centerY };
267
+
268
+ default:
269
+ return null;
270
+ }
271
+ }
272
+ `.trim();function Sy(t){return!!Iy(t)}function Iy(t){let n=t,e=n?.Blob,i=n?.Worker,o=n?.URL;return!e||!i||typeof o?.createObjectURL!="function"||typeof o.revokeObjectURL!="function"?null:{blobCtor:e,workerCtor:i,urlApi:o}}function yN(t){let n=new t.blobCtor([_N],{type:"text/javascript"});return t.urlApi.createObjectURL(n)}function Ty(t,n){if(!t)return;let e=n??(typeof URL>"u"?null:URL);typeof e?.revokeObjectURL=="function"&&e.revokeObjectURL(t)}var ri=(()=>{class t{worker=null;workerUrl=null;nextRequestId=0;isDisabled=!1;pending=new Map;resetRuntime(e){this.pending.forEach(i=>i.reject(e)),this.pending.clear(),this.worker?.terminate(),this.worker=null,Ty(this.workerUrl),this.workerUrl=null}dispose(){this.resetRuntime(new Error("Connection worker was destroyed."))}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),gl=class{connection;line;static fToken=Symbol("ApplyConnectionRenderRequest");constructor(n,e){this.connection=n,this.line=e}},vN=(()=>{let t=class es{_mediator=u(R);_renderCache=new WeakMap;handle({connection:e,line:i}){!this._mediator.execute(new $i(e))&&!this._shouldRender(e,i)||(e.setLine(i),e.initialize())}_shouldRender(e,i){let o=e.fPath().hostElement,r=this._createConnectionRenderSignature(e,i),a=this._renderCache.get(e);return a?.signature===r&&a.pathElement===o?!1:(this._renderCache.set(e,{signature:r,pathElement:o}),!0)}_createConnectionRenderSignature(e,i){let{sourceSide:o,targetSide:r}=e.getResolvedSides();return[e.fBehavior,e.fType,e.fRadius,e.fOffset,e.fReassignableStart(),this._serializeContents([...e.fContents()||[]]),o,r,this._serializePoint(i.point1),this._serializePoint(i.point2),this._serializeWaypoints(e.fWaypoints()?.waypoints()||[])].join("|")}_serializePoint(e){return`${e.x}:${e.y}`}_serializeWaypoints(e){return e.map(this._serializePoint).join(";")}_serializeContents(e){return e.map(i=>[i.position(),i.offset(),i.align()].join(":")).join(";")}static \u0275fac=function(i){return new(i||es)};static \u0275prov=C({token:es,factory:es.\u0275fac})};return t=S([I(gl)],t),t})(),_l=class{source;target;static fToken=Symbol("MarkConnectionConnectorsAsConnectedRequest");constructor(n,e){this.source=n,this.target=e}},CN=(()=>{let t=class ts{_state=u(Nf);handle({source:e,target:i}){e.setConnected(i),i.setConnected(e),this._state.trackConnectedConnectors(e,i)}static \u0275fac=function(i){return new(i||ts)};static \u0275prov=C({token:ts,factory:ts.\u0275fac})};return t=S([I(_l)],t),t})(),Sn=class{element;cache;static fToken=Symbol("GetNormalizedConnectorRectRequest");constructor(n,e=!0){this.element=n,this.cache=e}},xN={enabled:!1},Gt=new he("F_CACHE_OPTIONS",{providedIn:"root",factory:()=>ae({},xN)});var yl=class{id;nodeId;kind;element;static fToken=Symbol("RegisterFCacheConnectorRequest");constructor(n,e,i,o){this.id=n,this.nodeId=e,this.kind=i,this.element=o}},Ht=(()=>{class t{nodeEntries=new Map;nodeIdByElement=new WeakMap;connectorEntries=new Map;connectorKeysByNodeId=new Map;connectorKeyByElement=new WeakMap;static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),jh=class{key;id;kind;nodeId;element;rect;constructor(n,e,i,o,r,a){this.key=n,this.id=e,this.kind=i,this.nodeId=o,this.element=r,this.rect=a}},Ao=class{static build(n,e){return`${n}:${e}`}},Uh=class{id;element;reference;rect;constructor(n,e,i,o){this.id=n,this.element=e,this.reference=i,this.rect=o}},Ki=class{nodeId;reason;static fToken=Symbol("InvalidateFCacheNodeRequest");constructor(n,e="manual"){this.nodeId=n,this.reason=e}},bN=(()=>{let t=class ns{_store=u(Ht);_options=u(Gt);handle({nodeId:e,reason:i}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;o.rect=void 0;let r=this._store.connectorKeysByNodeId.get(e);if(r?.size)for(let a of r){let s=this._store.connectorEntries.get(a);s&&(s.rect=void 0)}}static \u0275fac=function(i){return new(i||ns)};static \u0275prov=C({token:ns,factory:ns.\u0275fac})};return t=S([I(Ki)],t),t})(),vl=class{id;element;reference;static fToken=Symbol("RegisterFCacheNodeRequest");constructor(n,e,i){this.id=n,this.element=e,this.reference=i}},wN=(()=>{let t=class is{_store=u(Ht);_options=u(Gt);handle({id:e,element:i,reference:o}){if(!this._options.enabled)return;let r=new Uh(e,i,o);this._store.nodeEntries.set(e,r),this._store.nodeIdByElement.set(i,e),this._store.connectorKeysByNodeId.set(e,this._store.connectorKeysByNodeId.get(e)??new Set)}static \u0275fac=function(i){return new(i||is)};static \u0275prov=C({token:is,factory:is.\u0275fac})};return t=S([I(vl)],t),t})(),Cl=class{id;static fToken=Symbol("UnregisterFCacheNodeRequest");constructor(n){this.id=n}},SN=(()=>{let t=class os{_store=u(Ht);_mediator=u(R);_options=u(Gt);handle({id:e}){if(!this._options.enabled)return;let i=this._store.nodeEntries.get(e);if(!i)return;this._store.nodeEntries.delete(e),this._store.nodeIdByElement.delete(i.element);let o=Array.from(this._store.connectorKeysByNodeId.get(e)??[]);for(let r of o){let a=this._store.connectorEntries.get(r);a&&this._mediator.execute(new Fo(a.id,a.kind))}this._store.connectorKeysByNodeId.delete(e)}static \u0275fac=function(i){return new(i||os)};static \u0275prov=C({token:os,factory:os.\u0275fac})};return t=S([I(Cl)],t),t})(),IN=(()=>{let t=class rs{_store=u(Ht);_mediator=u(R);_options=u(Gt);handle({id:e,nodeId:i,kind:o,element:r}){if(!this._options.enabled)return;let a=Ao.build(e,o),s=this._store.connectorEntries.get(a);s&&(this._detachConnectorFromNode(s.key,s.nodeId),this._store.connectorKeyByElement.delete(s.element));let c=new jh(a,e,o,i,r);this._store.connectorEntries.set(a,c),this._store.connectorKeyByElement.set(r,a);let d=this._store.connectorKeysByNodeId.get(i)??new Set;d.add(a),this._store.connectorKeysByNodeId.set(i,d),this._mediator.execute(new Ki(i,"connector-registered"))}_detachConnectorFromNode(e,i){let o=this._store.connectorKeysByNodeId.get(i);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(i))}static \u0275fac=function(i){return new(i||rs)};static \u0275prov=C({token:rs,factory:rs.\u0275fac})};return t=S([I(yl)],t),t})(),Fo=class{connectorId;kind;static fToken=Symbol("UnregisterFCacheConnectorRequest");constructor(n,e){this.connectorId=n,this.kind=e}},TN=(()=>{let t=class as{_store=u(Ht);_mediator=u(R);_options=u(Gt);handle({connectorId:e,kind:i}){if(!this._options.enabled)return;let o=Ao.build(e,i),r=this._store.connectorEntries.get(o);r&&(this._store.connectorEntries.delete(o),this._store.connectorKeyByElement.delete(r.element),this._detachConnectorFromNode(o,r.nodeId),this._store.nodeEntries.has(r.nodeId)&&this._mediator.execute(new Ki(r.nodeId,"connector-unregistered")))}_detachConnectorFromNode(e,i){let o=this._store.connectorKeysByNodeId.get(i);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(i))}static \u0275fac=function(i){return new(i||as)};static \u0275prov=C({token:as,factory:as.\u0275fac})};return t=S([I(Fo)],t),t})(),Yi=class{element;static fToken=Symbol("GetCachedFCacheRectRequest");constructor(n){this.element=n}},EN=(()=>{let t=class ss{_store=u(Ht);_options=u(Gt);handle({element:e}){if(!this._options.enabled)return;let i=this._store.nodeIdByElement.get(e);if(i){let r=this._store.nodeEntries.get(i)?.rect;if(r)return r}let o=this._store.connectorKeyByElement.get(e);if(o)return this._store.connectorEntries.get(o)?.rect??void 0}static \u0275fac=function(i){return new(i||ss)};static \u0275prov=C({token:ss,factory:ss.\u0275fac})};return t=S([I(Yi)],t),t})(),Qn=class{connectorId;kind;rect;static fToken=Symbol("SetFCacheConnectorRectRequest");constructor(n,e,i){this.connectorId=n,this.kind=e,this.rect=i}},PN=(()=>{let t=class cs{_store=u(Ht);_options=u(Gt);handle({connectorId:e,kind:i,rect:o}){if(!this._options.enabled)return;let r=Ao.build(e,i),a=this._store.connectorEntries.get(r);a&&(a.rect=He.fromRoundedRect(o))}static \u0275fac=function(i){return new(i||cs)};static \u0275prov=C({token:cs,factory:cs.\u0275fac})};return t=S([I(Qn)],t),t})(),Jn=class{nodeId;rect;static fToken=Symbol("SetFCacheNodeRectRequest");constructor(n,e){this.nodeId=n,this.rect=e}},MN=(()=>{let t=class ds{_store=u(Ht);_options=u(Gt);handle({nodeId:e,rect:i}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;let r=o.rect;o.rect=W.initialize(i.x,i.y,i.width,i.height),r&&this._updateConnectorRectsByNodeRect(e,r,o.rect)}_updateConnectorRectsByNodeRect(e,i,o){let r=this._store.connectorKeysByNodeId.get(e);if(!r?.size)return;let a=o.x-i.x,s=o.y-i.y,c=i.width!==0,d=i.height!==0,f=c?o.width/i.width:1,h=d?o.height/i.height:1;for(let v of r){let b=this._store.connectorEntries.get(v);if(!b?.rect)continue;let w=b.rect,T=w.gravityCenter,k=c?o.x+(T.x-i.x)*f:T.x+a,O=d?o.y+(T.y-i.y)*h:T.y+s;b.rect=new He(k-w.width/2,O-w.height/2,w.width,w.height,w.radius1,w.radius2,w.radius3,w.radius4)}}static \u0275fac=function(i){return new(i||ds)};static \u0275prov=C({token:ds,factory:ds.\u0275fac})};return t=S([I(Jn)],t),t})(),Lo=class{element;rect;static fToken=Symbol("UpdateFCacheRectByElementRequest");constructor(n,e){this.element=n,this.rect=e}},kN=(()=>{let t=class ls{_store=u(Ht);_options=u(Gt);handle({element:e,rect:i}){if(!this._options.enabled)return;let o=this._store.nodeIdByElement.get(e);if(o){let s=this._store.nodeEntries.get(o);s&&(s.rect=i);return}let r=this._store.connectorKeyByElement.get(e);if(!r)return;let a=this._store.connectorEntries.get(r);a&&(a.rect=i)}static \u0275fac=function(i){return new(i||ls)};static \u0275prov=C({token:ls,factory:ls.\u0275fac})};return t=S([I(Lo)],t),t})(),DN=[Ht,wN,SN,bN,IN,TN,EN,MN,PN,kN];function ao(t,n,e){return n?ee.fromPoint(t).elementTransform(n).sub(e.scaledPosition).sub(e.position).div(e.scale):ee.fromPoint(t)}function Ey(){return{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}}function Xi(t){return t?`${t}`:void 0}var ON=(()=>{let t=class us{_store=u(N);_mediator=u(R);_browser=u(je);get _transform(){return this._store.transform}handle({element:e,cache:i}){let o=this._mediator.execute(new Yi(e));if(o&&i)return o;let r=this._getElementRoundedRect(e),a=this._normalizePosition(r),s=this._unscaleSize(r),c=this._getUnscaledRect(a,s,r),d=this._getOffsetSize(e,s),f=He.fromCenter(c,d.width,d.height);return this._mediator.execute(new Lo(e,f)),f}_getElementRoundedRect(e){return this._getRoundedRect(W.fromElement(e),e,this._getComputedStyle(e))}_getRoundedRect(e,i,o){let[r,a,s,c]=this._normalizeCircularBorderRadii(e.width,e.height,[this._getSystemRadius(o.borderTopLeftRadius,i,o.fontSize),this._getSystemRadius(o.borderTopRightRadius,i,o.fontSize),this._getSystemRadius(o.borderBottomRightRadius,i,o.fontSize),this._getSystemRadius(o.borderBottomLeftRadius,i,o.fontSize)]);return new He(e.x,e.y,e.width,e.height,r,a,s,c)}_getComputedStyle(e){return this._browser.window.getComputedStyle(e)}_toPixels(e,i,o){return this._browser.toPixels(e,i.clientWidth,i.clientHeight,o)||0}_getSystemRadius(e,i,o){return this._toPixels(e,i,o)*this._transform.scale}_normalizeCircularBorderRadii(e,i,o){let[r,a,s,c]=o.map(f=>Math.max(0,f)),d=Math.min(1,this._getRadiusScaleFactor(e,r+a),this._getRadiusScaleFactor(i,a+s),this._getRadiusScaleFactor(e,s+c),this._getRadiusScaleFactor(i,c+r));return[r*d,a*d,s*d,c*d]}_getRadiusScaleFactor(e,i){return i<=0?1:e<=0?0:e/i}_normalizePosition(e){return ao(e,this._store.flowHost,this._transform)}_unscaleSize(e){return st.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,i,o){return new He(e.x,e.y,i.width,i.height,this._unscaleRadius(o.radius1),this._unscaleRadius(o.radius2),this._unscaleRadius(o.radius3),this._unscaleRadius(o.radius4))}_unscaleRadius(e){return e/this._transform.scale}_getOffsetSize(e,i){return st.offsetFromElement(e)||i}static \u0275fac=function(i){return new(i||us)};static \u0275prov=C({token:us,factory:us.\u0275fac})};return t=S([I(Sn)],t),t})(),xl=class{connector;cache;static fToken=Symbol("ResolveConnectionEndpointRectRequest");constructor(n,e){this.connector=n,this.cache=e}},NN=(()=>{let t=class fs{_mediator=u(R);handle({connector:e,cache:i}){let o=this._buildCacheKey(e),r=i.get(o)??this._calculateRect(e);return i.set(o,r),r}_buildCacheKey(e){return`${e.kind}::${e.fId()}`}_calculateRect(e){return this._mediator.execute(new Sn(e.hostElement))}static \u0275fac=function(i){return new(i||fs)};static \u0275prov=C({token:fs,factory:fs.\u0275fac})};return t=S([I(xl)],t),t})(),bl=class{connection;static fToken=Symbol("ResolveConnectionEndpointsRequest");constructor(n){this.connection=n}},RN=(()=>{let t=class ps{_store=u(N);handle({connection:e}){let i=this._store.outputs.get(e.fOutputId()),o=this._store.inputs.get(e.fInputId());return!i||!o?null:{source:i,target:o}}static \u0275fac=function(i){return new(i||ps)};static \u0275prov=C({token:ps,factory:ps.\u0275fac})};return t=S([I(bl)],t),t})(),Bo=class{connection;cache;static fToken=Symbol("ResolveConnectionGeometryRequest");constructor(n,e){this.connection=n,this.cache=e}},AN=(()=>{let t=class hs{_mediator=u(R);handle({connection:e,cache:i}){let o=this._resolveConnectionEndpoints(e);return o?Xt(ae({},o),{sourceRect:this._resolveEndpointRect(o.source,i),targetRect:this._resolveEndpointRect(o.target,i)}):null}_resolveConnectionEndpoints(e){return this._mediator.execute(new bl(e))}_resolveEndpointRect(e,i){return this._mediator.execute(new xl(e,i))}static \u0275fac=function(i){return new(i||hs)};static \u0275prov=C({token:hs,factory:hs.\u0275fac})};return t=S([I(Bo)],t),t})(),qe=class{element;static fToken=Symbol("GetNormalizedElementRectRequest");constructor(n){this.element=n}},FN=(()=>{let t=class ms{_store=u(N);_mediator=u(R);get _transform(){return this._store.transform}handle({element:e}){let i=this._mediator.execute(new Yi(e));if(i)return i;let o=W.fromElement(e),r=this._normalizePosition(o),a=this._unscaleSize(o),s=this._getUnscaledRect(r,a),c=this._getOffsetSize(e,a),d=this._fromCenter(s,c.width,c.height);return this._mediator.execute(new Lo(e,d)),d}_fromCenter(e,i,o){return W.initialize(e.gravityCenter.x-i/2,e.gravityCenter.y-o/2,i,o)}_normalizePosition(e){return ao(e,this._store.flowHost,this._transform)}_unscaleSize(e){return st.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,i){return new He(e.x,e.y,i.width,i.height)}_getOffsetSize(e,i){return st.offsetFromElement(e)||i}static \u0275fac=function(i){return new(i||ms)};static \u0275prov=C({token:ms,factory:ms.\u0275fac})};return t=S([I(qe)],t),t})(),tn=class{connector;static fToken=Symbol("ResolveConnectionEndpointRotationContextRequest");constructor(n){this.connector=n}},LN=(()=>{let t=class gs{_store=u(N);_mediator=u(R);handle({connector:e}){if(!e)return;let i=this._store.nodes.get(e.fNodeId);if(!i||!i._rotate)return;let o=this._mediator.execute(new qe(i.hostElement));return{rotationDeg:i._rotate,pivot:o.gravityCenter}}static \u0275fac=function(i){return new(i||gs)};static \u0275prov=C({token:gs,factory:gs.\u0275fac})};return t=S([I(tn)],t),t})(),wl=class{connection;geometry;static fToken=Symbol("BuildConnectionLineRequest");constructor(n,e){this.connection=n,this.geometry=e}},BN=(()=>{let t=class _s{_mediator=u(R);_connectionBehaviour=u(ro);handle({connection:e,geometry:i}){return this._connectionBehaviour.handle(new At(i.sourceRect,i.targetRect,e,i.source.fConnectableSide,i.target.fConnectableSide,this._resolveRotationContext(i.source),this._resolveRotationContext(i.target)))}_resolveRotationContext(e){return this._mediator.execute(new tn(e))}static \u0275fac=function(i){return new(i||_s)};static \u0275prov=C({token:_s,factory:_s.\u0275fac})};return t=S([I(wl)],t),t})(),zo=class{connection;source;target;line;static fToken=Symbol("RenderConnectionWithLineRequest");constructor(n,e,i,o){this.connection=n,this.source=e,this.target=i,this.line=o}},zN=(()=>{let t=class ys{_mediator=u(R);handle({connection:e,source:i,target:o,line:r}){this._mediator.execute(new _l(i,o)),this._mediator.execute(new gl(e,r))}static \u0275fac=function(i){return new(i||ys)};static \u0275prov=C({token:ys,factory:ys.\u0275fac})};return t=S([I(zo)],t),t})(),qo=class{connection;geometry;static fToken=Symbol("RenderConnectionFromGeometryRequest");constructor(n,e){this.connection=n,this.geometry=e}},qN=(()=>{let t=class vs{_mediator=u(R);handle({connection:e,geometry:i}){let o=this._mediator.execute(new wl(e,i));this._mediator.execute(new zo(e,i.source,i.target,o))}static \u0275fac=function(i){return new(i||vs)};static \u0275prov=C({token:vs,factory:vs.\u0275fac})};return t=S([I(qo)],t),t})(),Sl=class{connection;cache;static fToken=Symbol("RenderConnectionRequest");constructor(n,e){this.connection=n,this.cache=e}},VN=(()=>{let t=class Cs{_mediator=u(R);handle({connection:e,cache:i}){let o=this._mediator.execute(new Bo(e,i));o&&this._mediator.execute(new qo(e,o))}static \u0275fac=function(i){return new(i||Cs)};static \u0275prov=C({token:Cs,factory:Cs.\u0275fac})};return t=S([I(Sl)],t),t})(),ei=class{session;static fToken=Symbol("IsConnectionRedrawCurrentRequest");constructor(n){this.session=n}},GN=(()=>{let t=class xs{_store=u(N);_state=u(Nf);handle({session:e}){return e.renderTicket===this._state.renderTicket&&e.nodesRevision===this._store.nodesRevision}static \u0275fac=function(i){return new(i||xs)};static \u0275prov=C({token:xs,factory:xs.\u0275fac})};return t=S([I(ei)],t),t})(),Vo=class{session;static fToken=Symbol("CompleteConnectionRedrawRequest");constructor(n){this.session=n}},HN=(()=>{let t=class bs{_mediator=u(R);_store=u(N);handle({session:e}){this._mediator.execute(new ei(e))&&this._store.completeConnectionsRender(e.connectionsRevision,e.nodesRevision)}static \u0275fac=function(i){return new(i||bs)};static \u0275prov=C({token:bs,factory:bs.\u0275fac})};return t=S([I(Vo)],t),t})(),Il=class{batchItem;result;static fToken=Symbol("ApplyConnectionWorkerResultRequest");constructor(n,e){this.batchItem=n,this.result=e}},jN=(()=>{let t=class ws{_mediator=u(R);handle({batchItem:e,result:i}){if(e){if(!this._isSupportedWorkerResult(i)){this._fallbackToMainThread(e);return}try{e.connection._applyResolvedSidesToConnection(i.sourceSide,i.targetSide),this._mediator.execute(new zo(e.connection,e.geometry.source,e.geometry.target,i.line))}catch{this._fallbackToMainThread(e)}}}_fallbackToMainThread(e){this._mediator.execute(new qo(e.connection,e.geometry))}_isSupportedWorkerResult(e){return!!(e?.supported&&e.sourceSide&&e.targetSide&&e.line)}static \u0275fac=function(i){return new(i||ws)};static \u0275prov=C({token:ws,factory:ws.\u0275fac})};return t=S([I(Il)],t),t})(),Cn=class{connections;cache;startIndex;session;batchItems;workerResults;static fToken=Symbol("RunConnectionRedrawSliceRequest");constructor(n,e,i,o,r,a){this.connections=n,this.cache=e,this.startIndex=i,this.session=o,this.batchItems=r,this.workerResults=a}},UN=500,WN=6,$N=(()=>{let t=class Ss{_mediator=u(R);_browser=u(je);handle({connections:e,cache:i,startIndex:o,session:r,batchItems:a,workerResults:s}){if(!this._isCurrent(r))return;let c=this._now(),d=o,f=0;for(;d<e.length&&f<UN&&this._isWithinSliceBudget(c);){let h=e[d];if(a?this._mediator.execute(new Il(a[d]??null,s?.[d])):this._mediator.execute(new Sl(h,i)),d++,f++,!this._isCurrent(r))return}if(d>=e.length){this._mediator.execute(new Vo(r));return}this._requestAnimationFrame(()=>this._mediator.execute(new Cn(e,i,d,r,a,s)))}_isCurrent(e){return this._mediator.execute(new ei(e))}_requestAnimationFrame(e){let i=this._browser.document.defaultView;if(!i){e();return}i.requestAnimationFrame(e)}_now(){let e=this._browser.document.defaultView?.performance;return e?e.now():Date.now()}_isWithinSliceBudget(e){return this._browser.isBrowser()?this._now()-e<WN:!0}static \u0275fac=function(i){return new(i||Ss)};static \u0275prov=C({token:Ss,factory:Ss.\u0275fac})};return t=S([I(Cn)],t),t})(),Tl=class{static fToken=Symbol("StartConnectionRedrawRequest")},KN=(()=>{let t=class Is{_store=u(N);_state=u(Nf);handle(e){return this._state.resetConnectedConnectors(),{renderTicket:this._state.beginRender(),connectionsRevision:this._store.connectionsRevision,nodesRevision:this._store.nodesRevision}}static \u0275fac=function(i){return new(i||Is)};static \u0275prov=C({token:Is,factory:Is.\u0275fac})};return t=S([I(Tl)],t),t})(),Go=class{static fToken=Symbol("RedrawConnectionsRequest")},El=class{connectionCount;static fToken=Symbol("ShouldUseConnectionWorkerRequest");constructor(n){this.connectionCount=n}},Ho=class{static fToken=Symbol("IsConnectionWorkerEnabledRequest")},YN=(()=>{let t=class Ts{_browser=u(je);_state=u(ri);handle(e){if(this._state.isDisabled||!this._isWorkerAvailable())return!1;let i=this._browser.document.defaultView;return Sy(i)}_isWorkerAvailable(){return this._browser.isBrowser()}static \u0275fac=function(i){return new(i||Ts)};static \u0275prov=C({token:Ts,factory:Ts.\u0275fac})};return t=S([I(Ho)],t),t})(),XN=(()=>{let t=class Es{_mediator=u(R);handle({connectionCount:e}){return e>0&&this._mediator.execute(new Ho)}static \u0275fac=function(i){return new(i||Es)};static \u0275prov=C({token:Es,factory:Es.\u0275fac})};return t=S([I(El)],t),t})(),Pl=class{connection;geometry;originalIndex;static fToken=Symbol("BuildConnectionWorkerPayloadItemRequest");constructor(n,e,i){this.connection=n,this.geometry=e,this.originalIndex=i}},ZN=(()=>{let t=class Ps{_store=u(N);handle({connection:e,geometry:i,originalIndex:o}){let{source:r,target:a,sourceRect:s,targetRect:c}=i;return{originalIndex:o,behavior:e.fBehavior,outputSide:e.fOutputSide(),inputSide:e.fInputSide(),sourceConnectableSide:r.fConnectableSide,targetConnectableSide:a.fConnectableSide,sourceRotation:this._store.nodes.get(r.fNodeId)?._rotate||0,targetRotation:this._store.nodes.get(a.fNodeId)?._rotate||0,sourceRect:{x:s.x,y:s.y,width:s.width,height:s.height,radius1:s.radius1,radius2:s.radius2,radius3:s.radius3,radius4:s.radius4},targetRect:{x:c.x,y:c.y,width:c.width,height:c.height,radius1:c.radius1,radius2:c.radius2,radius3:c.radius3,radius4:c.radius4}}}static \u0275fac=function(i){return new(i||Ps)};static \u0275prov=C({token:Ps,factory:Ps.\u0275fac})};return t=S([I(Pl)],t),t})(),Ml=class{connections;cache;static fToken=Symbol("BuildConnectionWorkerBatchRequest");constructor(n,e){this.connections=n,this.cache=e}},QN=(()=>{let t=class Ms{_mediator=u(R);handle({connections:e,cache:i}){let o=new Array(e.length),r=[];for(let a=0;a<e.length;a++){let s=this._buildBatchItem(e[a],i,a);o[a]=s,s&&r.push(s.payload)}return{items:o,payload:r}}_buildBatchItem(e,i,o){let r=this._mediator.execute(new Bo(e,i));return r?{connection:e,geometry:r,payload:this._mediator.execute(new Pl(e,r,o))}:null}static \u0275fac=function(i){return new(i||Ms)};static \u0275prov=C({token:Ms,factory:Ms.\u0275fac})};return t=S([I(Ml)],t),t})(),kl=class{error;static fToken=Symbol("DisableConnectionWorkerRequest");constructor(n){this.error=n}},jo=class{error;static fToken=Symbol("ResetConnectionWorkerRuntimeRequest");constructor(n){this.error=n}},JN=(()=>{let t=class ks{_state=u(ri);handle({error:e}){this._state.resetRuntime(e)}static \u0275fac=function(i){return new(i||ks)};static \u0275prov=C({token:ks,factory:ks.\u0275fac})};return t=S([I(jo)],t),t})(),eR=(()=>{let t=class Ds{_state=u(ri);_mediator=u(R);handle({error:e}){this._state.isDisabled=!0,this._mediator.execute(new jo(e))}static \u0275fac=function(i){return new(i||Ds)};static \u0275prov=C({token:Ds,factory:Ds.\u0275fac})};return t=S([I(kl)],t),t})(),Dl=class{message;static fToken=Symbol("HandleConnectionWorkerMessageRequest");constructor(n){this.message=n}},tR=(()=>{let t=class Os{_state=u(ri);handle({message:e}){if(!e||typeof e.requestId!="number")return;let i=this._state.pending.get(e.requestId);if(i){if(this._state.pending.delete(e.requestId),e.error){i.reject(new Error(e.error));return}i.resolve(e.results??[])}}static \u0275fac=function(i){return new(i||Os)};static \u0275prov=C({token:Os,factory:Os.\u0275fac})};return t=S([I(Dl)],t),t})(),Ol=class{static fToken=Symbol("EnsureConnectionWorkerRequest")},nR=(()=>{let t=class Ns{_browser=u(je);_state=u(ri);_mediator=u(R);handle(e){if(this._state.worker)return this._state.worker;let i=this._browser.document.defaultView;if(!Sy(i))return null;let o=Iy(i);if(!o)return null;let r=yN(o);try{let a=new o.workerCtor(r,{name:"f-flow-connection-worker"});return a.onmessage=s=>{this._mediator.execute(new Dl(s.data))},a.onerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker runtime error."))},a.onmessageerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker message deserialization error."))},this._state.workerUrl=r,this._state.worker=a,a}catch(a){return Ty(r,o.urlApi),this._disableWorker(a instanceof Error?a:new Error("Connection worker initialization failed.")),null}}_disableWorker(e){this._mediator.execute(new kl(e))}_resetWorkerAfterRuntimeError(e){this._mediator.execute(new jo(e))}static \u0275fac=function(i){return new(i||Ns)};static \u0275prov=C({token:Ns,factory:Ns.\u0275fac})};return t=S([I(Ol)],t),t})(),Nl=class{payload;static fToken=Symbol("RunConnectionWorkerRequest");constructor(n){this.payload=n}},iR=(()=>{let t=class Rs{_state=u(ri);_mediator=u(R);handle({payload:e}){if(!e.length)return Promise.resolve([]);if(!this._mediator.execute(new Ho))return Promise.reject(new Error("Connection worker is disabled."));this._interruptPendingRequests();let i=this._mediator.execute(new Ol);if(!i)return Promise.reject(new Error("Unable to initialize connection worker."));let o=++this._state.nextRequestId;return new Promise((r,a)=>{this._state.pending.set(o,{resolve:r,reject:a});try{i.postMessage({requestId:o,items:e})}catch(s){this._state.pending.delete(o),a(s instanceof Error?s:new Error("Unknown error while posting message to connection worker."))}})}_interruptPendingRequests(){if(!this._state.pending.size)return;let e=new Error("Connection worker request was superseded by a newer redraw.");this._state.pending.forEach(i=>i.reject(e)),this._state.pending.clear()}static \u0275fac=function(i){return new(i||Rs)};static \u0275prov=C({token:Rs,factory:Rs.\u0275fac})};return t=S([I(Nl)],t),t})(),Rl=class{batch;static fToken=Symbol("RunConnectionWorkerBatchRequest");constructor(n){this.batch=n}},oR=(()=>{let t=class As{_mediator=u(R);handle({batch:e}){return e.payload.length?this._mediator.execute(new Nl(e.payload)):Promise.resolve([])}static \u0275fac=function(i){return new(i||As)};static \u0275prov=C({token:As,factory:As.\u0275fac})};return t=S([I(Rl)],t),t})(),Al=class{connections;cache;session;static fToken=Symbol("StartConnectionWorkerRedrawRequest");constructor(n,e,i){this.connections=n,this.cache=e,this.session=i}},rR=(()=>{let t=class Fs{_mediator=u(R);handle({connections:e,cache:i,session:o}){let r=this._mediator.execute(new Ml(e,i));if(!r.payload.length){this._mediator.execute(new Cn(e,i,0,o,r.items));return}this._mediator.execute(new Rl(r)).then(a=>{this._mediator.execute(new ei(o))&&this._mediator.execute(new Cn(e,i,0,o,r.items,this._alignWorkerResults(a,e.length)))}).catch(()=>{this._mediator.execute(new ei(o))&&this._mediator.execute(new Cn(e,i,0,o,r.items))})}_alignWorkerResults(e,i){let o=new Array(i);for(let r of e){let a=r.originalIndex;a<0||a>=i||(o[a]=r)}return o}static \u0275fac=function(i){return new(i||Fs)};static \u0275prov=C({token:Fs,factory:Fs.\u0275fac})};return t=S([I(Al)],t),t})(),aR=(()=>{let t=class Ls{_mediator=u(R);_store=u(N);handle(e){let i=this._mediator.execute(new Tl);this._createMarkersForCreate(),this._createMarkersForSnap();let o=[...this._store.connections.getAll()],r=new Map;if(!o.length){this._mediator.execute(new Vo(i));return}this._shouldUseConnectionWorker(o.length)?this._redrawUsingWorker(o,r,i):this._redrawWithoutWorker(o,r,i)}_createMarkersForCreate(){let e=this._store.connections.getForCreate();e&&this._mediator.execute(new $i(e))}_createMarkersForSnap(){let e=this._store.connections.getForSnap();e&&this._mediator.execute(new $i(e))}_shouldUseConnectionWorker(e){return this._mediator.execute(new El(e))}_redrawUsingWorker(e,i,o){this._mediator.execute(new Al(e,i,o))}_redrawWithoutWorker(e,i,o){this._mediator.execute(new Cn(e,i,0,o))}static \u0275fac=function(i){return new(i||Ls)};static \u0275prov=C({token:Ls,factory:Ls.\u0275fac})};return t=S([I(Go)],t),t})(),Wh=class{static fToken=Symbol("RemoveConnectionForCreateFromStoreRequest")},sR=(()=>{let t=class Bs{_store=u(N);handle(e){this._store.connections.removeInstanceForCreate()}static \u0275fac=function(i){return new(i||Bs)};static \u0275prov=C({token:Bs,factory:Bs.\u0275fac})};return t=S([I(Wh)],t),t})(),Fl=class{connection;static fToken=Symbol("RemoveConnectionFromStoreRequest");constructor(n){this.connection=n}},cR=(()=>{let t=class zs{_store=u(N);handle({connection:e}){this._store.connections.remove(e),this._store.emitConnectionChanges()}static \u0275fac=function(i){return new(i||zs)};static \u0275prov=C({token:zs,factory:zs.\u0275fac})};return t=S([I(Fl)],t),t})(),Ll=class{instance;static fToken=Symbol("RemoveConnectionMarkerFromStoreRequest");constructor(n){this.instance=n}},dR=(()=>{let t=class qs{_store=u(N);handle({instance:e}){this._store.connectionMarkers.remove(e),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||qs)};static \u0275prov=C({token:qs,factory:qs.\u0275fac})};return t=S([I(Ll)],t),t})(),$h=class{waypointIndex;connectionId;static fToken=Symbol("RemoveConnectionWaypointRequest");constructor(n,e){this.waypointIndex=n,this.connectionId=e}},Bl=class{static fToken=Symbol("EmitEndDragSequenceEventRequest")},lR=(()=>{let t=class Vs{_store=u(N);_dragSession=u(te);handle(e){this._store.flowHost.classList.remove($e.DRAG_AND_DROP.DRAGGING),this._dragSession.reset(),this._emitEvent()}_emitEvent(){this._store.fDraggable?.fDragEnded?.emit()}static \u0275fac=function(i){return new(i||Vs)};static \u0275prov=C({token:Vs,factory:Vs.\u0275fac})};return t=S([I(Bl)],t),t})(),zl=class{static fToken=Symbol("EmitStartDragSequenceEventRequest")},uR=(()=>{let t=class Gs{_mediator=u(R);_store=u(N);_dragContext=u(te);handle(e){this._dragContext.draggableItems.length>0&&(this._store.flowHost.classList.add($e.DRAG_AND_DROP.DRAGGING),this._mediator.execute(new Uo),this._emitDragStarted())}_emitDragStarted(){let e=this._dragContext.draggableItems[0].getEvent();this._store.fDraggable?.fDragStarted?.emit(new Ul(e.kind,e.data?ae({},e.data):void 0,e.fEventType))}static \u0275fac=function(i){return new(i||Gs)};static \u0275prov=C({token:Gs,factory:Gs.\u0275fac})};return t=S([I(zl)],t),t})(),Uo=class{static fToken=Symbol("EmitSelectionChangeEventRequest")},ti=class{_event;_target;get originalEvent(){return this._event}get targetElement(){return this._target||this.originalEvent.target}get touchEvent(){return this._event}get touches(){return this.touchEvent.touches}constructor(n,e){this._event=n,this._target=e}setTarget(n){this._target=n}preventDefault(){this.originalEvent.preventDefault()}get isEventInLockedContext(){return this.targetElement.closest("[fLockedContext]")!==null}},ql=class extends ti{constructor(n,e){super(n,e)}isMouseLeftButton(){return this.originalEvent.button===0}isMouseRightButton(){return this.originalEvent.buttons===2}getPosition(){return{x:this.originalEvent.clientX,y:this.originalEvent.clientY}}},Kh=class extends ti{constructor(n,e){super(n,e)}isMouseLeftButton(){let n=this.originalEvent;return n.pointerType==="mouse"&&n.button===0||n.pointerType==="touch"}isMouseRightButton(){let n=this.originalEvent;return n.pointerType==="mouse"&&n.button===2||n.pointerType==="touch"}getPosition(){let n=this.originalEvent;return{x:n.clientX,y:n.clientY}}getPointerType(){return this.originalEvent.pointerType}getPointerId(){return this.originalEvent.pointerId}},Yh=class extends ti{constructor(n){super(n)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let n=this.originalEvent.touches;return{x:n[0].clientX,y:n[0].clientY}}},Xh=class extends ti{constructor(n,e){super(n,e)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let n=this.originalEvent.targetTouches[0];return{x:n.clientX,y:n.clientY}}},Se=(()=>{class t{static _isSupported;static _isPassiveEventListenerSupported(){if(t._isSupported==null&&typeof window<"u")try{window.addEventListener("test",t.emptyListener,{passive:!0}),t._isSupported=!0}catch{t._isSupported=!1}return t._isSupported}static _passiveEventListener(e){return t._isPassiveEventListenerSupported()?e:!!e.capture}static activeListener(){return t._passiveEventListener({passive:!1})}static passiveListener(){return t._passiveEventListener({passive:!0})}static activeCaptureListener(){return t._passiveEventListener({passive:!1,capture:!0})}static emptyListener(){return()=>{}}}return t})(),fR=800,Zh=class{_document=u(Jr);_ngZone=u(Vn,{optional:!0});_mouseListeners=Se.emptyListener();_touchListeners=Se.emptyListener();_startListeners=Se.emptyListener();isSyntheticEvent(n){return!!this._lastTouchEventTime&&this._lastTouchEventTime+fR>Date.now()}_lastTouchEventTime=0;isDragStarted=!1;_dragStartThreshold=3;_dragStartDelay=0;_dragStartTime=0;_dragStartPosition={x:0,y:0};_moveHandler=this._checkDragSequenceToStart;_pointerDownElement=null;_onMouseDown=n=>{let e=this.isSyntheticEvent(n),i=hR(n),o=new ql(n);if(e||i||this.disabled||this.isDragStarted)return;this._pointerDownElement=o.targetElement,this.onPointerDown(o)&&(this._dragStartTime=Date.now(),this._dragStartPosition=o.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,Se.activeListener()),this._listen("mousemove",this._onMouseMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,Se.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,Se.activeCaptureListener())}),this._mouseListeners=()=>{this._unlisten("selectstart",this._onSelectStart,Se.activeListener()),this._unlisten("mousemove",this._onMouseMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,Se.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,Se.activeCaptureListener())})};_onTouchDown=n=>{let e=mR(n),i=new Yh(n);if(e||this.disabled||this.isDragStarted)return;this._pointerDownElement=i.targetElement,this.onPointerDown(i)&&(this._dragStartTime=Date.now(),this._dragStartPosition=i.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,Se.activeListener()),this._listen("touchmove",this._onTouchMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,Se.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,Se.activeCaptureListener())}),this._touchListeners=()=>{this._unlisten("selectstart",this._onSelectStart,Se.activeListener()),this._unlisten("touchmove",this._onTouchMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,Se.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,Se.activeCaptureListener())})};_onSelectStart=n=>{this.onSelect(n)};_onMouseMove=n=>{this._moveHandler(new ql(n))};_onTouchMove=n=>{this._moveHandler(new Xh(n))};_checkDragSequenceToStart(n){let e=n.getPosition();if(!this.isDragStarted&&this._pointerDownElement){n.setTarget(this._pointerDownElement);let i=Math.abs(e.x-this._dragStartPosition.x),o=Math.abs(e.y-this._dragStartPosition.y);if(i+o>=this._dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._dragStartDelay)){this._endDragSequence();return}n.preventDefault(),this.prepareDragSequence(n),this.isDragStarted=!0,this._moveHandler=this.onPointerMove,pR(n.originalEvent)&&(this._lastTouchEventTime=Date.now())}}}_onPointerUpEvent=n=>{this.isDragStarted&&this.onPointerUp(new Kh(n)),this._endDragSequence()};_endDragSequence(){this.isDragStarted=!1,this._pointerDownElement=null,this._moveHandler=this._checkDragSequenceToStart,this._mouseListeners(),this._mouseListeners=Se.emptyListener(),this._touchListeners(),this._touchListeners=Se.emptyListener(),this.finalizeDragSequence()}subscribe(){this.unsubscribe(),this._ngZone?.runOutsideAngular(()=>{this._listen("mousedown",this._onMouseDown,Se.activeListener()),this._listen("touchstart",this._onTouchDown,Se.passiveListener())}),this._startListeners=()=>{this._unlisten("mousedown",this._onMouseDown,Se.activeListener()),this._unlisten("touchstart",this._onTouchDown,Se.passiveListener())}}unsubscribe(){this._startListeners(),this._startListeners=Se.emptyListener(),this._touchListeners(),this._touchListeners=Se.emptyListener(),this._mouseListeners(),this._mouseListeners=Se.emptyListener()}_listen(n,e,i){this._document.addEventListener(n,e,i)}_unlisten(n,e,i){this._document.removeEventListener(n,e,i)}_preventDuringDrag=n=>{this.isDragStarted&&n.preventDefault()}};function pR(t){return t.type[0]==="t"}function hR(t){return t.buttons===0||t.offsetX===0&&t.offsetY===0}function mR(t){let n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!!n&&n.identifier===-1&&(n.radiusX==null||n.radiusX===1)&&(n.radiusY==null||n.radiusY===1)}var Qh=class extends ti{_position;_isMouseLeftButton;_isMouseRightButton;constructor(n){super(n.originalEvent,n.targetElement),this._position=n.getPosition(),this._isMouseLeftButton=n.isMouseLeftButton(),this._isMouseRightButton=n.isMouseRightButton()}isMouseLeftButton(){return this._isMouseLeftButton}isMouseRightButton(){return this._isMouseRightButton}getPosition(){return ae({},this._position)}};function gR(t){return new Qh(t)}var te=(()=>{class t{selectedItems=[];isSelectedChanged=!1;onPointerDownScale=1;onPointerDownPosition=new ee(0,0);draggableItems=[];autoPanFrameId=null;lastPointerEvent=null;lastPointerPosition=null;isAutoPanCanvasMoved=!1;reset(){for(let e of this.draggableItems)try{e.destroy?.()}catch{console.error(`Error while destroying drag handler of type ${e.type}`)}this.draggableItems=[],this.onPointerDownScale=1,this.onPointerDownPosition=new ee(0,0),this.autoPanFrameId=null,this.lastPointerEvent=null,this.lastPointerPosition=null,this.isAutoPanCanvasMoved=!1}markSelectionAsChanged(){this.isSelectedChanged=!0}rememberPointerEvent(e){this.lastPointerEvent=gR(e),this.lastPointerPosition=this.lastPointerEvent.getPosition()}isEmpty(){return!this.draggableItems.length}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),Jh=class{nodeIds;groupIds;connectionIds;get fNodeIds(){return this.nodeIds}get fGroupIds(){return this.groupIds}get fConnectionIds(){return this.connectionIds}constructor(n,e,i){this.nodeIds=n,this.groupIds=e,this.connectionIds=i}},_R=(()=>{let t=class Hs{_mediator=u(R);_store=u(N);_dragSession=u(te);handle(e){this._dragSession.isSelectedChanged&&(this._emitSelectionChange(this._getSelection()),this._dragSession.isSelectedChanged=!1,this._mediator.execute(new xn))}_getSelection(){return this._mediator.execute(new hr)}_emitSelectionChange(e){this._store.fDraggable?.fSelectionChange.emit(new Jh(e.fNodeIds,e.fGroupIds,e.fConnectionIds))}static \u0275fac=function(i){return new(i||Hs)};static \u0275prov=C({token:Hs,factory:Hs.\u0275fac})};return t=S([I(Uo)],t),t})(),em=class{nodeOrGroup;static fToken=Symbol("GetNormalizedParentNodeRectRequest");constructor(n){this.nodeOrGroup=n}},yR=(()=>{let t=class js{_store=u(N);_mediator=u(R);handle({nodeOrGroup:e}){let i=W.initialize(-1/0,-1/0,1/0,1/0),o=this._getNode(e.fParentId());return o&&(i=this._getParentRect(o)),i}_getNode(e){return this._store.nodes.get(e)}_getParentRect(e){let i=this._getNodeRect(e),o=this._getNodePadding(e,i);return W.initialize(i.x+o[0],i.y+o[1],i.width-o[0]-o[2],i.height-o[1]-o[3])}_getNodeRect(e){return this._mediator.execute(new qe(e.hostElement))}_getNodePadding(e,i){return this._mediator.execute(new ii(e,i))}static \u0275fac=function(i){return new(i||js)};static \u0275prov=C({token:js,factory:js.\u0275fac})};return t=S([I(em)],t),t})(),tm=class{fParentNodes;fDraggedNodes;static fToken=Symbol("IsArrayHasParentNodeRequest");constructor(n,e){this.fParentNodes=n,this.fDraggedNodes=e}},vR=(()=>{let t=class Us{handle(e){return this._isParentNodeInArray(this._getParentNodeIds(e.fParentNodes),e.fDraggedNodes)}_getParentNodeIds(e){return e.map(i=>i.fId())}_isParentNodeInArray(e,i){return i.some(o=>e.includes(o.fId()))}static \u0275fac=function(i){return new(i||Us)};static \u0275prov=C({token:Us,factory:Us.\u0275fac})};return t=S([I(tm)],t),t})(),nm=class{fNodeId;fConnectionIds;constructor(n,e){this.fNodeId=n,this.fConnectionIds=e}},Vl=class extends nm{nodeId;connectionIds;constructor(n,e){super(n,e),this.nodeId=n,this.connectionIds=e}},Gl=class{nodeOrGroup;static fToken=Symbol("DetectConnectionsUnderDragNodeRequest");constructor(n){this.nodeOrGroup=n}},CR=(()=>{let t=class Ws{_mediator=u(R);_store=u(N);handle({nodeOrGroup:e}){let i=this._collectConnectableConnectorIds(e,"source"),o=this._collectConnectableConnectorIds(e,"target");if(!i.size||!o.size)return;let r=this._collectAttachedConnectionIds(i,o),a=this._collectConnectionsUnderNode(e),s=[];for(let c of a){let d=c.fId();r.has(d)||s.push(d)}s.length&&(this._store.fDraggable?.fNodeIntersectedWithConnections.emit(new Vl(e.fId(),s)),this._store.fDraggable?.fNodeConnectionsIntersection.emit(new Vl(e.fId(),s)))}_collectConnectableConnectorIds(e,i){let o=i==="source"?this._store.outputs.getAll():this._store.inputs.getAll(),r=new Set;for(let a of o)a.canBeConnected&&e.isContains(a.hostElement)&&r.add(a.fId());return r}_collectAttachedConnectionIds(e,i){let o=new Set;for(let r of this._store.connections.getAll())(e.has(r.fOutputId())||i.has(r.fInputId()))&&o.add(r.fId());return o}_collectConnectionsUnderNode(e){let i=this._mediator.execute(new Sn(e.hostElement,!1)),o=[];for(let r of this._store.connections.getAll())this._hasIntersection(r,i)&&o.push(r);return o}_hasIntersection(e,i){return zi.getRoundedRectIntersectionsWithSVGPath(e.fPath().hostElement,i).length>0}static \u0275fac=function(i){return new(i||Ws)};static \u0275prov=C({token:Ws,factory:Ws.\u0275fac})};return t=S([I(Gl)],t),t})(),xR=[uR,lR,_R,yR,vR,CR],bR=new Set(["create-connection","reassign-connection","drag-node"]),wR=new Set(["selection-area"]),SR=new Set(["assign-to-container"]);function Py(t){let n=null;for(let e of t){if(SR.has(e))continue;let i=bR.has(e)?"rebase":wR.has(e)?"direct":null;if(!i)return null;if(!n){n=i;continue}if(n!==i)return null}return n}function My(t,n,e,i,o){return B.initialize(H0(t.x,n.left,n.right,e,i,o),H0(t.y,n.top,n.bottom,e,i,o))}function H0(t,n,e,i,o,r){let a=Math.max(0,i),s=Math.max(0,o);if(!a||!s)return 0;if(t<=n+a){let c=U0((n+a-t)/a,0,1);return j0(c,s,r)}if(t>=e-a){let c=U0((t-(e-a))/a,0,1);return-j0(c,s,r)}return 0}function IR(t,n,e){let i=e||1;return ee.fromPoint(t).add(ee.fromPoint(n).div(i))}function j0(t,n,e){return e?n*t:n}function U0(t,n,e){return Math.max(n,Math.min(e,t))}var Hl=class{static fToken=Symbol("RunAutoPanFrameRequest")},In=class{static fToken=Symbol("StopAutoPanRequest")},TR=(()=>{let t=class $s{_store=u(N);_dragContext=u(te);handle(e){this._dragContext.autoPanFrameId!==null&&(cancelAnimationFrame(this._dragContext.autoPanFrameId),this._dragContext.autoPanFrameId=null),this._dragContext.isAutoPanCanvasMoved&&(this._store.fCanvas?.emitCanvasChangeEvent(),this._dragContext.isAutoPanCanvasMoved=!1)}static \u0275fac=function(i){return new(i||$s)};static \u0275prov=C({token:$s,factory:$s.\u0275fac})};return t=S([I(In)],t),t})(),Wo=class{static fToken=Symbol("SyncAutoPanRequest")},ER=(()=>{let t=class Ks{_mediator=u(R);_store=u(N);_dragContext=u(te);handle(e){if(!this._canAutoPan()||!this._hasAutoPanDelta()){this._mediator.execute(new In);return}this._dragContext.autoPanFrameId===null&&(this._dragContext.autoPanFrameId=requestAnimationFrame(()=>{this._dragContext.autoPanFrameId=null,this._mediator.execute(new Hl)}))}_canAutoPan(){return!!this._store.fFlow&&!!this._store.fCanvas&&!!this._store.fDraggable?.isDragStarted&&!!this._autoPan()&&!!this._getAutoPanMode()&&this._edgeThreshold()>0&&this._speed()>0}_hasAutoPanDelta(){let e=this._getAutoPanDelta();return!!e.x||!!e.y}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,i=this._store.fFlow?.hostElement;return!e||!i?B.initialize():My(e,i.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_getAutoPanMode(){return Py(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_edgeThreshold(){return Math.max(0,this._autoPan()?.fEdgeThreshold()??0)}_speed(){return Math.max(0,this._autoPan()?.fSpeed()??0)}_acceleration(){return!!this._autoPan()?.fAcceleration()}_autoPan(){return this._store.instances.get(Pe.AUTO_PAN)}static \u0275fac=function(i){return new(i||Ks)};static \u0275prov=C({token:Ks,factory:Ks.\u0275fac})};return t=S([I(Wo)],t),t})(),PR=(()=>{let t=class Ys{_mediator=u(R);_store=u(N);_dragContext=u(te);handle(e){let i=this._getAutoPanMode();if(!this._canAutoPan(i)){this._mediator.execute(new In);return}let o=this._getAutoPanDelta();if(!o.x&&!o.y){this._mediator.execute(new In);return}this._applyCanvasDelta(o,i),this._replayLastPointerMove(),this._mediator.execute(new Wo)}_applyCanvasDelta(e,i){let o=this._store.transform;i==="rebase"&&(this._dragContext.onPointerDownPosition=IR(this._dragContext.onPointerDownPosition,e,this._dragContext.onPointerDownScale||o.scale||1)),o.position=ee.fromPoint(o.position).add(e),this._store.fCanvas?.redraw(),this._dragContext.isAutoPanCanvasMoved=!0}_replayLastPointerMove(){let e=this._dragContext.lastPointerEvent;if(!e)return;let i=this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition);this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(ae({},i),e)})}_getPointerPositionInCanvas(e){return ee.fromPoint(e.getPosition()).elementTransform(this._store.flowHost)}_canAutoPan(e){return!!this._store.fFlow&&!!this._store.fCanvas&&!!this._store.fDraggable?.isDragStarted&&!!this._autoPan()&&!!e&&this._edgeThreshold()>0&&this._speed()>0}_getAutoPanMode(){return Py(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,i=this._store.fFlow?.hostElement;return!e||!i?B.initialize():My(e,i.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_edgeThreshold(){return Math.max(0,this._autoPan()?.fEdgeThreshold()??0)}_speed(){return Math.max(0,this._autoPan()?.fSpeed()??0)}_acceleration(){return!!this._autoPan()?.fAcceleration()}_autoPan(){return this._store.instances.get(Pe.AUTO_PAN)}static \u0275fac=function(i){return new(i||Ys)};static \u0275prov=C({token:Ys,factory:Ys.\u0275fac})};return t=S([I(Hl)],t),t})(),MR=[ER,PR,TR],jl=class{event;static fToken=Symbol("DragCanvasFinalizeRequest");constructor(n){this.event=n}},Ul=class{kind;data;fEventType;get fData(){return this.data}constructor(n,e,i){this.kind=n,this.data=e,this.fEventType=i??n}},ct=class{data(){}_features=[];getEvent(){return new Ul(this.kind,this.data(),this.type)}attachFeature(n){this._features.push(n)}featuresPrepare(n){for(let e of this._features)e.onPrepare?.(n)}featuresMove(n,e){for(let i of this._features)i.onMove?.(n,e)}featuresFinalize(n,e){for(let i of this._features)i.onFinalize?.(n,e)}featuresEnd(n){for(let e of this._features)e.onEnd?.(n)}},Wl=class{_isConnected=!1;get isConnected(){return this._isConnected}toConnector=[];isSelfConnectable=!0;fConnectableSide=z.AUTO;userFConnectableSide=z.AUTO;isContains(n){return this.hostElement.contains(n)}setConnected(n){this._isConnected=!0,this.toConnector.push(n)}resetConnected(){this._isConnected=!1,this.toConnector=[]}},kR=new he("F_NODE_INPUT"),DR=(()=>{class t extends Wl{kind="input";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,standalone:!1,features:[ve]})}return t})(),qt=(function(t){return t.LEFT="left",t.LEFT_TOP="left-top",t.TOP="top",t.RIGHT_TOP="right-top",t.RIGHT="right",t.RIGHT_BOTTOM="right-bottom",t.BOTTOM="bottom",t.LEFT_BOTTOM="left-bottom",t})(qt||{});function OR(t){return Do(t,".f-rotate-handle")}var ky=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,selectors:[["","fDragHandle",""]],hostAttrs:[1,"f-drag-handle","f-component"],standalone:!1})}return t})(),Rf=new he("F_NODE"),NR=xy(class{hostElement;constructor(t){this.hostElement=t}}),$l=class extends NR{_injector=u(ot);renderer=u($_);browser=u(je);stateChanges=new Tt;_position=B.initialize();_rotate=0;_size;connectors=[];positionChanges(){pe(()=>{let n=this.position();Bt(()=>{B.isEqual(this._position,n)||(this._position=n,this.redraw(),this.refresh())})},{injector:this._injector})}sizeChanges(){pe(()=>{let n=this.size();Bt(()=>{this._isSizeEqual(n)||(this._size=n,this.redraw(),this.refresh())})},{injector:this._injector})}rotateChanges(){pe(()=>{let n=this.rotate();Bt(()=>{this._rotate!==n&&(this._rotate=n,this.redraw(),this.refresh())})},{injector:this._injector})}parentChanges(){pe(()=>{this.fParentId(),this.fIncludePadding(),this.fAutoSizeToFitChildren(),Bt(()=>this.refresh())},{injector:this._injector})}_isSizeEqual(n){return this._size?.width===n?.width&&this._size?.height===n?.height}isContains(n){return this.hostElement.contains(n)}redraw(){this._size&&(this.setStyle("width",""+this._size.width+"px"),this.setStyle("height",""+this._size.height+"px")),this.setStyle("transform",`translate(${this._position.x}px,${this._position.y}px) rotate(${this._rotate}deg)`)}resetSize(){this.removeStyle("width"),this.removeStyle("height")}updatePosition(n){this._position=n}updateRotate(n){this._rotate=n}updateSize(n){this._size=n}setClass(n){this.hostElement.classList.add(n)}removeClass(n){this.hostElement.classList.remove(n)}addConnector(n){this.connectors.push(n),this.refresh()}removeConnector(n){let e=this.connectors.indexOf(n);e!==-1&&this.connectors.splice(e,1),this.refresh()}},RR=0,AR=3,im=(()=>{class t extends $l{_debounceTimer=null;_destroyRef=u(rt);_mediator=u(R);fId=F(`f-group-${RR++}`,{alias:"fGroupId"});fParentId=F(null,{alias:"fGroupParentId"});position=Wn(B.initialize(),{alias:"fGroupPosition"});size=F(void 0,{alias:"fGroupSize"});sizeChange=Ge({alias:"fGroupSizeChange"});rotate=Wn(0,{alias:"fGroupRotate"});fConnectOnNode=F(!0,{transform:Ce});fMinimapClass=F([]);fDraggingDisabled=F(!1,{alias:"fGroupDraggingDisabled",transform:Ce});fSelectionDisabled=F(!1,{alias:"fGroupSelectionDisabled",transform:Ce});fIncludePadding=F(!0,{transform:Ce});fAutoExpandOnChildHit=F(!1,{transform:Ce});fAutoSizeToFitChildren=F(!1,{transform:Ce});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new sr(this))}setStyle(e,i){this.renderer.setStyle(this.hostElement,e,i)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new xn),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),AR))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Qi(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new dr(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new lr(this))}static \u0275fac=function(i){return new(i||t)(Jp(Be))};static \u0275dir=De({type:t,selectors:[["","fGroup",""]],hostAttrs:[1,"f-group","f-component"],hostVars:5,hostBindings:function(i,o){i&2&&(U("data-f-group-id",o.fId()),se("f-group-dragging-disabled",o.fDraggingDisabled())("f-group-selection-disabled",o.fSelectionDisabled()))},inputs:{fId:[1,"fGroupId","fId"],fParentId:[1,"fGroupParentId","fParentId"],position:[1,"fGroupPosition","position"],size:[1,"fGroupSize","size"],rotate:[1,"fGroupRotate","rotate"],fConnectOnNode:[1,"fConnectOnNode"],fMinimapClass:[1,"fMinimapClass"],fDraggingDisabled:[1,"fGroupDraggingDisabled","fDraggingDisabled"],fSelectionDisabled:[1,"fGroupSelectionDisabled","fSelectionDisabled"],fIncludePadding:[1,"fIncludePadding"],fAutoExpandOnChildHit:[1,"fAutoExpandOnChildHit"],fAutoSizeToFitChildren:[1,"fAutoSizeToFitChildren"]},outputs:{position:"fGroupPositionChange",sizeChange:"fGroupSizeChange",rotate:"fGroupRotateChange"},exportAs:["fComponent"],standalone:!1,features:[we([{provide:Rf,useExisting:t}]),ve]})}return t})(),W0=0,FR=3,Af=(()=>{class t extends $l{_debounceTimer=null;_destroyRef=u(rt);_mediator=u(R);fId=F(`f-node-${W0++}`,{alias:"fNodeId",transform:e=>Xi(e)||`f-node-${W0++}`});fParentId=F(null,{alias:"fNodeParentId"});position=Wn(B.initialize(),{alias:"fNodePosition"});size=F(void 0,{alias:"fNodeSize"});sizeChange=Ge({alias:"fNodeSizeChange"});rotate=Wn(0,{alias:"fNodeRotate"});fConnectOnNode=F(!0,{transform:Ce});fMinimapClass=F([]);fDraggingDisabled=F(!1,{alias:"fNodeDraggingDisabled",transform:Ce});fSelectionDisabled=F(!1,{alias:"fNodeSelectionDisabled",transform:Ce});fIncludePadding=F(!0,{transform:Ce});fAutoExpandOnChildHit=F(!1,{transform:Ce});fAutoSizeToFitChildren=F(!1,{transform:Ce});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new sr(this))}setStyle(e,i){this.renderer.setStyle(this.hostElement,e,i)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new xn),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),FR))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new Qi(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new dr(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new lr(this))}static \u0275fac=function(i){return new(i||t)(Jp(Be))};static \u0275dir=De({type:t,selectors:[["","fNode",""]],hostAttrs:[1,"f-node","f-component"],hostVars:5,hostBindings:function(i,o){i&2&&(U("data-f-node-id",o.fId()),se("f-node-dragging-disabled",o.fDraggingDisabled())("f-node-selection-disabled",o.fSelectionDisabled()))},inputs:{fId:[1,"fNodeId","fId"],fParentId:[1,"fNodeParentId","fParentId"],position:[1,"fNodePosition","position"],size:[1,"fNodeSize","size"],rotate:[1,"fNodeRotate","rotate"],fConnectOnNode:[1,"fConnectOnNode"],fMinimapClass:[1,"fMinimapClass"],fDraggingDisabled:[1,"fNodeDraggingDisabled","fDraggingDisabled"],fSelectionDisabled:[1,"fNodeSelectionDisabled","fSelectionDisabled"],fIncludePadding:[1,"fIncludePadding"],fAutoExpandOnChildHit:[1,"fAutoExpandOnChildHit"],fAutoSizeToFitChildren:[1,"fAutoSizeToFitChildren"]},outputs:{position:"fNodePositionChange",sizeChange:"fNodeSizeChange",rotate:"fNodeRotateChange"},exportAs:["fComponent"],standalone:!1,features:[we([{provide:Rf,useExisting:t}]),ve]})}return t})();function LR(t){return!!t.closest("[fNode]")}var $0=0,Dy=(()=>{class t extends DR{hostElement=u(Be).nativeElement;_mediator=u(R);_node=u(Rf);fId=F(`f-node-input-${$0++}`,{alias:"fInputId",transform:e=>Xi(e)||`f-node-input-${$0++}`});category=F(void 0,{alias:"fInputCategory",transform:Xi});multiple=F(!0,{alias:"fInputMultiple",transform:Ce});disabled=F(!1,{alias:"fInputDisabled",transform:Ce});userFConnectableSide=z.AUTO;get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new or(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle($e.CONNECTOR.INPUT_CONNECTED,!0),this.hostElement.classList.toggle($e.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle($e.CONNECTOR.INPUT_CONNECTED,!1),this.hostElement.classList.toggle($e.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new ur(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,selectors:[["","fNodeInput",""]],hostAttrs:[1,"f-component","f-node-input"],hostVars:5,hostBindings:function(i,o){i&2&&(U("data-f-input-id",o.fId()),se("f-node-input-multiple",o.multiple)("f-node-input-disabled",o.disabled()))},inputs:{fId:[1,"fInputId","fId"],category:[1,"fInputCategory","category"],multiple:[1,"fInputMultiple","multiple"],disabled:[1,"fInputDisabled","disabled"],userFConnectableSide:[2,"fInputConnectableSide","userFConnectableSide",e=>qi(e,"fInputConnectableSide",z)]},exportAs:["fNodeInput"],standalone:!1,features:[we([{provide:kR,useExisting:t}]),ve,wi]})}return t})(),BR=(()=>{class t extends Wl{get hasConnectionLimits(){return!!this.canBeConnectedInputs&&this.canBeConnectedInputs.length>0}canConnectTo(e){return[e.fId(),e.category()].some(o=>o&&this.canBeConnectedInputs?.includes(o))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,standalone:!1,features:[ve]})}return t})();function Oy(t){return!!t.closest("[fNodeOutlet]")}var zR=new he("F_NODE_OUTPUT"),qR=(()=>{class t extends BR{kind="output";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,standalone:!1,features:[ve]})}return t})();function Ny(t){return!!t.closest("[fNodeOutput]")}var K0=0,Ry=(()=>{class t extends qR{hostElement=u(Be).nativeElement;_mediator=u(R);_node=u(Rf);fId=F(`f-node-output-${K0++}`,{alias:"fOutputId",transform:e=>Xi(e)||`f-node-output-${K0++}`});multiple=F(!1,{alias:"fOutputMultiple",transform:Ce});disabled=F(!1,{alias:"fOutputDisabled",transform:Ce});userFConnectableSide=z.AUTO;isSelfConnectable=!0;canBeConnectedInputs=[];get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new or(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle($e.CONNECTOR.OUTPUT_CONNECTED,!0),this.hostElement.classList.toggle($e.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle($e.CONNECTOR.OUTPUT_CONNECTED,!1),this.hostElement.classList.toggle($e.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new ur(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,selectors:[["","fNodeOutput",""]],hostAttrs:[1,"f-component","f-node-output"],hostVars:7,hostBindings:function(i,o){i&2&&(U("data-f-output-id",o.fId()),se("f-node-output-multiple",o.multiple)("f-node-output-disabled",o.disabled())("f-node-output-self-connectable",o.isSelfConnectable))},inputs:{fId:[1,"fOutputId","fId"],multiple:[1,"fOutputMultiple","multiple"],disabled:[1,"fOutputDisabled","disabled"],userFConnectableSide:[2,"fOutputConnectableSide","userFConnectableSide",e=>qi(e,"fOutputConnectableSide",z)],isSelfConnectable:"isSelfConnectable",canBeConnectedInputs:[0,"fCanBeConnectedInputs","canBeConnectedInputs"]},exportAs:["fNodeOutput"],standalone:!1,features:[we([{provide:zR,useExisting:t}]),ve,wi]})}return t})();var Kl=class{event;static fToken=Symbol("CreateConnectionFinalizeRequest");constructor(n){this.event=n}},$o=class{outlet;static fToken=Symbol("ResolveConnectableOutputForOutletRequest");constructor(n){this.outlet=n}},VR=(()=>{let t=class Xs{_store=u(N);handle({outlet:e}){let i=this._findOwnerNode(e);if(!i)throw new Error("The fOutlet must belong to an fNode");let o=this._findFirstConnectableOutputInNode(i);if(!o)throw new Error("Outlet requires at least one connectable output in the same node.");return o}_findOwnerNode(e){let i=e.hostElement;return this._store.nodes.getAll().find(o=>o.isContains(i))}_findFirstConnectableOutputInNode(e){return this._store.outputs.getAll().find(i=>e.isContains(i.hostElement)&&i.canBeConnected)}static \u0275fac=function(i){return new(i||Xs)};static \u0275prov=C({token:Xs,factory:Xs.\u0275fac})};return t=S([I($o)],t),t})(),om=class{sourceId;targetId;dropPosition;fOutputId;fInputId;fDropPosition;constructor(n,e,i){this.sourceId=n,this.targetId=e,this.dropPosition=i,this.fOutputId=n,this.fInputId=e,this.fDropPosition=i}},Yl=(()=>{class t extends ct{type="create-connection";kind="create-connection";data(){return{fOutputOrOutletId:this._sourceRef.connector.fId()}}_result=u(En);_mediator=u(R);_connectionBehaviour=u(ro);_store=u(N);get _connection(){return this._store.connections.getForCreate()}get _snapConnection(){return this._store.connections.getForSnap()}_targets=[];_sourceRef;_pointerDown=new He;initialize(e,i){this._sourceRef=this._mediator.execute(new vt(e)),this._pointerDown=He.fromRect(W.initialize(i.x,i.y))}prepareDragSequence(){this._collectAndMarkTargets(),this._initSnapConnection(),this._initCreateConnection(),this._connection.show(),this.onPointerMove(B.initialize()),this._result.setData({toConnectorRect:this._pointerDown,canBeConnectedInputs:this._targets,fOutputId:this._sourceRef.connector.fId()})}_collectAndMarkTargets(){this._targets=this._mediator.execute(new ar(this._sourceRef.connector,this._sourceRef.rect.gravityCenter)),this._mediator.execute(new to(this._targets.map(e=>e.connector)))}_initSnapConnection(){this._snapConnection&&(this._snapConnection.fOutputId.set(this._sourceRef.connector.fId()),this._snapConnection.initialize())}_initCreateConnection(){this._connection.fOutputId.set(this._sourceRef.connector.fId()),this._connection.initialize()}onPointerMove(e){let i=this._pointerDown.addPoint(e),o=this._findClosestTarget(i),r=o?.connector.fConnectableSide||z.TOP;this._drawCreateConnection(i,r);let a=this._snapConnection;if(!a)return;let s=o&&o.distance<a.fSnapThreshold?o:void 0;this._drawSnapConnection(s)}_findClosestTarget(e){return this._mediator.execute(new ni(e,this._targets))}_drawCreateConnection(e,i){let o=this._connectionBehaviour.handle(new At(this._sourceRef.rect,e,this._connection,this._sourceRef.connector.fConnectableSide,i,this._resolveRotationContext(this._sourceRef.connector)));this._connection.setLine(o),this._connection.redraw()}_drawSnapConnection(e){let i=this._snapConnection;if(!i)return;if(!e){i.hide();return}let o=this._connectionBehaviour.handle(new At(this._sourceRef.rect,e.rect,i,this._sourceRef.connector.fConnectableSide,e.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(e.connector)));i.show(),i.setLine(o),i.redraw()}onPointerUp(){this._connection.redraw(),this._connection.hide(),this._snapConnection?.hide(),this._mediator.execute(new no(this._targets.map(e=>e.connector)))}_resolveRotationContext(e){return this._mediator.execute(new tn(e))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),GR=(()=>{let t=class Zs{_result=u(En);_mediator=u(R);_store=u(N);_dragContext=u(te);get _dragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isValid()&&(this._emitEvent(e.event),this._dragHandler.onPointerUp())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Yl)}_getTargetOutput(e){if(!e)throw new Error(`Output with fOutputId ${this._result.getData().fOutputId} not found. Make sure there is no f-connection to a non-existent fOutput.`);return Oy(e.hostElement)?this._mediator.execute(new $o(e)):e}_getOutput(){return this._store.outputs.get(this._result.getData().fOutputId)}_getOutlet(){return this._store.outlets.get(this._result.getData().fOutputId)}_emitEvent(e){this._store.fDraggable?.fCreateConnection.emit(new om(this._getTargetOutput(this._getOutput()||this._getOutlet()).fId(),this._getInputUnderPointer(e)?.fId(),e.getPosition()))}_getInputUnderPointer(e){return this._mediator.execute(new rr(e.getPosition(),this._result.getData().canBeConnectedInputs))}static \u0275fac=function(i){return new(i||Zs)};static \u0275prov=C({token:Zs,factory:Zs.\u0275fac})};return t=S([I(Kl)],t),t})(),Ko=class{eventPosition;source;static fToken=Symbol("CreateConnectionCreateDragHandlerRequest");constructor(n,e){this.eventPosition=n,this.source=e}},HR=(()=>{let t=class Qs{_store=u(N);_dragContext=u(te);_dragInjector=u(tt);get _transform(){return this._store.transform}handle({source:e,eventPosition:i}){this._dragContext.onPointerDownScale=this._transform.scale;let o=this._toFlowSpace(i);this._dragContext.onPointerDownPosition=o;let r=this._toCanvasSpace(o),a=this._dragInjector.get(Yl);a.initialize(e,r),this._dragContext.draggableItems=[a]}_toFlowSpace(e){return ee.fromPoint(e).elementTransform(this._store.flowHost).div(this._transform.scale)}_toCanvasSpace(e){return ee.fromPoint(e).mult(this._transform.scale).sub(this._transform.position).sub(this._transform.scaledPosition).div(this._transform.scale)}static \u0275fac=function(i){return new(i||Qs)};static \u0275prov=C({token:Qs,factory:Qs.\u0275fac})};return t=S([I(Ko)],t),t})(),Xl=class{event;node;static fToken=Symbol("CreateConnectionFromOutletPreparationRequest");constructor(n,e){this.event=n,this.node=e}},jR=(()=>{let t=class Js{_mediator=u(R);_store=u(N);handle({event:e,node:i}){let o=this._findOutlet(i);if(!o||(o.setOutputs(this._getOutputs(i)),!o.canBeConnected))return;let r=o.isConnectionFromOutlet?o:this._resolveOutput(o);!r||!r.canBeConnected||this._startDrag(e.getPosition(),r)}_findOutlet(e){return this._store.outlets.getAll().find(i=>e.isContains(i.hostElement))}_getOutputs(e){return this._store.outputs.getAll().filter(i=>e.isContains(i.hostElement))}_resolveOutput(e){return this._mediator.execute(new $o(e))}_startDrag(e,i){this._mediator.execute(new Ko(e,i))}static \u0275fac=function(i){return new(i||Js)};static \u0275prov=C({token:Js,factory:Js.\u0275fac})};return t=S([I(Xl)],t),t})(),Zl=class{event;node;static fToken=Symbol("CreateConnectionFromOutputPreparationRequest");constructor(n,e){this.event=n,this.node=e}},UR=(()=>{let t=class ec{_mediator=u(R);_store=u(N);handle({event:e,node:i}){if(!Ny(e.targetElement)||this._hasOutlet(i))return;let o=this._findOutput(e.targetElement);!o||!o.canBeConnected||this._startDrag(e.getPosition(),o)}_hasOutlet(e){return this._store.outlets.getAll().some(i=>e.isContains(i.hostElement))}_findOutput(e){return this._store.outputs.getAll().find(i=>i.hostElement.contains(e))}_startDrag(e,i){this._mediator.execute(new Ko(e,i))}static \u0275fac=function(i){return new(i||ec)};static \u0275prov=C({token:ec,factory:ec.\u0275fac})};return t=S([I(Zl)],t),t})(),Ql=class{event;fTrigger;static fToken=Symbol("CreateConnectionPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},WR=(()=>{let t=class tc{_mediator=u(R);_store=u(N);_dragContext=u(te);handle({event:e,fTrigger:i}){if(!this._isValidConditions()||!this._isValidTrigger(e,i))return;let o=Oy(e.targetElement),r=!o&&Ny(e.targetElement);if(!o&&!r)return;let a=this._findOwnerNode(e.targetElement);a&&(o?this._mediator.execute(new Xl(e,a)):this._mediator.execute(new Zl(e,a)))}_findOwnerNode(e){return this._store.nodes.getAll().find(i=>i.isContains(e))}_isValidConditions(){return this._dragContext.isEmpty()&&!!this._store.connections.getForCreate()}_isValidTrigger(e,i){return Et(e.originalEvent,i)}static \u0275fac=function(i){return new(i||tc)};static \u0275prov=C({token:tc,factory:tc.\u0275fac})};return t=S([I(Ql)],t),t})(),Jl=class{event;static fToken=Symbol("ReassignConnectionFinalizeRequest");constructor(n){this.event=n}},rm=class{connectionId;endpoint;previousSourceId;nextSourceId;previousTargetId;nextTargetId;dropPosition;isSourceReassign;isTargetReassign;oldSourceId;newSourceId;oldTargetId;newTargetId;dropPoint;constructor(n,e,i,o,r,a,s){this.connectionId=n,this.endpoint=e,this.previousSourceId=i,this.nextSourceId=o,this.previousTargetId=r,this.nextTargetId=a,this.dropPosition=s,this.isSourceReassign=e==="source",this.isTargetReassign=e==="target",this.oldSourceId=i,this.newSourceId=o,this.oldTargetId=r,this.newTargetId=a,this.dropPoint=s}},$R=(()=>{let t=class nc{_dragResult=u(En);_mediator=u(R);_store=u(N);_dragContext=u(te);get _dragDirective(){return this._store.fDraggable}handle({event:e}){let i=this._findReassignHandler();i&&(this._emitIfChanged(e),i.onPointerUp())}_findReassignHandler(){return this._dragContext.draggableItems.find(i=>i.getEvent().fEventType==="reassign-connection")}_emitIfChanged(e){let i=this._dragResult.getData(),o=this._findConnectableConnector(e,i.candidates);o&&!this._isReassignedToDifferentConnector(i,o)||this._dragDirective.fReassignConnection.emit(this._buildEvent(i,e,o))}_findConnectableConnector(e,i){return this._mediator.execute(new rr(e.getPosition(),i))}_isReassignedToDifferentConnector(e,i){let o=e.connection;return e.draggedEnd==="target"?o.fInputId()!==i.fId():o.fOutputId()!==i.fId()}_buildEvent(e,i,o){let r=e.connection;return new rm(r.fId(),e.draggedEnd,r.fOutputId(),e.draggedEnd==="source"?o?.fId():void 0,r.fInputId(),e.draggedEnd==="target"?o?.fId():void 0,i.getPosition())}static \u0275fac=function(i){return new(i||nc)};static \u0275prov=C({token:nc,factory:nc.\u0275fac})};return t=S([I(Jl)],t),t})(),eu=class{event;fTrigger;static fToken=Symbol("ReassignConnectionPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}};function KR(t,n){return Ay(t,n)||YR(t,n)}function Ay(t,n){return t.fDragHandleEnd()?.point&&Fy(n,t.fDragHandleEnd().point)&&!t.fDraggingDisabled()}function YR(t,n){return!!t.fDragHandleStart()?.point&&Fy(n,t.fDragHandleStart().point)&&!t.fDraggingDisabled()&&t.fReassignableStart()}function Fy(t,n){return(t.x-n.x)**2+(t.y-n.y)**2<=8**2}function Ly(t,n){return t&&t.distance<n.fSnapThreshold?t:void 0}function tu(t){return He.fromRect(W.initialize(t.x,t.y))}var am=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(n,e,i,o,r){this._mediator=n,this._behaviour=e,this._connection=i,this._sourceRef=o,this._targetRef=r,this._anchorRect=tu(this._connection.line.point1)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new rf(this._target,this._targetRef.rect.gravityCenter)),this._candidates.some(n=>n.connector.fId()===this._source.fId())||this._candidates.push(this._sourceRef),this._mediator.execute(new to(this._candidates.map(n=>n.connector)))}setSnapConnection(n){this._snap=n,n&&(n.fInputId.set(this._connection.fInputId()),n.initialize())}onPointerMove(n){let e=this._anchorRect.addPoint(n),i=this._findClosest(e.gravityCenter),o=i?.connector.fConnectableSide??this._source.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(Ly(i,r))}_findClosest(n){return this._mediator.execute(new ni(n,this._candidates))}_draw(n,e){let i=this._behaviour.handle(new At(n,this._targetRef.rect,this._connection,e,this._targetRef.connector.fConnectableSide,void 0,this._resolveRotationContext(this._targetRef.connector)));this._connection.setLine(i),this._connection.redraw()}_drawSnap(n){let e=this._snap;if(!e)return;if(!n){e.hide();return}let i=this._behaviour.handle(new At(n.rect,this._targetRef.rect,e,n.connector.fConnectableSide,this._target.fConnectableSide,this._resolveRotationContext(n.connector),this._resolveRotationContext(this._targetRef.connector)));e.show(),e.setLine(i),e.redraw()}onPointerUp(){this._draw(this._anchorRect,this._sourceRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new no(this._candidates.map(n=>n.connector)))}_resolveRotationContext(n){return this._mediator.execute(new tn(n))}},sm=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(n,e,i,o,r){this._mediator=n,this._behaviour=e,this._connection=i,this._sourceRef=o,this._targetRef=r,this._anchorRect=tu(this._connection.line.point2)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new ar(this._source,this._sourceRef.rect.gravityCenter));let n=this._connection.fInputId();n&&!this._candidates.some(e=>e.connector.fId()===n)&&this._candidates.push(this._targetRef),this._mediator.execute(new to(this._candidates.map(e=>e.connector)))}setSnapConnection(n){this._snap=n,n&&(n.fOutputId.set(this._connection.fOutputId()),n.initialize())}onPointerMove(n){let e=this._anchorRect.addPoint(n),i=this._findClosest(e.gravityCenter),o=i?.connector.fConnectableSide??this._target.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(Ly(i,r))}onPointerUp(){this._draw(this._anchorRect,this._targetRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new no(this._candidates.map(n=>n.connector)))}_findClosest(n){return this._mediator.execute(new ni(n,this._candidates))}_draw(n,e){let i=this._behaviour.handle(new At(this._sourceRef.rect,n,this._connection,this._source.fConnectableSide,e,this._resolveRotationContext(this._sourceRef.connector),void 0));this._connection.setLine(i),this._connection.redraw()}_drawSnap(n){let e=this._snap;if(!e)return;if(!n){e.hide();return}let i=this._behaviour.handle(new At(this._sourceRef.rect,n.rect,e,this._source.fConnectableSide,n.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(n.connector)));e.show(),e.setLine(i),e.redraw()}_resolveRotationContext(n){return this._mediator.execute(new tn(n))}},cm=(()=>{class t extends ct{type="reassign-connection";kind="reassign-connection";data(){return{fConnectionId:this._connection.fId()}}_result=u(En);_mediator=u(R);_connectionBehaviour=u(ro);_store=u(N);get _snapConnection(){return this._store.connections.getForSnap()}_connection;_draggedEnd;_sourceRef;_targetRef;_reassignHandler;initialize(e,i){this._connection=e,this._draggedEnd=i?"target":"source",this._sourceRef=this._mediator.execute(new vt(this._store.outputs.require(this._connection.fOutputId()))),this._targetRef=this._mediator.execute(new vt(this._store.inputs.require(this._connection.fInputId()))),this._reassignHandler=this._draggedEnd==="target"?this._createTargetHandler():this._createSourceHandler()}_createSourceHandler(){return new am(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}_createTargetHandler(){return new sm(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}prepareDragSequence(){this._reassignHandler.collectAndMarkCandidates(),this._reassignHandler.setSnapConnection(this._snapConnection),this._result.setData({draggedEnd:this._draggedEnd,sourceAnchorRect:tu(this._connection.line.point1),targetAnchorRect:tu(this._connection.line.point2),candidates:this._reassignHandler.candidates(),connection:this._connection})}onPointerMove(e){this._reassignHandler.onPointerMove(e)}onPointerUp(){this._reassignHandler.onPointerUp()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),XR=(()=>{let t=class ic{_mediator=u(R);_store=u(N);_dragContext=u(te);_dragInjector=u(tt);get _canvas(){return this._store.fCanvas}get _transform(){return this._store.transform}get _connections(){return this._store.connections.getAll()}handle(e){if(!this._dragContext.isEmpty()||!this._isValidTrigger(e))return;let i=ao(e.event.getPosition(),this._store.flowHost,this._transform),o=this._findConnectionAt(i);o&&(this._capturePointerDown(e),this._startDrag(o,i),queueMicrotask(()=>this._bringToFront(o)))}_findConnectionAt(e){return this._connections.find(i=>KR(i,e))}_capturePointerDown(e){this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=ee.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(this._transform.scale)}_startDrag(e,i){let o=this._dragInjector.get(cm);o.initialize(e,Ay(e,i)),this._dragContext.draggableItems=[o]}_isValidTrigger(e){return Et(e.event.originalEvent,e.fTrigger)}_bringToFront(e){this._mediator.execute(new oi(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(i){return new(i||ic)};static \u0275prov=C({token:ic,factory:ic.\u0275fac})};return t=S([I(eu)],t),t})(),nu=class{event;static fToken=Symbol("DragConnectionWaypointFinalizeRequest");constructor(n){this.event=n}},iu=class{connectionId;waypoints;constructor(n,e){this.connectionId=n,this.waypoints=e}},ou=(()=>{class t extends ct{type="move-connection-waypoint";kind="drag-connection-waypoint";_store=u(N);_point;_pick;get _waypointsComponent(){return this._pick?.connection.fWaypoints()}get _connection(){return this._pick?.connection}setPick(e){this._pick=e}prepareDragSequence(){this._pick?.candidate?(this._point=ae({},this._pick.candidate),this._waypointsComponent.insert(this._pick.candidate)):this._pick?.waypoint&&(this._point=ae({},this._pick.waypoint),this._waypointsComponent.select(this._pick.waypoint)),this._redrawConnection()}onPointerMove(e){this._waypointsComponent.move(B.sum(this._point,e)),this._redrawConnection()}onPointerUp(){this._waypointsComponent.update(),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._eventFromPick())}_redrawConnection(){this._connection.setLine(this._connection.line),this._connection.redraw()}_eventFromPick(){return new iu(this._connection.fId(),this._connection.fWaypoints()?.waypoints()||[])}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),ZR=(()=>{let t=class oc{_dragContext=u(te);get _fDragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isDroppedConnectionReassignEvent()&&this._fDragHandler.onPointerUp()}_isDroppedConnectionReassignEvent(){return this._dragContext.draggableItems.some(e=>e instanceof ou)}static \u0275fac=function(i){return new(i||oc)};static \u0275prov=C({token:oc,factory:oc.\u0275fac})};return t=S([I(nu)],t),t})(),ru=class{event;fTrigger;static fToken=Symbol("DragConnectionWaypointPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},QR=(()=>{let t=class rc{_mediator=u(R);_store=u(N);_dragContext=u(te);_dragInjector=u(tt);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _flowHost(){return this._store.flowHost}get _connections(){return this._store.connections.getAll()}handle(e){let i=ao(e.event.getPosition(),this._flowHost,this._transform),o=this._pickControlPoint(i);if(!o||!this._isValidTrigger(e))return;let r=this._dragInjector.get(ou);r.setPick(o),this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=ee.fromPoint(e.event.getPosition()).elementTransform(this._flowHost).div(this._transform.scale),this._dragContext.draggableItems=[r],queueMicrotask(()=>this._updateConnectionLayer(o.connection))}_pickControlPoint(e){if(this._dragContext.isEmpty())return IO(this._connections,e)}_isValidTrigger(e){return Et(e.event.originalEvent,e.fTrigger)}_updateConnectionLayer(e){this._mediator.execute(new oi(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(i){return new(i||rc)};static \u0275prov=C({token:rc,factory:rc.\u0275fac})};return t=S([I(ru)],t),t})(),JR=[GR,HR,jR,VR,UR,WR,$R,XR,QR,ZR],au=class{event;static fToken=Symbol("DropToGroupFinalizeRequest");constructor(n){this.event=n}},e2=1,Yo=(()=>{class t extends ct{type="move-node-to-parent";kind="assign-to-container";_store=u(N);_dragSession=u(te);get _transform(){return this._store.transform}_candidateGroups=[];_debounceTimer=null;_activeTarget=null;get activeTarget(){return this._activeTarget}initialize(e){this._candidateGroups=e}prepareDragSequence(){for(let{node:e}of this._candidateGroups)e.hostElement.classList.add($e.GROUPING.DROP_ACTIVE)}onPointerMove(e){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._updateActiveTarget(e),e2)}onPointerUp(){this._clearActiveTarget();for(let{node:e}of this._candidateGroups)e.hostElement.classList.remove($e.GROUPING.DROP_ACTIVE);this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}_updateActiveTarget(e){let i=this._getPointerInFlow(e),o=this._findTargetUnderPointer(i);o?this._setActiveTarget(o):this._clearActiveTarget()}_getPointerInFlow(e){let i=ee.fromPoint(this._dragSession.onPointerDownPosition).add(e),o=ee.fromPoint(this._transform.position).add(this._transform.scaledPosition).div(this._transform.scale);return i.sub(o)}_findTargetUnderPointer(e){return this._candidateGroups.find(i=>W.isIncludePoint(i.rect,e))}_setActiveTarget(e){this._activeTarget?.node!==e.node&&(this._clearActiveTarget(),this._activeTarget=e,e.node.setClass($e.GROUPING.OVER_BOUNDARY))}_clearActiveTarget(){this._activeTarget?.node.removeClass($e.GROUPING.OVER_BOUNDARY),this._activeTarget=null}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),su=class{nodesAndGroups;static fToken=Symbol("CreateDragNodeHierarchyRequest");constructor(n){this.nodesAndGroups=n}},dm=class{rootHandlers;participants;constructor(n,e){this.rootHandlers=n,this.participants=e}},lm=class{fNodeIds;constructor(n){this.fNodeIds=n}},Fm="move-node",Lm="drag-node";function t2(t){return t.getEvent().kind===Lm||t.getEvent().fEventType===Fm}var Tn=(()=>{class t extends ct{type=Fm;kind=Lm;data(){return new lm(this.items.map(e=>e.nodeOrGroup.fId()))}_magneticLines=null;_magneticRects=null;items;roots;initialize(e,i){this.items=e,this.roots=i}setMagneticLines(e){this._magneticLines=e}setMagneticRects(e){this._magneticRects=e}calculateMagneticLinesGuides(e){return this.calculateMagneticSnaps(e).lines}calculateMagneticSnaps(e){this._previewRoots(e);let i=this._rootsUnionRect();return{lines:this._magneticLines?._computeGuides(i),rects:this._magneticRects?._computeRects(i)}}prepareDragSequence(){for(let e of this.roots)e.prepareDragSequence()}onPointerMove(e){this._previewRoots(e);let i=this._rootsUnionRect();this._magneticLines?.scheduleRender(i),this._magneticRects?.scheduleRender(i)}onPointerUp(){for(let e of this.roots)e.onPointerUp();this._magneticLines?.clearGuides(),this._magneticRects?.clearGuides(),requestAnimationFrame(()=>this._refreshDraggedNodes())}_previewRoots(e){for(let i of this.roots)i.onPointerMove(e)}_rootsUnionRect(){let e=null;for(let i of this.roots){let o=i.getLastRect();e=e?W.union([e,o]):o}return e??W.initialize()}_refreshDraggedNodes(){for(let{nodeOrGroup:e}of this.roots)e.refresh()}destroy(){for(let e of this.roots??[])e.destroy?.()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),cu=class{_limits;_quantizeStep;constructor(n,e=.5){this._limits=n,this._quantizeStep=e}applyInto(n,e){let{min:i,max:o}=this._limits,r=this._clamp(n.x,i.x,o.x),a=this._clamp(n.y,i.y,o.y),s=n.x-r,c=n.y-a,d=this._quantizeSigned(s,this._quantizeStep),f=this._quantizeSigned(c,this._quantizeStep);e.value.x=r,e.value.y=a,e.edges.left=d<0,e.edges.right=d>0,e.edges.top=f<0,e.edges.bottom=f>0,e.overflow.x=Math.abs(d),e.overflow.y=Math.abs(f)}_quantizeSigned(n,e){if(e<=0||n===0)return 0;let i=n/e;return(n>0?Math.ceil(i):Math.floor(i))*e}_clamp(n,e,i){return Math.min(Math.max(n,e),i)}},um=class{_pointerDown;_vCellSize;_hCellSize;_snapWhileDragging;constructor(n,e){this._pointerDown=e,this._vCellSize=n.vCellSize(),this._hCellSize=n.hCellSize(),this._snapWhileDragging=n.fCellSizeWhileDragging()}snap(n,e){let i=e||this._snapWhileDragging;return this._strategies[+i](n)}_strategies={0:this._noSnap.bind(this),1:this._snapWithCellSize.bind(this)};_snapWithCellSize(n){return{x:this._snapToGrid(this._pointerDown.x+n.x,this._hCellSize)-this._pointerDown.x,y:this._snapToGrid(this._pointerDown.y+n.y,this._vCellSize)-this._pointerDown.y}}_noSnap(n){return n}_snapToGrid(n,e){return Math.round(n/e)*e}};function Y0(){return{value:{x:0,y:0},overflow:{x:0,y:0},edges:{left:!1,right:!1,top:!1,bottom:!1}}}var fm=class{_snapper;_hardClamp;_hardResult=Y0();_softClamps=[];_softResults=[];constructor(n,e,i){let o=n.get(N).fDraggable;this._snapper=new um(o,e),this._hardClamp=new cu(i.hard,.5);for(let r of i.soft)this._softClamps.push(new cu(r.limits,.5)),this._softResults.push(Y0())}apply(n,e=!1){let i=this._snapper.snap(n,e);this._hardClamp.applyInto(i,this._hardResult);let o={x:this._hardResult.value.x,y:this._hardResult.value.y};for(let r=0;r<this._softClamps.length;r++)this._softClamps[r].applyInto(o,this._softResults[r]);return{hardDelta:o,soft:this._softResults}}finalize(n){return this.apply(n,!0)}};function X0(t,n,e){let{x:i,y:o,width:r,height:a}=t;return e.right&&n.x>0&&(r+=n.x),e.left&&n.x>0&&(i-=n.x,r+=n.x),e.bottom&&n.y>0&&(a+=n.y),e.top&&n.y>0&&(o-=n.y,a+=n.y),W.initialize(i,o,r,a)}var pm=class extends ct{_injector;nodeOrGroup;children;sourceConnectionHandlers;targetConnectionHandlers;type=Fm;kind=Lm;_startPosition=B.initialize();_startRect=W.initialize();_applyConstraints=n=>n;_lastSoftResults=[];_deltaConstraints;_constraints;_lastPosition=B.initialize();_softParentConnectionHandlers=[];_mediator;constructor(n,e,i=[],o=[],r=[]){super(),this._injector=n,this.nodeOrGroup=e,this.children=i,this.sourceConnectionHandlers=o,this.targetConnectionHandlers=r,this._mediator=n.get(R),this._startRect=this._mediator.execute(new qe(e.hostElement)),this._startPosition=ae({},e._position)}setConstraints(n){this._constraints=n,this._deltaConstraints=new fm(this._injector,this._startPosition,n),this._applyConstraints=e=>{let i=this._deltaConstraints.apply(e);return this._applySoftExpansions(i.soft),i.hardDelta}}setSoftParentConnectionHandlers(n){this._softParentConnectionHandlers=n}finalizeConstraints(){this._applyConstraints=n=>{let e=this._deltaConstraints.finalize(n);return this._applySoftExpansions(e.soft),e.hardDelta}}getLastRect(){return W.initialize(this._lastPosition.x,this._lastPosition.y,this._startRect.width,this._startRect.height)}prepareDragSequence(){for(let n of this.children)n.prepareDragSequence();this.nodeOrGroup.hostElement.classList.add($e.DRAG_AND_DROP.DRAGGING)}onPointerMove(n){let e=this._applyConstraints(n);for(let i of this.children)i.onPointerMove(e);this._redraw(this._startPlus(e));for(let i of this.sourceConnectionHandlers)i.setSourceDelta(e);for(let i of this.targetConnectionHandlers)i.setTargetDelta(e)}onPointerUp(){for(let n of this.children)n.onPointerUp();this.nodeOrGroup.position.set(this.nodeOrGroup._position),this.nodeOrGroup.hostElement.classList.remove($e.DRAG_AND_DROP.DRAGGING),this._emitExpandedEvent()}_startPlus(n){return B.sum(this._startPosition,n)}_redraw(n){this._lastPosition=n,this.nodeOrGroup.updatePosition(n),this._mediator.execute(new Jn(this.nodeOrGroup.fId(),W.initialize(n.x,n.y,this._startRect.width,this._startRect.height))),this.nodeOrGroup.redraw()}_applySoftExpansions(n){this._lastSoftResults=n;for(let e=0;e<n.length;e++){let i=n[e],o=this._constraints.soft[e],r=X0(o.boundingRect,i.overflow,i.edges);this._commitParentRect(o.nodeOrGroup,r)&&this._updateParentConnectionHandlers(e)}}_commitParentRect(n,e){let i=n._position.x!==e.x||n._position.y!==e.y||n._size?.width!==e.width||n._size?.height!==e.height;return n.updateSize({width:e.width,height:e.height}),n.updatePosition({x:e.x,y:e.y}),this._mediator.execute(new Jn(n.fId(),e)),n.redraw(),i}_updateParentConnectionHandlers(n){let e=this._softParentConnectionHandlers[n];if(!e)return;let i=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,i);o.handler.setSourceDelta(this._buildDelta(o.baselineRect,r))}for(let o of e.target){let r=this._readConnectorRect(o.connector,i);o.handler.setTargetDelta(this._buildDelta(o.baselineRect,r))}}_readConnectorRect(n,e){let i=`${n.kind}::${n.fId()}`,o=e.get(i);if(o)return o;let r=this._mediator.execute(new vt(n)).rect;return e.set(i,r),r}_buildDelta(n,e){return B.initialize(e.x-n.x,e.y-n.y)}_emitExpandedEvent(){for(let n=0;n<this._lastSoftResults.length;n++){let e=this._lastSoftResults[n];if(!e.overflow.x&&!e.overflow.y)continue;let i=this._constraints.soft[n],o=X0(i.boundingRect,e.overflow,e.edges);i.nodeOrGroup.sizeChange.emit(o)}}destroy(){for(let n of this.children)n.destroy?.();this.children=[],this.sourceConnectionHandlers=[],this.targetConnectionHandlers=[],this._lastSoftResults=[],this._applyConstraints=n=>n,this._softParentConnectionHandlers=[]}},n2=(()=>{let t=class ac{_injector=u(ot);handle({nodesAndGroups:e}){let i=this._createHandlerByNodeId(e),o=this._linkParentsAndCollectRoots(e,i);return new dm(o,Array.from(i.values()))}_createHandlerByNodeId(e){let i=new Map;for(let o of e)i.set(o.fId(),new pm(this._injector,o));return i}_linkParentsAndCollectRoots(e,i){let o=[];for(let r of e){let a=i.get(r.fId());if(!a)continue;let s=r.fParentId(),c=s?i.get(s):void 0;c?c.children.push(a):o.push(a)}return o}static \u0275fac=function(i){return new(i||ac)};static \u0275prov=C({token:ac,factory:ac.\u0275fac})};return t=S([I(su)],t),t})(),du=class{nodeOrGroup;static fToken=Symbol("BuildDragNodeConstraintsRequest");constructor(n){this.nodeOrGroup=n}},Xo=class{nodeOrGroup;childrenPaddings;static fToken=Symbol("ReadNodeBoundsWithPaddingsRequest");constructor(n,e){this.nodeOrGroup=n,this.childrenPaddings=e}},hm=class{nodeOrGroup;boundingRect;innerRect;paddings;constructor(n,e,i,o){this.nodeOrGroup=n,this.boundingRect=e,this.innerRect=i,this.paddings=o}},i2=(()=>{let t=class sc{_mediator=u(R);handle({nodeOrGroup:e,childrenPaddings:i}){let o=this._readBoundingRect(e),r=this._readOwnPaddings(e,o),a=[r[0]+i[0],r[1]+i[1],r[2]+i[2],r[3]+i[3]],s=W.initialize(o.x+a[0],o.y+a[1],o.width-a[0]-a[2],o.height-a[1]-a[3]);return new hm(e,o,s,a)}_readBoundingRect(e){return this._mediator.execute(new qe(e.hostElement))}_readOwnPaddings(e,i){return this._mediator.execute(new ii(e,i))}static \u0275fac=function(i){return new(i||sc)};static \u0275prov=C({token:sc,factory:sc.\u0275fac})};return t=S([I(Xo)],t),t})(),o2=(()=>{let t=class cc{_mediator=u(R);handle({nodeOrGroup:e}){let i=this._readCurrentRect(e),o=this._readParentsChain(e);return this._buildConstraints(o,i)}_readCurrentRect(e){return this._mediator.execute(new qe(e.hostElement))}_readParentsChain(e){return this._mediator.execute(new eo(e))??[]}_buildConstraints(e,i){let o=[],r=Ey(),a=[0,0,0,0];for(let s of e){let c=this._readParentBounds(s,a);a=c.paddings;let d=this._calculateDifference(c.innerRect,i);if(this._isAutoExpand(s))o.push(this._makeSoftLimit(s,c.boundingRect,d));else{r=d;break}}return{soft:o,hard:r}}_readParentBounds(e,i){return this._mediator.execute(new Xo(e,i))}_calculateDifference(e,i){return{min:this._calculateMinimumDifference(e,i),max:this._calculateMaximumDifference(e,i)}}_calculateMinimumDifference(e,i){return B.initialize(e.x-i.x,e.y-i.y)}_calculateMaximumDifference(e,i){return B.initialize(e.x+e.width-(i.x+i.width),e.y+e.height-(i.y+i.height))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeSoftLimit(e,i,o){return{nodeOrGroup:e,boundingRect:i,initialSize:e._size,limits:o}}static \u0275fac=function(i){return new(i||cc)};static \u0275prov=C({token:cc,factory:cc.\u0275fac})};return t=S([I(du)],t),t})(),lu=class{rootHandlers;participants;static fToken=Symbol("CreateDragNodeHandlerRequest");constructor(n,e){this.rootHandlers=n,this.participants=e}},uu=class{dragHandler;constraints;handlerPool;static fToken=Symbol("AttachSoftParentConnectionDragHandlersToNodeRequest");constructor(n,e,i){this.dragHandler=n,this.constraints=e,this.handlerPool=i}},Zo=class{_mediator=u(R);_store=u(N);_behaviour=u(ro);_source;_target;_sourceRef;_targetRef;_sourceDelta=B.initialize();_targetDelta=B.initialize();connection;initialize(n){this.connection=n,this._source=this._store.outputs.require(this.connection.fOutputId()),this._target=this._store.inputs.require(this.connection.fInputId()),this._sourceRef=this._readRectRef(this._source),this._targetRef=this._readRectRef(this._target)}setSourceDelta(n){this._sourceDelta=n,this._mediator.execute(new Qn(this._source.fId(),this._source.kind,this._withDelta(this._sourceRef.rect,n)))}setTargetDelta(n){this._targetDelta=n,this._mediator.execute(new Qn(this._target.fId(),this._target.kind,this._withDelta(this._targetRef.rect,n)))}redraw(){let n=this._buildLine();this.connection.setLine(n),this.connection.redraw()}_buildLine(){let n=He.fromRoundedRect(this._sourceRef.rect).addPoint(this._sourceDelta),e=He.fromRoundedRect(this._targetRef.rect).addPoint(this._targetDelta);return this._behaviour.handle(new At(n,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(n){return this._mediator.execute(new vt(n))}_withDelta(n,e){return He.fromRoundedRect(n).addPoint(e)}_resolveRotationContext(n){return this._mediator.execute(new tn(n))}},Qo=(()=>{class t extends Zo{setSourceDelta(e){super.setSourceDelta(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),Jo=(()=>{class t extends Zo{_sourceUpdated=!1;_targetUpdated=!1;setSourceDelta(e){super.setSourceDelta(e),this._sourceUpdated=!0,this._redrawIfReady()}setTargetDelta(e){super.setTargetDelta(e),this._targetUpdated=!0,this._redrawIfReady()}_redrawIfReady(){!this._sourceUpdated||!this._targetUpdated||(this._sourceUpdated=!1,this._targetUpdated=!1,this.redraw())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),er=(()=>{class t extends Zo{setTargetDelta(e){super.setTargetDelta(e),this.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),r2=(()=>{let t=class dc{_store=u(N);_mediator=u(R);_dragInjector=u(tt);handle({dragHandler:e,constraints:i,handlerPool:o}){let r=i.soft.map(a=>this._buildParentConnectionHandlers(a.nodeOrGroup,o));e.setSoftParentConnectionHandlers(r)}_buildParentConnectionHandlers(e,i){let o=this._store.outputs.getAll().filter(f=>f.fNodeId===e.fId()),r=this._store.inputs.getAll().filter(f=>f.fNodeId===e.fId());if(!o.length&&!r.length)return{source:[],target:[]};let a=new Set(o.map(f=>f.fId())),s=new Set(r.map(f=>f.fId())),c=new Map,d={source:[],target:[]};for(let f of this._store.connections.getAll()){let h=a.has(f.fOutputId()),v=s.has(f.fInputId());if(!h&&!v)continue;let b=this._getExistingConnectionHandler(i,f);if(b||(b=this._createConnectionHandler(f,h,v),i.push(b)),h){let w=this._store.outputs.require(f.fOutputId());d.source.push({handler:b,connector:w,baselineRect:this._readConnectorRect(w,c)})}if(v){let w=this._store.inputs.require(f.fInputId());d.target.push({handler:b,connector:w,baselineRect:this._readConnectorRect(w,c)})}}return d}_getExistingConnectionHandler(e,i){return e.find(o=>o.connection.fId()===i.fId())}_createConnectionHandler(e,i,o){let r;return i&&o?r=this._dragInjector.createInstance(Jo):i?r=this._dragInjector.createInstance(Qo):r=this._dragInjector.createInstance(er),r.initialize(e),r}_readConnectorRect(e,i){let o=`${e.kind}::${e.fId()}`,r=i.get(o);if(r)return r;let a=this._mediator.execute(new vt(e)).rect;return i.set(o,a),a}static \u0275fac=function(i){return new(i||dc)};static \u0275prov=C({token:dc,factory:dc.\u0275fac})};return t=S([I(uu)],t),t})(),a2=(()=>{let t=class lc{_dragInjector=u(tt);_mediator=u(R);handle({rootHandlers:e,participants:i}){let o=this._collectConnectionHandlers(i);this._applyConstraintsToRoots(e,o);let r=this._dragInjector.createInstance(Tn);return r.initialize(i,e),r}_applyConstraintsToRoots(e,i){for(let o of e){let r=this._calculateConstraints(o.nodeOrGroup);o.setConstraints(r),this._attachSoftParentConnectionHandlers(o,r,i)}}_collectConnectionHandlers(e){let i=new Map;for(let o of e){for(let r of o.sourceConnectionHandlers)i.set(r.connection.fId(),r);for(let r of o.targetConnectionHandlers)i.set(r.connection.fId(),r)}return Array.from(i.values())}_attachSoftParentConnectionHandlers(e,i,o){this._mediator.execute(new uu(e,i,o))}_calculateConstraints(e){return this._mediator.execute(new du(e))}static \u0275fac=function(i){return new(i||lc)};static \u0275prov=C({token:lc,factory:lc.\u0275fac})};return t=S([I(lu)],t),t})(),fu=class{dragHandler;sourceIds;handlerPool;static fToken=Symbol("AttachTargetConnectionDragHandlersToNodeRequest");constructor(n,e,i){this.dragHandler=n,this.sourceIds=e,this.handlerPool=i}},s2=(()=>{let t=class uc{_store=u(N);_dragInjector=u(tt);get _connections(){return this._store.connections.getAll()}handle(e){this._getInputConnections(e.dragHandler.nodeOrGroup).forEach(i=>{this._createAndSetConnectionToNodeHandler(i,e)})}_getInputConnections(e){let i=new Set(this._getNodeInputIds(e));return this._connections.filter(o=>i.has(o.fInputId()))}_getNodeInputIds(e){return this._store.inputs.getAll().filter(i=>e.isContains(i.hostElement)).map(i=>i.fId())}_createAndSetConnectionToNodeHandler(e,i){let o=this._getExistingConnectionHandler(i.handlerPool,e);o||(o=this._createConnectionHandler(i.sourceIds,e),i.handlerPool.push(o)),i.dragHandler.targetConnectionHandlers.push(o)}_getExistingConnectionHandler(e,i){return e.find(o=>o.connection.fId()===i.fId())}_createConnectionHandler(e,i){let o;return e.includes(i.fOutputId())?o=this._dragInjector.createInstance(Jo):o=this._dragInjector.createInstance(er),o.initialize(i),o}static \u0275fac=function(i){return new(i||uc)};static \u0275prov=C({token:uc,factory:uc.\u0275fac})};return t=S([I(fu)],t),t})(),pu=class{dragHandler;targetIds;handlerPool;static fToken=Symbol("AttachSourceConnectionDragHandlersToNodeRequest");constructor(n,e,i){this.dragHandler=n,this.targetIds=e,this.handlerPool=i}},c2=(()=>{let t=class fc{_store=u(N);_dragInjector=u(tt);get _connections(){return this._store.connections.getAll()}handle(e){this._getOutputConnections(e.dragHandler.nodeOrGroup).forEach(i=>{this._createAndSetConnectionToNodeHandler(i,e)})}_getOutputConnections(e){let i=new Set(this._getNodeOutputIds(e));return this._connections.filter(o=>i.has(o.fOutputId()))}_getNodeOutputIds(e){return this._store.outputs.getAll().filter(i=>e.isContains(i.hostElement)).map(i=>i.fId())}_createAndSetConnectionToNodeHandler(e,i){let o=this._getExistingConnectionHandler(i.handlerPool,e);o||(o=this._createConnectionHandler(i.targetIds,e),i.handlerPool.push(o)),i.dragHandler.sourceConnectionHandlers.push(o)}_getExistingConnectionHandler(e,i){return e.find(o=>o.connection.fId()===i.fId())}_createConnectionHandler(e,i){let o;return e.includes(i.fInputId())?o=this._dragInjector.createInstance(Jo):o=this._dragInjector.createInstance(Qo),o.initialize(i),o}static \u0275fac=function(i){return new(i||fc)};static \u0275prov=C({token:fc,factory:fc.\u0275fac})};return t=S([I(pu)],t),t})(),hu=class{nodeOrGroup;static fToken=Symbol("AttachDragNodeHandlerFromSelectionRequest");constructor(n){this.nodeOrGroup=n}},d2=(()=>{let t=class pc{_mediator=u(R);_store=u(N);_dragSession=u(te);handle({nodeOrGroup:e}){let i=this._collectSelected(e),o=this._withDeepChildren(i),r=this._mediator.execute(new su(o)),a=this._collectSourceConnectorIds(o),s=this._collectTargetConnectorIds(o);return this._attachConnectionHandlers(r.participants,a,s),this._mediator.execute(new lu(r.rootHandlers,r.participants))}_collectSelected(e){let i=[];for(let o of this._dragSession.selectedItems){let r=this._findNodeByHost(o.hostElement);r&&i.push(r)}return e&&!i.includes(e)&&i.push(e),i}_findNodeByHost(e){return this._store.nodes.getAll().find(i=>i.isContains(e))}_withDeepChildren(e){let i=[];for(let o of e){i.push(o);let r=this._mediator.execute(new oo(o.fId()));i.push(...r)}return i}_collectSourceConnectorIds(e){return ph(e,i=>this._store.outputs.getAll().filter(o=>o.fNodeId===i.fId()).map(o=>o.fId()))}_collectTargetConnectorIds(e){return ph(e,i=>this._store.inputs.getAll().filter(o=>o.fNodeId===i.fId()).map(o=>o.fId()))}_attachConnectionHandlers(e,i,o){let r=[];for(let a of e)this._mediator.execute(new pu(a,o,r)),this._mediator.execute(new fu(a,i,r))}static \u0275fac=function(i){return new(i||pc)};static \u0275prov=C({token:pc,factory:pc.\u0275fac})};return t=S([I(hu)],t),t})(),l2=[n2,o2,a2,s2,c2,r2,i2,d2];function u2(t,n,e=10){let i=n.x,o=n.y,r=i+n.width,a=o+n.height,s=n.gravityCenter.x,c=n.gravityCenter.y,d,f,h=1/0,v,b,w=1/0,T=(O,A)=>{let V=A<0?-A:A;V<=e&&V<h&&(h=V,d=O,f=A)},k=(O,A)=>{let V=A<0?-A:A;V<=e&&V<w&&(w=V,v=O,b=A)};for(let O=0;O<t.length;O++){let A=t[O],V=A.x,q=A.y,X=V+A.width,ue=q+A.height,Ve=A.gravityCenter.x,ye=A.gravityCenter.y;T(V,i-V),T(X,i-X),T(Ve,s-Ve),T(V,r-V),T(X,r-X),k(q,o-q),k(ue,o-ue),k(ye,c-ye),k(q,a-q),k(ue,a-ue)}return{x:{guide:d,delta:f},y:{guide:v,delta:b}}}var Z0=["left","top","width","height"],mu=class{_element;constructor(n,e,i="f-line"){this._element=n.document.createElement("div"),this._element.classList.add(i),this._element.style.position="absolute",this._element.style.display="none",e.appendChild(this._element)}show(){this._element.style.display="block"}hide(){this._element.style.display="none"}render(n){for(let e of Z0){let i=n[e];i!=null&&(this._element.style[e]=`${i}px`)}}clearRect(){for(let n of Z0)this._element.style.removeProperty(n)}destroy(){this._element.remove()}},mm=class{_horizontal;_vertical;constructor(n,e){this._horizontal=new mu(n,e),this._vertical=new mu(n,e),this._horizontal.hide(),this._vertical.hide()}drawVerticalLine(n,e,i){this._vertical.show(),this._vertical.render({left:n*i.scale+i.position.x+i.scaledPosition.x,top:0,width:1,height:e.height})}drawHorizontalLine(n,e,i){this._horizontal.show(),this._horizontal.render({left:0,top:n*i.scale+i.position.y+i.scaledPosition.y,width:e.width,height:1})}hideVertical(){this._vertical.hide()}hideHorizontal(){this._horizontal.hide()}hideAll(){this._vertical.hide(),this._horizontal.hide()}destroy(){this._vertical.destroy(),this._horizontal.destroy()}},gu=class{static fToken=Symbol("MagneticLinesPreparationRequest")},f2=(()=>{let t=class hc{_mediator=u(R);_store=u(N);_browser=u(je);_injector=u(ot);_dragSession=u(te);_renderer;handle(e){let i=this._store.instances.get(Pe.MAGNETIC_LINES);if(!i)return;let o=this._dragSession.draggableItems.find(r=>r instanceof Tn);o&&o.setMagneticLines(new gm(this._injector,this._renderer??this._createRenderer(i),this._flowHostSize(),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(i=>i.nodeOrGroup)}_flowHostSize(){return this._store.flowHost.getBoundingClientRect()}_createRenderer({hostElement:e}){return this._renderer=new mm(this._browser,e),this._renderer}_notDraggedRects(e){let i=new Set(e);return this._store.nodes.getAll().filter(r=>!i.has(r)).map(r=>this._mediator.execute(new qe(r.hostElement)))}static \u0275fac=function(i){return new(i||hc)};static \u0275prov=C({token:hc,factory:hc.\u0275fac})};return t=S([I(gu)],t),t})(),gm=class{_renderer;_size;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;constructor(n,e,i,o){this._renderer=e,this._size=i,this._rects=o;let r=n.get(N);this._alignThreshold=r.instances.require(Pe.MAGNETIC_LINES).threshold(),this._canvasTransform=r.transform}scheduleRender(n){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderGuides(this._computeGuides(n)),15)}_renderGuides(n){this._renderVertical(n),this._renderHorizontal(n)}_renderVertical(n){n.x.guide!==void 0?this._renderer.drawVerticalLine(n.x.guide,this._size,this._canvasTransform):this._renderer.hideVertical()}_renderHorizontal(n){n.y.guide!==void 0?this._renderer.drawHorizontalLine(n.y.guide,this._size,this._canvasTransform):this._renderer.hideHorizontal()}_computeGuides(n){return u2(this._rects,n,this._alignThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},Q0=["top","center","bottom"],J0=["left","center","right"];function p2(t,n,e=10,i=10){let o=n.x,r=n.y,a=o+n.width,s=r+n.height,c=n.gravityCenter.x,d=n.gravityCenter.y,f=h2(t,n,o,r,a,s,c,d,e,i),h=m2(t,n,o,r,a,s,c,d,e,i);return f&&(!h||f.absDelta<=h.absDelta)?{axis:"x",delta:f.delta,gap:f.gap,rects:f.rects,alignMode:f.alignMode,crossDelta:f.crossDelta}:h?{axis:"y",delta:h.delta,gap:h.gap,rects:h.rects,alignMode:h.alignMode,crossDelta:h.crossDelta}:{rects:[]}}function h2(t,n,e,i,o,r,a,s,c,d){let f=1/0,h,v=0,b,w=[],T=0,k=[],O=[],A=[];for(let V=0;V<Q0.length;V++){let q=V===0?i:V===1?s:r;k.length=0,O.length=0,A.length=0;let X=1/0,ue=-1/0,Ve=0,ye=1/0,Je=1/0;for(let Ie=0;Ie<t.length;Ie++){let me=t[Ie],So=V===0?me.y:V===1?me.gravityCenter.y:me.y+me.height,Zp=q-So,Yt=Hi(Zp);if(Yt>c)continue;k.push(Ie),O.push(me.x),A.push(me.x+me.width);let Io=me.y,To=me.y+me.height;Io<X&&(X=Io),To>ue&&(ue=To),(Yt<ye||Yt===ye&&Ie<Je)&&(ye=Yt,Ve=So,Je=Ie)}let fe=k.length;if(fe<2)continue;By(k,O,A);let _e=0;for(;_e<fe&&O[_e]<=a;)_e++;let nt=_e>0&&_e<fe,ke,ht;nt?(ke=_e-1,ht=_e):_e<=0?(ke=0,ht=1):(ke=fe-2,ht=fe-1);let mt=O[ht]-A[ke];if(mt<0)continue;let Ye;if(nt){Ye=A[ke]+mt;let Ie=Ye+n.width,me=O[ht]-Ie;if(Hi(me-mt)>d)continue}else _e<=0?Ye=O[0]-mt-n.width:Ye=A[fe-1]+mt;let wo=e-Ye,qn=Hi(wo);if(qn>d||qn>=f)continue;let Dt=g2(k,O,A,X,ue);if(nt){let Ie=Ye,me=Ye+n.width;Dt.push({left:A[ke],top:X,width:Ie-A[ke],height:ue-X}),Dt.push({left:me,top:X,width:O[ht]-me,height:ue-X})}else if(_e<=0){let Ie=Ye+n.width;Dt.push({left:Ie,top:X,width:O[0]-Ie,height:ue-X})}else Dt.push({left:A[fe-1],top:X,width:Ye-A[fe-1],height:ue-X});let Xp=q-Ve;f=qn,h=wo,v=mt,b=Q0[V],w=Dt,T=Xp}if(!(h===void 0||b===void 0))return{delta:h,absDelta:f,gap:v,rects:w,alignMode:b,crossDelta:T}}function m2(t,n,e,i,o,r,a,s,c,d){let f=1/0,h,v=0,b,w=[],T=0,k=[],O=[],A=[];for(let V=0;V<J0.length;V++){let q=V===0?e:V===1?a:o;k.length=0,O.length=0,A.length=0;let X=1/0,ue=-1/0,Ve=0,ye=1/0,Je=1/0;for(let Ie=0;Ie<t.length;Ie++){let me=t[Ie],So=V===0?me.x:V===1?me.gravityCenter.x:me.x+me.width,Zp=q-So,Yt=Hi(Zp);if(Yt>c)continue;k.push(Ie),O.push(me.y),A.push(me.y+me.height);let Io=me.x,To=me.x+me.width;Io<X&&(X=Io),To>ue&&(ue=To),(Yt<ye||Yt===ye&&Ie<Je)&&(ye=Yt,Ve=So,Je=Ie)}let fe=k.length;if(fe<2)continue;By(k,O,A);let _e=0;for(;_e<fe&&O[_e]<=s;)_e++;let nt=_e>0&&_e<fe,ke,ht;nt?(ke=_e-1,ht=_e):_e<=0?(ke=0,ht=1):(ke=fe-2,ht=fe-1);let mt=O[ht]-A[ke];if(mt<0)continue;let Ye;if(nt){Ye=A[ke]+mt;let Ie=Ye+n.height,me=O[ht]-Ie;if(Hi(me-mt)>d)continue}else _e<=0?Ye=O[0]-mt-n.height:Ye=A[fe-1]+mt;let wo=i-Ye,qn=Hi(wo);if(qn>d||qn>=f)continue;let Dt=_2(k,O,A,X,ue);if(nt){let Ie=Ye,me=Ye+n.height;Dt.push({left:X,top:A[ke],width:ue-X,height:Ie-A[ke]}),Dt.push({left:X,top:me,width:ue-X,height:O[ht]-me})}else if(_e<=0){let Ie=Ye+n.height;Dt.push({left:X,top:Ie,width:ue-X,height:O[0]-Ie})}else Dt.push({left:X,top:A[fe-1],width:ue-X,height:Ye-A[fe-1]});let Xp=q-Ve;f=qn,h=wo,v=mt,b=J0[V],w=Dt,T=Xp}if(!(h===void 0||b===void 0))return{delta:h,absDelta:f,gap:v,rects:w,alignMode:b,crossDelta:T}}function g2(t,n,e,i,o){let r=[],a=o-i;for(let s=0;s<t.length-1;s++){let c=n[s+1]-e[s];c<0||r.push({left:e[s],top:i,width:c,height:a})}return r}function _2(t,n,e,i,o){let r=[],a=o-i;for(let s=0;s<t.length-1;s++){let c=n[s+1]-e[s];c<0||r.push({left:i,top:e[s],width:a,height:c})}return r}function By(t,n,e){for(let i=1;i<n.length;i++){let o=n[i],r=e[i],a=t[i],s=i-1;for(;s>=0;){let c=n[s],d=t[s];if(c<o||c===o&&d<a)break;n[s+1]=c,e[s+1]=e[s],t[s+1]=d,s--}n[s+1]=o,e[s+1]=r,t[s+1]=a}}function Hi(t){return t<0?-t:t}var _m=class{_element;_isVisible=!1;_left=Number.NaN;_top=Number.NaN;_width=Number.NaN;_height=Number.NaN;constructor(n,e,i="f-rect"){this._element=n.document.createElement("div"),this._element.classList.add(i);let o=this._element.style;o.position="absolute",o.display="none",o.boxSizing="border-box",o.pointerEvents="none",e.appendChild(this._element)}show(){this._isVisible||(this._isVisible=!0,this._element.style.display="block")}hide(){this._isVisible&&(this._isVisible=!1,this._element.style.display="none")}render(n,e,i,o){let r=this._element.style;n!==this._left&&(this._left=n,r.left=n+"px"),e!==this._top&&(this._top=e,r.top=e+"px"),i!==this._width&&(this._width=i,r.width=i+"px"),o!==this._height&&(this._height=o,r.height=o+"px")}clearRect(){this._left=Number.NaN,this._top=Number.NaN,this._width=Number.NaN,this._height=Number.NaN;let n=this._element.style;n.removeProperty("left"),n.removeProperty("top"),n.removeProperty("width"),n.removeProperty("height")}destroy(){this._element.remove()}},ym=class{_browser;_hostElement;_className;_pool=[];_activeCount=0;constructor(n,e,i="f-rect"){this._browser=n,this._hostElement=e,this._className=i}draw(n,e){let i=e.scale,o=e.position.x+e.scaledPosition.x,r=e.position.y+e.scaledPosition.y;for(let a=0;a<n.length;a++){let s=this._getOrCreate(a),c=n[a];s.show(),s.render(c.left*i+o,c.top*i+r,c.width*i,c.height*i)}for(let a=n.length;a<this._activeCount;a++)this._pool[a].hide();this._activeCount=n.length}hideAll(){for(let n=0;n<this._activeCount;n++)this._pool[n].hide();this._activeCount=0}destroy(){for(let n of this._pool)n.destroy();this._pool.length=0,this._activeCount=0}_getOrCreate(n){if(n<this._pool.length)return this._pool[n];let e=new _m(this._browser,this._hostElement,this._className);return this._pool.push(e),e}},_u=class{static fToken=Symbol("MagneticRectsPreparationRequest")},y2=(()=>{let t=class mc{_mediator=u(R);_store=u(N);_browser=u(je);_injector=u(ot);_dragSession=u(te);_renderer;handle(e){let i=this._store.instances.get(Pe.MAGNETIC_RECTS);if(!i)return;let o=this._dragSession.draggableItems.find(r=>r instanceof Tn);o&&o.setMagneticRects(new vm(this._injector,this._getRenderer(i),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(i=>i.nodeOrGroup)}_getRenderer(e){return this._renderer||(this._renderer=new ym(this._browser,e.hostElement)),this._renderer?.destroy(),this._renderer}_notDraggedRects(e){let i=new Set(e);return this._store.nodes.getAll().filter(r=>!i.has(r)).map(r=>this._mediator.execute(new qe(r.hostElement)))}static \u0275fac=function(i){return new(i||mc)};static \u0275prov=C({token:mc,factory:mc.\u0275fac})};return t=S([I(_u)],t),t})(),vm=class{_renderer;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;_spacingThreshold=10;constructor(n,e,i){this._renderer=e,this._rects=i;let o=n.get(N),r=o.instances.require(Pe.MAGNETIC_RECTS);this._alignThreshold=r.alignThreshold(),this._spacingThreshold=r.spacingThreshold(),this._canvasTransform=o.transform}scheduleRender(n){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderRects(this._computeRects(n)),15)}_renderRects(n){if(n.axis!==void 0&&n.delta!==void 0&&n.rects.length>0){this._renderer.draw(n.rects,this._canvasTransform);return}this._renderer.hideAll()}_computeRects(n){return p2(this._rects,n,this._alignThreshold,this._spacingThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},yu=class{event;static fToken=Symbol("DragNodeFinalizeRequest");constructor(n){this.event=n}},Cm=class{nodes;fNodes;constructor(n){this.nodes=n,this.fNodes=n}},v2=(()=>{let t=class gc{_mediator=u(R);_store=u(N);_dragSession=u(te);_dragHandler;handle({event:e}){if(this._dragHandler=this._getDragHandler(),!this._dragHandler)return;let i=this._buildDragDelta(e.getPosition()),o=this._dragHandler.calculateMagneticSnaps(i),r=this._applySnapToDelta(i,o.lines,o.rects);this._finalizeMove(this._dragHandler,r),this._emitNodeIntersectIfNeeded(this._dragHandler)}_getDragHandler(){return this._dragSession.draggableItems.find(t2)}_buildDragDelta(e){return ee.fromPoint(e).elementTransform(this._store.flowHost).div(this._dragSession.onPointerDownScale).sub(this._dragSession.onPointerDownPosition)}_applySnapToDelta(e,i,o){let r=e.x,a=e.y;return i&&(r=this._hasLineSnapValue(i.x)?e.x-(i.x.delta||0):r,a=this._hasLineSnapValue(i.y)?e.y-(i.y.delta||0):a),this._hasRectSnapValue(o)&&(o.axis==="x"?(r=e.x-o.delta,a=e.y-(o.crossDelta??0)):(a=e.y-o.delta,r=e.x-(o.crossDelta??0))),{x:r,y:a}}_hasLineSnapValue(e){return e.guide!==void 0&&e.guide!==null}_hasRectSnapValue(e){return!!e&&e.axis!==void 0&&e.delta!==void 0}_finalizeMove(e,i){for(let o of e.roots)o.finalizeConstraints();e.onPointerMove(i),e.onPointerUp?.(),this._store.fDraggable?.fMoveNodes.emit(this._buildMoveNodesEvent(e))}_buildMoveNodesEvent(e){let i=e.getEvent(),a=((i.data??i.fData)?.fNodeIds??[]).map(s=>({id:s,position:this._store.nodes.get(s)?._position}));return new Cm(a)}_emitNodeIntersectIfNeeded(e){if(!this._isDraggedJustOneNode(e)||!this._store.fDraggable?.fEmitOnNodeIntersect)return;let i=e.roots[0].nodeOrGroup;queueMicrotask(()=>this._mediator.execute(new Gl(i)))}_isDraggedJustOneNode(e){return e.roots.length===1}static \u0275fac=function(i){return new(i||gc)};static \u0275prov=C({token:gc,factory:gc.\u0275fac})};return t=S([I(yu)],t),t})(),vu=class{event;trigger;static fToken=Symbol("DragNodePreparationRequest");constructor(n,e){this.event=n,this.trigger=e}},C2=(()=>{let t=class _c{_mediator=u(R);_store=u(N);_dragSession=u(te);handle({event:e,trigger:i}){if(!this._canStartDrag(e,i))return;let o=this._findDraggableNode(e.targetElement);o&&(this._storePointerDownContext(e),this._dragSession.draggableItems=[this._buildDragNodeHandler(o)],this._mediator.execute(new gu),this._mediator.execute(new _u))}_canStartDrag(e,i){return this._dragSession.isEmpty()&&this._isDragHandle(e.targetElement)&&Et(e.originalEvent,i)}_isDragHandle(e){return Do(e,".f-drag-handle")}_findDraggableNode(e){let i=this._store.nodes.getAll();for(let o of i)if(!o.fDraggingDisabled()&&o.isContains(e))return o}_storePointerDownContext(e){this._dragSession.onPointerDownScale=this._store.transform.scale,this._dragSession.onPointerDownPosition=ee.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(this._store.transform.scale)}_buildDragNodeHandler(e){return(e.fSelectionDisabled()||!e.isSelected())&&queueMicrotask(()=>{this._mediator.execute(new io(e))}),this._mediator.execute(new hu(e))}static \u0275fac=function(i){return new(i||_c)};static \u0275prov=C({token:_c,factory:_c.\u0275fac})};return t=S([I(vu)],t),t})(),x2=[...l2,f2,y2,v2,C2],xm=class{targetGroupId;nodeIds;dropPosition;fTargetNode;fNodes;fDropPosition;constructor(n,e,i){this.targetGroupId=n,this.nodeIds=e,this.dropPosition=i,this.fTargetNode=n,this.fNodes=e,this.fDropPosition=i}},b2=(()=>{let t=class yc{_dragSession=u(te);_store=u(N);handle({event:e}){let i=this._findDropHandler();if(!i)return;let o=i.activeTarget?.node;o&&this._emitDropToGroupEvent(o.fId(),e),i.onPointerUp?.()}_findDropHandler(){return this._dragSession.draggableItems.find(e=>e instanceof Yo)}_emitDropToGroupEvent(e,i){this._store.fDraggable?.fDropToGroup.emit(new xm(e,this._getTopLevelDraggedIds(),i.getPosition()))}_getTopLevelDraggedIds(){let i=this._getMoveSummaryHandler().items.map(a=>a.nodeOrGroup),o=new Set(i.map(a=>a.fId())),r=[];for(let a of i){let s=a.fParentId();(!s||!o.has(s))&&r.push(a.fId())}return r}_getMoveSummaryHandler(){let e=this._dragSession.draggableItems.find(i=>i instanceof Tn);if(!e)throw new Error("DropToGroup requires DragNodeHandler.");return e}static \u0275fac=function(i){return new(i||yc)};static \u0275prov=C({token:yc,factory:yc.\u0275fac})};return t=S([I(au)],t),t})(),Cu=class{event;static fToken=Symbol("DropToGroupPreparationRequest");constructor(n){this.event=n}},xu=class{candidates;static fToken=Symbol("SortDropCandidatesByLayerRequest");constructor(n){this.candidates=n}},w2=(()=>{let t=class vc{handle({candidates:e}){let i=e.map((o,r)=>({candidate:o,index:r}));return i.sort((o,r)=>{let a=this._compareDomOrder(o.candidate.node.hostElement,r.candidate.node.hostElement);return a!==0?-a:o.index-r.index}),i.map(o=>o.candidate)}_compareDomOrder(e,i){if(e===i)return 0;let o=e.compareDocumentPosition(i);if((o&Node.DOCUMENT_POSITION_FOLLOWING)!==0)return-1;if((o&Node.DOCUMENT_POSITION_PRECEDING)!==0)return 1;if(o&Node.DOCUMENT_POSITION_DISCONNECTED){let r=e.getBoundingClientRect?.()??{top:0,left:0},a=i.getBoundingClientRect?.()??{top:0,left:0};return r.top!==a.top?r.top<a.top?-1:1:r.left!==a.left?r.left<a.left?-1:1:0}return 0}static \u0275fac=function(i){return new(i||vc)};static \u0275prov=C({token:vc,factory:vc.\u0275fac})};return t=S([I(xu)],t),t})(),bm=class{_onPointerDown;_limit;_vCellSize;_hCellSize;_adjustCellSize;constructor(n,e,i){this._onPointerDown=e,this._limit=i;let o=n.get(N);this._vCellSize=o.fDraggable.vCellSize(),this._hCellSize=o.fDraggable.hCellSize(),this._adjustCellSize=o.fDraggable.fCellSizeWhileDragging()}limit(n){let{min:e,max:i}=this._limit,{x:o,y:r}=this._cellSizeStrategies[+this._adjustCellSize](n);return{x:this._clamp(o,e.x,i.x),y:this._clamp(r,e.y,i.y)}}_cellSizeStrategies={0:this._skipCellSize.bind(this),1:this._applyCellSize.bind(this)};_applyCellSize(n){return{x:this._snapToGrid(this._onPointerDown.x+n.x,this._hCellSize)-this._onPointerDown.x,y:this._snapToGrid(this._onPointerDown.y+n.y,this._vCellSize)-this._onPointerDown.y}}_skipCellSize(n){return n}_clamp(n,e,i){return Math.min(Math.max(n,e),i)}_snapToGrid(n,e){return Math.round(n/e)*e}},bu=class{externalItem;static fToken=Symbol("DragExternalItemCreatePlaceholderRequest");constructor(n){this.externalItem=n}},S2=(()=>{let t=class Cc{_browser=u(je);_containerRef=u(ia);handle({externalItem:e}){let{hostElement:i,placeholder:o}=e,r=o(),a=r?this._fromTemplate(r):this._fromHost(i);return a.classList.add("f-external-item-placeholder"),a.style.pointerEvents="none",a}_fromTemplate(e){return gh(this._createViewRef(e),this._browser.document)}_fromHost(e){return hh(e)}_createViewRef(e){let i=this._containerRef.createEmbeddedView(e);return i.detectChanges(),i}static \u0275fac=function(i){return new(i||Cc)};static \u0275prov=C({token:Cc,factory:Cc.\u0275fac})};return t=S([I(bu)],t),t})(),wu=class{externalItem;static fToken=Symbol("DragExternalItemCreatePreviewRequest");constructor(n){this.externalItem=n}},I2=(()=>{let t=class xc{_browser=u(je);_containerRef=u(ia);handle({externalItem:e}){let{hostElement:i,preview:o}=e,r=o(),a=r?this._fromTemplate(r):this._fromHost(i);return this._setPreviewStyles(a),O0(a),a.classList.add("f-external-item-preview"),a}_fromTemplate(e){return gh(this._createViewRef(e),this._browser.document)}_fromHost(e){return hh(e)}_createViewRef(e){let i=this._containerRef.createEmbeddedView(e);return i.detectChanges(),i}_setPreviewStyles(e){mh(e.style,{"pointer-events":"none",margin:"showPopover"in e?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":"1000"},new Set(["position"]))}static \u0275fac=function(i){return new(i||xc)};static \u0275prov=C({token:xc,factory:xc.\u0275fac})};return t=S([I(wu)],t),t})(),Su=class{event;static fToken=Symbol("DragExternalItemFinalizeRequest");constructor(n){this.event=n}},wm=class{externalItemRect;data;targetContainerId;dropPosition;rect;fTargetNode;fDropPosition;constructor(n,e,i,o){this.externalItemRect=n,this.data=e,this.targetContainerId=i,this.dropPosition=o,this.rect=n,this.fTargetNode=i,this.fDropPosition=o}},T2="external-item",E2="drag-external-item";function P2(t){return t.getEvent().kind===E2||t.getEvent().fEventType===T2}var M2=(()=>{let t=class bc{_result=u(En);_mediator=u(R);_store=u(N);_dragSession=u(te);_browser=u(je);get _createNodeEmitter(){return this._store.fDraggable?.fCreateNode}handle(e){let i=this._findExternalItemHandler();if(!i)return;let o=this._getDestinationNodeOrGroupId();this._emitEvent(this._getElementsFromPoint(e.event.getPosition()),o,e.event.getPosition()),i.onPointerUp(),this._dragSession.draggableItems=[]}_findExternalItemHandler(){return this._dragSession.draggableItems.find(e=>P2(e))}_getDestinationNodeOrGroupId(){let e=this._getDropToGroupHandler(),i=e.activeTarget?.node.fId();return e.onPointerUp?.(),i}_getDropToGroupHandler(){let e=this._dragSession.draggableItems.find(i=>i instanceof Yo);if(!e)throw new Error("NodeDragToParentDragHandler not found");return e}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y).filter(i=>!i.closest(".f-external-item")&&!i.closest(".f-external-item-preview"))}_emitEvent(e,i,o){this._isPointerInCanvasRect(e)&&this._createNodeEmitter?.emit(new wm(this._getPreviewRect(),this._result.getData().externalItem.data(),i,i?o:void 0))}_isPointerInCanvasRect(e){return e.length?this._store.flowHost.contains(e[0]):!1}_getPreviewRect(){return this._mediator.execute(new qe(this._result.getData().preview))}static \u0275fac=function(i){return new(i||bc)};static \u0275prov=C({token:bc,factory:bc.\u0275fac})};return t=S([I(Su)],t),t})(),Sm=class{data;constructor(n){this.data=n}},Iu=class extends ct{_externalItem;_pointerDownClientPosition;type="external-item";kind="drag-external-item";data(){return new Sm(this._externalItem.data())}_result;_mediator;_browser;_store;_previewEl;_placeholderEl;_startRect=W.initialize();_pointerDownRect=W.initialize();_absoluteOffsetFromFlow=B.initialize();_grabOffsetFromPointer=B.initialize();_originalParent;_originalNextSibling;_originalDisplay;_applyConstraints=n=>n;constructor(n,e,i){super(),this._externalItem=e,this._pointerDownClientPosition=i,this._store=n.get(N),this._result=n.get(En),this._mediator=n.get(R),this._browser=n.get(je),this._originalDisplay=this._host.style.display,this._initConstraints(n)}get _host(){return this._externalItem.hostElement}get _overlayRoot(){return this._browser.document.fullscreenElement??this._browser.document.body}get _transform(){return this._store.transform}_initConstraints(n){this._startRect=this._getStartRect();let e=new bm(n,this._startRect,Ey());this._applyConstraints=i=>e.limit(i)}_getStartRect(){return this._mediator.execute(new qe(this._externalItem.hostElement))}prepareDragSequence(){this._pointerDownRect=this._readAbsoluteRect(this._host),this._absoluteOffsetFromFlow=ee.fromPoint(this._pointerDownRect).sub(this._toAbsolutePoint(this._startRect)),this._grabOffsetFromPointer=this._clientToAbsolute(this._pointerDownClientPosition).sub(this._pointerDownRect),this._rememberOriginalPlacement(),this._previewEl=this._createPreview(),this._placeholderEl=this._createPlaceholder(),this._placePreviewIntoOverlay(),this._swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(),this._result.setData({preview:this._previewEl,externalItem:this._externalItem})}_rememberOriginalPlacement(){let n=this._host.parentNode;if(!n){this._originalParent=void 0,this._originalNextSibling=null;return}this._originalParent=n,this._originalNextSibling=this._host.nextSibling}_createPreview(){let n=this._mediator.execute(new wu(this._externalItem));return this._externalItem.previewMatchSize()&&this._matchSize(n,this._pointerDownRect),n.style.transform=ey(this._pointerDownRect),n}_createPlaceholder(){return this._mediator.execute(new bu(this._externalItem))}_placePreviewIntoOverlay(){this._overlayRoot.appendChild(this._previewEl)}_swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(){let n=this._originalParent,e=this._placeholderEl;if(!n||!e)return;let i=n.replaceChild(e,this._host);this._overlayRoot.appendChild(i),this._host.style.display="none"}onPointerMove(n,e){if(!this._previewEl)return;let i=this._resolveDeltaFromPointer(n,e),o=this._applyConstraints(i),r=ee.fromPoint(this._startRect).add(o),a=this._toAbsolutePoint(r).add(this._absoluteOffsetFromFlow);this._previewEl.style.transform=ey(a)}onPointerUp(){this._previewEl&&this._previewEl.parentNode&&this._previewEl.parentNode.removeChild(this._previewEl),this._restoreOriginalInParent(),this._host.style.display=this._originalDisplay||"block",this._previewEl=void 0,this._placeholderEl=void 0,this._originalParent=void 0,this._originalNextSibling=null}_restoreOriginalInParent(){let n=this._originalParent,e=this._placeholderEl;if(!(!n||!e)){if(e.parentNode===n){n.replaceChild(this._host,e);return}this._originalNextSibling&&this._originalNextSibling.parentNode===n?n.insertBefore(this._host,this._originalNextSibling):n.appendChild(this._host)}}_matchSize(n,e){n.style.width=`${e.width}px`,n.style.height=`${e.height}px`}_readAbsoluteRect(n){let e=n.getBoundingClientRect(),i=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,o=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return W.initialize(e.left+o,e.top+i,e.width,e.height)}_toAbsolutePoint(n){let e=ee.fromPoint(this._transform.position).add(this._transform.scaledPosition);return ee.fromPoint(n).mult(this._transform.scale).add(e).add(this._getFlowHostAbsolutePosition())}_resolveDeltaFromPointer(n,e){let i=e?.getPosition();if(!i)return n;let o=this._clientToAbsolute(i).sub(this._grabOffsetFromPointer),r=this._toFlowPoint(o);return ee.fromPoint(r).sub(this._startRect)}_toFlowPoint(n){let e=this._getFlowHostAbsolutePosition(),i=ee.fromPoint(this._transform.position).add(this._transform.scaledPosition);return ee.fromPoint(n).sub(e).sub(i).div(this._transform.scale)}_getFlowHostAbsolutePosition(){let n=this._store.flowHost.getBoundingClientRect(),e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,i=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return B.initialize(n.left+i,n.top+e)}_clientToAbsolute(n){let e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,i=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return ee.fromPoint(n).add(B.initialize(i,e))}};function ey({x:t,y:n}){return`translate3d(${Math.round(t)}px, ${Math.round(n)}px, 0)`}var Tu=class{event;fTrigger;static fToken=Symbol("DragExternalItemPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}};function k2(t){return!!t.closest?.("[fExternalItem]")}function D2(t){return t.closest("[fExternalItem]")}var O2=(()=>{class t{_byHost=new Map;_items=j([]);items=D(()=>this._items());getByElement(e){let i=D2(e);return i?this._byHost.get(i):void 0}getByHost(e){return this._byHost.get(e)}register(e){let i=e.hostElement,o=this._byHost.get(i);o!==e&&(o&&o!==e&&this._byHost.delete(i),this._byHost.set(i,e),this._sync())}remove(e){let i=e.hostElement;this._byHost.get(i)===e&&(this._byHost.delete(i),this._sync())}_sync(){this._items.set([...this._byHost.values()])}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var N2=(()=>{let t=class wc{_apiService=u(O2);_dragSession=u(te);_store=u(N);_injector=u(ot);get _flowHost(){return this._store.flowHost}get _transform(){return this._store.transform}handle({event:e,fTrigger:i}){if(!this._dragSession.isEmpty()||!Et(e.originalEvent,i))return;let o=this._resolveExternalItem(e.targetElement);if(!o||o.disabled())return;let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=ee.fromPoint(e.getPosition()).elementTransform(this._flowHost).div(r),this._dragSession.draggableItems=[new Iu(this._injector,o,e.getPosition())]}_resolveExternalItem(e){return this._apiService.getByElement(e)}static \u0275fac=function(i){return new(i||wc)};static \u0275prov=C({token:wc,factory:wc.\u0275fac})};return t=S([I(Tu)],t),t})(),Eu=class{event;static fToken=Symbol("PreventDefaultIsExternalItemRequest");constructor(n){this.event=n}},R2=(()=>{let t=class Sc{handle(e){this._isTargetItemExternal(e.event)&&e.event.preventDefault()}_isTargetItemExternal(e){let i=this._isExternalItem(e.target),o=this._isExternalItem(e.target.parentNode);return i||o}_isExternalItem(e){let i=!1;try{i=k2(e)}catch{}return i}static \u0275fac=function(i){return new(i||Sc)};static \u0275prov=C({token:Sc,factory:Sc.\u0275fac})};return t=S([I(Eu)],t),t})(),A2=[S2,I2,M2,N2,R2],F2=(()=>{let t=class Ic{_mediator=u(R);_dragContext=u(te);_store=u(N);_dragInjector=u(tt);get _allNodes(){return this._store.nodes.getAll()}handle({event:e}){if(!this._canPrepare())return;let i=this._allNodes.find(a=>a.isContains(e.targetElement));if(!i&&!this._hasExternalDrag())throw new Error("Drag target node not found");let o=this._sortedTargetsForDrop();if(i){let a=i.fParentId(),s=this._mediator.execute(new of(a));s.length&&(o=o.filter(c=>s.includes(c.node.fId())))}let r=this._dragInjector.get(Yo);r.initialize(o),this._dragContext.draggableItems.push(r)}_canPrepare(){return this._hasMoveDrag()||this._hasExternalDrag()}_hasMoveDrag(){return this._dragContext.draggableItems.some(e=>e instanceof Tn)}_hasExternalDrag(){return this._dragContext.draggableItems.some(e=>e instanceof Iu)}_sortedTargetsForDrop(){let e=this._getDraggedNodes(),i=e.some(s=>s instanceof im),o=this._withParents(e),a=this._eligibleTargets(o,i).map(s=>{let c=this._mediator.execute(new qe(s.hostElement));return{node:s,rect:c}});return this._mediator.execute(new xu(a))}_getDraggedNodes(){let e=this._dragContext.draggableItems.find(i=>i instanceof Tn);return e?e.items.map(i=>i.nodeOrGroup):[]}_withParents(e){return e.reduce((i,o)=>{i.push(o);let r=this._mediator.execute(new eo(o));return i.push(...r),i},[])}_eligibleTargets(e,i){let o=this._allNodes.filter(r=>!e.includes(r));return i?o.filter(r=>r instanceof im):o}static \u0275fac=function(i){return new(i||Ic)};static \u0275prov=C({token:Ic,factory:Ic.\u0275fac})};return t=S([I(Cu)],t),t})(),L2=[w2,F2,b2],Pu=class{event;static fToken=Symbol("PinchToZoomFinalizeRequest");constructor(n){this.event=n}},B2=.5,Mu=(()=>{class t extends ct{type="pinch-to-zoom";kind="pinch-to-zoom";_store=u(N);get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.require(Pe.ZOOM)}_startDistance=null;_startScale=null;_touches;initialize(e){this._touches=e}prepareDragSequence(){let e=ty(this._touches);e!=null&&(this._startDistance=e,this._startScale=this._canvas.transform.scale)}onPointerMove(e,i){if(i.touches.length!==2||this._startDistance==null||this._startScale==null)return;let o=ty(i.touches),r=z2(i.touches);if(o==null||r==null){this._reset();return}if(Math.abs(o-this._startDistance)<B2)return;i.preventDefault();let a=o/this._startDistance,s=this._clamp(this._startScale*a);this._canvas.setScale(s,this._castPositionToFlow(r)),this._canvas.redraw()}_clamp(e){return Math.max(this._zoomComponent.minimum,Math.min(e,this._zoomComponent.maximum))}_castPositionToFlow(e){return ee.fromPoint(e).elementTransform(this._flowHost)}_reset(){this._startScale=null,this._startDistance=null}onPointerUp(){this._reset(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})();function z2(t){if(t.length!==2)return null;let n=t[0],e=t[1];return B.initialize((n.clientX+e.clientX)/2,(n.clientY+e.clientY)/2)}function ty(t){if(t.length!==2)return null;let n=t[0],e=t[1];return Math.hypot(e.clientX-n.clientX,e.clientY-n.clientY)}var q2=(()=>{let t=class Tc{_dragSession=u(te);handle(e){if(this._hasPinchZoomHandler())for(let i of this._dragSession.draggableItems)i.onPointerUp?.()}_hasPinchZoomHandler(){return this._dragSession.draggableItems.some(e=>e instanceof Mu)}static \u0275fac=function(i){return new(i||Tc)};static \u0275prov=C({token:Tc,factory:Tc.\u0275fac})};return t=S([I(Pu)],t),t})(),ku=class{event;static fToken=Symbol("PinchToZoomPreparationRequest");constructor(n){this.event=n}},V2=(()=>{let t=class Ec{_dragInjector=u(tt);_store=u(N);_dragSession=u(te);handle({event:e}){this._canStart(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=new ee,this._dragSession.draggableItems=[this._getHandler(e)])}_canStart(e){return this._dragSession.isEmpty()&&e.touches?.length===2&&!e.isEventInLockedContext&&this._hasZoomComponent()}_hasZoomComponent(){return this._store.instances.has(Pe.ZOOM)}_getHandler(e){let i=this._dragInjector.get(Mu);return i.initialize(e.touches),i}static \u0275fac=function(i){return new(i||Ec)};static \u0275prov=C({token:Ec,factory:Ec.\u0275fac})};return t=S([I(ku)],t),t})(),G2=[V2,q2],Du=class{event;static fToken=Symbol("SelectionAreaFinalizeRequest");constructor(n){this.event=n}},H2=(()=>{let t=class Pc{_dragSession=u(te);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(i=>{i.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>e.getEvent().kind==="selection-area")}static \u0275fac=function(i){return new(i||Pc)};static \u0275prov=C({token:Pc,factory:Pc.\u0275fac})};return t=S([I(Du)],t),t})(),Im=(()=>{class t extends ct{type="selection-area";kind="selection-area";_store=u(N);_dragSession=u(te);_mediator=u(R);_canBeSelected=[];_selectedByMove=[];get _transform(){return this._store.transform}get _canvasPosition(){return ee.fromPoint(this._transform.position).add(this._transform.scaledPosition)}get _instance(){return this._store.instances.require(Pe.SELECTION_AREA)}prepareDragSequence(){this._canBeSelected=this._mediator.execute(new _f),this._show(),this._draw(W.initialize(this._dragSession.onPointerDownPosition.x,this._dragSession.onPointerDownPosition.y))}onPointerMove(e){let i=ee.fromPoint(e).add(this._dragSession.onPointerDownPosition),o=this._getMinimumPoint(this._dragSession.onPointerDownPosition,i),r=Math.abs(e.x),a=Math.abs(e.y),s=W.initialize(o.x,o.y,r,a);this._draw(s),this._selectedByMove=[],this._canBeSelected.forEach(c=>{c.element.unmarkAsSelected();let d=W.addPoint(W.mult(c.fRect,this._transform.scale),this._canvasPosition);W.intersectionWithRect(d,s)&&(c.element.markAsSelected(),this._selectedByMove.push(c.element))}),this._mediator.execute(new xn)}_getMinimumPoint(e,i){return B.initialize(Math.min(e.x,i.x),Math.min(e.y,i.y))}onPointerUp(){this._hide(),this._dragSession.selectedItems.push(...this._selectedByMove),this._selectedByMove.length>0&&(this._dragSession.isSelectedChanged=!0)}_draw(e){let i=this._instance.hostElement.style;i.left=e.x+"px",i.top=e.y+"px",i.width=e.width+"px",i.height=e.height+"px"}_show(){this._instance.hostElement.style.display="block"}_hide(){this._instance.hostElement.style.display="none"}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),Ou=class{event;static fToken=Symbol("SelectionAreaPreparationRequest");constructor(n){this.event=n}},j2=(()=>{let t=class Mc{_store=u(N);_dragSession=u(te);_dragInjector=u(tt);get _instance(){return this._store.instances.get(Pe.SELECTION_AREA)}handle(e){this._isValid(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=ee.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost),this._dragSession.draggableItems=[this._dragInjector.createInstance(Im)])}_isValid(e){return!!this._instance&&this._dragSession.isEmpty()&&Et(e.event.originalEvent,this._instance.fTrigger)}static \u0275fac=function(i){return new(i||Mc)};static \u0275prov=C({token:Mc,factory:Mc.\u0275fac})};return t=S([I(Ou)],t),t})(),U2=[j2,H2],Nu=class{rect;childrenBounds;static fToken=Symbol("ApplyChildResizeConstraintsRequest");constructor(n,e){this.rect=n,this.childrenBounds=e}},W2=(()=>{let t=class kc{handle({rect:e,childrenBounds:i}){i&&this._apply(e,i)}_apply(e,i){this._restrictLeft(e,i),this._restrictTop(e,i),this._restrictRight(e,i),this._restrictBottom(e,i),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_restrictLeft(e,i){let o=e.x-i.x;o>0&&(e.x-=o,e.width+=o)}_restrictTop(e,i){let o=e.y-i.y;o>0&&(e.y-=o,e.height+=o)}_restrictRight(e,i){let o=i.x+i.width;e.x+e.width<=o&&(e.width=o-e.x)}_restrictBottom(e,i){let o=i.y+i.height;e.y+e.height<=o&&(e.height=o-e.y)}static \u0275fac=function(i){return new(i||kc)};static \u0275prov=C({token:kc,factory:kc.\u0275fac})};return t=S([I(Nu)],t),t})(),Ru=class{rect;limits;static fToken=Symbol("ApplyParentResizeConstraintsRequest");constructor(n,e){this.rect=n,this.limits=e}},$2=(()=>{let t=class Dc{_mediator=u(R);handle({rect:e,limits:i}){this._applyResizeConstraints(e,i)}_applyResizeConstraints(e,i){if(!i)return;let o=this._clampedCopyForCalculation(e,i);this._applySoftParentExpansions(o,i.softLimits),i.hardLimit&&this._clampRectToInner(e,i.hardLimit.innerRect)}_clampedCopyForCalculation(e,i){let o=ae({},e);return i.hardLimit&&this._clampRectToInner(o,i.hardLimit.innerRect),o}_clampRectToInner(e,i){if(e.x<i.x){let a=i.x-e.x;e.x+=a,e.width-=a}if(e.y<i.y){let a=i.y-e.y;e.y+=a,e.height-=a}let o=i.x+i.width;e.x+e.width>o&&(e.width=o-e.x);let r=i.y+i.height;e.y+e.height>r&&(e.height=r-e.y),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_applySoftParentExpansions(e,i){if(i?.length)for(let o of i)this._expandParentFromOriginalIfOverflow(e,o)}_expandParentFromOriginalIfOverflow(e,i){let o=i.innerRect,r=i.boundingRect,a=this._computeOverflow(o,e);if(!this._hasOverflow(a)){this._applyParentRect(i,r);return}let s=this._buildExpandedParentRect(r,a);this._applyParentRect(i,s)}_hasOverflow(e){return!!(e.left||e.top||e.right||e.bottom)}_computeOverflow(e,i){let o=Math.max(0,e.x-i.x),r=Math.max(0,e.y-i.y),a=Math.max(0,i.x+i.width-(e.x+e.width)),s=Math.max(0,i.y+i.height-(e.y+e.height));return{left:o,top:r,right:a,bottom:s}}_buildExpandedParentRect(e,i){let o=ae({},e);return i.left&&(o.x=e.x-i.left,o.width=e.width+i.left),i.top&&(o.y=e.y-i.top,o.height=e.height+i.top),i.right&&(o.width=(o.width??e.width)+i.right),i.bottom&&(o.height=(o.height??e.height)+i.bottom),o}_applyParentRect(e,i){e.nodeOrGroup.updatePosition(i),e.nodeOrGroup.updateSize(i),this._mediator.execute(new Jn(e.nodeOrGroup.fId(),i)),e.nodeOrGroup.redraw()}static \u0275fac=function(i){return new(i||Dc)};static \u0275prov=C({token:Dc,factory:Dc.\u0275fac})};return t=S([I(Ru)],t),t})(),Au=class{originalRect;difference;handleType;minimumSize;static fToken=Symbol("CalculateChangedRectFromDifferenceRequest");constructor(n,e,i,o){this.originalRect=n,this.difference=e,this.handleType=i,this.minimumSize=o}},ny={[qt.LEFT]:{x:-1,y:0},[qt.LEFT_TOP]:{x:-1,y:-1},[qt.TOP]:{x:0,y:-1},[qt.RIGHT_TOP]:{x:1,y:-1},[qt.RIGHT]:{x:1,y:0},[qt.RIGHT_BOTTOM]:{x:1,y:1},[qt.BOTTOM]:{x:0,y:1},[qt.LEFT_BOTTOM]:{x:-1,y:1}},K2=(()=>{let t=class Oc{handle({originalRect:e,difference:i,handleType:o,minimumSize:r}){let a=this._changeSizeInRect(e,i,ny[o],r);return this._changePosition(e,i,ny[o],a)}_changeSizeInRect(e,i,o,r){let a=e.width+o.x*i.x,s=e.height+o.y*i.y,c=0,d=0;return a<0&&(c=a,a=Math.abs(a)),a<r.width&&(o.x===-1&&(c+=a-r.width),a=r.width),s<0&&(d=s,s=Math.abs(s)),s<r.height&&(o.y===-1&&(d+=s-r.height),s=r.height),W.initialize(c,d,a,s)}_changePosition(e,i,o,r){let a=e.x+(o.x===-1?i.x:0)+r.x,s=e.y+(o.y===-1?i.y:0)+r.y;return W.initialize(a,s,r.width,r.height)}static \u0275fac=function(i){return new(i||Oc)};static \u0275prov=C({token:Oc,factory:Oc.\u0275fac})};return t=S([I(Au)],t),t})(),Fu=class{nodeOrGroup;paddings;static fToken=Symbol("CalculateDirectChildrenUnionRectRequest");constructor(n,e){this.nodeOrGroup=n,this.paddings=e}},Y2=(()=>{let t=class Nc{_mediator=u(R);_store=u(N);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle({nodeOrGroup:e,paddings:i}){let o=W.union(this._calculateDirectChildren(e.fId()).map(r=>this._normalizeRect(r)));return o?this._concatRectWithParentPadding(o,i):null}_calculateDirectChildren(e){return this._allNodesAndGroups.filter(i=>i.fParentId()===e)}_normalizeRect(e){return this._mediator.execute(new qe(e.hostElement))}_concatRectWithParentPadding(e,i){return W.initialize(e.x-i[0],e.y-i[1],e.width+i[0]+i[2],e.height+i[1]+i[3])}static \u0275fac=function(i){return new(i||Nc)};static \u0275prov=C({token:Nc,factory:Nc.\u0275fac})};return t=S([I(Fu)],t),t})(),tr=class{nodeOrGroup;rect;static fToken=Symbol("CalculateResizeLimitsRequest");constructor(n,e){this.nodeOrGroup=n,this.rect=e}},X2=(()=>{let t=class Rc{_mediator=u(R);handle({nodeOrGroup:e,rect:i}){let o=this._getParentsChain(e),r=this._calculateNodePaddings(e,i);return{limits:this._buildSoftHardLimits(o),childrenBounds:this._getNormalizedChildrenBounds(e,r),minimumSize:st.initialize(r[0]+r[2],r[1]+r[3])}}_calculateNodePaddings(e,i){return this._mediator.execute(new ii(e,i))}_getNormalizedChildrenBounds(e,i){return this._mediator.execute(new Fu(e,i))}_getParentsChain(e){return this._mediator.execute(new eo(e))??[]}_buildSoftHardLimits(e){let i=[],o,r=[0,0,0,0];for(let a of e){let s=this._getParentInfo(a,r);if(r=s.paddings,this._isAutoExpand(a))i.push(this._makeLimit(a,s));else{o=this._makeLimit(a,s);break}}return{softLimits:i,hardLimit:o}}_getParentInfo(e,i){return this._mediator.execute(new Xo(e,i))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeLimit(e,{boundingRect:i,innerRect:o}){return{nodeOrGroup:e,boundingRect:i,innerRect:o}}static \u0275fac=function(i){return new(i||Rc)};static \u0275prov=C({token:Rc,factory:Rc.\u0275fac})};return t=S([I(tr)],t),t})(),Lu=class{event;static fToken=Symbol("ResizeNodeFinalizeRequest");constructor(n){this.event=n}},zy="node-resize",qy="resize-node";function Z2(t){return t.getEvent().kind===qy||t.getEvent().fEventType===zy}var Q2=(()=>{let t=class Ac{_dragSession=u(te);handle(e){this._isNodeResizeHandler()&&this._dragSession.draggableItems.forEach(i=>i.onPointerUp?.())}_isNodeResizeHandler(){return this._dragSession.draggableItems.some(e=>Z2(e))}static \u0275fac=function(i){return new(i||Ac)};static \u0275prov=C({token:Ac,factory:Ac.\u0275fac})};return t=S([I(Lu)],t),t})(),Tm=class{fNodeId;constructor(n){this.fNodeId=n}},Em=(()=>{class t extends ct{type=zy;kind=qy;data(){return new Tm(this._nodeOrGroup.fId())}_mediator=u(R);_baselineRect;_constraints;_lastRect=null;_nodeOrGroup;_handleType;_nodeConnections={source:[],target:[]};_softParentConnections=[];initialize(e,i){this._nodeOrGroup=e,this._handleType=i}setNodeConnectionHandlers(e){this._nodeConnections=e}setSoftParentConnectionHandlers(e){this._softParentConnections=e}prepareDragSequence(){this._baselineRect=this._readBaselineRect(),this._constraints=this._buildConstraints(this._baselineRect),this._lastRect=this._baselineRect}onPointerMove(e){let i=this._calcNextRect(e);this._applyConstraints(i),this._commitRect(i),this._applyConnectionHandlers(this._nodeConnections);for(let o of this._softParentConnections)this._applyConnectionHandlers(o);this._lastRect=i}onPointerUp(){let e=this._lastRect??this._fallbackRectFromModel();this._nodeOrGroup.sizeChange.emit(e),requestAnimationFrame(()=>this._nodeOrGroup.refresh())}_readBaselineRect(){return this._mediator.execute(new qe(this._nodeOrGroup.hostElement))}_buildConstraints(e){return this._mediator.execute(new tr(this._nodeOrGroup,e))}_calcNextRect(e){return this._mediator.execute(new Au(this._baselineRect,e,this._handleType,this._constraints.minimumSize))}_applyConstraints(e){this._mediator.execute(new Nu(e,this._constraints.childrenBounds)),this._mediator.execute(new Ru(e,this._constraints.limits))}_commitRect(e){this._nodeOrGroup.updatePosition({x:e.x,y:e.y}),this._nodeOrGroup.updateSize({width:e.width,height:e.height}),this._mediator.execute(new Jn(this._nodeOrGroup.fId(),e)),this._nodeOrGroup.redraw()}_fallbackRectFromModel(){return W.initialize(this._nodeOrGroup._position.x,this._nodeOrGroup._position.y,this._nodeOrGroup._size?.width,this._nodeOrGroup._size?.height)}_applyConnectionHandlers(e){if(!e.source.length&&!e.target.length)return;let i=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,i);o.handler.setSourceRect(r)}for(let o of e.target){let r=this._readConnectorRect(o.connector,i);o.handler.setTargetRect(r)}}_readConnectorRect(e,i){let o=`${e.kind}::${e.fId()}`,r=i.get(o);if(r)return r;let a=this._mediator.execute(new Sn(e.hostElement,!1));return i.set(o,a),a}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),nr=class{_mediator=u(R);_store=u(N);_behaviour=u(ro);_source;_target;_sourceRef;_targetRef;_sourceRect;_targetRect;connection;initialize(n){this.connection=n,this._source=this._store.outputs.require(this.connection.fOutputId()),this._target=this._store.inputs.require(this.connection.fInputId()),this._sourceRef=this._readRectRef(this._source),this._targetRef=this._readRectRef(this._target),this._sourceRect=He.fromRoundedRect(this._sourceRef.rect),this._targetRect=He.fromRoundedRect(this._targetRef.rect)}setSourceRect(n){this._sourceRect=He.fromRoundedRect(n),this._mediator.execute(new Qn(this._source.fId(),this._source.kind,this._sourceRect))}setTargetRect(n){this._targetRect=He.fromRoundedRect(n),this._mediator.execute(new Qn(this._target.fId(),this._target.kind,this._targetRect))}redraw(){let n=this._buildLine();this.connection.setLine(n),this.connection.redraw()}_buildLine(){let n=He.fromRoundedRect(this._sourceRect),e=He.fromRoundedRect(this._targetRect);return this._behaviour.handle(new At(n,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(n){return{connector:n,rect:this._mediator.execute(new Sn(n.hostElement,!1))}}_resolveRotationContext(n){return this._mediator.execute(new tn(n))}},J2=(()=>{class t extends nr{_sourceUpdated=!1;_targetUpdated=!1;setSourceRect(e){super.setSourceRect(e),this._sourceUpdated=!0,this._redrawIfReady()}setTargetRect(e){super.setTargetRect(e),this._targetUpdated=!0,this._redrawIfReady()}_redrawIfReady(){!this._sourceUpdated||!this._targetUpdated||(this._sourceUpdated=!1,this._targetUpdated=!1,super.redraw())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),eA=(()=>{class t extends nr{setSourceRect(e){super.setSourceRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),tA=(()=>{class t extends nr{setTargetRect(e){super.setTargetRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),Bu=class{event;fTrigger;static fToken=Symbol("ResizeNodePreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},zu=class{handler;nodeOrGroup;static fToken=Symbol("AttachResizeConnectionDragHandlersToNodeRequest");constructor(n,e){this.handler=n,this.nodeOrGroup=e}},nA=(()=>{let t=class Fc{_store=u(N);_mediator=u(R);_dragInjector=u(tt);handle({handler:e,nodeOrGroup:i}){let o=this._readSoftParents(i),r=[i,...o],a=this._collectSourceConnectorIds(r),s=this._collectTargetConnectorIds(r),c=new Map;e.setNodeConnectionHandlers(this._buildConnectionHandlersForNode(i,a,s,c)),e.setSoftParentConnectionHandlers(o.map(d=>this._buildConnectionHandlersForNode(d,a,s,c)))}_readSoftParents(e){let i=this._mediator.execute(new qe(e.hostElement));return this._mediator.execute(new tr(e,i)).limits.softLimits.map(r=>r.nodeOrGroup)}_collectSourceConnectorIds(e){let i=new Set(e.map(o=>o.fId()));return new Set(this._store.outputs.getAll().filter(o=>i.has(o.fNodeId)).map(o=>o.fId()))}_collectTargetConnectorIds(e){let i=new Set(e.map(o=>o.fId()));return new Set(this._store.inputs.getAll().filter(o=>i.has(o.fNodeId)).map(o=>o.fId()))}_buildConnectionHandlersForNode(e,i,o,r){let a=this._store.outputs.getAll().filter(h=>h.fNodeId===e.fId()),s=this._store.inputs.getAll().filter(h=>h.fNodeId===e.fId());if(!a.length&&!s.length)return{source:[],target:[]};let c=new Set(a.map(h=>h.fId())),d=new Set(s.map(h=>h.fId())),f={source:[],target:[]};for(let h of this._store.connections.getAll()){let v=c.has(h.fOutputId()),b=d.has(h.fInputId());if(!v&&!b)continue;let w=r.get(h.fId())??this._createConnectionHandler(h,i,o);if(r.set(h.fId(),w),v){let T=this._store.outputs.require(h.fOutputId());f.source.push({handler:w,connector:T})}if(b){let T=this._store.inputs.require(h.fInputId());f.target.push({handler:w,connector:T})}}return f}_createConnectionHandler(e,i,o){let r=i.has(e.fOutputId()),a=o.has(e.fInputId()),s=r&&a?this._dragInjector.createInstance(J2):r?this._dragInjector.createInstance(eA):this._dragInjector.createInstance(tA);return s.initialize(e),s}static \u0275fac=function(i){return new(i||Fc)};static \u0275prov=C({token:Fc,factory:Fc.\u0275fac})};return t=S([I(zu)],t),t})(),iA=(()=>{let t=class Lc{_mediator=u(R);_store=u(N);_dragSession=u(te);_dragInjector=u(tt);get _transform(){return this._store.transform}handle({event:e,fTrigger:i}){if(!this._dragSession.isEmpty()||!this._isResizeHandle(e.targetElement)||!Et(e.originalEvent,i))return;let o=this._findResizableNode(e.targetElement);if(!o)return;this._selectBeforeResize(o);let r=this._transform.scale??1;this._dragSession.onPointerDownScale=r,this._dragSession.onPointerDownPosition=ee.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(r);let a=this._dragInjector.createInstance(Em);a.initialize(o,this._readResizeHandleType(e.targetElement)),this._mediator.execute(new zu(a,o)),this._dragSession.draggableItems=[a]}_isResizeHandle(e){return Do(e,".f-resize-handle")}_findResizableNode(e){let i=this._store.nodes.getAll().find(o=>o.isContains(e));if(i)return i.fDraggingDisabled()?void 0:i}_selectBeforeResize(e){queueMicrotask(()=>{this._mediator.execute(new io(e))})}_readResizeHandleType(e){let i=N0(e,"fResizeHandleType",".f-resize-handle");return qt[i]}static \u0275fac=function(i){return new(i||Lc)};static \u0275prov=C({token:Lc,factory:Lc.\u0275fac})};return t=S([I(Bu)],t),t})(),oA=[W2,$2,K2,Y2,X2,nA,Q2,iA],qu=class{event;static fToken=Symbol("RotateNodeFinalizeRequest");constructor(n){this.event=n}},Vy="node-rotate",Gy="rotate-node";function rA(t){return t.getEvent().kind===Gy||t.getEvent().fEventType===Vy}var aA=(()=>{let t=class Bc{_dragSession=u(te);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(i=>{i.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>rA(e))}static \u0275fac=function(i){return new(i||Bc)};static \u0275prov=C({token:Bc,factory:Bc.\u0275fac})};return t=S([I(qu)],t),t})(),Vu=class{event;fTrigger;static fToken=Symbol("RotateNodePreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},Pm=class{fNodeId;constructor(n){this.fNodeId=n}};function sA(t,n,e){let{x:i,y:o}=cA(t,n,e),r=i-t.x,a=o-t.y;return{x:r,y:a}}function cA(t,n,e){let i=t.x-e.x,o=t.y-e.y,r=n*Math.PI/180,a=Math.cos(r),s=Math.sin(r),c=i*a-o*s,d=i*s+o*a,f=c+e.x,h=d+e.y;return{x:f,y:h}}var Mm=(()=>{class t extends ct{type=Vy;kind=Gy;data(){return new Pm(this._nodeOrGroup.fId())}_store=u(N);_mediator=u(R);_dragSession=u(te);_nodeOrGroup;_sourceConnections;_targetConnections;_startRotation=0;_nodeRect;_nodeCenter;_pointerDownInFlow;_rotationOffsetDeg=0;get _transform(){return this._store.transform}initialize(e,i,o){this._nodeOrGroup=e,this._sourceConnections=i,this._targetConnections=o,this._startRotation=this._nodeOrGroup._rotate}prepareDragSequence(){this._nodeRect=this._readNodeRect(),this._nodeCenter=this._nodeRect.gravityCenter,this._pointerDownInFlow=this._calculatePointerDownInFlow();let e=this._angleDeg(this._pointerDownInFlow);this._rotationOffsetDeg=e-this._startRotation}onPointerMove(e){let i=B.sum(this._pointerDownInFlow,e),r=this._angleDeg(i)-this._rotationOffsetDeg;this._applyRotation(r);let a=r-this._startRotation;for(let s of this._sourceConnections)s.connection.setSourceDelta(this._deltaAfterRotation(s.connector,a));for(let s of this._targetConnections)s.connection.setTargetDelta(this._deltaAfterRotation(s.connector,a))}onPointerUp(){this._nodeOrGroup.rotate.set(this._nodeOrGroup._rotate),this._nodeOrGroup.refresh()}_readNodeRect(){return this._mediator.execute(new qe(this._nodeOrGroup.hostElement))}_calculatePointerDownInFlow(){return B.sub(this._dragSession.onPointerDownPosition,B.sum(this._transform.position,this._transform.scaledPosition))}_angleDeg(e){return Math.atan2(e.y-this._nodeCenter.y,e.x-this._nodeCenter.x)*(180/Math.PI)}_applyRotation(e){this._nodeOrGroup.updateRotate(e),this._nodeOrGroup.redraw()}_deltaAfterRotation(e,i){return sA(e,i,this._nodeCenter)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),dA=(()=>{let t=class zc{_mediator=u(R);_store=u(N);_dragContext=u(te);_dragInjector=u(tt);get _transform(){return this._store.transform}handle(e){if(!this._isPreparationAllowed(e))return;let i=this._findRotatableNode(e.event.targetElement);if(!i)return;this._selectBeforeRotate(i);let o=this._transform.scale;this._dragContext.onPointerDownScale=o,this._dragContext.onPointerDownPosition=ee.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(o);let r=this._dragInjector.createInstance(Mm);r.initialize(i,this._buildOutputConnectionHandlers(i),this._buildInputConnectionHandlers(i)),this._dragContext.draggableItems=[r]}_isPreparationAllowed({event:e,fTrigger:i}){return this._dragContext.isEmpty()&&OR(e.targetElement)&&Et(e.originalEvent,i)}_findRotatableNode(e){for(let i of this._store.nodes.getAll())if(!i.fDraggingDisabled()&&i.isContains(e))return i}_selectBeforeRotate(e){queueMicrotask(()=>{this._mediator.execute(new io(e))})}_buildInputConnectionHandlers(e){return this._mediator.execute(new $u(e)).map(i=>{let o=this._store.inputs.require(i.fInputId()),r=this._mediator.execute(new vt(o)),a=this._dragInjector.get(er);return a.initialize(i),{connection:a,connector:r.rect.gravityCenter}})}_buildOutputConnectionHandlers(e){return this._mediator.execute(new nf(e)).map(i=>{let o=this._store.outputs.require(i.fOutputId()),r=this._mediator.execute(new vt(o)),a=this._dragInjector.get(Qo);return a.initialize(i),{connection:a,connector:r.rect.gravityCenter}})}static \u0275fac=function(i){return new(i||zc)};static \u0275prov=C({token:zc,factory:zc.\u0275fac})};return t=S([I(Vu)],t),t})(),lA=[aA,dA],ir=class{flowRect;canvasPosition;eventPoint;minimap;static fToken=Symbol("CalculateFlowPointFromMinimapPointRequest");constructor(n,e,i,o){this.flowRect=n,this.canvasPosition=e,this.eventPoint=i,this.minimap=o}},uA=(()=>{let t=class qc{_store=u(N);get _canvasScale(){return this._store.transform.scale||1}handle(e){return B.sub(e.canvasPosition,B.sub(this._getPositionInViewBox(e.eventPoint,e.minimap),this._getNormalizedFlowCenter(e.flowRect)))}_getNormalizedFlowCenter(e){return ee.fromPoint(e.gravityCenter).sub(e)}_getPositionInViewBox(e,i){let o=this.normalizeEventPoint(e,i);return B.sum(o,W.mult(i.viewBox,this._canvasScale))}normalizeEventPoint(e,i){return this._getEventPointInMinimap(e,i).mult(i.scale).mult(this._canvasScale)}_getEventPointInMinimap(e,i){return ee.fromPoint(e).elementTransform(i.element)}static \u0275fac=function(i){return new(i||qc)};static \u0275prov=C({token:qc,factory:qc.\u0275fac})};return t=S([I(ir)],t),t})(),Gu=class{event;static fToken=Symbol("DragMinimapFinalizeRequest");constructor(n){this.event=n}},fA=(()=>{let t=class Vc{_dragSession=u(te);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(i=>{i.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(pA)}static \u0275fac=function(i){return new(i||Vc)};static \u0275prov=C({token:Vc,factory:Vc.\u0275fac})};return t=S([I(Gu)],t),t})(),Hy="minimap",jy="minimap";function pA(t){return t.getEvent().kind===jy||t.getEvent().fEventType===Hy}var km=(()=>{class t extends ct{type=Hy;kind=jy;_store=u(N);_mediator=u(R);_lastDelta=null;_flowRect;_startCanvasPosition;_eventPoint;_minimap;initialize(e,i,o,r){this._flowRect=e,this._startCanvasPosition=i,this._eventPoint=o,this._minimap=r}prepareDragSequence(){this._store.fCanvas?.hostElement.classList.add("f-scaled-animate")}onPointerMove(e){this._lastDelta&&this._isSamePoint(e,this._lastDelta)||(this._lastDelta=e,this._store.fCanvas?.setPosition(this._getNewPosition(ee.fromPoint(this._eventPoint).add(e))),this._store.fCanvas?.redraw())}_isSamePoint(e,i){return e.x===i.x&&e.y===i.y}_getNewPosition(e){return this._mediator.execute(new ir(this._flowRect,this._startCanvasPosition,e,this._minimap))}onPointerUp(){this._store.fCanvas?.hostElement.classList.remove("f-scaled-animate"),this._store.fCanvas?.emitCanvasChangeEvent()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),Hu=class{event;static fToken=Symbol("DragMinimapPreparationRequest");constructor(n){this.event=n}},hA=(()=>{let t=class Gc{_store=u(N);_mediator=u(R);_dragSession=u(te);_dragInjector=u(tt);get _canvas(){return this._store.fCanvas}get _flowHost(){return this._store.flowHost}handle({event:e}){if(!this._isValid(e))return;let i=this._store.instances.require(Pe.MINIMAP).state,o=e.getPosition(),r=ee.fromPoint(this._store.transform.position),a=W.fromElement(this._flowHost);this._canvas.setPosition(this._calculateCanvasPosition(a,o,i)),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent(),this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=ee.fromPoint(o).elementTransform(this._flowHost);let s=this._dragInjector.createInstance(km);s.initialize(a,r,o,i),this._dragSession.draggableItems=[s]}_isValid(e){return!(!this._dragSession.isEmpty()||!this._flowHost.contains(e.targetElement)||!e.targetElement.closest(".f-minimap")||!this._store.instances.get(Pe.MINIMAP))}_calculateCanvasPosition(e,i,o){return this._mediator.execute(new ir(e,ee.fromPoint(this._canvas.transform.position),i,o))}static \u0275fac=function(i){return new(i||Gc)};static \u0275prov=C({token:Gc,factory:Gc.\u0275fac})};return t=S([I(Hu)],t),t})(),mA=[uA,fA,hA];function gA(t){return!!t&&typeof t.destroy=="function"}var tt=(()=>{class t{_injector=u(ot);_dragInjector=null;_created=[];create(){this._dragInjector=ot.create({providers:[{provide:ju,useClass:ju},{provide:ou,useClass:ou},{provide:Yl,useClass:Yl},{provide:cm,useClass:cm},{provide:Yo,useClass:Yo},{provide:Qo,useClass:Qo},{provide:er,useClass:er},{provide:Jo,useClass:Jo},{provide:Tn,useClass:Tn},{provide:Mu,useClass:Mu},{provide:Im,useClass:Im},{provide:Em,useClass:Em},{provide:Mm,useClass:Mm},{provide:km,useClass:km}],parent:this._injector}),this._created=[]}get(e){if(!this._dragInjector)throw new Error("DragHandlerInjector has not been created. Call create() before using get().");return this._dragInjector.get(e)}createInstance(e){if(!this._dragInjector)throw new Error("DragHandlerInjector is not created");let i=j_(this._dragInjector,()=>new e);return this._created.push(i),i}destroy(){for(let e of this._created)gA(e)&&e.destroy();this._created=[],this._dragInjector?.destroy?.(),this._dragInjector=null}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),En=(()=>{class t{_data;setData(e){this._data=ae(ae({},this._data),e)}getData(){return this._data}clear(){this._data=void 0}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),iy="f-canvas-dragging",oy="canvas-dragging",ju=(()=>{class t extends ct{type="canvas-move";kind="drag-canvas";_store=u(N);_onPointerDownPosition=B.initialize();constructor(){super(),this._store.fCanvas?.hostElement.classList.add(iy,oy)}prepareDragSequence(){this._onPointerDownPosition=this._store.transform.position}onPointerMove(e){this._store.fCanvas?.setPosition(ee.fromPoint(this._onPointerDownPosition).add(e)),this._store.fCanvas?.redraw()}onPointerUp(){this._store.fCanvas?.emitCanvasChangeEvent(),this._store.fCanvas?.hostElement.classList.remove(iy,oy)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),_A=(()=>{let t=class Hc{_dragContext=u(te);handle(e){this._isValid()&&this._dragContext.draggableItems.forEach(i=>i.onPointerUp?.())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof ju)}static \u0275fac=function(i){return new(i||Hc)};static \u0275prov=C({token:Hc,factory:Hc.\u0275fac})};return t=S([I(jl)],t),t})(),Uu=class{event;fTrigger;static fToken=Symbol("DragCanvasPreparationRequest");constructor(n,e){this.event=n,this.fTrigger=e}},yA=(()=>{let t=class jc{_store=u(N);_dragContext=u(te);_dragInjector=u(tt);handle({event:e,fTrigger:i}){!this._isValid(e)||!this._isValidTrigger(e,i)||(this._dragContext.onPointerDownScale=1,this._dragContext.onPointerDownPosition=ee.fromPoint(e.getPosition()).elementTransform(this._store.flowHost),this._dragContext.draggableItems=[this._dragInjector.get(ju)])}_isValid(e){return this._dragContext.isEmpty()&&(this._isBackgroundElement(e.targetElement)||this._isDragOnHost(e.targetElement))}_isBackgroundElement(e){return this._store.instances.get(Pe.BACKGROUND)?.hostElement.contains(e)}_isDragOnHost(e){return this._store.flowHost.contains(e)&&!this._getNode(e)}_getNode(e){let i=this._store.nodes.getAll().find(o=>o.isContains(e));return i&&i.fDraggingDisabled()&&(i=void 0),i}_isValidTrigger(e,i){return Et(e.originalEvent,i)}static \u0275fac=function(i){return new(i||jc)};static \u0275prov=C({token:jc,factory:jc.\u0275fac})};return t=S([I(Uu)],t),t})(),vA=[_A,yA],Wu=class{event;trigger;static fToken=Symbol("SelectByPointerRequest");constructor(n,e){this.event=n,this.trigger=e}},CA=(()=>{let t=class Uc{_mediator=u(R);_store=u(N);_dragSession=u(te);handle({event:e,trigger:i}){if(!this._isSelectionAllowed(e))return;let o=this._resolveSelectable(e.targetElement);this._deferRaiseLayerFor(o),Et(e.originalEvent,i)?this._applyToggleSelect(o):this._applySingleSelect(o)}_isSelectionAllowed(e){return this._store.flowHost.contains(e.targetElement)&&this._dragSession.isEmpty()}_resolveSelectable(e){return this._findNodeOrGroupAt(e)??this._findConnectionAt(e)}_findNodeOrGroupAt(e){return this._store.nodes.getAll().find(i=>i.isContains(e))}_findConnectionAt(e){return this._store.connections.getAll().find(i=>i.isContains(e))}_deferRaiseLayerFor(e){e&&queueMicrotask(()=>{this._mediator.execute(new oi(e,e.hostElement.parentElement))})}_applySingleSelect(e){if(!e||e.fSelectionDisabled()){this._clearSelection();return}e.isSelected()||(this._clearSelection(),this._select(e))}_applyToggleSelect(e){!e||e.fSelectionDisabled()||(e.isSelected()?this._deselect(e):this._select(e))}_clearSelection(){if(this._dragSession.selectedItems.length){for(let e of this._dragSession.selectedItems)e.unmarkAsSelected();this._dragSession.markSelectionAsChanged(),this._dragSession.selectedItems=[]}}_select(e){this._dragSession.selectedItems.push(e),e.markAsSelected(),this._dragSession.markSelectionAsChanged()}_deselect(e){let i=this._dragSession.selectedItems.indexOf(e);i>=0&&this._dragSession.selectedItems.splice(i,1),e.unmarkAsSelected(),this._dragSession.markSelectionAsChanged()}static \u0275fac=function(i){return new(i||Uc)};static \u0275prov=C({token:Uc,factory:Uc.\u0275fac})};return t=S([I(Wu)],t),t})(),xA=[CA];var Dm=class extends Zh{hostElement=u(Be).nativeElement};function bA(t){return Do(t,".f-drag-blocker")}var Uy=(()=>{class t extends Dm{_result=u(En);_mediator=u(R);_platform=u(fh);disabled=!1;fMultiSelectTrigger=e=>this._platform.getOS()===_n.MAC_OS?e.metaKey:e.ctrlKey;fReassignConnectionTrigger=Nt;fCreateConnectionTrigger=Nt;fConnectionWaypointsTrigger=F(Nt);fMoveControlPointTrigger=Nt;fNodeResizeTrigger=Nt;fNodeRotateTrigger=Nt;fNodeMoveTrigger=Nt;fCanvasMoveTrigger=Nt;fExternalItemTrigger=Nt;fSelectionChange=new gt;fNodeIntersectedWithConnections=new gt;fNodeConnectionsIntersection=Ge();fEmitOnNodeIntersect=!1;fCreateNode=new gt;fMoveNodes=new gt;fReassignConnection=new gt;fCreateConnection=new gt;fConnectionWaypointsChanged=Ge();fDropToGroup=new gt;vCellSize=F(1,{transform:e=>et(e,1)});hCellSize=F(1,{transform:e=>et(e,1)});fCellSizeWhileDragging=F(!1,{transform:e=>Ce(e)});fDragStarted=new gt;fDragEnded=new gt;_dragHandlerInjector=u(tt);ngOnInit(){this._mediator.execute(new Xu(this))}ngAfterViewInit(){super.subscribe()}onPointerDown(e){if(bA(e.targetElement))return!1;this._dragHandlerInjector.create(),this._result.clear(),this._mediator.execute(new Qu),this._mediator.execute(new Ou(e)),this._mediator.execute(new Hu(e)),this._mediator.execute(new ku(e)),this._mediator.execute(new Wu(e,this.fMultiSelectTrigger)),this._mediator.execute(new eu(e,this.fReassignConnectionTrigger)),this._mediator.execute(new Ql(e,this.fCreateConnectionTrigger)),this._mediator.execute(new ru(e,this.fConnectionWaypointsTrigger()));let i=e.isMouseLeftButton();return i||this.finalizeDragSequence(),i}prepareDragSequence(e){this._mediator.execute(new Bu(e,this.fNodeResizeTrigger)),this._mediator.execute(new Vu(e,this.fNodeRotateTrigger)),this._mediator.execute(new vu(e,this.fNodeMoveTrigger)),this._mediator.execute(new Tu(e,this.fExternalItemTrigger)),this._mediator.execute(new Cu(e)),this._mediator.execute(new Uu(e,this.fCanvasMoveTrigger)),this._mediator.execute(new Ju)}onSelect(e){this._mediator.execute(new Eu(e))}onPointerMove(e){this._mediator.execute(new Zu(e))}onPointerUp(e){this._mediator.execute(new Gu(e)),this._mediator.execute(new Du(e)),this._mediator.execute(new Jl(e)),this._mediator.execute(new Kl(e)),this._mediator.execute(new Lu(e)),this._mediator.execute(new qu(e)),this._mediator.execute(new yu(e)),this._mediator.execute(new Su(e)),this._mediator.execute(new au(e)),this._mediator.execute(new jl(e)),this._mediator.execute(new Pu(e)),this._mediator.execute(new nu(e)),this._mediator.execute(new Bl)}finalizeDragSequence(){this._mediator.execute(new In),this._mediator.execute(new Uo),this._result.clear(),this._dragHandlerInjector.destroy()}ngOnDestroy(){this._mediator.execute(new In),this._mediator.execute(new ef),super.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,selectors:[["f-flow","fDraggable",""]],inputs:{disabled:[2,"fDraggableDisabled","disabled",Ce],fMultiSelectTrigger:"fMultiSelectTrigger",fReassignConnectionTrigger:"fReassignConnectionTrigger",fCreateConnectionTrigger:"fCreateConnectionTrigger",fConnectionWaypointsTrigger:[1,"fConnectionWaypointsTrigger"],fMoveControlPointTrigger:"fMoveControlPointTrigger",fNodeResizeTrigger:"fNodeResizeTrigger",fNodeRotateTrigger:"fNodeRotateTrigger",fNodeMoveTrigger:"fNodeMoveTrigger",fCanvasMoveTrigger:"fCanvasMoveTrigger",fExternalItemTrigger:"fExternalItemTrigger",fEmitOnNodeIntersect:[2,"fEmitOnNodeIntersect","fEmitOnNodeIntersect",Ce],vCellSize:[1,"vCellSize"],hCellSize:[1,"hCellSize"],fCellSizeWhileDragging:[1,"fCellSizeWhileDragging"]},outputs:{fSelectionChange:"fSelectionChange",fNodeIntersectedWithConnections:"fNodeIntersectedWithConnections",fNodeConnectionsIntersection:"fNodeConnectionsIntersection",fCreateNode:"fCreateNode",fMoveNodes:"fMoveNodes",fReassignConnection:"fReassignConnection",fCreateConnection:"fCreateConnection",fConnectionWaypointsChanged:"fConnectionWaypointsChanged",fDropToGroup:"fDropToGroup",fDragStarted:"fDragStarted",fDragEnded:"fDragEnded"},exportAs:["fDraggable"],standalone:!1,features:[we([En,tt]),ve]})}return t})(),wA=[...vA,...JR,...xR,...xA,...A2,...MR,...mA,...x2,...L2,...oA,...lA,...U2,...G2],SA=(()=>{let t=class Wc{_store=u(N);handle({waypointIndex:e,connectionId:i}){let o=this._store.connections.require(i),r=o.fWaypoints()?.waypoints().slice();if(!r)throw new Error("Connection waypoints not found");r.splice(e,1),o.fWaypoints()?.waypoints.set(r),this._store.fDraggable?.fConnectionWaypointsChanged.emit(this._changeEvent(o))}_changeEvent(e){return new iu(e.fId(),e.fWaypoints()?.waypoints()||[])}static \u0275fac=function(i){return new(i||Wc)};static \u0275prov=C({token:Wc,factory:Wc.\u0275fac})};return t=S([I($h)],t),t})(),Om=class{static fToken=Symbol("RemoveSnapConnectionFromStoreRequest")},IA=(()=>{let t=class $c{_store=u(N);handle(e){this._store.connections.removeInstanceForSnap()}static \u0275fac=function(i){return new(i||$c)};static \u0275prov=C({token:$c,factory:$c.\u0275fac})};return t=S([I(Om)],t),t})(),TA=[Nf,ri,vO,CO,xO,bO,hN,jN,vN,BN,QN,ZN,HN,eR,nR,tR,GN,YN,CN,aR,VN,qN,zN,NN,LN,RN,AN,JN,$N,iR,oR,XN,KN,rR,sR,cR,dR,IA,SA],or=class{instance;static fToken=Symbol("AddConnectorToStoreRequest");constructor(n){this.instance=n}},EA=(()=>{let t=class Kc{_store=u(N);_mediator=u(R);handle({instance:e}){switch(e.kind){case"input":this._addInput(e);break;case"output":this._addOutput(e);break;case"outlet":this._addOutlet(e);break;default:throw new Error(`Unknown connector kind: ${e.kind}`)}}_addInput(e){this._store.inputs.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_addOutput(e){this._store.outputs.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_addOutlet(e){this._store.outlets.add(e),this._store.emitNodeChanges(),this._geometryRegister(e)}_geometryRegister(e){this._mediator.execute(new yl(e.fId(),e.fNodeId,e.kind,e.hostElement))}static \u0275fac=function(i){return new(i||Kc)};static \u0275prov=C({token:Kc,factory:Kc.\u0275fac})};return t=S([I(or)],t),t})(),ni=class{position;connectorRefs;static fToken=Symbol("CalculateClosestConnectorRequest");constructor(n,e){this.position=n,this.connectorRefs=e}},PA=(()=>{let t=class Yc{handle({position:e,connectorRefs:i}){let o,r=1/0;for(let a of i){let s=this._distanceToRect(e,a.rect);s<r&&(r=s,o=a)}return o?Xt(ae({},o),{distance:r}):void 0}_distanceToRect(e,{x:i,y:o,width:r,height:a}){let s=this._clamp(e.x,i,i+r),c=this._clamp(e.y,o,o+a),d=e.x-s,f=e.y-c;return Math.sqrt(d*d+f*f)}_clamp(e,i,o){return Math.max(i,Math.min(o,e))}static \u0275fac=function(i){return new(i||Yc)};static \u0275prov=C({token:Yc,factory:Yc.\u0275fac})};return t=S([I(ni)],t),t})(),rr=class{pointerPosition;connectableConnectors;static fToken=Symbol("FindConnectableConnectorUsingPriorityAndPositionRequest");constructor(n,e){this.pointerPosition=n,this.connectableConnectors=e}},MA=(()=>{let t=class Xc{_mediator=u(R);_store=u(N);_browser=u(je);get _transform(){return this._store.transform}get _flowHost(){return this._store.flowHost}get _fNodes(){return this._store.nodes.getAll()}get _snapConnection(){return this._store.connections.getForSnap()}handle(e){let i=this._findConnectorAtPosition(e);return i.length>0?i[0]:void 0}_findConnectorAtPosition(e){let i=[];i.push(...this._filterConnectorsThatLocatedAtPosition(e));let o=this._isSnapConnectionEnabledAndHasClosestConnector(e);o&&i.unshift(o.connector);let r=this._getFirstConnectableConnectorOfNodeAtPosition(e);return r&&i.push(r),i}_filterConnectorsThatLocatedAtPosition(e){return e.connectableConnectors.filter(i=>W.isIncludePoint(i.rect,this._calculatePointerInFlow(e.pointerPosition))).map(i=>i.connector)}_calculatePointerInFlow(e){return ao(e,this._flowHost,this._transform)}_isSnapConnectionEnabledAndHasClosestConnector(e){if(!this._snapConnection)return;let i=this._mediator.execute(new ni(this._calculatePointerInFlow(e.pointerPosition),e.connectableConnectors));return this._isValidClosestInput(i)?i:void 0}_isValidClosestInput(e){return!!e&&e.distance<this._snapConnection.fSnapThreshold}_getFirstConnectableConnectorOfNodeAtPosition(e){return this._getElementsFromPoint(e.pointerPosition).map(i=>this._findConnectableNode(i)).filter(i=>!!i).map(i=>this._findFirstConnectableConnectorOfNode(e.connectableConnectors,i)).find(i=>!!i)}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y)}_findConnectableNode(e){return this._fNodes.find(i=>i.isContains(e)&&i.fConnectOnNode())}_findFirstConnectableConnectorOfNode(e,i){return e.find(o=>o.connector.fNodeId===i.fId())?.connector}static \u0275fac=function(i){return new(i||Xc)};static \u0275prov=C({token:Xc,factory:Xc.\u0275fac})};return t=S([I(rr)],t),t})(),ar=class{source;pointer;static fToken=Symbol("CalculateTargetConnectorsToConnectRequest");constructor(n,e){this.source=n,this.pointer=e}},vt=class{connector;static fToken=Symbol("GetConnectorRectReferenceRequest");constructor(n){this.connector=n}},kA=(()=>{let t=class Zc{_mediator=u(R);handle({connector:e}){return{connector:e,rect:this._getRect(e)}}_getRect(e){return this._mediator.execute(new Sn(e.hostElement))}static \u0275fac=function(i){return new(i||Zc)};static \u0275prov=C({token:Zc,factory:Zc.\u0275fac})};return t=S([I(vt)],t),t})(),sr=class{nodeOrGroup;static fToken=Symbol("AddNodeToStoreRequest");constructor(n){this.nodeOrGroup=n}},DA=(()=>{let t=class Qc{_store=u(N);_mediator=u(R);handle({nodeOrGroup:e}){this._store.nodes.add(e),this._mediator.execute(new vl(e.fId(),e.hostElement,e)),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||Qc)};static \u0275prov=C({token:Qc,factory:Qc.\u0275fac})};return t=S([I(sr)],t),t})(),$u=class{nodeOrGroup;static fToken=Symbol("CalculateInputConnectionsRequest");constructor(n){this.nodeOrGroup=n}},OA=(()=>{let t=class Jc{_store=u(N);handle({nodeOrGroup:e}){let i=this._collectInputIds(e);return this._collectConnections(i)}_collectInputIds(e){let i=new Set,o=this._store.inputs.getAll();for(let r of o)e.isContains(r.hostElement)&&i.add(r.fId());return i}_collectConnections(e){let i=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fInputId())&&i.push(r);return i}static \u0275fac=function(i){return new(i||Jc)};static \u0275prov=C({token:Jc,factory:Jc.\u0275fac})};return t=S([I($u)],t),t})(),Zi=class{connector;pointerPosition;static fToken=Symbol("CalculateConnectableSideByConnectedPositionsRequest");constructor(n,e){this.connector=n,this.pointerPosition=e}},ry=2,at=(function(t){return t[t.NONE=0]="NONE",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.TOP=4]="TOP",t[t.BOTTOM=8]="BOTTOM",t[t.ALL=15]="ALL",t})(at||{});function NA(t,n,e,i,o){let r=RA(o),a=e-t,s=i-n,c=AA(a,s);return FA(c,r)?c:LA(a,s,r,c)}function RA(t){if(!t||t.length===0)return at.ALL;let n=at.NONE;for(let e=0;e<t.length;e++)switch(t[e]){case z.LEFT:n|=at.LEFT;break;case z.RIGHT:n|=at.RIGHT;break;case z.TOP:n|=at.TOP;break;case z.BOTTOM:n|=at.BOTTOM;break}return n||at.ALL}function AA(t,n){let e=t<0?-t:t,i=n<0?-n:n;return e-i>ry?t<0?z.LEFT:z.RIGHT:(i-e>ry,n<0?z.TOP:z.BOTTOM)}function FA(t,n){switch(t){case z.LEFT:return(n&at.LEFT)!==0;case z.RIGHT:return(n&at.RIGHT)!==0;case z.TOP:return(n&at.TOP)!==0;case z.BOTTOM:return(n&at.BOTTOM)!==0;default:return!0}}function LA(t,n,e,i){let o=i,r=-1/0;if(e&at.RIGHT){let a=t;a>r&&(r=a,o=z.RIGHT)}if(e&at.LEFT){let a=-t;a>r&&(r=a,o=z.LEFT)}if(e&at.BOTTOM){let a=n;a>r&&(r=a,o=z.BOTTOM)}if(e&at.TOP){let a=-n;a>r&&(r=a,o=z.TOP)}return o}function Ku(t){return t===z.CALCULATE||t===z.CALCULATE_HORIZONTAL||t===z.CALCULATE_VERTICAL}var BA={[z.CALCULATE]:[z.TOP,z.BOTTOM,z.LEFT,z.RIGHT],[z.CALCULATE_HORIZONTAL]:[z.LEFT,z.RIGHT],[z.CALCULATE_VERTICAL]:[z.TOP,z.BOTTOM]},zA=(()=>{let t=class ed{_mediator=u(R);handle({connector:e,pointerPosition:i}){let o=e.userFConnectableSide,r=this._getConnectorRect(e.hostElement).gravityCenter,a=this._accumulateConnectedCenters(e.hostElement,e.toConnector,i),s=a.sumX/a.count,c=a.sumY/a.count;return NA(r.x,r.y,s,c,BA[o])}_accumulateConnectedCenters(e,i,o){let r=o?.x||0,a=o?.y||0,s=o?1:0;if(i&&i.length)for(let c=0;c<i.length;c++){let d=i[c].hostElement;if(d===e)continue;let f=this._getConnectorRect(d).gravityCenter;r+=f.x,a+=f.y,s++}return{sumX:r,sumY:a,count:s}}_getConnectorRect(e){return this._mediator.execute(new qe(e))}static \u0275fac=function(i){return new(i||ed)};static \u0275prov=C({token:ed,factory:ed.\u0275fac})};return t=S([I(Zi)],t),t})(),Yu=class{connector;static fToken=Symbol("CalculateConnectableSideByInternalPositionRequest");constructor(n){this.connector=n}},Xu=class{fComponent;static fToken=Symbol("AddDndToStoreRequest");constructor(n){this.fComponent=n}},qA=(()=>{let t=class td{_store=u(N);handle(e){this._store.fDraggable=e.fComponent}static \u0275fac=function(i){return new(i||td)};static \u0275prov=C({token:td,factory:td.\u0275fac})};return t=S([I(Xu)],t),t})(),Zu=class{event;static fToken=Symbol("OnPointerMoveRequest");constructor(n){this.event=n}},VA=(()=>{let t=class nd{_mediator=u(R);_store=u(N);get _hostElement(){return this._store.fDraggable?.hostElement}_dragContext=u(te);handle({event:e}){this._dragContext.rememberPointerEvent(e),this._setDifferenceToDraggableItems(this._getDifferenceBetweenPointerAndPointerDown(e),e),this._mediator.execute(new Wo)}_setDifferenceToDraggableItems(e,i){this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(ae({},e),i)})}_getDifferenceBetweenPointerAndPointerDown(e){return this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition)}_getPointerPositionInCanvas(e){return ee.fromPoint(e.getPosition()).elementTransform(this._hostElement)}static \u0275fac=function(i){return new(i||nd)};static \u0275prov=C({token:nd,factory:nd.\u0275fac})};return t=S([I(Zu)],t),t})(),Qu=class{static fToken=Symbol("InitializeDragSequenceRequest")},GA=(()=>{let t=class id{_dragContext=u(te);handle(e){this._dragContext.reset()}static \u0275fac=function(i){return new(i||id)};static \u0275prov=C({token:id,factory:id.\u0275fac})};return t=S([I(Qu)],t),t})(),Pn=class{static fToken=Symbol("IsDragStartedRequest")},HA=(()=>{let t=class od{_store=u(N);handle(e){return!!this._store.fDraggable?.isDragStarted}static \u0275fac=function(i){return new(i||od)};static \u0275prov=C({token:od,factory:od.\u0275fac})};return t=S([I(Pn)],t),t})(),Ju=class{static fToken=Symbol("PrepareDragSequenceRequest")},jA=(()=>{let t=class rd{_mediator=u(R);_dragContext=u(te);handle(e){this._callPrepareDragSequence(),this._mediator.execute(new zl)}_callPrepareDragSequence(){this._dragContext.draggableItems.forEach(e=>e.prepareDragSequence?.())}static \u0275fac=function(i){return new(i||rd)};static \u0275prov=C({token:rd,factory:rd.\u0275fac})};return t=S([I(Ju)],t),t})(),ef=class{static fToken=Symbol("RemoveDndFromStoreRequest")},UA=(()=>{let t=class ad{_store=u(N);handle(e){this._store.fDraggable=void 0}static \u0275fac=function(i){return new(i||ad)};static \u0275prov=C({token:ad,factory:ad.\u0275fac})};return t=S([I(ef)],t),t})(),WA=[qA,VA,GA,jA,HA,UA],$A=new he("CONNECTABLE_SIDE_EPSILON"),KA=(()=>{let t=class sd{_mediator=u(R);_lastSide=new WeakMap;_epsilon=Math.max(0,u($A,{optional:!0})??2);handle({connector:e}){if(this._isDragging()){let o=this._lastSide.get(e);if(o!==void 0)return o;let r=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,r),r}let i=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,i),i}_getSideByDelta(e,i,o){let r=W.fromElement(e),a=i.getBoundingClientRect(),s=r.gravityCenter.x,c=r.gravityCenter.y,d=s-a.left,f=a.right-s,h=c-a.top,v=a.bottom-c,b=0,w=d,T=[d,f,h,v];for(let A=1;A<4;A++){let V=T[A];V<w&&(w=V,b=A)}let k=b===0?z.LEFT:b===1?z.RIGHT:b===2?z.TOP:z.BOTTOM,O=this._lastSide.get(o);if(O!==void 0&&O!==k){let A=O===z.LEFT?0:O===z.RIGHT?1:O===z.TOP?2:3;(A===0?d:A===1?f:A===2?h:v)-w<=this._epsilon&&(k=O)}return k}_isDragging(){return this._mediator.execute(new Pn)}static \u0275fac=function(i){return new(i||sd)};static \u0275prov=C({token:sd,factory:sd.\u0275fac})};return t=S([I(Yu)],t),t})(),Qi=class{nodeOrGroup;static fToken=Symbol("CalculateConnectorsConnectableSidesRequest");constructor(n){this.nodeOrGroup=n}},YA=(()=>{let t=class cd{_mediator=u(R);handle({nodeOrGroup:e}){let i=e.connectors,o=i.length;for(let a=0;a<o;a++){let s=i[a];s.fConnectableSide=this._resolveSideForConnectorFast(s)}let r=new Set;for(let a=0;a<o;a++){let c=i[a].toConnector;if(c&&c.length)for(let d=0,f=c.length;d<f;d++){let h=c[d],v=h.userFConnectableSide;Ku(v)&&r.add(h)}}r.size>0&&r.forEach(a=>{a.fConnectableSide=this._calculateByConnectedPositions(a)})}_resolveSideForConnectorFast(e){let i=e.userFConnectableSide;return i===z.AUTO?this._mediator.execute(new Yu(e)):Ku(i)?this._calculateByConnectedPositions(e):i}_calculateByConnectedPositions(e){return this._mediator.execute(new Zi(e))}static \u0275fac=function(i){return new(i||cd)};static \u0275prov=C({token:cd,factory:cd.\u0275fac})};return t=S([I(Qi)],t),t})(),Ji=class{static fToken=Symbol("CalculateNodesBoundingBoxRequest")},XA=(()=>{let t=class dd{_store=u(N);handle(e){return W.union(this._nodesRects())}_nodesRects(){return this._store.nodes.getAll().map(e=>W.fromElement(e.hostElement))}static \u0275fac=function(i){return new(i||dd)};static \u0275prov=C({token:dd,factory:dd.\u0275fac})};return t=S([I(Ji)],t),t})(),tf=class{fNodes;static fToken=Symbol("CalculateNodesBoundingBoxNormalizedPositionRequest");constructor(n){this.fNodes=n}},ZA=(()=>{let t=class ld{_store=u(N);_mediator=u(R);handle(e){return W.union(this._getNodesRects(e.fNodes||this._store.nodes.getAll()))}_getNodesRects(e){return e.map(i=>this._getNodeRect(i))}_getNodeRect(e){let i=this._mediator.execute(new Yi(e.hostElement));if(i)return this._getElementRect(e,i);let o=this._mediator.execute(new qe(e.hostElement));return this._getElementRect(e,o)}_getElementRect(e,i){return W.initialize(e._position.x,e._position.y,i.width,i.height)}static \u0275fac=function(i){return new(i||ld)};static \u0275prov=C({token:ld,factory:ld.\u0275fac})};return t=S([I(tf)],t),t})(),nf=class{nodeOrGroup;static fToken=Symbol("CalculateOutputConnectionsRequest");constructor(n){this.nodeOrGroup=n}},QA=(()=>{let t=class ud{_store=u(N);handle({nodeOrGroup:e}){let i=this._collectOutputIds(e);return this._collectConnections(i)}_collectOutputIds(e){let i=new Set,o=this._store.outputs.getAll();for(let r of o)e.isContains(r.hostElement)&&i.add(r.fId());return i}_collectConnections(e){let i=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fOutputId())&&i.push(r);return i}static \u0275fac=function(i){return new(i||ud)};static \u0275prov=C({token:ud,factory:ud.\u0275fac})};return t=S([I(nf)],t),t})(),cr=class{nodeOrGroup;static fToken=Symbol("FitToChildNodesAndGroupsRequest");constructor(n){this.nodeOrGroup=n}},ii=class{fNode;rect;static fToken=Symbol("GetNodePaddingRequest");constructor(n,e){this.fNode=n,this.rect=e}},JA=(()=>{let t=class fd{_browser=u(je);handle(e){return e.fNode.fIncludePadding()?this._getPaddingData(e.fNode,e.rect):[0,0,0,0]}_getPaddingData(e,i){let o=this._browser.window.getComputedStyle(e.hostElement);return[this._browser.toPixels(o.paddingLeft,i.width,i.height,o.fontSize),this._browser.toPixels(o.paddingTop,i.width,i.height,o.fontSize),this._browser.toPixels(o.paddingRight,i.width,i.height,o.fontSize),this._browser.toPixels(o.paddingBottom,i.width,i.height,o.fontSize)]}static \u0275fac=function(i){return new(i||fd)};static \u0275prov=C({token:fd,factory:fd.\u0275fac})};return t=S([I(ii)],t),t})(),eF=(()=>{let t=class pd{_mediator=u(R);_store=u(N);get _nodes(){return this._store.nodes.getAll()}handle({nodeOrGroup:e}){if(e.fAutoSizeToFitChildren()){let r=this._calculateDirectChildren(e);if(r.length){let a=this._boundingRect(e),s=this._calculateChildrenBounding(r,this._paddings(e,a));e.updatePosition(s),e.updateSize(s),e.redraw()}}let i=e.fParentId();if(!i)return;let o=this._nodes.find(r=>r.fId()===i);o&&this._mediator.execute(new cr(o))}_calculateDirectChildren(e){return this._nodes.filter(i=>i.fParentId()===e.fId())}_unionRect(e){return W.union(e.map(i=>this._boundingRect(i)))||W.initialize()}_boundingRect(e){return this._mediator.execute(new qe(e.hostElement))}_paddings(e,i){return this._mediator.execute(new ii(e,i))}_calculateChildrenBounding(e,[i,o,r,a]){let s=this._unionRect(e);return s=W.initialize(s.x-i,s.y-o,s.width+i+r,s.height+o+a),s}static \u0275fac=function(i){return new(i||pd)};static \u0275prov=C({token:pd,factory:pd.\u0275fac})};return t=S([I(cr)],t),t})(),of=class{id;static fToken=Symbol("GetChildNodeIdsRequest");constructor(n){this.id=n}},tF=(()=>{let t=class hd{_store=u(N);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle(e){if(!e.id)return[];let i=new Set,o=[];return this._collectDescendants(e.id,o,i),o}_collectDescendants(e,i,o){if(o.has(e))throw new Error(`Circular reference detected in the node hierarchy. Node id: ${e}`);o.add(e);let r=this._allNodesAndGroups.filter(a=>a.fParentId()===e).map(a=>a.fId());i.push(...r);for(let a of r)this._collectDescendants(a,i,o)}static \u0275fac=function(i){return new(i||hd)};static \u0275prov=C({token:hd,factory:hd.\u0275fac})};return t=S([I(of)],t),t})(),eo=class{nodeOrGroup;static fToken=Symbol("GetParentNodesRequest");constructor(n){this.nodeOrGroup=n}},nF=(()=>{let t=class md{_store=u(N);handle({nodeOrGroup:e}){return this._getParentNodes(e,new Set,[])}_getParentNodes(e,i,o){if(i.has(e.fId()))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e.fId());i.add(e.fId());let r=this._store.nodes.get(e.fParentId());return r?(o.push(r),this._getParentNodes(r,i,o)):o}static \u0275fac=function(i){return new(i||md)};static \u0275prov=C({token:md,factory:md.\u0275fac})};return t=S([I(eo)],t),t})(),dr=class{nodeOrGroup;destroyRef;static fToken=Symbol("UpdateNodeWhenStateOrSizeChangedRequest");constructor(n,e){this.nodeOrGroup=n,this.destroyRef=e}},iF=(()=>{let t=class gd{_mediator=u(R);handle({nodeOrGroup:e,destroyRef:i}){let{hostElement:o,stateChanges:r}=e;new Vt(new Th(o),r).listen(i,()=>{this._mediator.execute(new Xn),this._isDragging()||(this._mediator.execute(new Ki(e.fId(),"UpdateNodeWhenStateOrSizeChanged")),this._mediator.execute(new Qi(e)),this._mediator.execute(new cr(e)))})}_isDragging(){return this._mediator.execute(new Pn)}static \u0275fac=function(i){return new(i||gd)};static \u0275prov=C({token:gd,factory:gd.\u0275fac})};return t=S([I(dr)],t),t})(),lr=class{instance;static fToken=Symbol("RemoveNodeFromStoreRequest");constructor(n){this.instance=n}},oF=(()=>{let t=class _d{_store=u(N);_mediator=u(R);handle({instance:e}){this._store.nodes.remove(e),this._mediator.execute(new Cl(e.fId())),this._store.emitNodeChanges()}static \u0275fac=function(i){return new(i||_d)};static \u0275prov=C({token:_d,factory:_d.\u0275fac})};return t=S([I(lr)],t),t})(),rF=[DA,zA,KA,OA,YA,XA,ZA,QA,eF,tF,JA,nF,iF,oF],aF=(()=>{let t=class yd{_mediator=u(R);_store=u(N);get _targets(){return this._store.inputs.getAll()}handle({source:e,pointer:i}){let o=this._getConnectableTargets(e),r=[];for(let a of o)r.push(this._mediator.execute(new vt(a)));return this._scheduleApplyCalculatedSides(r,i),r}_getConnectableTargets(e){if(e.hasConnectionLimits)return this._targets.filter(o=>e.canConnectTo(o));let i=this._targets.filter(o=>o.canBeConnected);return e.isSelfConnectable||(i=i.filter(o=>o.fNodeId!==e.fNodeId)),i}_scheduleApplyCalculatedSides(e,i){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,i))}_applyCalculatedConnectableSides(e,i){for(let{connector:o}of e)Ku(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,i))}_calculateByConnectedPositions(e,i){return this._mediator.execute(new Zi(e,i))}static \u0275fac=function(i){return new(i||yd)};static \u0275prov=C({token:yd,factory:yd.\u0275fac})};return t=S([I(ar)],t),t})(),rf=class{target;pointer;static fToken=Symbol("CalculateSourceConnectorsToConnectRequest");constructor(n,e){this.target=n,this.pointer=e}},sF=(()=>{let t=class vd{_mediator=u(R);_store=u(N);get _sources(){return this._store.outputs.getAll()}handle({target:e,pointer:i}){let o=this._getConnectableSources(e),r=[];for(let a of o)r.push(this._mediator.execute(new vt(a)));return this._scheduleApplyCalculatedSides(r,i),r}_getConnectableSources(e){return this._sources.filter(i=>{let o=i.canBeConnected;return o&&i.hasConnectionLimits&&(o=i.canConnectTo(e)),o})}_scheduleApplyCalculatedSides(e,i){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,i))}_applyCalculatedConnectableSides(e,i){for(let{connector:o}of e)Ku(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,i))}_calculateByConnectedPositions(e,i){return this._mediator.execute(new Zi(e,i))}static \u0275fac=function(i){return new(i||vd)};static \u0275prov=C({token:vd,factory:vd.\u0275fac})};return t=S([I(rf)],t),t})(),to=class{connectors;static fToken=Symbol("MarkConnectableConnectorsRequest");constructor(n){this.connectors=n}},$e={DRAG_AND_DROP:{DRAGGING:"f-dragging",CONNECTIONS_DRAGGING:"f-connections-dragging"},GROUPING:{OVER_BOUNDARY:"f-grouping-over-boundary",DROP_ACTIVE:"f-grouping-drop-active"},CONNECTOR:{OUTPUT_CONNECTED:"f-node-output-connected",OUTPUT_NOT_CONNECTABLE:"f-node-output-not-connectable",INPUT_CONNECTED:"f-node-input-connected",INPUT_NOT_CONNECTABLE:"f-node-input-not-connectable",CONNECTABLE:"f-connector-connectable"}},cF=(()=>{let t=class Cd{_store=u(N);handle({connectors:e}){this._store.flowHost.classList.add($e.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(i=>this._markConnector(i))}_markConnector({hostElement:e}){e.classList.add($e.CONNECTOR.CONNECTABLE)}static \u0275fac=function(i){return new(i||Cd)};static \u0275prov=C({token:Cd,factory:Cd.\u0275fac})};return t=S([I(to)],t),t})(),ur=class{instance;static fToken=Symbol("RemoveConnectorFromStoreRequest");constructor(n){this.instance=n}},dF=(()=>{let t=class xd{_store=u(N);_mediator=u(R);handle({instance:e}){switch(e.kind){case"input":this._removeInput(e);break;case"output":this._removeOutput(e);break;case"outlet":this._removeOutlet(e);break;default:throw new Error(`Unknown connector kind: ${e.kind}`)}}_removeInput(e){this._store.inputs.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_removeOutput(e){this._store.outputs.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_removeOutlet(e){this._store.outlets.removeById(e.fId()),this._store.emitNodeChanges(),this._geometryUnregister(e)}_geometryUnregister(e){this._mediator.execute(new Fo(e.fId(),e.kind))}static \u0275fac=function(i){return new(i||xd)};static \u0275prov=C({token:xd,factory:xd.\u0275fac})};return t=S([I(ur)],t),t})(),no=class{connectors;static fToken=Symbol("UnmarkConnectableConnectorsRequest");constructor(n){this.connectors=n}},lF=(()=>{let t=class bd{_store=u(N);handle({connectors:e}){this._store.flowHost.classList.remove($e.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(i=>this._unmarkConnector(i))}_unmarkConnector({hostElement:e}){e.classList.remove($e.CONNECTOR.CONNECTABLE)}static \u0275fac=function(i){return new(i||bd)};static \u0275prov=C({token:bd,factory:bd.\u0275fac})};return t=S([I(no)],t),t})(),uF=[EA,dF,PA,MA,sF,aF,kA,cF,lF],af=class{instance;static fToken=Symbol("AddFlowToStoreRequest");constructor(n){this.instance=n}},ai=(function(t){return t.TOP_BOTTOM="TOP_BOTTOM",t.BOTTOM_TOP="BOTTOM_TOP",t.LEFT_RIGHT="LEFT_RIGHT",t.RIGHT_LEFT="RIGHT_LEFT",t})(ai||{}),yn=(function(t){return t.MANUAL="manual",t.AUTO="auto",t})(yn||{});function fF(t){let n=[...t.nodes.map(ay),...t.groups.map(ay)],e=new Set(t.nodes.map(s=>s.id)),i=new Set(t.groups.map(s=>s.id)),o=new Map,r=new Map;for(let s of[...t.nodes,...t.groups]){for(let c of s.fOutputs)o.set(c.id,s.id);for(let c of s.fInputs)r.set(c.id,s.id)}let a=t.connections.reduce((s,c)=>{let d=o.get(c.fOutputId),f=r.get(c.fInputId);return!d||!f||s.push({source:d,target:f}),s},[]);return{nodes:n,connections:a,nodeIds:e,groupIds:i}}function ay(t){return{id:t.id,size:t.measuredSize?ae({},t.measuredSize):t.size?ae({},t.size):void 0}}var pF=1,Ff=(()=>{class t{_destroyRef=u(rt);_flows=new Map;_engine;constructor(){this._destroyRef.onDestroy(()=>{Array.from(this._flows.keys()).forEach(e=>this.unregisterFlow(e)),this._engine=void 0})}attachEngine(e){this._engine=e}registerFlow(e,i){let o=e.fId();this.unregisterFlow(o);let r={flow:e,store:i,nodeSignature:this._buildNodeSignature(i),connectionSignature:this._buildConnectionSignature(i),timeoutId:null,raf1:null,raf2:null,unsubs:[],runId:0,isApplying:!1};r.unsubs.push(i.nodesChanges$.listen(()=>this._handleNodesChanges(o)),i.connectionsChanges$.listen(()=>this._handleConnectionsChanges(o))),this._flows.set(o,r),this._engine?.getMode()===yn.AUTO&&this._scheduleRelayout(o)}unregisterFlow(e){let i=this._flows.get(e);i&&(i.unsubs.forEach(o=>o()),this._clearScheduledWork(i),this._flows.delete(e))}handleModeChanged(e){if(e===yn.AUTO)for(let i of this._flows.keys())this._scheduleRelayout(i)}async relayout(e){if(this._engine){if(e){let i=this._flows.get(e);i&&await this._relayoutRegisteredFlow(e,i);return}for(let[i,o]of this._flows.entries())await this._relayoutRegisteredFlow(i,o)}}_handleNodesChanges(e){let i=this._flows.get(e);if(!i||i.isApplying)return;let o=this._buildNodeSignature(i.store);o!==i.nodeSignature&&(i.nodeSignature=o,this._scheduleRelayout(e))}_handleConnectionsChanges(e){let i=this._flows.get(e);if(!i||i.isApplying)return;let o=this._buildConnectionSignature(i.store);o!==i.connectionSignature&&(i.connectionSignature=o,this._scheduleRelayout(e))}_scheduleRelayout(e){let i=this._flows.get(e);!i||!this._engine||this._engine.getMode()!==yn.AUTO||(i.timeoutId!==null&&clearTimeout(i.timeoutId),this._cancelAnimationFrames(i),i.timeoutId=setTimeout(()=>{i.timeoutId=null,this._runAfterNextPaint(i,()=>{this._relayoutFlowIfReady(e)})},pF))}async _relayoutFlowIfReady(e){let i=this._flows.get(e);if(!(!i||!this._engine||this._engine.getMode()!==yn.AUTO)){if(i.store.hasPendingProgressiveRender){this._scheduleRelayout(e);return}await this._relayoutRegisteredFlow(e,i)}}async _relayoutRegisteredFlow(e,i){if(!this._engine)return;let o=fF(i.flow.getState({measuredSize:!0})),r=++i.runId,a=await this._engine.calculate(o.nodes,o.connections,{flowId:e,mode:this._engine.getMode()}),s=this._flows.get(e);if(!(!s||s.runId!==r||!this._applyPositions(s.store,a.nodes).length)){s.isApplying=!0;try{s.flow.redraw(),this._emitWriteback(e,a.nodes,o.nodeIds,o.groupIds)}finally{queueMicrotask(()=>{let d=this._flows.get(e);d&&(d.isApplying=!1)})}}}_emitWriteback(e,i,o,r){let a=this._engine?.getWriteback();a&&a({flowId:e,nodes:i.filter(s=>o.has(s.id)),groups:i.filter(s=>r.has(s.id))})}_applyPositions(e,i){return i.filter(o=>{let r=e.nodes.get(o.id);return!r||B.isEqual(r._position,o.position)?!1:(r.position.set(ae({},o.position)),!0)})}_buildNodeSignature(e){return e.nodes.getAll().map(i=>i.fId()).sort().join("|")}_buildConnectionSignature(e){return e.connections.getAll().map(i=>`${i.fId()}:${i.fOutputId()}:${i.fInputId()}`).sort().join("|")}_runAfterNextPaint(e,i){if(this._cancelAnimationFrames(e),typeof requestAnimationFrame!="function"){i();return}e.raf1=requestAnimationFrame(()=>{e.raf1=null,e.raf2=requestAnimationFrame(()=>{e.raf2=null,i()})})}_clearScheduledWork(e){e.timeoutId!==null&&(clearTimeout(e.timeoutId),e.timeoutId=null),this._cancelAnimationFrames(e)}_cancelAnimationFrames(e){e.raf1!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(e.raf1),e.raf1=null),e.raf2!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(e.raf2),e.raf2=null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),Wy=new he("F_LAYOUT_OPTIONS");function $y(t,n){return t.reduce((e,i)=>{let o=n.get(i.id);return o&&e.push({id:i.id,position:o}),e},[])}var hF=new he("F_LAYOUT"),sf=class{_controller=u(Ff);_config=u(Wy,{optional:!0})??{};_interactiveOptions;_mode;_writeback;_defaultOptions;interactiveOptions;constructor(n){this._mode=this._config.mode??yn.MANUAL,this._writeback=this._config.writeback??null,this._defaultOptions=this.mergeOptions(n,this._config.options),this._interactiveOptions=j(this.mergeOptions(this._defaultOptions,{})),this.interactiveOptions=D(()=>this.mergeOptions(this._interactiveOptions(),{})),this._controller.attachEngine(this)}setMode(n){this._mode=n,this._controller.handleModeChanged(n)}getMode(){return this._mode}setWriteback(n){this._writeback=n}getWriteback(){return this._writeback}setInteractiveOptions(n){this._interactiveOptions.set(this.mergeOptions(this._interactiveOptions(),n))}relayout(n){return this._controller.relayout(n)}getProviderConfig(){return ae({},this._config)}resolveLayoutOptions(n){let e=ae({},n??{});return delete e.flowId,delete e.mode,this.mergeOptions(this._interactiveOptions(),e)}};function Ky(t,n){return[Ff,t,{provide:hF,useExisting:t},{provide:Wy,useValue:n??{}}]}var mF=(()=>{let t=class wd{_store=u(N);_layoutController=u(Ff,{optional:!0});handle({instance:e}){this._store.fFlow=e,this._layoutController?.registerFlow(e,this._store)}static \u0275fac=function(i){return new(i||wd)};static \u0275prov=C({token:wd,factory:wd.\u0275fac})};return t=S([I(af)],t),t})(),cf=class{static fToken=Symbol("GetFlowRequest")},gF=(()=>{let t=class Sd{_store=u(N);handle(e){let i=this._store.fFlow;if(!i)throw new Error("Flow not found in store");return i}static \u0275fac=function(i){return new(i||Sd)};static \u0275prov=C({token:Sd,factory:Sd.\u0275fac})};return t=S([I(cf)],t),t})(),df=class{static fToken=Symbol("CalculateConnectionsStateRequest")},_F=(()=>{let t=class Id{_store=u(N);handle(e){return this._store.connections.getAll().map(this._mapToConnectionState)}_mapToConnectionState(e){return{id:e.fId(),fOutputId:e.fOutputId(),fInputId:e.fInputId(),fType:e.fType,fBehavior:e.fBehavior,isSelected:e.isSelected(),waypoints:e.fWaypoints()?.waypoints()||[],fInputSide:e.fInputSide(),fOutputSide:e.fOutputSide()}}static \u0275fac=function(i){return new(i||Id)};static \u0275prov=C({token:Id,factory:Id.\u0275fac})};return t=S([I(df)],t),t})(),fr=class{component;measuredSize;static fToken=Symbol("CalculateNodesStateRequest");constructor(n,e=!1){this.component=n,this.measuredSize=e}},yF=(()=>{let t=class Td{_store=u(N);_mediator=u(R);handle({component:e,measuredSize:i}){return this._store.nodes.getAll().filter(o=>o instanceof e).map(o=>{let r=i?this._mediator.execute(new qe(o.hostElement)):null;return{id:o.fId(),parentId:o.fParentId()??void 0,position:ae({},o._position),size:o._size?ae({},o._size):void 0,measuredSize:r?{width:r.width,height:r.height}:void 0,rotate:o._rotate,fOutputs:this._getOutputs(o.hostElement),fInputs:this._getInputs(o.hostElement),isSelected:o.isSelected()}})}_getOutputs(e){return this._store.outputs.getAll().filter(i=>e.contains(i.hostElement)).map(i=>({id:i.fId(),fConnectableSide:i.fConnectableSide}))}_getInputs(e){return this._store.inputs.getAll().filter(i=>e.contains(i.hostElement)).map(i=>({id:i.fId(),fConnectableSide:i.fConnectableSide}))}static \u0275fac=function(i){return new(i||Td)};static \u0275prov=C({token:Td,factory:Td.\u0275fac})};return t=S([I(fr)],t),t})(),lf=class{measuredSize;static fToken=Symbol("CalculateFlowStateRequest");constructor(n=!1){this.measuredSize=n}},vF=(()=>{let t=class Ed{_mediator=u(R);_store=u(N);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _canvasPosition(){return B.sum(this._transform.position,this._transform.scaledPosition)}handle({measuredSize:e}){return{position:this._canvasPosition,scale:this._canvas.transform.scale,nodes:this._mediator.execute(new fr(Af,e)),groups:this._mediator.execute(new fr(im,e)),connections:this._mediator.execute(new df)}}static \u0275fac=function(i){return new(i||Ed)};static \u0275prov=C({token:Ed,factory:Ed.\u0275fac})};return t=S([I(lf)],t),t})(),CF=[vF,yF,_F],uf=class{instance;static fToken=Symbol("RemoveFlowFromStoreRequest");constructor(n){this.instance=n}},xF=(()=>{let t=class Pd{_store=u(N);_layoutController=u(Ff,{optional:!0});handle({instance:e}){this._layoutController?.unregisterFlow(e.fId()),this._store.fFlow=void 0}static \u0275fac=function(i){return new(i||Pd)};static \u0275prov=C({token:Pd,factory:Pd.\u0275fac})};return t=S([I(uf)],t),t})(),Lf=(()=>{class t{isNodesRendered=!1;isFullRendered=!1;static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),ff=class{static fToken=Symbol("NotifyNodesRenderedRequest")},Bm=new he("F_FLOW"),Nm=class{},bF=(()=>{let t=class Md{_state=u(Lf);_fFlow=u(Bm);handle(e){this._state.isNodesRendered||(this._state.isNodesRendered=!0,this._fFlow.fNodesRendered.emit(this._fFlow.fId()))}static \u0275fac=function(i){return new(i||Md)};static \u0275prov=C({token:Md,factory:Md.\u0275fac})};return t=S([I(ff)],t),t})(),pf=class{static fToken=Symbol("NotifyFullRenderedRequest")},wF=(()=>{let t=class kd{_state=u(Lf);_fFlow=u(Bm);handle(e){this._state.isFullRendered||(this._state.isFullRendered=!0,this._fFlow.fFullRendered.emit(this._fFlow.fId()),this._fFlow.fLoaded.emit(this._fFlow.fId()))}static \u0275fac=function(i){return new(i||kd)};static \u0275prov=C({token:kd,factory:kd.\u0275fac})};return t=S([I(pf)],t),t})(),pr=class{targetConnectionsRevision;targetNodesRevision;callback;destroyRef;static fToken=Symbol("WaitForConnectionsRenderedRequest");constructor(n,e,i,o){this.targetConnectionsRevision=n,this.targetNodesRevision=e,this.callback=i,this.destroyRef=o}},SF=(()=>{let t=class Dd{_store=u(N);handle({targetConnectionsRevision:e,targetNodesRevision:i,callback:o,destroyRef:r}){if(this._store.connectionsRenderedRevision>=e&&this._store.connectionsRenderedNodesRevision>=i){o();return}let a=this._store.connectionsRenderedChanges$.listen(()=>{this._store.connectionsRenderedRevision<e||this._store.connectionsRenderedNodesRevision<i||(a(),o())});r.onDestroy(a)}static \u0275fac=function(i){return new(i||Dd)};static \u0275prov=C({token:Dd,factory:Dd.\u0275fac})};return t=S([I(pr)],t),t})(),hf=class{static fToken=Symbol("ResetRenderLifecycleRequest")},IF=(()=>{let t=class Od{_state=u(Lf);handle(e){this._state.isNodesRendered=!1,this._state.isFullRendered=!1}static \u0275fac=function(i){return new(i||Od)};static \u0275prov=C({token:Od,factory:Od.\u0275fac})};return t=S([I(hf)],t),t})(),mf=class{destroyRef;static fToken=Symbol("QueueConnectionRedrawRequest");constructor(n){this.destroyRef=n}},Yy=(()=>{class t{isWaitingForViewportAnimation=!1;pendingRedraw=!1;static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})(),TF=(()=>{let t=class Nd{_state=u(Yy);_store=u(N);_mediator=u(R);handle(e){if(this._state.pendingRedraw=!0,this._state.isWaitingForViewportAnimation)return;this._state.isWaitingForViewportAnimation=!0;let i=this._store.viewportAnimationChanges$.listen(()=>{if(this._store.isViewportAnimating)return;let o=this._state.pendingRedraw;i(),this._state.isWaitingForViewportAnimation=!1,this._state.pendingRedraw=!1,o&&this._mediator.execute(new Go)});e.destroyRef.onDestroy(i)}static \u0275fac=function(i){return new(i||Nd)};static \u0275prov=C({token:Nd,factory:Nd.\u0275fac})};return t=S([I(mf)],t),t})(),EF=[mF,gF,...CF,xF,Lf,bF,wF,SF,IF,Yy,TF],gf=class{static fToken=Symbol("ClearSelectionRequest")},PF=(()=>{let t=class Rd{_dragContext=u(te);handle(e){this._dragContext.selectedItems.forEach(i=>i.unmarkAsSelected()),this._dragContext.selectedItems=[],this._dragContext.isSelectedChanged=!0}static \u0275fac=function(i){return new(i||Rd)};static \u0275prov=C({token:Rd,factory:Rd.\u0275fac})};return t=S([I(gf)],t),t})(),_f=class{static fToken=Symbol("CalculateSelectableItemsRequest")},MF=(()=>{let t=class Ad{_mediator=u(R);_store=u(N);_dragContext=u(te);get _nodes(){return this._store.nodes.getAll()}get _connections(){return this._store.connections.getAll()}handle(){return[...this._nodeRects(),...this._connectionRects()].filter(e=>!this._dragContext.selectedItems.includes(e.element))}_nodeRects(){return this._nodes.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new qe(e.hostElement))}))}_connectionRects(){return this._connections.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new qe(e.boundingElement))}))}static \u0275fac=function(i){return new(i||Ad)};static \u0275prov=C({token:Ad,factory:Ad.\u0275fac})};return t=S([I(_f)],t),t})(),hr=class{static fToken=Symbol("GetCurrentSelectionRequest")},kF=(()=>{let t=class Fd{_dragContext=u(te);handle(){return{fNodeIds:this._getSelectedNodes(),fGroupIds:this._getSelectedGroups(),fConnectionIds:this._getSelectedConnections()}}_getSelectedNodes(){return this._dragContext.selectedItems.filter(e=>e.hostElement.classList.contains("f-node")).map(e=>e.hostElement.dataset.fNodeId)}_getSelectedGroups(){return this._dragContext.selectedItems.filter(e=>e.hostElement.classList.contains("f-group")).map(e=>e.hostElement.dataset.fGroupId)}_getSelectedConnections(){return this._dragContext.selectedItems.filter(e=>!e.hostElement.classList.contains("f-node")&&!e.hostElement.classList.contains("f-group")).map(e=>e.hostElement.id)}static \u0275fac=function(i){return new(i||Fd)};static \u0275prov=C({token:Fd,factory:Fd.\u0275fac})};return t=S([I(hr)],t),t})(),yf=class{nodes;connections;isSelectedChanged;static fToken=Symbol("SelectRequest");constructor(n,e,i=!0){this.nodes=n,this.connections=e,this.isSelectedChanged=i}},DF=(()=>{let t=class Ld{_dragContext=u(te);_store=u(N);handle(e){this._dragContext.selectedItems.forEach(i=>{i.unmarkAsSelected()}),this._dragContext.selectedItems=[],e.nodes.forEach(i=>{let o=this._store.nodes.get(i);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),e.connections.forEach(i=>{let o=this._store.connections.get(i);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),this._dragContext.isSelectedChanged=e.isSelectedChanged}static \u0275fac=function(i){return new(i||Ld)};static \u0275prov=C({token:Ld,factory:Ld.\u0275fac})};return t=S([I(yf)],t),t})(),vf=class{static fToken=Symbol("SelectAllRequest")},OF=(()=>{let t=class Bd{_dragSession=u(te);_store=u(N);handle(e){this._dragSession.selectedItems.forEach(i=>{i.unmarkAsSelected()}),this._dragSession.selectedItems=[],this._store.nodes.getAll().forEach(i=>{i.markAsSelected(),this._dragSession.selectedItems.push(i)}),this._store.connections.getAll().forEach(i=>{i.markAsSelected(),this._dragSession.selectedItems.push(i)}),this._dragSession.isSelectedChanged=!0}static \u0275fac=function(i){return new(i||Bd)};static \u0275prov=C({token:Bd,factory:Bd.\u0275fac})};return t=S([I(vf)],t),t})(),io=class{nodeOrGroup;static fToken=Symbol("SelectAndUpdateNodeLayerRequest");constructor(n){this.nodeOrGroup=n}},Cf=class{fItemsContainer;allElements;elementsThatShouldBeInFront;targetIndex;static fToken=Symbol("MoveFrontElementsBeforeTargetElementRequest");constructor(n,e,i,o){this.fItemsContainer=n,this.allElements=e,this.elementsThatShouldBeInFront=i,this.targetIndex=o}},NF=(()=>{let t=class zd{handle(e){let i=[];for(let o=e.targetIndex+1;o<e.allElements.length;o++){let r=e.allElements[o];e.elementsThatShouldBeInFront.includes(r)||i.push(r)}i.forEach(o=>{e.fItemsContainer.removeChild(o),e.fItemsContainer.insertBefore(o,e.allElements[e.targetIndex])})}static \u0275fac=function(i){return new(i||zd)};static \u0275prov=C({token:zd,factory:zd.\u0275fac})};return t=S([I(Cf)],t),t})(),oi=class{item;itemContainer;static fToken=Symbol("UpdateItemAndChildrenLayersRequest");constructor(n,e){this.item=n,this.itemContainer=e}},oo=class{nodeOrGroupId;static fToken=Symbol("GetDeepChildrenNodesAndGroupsRequest");constructor(n){this.nodeOrGroupId=n}},RF=(()=>{let t=class qd{_store=u(N);handle({nodeOrGroupId:e}){return this._getChildrenNodes(e)}_getChildrenNodes(e,i=new Set){if(i.has(e))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e);i.add(e);let o=this._store.nodes.getAll().filter(r=>r.fParentId()===e);return o.reduce((r,a)=>r.concat(this._getChildrenNodes(a.fId(),i)),o)}static \u0275fac=function(i){return new(i||qd)};static \u0275prov=C({token:qd,factory:qd.\u0275fac})};return t=S([I(oo)],t),t})(),AF=(()=>{let t=class Vd{_store=u(N);_mediator=u(R);get _canvas(){return this._store.fCanvas}get _groupsContainer(){return this._canvas.fGroupsContainer().nativeElement}get _nodesContainer(){return this._canvas.fNodesContainer().nativeElement}get _connectionsContainer(){return this._canvas.fConnectionsContainer().nativeElement}handle(e){switch(e.itemContainer){case this._groupsContainer:this._handleGroup(e);break;case this._nodesContainer:this._handleNode(e);break;case this._connectionsContainer:this._handleConnection(e);break;default:throw new Error("Unknown container")}}_handleGroup(e){let i=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenGroups(i);this._updateLayers(this._groupsContainer,e.item.hostElement,o);let r=this._getChildrenNodes(i);r.length&&this._updateLayers(this._nodesContainer,r[0],r)}_handleNode(e){let i=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenNodes(i);this._updateLayers(e.itemContainer,e.item.hostElement,o)}_handleConnection(e){this._updateLayers(e.itemContainer,e.item.hostElement,[])}_updateLayers(e,i,o){let r=Array.from(e.children),a=r.findIndex(s=>s===i);this._isAnythingNeedToBeMoved(r,a,o)&&this._mediator.execute(new Cf(e,r,o,a))}_isAnythingNeedToBeMoved(e,i,o){for(let r=i+1;r<e.length;r++)if(!o.includes(e[r]))return!0;return!1}_getChildrenGroups(e){let i=Array.from(this._groupsContainer.children);return e.filter(o=>this._groupsContainer.contains(o)).sort((o,r)=>i.indexOf(o)-i.indexOf(r))}_getChildrenNodes(e){let i=Array.from(this._nodesContainer.children);return e.filter(o=>this._nodesContainer.contains(o)).sort((o,r)=>i.indexOf(o)-i.indexOf(r))}_getChildrenNodesAndGroups(e){return this._mediator.execute(new oo(e)).map(i=>i.hostElement)}static \u0275fac=function(i){return new(i||Vd)};static \u0275prov=C({token:Vd,factory:Vd.\u0275fac})};return t=S([I(oi)],t),t})(),FF=(()=>{let t=class Gd{_dragSession=u(te);_mediator=u(R);handle({nodeOrGroup:e}){this._selectNodeIfNotSelected(e),this._mediator.execute(new oi(e,e.hostElement.parentElement))}_selectNodeIfNotSelected(e){e.fSelectionDisabled()||this._dragSession.selectedItems.includes(e)||(this._dragSession.selectedItems.push(e),e.markAsSelected(),this._dragSession.isSelectedChanged=!0)}static \u0275fac=function(i){return new(i||Gd)};static \u0275prov=C({token:Gd,factory:Gd.\u0275fac})};return t=S([I(io)],t),t})(),LF=[PF,MF,kF,DF,OF,FF],xf=class{static fToken=Symbol("ResetZoomRequest")},BF=(()=>{let t=class Hd{_store=u(N);get _canvas(){return this._store.fCanvas}handle(e){this._canvas.resetScale(),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=function(i){return new(i||Hd)};static \u0275prov=C({token:Hd,factory:Hd.\u0275fac})};return t=S([I(xf)],t),t})(),bf=class{position;step;direction;animate;static fToken=Symbol("SetZoomRequest");constructor(n,e,i,o=!1){this.position=n,this.step=e,this.direction=i,this.animate=o}},zF=new Set(["drag-node","drag-external-item","resize-node","rotate-node","create-connection","reassign-connection","drag-connection-waypoint","assign-to-container"]),qF=new Set(["drag-canvas","selection-area"]),VF=(()=>{let t=class jd{_mediator=u(R);_store=u(N);_dragContext=u(te,{optional:!0});get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.get(Pe.ZOOM)}get _isDragStarted(){return this._mediator.execute(new Pn)}handle(e){if(!this._zoomComponent)return;let i=this._canvas.transform.scale,o=this._clamp(i+e.step*e.direction);if(o===i)return;let r=this._castPositionToFlow(e.position);if(this._isDragStarted){let a=this._getDragZoomMode();if(a==="blocked")return;a==="rebase"&&this._rebaseDragContext(r,o)}this._canvas.setScale(o,r),e.animate?this._canvas.redrawWithAnimation():this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}_clamp(e){return Math.max(this._zoomComponent?.minimum||1,Math.min(e,this._zoomComponent?.maximum||1))}_castPositionToFlow(e){return ee.fromPoint(e).elementTransform(this._flowHost)}_getDragZoomMode(){if(this._dragContext?.isEmpty())return"blocked";let e=!1;for(let i of this._dragContext?.draggableItems??[]){let o=i.getEvent().kind;if(zF.has(o)){e=!0;continue}if(!qF.has(o))return"blocked"}return e?"rebase":"direct"}_rebaseDragContext(e,i){if(!this._dragContext)return;let o=this._dragContext.onPointerDownScale;if(!o||o===i){this._dragContext.onPointerDownScale=i;return}let r=1/i-1/o;this._dragContext.onPointerDownPosition=ee.fromPoint(this._dragContext.onPointerDownPosition).add(ee.fromPoint(e).mult(r)),this._dragContext.onPointerDownScale=i}static \u0275fac=function(i){return new(i||jd)};static \u0275prov=C({token:jd,factory:jd.\u0275fac})};return t=S([I(bf)],t),t})(),GF=[BF,VF],wf=class{static fToken=Symbol("MinimapDrawNodesRequest")},HF=(()=>{let t=class Ud{_browser=u(je);_store=u(N);handle(e){let i=this._store.fFlow,o=this._store.fCanvas;return!i||!o?[]:this._store.nodes.getAll().map(a=>this._renderNode(a,i,o))}_renderNode(e,i,o){let r=ji("rect",this._browser);dh(this._nodeRect(e,i,o),r);let a=e instanceof Af;return r.classList.add("f-component",a?"f-minimap-node":"f-minimap-group"),r.classList.add(...this._minimapClasses(e)),e.isSelected()&&r.classList.add("f-selected"),r}_nodeRect(e,i,o){let r=W.elementTransform(W.fromElement(e.hostElement),i.hostElement);return W.div(r,o.transform.scale)}_minimapClasses(e){let i=e.fMinimapClass();return Array.isArray(i)?i:[i]}static \u0275fac=function(i){return new(i||Ud)};static \u0275prov=C({token:Ud,factory:Ud.\u0275fac})};return t=S([I(wf)],t),t})(),Sf=class{svg;minSize;static fToken=Symbol("MinimapCalculateViewportRequest");constructor(n,e){this.svg=n,this.minSize=e}},jF=(()=>{let t=class Wd{_mediator=u(R);_store=u(N);handle({svg:e,minSize:i}){let o=this._store.fFlow,r=this._store.fCanvas;if(!o||!r)return{scale:1,viewBox:W.initialize(0,0,0,0)};let a=this._contentRectInMinimapSpace(o,r,i),s=this._minimapRectInFlowSpace(e,o),c=this._viewportScale(a,s),d=this._viewportViewBox(a,s,c);return{scale:c,viewBox:d}}_contentRectInMinimapSpace(e,i,o){let r=this._nodesBoundingBox(),a=W.elementTransform(r,e.hostElement),s=W.div(a,i.transform.scale);return E0(s,o)}_nodesBoundingBox(){return this._mediator.execute(new Ji)??W.initialize(0,0,0,0)}_minimapRectInFlowSpace(e,i){return W.elementTransform(W.fromElement(e),i.hostElement)}_viewportScale(e,i){let o=i.width||1,r=i.height||1;return Math.max(e.width/o,e.height/r)}_viewportViewBox(e,i,o){let r=this._viewportSize(i,o),a=e.x-(r.width-e.width)/2,s=e.y-(r.height-e.height)/2;return W.initialize(a,s,r.width,r.height)}_viewportSize(e,i){return st.initialize(e.width*i||0,e.height*i||0)}static \u0275fac=function(i){return new(i||Wd)};static \u0275prov=C({token:Wd,factory:Wd.\u0275fac})};return t=S([I(Sf)],t),t})(),If=class{static fToken=Symbol("MinimapCalculateViewRectRequest")},UF=(()=>{let t=class $d{_store=u(N);handle(e){let i=this._store.fFlow,o=this._store.fCanvas;if(!i||!o)return W.initialize();let r=W.div(W.fromElement(i.hostElement),o.transform.scale);return r.x=0,r.y=0,r}static \u0275fac=function(i){return new(i||$d)};static \u0275prov=C({token:$d,factory:$d.\u0275fac})};return t=S([I(If)],t),t})(),Tf=class{element;scale;viewBox;constructor(n,e=1,i=W.initialize(0,0,0,0)){this.element=n,this.scale=e,this.viewBox=i}},WF=[HF,jF,UF],Ef=class{position;static fToken=Symbol("GetNormalizedPointRequest");constructor(n){this.position=n}},$F=(()=>{let t=class Kd{_store=u(N);handle({position:e}){return ao(e,this._store.flowHost,this._store.transform)}static \u0275fac=function(i){return new(i||Kd)};static \u0275prov=C({token:Kd,factory:Kd.\u0275fac})};return t=S([I(Ef)],t),t})(),Pf=class{static fToken=Symbol("SortNodeLayersRequest")},KF=(()=>{let t=class Yd{_store=u(N);_mediator=u(R);_browser=u(je);get _canvas(){return this._store.fCanvas}get _groupsContainer(){return this._canvas.fGroupsContainer().nativeElement}get _nodesContainer(){return this._canvas.fNodesContainer().nativeElement}get _fNodeElements(){return Array.from(this._nodesContainer.children)}handle(e){this._getGroups().forEach(i=>{this._moveChildrenNodes(this._getSortedChildrenNodes(i))})}_getGroups(){return this._store.nodes.getAll().filter(e=>this._groupsContainer.contains(e.hostElement))}_getSortedChildrenNodes(e){let i=this._fNodeElements;return this._getChildrenNodes(e.fId()).sort((o,r)=>i.indexOf(o)-i.indexOf(r))}_getChildrenNodes(e){return this._mediator.execute(new oo(e)).filter(i=>this._nodesContainer.contains(i.hostElement)).map(i=>i.hostElement)}_moveChildrenNodes(e){let i=this._browser.document.createDocumentFragment();e.forEach(o=>{i.appendChild(o)}),this._nodesContainer.appendChild(i)}static \u0275fac=function(i){return new(i||Yd)};static \u0275prov=C({token:Yd,factory:Yd.\u0275fac})};return t=S([I(Pf)],t),t})(),mr=class{itemsContainer;static fToken=Symbol("SortItemsByParentRequest");constructor(n){this.itemsContainer=n}},YF=(()=>{let t=class Xd{_store=u(N);_browser=u(je);handle({itemsContainer:e}){let i=Array.from(e.children);if(i.length<2)return;let o=this._buildPositions(i),r=this._store.nodes.getAll().filter(c=>e.contains(c.hostElement));if(r.length<2||!r.some(c=>!!c.fParentId()))return;let a=this._buildChildrenByParentId(r),s=new Map;for(let c of r){let d=this._getSortedChildrenBeforeParent(e,o,c,a,s);d.length&&this._moveBeforeNextSibling(e,d,c.hostElement.nextElementSibling)}}_buildPositions(e){let i=new Map;for(let o=0;o<e.length;o++)i.set(e[o],o);return i}_getSortedChildrenBeforeParent(e,i,o,r,a){let s=i.get(o.hostElement);if(s===void 0)return[];let c=this._getDeepChildren(o.fId(),r,a);if(!c.length)return[];let d=[];for(let f of c){let h=f.hostElement;if(!e.contains(h))continue;let v=i.get(h);v===void 0||v>=s||d.push(h)}return d.sort((f,h)=>(i.get(f)??0)-(i.get(h)??0)),d}_buildChildrenByParentId(e){let i=new Map;for(let o of e){let r=o.fParentId();if(!r)continue;let a=i.get(r)??[];a.push(o),i.set(r,a)}return i}_getDeepChildren(e,i,o){let r=o.get(e);if(r)return r;let a=[],s=[...i.get(e)??[]],c=new Set([e]);for(;s.length;){let d=s.pop();if(!d)continue;let f=d.fId();if(c.has(f))continue;c.add(f),a.push(d);let h=i.get(f);h?.length&&s.push(...h)}return o.set(e,a),a}_moveBeforeNextSibling(e,i,o){let r=this._browser.document.createDocumentFragment();for(let a of i)r.appendChild(a);e.insertBefore(r,o)}static \u0275fac=function(i){return new(i||Xd)};static \u0275prov=C({token:Xd,factory:Xd.\u0275fac})};return t=S([I(mr)],t),t})(),Mf=class{static fToken=Symbol("SortItemLayersRequest")},XF=(()=>{let t=class Zd{_store=u(N);_mediator=u(R);get _canvas(){return this._store.fCanvas}handle(e){if(!this._canvas)return;let i=this._store.nodes.getAll();i.length<2||!i.some(o=>!!o.fParentId())||(this._mediator.execute(new mr(this._canvas.fGroupsContainer().nativeElement)),this._mediator.execute(new Pf),this._mediator.execute(new mr(this._canvas.fNodesContainer().nativeElement)))}static \u0275fac=function(i){return new(i||Zd)};static \u0275prov=C({token:Zd,factory:Zd.\u0275fac})};return t=S([I(Mf)],t),t})();function ji(t,n){return n.document.createElementNS("http://www.w3.org/2000/svg",t)}function Et(t,n){return n(t)}function Nt(t){return!0}function ZF(){return/android|iPad|iPhone|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)}var QF=[...yO,...TA,...sO,...uF,...WA,...EF,...rF,...LF,...GF,...WF,...DN,RF,ON,FN,$F,XF,YF,KF,AF,NF],JF=0,Xy=(()=>{class t{_destroyRef=u(rt);_elementReference=u(Be);_fBrowser=u(je);_stateChanges=new Tt;get hostElement(){return this._elementReference.nativeElement}id=F(`f-pattern-${JF++}`);vColor=F("rgba(0,0,0,0.1)");hColor=F("rgba(0,0,0,0.1)");vSize=F(20,{transform:et});hSize=F(20,{transform:et});_transform=gn.default();_position=B.initialize();_size=st.initialize(this.hSize(),this.vSize());_pattern;_vLine;_hLine;constructor(){this._createPattern()}_createPattern(){this._pattern=ji("pattern",this._fBrowser),this._pattern.setAttribute("patternUnits","userSpaceOnUse"),this.hostElement.appendChild(this._pattern),this._vLine=ji("line",this._fBrowser),this._pattern.appendChild(this._vLine),this._hLine=ji("line",this._fBrowser),this._pattern.appendChild(this._hLine)}ngOnInit(){this._listenStateChanges()}_listenStateChanges(){new Vt(this._stateChanges).pipe(kf()).listen(this._destroyRef,()=>this._redraw())}ngOnChanges(e){(e.vSize||e.hSize||e.vColor||e.hColor)&&this._refresh()}_redraw(){this._calculatePattern(),this._redrawPattern(),this._redrawLine(this._vLine,this.vColor(),this._size.width,0,this._size.width,this._size.height),this._redrawLine(this._hLine,this.hColor(),0,this._size.height,this._size.width,this._size.height)}_calculatePattern(){this._position.x=this._transform.position.x+this._transform.scaledPosition.x,this._position.y=this._transform.position.y+this._transform.scaledPosition.y,this._size=st.initialize(this.hSize()*this._transform.scale,this.vSize()*this._transform.scale)}_redrawPattern(){this._pattern.setAttribute("x",`${this._position.x}`),this._pattern.setAttribute("y",`${this._position.y}`),this._pattern.setAttribute("width",`${this._size.width}`),this._pattern.setAttribute("height",`${this._size.height}`)}_redrawLine(e,i,o,r,a,s){e.setAttribute("stroke",`${i}`),e.setAttribute("x1",`${o}`),e.setAttribute("x2",`${a}`),e.setAttribute("y1",`${r}`),e.setAttribute("y2",`${s}`)}setTransform(e){this._transform=e,this._refresh()}_refresh(){this._stateChanges.notify()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=J({type:t,selectors:[["f-rect-pattern"]],hostVars:1,hostBindings:function(i,o){i&2&&U("id",o.id)},inputs:{id:[1,"id"],vColor:[1,"vColor"],hColor:[1,"hColor"],vSize:[1,"vSize"],hSize:[1,"hSize"]},features:[we([{provide:xh,useExisting:t}]),wi],decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0})}return t})();var eL=new he("F_BACKGROUND"),tL=(()=>{class t{hostElement=u(Be).nativeElement;static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,standalone:!1})}return t})(),Zy=(()=>{class t extends tL{_mediator=u(R);fBackgroundPattern=da(xh);ngOnInit(){this._mediator.execute(new bn(Pe.BACKGROUND,this))}ngAfterContentInit(){this._mediator.execute(new Qd(this.fBackgroundPattern()))}setTransform(e){this.fBackgroundPattern()?.setTransform(e)}ngOnDestroy(){this._mediator.execute(new wn(Pe.BACKGROUND))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-background"]],contentQueries:function(i,o,r){i&1&&nh(r,o.fBackgroundPattern,xh,5),i&2&&_t()},hostAttrs:[1,"f-component","f-background"],features:[we([{provide:eL,useExisting:t}]),ve],ngContentSelectors:RD,decls:2,vars:0,template:function(i,o){i&1&&(Zt(),it(),K(0,"svg"),Ae(1),Y())},styles:["[_nghost-%COMP%]{position:absolute;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{width:100%;height:100%}"],changeDetection:0})}return t})();var Rm=class{position;scale;constructor(n,e){this.position=n,this.scale=e}},nL=new he("F_CANVAS"),iL=(()=>{class t{transform=gn.default();_fCanvasChange=new Tt;destroyRef=u(rt);getPosition(){return this.transform.position}setPosition(e){this.transform.position=e}emitCanvasChangeEvent(){this._fCanvasChange.notify()}subscribeOnCanvasChange(){new Vt(this._fCanvasChange).pipe(Jd(this.debounce())).listen(this.destroyRef,()=>{this.fCanvasChange.emit(new Rm(B.sum(this.transform.position,this.transform.scaledPosition),this.transform.scale))})}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,standalone:!1})}return t})(),gr=(()=>{class t extends iL{_mediator=u(R);_componentsStore=u(N);_elementReference=u(Be);_injector=u(ot);_flowId;fCanvasChange=Ge();position=F(B.initialize(),{transform:B.castToPoint});scale=F(1,{transform:et});debounceTime=F(0,{transform:et});debounce=D(()=>this.debounceTime()<0?0:this.debounceTime());get hostElement(){return this._elementReference.nativeElement}fGroupsContainer=ze.required("fGroupsContainer");fNodesContainer=ze.required("fNodesContainer");fConnectionsContainer=ze.required("fConnectionsContainer");get flowId(){return this._flowId||""}ngOnInit(){this._flowId=this._mediator.execute(new cf).fId(),this._mediator.execute(new tl(this)),this._positionChange(),this._scaleChange(),super.subscribeOnCanvasChange()}_positionChange(){pe(()=>{this._mediator.execute(new ol(this.transform,this.position()))},{injector:this._injector})}_scaleChange(){pe(()=>{this._mediator.execute(new rl(this.transform,this.scale()))},{injector:this._injector})}redraw(){this._mediator.execute(new Ro(this.transform)),this.hostElement.style.removeProperty("transition"),this.hostElement.style.transform=gn.toString(this.transform),this._mediator.execute(new xn)}redrawWithAnimation(){this._mediator.execute(new Ro(this.transform)),this.hostElement.style.transition=`transform ${ZF()?80:150}ms ease-in-out`,this.hostElement.style.transform=gn.toString(this.transform),sy(this.hostElement,()=>this.redraw())}centerGroupOrNode(e,i=!0){this._afterRedraw(()=>{this._mediator.execute(new nl(e,i))})}fitToScreen(e=B.initialize(),i=!0){this._afterRedraw(()=>{this._mediator.execute(new il(e,i))})}resetScaleAndCenter(e=!0){this._afterRedraw(()=>{this._mediator.execute(new cl(e))})}getScale(){return this.transform.scale||1}setScale(e,i=B.initialize()){this._mediator.execute(new dl(e,i))}resetScale(){this._mediator.execute(new sl)}ngOnDestroy(){this._mediator.execute(new al)}_afterRedraw(e){this._mediator.execute(new pr(this._componentsStore.connectionsRevision,this._componentsStore.nodesRevision,()=>na(e,{injector:this._injector}),this.destroyRef))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-canvas"]],viewQuery:function(i,o){i&1&&Ot(o.fGroupsContainer,AD,5)(o.fNodesContainer,FD,5)(o.fConnectionsContainer,LD,5),i&2&&_t(3)},hostAttrs:[1,"f-component","f-canvas"],inputs:{position:[1,"position"],scale:[1,"scale"],debounceTime:[1,"debounceTime"]},outputs:{fCanvasChange:"fCanvasChange"},features:[we([{provide:nL,useExisting:t}]),ve],ngContentSelectors:zD,decls:12,vars:0,consts:[["fGroupsContainer",""],["fConnectionsContainer",""],["fNodesContainer",""],[1,"f-connections-container"]],template:function(i,o){i&1&&(Zt(BD),ra(0),K(1,"div",null,0),Ae(3),Y(),K(4,"div",3,1),Ae(6,1),Ae(7,2),Ae(8,3),Y(),K(9,"div",null,2),Ae(11,4),Y(),aa())},styles:["[_nghost-%COMP%]{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}.f-canvas-dragging[_nghost-%COMP%], .canvas-dragging[_nghost-%COMP%]{transform:translateZ(0)}.f-connections-container[_ngcontent-%COMP%]{position:absolute;z-index:2}"],changeDetection:0})}return t})();var oL=0,Qy=(()=>{class t extends pN{fId=F(`f-connection-${oL++}`,{alias:"fConnectionId"});fOutputId=F("",{transform:e=>Xi(e)||""});fInputId=F("",{transform:e=>Xi(e)||""});fRadius=8;fOffset=12;fBehavior=vn.FIXED;fType=Vi.STRAIGHT;fSelectionDisabled=F(!1,{transform:Ce});fReassignableStart=F(!1,{transform:Ce});fDraggingDisabled=F(!1,{alias:"fReassignDisabled",transform:Ce});fInputSide=F(Ee.DEFAULT,{transform:e=>qi(e,"fInputSide",Ee)});fOutputSide=F(Ee.DEFAULT,{transform:e=>qi(e,"fOutputSide",Ee)});get boundingElement(){return this.fPath().hostElement}_mediator=u(R);ngOnInit(){this._mediator.execute(new ul(this))}ngOnChanges(){this._mediator.execute(new Xn)}ngOnDestroy(){this._mediator.execute(new Fl(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-connection"]],hostAttrs:[1,"f-component","f-connection"],hostVars:5,hostBindings:function(i,o){i&2&&(U("id",o.fId()),se("f-connection-selection-disabled",o.fSelectionDisabled())("f-connection-reassign-disabled",o.fDraggingDisabled()))},inputs:{fId:[1,"fConnectionId","fId"],fOutputId:[1,"fOutputId"],fInputId:[1,"fInputId"],fRadius:[2,"fRadius","fRadius",et],fOffset:[2,"fOffset","fOffset",et],fBehavior:[2,"fBehavior","fBehavior",e=>qi(e,"fBehavior",vn)],fType:"fType",fSelectionDisabled:[1,"fSelectionDisabled"],fReassignableStart:[1,"fReassignableStart"],fDraggingDisabled:[1,"fReassignDisabled","fDraggingDisabled"],fInputSide:[1,"fInputSide"],fOutputSide:[1,"fOutputSide"]},exportAs:["fComponent"],standalone:!1,features:[we([{provide:Df,useExisting:t}]),ve,wi],ngContentSelectors:VD,decls:15,vars:6,consts:[["defs",""],["xmlns","http://www.w3.org/2000/svg"],[1,"f-connection-group"],["fConnectionGradientRenderer","",3,"fConnectionGradientRendererFor"],["fConnectionSelection",""],["f-connection-path","",3,"useGradient"],["f-connection-drag-handle-start","","r","8"],["f-connection-drag-handle-end","","r","8"]],template:function(i,o){if(i&1&&(Zt(qD),it(),p(0,"svg",1),L(1,"defs",null,0),Ae(3),p(4,"g",2),E(5,GD,1,1,":svg:linearGradient",3),L(6,"path",4),p(7,"g"),L(8,"path",5),E(9,HD,1,0,":svg:circle",6),L(10,"circle",7),m()()(),Ae(11,1),Ae(12,2),Ae(13,3),E(14,jD,1,0)),i&2){let r;l(5),P((r=o.fGradient())?5:-1,r),l(),U("d",o.path),l(2),M("useGradient",!!o.fGradient()),U("d",o.path),l(),P(o.fReassignableStart()?9:-1),l(5),P(o.fContents().length?14:-1)}},dependencies:[Lh,dN,lN,iN,cN],styles:["[_nghost-%COMP%]{pointer-events:none}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{display:block;vertical-align:middle;overflow:visible!important;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%] .f-connection-group[_ngcontent-%COMP%]{pointer-events:all}[_nghost-%COMP%] .f-connection-content[_ngcontent-%COMP%]{pointer-events:all}"],changeDetection:0})}return t})();var rL=new he("F_MAGNETIC_LINES"),aL=(()=>{class t{hostElement=u(Be).nativeElement;static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,standalone:!1})}return t})();var Jy=(()=>{class t extends aL{threshold=F(10,{transform:et,alias:"fAlignThreshold"});_mediator=u(R);ngOnInit(){this._mediator.execute(new bn(Pe.MAGNETIC_LINES,this))}ngOnDestroy(){this._mediator.execute(new wn(Pe.MAGNETIC_LINES))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-line-alignment"]],hostAttrs:[1,"f-line-alignment","f-component"],inputs:{threshold:[1,"fAlignThreshold","threshold"]},exportAs:["fComponent"],standalone:!1,features:[we([{provide:rL,useExisting:t}]),ve],decls:0,vars:0,template:function(i,o){},styles:[UD]})}return t})();var yh=(()=>{class t{fMinSize=F(1e3);_mediator=u(R);hostElement=u(Be).nativeElement;model=new Tf(this.hostElement);redraw(){let{scale:e,viewBox:i}=this._mediator.execute(new Sf(this.hostElement,this.fMinSize()));this.model=new Tf(this.hostElement,e,i),P0(i,this.hostElement)}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,selectors:[["svg","fMinimapFlow",""]],inputs:{fMinSize:[1,"fMinSize"]}})}return t})(),vh=(()=>{class t{_mediator=u(R);_elementRef=u(Be);hostElement=this._elementRef.nativeElement;redraw(){this.clear();let e=this._elementRef.nativeElement.ownerDocument.createDocumentFragment();this._mediator.execute(new wf).forEach(i=>{e.appendChild(i)}),this.hostElement.appendChild(e)}clear(){this.hostElement.replaceChildren()}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,selectors:[["g","fMinimapCanvas",""]]})}return t})(),Ch=(()=>{class t{_mediator=u(R);hostElement=u(Be).nativeElement;redraw(){dh(this._mediator.execute(new If),this.hostElement)}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,selectors:[["rect","fMinimapView",""]],hostAttrs:[1,"f-component","f-minimap-view"]})}return t})(),sL=new he("F_MINIMAP_BASE"),cL=(()=>{class t{hostElement=u(Be).nativeElement;static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,standalone:!1})}return t})(),ev=(()=>{class t extends cL{_destroyRef=u(rt);_mediator=u(R);_browser=u(je);_store=u(N);_canvas=ze.required(vh);_flow=ze.required(yh);_minimapView=ze.required(Ch);fMinSize=F(1e3);fNodeRenderLimit=F(1500,{transform:et});get state(){return this._flow().model}ngOnInit(){this._mediator.execute(new bn(Pe.MINIMAP,this))}ngAfterViewInit(){this._listenTransformChanges()}_listenTransformChanges(){this._mediator.execute(new el).pipe(kf(),YD()).listen(this._destroyRef,()=>{this._redraw()})}_redraw(){if(this._browser.isBrowser()){if(this._isOverNodeRenderLimit()){this._canvas().clear();return}this._flow().redraw(),this._minimapView().redraw(),this._canvas().redraw()}}_isOverNodeRenderLimit(){let e=this.fNodeRenderLimit();return e>0&&this._store.nodes.size()>e}ngOnDestroy(){this._mediator.execute(new wn(Pe.MINIMAP))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-minimap"]],viewQuery:function(i,o){i&1&&Ot(o._canvas,vh,5)(o._flow,yh,5)(o._minimapView,Ch,5),i&2&&_t(3)},hostAttrs:[1,"f-component","f-minimap"],inputs:{fMinSize:[1,"fMinSize"],fNodeRenderLimit:[1,"fNodeRenderLimit"]},exportAs:["fComponent"],features:[we([{provide:sL,useExisting:t}]),ve],decls:3,vars:1,consts:[["fMinimapFlow","","width","100%","height","100%","fLockedContext","",3,"fMinSize"],["fMinimapCanvas",""],["fMinimapView","","x","0","y","0","width","100%","height","100%","stroke","none"]],template:function(i,o){i&1&&(it(),p(0,"svg",0),L(1,"g",1)(2,"rect",2),m()),i&2&&M("fMinSize",o.fMinSize())},dependencies:[yh,vh,Ch],styles:["[_nghost-%COMP%]{display:block;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}return t})();var dL=(()=>{class t{hostElement=u(Be).nativeElement;initialize(){this.hostElement.style.display="none"}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,standalone:!1})}return t})(),tv=(()=>{class t extends dL{_mediator=u(R);fTrigger=e=>e.shiftKey;ngOnInit(){this._mediator.execute(new bn(Pe.SELECTION_AREA,this)),super.initialize()}ngOnDestroy(){this._mediator.execute(new wn(Pe.SELECTION_AREA))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-selection-area"]],hostAttrs:[1,"f-selection-area","f-component"],inputs:{fTrigger:"fTrigger"},features:[ve],decls:0,vars:0,template:function(i,o){},styles:["[_nghost-%COMP%]{position:absolute}"]})}return t})();var lL=0,uL=120,_r=(()=>{class t extends Nm{_destroyRef=u(rt);_mediator=u(R);_browser=u(je);_componentsStore=u(N);_cache=u(Gt);_injector=u(ot);fId=F(`f-flow-${lL++}`,{alias:"fFlowId"});fCache=F(!1,{transform:Ce});hostElement=u(Be).nativeElement;fNodesRendered=Ge();fFullRendered=Ge();fLoaded=Ge();ngOnInit(){this._mediator.execute(new af(this)),this._listenCacheChanges()}ngAfterContentInit(){this._browser.isBrowser()&&(this._listenNodesChanges(),this._listenConnectionsChanges())}_listenCacheChanges(){pe(()=>{this._cache.enabled=this.fCache()},{injector:this._injector})}_listenNodesChanges(){new Vt(this._componentsStore.nodesChanges$,this._componentsStore.progressiveRenderChanges$).pipe(kf(),Jd(uL),KD()).listen(this._destroyRef,()=>{this._mediator.execute(new Pn)||this._componentsStore.hasPendingProgressiveRender||(this._mediator.execute(new Mf),this._mediator.execute(new ff),this._mediator.execute(new pr(this._componentsStore.connectionsRevision+1,this._componentsStore.nodesRevision,()=>this._mediator.execute(new pf),this._destroyRef)),this._mediator.execute(new Xn))})}_listenConnectionsChanges(){this._mediator.execute(new Gi).listen(this._destroyRef,()=>{if(!this._mediator.execute(new Pn)){if(this._componentsStore.isViewportAnimating){this._mediator.execute(new mf(this._destroyRef));return}this._mediator.execute(new Go)}})}redraw(){this._mediator.execute(new Xn)}reset(){this._mediator.execute(new hf)}getNodesBoundingBox(){return this._mediator.execute(new tf)}getSelection(){return this._mediator.execute(new hr)}getPositionInFlow(e){return this._mediator.execute(new Ef(e))}getState(e){return this._mediator.execute(new lf(e?.measuredSize??!1))}selectAll(){this._mediator.execute(new Gi).pipe(R0()).listen(this._destroyRef,()=>{this._mediator.execute(new vf)})}select(e,i,o=!0){this._mediator.execute(new Gi).pipe(R0()).listen(this._destroyRef,()=>{this._mediator.execute(new yf(e,i,o))})}clearSelection(){this._mediator.execute(new gf)}ngOnDestroy(){this._mediator.execute(new uf(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["f-flow"]],hostAttrs:[1,"f-component","f-flow"],hostVars:1,hostBindings:function(i,o){i&2&&U("id",o.fId())},inputs:{fId:[1,"fFlowId","fId"],fCache:[1,"fCache"]},outputs:{fNodesRendered:"fNodesRendered",fFullRendered:"fFullRendered",fLoaded:"fLoaded"},features:[we([R,...iO,vy,ro,...QF,te,...wA,{provide:Bm,useExisting:t}]),ve],ngContentSelectors:$D,decls:7,vars:0,template:function(i,o){i&1&&(Zt(WD),ra(0),Ae(1),Ae(2,1),Ae(3,2),Ae(4,3),Ae(5,4),Ae(6,5),aa())},styles:["[_nghost-%COMP%]{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none} .f-connection-content{position:absolute;left:0;top:0;inline-size:max-content;pointer-events:all;transform-origin:50% 50%} .f-node, .f-group{position:absolute!important;transform-origin:center;-webkit-user-select:none;user-select:none;pointer-events:all;left:0!important;top:0!important;box-sizing:border-box} .f-group{z-index:1} .f-connection-content{z-index:3} .f-node{z-index:4}.hidden[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0})}return t})();var nv=(()=>{class t{fVirtualForOf=[];fVirtualForTrackBy;_vc=u(ia);_tpl=u(W_);_zone=u(Vn);_componentsStore=u(N,{optional:!0});_views=[];_rafId=null;_isProgressiveRenderActive=!1;ngOnChanges(e){e.fVirtualForOf&&(this._reset(),this._renderProgressively())}ngOnDestroy(){this._reset()}_reset(){this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._finishProgressiveRender(),this._vc.clear(),this._views.length=0}_renderProgressively(){let i=0;this._startProgressiveRender(),this._zone.runOutsideAngular(()=>{let o=()=>{let r=performance.now();for(;i<this.fVirtualForOf.length&&performance.now()-r<10;){let a=this.fVirtualForOf[i],s=this._vc.createEmbeddedView(this._tpl,{$implicit:a,index:i});this._views.push(s),i++}if(i<this.fVirtualForOf.length){this._rafId=requestAnimationFrame(o);return}this._rafId=null,this._finishProgressiveRender()};this._rafId=requestAnimationFrame(o)})}_startProgressiveRender(){this._isProgressiveRenderActive||(this._isProgressiveRenderActive=!0,this._componentsStore?.beginProgressiveRender())}_finishProgressiveRender(){this._isProgressiveRenderActive&&(this._isProgressiveRenderActive=!1,this._componentsStore?.endProgressiveRender())}static \u0275fac=function(i){return new(i||t)};static \u0275dir=De({type:t,selectors:[["","fVirtualFor","","fVirtualForOf",""]],inputs:{fVirtualForOf:"fVirtualForOf",fVirtualForTrackBy:"fVirtualForTrackBy"},features:[wi]})}return t})();var Rt=(function(t){return t[t.ZOOM_IN=1]="ZOOM_IN",t[t.ZOOM_OUT=-1]="ZOOM_OUT",t})(Rt||{}),fL=new he("F_ZOOM"),Am=class{},pL=.1,hL=1,mL=.5,gL=60,_L=.5;function yL(t){return Math.abs(t.deltaY)>=Math.abs(t.deltaX)?t.deltaY:t.deltaX}function vL(t,n,e){return CL(t)?bL(n,e):xL(n,e)}function CL(t){return(t.ctrlKey||t.metaKey)&&t.deltaMode===WheelEvent.DOM_DELTA_PIXEL}function xL(t,n){let e=Math.abs(t)/100,i=iv(e,pL,hL);return n*i}function bL(t,n){if(Math.abs(t)<mL)return 0;let e=Math.abs(t)/gL,i=iv(e,0,_L);return n*i}function iv(t,n,e){return Math.max(n,Math.min(e,t))}var yr=(()=>{class t extends Am{_mediator=u(R);_injector=u(ot);_store=u(N);_triggersListener=Se.emptyListener();isEnabled=F(!1,{alias:"fZoom",transform:Ce});fWheelTrigger=Nt;fDblClickTrigger=Nt;minimum=.1;maximum=4;step=.1;dblClickStep=.5;get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}ngOnInit(){this._mediator.execute(new bn(Pe.ZOOM,this))}ngAfterViewInit(){this._listenZoomEnabledChanges()}_listenZoomEnabledChanges(){pe(()=>{this.isEnabled(),Bt(()=>this._listenTriggers())},{injector:this._injector})}_listenTriggers(){this._flowHost&&(this._disposeListeners(),this.isEnabled()&&(this._listen("wheel",this._onWheel,Se.activeListener()),this._listen("dblclick",this._onDoubleClick),this._triggersListener=()=>{this._unlisten("wheel",this._onWheel,Se.activeListener()),this._unlisten("dblclick",this._onDoubleClick)}))}_onWheel=e=>{if(!Et(e,this.fWheelTrigger)||(e.preventDefault(),e.target?.closest("[fLockedContext]")))return;let o=yL(e);if(o===0)return;let r=this._normalizeWheelStep(e,o);r!==0&&this.setZoom(B.initialize(e.clientX,e.clientY),r,this._calculateDirection(o),!1)};_normalizeWheelStep(e,i){return vL(e,i,this.step)}_calculateDirection(e){return e>0?Rt.ZOOM_OUT:Rt.ZOOM_IN}_onDoubleClick=e=>{if(!Et(e,this.fDblClickTrigger))return;e.preventDefault();let i=e.target;LR(i)||i?.closest("[fLockedContext]")||this.setZoom(B.initialize(e.clientX,e.clientY),this.dblClickStep,Rt.ZOOM_IN,!0)};_getToCenterPosition(e,i){return B.initialize(e?.x||i.gravityCenter.x,e?.y||i.gravityCenter.y)}zoomIn(e){this._onZoomToCenter(Rt.ZOOM_IN,e)}zoomOut(e){this._onZoomToCenter(Rt.ZOOM_OUT,e)}_onZoomToCenter(e,i){this.setZoom(this._getToCenterPosition(i,W.fromElement(this._flowHost)),this.step,e,!1)}setZoom(e,i,o,r){this._mediator.execute(new bf(e,i,o,r))}getZoomValue(){return this._canvas.transform.scale||1}reset(){this._mediator.execute(new xf)}_disposeListeners(){this._triggersListener(),this._triggersListener=Se.emptyListener()}ngOnDestroy(){this._disposeListeners(),this._mediator.execute(new wn(Pe.ZOOM))}_listen(e,i,o){this._flowHost.addEventListener(e,i,o)}_unlisten(e,i,o){this._flowHost.removeEventListener(e,i,o)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275dir=De({type:t,selectors:[["f-canvas","fZoom",""]],hostAttrs:[1,"f-zoom","f-component"],inputs:{isEnabled:[1,"fZoom","isEnabled"],fWheelTrigger:"fWheelTrigger",fDblClickTrigger:"fDblClickTrigger",minimum:[2,"fZoomMinimum","minimum",et],maximum:[2,"fZoomMaximum","maximum",et],step:[2,"fZoomStep","step",et],dblClickStep:[2,"fZoomDblClickStep","dblClickStep",et]},features:[we([{provide:fL,useExisting:t}]),ve]})}return t})();var ov=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Si({type:t});static \u0275inj=xi({imports:[Ti]})}return t})();var mp=iD(tM(),1);var $r=(function(t){return t.NETWORK_SIMPLEX="network-simplex",t.TIGHT_TREE="tight-tree",t.LONGEST_PATH="longest-path",t})($r||{}),LY={direction:ai.TOP_BOTTOM,nodeGap:48,layerGap:64,algorithm:$r.NETWORK_SIMPLEX,defaultNodeSize:st.initialize(120,72)},f_=(()=>{class t extends sf{constructor(){super(LY)}mergeOptions(e,i={}){return Xt(ae(ae({},e),i),{defaultNodeSize:i.defaultNodeSize?st.initialize(i.defaultNodeSize.width,i.defaultNodeSize.height):st.initialize(e.defaultNodeSize.width,e.defaultNodeSize.height)})}async calculate(e,i,o){let r=this.resolveLayoutOptions(o),a=this._buildGraph(e,i,r),s=new Map;return mp.layout(a),a.nodes().forEach(c=>{let d=a.node(c),f=e.find(v=>v.id===c);if(!d||!f)return;let h=f.size??r.defaultNodeSize;s.set(c,B.initialize(d.x-h.width/2,d.y-h.height/2))}),{nodes:$y(e,s)}}_buildGraph(e,i,o){let r=new mp.graphlib.Graph;return r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:this._mapDirection(o.direction),nodesep:o.nodeGap,ranksep:o.layerGap,ranker:this._mapAlgorithm(o.algorithm)}),e.forEach(a=>{let s=a.size??o.defaultNodeSize;r.setNode(a.id,{width:s.width,height:s.height})}),i.forEach(a=>{!r.hasNode(a.source)||!r.hasNode(a.target)||r.setEdge(a.source,a.target,{})}),r}_mapAlgorithm(e){switch(e){case $r.TIGHT_TREE:return"tight-tree";case $r.LONGEST_PATH:return"longest-path";case $r.NETWORK_SIMPLEX:default:return"network-simplex"}}_mapDirection(e){switch(e){case ai.BOTTOM_TOP:return"BT";case ai.LEFT_RIGHT:return"LR";case ai.RIGHT_LEFT:return"RL";case ai.TOP_BOTTOM:default:return"TB"}}static \u0275fac=function(i){return new(i||t)};static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})();var gi={loading:"Loading collection",errorTitle:"Failed to load",emptyTitle:"No nodes match",emptyDesc:"Adjust or reset the filters above.",a11y:{toolbar:"Graph controls",panel:"Selected node details"},toolbar:{zoomIn:"Zoom in",zoomOut:"Zoom out",fitToScreen:"Fit to screen",resetLayoutLabel:"Reset layout",resetLayoutTooltip:"Reset layout (re-run auto layout, clear saved positions)",layoutAlgorithmLabel:"Layout algorithm",layoutAlgorithmTooltip:"Layout algorithm (balanced, stretched or organic)",layoutDirectionLabel:"Layout direction",layoutDirectionTooltip:"Layout direction (TB, BT, LR, RL)",layoutDirectionUnavailableTooltip:"Direction does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",layoutSpacingLabel:"Layout spacing",layoutSpacingTooltip:"Layout spacing (compact, normal, spacious)",layoutSpacingUnavailableTooltip:"Spacing does not apply to the Organic layout. Switch to Balanced or Stretched to set it.",connectionTypeLabel:"Edge style",connectionTypeTooltip:"Edge style (orthogonal, straight, bezier or adaptive curve)"},layout:{algorithm:{options:{"network-simplex":{label:"Balanced"},"longest-path":{label:"Stretched"},force:{label:"Organic"}}},direction:{options:{TOP_BOTTOM:{label:"Top to bottom"},BOTTOM_TOP:{label:"Bottom to top"},LEFT_RIGHT:{label:"Left to right"},RIGHT_LEFT:{label:"Right to left"}}},spacing:{options:{compact:{label:"Compact"},normal:{label:"Normal"},spacious:{label:"Spacious"}}},connection:{options:{segment:{label:"Orthogonal"},straight:{label:"Straight"},bezier:{label:"Bezier"},"adaptive-curve":{label:"Adaptive curve"}}}},panel:{resizeLabel:"Resize panel"},resetLayoutConfirm:{header:"Reset layout?",message:"Reset all node positions to the automatic layout. This cannot be undone.",accept:"Reset",reject:"Cancel"}};var xo={graph:{perf:{cache:!0,virtualization:!1},perfHud:!0},inspector:{actionMocks:!1}};var p_=["network-simplex","longest-path","force"];function h_(t){return t!=="force"}function nM(t){return t!=="force"}var m_=["TOP_BOTTOM","BOTTOM_TOP","LEFT_RIGHT","RIGHT_LEFT"],g_=["compact","normal","spacious"],iM={compact:{nodeGap:40,layerGap:56},normal:{nodeGap:64,layerGap:96},spacious:{nodeGap:96,layerGap:144}},oM="network-simplex",rM="TOP_BOTTOM",aM="normal";function sM(t){return typeof t=="string"&&p_.includes(t)}function cM(t){return typeof t=="string"&&m_.includes(t)}function dM(t){return typeof t=="string"&&g_.includes(t)}var BY="adaptive-curve",__=["segment","straight","bezier","adaptive-curve"],lM="sm.graph.connection-type",uM="sm.graph.layout-algorithm",fM="sm.graph.layout-direction",pM="sm.graph.layout-spacing",yp=class t{_connectionType=j(gp(lM,zY,BY));_layoutAlgorithm=j(gp(uM,sM,oM));_layoutDirection=j(gp(fM,cM,rM));_layoutSpacing=j(gp(pM,dM,aM));connectionType=this._connectionType.asReadonly();layoutAlgorithm=this._layoutAlgorithm.asReadonly();layoutDirection=this._layoutDirection.asReadonly();layoutSpacing=this._layoutSpacing.asReadonly();setConnectionType(n){this._connectionType()!==n&&(this._connectionType.set(n),_p(lM,n))}setLayoutAlgorithm(n){this._layoutAlgorithm()!==n&&(this._layoutAlgorithm.set(n),_p(uM,n))}setLayoutDirection(n){this._layoutDirection()!==n&&(this._layoutDirection.set(n),_p(fM,n))}setLayoutSpacing(n){this._layoutSpacing()!==n&&(this._layoutSpacing.set(n),_p(pM,n))}static toFoblexEnum(n){return n}static \u0275fac=function(e){return new(e||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})};function gp(t,n,e){let i=null;try{i=localStorage.getItem(t)}catch{return e}return i&&n(i)?i:e}function _p(t,n){try{localStorage.setItem(t,n)}catch{}}function zY(t){return typeof t=="string"&&__.includes(t)}var hM={a11y:{toolbarLabel:"Toggle node kinds"},favorites:{label:"Favorites"}};function qY(t,n){if(t&1&&dn(0,"i",4),t&2){let e=g();Fe(e.piClass()),ft("font-size",e.size(),"px")}}function VY(t,n){if(t&1&&(it(),K(0,"svg",1),dn(1,"path"),Y()),t&2){let e=g();U("width",e.size())("height",e.size()),l(),U("d",e.svgPath())}}function GY(t,n){if(t&1&&(K(0,"span",4),y(1),Y()),t&2){let e=g();ft("font-size",e.size(),"px")("line-height",e.size(),"px"),l(),x(e.emoji())}}function HY(t,n){if(t&1&&(K(0,"span",5),y(1),Y()),t&2){let e=g();ft("font-size",e.size(),"px")("line-height",e.size(),"px"),l(),x(e.letter())}}var Ln=class t{kindRegistry=u(Di);kind=F.required();size=F(18);provider=F(null);resolvedUi=D(()=>this.kindRegistry.lookup(this.kind()));variant=D(()=>{let n=this.resolvedUi();return n?.icon?.kind==="pi"?"pi":n?.icon?.kind==="svg"?"svg":n?.emoji?"emoji":"letter"});piClass=D(()=>{let n=this.resolvedUi()?.icon;return n?.kind==="pi"?`pi ${n.id}`:""});svgPath=D(()=>{let n=this.resolvedUi()?.icon;return n?.kind==="svg"?n.path:""});emoji=D(()=>this.resolvedUi()?.emoji??"");letter=D(()=>this.kindRegistry.labelOf(this.kind()).charAt(0).toUpperCase());static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-kind-icon"]],inputs:{kind:[1,"kind"],size:[1,"size"],provider:[1,"provider"]},decls:4,vars:1,consts:[["aria-hidden","true",3,"class","font-size"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2.2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["aria-hidden","true",3,"font-size","line-height"],["aria-hidden","true",1,"kind-icon__letter",3,"font-size","line-height"],["aria-hidden","true"],["aria-hidden","true",1,"kind-icon__letter"]],template:function(e,i){if(e&1&&E(0,qY,1,4,"i",0)(1,VY,2,3,":svg:svg",1)(2,GY,2,5,"span",2)(3,HY,2,5,"span",3),e&2){let o;P((o=i.variant())==="pi"?0:o==="svg"?1:o==="emoji"?2:o==="letter"?3:-1)}},styles:["[_nghost-%COMP%]{display:inline-flex;align-items:center;justify-content:center;line-height:1}"],changeDetection:0})};var _M=()=>({class:"kind-palette__content"}),yM=t=>({content:t}),jY=(t,n)=>n.kind;function UY(t,n){if(t&1&&(L(0,"sm-kind-icon",5),p(1,"span"),y(2),m()),t&2){let e=g().$implicit;M("kind",e.kind)("size",16),l(2),x(e.count)}}function WY(t,n){if(t&1){let e=de();p(0,"p-togglebutton",4),$("ngModelChange",function(){let o=G(e).$implicit,r=g();return H(r.toggle(o.kind))}),be(1,UY,3,3,"ng-template",null,0,Un),m()}if(t&2){let e=n.$implicit,i=g();M("ngModel",i.isActive(e.kind))("pTooltip",e.label)("ariaLabel",e.label)("styleClass","kind-palette__btn kind-palette__btn--"+e.kind)("pt",Jt(7,yM,jn(6,_M))),U("data-testid","kind-palette-"+e.kind)}}function $Y(t,n){if(t&1&&(L(0,"i",7),p(1,"span"),y(2),m()),t&2){let e=g(2);se("pi-star-fill",e.favoritesActive())("pi-star",!e.favoritesActive()),l(2),x(e.favoritesCount())}}function KY(t,n){if(t&1){let e=de();p(0,"p-togglebutton",6),$("ngModelChange",function(){G(e);let o=g();return H(o.toggleFavoritesOnly())}),be(1,$Y,3,5,"ng-template",null,0,Un),m()}if(t&2){let e=g();M("ngModel",e.favoritesActive())("pTooltip",e.texts.favorites.label)("ariaLabel",e.texts.favorites.label)("pt",Jt(5,yM,jn(4,_M)))}}var vp=class t{loader=u(hn);filters=u(Oi);kindRegistry=u(Di);texts=hM;entries=D(()=>{let n=new Map;for(let e of this.loader.nodes())n.set(e.kind,(n.get(e.kind)??0)+1);return this.kindRegistry.kinds().map(e=>({kind:e.name,label:e.label,count:n.get(e.name)??0})).filter(e=>e.count>0)});favoritesCount=D(()=>this.loader.nodes().filter(n=>n.isFavorite===!0).length);showFavorites=D(()=>this.loader.hasAnyFavorites()||this.filters.favoritesOnly());favoritesActive=D(()=>this.filters.favoritesOnly());isActive(n){return this.filters.isKindActive(n)}toggle(n){let e=this.entries().map(i=>i.kind);this.filters.toggleKind(n,e)}toggleFavoritesOnly(){this.filters.setFavoritesOnly(!this.filters.favoritesOnly())}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-kind-palette"]],decls:4,vars:2,consts:[["content",""],["role","toolbar","data-testid","kind-palette",1,"kind-palette"],[3,"ngModel","pTooltip","ariaLabel","styleClass","pt"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModel","pTooltip","ariaLabel","pt"],[3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass","pt"],[3,"kind","size"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModelChange","ngModel","pTooltip","ariaLabel","pt"],["aria-hidden","true",1,"pi"]],template:function(e,i){e&1&&(p(0,"div",1),Z(1,WY,3,9,"p-togglebutton",2,jY),E(3,KY,3,7,"p-togglebutton",3),m()),e&2&&(U("aria-label",i.texts.a11y.toolbarLabel),l(),Q(i.entries()),l(2),P(i.showFavorites()?3:-1))},dependencies:[Ai,Ni,Ri,Li,Fi,We,Ze,Ln],styles:["[_nghost-%COMP%]{display:block;pointer-events:auto}.kind-palette[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating)}.kind-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0 .55rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-content-checked-background: var(--sm-bg-hover);--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);--p-togglebutton-icon-color: var(--p-text-muted-color);--p-togglebutton-icon-hover-color: var(--p-text-color);--p-togglebutton-icon-checked-color: var(--p-text-color);width:56px;height:30px;font-size:.72rem;font-weight:600;font-variant-numeric:tabular-nums}[_nghost-%COMP%] .kind-palette__content{width:100%;height:100%;justify-content:flex-start;display:flex;align-items:center;gap:.4rem}[_nghost-%COMP%] .kind-palette__content>span{flex:1;text-align:right}[_nghost-%COMP%] .kind-palette__btn sm-kind-icon{display:inline-flex;align-items:center;color:var(--p-text-muted-color)}[_nghost-%COMP%] .kind-palette__btn[aria-pressed=true] sm-kind-icon{color:var(--p-text-color)}[_nghost-%COMP%] .kind-palette__btn--skill[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-skill)}[_nghost-%COMP%] .kind-palette__btn--agent[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-agent)}[_nghost-%COMP%] .kind-palette__btn--command[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-command)}[_nghost-%COMP%] .kind-palette__btn--markdown[aria-pressed=true] sm-kind-icon{color:var(--sm-kind-markdown)}[_nghost-%COMP%] .kind-palette__btn--favorites .pi{font-size:.95rem;line-height:1;color:var(--p-text-muted-color)}[_nghost-%COMP%] .kind-palette__btn--favorites:hover .pi{color:var(--p-text-color)}[_nghost-%COMP%] .kind-palette__btn--favorites[aria-pressed=true] .pi{color:var(--p-primary-color)}"],changeDetection:0})};var Kt={a11y:{toolbarLabel:"Link kind filters"},kinds:{invokes:"Invokes",references:"References",mentions:"Mentions",supersedes:"Supersedes"},tooltips:{invokes:`Invokes:
273
+ "/skill-command"`,references:`References:
274
+ "[link](./link.md)"`,mentions:`Mention:
275
+ "@agent.md"`,supersedes:`Supersedes:
276
+ .sm annotation`}};var YY=()=>({class:"link-kind-palette__content"}),XY=t=>({content:t}),ZY=(t,n)=>n.kind;function QY(t,n){if(t&1&&y(0),t&2){let e=g(2).$implicit;Le(" ",e.text," ")}}function JY(t,n){if(t&1&&L(0,"i"),t&2){let e=g(2).$implicit;Fe(e.icon)}}function eX(t,n){if(t&1&&(p(0,"span",4),E(1,QY,1,1)(2,JY,1,2,"i",5),m()),t&2){let e=g().$implicit;l(),P(e.text?1:e.icon?2:-1)}}function tX(t,n){if(t&1){let e=de();p(0,"p-togglebutton",3),$("ngModelChange",function(){let o=G(e).$implicit,r=g();return H(r.toggle(o.kind))}),be(1,eX,3,1,"ng-template",null,0,Un),m()}if(t&2){let e=n.$implicit,i=g();M("ngModel",i.isActive(e.kind))("pTooltip",e.tooltip)("ariaLabel",e.label)("styleClass","link-kind-palette__btn link-kind-palette__btn--"+e.kind)("pt",Jt(7,XY,jn(6,YY))),U("data-testid","link-kind-palette-"+e.kind)}}var Cp=class t{filters=u(Oi);texts=Kt;entries=[{kind:"invokes",label:Kt.kinds.invokes,tooltip:Kt.tooltips.invokes,text:"/"},{kind:"references",label:Kt.kinds.references,tooltip:Kt.tooltips.references,icon:"pi pi-link"},{kind:"mentions",label:Kt.kinds.mentions,tooltip:Kt.tooltips.mentions,text:"@"},{kind:"supersedes",label:Kt.kinds.supersedes,tooltip:Kt.tooltips.supersedes,icon:"pi pi-angle-double-right"}];constructor(){for(let n of this.entries)if(!_0.includes(n.kind))throw new Error(`link-kind-palette: unknown link kind "${n.kind}"`)}isActive(n){return this.filters.isLinkKindActive(n)}toggle(n){this.filters.toggleLinkKind(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-link-kind-palette"]],decls:3,vars:1,consts:[["content",""],["role","toolbar","data-testid","link-kind-palette",1,"link-kind-palette"],["tooltipStyleClass","link-kind-palette__tooltip",3,"ngModel","pTooltip","ariaLabel","styleClass","pt"],["tooltipStyleClass","link-kind-palette__tooltip",3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass","pt"],["aria-hidden","true",1,"link-kind-palette__glyph"],[3,"class"]],template:function(e,i){e&1&&(p(0,"div",1),Z(1,tX,3,9,"p-togglebutton",2,ZY),m()),e&2&&(U("aria-label",i.texts.a11y.toolbarLabel),l(),Q(i.entries))},dependencies:[Ai,Ni,Ri,Li,Fi,We,Ze],styles:["[_nghost-%COMP%]{display:block;width:100%;pointer-events:auto}.link-kind-palette[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:2px;padding:4px;background:color-mix(in srgb,var(--sm-bg-content) 80%,transparent);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid var(--sm-border);border-radius:.65rem;box-shadow:var(--sm-shadow-floating)}.link-kind-palette__btn[_ngcontent-%COMP%]{--p-togglebutton-padding: 0;--p-togglebutton-content-padding: 0;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-background: transparent;--p-togglebutton-checked-background: transparent;--p-togglebutton-hover-background: transparent;--p-togglebutton-border-color: transparent;--p-togglebutton-checked-border-color: transparent;--p-togglebutton-content-checked-background: var(--sm-bg-hover);--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-color);width:100%;height:30px}[_nghost-%COMP%] .link-kind-palette__content{width:100%;height:100%;display:flex;align-items:center;justify-content:center}[_nghost-%COMP%] .link-kind-palette__glyph{font-size:.95rem;line-height:1;font-weight:600;display:inline-flex;align-items:center;justify-content:center}[_nghost-%COMP%] .link-kind-palette__btn--invokes .link-kind-palette__glyph{color:var(--sm-edge-invokes)}[_nghost-%COMP%] .link-kind-palette__btn--invokes[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-invokes-active)}[_nghost-%COMP%] .link-kind-palette__btn--references .link-kind-palette__glyph{color:var(--sm-edge-references)}[_nghost-%COMP%] .link-kind-palette__btn--references[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-references-active)}[_nghost-%COMP%] .link-kind-palette__btn--mentions .link-kind-palette__glyph{color:var(--sm-edge-mentions)}[_nghost-%COMP%] .link-kind-palette__btn--mentions[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-mentions-active)}[_nghost-%COMP%] .link-kind-palette__btn--supersedes .link-kind-palette__glyph{color:var(--sm-edge-supersedes)}[_nghost-%COMP%] .link-kind-palette__btn--supersedes[aria-pressed=true] .link-kind-palette__glyph{color:var(--sm-edge-supersedes-active)}[_nghost-%COMP%] .link-kind-palette__tooltip .p-tooltip-text{white-space:pre-line;text-align:center;line-height:1.35}"],changeDetection:0})};var _i={llm:{what:{label:"what",tooltip:"What it does (LLM-inferred summary)"},when:{label:"when",tooltip:"When to use (LLM-inferred)"},style:{label:"style",tooltip:"Interaction style (LLM-inferred)"},does:{label:"does",tooltip:"Capabilities (LLM-inferred)"},steps:{label:"steps",tooltip:"Recipe / ordered steps (LLM-inferred)"},pre:{label:"pre",tooltip:"Preconditions (LLM-inferred)"},out:{label:"out",tooltip:"Outputs / produced artifacts (LLM-inferred)"},fx:{label:"fx",tooltip:"Side effects (LLM-inferred)"},eg:{label:"eg",tooltip:"Invocation example (LLM-inferred)"},topics:{label:"topics",tooltip:"Topics covered (LLM-inferred)"},facts:{label:"facts",tooltip:"Key facts (LLM-inferred discrete claims)"}},meta:{model:"model",allowed:"allowed",tags:"tags"},stats:{errors:t=>`${t} error${t===1?"":"s"}`,warns:t=>`${t} warning${t===1?"":"s"}`,bytes:t=>`${t.toLocaleString("en-US")} bytes`,tokens:t=>`${t.toLocaleString("en-US")} tokens`},stability:{experimental:"experimental",deprecated:"deprecated"},sidecar:{staleBody:"Stale: body content changed since the last bump.",staleFrontmatter:"Stale: frontmatter changed since the last bump.",staleBoth:"Stale: body and frontmatter changed since the last bump."},confidence:t=>`LLM summary \xB7 confidence ${t.toFixed(2)}`,ariaExpand:"Expand",ariaFavoriteAdd:"Add to favorites",ariaFavoriteRemove:"Remove from favorites",favoriteAddTooltip:"Mark as favorite",favoriteRemoveTooltip:"Unfavorite"};var nX={claude:{label:"Claude",color:"#cc785c",colorDark:"#e89270"},gemini:{label:"Gemini",color:"#4285f4",colorDark:"#669df6"},"agent-skills":{label:"Open Skills",color:"#64748b",colorDark:"#94a3b8"}},iX=new Set(["markdown"]),oX={label:"",color:"#9ca3af",colorDark:"#6b7280"};function vM(t){if(!t||iX.has(t))return null;let n=nX[t];return n||Xt(ae({},oX),{label:t})}function y_(t){let n=t.normalize("NFD");return n=n.replace(new RegExp("\\p{Mn}+","gu"),""),n=n.toLowerCase(),n=n.replace(/[-_\s]+/g," "),n=n.replace(/\s+/g," "),n.trim()}function CM(t){let n=new Map;return rX(t,n),aX(t,n),n}function rX(t,n){for(let e of t){let i=xM(e);if(i===null)continue;let o=y_(i);n.has(o)||n.set(o,e.path)}}function aX(t,n){for(let e of t){if(xM(e)!==null)continue;let i=v_(e.path);if(i.length===0)continue;let o=y_(i);n.has(o)||n.set(o,e.path)}}function xM(t){let n=t.frontmatter?.name;return typeof n!="string"||n.length===0?null:n}function v_(t){let n=t.split("/").filter(i=>i.length>0);if(n.length===0)return t;let e=n[n.length-1];return e==="SKILL.md"&&n.length>=2?n[n.length-2]:e.replace(/\.md$/,"")}function bM(t,n,e){let i=t.charAt(0);if(i!=="/"&&i!=="@")return t;let o=n!==null?n.replace(/^[/@]/,"").trim():y_(t.slice(1));return e.get(o)??t}var sX=(t,n)=>n.source+":"+n.tag,cX=(t,n)=>n.step,dX=(t,n)=>n.analyzerId+n.message;function lX(t,n){if(t&1&&(p(0,"span",33),y(1),m()),t&2){let e=g(),i=ne(1),o=ne(3);se("sm-gnode__llm-marker--low",o==="low")("sm-gnode__llm-marker--med",o==="med")("sm-gnode__llm-marker--high",o==="high"),M("pTooltip",e.texts.confidence(i.confidence)),l(),Le("",e.confidencePct(),"%")}}function uX(t,n){t&1&&(p(0,"span",9),y(1),m()),t&2&&(l(),x(n))}function fX(t,n){if(t&1&&(p(0,"span",13)(1,"span",34),y(2,"T"),m(),y(3),m()),t&2){let e=g(),i=ne(2);M("pTooltip",e.texts.stats.tokens(i.tokensTotal)),l(3),x(e.tokensShort())}}function pX(t,n){if(t&1&&(p(0,"span",14)(1,"span",34),y(2,"B"),m(),y(3),m()),t&2){let e=g(),i=ne(2);M("pTooltip",e.texts.stats.bytes(i.bytesTotal)),l(3),x(e.bytesShort())}}function hX(t,n){if(t&1&&(p(0,"span",35),y(1),m()),t&2){let e=n;g();let i=ne(0);ft("--provider-color",e.color)("--provider-color-dark",e.colorDark??e.color),M("pTooltip",i.provider),l(),x(e.label)}}function mX(t,n){if(t&1&&(p(0,"span",38),y(1),m()),t&2){let e=n.$implicit;se("sm-gnode__tag-chip--author",e.source==="author")("sm-gnode__tag-chip--user",e.source==="user"),U("data-tag-source",e.source),l(),x(e.tag)}}function gX(t,n){if(t&1&&(p(0,"span",37),y(1),m()),t&2){g(2);let e=ne(5);l(),Le("+",e," more")}}function _X(t,n){if(t&1&&(p(0,"div",19),Z(1,mX,2,6,"span",36,sX),E(3,gX,2,1,"span",37),m()),t&2){g();let e=ne(4),i=ne(5);l(),Q(e),l(2),P(i>0?3:-1)}}function yX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"span"),y(4),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.what.tooltip),l(),x(i.texts.llm.what.label),l(2),x(e.whatItCovers)}}function vX(t,n){if(t&1&&(p(0,"span",42),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function CX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"div",41),Z(4,vX,2,1,"span",42,Te),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.topics.tooltip),l(),x(i.texts.llm.topics.label),l(2),Q(e.topics)}}function xX(t,n){if(t&1&&(p(0,"span",42),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function bX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"div",41),Z(4,xX,2,1,"span",42,Te),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.facts.tooltip),l(),x(i.texts.llm.facts.label),l(2),Q(e.keyFacts)}}function wX(t,n){if(t&1&&(E(0,yX,5,3,"div",39),E(1,CX,6,2,"div",39),E(2,bX,6,2,"div",39)),t&2){let e=n,i=g(2);P(i.showLlmWhat?0:-1),l(),P(e.topics!=null&&e.topics.length?1:-1),l(),P(e.keyFacts!=null&&e.keyFacts.length?2:-1)}}function SX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"span"),y(4),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.what.tooltip),l(),x(i.texts.llm.what.label),l(2),x(e.whatItDoes)}}function IX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"span"),y(4),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.when.tooltip),l(),x(i.texts.llm.when.label),l(2),x(e.whenToUse)}}function TX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"span"),y(4),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.style.tooltip),l(),x(i.texts.llm.style.label),l(2),x(e.interactionStyle)}}function EX(t,n){if(t&1&&(p(0,"span",42),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function PX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"div",41),Z(4,EX,2,1,"span",42,Te),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.does.tooltip),l(),x(i.texts.llm.does.label),l(2),Q(e.capabilities)}}function MX(t,n){if(t&1&&(E(0,SX,5,3,"div",39),E(1,IX,5,3,"div",39),E(2,TX,5,3,"div",39),E(3,PX,6,2,"div",39)),t&2){let e=n,i=g(2);P(i.showLlmWhat?0:-1),l(),P(e.whenToUse?1:-1),l(),P(e.interactionStyle?2:-1),l(),P(e.capabilities!=null&&e.capabilities.length?3:-1)}}function kX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"span"),y(4),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.what.tooltip),l(),x(i.texts.llm.what.label),l(2),x(e.whatItDoes)}}function DX(t,n){if(t&1&&y(0),t&2){let e=n.$implicit,i=n.$index,o=n.$count;K_("",e.step,". ",e.description,"",i===o-1?"":" \xB7 ")}}function OX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"span"),Z(4,DX,1,3,null,null,cX),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.steps.tooltip),l(),x(i.texts.llm.steps.label),l(2),Q(e.recipe)}}function NX(t,n){if(t&1&&(p(0,"span",42),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function RX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"div",41),Z(4,NX,2,1,"span",42,Te),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.pre.tooltip),l(),x(i.texts.llm.pre.label),l(2),Q(e.preconditions)}}function AX(t,n){if(t&1&&(p(0,"span",42),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function FX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"div",41),Z(4,AX,2,1,"span",42,Te),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.out.tooltip),l(),x(i.texts.llm.out.label),l(2),Q(e.outputs)}}function LX(t,n){if(t&1&&(p(0,"span",42),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function BX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"div",41),Z(4,LX,2,1,"span",42,Te),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.fx.tooltip),l(),x(i.texts.llm.fx.label),l(2),Q(e.sideEffects)}}function zX(t,n){if(t&1&&(E(0,kX,5,3,"div",39),E(1,OX,6,2,"div",39),E(2,RX,6,2,"div",39),E(3,FX,6,2,"div",39),E(4,BX,6,2,"div",39)),t&2){let e=n,i=g(2);P(i.showLlmWhat?0:-1),l(),P(e.recipe!=null&&e.recipe.length?1:-1),l(),P(e.preconditions!=null&&e.preconditions.length?2:-1),l(),P(e.outputs!=null&&e.outputs.length?3:-1),l(),P(e.sideEffects!=null&&e.sideEffects.length?4:-1)}}function qX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"span"),y(4),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.what.tooltip),l(),x(i.texts.llm.what.label),l(2),x(e.whatItDoes)}}function VX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"code",43),y(4),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.eg.tooltip),l(),x(i.texts.llm.eg.label),l(2),x(e.invocationExample)}}function GX(t,n){if(t&1&&(p(0,"span",42),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function HX(t,n){if(t&1&&(p(0,"div",39)(1,"span",40),y(2),m(),p(3,"div",41),Z(4,GX,2,1,"span",42,Te),m()()),t&2){let e=g(),i=g(2);l(),M("pTooltip",i.texts.llm.fx.tooltip),l(),x(i.texts.llm.fx.label),l(2),Q(e.sideEffects)}}function jX(t,n){if(t&1&&(E(0,qX,5,3,"div",39),E(1,VX,5,3,"div",39),E(2,HX,6,2,"div",39)),t&2){let e=n,i=g(2);P(i.showLlmWhat?0:-1),l(),P(e.invocationExample?1:-1),l(),P(e.sideEffects!=null&&e.sideEffects.length?2:-1)}}function UX(t,n){if(t&1&&(p(0,"div",24),E(1,wX,3,3),E(2,MX,4,4),E(3,zX,5,5),E(4,jX,3,3),m()),t&2){let e,i,o,r,a=g();l(),P((e=a.summaryMarkdown())?1:-1,e),l(),P((i=a.summaryAgent())?2:-1,i),l(),P((o=a.summarySkill())?3:-1,o),l(),P((r=a.summaryCommand())?4:-1,r)}}function WX(t,n){if(t&1&&(p(0,"div",25),y(1),m()),t&2){let e=g();l(),x(e.description())}}function $X(t,n){if(t&1&&(p(0,"div",44)(1,"div",45)(2,"span",46),y(3),m(),p(4,"span",47),y(5),m()()()),t&2){let e=g(),i=g();l(3),x(i.texts.meta.model),l(2),x(e.model)}}function KX(t,n){t&1&&E(0,$X,6,2,"div",44),t&2&&P(n.model?0:-1)}function YX(t,n){if(t&1&&(p(0,"div",49),L(1,"i",50),p(2,"code",51),y(3),m(),p(4,"span",52),y(5),m()()),t&2){let e=n.$implicit;se("sm-gnode__issue--error",e.severity==="error")("sm-gnode__issue--warn",e.severity==="warn"),M("pTooltip",e.detail??e.analyzerId+" \xB7 "+e.message),l(),se("pi",!0)("pi-times-circle",e.severity==="error")("pi-exclamation-triangle",e.severity==="warn"),l(2),x(e.analyzerId),l(2),x(e.message)}}function XX(t,n){if(t&1&&(p(0,"div",26),Z(1,YX,6,13,"div",48,dX),m()),t&2){let e=g();l(),Q(e.visibleIssues())}}function ZX(t,n){if(t&1&&(p(0,"span",29),L(1,"i",53),p(2,"span",54),y(3),m()()),t&2){let e=g();M("pTooltip",e.texts.stats.errors(e.errorCount())),l(3),x(e.errorCount())}}function QX(t,n){if(t&1&&(p(0,"span",30),L(1,"i",55),p(2,"span",54),y(3),m()()),t&2){let e=g();M("pTooltip",e.texts.stats.warns(e.warnCount())),l(3),x(e.warnCount())}}var JX={selected:!1,highlighted:!1,dimmed:!1},xp=class t{node=F.required();stats=F({linksIn:0,linksOut:0});summary=F(null);issues=F([]);selection=F(JX);isFavorite=F(!1);favoriteToggle=Ge();texts=_i;showLlmWhat=!1;showLlmConfidence=!1;expanded=Wn(!1);fmAgent=D(()=>{let n=this.node();return n.kind==="agent"?n.frontmatter:null});summaryAgent=D(()=>{let n=this.summary();return n?.kind==="agent"?n:null});summarySkill=D(()=>{let n=this.summary();return n?.kind==="skill"?n:null});summaryCommand=D(()=>{let n=this.summary();return n?.kind==="command"?n:null});summaryMarkdown=D(()=>{let n=this.summary();return n?.kind==="markdown"?n:null});hasLlmCluster=D(()=>{let n=this.summary();return n===null?!1:this.showLlmWhat?!0:this.hasNonWhatLlmContent(n)});hasNonWhatLlmContent(n){switch(n.kind){case"markdown":return(n.topics?.length??0)>0||(n.keyFacts?.length??0)>0;case"agent":return!!n.whenToUse||!!n.interactionStyle||(n.capabilities?.length??0)>0;case"skill":return(n.recipe?.length??0)>0||(n.preconditions?.length??0)>0||(n.outputs?.length??0)>0||(n.sideEffects?.length??0)>0;case"command":return!!n.invocationExample||(n.sideEffects?.length??0)>0;default:return!1}}confidenceTier=D(()=>{let n=this.summary();return n?n.confidence>.8?"high":n.confidence>=.5?"med":"low":null});confidencePct=D(()=>{let n=this.summary();return n?Math.round(n.confidence*100):null});visibleIssues=D(()=>this.issues().filter(n=>n.severity==="error"||n.severity==="warn"));errorCount=D(()=>this.visibleIssues().filter(n=>n.severity==="error").length);warnCount=D(()=>this.visibleIssues().filter(n=>n.severity==="warn").length);nodeColor=D(()=>this.agentVendorColor());kindRegistry=u(Di);providerAccent=D(()=>null);providerChip=D(()=>vM(this.node().provider));bytesShort=D(()=>{let n=this.stats().bytesTotal;return n===void 0?null:ah(n)});tokensShort=D(()=>{let n=this.stats().tokensTotal;return n===void 0?null:ah(n)});version=D(()=>ba(this.node()));stability=D(()=>wa(this.node()));tagChips=D(()=>{let n=this.node(),e=[],o=n.frontmatter.tags;if(Array.isArray(o))for(let s of o)typeof s=="string"&&s.length>0&&e.push({tag:s,source:"author"});let a=n.sidecar?.annotations?.tags;if(Array.isArray(a))for(let s of a)typeof s=="string"&&s.length>0&&e.push({tag:s,source:"user"});else{let s=xa(n.frontmatter)?.tags;if(Array.isArray(s))for(let c of s)typeof c=="string"&&c.length>0&&e.push({tag:c,source:"user"})}return e});visibleTagChips=D(()=>this.tagChips().slice(0,3));moreTagsCount=D(()=>Math.max(0,this.tagChips().length-3));agentVendorColor=D(()=>{let n=this.node();if(n.kind!=="agent")return null;let i=n.frontmatter.color;return typeof i=="string"&&i.length>0?i:null});displayName=D(()=>{let n=this.node().frontmatter;return n.name?n.name:v_(this.node().path)});description=D(()=>this.node().frontmatter.description??"");toggleExpanded(n){n.stopPropagation(),this.expanded.update(e=>!e)}toggleFavorite(n){n.stopPropagation();let e=!this.isFavorite();this.favoriteToggle.emit({path:this.node().path,value:e})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-node-card"]],hostAttrs:[1,"sm-gnode"],hostVars:17,hostBindings:function(e,i){e&2&&(U("data-kind",i.node().kind),ft("--node-color",i.nodeColor())("--accent",i.providerAccent()),se("sm-gnode--with-color",!!i.nodeColor())("sm-gnode--deprecated",i.stability()==="deprecated")("sm-gnode--expanded",i.expanded())("sm-gnode--selected",i.selection().selected)("sm-gnode--highlighted",i.selection().highlighted)("sm-gnode--dimmed",i.selection().dimmed))},inputs:{node:[1,"node"],stats:[1,"stats"],summary:[1,"summary"],issues:[1,"issues"],selection:[1,"selection"],isFavorite:[1,"isFavorite"],expanded:[1,"expanded"]},outputs:{favoriteToggle:"favoriteToggle",expanded:"expandedChange"},decls:42,vars:38,consts:[[1,"sm-gnode__main"],["aria-hidden","true",1,"sm-gnode__icon-box"],[3,"kind","provider","size"],[1,"sm-gnode__content"],[1,"sm-gnode__name-row"],[1,"sm-gnode__name",3,"pTooltip"],["slot","card.title.right",3,"node"],[1,"sm-gnode__actions"],[1,"sm-gnode__confidence",3,"sm-gnode__llm-marker--low","sm-gnode__llm-marker--med","sm-gnode__llm-marker--high","pTooltip"],["data-testid","node-card-version",1,"sm-gnode__name-version"],["type","button",1,"sm-gnode__chevron",3,"click"],["aria-hidden","true",1,"pi","pi-chevron-down"],[1,"sm-gnode__sub"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--tokens",3,"pTooltip"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--bytes",3,"pTooltip"],["data-testid","node-card-provider",1,"sm-gnode__provider",3,"--provider-color","--provider-color-dark","pTooltip"],["type","button","data-testid","node-card-favorite",1,"sm-gnode__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["slot","card.subtitle.left",3,"node"],["data-testid","node-card-tags",1,"sm-gnode__tagrow"],[1,"sm-gnode__panel"],["data-testid","node-card-path",1,"sm-gnode__path",3,"pTooltip"],["aria-hidden","true",1,"fa-regular","fa-folder-open","sm-gnode__path-icon"],[1,"sm-gnode__path-value"],[1,"sm-gnode__llm"],[1,"sm-gnode__desc"],[1,"sm-gnode__issues-block"],[1,"sm-gnode__footer"],["slot","card.footer.left",3,"node"],[1,"sm-gnode__stat","sm-gnode__stat--error",3,"pTooltip"],[1,"sm-gnode__stat","sm-gnode__stat--warn",3,"pTooltip"],[1,"sm-gnode__footer-right-cluster"],["slot","card.footer.right",3,"node"],[1,"sm-gnode__confidence",3,"pTooltip"],[1,"sm-gnode__sub-key"],["data-testid","node-card-provider",1,"sm-gnode__provider",3,"pTooltip"],[1,"sm-gnode__tag-chip",3,"sm-gnode__tag-chip--author","sm-gnode__tag-chip--user"],["data-testid","node-card-tags-more",1,"sm-gnode__tag-more"],[1,"sm-gnode__tag-chip"],[1,"sm-gnode__llm-line"],[1,"sm-gnode__llm-label",3,"pTooltip"],[1,"sm-gnode__chips"],[1,"sm-gnode__chip","sm-gnode__chip--llm"],[1,"sm-gnode__llm-code"],[1,"sm-gnode__meta"],[1,"sm-gnode__meta-row"],[1,"sm-gnode__meta-label"],[1,"sm-gnode__meta-value","sm-gnode__meta-value--mono"],[1,"sm-gnode__issue",3,"sm-gnode__issue--error","sm-gnode__issue--warn","pTooltip"],[1,"sm-gnode__issue",3,"pTooltip"],["aria-hidden","true",1,"sm-gnode__issue-icon"],[1,"sm-gnode__issue-rule"],[1,"sm-gnode__issue-msg"],["aria-hidden","true",1,"fa-solid","fa-circle-xmark"],[1,"sm-gnode__stat-num"],["aria-hidden","true",1,"fa-solid","fa-triangle-exclamation"]],template:function(e,i){if(e&1&&(yt(0)(1)(2)(3)(4)(5),p(6,"div",0)(7,"div",1),L(8,"sm-kind-icon",2),m(),p(9,"div",3)(10,"div",4)(11,"span",5),y(12),m(),L(13,"sm-view-contributions-host",6),m()(),p(14,"div",7),E(15,lX,2,8,"span",8),E(16,uX,2,1,"span",9),p(17,"button",10),$("click",function(r){return i.toggleExpanded(r)}),L(18,"i",11),m()(),p(19,"div",12),E(20,fX,4,2,"span",13),E(21,pX,4,2,"span",14),E(22,hX,2,6,"span",15),p(23,"button",16),$("click",function(r){return i.toggleFavorite(r)}),L(24,"i",17),m(),L(25,"sm-view-contributions-host",18),m()(),E(26,_X,4,1,"div",19),p(27,"div",20)(28,"div",21),L(29,"i",22),p(30,"span",23),y(31),m()(),E(32,UX,5,4,"div",24),E(33,WX,2,1,"div",25),E(34,KX,1,1),E(35,XX,3,0,"div",26),m(),p(36,"div",27),L(37,"sm-view-contributions-host",28),E(38,ZX,4,2,"span",29),E(39,QX,4,2,"span",30),p(40,"div",31),L(41,"sm-view-contributions-host",32),m()()),e&2){let o,r,a,s=Xe(i.node());l();let c=Xe(i.summary());l(),Xe(i.stats()),l();let d=Xe(i.confidenceTier());l();let f=Xe(i.visibleTagChips());l(),Xe(i.moreTagsCount()),l(3),M("kind",s.kind)("provider",s.provider)("size",18),l(3),M("pTooltip",i.displayName()),l(),x(i.displayName()),l(),M("node",i.node()),l(2),P(i.showLlmConfidence&&c!==null&&d!==null?15:-1),l(),P((o=i.version())?16:-1,o),l(),U("aria-label",i.texts.ariaExpand),l(3),P(i.tokensShort()!==null?20:-1),l(),P(i.bytesShort()!==null?21:-1),l(),P((r=i.providerChip())?22:-1,r),l(),se("sm-gnode__favorite--on",i.isFavorite()),M("pTooltip",i.isFavorite()?i.texts.favoriteRemoveTooltip:i.texts.favoriteAddTooltip),U("aria-label",i.isFavorite()?i.texts.ariaFavoriteRemove:i.texts.ariaFavoriteAdd),l(),se("pi-star-fill",i.isFavorite())("pi-star",!i.isFavorite()),l(),M("node",i.node()),l(),P(f.length?26:-1),l(2),M("pTooltip",s.path),l(3),x(s.path),l(),P(i.hasLlmCluster()?32:-1),l(),P(i.description()?33:-1),l(),P((a=i.fmAgent())?34:-1,a),l(),P(i.visibleIssues().length?35:-1),l(2),M("node",i.node()),l(),P(i.errorCount()>0?38:-1),l(),P(i.warnCount()>0?39:-1),l(2),M("node",i.node())}},dependencies:[Ln,We,Ze,mn],styles:['[_nghost-%COMP%]{--accent: var(--sm-kind-markdown);position:relative;display:inline-block;width:260px;background:var(--sm-bg-content);border:1px solid var(--sm-border);border-radius:8px;box-shadow:var(--sm-shadow-card);overflow:hidden;transition:box-shadow .12s ease,border-color .12s ease,transform .12s ease;-webkit-user-select:none;user-select:none;text-align:start}[_nghost-%COMP%]:hover{box-shadow:var(--sm-shadow-card-hover)}[_nghost-%COMP%]:before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--accent)}[data-kind="skill"][_nghost-%COMP%]{--accent: var(--sm-kind-skill)}[data-kind="agent"][_nghost-%COMP%]{--accent: var(--sm-kind-agent)}[data-kind="command"][_nghost-%COMP%]{--accent: var(--sm-kind-command)}[data-kind="markdown"][_nghost-%COMP%]{--accent: var(--sm-kind-markdown)}.sm-gnode--deprecated[_nghost-%COMP%]{opacity:.55}.sm-gnode--selected[_nghost-%COMP%]{border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color),0 4px 16px color-mix(in srgb,var(--p-primary-color) 25%,transparent)}.sm-gnode--highlighted[_nghost-%COMP%]{border-color:var(--p-primary-color);box-shadow:var(--sm-shadow-card-hover)}.sm-gnode--dimmed[_nghost-%COMP%]{opacity:.25}.sm-gnode__main[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.6rem;row-gap:.3rem;align-items:start;padding:.6rem .65rem}.sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-markdown-bg);--kind-fg: var(--sm-kind-markdown-fg);width:38px;height:38px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--kind-bg);color:var(--kind-fg);flex:none;font-size:1.05rem;grid-row:1 / span 2;align-self:center}[data-kind="skill"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-skill-bg);--kind-fg: var(--sm-kind-skill-fg)}[data-kind="agent"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-agent-bg);--kind-fg: var(--sm-kind-agent-fg)}[data-kind="command"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-command-bg);--kind-fg: var(--sm-kind-command-fg)}[data-kind="markdown"][_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-markdown-bg);--kind-fg: var(--sm-kind-markdown-fg)}.sm-gnode__content[_ngcontent-%COMP%]{min-width:0;width:100%;justify-self:stretch;display:flex;flex-direction:column;gap:.15rem}.sm-gnode__name-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.35rem;min-width:0}.sm-gnode__name-row[_ngcontent-%COMP%] > sm-view-contributions-host[_ngcontent-%COMP%]{margin-left:auto;align-self:center}.sm-gnode__name[_ngcontent-%COMP%]{font-size:.9rem;font-weight:600;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--p-text-color);flex:0 1 auto;min-width:0}.sm-gnode__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.65rem;color:var(--sm-text-muted);background:color-mix(in srgb,var(--accent) 10%,transparent);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);line-height:1.2;flex:none;align-self:center}.sm-gnode--with-color[_nghost-%COMP%] .sm-gnode__name[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--node-color) 7%,transparent);padding:.05rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__actions[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.2rem}.sm-gnode__confidence[_ngcontent-%COMP%]{display:flex;align-items:flex-start;font-size:.65rem;font-weight:600;font-variant-numeric:tabular-nums;line-height:1;flex:none;cursor:help;padding-top:.35rem}.sm-gnode__llm-marker--high[_ngcontent-%COMP%]{color:var(--sm-severity-success)}.sm-gnode__llm-marker--med[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__llm-marker--low[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.sm-gnode__chevron[_ngcontent-%COMP%]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:var(--sm-text-muted);border-radius:var(--sm-radius-md);transition:transform .16s ease,background .12s ease,color .12s ease}.sm-gnode__chevron[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.7rem;line-height:1}.sm-gnode__chevron[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color)}.sm-gnode--expanded[_nghost-%COMP%] .sm-gnode__chevron[_ngcontent-%COMP%]{transform:rotate(180deg)}.sm-gnode__favorite[_ngcontent-%COMP%]{position:absolute;top:-3px;right:0;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;cursor:pointer;color:var(--sm-text-muted);border-radius:var(--sm-radius-md);flex:none;transition:background .12s ease,color .12s ease}.sm-gnode__favorite[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.8rem;line-height:1}.sm-gnode__favorite[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover);color:var(--p-text-color)}.sm-gnode__favorite--on[_ngcontent-%COMP%], .sm-gnode__favorite--on[_ngcontent-%COMP%]:hover{color:var(--p-primary-color)}.sm-gnode__sub[_ngcontent-%COMP%]{position:relative;grid-column:2 / -1;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-family:var(--sm-font-mono);font-size:.6rem;color:var(--sm-text-muted);line-height:1.2;margin-top:.1rem;min-width:0;width:100%;padding-right:28px}.sm-gnode__sub-stat[_ngcontent-%COMP%]{padding:.08rem .35rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);font-family:var(--sm-font-mono);font-size:.6rem;color:var(--sm-text-muted);font-weight:400;flex:none}.sm-gnode__sub-stat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.15rem}.sm-gnode__sub-stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.65rem}.sm-gnode__sub-key[_ngcontent-%COMP%]{font-weight:700}.sm-gnode__sub-stat--tokens[_ngcontent-%COMP%]{background:var(--sm-stat-tokens-bg)}.sm-gnode__sub-stat--bytes[_ngcontent-%COMP%]{background:var(--sm-stat-bytes-bg)}.sm-gnode__provider[_ngcontent-%COMP%]{padding:.08rem .4rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.6rem;font-weight:600;letter-spacing:.02em;color:var(--provider-color);background:color-mix(in srgb,var(--provider-color) 14%,transparent);flex:none;display:inline-flex;align-items:center}.app-dark[_nghost-%COMP%] .sm-gnode__provider[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__provider[_ngcontent-%COMP%]{color:var(--provider-color-dark);background:color-mix(in srgb,var(--provider-color-dark) 24%,transparent)}.sm-gnode__panel[_ngcontent-%COMP%]{display:none;border-top:1px solid var(--sm-border)}.sm-gnode--expanded[_nghost-%COMP%] .sm-gnode__panel[_ngcontent-%COMP%]{display:block}.sm-gnode__llm[_ngcontent-%COMP%]{padding:.5rem .7rem;display:flex;flex-direction:column;gap:.25rem;font-size:.75rem;line-height:1.4}.sm-gnode__llm-line[_ngcontent-%COMP%]{display:flex;gap:.4rem;align-items:baseline;color:var(--p-text-color);font-style:italic;min-width:0}.sm-gnode__llm-label[_ngcontent-%COMP%]{flex:none;font-style:normal;color:var(--sm-text-muted);font-size:.6rem;letter-spacing:.04em;text-transform:uppercase;font-weight:600;min-width:2.2rem;padding-top:.2rem;cursor:help}.sm-gnode__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.25rem;flex:1;min-width:0}.sm-gnode__chip[_ngcontent-%COMP%]{font-size:.65rem;padding:.1rem .4rem;border-radius:var(--sm-radius-sm);border:1px solid var(--sm-border);background:var(--sm-bg-hover);color:var(--p-text-color);line-height:1.3}.sm-gnode__chip--mono[_ngcontent-%COMP%]{font-family:var(--sm-font-mono)}.sm-gnode__chip--allowed[_ngcontent-%COMP%]{border-style:dashed;background:transparent;color:var(--sm-text-muted)}.sm-gnode__chip--llm[_ngcontent-%COMP%]{font-style:italic}.sm-gnode__chip-required[_ngcontent-%COMP%]{color:var(--sm-severity-error);margin-left:2px}.sm-gnode__llm-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);font-size:.7rem;font-style:normal;color:var(--p-text-color)}.sm-gnode__path[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;padding:.4rem .7rem;font-family:var(--sm-font-mono);font-size:.68rem;color:var(--sm-text-muted);background:var(--sm-bg-hover);border-top:1px solid var(--sm-border);min-width:0}.sm-gnode__path-icon[_ngcontent-%COMP%]{flex:none;font-size:.7rem;color:var(--sm-text-muted)}.sm-gnode__path-value[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;unicode-bidi:plaintext;text-align:left}.sm-gnode__desc[_ngcontent-%COMP%]{padding:.55rem .7rem;font-size:.78rem;line-height:1.45;color:var(--p-text-color);max-height:140px;overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--sm-border);scrollbar-width:thin;scrollbar-color:var(--sm-border) transparent}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.sm-gnode__desc[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--sm-border);border-radius:var(--sm-radius-sm)}.sm-gnode__meta[_ngcontent-%COMP%]{padding:.5rem .7rem;border-top:1px solid var(--sm-border);display:flex;flex-direction:column;gap:.35rem}.sm-gnode__meta-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;font-size:.7rem;min-width:0}.sm-gnode__meta-label[_ngcontent-%COMP%]{color:var(--sm-text-muted);text-transform:uppercase;letter-spacing:.04em;font-weight:600;font-size:.6rem;flex:none;min-width:60px;padding-top:.15rem}.sm-gnode__meta-value[_ngcontent-%COMP%]{color:var(--p-text-color);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm-gnode__meta-value--mono[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.08rem .4rem;border-radius:var(--sm-radius-sm);font-size:.68rem}.sm-gnode__issues-block[_ngcontent-%COMP%]{padding:.5rem .7rem;border-top:1px solid var(--sm-border);display:flex;flex-direction:column;gap:.25rem}.sm-gnode__issue[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.35rem;font-size:.7rem;line-height:1.35;min-width:0}.sm-gnode__issue-icon[_ngcontent-%COMP%]{font-size:.7rem;flex:none}.sm-gnode__issue--error[_ngcontent-%COMP%] .sm-gnode__issue-icon[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.sm-gnode__issue--warn[_ngcontent-%COMP%] .sm-gnode__issue-icon[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__issue-rule[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);color:var(--sm-text-muted);flex:none;font-size:.65rem}.sm-gnode__issue-msg[_ngcontent-%COMP%]{color:var(--p-text-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.sm-gnode__footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.7rem;min-height:1.4rem;padding:.4rem .7rem;border-top:1px solid var(--sm-border);background:var(--sm-bg-hover);font-size:.7rem;color:var(--sm-text-muted)}.sm-gnode__footer-right-cluster[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.7rem;margin-left:auto}.sm-gnode__stat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;line-height:1}.sm-gnode__stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.6rem;line-height:1;display:block}.sm-gnode__stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{transform:translateY(1px)}.sm-gnode__stat-num[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color);line-height:1;display:block}.sm-gnode__stat--error[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error);padding:.1rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__stat--error[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.sm-gnode__stat--warn[_ngcontent-%COMP%]{background:var(--sm-severity-warn-bg);color:var(--sm-severity-warn);padding:.1rem .4rem;border-radius:var(--sm-radius-sm)}.sm-gnode__stat--warn[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%], .sm-gnode__stat--stale[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__tagrow[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;padding:0 .65rem .35rem}.sm-gnode__tag-chip[_ngcontent-%COMP%]{font-size:.6rem;font-family:var(--sm-font-mono);padding:.05rem .35rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--sm-text-muted);border:1px solid var(--sm-border);line-height:1.4}.sm-gnode__tag-chip--author[_ngcontent-%COMP%]{background:transparent;border-color:var(--accent);color:var(--accent)}.sm-gnode__tag-more[_ngcontent-%COMP%]{font-size:.6rem;color:var(--sm-text-muted);font-style:italic}'],changeDetection:0})};var wM={a11y:{expand:"Expand performance HUD",collapse:"Collapse performance HUD"},units:{fps:t=>`${t} fps`,ms:t=>`${t}ms`,mb:t=>`${t} MB`,longTasks:t=>`${t} long`,domNodes:t=>`${t} dom`,nodes:(t,n)=>`${t}/${n} nodes`,edges:t=>`${t} edges`}};var eZ=["sparkline"],tZ=()=>({class:"perf-hud__content"}),nZ=t=>({content:t});function iZ(t,n){if(t&1&&(p(0,"span",9),y(1),m()),t&2){let e=g(2);l(),x(e.texts.units.mb(e.heapMb()))}}function oZ(t,n){if(t&1&&(p(0,"div",3)(1,"span",4),y(2),m()(),p(3,"div",5)(4,"div",6)(5,"div",7),L(6,"canvas",8,1),p(8,"span",9),y(9),m()(),p(10,"div",10)(11,"div",11),E(12,iZ,2,1,"span",9),p(13,"span",9),y(14),m(),p(15,"span",9),y(16),m()()(),p(17,"div",10)(18,"div",11)(19,"span",9),y(20),m(),p(21,"span",9),y(22),m()()()()()),t&2){let e=g();l(2),x(e.texts.units.fps(e.fps())),l(),U("aria-hidden",!e.expanded()),l(6),x(e.texts.units.ms(e.frameTimeMs())),l(3),P(e.hasHeap()?12:-1),l(2),x(e.texts.units.domNodes(e.domNodes())),l(2),x(e.texts.units.longTasks(e.longTasks())),l(4),x(e.texts.units.nodes(e.visible(),e.total())),l(2),x(e.texts.units.edges(e.edges()))}}var rZ=30,C_=60,bp=14,wp=class t{visible=F(0);total=F(0);edges=F(0);texts=wM;destroyRef=u(rt);zone=u(Vn);fps=j(0);frameTimeMs=j(0);fpsSamples=j([]);sparklineCanvas=ze("sparkline");heapMb=j(null);longTasks=j(0);domNodes=j(0);expanded=j(aZ());hasHeap=D(()=>this.heapMb()!==null);constructor(){let n=0,e=0,i=performance.now(),o=i,r=0,a=c=>{let d=c-i;if(i=c,n+=1,e+=d,c-o>=1e3){let f=(c-o)/1e3,h=Math.round(n/f);this.fps.set(h),this.frameTimeMs.set(Math.round(e/Math.max(n,1))),this.heapMb.set(cZ()),this.domNodes.set(document.querySelectorAll("*").length),this.fpsSamples.update(v=>{let b=v.length>=rZ?v.slice(1):v.slice();return b.push(h),b}),n=0,e=0,o=c}r=requestAnimationFrame(a)};this.zone.runOutsideAngular(()=>{r=requestAnimationFrame(a)});let s=null;if(typeof PerformanceObserver<"u")try{s=new PerformanceObserver(c=>{this.longTasks.update(d=>d+c.getEntries().length)}),s.observe({type:"longtask",buffered:!0})}catch{}this.destroyRef.onDestroy(()=>{cancelAnimationFrame(r),s?.disconnect()}),pe(()=>{let c=this.sparklineCanvas(),d=this.fpsSamples();c&&dZ(c.nativeElement,d)})}setExpanded(n){this.expanded.set(n),sZ(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-perf-hud"]],viewQuery:function(e,i){e&1&&Ot(i.sparklineCanvas,eZ,5),e&2&&_t()},inputs:{visible:[1,"visible"],total:[1,"total"],edges:[1,"edges"]},decls:3,vars:7,consts:[["content",""],["sparkline",""],["data-testid","perf-hud",3,"ngModelChange","ngModel","ariaLabel","styleClass","pt"],[1,"perf-hud__header"],[1,"perf-hud__cell","perf-hud__cell--fps"],[1,"perf-hud__expandable"],[1,"perf-hud__expandable-inner"],[1,"perf-hud__row","perf-hud__row--sparkline"],["aria-hidden","true",1,"perf-hud__sparkline"],[1,"perf-hud__cell"],[1,"perf-hud__section"],[1,"perf-hud__row"]],template:function(e,i){e&1&&(p(0,"p-togglebutton",2),$("ngModelChange",function(r){return i.setExpanded(r)}),be(1,oZ,23,8,"ng-template",null,0,Un),m()),e&2&&M("ngModel",i.expanded())("ariaLabel",i.expanded()?i.texts.a11y.collapse:i.texts.a11y.expand)("styleClass",i.expanded()?"perf-hud perf-hud--expanded":"perf-hud")("pt",Jt(5,nZ,jn(4,tZ)))},dependencies:[Ai,Ni,Ri,Li,Fi],styles:["[_nghost-%COMP%]{position:absolute;bottom:16px;left:16px;z-index:2;pointer-events:none}.perf-hud[_ngcontent-%COMP%]{pointer-events:auto;--p-togglebutton-padding: 0;--p-togglebutton-content-padding: .25rem .7rem;--p-togglebutton-border-radius: var(--sm-radius-pill);--p-togglebutton-content-border-radius: var(--sm-radius-pill);--p-togglebutton-gap: .4rem;--p-togglebutton-background: var(--sm-bg-content);--p-togglebutton-checked-background: var(--sm-bg-content);--p-togglebutton-hover-background: var(--sm-bg-content);--p-togglebutton-border-color: var(--sm-border);--p-togglebutton-checked-border-color: var(--sm-border);--p-togglebutton-content-checked-background: transparent;--p-togglebutton-color: var(--p-text-muted-color);--p-togglebutton-hover-color: var(--p-text-color);--p-togglebutton-checked-color: var(--p-text-muted-color);box-shadow:var(--sm-shadow-floating);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.7rem;font-weight:500;line-height:14px;opacity:.75;transition:opacity .15s ease,color .15s ease}.perf-hud[_ngcontent-%COMP%]:hover{opacity:1}.perf-hud--expanded[_ngcontent-%COMP%]{--p-togglebutton-border-radius: var(--sm-radius-md);--p-togglebutton-content-border-radius: var(--sm-radius-md);--p-togglebutton-content-padding: .45rem .7rem;line-height:1.35;opacity:.95}[_nghost-%COMP%] .perf-hud__content{display:flex;flex-direction:column;align-items:stretch;gap:0}.perf-hud__cell[_ngcontent-%COMP%]{white-space:nowrap;font-variant-numeric:tabular-nums}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__cell--fps[_ngcontent-%COMP%]{font-weight:600;color:var(--p-text-color)}.perf-hud__sparkline[_ngcontent-%COMP%]{width:60px;height:14px;opacity:.6}.perf-hud__header[_ngcontent-%COMP%]{display:flex;align-items:center}.perf-hud__expandable[_ngcontent-%COMP%]{display:grid;grid-template-rows:0fr;grid-template-columns:0fr;overflow:hidden;transition:grid-template-rows .22s ease,grid-template-columns .22s ease}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__expandable[_ngcontent-%COMP%]{grid-template-rows:1fr;grid-template-columns:1fr}.perf-hud__expandable-inner[_ngcontent-%COMP%]{min-height:0;min-width:0;overflow:hidden;display:flex;flex-direction:column;gap:.3rem;padding-top:0;transition:padding-top .22s ease}.perf-hud--expanded[_ngcontent-%COMP%] .perf-hud__expandable-inner[_ngcontent-%COMP%]{padding-top:.3rem}.perf-hud__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.15rem;padding-top:.3rem;border-top:1px solid var(--sm-border)}.perf-hud__section[_ngcontent-%COMP%]:first-child{padding-top:0;border-top:0}.perf-hud__row[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.6rem;white-space:nowrap}.perf-hud__row--sparkline[_ngcontent-%COMP%]{justify-content:space-between;gap:.6rem}"],changeDetection:0})},SM="sm.perf-hud.expanded";function aZ(){try{return localStorage.getItem(SM)==="1"}catch{return!1}}function sZ(t){try{localStorage.setItem(SM,t?"1":"0")}catch{}}function cZ(){let t=performance.memory;return t?Math.round(t.usedJSHeapSize/1024/1024):null}function dZ(t,n){let e=window.devicePixelRatio||1,i=C_*e,o=bp*e;(t.width!==i||t.height!==o)&&(t.width=i,t.height=o);let r=t.getContext("2d");if(!r||(r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,C_,bp),n.length<2))return;let a=Math.max(60,...n),s=C_/(n.length-1);r.beginPath();for(let c=0;c<n.length;c+=1){let d=c*s,f=bp-n[c]/a*bp;c===0?r.moveTo(d,f):r.lineTo(d,f)}r.strokeStyle=getComputedStyle(t).color,r.lineWidth=1,r.stroke()}var lZ="debug-perf",Sp=class t{visible=j(this.resolveInitial());resolveInitial(){let e=new URLSearchParams(window.location.search).get(lZ);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:xo.graph.perfHud}static \u0275fac=function(e){return new(e||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})};var IM=`
277
+ .p-card {
278
+ background: dt('card.background');
279
+ color: dt('card.color');
280
+ box-shadow: dt('card.shadow');
281
+ border-radius: dt('card.border.radius');
282
+ display: flex;
283
+ flex-direction: column;
284
+ }
285
+
286
+ .p-card-caption {
287
+ display: flex;
288
+ flex-direction: column;
289
+ gap: dt('card.caption.gap');
290
+ }
291
+
292
+ .p-card-body {
293
+ padding: dt('card.body.padding');
294
+ display: flex;
295
+ flex-direction: column;
296
+ gap: dt('card.body.gap');
297
+ }
298
+
299
+ .p-card-title {
300
+ font-size: dt('card.title.font.size');
301
+ font-weight: dt('card.title.font.weight');
302
+ }
303
+
304
+ .p-card-subtitle {
305
+ color: dt('card.subtitle.color');
306
+ }
307
+ `;var uZ=["header"],fZ=["title"],pZ=["subtitle"],hZ=["content"],mZ=["footer"],gZ=["*",[["p-header"]],[["p-footer"]]],_Z=["*","p-header","p-footer"];function yZ(t,n){t&1&&Ii(0)}function vZ(t,n){if(t&1&&(p(0,"div",1),Ae(1,1),be(2,yZ,1,0,"ng-container",2),m()),t&2){let e=g();Fe(e.cx("header")),M("pBind",e.ptm("header")),l(2),M("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)}}function CZ(t,n){if(t&1&&(Gn(0),y(1),Hn()),t&2){let e=g(2);l(),x(e.header)}}function xZ(t,n){t&1&&Ii(0)}function bZ(t,n){if(t&1&&(p(0,"div",1),be(1,CZ,2,1,"ng-container",3)(2,xZ,1,0,"ng-container",2),m()),t&2){let e=g();Fe(e.cx("title")),M("pBind",e.ptm("title")),l(),M("ngIf",e.header&&!e._titleTemplate&&!e.titleTemplate),l(),M("ngTemplateOutlet",e.titleTemplate||e._titleTemplate)}}function wZ(t,n){if(t&1&&(Gn(0),y(1),Hn()),t&2){let e=g(2);l(),x(e.subheader)}}function SZ(t,n){t&1&&Ii(0)}function IZ(t,n){if(t&1&&(p(0,"div",1),be(1,wZ,2,1,"ng-container",3)(2,SZ,1,0,"ng-container",2),m()),t&2){let e=g();Fe(e.cx("subtitle")),M("pBind",e.ptm("subtitle")),l(),M("ngIf",e.subheader&&!e._subtitleTemplate&&!e.subtitleTemplate),l(),M("ngTemplateOutlet",e.subtitleTemplate||e._subtitleTemplate)}}function TZ(t,n){t&1&&Ii(0)}function EZ(t,n){t&1&&Ii(0)}function PZ(t,n){if(t&1&&(p(0,"div",1),Ae(1,2),be(2,EZ,1,0,"ng-container",2),m()),t&2){let e=g();Fe(e.cx("footer")),M("pBind",e.ptm("footer")),l(2),M("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var MZ=`
308
+ ${IM}
309
+
310
+ .p-card {
311
+ display: block;
312
+ }
313
+ `,kZ={root:"p-card p-component",header:"p-card-header",body:"p-card-body",caption:"p-card-caption",title:"p-card-title",subtitle:"p-card-subtitle",content:"p-card-content",footer:"p-card-footer"},TM=(()=>{class t extends pa{name="card";style=MZ;classes=kZ;static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275prov=C({token:t,factory:t.\u0275fac})}return t})();var EM=new he("CARD_INSTANCE"),Kr=(()=>{class t extends ma{componentName="Card";$pcCard=u(EM,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=u(zt,{self:!0});_componentStyle=u(TM);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}header;subheader;set style(e){o0(this._style(),e)||(this._style.set(e),this.el?.nativeElement&&e&&Object.keys(e).forEach(i=>{this.el.nativeElement.style[i]=e[i]}))}get style(){return this._style()}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=j(null);getBlockableElement(){return this.el.nativeElement}templates;onAfterContentInit(){this.templates.forEach(e=>{switch(e.getType()){case"header":this._headerTemplate=e.template;break;case"title":this._titleTemplate=e.template;break;case"subtitle":this._subtitleTemplate=e.template;break;case"content":this._contentTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;default:this._contentTemplate=e.template;break}})}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ie(t)))(o||t)}})();static \u0275cmp=J({type:t,selectors:[["p-card"]],contentQueries:function(i,o,r){if(i&1&&sa(r,a0,5)(r,s0,5)(r,uZ,4)(r,fZ,4)(r,pZ,4)(r,hZ,4)(r,mZ,4)(r,un,4),i&2){let a;St(a=It())&&(o.headerFacet=a.first),St(a=It())&&(o.footerFacet=a.first),St(a=It())&&(o.headerTemplate=a.first),St(a=It())&&(o.titleTemplate=a.first),St(a=It())&&(o.subtitleTemplate=a.first),St(a=It())&&(o.contentTemplate=a.first),St(a=It())&&(o.footerTemplate=a.first),St(a=It())&&(o.templates=a)}},hostVars:4,hostBindings:function(i,o){i&2&&(ca(o._style()),Fe(o.cn(o.cx("root"),o.styleClass)))},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[we([TM,{provide:EM,useExisting:t},{provide:ha,useExisting:t}]),oa([zt]),ve],ngContentSelectors:_Z,decls:8,vars:11,consts:[[3,"pBind","class",4,"ngIf"],[3,"pBind"],[4,"ngTemplateOutlet"],[4,"ngIf"]],template:function(i,o){i&1&&(Zt(gZ),be(0,vZ,3,4,"div",0),p(1,"div",1),be(2,bZ,3,5,"div",0)(3,IZ,3,5,"div",0),p(4,"div",1),Ae(5),be(6,TZ,1,0,"ng-container",2),m(),be(7,PZ,3,4,"div",0),m()),i&2&&(M("ngIf",o.headerFacet||o.headerTemplate||o._headerTemplate),l(),Fe(o.cx("body")),M("pBind",o.ptm("body")),l(),M("ngIf",o.header||o.titleTemplate||o._titleTemplate),l(),M("ngIf",o.subheader||o.subtitleTemplate||o._subtitleTemplate),l(),Fe(o.cx("content")),M("pBind",o.ptm("content")),l(2),M("ngTemplateOutlet",o.contentTemplate||o._contentTemplate),l(),M("ngIf",o.footerFacet||o.footerTemplate||o._footerTemplate))},dependencies:[Ti,Y_,la,fn,ga,zt],encapsulation:2,changeDetection:0})}return t})(),Ip=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Si({type:t});static \u0275inj=xi({imports:[Kr,fn,ga,fn,ga]})}return t})();var zn={emptyNoSelection:{title:"No node selected",descPrefix:"Pick a node from the ",listLink:"list",descMiddle:" or ",graphLink:"graph",descSuffix:"."},emptyNotFound:{title:"Node not found",descSuffix:" does not exist in the collection. ",backLink:"Back to list",descAfterLink:"."},backToList:"\u2190 back to list",cards:{agent:"Agent",body:"Body"},body:{loading:"Loading body\u2026",empty:"This file has no body content (only frontmatter).",unavailable:"Body content unavailable. The source file may have moved or been deleted since the last scan.",renderError:"Failed to render markdown body.",refreshLabel:"Refresh body"},placeholders:{enrichmentTitle:"Enrichment",summaryTitle:"Summary",findingsTitle:"Findings",body:"Available in v0.8.0"},cardsAnnotations:"Annotations",bump:{label:"Bump version",tooltipEnabled:"Increment the sidecar version and refresh hashes.",tooltipDisabledFresh:"No drift detected (bump is only available when the body or frontmatter has changed since the last bump).",errorPrefix:"Bump failed:",errorFresh:"This node is fresh; nothing to bump.",errorNotFound:"Node not found on the server.",errorGeneric:"Could not bump the sidecar.",consentHeader:"Save extra info alongside your files?",consentMessage:`Skill-map can keep a small companion file (*.sm) next to each of your markdown files. It tracks version, history and tags so you can see how each one evolves over time.
314
+
315
+ We use a separate \`.sm\` file so your markdown stays clean, no metadata gets mixed into the content you wrote.
316
+
317
+ Your preference stays on your computer, it does not travel with the project, and we won't ask again.`,consentAccept:"Yes, allow",consentReject:"Not now",consentDialogAriaLabel:"Sidecar consent"},stats:{bytes:"Bytes",tokens:"Tokens",links:"Links",out:"out",in:"in",ext:"ext"},pluginsHeader:"Plugin contributions",audit:{header:"Audit",headerSummary:(t,n)=>`last bumped ${t} by ${n}`,headerEmpty:"never bumped",fields:{lastBumpedAt:"Last bumped",lastBumpedBy:"by",createdAt:"Created",createdBy:"by"}},supersededByBanner:t=>`Superseded by ${t}`,debugToggleAriaLabel:"Toggle debug panel",debugToggleTooltip:"Show diagnostic fields (hash diffs, resolved provider/kind, sidecar status enum).",close:{label:"Close",tooltip:"Close inspector"}};var Tp=class t{dataSource=u(pn);wsEvents=u(Ca);loader=u(hn);destroyRef=u(rt);constructor(){this.wsEvents.sidecarBumped$.pipe(ki(this.destroyRef)).subscribe(n=>{this.loader.patchSidecarFromBump({nodePath:n.data.nodePath,version:n.data.version,status:n.data.status})})}async bump(n,e={}){return this.dataSource.bumpSidecar(n,e)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=C({token:t,factory:t.\u0275fac,providedIn:"root"})};var MM={cardHeader:"Annotations",emptyOverlay:"No sidecar (.sm) file present for this node.",emptyAnnotations:"Sidecar present but no annotations are declared yet.",sections:{lifecycle:"Lifecycle",supersession:"Supersession",provenance:"Provenance",taxonomy:"Taxonomy",docs:"Docs"},fields:{version:"Version",stability:"Stability",supersedes:"Supersedes",supersededBy:"Superseded by",authors:"Authors",license:"License",source:"Source",sourceVersion:"Source version",tags:"Tags",docsUrl:"Docs URL"},brokenRefTooltip:"This path does not resolve to a node in the current scan scope."};var NZ=(t,n)=>"a:"+n,RZ=(t,n)=>"u:"+n;function AZ(t,n){if(t&1&&(p(0,"p",0),y(1),m()),t&2){let e=g(2);l(),x(e.texts.emptyOverlay)}}function FZ(t,n){if(t&1&&(p(0,"p",1),y(1),m()),t&2){let e=g(2);l(),x(e.texts.emptyAnnotations)}}function LZ(t,n){if(t&1&&E(0,AZ,2,1,"p",0)(1,FZ,2,1,"p",1),t&2){let e,i=g();P((e=i.overlay())!=null&&e.present?1:0)}}function BZ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd",9)(3,"code"),y(4),m()()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.version),l(3),x(e.version)}}function zZ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd"),L(3,"p-tag",10),m()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.stability),l(2),M("value",e.stability)("severity",i.stabilitySeverity(e.stability))("rounded",!0)}}function qZ(t,n){if(t&1&&(yt(0),p(1,"section",2)(2,"h4",7),y(3),m(),p(4,"dl",8),E(5,BZ,5,2),E(6,zZ,4,4),m()()),t&2){let e=g(2),i=Xe(e.lifecycle());l(3),x(e.texts.sections.lifecycle),l(2),P(i.version!==null?5:-1),l(),P(i.stability!==null?6:-1)}}function VZ(t,n){if(t&1){let e=de();p(0,"h5"),y(1),m(),p(2,"div",11)(3,"p-chip",12),$("click",function(){G(e),g();let o=ne(0),r=g(2);return H(r.onOpenPath(o.supersededBy))}),m()()}if(t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.supersededBy),l(2),M("label",e.supersededBy)("styleClass",i.isBroken(e.supersededBy)?"chip--broken":"chip--link")("pTooltip",i.isBroken(e.supersededBy)?i.texts.brokenRefTooltip:"")}}function GZ(t,n){if(t&1){let e=de();p(0,"p-chip",12),$("click",function(){let o=G(e).$implicit,r=g(4);return H(r.onOpenPath(o))}),m()}if(t&2){let e=n.$implicit,i=g(4);M("label",e)("styleClass",i.isBroken(e)?"chip--broken":"chip--link")("pTooltip",i.isBroken(e)?i.texts.brokenRefTooltip:"")}}function HZ(t,n){if(t&1&&(p(0,"h5"),y(1),m(),p(2,"div",11),Z(3,GZ,1,3,"p-chip",13,Te),m()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.supersedes),l(2),Q(e.supersedes)}}function jZ(t,n){if(t&1&&(yt(0),p(1,"section",3)(2,"h4",7),y(3),m(),E(4,VZ,4,4),E(5,HZ,5,1),m()),t&2){let e=g(2),i=Xe(e.supersession());l(3),x(e.texts.sections.supersession),l(),P(i.supersededBy!==null?4:-1),l(),P(i.supersedes.length?5:-1)}}function UZ(t,n){if(t&1&&L(0,"p-chip",14),t&2){let e=n.$implicit;M("label",e)}}function WZ(t,n){if(t&1&&(p(0,"h5"),y(1),m(),p(2,"div",11),Z(3,UZ,1,1,"p-chip",14,Te),m()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.authors),l(2),Q(e.authors)}}function $Z(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd"),y(3),m()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.license),l(2),x(e.license)}}function KZ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"a",15),y(4),m()()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.source),l(2),M("href",e.source,Eo),l(),x(e.source)}}function YZ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.sourceVersion),l(3),x(e.sourceVersion)}}function XZ(t,n){if(t&1&&(yt(0),p(1,"section",4)(2,"h4",7),y(3),m(),E(4,WZ,5,1),p(5,"dl",8),E(6,$Z,4,2),E(7,KZ,5,3),E(8,YZ,5,2),m()()),t&2){let e=g(2),i=Xe(e.provenance());l(3),x(e.texts.sections.provenance),l(),P(i.authors.length?4:-1),l(2),P(i.license!==null?6:-1),l(),P(i.source!==null?7:-1),l(),P(i.sourceVersion!==null?8:-1)}}function ZZ(t,n){if(t&1){let e=de();p(0,"p-chip",19),$("click",function(){let o=G(e).$implicit,r=g(3);return H(r.tagClick.emit(o))})("keydown.enter",function(){let o=G(e).$implicit,r=g(3);return H(r.tagClick.emit(o))})("keydown.space",function(o){let r=G(e).$implicit;return g(3).tagClick.emit(r),H(o.preventDefault())}),m()}if(t&2){let e=n.$implicit,i=g(3);M("label",e)("styleClass","ann-panel__chip ann-panel__chip--author"+(i.isActiveTag(e)?" ann-panel__chip--active":""))}}function QZ(t,n){if(t&1){let e=de();p(0,"p-chip",20),$("click",function(){let o=G(e).$implicit,r=g(3);return H(r.tagClick.emit(o))})("keydown.enter",function(){let o=G(e).$implicit,r=g(3);return H(r.tagClick.emit(o))})("keydown.space",function(o){let r=G(e).$implicit;return g(3).tagClick.emit(r),H(o.preventDefault())}),m()}if(t&2){let e=n.$implicit,i=g(3);M("label",e)("styleClass","ann-panel__chip ann-panel__chip--user"+(i.isActiveTag(e)?" ann-panel__chip--active":""))}}function JZ(t,n){if(t&1&&(p(0,"section",5)(1,"h4",7),y(2),m(),p(3,"h5"),y(4),m(),p(5,"div",16),Z(6,ZZ,1,2,"p-chip",17,NZ),Z(8,QZ,1,2,"p-chip",18,RZ),m()()),t&2){let e=g(2),i=e.taxonomy();l(2),x(e.texts.sections.taxonomy),l(2),x(e.texts.fields.tags),l(2),Q(i.authorTags),l(2),Q(i.userTags)}}function eQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"a",15),y(4),m()()),t&2){g();let e=ne(0),i=g(2);l(),x(i.texts.fields.docsUrl),l(2),M("href",e.docsUrl,Eo),l(),x(e.docsUrl)}}function tQ(t,n){if(t&1&&(yt(0),p(1,"section",6)(2,"h4",7),y(3),m(),p(4,"dl",8),E(5,eQ,5,3),m()()),t&2){let e=g(2),i=Xe(e.docs());l(3),x(e.texts.sections.docs),l(2),P(i.docsUrl!==null?5:-1)}}function nQ(t,n){if(t&1&&(E(0,qZ,7,4,"section",2),E(1,jZ,6,4,"section",3),E(2,XZ,9,6,"section",4),E(3,JZ,10,2,"section",5),E(4,tQ,6,3,"section",6)),t&2){let e=g();P(e.hasLifecycle()?0:-1),l(),P(e.hasSupersession()?1:-1),l(),P(e.hasProvenance()?2:-1),l(),P(e.hasTaxonomy()?3:-1),l(),P(e.hasDocs()?4:-1)}}var Pp=class t{overlay=F(void 0);authorTags=F([]);knownPaths=F(null);openPath=Ge();tagClick=Ge();activeTag=F(null);isActiveTag(n){return this.activeTag()===n}texts=MM;annotations=D(()=>{let n=this.overlay();return!n||!n.present?null:n.annotations??null});hasAnnotations=D(()=>{let n=this.annotations();return n!==null&&Object.keys(n).length>0});hasAnyContent=D(()=>this.hasLifecycle()||this.hasSupersession()||this.hasProvenance()||this.hasTaxonomy()||this.hasDocs());lifecycle=D(()=>{let n=this.annotations()??{};return{version:iQ(n.version),stability:oQ(n.stability)}});hasLifecycle=D(()=>Ep(this.lifecycle()));supersession=D(()=>{let n=this.annotations()??{};return{supersedes:b_(n.supersedes),supersededBy:x_(n.supersededBy)}});hasSupersession=D(()=>Ep(this.supersession()));provenance=D(()=>{let n=this.annotations()??{};return{authors:b_(n.authors),license:x_(n.license),source:kM(n.source),sourceVersion:x_(n.sourceVersion)}});hasProvenance=D(()=>Ep(this.provenance()));taxonomy=D(()=>{let n=this.annotations()??{};return{authorTags:this.authorTags(),userTags:b_(n.tags)}});hasTaxonomy=D(()=>{let n=this.taxonomy();return n.authorTags.length>0||n.userTags.length>0});docs=D(()=>{let n=this.annotations()??{};return{docsUrl:kM(n.docsUrl)}});hasDocs=D(()=>Ep(this.docs()));stabilitySeverity(n){return v0[n]}isBroken(n){let e=this.knownPaths();return e?!e.has(n):!1}onOpenPath(n){this.isBroken(n)||this.openPath.emit(n)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-annotations-panel"]],inputs:{overlay:[1,"overlay"],authorTags:[1,"authorTags"],knownPaths:[1,"knownPaths"],activeTag:[1,"activeTag"]},outputs:{openPath:"openPath",tagClick:"tagClick"},decls:2,vars:1,consts:[["data-testid","annotations-panel-empty-overlay",1,"ann-panel__empty"],["data-testid","annotations-panel-empty-annotations",1,"ann-panel__empty"],["data-testid","annotations-section-lifecycle",1,"ann-panel__section"],["data-testid","annotations-section-supersession",1,"ann-panel__section"],["data-testid","annotations-section-provenance",1,"ann-panel__section"],["data-testid","annotations-section-taxonomy",1,"ann-panel__section"],["data-testid","annotations-section-docs",1,"ann-panel__section"],[1,"ann-panel__section-title"],[1,"ann-panel__kv"],["data-testid","annotations-version"],["data-testid","annotations-stability",3,"value","severity","rounded"],[1,"ann-panel__chips"],[3,"click","label","styleClass","pTooltip"],[3,"label","styleClass","pTooltip"],[3,"label"],["target","_blank","rel","noopener noreferrer",3,"href"],["data-testid","annotations-tags",1,"ann-panel__chips"],["data-tag-source","author","role","button","tabindex","0",3,"label","styleClass"],["data-tag-source","user","role","button","tabindex","0",3,"label","styleClass"],["data-tag-source","author","role","button","tabindex","0",3,"click","keydown.enter","keydown.space","label","styleClass"],["data-tag-source","user","role","button","tabindex","0",3,"click","keydown.enter","keydown.space","label","styleClass"]],template:function(e,i){e&1&&E(0,LZ,2,1)(1,nQ,5,5),e&2&&P(i.hasAnyContent()?1:0)},dependencies:[Bi,Sa,Ta,Ia,We,Ze],styles:["[_nghost-%COMP%]{display:block}.ann-panel__empty[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-style:italic;font-size:.85rem;margin:0}.ann-panel__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;padding:.4rem 0}.ann-panel__section[_ngcontent-%COMP%] + .ann-panel__section[_ngcontent-%COMP%]{border-top:1px solid var(--sm-border);padding-top:.6rem}.ann-panel__section-title[_ngcontent-%COMP%]{font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;color:var(--sm-text-muted);margin:0 0 .2rem;font-weight:600}.ann-panel__section[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{margin:.4rem 0 .2rem;font-size:.78rem;font-weight:600;color:var(--p-text-color)}.ann-panel__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.85rem}.ann-panel__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500}.ann-panel__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;color:var(--p-text-color);word-break:break-word}.ann-panel__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.3rem}[_nghost-%COMP%] .chip--broken{background:var(--sm-bg-hover);color:var(--sm-text-muted);text-decoration:line-through;cursor:not-allowed}[_nghost-%COMP%] .ann-panel__chip--author{background:transparent;border:1px solid var(--p-primary-color);color:var(--p-primary-color)}[_nghost-%COMP%] .ann-panel__chip--user{background:var(--p-chip-background);color:var(--p-chip-color)}[_nghost-%COMP%] .ann-panel__chip--author, [_nghost-%COMP%] .ann-panel__chip--user{cursor:pointer;transition:filter .1s ease,box-shadow .1s ease}[_nghost-%COMP%] .ann-panel__chip--author:hover, [_nghost-%COMP%] .ann-panel__chip--user:hover{filter:brightness(1.05)}[_nghost-%COMP%] .ann-panel__chip--author:focus-visible, [_nghost-%COMP%] .ann-panel__chip--user:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}[_nghost-%COMP%] .ann-panel__chip--active{background:var(--p-primary-color);color:var(--p-primary-color-text);border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-200)}"],changeDetection:0})};function iQ(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function x_(t){return typeof t=="string"&&t.length>0?t:null}function kM(t){if(typeof t!="string"||t.length===0)return null;try{let n=new URL(t);return n.protocol==="http:"||n.protocol==="https:"?t:null}catch{return null}}function oQ(t){return t==="stable"||t==="experimental"||t==="deprecated"?t:null}function b_(t){return Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.length>0):[]}function Ep(t){for(let n of Object.values(t))if(n!=null){if(Array.isArray(n)){if(n.length>0)return!0;continue}if(typeof n=="string"){if(n.length>0)return!0;continue}return!0}return!1}var Mp=class t{title=F.required();body=F.required();icon=F("pi pi-clock");testId=F(null);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-empty-state"]],inputs:{title:[1,"title"],body:[1,"body"],icon:[1,"icon"],testId:[1,"testId"]},decls:6,vars:5,consts:[[1,"empty-state-card"],["aria-hidden","true",1,"empty-state-card__icon"],[1,"empty-state-card__title"],[1,"empty-state-card__body"]],template:function(e,i){if(e&1&&(K(0,"div",0),dn(1,"span",1),K(2,"p",2),y(3),Y(),K(4,"p",3),y(5),Y()()),e&2){let o=i.testId();U("data-testid",o),l(),Fe(i.icon()),l(2),x(i.title()),l(2),x(i.body())}},styles:["[_nghost-%COMP%]{display:block}.empty-state-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;padding:1rem 1.25rem;border:1px dashed var(--p-content-border-color);border-radius:var(--p-border-radius-md);background:var(--p-content-background);color:var(--p-text-muted-color)}.empty-state-card__icon[_ngcontent-%COMP%]{font-size:1.25rem;color:var(--p-text-muted-color);opacity:.7}.empty-state-card__title[_ngcontent-%COMP%]{margin:0;font-weight:600;color:var(--p-text-color)}.empty-state-card__body[_ngcontent-%COMP%]{margin:0;font-size:.85rem;line-height:1.4}"],changeDetection:0})};var DM={cardHeader:"Linked nodes",refreshLabel:"Refresh links",outgoingHeader:"Outgoing",incomingHeader:"Incoming",findingsHeader:"Findings",emptyFindings:"No findings on this node.",loading:"Loading links\u2026",error:"Failed to load links.",emptyOutgoing:"No outgoing links from this node.",emptyIncoming:"No incoming links to this node.",confidence:{high:"high",medium:"medium",low:"low"},sourcesPrefix:"detected by ",sourcesSeparator:", ",issueOnTargetTooltip:"Target has an issue: ",issueOnSourceTooltip:"Source has an issue: ",occurrencesHeader:"Occurs at:",occurrencesItem:"line {{line}} \xB7 `{{trigger}}` ({{extractor}})",occurrencesItemUnknownLine:"`{{trigger}}` ({{extractor}})",externalRefsHeader:"External references",emptyExternalRefs:"No external URLs in this node's body.",externalRefsItemLine:"line {{line}}",externalRefsItemUnknownLine:"unknown line"};var aQ=(t,n)=>n.url+"|"+(n.line??-1),sQ=(t,n)=>n.analyzerId+"|"+((n.data==null?null:n.data.target)??"")+"|"+n.message,RM=(t,n)=>n.source+"|"+n.target+"|"+n.kind+"|"+((n.trigger==null?null:n.trigger.normalizedTrigger)??""),AM=(t,n)=>n.extractor+"|"+n.originalTrigger+"|"+((n.location==null?null:n.location.line)??-1);function cQ(t,n){if(t&1){let e=de();p(0,"div",4)(1,"h3",5),y(2),m(),p(3,"p-button",6),$("onClick",function(){G(e);let o=g(2);return H(o.refresh())}),m()()}if(t&2){let e=g(2);l(2),x(e.texts.cardHeader),l(),M("rounded",!0)("text",!0)("ariaLabel",e.texts.refreshLabel)("pTooltip",e.texts.refreshLabel)("disabled",e.state()==="loading")}}function dQ(t,n){if(t&1&&(p(0,"p",2),y(1),m()),t&2){let e=g(2);l(),x(e.texts.loading)}}function lQ(t,n){if(t&1&&(p(0,"p",3),y(1),m()),t&2){let e=g(2);l(),x(e.texts.error)}}function uQ(t,n){if(t&1&&y(0),t&2){let e=g().$implicit,i=g(4);Le(" ",i.texts.externalRefsItemLine.replace("{{line}}",e.line.toString())," ")}}function fQ(t,n){if(t&1&&y(0),t&2){let e=g(5);Le(" ",e.texts.externalRefsItemUnknownLine," ")}}function pQ(t,n){if(t&1&&(p(0,"li",16)(1,"span",17),E(2,uQ,1,1)(3,fQ,1,1),m(),p(4,"a",18),y(5),m()()),t&2){let e=n.$implicit;U("data-testid","linked-nodes-external-ref-"+e.url),l(2),P(e.line?2:3),l(2),M("href",e.url,Eo),l(),x(e.url)}}function hQ(t,n){if(t&1&&(p(0,"section",7)(1,"h4",9),y(2),m(),p(3,"ul",11),Z(4,pQ,6,4,"li",16,aQ),m()()),t&2){let e=g(3);l(2),x(e.texts.externalRefsHeader),l(2),Q(e.externalRefs())}}function mQ(t,n){if(t&1&&(p(0,"p",10),y(1),m()),t&2){let e=g(3);l(),x(e.texts.emptyFindings)}}function gQ(t,n){if(t&1&&(p(0,"li",19),L(1,"p-tag",20),p(2,"span",21),y(3),m()()),t&2){let e=n.$implicit,i=g(4);U("data-testid","linked-nodes-finding-"+e.analyzerId),l(),M("value",e.analyzerId)("severity",i.issueSeverity(e.severity))("rounded",!0),l(2),x(e.message)}}function _Q(t,n){if(t&1&&(p(0,"ul",11),Z(1,gQ,4,5,"li",19,sQ),m()),t&2){let e=g(3);l(),Q(e.findings())}}function yQ(t,n){if(t&1&&(p(0,"p",13),y(1),m()),t&2){let e=g(3);l(),x(e.texts.emptyOutgoing)}}function vQ(t,n){if(t&1&&L(0,"p-tag",25),t&2){let e=n,i=g().$implicit,o=g(4);M("value",e.analyzerId)("severity",o.issueSeverity(e.severity))("rounded",!0)("pTooltip",e.message),U("data-testid","linked-nodes-outgoing-issue-"+i.target)}}function CQ(t,n){if(t&1&&(p(0,"span",26),y(1),m()),t&2){let e=g().$implicit,i=g(4);l(),Po(" ",i.texts.sourcesPrefix,"",e.sources.join(i.texts.sourcesSeparator)," ")}}function xQ(t,n){if(t&1&&(p(0,"li",29),y(1),m()),t&2){let e=n.$implicit,i=g(6);l(),x(i.occurrenceLabel(e))}}function bQ(t,n){if(t&1&&(p(0,"ul",27)(1,"li",28),y(2),m(),Z(3,xQ,2,1,"li",29,AM),m()),t&2){let e=g().$implicit,i=g(4);U("data-testid","linked-nodes-occurrences-"+e.target),l(2),x(i.texts.occurrencesHeader),l(),Q(e.occurrences)}}function wQ(t,n){if(t&1){let e=de();p(0,"li",22),L(1,"p-tag",23),p(2,"p-button",24),$("onClick",function(){let o=G(e).$implicit,r=g(4);return H(r.onOpen(o.target))}),m(),L(3,"p-tag",25),E(4,vQ,1,5,"p-tag",25),E(5,CQ,2,2,"span",26),E(6,bQ,5,2,"ul",27),m()}if(t&2){let e,i=n.$implicit,o=g(4);U("data-testid","linked-nodes-outgoing-row-"+i.target),l(),M("value",i.kind)("severity",o.kindSeverity(i.kind)),l(),M("link",!0)("label",i.target),U("data-testid","linked-nodes-outgoing-link-"+i.target),l(),M("value",o.confidenceValue(i.confidence))("severity",o.confidenceSeverity(i.confidence))("rounded",!0)("pTooltip",o.confidenceLabel(i.confidence)),l(),P((e=o.issueForOutgoing(i))?4:-1,e),l(),P(i.sources.length?5:-1),l(),P(i.occurrences&&i.occurrences.length>0?6:-1)}}function SQ(t,n){if(t&1&&(p(0,"ul",11),Z(1,wQ,7,13,"li",22,RM),m()),t&2){let e=g(3);l(),Q(e.outgoing())}}function IQ(t,n){if(t&1&&(p(0,"p",15),y(1),m()),t&2){let e=g(3);l(),x(e.texts.emptyIncoming)}}function TQ(t,n){if(t&1&&L(0,"p-tag",25),t&2){let e=n,i=g().$implicit,o=g(4);M("value",e.analyzerId)("severity",o.issueSeverity(e.severity))("rounded",!0)("pTooltip",e.message),U("data-testid","linked-nodes-incoming-issue-"+i.source)}}function EQ(t,n){if(t&1&&(p(0,"span",26),y(1),m()),t&2){let e=g().$implicit,i=g(4);l(),Po(" ",i.texts.sourcesPrefix,"",e.sources.join(i.texts.sourcesSeparator)," ")}}function PQ(t,n){if(t&1&&(p(0,"li",29),y(1),m()),t&2){let e=n.$implicit,i=g(6);l(),x(i.occurrenceLabel(e))}}function MQ(t,n){if(t&1&&(p(0,"ul",27)(1,"li",28),y(2),m(),Z(3,PQ,2,1,"li",29,AM),m()),t&2){let e=g().$implicit,i=g(4);U("data-testid","linked-nodes-occurrences-"+e.target),l(2),x(i.texts.occurrencesHeader),l(),Q(e.occurrences)}}function kQ(t,n){if(t&1){let e=de();p(0,"li",22),L(1,"p-tag",23),p(2,"p-button",24),$("onClick",function(){let o=G(e).$implicit,r=g(4);return H(r.onOpen(o.source))}),m(),L(3,"p-tag",25),E(4,TQ,1,5,"p-tag",25),E(5,EQ,2,2,"span",26),E(6,MQ,5,2,"ul",27),m()}if(t&2){let e,i=n.$implicit,o=g(4);U("data-testid","linked-nodes-incoming-row-"+i.source),l(),M("value",i.kind)("severity",o.kindSeverity(i.kind)),l(),M("link",!0)("label",i.source),U("data-testid","linked-nodes-incoming-link-"+i.source),l(),M("value",o.confidenceValue(i.confidence))("severity",o.confidenceSeverity(i.confidence))("rounded",!0)("pTooltip",o.confidenceLabel(i.confidence)),l(),P((e=o.issueForIncoming(i))?4:-1,e),l(),P(i.sources.length?5:-1),l(),P(i.occurrences&&i.occurrences.length>0?6:-1)}}function DQ(t,n){if(t&1&&(p(0,"ul",11),Z(1,kQ,7,13,"li",22,RM),m()),t&2){let e=g(3);l(),Q(e.incoming())}}function OQ(t,n){if(t&1&&(E(0,hQ,6,1,"section",7),p(1,"section",8)(2,"h4",9),y(3),m(),E(4,mQ,2,1,"p",10)(5,_Q,3,0,"ul",11),m(),p(6,"section",12)(7,"h4",9),y(8),m(),E(9,yQ,2,1,"p",13)(10,SQ,3,0,"ul",11),m(),p(11,"section",14)(12,"h4",9),y(13),m(),E(14,IQ,2,1,"p",15)(15,DQ,3,0,"ul",11),m()),t&2){let e=g(2);P(e.externalRefs().length>0?0:-1),l(3),x(e.texts.findingsHeader),l(),P(e.findings().length===0?4:5),l(4),x(e.texts.outgoingHeader),l(),P(e.outgoing().length===0?9:10),l(4),x(e.texts.incomingHeader),l(),P(e.incoming().length===0?14:15)}}function NQ(t,n){if(t&1&&(p(0,"p-card",0),be(1,cQ,4,6,"ng-template",1),E(2,dQ,2,1,"p",2)(3,lQ,2,1,"p",3)(4,OQ,16,7),m()),t&2){let e,i=g();l(2),P((e=i.state())==="loading"?2:e==="error"?3:e==="ready"?4:-1)}}var kp=class t{dataSource=u(pn);wsEvents=u(Ca);destroyRef=u(rt);texts=DM;path=F(null);openPath=Ge();state=j("idle");outgoingRaw=j([]);incomingRaw=j([]);outgoing=D(()=>this.outgoingRaw().filter(n=>!OM(n)));incoming=D(()=>this.incomingRaw().filter(n=>!OM(n)));issues=j([]);externalRefs=j([]);fetchToken=0;hasResults=D(()=>this.state()==="ready"&&(this.outgoing().length>0||this.incoming().length>0));findings=D(()=>{let n=this.path();return n?this.issues().filter(e=>e.nodeIds.includes(n)):[]});constructor(){this.wsEvents.scanCompleted$.pipe(ki(this.destroyRef)).subscribe(()=>{let n=this.path();n&&this.fetch(n)}),pe(()=>{let n=this.path();if(!n){this.fetchToken++,this.state.set("idle"),this.outgoingRaw.set([]),this.incomingRaw.set([]);return}this.fetch(n)})}refresh(){let n=this.path();n&&this.fetch(n)}onOpen(n){this.openPath.emit(n)}kindSeverity(n){return C0[n]??"secondary"}confidenceSeverity(n){return b0(n)}confidenceLabel(n){return this.texts.confidence[x0(n)]}confidenceValue(n){return n.toFixed(2)}issueSeverity(n){return n==="error"?"danger":n==="warn"?"warn":"info"}issueForOutgoing(n){let e=this.path();if(!e)return null;let i=[n.target,n.resolvedTarget].filter(s=>typeof s=="string"),o=this.issues().find(s=>{if(!s.nodeIds.includes(e))return!1;let c=s.data?.target;return typeof c!="string"?!1:i.includes(c)});if(o)return o;let r=n.resolvedTarget??n.target;return this.issues().find(s=>{if(!s.nodeIds.includes(r))return!1;let c=s.data?.target;return typeof c!="string"||c===r})??null}occurrenceLabel(n){let e=n.location?.line;return typeof e!="number"?this.texts.occurrencesItemUnknownLine.replace("{{trigger}}",n.originalTrigger).replace("{{extractor}}",n.extractor):this.texts.occurrencesItem.replace("{{line}}",String(e)).replace("{{trigger}}",n.originalTrigger).replace("{{extractor}}",n.extractor)}issueForIncoming(n){let e=this.path();if(!e)return null;let i=[n.target,n.resolvedTarget,e].filter(r=>typeof r=="string");return this.issues().find(r=>{if(!r.nodeIds.includes(n.source))return!1;let a=r.data?.target;return typeof a!="string"?!1:i.includes(a)})??null}async fetch(n){let e=++this.fetchToken;this.state.set("loading");try{let[i,o,r,a]=await Promise.allSettled([this.dataSource.listLinks({from:n}),this.dataSource.listLinks({to:n}),this.dataSource.listIssues(),this.dataSource.getNode(n)]);if(e!==this.fetchToken)return;if(i.status!=="fulfilled"||o.status!=="fulfilled"||r.status!=="fulfilled"){this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefs.set([]),this.state.set("error");return}this.outgoingRaw.set(i.value.items),this.incomingRaw.set(o.value.items),this.issues.set(r.value.items),this.externalRefs.set(a.status==="fulfilled"?a.value?.item?.externalRefs??[]:[]),this.state.set("ready")}catch{if(e!==this.fetchToken)return;this.outgoingRaw.set([]),this.incomingRaw.set([]),this.issues.set([]),this.externalRefs.set([]),this.state.set("error")}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-linked-nodes-panel"]],inputs:{path:[1,"path"]},outputs:{openPath:"openPath"},decls:1,vars:1,consts:[["styleClass","linked-nodes-panel","data-testid","linked-nodes-panel"],["pTemplate","header"],["data-testid","linked-nodes-loading",1,"linked-nodes-panel__status"],["data-testid","linked-nodes-error",1,"linked-nodes-panel__status","linked-nodes-panel__status--warn"],[1,"linked-nodes-panel__header"],[1,"linked-nodes-panel__title"],["icon","pi pi-refresh","severity","secondary","data-testid","linked-nodes-refresh",3,"onClick","rounded","text","ariaLabel","pTooltip","disabled"],["data-testid","linked-nodes-external-refs",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-findings",1,"linked-nodes-panel__section"],[1,"linked-nodes-panel__section-title"],["data-testid","linked-nodes-findings-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__rows"],["data-testid","linked-nodes-outgoing",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-outgoing-empty",1,"linked-nodes-panel__status"],["data-testid","linked-nodes-incoming",1,"linked-nodes-panel__section"],["data-testid","linked-nodes-incoming-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--external-ref"],[1,"linked-nodes-panel__external-ref-line"],["target","_blank","rel","noopener noreferrer",1,"linked-nodes-panel__external-ref-url",3,"href"],[1,"linked-nodes-panel__row","linked-nodes-panel__row--finding"],[3,"value","severity","rounded"],[1,"linked-nodes-panel__finding-message"],[1,"linked-nodes-panel__row"],[3,"value","severity"],["severity","primary","styleClass","linked-nodes-panel__path",3,"onClick","link","label"],[3,"value","severity","rounded","pTooltip"],[1,"linked-nodes-panel__sources"],[1,"linked-nodes-panel__occurrences"],[1,"linked-nodes-panel__occurrences-header"],[1,"linked-nodes-panel__occurrences-item"]],template:function(e,i){e&1&&E(0,NQ,5,1,"p-card",0),e&2&&P(i.path()?0:-1)},dependencies:[Ip,Kr,un,Ta,Ia,Bi,Mi,Pi,We,Ze],styles:["[_nghost-%COMP%]{display:block}.linked-nodes-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem 1rem 0}.linked-nodes-panel__title[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600}.linked-nodes-panel__status[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--p-text-muted-color);font-style:italic}.linked-nodes-panel__status--warn[_ngcontent-%COMP%]{color:var(--sm-severity-warn);font-style:normal}.linked-nodes-panel__section[_ngcontent-%COMP%] + .linked-nodes-panel__section[_ngcontent-%COMP%]{margin-top:1rem}.linked-nodes-panel__section-title[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__rows[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.linked-nodes-panel__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.4rem .5rem;border-radius:var(--sm-radius-md);background:var(--p-content-background);border:1px solid var(--p-content-border-color)}.linked-nodes-panel__path[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.85rem;padding:0;text-underline-offset:2px}.linked-nodes-panel__sources[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);margin-left:auto}.linked-nodes-panel__occurrences[_ngcontent-%COMP%]{flex-basis:100%;list-style:none;margin:.25rem 0 0;padding:.25rem 0 0;border-top:1px dashed var(--p-content-border-color);display:flex;flex-direction:column;gap:.15rem}.linked-nodes-panel__occurrences-header[_ngcontent-%COMP%]{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color)}.linked-nodes-panel__occurrences-item[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--p-text-muted-color)}.linked-nodes-panel__row--finding[_ngcontent-%COMP%]{align-items:flex-start}.linked-nodes-panel__finding-message[_ngcontent-%COMP%]{font-size:.8rem;line-height:1.4;color:var(--p-text-color)}.linked-nodes-panel__row--external-ref[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.85rem}.linked-nodes-panel__external-ref-line[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);min-width:4.5rem}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]{flex:1;word-break:break-all;color:var(--p-primary-color);text-decoration:none}.linked-nodes-panel__external-ref-url[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};function OM(t){return!!(t.source===t.target||t.resolvedTarget&&t.source===t.resolvedTarget)}var FM={providerSpecificHeader:"Provider-specific",fieldCount:t=>`${t} field${t===1?"":"s"}`,fields:{tools:"Tools",model:"Model",skills:"Skills",disallowedTools:"Disallowed tools",initialPrompt:"Initial prompt",permissionMode:"Permission mode",maxTurns:"Max turns",memory:"Memory",background:"Background",effort:"Effort",isolation:"Isolation",mcpServers:"MCP servers",hooks:"Hooks"},initialPromptToggle:"Toggle initial prompt"};var RQ=(t,n)=>n.name,AQ=(t,n)=>n.event;function FQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){let e=g(4);l(),x(e.texts.fields.model),l(3),x(n)}}function LQ(t,n){if(t&1&&L(0,"p-chip",12),t&2){let e=n.$implicit;M("label",e)}}function BQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd",11),Z(3,LQ,1,1,"p-chip",12,Te),m()),t&2){let e=g(4);l(),x(e.texts.fields.tools),l(2),Q(e.tools())}}function zQ(t,n){if(t&1){let e=de();p(0,"p-chip",14),$("click",function(){let o=G(e).$implicit,r=g(5);return H(r.onSkillChipClick(o))}),m()}if(t&2){let e=n.$implicit,i=g(5);M("label",e)("styleClass",i.isSkillKnown(e)?"chip--link":"")}}function qQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd",11),Z(3,zQ,1,2,"p-chip",13,Te),m()),t&2){let e=g(4);l(),x(e.texts.fields.skills),l(2),Q(e.skills())}}function VQ(t,n){if(t&1&&L(0,"p-chip",15),t&2){let e=n.$implicit;M("label",e)}}function GQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd",11),Z(3,VQ,1,1,"p-chip",15,Te),m()),t&2){let e=g(4);l(),x(e.texts.fields.disallowedTools),l(2),Q(e.disallowedTools())}}function HQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){let e=g(4);l(),x(e.texts.fields.permissionMode),l(3),x(n)}}function jQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd"),y(3),m()),t&2){let e=g(4);l(),x(e.texts.fields.maxTurns),l(2),x(e.maxTurns())}}function UQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){let e=g(4);l(),x(e.texts.fields.effort),l(3),x(n)}}function WQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){let e=g(4);l(),x(e.texts.fields.memory),l(3),x(n)}}function $Q(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4,"true"),m()()),t&2){let e=g(4);l(),x(e.texts.fields.background)}}function KQ(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){let e=g(4);l(),x(e.texts.fields.isolation),l(3),x(n)}}function YQ(t,n){if(t&1&&(p(0,"blockquote",18),y(1),m()),t&2){let e=g();l(),x(e)}}function XQ(t,n){if(t&1&&(p(0,"p",19),y(1),m()),t&2){let e=g();l(),Po("",e.slice(0,80),"",e.length>80?"\u2026":"")}}function ZQ(t,n){if(t&1){let e=de();p(0,"div",9)(1,"h5",16)(2,"button",17),$("click",function(){G(e);let o=g(4);return H(o.toggleInitialPrompt())}),L(3,"i",4),y(4),m()(),E(5,YQ,2,1,"blockquote",18)(6,XQ,2,2,"p",19),m()}if(t&2){let e=g(4);l(2),U("aria-label",e.texts.initialPromptToggle),l(),se("pi-chevron-right",!e.initialPromptExpanded())("pi-chevron-down",e.initialPromptExpanded()),l(),Le(" ",e.texts.fields.initialPrompt," "),l(),P(e.initialPromptExpanded()?5:6)}}function QQ(t,n){if(t&1&&(p(0,"code",23),y(1),m()),t&2){let e=g().$implicit;l(),x(e.command)}}function JQ(t,n){if(t&1&&(p(0,"li",21)(1,"code",22),y(2),m(),E(3,QQ,2,1,"code",23),m()),t&2){let e=n.$implicit;l(2),x(e.name),l(),P(e.command!==null?3:-1)}}function eJ(t,n){if(t&1&&(p(0,"div",10)(1,"h5",16),y(2),m(),p(3,"ul",20),Z(4,JQ,4,2,"li",21,RQ),m()()),t&2){let e=g(4);l(2),x(e.texts.fields.mcpServers),l(2),Q(e.mcpServers())}}function tJ(t,n){if(t&1&&(p(0,"code"),y(1),m(),y(2)),t&2){let e=n.$implicit,i=n.$index,o=n.$count;l(),x(e),l(),Le("",i===o-1?"":", "," ")}}function nJ(t,n){if(t&1&&(p(0,"span",24),Z(1,tJ,3,2,null,null,Te),m()),t&2){let e=g().$implicit;l(),Q(e.keys)}}function iJ(t,n){if(t&1&&(p(0,"li",21)(1,"code",22),y(2),m(),E(3,nJ,3,0,"span",24),m()),t&2){let e=n.$implicit;l(2),x(e.event),l(),P(e.keys.length?3:-1)}}function oJ(t,n){if(t&1&&(p(0,"div",10)(1,"h5",16),y(2),m(),p(3,"ul",20),Z(4,iJ,4,2,"li",21,AQ),m()()),t&2){let e=g(4);l(2),x(e.texts.fields.hooks),l(2),Q(e.hooks())}}function rJ(t,n){if(t&1&&(p(0,"dl",8),E(1,FQ,5,2),E(2,BQ,5,1),E(3,qQ,5,1),E(4,GQ,5,1),E(5,HQ,5,2),E(6,jQ,4,2),E(7,UQ,5,2),E(8,WQ,5,2),E(9,$Q,5,1),E(10,KQ,5,2),m(),E(11,ZQ,7,7,"div",9),E(12,eJ,6,1,"div",10),E(13,oJ,6,1,"div",10)),t&2){let e,i,o,r,a,s,c=g(3);l(),P((e=c.model())?1:-1,e),l(),P(c.tools().length?2:-1),l(),P(c.skills().length?3:-1),l(),P(c.disallowedTools().length?4:-1),l(),P((i=c.permissionMode())?5:-1,i),l(),P(c.maxTurns()!==null?6:-1),l(),P((o=c.effort())?7:-1,o),l(),P((r=c.memory())?8:-1,r),l(),P(c.background()?9:-1),l(),P((a=c.isolation())?10:-1,a),l(),P((s=c.initialPrompt())?11:-1,s),l(),P(c.mcpServers().length?12:-1),l(),P(c.hooks().length?13:-1)}}function aJ(t,n){if(t&1&&(p(0,"dt"),y(1,"when_to_use"),m(),p(2,"dd"),y(3),m()),t&2){g();let e=ne(0);l(3),x(e.when_to_use)}}function sJ(t,n){if(t&1&&(p(0,"dt"),y(1,"argument-hint"),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0);l(4),x(e.argumentHint)}}function cJ(t,n){if(t&1&&L(0,"p-chip",12),t&2){let e=n.$implicit;M("label",e)}}function dJ(t,n){if(t&1&&(p(0,"dt"),y(1,"arguments"),m(),p(2,"dd",11),Z(3,cJ,1,1,"p-chip",12,Te),m()),t&2){g();let e=ne(0);l(3),Q(e.arguments)}}function lJ(t,n){if(t&1&&L(0,"p-chip",12),t&2){let e=n.$implicit;M("label",e)}}function uJ(t,n){if(t&1&&(p(0,"dt"),y(1,"allowed-tools"),m(),p(2,"dd",11),Z(3,lJ,1,1,"p-chip",12,Te),m()),t&2){g();let e=ne(0);l(3),Q(e.allowedTools)}}function fJ(t,n){if(t&1&&(p(0,"dt"),y(1,"model"),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0);l(4),x(e.model)}}function pJ(t,n){if(t&1&&(p(0,"dt"),y(1,"effort"),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0);l(4),x(e.effort)}}function hJ(t,n){if(t&1&&(p(0,"dt"),y(1,"context"),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0);l(4),x(e.context)}}function mJ(t,n){if(t&1&&(p(0,"dt"),y(1,"agent"),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0);l(4),x(e.agent)}}function gJ(t,n){if(t&1&&(p(0,"dt"),y(1,"shell"),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0);l(4),x(e.shell)}}function _J(t,n){if(t&1&&L(0,"p-chip",12),t&2){let e=n.$implicit;M("label",e)}}function yJ(t,n){if(t&1&&(p(0,"dt"),y(1,"paths"),m(),p(2,"dd",11),Z(3,_J,1,1,"p-chip",12,Te),m()),t&2){g();let e=ne(0);l(3),Q(e.paths)}}function vJ(t,n){t&1&&(p(0,"dt"),y(1,"disable-model-invocation"),m(),p(2,"dd")(3,"code"),y(4,"true"),m()())}function CJ(t,n){if(t&1&&(p(0,"dt"),y(1,"user-invocable"),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0);l(4),x(e.userInvocable)}}function xJ(t,n){if(t&1&&(yt(0),p(1,"dl",7),E(2,aJ,4,1),E(3,sJ,5,1),E(4,dJ,5,0),E(5,uJ,5,0),E(6,fJ,5,1),E(7,pJ,5,1),E(8,hJ,5,1),E(9,mJ,5,1),E(10,gJ,5,1),E(11,yJ,5,0),E(12,vJ,5,0),E(13,CJ,5,1),m()),t&2){let e=Xe(g(3).skillBase());l(2),P(e.when_to_use!==null?2:-1),l(),P(e.argumentHint!==null?3:-1),l(),P(e.arguments.length?4:-1),l(),P(e.allowedTools.length?5:-1),l(),P(e.model!==null?6:-1),l(),P(e.effort!==null?7:-1),l(),P(e.context!==null?8:-1),l(),P(e.agent!==null?9:-1),l(),P(e.shell!==null?10:-1),l(),P(e.paths.length?11:-1),l(),P(e.disableModelInvocation?12:-1),l(),P(e.userInvocable!==null?13:-1)}}function bJ(t,n){if(t&1&&(p(0,"div",6),E(1,rJ,14,13)(2,xJ,14,13,"dl",7),m()),t&2){let e=g(2);l(),P(e.isAgent()?1:e.isSkillOrCommand()?2:-1)}}function wJ(t,n){if(t&1){let e=de();p(0,"div",0)(1,"section",1)(2,"h4",2)(3,"button",3),$("click",function(){G(e);let o=g();return H(o.toggleSection())}),L(4,"i",4),y(5),p(6,"span",5),y(7),m()()(),E(8,bJ,3,1,"div",6),m()()}if(t&2){let e=g();l(3),U("aria-expanded",e.sectionExpanded()),l(),se("pi-chevron-right",!e.sectionExpanded())("pi-chevron-down",e.sectionExpanded()),l(),Le(" ",e.texts.providerSpecificHeader," "),l(2),Le("(",e.texts.fieldCount(e.populatedFieldCount()),")"),l(),P(e.sectionExpanded()?8:-1)}}var Op=class t{frontmatter=F.required();kind=F.required();provider=F(void 0);knownPaths=F(null);onSkillClick=F(null);texts=FM;hasVendorSurface=D(()=>{let n=this.kind();return n==="agent"||n==="skill"||n==="command"});isAgent=D(()=>this.kind()==="agent");isSkillOrCommand=D(()=>{let n=this.kind();return n==="skill"||n==="command"});tools=D(()=>Dp(this.fm().tools));model=D(()=>wt(this.fm().model));skills=D(()=>Dp(this.fm().skills));disallowedTools=D(()=>Dp(this.fm().disallowedTools));initialPrompt=D(()=>wt(this.fm().initialPrompt));initialPromptExpanded=j(!1);permissionMode=D(()=>wt(this.fm().permissionMode));maxTurns=D(()=>SJ(this.fm().maxTurns));memory=D(()=>wt(this.fm().memory));background=D(()=>this.fm().background===!0);effort=D(()=>wt(this.fm().effort));isolation=D(()=>wt(this.fm().isolation));mcpServers=D(()=>{let n=this.fm().mcpServers;return Array.isArray(n)?n.filter(e=>typeof e=="object"&&e!==null).map((e,i)=>({name:typeof e.name=="string"&&e.name.length>0?e.name:`mcpServer[${i}]`,command:typeof e.command=="string"?e.command:null})):[]});hooks=D(()=>{let n=this.fm().hooks;if(typeof n!="object"||n===null)return[];let e=[];for(let[i,o]of Object.entries(n)){let r=typeof o=="object"&&o!==null?Object.keys(o):[];e.push({event:i,keys:r})}return e});skillBase=D(()=>{let n=this.fm();return{when_to_use:wt(n.when_to_use),argumentHint:wt(n["argument-hint"]),arguments:w_(n.arguments),disableModelInvocation:n["disable-model-invocation"]===!0,userInvocable:typeof n["user-invocable"]=="boolean"?n["user-invocable"]:null,allowedTools:w_(n["allowed-tools"]),model:wt(n.model),effort:wt(n.effort),context:wt(n.context),agent:wt(n.agent),paths:w_(n.paths),shell:wt(n.shell)}});populatedFieldCount=D(()=>{if(this.isAgent()){let n=0;return this.model()!==null&&n++,this.tools().length&&n++,this.skills().length&&n++,this.disallowedTools().length&&n++,this.permissionMode()!==null&&n++,this.maxTurns()!==null&&n++,this.effort()!==null&&n++,this.memory()!==null&&n++,this.background()&&n++,this.isolation()!==null&&n++,this.initialPrompt()!==null&&n++,this.mcpServers().length&&n++,this.hooks().length&&n++,n}if(this.isSkillOrCommand()){let n=this.skillBase(),e=0;return n.when_to_use!==null&&e++,n.argumentHint!==null&&e++,n.arguments.length&&e++,n.allowedTools.length&&e++,n.model!==null&&e++,n.effort!==null&&e++,n.context!==null&&e++,n.agent!==null&&e++,n.shell!==null&&e++,n.paths.length&&e++,n.disableModelInvocation&&e++,n.userInvocable!==null&&e++,e}return 0});hasAnyContent=D(()=>this.hasVendorSurface()&&this.populatedFieldCount()>0);sectionExpanded=j(!1);toggleSection(){this.sectionExpanded.update(n=>!n)}toggleInitialPrompt(){this.initialPromptExpanded.update(n=>!n)}onSkillChipClick(n){let e=this.onSkillClick();e&&e(n)}isSkillKnown(n){let e=this.knownPaths();return e?e.has(n):!1}fm(){return this.frontmatter()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-vendor-frontmatter"]],inputs:{frontmatter:[1,"frontmatter"],kind:[1,"kind"],provider:[1,"provider"],knownPaths:[1,"knownPaths"],onSkillClick:[1,"onSkillClick"]},decls:1,vars:1,consts:[["data-testid","vendor-frontmatter",1,"vfm"],["data-testid","vendor-frontmatter-section",1,"vfm__section"],[1,"vfm__section-toggle"],["type","button","data-testid","vendor-frontmatter-section-toggle",1,"vfm__inline-toggle",3,"click"],["aria-hidden","true",1,"pi"],[1,"vfm__count"],["data-testid","vendor-frontmatter-section-body",1,"vfm__body"],["data-testid","vendor-frontmatter-skill-base",1,"vfm__kv"],[1,"vfm__kv"],["data-testid","vendor-frontmatter-initial-prompt-row",1,"vfm__row"],[1,"vfm__row"],[1,"vfm__chips"],[3,"label"],[3,"label","styleClass"],[3,"click","label","styleClass"],["styleClass","chip--danger",3,"label"],[1,"vfm__label"],["type","button","data-testid","vendor-frontmatter-initial-prompt-toggle",1,"vfm__inline-toggle",3,"click"],["data-testid","vendor-frontmatter-initial-prompt",1,"vfm__quote"],[1,"vfm__quote-collapsed"],[1,"vfm__list"],[1,"vfm__list-row"],[1,"vfm__list-key"],[1,"vfm__list-cmd"],[1,"vfm__list-keys"]],template:function(e,i){e&1&&E(0,wJ,9,8,"div",0),e&2&&P(i.hasAnyContent()?0:-1)},dependencies:[Bi,Sa,We],styles:["[_nghost-%COMP%]{display:block}.vfm[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.vfm__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem}.vfm__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.vfm__row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.vfm__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.25rem;margin:0;font-size:.85rem}.vfm__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500}.vfm__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;word-break:break-word}.vfm__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.3rem}.vfm__label[_ngcontent-%COMP%]{margin:.25rem 0;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--sm-text-muted);font-weight:600}.vfm__section-toggle[_ngcontent-%COMP%]{margin:0}.vfm__inline-toggle[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem;background:transparent;border:none;padding:0;font:inherit;font-size:.85rem;font-weight:600;color:var(--p-text-color);cursor:pointer}.vfm__inline-toggle[_ngcontent-%COMP%]:hover{color:var(--p-primary-color)}.vfm__count[_ngcontent-%COMP%]{font-weight:400;color:var(--sm-text-muted)}.vfm__quote[_ngcontent-%COMP%]{margin:.35rem 0 0;padding:.5rem .75rem;border-left:3px solid var(--sm-border);background:var(--sm-bg-hover);font-style:italic;font-size:.85rem;white-space:pre-wrap;border-radius:0 4px 4px 0}.vfm__quote-collapsed[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:.8rem;color:var(--sm-text-muted);font-style:italic}.vfm__list[_ngcontent-%COMP%]{margin:.25rem 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:.2rem}.vfm__list-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:baseline;gap:.4rem;font-size:.8rem}.vfm__list-key[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-weight:600;background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm)}.vfm__list-cmd[_ngcontent-%COMP%], .vfm__list-keys[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.75rem;color:var(--sm-text-muted)}[_nghost-%COMP%] .chip--danger{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}"],changeDetection:0})};function wt(t){return typeof t=="string"&&t.length>0?t:null}function SJ(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Dp(t){return Array.isArray(t)?t.filter(n=>typeof n=="string"&&n.length>0):[]}function w_(t){return typeof t=="string"?t.length>0?[t]:[]:Array.isArray(t)?Dp(t):[]}var LM={header:"Plugin contributions",count:t=>`${t} namespace${t===1?"":"s"}`,unregisteredBadge:"unregistered",rootContribBadge:t=>`from plugin: ${t}`,empty:"No plugin contributions on this sidecar."};var qM=(t,n)=>n.key,IJ=(t,n)=>n.pluginId;function TJ(t,n){if(t&1&&(p(0,"p",0),y(1),m()),t&2){let e=g();l(),x(e.texts.empty)}}function EJ(t,n){if(t&1&&(p(0,"span",5),y(1),m()),t&2){let e=g().$implicit,i=g(3);l(),x(i.texts.rootContribBadge(e.pluginId))}}function PJ(t,n){if(t&1&&(p(0,"div",3)(1,"code",4),y(2),m(),E(3,EJ,2,1,"span",5),p(4,"pre",6),y(5),m()()),t&2){let e=n.$implicit;l(2),x(e.key),l(),P(e.pluginId!==null?3:-1),l(2),x(e.value)}}function MJ(t,n){if(t&1&&(p(0,"div",1),Z(1,PJ,6,3,"div",3,qM),m()),t&2){let e=g(2);l(),Q(e.rootContributions())}}function kJ(t,n){if(t&1&&(p(0,"span",10),y(1),m()),t&2){let e=g(4);l(),x(e.texts.unregisteredBadge)}}function DJ(t,n){if(t&1&&(p(0,"dt",12),y(1),m(),p(2,"dd")(3,"pre"),y(4),m()()),t&2){let e=n.$implicit;M("pTooltip",e.description??""),l(),x(e.key),l(3),x(e.value)}}function OJ(t,n){if(t&1&&(p(0,"section",7)(1,"h5",8)(2,"span",9),y(3),m(),E(4,kJ,2,1,"span",10),m(),p(5,"dl",11),Z(6,DJ,5,3,null,null,qM),m()()),t&2){let e=n.$implicit;U("data-testid","plugin-contributions-ns-"+e.pluginId),l(3),x(e.pluginId),l(),P(e.registered?-1:4),l(2),Q(e.rows)}}function NJ(t,n){if(t&1&&(p(0,"div",2),Z(1,OJ,8,3,"section",7,IJ),m()),t&2){let e=g(2);l(),Q(e.namespaces())}}function RJ(t,n){if(t&1&&(E(0,MJ,3,0,"div",1),E(1,NJ,3,0,"div",2)),t&2){let e=g();P(e.rootContributions().length?0:-1),l(),P(e.namespaces().length?1:-1)}}var BM=new Set(["identity","annotations","settings","audit"]),Np=class t{dataSource=u(pn);sidecarRoot=F(void 0);texts=LM;catalog=j(null);constructor(){this.fetchCatalog()}namespaces=D(()=>{let n=this.sidecarRoot();if(!n)return[];let e=this.catalog(),i=new Map;if(e)for(let r of e){if(r.location!=="namespaced")continue;let a=i.get(r.pluginId);a?a.push(r):i.set(r.pluginId,[r])}let o=[];for(let[r,a]of Object.entries(n)){if(BM.has(r)||this.isRegisteredRootKey(r))continue;let c=typeof a=="object"&&a!==null&&!Array.isArray(a)?a:{value:a},d=i.has(r),f=i.get(r)??[],h=Object.entries(c).map(([v,b])=>({key:v,value:zM(b),description:d?AJ(f,v):null}));o.push({pluginId:r,registered:d,rows:h})}return o});rootContributions=D(()=>{let n=this.sidecarRoot();if(!n)return[];let e=this.catalog();if(!e)return[];let i=new Map;for(let r of e)r.location==="root"&&i.set(r.key,r);let o=[];for(let[r,a]of Object.entries(n)){if(BM.has(r))continue;let s=i.get(r);s&&o.push({key:r,pluginId:s.pluginId,value:zM(a)})}return o});count=D(()=>this.namespaces().length+this.rootContributions().length);isEmpty=D(()=>this.count()===0);isRegisteredRootKey(n){let e=this.catalog();return e?e.some(i=>i.location==="root"&&i.key===n):!1}async fetchCatalog(){try{let n=await this.dataSource.getRegisteredAnnotations();this.catalog.set(n)}catch{this.catalog.set([])}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-plugin-contributions"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","plugin-contributions-empty",1,"pcp__empty"],["data-testid","plugin-contributions-roots",1,"pcp__roots"],[1,"pcp__namespaces"],[1,"pcp__root-row"],[1,"pcp__root-key"],[1,"pcp__root-badge"],[1,"pcp__root-value"],[1,"pcp__ns"],[1,"pcp__ns-header"],[1,"pcp__ns-name"],["data-testid","plugin-contributions-unregistered-badge",1,"pcp__ns-badge"],[1,"pcp__kv"],[3,"pTooltip"]],template:function(e,i){e&1&&E(0,TJ,2,1,"p",0)(1,RJ,2,2),e&2&&P(i.isEmpty()?0:1)},dependencies:[We,Ze],styles:["[_nghost-%COMP%]{display:block}.pcp__empty[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--sm-text-muted);font-style:italic}.pcp__roots[_ngcontent-%COMP%], .pcp__namespaces[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.6rem}.pcp__root-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;font-size:.85rem}.pcp__root-key[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);background:var(--sm-bg-hover);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);font-weight:600}.pcp__root-badge[_ngcontent-%COMP%]{font-size:.7rem;color:var(--sm-text-muted);font-style:italic;background:var(--sm-bg-hover);padding:.05rem .35rem;border-radius:var(--sm-radius-sm)}.pcp__root-value[_ngcontent-%COMP%]{flex:1 1 100%;margin:.2rem 0 0;padding:.45rem .6rem;background:var(--sm-bg-hover);border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.8rem;white-space:pre-wrap;word-break:break-word}.pcp__ns[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.pcp__ns[_ngcontent-%COMP%] + .pcp__ns[_ngcontent-%COMP%]{border-top:1px solid var(--sm-border);padding-top:.5rem}.pcp__ns-header[_ngcontent-%COMP%]{margin:0;display:inline-flex;align-items:center;gap:.5rem;font-size:.85rem;font-weight:600}.pcp__ns-name[_ngcontent-%COMP%]{font-family:var(--sm-font-mono)}.pcp__ns-badge[_ngcontent-%COMP%]{font-size:.65rem;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--sm-text-muted);background:var(--sm-bg-hover);padding:.05rem .4rem;border-radius:var(--sm-radius-sm)}.pcp__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.85rem}.pcp__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500;font-family:var(--sm-font-mono);cursor:help}.pcp__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;word-break:break-word}.pcp__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:0;font-family:var(--sm-font-mono);font-size:.8rem;white-space:pre-wrap;word-break:break-word}"],changeDetection:0})};function zM(t){if(t===null)return"null";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function AJ(t,n){for(let e of t)if(e.key===n){let i=e.schema.description;return typeof i=="string"&&i.length>0?i:null}return null}var Rp=class t{node=F(null);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-inspector-slots-panel"]],inputs:{node:[1,"node"]},decls:6,vars:6,consts:[["slot","inspector.body.panel.breakdown",3,"node"],["slot","inspector.body.panel.records",3,"node"],["slot","inspector.body.panel.tree",3,"node"],["slot","inspector.body.panel.key-values",3,"node"],["slot","inspector.body.panel.link-list",3,"node"],["slot","inspector.body.panel.markdown",3,"node"]],template:function(e,i){e&1&&L(0,"sm-view-contributions-host",0)(1,"sm-view-contributions-host",1)(2,"sm-view-contributions-host",2)(3,"sm-view-contributions-host",3)(4,"sm-view-contributions-host",4)(5,"sm-view-contributions-host",5),e&2&&(M("node",i.node()),l(),M("node",i.node()),l(),M("node",i.node()),l(),M("node",i.node()),l(),M("node",i.node()),l(),M("node",i.node()))},dependencies:[mn],encapsulation:2,changeDetection:0})};var VM={header:"Debug",toggleAriaLabel:"Toggle debug panel",fields:{forPath:"for.path",bodyHashStored:"for.bodyHash (stored)",bodyHashLive:"node.bodyHash (live)",frontmatterHashStored:"for.frontmatterHash (stored)",frontmatterHashLive:"node.frontmatterHash (live)",resolvedProvider:"for.resolvedAs.provider",resolvedKind:"for.resolvedAs.kind",sidecarStatus:"sidecar.status",sidecarPresent:"sidecar.present"},diffMarker:"!=",absentMarker:"(absent)",notSetMarker:"(not set)"};function FJ(t,n){t&1&&(K(0,"code"),y(1),Y()),t&2&&(l(),x(n))}function LJ(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.absentMarker)}}function BJ(t,n){if(t&1&&(K(0,"code"),y(1),Y()),t&2){let e=g();se("dbg__diff",e.bodyHashDrift()),l(),x(n)}}function zJ(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.absentMarker)}}function qJ(t,n){if(t&1&&(K(0,"code"),y(1),Y()),t&2){let e=g();se("dbg__diff",e.bodyHashDrift()),l(),x(n)}}function VJ(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.absentMarker)}}function GJ(t,n){if(t&1&&(K(0,"code"),y(1),Y()),t&2){let e=g();se("dbg__diff",e.frontmatterHashDrift()),l(),x(n)}}function HJ(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.absentMarker)}}function jJ(t,n){if(t&1&&(K(0,"code"),y(1),Y()),t&2){let e=g();se("dbg__diff",e.frontmatterHashDrift()),l(),x(n)}}function UJ(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.absentMarker)}}function WJ(t,n){t&1&&(K(0,"code"),y(1),Y()),t&2&&(l(),x(n))}function $J(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.notSetMarker)}}function KJ(t,n){t&1&&(K(0,"code"),y(1),Y()),t&2&&(l(),x(n))}function YJ(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.notSetMarker)}}function XJ(t,n){t&1&&(K(0,"code"),y(1),Y()),t&2&&(l(),x(n))}function ZJ(t,n){if(t&1&&(K(0,"span",2),y(1),Y()),t&2){let e=g();l(),x(e.texts.absentMarker)}}var Ap=class t{node=F.required();sidecarRoot=F(null);overlay=F(void 0);texts=VM;identityBlock=D(()=>{let n=this.sidecarRoot(),e={path:null,bodyHash:null,frontmatterHash:null,resolvedProvider:null,resolvedKind:null};if(!n)return e;let i=n.identity;if(typeof i!="object"||i===null)return e;let o=i,r=typeof o.resolvedAs=="object"&&o.resolvedAs!==null?o.resolvedAs:null;return{path:typeof o.path=="string"?o.path:null,bodyHash:typeof o.bodyHash=="string"?o.bodyHash:null,frontmatterHash:typeof o.frontmatterHash=="string"?o.frontmatterHash:null,resolvedProvider:r&&typeof r.provider=="string"?r.provider:null,resolvedKind:r&&typeof r.kind=="string"?r.kind:null}});bodyHashLive=D(()=>this.node().bodyHash??null);frontmatterHashLive=D(()=>this.node().frontmatterHash??null);bodyHashDrift=D(()=>{let n=this.identityBlock().bodyHash,e=this.bodyHashLive();return n!==null&&e!==null&&n!==e});frontmatterHashDrift=D(()=>{let n=this.identityBlock().frontmatterHash,e=this.frontmatterHashLive();return n!==null&&e!==null&&n!==e});sidecarStatusLiteral=D(()=>{let n=this.overlay();if(!n)return null;let e=n.status??null;return e===null?null:String(e)});sidecarPresent=D(()=>this.overlay()?.present===!0);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-inspector-debug-panel"]],inputs:{node:[1,"node"],sidecarRoot:[1,"sidecarRoot"],overlay:[1,"overlay"]},decls:46,vars:18,consts:[["data-testid","inspector-debug-panel",1,"dbg__kv"],["data-testid","dbg-for-path"],[1,"dbg__absent"],["data-testid","dbg-body-hash-stored"],[3,"dbg__diff"],["data-testid","dbg-body-hash-live"],["data-testid","dbg-fm-hash-stored"],["data-testid","dbg-fm-hash-live"],["data-testid","dbg-resolved-provider"],["data-testid","dbg-resolved-kind"],["data-testid","dbg-sidecar-status"],["data-testid","dbg-sidecar-present"]],template:function(e,i){if(e&1&&(K(0,"dl",0)(1,"dt"),y(2),Y(),K(3,"dd",1),E(4,FJ,2,1,"code")(5,LJ,2,1,"span",2),Y(),K(6,"dt"),y(7),Y(),K(8,"dd",3),E(9,BJ,2,3,"code",4)(10,zJ,2,1,"span",2),Y(),K(11,"dt"),y(12),Y(),K(13,"dd",5),E(14,qJ,2,3,"code",4)(15,VJ,2,1,"span",2),Y(),K(16,"dt"),y(17),Y(),K(18,"dd",6),E(19,GJ,2,3,"code",4)(20,HJ,2,1,"span",2),Y(),K(21,"dt"),y(22),Y(),K(23,"dd",7),E(24,jJ,2,3,"code",4)(25,UJ,2,1,"span",2),Y(),K(26,"dt"),y(27),Y(),K(28,"dd",8),E(29,WJ,2,1,"code")(30,$J,2,1,"span",2),Y(),K(31,"dt"),y(32),Y(),K(33,"dd",9),E(34,KJ,2,1,"code")(35,YJ,2,1,"span",2),Y(),K(36,"dt"),y(37),Y(),K(38,"dd",10),E(39,XJ,2,1,"code")(40,ZJ,2,1,"span",2),Y(),K(41,"dt"),y(42),Y(),K(43,"dd",11)(44,"code"),y(45),Y()()()),e&2){let o,r,a,s,c,d,f,h;l(2),x(i.texts.fields.forPath),l(2),P((o=i.identityBlock().path)?4:5,o),l(3),x(i.texts.fields.bodyHashStored),l(2),P((r=i.identityBlock().bodyHash)?9:10,r),l(3),x(i.texts.fields.bodyHashLive),l(2),P((a=i.bodyHashLive())?14:15,a),l(3),x(i.texts.fields.frontmatterHashStored),l(2),P((s=i.identityBlock().frontmatterHash)?19:20,s),l(3),x(i.texts.fields.frontmatterHashLive),l(2),P((c=i.frontmatterHashLive())?24:25,c),l(3),x(i.texts.fields.resolvedProvider),l(2),P((d=i.identityBlock().resolvedProvider)?29:30,d),l(3),x(i.texts.fields.resolvedKind),l(2),P((f=i.identityBlock().resolvedKind)?34:35,f),l(3),x(i.texts.fields.sidecarStatus),l(2),P((h=i.sidecarStatusLiteral())?39:40,h),l(3),x(i.texts.fields.sidecarPresent),l(3),x(i.sidecarPresent())}},styles:["[_nghost-%COMP%]{display:block}.dbg__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.8rem}.dbg__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-family:var(--sm-font-mono);font-weight:500}.dbg__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}.dbg__kv[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;background:var(--sm-bg-hover);padding:.05rem .3rem;border-radius:var(--sm-radius-sm);word-break:break-all}.dbg__diff[_ngcontent-%COMP%]{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}.dbg__absent[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem;color:var(--sm-text-muted);font-style:italic}"],changeDetection:0})};function QJ(t,n){if(t&1&&(K(0,"span",3),y(1),K(2,"code"),y(3),Y()()),t&2){g(2);let e=ne(0),i=g();l(),Le(" ",i.texts.fields.lastBumpedBy," "),l(2),x(e.lastBumpedBy)}}function JJ(t,n){if(t&1&&(K(0,"dt"),y(1),Y(),K(2,"dd")(3,"span",2),y(4),Y(),E(5,QJ,4,2,"span",3),Y()),t&2){g();let e=ne(0),i=g();l(),x(i.texts.fields.lastBumpedAt),l(2),th("title",e.lastBumpedAt),l(),x(i.lastBumpedRel()),l(),P(e.lastBumpedBy!==null?5:-1)}}function eee(t,n){if(t&1&&(K(0,"span",3),y(1),K(2,"code"),y(3),Y()()),t&2){g(2);let e=ne(0),i=g();l(),Le(" ",i.texts.fields.createdBy," "),l(2),x(e.createdBy)}}function tee(t,n){if(t&1&&(K(0,"dt"),y(1),Y(),K(2,"dd")(3,"span",2),y(4),Y(),E(5,eee,4,2,"span",3),Y()),t&2){g();let e=ne(0),i=g();l(),x(i.texts.fields.createdAt),l(2),th("title",e.createdAt),l(),x(i.createdRel()),l(),P(e.createdBy!==null?5:-1)}}function nee(t,n){if(t&1&&(yt(0),K(1,"dl",0),E(2,JJ,6,4),E(3,tee,6,4),Y()),t&2){let e=Xe(g().audit());l(2),P(e.lastBumpedAt!==null?2:-1),l(),P(e.createdAt!==null?3:-1)}}function iee(t,n){if(t&1&&(K(0,"p",1),y(1),Y()),t&2){let e=g();l(),x(e.texts.headerEmpty)}}var Lp=class t{sidecarRoot=F(null);texts=zn.audit;audit=D(()=>{let n=this.sidecarRoot(),e={lastBumpedAt:null,lastBumpedBy:null,createdAt:null,createdBy:null};if(!n)return e;let i=n.audit;if(typeof i!="object"||i===null)return e;let o=i;return{lastBumpedAt:Fp(o.lastBumpedAt),lastBumpedBy:Fp(o.lastBumpedBy),createdAt:Fp(o.createdAt),createdBy:Fp(o.createdBy)}});hasContent=D(()=>{let n=this.audit();return n.lastBumpedAt!==null||n.lastBumpedBy!==null||n.createdAt!==null||n.createdBy!==null});lastBumpedRel=D(()=>{let n=this.audit().lastBumpedAt;return n===null?null:Mo(n)});createdRel=D(()=>{let n=this.audit().createdAt;return n===null?null:Mo(n)});static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-inspector-audit-panel"]],inputs:{sidecarRoot:[1,"sidecarRoot"]},decls:2,vars:1,consts:[["data-testid","inspector-audit-panel",1,"audit__kv"],["data-testid","inspector-audit-panel-empty",1,"audit__empty"],[3,"title"],[1,"audit__by"]],template:function(e,i){e&1&&E(0,nee,4,3,"dl",0)(1,iee,2,1,"p",1),e&2&&P(i.hasContent()?0:1)},styles:["[_nghost-%COMP%]{display:block}.audit__kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;column-gap:.6rem;row-gap:.2rem;margin:0;font-size:.85rem}.audit__kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:500}.audit__kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}.audit__by[_ngcontent-%COMP%]{color:var(--sm-text-muted)}.audit__by[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.78rem}.audit__empty[_ngcontent-%COMP%]{margin:0;font-style:italic;color:var(--sm-text-muted);font-size:.85rem}"],changeDetection:0})};function Fp(t){return typeof t=="string"&&t.length>0?t:null}var oee=["closeBtn"];function ree(t,n){if(t&1&&(p(0,"span",11),L(1,"i",19),m()),t&2){let e=g();M("pTooltip",e.headerStaleTooltip())}}function aee(t,n){if(t&1&&(p(0,"span",12),it(),p(1,"svg",20),L(2,"path",21)(3,"path",22)(4,"path",23),m()()),t&2){let e=g();M("pTooltip",e.cardTexts.stability.experimental)}}function see(t,n){if(t&1&&(p(0,"span",12),L(1,"i",24),m()),t&2){let e=g();M("pTooltip",e.cardTexts.stability.deprecated)}}function cee(t,n){t&1&&(p(0,"span",13),y(1),m()),t&2&&(l(),x(n))}function dee(t,n){if(t&1){let e=de();p(0,"button",25,0),$("click",function(o){G(e);let r=g();return H(r.onCloseClick(o))}),L(2,"i",26),m()}if(t&2){let e=g();M("pTooltip",e.texts.close.tooltip),U("aria-label",e.texts.close.label)}}function lee(t,n){t&1&&(p(0,"div",17)(1,"span",27),y(2,"Actions"),m(),p(3,"button",28),L(4,"i",29),p(5,"span"),y(6,"Generate summary"),m()(),p(7,"button",30),L(8,"i",31),p(9,"span"),y(10,"Run audit"),m()(),p(11,"button",32),L(12,"i",33),p(13,"span"),y(14,"Validate"),m()()())}function uee(t,n){if(t&1&&(p(0,"span",34),y(1),m()),t&2){let e=n.$implicit;l(),x(e)}}function fee(t,n){if(t&1&&(p(0,"div",18),Z(1,uee,2,1,"span",34,Te),m()),t&2){let e=g();l(),Q(e.headerTools())}}var pee=new Set(["red","orange","yellow","green","cyan","blue","purple","pink"]),Bp=class t{node=F.required();mode=F("standalone");showActionMocks=F(!1);close=Ge();favoriteToggle=Ge();texts=zn;cardTexts=_i;closeBtn=ze("closeBtn");constructor(){pe(()=>{this.mode()==="embedded"&&(this.node(),queueMicrotask(()=>this.closeBtn()?.nativeElement.focus({preventScroll:!0})))})}headerVersion=D(()=>ba(this.node()));headerStability=D(()=>wa(this.node()));headerTitleColor=D(()=>{let n=this.node(),i=n.frontmatter.color;return typeof i=="string"&&pee.has(i)?i:`var(--sm-kind-${n.kind})`});headerTools=D(()=>h0(this.node()));headerIsStale=D(()=>m0(this.node()));headerStaleTooltip=D(()=>g0(this.node(),_i.sidecar));onCloseClick(n){n.stopPropagation(),this.close.emit()}onFavoriteClick(n){n.stopPropagation(),this.favoriteToggle.emit(this.node().path)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-inspector-header"]],viewQuery:function(e,i){e&1&&Ot(i.closeBtn,oee,5),e&2&&_t()},inputs:{node:[1,"node"],mode:[1,"mode"],showActionMocks:[1,"showActionMocks"]},outputs:{close:"close",favoriteToggle:"favoriteToggle"},decls:21,vars:32,consts:[["closeBtn",""],["data-testid","inspector-title",1,"inspector__header"],["aria-hidden","true",1,"inspector__icon-box"],[3,"kind","provider","size"],[1,"inspector__content"],[1,"inspector__name-row"],["data-testid","inspector-title-text",1,"inspector__name"],["data-testid","inspector-path",1,"inspector__path-code"],[1,"inspector__actions-cluster"],["type","button","data-testid","inspector-favorite",1,"inspector__favorite",3,"click","pTooltip"],["aria-hidden","true",1,"pi"],["data-testid","inspector-stale-badge",1,"inspector__stale-icon",3,"pTooltip"],["data-testid","inspector-stability-tag",1,"inspector__stability-icon",3,"pTooltip"],["data-testid","inspector-version",1,"inspector__name-version"],["slot","inspector.header.badge.counter",3,"node"],["slot","inspector.header.badge.tag",3,"node"],["type","button","data-testid","inspector-close",1,"inspector__close",3,"pTooltip"],["data-testid","inspector-plugin-actions",1,"inspector__plugin-actions"],["data-testid","inspector-header-tools",1,"inspector__tools"],["aria-hidden","true",1,"pi","pi-clock"],["width","14","height","14","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true"],["d","M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"],["d","M6.453 15h11.094"],["d","M8.5 2h7"],["aria-hidden","true",1,"pi","pi-ban"],["type","button","data-testid","inspector-close",1,"inspector__close",3,"click","pTooltip"],["aria-hidden","true",1,"pi","pi-times"],[1,"inspector__plugin-actions-label"],["type","button","data-testid","inspector-plugin-btn-summary",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-sparkles"],["type","button","data-testid","inspector-plugin-btn-audit",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-search"],["type","button","data-testid","inspector-plugin-btn-validate",1,"inspector__plugin-btn"],["aria-hidden","true",1,"pi","pi-check-circle"],[1,"inspector__tool-tag"]],template:function(e,i){if(e&1&&(p(0,"header",1)(1,"div",2),L(2,"sm-kind-icon",3),m(),p(3,"div",4)(4,"div",5)(5,"h2",6),y(6),m()(),p(7,"code",7),y(8),m()(),p(9,"div",8)(10,"button",9),$("click",function(r){return i.onFavoriteClick(r)}),L(11,"i",10),m(),E(12,ree,2,1,"span",11),E(13,aee,5,1,"span",12),E(14,see,2,1,"span",12),E(15,cee,2,1,"span",13),L(16,"sm-view-contributions-host",14)(17,"sm-view-contributions-host",15),E(18,dee,3,2,"button",16),m(),E(19,lee,15,0,"div",17),E(20,fee,3,0,"div",18),m()),e&2){let o,r=i.node();ft("--node-color",i.headerTitleColor()),se("inspector__header--skill",r.kind==="skill")("inspector__header--agent",r.kind==="agent")("inspector__header--command",r.kind==="command")("inspector__header--markdown",r.kind==="markdown"),l(2),M("kind",r.kind)("provider",r.provider)("size",18),l(4),x(r.frontmatter.name),l(2),x(r.path),l(2),se("inspector__favorite--on",r.isFavorite===!0),M("pTooltip",r.isFavorite===!0?i.cardTexts.favoriteRemoveTooltip:i.cardTexts.favoriteAddTooltip),U("aria-label",r.isFavorite===!0?i.cardTexts.ariaFavoriteRemove:i.cardTexts.ariaFavoriteAdd),l(),se("pi-star-fill",r.isFavorite===!0)("pi-star",r.isFavorite!==!0),l(),P(i.headerIsStale()?12:-1),l(),P(i.headerStability()==="experimental"?13:-1),l(),P(i.headerStability()==="deprecated"?14:-1),l(),P((o=i.headerVersion())?15:-1,o),l(),M("node",r),l(),M("node",r),l(),P(i.mode()==="embedded"?18:-1),l(),P(i.showActionMocks()?19:-1),l(),P(i.headerTools().length>0?20:-1)}},dependencies:[We,Ze,Ln,mn],styles:["[_nghost-%COMP%]{--hero-fg: #fff;--hero-fg-bold: rgba(255, 255, 255, .95);--hero-fg-soft: rgba(255, 255, 255, .85);--hero-fg-muted: rgba(255, 255, 255, .7);--hero-fg-faint: rgba(255, 255, 255, .5);--hero-divider: rgba(255, 255, 255, .18);--hero-divider-strong: rgba(255, 255, 255, .32);--hero-divider-stronger: rgba(255, 255, 255, .45);--hero-overlay: rgba(255, 255, 255, .08);--hero-overlay-soft: rgba(255, 255, 255, .16);--hero-overlay-strong: rgba(255, 255, 255, .2);--hero-overlay-hover: rgba(255, 255, 255, .26);--hero-warn-fg: #fde68a;--hero-slate-fg: #475569}.inspector__header[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown);position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:.75rem;row-gap:.3rem;align-items:start;padding:.85rem 1rem;background:linear-gradient(to bottom,transparent 0%,transparent 75%,var(--sm-bg-content) 100%),color-mix(in srgb,var(--accent) 75%,var(--hero-slate-fg));color:var(--hero-fg);overflow:hidden}.inspector__header--skill[_ngcontent-%COMP%]{--accent: var(--sm-kind-skill)}.inspector__header--agent[_ngcontent-%COMP%]{--accent: var(--sm-kind-agent)}.inspector__header--command[_ngcontent-%COMP%]{--accent: var(--sm-kind-command)}.inspector__header--markdown[_ngcontent-%COMP%]{--accent: var(--sm-kind-markdown)}.inspector-view--embedded[_nghost-%COMP%] .inspector__header[_ngcontent-%COMP%], .inspector-view--embedded [_nghost-%COMP%] .inspector__header[_ngcontent-%COMP%]{margin:-1rem -1.1rem 0}.inspector__icon-box[_ngcontent-%COMP%]{width:42px;height:42px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--hero-overlay-strong);color:var(--hero-fg);flex:none;font-size:1.1rem;grid-row:1 / span 3;align-self:center}.inspector__content[_ngcontent-%COMP%]{min-width:0;width:100%;display:flex;flex-direction:column;gap:.25rem}.inspector__name-row[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:.35rem;min-width:0}.inspector__name[_ngcontent-%COMP%]{margin:0;font-size:1.05rem;font-weight:600;line-height:1.25;letter-spacing:-.01em;word-break:break-word;color:var(--hero-fg);flex:0 1 auto;min-width:0}.inspector__path-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;color:var(--hero-fg-soft);background:var(--hero-overlay-soft);padding:.1rem .4rem;border-radius:var(--sm-radius-sm);word-break:break-all;align-self:flex-start;max-width:100%}.inspector__actions-cluster[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.3rem;align-self:center}.inspector__favorite[_ngcontent-%COMP%]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;padding:0;cursor:pointer;color:var(--hero-fg-soft);border-radius:var(--sm-radius-md);flex:none;transition:background .12s ease,color .12s ease}.inspector__favorite[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.85rem;line-height:1}.inspector__favorite[_ngcontent-%COMP%]:hover{background:var(--hero-divider);color:var(--hero-fg)}.inspector__favorite[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--hero-fg-muted);outline-offset:1px}.inspector__favorite--on[_ngcontent-%COMP%]{color:var(--hero-fg)}.inspector__stability-icon[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;color:var(--hero-fg-soft);cursor:help}.inspector__stale-icon[_ngcontent-%COMP%]{color:var(--hero-warn-fg)}.inspector__stability-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .inspector__stability-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{font-size:.7rem;width:1em;height:1em;line-height:1}.inspector__close[_ngcontent-%COMP%]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;background:var(--hero-overlay-soft);border:1px solid var(--hero-divider-strong);border-radius:var(--sm-radius-md);padding:0;margin-left:.25rem;color:var(--hero-fg);cursor:pointer;flex:none;transition:background .12s ease,border-color .12s ease}.inspector__close[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{font-size:.75rem;line-height:1}.inspector__close[_ngcontent-%COMP%]:hover{background:var(--hero-overlay-hover);border-color:var(--hero-divider-stronger)}.inspector__close[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--hero-fg-muted);outline-offset:1px}.inspector__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.66rem;color:var(--hero-fg-bold);background:var(--hero-overlay-strong);padding:.06rem .4rem;border-radius:var(--sm-radius-sm);line-height:1.2;flex:none}.inspector__plugin-actions[_ngcontent-%COMP%]{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin-top:.55rem}.inspector__plugin-actions-label[_ngcontent-%COMP%]{font-size:.6rem;text-transform:uppercase;letter-spacing:.06em;font-weight:600;color:var(--hero-fg-muted);margin-right:.15rem}.inspector__plugin-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .75rem;border:1px solid var(--hero-divider-strong);border-radius:var(--sm-radius-pill);background:var(--hero-overlay-soft);color:var(--hero-fg);font-size:.78rem;font-weight:500;cursor:pointer;transition:background .12s ease,border-color .12s ease,transform .12s ease;font-family:inherit}.inspector__plugin-btn[_ngcontent-%COMP%]:hover{background:var(--hero-overlay-hover);border-color:var(--hero-divider-stronger)}.inspector__plugin-btn[_ngcontent-%COMP%]:active{transform:translateY(1px)}.inspector__plugin-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.85rem}.inspector__tools[_ngcontent-%COMP%]{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:.3rem;padding:.45rem 1rem .55rem;margin:.6rem -1rem -.85rem}.inspector__tool-tag[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:.12rem .5rem;border-radius:var(--sm-radius-sm);background:var(--sm-bg-hover);color:var(--p-text-color);font-family:var(--sm-font-mono);font-size:.66rem;font-weight:500;line-height:1.3;flex:none}"],changeDetection:0})};function S_(t){cn(S_);let{path:n,dataSource:e,markdown:i}=t,o=j("idle"),r=j(null),a=0,s=async(d,f)=>{try{let h=await e.getNode(d,{includeBody:!0});if(f!==a)return;if(h===null){o.set("unavailable");return}let v=h.item.body;if(v===null){o.set("unavailable");return}if(v===void 0||v.trim().length===0){o.set("empty");return}let b=await i.render(v);if(f!==a)return;r.set(b),o.set("ready")}catch{if(f!==a)return;o.set("error")}};pe(()=>{let d=n(),f=++a;if(r.set(null),!d){o.set("idle");return}o.set("loading"),s(d,f)});let c=()=>{let d=n();if(!d||o()==="loading")return;let f=++a;r.set(null),o.set("loading"),s(d,f)};return{bodyState:o.asReadonly(),bodyHtml:r.asReadonly(),refresh:c}}function I_(t){cn(I_);let{node:n,sidecarService:e,confirmation:i}=t,o=zn,r=D(()=>{let w=n();if(!w)return!1;let T=w.sidecar;return!T||T.present===!1?!0:T.status==="fresh"?!1:p0(T)}),a=j(!1),s=j(null),c=D(()=>r()?o.bump.tooltipEnabled:o.bump.tooltipDisabledFresh),d=w=>{if(w instanceof rh)switch(w.code){case"sidecar-fresh":return`${o.bump.errorPrefix} ${o.bump.errorFresh}`;case"not-found":return`${o.bump.errorPrefix} ${o.bump.errorNotFound}`;default:return`${o.bump.errorPrefix} ${w.message||o.bump.errorGeneric}`}let T=w instanceof Error?w.message:String(w);return`${o.bump.errorPrefix} ${T||o.bump.errorGeneric}`},f=async w=>{if(!a()){a.set(!0),s.set(null);try{await e.bump(w,{confirm:!0})}catch(T){s.set(d(T))}finally{a.set(!1)}}},h=w=>{i.confirm({header:o.bump.consentHeader,message:o.bump.consentMessage,acceptLabel:o.bump.consentAccept,rejectLabel:o.bump.consentReject,acceptButtonProps:{severity:"primary"},rejectButtonProps:{severity:"secondary"},accept:()=>{f(w)}})},v=async()=>{let w=n();if(w&&r()&&!a()){a.set(!0),s.set(null);try{await e.bump(w.path)}catch(T){if(T instanceof rh&&T.code==="confirm-required"&&hee(T.details)){h(w.path);return}s.set(d(T))}finally{a.set(!1)}}},b=()=>{s.set(null)};return{canBump:r,bumpInFlight:a.asReadonly(),bumpError:s.asReadonly(),bumpTooltip:c,onBumpClick:v,dismissBumpError:b}}function hee(t){return typeof t!="object"||t===null?!1:t.key==="allowEditSmFiles"}function T_(t){cn(T_);let{path:n,pathSet:e,dataSource:i}=t,o=j(new Set),r=j(new Set),a=j(new Set);return pe(()=>{n(),o.set(new Set),r.set(new Set),a.set(new Set)}),{linkStatus:f=>e().has(f)||o().has(f)?"live":r().has(f)?"dead-confirmed":"dead-heuristic",isVerifying:f=>a().has(f),verifyDeadLink:async f=>{if(!(o().has(f)||r().has(f))&&!a().has(f)){a.update(h=>new Set(h).add(f));try{await i.getNode(f)===null?r.update(v=>new Set(v).add(f)):o.update(v=>new Set(v).add(f))}catch{}finally{a.update(h=>{let v=new Set(h);return v.delete(f),v})}}}}}function E_(t){cn(E_);let n=j(!1),e=j(!1),i=j(!1);return pe(()=>{t.path(),n.set(!1),e.set(!1),i.set(!1)}),{auditExpanded:n.asReadonly(),pluginsExpanded:e.asReadonly(),debugVisible:i.asReadonly(),toggleAudit:()=>n.update(o=>!o),togglePlugins:()=>e.update(o=>!o),toggleDebug:()=>i.update(o=>!o)}}var mee=new Set(["inspector.body.panel.breakdown","inspector.body.panel.records","inspector.body.panel.tree","inspector.body.panel.key-values","inspector.body.panel.link-list","inspector.body.panel.markdown"]),gee=new Set(["identity","annotations","settings","audit"]),_ee=new Set(["agent","skill","command"]);function GM(t){let{node:n,texts:e}=t,i=D(()=>{let c=n()?.sidecar;if(!c||!c.present)return null;if(c.root)return c.root;let d={};return c.annotations&&(d.annotations=c.annotations),d}),o=D(()=>{let c=n()?.kind;return c!==void 0&&_ee.has(c)}),r=D(()=>{let c=i();if(!c)return!1;for(let d of Object.keys(c))if(!gee.has(d))return!0;return!1}),a=D(()=>{let c=n()?.contributions??[];for(let d of c)if(mee.has(d.slot))return!0;return!1}),s=D(()=>{let c=i();if(!c)return e.audit.headerEmpty;let d=c.audit;if(typeof d!="object"||d===null)return e.audit.headerEmpty;let f=d,h=typeof f.lastBumpedAt=="string"?f.lastBumpedAt:null,v=typeof f.lastBumpedBy=="string"?f.lastBumpedBy:null;return h===null?e.audit.headerEmpty:e.audit.headerSummary(Mo(h),v??"?")});return{sidecarRoot:i,hasVendorFrontmatter:o,hasPluginContributions:r,hasViewContributions:a,auditSummary:s}}function vee(t,n){if(t&1&&(p(0,"section",0)(1,"div",1),L(2,"span",2),p(3,"p",3),y(4),m(),p(5,"p",4)(6,"span"),y(7),m(),p(8,"a",5),y(9),m(),p(10,"span"),y(11),m(),p(12,"a",6),y(13),m(),p(14,"span"),y(15),m()()()()),t&2){let e=g();l(4),x(e.texts.emptyNoSelection.title),l(3),x(e.texts.emptyNoSelection.descPrefix),l(2),x(e.texts.emptyNoSelection.listLink),l(2),x(e.texts.emptyNoSelection.descMiddle),l(2),x(e.texts.emptyNoSelection.graphLink),l(2),x(e.texts.emptyNoSelection.descSuffix)}}function Cee(t,n){if(t&1&&(p(0,"section",0)(1,"div",7),L(2,"span",8),p(3,"p",3),y(4),m(),p(5,"p",4)(6,"code"),y(7),m(),p(8,"span"),y(9),m(),p(10,"a",5),y(11),m(),p(12,"span"),y(13),m()()()()),t&2){let e=g();l(4),x(e.texts.emptyNotFound.title),l(3),x(e.path()),l(2),x(e.texts.emptyNotFound.descSuffix),l(2),x(e.texts.emptyNotFound.backLink),l(2),x(e.texts.emptyNotFound.descAfterLink)}}function xee(t,n){if(t&1&&(p(0,"a",14),y(1),m()),t&2){let e=g(2);l(),x(e.texts.backToList)}}function bee(t,n){if(t&1&&(p(0,"div",15),L(1,"i",40),p(2,"span"),y(3),m()()),t&2){let e=g(2);l(3),x(e.texts.supersededByBanner(n))}}function wee(t,n){if(t&1){let e=de();p(0,"div",16)(1,"span"),y(2),m(),p(3,"button",41),$("click",function(){G(e);let o=g(2);return H(o.dismissBumpError())}),L(4,"i",42),m()()}t&2&&(l(2),x(n))}function See(t,n){if(t&1&&(p(0,"p",17),y(1),m()),t&2){g();let e=ne(1);l(),x(e.description)}}function Iee(t,n){if(t&1&&(p(0,"div",18),L(1,"sm-inspector-debug-panel",43),m()),t&2){g();let e=ne(0),i=g();l(),M("node",e)("sidecarRoot",i.sidecarRoot())("overlay",e.sidecar)}}function Tee(t,n){if(t&1&&L(0,"sm-empty-state",44)(1,"sm-empty-state",45),t&2){let e=g(2);M("title",e.texts.placeholders.enrichmentTitle)("body",e.texts.placeholders.body),l(),M("title",e.texts.placeholders.summaryTitle)("body",e.texts.placeholders.body)}}function Eee(t,n){if(t&1&&(p(0,"div",48),L(1,"i",49),p(2,"span"),y(3),m(),p(4,"span",50),y(5),m()()),t&2){let e=g(3);l(3),x(e.texts.placeholders.findingsTitle),l(2),x(e.issues().length)}}function Pee(t,n){t&1&&(p(0,"p",55)(1,"strong"),y(2,"Hint:"),m(),y(3),m()),t&2&&(l(3),Le(" ",n," "))}function Mee(t,n){if(t&1&&(p(0,"li",47)(1,"div",51)(2,"span",52),y(3),m(),p(4,"code",53),y(5),m()(),p(6,"p",54),y(7),m(),E(8,Pee,4,1,"p",55),m()),t&2){let e,i=n.$implicit;U("data-severity",i.severity),l(2),U("data-severity",i.severity),l(),x(i.severity),l(2),x(i.analyzerId),l(2),x(i.message),l(),P((e=i.fix==null?null:i.fix.summary)?8:-1,e)}}function kee(t,n){if(t&1&&(p(0,"p-card",20),be(1,Eee,6,2,"ng-template",29),p(2,"ul",46),Z(3,Mee,9,6,"li",47,eh),m()()),t&2){let e=g(2);l(3),Q(e.issues())}}function Dee(t,n){if(t&1&&L(0,"sm-empty-state",21),t&2){let e=g(2);M("title",e.texts.placeholders.findingsTitle)("body",e.texts.placeholders.body)}}function Oee(t,n){if(t&1){let e=de();p(0,"p-card",22)(1,"sm-annotations-panel",56),$("openPath",function(o){G(e);let r=g(2);return H(r.openPath(o))})("tagClick",function(o){G(e);let r=g(2);return H(r.tagSelect.emit(o))}),m()()}if(t&2){g();let e=ne(0),i=g();M("header",i.texts.cardsAnnotations),l(),M("overlay",e.sidecar)("authorTags",i.authorTags())("knownPaths",i.pathSet())("activeTag",i.activeTag())}}function Nee(t,n){if(t&1&&(p(0,"p-card",23),L(1,"sm-vendor-frontmatter",57),m()),t&2){g();let e=ne(0),i=ne(1),o=g();M("header",o.texts.cards.agent),l(),M("frontmatter",i)("kind",e.kind)("provider",e.provider)("knownPaths",o.pathSet())("onSkillClick",o.onSkillChip)}}function Ree(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0),i=g();l(),x(i.texts.stats.bytes),l(3),x(e.bytesTotal)}}function Aee(t,n){if(t&1&&(p(0,"dt"),y(1),m(),p(2,"dd")(3,"code"),y(4),m()()),t&2){g();let e=ne(0),i=g();l(),x(i.texts.stats.tokens),l(3),x(e.tokensTotal)}}function Fee(t,n){if(t&1&&(y(0," \xB7 "),p(1,"code"),y(2),m(),y(3)),t&2){g();let e=ne(0),i=g();l(2),x(e.externalRefsCount),l(),Le(" ",i.texts.stats.ext," ")}}function Lee(t,n){if(t&1){let e=de();p(0,"button",58),$("click",function(){G(e);let o=g(2);return H(o.toggleAudit())}),L(1,"i",59),p(2,"span",60),y(3),m(),p(4,"span",61),y(5),m()()}if(t&2){let e=g(2);U("aria-expanded",e.auditExpanded()),l(),se("pi-chevron-right",!e.auditExpanded())("pi-chevron-down",e.auditExpanded()),l(2),x(e.texts.audit.header),l(2),Le(" \xB7 ",e.auditSummary()," ")}}function Bee(t,n){if(t&1&&L(0,"sm-inspector-audit-panel",30),t&2){let e=g(2);M("sidecarRoot",e.sidecarRoot())}}function zee(t,n){if(t&1){let e=de();p(0,"button",62),$("click",function(){G(e);let o=g(3);return H(o.togglePlugins())}),L(1,"i",59),p(2,"span",60),y(3),m()()}if(t&2){let e=g(3);U("aria-expanded",e.pluginsExpanded()),l(),se("pi-chevron-right",!e.pluginsExpanded())("pi-chevron-down",e.pluginsExpanded()),l(2),x(e.texts.pluginsHeader)}}function qee(t,n){if(t&1&&L(0,"sm-plugin-contributions",30),t&2){let e=g(3);M("sidecarRoot",e.sidecarRoot())}}function Vee(t,n){if(t&1&&(p(0,"p-card",31),be(1,zee,4,6,"ng-template",29),E(2,qee,1,1,"sm-plugin-contributions",30),m()),t&2){let e=g(2);l(2),P(e.pluginsExpanded()?2:-1)}}function Gee(t,n){if(t&1&&(p(0,"p-card",32),L(1,"sm-inspector-slots-panel",63),m()),t&2){let e=g(2);l(),M("node",e.node())}}function Hee(t,n){if(t&1){let e=de();p(0,"div",64)(1,"h3",65),y(2),m(),p(3,"p-button",66),$("onClick",function(){G(e);let o=g(2);return H(o.refreshBody())}),m()()}if(t&2){let e=g(2);l(2),x(e.texts.cards.body),l(),M("rounded",!0)("text",!0)("ariaLabel",e.texts.body.refreshLabel)("pTooltip",e.texts.body.refreshLabel)("disabled",e.bodyState()==="loading"||!e.path())("loading",e.bodyState()==="loading")}}function jee(t,n){if(t&1&&(p(0,"p",34),y(1),m()),t&2){let e=g(2);l(),x(e.texts.body.loading)}}function Uee(t,n){if(t&1&&(p(0,"p",35),y(1),m()),t&2){let e=g(2);l(),x(e.texts.body.empty)}}function Wee(t,n){if(t&1&&(p(0,"p",36),y(1),m()),t&2){let e=g(2);l(),x(e.texts.body.unavailable)}}function $ee(t,n){if(t&1&&(p(0,"p",37),y(1),m()),t&2){let e=g(2);l(),x(e.texts.body.renderError)}}function Kee(t,n){if(t&1&&L(0,"div",38),t&2){let e=g(2);M("innerHTML",e.bodyHtml(),U_)}}function Yee(t,n){if(t&1){let e=de();yt(0)(1),p(2,"section",0)(3,"sm-inspector-header",9),$("close",function(){G(e);let o=g();return H(o.onHeaderClose())})("favoriteToggle",function(o){G(e);let r=g();return H(r.onHeaderFavoriteToggle(o))}),m(),p(4,"div",10)(5,"button",11),$("click",function(){G(e);let o=g();return H(o.toggleDebug())}),L(6,"i",12),m(),p(7,"p-button",13),$("onClick",function(){G(e);let o=g();return H(o.onBumpClick())}),m(),E(8,xee,2,1,"a",14),m(),E(9,bee,4,1,"div",15),E(10,wee,5,1,"div",16),E(11,See,2,1,"p",17),E(12,Iee,2,3,"div",18),p(13,"div",19),E(14,Tee,2,4),E(15,kee,5,0,"p-card",20)(16,Dee,1,2,"sm-empty-state",21),E(17,Oee,2,5,"p-card",22),E(18,Nee,2,6,"p-card",23),p(19,"div",24)(20,"sm-linked-nodes-panel",25),$("openPath",function(o){G(e);let r=g();return H(r.openPath(o))}),m()(),p(21,"p-card",26)(22,"dl",27),E(23,Ree,5,2),E(24,Aee,5,2),p(25,"dt"),y(26),m(),p(27,"dd")(28,"code"),y(29),m(),y(30),p(31,"code"),y(32),m(),y(33),E(34,Fee,4,2),m()()(),p(35,"p-card",28),be(36,Lee,6,7,"ng-template",29),E(37,Bee,1,1,"sm-inspector-audit-panel",30),m(),E(38,Vee,3,1,"p-card",31),E(39,Gee,2,1,"p-card",32),p(40,"p-card",33),be(41,Hee,4,7,"ng-template",29),E(42,jee,2,1,"p",34)(43,Uee,2,1,"p",35)(44,Wee,2,1,"p",36)(45,$ee,2,1,"p",37)(46,Kee,1,1,"div",38),m()(),L(47,"p-confirmdialog",39),m()}if(t&2){let e,i,o,r=g(),a=Xe(r.node());l();let s=Xe(a.frontmatter);l(2),M("node",a)("mode",r.mode())("showActionMocks",r.showActionMocks),l(2),se("inspector__debug-toggle--active",r.debugVisible()),M("pTooltip",r.texts.debugToggleTooltip),U("aria-label",r.texts.debugToggleAriaLabel)("aria-pressed",r.debugVisible()),l(2),M("label",r.texts.bump.label)("disabled",!r.canBump()||r.bumpInFlight())("loading",r.bumpInFlight())("pTooltip",r.bumpTooltip()),l(),P(r.mode()==="standalone"?8:-1),l(),P((e=r.headerSupersededBy())?9:-1,e),l(),P((i=r.bumpError())?10:-1,i),l(),P(s.description?11:-1),l(),P(r.debugVisible()?12:-1),l(2),P(r.mode()==="standalone"?14:-1),l(),P(r.issues().length>0?15:r.mode()==="standalone"?16:-1),l(2),P(a.sidecar!=null&&a.sidecar.present||r.authorTags().length>0?17:-1),l(),P(r.hasVendorFrontmatter()?18:-1),l(2),M("path",a.path),l(3),P(a.bytesTotal!==void 0?23:-1),l(),P(a.tokensTotal!==void 0?24:-1),l(2),x(r.texts.stats.links),l(3),x(a.linksOutCount??0),l(),Le(" ",r.texts.stats.out," \xB7 "),l(2),x(a.linksInCount??0),l(),Le(" ",r.texts.stats.in," "),l(),P(a.externalRefsCount!==void 0&&a.externalRefsCount>0?34:-1),l(3),P(r.auditExpanded()?37:-1),l(),P(r.hasPluginContributions()?38:-1),l(),P(r.hasViewContributions()?39:-1),l(3),P((o=r.bodyState())==="loading"?42:o==="empty"?43:o==="unavailable"?44:o==="error"?45:o==="ready"?46:-1),l(5),M("ariaLabel",r.texts.bump.consentDialogAriaLabel)}}var zp=class t{loader=u(hn);router=u(ua);dataSource=u(pn);markdown=u(y0);sidecarService=u(Tp);confirmation=u(Ei);texts=zn;cardTexts=_i;showActionMocks=xo.inspector.actionMocks;path=F(void 0);mode=F("standalone");activeTag=F(null);close=Ge();tagSelect=Ge();node=D(()=>{let n=this.path();return n?this.loader.nodes().find(e=>e.path===n)??null:null});pathSet=D(()=>{let n=new Set;for(let e of this.loader.nodes())n.add(e.path);return n});authorTags=D(()=>{let e=(this.node()?.frontmatter??{}).tags;if(!Array.isArray(e))return[];let i=e.filter(o=>typeof o=="string"&&o.length>0);return[...new Set(i)].sort()});headerSupersededBy=D(()=>{let n=this.node();if(!n)return null;let i=n.sidecar?.annotations?.supersededBy;if(typeof i=="string"&&i.length>0)return i;let o=xa(n.frontmatter)?.supersededBy;return typeof o=="string"&&o.length>0?o:null});bodyHandle=S_({path:this.path,dataSource:this.dataSource,markdown:this.markdown});bodyState=this.bodyHandle.bodyState;bodyHtml=this.bodyHandle.bodyHtml;deadLink=T_({path:this.path,pathSet:this.pathSet,dataSource:this.dataSource});sectionCollapse=E_({path:this.path});auditExpanded=this.sectionCollapse.auditExpanded;pluginsExpanded=this.sectionCollapse.pluginsExpanded;debugVisible=this.sectionCollapse.debugVisible;derivations=GM({node:this.node,texts:this.texts});sidecarRoot=this.derivations.sidecarRoot;hasVendorFrontmatter=this.derivations.hasVendorFrontmatter;hasPluginContributions=this.derivations.hasPluginContributions;hasViewContributions=this.derivations.hasViewContributions;auditSummary=this.derivations.auditSummary;issues=j([]);issuesLoaderEffect=pe(n=>{let e=this.path();if(this.issues.set([]),!e)return;let i=!1;n(()=>{i=!0}),this.dataSource.listIssues({node:e}).then(o=>{i||this.issues.set(o.items)}).catch(()=>{i||this.issues.set([])})});ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}openPath(n){this.router.navigate(["/graph"],{queryParams:{path:n}})}onSkillChip=n=>{this.openPath(n)};pathExists(n){return this.pathSet().has(n)}linkStatus(n){return this.deadLink.linkStatus(n)}isVerifying(n){return this.deadLink.isVerifying(n)}verifyDeadLink(n){return this.deadLink.verifyDeadLink(n)}refreshBody(){this.bodyHandle.refresh()}onHeaderFavoriteToggle(n){let e=this.node();!e||e.path!==n||this.loader.toggleFavorite(n,!e.isFavorite)}onHeaderClose(){this.close.emit()}toggleAudit(){this.sectionCollapse.toggleAudit()}togglePlugins(){this.sectionCollapse.togglePlugins()}toggleDebug(){this.sectionCollapse.toggleDebug()}bumpHandle=I_({node:this.node,sidecarService:this.sidecarService,confirmation:this.confirmation});canBump=this.bumpHandle.canBump;bumpInFlight=this.bumpHandle.bumpInFlight;bumpError=this.bumpHandle.bumpError;bumpTooltip=this.bumpHandle.bumpTooltip;onBumpClick(){return this.bumpHandle.onBumpClick()}dismissBumpError(){this.bumpHandle.dismissBumpError()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-inspector-view"]],hostVars:2,hostBindings:function(e,i){e&2&&se("inspector-view--embedded",i.mode()==="embedded")},inputs:{path:[1,"path"],mode:[1,"mode"],activeTag:[1,"activeTag"]},outputs:{close:"close",tagSelect:"tagSelect"},features:[we([Ei])],decls:3,vars:1,consts:[["data-testid","inspector-view",1,"inspector"],["data-testid","inspector-empty-no-selection",1,"empty-state"],[1,"empty-state__icon","pi","pi-eye"],[1,"empty-state__title"],[1,"empty-state__desc"],["routerLink","/list",1,"inspector__back"],["routerLink","/graph",1,"inspector__back"],["data-testid","inspector-empty-not-found",1,"empty-state"],[1,"empty-state__icon","empty-state__icon--warn","pi","pi-question-circle"],[3,"close","favoriteToggle","node","mode","showActionMocks"],[1,"inspector__toolbar"],["type","button","data-testid","inspector-debug-toggle",1,"inspector__debug-toggle",3,"click","pTooltip"],["aria-hidden","true",1,"pi","pi-info-circle"],["icon","pi pi-arrow-up-right","severity","secondary","size","small","data-testid","inspector-bump",3,"onClick","label","disabled","loading","pTooltip"],["routerLink","/list","data-testid","inspector-back",1,"inspector__back"],["data-testid","inspector-superseded-banner",1,"inspector__superseded"],["data-testid","inspector-bump-error",1,"inspector__bump-error"],["data-testid","inspector-description",1,"inspector__desc"],["data-testid","inspector-debug-section",1,"inspector__debug"],[1,"inspector__grid"],["data-testid","inspector-findings"],["icon","pi pi-search","testId","inspector-empty-findings",3,"title","body"],["styleClass","inspector__card inspector__card--full","data-testid","inspector-card-annotations",3,"header"],["styleClass","inspector__card inspector__card--full","data-testid","inspector-card-vendor-frontmatter",3,"header"],["data-testid","inspector-card-linked-nodes",1,"inspector__card","inspector__card--full"],[3,"openPath","path"],["styleClass","inspector__card inspector__card--full inspector__card--stats","data-testid","inspector-card-stats"],[1,"kv"],["styleClass","inspector__card inspector__card--full inspector__card--collapsible","data-testid","inspector-card-audit"],["pTemplate","header"],[3,"sidecarRoot"],["styleClass","inspector__card inspector__card--full inspector__card--collapsible","data-testid","inspector-card-plugins"],["styleClass","inspector__card inspector__card--full","data-testid","inspector-card-view-contributions"],["styleClass","inspector__card inspector__card--full inspector__body","data-testid","inspector-card-body"],["data-testid","inspector-body-loading",1,"inspector__body-status"],["data-testid","inspector-body-empty",1,"inspector__body-status"],["data-testid","inspector-body-unavailable",1,"inspector__body-status","inspector__body-status--warn"],["data-testid","inspector-body-error",1,"inspector__body-status","inspector__body-status--warn"],["data-testid","inspector-body-rendered",1,"inspector__body-rendered",3,"innerHTML"],["data-testid","inspector-bump-consent","styleClass","sm-consent-dialog",3,"ariaLabel"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],["type","button","aria-label","Dismiss",1,"inspector__bump-error-dismiss",3,"click"],["aria-hidden","true",1,"pi","pi-times"],[3,"node","sidecarRoot","overlay"],["icon","pi pi-sparkles","testId","inspector-empty-enrichment",3,"title","body"],["icon","pi pi-file","testId","inspector-empty-summary",3,"title","body"],[1,"inspector__findings-list"],["data-testid","inspector-finding",1,"inspector__finding"],[1,"inspector__findings-header"],[1,"pi","pi-search"],[1,"inspector__findings-count"],[1,"inspector__finding-head"],[1,"inspector__finding-severity"],[1,"inspector__finding-analyzer"],[1,"inspector__finding-message"],["data-testid","inspector-finding-hint",1,"inspector__finding-hint"],[3,"openPath","tagClick","overlay","authorTags","knownPaths","activeTag"],[3,"frontmatter","kind","provider","knownPaths","onSkillClick"],["type","button","data-testid","inspector-audit-toggle",1,"inspector__collapsible-header",3,"click"],["aria-hidden","true",1,"pi"],[1,"inspector__collapsible-title"],["data-testid","inspector-audit-summary",1,"inspector__collapsible-summary"],["type","button","data-testid","inspector-plugins-toggle",1,"inspector__collapsible-header",3,"click"],[3,"node"],[1,"inspector__body-header"],[1,"inspector__body-title"],["icon","pi pi-refresh","severity","secondary","data-testid","inspector-body-refresh",3,"onClick","rounded","text","ariaLabel","pTooltip","disabled","loading"]],template:function(e,i){e&1&&E(0,vee,16,6,"section",0)(1,Cee,14,5,"section",0)(2,Yee,48,37,"section",0),e&2&&P(i.path()?i.node()?2:1:0)},dependencies:[Q_,Ip,Kr,un,Mi,Pi,We,Ze,va,ya,Mp,kp,Pp,Op,Np,Rp,Ap,Lp,Bp],styles:["[_nghost-%COMP%]{display:block}.inspector[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.inspector--empty[_ngcontent-%COMP%]{padding:2rem;color:var(--p-text-muted-color)}.inspector--empty[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.1rem .35rem;border-radius:var(--sm-radius-md);font-size:.85rem}.inspector__toolbar[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem}.inspector__back[_ngcontent-%COMP%]{font-size:.9rem;color:var(--p-primary-color)}.inspector__desc[_ngcontent-%COMP%]{margin:0;color:var(--p-text-color);font-size:1rem;line-height:1.5;max-width:70ch}.inspector__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.inspector__card--full[_ngcontent-%COMP%]{grid-column:1 / -1}[_nghost-%COMP%] .inspector__card--hero{border-left:3px solid var(--p-primary-color)}.inspector__body[_ngcontent-%COMP%]{display:block}.inspector__body-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem 1rem 0}.inspector__body-title[_ngcontent-%COMP%]{margin:0;font-size:.95rem;font-weight:600}.inspector__body-status[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--p-text-muted-color);font-style:italic}.inspector__body-status--warn[_ngcontent-%COMP%]{color:var(--sm-severity-warn);font-style:normal}.inspector__body-rendered[_ngcontent-%COMP%]{font-size:.9rem;line-height:1.55;max-height:600px;overflow:auto}.inspector__body-rendered[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0}.inspector__body-rendered[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:0}.inspector__body-rendered[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{background:var(--p-content-background);border:1px solid var(--p-content-border-color);border-radius:var(--sm-radius-md);padding:.75rem;margin:.75rem 0;white-space:pre-wrap;word-wrap:break-word;font-family:var(--sm-font-mono);font-size:.85rem;line-height:1.5;overflow-x:auto}.inspector__body-rendered[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--p-content-background);padding:.1rem .3rem;border-radius:var(--sm-radius-sm);font-family:var(--sm-font-mono);font-size:.85em}.inspector__body-rendered[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:transparent;padding:0;border-radius:0}.kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.25rem .75rem;margin:0 0 .5rem;font-size:.9rem}.kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--p-text-muted-color);font-weight:500}.kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;word-break:break-word}.kv[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.1rem .35rem;border-radius:var(--sm-radius-md);font-size:.85rem}.kv[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--p-primary-color);word-break:break-all}h4[_ngcontent-%COMP%]{margin:1rem 0 .5rem;font-size:.85rem;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color);font-weight:600}h4[_ngcontent-%COMP%]:first-child{margin-top:0}.chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.4rem}[_nghost-%COMP%] .chip--link{cursor:pointer;background:var(--p-primary-50);color:var(--p-primary-color);transition:background .15s ease}[_nghost-%COMP%] .chip--link:hover{background:var(--p-primary-100)}[_nghost-%COMP%] .chip--warn{background:var(--sm-kind-command-bg);color:var(--sm-kind-command-fg)}.rel-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.2rem}.rel-chip__verify[_ngcontent-%COMP%]{background:none;border:none;padding:.15rem;cursor:pointer;color:var(--p-text-muted-color);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;transition:color .15s ease,background .15s ease}.rel-chip__verify[_ngcontent-%COMP%]:hover:not(:disabled){color:var(--p-primary-color);background:var(--sm-bg-hover)}.rel-chip__verify[_ngcontent-%COMP%]:disabled{cursor:wait;opacity:.6}.rel-chip__verify--confirmed[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.rel-chip__verify--confirmed[_ngcontent-%COMP%]:hover:not(:disabled){color:var(--sm-severity-error)}.args[_ngcontent-%COMP%]{margin:0;padding-left:1.25rem;display:flex;flex-direction:column;gap:.35rem;font-size:.9rem}.args[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--sm-bg-hover);padding:.1rem .35rem;border-radius:var(--sm-radius-md);font-size:.8rem;font-weight:500}.args__type[_ngcontent-%COMP%]{color:var(--p-text-muted-color);font-style:italic;margin-left:.25rem}.args__req[_ngcontent-%COMP%]{display:inline-block;margin-left:.5rem;padding:0 .4rem;font-size:.7rem;background:var(--sm-kind-command-bg);color:var(--sm-kind-command-fg);border-radius:var(--sm-radius-md);text-transform:uppercase;letter-spacing:.04em;font-weight:600}.cond[_ngcontent-%COMP%]{font-size:.8rem;word-break:break-all}@media(max-width:1280px){.inspector__grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.inspector-view--embedded[_nghost-%COMP%] .inspector[_ngcontent-%COMP%]{padding:1rem 1.1rem 1.25rem;gap:.85rem}.inspector-view--embedded[_nghost-%COMP%] .inspector__desc[_ngcontent-%COMP%]{font-size:.9rem;line-height:1.45;max-width:none}.inspector-view--embedded[_nghost-%COMP%] .inspector__grid[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:.75rem}.inspector-view--embedded[_nghost-%COMP%] [data-testid=inspector-card-annotations][_ngcontent-%COMP%]{order:1}.inspector-view--embedded[_nghost-%COMP%] [data-testid=inspector-card-vendor-frontmatter][_ngcontent-%COMP%]{order:2}.inspector-view--embedded[_nghost-%COMP%] [data-testid=inspector-card-linked-nodes][_ngcontent-%COMP%]{order:3}.inspector-view--embedded[_nghost-%COMP%] [data-testid=inspector-card-stats][_ngcontent-%COMP%]{order:4}.inspector-view--embedded[_nghost-%COMP%] [data-testid=inspector-card-audit][_ngcontent-%COMP%]{order:5}.inspector-view--embedded[_nghost-%COMP%] [data-testid=inspector-card-plugins][_ngcontent-%COMP%]{order:6}.inspector-view--embedded[_nghost-%COMP%] [data-testid=inspector-card-body][_ngcontent-%COMP%]{order:7}.inspector-view--embedded[_nghost-%COMP%] .inspector__card .p-card-body{padding:.75rem .85rem}.inspector-view--embedded[_nghost-%COMP%] .inspector__card .p-card-title{font-size:.9rem;margin-bottom:.5rem}.inspector-view--embedded[_nghost-%COMP%] .inspector__card[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--p-text-muted-color);margin:.5rem 0 .35rem}.inspector-view--embedded[_nghost-%COMP%] .inspector__card[_ngcontent-%COMP%] .kv[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.25rem .65rem;margin:0;font-size:.85rem}.inspector-view--embedded[_nghost-%COMP%] .inspector__card[_ngcontent-%COMP%] .kv[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--p-text-muted-color)}.inspector-view--embedded[_nghost-%COMP%] .inspector__card[_ngcontent-%COMP%] .kv[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;word-break:break-word}.inspector__bump-error[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;padding:.5rem .75rem;margin:.5rem 0;background:var(--sm-severity-error-bg);color:var(--sm-severity-error);border-radius:var(--sm-radius-md);font-size:.85rem}.inspector__bump-error-dismiss[_ngcontent-%COMP%]{margin-left:auto;background:transparent;border:none;cursor:pointer;color:inherit;display:inline-flex;align-items:center;justify-content:center}.inspector__superseded[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.55rem .85rem;background:var(--sm-severity-warn-bg);color:var(--sm-severity-warn);border-radius:var(--sm-radius-md);font-size:.85rem;font-family:var(--sm-font-mono)}.inspector__debug-toggle[_ngcontent-%COMP%]{width:30px;height:30px;border-radius:50%;border:1px solid var(--sm-border);background:transparent;color:var(--sm-text-muted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:color .12s ease,border-color .12s ease,background .12s ease}.inspector__debug-toggle[_ngcontent-%COMP%]:hover{color:var(--p-primary-color);border-color:var(--p-primary-color)}.inspector__debug-toggle--active[_ngcontent-%COMP%]{color:var(--p-primary-color);border-color:var(--p-primary-color);background:color-mix(in srgb,var(--p-primary-color) 10%,transparent)}.inspector__debug[_ngcontent-%COMP%]{padding:.6rem .85rem;border:1px solid var(--sm-border);border-radius:var(--sm-radius-md);background:var(--sm-bg-hover)}.inspector__collapsible-header[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;gap:.5rem;padding:.65rem 1rem;background:transparent;border:none;text-align:left;cursor:pointer;font-size:.9rem;color:var(--p-text-color)}.inspector__collapsible-header[_ngcontent-%COMP%]:hover{background:var(--sm-bg-hover)}.inspector__collapsible-title[_ngcontent-%COMP%]{font-weight:600}.inspector__collapsible-summary[_ngcontent-%COMP%]{color:var(--sm-text-muted);font-weight:400;font-size:.85rem;font-style:italic}.inspector__findings-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;font-weight:600}.inspector__findings-count[_ngcontent-%COMP%]{margin-left:auto;font-size:.85rem;color:var(--p-text-muted-color)}.inspector__findings-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.inspector__finding[_ngcontent-%COMP%]{padding:.6rem .75rem;border-left:3px solid var(--p-content-border-color);background:var(--p-content-background);border-radius:var(--sm-radius-md)}.inspector__finding[data-severity=error][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-error);background:var(--sm-severity-error-bg)}.inspector__finding[data-severity=warn][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-warn);background:var(--sm-severity-warn-bg)}.inspector__finding[data-severity=info][_ngcontent-%COMP%]{border-left-color:var(--sm-severity-info);background:var(--sm-severity-info-bg)}.inspector__finding-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.25rem}.inspector__finding-severity[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.7rem;font-weight:700;letter-spacing:.04em;padding:.1rem .4rem;border-radius:var(--sm-radius-sm, 4px);color:var(--p-content-background);background:var(--p-text-color)}.inspector__finding-severity[data-severity=error][_ngcontent-%COMP%]{background:var(--sm-severity-error)}.inspector__finding-severity[data-severity=warn][_ngcontent-%COMP%]{background:var(--sm-severity-warn)}.inspector__finding-severity[data-severity=info][_ngcontent-%COMP%]{background:var(--sm-severity-info)}.inspector__finding-analyzer[_ngcontent-%COMP%]{font-size:.8rem;color:var(--p-text-muted-color)}.inspector__finding-message[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--p-text-color)}.inspector__finding-hint[_ngcontent-%COMP%]{margin:.4rem 0 0;font-size:.85rem;color:var(--p-text-color);background:var(--p-content-background);padding:.4rem .5rem;border-radius:var(--sm-radius-sm, 4px)}"],changeDetection:0})};var qp=class t{smMiddleMousePan=F.required();origin=null;rafId=null;pendingPosition=null;onMouseDown(n){if(n.button!==1)return;let e=this.smMiddleMousePan();if(!e)return;n.preventDefault();let i=e.getPosition()??{x:0,y:0};this.origin={mouseX:n.clientX,mouseY:n.clientY,canvasX:i.x,canvasY:i.y},document.addEventListener("mousemove",this.onMove),document.addEventListener("mouseup",this.onEnd)}ngOnDestroy(){this.onEnd()}onMove=n=>{this.origin&&(this.pendingPosition={x:this.origin.canvasX+(n.clientX-this.origin.mouseX),y:this.origin.canvasY+(n.clientY-this.origin.mouseY)},this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.rafId=null;let e=this.smMiddleMousePan();!e||!this.pendingPosition||(e.setPosition(this.pendingPosition),e.redraw())})))};onEnd=()=>{this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.pendingPosition=null,this.origin=null,document.removeEventListener("mousemove",this.onMove),document.removeEventListener("mouseup",this.onEnd),this.smMiddleMousePan()?.emitCanvasChangeEvent()};static \u0275fac=function(e){return new(e||t)};static \u0275dir=De({type:t,selectors:[["","smMiddleMousePan",""]],hostBindings:function(e,i){e&1&&$("mousedown",function(r){return i.onMouseDown(r)})},inputs:{smMiddleMousePan:[1,"smMiddleMousePan"]}})};function P_(t,n){var e,i=1;t==null&&(t=0),n==null&&(n=0);function o(){var r,a=e.length,s,c=0,d=0;for(r=0;r<a;++r)s=e[r],c+=s.x,d+=s.y;for(c=(c/a-t)*i,d=(d/a-n)*i,r=0;r<a;++r)s=e[r],s.x-=c,s.y-=d}return o.initialize=function(r){e=r},o.x=function(r){return arguments.length?(t=+r,o):t},o.y=function(r){return arguments.length?(n=+r,o):n},o.strength=function(r){return arguments.length?(i=+r,o):i},o}function HM(t){let n=+this._x.call(null,t),e=+this._y.call(null,t);return jM(this.cover(n,e),n,e,t)}function jM(t,n,e,i){if(isNaN(n)||isNaN(e))return t;var o,r=t._root,a={data:i},s=t._x0,c=t._y0,d=t._x1,f=t._y1,h,v,b,w,T,k,O,A;if(!r)return t._root=a,t;for(;r.length;)if((T=n>=(h=(s+d)/2))?s=h:d=h,(k=e>=(v=(c+f)/2))?c=v:f=v,o=r,!(r=r[O=k<<1|T]))return o[O]=a,t;if(b=+t._x.call(null,r.data),w=+t._y.call(null,r.data),n===b&&e===w)return a.next=r,o?o[O]=a:t._root=a,t;do o=o?o[O]=new Array(4):t._root=new Array(4),(T=n>=(h=(s+d)/2))?s=h:d=h,(k=e>=(v=(c+f)/2))?c=v:f=v;while((O=k<<1|T)===(A=(w>=v)<<1|b>=h));return o[A]=r,o[O]=a,t}function UM(t){var n,e,i=t.length,o,r,a=new Array(i),s=new Array(i),c=1/0,d=1/0,f=-1/0,h=-1/0;for(e=0;e<i;++e)isNaN(o=+this._x.call(null,n=t[e]))||isNaN(r=+this._y.call(null,n))||(a[e]=o,s[e]=r,o<c&&(c=o),o>f&&(f=o),r<d&&(d=r),r>h&&(h=r));if(c>f||d>h)return this;for(this.cover(c,d).cover(f,h),e=0;e<i;++e)jM(this,a[e],s[e],t[e]);return this}function WM(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,i=this._y0,o=this._x1,r=this._y1;if(isNaN(e))o=(e=Math.floor(t))+1,r=(i=Math.floor(n))+1;else{for(var a=o-e||1,s=this._root,c,d;e>t||t>=o||i>n||n>=r;)switch(d=(n<i)<<1|t<e,c=new Array(4),c[d]=s,s=c,a*=2,d){case 0:o=e+a,r=i+a;break;case 1:e=o-a,r=i+a;break;case 2:o=e+a,i=r-a;break;case 3:e=o-a,i=r-a;break}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=i,this._x1=o,this._y1=r,this}function $M(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function KM(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Qe(t,n,e,i,o){this.node=t,this.x0=n,this.y0=e,this.x1=i,this.y1=o}function YM(t,n,e){var i,o=this._x0,r=this._y0,a,s,c,d,f=this._x1,h=this._y1,v=[],b=this._root,w,T;for(b&&v.push(new Qe(b,o,r,f,h)),e==null?e=1/0:(o=t-e,r=n-e,f=t+e,h=n+e,e*=e);w=v.pop();)if(!(!(b=w.node)||(a=w.x0)>f||(s=w.y0)>h||(c=w.x1)<o||(d=w.y1)<r))if(b.length){var k=(a+c)/2,O=(s+d)/2;v.push(new Qe(b[3],k,O,c,d),new Qe(b[2],a,O,k,d),new Qe(b[1],k,s,c,O),new Qe(b[0],a,s,k,O)),(T=(n>=O)<<1|t>=k)&&(w=v[v.length-1],v[v.length-1]=v[v.length-1-T],v[v.length-1-T]=w)}else{var A=t-+this._x.call(null,b.data),V=n-+this._y.call(null,b.data),q=A*A+V*V;if(q<e){var X=Math.sqrt(e=q);o=t-X,r=n-X,f=t+X,h=n+X,i=b.data}}return i}function XM(t){if(isNaN(f=+this._x.call(null,t))||isNaN(h=+this._y.call(null,t)))return this;var n,e=this._root,i,o,r,a=this._x0,s=this._y0,c=this._x1,d=this._y1,f,h,v,b,w,T,k,O;if(!e)return this;if(e.length)for(;;){if((w=f>=(v=(a+c)/2))?a=v:c=v,(T=h>=(b=(s+d)/2))?s=b:d=b,n=e,!(e=e[k=T<<1|w]))return this;if(!e.length)break;(n[k+1&3]||n[k+2&3]||n[k+3&3])&&(i=n,O=k)}for(;e.data!==t;)if(o=e,!(e=e.next))return this;return(r=e.next)&&delete e.next,o?(r?o.next=r:delete o.next,this):n?(r?n[k]=r:delete n[k],(e=n[0]||n[1]||n[2]||n[3])&&e===(n[3]||n[2]||n[1]||n[0])&&!e.length&&(i?i[O]=e:this._root=e),this):(this._root=r,this)}function ZM(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this}function QM(){return this._root}function JM(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function ek(t){var n=[],e,i=this._root,o,r,a,s,c;for(i&&n.push(new Qe(i,this._x0,this._y0,this._x1,this._y1));e=n.pop();)if(!t(i=e.node,r=e.x0,a=e.y0,s=e.x1,c=e.y1)&&i.length){var d=(r+s)/2,f=(a+c)/2;(o=i[3])&&n.push(new Qe(o,d,f,s,c)),(o=i[2])&&n.push(new Qe(o,r,f,d,c)),(o=i[1])&&n.push(new Qe(o,d,a,s,f)),(o=i[0])&&n.push(new Qe(o,r,a,d,f))}return this}function tk(t){var n=[],e=[],i;for(this._root&&n.push(new Qe(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var o=i.node;if(o.length){var r,a=i.x0,s=i.y0,c=i.x1,d=i.y1,f=(a+c)/2,h=(s+d)/2;(r=o[0])&&n.push(new Qe(r,a,s,f,h)),(r=o[1])&&n.push(new Qe(r,f,s,c,h)),(r=o[2])&&n.push(new Qe(r,a,h,f,d)),(r=o[3])&&n.push(new Qe(r,f,h,c,d))}e.push(i)}for(;i=e.pop();)t(i.node,i.x0,i.y0,i.x1,i.y1);return this}function nk(t){return t[0]}function ik(t){return arguments.length?(this._x=t,this):this._x}function ok(t){return t[1]}function rk(t){return arguments.length?(this._y=t,this):this._y}function yi(t,n,e){var i=new M_(n??nk,e??ok,NaN,NaN,NaN,NaN);return t==null?i:i.addAll(t)}function M_(t,n,e,i,o,r){this._x=t,this._y=n,this._x0=e,this._y0=i,this._x1=o,this._y1=r,this._root=void 0}function ak(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var ut=yi.prototype=M_.prototype;ut.copy=function(){var t=new M_(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,e,i;if(!n)return t;if(!n.length)return t._root=ak(n),t;for(e=[{source:n,target:t._root=new Array(4)}];n=e.pop();)for(var o=0;o<4;++o)(i=n.source[o])&&(i.length?e.push({source:i,target:n.target[o]=new Array(4)}):n.target[o]=ak(i));return t};ut.add=HM;ut.addAll=UM;ut.cover=WM;ut.data=$M;ut.extent=KM;ut.find=YM;ut.remove=XM;ut.removeAll=ZM;ut.root=QM;ut.size=JM;ut.visit=ek;ut.visitAfter=tk;ut.x=ik;ut.y=rk;function Ke(t){return function(){return t}}function Lt(t){return(t()-.5)*1e-6}function Xee(t){return t.x+t.vx}function Zee(t){return t.y+t.vy}function k_(t){var n,e,i,o=1,r=1;typeof t!="function"&&(t=Ke(t==null?1:+t));function a(){for(var d,f=n.length,h,v,b,w,T,k,O=0;O<r;++O)for(h=yi(n,Xee,Zee).visitAfter(s),d=0;d<f;++d)v=n[d],T=e[v.index],k=T*T,b=v.x+v.vx,w=v.y+v.vy,h.visit(A);function A(V,q,X,ue,Ve){var ye=V.data,Je=V.r,fe=T+Je;if(ye){if(ye.index>v.index){var _e=b-ye.x-ye.vx,nt=w-ye.y-ye.vy,ke=_e*_e+nt*nt;ke<fe*fe&&(_e===0&&(_e=Lt(i),ke+=_e*_e),nt===0&&(nt=Lt(i),ke+=nt*nt),ke=(fe-(ke=Math.sqrt(ke)))/ke*o,v.vx+=(_e*=ke)*(fe=(Je*=Je)/(k+Je)),v.vy+=(nt*=ke)*fe,ye.vx-=_e*(fe=1-fe),ye.vy-=nt*fe)}return}return q>b+fe||ue<b-fe||X>w+fe||Ve<w-fe}}function s(d){if(d.data)return d.r=e[d.data.index];for(var f=d.r=0;f<4;++f)d[f]&&d[f].r>d.r&&(d.r=d[f].r)}function c(){if(n){var d,f=n.length,h;for(e=new Array(f),d=0;d<f;++d)h=n[d],e[h.index]=+t(h,d,n)}}return a.initialize=function(d,f){n=d,i=f,c()},a.iterations=function(d){return arguments.length?(r=+d,a):r},a.strength=function(d){return arguments.length?(o=+d,a):o},a.radius=function(d){return arguments.length?(t=typeof d=="function"?d:Ke(+d),c(),a):t},a}function Qee(t){return t.index}function sk(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}function D_(t){var n=Qee,e=h,i,o=Ke(30),r,a,s,c,d,f=1;t==null&&(t=[]);function h(k){return 1/Math.min(s[k.source.index],s[k.target.index])}function v(k){for(var O=0,A=t.length;O<f;++O)for(var V=0,q,X,ue,Ve,ye,Je,fe;V<A;++V)q=t[V],X=q.source,ue=q.target,Ve=ue.x+ue.vx-X.x-X.vx||Lt(d),ye=ue.y+ue.vy-X.y-X.vy||Lt(d),Je=Math.sqrt(Ve*Ve+ye*ye),Je=(Je-r[V])/Je*k*i[V],Ve*=Je,ye*=Je,ue.vx-=Ve*(fe=c[V]),ue.vy-=ye*fe,X.vx+=Ve*(fe=1-fe),X.vy+=ye*fe}function b(){if(a){var k,O=a.length,A=t.length,V=new Map(a.map((X,ue)=>[n(X,ue,a),X])),q;for(k=0,s=new Array(O);k<A;++k)q=t[k],q.index=k,typeof q.source!="object"&&(q.source=sk(V,q.source)),typeof q.target!="object"&&(q.target=sk(V,q.target)),s[q.source.index]=(s[q.source.index]||0)+1,s[q.target.index]=(s[q.target.index]||0)+1;for(k=0,c=new Array(A);k<A;++k)q=t[k],c[k]=s[q.source.index]/(s[q.source.index]+s[q.target.index]);i=new Array(A),w(),r=new Array(A),T()}}function w(){if(a)for(var k=0,O=t.length;k<O;++k)i[k]=+e(t[k],k,t)}function T(){if(a)for(var k=0,O=t.length;k<O;++k)r[k]=+o(t[k],k,t)}return v.initialize=function(k,O){a=k,d=O,b()},v.links=function(k){return arguments.length?(t=k,b(),v):t},v.id=function(k){return arguments.length?(n=k,v):n},v.iterations=function(k){return arguments.length?(f=+k,v):f},v.strength=function(k){return arguments.length?(e=typeof k=="function"?k:Ke(+k),w(),v):e},v.distance=function(k){return arguments.length?(o=typeof k=="function"?k:Ke(+k),T(),v):o},v}var Jee={value:()=>{}};function dk(){for(var t=0,n=arguments.length,e={},i;t<n;++t){if(!(i=arguments[t]+"")||i in e||/[\s.]/.test(i))throw new Error("illegal type: "+i);e[i]=[]}return new Vp(e)}function Vp(t){this._=t}function ete(t,n){return t.trim().split(/^|\s+/).map(function(e){var i="",o=e.indexOf(".");if(o>=0&&(i=e.slice(o+1),e=e.slice(0,o)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}Vp.prototype=dk.prototype={constructor:Vp,on:function(t,n){var e=this._,i=ete(t+"",e),o,r=-1,a=i.length;if(arguments.length<2){for(;++r<a;)if((o=(t=i[r]).type)&&(o=tte(e[o],t.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++r<a;)if(o=(t=i[r]).type)e[o]=ck(e[o],t.name,n);else if(n==null)for(o in e)e[o]=ck(e[o],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Vp(t)},call:function(t,n){if((o=arguments.length-2)>0)for(var e=new Array(o),i=0,o,r;i<o;++i)e[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(n,e)}};function tte(t,n){for(var e=0,i=t.length,o;e<i;++e)if((o=t[e]).name===n)return o.value}function ck(t,n,e){for(var i=0,o=t.length;i<o;++i)if(t[i].name===n){t[i]=Jee,t=t.slice(0,i).concat(t.slice(i+1));break}return e!=null&&t.push({name:n,value:e}),t}var O_=dk;var bo=0,Xr=0,Yr=0,uk=1e3,Gp,Zr,Hp=0,vi=0,jp=0,Qr=typeof performance=="object"&&performance.now?performance:Date,fk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function A_(){return vi||(fk(nte),vi=Qr.now()+jp)}function nte(){vi=0}function N_(){this._call=this._time=this._next=null}N_.prototype=Up.prototype={constructor:N_,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?A_():+e)+(n==null?0:+n),!this._next&&Zr!==this&&(Zr?Zr._next=this:Gp=this,Zr=this),this._call=t,this._time=e,R_()},stop:function(){this._call&&(this._call=null,this._time=1/0,R_())}};function Up(t,n,e){var i=new N_;return i.restart(t,n,e),i}function pk(){A_(),++bo;for(var t=Gp,n;t;)(n=vi-t._time)>=0&&t._call.call(void 0,n),t=t._next;--bo}function lk(){vi=(Hp=Qr.now())+jp,bo=Xr=0;try{pk()}finally{bo=0,ote(),vi=0}}function ite(){var t=Qr.now(),n=t-Hp;n>uk&&(jp-=n,Hp=t)}function ote(){for(var t,n=Gp,e,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Gp=e);Zr=t,R_(i)}function R_(t){if(!bo){Xr&&(Xr=clearTimeout(Xr));var n=t-vi;n>24?(t<1/0&&(Xr=setTimeout(lk,t-Qr.now()-jp)),Yr&&(Yr=clearInterval(Yr))):(Yr||(Hp=Qr.now(),Yr=setInterval(ite,uk)),bo=1,fk(lk))}}function hk(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}function mk(t){return t.x}function gk(t){return t.y}var rte=10,ate=Math.PI*(3-Math.sqrt(5));function F_(t){var n,e=1,i=.001,o=1-Math.pow(i,1/300),r=0,a=.6,s=new Map,c=Up(h),d=O_("tick","end"),f=hk();t==null&&(t=[]);function h(){v(),d.call("tick",n),e<i&&(c.stop(),d.call("end",n))}function v(T){var k,O=t.length,A;T===void 0&&(T=1);for(var V=0;V<T;++V)for(e+=(r-e)*o,s.forEach(function(q){q(e)}),k=0;k<O;++k)A=t[k],A.fx==null?A.x+=A.vx*=a:(A.x=A.fx,A.vx=0),A.fy==null?A.y+=A.vy*=a:(A.y=A.fy,A.vy=0);return n}function b(){for(var T=0,k=t.length,O;T<k;++T){if(O=t[T],O.index=T,O.fx!=null&&(O.x=O.fx),O.fy!=null&&(O.y=O.fy),isNaN(O.x)||isNaN(O.y)){var A=rte*Math.sqrt(.5+T),V=T*ate;O.x=A*Math.cos(V),O.y=A*Math.sin(V)}(isNaN(O.vx)||isNaN(O.vy))&&(O.vx=O.vy=0)}}function w(T){return T.initialize&&T.initialize(t,f),T}return b(),n={tick:v,restart:function(){return c.restart(h),n},stop:function(){return c.stop(),n},nodes:function(T){return arguments.length?(t=T,b(),s.forEach(w),n):t},alpha:function(T){return arguments.length?(e=+T,n):e},alphaMin:function(T){return arguments.length?(i=+T,n):i},alphaDecay:function(T){return arguments.length?(o=+T,n):+o},alphaTarget:function(T){return arguments.length?(r=+T,n):r},velocityDecay:function(T){return arguments.length?(a=1-T,n):1-a},randomSource:function(T){return arguments.length?(f=T,s.forEach(w),n):f},force:function(T,k){return arguments.length>1?(k==null?s.delete(T):s.set(T,w(k)),n):s.get(T)},find:function(T,k,O){var A=0,V=t.length,q,X,ue,Ve,ye;for(O==null?O=1/0:O*=O,A=0;A<V;++A)Ve=t[A],q=T-Ve.x,X=k-Ve.y,ue=q*q+X*X,ue<O&&(ye=Ve,O=ue);return ye},on:function(T,k){return arguments.length>1?(d.on(T,k),n):d.on(T)}}}function L_(){var t,n,e,i,o=Ke(-30),r,a=1,s=1/0,c=.81;function d(b){var w,T=t.length,k=yi(t,mk,gk).visitAfter(h);for(i=b,w=0;w<T;++w)n=t[w],k.visit(v)}function f(){if(t){var b,w=t.length,T;for(r=new Array(w),b=0;b<w;++b)T=t[b],r[T.index]=+o(T,b,t)}}function h(b){var w=0,T,k,O=0,A,V,q;if(b.length){for(A=V=q=0;q<4;++q)(T=b[q])&&(k=Math.abs(T.value))&&(w+=T.value,O+=k,A+=k*T.x,V+=k*T.y);b.x=A/O,b.y=V/O}else{T=b,T.x=T.data.x,T.y=T.data.y;do w+=r[T.data.index];while(T=T.next)}b.value=w}function v(b,w,T,k){if(!b.value)return!0;var O=b.x-n.x,A=b.y-n.y,V=k-w,q=O*O+A*A;if(V*V/c<q)return q<s&&(O===0&&(O=Lt(e),q+=O*O),A===0&&(A=Lt(e),q+=A*A),q<a&&(q=Math.sqrt(a*q)),n.vx+=O*b.value*i/q,n.vy+=A*b.value*i/q),!0;if(b.length||q>=s)return;(b.data!==n||b.next)&&(O===0&&(O=Lt(e),q+=O*O),A===0&&(A=Lt(e),q+=A*A),q<a&&(q=Math.sqrt(a*q)));do b.data!==n&&(V=r[b.data.index]*i/q,n.vx+=O*V,n.vy+=A*V);while(b=b.next)}return d.initialize=function(b,w){t=b,e=w,f()},d.strength=function(b){return arguments.length?(o=typeof b=="function"?b:Ke(+b),f(),d):o},d.distanceMin=function(b){return arguments.length?(a=b*b,d):Math.sqrt(a)},d.distanceMax=function(b){return arguments.length?(s=b*b,d):Math.sqrt(s)},d.theta=function(b){return arguments.length?(c=b*b,d):Math.sqrt(c)},d}function B_(t){var n=Ke(.1),e,i,o;typeof t!="function"&&(t=Ke(t==null?0:+t));function r(s){for(var c=0,d=e.length,f;c<d;++c)f=e[c],f.vx+=(o[c]-f.x)*i[c]*s}function a(){if(e){var s,c=e.length;for(i=new Array(c),o=new Array(c),s=0;s<c;++s)i[s]=isNaN(o[s]=+t(e[s],s,e))?0:+n(e[s],s,e)}}return r.initialize=function(s){e=s,a()},r.strength=function(s){return arguments.length?(n=typeof s=="function"?s:Ke(+s),a(),r):n},r.x=function(s){return arguments.length?(t=typeof s=="function"?s:Ke(+s),a(),r):t},r}function z_(t){var n=Ke(.1),e,i,o;typeof t!="function"&&(t=Ke(t==null?0:+t));function r(s){for(var c=0,d=e.length,f;c<d;++c)f=e[c],f.vy+=(o[c]-f.y)*i[c]*s}function a(){if(e){var s,c=e.length;for(i=new Array(c),o=new Array(c),s=0;s<c;++s)i[s]=isNaN(o[s]=+t(e[s],s,e))?0:+n(e[s],s,e)}}return r.initialize=function(s){e=s,a()},r.strength=function(s){return arguments.length?(n=typeof s=="function"?s:Ke(+s),a(),r):n},r.y=function(s){return arguments.length?(t=typeof s=="function"?s:Ke(+s),a(),r):t},r}var q_=260,_k=120;function yk(t,n){let e=t.map(o=>o.path).sort(),i=n.map(o=>o.id).sort();return`${e.length}|${e.join(",")}|${i.length}|${i.join(",")}`}function vk(t,n){let e=new Set(t.map(d=>d.path)),i=CM(t),o=new Map,r=n?.links??[];for(let d of r){if(!e.has(d.source))continue;let f=bM(d.target,d.trigger?.normalizedTrigger??null,i);if(!e.has(f)||d.source===f)continue;let h=cte(d.kind,d.source,f),v=typeof d.confidence=="number"?d.confidence:.6,b=o.get(h);b?v>b.confidence&&(b.confidence=v):o.set(h,{id:h,from:d.source,to:f,kind:d.kind,confidence:v})}let a=[...o.values()],s=new Map;for(let d of t)s.set(d.path,d);let c=new Map;for(let d of n?.nodes??[])c.set(d.path,d);return{nodesByPath:s,apiNodesByPath:c,edges:a}}async function Ck(t,n,e,i){let o={width:q_,height:_k},r=n.map(f=>({id:f.path,size:o})),a=e.map(f=>({source:f.from,target:f.to})),s=iM[i.spacing],c=await t.calculate(r,a,{algorithm:i.algorithm,direction:i.direction,nodeGap:s.nodeGap,layerGap:s.layerGap}),d=new Map;for(let{id:f,position:h}of c.nodes)d.set(f,{x:h.x,y:h.y});return d}function xk(t,n){let e=t.map(s=>({id:s.path})),i=n.map(s=>({source:s.from,target:s.to})),o=F_(e).force("link",D_(i).id(s=>s.id).distance(90).strength(1)).force("charge",L_().strength(-200)).force("center",P_(0,0)).force("x",B_(0).strength(.06)).force("y",z_(0).strength(.06)).force("collide",k_(q_/2+12)).stop(),r=400;for(let s=0;s<r;s++)o.tick();let a=new Map;for(let s of e)a.set(s.id,{x:(s.x??0)-q_/2,y:(s.y??0)-_k/2});return a}function bk(t,n,e,i=null){let o=t.edges.filter(c=>n.has(c.from)&&n.has(c.to)&&(i===null||i.has(c.kind))),r=new Map,a=new Map;for(let c of o)r.set(c.from,(r.get(c.from)??0)+1),a.set(c.to,(a.get(c.to)??0)+1);let s=[];for(let c of n){let d=t.nodesByPath.get(c);if(!d)continue;let f=t.apiNodesByPath.get(c),h=e[c],v=t.positions.get(c)??{x:0,y:0},b=h?{x:h.x,y:h.y}:v;s.push({id:c,path:c,view:d,kind:d.kind,position:b,stats:{linksIn:a.get(c)??0,linksOut:r.get(c)??0,bytesTotal:f?.bytes.total,tokensTotal:f?.tokens?.total,externalRefsCount:f?.externalRefsCount},summary:ste(d)})}return{nodes:s,edges:o}}function ste(t){let n={injectionDetected:!1,contentQuality:"clean"},e=(t.frontmatter.description??t.frontmatter.name??"").trim();return{kind:"markdown",confidence:.6,safety:n,whatItCovers:e||`${t.kind} entry`,topics:[],keyFacts:[]}}function cte(t,n,e){return`${t}:${n}::${e}`}function wk(t,n){if(t.size===0)return{next:t,dirty:!1};let e=!1,i=new Set;for(let o of t)n.has(o)?i.add(o):e=!0;return{next:e?i:t,dirty:e}}function Sk(t){let{nodes:n,current:e,layout:i}=t,o=new Set(n.map(c=>c.path)),r=!1,a=ae({},e);for(let c of Object.keys(a))o.has(c)||(delete a[c],r=!0);let s=[];for(let c of o)c in a||s.push(c);for(let c of s){let d=i.positions.get(c);d&&(a[c]={x:d.x,y:d.y},r=!0)}return{next:a,dirty:r}}function Ik(t){let{selectedPath:n,setSelectedNodeId:e,readSelectedNodeId:i,graphNodes:o,router:r,route:a}=t,s=f0(a.queryParamMap.pipe(G_(c=>c.get("path"))),{initialValue:a.snapshot.queryParamMap.get("path")});pe(()=>{let c=s(),d=o();if(d.length===0||!c)return;let f=Bt(()=>i());if(f!==null&&d.find(b=>b.id===f)?.view.path===c)return;let h=d.find(v=>v.view.path===c);h&&e(h.id)}),pe(()=>{let c=n(),d=Bt(()=>s());(c??null)!==(d??null)&&r.navigate([],{relativeTo:a,queryParams:{path:c??null},queryParamsHandling:"merge",replaceUrl:!0})})}function Tk(t,n){let i=t.frontmatter.tags;if(Array.isArray(i)&&i.includes(n))return!0;let r=t.sidecar?.annotations?.tags;return!!(Array.isArray(r)&&r.includes(n))}function Ek(t){if(typeof t!="object"||t===null)return!1;let n=t;return typeof n.x=="number"&&typeof n.y=="number"&&Number.isFinite(n.x)&&Number.isFinite(n.y)}function Pk(t){if(typeof t!="object"||t===null)return!1;let n=t;return typeof n.x=="number"&&typeof n.y=="number"&&typeof n.scale=="number"&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.scale)&&n.scale>0}function Mk(t){return t.querySelector(".p-overlay-mask, .p-dialog, .p-overlay")!==null}var kk="sm.graph.viewport",Dk="sm.graph.node-positions",Ok="sm.graph.node-expanded",Nk="sm.graph.panel-width";function Rk(){let t=null;try{t=localStorage.getItem(kk)}catch{return null}if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return Pk(n)?n:null}function Ak(t){try{localStorage.setItem(kk,JSON.stringify(t))}catch{}}function Fk(){let t=null;try{t=localStorage.getItem(Dk)}catch{return{}}if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}if(typeof n!="object"||n===null)return{};let e={};for(let[i,o]of Object.entries(n))Ek(o)&&(e[i]={x:o.x,y:o.y});return e}function Wp(t){try{localStorage.setItem(Dk,JSON.stringify(t))}catch{}}function Lk(){let t=null;try{t=localStorage.getItem(Ok)}catch{return new Set}if(!t)return new Set;let n;try{n=JSON.parse(t)}catch{return new Set}if(!Array.isArray(n))return new Set;let e=new Set;for(let i of n)typeof i=="string"&&i.length>0&&e.add(i);return e}function $p(t){try{localStorage.setItem(Ok,JSON.stringify([...t]))}catch{}}function Bk(){let t=null;try{t=localStorage.getItem(Nk)}catch{return null}if(!t)return null;let n=Number(t);return!Number.isFinite(n)||n<=0?null:n}function zk(t){try{localStorage.setItem(Nk,String(Math.round(t)))}catch{}}var qk=400,Kp=400,Vk=80;function Gk(t){let n=j(t.initialWidth),e=j(typeof window>"u"?1920:window.innerWidth);typeof window<"u"&&H_(window,"resize").pipe(ki(t.destroyRef)).subscribe(()=>e.set(window.innerWidth));let i=D(()=>{let h=Math.max(Kp,e()-Vk),v=n();return v>h||v<Kp?Math.min(qk,h):v}),o=null,r=null,a=null,s=()=>{a=null,r!==null&&(n.set(r),r=null)},c=h=>{if(!o)return;let v=h.clientX-o.mouseX,b=o.widthAtStart-v,w=Math.max(Kp,e()-Vk);r=Math.min(w,Math.max(Kp,b)),a===null&&typeof window<"u"&&(a=window.requestAnimationFrame(s))},d=()=>{o&&(o=null,document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d),a!==null&&typeof window<"u"&&(window.cancelAnimationFrame(a),a=null),r!==null&&(n.set(r),r=null),t.onCommit(n()))};return{clampedPanelWidth:i,onPanelResizeStart:h=>{h.button===0&&(h.preventDefault(),h.stopPropagation(),o={mouseX:h.clientX,widthAtStart:i()},document.addEventListener("mousemove",c),document.addEventListener("mouseup",d))}}}function Hk(t){let{points:n,wrap:e,panelW:i,zoomMin:o}=t;if(n.length===0)return null;let r=1/0,a=1/0,s=-1/0,c=-1/0;for(let q of n)q.x<r&&(r=q.x),q.y<a&&(a=q.y),q.x+260>s&&(s=q.x+260),q.y+120>c&&(c=q.y+120);let d=Math.max(1,e.width-i),f=Math.max(1,s-r),h=Math.max(1,c-a),v=Math.max(1,d-160),b=Math.max(1,e.height-160),w=Math.min(v/f,b/h),T=Math.min(2,Math.max(o,w)),k=(r+s)/2,O=(a+c)/2,A=d/2-k*T,V=e.height/2-O*T;return{position:{x:A,y:V},scale:T}}function jk(t,n,e){if(typeof requestAnimationFrame>"u"||e<=0){t.writePosition(n.position),t.writeScale(n.scale);return}let i=t.readPosition(),o=t.readScale(),r=performance.now(),a=s=>{if(t.isStaleToken())return;let c=Math.min(1,(s-r)/e),d=dte(c);t.writePosition({x:i.x+(n.position.x-i.x)*d,y:i.y+(n.position.y-i.y)*d}),t.writeScale(o+(n.scale-o)*d),c<1&&requestAnimationFrame(a)};requestAnimationFrame(a)}function dte(t){return 1-Math.pow(1-t,3)}var Uk=320;function Wk(t){let n=j(null),e=null,i=0,o=(c,d)=>{let f=++i;jk({readPosition:()=>t.viewportPosition(),readScale:()=>t.viewportScale(),writePosition:h=>t.viewportPosition.set(h),writeScale:h=>t.viewportScale.set(h),isStaleToken:()=>f!==i},c,d)},r=c=>{let d=t.canvasWrap();if(!d||c.length===0)return;let f=t.fullLayout(),h=[];for(let b of c){let w=f.positions.get(b);w&&h.push(w)}if(h.length===0)return;let v=Hk({points:h,wrap:d,panelW:t.selectedNodeId()!==null?t.clampedPanelWidth():0,zoomMin:t.zoomMin});v&&o(v,Uk)},a=()=>{let c=e;c&&(e=null,o({position:c.position,scale:c.scale},Uk))};return{activeTagSelection:n,onTagSelect:c=>{let d=t.flow();if(!d)return;if(n()===c){d.clearSelection(),n.set(null),a();return}let f=t.nodes().filter(h=>Tk(h,c)).map(h=>h.path);if(f.length===0){d.clearSelection(),n.set(null),a();return}e===null&&(e={position:ae({},t.viewportPosition()),scale:t.viewportScale()}),d.select(f,[]),n.set(c),r(f)}}}var Yp=.25,V_=2;function $k(t){let n=j(t.savedViewport?{x:t.savedViewport.x,y:t.savedViewport.y}:{x:0,y:0}),e=j(t.savedViewport?.scale??1),i=D(()=>e()<V_-1e-6),o=D(()=>e()>Yp+1e-6);return{viewportPosition:n,viewportScale:e,canZoomIn:i,canZoomOut:o,onCanvasChange:a=>{let s=n();(s.x!==a.position.x||s.y!==a.position.y)&&n.set({x:a.position.x,y:a.position.y}),e()!==a.scale&&e.set(a.scale),t.hasCompletedInitialLayout()&&Ak({x:a.position.x,y:a.position.y,scale:a.scale})}}}function Kk(t){let n=D(()=>{let c=new Map;for(let d of t.graph().edges)c.has(d.from)||c.set(d.from,new Set),c.has(d.to)||c.set(d.to,new Set),c.get(d.from).add(d.to),c.get(d.to).add(d.from);return c}),e=c=>t.selectedNodeId()===c,i=c=>{let d=t.selectedNodeId();return d===null||d===c?!1:n().get(d)?.has(c)??!1},o=c=>{if(t.activeTagSelection()!==null)return!1;let d=t.selectedNodeId();return d===null||d===c?!1:!(n().get(d)?.has(c)??!1)},r=c=>{let d=t.selectedNodeId();return d!==null&&(c.from===d||c.to===d)},a=c=>{if(t.activeTagSelection()!==null)return!1;let d=t.selectedNodeId();return d===null?!1:c.from!==d&&c.to!==d},s=D(()=>{let c=t.selectedNodeId(),d=t.activeTagSelection()!==null,f=c!==null?n().get(c)??null:null,h=new Map;for(let v of t.graph().nodes){let b=v.id,w=c===b,T=!w&&c!==null&&(f?.has(b)??!1),k=!d&&c!==null&&!w&&!(f?.has(b)??!1);h.set(b,{selected:w,highlighted:T,dimmed:k})}return h});return{isSelected:e,isHighlighted:i,isDimmed:o,isEdgeHighlighted:r,isEdgeDimmed:a,selectionView:s}}function Yk(t){let n=t.onCommit??Wp,e=null,i=!1,o=null,r=()=>{queueMicrotask(()=>{if(!i){o=null;return}i=!1,o&&(t.nodePositions.set(o),o=null),n(t.nodePositions())})},a=(d,f)=>{o||(o=ae({},t.nodePositions())),o[d]={x:f.x,y:f.y},i=!0},s=d=>{e={x:d.clientX,y:d.clientY},document.addEventListener("mouseup",r,{once:!0})},c=d=>{let f=e;if(e=null,!f)return!0;let h=d.clientX-f.x,v=d.clientY-f.y;return Math.hypot(h,v)<=4};return t.destroyRef.onDestroy(()=>{document.removeEventListener("mouseup",r)}),{onNodePositionChange:a,onNodePointerDown:s,isClickWithoutDrag:c}}function Xk(t){let n=j(Lk());return pe(()=>{let r=new Set(t.nodes().map(s=>s.path));if(r.size===0)return;let a=wk(n(),r);a.dirty&&(n.set(a.next),$p(a.next))}),{isExpanded:r=>n().has(r),setExpanded:(r,a)=>{let s=n();if(s.has(r)===a)return;let c=new Set(s);a?c.add(r):c.delete(r),n.set(c),$p(c)},resetAll:()=>{n.set(new Set),$p(new Set)}}}function Zk(t){let n=!1,e=null;return pe(()=>{let i=t.visibleNodes();n||i.length!==0&&queueMicrotask(()=>{n=!0,t.savedViewport||t.fit()})}),pe(()=>{let i=t.pathsFingerprint();if(!n){e=i;return}e!==i&&(e=i,t.fit())}),{hasCompletedInitialLayout:()=>n}}var lte=["canvasWrap"],nD=(t,n)=>n.id;function ute(t,n){if(t&1&&(p(0,"div",6),L(1,"span",11),p(2,"p",12),y(3),m()()),t&2){let e=g();l(3),x(e.texts.loading)}}function fte(t,n){if(t&1&&(p(0,"div",7),L(1,"span",13),p(2,"p",12),y(3),m(),p(4,"p",14),y(5),m()()),t&2){let e=g();l(3),x(e.texts.errorTitle),l(2),x(e.error())}}function pte(t,n){if(t&1&&(p(0,"div",8),L(1,"span",15),p(2,"p",12),y(3),m(),p(4,"p",14),y(5),m()()),t&2){let e=g();l(3),x(e.texts.emptyTitle),l(2),x(e.texts.emptyDesc)}}function hte(t,n){if(t&1&&(p(0,"f-connection",48),it(),p(1,"svg",49),L(2,"circle",50),m(),Qp(),L(3,"f-connection-marker-arrow",51),m()),t&2){let e=n.$implicit,i=g(2);Fe("f-conn--"+e.kind),ft("opacity",i.edgeOpacity(e)),se("f-conn--highlighted",i.isEdgeHighlighted(e))("f-conn--dimmed",i.isEdgeDimmed(e)),M("fOutputId",e.from+"-out")("fInputId",e.to+"-in")("fOutputSide",i.outputSide())("fInputSide",i.inputSide())("fType",i.connectionType())("fBehavior",i.connectionBehavior)("fReassignDisabled",!0),l(),M("type",i.markerStart)("width",9)("height",9)("refX",4.5)("refY",4.5),l(2),M("type",i.markerEnd)}}function mte(t,n){if(t&1){let e=de();Gn(0,22),p(1,"div",53),$("fNodePositionChange",function(o){let r=G(e).$implicit,a=g(3);return H(a.onNodePositionChange(r.id,o))})("pointerdown",function(o){G(e);let r=g(3);return H(r.onNodePointerDown(o))})("click",function(o){let r=G(e).$implicit,a=g(3);return H(a.selectNode(r,o))})("dblclick",function(){let o=G(e).$implicit,r=g(3);return H(r.openNode(o))}),p(2,"sm-node-card",54),$("expandedChange",function(o){let r=G(e).$implicit,a=g(3);return H(a.setExpanded(r.id,o))})("favoriteToggle",function(o){G(e);let r=g(3);return H(r.onFavoriteToggle(o))}),m(),p(3,"div",55),L(4,"sm-view-contributions-host",56),m()(),Hn()}if(t&2){let e=n.$implicit,i=g(3);l(),M("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fInputConnectableSide",i.inputSide())("fOutputId",e.id+"-out")("fOutputConnectableSide",i.outputSide()),U("data-testid","graph-node-"+e.id),l(),M("node",e.view)("stats",e.stats)("summary",e.summary)("selection",i.selectionFor(e.id))("expanded",i.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),l(2),M("node",e.view)}}function gte(t,n){if(t&1&&be(0,mte,5,14,"ng-container",52),t&2){let e=g(2);M("fVirtualForOf",e.graph().nodes)}}function _te(t,n){if(t&1){let e=de();p(0,"div",58),$("fNodePositionChange",function(o){let r=G(e).$implicit,a=g(3);return H(a.onNodePositionChange(r.id,o))})("pointerdown",function(o){G(e);let r=g(3);return H(r.onNodePointerDown(o))})("click",function(o){let r=G(e).$implicit,a=g(3);return H(a.selectNode(r,o))})("dblclick",function(){let o=G(e).$implicit,r=g(3);return H(r.openNode(o))}),p(1,"sm-node-card",54),$("expandedChange",function(o){let r=G(e).$implicit,a=g(3);return H(a.setExpanded(r.id,o))})("favoriteToggle",function(o){G(e);let r=g(3);return H(r.onFavoriteToggle(o))}),m(),p(2,"div",55),L(3,"sm-view-contributions-host",56),m()()}if(t&2){let e=n.$implicit,i=g(3);M("fNodeId",e.id)("fNodePosition",e.position)("fInputId",e.id+"-in")("fOutputId",e.id+"-out"),U("data-testid","graph-node-"+e.id),l(),M("node",e.view)("stats",e.stats)("summary",e.summary)("selection",i.selectionFor(e.id))("expanded",i.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),l(2),M("node",e.view)}}function yte(t,n){if(t&1&&(Gn(0,22),Z(1,_te,4,12,"div",57,nD),Hn()),t&2){let e=g(2);l(),Q(e.graph().nodes)}}function vte(t,n){if(t&1&&L(0,"sm-perf-hud",28),t&2){let e=g(2);M("visible",e.visibleCount())("total",e.totalCount())("edges",e.edgeCount())}}function Cte(t,n){if(t&1){let e=de();p(0,"li",43)(1,"button",59),$("click",function(){let o=G(e).$implicit;g();let r=Qt(36);return g().setLayoutAlgorithm(o),H(r.hide())}),y(2),m()()}if(t&2){let e=n.$implicit,i=g(2);l(),se("is-active",i.layoutAlgorithm()===e),U("aria-checked",i.layoutAlgorithm()===e)("data-testid","graph-layout-algorithm-option-"+e),l(),Le(" ",i.layoutAlgorithmLabel(e)," ")}}function xte(t,n){if(t&1){let e=de();p(0,"button",60),$("click",function(){let o=G(e).$implicit;g();let r=Qt(41);return g().setLayoutDirection(o),H(r.hide())}),L(1,"i",61),m()}if(t&2){let e=n.$implicit,i=g(2);se("is-active",i.layoutDirection()===e),M("pTooltip",i.layoutDirectionLabel(e)),U("aria-checked",i.layoutDirection()===e)("aria-label",i.layoutDirectionLabel(e))("data-testid","graph-layout-direction-option-"+e),l(),Fe(i.directionItemIcon(e))}}function bte(t,n){if(t&1){let e=de();p(0,"button",60),$("click",function(){let o=G(e).$implicit;g();let r=Qt(46);return g().setLayoutSpacing(o),H(r.hide())}),L(1,"i",61),m()}if(t&2){let e=n.$implicit,i=g(2);se("is-active",i.layoutSpacing()===e),M("pTooltip",i.layoutSpacingLabel(e)),U("aria-checked",i.layoutSpacing()===e)("aria-label",i.layoutSpacingLabel(e))("data-testid","graph-layout-spacing-option-"+e),l(),Fe(i.spacingItemIcon(e))}}function wte(t,n){if(t&1){let e=de();p(0,"button",60),$("click",function(){let o=G(e).$implicit;g();let r=Qt(51);return g().setConnectionType(o),H(r.hide())}),it(),p(1,"svg",62),L(2,"path",39),m()()}if(t&2){let e=n.$implicit,i=g(2);se("is-active",i.connectionType()===e),M("pTooltip",i.connectionTypeLabel(e)),U("aria-checked",i.connectionType()===e)("aria-label",i.connectionTypeLabel(e))("data-testid","graph-connection-type-option-"+e),l(2),U("d",i.connectionTypeItemPath(e))}}function Ste(t,n){if(t&1){let e=de();p(0,"div",16,0),$("click",function(o){G(e);let r=g();return H(r.onCanvasClick(o))}),p(2,"f-flow",17),$("fLoaded",function(){G(e);let o=g();return H(o.onLoaded())}),L(3,"f-selection-area"),p(4,"f-background"),L(5,"f-rect-pattern"),m(),L(6,"f-line-alignment",18),p(7,"f-canvas",19),$("fCanvasChange",function(o){G(e);let r=g();return H(r.onCanvasChange(o))}),Gn(8,20),Z(9,hte,4,21,"f-connection",21,nD),Hn(),E(11,gte,1,1,"ng-container",22)(12,yte,3,0,"ng-container",22),m(),L(13,"f-minimap"),m(),p(14,"div",23),L(15,"sm-kind-palette")(16,"sm-link-kind-palette"),m(),p(17,"aside",24)(18,"div",25),$("mousedown",function(o){G(e);let r=g();return H(r.onPanelResizeStart(o))}),m(),p(19,"div",26)(20,"sm-inspector-view",27),$("close",function(){G(e);let o=g();return H(o.closePanel())})("tagSelect",function(o){G(e);let r=g();return H(r.onTagSelect(o))}),m()()(),E(21,vte,1,3,"sm-perf-hud",28),p(22,"div",29)(23,"p-button",30),$("onClick",function(){G(e);let o=g();return H(o.zoomIn())}),m(),p(24,"p-button",31),$("onClick",function(){G(e);let o=g();return H(o.zoomOut())}),m(),p(25,"p-button",32),$("onClick",function(){G(e);let o=g();return H(o.fitToScreen())}),m(),L(26,"span",33),p(27,"p-button",34),$("onClick",function(o){G(e);let r=Qt(36);return H(r.toggle(o))}),m(),p(28,"p-button",35),$("onClick",function(o){G(e);let r=Qt(41);return H(r.toggle(o))}),m(),p(29,"p-button",36),$("onClick",function(o){G(e);let r=Qt(46);return H(r.toggle(o))}),m(),p(30,"p-button",37),$("onClick",function(o){G(e);let r=Qt(51);return H(r.toggle(o))}),it(),p(31,"svg",38),L(32,"path",39),m()(),Qp(),L(33,"span",33),p(34,"p-button",40),$("onClick",function(){G(e);let o=g();return H(o.resetLayout())}),m()(),p(35,"p-popover",41,1)(37,"ul",42),Z(38,Cte,3,5,"li",43,Te),m()(),p(40,"p-popover",41,2)(42,"div",44),Z(43,xte,2,8,"button",45,Te),m()(),p(45,"p-popover",41,3)(47,"div",46),Z(48,bte,2,8,"button",45,Te),m()(),p(50,"p-popover",41,4)(52,"div",47),Z(53,wte,3,7,"button",45,Te),m()()()}if(t&2){let e=g();M("smMiddleMousePan",e.canvas()),l(2),M("fCache",e.perf.cache),l(4),M("fAlignThreshold",20),l(),M("position",e.viewportPosition())("scale",e.viewportScale())("fZoomStep",.06)("fZoomDblClickStep",.35)("fZoomMinimum",e.zoomMin)("fZoomMaximum",e.zoomMax)("debounceTime",150),l(2),Q(e.graph().edges),l(2),P(e.perf.virtualization?11:12),l(6),ft("width",e.clampedPanelWidth(),"px"),se("is-open",e.selectedNodeId()!==null),U("aria-label",e.texts.a11y.panel),l(),U("aria-label",e.texts.panel.resizeLabel),l(2),M("path",e.selectedPath())("activeTag",e.activeTagSelection()),l(),P(e.perfHud()?21:-1),l(),U("aria-label",e.texts.a11y.toolbar),l(),M("ariaLabel",e.texts.toolbar.zoomIn)("pTooltip",e.texts.toolbar.zoomIn)("text",!0)("rounded",!0)("disabled",!e.canZoomIn()),l(),M("ariaLabel",e.texts.toolbar.zoomOut)("pTooltip",e.texts.toolbar.zoomOut)("text",!0)("rounded",!0)("disabled",!e.canZoomOut()),l(),M("ariaLabel",e.texts.toolbar.fitToScreen)("pTooltip",e.texts.toolbar.fitToScreen)("text",!0)("rounded",!0),l(2),M("ariaLabel",e.texts.toolbar.layoutAlgorithmLabel)("pTooltip",e.texts.toolbar.layoutAlgorithmTooltip)("text",!0)("rounded",!0),l(),M("icon",e.directionIcon())("ariaLabel",e.texts.toolbar.layoutDirectionLabel)("pTooltip",e.directionAvailable()?e.texts.toolbar.layoutDirectionTooltip:e.texts.toolbar.layoutDirectionUnavailableTooltip)("text",!0)("rounded",!0)("disabled",!e.directionAvailable()),l(),M("icon",e.spacingIcon())("ariaLabel",e.texts.toolbar.layoutSpacingLabel)("pTooltip",e.spacingAvailable()?e.texts.toolbar.layoutSpacingTooltip:e.texts.toolbar.layoutSpacingUnavailableTooltip)("text",!0)("rounded",!0)("disabled",!e.spacingAvailable()),l(),M("ariaLabel",e.texts.toolbar.connectionTypeLabel)("pTooltip",e.texts.toolbar.connectionTypeTooltip)("text",!0)("rounded",!0),l(2),U("d",e.connectionTypeItemPath(e.connectionType())),l(2),M("ariaLabel",e.texts.toolbar.resetLayoutLabel)("pTooltip",e.texts.toolbar.resetLayoutTooltip)("text",!0)("rounded",!0),l(4),Q(e.layoutAlgorithms),l(5),Q(e.layoutDirections),l(5),Q(e.layoutSpacings),l(5),Q(e.connectionTypes)}}var Qk=.2,Ite={selected:!1,highlighted:!1,dimmed:!1},Tte={TOP_BOTTOM:{output:Ee.BOTTOM,input:Ee.TOP},BOTTOM_TOP:{output:Ee.TOP,input:Ee.BOTTOM},LEFT_RIGHT:{output:Ee.RIGHT,input:Ee.LEFT},RIGHT_LEFT:{output:Ee.LEFT,input:Ee.RIGHT}};function Ete(t){return Tte[t]}var Jk={TOP_BOTTOM:"pi pi-arrow-down",BOTTOM_TOP:"pi pi-arrow-up",LEFT_RIGHT:"pi pi-arrow-right",RIGHT_LEFT:"pi pi-arrow-left"},eD={compact:"pi pi-window-minimize",normal:"pi pi-bars",spacious:"pi pi-window-maximize"},Pte={segment:"M 2 14 L 8 14 L 8 2 L 14 2",straight:"M 2 14 L 14 2",bezier:"M 2 14 C 6 14, 10 2, 14 2","adaptive-curve":"M 2 14 C 8 14, 8 2, 14 2"},tD=class t{loader=u(hn);filters=u(Oi);graphPreferences=u(yp);router=u(ua);route=u(Z_);confirmationService=u(Ei);destroyRef=u(rt);dagreLayout=u(f_);injector=u(ot);flow=ze(_r);canvas=ze(gr);zoom=ze(yr);canvasWrap=ze("canvasWrap");connectionType=this.graphPreferences.connectionType;connectionBehavior=vn.FIXED;markerStart=xe.START_ALL_STATES;markerEnd=xe.END_ALL_STATES;perf=xo.graph.perf;perfHud=u(Sp).visible;savedViewport=Rk();viewportStore=$k({savedViewport:this.savedViewport,hasCompletedInitialLayout:()=>this.layoutFit.hasCompletedInitialLayout()});viewportPosition=this.viewportStore.viewportPosition;viewportScale=this.viewportStore.viewportScale;canZoomIn=this.viewportStore.canZoomIn;canZoomOut=this.viewportStore.canZoomOut;zoomMin=Yp;zoomMax=V_;texts=gi;nodePositions=j(Fk());nodeDrag=Yk({destroyRef:this.destroyRef,nodePositions:this.nodePositions});expansion=Xk({nodes:this.loader.nodes});panelResize=Gk({destroyRef:this.destroyRef,initialWidth:Bk()??400,onCommit:n=>zk(n)});clampedPanelWidth=this.panelResize.clampedPanelWidth;loading=this.loader.loading;error=this.loader.error;visibleNodes=D(()=>this.filters.apply(this.loader.nodes()));topology=D(()=>vk(this.loader.nodes(),this.loader.scan()));layoutPositions=j(new Map);layoutComputedAtSignal=j(0);fullLayout=D(()=>Xt(ae({},this.topology()),{positions:this.layoutPositions(),computedAt:this.layoutComputedAtSignal()}));graph=D(()=>{let n=new Set(this.visibleNodes().map(o=>o.path)),e=this.filters.selectedLinkKinds(),i=e.length>0?new Set(e):null;return bk(this.fullLayout(),n,this.nodePositions(),i)});hasData=D(()=>this.graph().nodes.length>0);showEmptyState=D(()=>!this.hasData()&&!this.filters.kindToggleExplicitEmpty());visibleCount=D(()=>this.graph().nodes.length);totalCount=D(()=>this.loader.nodes().length);edgeCount=D(()=>this.graph().edges.length);layoutComputedAt=D(()=>this.layoutComputedAtSignal());connectionSides=D(()=>{if(!h_(this.graphPreferences.layoutAlgorithm()))return{input:Ee.CALCULATE,output:Ee.CALCULATE};let n=this.graphPreferences.layoutDirection();return Ete(n)});inputSide=D(()=>this.connectionSides().input);outputSide=D(()=>this.connectionSides().output);layoutAlgorithms=p_;layoutDirections=m_;layoutSpacings=g_;connectionTypes=__;layoutAlgorithm=this.graphPreferences.layoutAlgorithm;layoutDirection=this.graphPreferences.layoutDirection;layoutSpacing=this.graphPreferences.layoutSpacing;directionIcon=D(()=>Jk[this.layoutDirection()]);spacingIcon=D(()=>eD[this.layoutSpacing()]);directionAvailable=D(()=>h_(this.layoutAlgorithm()));spacingAvailable=D(()=>nM(this.layoutAlgorithm()));selectedNodeId=j(null);selectedPath=D(()=>{let n=this.selectedNodeId();return n?this.graph().nodes.find(i=>i.id===n)?.view.path:void 0});selectionGuard=pe(()=>{let n=this.selectedNodeId();if(n===null)return;this.graph().nodes.some(i=>i.id===n)||this.selectedNodeId.set(null)});pathsFingerprint=D(()=>this.loader.nodes().map(n=>n.path).sort().join("|"));layoutFit=Zk({visibleNodes:this.visibleNodes,pathsFingerprint:this.pathsFingerprint,savedViewport:this.savedViewport,fit:()=>this.fitToScreenClamped()});constructor(){let n=D(()=>this.loader.nodes().map(o=>({id:o.path,view:{path:o.path}})),{equal:(o,r)=>{if(o.length!==r.length)return!1;for(let a=0;a<o.length;a++)if(o[a]?.id!==r[a]?.id)return!1;return!0}});Ik({selectedPath:this.selectedPath,setSelectedNodeId:o=>this.selectedNodeId.set(o),readSelectedNodeId:()=>this.selectedNodeId(),graphNodes:n,router:this.router,route:this.route}),pe(()=>{let o=this.loader.nodes();if(o.length===0)return;let r=this.fullLayout();if(r.positions.size===0)return;let a=Sk({nodes:o,current:this.nodePositions(),layout:r});a.dirty&&(this.nodePositions.set(a.next),Wp(a.next))});let e="",i="";pe(()=>{let o=this.loader.nodes(),r=this.topology(),a={algorithm:this.graphPreferences.layoutAlgorithm(),direction:this.graphPreferences.layoutDirection(),spacing:this.graphPreferences.layoutSpacing()};if(o.length===0)return;let s=yk(o,r.edges),c=`${a.algorithm}|${a.direction}|${a.spacing}`,d=`${s}|${c}`;if(d===e)return;let f=i!==""&&i!==c;e=d,i=c,(a.algorithm==="force"?Promise.resolve(xk(o,r.edges)):Promise.resolve().then(()=>Ck(this.dagreLayout,o,r.edges,a))).then(v=>{this.layoutPositions.set(v),this.layoutComputedAtSignal.set(performance.now()),f&&(this.nodePositions.set({}),this.fitToScreenClamped())}).catch(v=>{console.error("[graph-view] layout failed:",v)})})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}onLoaded(){}onCanvasChange=this.viewportStore.onCanvasChange;fitToScreenClamped(){let n=this.canvas(),e=this.zoom();n&&(n.fitToScreen({x:40,y:40},!1),na(()=>{let i=n.transform.scale;if(i<=this.zoomMax&&i>=this.zoomMin)return;let o=Math.max(this.zoomMin,Math.min(i,this.zoomMax)),r=Math.abs(i-o),a=i>o?Rt.ZOOM_OUT:Rt.ZOOM_IN;e?.setZoom(this.getViewportCenter(),r,a,!1)},{injector:this.injector}))}onNodePositionChange(n,e){this.nodeDrag.onNodePositionChange(n,e)}zoomIn(){this.zoom()?.setZoom(this.getViewportCenter(),Qk,Rt.ZOOM_IN,!0)}zoomOut(){this.zoom()?.setZoom(this.getViewportCenter(),Qk,Rt.ZOOM_OUT,!0)}fitToScreen(){this.fitToScreenClamped()}resetLayout(){let n=gi.resetLayoutConfirm;this.confirmationService.confirm({header:n.header,message:n.message,icon:"pi pi-exclamation-triangle",acceptButtonProps:{label:n.accept,severity:"danger"},rejectButtonProps:{label:n.reject,severity:"secondary",outlined:!0},accept:()=>{this.nodePositions.set({}),this.expansion.resetAll(),this.fitToScreenClamped()}})}getViewportCenter(){let n=this.canvasWrap()?.nativeElement;if(!n)return{x:0,y:0};let e=n.getBoundingClientRect();return{x:e.width/2,y:e.height/2}}onNodePointerDown(n){this.nodeDrag.onNodePointerDown(n)}selectNode(n,e){this.nodeDrag.isClickWithoutDrag(e)&&this.selectedNodeId.set(n.id)}tagSelection=Wk({flow:this.flow,nodes:this.loader.nodes,fullLayout:D(()=>this.fullLayout()),canvasWrap:()=>{let n=this.canvasWrap()?.nativeElement;return n?{width:n.clientWidth,height:n.clientHeight}:null},selectedNodeId:this.selectedNodeId,clampedPanelWidth:this.clampedPanelWidth,zoomMin:Yp,viewportPosition:this.viewportPosition,viewportScale:this.viewportScale});activeTagSelection=this.tagSelection.activeTagSelection;selectionState=Kk({graph:this.graph,selectedNodeId:this.selectedNodeId,activeTagSelection:this.activeTagSelection});onTagSelect(n){this.tagSelection.onTagSelect(n)}closePanel(){this.selectedNodeId.set(null)}onEscape(){this.selectedNodeId()!==null&&(typeof document<"u"&&Mk(document)||this.closePanel())}onPanelResizeStart(n){this.panelResize.onPanelResizeStart(n)}openNode(n){this.selectedNodeId.set(n.id)}onCanvasClick(n){let e=n.target;e?.closest(".sm-gnode")||e?.closest(".graph__toolbar")||e?.closest(".perf-hud")||e?.closest(".kind-palette")||e?.closest(".graph__panel")||this.selectedNodeId.set(null)}isSelected(n){return this.selectionState.isSelected(n)}isHighlighted(n){return this.selectionState.isHighlighted(n)}isDimmed(n){return this.selectionState.isDimmed(n)}selectionFor(n){return this.selectionState.selectionView().get(n)??Ite}isExpanded(n){return this.expansion.isExpanded(n)}setExpanded(n,e){this.expansion.setExpanded(n,e)}onFavoriteToggle(n){this.loader.toggleFavorite(n.path,n.value)}isEdgeHighlighted(n){return this.selectionState.isEdgeHighlighted(n)}isEdgeDimmed(n){return this.selectionState.isEdgeDimmed(n)}edgeOpacity(n){return this.isEdgeDimmed(n)?.15:.25+.75*(typeof n.confidence=="number"?n.confidence:.6)}layoutAlgorithmLabel(n){return gi.layout.algorithm.options[n].label}layoutDirectionLabel(n){return gi.layout.direction.options[n].label}layoutSpacingLabel(n){return gi.layout.spacing.options[n].label}setLayoutAlgorithm(n){this.graphPreferences.setLayoutAlgorithm(n)}setLayoutDirection(n){this.graphPreferences.setLayoutDirection(n)}setLayoutSpacing(n){this.graphPreferences.setLayoutSpacing(n)}directionItemIcon(n){return Jk[n]}spacingItemIcon(n){return eD[n]}connectionTypeLabel(n){return gi.layout.connection.options[n].label}setConnectionType(n){this.graphPreferences.setConnectionType(n)}connectionTypeItemPath(n){return Pte[n]}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=J({type:t,selectors:[["sm-graph-view"]],viewQuery:function(e,i){e&1&&Ot(i.flow,_r,5)(i.canvas,gr,5)(i.zoom,yr,5)(i.canvasWrap,lte,5),e&2&&_t(4)},hostBindings:function(e,i){e&1&&$("keydown.escape",function(){return i.onEscape()},ta)},features:[we([Ei,Ky(f_,{mode:yn.MANUAL})])],decls:6,vars:2,consts:[["canvasWrap",""],["algorithmPopover",""],["directionPopover",""],["spacingPopover",""],["connectionTypePopover",""],["data-testid","graph-view",1,"graph"],["data-testid","graph-loading",1,"empty-state"],["data-testid","graph-error",1,"empty-state"],["data-testid","graph-empty",1,"empty-state"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"smMiddleMousePan"],["styleClass","graph__confirm","maskStyleClass","graph__confirm-mask","data-testid","graph-reset-layout-confirm",3,"ariaLabel"],[1,"empty-state__icon","fa-solid","fa-spinner","fa-spin"],[1,"empty-state__title"],[1,"empty-state__icon","empty-state__icon--error","fa-solid","fa-circle-exclamation"],[1,"empty-state__desc"],[1,"empty-state__icon","fa-solid","fa-filter-circle-xmark"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"click","smMiddleMousePan"],["fDraggable","",3,"fLoaded","fCache"],[3,"fAlignThreshold"],["fZoom","",3,"fCanvasChange","position","scale","fZoomStep","fZoomDblClickStep","fZoomMinimum","fZoomMaximum","debounceTime"],["ngProjectAs","[fConnections]",5,["","fConnections",""]],[3,"fOutputId","fInputId","fOutputSide","fInputSide","fType","fBehavior","fReassignDisabled","class","f-conn--highlighted","f-conn--dimmed","opacity"],["ngProjectAs","[fNodes]",5,["","fNodes",""]],[1,"graph__filter-stack"],["role","complementary","data-testid","graph-panel",1,"graph__panel"],["role","separator","aria-orientation","vertical","data-testid","graph-panel-resize",1,"graph__panel-resize",3,"mousedown"],[1,"graph__panel-scroll"],["mode","embedded",3,"close","tagSelect","path","activeTag"],[3,"visible","total","edges"],["role","toolbar","data-testid","graph-toolbar",1,"graph__toolbar"],["icon","pi pi-search-plus","severity","secondary","size","small","data-testid","graph-zoom-in",3,"onClick","ariaLabel","pTooltip","text","rounded","disabled"],["icon","pi pi-search-minus","severity","secondary","size","small","data-testid","graph-zoom-out",3,"onClick","ariaLabel","pTooltip","text","rounded","disabled"],["icon","pi pi-stop","severity","secondary","size","small","data-testid","graph-fit-to-screen",3,"onClick","ariaLabel","pTooltip","text","rounded"],["aria-hidden","true",1,"graph__toolbar-sep"],["icon","pi pi-sitemap","severity","secondary","size","small","data-testid","graph-layout-algorithm-toggle",3,"onClick","ariaLabel","pTooltip","text","rounded"],["severity","secondary","size","small","data-testid","graph-layout-direction-toggle",3,"onClick","icon","ariaLabel","pTooltip","text","rounded","disabled"],["severity","secondary","size","small","data-testid","graph-layout-spacing-toggle",3,"onClick","icon","ariaLabel","pTooltip","text","rounded","disabled"],["severity","secondary","size","small","data-testid","graph-connection-type-toggle",3,"onClick","ariaLabel","pTooltip","text","rounded"],["viewBox","0 0 16 16","aria-hidden","true",1,"graph__connection-svg","graph__connection-svg--toggle"],["fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["icon","pi pi-history","severity","secondary","size","small","data-testid","graph-reset-layout",3,"onClick","ariaLabel","pTooltip","text","rounded"],["appendTo","body","styleClass","graph__layout-popover"],["role","menu","data-testid","graph-layout-algorithm-menu",1,"graph__layout-menu"],["role","none"],["role","menu","data-testid","graph-layout-direction-menu",1,"graph__layout-icon-row"],["type","button","role","menuitemradio",1,"graph__layout-icon-item",3,"is-active","pTooltip"],["role","menu","data-testid","graph-layout-spacing-menu",1,"graph__layout-icon-row"],["role","menu","data-testid","graph-connection-type-menu",1,"graph__layout-icon-row"],[3,"fOutputId","fInputId","fOutputSide","fInputSide","fType","fBehavior","fReassignDisabled"],["fMarker","","viewBox","0 0 9 9","markerUnits","userSpaceOnUse",1,"sm-edge-dot",3,"type","width","height","refX","refY"],["cx","4.5","cy","4.5","r","3.5"],[3,"type"],["ngProjectAs","[fNodes]",5,["","fNodes",""],4,"fVirtualFor","fVirtualForOf"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition","fInputId","fInputConnectableSide","fOutputId","fOutputConnectableSide"],[3,"expandedChange","favoriteToggle","node","stats","summary","selection","expanded","isFavorite"],[1,"sm-gnode__marker-anchor"],["slot","graph.node.alert",3,"node"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","","fInputConnectableSide","top","fOutputConnectableSide","bottom",1,"sm-gnode-host",3,"fNodeId","fNodePosition","fInputId","fOutputId"],["fNode","","fDragHandle","","fNodeInput","","fNodeOutput","","fInputConnectableSide","top","fOutputConnectableSide","bottom",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition","fInputId","fOutputId"],["type","button","role","menuitemradio",1,"graph__layout-menu-item",3,"click"],["type","button","role","menuitemradio",1,"graph__layout-icon-item",3,"click","pTooltip"],["aria-hidden","true"],["viewBox","0 0 16 16","aria-hidden","true",1,"graph__connection-svg"]],template:function(e,i){e&1&&(p(0,"section",5),E(1,ute,4,1,"div",6)(2,fte,6,2,"div",7)(3,pte,6,2,"div",8)(4,Ste,55,60,"div",9),L(5,"p-confirmdialog",10),m()),e&2&&(l(),P(i.loading()&&!i.hasData()?1:i.error()&&!i.hasData()?2:i.showEmptyState()?3:4),l(4),M("ariaLabel",i.texts.resetLayoutConfirm.header))},dependencies:[ov,_r,gr,Zy,Xy,yr,tv,uy,fy,Qy,Dy,Ry,Jy,ev,Af,ky,nv,Uy,vp,Cp,xp,wp,zp,Mi,Pi,va,ya,T0,sh,We,Ze,mn,qp],styles:['[_nghost-%COMP%]{display:block;height:100%}.graph[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%]{position:relative;flex:1;min-height:0;background:var(--sm-bg-content);overflow:hidden;--ff-connection-drag-handle-stroke: transparent;--ff-connection-drag-handle-fill: transparent;--ff-canvas-background-color: transparent}.graph__filter-stack[_ngcontent-%COMP%]{position:absolute;top:16px;left:16px;z-index:2;display:flex;flex-direction:column;gap:8px;pointer-events:none}.graph__filter-stack[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:auto}.graph__canvas-wrap[_ngcontent-%COMP%] f-flow[_ngcontent-%COMP%]{width:100%;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%] .f-connection-drag-handle{fill:transparent;stroke:transparent}.graph__panel[_ngcontent-%COMP%]{position:absolute;top:0;right:0;bottom:0;background:var(--sm-bg-content);border-left:1px solid var(--sm-border);box-shadow:0 4px 24px #0000002e;transform:translate(100%);transition:transform .22s ease;z-index:20;pointer-events:none;display:flex;overflow:hidden}.graph__panel.is-open[_ngcontent-%COMP%]{transform:translate(0);pointer-events:auto}.graph__panel-scroll[_ngcontent-%COMP%]{flex:1;min-height:0;min-width:0;overflow-y:auto}.graph__panel-resize[_ngcontent-%COMP%]{position:absolute;top:0;left:0;bottom:0;width:6px;cursor:ew-resize;z-index:2;background:transparent;transition:background .12s ease}.graph__panel-resize[_ngcontent-%COMP%]:hover, .graph__panel-resize[_ngcontent-%COMP%]:active{background:color-mix(in srgb,var(--p-primary-color) 30%,transparent)}.graph__toolbar[_ngcontent-%COMP%]{position:absolute;bottom:16px;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:2px;padding:4px;background:var(--sm-bg-content);border:1px solid var(--sm-border);border-radius:var(--sm-radius-pill);box-shadow:var(--sm-shadow-floating);z-index:2;pointer-events:auto;transition:box-shadow .22s ease}.graph__toolbar-sep[_ngcontent-%COMP%]{width:1px;height:18px;margin:0 2px;background:var(--sm-border);flex-shrink:0}.sm-gnode-host[_ngcontent-%COMP%]{position:relative;display:inline-block;cursor:pointer;--ff-node-width: auto;--ff-node-min-height: 0;--ff-node-padding: 0;--ff-node-background-color: transparent;--ff-node-border-color: transparent;--ff-node-border-color-selected: transparent;--ff-node-border-radius: 0;--ff-node-shadow: none;--ff-node-shadow-selected: none}.sm-gnode-host.f-selected[_ngcontent-%COMP%]{filter:drop-shadow(0 0 6px var(--p-primary-color-300))}.sm-gnode-host.f-selected[_ngcontent-%COMP%] > .sm-gnode[_ngcontent-%COMP%]{box-shadow:0 0 0 3px var(--p-primary-color),var(--sm-shadow-card)}.f-conn--invokes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes);--ff-connection-width: 1.5px;--ff-marker-color: var(--sm-edge-invokes)}.f-conn--references[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references);--ff-connection-width: 1.25px;--ff-marker-color: var(--sm-edge-references)}.f-conn--mentions[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions);--ff-connection-width: 1px;--ff-marker-color: var(--sm-edge-mentions)}.f-conn--supersedes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes);--ff-connection-width: 1.25px;--ff-marker-color: var(--sm-edge-supersedes)}.graph__canvas-wrap[_ngcontent-%COMP%] .f-conn--supersedes .f-connection-path{stroke-dasharray:none}.f-conn--highlighted[_ngcontent-%COMP%]{--ff-connection-width: 2px}.f-conn--dimmed[_ngcontent-%COMP%]{opacity:.15}.f-connection.f-selected[_ngcontent-%COMP%]{--ff-connection-width: 2.5px}.f-conn--invokes.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes-active);--ff-connection-selected-color: var(--sm-edge-invokes-active);--ff-marker-color: var(--sm-edge-invokes-active)}.f-conn--references.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references-active);--ff-connection-selected-color: var(--sm-edge-references-active);--ff-marker-color: var(--sm-edge-references-active)}.f-conn--mentions.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions-active);--ff-connection-selected-color: var(--sm-edge-mentions-active);--ff-marker-color: var(--sm-edge-mentions-active)}.f-conn--supersedes.f-selected[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes-active);--ff-connection-selected-color: var(--sm-edge-supersedes-active);--ff-marker-color: var(--sm-edge-supersedes-active)}.sm-gnode__marker-anchor[_ngcontent-%COMP%]{position:absolute;top:-10px;right:-10px;z-index:4;display:inline-flex;align-items:center;gap:.25rem;pointer-events:none;transition:opacity .15s ease}sm-node-card.sm-gnode--dimmed[_ngcontent-%COMP%] + .sm-gnode__marker-anchor[_ngcontent-%COMP%]{opacity:.25}sm-node-card.sm-gnode--deprecated[_ngcontent-%COMP%] + .sm-gnode__marker-anchor[_ngcontent-%COMP%]{opacity:.55}[_nghost-%COMP%] .graph__layout-popover .p-popover-content{padding:4px}.graph__layout-menu[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;min-width:160px}.graph__layout-menu-item[_ngcontent-%COMP%]{appearance:none;border:0;background:transparent;color:var(--sm-text);font:inherit;text-align:left;padding:6px 10px;border-radius:var(--sm-radius-sm, 4px);cursor:pointer;display:flex;align-items:center;gap:8px;transition:background .12s ease,color .12s ease}.graph__layout-menu-item[_ngcontent-%COMP%]:hover, .graph__layout-menu-item[_ngcontent-%COMP%]:focus-visible{background:color-mix(in srgb,var(--p-primary-color) 12%,transparent);outline:none}.graph__layout-menu-item.is-active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--p-primary-color) 18%,transparent);color:var(--p-primary-color);font-weight:600}.graph__layout-menu-item[_ngcontent-%COMP%]:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:transparent;flex-shrink:0}.graph__layout-menu-item.is-active[_ngcontent-%COMP%]:before{background:var(--p-primary-color)}.graph__layout-icon-row[_ngcontent-%COMP%]{display:inline-flex;flex-direction:row;gap:2px;padding:2px}.graph__layout-icon-item[_ngcontent-%COMP%]{appearance:none;border:0;background:transparent;color:var(--sm-text);cursor:pointer;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--sm-radius-sm, 4px);transition:background .12s ease,color .12s ease}.graph__layout-icon-item[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:1rem}.graph__connection-svg[_ngcontent-%COMP%]{width:20px;height:20px;overflow:visible}.graph__connection-svg--toggle[_ngcontent-%COMP%]{width:16px;height:16px}.graph__layout-icon-item[_ngcontent-%COMP%]:hover, .graph__layout-icon-item[_ngcontent-%COMP%]:focus-visible{background:color-mix(in srgb,var(--p-primary-color) 12%,transparent);outline:none}.graph__layout-icon-item.is-active[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--p-primary-color) 18%,transparent);color:var(--p-primary-color)}'],changeDetection:0})};export{tD as GraphView};