@skill-map/cli 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/tutorial/sm-tutorial.md +3 -3
- package/dist/cli.js +7476 -6447
- package/dist/cli.js.map +1 -1
- package/dist/conformance/index.js +1 -1
- package/dist/conformance/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +182 -141
- package/dist/index.js.map +1 -1
- package/dist/kernel/index.d.ts +268 -109
- package/dist/kernel/index.js +182 -141
- package/dist/kernel/index.js.map +1 -1
- package/dist/migrations/001_initial.sql +17 -17
- package/dist/ui/{chunk-7CAK6MVK.js → chunk-2W62S3FU.js} +10 -10
- package/dist/ui/{chunk-BORRASJB.js → chunk-C7QWBAYP.js} +6 -6
- package/dist/ui/{chunk-VWAUXWQX.js → chunk-DLT5AP43.js} +1 -1
- package/dist/ui/chunk-HJSRMZTK.js +450 -0
- package/dist/ui/chunk-HOBQ4G4O.js +125 -0
- package/dist/ui/chunk-IBUV6OG2.js +1 -0
- package/dist/ui/chunk-LQTUSDHD.js +124 -0
- package/dist/ui/chunk-QICH7GU2.js +5 -0
- package/dist/ui/chunk-UJRROL5X.js +1 -0
- package/dist/ui/chunk-VLNLJAUB.js +61 -0
- package/dist/ui/{chunk-LFIE4SCX.js → chunk-W3JLG7BI.js} +13 -13
- package/dist/ui/index.html +2 -2
- package/dist/ui/main-QHE47BCM.js +1 -0
- package/dist/ui/{styles-UAABA7VK.css → styles-VJ5Q6D2X.css} +1 -1
- package/migrations/001_initial.sql +17 -17
- package/package.json +2 -2
- package/dist/ui/chunk-CZSS4D6J.js +0 -454
- package/dist/ui/chunk-EQD7AYYJ.js +0 -227
- package/dist/ui/chunk-ETTRVTFV.js +0 -1
- package/dist/ui/chunk-OKO3QOH6.js +0 -1
- package/dist/ui/chunk-PMIMYHBM.js +0 -61
- package/dist/ui/chunk-UHFGCO24.js +0 -1
- package/dist/ui/chunk-VHIPW3TH.js +0 -1
- package/dist/ui/main-BSYMJKTL.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{b as xn,d as Uh}from"./chunk-ETTRVTFV.js";import{a as wo,b as So,c as Io,d as bn,e as To,f as wn}from"./chunk-VWAUXWQX.js";import{b as Oh,d as po,e as Fh,i as _o,j as Vh,k as Qe,l as Ue,m as Mt,n as yo,o as Zt,p as Dt,r as vo}from"./chunk-PMIMYHBM.js";import{a as jh}from"./chunk-UHFGCO24.js";import{d as Co,e as xo,f as bo}from"./chunk-VHIPW3TH.js";import{$ as Qn,$a as qt,$b as Kt,Aa as _e,Ab as Dh,Ba as Pe,Cc as Lh,Dc as Bh,Eb as ot,Ec as gn,Fb as Le,Fc as mo,Gb as Q,Hb as Re,Hc as zh,J as g,K as no,Ka as Z,Kc as Gh,Lc as Hh,M as fe,N as pn,Na as w,O as d,Oa as S,Qa as we,Qb as ei,R as Ch,Ra as J,Rc as ti,S as j,Sa as ee,Sb as gt,Sc as go,T as U,Ta as P,Tb as E,U as Ae,Ua as u,V as _u,Va as f,W as Ye,Wa as B,Wb as je,X as io,Xa as H,Xb as F,Y as Ze,Ya as $,Yb as Ie,Za as Pt,Zb as lo,Zc as yn,_ as nt,_a as Wt,_b as xu,_c as vn,ab as _n,bb as ao,bc as xe,ca as q,cb as co,cc as We,cd as Cn,da as me,db as ae,dd as Yt,ea as mn,eb as vu,fa as ne,fb as K,g as C,ha as Se,hb as p,ia as oo,ib as Xt,ja as xh,jb as Me,ka as gu,kb as Ph,lc as kh,m as eo,ma as bh,mb as wt,n as vh,na as wh,nb as St,nc as Rh,oa as c,ob as Cu,oc as uo,pa as Sh,pb as ft,pc as fo,qa as Ih,qb as it,ra as Th,rc as Nh,sa as yu,sb as at,sc as ho,ta as ro,tb as de,u as to,ub as Mh,vb as Ce,wa as te,wb as m,xa as so,xb as y,ya as Ee,yb as He,za as Eh,zb as Jn}from"./chunk-LFIE4SCX.js";import{V as Ah}from"./chunk-3R7E3HPC.js";import{a as ue,b as mu}from"./chunk-Q7L6LLAK.js";var Qt=class{constructor(i,e,n,o,r){this.center=i,this.radiusX=e,this.radiusY=n,this.startAngle=o,this.endAngle=r}},A=class t{static castToPoint(i){return i||t.initialize()}static initialize(i=0,e=0){return{x:i,y:e}}static copy(i){return t.initialize(i.x,i.y)}static isEqual(i,e){return i.x===e.x&&i.y===e.y}static sum(i,e){return{x:i.x+e.x,y:i.y+e.y}}static sub(i,e){return{x:i.x-e.x,y:i.y-e.y}}static div(i,e){return{x:i.x/e,y:i.y/e}}static mult(i,e){return{x:i.x*e,y:i.y*e}}static interpolatePoints(i,e,n){let o=1-n;return t.initialize(i.x*o+e.x*n,i.y*o+e.y*n)}static roundTo(i,e){let n=Math.trunc(i.x/e),o=Math.trunc(i.y/e);return{x:n*e,y:o*e}}static hypotenuse(i,e){let n=e.x-i.x,o=e.y-i.y;return Math.abs(Math.sqrt(n*n+o*o))}static distance(i,e){let n=i.x-e.x,o=i.y-e.y;return Math.sqrt(n*n+o*o)}static getMinimum(i,e){return t.initialize(Math.min(i.x,e.x),Math.min(i.y,e.y))}static getMaximum(i,e){return t.initialize(Math.max(i.x,e.x),Math.max(i.y,e.y))}static matrixTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getScreenCTM();if(o){let r=e.createSVGPoint();r.x=i.x,r.y=i.y,n=r.matrixTransform(o.inverse())}return n}static elementTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getBoundingClientRect();return n=t.sub(n,t.initialize(o.left,o.top)),n}},X=class t{constructor(i=0,e=0){this.x=i,this.y=e}static fromPoint(i){return new t(i.x,i.y)}add(i){let e=A.sum(this,i);return t.fromPoint(e)}sub(i){let e=A.sub(this,i);return t.fromPoint(e)}subNumber(i){let e=A.sub(this,new t(i,i));return t.fromPoint(e)}div(i){let e=A.div(this,i);return t.fromPoint(e)}mult(i){let e=A.mult(this,i);return t.fromPoint(e)}matrixTransform(i){let e=A.matrixTransform(this,i);return t.fromPoint(e)}elementTransform(i){let e=A.elementTransform(this,i);return t.fromPoint(e)}},ni=class{static initialize(i=A.initialize(),e=A.initialize()){return{point1:i,point2:e}}static copy(i){return{point1:i.point1,point2:i.point2}}static hypotenuse(i){return Math.sqrt(Math.pow(i.point1.x-i.point2.x,2)+Math.pow(i.point1.y-i.point2.y,2))}},Jt=class{constructor(i,e){this.point1=i,this.point2=e}},G=class t{static initialize(i=0,e=0,n=0,o=0){n<0&&(i=i+n,n=-n),o<0&&(e=e+o,o=-o);let r=A.initialize(i+n/2,e+o/2);return{x:i,y:e,width:n,height:o,gravityCenter:r}}static copy(i){return t.initialize(i.x,i.y,i.width,i.height)}static fromElement(i){let{x:e,y:n,width:o,height:r}=i.getBoundingClientRect();return t.initialize(e,n,o,r)}static isIncludePoint(i,e){return e.x>=t.left(i)&&e.x<=t.right(i)&&e.y>=t.top(i)&&e.y<=t.bottom(i)}static intersectionWithRect(i,e){return!(i.x+i.width<e.x||e.x+e.width<i.x||i.y+i.height<e.y||e.y+e.height<i.y)}static left(i){return i.x}static top(i){return i.y}static right(i){return i.x+i.width}static bottom(i){return i.y+i.height}static addPoint(i,e){let n=t.copy(i);return n.x+=e.x,n.y+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static mult(i,e){let n=t.copy(i);return n.x*=e,n.y*=e,n.width*=e,n.height*=e,this.initialize(n.x,n.y,n.width,n.height)}static div(i,e){let n=t.copy(i);return n.x/=e,n.y/=e,n.width/=e,n.height/=e,this.initialize(n.x,n.y,n.width,n.height)}static addPointToSize(i,e){let n=t.copy(i);return n.width+=e.x,n.height+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static union(i){return!i||i.length===0?null:i.reduce((e,n)=>{let o=Math.min(e.x,n.x),r=Math.min(e.y,n.y),s=Math.max(e.x+e.width,n.x+n.width),a=Math.max(e.y+e.height,n.y+n.height);return t.initialize(o,r,s-o,a-r)},i[0])}static elementTransform(i,e){let n=e.getBoundingClientRect(),o=A.sub(i,A.initialize(n.left,n.top));return t.initialize(o.x,o.y,i.width,i.height)}static updateIsNotFinite(i){return!Number.isFinite(i.width)||!Number.isFinite(i.height)||!Number.isFinite(i.x)||!Number.isFinite(i.y)?t.initialize(0,0,0,0):i}};function $h(t,i){let e=Math.max(t.width,i),n=Math.max(t.height,i),o=(e-t.width)/2,r=(n-t.height)/2;return G.initialize(t.x-o,t.y-r,e,n)}function wu(t,i){t=G.updateIsNotFinite(t),i.setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("width",t.width.toString()),i.setAttribute("height",t.height.toString())}function Wh(t,i){t=G.updateIsNotFinite(t),i.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}var De=class t{constructor(i=0,e=0,n=0,o=0,r=0,s=0,a=0,l=0){this.x=i,this.y=e,this.width=n,this.height=o,this.radius1=r,this.radius2=s,this.radius3=a,this.radius4=l,this.gravityCenter=A.initialize(),this.gravityCenter=this.calculateGravityCenter(this)}calculateGravityCenter(i){return new X(i.x+i.width/2,i.y+i.height/2)}static fromRect(i){return new t(i.x,i.y,i.width,i.height)}static fromRoundedRect(i){return new t(i.x,i.y,i.width,i.height,i.radius1,i.radius2,i.radius3,i.radius4)}static fromCenter(i,e,n){return new t(i.gravityCenter.x-e/2,i.gravityCenter.y-n/2,e,n,i.radius1,i.radius2,i.radius3,i.radius4)}static fromPoint(i){return new t(i.x,i.y)}addPoint(i){let e=t.fromRoundedRect(this);return e.x+=i.x,e.y+=i.y,e.gravityCenter=this.calculateGravityCenter(e),e}},ht=class t{static initialize(i=0,e=0){return{width:i,height:e}}static isEqual(i,e){return i.width===e.width&&i.height===e.height}static offsetFromElement(i){if(i instanceof SVGGraphicsElement){let e=i.getBBox();return t.initialize(e.width,e.height)}else if(i instanceof HTMLElement)return t.initialize(i.offsetWidth,i.offsetHeight)}};function P_(){return{position:A.initialize(),scaledPosition:A.initialize(),scale:1,rotate:0}}function M_(t){let i;if(t){t=t.replace("matrix(",""),t=t.replace(")","");let e=t.split(" ");i={position:{x:Number(e[4]),y:Number(e[5])},scaledPosition:A.initialize(),scale:Number(e[0]),rotate:0}}return i}var kt=class{static toString(i){let e=A.sum(i.position,i.scaledPosition);return`matrix(${i.scale}, 0, 0, ${i.scale}, ${e.x}, ${e.y})`}static fromString(i){return M_(i)}static default(){return P_()}},Je=class t{static initialize(i=0,e=0){return A.initialize(i,e)}static fromPoints(i,e){return t.initialize(e.x-i.x,e.y-i.y)}static vectorLength(i){return Math.sqrt(t.magnitudeSquared(i))}static magnitudeSquared(i){return i.x*i.x+i.y*i.y}static dotProduct(i,e){return i.x*e.x+i.y*e.y}static crossProduct(i,e){return i.x*e.y-i.y*e.x}static subtract(i,e){return t.initialize(i.x-e.x,i.y-e.y)}static add(i,e){return t.initialize(i.x+e.x,i.y+e.y)}static scale(i,e){return t.initialize(i.x*e,i.y*e)}static angle(i,e){let n=Math.acos(Math.max(-1,Math.min(t.dotProduct(i,e)/(t.vectorLength(i)*t.vectorLength(e)),1)));return t.crossProduct(i,e)<0?-n:n}},bu=class{static parseRoundedRect(i){let e=Math.PI*.5,n=i.x,o=i.y,r=i.x+i.width,s=i.y+i.height,a=i.x+i.radius1,l=i.y+i.radius1,h=i.x+i.width-i.radius2,_=i.y+i.radius2,v=i.x+i.width-i.radius3,b=i.y+i.height-i.radius3,I=i.x+i.radius4,N=i.y+i.height-i.radius4;return[new Qt({x:a,y:l},i.radius1,i.radius1,2*e,3*e),new Jt({x:a,y:o},{x:h,y:o}),new Qt({x:h,y:_},i.radius2,i.radius2,3*e,4*e),new Jt({x:r,y:_},{x:r,y:b}),new Qt({x:v,y:b},i.radius3,i.radius3,0,e),new Jt({x:v,y:s},{x:I,y:s}),new Qt({x:I,y:N},i.radius4,i.radius4,e,2*e),new Jt({x:n,y:N},{x:n,y:l})]}},Sn=class{static getRoundedRectIntersections(i,e,n){let o=bu.parseRoundedRect(n);for(let r of o)if(r instanceof Qt){let s=this.intersectArcWithLine(r,i,e);if(s.length>0)return s}else if(r instanceof Jt){let s=this.intersectLineSegments(i,e,r.point1,r.point2);if(s)return[s]}return[]}static getRoundedRectIntersectionsWithSVGPath(i,e){let n=i.getTotalLength(),o=[];for(let r=0;r<=n;r+=1){let s=i.getPointAtLength(r);o.push({x:s.x,y:s.y})}for(let r=1;r<o.length;r++){let s=this.getRoundedRectIntersections(o[r-1],o[r],e);if(s.length>0)return s}return[]}static intersectArcWithLine(i,e,n){return this.filterPointsWithinArc(this.findEllipseLineIntersections(i.center,i.radiusX,i.radiusY,e,n),i)}static intersectLineSegments(i,e,n,o){let r=e.x-i.x,s=e.y-i.y,a=o.x-n.x,l=o.y-n.y,h=(-s*(i.x-n.x)+r*(i.y-n.y))/(-a*s+r*l),_=(a*(i.y-n.y)-l*(i.x-n.x))/(-a*s+r*l);return h>=0&&h<=1&&_>=0&&_<=1?{x:i.x+_*r,y:i.y+_*s}:null}static filterPointsWithinArc(i,e){let{center:n,startAngle:o,endAngle:r}=e;if(i.length===0)return i;r<o&&([o,r]=[r,o]),(o<0||r<0)&&(o+=2*Math.PI,r+=2*Math.PI);let s=[];for(let a of i){let l=this.normalizeAngle(Je.angle(Je.initialize(1,0),Je.initialize(a.x-n.x,a.y-n.y)));l<o&&(l+=2*Math.PI),o<=l&&l<=r&&s.push(a)}return s}static normalizeAngle(i){let e=i%(2*Math.PI);return e<0?e+2*Math.PI:e}static findEllipseLineIntersections(i,e,n,o,r){let s=Je.initialize(o.x,o.y),a=Je.fromPoints(o,r),l=Je.initialize(i.x,i.y),h=Je.subtract(s,l),_=Je.initialize(a.x/(e*e),a.y/(n*n)),v=Je.initialize(h.x/(e*e),h.y/(n*n)),b=Je.dotProduct(a,_),I=Je.dotProduct(a,v),N=Je.dotProduct(h,v)-1,D=I*I-b*N;return D<0?[]:this.calculateIntersectionPoints(D,b,I,o,r)}static calculateIntersectionPoints(i,e,n,o,r){let s=[];if(i>0){let a=Math.sqrt(i),l=(-n-a)/e,h=(-n+a)/e;l>=0&&l<=1&&s.push(A.interpolatePoints(o,r,l)),h>=0&&h<=1&&s.push(A.interpolatePoints(o,r,h))}else{let a=-n/e;a>=0&&a<=1&&s.push(A.interpolatePoints(o,r,a))}return s}};var Su=class{handle(i,e){let n=!0;if(this.validator&&(n=e.get(this.validator).handle(i)),!!n)return e.get(this.execution).handle(i)}execute(i,e){return e.get(this.execution).handle(i)}setValidator(i){this.validator=i}setExecution(i){this.execution=i}},R=class t{constructor(){this._injector=d(Ye)}static registerPipeline(i,e,n){if(!i||!i.fToken)throw new Error("Type must have a fToken static property.");let o=this.pipelines.get(i.fToken)||new Su;n?o.setValidator(e):o.setExecution(e),this.pipelines.set(i.fToken,o)}send(i){let e=t.pipelines.get(i.constructor.fToken);if(e)return e.handle(i,this._injector);throw new Error("Handler not registered for request type.")}execute(i){return t.pipelines.get(i.constructor.fToken).execute(i,this._injector)}};R.pipelines=new Map;R.\u0275fac=function(i){return new(i||R)};R.\u0275prov=g({token:R,factory:R.\u0275fac});function x(t){return function(i){R.registerPipeline(t,i,!1)}}var D_=(()=>{class t{setItem(e,n){localStorage.setItem(e,n)}getItem(e){return localStorage.getItem(e)}removeItem(e){localStorage.removeItem(e)}clear(){localStorage.clear()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),k_=(()=>{class t{storage={};setItem(e,n){this.storage[e]=n}getItem(e){return this.storage[e]||null}removeItem(e){delete this.storage[e]}clear(){this.storage={}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),R_=new fe("F_LOCAL_STORAGE",{providedIn:"root",factory:()=>fo(d(oo))?d(D_):d(k_)}),N_=(()=>{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,n,o){window.open(e,n,o)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),O_=(()=>{class t{getComputedStyle(e){return new Proxy({getPropertyValue:n=>"0"},{get:(n,o)=>o==="getPropertyValue"?n.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,n,o){}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),F_=new fe("F_WINDOW",{providedIn:"root",factory:()=>fo(d(oo))?d(N_):d(O_)}),Rt=(function(t){return t.MAC_OS="macos",t.IOS="ios",t.WINDOWS="windows",t.ANDROID="android",t.LINUX="linux",t})(Rt||{}),Iu;try{Iu=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Iu=!1}var Tu=(()=>{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||Iu)&&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?fo(this._platformId):typeof document=="object"&&!!document}getOS(){let e=navigator.userAgent.toLowerCase(),n=/(macintosh|macintel|macppc|mac68k|macos)/i,o=/(win32|win64|windows|wince)/i,r;return n.test(e)?r=Rt.MAC_OS:this.IOS?r=Rt.IOS:o.test(e)?r=Rt.WINDOWS:this.ANDROID?r=Rt.ANDROID:!r&&/linux/.test(e)&&(r=Rt.LINUX),r}static \u0275fac=function(n){return new(n||t)(pn(oo))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ke=(()=>{class t{injectedDocument;windowService;localStorageService;platformService;constructor(e,n,o,r){this.injectedDocument=e,this.windowService=n,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,n,o,r){if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("%")){let s=parseFloat(e)/100;return Math.max(n,o)*s}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 s=this.window.innerHeight/100;return parseFloat(e)*s}else if(e.endsWith("vw")){let s=this.window.innerWidth/100;return parseFloat(e)*s}}return parseFloat(e)||0}static \u0275fac=function(n){return new(n||t)(pn(io),pn(F_),pn(R_),pn(Tu))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Eu(t,i){return t.reduce((e,n)=>[...e,...i(n)],[])}function Pu(t){let i=t.cloneNode(!0),e=i.querySelectorAll("[id]"),n=t.nodeName.toLowerCase();i.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return n==="canvas"?Kh(t,i):(n==="input"||n==="select"||n==="textarea")&&Xh(t,i),qh("canvas",t,i,Kh),qh("input, textarea, select",t,i,Xh),i}function qh(t,i,e,n){let o=i.querySelectorAll(t);if(o.length){let r=e.querySelectorAll(t);for(let s=0;s<o.length;s++)n(o[s],r[s])}}var A_=0;function Xh(t,i){i.type!=="file"&&(i.value=t.value),i.type==="radio"&&i.name&&(i.name=`mat-clone-${i.name}-${A_++}`)}function Kh(t,i){let e=i.getContext("2d");if(e)try{e.drawImage(t,0,0)}catch{}}function Mu(t,i,e){for(let n in i)if(i.hasOwnProperty(n)){let o=i[n];o?t.setProperty(n,o,e?.has(n)?"important":""):t.removeProperty(n)}return t}function Yh(t){Mu(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 Zh(t,i,e){return L_(t,e).dataset[i]}function L_(t,i){return t.closest(i)}function Du(t,i){let e=t.rootNodes;if(e.length===1&&e[0].nodeType===i.ELEMENT_NODE)return e[0];let n=i.createElement("div");return e.forEach(o=>n.appendChild(o)),n}function ii(t,i){let e=B_(t,i);return!!e&&!e.classList.contains(i+"-disabled")}function B_(t,i){return t.closest(i)}function It(t){return t.match(/^[a-zA-Z_]/)||(t="_"+t),t.replace(/[^a-zA-Z0-9_\-:.]/g,"_")}function In(t,i,e){let n=e[t.toUpperCase()]||z_(e,t.toLowerCase());if(n===void 0)throw new Error(`Unknown ${i}: ${t}. Accepted values: ${Object.keys(e).join(", ")}`);return n}function z_(t,i){return Object.keys(t).find(e=>t[e]===i)}var V_=["markerElement"],G_=["fConnectionGradientRenderer",""],H_=["f-connection-path",""],j_=["fConnectionSelection",""],U_=["f-connection-drag-handle-start",""],$_=["f-connection-drag-handle-end",""],W_=["defs"],q_=["*"],X_=["fGroupsContainer"],K_=["fNodesContainer"],Y_=["fConnectionsContainer"],Z_=[[["","fGroup",""],["","fGroups",""]],[["f-snap-connection"]],[["f-connection"],["","fConnections",""]],[["f-connection-for-create"]],[["","fNode",""],["","fNodes",""]]],Q_=["[fGroup], [fGroups]","f-snap-connection","f-connection, [fConnections]","f-connection-for-create","[fNode], [fNodes]"],J_=[[["svg","fMarker",""]],[["f-connection-marker-circle"],["f-connection-marker-arrow"]],[["f-connection-gradient"]],[["f-connection-waypoints"]],[["","fConnectionContent",""]]],eg=["svg[fMarker]","f-connection-marker-circle, f-connection-marker-arrow","f-connection-gradient","f-connection-waypoints","[fConnectionContent]"];function tg(t,i){t&1&&(Ae(),B(0,"linearGradient",3)),t&2&&P("fConnectionGradientRendererFor",i)}function ng(t,i){t&1&&(Ae(),B(0,"circle",6))}function ig(t,i){t&1&&Me(0,4)}var og="[_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}",rg=[[["","fDefinitions",""]],[["f-background"]],[["f-line-alignment"]],[["f-canvas"]],[["f-selection-area"]],"*"],sg=["[fDefinitions]","f-background","f-line-alignment","f-canvas","f-selection-area","*"],Fu=new fe("F_BACKGROUND_PATTERN"),Qa=class{fPattern;static fToken=Symbol("AddPatternToBackgroundRequest");constructor(i){this.fPattern=i}},Mn=class{_items=[];_byId=new Map;get(i){return this._byId.get(i)}require(i){let e=this._byId.get(i);if(!e)throw new Error(`${this.kind} not found: ${i}`);return e}has(i){return this._byId.has(i)}getAll(){return this._items}size(){return this._items.length}add(i){let e=i.fId();if(this._byId.has(e))throw new Error(`${this.kind} already exists: ${e}`);this._items.push(i),this._byId.set(e,i)}addMany(i){for(let e of i)this.add(e)}remove(i){let e=i.fId(),n=this._byId.get(e);if(!n)return!1;this._byId.delete(e);let o=this._items.indexOf(n);return o>=0&&this._items.splice(o,1),!0}removeById(i){let e=this._byId.get(i);if(!e)return;this._byId.delete(i);let n=this._items.indexOf(e);return n>=0&&this._items.splice(n,1),e}clear(){this._items.length=0,this._byId.clear()}};function en(t){return{name:t}}var Au=class{_instances=new Map;get(i){return this._instances.get(i.name)}require(i){let e=this.get(i);if(!e)throw new Error(`Instance not found: ${i.name}`);return e}has(i){return this._instances.has(i.name)}add(i,e){if(this._instances.has(i.name))throw new Error(`${i.name} already exists`);this._instances.set(i.name,e)}remove(i){if(!this._instances.has(i.name))throw new Error(`${i.name} does not exist`);return this._instances.delete(i.name),!0}clear(){this._instances.clear()}},si=class extends Mn{kind;constructor(i){super(),this.kind=i}},Lu=class extends Mn{kind="Connection Marker"},Bu=class extends Mn{kind="Connection";_instancesForCreate;_instancesForSnap;getForSnap(){return this._instancesForSnap}getForCreate(){return this._instancesForCreate}addForCreate(i){this._instancesForCreate=i}addForSnap(i){this._instancesForSnap=i}removeInstanceForCreate(){this._instancesForCreate=void 0}removeInstanceForSnap(){this._instancesForSnap=void 0}},zu=class extends Mn{kind="Node"},Tn=class{notifyOnSubscribe;static fToken=Symbol("ListenConnectionsChangesRequest");constructor(i=!0){this.notifyOnSubscribe=i}};function ag(){return t=>{let i=null,e=null,n=()=>{i!==null&&cancelAnimationFrame(i),e!==null&&cancelAnimationFrame(e),i=e=null};return{callback:()=>{n(),i=requestAnimationFrame(()=>{i=null,e=requestAnimationFrame(()=>{e=null,t()})})},cleanup:n}}}function cg(){return t=>{let i=null;return{callback:()=>{i!==null&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=null,t()})},cleanup:()=>{i!==null&&cancelAnimationFrame(i),i=null}}}}function Ja(t){return i=>{let e=null;return{callback:()=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,i()},t)},cleanup:()=>{e!==null&&clearTimeout(e),e=null}}}}var ct=class{_listeners=new Set;notify(){this._listeners.forEach(i=>i())}listen(i){return this._listeners.add(i),()=>this.stop(i)}stop(i){this._listeners.delete(i)}},Vu=class extends ct{_htmlElement;_observer=new ResizeObserver(()=>this.notify());_isObserving=!1;constructor(i){super(),this._htmlElement=i}listen(i){return this._isObserving||(this._observer.observe(this._htmlElement),this._isObserving=!0),super.listen(i)}stop(i){super.stop(i),this._listeners.size===0&&this._disconnect()}_disconnect(){this._observer.unobserve(this._htmlElement),this._observer.disconnect(),this._isObserving=!1}},vt=class t{_channels=[];_operators=[];constructor(...i){this._channels=[...i]}pipe(...i){let e=new t(...this._channels);return e._operators=[...this._operators,...i],e}listen(i,e){let n=e,o=[],r=[],s=[];for(let v of[...this._operators].reverse()){let b=v(n);n=b.callback,b.cleanup&&o.push(b.cleanup),b.onSubscribe&&r.push(b.onSubscribe),b.setTeardown&&s.push(b.setTeardown)}let a=this._channels.map(v=>v.listen(()=>n())),l=null,h=!1,_=()=>{h||(h=!0,l?.(),l=null,a.forEach(v=>v()),o.forEach(v=>v()))};s.slice().reverse().forEach(v=>v(_)),r.slice().reverse().forEach(v=>v(n)),l=i.onDestroy(_)}};function Sl(){return t=>{let i=!0;return{callback:t,onSubscribe:e=>{queueMicrotask(()=>{i&&e()})},cleanup:()=>{i=!1}}}}function Qh(){return t=>{let i=!1,e=null;return{setTeardown:n=>e=n,callback:()=>{if(!i){i=!0;try{t()}finally{e?.()}}}}}}var dg=(()=>{let t=class Mo{_store=d(T);handle({notifyOnSubscribe:e}){return e?new vt(this._store.connectionsChanges$).pipe(Sl(),Ja(1)):new vt(this._store.connectionsChanges$).pipe(Ja(1))}static \u0275fac=function(n){return new(n||Mo)};static \u0275prov=g({token:Mo,factory:Mo.\u0275fac})};return t=C([x(Tn)],t),t})(),Gu=class{static fToken=Symbol("ListenNodesChangesRequest")},lg=(()=>{let t=class Do{_store=d(T);handle(e){return new vt(this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||Do)};static \u0275prov=g({token:Do,factory:Do.\u0275fac})};return t=C([x(Gu)],t),t})(),ec=class{static fToken=Symbol("ListenTransformChangesRequest")},ug=(()=>{let t=class ko{_store=d(T);handle(e){return new vt(this._store.transformChanges$,this._store.connectionsChanges$,this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||ko)};static \u0275prov=g({token:ko,factory:ko.\u0275fac})};return t=C([x(ec)],t),t})(),tn=class{static fToken=Symbol("EmitConnectionsChangesRequest")},fg=(()=>{let t=class Ro{_store=d(T);handle(e){this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Ro)};static \u0275prov=g({token:Ro,factory:Ro.\u0275fac})};return t=C([x(tn)],t),t})(),At=class{static fToken=Symbol("NotifyTransformChangedRequest")},T=(()=>{class t{transformChanges$=new ct;viewportAnimationChanges$=new ct;connectionsChanges$=new ct;_connectionsRevision=0;connectionsRenderedChanges$=new ct;_connectionsRenderedRevision=0;_connectionsRenderedNodesRevision=0;_viewportAnimationCount=0;nodesChanges$=new ct;_nodesRevision=0;progressiveRenderChanges$=new ct;_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 zu;connections=new Bu;connectionMarkers=new Lu;outputs=new si("Output");inputs=new si("Input");outlets=new si("Outlet");instances=new Au;fDraggable;emitNodeChanges(){this._nodesRevision++,this.nodesChanges$.notify()}emitConnectionChanges(){this._connectionsRevision++,this.connectionsChanges$.notify()}completeConnectionsRender(e,n){e<this._connectionsRenderedRevision||e===this._connectionsRenderedRevision&&n<=this._connectionsRenderedNodesRevision||(this._connectionsRenderedRevision=Math.min(e,this._connectionsRevision),this._connectionsRenderedNodesRevision=n,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(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),ye={MAGNETIC_LINES:en("magnetic-lines"),MAGNETIC_RECTS:en("magnetic-rects"),ZOOM:en("zoom-controls"),BACKGROUND:en("background"),SELECTION_AREA:en("selection-area"),MINIMAP:en("minimap"),AUTO_PAN:en("auto-pan")},hg=(()=>{let t=class No{_store=d(T);handle(e){this._store.transformChanged()}static \u0275fac=function(n){return new(n||No)};static \u0275prov=g({token:No,factory:No.\u0275fac})};return t=C([x(At)],t),t})(),Lt=class{key;instance;static fToken=Symbol("RegisterPluginInstanceRequest");constructor(i,e){this.key=i,this.instance=e}},pg=(()=>{let t=class Oo{_store=d(T);handle({key:e,instance:n}){this._store.instances.add(e,n)}static \u0275fac=function(n){return new(n||Oo)};static \u0275prov=g({token:Oo,factory:Oo.\u0275fac})};return t=C([x(Lt)],t),t})(),Bt=class{key;static fToken=Symbol("RemovePluginInstanceRequest");constructor(i){this.key=i}},mg=(()=>{let t=class Fo{_store=d(T);handle({key:e}){this._store.instances.remove(e)}static \u0275fac=function(n){return new(n||Fo)};static \u0275prov=g({token:Fo,factory:Fo.\u0275fac})};return t=C([x(Bt)],t),t})(),_g=[T,lg,dg,ug,fg,hg,pg,mg],gg=0,yg=(()=>{let t=class Ao{_store=d(T);_browser=d(ke);get _backgroundElement(){return this._store.instances.get(ye.BACKGROUND)?.hostElement}handle(e){let n=this._getPatterns(e.fPattern?.hostElement);if(!n?.length)return;let o=Pn("defs",this._browser);if(e.fPattern?.hostElement.remove(),n.forEach(r=>{o.append(r)}),n.length){this._backgroundElement?.firstChild?.appendChild(o),n[n.length-1].id="f-background-pattern-"+gg++;let r=n[n.length-1].id,s=Pn("rect",this._browser);s.setAttribute("fill","url(#"+r+")"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),this._backgroundElement?.firstChild?.appendChild(s);let a=this._store.fCanvas?.transform||kt.default();e.fPattern?.setTransform(a)}}_getPatterns(e){return Array.from(e?.getElementsByTagName("pattern")||[])}static \u0275fac=function(n){return new(n||Ao)};static \u0275prov=g({token:Ao,factory:Ao.\u0275fac})};return t=C([x(Qa)],t),t})(),ai=class{fTransform;static fToken=Symbol("SetBackgroundTransformRequest");constructor(i){this.fTransform=i}},vg=(()=>{let t=class Lo{_store=d(T);handle(e){this._store.instances.get(ye.BACKGROUND)?.setTransform(e.fTransform)}static \u0275fac=function(n){return new(n||Lo)};static \u0275prov=g({token:Lo,factory:Lo.\u0275fac})};return t=C([x(ai)],t),t})(),Cg=[yg,vg],tc=class{instance;static fToken=Symbol("AddCanvasToStoreRequest");constructor(i){this.instance=i}},xg=(()=>{let t=class Bo{_store=d(T);handle({instance:e}){this._store.fCanvas=e}static \u0275fac=function(n){return new(n||Bo)};static \u0275prov=g({token:Bo,factory:Bo.\u0275fac})};return t=C([x(tc)],t),t})(),nc=class{id;animated;static fToken=Symbol("CenterGroupOrNodeRequest");constructor(i,e){this.id=i,this.animated=e}},bg=(()=>{let t=class zo{_store=d(T);_mediator=d(R);get _transform(){return this._store.transform}handle({id:e,animated:n}){let o=this._store.nodes.get(e);o&&(this._toCenter(this._getNodeRect(o),this._getFlowRect(),o._position),this._mediator.execute(new Dn(n,nn.VIEWPORT_ONLY)))}_toCenter(e,n,o){this._transform.scaledPosition=A.initialize(),this._transform.position=A.initialize((n.width-e.width)/2-o.x*this._transform.scale,(n.height-e.height)/2-o.y*this._transform.scale)}_getNodeRect(e){return G.fromElement(e.hostElement)}_getFlowRect(){return G.fromElement(this._store.flowHost)}static \u0275fac=function(n){return new(n||zo)};static \u0275prov=g({token:zo,factory:zo.\u0275fac})};return t=C([x(nc)],t),t})(),ic=class{toCenter;animated;static fToken=Symbol("FitToFlowRequest");constructor(i,e){this.toCenter=i,this.animated=e}},wg=(()=>{let t=class Vo{_store=d(T);get _transform(){return this._store.transform}_mediator=d(R);handle({toCenter:e,animated:n}){let o=this._mediator.execute(new Ln)||G.initialize();o.width===0||o.height===0||(this.fitToParent(o,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(r=>r._position),e),this._mediator.execute(new Dn(n,nn.VIEWPORT_ONLY)))}fitToParent(e,n,o,r){this._transform.scaledPosition=A.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let s=e.width/this._transform.scale+r.x,a=e.height/this._transform.scale+r.y;(s>n.width||a>n.height||s<n.width&&a<n.height)&&(this._transform.scale=Math.min(n.width/s,n.height/a));let l=(n.width-s*this._transform.scale)/2-this._transform.position.x*this._transform.scale,h=(n.height-a*this._transform.scale)/2-this._transform.position.y*this._transform.scale;this._transform.position=A.initialize(l+r.x/2*this._transform.scale,h+r.y/2*this._transform.scale)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return A.initialize(n,o)}static \u0275fac=function(n){return new(n||Vo)};static \u0275prov=g({token:Vo,factory:Vo.\u0275fac})};return t=C([x(ic)],t),t})(),oc=class{transform;position;static fToken=Symbol("InputCanvasPositionRequest");constructor(i,e){this.transform=i,this.position=e}},Sg=(()=>{let t=class Go{_store=d(T);handle({transform:e,position:n}){n&&(A.isEqual(this._calculateTransformPosition(e),n)||(e.position=n,e.scaledPosition=A.initialize(),this._store.fCanvas?.redraw()))}_calculateTransformPosition(e){return A.sum(e.position,e.scaledPosition)}static \u0275fac=function(n){return new(n||Go)};static \u0275prov=g({token:Go,factory:Go.\u0275fac})};return t=C([x(oc)],t),t})(),rc=class{transform;scale;static fToken=Symbol("InputCanvasScaleRequest");constructor(i,e){this.transform=i,this.scale=e}},Ig=(()=>{let t=class Ho{_store=d(T);handle(e){!e.scale&&e.scale!==0||(e.transform.scale=e.scale,this._store.fCanvas?.redraw())}static \u0275fac=function(n){return new(n||Ho)};static \u0275prov=g({token:Ho,factory:Ho.\u0275fac})};return t=C([x(rc)],t),t})(),nn=(function(t){return t.VIEWPORT_ONLY="VIEWPORT_ONLY",t.WITH_CONNECTION_CHANGES="WITH_CONNECTION_CHANGES",t})(nn||{}),Dn=class{animated;context;static fToken=Symbol("RedrawCanvasWithAnimationRequest");constructor(i,e=nn.WITH_CONNECTION_CHANGES){this.animated=i,this.context=e}};function Ip(t,i){let e=n=>{n.propertyName==="transform"&&(t.removeEventListener("transitionend",e),i(n))};t.addEventListener("transitionend",e)}var Tg=(()=>{let t=class jo{_store=d(T);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(),Ip(this._canvas.hostElement,()=>{this._store.endViewportAnimation(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()})}_redraw(e){this._canvas?.redraw(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||jo)};static \u0275prov=g({token:jo,factory:jo.\u0275fac})};return t=C([x(Dn)],t),t})(),sc=class{static fToken=Symbol("RemoveCanvasFromStoreRequest")},Eg=(()=>{let t=class Uo{_store=d(T);handle(e){this._store.fCanvas=void 0}static \u0275fac=function(n){return new(n||Uo)};static \u0275prov=g({token:Uo,factory:Uo.\u0275fac})};return t=C([x(sc)],t),t})(),ac=class{static fToken=Symbol("ResetScaleRequest")},Pg=(()=>{let t=class $o{_store=d(T);get _transform(){return this._store.transform}handle(e){this._transform.scale=1,this._transform.scaledPosition=A.initialize()}static \u0275fac=function(n){return new(n||$o)};static \u0275prov=g({token:$o,factory:$o.\u0275fac})};return t=C([x(ac)],t),t})(),cc=class{animated;static fToken=Symbol("ResetScaleAndCenterRequest");constructor(i){this.animated=i}},Mg=(()=>{let t=class Wo{_mediator=d(R);_store=d(T);get _transform(){return this._store.transform}handle({animated:e}){let n=this._mediator.execute(new Ln)||G.initialize();n.width===0||n.height===0||(this._oneToOneCentering(n,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(o=>o._position)),this._mediator.execute(new Dn(e,nn.VIEWPORT_ONLY)))}_oneToOneCentering(e,n,o){this._transform.scaledPosition=A.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let r=(n.width-e.width/this._transform.scale)/2-this._transform.position.x,s=(n.height-e.height/this._transform.scale)/2-this._transform.position.y;this._transform.scale=1,this._transform.position=A.initialize(r,s)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return A.initialize(n,o)}static \u0275fac=function(n){return new(n||Wo)};static \u0275prov=g({token:Wo,factory:Wo.\u0275fac})};return t=C([x(cc)],t),t})(),dc=class{scale;toPosition;static fToken=Symbol("UpdateScaleRequest");constructor(i,e){this.scale=i,this.toPosition=e}},Dg=(()=>{let t=class qo{_store=d(T);get _transform(){return this._store.transform}handle({scale:e,toPosition:n}){if(e===this._transform.scale)return;let o=A.sum(this._transform.scaledPosition,this._transform.position),r=n.x-(n.x-o.x)*e/this._transform.scale,s=n.y-(n.y-o.y)*e/this._transform.scale;this._transform.scale=e,this._transform.scaledPosition=A.sub(A.initialize(r,s),this._transform.position)}static \u0275fac=function(n){return new(n||qo)};static \u0275prov=g({token:qo,factory:qo.\u0275fac})};return t=C([x(dc)],t),t})(),kg=[xg,bg,wg,Sg,Ig,Tg,Eg,Pg,Mg,Dg],Hu=class{connection;static fToken=Symbol("AddConnectionForCreateToStoreRequest");constructor(i){this.connection=i}},Rg=(()=>{let t=class Xo{_store=d(T);handle({connection:e}){this._store.connections.addForCreate(e)}static \u0275fac=function(n){return new(n||Xo)};static \u0275prov=g({token:Xo,factory:Xo.\u0275fac})};return t=C([x(Hu)],t),t})(),ju=class{instance;static fToken=Symbol("AddConnectionMarkerToStoreRequest");constructor(i){this.instance=i}},Ng=(()=>{let t=class Ko{_store=d(T);handle({instance:e}){this._store.connectionMarkers.add(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Ko)};static \u0275prov=g({token:Ko,factory:Ko.\u0275fac})};return t=C([x(ju)],t),t})(),lc=class{connection;static fToken=Symbol("AddConnectionToStoreRequest");constructor(i){this.connection=i}},Og=(()=>{let t=class Yo{_store=d(T);handle({connection:e}){this._store.connections.add(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Yo)};static \u0275prov=g({token:Yo,factory:Yo.\u0275fac})};return t=C([x(lc)],t),t})(),Uu=class{connection;static fToken=Symbol("AddSnapConnectionToStoreRequest");constructor(i){this.connection=i}},Fg=(()=>{let t=class Zo{_store=d(T);handle({connection:e}){this._store.connections.addForSnap(e)}static \u0275fac=function(n){return new(n||Zo)};static \u0275prov=g({token:Zo,factory:Zo.\u0275fac})};return t=C([x(Uu)],t),t})(),kn=class{connection;static fToken=Symbol("CreateConnectionMarkersRequest");constructor(i){this.connection=i}},Jh=new fe("F_CONNECTION_CONTENT");var uc=class t{points;cumulativeLengths;segmentTangents;totalLength;constructor(i){let e=t._removeConsecutiveDuplicates(i);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 n=this.points.length,o=n-1,r=new Array(n).fill(0),s=new Array(o),a=0;for(let l=0;l<o;l++){let h=this.points[l+1].x-this.points[l].x,_=this.points[l+1].y-this.points[l].y,v=Math.hypot(h,_),b=v?h/v:1,I=v?_/v:0;s[l]={x:b,y:I},a+=v,r[l+1]=a}this.cumulativeLengths=r,this.segmentTangents=s,this.totalLength=a||1}static from(i){return new t(i.map(e=>({x:e.x,y:e.y})))}static _removeConsecutiveDuplicates(i){let e=[];for(let n of i){let o=e[e.length-1];(!o||o.x!==n.x||o.y!==n.y)&&e.push({x:n.x,y:n.y})}return e}},$u=class t{_polyline;constructor(i=[]){this._polyline=new uc(i)}updatePoints(i){return this._polyline=new uc(i),this._polyline.totalLength}calculateTotalLength(i){return this.updatePoints(i)}get totalLength(){return this._polyline.totalLength}getPointAtProgress(i){let{points:e,cumulativeLengths:n,segmentTangents:o,totalLength:r}=this._polyline,a=t._clamp(i,0,1)*r,l=.5;if(a<=l)return{point:e[0],tangent:o[0]??{x:1,y:0},atEdge:!0};if(r-a<=l){let O=e.length-1;return{point:e[O],tangent:o[O-1]??{x:1,y:0},atEdge:!0}}let h=t._findRightIndex(n,a),_=Math.max(1,h),v=n[_-1],b=n[_],I=t._safeRatio(a-v,b-v),N=e[_-1],D=e[_],M={x:t._lerp(N.x,D.x,I),y:t._lerp(N.y,D.y,I)},k=o[_-1]??{x:1,y:0};return{point:M,tangent:k,atEdge:!1}}getPointAtLength(i){return this.getPointAtProgress(i)}getPointAtDistance(i){let e=this._polyline.totalLength?i/this._polyline.totalLength:0;return this.getPointAtProgress(e)}static _findRightIndex(i,e){let n=0,o=i.length-1;for(;n<o;){let r=n+o>>1;i[r]<e?n=r+1:o=r}return n}static _lerp(i,e,n){return i+(e-i)*n}static _clamp(i,e,n){return i<e?e:i>n?n:i}static _safeRatio(i,e){let n=Math.abs(e)<1e-6?1e-6:e;return i/n}},Tp=(function(t){return t.NONE="none",t.ALONG="along",t})(Tp||{}),Wu=class{compute(i,e){let n=this._clamp01(e.position()),{point:o,tangent:r}=i.getPointAtLength(n),s={x:-r.y,y:r.x},a=e.offset()??0,l=o.x+s.x*a,h=o.y+s.y*a,v=this._sizeAlongDirection(e.hostElement,r)*.5,b=n*i.totalLength,I=i.totalLength-b,N=this._applyEdgeGuard(l,h,r,b,I,v),D=this._calculateContentRotation(e.align(),r);return{position:N,rotationDeg:D}}_clamp01(i){return i<=0?0:i>=1?1:i}_applyEdgeGuard(i,e,n,o,r,s){if(o<=s){let a=s-o;return{x:i+n.x*a,y:e+n.y*a}}if(r<=s){let a=s-r;return{x:i-n.x*a,y:e-n.y*a}}return{x:i,y:e}}_sizeAlongDirection(i,e){let n=G.fromElement(i);return Math.abs(e.x)*n.width+Math.abs(e.y)*n.height}_normalize180(i){let e=(i+180)%360;return e<0&&(e+=360),e-180}_keepUpright(i){let e=this._normalize180(i);return e>90?e-=180:e<-90&&(e+=180),e}_calculateContentRotation(i,e){let n=0;return i===Tp.ALONG&&(n=Math.atan2(e.y,e.x)*180/Math.PI,n=this._keepUpright(n)),n}},qu=class{_placement;constructor(i=new Wu){this._placement=i}layout(i,e){let n=new $u(i),o=n.totalLength;for(let r of e){let{position:s,rotationDeg:a}=this._placement.compute(n,r);r.hostElement.style.transform=this._createTransformString(s,a)}return o}_createTransformString(i,e){return`translate3d(${i.x}px, ${i.y}px, 0) translate(-50%, -50%) rotate(${e}deg)`}};var ep=new fe("F_CONNECTION_WAYPOINTS");function Ep(t,i,e){return(t.x-i.x)**2+(t.y-i.y)**2<=e**2}function Ag(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.candidates().find(o=>Ep(i,o,n))}function Lg(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.waypoints().find(o=>Ep(i,o,n))}function Bg(t,i){for(let e of t){let n=Lg(e,i);if(n&&e.fWaypoints()?.visibility())return{connection:e,waypoint:n};let o=Ag(e,i);if(o&&e.fWaypoints()?.visibility())return{connection:e,candidate:o}}}var Il=new fe("F_CONNECTION_COMPONENTS_PARENT");var ge=(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})(ge||{}),Xu=new fe("F_CONNECTION_MARKER"),zg=0,Ku=class{fId=q(`f-marker-${zg++}`);hostElement=d(Se).nativeElement};function Vg(t,i=ge.START){if(typeof t!="string")return i;let e=t.trim().toLowerCase();return e?Gg(e)??i:i}function Gg(t){switch(t){case"start":case"f-connection-marker-start":return ge.START;case"end":case"f-connection-marker-end":return ge.END;case"selected-start":case"f-connection-selected-marker-start":return ge.SELECTED_START;case"selected-end":case"f-connection-selected-marker-end":return ge.SELECTED_END;case"start-all-states":case"f-connection-marker-start-all-states":case"start-all":case"all-start":return ge.START_ALL_STATES;case"end-all-states":case"f-connection-marker-end-all-states":case"end-all":case"all-end":return ge.END_ALL_STATES;default:return null}}var Pp=(()=>{class t extends Ku{_markerElement=Ie.required("markerElement");_type=F(ge.END_ALL_STATES,{alias:"type",transform:e=>Vg(e,ge.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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-connection-marker-arrow"]],viewQuery:function(n,o){n&1&&ft(o._markerElement,V_,5),n&2&&it()},hostAttrs:[1,"f-component",2,"display","none"],inputs:{_type:[1,"type","_type"]},features:[Re([{provide:Xu,useExisting:t}]),_e],decls:3,vars:0,consts:[["markerElement",""],["viewBox","0 0 6 6",1,"f-marker"],["d","M0,0 L6,3 0,6Z"]],template:function(n,o){n&1&&(Ae(),H(0,"svg",1,0),Pt(2,"path",2),$())},encapsulation:2})}return t})();var Ot=(function(t){return t.FIXED="fixed",t.FIXED_CENTER="fixed_center",t.FLOATING="floating",t})(Ot||{}),qe=(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})(qe||{});function Hg({sourceRect:t,targetRect:i}){return{point1:t.gravityCenter,point2:i.gravityCenter}}var L=(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})(L||{}),Nt=(function(t){return t.SEGMENT="segment",t.STRAIGHT="straight",t.BEZIER="bezier",t.ADAPTIVE_CURVE="adaptive-curve",t})(Nt||{});function jg({sourceRect:t,sourceConnectableSide:i,targetRect:e,targetConnectableSide:n}){return{point1:tp(t,i===L.AUTO?L.BOTTOM:i),point2:tp(e,n===L.AUTO?L.TOP:n)}}function tp(t,i){switch(i){case L.TOP:return{x:t.x+t.width/2,y:t.y};case L.BOTTOM:return{x:t.x+t.width/2,y:t.y+t.height};case L.LEFT:return{x:t.x,y:t.y+t.height/2};case L.RIGHT:return{x:t.x+t.width,y:t.y+t.height/2};default:throw new Error(`Unknown side: ${i}`)}}function Mp(t,i,e,n){if(!n||!n.rotationDeg)return Sn.getRoundedRectIntersections(t,i,e)[0];let o=Qo(t,-n.rotationDeg,n.pivot),r=Qo(i,-n.rotationDeg,n.pivot),s=Ug(e,-n.rotationDeg,n.pivot),a=Sn.getRoundedRectIntersections(o,r,s)[0];return a?Qo(a,n.rotationDeg,n.pivot):void 0}function Ug(t,i,e){let n=Qo($g(t),i,e);return new De(n.x-t.width/2,n.y-t.height/2,t.width,t.height,t.radius1,t.radius2,t.radius3,t.radius4)}function $g(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Qo(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,s=Math.cos(r),a=Math.sin(r);return{x:n*s-o*a+e.x,y:n*a+o*s+e.y}}function Wg({sourceRect:t,targetRect:i,sourceRotationContext:e,targetRotationContext:n}){return Kg(qg(t,i,e),Xg(t,i,n),t,i)}function qg(t,i,e){return Mp(t.gravityCenter,i.gravityCenter,t,e)}function Xg(t,i,e){return Mp(i.gravityCenter,t.gravityCenter,i,e)}function Kg(t,i,e,n){return{point1:t||e.gravityCenter,point2:i||n.gravityCenter}}var Eo=.5,Yg={[Ot.FLOATING]:Wg,[Ot.FIXED_CENTER]:Hg,[Ot.FIXED]:jg},jn=(()=>{class t{handle(e){let n=this._calculateDirectionalVectors(e.sourceRect.gravityCenter.x,e.sourceRect.gravityCenter.y,e.targetRect.gravityCenter.x,e.targetRect.gravityCenter.y),o=this._determineSourceSide(e,n),r=this._determineTargetSide(e,n);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,n,o,r){let s=o-e,a=r-n;return{sourceToTargetX:s,sourceToTargetY:a,targetToSourceX:-s,targetToSourceY:-a}}_determineSourceSide(e,n){return this._resolveConnectableSide(e.connection.fOutputSide(),n.sourceToTargetX,n.sourceToTargetY,e.sourceConnectableSide)}_determineTargetSide(e,n){return this._resolveConnectableSide(e.connection.fInputSide(),n.targetToSourceX,n.targetToSourceY,e.targetConnectableSide)}_resolveConnectableSide(e,n,o,r){if(e===qe.DEFAULT)return r;let s=Math.abs(n),a=Math.abs(o);if(s<Eo&&a<Eo)return r;let h=s>=a;switch(e){case qe.CALCULATE:return h?n>=0?L.RIGHT:L.LEFT:o>=0?L.BOTTOM:L.TOP;case qe.CALCULATE_HORIZONTAL:return s<Eo?r:n>=0?L.RIGHT:L.LEFT;case qe.CALCULATE_VERTICAL:return a<Eo?r:o>=0?L.BOTTOM:L.TOP;case qe.TOP:return L.TOP;case qe.BOTTOM:return L.BOTTOM;case qe.LEFT:return L.LEFT;case qe.RIGHT:return L.RIGHT;default:return r}}_getBehaviorHandler(e){let n=Yg[e];if(!n)throw new Error(`[Behavior] No handler for behavior: ${e}`);return n}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),mt=class{sourceRect;targetRect;connection;sourceConnectableSide;targetConnectableSide;sourceRotationContext;targetRotationContext;constructor(i,e,n,o,r,s,a){this.sourceRect=i,this.targetRect=e,this.connection=n,this.sourceConnectableSide=o,this.targetConnectableSide=r,this.sourceRotationContext=s,this.targetRotationContext=a}};function Tl(t,i,e){return[t,...e??[],i]}function Zg(t,i){let e=Math.abs(i.x-t.x)/2,n=i.x<t.x?i.x+e:i.x-e,o=Math.abs(i.y-t.y)/2,r=i.y<t.y?i.y+o:i.y-o;return{x:n,y:r}}function Qg(t,i=32){let e=new Array(i+1);e[0]=ue({},t[0]);for(let n=1;n<=i;n++)e[n]=Dp(t[0],t[1],t[2],t[3],n/i);return e}function Dp(t,i,e,n,o){let r=1-o,s=o*o,a=r*r,l=a*r,h=s*o;return{x:l*t.x+3*a*o*i.x+3*r*s*e.x+h*n.x,y:l*t.y+3*a*o*i.y+3*r*s*e.y+h*n.y}}function kp(t){return t.map(i=>Dp(i.p0,i.c1,i.c2,i.p3,.5))}function Jg(t){if(t.length<2)throw new Error("Polylines must be at least two points");let i=e0(t);return i<=0?[ue({},t[0])]:[t0(t,i/2)]}function e0(t){let i=0;for(let e=0;e<t.length-1;e++)i+=Rp(t[e],t[e+1]);return i}function t0(t,i){let e=0;for(let o=0;o<t.length-1;o++){let r=t[o],s=t[o+1],a=Rp(r,s);if(!(a<=0)){if(e+a>=i){let l=(i-e)/a;return{x:r.x+(s.x-r.x)*l,y:r.y+(s.y-r.y)*l}}e+=a}}let n=t[t.length-1];return{x:n.x,y:n.y}}function Rp(t,i){return Math.hypot(i.x-t.x,i.y-t.y)}function n0(t){let i=[];for(let e of t)for(let n of e){let o=i[i.length-1];(!o||o.x!==n.x||o.y!==n.y)&&i.push(n)}return i}function Np(t){if(!t.length)return"";let i=`M ${t[0].p0.x} ${t[0].p0.y}`;for(let e=0;e<t.length;e++){let n=t[e],o=e===t.length-1,r=o?n.p3.x+2e-4:n.p3.x,s=o?n.p3.y+2e-4:n.p3.y;i+=` C ${n.c1.x} ${n.c1.y}, ${n.c2.x} ${n.c2.y}, ${r} ${s}`}return i}function Op(t,i=16){if(!t.length)return[];let e=[];for(let n=0;n<t.length;n++){let o=t[n],r=Qg([o.p0,o.c1,o.c2,o.p3],i);n>0&&r.shift(),e.push(...r)}return e}function i0(t,i=1e-6){let e=t.length;if(e<=2)return t;let n=[];n.push(t[0]);for(let r=1;r<e;r++){let s=t[r],a=n[n.length-1];(Math.abs(s.x-a.x)>i||Math.abs(s.y-a.y)>i)&&n.push(s)}if(n.length<=2)return n;let o=[];o.push(n[0]);for(let r=1;r<n.length-1;r++){let s=o[o.length-1],a=n[r],l=n[r+1],h=Math.abs(s.x-a.x)<=i&&Math.abs(a.x-l.x)<=i,_=Math.abs(s.y-a.y)<=i&&Math.abs(a.y-l.y)<=i;!h&&!_&&o.push(a)}return o.push(n[n.length-1]),o}var Yu=class t{static _dir(i){switch(i){case L.LEFT:return{x:-1,y:0};case L.RIGHT:return{x:1,y:0};case L.TOP:return{x:0,y:-1};case L.BOTTOM:return{x:0,y:1};case L.AUTO:return{x:0,y:0}}return{x:0,y:0}}static _isHorizontal(i){return i===L.LEFT||i===L.RIGHT}static _handleLength(i,e,n,o){let r=Math.abs(e.x-i.x),s=Math.abs(e.y-i.y),a=Math.hypot(r,s),l=n===L.AUTO?Math.max(r,s):this._isHorizontal(n)?r:s,h=Math.max(8,o),_=o+.5*a,v=o*1.05+l*.3;return Math.min(_,Math.max(h,v))}static _softControl(i,e,n,o){let r=this._dir(i),s=n.x-e.x,a=n.y-e.y,l=Math.hypot(s,a)||1,h=s/l,_=a/l;if(i===L.AUTO)return{x:e.x+h*o,y:e.y+_*o};let v=r.x*h+r.y*_,b=.12,I=Math.max(0,-v)*.08,N=Math.min(.2,b+I),D=r.x*(1-N)+h*N,M=r.y*(1-N)+_*N,k=Math.hypot(D,M)||1;return{x:e.x+D/k*o,y:e.y+M/k*o}}handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Math.max(0,r??0),l=Tl(i,n,s),h=[];for(let v=0;v<l.length-1;v++){let b=l[v],I=l[v+1],N=t._handleLength(b,I,e,a),D=t._handleLength(I,b,o,a),M=t._softControl(e,b,I,N),k=t._softControl(o,I,b,D);h.push({p0:b,c1:M,c2:k,p3:I,chainIndex:v})}let _=Op(h,12);return{path:Np(h),secondPoint:h[0]?.c1??i,penultimatePoint:h[h.length-1]?.c2??n,points:_,candidates:kp(h)}}},Zu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Tl(i,n,s),l=[];for(let _=0;_<a.length-1;_++){let v=a[_],b=a[_+1],I=np(e,v,b,r??0),N=np(o,b,v,r??0);l.push({p0:v,c1:I,c2:N,p3:b,chainIndex:_})}let h=Op(l,12);return{path:Np(l),secondPoint:l[0]?.c1??i,penultimatePoint:l[l.length-1]?.c2??n,points:h,candidates:kp(l)}}};function np(t,i,e,n){let o={x:i.x,y:i.y};switch(t){case L.LEFT:o.x-=Po(i.x-e.x,n);break;case L.RIGHT:o.x+=Po(e.x-i.x,n);break;case L.TOP:o.y-=Po(i.y-e.y,n);break;case L.BOTTOM:o.y+=Po(e.y-i.y,n);break;case L.AUTO:break}return o}function Po(t,i){return t>=i?t:i*Math.sqrt(i-t)}function o0(t){let{axis:i,source:e,target:n,sourceSide:o,targetSide:r,sourceGap:s,targetGap:a,sourceDir:l,targetDir:h,currentDir:_,offset:v,sourceGapOffset:b,targetGapOffset:I}=t,N=r0(s,a),D=s0(i,l,_,N);return o===r?a0(i,e,n,v,l,_,s,a,b,I):D=c0(i,l,h,s,a,N,D),D}function r0(t,i){return{sourceTarget:[{x:t.x,y:i.y}],targetSource:[{x:i.x,y:t.y}]}}function s0(t,i,e,n){return t==="x"?i.x===e?n.targetSource:n.sourceTarget:i.y===e?n.sourceTarget:n.targetSource}function a0(t,i,e,n,o,r,s,a,l,h){let _=Math.abs(i[t]-e[t]);if(_>n)return;let v=Math.min(n-1,n-_);v<=0||(o[t]===r?l[t]=(s[t]>i[t]?-1:1)*v:h[t]=(a[t]>e[t]?-1:1)*v)}function c0(t,i,e,n,o,r,s){let a=t==="x"?"y":"x",l=i[t]===e[a],h=n[a]>o[a],_=n[a]<o[a];return i[t]===1&&(!l&&h||l&&_)||i[t]!==1&&(!l&&_||l&&h)?t==="x"?r.sourceTarget:r.targetSource:s}var oi=1e-6,ip=2e-4,d0=.75;function l0(t,i){let e=t.length,n=[];n.push(`M ${t[0].x} ${t[0].y}`);for(let r=1;r<e-1;r++)n.push(u0(t[r-1],t[r],t[r+1],i));let o=t[e-1];return n.push(`L ${o.x+ip} ${o.y+ip}`),n.join(" ")}function u0(t,i,e,n){let o=i.x,r=i.y;if(n<=0)return`L ${o} ${r}`;let s=Math.abs(t.x-o)<=oi&&Math.abs(o-e.x)<=oi,a=Math.abs(t.y-r)<=oi&&Math.abs(r-e.y)<=oi;if(s||a)return`L ${o} ${r}`;let l=Math.hypot(o-t.x,r-t.y),h=Math.hypot(e.x-o,e.y-r),_=Math.min(l*.5,h*.5,n);if(_<d0)return`L ${o} ${r}`;if(Math.abs(t.y-r)<=oi){let M=t.x<e.x?-1:1,k=t.y<e.y?1:-1,O=o+_*M,z=r+_*k;return`L ${O} ${r} Q ${o} ${r} ${o} ${z}`}let b=t.x<e.x?1:-1,I=t.y<e.y?-1:1,N=r+_*I,D=o+_*b;return`L ${o} ${N} Q ${o} ${r} ${D} ${r}`}var op={[L.LEFT]:A.initialize(-1,0),[L.RIGHT]:A.initialize(1,0),[L.TOP]:A.initialize(0,-1),[L.BOTTOM]:A.initialize(0,1),[L.AUTO]:A.initialize(0,0)},Qu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,waypoints:r,offset:s,radius:a}){let l=Tl(i,n,r),h=[],_=[];for(let N=0;N<l.length-1;N++){let D=l[N],M=l[N+1],k=this._getPathPoints(D,e,M,o,s??0);h.push(k),_.push(...Jg(k))}let v=i0(n0(h)),b=v.length>1?v[v.length-2]:i,I=v.length>1?v[1]:n;return{path:l0(v,a??0),penultimatePoint:b,secondPoint:I,points:v,candidates:_}}_getPathPoints(i,e,n,o,r){let s=op[e],a=op[o],l={x:i.x+s.x*r,y:i.y+s.y*r},h={x:n.x+a.x*r,y:n.y+a.y*r},_=this._getDirection(l,e,h),v=_.x!==0?"x":"y",b=_[v],I=[],N=A.initialize(),D=A.initialize(),M=Zg(i,n);if(s[v]*a[v]===-1){let k=[{x:M.x,y:l.y},{x:M.x,y:h.y}],O=[{x:l.x,y:M.y},{x:h.x,y:M.y}];s[v]===b?I=v==="x"?k:O:I=v==="x"?O:k}else I=o0({axis:v,source:i,target:n,sourceSide:e,targetSide:o,sourceGap:l,targetGap:h,sourceDir:s,targetDir:a,currentDir:b,offset:r,sourceGapOffset:N,targetGapOffset:D});return[i,{x:l.x+N.x,y:l.y+N.y},...I,{x:h.x+D.x,y:h.y+D.y},n]}_getDirection(i,e,n){return e===L.LEFT||e===L.RIGHT?i.x<n.x?A.initialize(1,0):A.initialize(-1,0):i.y<n.y?A.initialize(0,1):A.initialize(0,-1)}},rp=2e-4,Ju=class{handle(i){let e=Tl(i.source,i.target,i.waypoints),n=e.length,o=e[0],r=`M ${o.x} ${o.y}`,s=new Array(n-1);for(let a=0;a<n-1;a++){let l=e[a],h=e[a+1],_=a===n-2,v=_?h.x+rp:h.x,b=_?h.y+rp:h.y;r+=` L ${v} ${b}`,s[a]={x:(l.x+h.x)*.5,y:(l.y+h.y)*.5}}return{path:r,candidates:s,points:e,secondPoint:e[1]??i.target,penultimatePoint:e[n-2]??i.source}}},f0=new fe("F_CONNECTION_BUILDERS"),Fp=(()=>{class t{_builtinBuilders={[Nt.STRAIGHT]:new Ju,[Nt.BEZIER]:new Zu,[Nt.ADAPTIVE_CURVE]:new Yu,[Nt.SEGMENT]:new Qu};_providedBuilders;_builders;constructor(){this._providedBuilders=d(f0,{optional:!0})||{},this._builders=ue(ue({},this._builtinBuilders),this._providedBuilders)}handle({type:e,payload:n}){let o=this._builders[e];if(!o)throw this._createBuilderNotFoundError(e);return o.handle(n)}_createBuilderNotFoundError(e){let n=Object.keys(this._builtinBuilders).sort(),o=Object.keys(this._providedBuilders).sort(),r=Object.keys(this._builders).sort(),s=n.filter(l=>l in this._providedBuilders).sort(),a=[`Connection Builder Error: builder type "${e}" not found.`,`Registered types: ${r.length?r.join(", "):"(none)"}`,`Built-in types: ${n.length?n.join(", "):"(none)"}`,`Provided (F_CONNECTION_BUILDERS) types: ${o.length?o.join(", "):"(none)"}`,s.length?`Overridden built-ins: ${s.join(", ")}`:null,"Tip: ensure you pass a valid Connection Type or provide a builder via F_CONNECTION_BUILDERS."].filter(Boolean);return new Error(a.join(`
|
|
2
|
-
`))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();function h0(t,i,e){return It("connection_"+t+i+e)}function p0(t,i,e){return It("connection_for_selection_"+t+i+e)}function Ap(t){return It("connection_gradient_"+t)}function m0(t){return`url(#${Ap(t)})`}var _0=(()=>{class t{_connection=d(Il);_hostElement=d(Se).nativeElement;_injector=d(Ye);_hostAttributes=new Map;_startColor;_endColor;gradientId=E(()=>Ap(this._connection.fId()));ngOnInit(){this._listenColorChanges()}_listenColorChanges(){me(()=>{this.gradient().fStartColor(),this.gradient().fEndColor(),gt(()=>{this._updateGradient()})},{injector:this._injector})}get stop1Element(){return this._hostElement.children.item(0)}get stop2Element(){return this._hostElement.children.item(1)}redraw(e){let n=e.point2.x-e.point1.x,o=e.point2.y-e.point1.y,r=Math.sqrt(n*n+o*o)||.01,s=new X(.5-.5*n/r,.5-.5*o/r);this._setHostAttribute("x1",s.x.toString()),this._setHostAttribute("y1",s.y.toString());let a=new X(.5+.5*n/r,.5+.5*o/r);this._setHostAttribute("x2",a.x.toString()),this._setHostAttribute("y2",a.y.toString()),this._updateGradient()}_updateGradient(){let e=this.gradient();this._setFromColor(e.fStartColor()),this._setToColor(e.fEndColor())}_setFromColor(e){let n=e||"transparent";this._startColor!==n&&(this._startColor=n,this.stop1Element.setAttribute("stop-color",n),this.stop1Element.style.setProperty("stop-color",n))}_setToColor(e){let n=e||"transparent";this._endColor!==n&&(this._endColor=n,this.stop2Element.setAttribute("stop-color",n),this.stop2Element.style.setProperty("stop-color",n))}_setHostAttribute(e,n){this._hostAttributes.get(e)!==n&&(this._hostAttributes.set(e,n),this._hostElement.setAttribute(e,n))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),ef=(()=>{class t extends _0{gradient=F.required({alias:"fConnectionGradientRendererFor"});static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["linearGradient","fConnectionGradientRenderer",""]],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.gradientId())},inputs:{gradient:[1,"fConnectionGradientRendererFor","gradient"]},features:[_e],attrs:G_,decls:3,vars:0,consts:[[0,"xmlns","svg","http://www.w3.org/2000/svg"],["offset","0%"],["offset","100%"]],template:function(n,o){n&1&&(ao(0,0),Ae(),Pt(1,"stop",1)(2,"stop",2),co())},encapsulation:2,changeDetection:0})}return t})(),sp=new fe("F_CONNECTION_GRADIENT");var tf=new fe("F_CONNECTION_PATH"),nf=class{hostElement=d(Se).nativeElement},g0=(()=>{class t extends nf{_connection=d(Il);useGradient=F(!1);linkToGradient=E(()=>this.useGradient()?m0(this._connection.fId()):null);get fPathId(){return this._connection.fId()}get attrConnectionId(){return h0(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(#${C0(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${x0(this._connection.fId())})`)}deselect(){this.hostElement.setAttribute("marker-start",`url(#${y0(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${v0(this._connection.fId())})`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["path","f-connection-path",""]],hostAttrs:[1,"f-component","f-connection-path"],hostVars:4,hostBindings:function(n,o){n&2&&(Z("id",o.attrConnectionId)("data-f-path-id",o.fPathId),at("stroke",o.linkToGradient()))},inputs:{useGradient:[1,"useGradient"]},standalone:!1,features:[Re([{provide:tf,useExisting:t}]),_e],attrs:H_,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})();function y0(t){return It(`f-connection-marker-start-${t}`)}function v0(t){return It(`f-connection-marker-end-${t}`)}function C0(t){return It(`f-connection-selected-marker-start-${t}`)}function x0(t){return It(`f-connection-selected-marker-end-${t}`)}var of=new fe("F_CONNECTION_SELECTION"),rf=class{hostElement=d(Se).nativeElement},b0=(()=>{class t extends rf{_connection=d(Il);get connectionForSelectionId(){return p0(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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["path","fConnectionSelection",""]],hostAttrs:[1,"f-component","f-connection-selection"],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.connectionForSelectionId)},standalone:!1,features:[Re([{provide:of,useExisting:t}]),_e],attrs:j_,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})(),sf=new fe("F_CONNECTION_DRAG_HANDLE_END"),af=new fe("F_CONNECTION_DRAG_HANDLE_START"),fc=class{hostElement=d(Se).nativeElement;point=A.initialize();class="f-connection-drag-handle";calculateCircleCenter(i,e,n){let o={x:e.x-i.x,y:e.y-i.y},r=Math.sqrt(o.x*o.x+o.y*o.y)||1,s={x:o.x/r,y:o.y/r},a={x:s.x*n,y:s.y*n};return{x:e.x-a.x,y:e.y-a.y}}},w0=(()=>{class t extends fc{redraw(e,n){this.point=this.calculateCircleCenter(e,n,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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["circle","f-connection-drag-handle-start",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ce(o.class)},standalone:!1,features:[Re([{provide:af,useExisting:t}]),_e],attrs:U_,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),S0=(()=>{class t extends fc{redraw(e,n){this.point=this.calculateCircleCenter(e,n,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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["circle","f-connection-drag-handle-end",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ce(o.class)},standalone:!1,features:[Re([{provide:sf,useExisting:t}]),_e],attrs:$_,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),ku="f-selected";function Lp(t){return class extends t{fId=q("");fSelectionDisabled=q(!1);unmarkAsSelected(){this.unmarkChildrenAsSelected?.(),this.hostElement.classList.remove(ku)}markAsSelected(){this.markChildrenAsSelected?.(),this.isSelected()||this.hostElement.classList.add(ku)}isSelected(){return this.hostElement.classList.contains(ku)}markChildrenAsSelected(){}unmarkChildrenAsSelected(){}constructor(...i){super(...i)}}}function I0(t){return class extends t{show(){this.hostElement.style.display="unset"}hide(){this.hostElement.style.display="none"}constructor(...i){super(...i)}}}var T0=Lp(I0(class{hostElement;constructor(t){this.hostElement=t}})),E0=(()=>{class t extends T0{_fConnectionBuilder=d(Fp);path="";line=ni.initialize();fReassignableStart=q(!1);fDraggingDisabled=q(!1);fSelectionDisabled=q(!1);fDefs=Ie.required("defs");fPath=Ie.required(tf);fDragHandleStart=Ie(af);fDragHandleEnd=Ie.required(sf);fSelection=Ie.required(of);fContents=xu(Jh,{descendants:!0});fMarkers=xu(Xu,{descendants:!0});fGradient=lo(sp);_fGradientRenderer=Ie(ef);fWaypoints=lo(ep);fInputSide=q(qe.DEFAULT);_contentLayoutEngine=new qu;_sourceSide=L.AUTO;fOutputSide=q(qe.DEFAULT);_targetSide=L.AUTO;_penultimatePoint=A.initialize();_secondPoint=A.initialize();constructor(){super(d(Se).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(n=>n.hostElement?.contains(e))||this.fWaypoints()?.hostElement?.contains(e)}setLine({point1:e,point2:n}){this.line=ni.initialize(e,n);let{path:o,points:r,penultimatePoint:s,secondPoint:a,candidates:l}=this._getPathResult(e,n);this.path=o,this._penultimatePoint=s||e,this._secondPoint=a||n,this.fWaypoints()?.candidates.set(l||[]),this._contentLayoutEngine.layout(r||[],this._contents())}_contents(){return Array.from(this.fContents()?.values()??[])}_getPathResult(e,n){return this._fConnectionBuilder.handle({type:this.fType,payload:{source:e,sourceSide:this._sourceSide,target:n,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,n){this._sourceSide=e,this._targetSide=n}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,contentQueries:function(n,o,r){n&1&&Cu(r,o.fContents,Jh,5)(r,o.fMarkers,Xu,5)(r,o.fGradient,sp,5)(r,o.fWaypoints,ep,5),n&2&&it(4)},viewQuery:function(n,o){n&1&&ft(o.fDefs,W_,5)(o.fPath,tf,5)(o.fDragHandleStart,af,5)(o.fDragHandleEnd,sf,5)(o.fSelection,of,5)(o._fGradientRenderer,ef,5),n&2&&it(6)},standalone:!1,features:[_e]})}return t})(),P0=(()=>{let t=class Jo{_browser=d(ke);_markerCache=new WeakMap;handle({connection:e}){let n=this._findConnectionMarkers(e),o=e.fDefs();if(!o)return!1;let r=M0(n),s=this._markerCache.get(e);if(s?.signature===r&&s.defsElement===o.nativeElement)return!1;let a=zp("defs",this._browser);return n.forEach(l=>{Bp(l.type).forEach(h=>{let _=D0(h,l,e.fId(),this._browser),v=l.markerElement.cloneNode(!0);v.setAttribute("height",`${l.height}`),v.setAttribute("width",`${l.width}`),v.removeAttribute("markerUnits"),v.style.display="unset",_.append(v),a.append(_)})}),o.nativeElement.innerHTML=a.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(n){return new(n||Jo)};static \u0275prov=g({token:Jo,factory:Jo.\u0275fac})};return t=C([x(kn)],t),t})();function M0(t){return t.map(i=>[...Bp(i.type),i.width,i.height,i.refX,i.refY,i.orient,i.markerUnits,i.markerElement.outerHTML].join("|")).join("||")}function D0(t,i,e,n){let o=zp("marker",n);return o.setAttribute("id",It(t+"-"+e)),o.setAttribute("markerHeight",`${i.height}`),o.setAttribute("markerWidth",`${i.width}`),o.setAttribute("orient",`${i.orient}`),o.setAttribute("refX",`${i.refX}`),o.setAttribute("refY",`${i.refY}`),o.setAttribute("markerUnits",`${i.markerUnits}`),o}function Bp(t){switch(t){case ge.START:return[ge.START];case ge.END:return[ge.END];case ge.SELECTED_START:return[ge.SELECTED_START];case ge.SELECTED_END:return[ge.SELECTED_END];case ge.START_ALL_STATES:return[ge.START,ge.SELECTED_START];case ge.END_ALL_STATES:return[ge.END,ge.SELECTED_END];default:return[]}}function zp(t,i){return i.document.createElementNS("http://www.w3.org/2000/svg",t)}var El=(()=>{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,n){this._connectedInPreviousRender.add(e),this._connectedInPreviousRender.add(n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),k0=String.raw`
|
|
1
|
+
import{b as xn,d as Wh}from"./chunk-IBUV6OG2.js";import{a as wo,b as So,c as Io,d as bn,e as To,f as wn}from"./chunk-DLT5AP43.js";import{b as Oh,d as po,e as Fh,i as _o,j as Vh,k as Qe,l as je,m as Mt,n as yo,o as Zt,p as Dt,r as vo}from"./chunk-VLNLJAUB.js";import{c as jh,d as Uh,e as $h}from"./chunk-LQTUSDHD.js";import{h as Co,i as xo,j as bo}from"./chunk-QICH7GU2.js";import{$a as _n,$c as vn,Aa as Me,Db as ot,Dc as Lh,Eb as Ae,Ec as Bh,Fb as Q,Fc as gn,Gb as Ie,Gc as mo,Ic as zh,J as g,Ja as Z,K as no,Lc as Gh,M as fe,Ma as w,Mc as Hh,N as pn,Na as S,O as d,Pa as we,Pb as ei,Qa as J,R as Ch,Ra as ee,Rb as gt,S as j,Sa as T,Sb as P,Sc as ti,T as U,Ta as u,Tc as go,U as $e,Ua as f,V as Ye,Va as A,Vb as He,W as io,Wa as H,Wb as F,X as Ze,Xa as $,Xb as Te,Ya as Pt,Yb as lo,Z as nt,Za as Wt,Zb as Cu,_ as Qn,_a as qt,_b as Kt,_c as yn,ab as ao,ac as xe,ba as q,bb as co,bc as We,ca as me,cb as ae,da as mn,db as yu,dd as Cn,ea as ne,eb as K,ed as Yt,g as C,ga as Se,gb as p,ha as oo,hb as Xt,ia as xh,ib as De,ja as _u,jb as Ph,kc as kh,la as bh,lb as wt,m as eo,ma as wh,mb as St,mc as Rh,n as vh,na as c,nb as vu,nc as uo,oa as Sh,ob as ft,oc as fo,pa as Ih,pb as it,qa as Th,qc as Nh,ra as gu,rb as at,rc as ho,sa as ro,sb as de,tb as Mh,u as to,ub as Ce,va as te,vb as m,wa as so,wb as y,xa as Pe,xb as Ge,ya as Eh,yb as Jn,yc as xu,za as _e,zb as Dh}from"./chunk-W3JLG7BI.js";import{V as Ah}from"./chunk-3R7E3HPC.js";import{a as ue,b as mu}from"./chunk-Q7L6LLAK.js";var Qt=class{constructor(i,e,n,o,r){this.center=i,this.radiusX=e,this.radiusY=n,this.startAngle=o,this.endAngle=r}},L=class t{static castToPoint(i){return i||t.initialize()}static initialize(i=0,e=0){return{x:i,y:e}}static copy(i){return t.initialize(i.x,i.y)}static isEqual(i,e){return i.x===e.x&&i.y===e.y}static sum(i,e){return{x:i.x+e.x,y:i.y+e.y}}static sub(i,e){return{x:i.x-e.x,y:i.y-e.y}}static div(i,e){return{x:i.x/e,y:i.y/e}}static mult(i,e){return{x:i.x*e,y:i.y*e}}static interpolatePoints(i,e,n){let o=1-n;return t.initialize(i.x*o+e.x*n,i.y*o+e.y*n)}static roundTo(i,e){let n=Math.trunc(i.x/e),o=Math.trunc(i.y/e);return{x:n*e,y:o*e}}static hypotenuse(i,e){let n=e.x-i.x,o=e.y-i.y;return Math.abs(Math.sqrt(n*n+o*o))}static distance(i,e){let n=i.x-e.x,o=i.y-e.y;return Math.sqrt(n*n+o*o)}static getMinimum(i,e){return t.initialize(Math.min(i.x,e.x),Math.min(i.y,e.y))}static getMaximum(i,e){return t.initialize(Math.max(i.x,e.x),Math.max(i.y,e.y))}static matrixTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getScreenCTM();if(o){let r=e.createSVGPoint();r.x=i.x,r.y=i.y,n=r.matrixTransform(o.inverse())}return n}static elementTransform(i,e){let n=t.initialize(i.x,i.y),o=e.getBoundingClientRect();return n=t.sub(n,t.initialize(o.left,o.top)),n}},X=class t{constructor(i=0,e=0){this.x=i,this.y=e}static fromPoint(i){return new t(i.x,i.y)}add(i){let e=L.sum(this,i);return t.fromPoint(e)}sub(i){let e=L.sub(this,i);return t.fromPoint(e)}subNumber(i){let e=L.sub(this,new t(i,i));return t.fromPoint(e)}div(i){let e=L.div(this,i);return t.fromPoint(e)}mult(i){let e=L.mult(this,i);return t.fromPoint(e)}matrixTransform(i){let e=L.matrixTransform(this,i);return t.fromPoint(e)}elementTransform(i){let e=L.elementTransform(this,i);return t.fromPoint(e)}},ni=class{static initialize(i=L.initialize(),e=L.initialize()){return{point1:i,point2:e}}static copy(i){return{point1:i.point1,point2:i.point2}}static hypotenuse(i){return Math.sqrt(Math.pow(i.point1.x-i.point2.x,2)+Math.pow(i.point1.y-i.point2.y,2))}},Jt=class{constructor(i,e){this.point1=i,this.point2=e}},G=class t{static initialize(i=0,e=0,n=0,o=0){n<0&&(i=i+n,n=-n),o<0&&(e=e+o,o=-o);let r=L.initialize(i+n/2,e+o/2);return{x:i,y:e,width:n,height:o,gravityCenter:r}}static copy(i){return t.initialize(i.x,i.y,i.width,i.height)}static fromElement(i){let{x:e,y:n,width:o,height:r}=i.getBoundingClientRect();return t.initialize(e,n,o,r)}static isIncludePoint(i,e){return e.x>=t.left(i)&&e.x<=t.right(i)&&e.y>=t.top(i)&&e.y<=t.bottom(i)}static intersectionWithRect(i,e){return!(i.x+i.width<e.x||e.x+e.width<i.x||i.y+i.height<e.y||e.y+e.height<i.y)}static left(i){return i.x}static top(i){return i.y}static right(i){return i.x+i.width}static bottom(i){return i.y+i.height}static addPoint(i,e){let n=t.copy(i);return n.x+=e.x,n.y+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static mult(i,e){let n=t.copy(i);return n.x*=e,n.y*=e,n.width*=e,n.height*=e,this.initialize(n.x,n.y,n.width,n.height)}static div(i,e){let n=t.copy(i);return n.x/=e,n.y/=e,n.width/=e,n.height/=e,this.initialize(n.x,n.y,n.width,n.height)}static addPointToSize(i,e){let n=t.copy(i);return n.width+=e.x,n.height+=e.y,this.initialize(n.x,n.y,n.width,n.height)}static union(i){return!i||i.length===0?null:i.reduce((e,n)=>{let o=Math.min(e.x,n.x),r=Math.min(e.y,n.y),s=Math.max(e.x+e.width,n.x+n.width),a=Math.max(e.y+e.height,n.y+n.height);return t.initialize(o,r,s-o,a-r)},i[0])}static elementTransform(i,e){let n=e.getBoundingClientRect(),o=L.sub(i,L.initialize(n.left,n.top));return t.initialize(o.x,o.y,i.width,i.height)}static updateIsNotFinite(i){return!Number.isFinite(i.width)||!Number.isFinite(i.height)||!Number.isFinite(i.x)||!Number.isFinite(i.y)?t.initialize(0,0,0,0):i}};function qh(t,i){let e=Math.max(t.width,i),n=Math.max(t.height,i),o=(e-t.width)/2,r=(n-t.height)/2;return G.initialize(t.x-o,t.y-r,e,n)}function wu(t,i){t=G.updateIsNotFinite(t),i.setAttribute("x",t.x.toString()),i.setAttribute("y",t.y.toString()),i.setAttribute("width",t.width.toString()),i.setAttribute("height",t.height.toString())}function Xh(t,i){t=G.updateIsNotFinite(t),i.setAttribute("viewBox",`${t.x} ${t.y} ${t.width} ${t.height}`)}var ke=class t{constructor(i=0,e=0,n=0,o=0,r=0,s=0,a=0,l=0){this.x=i,this.y=e,this.width=n,this.height=o,this.radius1=r,this.radius2=s,this.radius3=a,this.radius4=l,this.gravityCenter=L.initialize(),this.gravityCenter=this.calculateGravityCenter(this)}calculateGravityCenter(i){return new X(i.x+i.width/2,i.y+i.height/2)}static fromRect(i){return new t(i.x,i.y,i.width,i.height)}static fromRoundedRect(i){return new t(i.x,i.y,i.width,i.height,i.radius1,i.radius2,i.radius3,i.radius4)}static fromCenter(i,e,n){return new t(i.gravityCenter.x-e/2,i.gravityCenter.y-n/2,e,n,i.radius1,i.radius2,i.radius3,i.radius4)}static fromPoint(i){return new t(i.x,i.y)}addPoint(i){let e=t.fromRoundedRect(this);return e.x+=i.x,e.y+=i.y,e.gravityCenter=this.calculateGravityCenter(e),e}},ht=class t{static initialize(i=0,e=0){return{width:i,height:e}}static isEqual(i,e){return i.width===e.width&&i.height===e.height}static offsetFromElement(i){if(i instanceof SVGGraphicsElement){let e=i.getBBox();return t.initialize(e.width,e.height)}else if(i instanceof HTMLElement)return t.initialize(i.offsetWidth,i.offsetHeight)}};function D_(){return{position:L.initialize(),scaledPosition:L.initialize(),scale:1,rotate:0}}function k_(t){let i;if(t){t=t.replace("matrix(",""),t=t.replace(")","");let e=t.split(" ");i={position:{x:Number(e[4]),y:Number(e[5])},scaledPosition:L.initialize(),scale:Number(e[0]),rotate:0}}return i}var kt=class{static toString(i){let e=L.sum(i.position,i.scaledPosition);return`matrix(${i.scale}, 0, 0, ${i.scale}, ${e.x}, ${e.y})`}static fromString(i){return k_(i)}static default(){return D_()}},Je=class t{static initialize(i=0,e=0){return L.initialize(i,e)}static fromPoints(i,e){return t.initialize(e.x-i.x,e.y-i.y)}static vectorLength(i){return Math.sqrt(t.magnitudeSquared(i))}static magnitudeSquared(i){return i.x*i.x+i.y*i.y}static dotProduct(i,e){return i.x*e.x+i.y*e.y}static crossProduct(i,e){return i.x*e.y-i.y*e.x}static subtract(i,e){return t.initialize(i.x-e.x,i.y-e.y)}static add(i,e){return t.initialize(i.x+e.x,i.y+e.y)}static scale(i,e){return t.initialize(i.x*e,i.y*e)}static angle(i,e){let n=Math.acos(Math.max(-1,Math.min(t.dotProduct(i,e)/(t.vectorLength(i)*t.vectorLength(e)),1)));return t.crossProduct(i,e)<0?-n:n}},bu=class{static parseRoundedRect(i){let e=Math.PI*.5,n=i.x,o=i.y,r=i.x+i.width,s=i.y+i.height,a=i.x+i.radius1,l=i.y+i.radius1,h=i.x+i.width-i.radius2,_=i.y+i.radius2,v=i.x+i.width-i.radius3,b=i.y+i.height-i.radius3,I=i.x+i.radius4,N=i.y+i.height-i.radius4;return[new Qt({x:a,y:l},i.radius1,i.radius1,2*e,3*e),new Jt({x:a,y:o},{x:h,y:o}),new Qt({x:h,y:_},i.radius2,i.radius2,3*e,4*e),new Jt({x:r,y:_},{x:r,y:b}),new Qt({x:v,y:b},i.radius3,i.radius3,0,e),new Jt({x:v,y:s},{x:I,y:s}),new Qt({x:I,y:N},i.radius4,i.radius4,e,2*e),new Jt({x:n,y:N},{x:n,y:l})]}},Sn=class{static getRoundedRectIntersections(i,e,n){let o=bu.parseRoundedRect(n);for(let r of o)if(r instanceof Qt){let s=this.intersectArcWithLine(r,i,e);if(s.length>0)return s}else if(r instanceof Jt){let s=this.intersectLineSegments(i,e,r.point1,r.point2);if(s)return[s]}return[]}static getRoundedRectIntersectionsWithSVGPath(i,e){let n=i.getTotalLength(),o=[];for(let r=0;r<=n;r+=1){let s=i.getPointAtLength(r);o.push({x:s.x,y:s.y})}for(let r=1;r<o.length;r++){let s=this.getRoundedRectIntersections(o[r-1],o[r],e);if(s.length>0)return s}return[]}static intersectArcWithLine(i,e,n){return this.filterPointsWithinArc(this.findEllipseLineIntersections(i.center,i.radiusX,i.radiusY,e,n),i)}static intersectLineSegments(i,e,n,o){let r=e.x-i.x,s=e.y-i.y,a=o.x-n.x,l=o.y-n.y,h=(-s*(i.x-n.x)+r*(i.y-n.y))/(-a*s+r*l),_=(a*(i.y-n.y)-l*(i.x-n.x))/(-a*s+r*l);return h>=0&&h<=1&&_>=0&&_<=1?{x:i.x+_*r,y:i.y+_*s}:null}static filterPointsWithinArc(i,e){let{center:n,startAngle:o,endAngle:r}=e;if(i.length===0)return i;r<o&&([o,r]=[r,o]),(o<0||r<0)&&(o+=2*Math.PI,r+=2*Math.PI);let s=[];for(let a of i){let l=this.normalizeAngle(Je.angle(Je.initialize(1,0),Je.initialize(a.x-n.x,a.y-n.y)));l<o&&(l+=2*Math.PI),o<=l&&l<=r&&s.push(a)}return s}static normalizeAngle(i){let e=i%(2*Math.PI);return e<0?e+2*Math.PI:e}static findEllipseLineIntersections(i,e,n,o,r){let s=Je.initialize(o.x,o.y),a=Je.fromPoints(o,r),l=Je.initialize(i.x,i.y),h=Je.subtract(s,l),_=Je.initialize(a.x/(e*e),a.y/(n*n)),v=Je.initialize(h.x/(e*e),h.y/(n*n)),b=Je.dotProduct(a,_),I=Je.dotProduct(a,v),N=Je.dotProduct(h,v)-1,D=I*I-b*N;return D<0?[]:this.calculateIntersectionPoints(D,b,I,o,r)}static calculateIntersectionPoints(i,e,n,o,r){let s=[];if(i>0){let a=Math.sqrt(i),l=(-n-a)/e,h=(-n+a)/e;l>=0&&l<=1&&s.push(L.interpolatePoints(o,r,l)),h>=0&&h<=1&&s.push(L.interpolatePoints(o,r,h))}else{let a=-n/e;a>=0&&a<=1&&s.push(L.interpolatePoints(o,r,a))}return s}};var Su=class{handle(i,e){let n=!0;if(this.validator&&(n=e.get(this.validator).handle(i)),!!n)return e.get(this.execution).handle(i)}execute(i,e){return e.get(this.execution).handle(i)}setValidator(i){this.validator=i}setExecution(i){this.execution=i}},R=class t{constructor(){this._injector=d(Ye)}static registerPipeline(i,e,n){if(!i||!i.fToken)throw new Error("Type must have a fToken static property.");let o=this.pipelines.get(i.fToken)||new Su;n?o.setValidator(e):o.setExecution(e),this.pipelines.set(i.fToken,o)}send(i){let e=t.pipelines.get(i.constructor.fToken);if(e)return e.handle(i,this._injector);throw new Error("Handler not registered for request type.")}execute(i){return t.pipelines.get(i.constructor.fToken).execute(i,this._injector)}};R.pipelines=new Map;R.\u0275fac=function(i){return new(i||R)};R.\u0275prov=g({token:R,factory:R.\u0275fac});function x(t){return function(i){R.registerPipeline(t,i,!1)}}var R_=(()=>{class t{setItem(e,n){localStorage.setItem(e,n)}getItem(e){return localStorage.getItem(e)}removeItem(e){localStorage.removeItem(e)}clear(){localStorage.clear()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),N_=(()=>{class t{storage={};setItem(e,n){this.storage[e]=n}getItem(e){return this.storage[e]||null}removeItem(e){delete this.storage[e]}clear(){this.storage={}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),O_=new fe("F_LOCAL_STORAGE",{providedIn:"root",factory:()=>fo(d(oo))?d(R_):d(N_)}),F_=(()=>{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,n,o){window.open(e,n,o)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),A_=(()=>{class t{getComputedStyle(e){return new Proxy({getPropertyValue:n=>"0"},{get:(n,o)=>o==="getPropertyValue"?n.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,n,o){}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),L_=new fe("F_WINDOW",{providedIn:"root",factory:()=>fo(d(oo))?d(F_):d(A_)}),Rt=(function(t){return t.MAC_OS="macos",t.IOS="ios",t.WINDOWS="windows",t.ANDROID="android",t.LINUX="linux",t})(Rt||{}),Iu;try{Iu=typeof Intl<"u"&&Intl.v8BreakIterator}catch{Iu=!1}var Tu=(()=>{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||Iu)&&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?fo(this._platformId):typeof document=="object"&&!!document}getOS(){let e=navigator.userAgent.toLowerCase(),n=/(macintosh|macintel|macppc|mac68k|macos)/i,o=/(win32|win64|windows|wince)/i,r;return n.test(e)?r=Rt.MAC_OS:this.IOS?r=Rt.IOS:o.test(e)?r=Rt.WINDOWS:this.ANDROID?r=Rt.ANDROID:!r&&/linux/.test(e)&&(r=Rt.LINUX),r}static \u0275fac=function(n){return new(n||t)(pn(oo))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Re=(()=>{class t{injectedDocument;windowService;localStorageService;platformService;constructor(e,n,o,r){this.injectedDocument=e,this.windowService=n,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,n,o,r){if(e.endsWith("px"))return parseFloat(e);if(e.endsWith("%")){let s=parseFloat(e)/100;return Math.max(n,o)*s}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 s=this.window.innerHeight/100;return parseFloat(e)*s}else if(e.endsWith("vw")){let s=this.window.innerWidth/100;return parseFloat(e)*s}}return parseFloat(e)||0}static \u0275fac=function(n){return new(n||t)(pn(io),pn(L_),pn(O_),pn(Tu))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Eu(t,i){return t.reduce((e,n)=>[...e,...i(n)],[])}function Pu(t){let i=t.cloneNode(!0),e=i.querySelectorAll("[id]"),n=t.nodeName.toLowerCase();i.removeAttribute("id");for(let o=0;o<e.length;o++)e[o].removeAttribute("id");return n==="canvas"?Zh(t,i):(n==="input"||n==="select"||n==="textarea")&&Yh(t,i),Kh("canvas",t,i,Zh),Kh("input, textarea, select",t,i,Yh),i}function Kh(t,i,e,n){let o=i.querySelectorAll(t);if(o.length){let r=e.querySelectorAll(t);for(let s=0;s<o.length;s++)n(o[s],r[s])}}var B_=0;function Yh(t,i){i.type!=="file"&&(i.value=t.value),i.type==="radio"&&i.name&&(i.name=`mat-clone-${i.name}-${B_++}`)}function Zh(t,i){let e=i.getContext("2d");if(e)try{e.drawImage(t,0,0)}catch{}}function Mu(t,i,e){for(let n in i)if(i.hasOwnProperty(n)){let o=i[n];o?t.setProperty(n,o,e?.has(n)?"important":""):t.removeProperty(n)}return t}function Qh(t){Mu(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 Jh(t,i,e){return z_(t,e).dataset[i]}function z_(t,i){return t.closest(i)}function Du(t,i){let e=t.rootNodes;if(e.length===1&&e[0].nodeType===i.ELEMENT_NODE)return e[0];let n=i.createElement("div");return e.forEach(o=>n.appendChild(o)),n}function ii(t,i){let e=V_(t,i);return!!e&&!e.classList.contains(i+"-disabled")}function V_(t,i){return t.closest(i)}function It(t){return t.match(/^[a-zA-Z_]/)||(t="_"+t),t.replace(/[^a-zA-Z0-9_\-:.]/g,"_")}function In(t,i,e){let n=e[t.toUpperCase()]||G_(e,t.toLowerCase());if(n===void 0)throw new Error(`Unknown ${i}: ${t}. Accepted values: ${Object.keys(e).join(", ")}`);return n}function G_(t,i){return Object.keys(t).find(e=>t[e]===i)}var H_=["markerElement"],j_=["fConnectionGradientRenderer",""],U_=["f-connection-path",""],$_=["fConnectionSelection",""],W_=["f-connection-drag-handle-start",""],q_=["f-connection-drag-handle-end",""],X_=["defs"],K_=["*"],Y_=["fGroupsContainer"],Z_=["fNodesContainer"],Q_=["fConnectionsContainer"],J_=[[["","fGroup",""],["","fGroups",""]],[["f-snap-connection"]],[["f-connection"],["","fConnections",""]],[["f-connection-for-create"]],[["","fNode",""],["","fNodes",""]]],eg=["[fGroup], [fGroups]","f-snap-connection","f-connection, [fConnections]","f-connection-for-create","[fNode], [fNodes]"],tg=[[["svg","fMarker",""]],[["f-connection-marker-circle"],["f-connection-marker-arrow"]],[["f-connection-gradient"]],[["f-connection-waypoints"]],[["","fConnectionContent",""]]],ng=["svg[fMarker]","f-connection-marker-circle, f-connection-marker-arrow","f-connection-gradient","f-connection-waypoints","[fConnectionContent]"];function ig(t,i){t&1&&($e(),A(0,"linearGradient",3)),t&2&&T("fConnectionGradientRendererFor",i)}function og(t,i){t&1&&($e(),A(0,"circle",6))}function rg(t,i){t&1&&De(0,4)}var sg="[_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}",ag=[[["","fDefinitions",""]],[["f-background"]],[["f-line-alignment"]],[["f-canvas"]],[["f-selection-area"]],"*"],cg=["[fDefinitions]","f-background","f-line-alignment","f-canvas","f-selection-area","*"],Fu=new fe("F_BACKGROUND_PATTERN"),Qa=class{fPattern;static fToken=Symbol("AddPatternToBackgroundRequest");constructor(i){this.fPattern=i}},Mn=class{_items=[];_byId=new Map;get(i){return this._byId.get(i)}require(i){let e=this._byId.get(i);if(!e)throw new Error(`${this.kind} not found: ${i}`);return e}has(i){return this._byId.has(i)}getAll(){return this._items}size(){return this._items.length}add(i){let e=i.fId();if(this._byId.has(e))throw new Error(`${this.kind} already exists: ${e}`);this._items.push(i),this._byId.set(e,i)}addMany(i){for(let e of i)this.add(e)}remove(i){let e=i.fId(),n=this._byId.get(e);if(!n)return!1;this._byId.delete(e);let o=this._items.indexOf(n);return o>=0&&this._items.splice(o,1),!0}removeById(i){let e=this._byId.get(i);if(!e)return;this._byId.delete(i);let n=this._items.indexOf(e);return n>=0&&this._items.splice(n,1),e}clear(){this._items.length=0,this._byId.clear()}};function en(t){return{name:t}}var Au=class{_instances=new Map;get(i){return this._instances.get(i.name)}require(i){let e=this.get(i);if(!e)throw new Error(`Instance not found: ${i.name}`);return e}has(i){return this._instances.has(i.name)}add(i,e){if(this._instances.has(i.name))throw new Error(`${i.name} already exists`);this._instances.set(i.name,e)}remove(i){if(!this._instances.has(i.name))throw new Error(`${i.name} does not exist`);return this._instances.delete(i.name),!0}clear(){this._instances.clear()}},si=class extends Mn{kind;constructor(i){super(),this.kind=i}},Lu=class extends Mn{kind="Connection Marker"},Bu=class extends Mn{kind="Connection";_instancesForCreate;_instancesForSnap;getForSnap(){return this._instancesForSnap}getForCreate(){return this._instancesForCreate}addForCreate(i){this._instancesForCreate=i}addForSnap(i){this._instancesForSnap=i}removeInstanceForCreate(){this._instancesForCreate=void 0}removeInstanceForSnap(){this._instancesForSnap=void 0}},zu=class extends Mn{kind="Node"},Tn=class{notifyOnSubscribe;static fToken=Symbol("ListenConnectionsChangesRequest");constructor(i=!0){this.notifyOnSubscribe=i}};function dg(){return t=>{let i=null,e=null,n=()=>{i!==null&&cancelAnimationFrame(i),e!==null&&cancelAnimationFrame(e),i=e=null};return{callback:()=>{n(),i=requestAnimationFrame(()=>{i=null,e=requestAnimationFrame(()=>{e=null,t()})})},cleanup:n}}}function lg(){return t=>{let i=null;return{callback:()=>{i!==null&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=null,t()})},cleanup:()=>{i!==null&&cancelAnimationFrame(i),i=null}}}}function Ja(t){return i=>{let e=null;return{callback:()=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{e=null,i()},t)},cleanup:()=>{e!==null&&clearTimeout(e),e=null}}}}var ct=class{_listeners=new Set;notify(){this._listeners.forEach(i=>i())}listen(i){return this._listeners.add(i),()=>this.stop(i)}stop(i){this._listeners.delete(i)}},Vu=class extends ct{_htmlElement;_observer=new ResizeObserver(()=>this.notify());_isObserving=!1;constructor(i){super(),this._htmlElement=i}listen(i){return this._isObserving||(this._observer.observe(this._htmlElement),this._isObserving=!0),super.listen(i)}stop(i){super.stop(i),this._listeners.size===0&&this._disconnect()}_disconnect(){this._observer.unobserve(this._htmlElement),this._observer.disconnect(),this._isObserving=!1}},vt=class t{_channels=[];_operators=[];constructor(...i){this._channels=[...i]}pipe(...i){let e=new t(...this._channels);return e._operators=[...this._operators,...i],e}listen(i,e){let n=e,o=[],r=[],s=[];for(let v of[...this._operators].reverse()){let b=v(n);n=b.callback,b.cleanup&&o.push(b.cleanup),b.onSubscribe&&r.push(b.onSubscribe),b.setTeardown&&s.push(b.setTeardown)}let a=this._channels.map(v=>v.listen(()=>n())),l=null,h=!1,_=()=>{h||(h=!0,l?.(),l=null,a.forEach(v=>v()),o.forEach(v=>v()))};s.slice().reverse().forEach(v=>v(_)),r.slice().reverse().forEach(v=>v(n)),l=i.onDestroy(_)}};function Sl(){return t=>{let i=!0;return{callback:t,onSubscribe:e=>{queueMicrotask(()=>{i&&e()})},cleanup:()=>{i=!1}}}}function ep(){return t=>{let i=!1,e=null;return{setTeardown:n=>e=n,callback:()=>{if(!i){i=!0;try{t()}finally{e?.()}}}}}}var ug=(()=>{let t=class Mo{_store=d(E);handle({notifyOnSubscribe:e}){return e?new vt(this._store.connectionsChanges$).pipe(Sl(),Ja(1)):new vt(this._store.connectionsChanges$).pipe(Ja(1))}static \u0275fac=function(n){return new(n||Mo)};static \u0275prov=g({token:Mo,factory:Mo.\u0275fac})};return t=C([x(Tn)],t),t})(),Gu=class{static fToken=Symbol("ListenNodesChangesRequest")},fg=(()=>{let t=class Do{_store=d(E);handle(e){return new vt(this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||Do)};static \u0275prov=g({token:Do,factory:Do.\u0275fac})};return t=C([x(Gu)],t),t})(),ec=class{static fToken=Symbol("ListenTransformChangesRequest")},hg=(()=>{let t=class ko{_store=d(E);handle(e){return new vt(this._store.transformChanges$,this._store.connectionsChanges$,this._store.nodesChanges$)}static \u0275fac=function(n){return new(n||ko)};static \u0275prov=g({token:ko,factory:ko.\u0275fac})};return t=C([x(ec)],t),t})(),tn=class{static fToken=Symbol("EmitConnectionsChangesRequest")},pg=(()=>{let t=class Ro{_store=d(E);handle(e){this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Ro)};static \u0275prov=g({token:Ro,factory:Ro.\u0275fac})};return t=C([x(tn)],t),t})(),At=class{static fToken=Symbol("NotifyTransformChangedRequest")},E=(()=>{class t{transformChanges$=new ct;viewportAnimationChanges$=new ct;connectionsChanges$=new ct;_connectionsRevision=0;connectionsRenderedChanges$=new ct;_connectionsRenderedRevision=0;_connectionsRenderedNodesRevision=0;_viewportAnimationCount=0;nodesChanges$=new ct;_nodesRevision=0;progressiveRenderChanges$=new ct;_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 zu;connections=new Bu;connectionMarkers=new Lu;outputs=new si("Output");inputs=new si("Input");outlets=new si("Outlet");instances=new Au;fDraggable;emitNodeChanges(){this._nodesRevision++,this.nodesChanges$.notify()}emitConnectionChanges(){this._connectionsRevision++,this.connectionsChanges$.notify()}completeConnectionsRender(e,n){e<this._connectionsRenderedRevision||e===this._connectionsRenderedRevision&&n<=this._connectionsRenderedNodesRevision||(this._connectionsRenderedRevision=Math.min(e,this._connectionsRevision),this._connectionsRenderedNodesRevision=n,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(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),ye={MAGNETIC_LINES:en("magnetic-lines"),MAGNETIC_RECTS:en("magnetic-rects"),ZOOM:en("zoom-controls"),BACKGROUND:en("background"),SELECTION_AREA:en("selection-area"),MINIMAP:en("minimap"),AUTO_PAN:en("auto-pan")},mg=(()=>{let t=class No{_store=d(E);handle(e){this._store.transformChanged()}static \u0275fac=function(n){return new(n||No)};static \u0275prov=g({token:No,factory:No.\u0275fac})};return t=C([x(At)],t),t})(),Lt=class{key;instance;static fToken=Symbol("RegisterPluginInstanceRequest");constructor(i,e){this.key=i,this.instance=e}},_g=(()=>{let t=class Oo{_store=d(E);handle({key:e,instance:n}){this._store.instances.add(e,n)}static \u0275fac=function(n){return new(n||Oo)};static \u0275prov=g({token:Oo,factory:Oo.\u0275fac})};return t=C([x(Lt)],t),t})(),Bt=class{key;static fToken=Symbol("RemovePluginInstanceRequest");constructor(i){this.key=i}},gg=(()=>{let t=class Fo{_store=d(E);handle({key:e}){this._store.instances.remove(e)}static \u0275fac=function(n){return new(n||Fo)};static \u0275prov=g({token:Fo,factory:Fo.\u0275fac})};return t=C([x(Bt)],t),t})(),yg=[E,fg,ug,hg,pg,mg,_g,gg],vg=0,Cg=(()=>{let t=class Ao{_store=d(E);_browser=d(Re);get _backgroundElement(){return this._store.instances.get(ye.BACKGROUND)?.hostElement}handle(e){let n=this._getPatterns(e.fPattern?.hostElement);if(!n?.length)return;let o=Pn("defs",this._browser);if(e.fPattern?.hostElement.remove(),n.forEach(r=>{o.append(r)}),n.length){this._backgroundElement?.firstChild?.appendChild(o),n[n.length-1].id="f-background-pattern-"+vg++;let r=n[n.length-1].id,s=Pn("rect",this._browser);s.setAttribute("fill","url(#"+r+")"),s.setAttribute("width","100%"),s.setAttribute("height","100%"),this._backgroundElement?.firstChild?.appendChild(s);let a=this._store.fCanvas?.transform||kt.default();e.fPattern?.setTransform(a)}}_getPatterns(e){return Array.from(e?.getElementsByTagName("pattern")||[])}static \u0275fac=function(n){return new(n||Ao)};static \u0275prov=g({token:Ao,factory:Ao.\u0275fac})};return t=C([x(Qa)],t),t})(),ai=class{fTransform;static fToken=Symbol("SetBackgroundTransformRequest");constructor(i){this.fTransform=i}},xg=(()=>{let t=class Lo{_store=d(E);handle(e){this._store.instances.get(ye.BACKGROUND)?.setTransform(e.fTransform)}static \u0275fac=function(n){return new(n||Lo)};static \u0275prov=g({token:Lo,factory:Lo.\u0275fac})};return t=C([x(ai)],t),t})(),bg=[Cg,xg],tc=class{instance;static fToken=Symbol("AddCanvasToStoreRequest");constructor(i){this.instance=i}},wg=(()=>{let t=class Bo{_store=d(E);handle({instance:e}){this._store.fCanvas=e}static \u0275fac=function(n){return new(n||Bo)};static \u0275prov=g({token:Bo,factory:Bo.\u0275fac})};return t=C([x(tc)],t),t})(),nc=class{id;animated;static fToken=Symbol("CenterGroupOrNodeRequest");constructor(i,e){this.id=i,this.animated=e}},Sg=(()=>{let t=class zo{_store=d(E);_mediator=d(R);get _transform(){return this._store.transform}handle({id:e,animated:n}){let o=this._store.nodes.get(e);o&&(this._toCenter(this._getNodeRect(o),this._getFlowRect(),o._position),this._mediator.execute(new Dn(n,nn.VIEWPORT_ONLY)))}_toCenter(e,n,o){this._transform.scaledPosition=L.initialize(),this._transform.position=L.initialize((n.width-e.width)/2-o.x*this._transform.scale,(n.height-e.height)/2-o.y*this._transform.scale)}_getNodeRect(e){return G.fromElement(e.hostElement)}_getFlowRect(){return G.fromElement(this._store.flowHost)}static \u0275fac=function(n){return new(n||zo)};static \u0275prov=g({token:zo,factory:zo.\u0275fac})};return t=C([x(nc)],t),t})(),ic=class{toCenter;animated;static fToken=Symbol("FitToFlowRequest");constructor(i,e){this.toCenter=i,this.animated=e}},Ig=(()=>{let t=class Vo{_store=d(E);get _transform(){return this._store.transform}_mediator=d(R);handle({toCenter:e,animated:n}){let o=this._mediator.execute(new Ln)||G.initialize();o.width===0||o.height===0||(this.fitToParent(o,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(r=>r._position),e),this._mediator.execute(new Dn(n,nn.VIEWPORT_ONLY)))}fitToParent(e,n,o,r){this._transform.scaledPosition=L.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let s=e.width/this._transform.scale+r.x,a=e.height/this._transform.scale+r.y;(s>n.width||a>n.height||s<n.width&&a<n.height)&&(this._transform.scale=Math.min(n.width/s,n.height/a));let l=(n.width-s*this._transform.scale)/2-this._transform.position.x*this._transform.scale,h=(n.height-a*this._transform.scale)/2-this._transform.position.y*this._transform.scale;this._transform.position=L.initialize(l+r.x/2*this._transform.scale,h+r.y/2*this._transform.scale)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return L.initialize(n,o)}static \u0275fac=function(n){return new(n||Vo)};static \u0275prov=g({token:Vo,factory:Vo.\u0275fac})};return t=C([x(ic)],t),t})(),oc=class{transform;position;static fToken=Symbol("InputCanvasPositionRequest");constructor(i,e){this.transform=i,this.position=e}},Tg=(()=>{let t=class Go{_store=d(E);handle({transform:e,position:n}){n&&(L.isEqual(this._calculateTransformPosition(e),n)||(e.position=n,e.scaledPosition=L.initialize(),this._store.fCanvas?.redraw()))}_calculateTransformPosition(e){return L.sum(e.position,e.scaledPosition)}static \u0275fac=function(n){return new(n||Go)};static \u0275prov=g({token:Go,factory:Go.\u0275fac})};return t=C([x(oc)],t),t})(),rc=class{transform;scale;static fToken=Symbol("InputCanvasScaleRequest");constructor(i,e){this.transform=i,this.scale=e}},Eg=(()=>{let t=class Ho{_store=d(E);handle(e){!e.scale&&e.scale!==0||(e.transform.scale=e.scale,this._store.fCanvas?.redraw())}static \u0275fac=function(n){return new(n||Ho)};static \u0275prov=g({token:Ho,factory:Ho.\u0275fac})};return t=C([x(rc)],t),t})(),nn=(function(t){return t.VIEWPORT_ONLY="VIEWPORT_ONLY",t.WITH_CONNECTION_CHANGES="WITH_CONNECTION_CHANGES",t})(nn||{}),Dn=class{animated;context;static fToken=Symbol("RedrawCanvasWithAnimationRequest");constructor(i,e=nn.WITH_CONNECTION_CHANGES){this.animated=i,this.context=e}};function Ep(t,i){let e=n=>{n.propertyName==="transform"&&(t.removeEventListener("transitionend",e),i(n))};t.addEventListener("transitionend",e)}var Pg=(()=>{let t=class jo{_store=d(E);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(),Ep(this._canvas.hostElement,()=>{this._store.endViewportAnimation(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()})}_redraw(e){this._canvas?.redraw(),e===nn.WITH_CONNECTION_CHANGES&&this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||jo)};static \u0275prov=g({token:jo,factory:jo.\u0275fac})};return t=C([x(Dn)],t),t})(),sc=class{static fToken=Symbol("RemoveCanvasFromStoreRequest")},Mg=(()=>{let t=class Uo{_store=d(E);handle(e){this._store.fCanvas=void 0}static \u0275fac=function(n){return new(n||Uo)};static \u0275prov=g({token:Uo,factory:Uo.\u0275fac})};return t=C([x(sc)],t),t})(),ac=class{static fToken=Symbol("ResetScaleRequest")},Dg=(()=>{let t=class $o{_store=d(E);get _transform(){return this._store.transform}handle(e){this._transform.scale=1,this._transform.scaledPosition=L.initialize()}static \u0275fac=function(n){return new(n||$o)};static \u0275prov=g({token:$o,factory:$o.\u0275fac})};return t=C([x(ac)],t),t})(),cc=class{animated;static fToken=Symbol("ResetScaleAndCenterRequest");constructor(i){this.animated=i}},kg=(()=>{let t=class Wo{_mediator=d(R);_store=d(E);get _transform(){return this._store.transform}handle({animated:e}){let n=this._mediator.execute(new Ln)||G.initialize();n.width===0||n.height===0||(this._oneToOneCentering(n,G.fromElement(this._store.flowHost),this._store.nodes.getAll().map(o=>o._position)),this._mediator.execute(new Dn(e,nn.VIEWPORT_ONLY)))}_oneToOneCentering(e,n,o){this._transform.scaledPosition=L.initialize(),this._transform.position=this._getZeroPositionWithoutScale(o);let r=(n.width-e.width/this._transform.scale)/2-this._transform.position.x,s=(n.height-e.height/this._transform.scale)/2-this._transform.position.y;this._transform.scale=1,this._transform.position=L.initialize(r,s)}_getZeroPositionWithoutScale(e){let n=e.length?Math.min(...e.map(r=>r.x)):0,o=e.length?Math.min(...e.map(r=>r.y)):0;return L.initialize(n,o)}static \u0275fac=function(n){return new(n||Wo)};static \u0275prov=g({token:Wo,factory:Wo.\u0275fac})};return t=C([x(cc)],t),t})(),dc=class{scale;toPosition;static fToken=Symbol("UpdateScaleRequest");constructor(i,e){this.scale=i,this.toPosition=e}},Rg=(()=>{let t=class qo{_store=d(E);get _transform(){return this._store.transform}handle({scale:e,toPosition:n}){if(e===this._transform.scale)return;let o=L.sum(this._transform.scaledPosition,this._transform.position),r=n.x-(n.x-o.x)*e/this._transform.scale,s=n.y-(n.y-o.y)*e/this._transform.scale;this._transform.scale=e,this._transform.scaledPosition=L.sub(L.initialize(r,s),this._transform.position)}static \u0275fac=function(n){return new(n||qo)};static \u0275prov=g({token:qo,factory:qo.\u0275fac})};return t=C([x(dc)],t),t})(),Ng=[wg,Sg,Ig,Tg,Eg,Pg,Mg,Dg,kg,Rg],Hu=class{connection;static fToken=Symbol("AddConnectionForCreateToStoreRequest");constructor(i){this.connection=i}},Og=(()=>{let t=class Xo{_store=d(E);handle({connection:e}){this._store.connections.addForCreate(e)}static \u0275fac=function(n){return new(n||Xo)};static \u0275prov=g({token:Xo,factory:Xo.\u0275fac})};return t=C([x(Hu)],t),t})(),ju=class{instance;static fToken=Symbol("AddConnectionMarkerToStoreRequest");constructor(i){this.instance=i}},Fg=(()=>{let t=class Ko{_store=d(E);handle({instance:e}){this._store.connectionMarkers.add(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Ko)};static \u0275prov=g({token:Ko,factory:Ko.\u0275fac})};return t=C([x(ju)],t),t})(),lc=class{connection;static fToken=Symbol("AddConnectionToStoreRequest");constructor(i){this.connection=i}},Ag=(()=>{let t=class Yo{_store=d(E);handle({connection:e}){this._store.connections.add(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||Yo)};static \u0275prov=g({token:Yo,factory:Yo.\u0275fac})};return t=C([x(lc)],t),t})(),Uu=class{connection;static fToken=Symbol("AddSnapConnectionToStoreRequest");constructor(i){this.connection=i}},Lg=(()=>{let t=class Zo{_store=d(E);handle({connection:e}){this._store.connections.addForSnap(e)}static \u0275fac=function(n){return new(n||Zo)};static \u0275prov=g({token:Zo,factory:Zo.\u0275fac})};return t=C([x(Uu)],t),t})(),kn=class{connection;static fToken=Symbol("CreateConnectionMarkersRequest");constructor(i){this.connection=i}},tp=new fe("F_CONNECTION_CONTENT");var uc=class t{points;cumulativeLengths;segmentTangents;totalLength;constructor(i){let e=t._removeConsecutiveDuplicates(i);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 n=this.points.length,o=n-1,r=new Array(n).fill(0),s=new Array(o),a=0;for(let l=0;l<o;l++){let h=this.points[l+1].x-this.points[l].x,_=this.points[l+1].y-this.points[l].y,v=Math.hypot(h,_),b=v?h/v:1,I=v?_/v:0;s[l]={x:b,y:I},a+=v,r[l+1]=a}this.cumulativeLengths=r,this.segmentTangents=s,this.totalLength=a||1}static from(i){return new t(i.map(e=>({x:e.x,y:e.y})))}static _removeConsecutiveDuplicates(i){let e=[];for(let n of i){let o=e[e.length-1];(!o||o.x!==n.x||o.y!==n.y)&&e.push({x:n.x,y:n.y})}return e}},$u=class t{_polyline;constructor(i=[]){this._polyline=new uc(i)}updatePoints(i){return this._polyline=new uc(i),this._polyline.totalLength}calculateTotalLength(i){return this.updatePoints(i)}get totalLength(){return this._polyline.totalLength}getPointAtProgress(i){let{points:e,cumulativeLengths:n,segmentTangents:o,totalLength:r}=this._polyline,a=t._clamp(i,0,1)*r,l=.5;if(a<=l)return{point:e[0],tangent:o[0]??{x:1,y:0},atEdge:!0};if(r-a<=l){let O=e.length-1;return{point:e[O],tangent:o[O-1]??{x:1,y:0},atEdge:!0}}let h=t._findRightIndex(n,a),_=Math.max(1,h),v=n[_-1],b=n[_],I=t._safeRatio(a-v,b-v),N=e[_-1],D=e[_],M={x:t._lerp(N.x,D.x,I),y:t._lerp(N.y,D.y,I)},k=o[_-1]??{x:1,y:0};return{point:M,tangent:k,atEdge:!1}}getPointAtLength(i){return this.getPointAtProgress(i)}getPointAtDistance(i){let e=this._polyline.totalLength?i/this._polyline.totalLength:0;return this.getPointAtProgress(e)}static _findRightIndex(i,e){let n=0,o=i.length-1;for(;n<o;){let r=n+o>>1;i[r]<e?n=r+1:o=r}return n}static _lerp(i,e,n){return i+(e-i)*n}static _clamp(i,e,n){return i<e?e:i>n?n:i}static _safeRatio(i,e){let n=Math.abs(e)<1e-6?1e-6:e;return i/n}},Pp=(function(t){return t.NONE="none",t.ALONG="along",t})(Pp||{}),Wu=class{compute(i,e){let n=this._clamp01(e.position()),{point:o,tangent:r}=i.getPointAtLength(n),s={x:-r.y,y:r.x},a=e.offset()??0,l=o.x+s.x*a,h=o.y+s.y*a,v=this._sizeAlongDirection(e.hostElement,r)*.5,b=n*i.totalLength,I=i.totalLength-b,N=this._applyEdgeGuard(l,h,r,b,I,v),D=this._calculateContentRotation(e.align(),r);return{position:N,rotationDeg:D}}_clamp01(i){return i<=0?0:i>=1?1:i}_applyEdgeGuard(i,e,n,o,r,s){if(o<=s){let a=s-o;return{x:i+n.x*a,y:e+n.y*a}}if(r<=s){let a=s-r;return{x:i-n.x*a,y:e-n.y*a}}return{x:i,y:e}}_sizeAlongDirection(i,e){let n=G.fromElement(i);return Math.abs(e.x)*n.width+Math.abs(e.y)*n.height}_normalize180(i){let e=(i+180)%360;return e<0&&(e+=360),e-180}_keepUpright(i){let e=this._normalize180(i);return e>90?e-=180:e<-90&&(e+=180),e}_calculateContentRotation(i,e){let n=0;return i===Pp.ALONG&&(n=Math.atan2(e.y,e.x)*180/Math.PI,n=this._keepUpright(n)),n}},qu=class{_placement;constructor(i=new Wu){this._placement=i}layout(i,e){let n=new $u(i),o=n.totalLength;for(let r of e){let{position:s,rotationDeg:a}=this._placement.compute(n,r);r.hostElement.style.transform=this._createTransformString(s,a)}return o}_createTransformString(i,e){return`translate3d(${i.x}px, ${i.y}px, 0) translate(-50%, -50%) rotate(${e}deg)`}};var np=new fe("F_CONNECTION_WAYPOINTS");function Mp(t,i,e){return(t.x-i.x)**2+(t.y-i.y)**2<=e**2}function Bg(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.candidates().find(o=>Mp(i,o,n))}function zg(t,i){let e=t.fWaypoints(),n=e?.radius()||8;return e?.waypoints().find(o=>Mp(i,o,n))}function Vg(t,i){for(let e of t){let n=zg(e,i);if(n&&e.fWaypoints()?.visibility())return{connection:e,waypoint:n};let o=Bg(e,i);if(o&&e.fWaypoints()?.visibility())return{connection:e,candidate:o}}}var Il=new fe("F_CONNECTION_COMPONENTS_PARENT");var ge=(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})(ge||{}),Xu=new fe("F_CONNECTION_MARKER"),Gg=0,Ku=class{fId=q(`f-marker-${Gg++}`);hostElement=d(Se).nativeElement};function Hg(t,i=ge.START){if(typeof t!="string")return i;let e=t.trim().toLowerCase();return e?jg(e)??i:i}function jg(t){switch(t){case"start":case"f-connection-marker-start":return ge.START;case"end":case"f-connection-marker-end":return ge.END;case"selected-start":case"f-connection-selected-marker-start":return ge.SELECTED_START;case"selected-end":case"f-connection-selected-marker-end":return ge.SELECTED_END;case"start-all-states":case"f-connection-marker-start-all-states":case"start-all":case"all-start":return ge.START_ALL_STATES;case"end-all-states":case"f-connection-marker-end-all-states":case"end-all":case"all-end":return ge.END_ALL_STATES;default:return null}}var Dp=(()=>{class t extends Ku{_markerElement=Te.required("markerElement");_type=F(ge.END_ALL_STATES,{alias:"type",transform:e=>Hg(e,ge.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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-connection-marker-arrow"]],viewQuery:function(n,o){n&1&&ft(o._markerElement,H_,5),n&2&&it()},hostAttrs:[1,"f-component",2,"display","none"],inputs:{_type:[1,"type","_type"]},features:[Ie([{provide:Xu,useExisting:t}]),_e],decls:3,vars:0,consts:[["markerElement",""],["viewBox","0 0 6 6",1,"f-marker"],["d","M0,0 L6,3 0,6Z"]],template:function(n,o){n&1&&($e(),H(0,"svg",1,0),Pt(2,"path",2),$())},encapsulation:2})}return t})();var Ot=(function(t){return t.FIXED="fixed",t.FIXED_CENTER="fixed_center",t.FLOATING="floating",t})(Ot||{}),qe=(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})(qe||{});function Ug({sourceRect:t,targetRect:i}){return{point1:t.gravityCenter,point2:i.gravityCenter}}var B=(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})(B||{}),Nt=(function(t){return t.SEGMENT="segment",t.STRAIGHT="straight",t.BEZIER="bezier",t.ADAPTIVE_CURVE="adaptive-curve",t})(Nt||{});function $g({sourceRect:t,sourceConnectableSide:i,targetRect:e,targetConnectableSide:n}){return{point1:ip(t,i===B.AUTO?B.BOTTOM:i),point2:ip(e,n===B.AUTO?B.TOP:n)}}function ip(t,i){switch(i){case B.TOP:return{x:t.x+t.width/2,y:t.y};case B.BOTTOM:return{x:t.x+t.width/2,y:t.y+t.height};case B.LEFT:return{x:t.x,y:t.y+t.height/2};case B.RIGHT:return{x:t.x+t.width,y:t.y+t.height/2};default:throw new Error(`Unknown side: ${i}`)}}function kp(t,i,e,n){if(!n||!n.rotationDeg)return Sn.getRoundedRectIntersections(t,i,e)[0];let o=Qo(t,-n.rotationDeg,n.pivot),r=Qo(i,-n.rotationDeg,n.pivot),s=Wg(e,-n.rotationDeg,n.pivot),a=Sn.getRoundedRectIntersections(o,r,s)[0];return a?Qo(a,n.rotationDeg,n.pivot):void 0}function Wg(t,i,e){let n=Qo(qg(t),i,e);return new ke(n.x-t.width/2,n.y-t.height/2,t.width,t.height,t.radius1,t.radius2,t.radius3,t.radius4)}function qg(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Qo(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,s=Math.cos(r),a=Math.sin(r);return{x:n*s-o*a+e.x,y:n*a+o*s+e.y}}function Xg({sourceRect:t,targetRect:i,sourceRotationContext:e,targetRotationContext:n}){return Zg(Kg(t,i,e),Yg(t,i,n),t,i)}function Kg(t,i,e){return kp(t.gravityCenter,i.gravityCenter,t,e)}function Yg(t,i,e){return kp(i.gravityCenter,t.gravityCenter,i,e)}function Zg(t,i,e,n){return{point1:t||e.gravityCenter,point2:i||n.gravityCenter}}var Eo=.5,Qg={[Ot.FLOATING]:Xg,[Ot.FIXED_CENTER]:Ug,[Ot.FIXED]:$g},jn=(()=>{class t{handle(e){let n=this._calculateDirectionalVectors(e.sourceRect.gravityCenter.x,e.sourceRect.gravityCenter.y,e.targetRect.gravityCenter.x,e.targetRect.gravityCenter.y),o=this._determineSourceSide(e,n),r=this._determineTargetSide(e,n);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,n,o,r){let s=o-e,a=r-n;return{sourceToTargetX:s,sourceToTargetY:a,targetToSourceX:-s,targetToSourceY:-a}}_determineSourceSide(e,n){return this._resolveConnectableSide(e.connection.fOutputSide(),n.sourceToTargetX,n.sourceToTargetY,e.sourceConnectableSide)}_determineTargetSide(e,n){return this._resolveConnectableSide(e.connection.fInputSide(),n.targetToSourceX,n.targetToSourceY,e.targetConnectableSide)}_resolveConnectableSide(e,n,o,r){if(e===qe.DEFAULT)return r;let s=Math.abs(n),a=Math.abs(o);if(s<Eo&&a<Eo)return r;let h=s>=a;switch(e){case qe.CALCULATE:return h?n>=0?B.RIGHT:B.LEFT:o>=0?B.BOTTOM:B.TOP;case qe.CALCULATE_HORIZONTAL:return s<Eo?r:n>=0?B.RIGHT:B.LEFT;case qe.CALCULATE_VERTICAL:return a<Eo?r:o>=0?B.BOTTOM:B.TOP;case qe.TOP:return B.TOP;case qe.BOTTOM:return B.BOTTOM;case qe.LEFT:return B.LEFT;case qe.RIGHT:return B.RIGHT;default:return r}}_getBehaviorHandler(e){let n=Qg[e];if(!n)throw new Error(`[Behavior] No handler for behavior: ${e}`);return n}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),mt=class{sourceRect;targetRect;connection;sourceConnectableSide;targetConnectableSide;sourceRotationContext;targetRotationContext;constructor(i,e,n,o,r,s,a){this.sourceRect=i,this.targetRect=e,this.connection=n,this.sourceConnectableSide=o,this.targetConnectableSide=r,this.sourceRotationContext=s,this.targetRotationContext=a}};function Tl(t,i,e){return[t,...e??[],i]}function Jg(t,i){let e=Math.abs(i.x-t.x)/2,n=i.x<t.x?i.x+e:i.x-e,o=Math.abs(i.y-t.y)/2,r=i.y<t.y?i.y+o:i.y-o;return{x:n,y:r}}function e0(t,i=32){let e=new Array(i+1);e[0]=ue({},t[0]);for(let n=1;n<=i;n++)e[n]=Rp(t[0],t[1],t[2],t[3],n/i);return e}function Rp(t,i,e,n,o){let r=1-o,s=o*o,a=r*r,l=a*r,h=s*o;return{x:l*t.x+3*a*o*i.x+3*r*s*e.x+h*n.x,y:l*t.y+3*a*o*i.y+3*r*s*e.y+h*n.y}}function Np(t){return t.map(i=>Rp(i.p0,i.c1,i.c2,i.p3,.5))}function t0(t){if(t.length<2)throw new Error("Polylines must be at least two points");let i=n0(t);return i<=0?[ue({},t[0])]:[i0(t,i/2)]}function n0(t){let i=0;for(let e=0;e<t.length-1;e++)i+=Op(t[e],t[e+1]);return i}function i0(t,i){let e=0;for(let o=0;o<t.length-1;o++){let r=t[o],s=t[o+1],a=Op(r,s);if(!(a<=0)){if(e+a>=i){let l=(i-e)/a;return{x:r.x+(s.x-r.x)*l,y:r.y+(s.y-r.y)*l}}e+=a}}let n=t[t.length-1];return{x:n.x,y:n.y}}function Op(t,i){return Math.hypot(i.x-t.x,i.y-t.y)}function o0(t){let i=[];for(let e of t)for(let n of e){let o=i[i.length-1];(!o||o.x!==n.x||o.y!==n.y)&&i.push(n)}return i}function Fp(t){if(!t.length)return"";let i=`M ${t[0].p0.x} ${t[0].p0.y}`;for(let e=0;e<t.length;e++){let n=t[e],o=e===t.length-1,r=o?n.p3.x+2e-4:n.p3.x,s=o?n.p3.y+2e-4:n.p3.y;i+=` C ${n.c1.x} ${n.c1.y}, ${n.c2.x} ${n.c2.y}, ${r} ${s}`}return i}function Ap(t,i=16){if(!t.length)return[];let e=[];for(let n=0;n<t.length;n++){let o=t[n],r=e0([o.p0,o.c1,o.c2,o.p3],i);n>0&&r.shift(),e.push(...r)}return e}function r0(t,i=1e-6){let e=t.length;if(e<=2)return t;let n=[];n.push(t[0]);for(let r=1;r<e;r++){let s=t[r],a=n[n.length-1];(Math.abs(s.x-a.x)>i||Math.abs(s.y-a.y)>i)&&n.push(s)}if(n.length<=2)return n;let o=[];o.push(n[0]);for(let r=1;r<n.length-1;r++){let s=o[o.length-1],a=n[r],l=n[r+1],h=Math.abs(s.x-a.x)<=i&&Math.abs(a.x-l.x)<=i,_=Math.abs(s.y-a.y)<=i&&Math.abs(a.y-l.y)<=i;!h&&!_&&o.push(a)}return o.push(n[n.length-1]),o}var Yu=class t{static _dir(i){switch(i){case B.LEFT:return{x:-1,y:0};case B.RIGHT:return{x:1,y:0};case B.TOP:return{x:0,y:-1};case B.BOTTOM:return{x:0,y:1};case B.AUTO:return{x:0,y:0}}return{x:0,y:0}}static _isHorizontal(i){return i===B.LEFT||i===B.RIGHT}static _handleLength(i,e,n,o){let r=Math.abs(e.x-i.x),s=Math.abs(e.y-i.y),a=Math.hypot(r,s),l=n===B.AUTO?Math.max(r,s):this._isHorizontal(n)?r:s,h=Math.max(8,o),_=o+.5*a,v=o*1.05+l*.3;return Math.min(_,Math.max(h,v))}static _softControl(i,e,n,o){let r=this._dir(i),s=n.x-e.x,a=n.y-e.y,l=Math.hypot(s,a)||1,h=s/l,_=a/l;if(i===B.AUTO)return{x:e.x+h*o,y:e.y+_*o};let v=r.x*h+r.y*_,b=.12,I=Math.max(0,-v)*.08,N=Math.min(.2,b+I),D=r.x*(1-N)+h*N,M=r.y*(1-N)+_*N,k=Math.hypot(D,M)||1;return{x:e.x+D/k*o,y:e.y+M/k*o}}handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Math.max(0,r??0),l=Tl(i,n,s),h=[];for(let v=0;v<l.length-1;v++){let b=l[v],I=l[v+1],N=t._handleLength(b,I,e,a),D=t._handleLength(I,b,o,a),M=t._softControl(e,b,I,N),k=t._softControl(o,I,b,D);h.push({p0:b,c1:M,c2:k,p3:I,chainIndex:v})}let _=Ap(h,12);return{path:Fp(h),secondPoint:h[0]?.c1??i,penultimatePoint:h[h.length-1]?.c2??n,points:_,candidates:Np(h)}}},Zu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,offset:r,waypoints:s}){let a=Tl(i,n,s),l=[];for(let _=0;_<a.length-1;_++){let v=a[_],b=a[_+1],I=op(e,v,b,r??0),N=op(o,b,v,r??0);l.push({p0:v,c1:I,c2:N,p3:b,chainIndex:_})}let h=Ap(l,12);return{path:Fp(l),secondPoint:l[0]?.c1??i,penultimatePoint:l[l.length-1]?.c2??n,points:h,candidates:Np(l)}}};function op(t,i,e,n){let o={x:i.x,y:i.y};switch(t){case B.LEFT:o.x-=Po(i.x-e.x,n);break;case B.RIGHT:o.x+=Po(e.x-i.x,n);break;case B.TOP:o.y-=Po(i.y-e.y,n);break;case B.BOTTOM:o.y+=Po(e.y-i.y,n);break;case B.AUTO:break}return o}function Po(t,i){return t>=i?t:i*Math.sqrt(i-t)}function s0(t){let{axis:i,source:e,target:n,sourceSide:o,targetSide:r,sourceGap:s,targetGap:a,sourceDir:l,targetDir:h,currentDir:_,offset:v,sourceGapOffset:b,targetGapOffset:I}=t,N=a0(s,a),D=c0(i,l,_,N);return o===r?d0(i,e,n,v,l,_,s,a,b,I):D=l0(i,l,h,s,a,N,D),D}function a0(t,i){return{sourceTarget:[{x:t.x,y:i.y}],targetSource:[{x:i.x,y:t.y}]}}function c0(t,i,e,n){return t==="x"?i.x===e?n.targetSource:n.sourceTarget:i.y===e?n.sourceTarget:n.targetSource}function d0(t,i,e,n,o,r,s,a,l,h){let _=Math.abs(i[t]-e[t]);if(_>n)return;let v=Math.min(n-1,n-_);v<=0||(o[t]===r?l[t]=(s[t]>i[t]?-1:1)*v:h[t]=(a[t]>e[t]?-1:1)*v)}function l0(t,i,e,n,o,r,s){let a=t==="x"?"y":"x",l=i[t]===e[a],h=n[a]>o[a],_=n[a]<o[a];return i[t]===1&&(!l&&h||l&&_)||i[t]!==1&&(!l&&_||l&&h)?t==="x"?r.sourceTarget:r.targetSource:s}var oi=1e-6,rp=2e-4,u0=.75;function f0(t,i){let e=t.length,n=[];n.push(`M ${t[0].x} ${t[0].y}`);for(let r=1;r<e-1;r++)n.push(h0(t[r-1],t[r],t[r+1],i));let o=t[e-1];return n.push(`L ${o.x+rp} ${o.y+rp}`),n.join(" ")}function h0(t,i,e,n){let o=i.x,r=i.y;if(n<=0)return`L ${o} ${r}`;let s=Math.abs(t.x-o)<=oi&&Math.abs(o-e.x)<=oi,a=Math.abs(t.y-r)<=oi&&Math.abs(r-e.y)<=oi;if(s||a)return`L ${o} ${r}`;let l=Math.hypot(o-t.x,r-t.y),h=Math.hypot(e.x-o,e.y-r),_=Math.min(l*.5,h*.5,n);if(_<u0)return`L ${o} ${r}`;if(Math.abs(t.y-r)<=oi){let M=t.x<e.x?-1:1,k=t.y<e.y?1:-1,O=o+_*M,z=r+_*k;return`L ${O} ${r} Q ${o} ${r} ${o} ${z}`}let b=t.x<e.x?1:-1,I=t.y<e.y?-1:1,N=r+_*I,D=o+_*b;return`L ${o} ${N} Q ${o} ${r} ${D} ${r}`}var sp={[B.LEFT]:L.initialize(-1,0),[B.RIGHT]:L.initialize(1,0),[B.TOP]:L.initialize(0,-1),[B.BOTTOM]:L.initialize(0,1),[B.AUTO]:L.initialize(0,0)},Qu=class{handle({source:i,sourceSide:e,target:n,targetSide:o,waypoints:r,offset:s,radius:a}){let l=Tl(i,n,r),h=[],_=[];for(let N=0;N<l.length-1;N++){let D=l[N],M=l[N+1],k=this._getPathPoints(D,e,M,o,s??0);h.push(k),_.push(...t0(k))}let v=r0(o0(h)),b=v.length>1?v[v.length-2]:i,I=v.length>1?v[1]:n;return{path:f0(v,a??0),penultimatePoint:b,secondPoint:I,points:v,candidates:_}}_getPathPoints(i,e,n,o,r){let s=sp[e],a=sp[o],l={x:i.x+s.x*r,y:i.y+s.y*r},h={x:n.x+a.x*r,y:n.y+a.y*r},_=this._getDirection(l,e,h),v=_.x!==0?"x":"y",b=_[v],I=[],N=L.initialize(),D=L.initialize(),M=Jg(i,n);if(s[v]*a[v]===-1){let k=[{x:M.x,y:l.y},{x:M.x,y:h.y}],O=[{x:l.x,y:M.y},{x:h.x,y:M.y}];s[v]===b?I=v==="x"?k:O:I=v==="x"?O:k}else I=s0({axis:v,source:i,target:n,sourceSide:e,targetSide:o,sourceGap:l,targetGap:h,sourceDir:s,targetDir:a,currentDir:b,offset:r,sourceGapOffset:N,targetGapOffset:D});return[i,{x:l.x+N.x,y:l.y+N.y},...I,{x:h.x+D.x,y:h.y+D.y},n]}_getDirection(i,e,n){return e===B.LEFT||e===B.RIGHT?i.x<n.x?L.initialize(1,0):L.initialize(-1,0):i.y<n.y?L.initialize(0,1):L.initialize(0,-1)}},ap=2e-4,Ju=class{handle(i){let e=Tl(i.source,i.target,i.waypoints),n=e.length,o=e[0],r=`M ${o.x} ${o.y}`,s=new Array(n-1);for(let a=0;a<n-1;a++){let l=e[a],h=e[a+1],_=a===n-2,v=_?h.x+ap:h.x,b=_?h.y+ap:h.y;r+=` L ${v} ${b}`,s[a]={x:(l.x+h.x)*.5,y:(l.y+h.y)*.5}}return{path:r,candidates:s,points:e,secondPoint:e[1]??i.target,penultimatePoint:e[n-2]??i.source}}},p0=new fe("F_CONNECTION_BUILDERS"),Lp=(()=>{class t{_builtinBuilders={[Nt.STRAIGHT]:new Ju,[Nt.BEZIER]:new Zu,[Nt.ADAPTIVE_CURVE]:new Yu,[Nt.SEGMENT]:new Qu};_providedBuilders;_builders;constructor(){this._providedBuilders=d(p0,{optional:!0})||{},this._builders=ue(ue({},this._builtinBuilders),this._providedBuilders)}handle({type:e,payload:n}){let o=this._builders[e];if(!o)throw this._createBuilderNotFoundError(e);return o.handle(n)}_createBuilderNotFoundError(e){let n=Object.keys(this._builtinBuilders).sort(),o=Object.keys(this._providedBuilders).sort(),r=Object.keys(this._builders).sort(),s=n.filter(l=>l in this._providedBuilders).sort(),a=[`Connection Builder Error: builder type "${e}" not found.`,`Registered types: ${r.length?r.join(", "):"(none)"}`,`Built-in types: ${n.length?n.join(", "):"(none)"}`,`Provided (F_CONNECTION_BUILDERS) types: ${o.length?o.join(", "):"(none)"}`,s.length?`Overridden built-ins: ${s.join(", ")}`:null,"Tip: ensure you pass a valid Connection Type or provide a builder via F_CONNECTION_BUILDERS."].filter(Boolean);return new Error(a.join(`
|
|
2
|
+
`))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();function m0(t,i,e){return It("connection_"+t+i+e)}function _0(t,i,e){return It("connection_for_selection_"+t+i+e)}function Bp(t){return It("connection_gradient_"+t)}function g0(t){return`url(#${Bp(t)})`}var y0=(()=>{class t{_connection=d(Il);_hostElement=d(Se).nativeElement;_injector=d(Ye);_hostAttributes=new Map;_startColor;_endColor;gradientId=P(()=>Bp(this._connection.fId()));ngOnInit(){this._listenColorChanges()}_listenColorChanges(){me(()=>{this.gradient().fStartColor(),this.gradient().fEndColor(),gt(()=>{this._updateGradient()})},{injector:this._injector})}get stop1Element(){return this._hostElement.children.item(0)}get stop2Element(){return this._hostElement.children.item(1)}redraw(e){let n=e.point2.x-e.point1.x,o=e.point2.y-e.point1.y,r=Math.sqrt(n*n+o*o)||.01,s=new X(.5-.5*n/r,.5-.5*o/r);this._setHostAttribute("x1",s.x.toString()),this._setHostAttribute("y1",s.y.toString());let a=new X(.5+.5*n/r,.5+.5*o/r);this._setHostAttribute("x2",a.x.toString()),this._setHostAttribute("y2",a.y.toString()),this._updateGradient()}_updateGradient(){let e=this.gradient();this._setFromColor(e.fStartColor()),this._setToColor(e.fEndColor())}_setFromColor(e){let n=e||"transparent";this._startColor!==n&&(this._startColor=n,this.stop1Element.setAttribute("stop-color",n),this.stop1Element.style.setProperty("stop-color",n))}_setToColor(e){let n=e||"transparent";this._endColor!==n&&(this._endColor=n,this.stop2Element.setAttribute("stop-color",n),this.stop2Element.style.setProperty("stop-color",n))}_setHostAttribute(e,n){this._hostAttributes.get(e)!==n&&(this._hostAttributes.set(e,n),this._hostElement.setAttribute(e,n))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,standalone:!1})}return t})(),ef=(()=>{class t extends y0{gradient=F.required({alias:"fConnectionGradientRendererFor"});static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["linearGradient","fConnectionGradientRenderer",""]],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.gradientId())},inputs:{gradient:[1,"fConnectionGradientRendererFor","gradient"]},features:[_e],attrs:j_,decls:3,vars:0,consts:[[0,"xmlns","svg","http://www.w3.org/2000/svg"],["offset","0%"],["offset","100%"]],template:function(n,o){n&1&&(ao(0,0),$e(),Pt(1,"stop",1)(2,"stop",2),co())},encapsulation:2,changeDetection:0})}return t})(),cp=new fe("F_CONNECTION_GRADIENT");var tf=new fe("F_CONNECTION_PATH"),nf=class{hostElement=d(Se).nativeElement},v0=(()=>{class t extends nf{_connection=d(Il);useGradient=F(!1);linkToGradient=P(()=>this.useGradient()?g0(this._connection.fId()):null);get fPathId(){return this._connection.fId()}get attrConnectionId(){return m0(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(#${b0(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${w0(this._connection.fId())})`)}deselect(){this.hostElement.setAttribute("marker-start",`url(#${C0(this._connection.fId())})`),this.hostElement.setAttribute("marker-end",`url(#${x0(this._connection.fId())})`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["path","f-connection-path",""]],hostAttrs:[1,"f-component","f-connection-path"],hostVars:4,hostBindings:function(n,o){n&2&&(Z("id",o.attrConnectionId)("data-f-path-id",o.fPathId),at("stroke",o.linkToGradient()))},inputs:{useGradient:[1,"useGradient"]},standalone:!1,features:[Ie([{provide:tf,useExisting:t}]),_e],attrs:U_,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})();function C0(t){return It(`f-connection-marker-start-${t}`)}function x0(t){return It(`f-connection-marker-end-${t}`)}function b0(t){return It(`f-connection-selected-marker-start-${t}`)}function w0(t){return It(`f-connection-selected-marker-end-${t}`)}var of=new fe("F_CONNECTION_SELECTION"),rf=class{hostElement=d(Se).nativeElement},S0=(()=>{class t extends rf{_connection=d(Il);get connectionForSelectionId(){return _0(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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["path","fConnectionSelection",""]],hostAttrs:[1,"f-component","f-connection-selection"],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.connectionForSelectionId)},standalone:!1,features:[Ie([{provide:of,useExisting:t}]),_e],attrs:$_,decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{fill:none;pointer-events:stroke}"],changeDetection:0})}return t})(),sf=new fe("F_CONNECTION_DRAG_HANDLE_END"),af=new fe("F_CONNECTION_DRAG_HANDLE_START"),fc=class{hostElement=d(Se).nativeElement;point=L.initialize();class="f-connection-drag-handle";calculateCircleCenter(i,e,n){let o={x:e.x-i.x,y:e.y-i.y},r=Math.sqrt(o.x*o.x+o.y*o.y)||1,s={x:o.x/r,y:o.y/r},a={x:s.x*n,y:s.y*n};return{x:e.x-a.x,y:e.y-a.y}}},I0=(()=>{class t extends fc{redraw(e,n){this.point=this.calculateCircleCenter(e,n,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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["circle","f-connection-drag-handle-start",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ce(o.class)},standalone:!1,features:[Ie([{provide:af,useExisting:t}]),_e],attrs:W_,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),T0=(()=>{class t extends fc{redraw(e,n){this.point=this.calculateCircleCenter(e,n,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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["circle","f-connection-drag-handle-end",""]],hostVars:2,hostBindings:function(n,o){n&2&&Ce(o.class)},standalone:!1,features:[Ie([{provide:sf,useExisting:t}]),_e],attrs:q_,decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),ku="f-selected";function zp(t){return class extends t{fId=q("");fSelectionDisabled=q(!1);unmarkAsSelected(){this.unmarkChildrenAsSelected?.(),this.hostElement.classList.remove(ku)}markAsSelected(){this.markChildrenAsSelected?.(),this.isSelected()||this.hostElement.classList.add(ku)}isSelected(){return this.hostElement.classList.contains(ku)}markChildrenAsSelected(){}unmarkChildrenAsSelected(){}constructor(...i){super(...i)}}}function E0(t){return class extends t{show(){this.hostElement.style.display="unset"}hide(){this.hostElement.style.display="none"}constructor(...i){super(...i)}}}var P0=zp(E0(class{hostElement;constructor(t){this.hostElement=t}})),M0=(()=>{class t extends P0{_fConnectionBuilder=d(Lp);path="";line=ni.initialize();fReassignableStart=q(!1);fDraggingDisabled=q(!1);fSelectionDisabled=q(!1);fDefs=Te.required("defs");fPath=Te.required(tf);fDragHandleStart=Te(af);fDragHandleEnd=Te.required(sf);fSelection=Te.required(of);fContents=Cu(tp,{descendants:!0});fMarkers=Cu(Xu,{descendants:!0});fGradient=lo(cp);_fGradientRenderer=Te(ef);fWaypoints=lo(np);fInputSide=q(qe.DEFAULT);_contentLayoutEngine=new qu;_sourceSide=B.AUTO;fOutputSide=q(qe.DEFAULT);_targetSide=B.AUTO;_penultimatePoint=L.initialize();_secondPoint=L.initialize();constructor(){super(d(Se).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(n=>n.hostElement?.contains(e))||this.fWaypoints()?.hostElement?.contains(e)}setLine({point1:e,point2:n}){this.line=ni.initialize(e,n);let{path:o,points:r,penultimatePoint:s,secondPoint:a,candidates:l}=this._getPathResult(e,n);this.path=o,this._penultimatePoint=s||e,this._secondPoint=a||n,this.fWaypoints()?.candidates.set(l||[]),this._contentLayoutEngine.layout(r||[],this._contents())}_contents(){return Array.from(this.fContents()?.values()??[])}_getPathResult(e,n){return this._fConnectionBuilder.handle({type:this.fType,payload:{source:e,sourceSide:this._sourceSide,target:n,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,n){this._sourceSide=e,this._targetSide=n}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,contentQueries:function(n,o,r){n&1&&vu(r,o.fContents,tp,5)(r,o.fMarkers,Xu,5)(r,o.fGradient,cp,5)(r,o.fWaypoints,np,5),n&2&&it(4)},viewQuery:function(n,o){n&1&&ft(o.fDefs,X_,5)(o.fPath,tf,5)(o.fDragHandleStart,af,5)(o.fDragHandleEnd,sf,5)(o.fSelection,of,5)(o._fGradientRenderer,ef,5),n&2&&it(6)},standalone:!1,features:[_e]})}return t})(),D0=(()=>{let t=class Jo{_browser=d(Re);_markerCache=new WeakMap;handle({connection:e}){let n=this._findConnectionMarkers(e),o=e.fDefs();if(!o)return!1;let r=k0(n),s=this._markerCache.get(e);if(s?.signature===r&&s.defsElement===o.nativeElement)return!1;let a=Gp("defs",this._browser);return n.forEach(l=>{Vp(l.type).forEach(h=>{let _=R0(h,l,e.fId(),this._browser),v=l.markerElement.cloneNode(!0);v.setAttribute("height",`${l.height}`),v.setAttribute("width",`${l.width}`),v.removeAttribute("markerUnits"),v.style.display="unset",_.append(v),a.append(_)})}),o.nativeElement.innerHTML=a.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(n){return new(n||Jo)};static \u0275prov=g({token:Jo,factory:Jo.\u0275fac})};return t=C([x(kn)],t),t})();function k0(t){return t.map(i=>[...Vp(i.type),i.width,i.height,i.refX,i.refY,i.orient,i.markerUnits,i.markerElement.outerHTML].join("|")).join("||")}function R0(t,i,e,n){let o=Gp("marker",n);return o.setAttribute("id",It(t+"-"+e)),o.setAttribute("markerHeight",`${i.height}`),o.setAttribute("markerWidth",`${i.width}`),o.setAttribute("orient",`${i.orient}`),o.setAttribute("refX",`${i.refX}`),o.setAttribute("refY",`${i.refY}`),o.setAttribute("markerUnits",`${i.markerUnits}`),o}function Vp(t){switch(t){case ge.START:return[ge.START];case ge.END:return[ge.END];case ge.SELECTED_START:return[ge.SELECTED_START];case ge.SELECTED_END:return[ge.SELECTED_END];case ge.START_ALL_STATES:return[ge.START,ge.SELECTED_START];case ge.END_ALL_STATES:return[ge.END,ge.SELECTED_END];default:return[]}}function Gp(t,i){return i.document.createElementNS("http://www.w3.org/2000/svg",t)}var El=(()=>{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,n){this._connectedInPreviousRender.add(e),this._connectedInPreviousRender.add(n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),N0=String.raw`
|
|
3
3
|
const EPSILON = 0.5;
|
|
4
4
|
|
|
5
5
|
addEventListener('message', (event) => {
|
|
@@ -207,7 +207,7 @@ function getSidePoint(rect, side) {
|
|
|
207
207
|
return null;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
`.trim();function Vp(t){return!!Gp(t)}function Gp(t){let i=t,e=i?.Blob,n=i?.Worker,o=i?.URL;return!e||!n||typeof o?.createObjectURL!="function"||typeof o.revokeObjectURL!="function"?null:{blobCtor:e,workerCtor:n,urlApi:o}}function R0(t){let i=new t.blobCtor([k0],{type:"text/javascript"});return t.urlApi.createObjectURL(i)}function Hp(t,i){if(!t)return;let e=i??(typeof URL>"u"?null:URL);typeof e?.revokeObjectURL=="function"&&e.revokeObjectURL(t)}var un=(()=>{class t{worker=null;workerUrl=null;nextRequestId=0;isDisabled=!1;pending=new Map;resetRuntime(e){this.pending.forEach(n=>n.reject(e)),this.pending.clear(),this.worker?.terminate(),this.worker=null,Hp(this.workerUrl),this.workerUrl=null}dispose(){this.resetRuntime(new Error("Connection worker was destroyed."))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),hc=class{connection;line;static fToken=Symbol("ApplyConnectionRenderRequest");constructor(i,e){this.connection=i,this.line=e}},N0=(()=>{let t=class er{_mediator=d(R);_renderCache=new WeakMap;handle({connection:e,line:n}){!this._mediator.execute(new kn(e))&&!this._shouldRender(e,n)||(e.setLine(n),e.initialize())}_shouldRender(e,n){let o=e.fPath().hostElement,r=this._createConnectionRenderSignature(e,n),s=this._renderCache.get(e);return s?.signature===r&&s.pathElement===o?!1:(this._renderCache.set(e,{signature:r,pathElement:o}),!0)}_createConnectionRenderSignature(e,n){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(n.point1),this._serializePoint(n.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(n=>[n.position(),n.offset(),n.align()].join(":")).join(";")}static \u0275fac=function(n){return new(n||er)};static \u0275prov=g({token:er,factory:er.\u0275fac})};return t=C([x(hc)],t),t})(),pc=class{source;target;static fToken=Symbol("MarkConnectionConnectorsAsConnectedRequest");constructor(i,e){this.source=i,this.target=e}},O0=(()=>{let t=class tr{_state=d(El);handle({source:e,target:n}){e.setConnected(n),n.setConnected(e),this._state.trackConnectedConnectors(e,n)}static \u0275fac=function(n){return new(n||tr)};static \u0275prov=g({token:tr,factory:tr.\u0275fac})};return t=C([x(pc)],t),t})(),zt=class{element;cache;static fToken=Symbol("GetNormalizedConnectorRectRequest");constructor(i,e=!0){this.element=i,this.cache=e}},F0={enabled:!1},Ct=new fe("F_CACHE_OPTIONS",{providedIn:"root",factory:()=>ue({},F0)});var mc=class{id;nodeId;kind;element;static fToken=Symbol("RegisterFCacheConnectorRequest");constructor(i,e,n,o){this.id=i,this.nodeId=e,this.kind=n,this.element=o}},xt=(()=>{class t{nodeEntries=new Map;nodeIdByElement=new WeakMap;connectorEntries=new Map;connectorKeysByNodeId=new Map;connectorKeyByElement=new WeakMap;static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),cf=class{key;id;kind;nodeId;element;rect;constructor(i,e,n,o,r,s){this.key=i,this.id=e,this.kind=n,this.nodeId=o,this.element=r,this.rect=s}},ci=class{static build(i,e){return`${i}:${e}`}},df=class{id;element;reference;rect;constructor(i,e,n,o){this.id=i,this.element=e,this.reference=n,this.rect=o}},Rn=class{nodeId;reason;static fToken=Symbol("InvalidateFCacheNodeRequest");constructor(i,e="manual"){this.nodeId=i,this.reason=e}},A0=(()=>{let t=class nr{_store=d(xt);_options=d(Ct);handle({nodeId:e,reason:n}){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 s of r){let a=this._store.connectorEntries.get(s);a&&(a.rect=void 0)}}static \u0275fac=function(n){return new(n||nr)};static \u0275prov=g({token:nr,factory:nr.\u0275fac})};return t=C([x(Rn)],t),t})(),_c=class{id;element;reference;static fToken=Symbol("RegisterFCacheNodeRequest");constructor(i,e,n){this.id=i,this.element=e,this.reference=n}},L0=(()=>{let t=class ir{_store=d(xt);_options=d(Ct);handle({id:e,element:n,reference:o}){if(!this._options.enabled)return;let r=new df(e,n,o);this._store.nodeEntries.set(e,r),this._store.nodeIdByElement.set(n,e),this._store.connectorKeysByNodeId.set(e,this._store.connectorKeysByNodeId.get(e)??new Set)}static \u0275fac=function(n){return new(n||ir)};static \u0275prov=g({token:ir,factory:ir.\u0275fac})};return t=C([x(_c)],t),t})(),gc=class{id;static fToken=Symbol("UnregisterFCacheNodeRequest");constructor(i){this.id=i}},B0=(()=>{let t=class or{_store=d(xt);_mediator=d(R);_options=d(Ct);handle({id:e}){if(!this._options.enabled)return;let n=this._store.nodeEntries.get(e);if(!n)return;this._store.nodeEntries.delete(e),this._store.nodeIdByElement.delete(n.element);let o=Array.from(this._store.connectorKeysByNodeId.get(e)??[]);for(let r of o){let s=this._store.connectorEntries.get(r);s&&this._mediator.execute(new di(s.id,s.kind))}this._store.connectorKeysByNodeId.delete(e)}static \u0275fac=function(n){return new(n||or)};static \u0275prov=g({token:or,factory:or.\u0275fac})};return t=C([x(gc)],t),t})(),z0=(()=>{let t=class rr{_store=d(xt);_mediator=d(R);_options=d(Ct);handle({id:e,nodeId:n,kind:o,element:r}){if(!this._options.enabled)return;let s=ci.build(e,o),a=this._store.connectorEntries.get(s);a&&(this._detachConnectorFromNode(a.key,a.nodeId),this._store.connectorKeyByElement.delete(a.element));let l=new cf(s,e,o,n,r);this._store.connectorEntries.set(s,l),this._store.connectorKeyByElement.set(r,s);let h=this._store.connectorKeysByNodeId.get(n)??new Set;h.add(s),this._store.connectorKeysByNodeId.set(n,h),this._mediator.execute(new Rn(n,"connector-registered"))}_detachConnectorFromNode(e,n){let o=this._store.connectorKeysByNodeId.get(n);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||rr)};static \u0275prov=g({token:rr,factory:rr.\u0275fac})};return t=C([x(mc)],t),t})(),di=class{connectorId;kind;static fToken=Symbol("UnregisterFCacheConnectorRequest");constructor(i,e){this.connectorId=i,this.kind=e}},V0=(()=>{let t=class sr{_store=d(xt);_mediator=d(R);_options=d(Ct);handle({connectorId:e,kind:n}){if(!this._options.enabled)return;let o=ci.build(e,n),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 Rn(r.nodeId,"connector-unregistered")))}_detachConnectorFromNode(e,n){let o=this._store.connectorKeysByNodeId.get(n);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||sr)};static \u0275prov=g({token:sr,factory:sr.\u0275fac})};return t=C([x(di)],t),t})(),Nn=class{element;static fToken=Symbol("GetCachedFCacheRectRequest");constructor(i){this.element=i}},G0=(()=>{let t=class ar{_store=d(xt);_options=d(Ct);handle({element:e}){if(!this._options.enabled)return;let n=this._store.nodeIdByElement.get(e);if(n){let r=this._store.nodeEntries.get(n)?.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(n){return new(n||ar)};static \u0275prov=g({token:ar,factory:ar.\u0275fac})};return t=C([x(Nn)],t),t})(),on=class{connectorId;kind;rect;static fToken=Symbol("SetFCacheConnectorRectRequest");constructor(i,e,n){this.connectorId=i,this.kind=e,this.rect=n}},H0=(()=>{let t=class cr{_store=d(xt);_options=d(Ct);handle({connectorId:e,kind:n,rect:o}){if(!this._options.enabled)return;let r=ci.build(e,n),s=this._store.connectorEntries.get(r);s&&(s.rect=De.fromRoundedRect(o))}static \u0275fac=function(n){return new(n||cr)};static \u0275prov=g({token:cr,factory:cr.\u0275fac})};return t=C([x(on)],t),t})(),rn=class{nodeId;rect;static fToken=Symbol("SetFCacheNodeRectRequest");constructor(i,e){this.nodeId=i,this.rect=e}},j0=(()=>{let t=class dr{_store=d(xt);_options=d(Ct);handle({nodeId:e,rect:n}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;let r=o.rect;o.rect=G.initialize(n.x,n.y,n.width,n.height),r&&this._updateConnectorRectsByNodeRect(e,r,o.rect)}_updateConnectorRectsByNodeRect(e,n,o){let r=this._store.connectorKeysByNodeId.get(e);if(!r?.size)return;let s=o.x-n.x,a=o.y-n.y,l=n.width!==0,h=n.height!==0,_=l?o.width/n.width:1,v=h?o.height/n.height:1;for(let b of r){let I=this._store.connectorEntries.get(b);if(!I?.rect)continue;let N=I.rect,D=N.gravityCenter,M=l?o.x+(D.x-n.x)*_:D.x+s,k=h?o.y+(D.y-n.y)*v:D.y+a;I.rect=new De(M-N.width/2,k-N.height/2,N.width,N.height,N.radius1,N.radius2,N.radius3,N.radius4)}}static \u0275fac=function(n){return new(n||dr)};static \u0275prov=g({token:dr,factory:dr.\u0275fac})};return t=C([x(rn)],t),t})(),li=class{element;rect;static fToken=Symbol("UpdateFCacheRectByElementRequest");constructor(i,e){this.element=i,this.rect=e}},U0=(()=>{let t=class lr{_store=d(xt);_options=d(Ct);handle({element:e,rect:n}){if(!this._options.enabled)return;let o=this._store.nodeIdByElement.get(e);if(o){let a=this._store.nodeEntries.get(o);a&&(a.rect=n);return}let r=this._store.connectorKeyByElement.get(e);if(!r)return;let s=this._store.connectorEntries.get(r);s&&(s.rect=n)}static \u0275fac=function(n){return new(n||lr)};static \u0275prov=g({token:lr,factory:lr.\u0275fac})};return t=C([x(li)],t),t})(),$0=[xt,L0,B0,A0,z0,V0,G0,j0,H0,U0];function Un(t,i,e){return i?X.fromPoint(t).elementTransform(i).sub(e.scaledPosition).sub(e.position).div(e.scale):X.fromPoint(t)}function jp(){return{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}}function On(t){return t?`${t}`:void 0}var W0=(()=>{let t=class ur{_store=d(T);_mediator=d(R);_browser=d(ke);get _transform(){return this._store.transform}handle({element:e,cache:n}){let o=this._mediator.execute(new Nn(e));if(o&&n)return o;let r=this._getElementRoundedRect(e),s=this._normalizePosition(r),a=this._unscaleSize(r),l=this._getUnscaledRect(s,a,r),h=this._getOffsetSize(e,a),_=De.fromCenter(l,h.width,h.height);return this._mediator.execute(new li(e,_)),_}_getElementRoundedRect(e){return this._getRoundedRect(G.fromElement(e),e,this._getComputedStyle(e))}_getRoundedRect(e,n,o){let[r,s,a,l]=this._normalizeCircularBorderRadii(e.width,e.height,[this._getSystemRadius(o.borderTopLeftRadius,n,o.fontSize),this._getSystemRadius(o.borderTopRightRadius,n,o.fontSize),this._getSystemRadius(o.borderBottomRightRadius,n,o.fontSize),this._getSystemRadius(o.borderBottomLeftRadius,n,o.fontSize)]);return new De(e.x,e.y,e.width,e.height,r,s,a,l)}_getComputedStyle(e){return this._browser.window.getComputedStyle(e)}_toPixels(e,n,o){return this._browser.toPixels(e,n.clientWidth,n.clientHeight,o)||0}_getSystemRadius(e,n,o){return this._toPixels(e,n,o)*this._transform.scale}_normalizeCircularBorderRadii(e,n,o){let[r,s,a,l]=o.map(_=>Math.max(0,_)),h=Math.min(1,this._getRadiusScaleFactor(e,r+s),this._getRadiusScaleFactor(n,s+a),this._getRadiusScaleFactor(e,a+l),this._getRadiusScaleFactor(n,l+r));return[r*h,s*h,a*h,l*h]}_getRadiusScaleFactor(e,n){return n<=0?1:e<=0?0:e/n}_normalizePosition(e){return Un(e,this._store.flowHost,this._transform)}_unscaleSize(e){return ht.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n,o){return new De(e.x,e.y,n.width,n.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,n){return ht.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||ur)};static \u0275prov=g({token:ur,factory:ur.\u0275fac})};return t=C([x(zt)],t),t})(),yc=class{connector;cache;static fToken=Symbol("ResolveConnectionEndpointRectRequest");constructor(i,e){this.connector=i,this.cache=e}},q0=(()=>{let t=class fr{_mediator=d(R);handle({connector:e,cache:n}){let o=this._buildCacheKey(e),r=n.get(o)??this._calculateRect(e);return n.set(o,r),r}_buildCacheKey(e){return`${e.kind}::${e.fId()}`}_calculateRect(e){return this._mediator.execute(new zt(e.hostElement))}static \u0275fac=function(n){return new(n||fr)};static \u0275prov=g({token:fr,factory:fr.\u0275fac})};return t=C([x(yc)],t),t})(),vc=class{connection;static fToken=Symbol("ResolveConnectionEndpointsRequest");constructor(i){this.connection=i}},X0=(()=>{let t=class hr{_store=d(T);handle({connection:e}){let n=this._store.outputs.get(e.fOutputId()),o=this._store.inputs.get(e.fInputId());return!n||!o?null:{source:n,target:o}}static \u0275fac=function(n){return new(n||hr)};static \u0275prov=g({token:hr,factory:hr.\u0275fac})};return t=C([x(vc)],t),t})(),ui=class{connection;cache;static fToken=Symbol("ResolveConnectionGeometryRequest");constructor(i,e){this.connection=i,this.cache=e}},K0=(()=>{let t=class pr{_mediator=d(R);handle({connection:e,cache:n}){let o=this._resolveConnectionEndpoints(e);return o?mu(ue({},o),{sourceRect:this._resolveEndpointRect(o.source,n),targetRect:this._resolveEndpointRect(o.target,n)}):null}_resolveConnectionEndpoints(e){return this._mediator.execute(new vc(e))}_resolveEndpointRect(e,n){return this._mediator.execute(new yc(e,n))}static \u0275fac=function(n){return new(n||pr)};static \u0275prov=g({token:pr,factory:pr.\u0275fac})};return t=C([x(ui)],t),t})(),Te=class{element;static fToken=Symbol("GetNormalizedElementRectRequest");constructor(i){this.element=i}},Y0=(()=>{let t=class mr{_store=d(T);_mediator=d(R);get _transform(){return this._store.transform}handle({element:e}){let n=this._mediator.execute(new Nn(e));if(n)return n;let o=G.fromElement(e),r=this._normalizePosition(o),s=this._unscaleSize(o),a=this._getUnscaledRect(r,s),l=this._getOffsetSize(e,s),h=this._fromCenter(a,l.width,l.height);return this._mediator.execute(new li(e,h)),h}_fromCenter(e,n,o){return G.initialize(e.gravityCenter.x-n/2,e.gravityCenter.y-o/2,n,o)}_normalizePosition(e){return Un(e,this._store.flowHost,this._transform)}_unscaleSize(e){return ht.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n){return new De(e.x,e.y,n.width,n.height)}_getOffsetSize(e,n){return ht.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||mr)};static \u0275prov=g({token:mr,factory:mr.\u0275fac})};return t=C([x(Te)],t),t})(),Et=class{connector;static fToken=Symbol("ResolveConnectionEndpointRotationContextRequest");constructor(i){this.connector=i}},Z0=(()=>{let t=class _r{_store=d(T);_mediator=d(R);handle({connector:e}){if(!e)return;let n=this._store.nodes.get(e.fNodeId);if(!n||!n._rotate)return;let o=this._mediator.execute(new Te(n.hostElement));return{rotationDeg:n._rotate,pivot:o.gravityCenter}}static \u0275fac=function(n){return new(n||_r)};static \u0275prov=g({token:_r,factory:_r.\u0275fac})};return t=C([x(Et)],t),t})(),Cc=class{connection;geometry;static fToken=Symbol("BuildConnectionLineRequest");constructor(i,e){this.connection=i,this.geometry=e}},Q0=(()=>{let t=class gr{_mediator=d(R);_connectionBehaviour=d(jn);handle({connection:e,geometry:n}){return this._connectionBehaviour.handle(new mt(n.sourceRect,n.targetRect,e,n.source.fConnectableSide,n.target.fConnectableSide,this._resolveRotationContext(n.source),this._resolveRotationContext(n.target)))}_resolveRotationContext(e){return this._mediator.execute(new Et(e))}static \u0275fac=function(n){return new(n||gr)};static \u0275prov=g({token:gr,factory:gr.\u0275fac})};return t=C([x(Cc)],t),t})(),fi=class{connection;source;target;line;static fToken=Symbol("RenderConnectionWithLineRequest");constructor(i,e,n,o){this.connection=i,this.source=e,this.target=n,this.line=o}},J0=(()=>{let t=class yr{_mediator=d(R);handle({connection:e,source:n,target:o,line:r}){this._mediator.execute(new pc(n,o)),this._mediator.execute(new hc(e,r))}static \u0275fac=function(n){return new(n||yr)};static \u0275prov=g({token:yr,factory:yr.\u0275fac})};return t=C([x(fi)],t),t})(),hi=class{connection;geometry;static fToken=Symbol("RenderConnectionFromGeometryRequest");constructor(i,e){this.connection=i,this.geometry=e}},ey=(()=>{let t=class vr{_mediator=d(R);handle({connection:e,geometry:n}){let o=this._mediator.execute(new Cc(e,n));this._mediator.execute(new fi(e,n.source,n.target,o))}static \u0275fac=function(n){return new(n||vr)};static \u0275prov=g({token:vr,factory:vr.\u0275fac})};return t=C([x(hi)],t),t})(),xc=class{connection;cache;static fToken=Symbol("RenderConnectionRequest");constructor(i,e){this.connection=i,this.cache=e}},ty=(()=>{let t=class Cr{_mediator=d(R);handle({connection:e,cache:n}){let o=this._mediator.execute(new ui(e,n));o&&this._mediator.execute(new hi(e,o))}static \u0275fac=function(n){return new(n||Cr)};static \u0275prov=g({token:Cr,factory:Cr.\u0275fac})};return t=C([x(xc)],t),t})(),sn=class{session;static fToken=Symbol("IsConnectionRedrawCurrentRequest");constructor(i){this.session=i}},ny=(()=>{let t=class xr{_store=d(T);_state=d(El);handle({session:e}){return e.renderTicket===this._state.renderTicket&&e.nodesRevision===this._store.nodesRevision}static \u0275fac=function(n){return new(n||xr)};static \u0275prov=g({token:xr,factory:xr.\u0275fac})};return t=C([x(sn)],t),t})(),pi=class{session;static fToken=Symbol("CompleteConnectionRedrawRequest");constructor(i){this.session=i}},iy=(()=>{let t=class br{_mediator=d(R);_store=d(T);handle({session:e}){this._mediator.execute(new sn(e))&&this._store.completeConnectionsRender(e.connectionsRevision,e.nodesRevision)}static \u0275fac=function(n){return new(n||br)};static \u0275prov=g({token:br,factory:br.\u0275fac})};return t=C([x(pi)],t),t})(),bc=class{batchItem;result;static fToken=Symbol("ApplyConnectionWorkerResultRequest");constructor(i,e){this.batchItem=i,this.result=e}},oy=(()=>{let t=class wr{_mediator=d(R);handle({batchItem:e,result:n}){if(e){if(!this._isSupportedWorkerResult(n)){this._fallbackToMainThread(e);return}try{e.connection._applyResolvedSidesToConnection(n.sourceSide,n.targetSide),this._mediator.execute(new fi(e.connection,e.geometry.source,e.geometry.target,n.line))}catch{this._fallbackToMainThread(e)}}}_fallbackToMainThread(e){this._mediator.execute(new hi(e.connection,e.geometry))}_isSupportedWorkerResult(e){return!!(e?.supported&&e.sourceSide&&e.targetSide&&e.line)}static \u0275fac=function(n){return new(n||wr)};static \u0275prov=g({token:wr,factory:wr.\u0275fac})};return t=C([x(bc)],t),t})(),Ft=class{connections;cache;startIndex;session;batchItems;workerResults;static fToken=Symbol("RunConnectionRedrawSliceRequest");constructor(i,e,n,o,r,s){this.connections=i,this.cache=e,this.startIndex=n,this.session=o,this.batchItems=r,this.workerResults=s}},ry=500,sy=6,ay=(()=>{let t=class Sr{_mediator=d(R);_browser=d(ke);handle({connections:e,cache:n,startIndex:o,session:r,batchItems:s,workerResults:a}){if(!this._isCurrent(r))return;let l=this._now(),h=o,_=0;for(;h<e.length&&_<ry&&this._isWithinSliceBudget(l);){let v=e[h];if(s?this._mediator.execute(new bc(s[h]??null,a?.[h])):this._mediator.execute(new xc(v,n)),h++,_++,!this._isCurrent(r))return}if(h>=e.length){this._mediator.execute(new pi(r));return}this._requestAnimationFrame(()=>this._mediator.execute(new Ft(e,n,h,r,s,a)))}_isCurrent(e){return this._mediator.execute(new sn(e))}_requestAnimationFrame(e){let n=this._browser.document.defaultView;if(!n){e();return}n.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<sy:!0}static \u0275fac=function(n){return new(n||Sr)};static \u0275prov=g({token:Sr,factory:Sr.\u0275fac})};return t=C([x(Ft)],t),t})(),wc=class{static fToken=Symbol("StartConnectionRedrawRequest")},cy=(()=>{let t=class Ir{_store=d(T);_state=d(El);handle(e){return this._state.resetConnectedConnectors(),{renderTicket:this._state.beginRender(),connectionsRevision:this._store.connectionsRevision,nodesRevision:this._store.nodesRevision}}static \u0275fac=function(n){return new(n||Ir)};static \u0275prov=g({token:Ir,factory:Ir.\u0275fac})};return t=C([x(wc)],t),t})(),mi=class{static fToken=Symbol("RedrawConnectionsRequest")},Sc=class{connectionCount;static fToken=Symbol("ShouldUseConnectionWorkerRequest");constructor(i){this.connectionCount=i}},_i=class{static fToken=Symbol("IsConnectionWorkerEnabledRequest")},dy=(()=>{let t=class Tr{_browser=d(ke);_state=d(un);handle(e){if(this._state.isDisabled||!this._isWorkerAvailable())return!1;let n=this._browser.document.defaultView;return Vp(n)}_isWorkerAvailable(){return this._browser.isBrowser()}static \u0275fac=function(n){return new(n||Tr)};static \u0275prov=g({token:Tr,factory:Tr.\u0275fac})};return t=C([x(_i)],t),t})(),ly=(()=>{let t=class Er{_mediator=d(R);handle({connectionCount:e}){return e>0&&this._mediator.execute(new _i)}static \u0275fac=function(n){return new(n||Er)};static \u0275prov=g({token:Er,factory:Er.\u0275fac})};return t=C([x(Sc)],t),t})(),Ic=class{connection;geometry;originalIndex;static fToken=Symbol("BuildConnectionWorkerPayloadItemRequest");constructor(i,e,n){this.connection=i,this.geometry=e,this.originalIndex=n}},uy=(()=>{let t=class Pr{_store=d(T);handle({connection:e,geometry:n,originalIndex:o}){let{source:r,target:s,sourceRect:a,targetRect:l}=n;return{originalIndex:o,behavior:e.fBehavior,outputSide:e.fOutputSide(),inputSide:e.fInputSide(),sourceConnectableSide:r.fConnectableSide,targetConnectableSide:s.fConnectableSide,sourceRotation:this._store.nodes.get(r.fNodeId)?._rotate||0,targetRotation:this._store.nodes.get(s.fNodeId)?._rotate||0,sourceRect:{x:a.x,y:a.y,width:a.width,height:a.height,radius1:a.radius1,radius2:a.radius2,radius3:a.radius3,radius4:a.radius4},targetRect:{x:l.x,y:l.y,width:l.width,height:l.height,radius1:l.radius1,radius2:l.radius2,radius3:l.radius3,radius4:l.radius4}}}static \u0275fac=function(n){return new(n||Pr)};static \u0275prov=g({token:Pr,factory:Pr.\u0275fac})};return t=C([x(Ic)],t),t})(),Tc=class{connections;cache;static fToken=Symbol("BuildConnectionWorkerBatchRequest");constructor(i,e){this.connections=i,this.cache=e}},fy=(()=>{let t=class Mr{_mediator=d(R);handle({connections:e,cache:n}){let o=new Array(e.length),r=[];for(let s=0;s<e.length;s++){let a=this._buildBatchItem(e[s],n,s);o[s]=a,a&&r.push(a.payload)}return{items:o,payload:r}}_buildBatchItem(e,n,o){let r=this._mediator.execute(new ui(e,n));return r?{connection:e,geometry:r,payload:this._mediator.execute(new Ic(e,r,o))}:null}static \u0275fac=function(n){return new(n||Mr)};static \u0275prov=g({token:Mr,factory:Mr.\u0275fac})};return t=C([x(Tc)],t),t})(),Ec=class{error;static fToken=Symbol("DisableConnectionWorkerRequest");constructor(i){this.error=i}},gi=class{error;static fToken=Symbol("ResetConnectionWorkerRuntimeRequest");constructor(i){this.error=i}},hy=(()=>{let t=class Dr{_state=d(un);handle({error:e}){this._state.resetRuntime(e)}static \u0275fac=function(n){return new(n||Dr)};static \u0275prov=g({token:Dr,factory:Dr.\u0275fac})};return t=C([x(gi)],t),t})(),py=(()=>{let t=class kr{_state=d(un);_mediator=d(R);handle({error:e}){this._state.isDisabled=!0,this._mediator.execute(new gi(e))}static \u0275fac=function(n){return new(n||kr)};static \u0275prov=g({token:kr,factory:kr.\u0275fac})};return t=C([x(Ec)],t),t})(),Pc=class{message;static fToken=Symbol("HandleConnectionWorkerMessageRequest");constructor(i){this.message=i}},my=(()=>{let t=class Rr{_state=d(un);handle({message:e}){if(!e||typeof e.requestId!="number")return;let n=this._state.pending.get(e.requestId);if(n){if(this._state.pending.delete(e.requestId),e.error){n.reject(new Error(e.error));return}n.resolve(e.results??[])}}static \u0275fac=function(n){return new(n||Rr)};static \u0275prov=g({token:Rr,factory:Rr.\u0275fac})};return t=C([x(Pc)],t),t})(),Mc=class{static fToken=Symbol("EnsureConnectionWorkerRequest")},_y=(()=>{let t=class Nr{_browser=d(ke);_state=d(un);_mediator=d(R);handle(e){if(this._state.worker)return this._state.worker;let n=this._browser.document.defaultView;if(!Vp(n))return null;let o=Gp(n);if(!o)return null;let r=R0(o);try{let s=new o.workerCtor(r,{name:"f-flow-connection-worker"});return s.onmessage=a=>{this._mediator.execute(new Pc(a.data))},s.onerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker runtime error."))},s.onmessageerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker message deserialization error."))},this._state.workerUrl=r,this._state.worker=s,s}catch(s){return Hp(r,o.urlApi),this._disableWorker(s instanceof Error?s:new Error("Connection worker initialization failed.")),null}}_disableWorker(e){this._mediator.execute(new Ec(e))}_resetWorkerAfterRuntimeError(e){this._mediator.execute(new gi(e))}static \u0275fac=function(n){return new(n||Nr)};static \u0275prov=g({token:Nr,factory:Nr.\u0275fac})};return t=C([x(Mc)],t),t})(),Dc=class{payload;static fToken=Symbol("RunConnectionWorkerRequest");constructor(i){this.payload=i}},gy=(()=>{let t=class Or{_state=d(un);_mediator=d(R);handle({payload:e}){if(!e.length)return Promise.resolve([]);if(!this._mediator.execute(new _i))return Promise.reject(new Error("Connection worker is disabled."));this._interruptPendingRequests();let n=this._mediator.execute(new Mc);if(!n)return Promise.reject(new Error("Unable to initialize connection worker."));let o=++this._state.nextRequestId;return new Promise((r,s)=>{this._state.pending.set(o,{resolve:r,reject:s});try{n.postMessage({requestId:o,items:e})}catch(a){this._state.pending.delete(o),s(a instanceof Error?a: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(n=>n.reject(e)),this._state.pending.clear()}static \u0275fac=function(n){return new(n||Or)};static \u0275prov=g({token:Or,factory:Or.\u0275fac})};return t=C([x(Dc)],t),t})(),kc=class{batch;static fToken=Symbol("RunConnectionWorkerBatchRequest");constructor(i){this.batch=i}},yy=(()=>{let t=class Fr{_mediator=d(R);handle({batch:e}){return e.payload.length?this._mediator.execute(new Dc(e.payload)):Promise.resolve([])}static \u0275fac=function(n){return new(n||Fr)};static \u0275prov=g({token:Fr,factory:Fr.\u0275fac})};return t=C([x(kc)],t),t})(),Rc=class{connections;cache;session;static fToken=Symbol("StartConnectionWorkerRedrawRequest");constructor(i,e,n){this.connections=i,this.cache=e,this.session=n}},vy=(()=>{let t=class Ar{_mediator=d(R);handle({connections:e,cache:n,session:o}){let r=this._mediator.execute(new Tc(e,n));if(!r.payload.length){this._mediator.execute(new Ft(e,n,0,o,r.items));return}this._mediator.execute(new kc(r)).then(s=>{this._mediator.execute(new sn(o))&&this._mediator.execute(new Ft(e,n,0,o,r.items,this._alignWorkerResults(s,e.length)))}).catch(()=>{this._mediator.execute(new sn(o))&&this._mediator.execute(new Ft(e,n,0,o,r.items))})}_alignWorkerResults(e,n){let o=new Array(n);for(let r of e){let s=r.originalIndex;s<0||s>=n||(o[s]=r)}return o}static \u0275fac=function(n){return new(n||Ar)};static \u0275prov=g({token:Ar,factory:Ar.\u0275fac})};return t=C([x(Rc)],t),t})(),Cy=(()=>{let t=class Lr{_mediator=d(R);_store=d(T);handle(e){let n=this._mediator.execute(new wc);this._createMarkersForCreate(),this._createMarkersForSnap();let o=[...this._store.connections.getAll()],r=new Map;if(!o.length){this._mediator.execute(new pi(n));return}this._shouldUseConnectionWorker(o.length)?this._redrawUsingWorker(o,r,n):this._redrawWithoutWorker(o,r,n)}_createMarkersForCreate(){let e=this._store.connections.getForCreate();e&&this._mediator.execute(new kn(e))}_createMarkersForSnap(){let e=this._store.connections.getForSnap();e&&this._mediator.execute(new kn(e))}_shouldUseConnectionWorker(e){return this._mediator.execute(new Sc(e))}_redrawUsingWorker(e,n,o){this._mediator.execute(new Rc(e,n,o))}_redrawWithoutWorker(e,n,o){this._mediator.execute(new Ft(e,n,0,o))}static \u0275fac=function(n){return new(n||Lr)};static \u0275prov=g({token:Lr,factory:Lr.\u0275fac})};return t=C([x(mi)],t),t})(),lf=class{static fToken=Symbol("RemoveConnectionForCreateFromStoreRequest")},xy=(()=>{let t=class Br{_store=d(T);handle(e){this._store.connections.removeInstanceForCreate()}static \u0275fac=function(n){return new(n||Br)};static \u0275prov=g({token:Br,factory:Br.\u0275fac})};return t=C([x(lf)],t),t})(),Nc=class{connection;static fToken=Symbol("RemoveConnectionFromStoreRequest");constructor(i){this.connection=i}},by=(()=>{let t=class zr{_store=d(T);handle({connection:e}){this._store.connections.remove(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||zr)};static \u0275prov=g({token:zr,factory:zr.\u0275fac})};return t=C([x(Nc)],t),t})(),uf=class{instance;static fToken=Symbol("RemoveConnectionMarkerFromStoreRequest");constructor(i){this.instance=i}},wy=(()=>{let t=class Vr{_store=d(T);handle({instance:e}){this._store.connectionMarkers.remove(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Vr)};static \u0275prov=g({token:Vr,factory:Vr.\u0275fac})};return t=C([x(uf)],t),t})(),ff=class{waypointIndex;connectionId;static fToken=Symbol("RemoveConnectionWaypointRequest");constructor(i,e){this.waypointIndex=i,this.connectionId=e}},Oc=class{static fToken=Symbol("EmitEndDragSequenceEventRequest")},Sy=(()=>{let t=class Gr{_store=d(T);_dragSession=d(Y);handle(e){this._store.flowHost.classList.remove(Ne.DRAG_AND_DROP.DRAGGING),this._dragSession.reset(),this._emitEvent()}_emitEvent(){this._store.fDraggable?.fDragEnded?.emit()}static \u0275fac=function(n){return new(n||Gr)};static \u0275prov=g({token:Gr,factory:Gr.\u0275fac})};return t=C([x(Oc)],t),t})(),Fc=class{static fToken=Symbol("EmitStartDragSequenceEventRequest")},Iy=(()=>{let t=class Hr{_mediator=d(R);_store=d(T);_dragContext=d(Y);handle(e){this._dragContext.draggableItems.length>0&&(this._store.flowHost.classList.add(Ne.DRAG_AND_DROP.DRAGGING),this._mediator.execute(new yi),this._emitDragStarted())}_emitDragStarted(){let e=this._dragContext.draggableItems[0].getEvent();this._store.fDraggable?.fDragStarted?.emit(new Gc(e.kind,e.data?ue({},e.data):void 0,e.fEventType))}static \u0275fac=function(n){return new(n||Hr)};static \u0275prov=g({token:Hr,factory:Hr.\u0275fac})};return t=C([x(Fc)],t),t})(),yi=class{static fToken=Symbol("EmitSelectionChangeEventRequest")},an=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(i,e){this._event=i,this._target=e}setTarget(i){this._target=i}preventDefault(){this.originalEvent.preventDefault()}get isEventInLockedContext(){return this.targetElement.closest("[fLockedContext]")!==null}},Ac=class extends an{constructor(i,e){super(i,e)}isMouseLeftButton(){return this.originalEvent.button===0}isMouseRightButton(){return this.originalEvent.buttons===2}getPosition(){return{x:this.originalEvent.clientX,y:this.originalEvent.clientY}}},hf=class extends an{constructor(i,e){super(i,e)}isMouseLeftButton(){let i=this.originalEvent;return i.pointerType==="mouse"&&i.button===0||i.pointerType==="touch"}isMouseRightButton(){let i=this.originalEvent;return i.pointerType==="mouse"&&i.button===2||i.pointerType==="touch"}getPosition(){let i=this.originalEvent;return{x:i.clientX,y:i.clientY}}getPointerType(){return this.originalEvent.pointerType}getPointerId(){return this.originalEvent.pointerId}},pf=class extends an{constructor(i){super(i)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let i=this.originalEvent.touches;return{x:i[0].clientX,y:i[0].clientY}}},mf=class extends an{constructor(i,e){super(i,e)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let i=this.originalEvent.targetTouches[0];return{x:i.clientX,y:i.clientY}}},he=(()=>{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})(),Ty=800,_f=class{_document=d(io);_ngZone=d(Qn,{optional:!0});_mouseListeners=he.emptyListener();_touchListeners=he.emptyListener();_startListeners=he.emptyListener();isSyntheticEvent(i){return!!this._lastTouchEventTime&&this._lastTouchEventTime+Ty>Date.now()}_lastTouchEventTime=0;isDragStarted=!1;_dragStartThreshold=3;_dragStartDelay=0;_dragStartTime=0;_dragStartPosition={x:0,y:0};_moveHandler=this._checkDragSequenceToStart;_pointerDownElement=null;_onMouseDown=i=>{let e=this.isSyntheticEvent(i),n=Py(i),o=new Ac(i);if(e||n||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,he.activeListener()),this._listen("mousemove",this._onMouseMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,he.activeCaptureListener())}),this._mouseListeners=()=>{this._unlisten("selectstart",this._onSelectStart,he.activeListener()),this._unlisten("mousemove",this._onMouseMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,he.activeCaptureListener())})};_onTouchDown=i=>{let e=My(i),n=new pf(i);if(e||this.disabled||this.isDragStarted)return;this._pointerDownElement=n.targetElement,this.onPointerDown(n)&&(this._dragStartTime=Date.now(),this._dragStartPosition=n.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,he.activeListener()),this._listen("touchmove",this._onTouchMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,he.activeCaptureListener())}),this._touchListeners=()=>{this._unlisten("selectstart",this._onSelectStart,he.activeListener()),this._unlisten("touchmove",this._onTouchMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,he.activeCaptureListener())})};_onSelectStart=i=>{this.onSelect(i)};_onMouseMove=i=>{this._moveHandler(new Ac(i))};_onTouchMove=i=>{this._moveHandler(new mf(i))};_checkDragSequenceToStart(i){let e=i.getPosition();if(!this.isDragStarted&&this._pointerDownElement){i.setTarget(this._pointerDownElement);let n=Math.abs(e.x-this._dragStartPosition.x),o=Math.abs(e.y-this._dragStartPosition.y);if(n+o>=this._dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._dragStartDelay)){this._endDragSequence();return}i.preventDefault(),this.prepareDragSequence(i),this.isDragStarted=!0,this._moveHandler=this.onPointerMove,Ey(i.originalEvent)&&(this._lastTouchEventTime=Date.now())}}}_onPointerUpEvent=i=>{this.isDragStarted&&this.onPointerUp(new hf(i)),this._endDragSequence()};_endDragSequence(){this.isDragStarted=!1,this._pointerDownElement=null,this._moveHandler=this._checkDragSequenceToStart,this._mouseListeners(),this._mouseListeners=he.emptyListener(),this._touchListeners(),this._touchListeners=he.emptyListener(),this.finalizeDragSequence()}subscribe(){this.unsubscribe(),this._ngZone?.runOutsideAngular(()=>{this._listen("mousedown",this._onMouseDown,he.activeListener()),this._listen("touchstart",this._onTouchDown,he.passiveListener())}),this._startListeners=()=>{this._unlisten("mousedown",this._onMouseDown,he.activeListener()),this._unlisten("touchstart",this._onTouchDown,he.passiveListener())}}unsubscribe(){this._startListeners(),this._startListeners=he.emptyListener(),this._touchListeners(),this._touchListeners=he.emptyListener(),this._mouseListeners(),this._mouseListeners=he.emptyListener()}_listen(i,e,n){this._document.addEventListener(i,e,n)}_unlisten(i,e,n){this._document.removeEventListener(i,e,n)}_preventDuringDrag=i=>{this.isDragStarted&&i.preventDefault()}};function Ey(t){return t.type[0]==="t"}function Py(t){return t.buttons===0||t.offsetX===0&&t.offsetY===0}function My(t){let i=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!!i&&i.identifier===-1&&(i.radiusX==null||i.radiusX===1)&&(i.radiusY==null||i.radiusY===1)}var gf=class extends an{_position;_isMouseLeftButton;_isMouseRightButton;constructor(i){super(i.originalEvent,i.targetElement),this._position=i.getPosition(),this._isMouseLeftButton=i.isMouseLeftButton(),this._isMouseRightButton=i.isMouseRightButton()}isMouseLeftButton(){return this._isMouseLeftButton}isMouseRightButton(){return this._isMouseRightButton}getPosition(){return ue({},this._position)}};function Dy(t){return new gf(t)}var Y=(()=>{class t{selectedItems=[];isSelectedChanged=!1;onPointerDownScale=1;onPointerDownPosition=new X(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 X(0,0),this.autoPanFrameId=null,this.lastPointerEvent=null,this.lastPointerPosition=null,this.isAutoPanCanvasMoved=!1}markSelectionAsChanged(){this.isSelectedChanged=!0}rememberPointerEvent(e){this.lastPointerEvent=Dy(e),this.lastPointerPosition=this.lastPointerEvent.getPosition()}isEmpty(){return!this.draggableItems.length}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),yf=class{nodeIds;groupIds;connectionIds;get fNodeIds(){return this.nodeIds}get fGroupIds(){return this.groupIds}get fConnectionIds(){return this.connectionIds}constructor(i,e,n){this.nodeIds=i,this.groupIds=e,this.connectionIds=n}},ky=(()=>{let t=class jr{_mediator=d(R);_store=d(T);_dragSession=d(Y);handle(e){this._dragSession.isSelectedChanged&&(this._emitSelectionChange(this._getSelection()),this._dragSession.isSelectedChanged=!1,this._mediator.execute(new At))}_getSelection(){return this._mediator.execute(new Gi)}_emitSelectionChange(e){this._store.fDraggable?.fSelectionChange.emit(new yf(e.fNodeIds,e.fGroupIds,e.fConnectionIds))}static \u0275fac=function(n){return new(n||jr)};static \u0275prov=g({token:jr,factory:jr.\u0275fac})};return t=C([x(yi)],t),t})(),vf=class{nodeOrGroup;static fToken=Symbol("GetNormalizedParentNodeRectRequest");constructor(i){this.nodeOrGroup=i}},Ry=(()=>{let t=class Ur{_store=d(T);_mediator=d(R);handle({nodeOrGroup:e}){let n=G.initialize(-1/0,-1/0,1/0,1/0),o=this._getNode(e.fParentId());return o&&(n=this._getParentRect(o)),n}_getNode(e){return this._store.nodes.get(e)}_getParentRect(e){let n=this._getNodeRect(e),o=this._getNodePadding(e,n);return G.initialize(n.x+o[0],n.y+o[1],n.width-o[0]-o[2],n.height-o[1]-o[3])}_getNodeRect(e){return this._mediator.execute(new Te(e.hostElement))}_getNodePadding(e,n){return this._mediator.execute(new dn(e,n))}static \u0275fac=function(n){return new(n||Ur)};static \u0275prov=g({token:Ur,factory:Ur.\u0275fac})};return t=C([x(vf)],t),t})(),Cf=class{fParentNodes;fDraggedNodes;static fToken=Symbol("IsArrayHasParentNodeRequest");constructor(i,e){this.fParentNodes=i,this.fDraggedNodes=e}},Ny=(()=>{let t=class $r{handle(e){return this._isParentNodeInArray(this._getParentNodeIds(e.fParentNodes),e.fDraggedNodes)}_getParentNodeIds(e){return e.map(n=>n.fId())}_isParentNodeInArray(e,n){return n.some(o=>e.includes(o.fId()))}static \u0275fac=function(n){return new(n||$r)};static \u0275prov=g({token:$r,factory:$r.\u0275fac})};return t=C([x(Cf)],t),t})(),xf=class{fNodeId;fConnectionIds;constructor(i,e){this.fNodeId=i,this.fConnectionIds=e}},Lc=class extends xf{nodeId;connectionIds;constructor(i,e){super(i,e),this.nodeId=i,this.connectionIds=e}},Bc=class{nodeOrGroup;static fToken=Symbol("DetectConnectionsUnderDragNodeRequest");constructor(i){this.nodeOrGroup=i}},Oy=(()=>{let t=class Wr{_mediator=d(R);_store=d(T);handle({nodeOrGroup:e}){let n=this._collectConnectableConnectorIds(e,"source"),o=this._collectConnectableConnectorIds(e,"target");if(!n.size||!o.size)return;let r=this._collectAttachedConnectionIds(n,o),s=this._collectConnectionsUnderNode(e),a=[];for(let l of s){let h=l.fId();r.has(h)||a.push(h)}a.length&&(this._store.fDraggable?.fNodeIntersectedWithConnections.emit(new Lc(e.fId(),a)),this._store.fDraggable?.fNodeConnectionsIntersection.emit(new Lc(e.fId(),a)))}_collectConnectableConnectorIds(e,n){let o=n==="source"?this._store.outputs.getAll():this._store.inputs.getAll(),r=new Set;for(let s of o)s.canBeConnected&&e.isContains(s.hostElement)&&r.add(s.fId());return r}_collectAttachedConnectionIds(e,n){let o=new Set;for(let r of this._store.connections.getAll())(e.has(r.fOutputId())||n.has(r.fInputId()))&&o.add(r.fId());return o}_collectConnectionsUnderNode(e){let n=this._mediator.execute(new zt(e.hostElement,!1)),o=[];for(let r of this._store.connections.getAll())this._hasIntersection(r,n)&&o.push(r);return o}_hasIntersection(e,n){return Sn.getRoundedRectIntersectionsWithSVGPath(e.fPath().hostElement,n).length>0}static \u0275fac=function(n){return new(n||Wr)};static \u0275prov=g({token:Wr,factory:Wr.\u0275fac})};return t=C([x(Bc)],t),t})(),Fy=[Iy,Sy,ky,Ry,Ny,Oy],Ay=new Set(["create-connection","reassign-connection","drag-node"]),Ly=new Set(["selection-area"]),By=new Set(["assign-to-container"]);function Up(t){let i=null;for(let e of t){if(By.has(e))continue;let n=Ay.has(e)?"rebase":Ly.has(e)?"direct":null;if(!n)return null;if(!i){i=n;continue}if(i!==n)return null}return i}function $p(t,i,e,n,o){return A.initialize(ap(t.x,i.left,i.right,e,n,o),ap(t.y,i.top,i.bottom,e,n,o))}function ap(t,i,e,n,o,r){let s=Math.max(0,n),a=Math.max(0,o);if(!s||!a)return 0;if(t<=i+s){let l=dp((i+s-t)/s,0,1);return cp(l,a,r)}if(t>=e-s){let l=dp((t-(e-s))/s,0,1);return-cp(l,a,r)}return 0}function zy(t,i,e){let n=e||1;return X.fromPoint(t).add(X.fromPoint(i).div(n))}function cp(t,i,e){return e?i*t:i}function dp(t,i,e){return Math.max(i,Math.min(e,t))}var zc=class{static fToken=Symbol("RunAutoPanFrameRequest")},Vt=class{static fToken=Symbol("StopAutoPanRequest")},Vy=(()=>{let t=class qr{_store=d(T);_dragContext=d(Y);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(n){return new(n||qr)};static \u0275prov=g({token:qr,factory:qr.\u0275fac})};return t=C([x(Vt)],t),t})(),vi=class{static fToken=Symbol("SyncAutoPanRequest")},Gy=(()=>{let t=class Xr{_mediator=d(R);_store=d(T);_dragContext=d(Y);handle(e){if(!this._canAutoPan()||!this._hasAutoPanDelta()){this._mediator.execute(new Vt);return}this._dragContext.autoPanFrameId===null&&(this._dragContext.autoPanFrameId=requestAnimationFrame(()=>{this._dragContext.autoPanFrameId=null,this._mediator.execute(new zc)}))}_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,n=this._store.fFlow?.hostElement;return!e||!n?A.initialize():$p(e,n.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_getAutoPanMode(){return Up(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(ye.AUTO_PAN)}static \u0275fac=function(n){return new(n||Xr)};static \u0275prov=g({token:Xr,factory:Xr.\u0275fac})};return t=C([x(vi)],t),t})(),Hy=(()=>{let t=class Kr{_mediator=d(R);_store=d(T);_dragContext=d(Y);handle(e){let n=this._getAutoPanMode();if(!this._canAutoPan(n)){this._mediator.execute(new Vt);return}let o=this._getAutoPanDelta();if(!o.x&&!o.y){this._mediator.execute(new Vt);return}this._applyCanvasDelta(o,n),this._replayLastPointerMove(),this._mediator.execute(new vi)}_applyCanvasDelta(e,n){let o=this._store.transform;n==="rebase"&&(this._dragContext.onPointerDownPosition=zy(this._dragContext.onPointerDownPosition,e,this._dragContext.onPointerDownScale||o.scale||1)),o.position=X.fromPoint(o.position).add(e),this._store.fCanvas?.redraw(),this._dragContext.isAutoPanCanvasMoved=!0}_replayLastPointerMove(){let e=this._dragContext.lastPointerEvent;if(!e)return;let n=this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition);this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(ue({},n),e)})}_getPointerPositionInCanvas(e){return X.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 Up(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,n=this._store.fFlow?.hostElement;return!e||!n?A.initialize():$p(e,n.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(ye.AUTO_PAN)}static \u0275fac=function(n){return new(n||Kr)};static \u0275prov=g({token:Kr,factory:Kr.\u0275fac})};return t=C([x(zc)],t),t})(),jy=[Gy,Hy,Vy],Vc=class{event;static fToken=Symbol("DragCanvasFinalizeRequest");constructor(i){this.event=i}},Gc=class{kind;data;fEventType;get fData(){return this.data}constructor(i,e,n){this.kind=i,this.data=e,this.fEventType=n??i}},Xe=class{data(){}_features=[];getEvent(){return new Gc(this.kind,this.data(),this.type)}attachFeature(i){this._features.push(i)}featuresPrepare(i){for(let e of this._features)e.onPrepare?.(i)}featuresMove(i,e){for(let n of this._features)n.onMove?.(i,e)}featuresFinalize(i,e){for(let n of this._features)n.onFinalize?.(i,e)}featuresEnd(i){for(let e of this._features)e.onEnd?.(i)}},Hc=class{_isConnected=!1;get isConnected(){return this._isConnected}toConnector=[];isSelfConnectable=!0;fConnectableSide=L.AUTO;userFConnectableSide=L.AUTO;isContains(i){return this.hostElement.contains(i)}setConnected(i){this._isConnected=!0,this.toConnector.push(i)}resetConnected(){this._isConnected=!1,this.toConnector=[]}},Uy=new fe("F_NODE_INPUT"),$y=(()=>{class t extends Hc{kind="input";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Ee({type:t,standalone:!1,features:[_e]})}return t})(),yt=(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})(yt||{});function Wy(t){return ii(t,".f-rotate-handle")}var Wp=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,selectors:[["","fDragHandle",""]],hostAttrs:[1,"f-drag-handle","f-component"],standalone:!1})}return t})(),Pl=new fe("F_NODE"),qy=Lp(class{hostElement;constructor(t){this.hostElement=t}}),jc=class extends qy{_injector=d(Ye);renderer=d(Th);browser=d(ke);stateChanges=new ct;_position=A.initialize();_rotate=0;_size;connectors=[];positionChanges(){me(()=>{let i=this.position();gt(()=>{A.isEqual(this._position,i)||(this._position=i,this.redraw(),this.refresh())})},{injector:this._injector})}sizeChanges(){me(()=>{let i=this.size();gt(()=>{this._isSizeEqual(i)||(this._size=i,this.redraw(),this.refresh())})},{injector:this._injector})}rotateChanges(){me(()=>{let i=this.rotate();gt(()=>{this._rotate!==i&&(this._rotate=i,this.redraw(),this.refresh())})},{injector:this._injector})}parentChanges(){me(()=>{this.fParentId(),this.fIncludePadding(),this.fAutoSizeToFitChildren(),gt(()=>this.refresh())},{injector:this._injector})}_isSizeEqual(i){return this._size?.width===i?.width&&this._size?.height===i?.height}isContains(i){return this.hostElement.contains(i)}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(i){this._position=i}updateRotate(i){this._rotate=i}updateSize(i){this._size=i}setClass(i){this.hostElement.classList.add(i)}removeClass(i){this.hostElement.classList.remove(i)}addConnector(i){this.connectors.push(i),this.refresh()}removeConnector(i){let e=this.connectors.indexOf(i);e!==-1&&this.connectors.splice(e,1),this.refresh()}},Xy=0,Ky=3,bf=(()=>{class t extends jc{_debounceTimer=null;_destroyRef=d(Ze);_mediator=d(R);fId=F(`f-group-${Xy++}`,{alias:"fGroupId"});fParentId=F(null,{alias:"fGroupParentId"});position=Kt(A.initialize(),{alias:"fGroupPosition"});size=F(void 0,{alias:"fGroupSize"});sizeChange=je({alias:"fGroupSizeChange"});rotate=Kt(0,{alias:"fGroupRotate"});fConnectOnNode=F(!0,{transform:xe});fMinimapClass=F([]);fDraggingDisabled=F(!1,{alias:"fGroupDraggingDisabled",transform:xe});fSelectionDisabled=F(!1,{alias:"fGroupSelectionDisabled",transform:xe});fIncludePadding=F(!0,{transform:xe});fAutoExpandOnChildHit=F(!1,{transform:xe});fAutoSizeToFitChildren=F(!1,{transform:xe});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Oi(this))}setStyle(e,n){this.renderer.setStyle(this.hostElement,e,n)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new At),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),Ky))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new An(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new Ai(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new Li(this))}static \u0275fac=function(n){return new(n||t)(yu(Se))};static \u0275dir=Ee({type:t,selectors:[["","fGroup",""]],hostAttrs:[1,"f-group","f-component"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("data-f-group-id",o.fId()),de("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:[Re([{provide:Pl,useExisting:t}]),_e]})}return t})(),lp=0,Yy=3,Ml=(()=>{class t extends jc{_debounceTimer=null;_destroyRef=d(Ze);_mediator=d(R);fId=F(`f-node-${lp++}`,{alias:"fNodeId",transform:e=>On(e)||`f-node-${lp++}`});fParentId=F(null,{alias:"fNodeParentId"});position=Kt(A.initialize(),{alias:"fNodePosition"});size=F(void 0,{alias:"fNodeSize"});sizeChange=je({alias:"fNodeSizeChange"});rotate=Kt(0,{alias:"fNodeRotate"});fConnectOnNode=F(!0,{transform:xe});fMinimapClass=F([]);fDraggingDisabled=F(!1,{alias:"fNodeDraggingDisabled",transform:xe});fSelectionDisabled=F(!1,{alias:"fNodeSelectionDisabled",transform:xe});fIncludePadding=F(!0,{transform:xe});fAutoExpandOnChildHit=F(!1,{transform:xe});fAutoSizeToFitChildren=F(!1,{transform:xe});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Oi(this))}setStyle(e,n){this.renderer.setStyle(this.hostElement,e,n)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new At),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),Yy))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new An(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new Ai(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new Li(this))}static \u0275fac=function(n){return new(n||t)(yu(Se))};static \u0275dir=Ee({type:t,selectors:[["","fNode",""]],hostAttrs:[1,"f-node","f-component"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("data-f-node-id",o.fId()),de("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:[Re([{provide:Pl,useExisting:t}]),_e]})}return t})();function Zy(t){return!!t.closest("[fNode]")}var up=0,qp=(()=>{class t extends $y{hostElement=d(Se).nativeElement;_mediator=d(R);_node=d(Pl);fId=F(`f-node-input-${up++}`,{alias:"fInputId",transform:e=>On(e)||`f-node-input-${up++}`});category=F(void 0,{alias:"fInputCategory",transform:On});multiple=F(!0,{alias:"fInputMultiple",transform:xe});disabled=F(!1,{alias:"fInputDisabled",transform:xe});userFConnectableSide=L.AUTO;get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new ki(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_CONNECTED,!0),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_CONNECTED,!1),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new Bi(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["","fNodeInput",""]],hostAttrs:[1,"f-component","f-node-input"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("data-f-input-id",o.fId()),de("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=>In(e,"fInputConnectableSide",L)]},exportAs:["fNodeInput"],standalone:!1,features:[Re([{provide:Uy,useExisting:t}]),_e,mn]})}return t})(),Qy=(()=>{class t extends Hc{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=ne(t)))(o||t)}})();static \u0275dir=Ee({type:t,standalone:!1,features:[_e]})}return t})();function Xp(t){return!!t.closest("[fNodeOutlet]")}var Jy=new fe("F_NODE_OUTPUT"),ev=(()=>{class t extends Qy{kind="output";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Ee({type:t,standalone:!1,features:[_e]})}return t})();function Kp(t){return!!t.closest("[fNodeOutput]")}var fp=0,Yp=(()=>{class t extends ev{hostElement=d(Se).nativeElement;_mediator=d(R);_node=d(Pl);fId=F(`f-node-output-${fp++}`,{alias:"fOutputId",transform:e=>On(e)||`f-node-output-${fp++}`});multiple=F(!1,{alias:"fOutputMultiple",transform:xe});disabled=F(!1,{alias:"fOutputDisabled",transform:xe});userFConnectableSide=L.AUTO;isSelfConnectable=!0;canBeConnectedInputs=[];get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new ki(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_CONNECTED,!0),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_CONNECTED,!1),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new Bi(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["","fNodeOutput",""]],hostAttrs:[1,"f-component","f-node-output"],hostVars:7,hostBindings:function(n,o){n&2&&(Z("data-f-output-id",o.fId()),de("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=>In(e,"fOutputConnectableSide",L)],isSelfConnectable:"isSelfConnectable",canBeConnectedInputs:[0,"fCanBeConnectedInputs","canBeConnectedInputs"]},exportAs:["fNodeOutput"],standalone:!1,features:[Re([{provide:Jy,useExisting:t}]),_e,mn]})}return t})();var Uc=class{event;static fToken=Symbol("CreateConnectionFinalizeRequest");constructor(i){this.event=i}},Ci=class{outlet;static fToken=Symbol("ResolveConnectableOutputForOutletRequest");constructor(i){this.outlet=i}},tv=(()=>{let t=class Yr{_store=d(T);handle({outlet:e}){let n=this._findOwnerNode(e);if(!n)throw new Error("The fOutlet must belong to an fNode");let o=this._findFirstConnectableOutputInNode(n);if(!o)throw new Error("Outlet requires at least one connectable output in the same node.");return o}_findOwnerNode(e){let n=e.hostElement;return this._store.nodes.getAll().find(o=>o.isContains(n))}_findFirstConnectableOutputInNode(e){return this._store.outputs.getAll().find(n=>e.isContains(n.hostElement)&&n.canBeConnected)}static \u0275fac=function(n){return new(n||Yr)};static \u0275prov=g({token:Yr,factory:Yr.\u0275fac})};return t=C([x(Ci)],t),t})(),wf=class{sourceId;targetId;dropPosition;fOutputId;fInputId;fDropPosition;constructor(i,e,n){this.sourceId=i,this.targetId=e,this.dropPosition=n,this.fOutputId=i,this.fInputId=e,this.fDropPosition=n}},$c=(()=>{class t extends Xe{type="create-connection";kind="create-connection";data(){return{fOutputOrOutletId:this._sourceRef.connector.fId()}}_result=d(Ht);_mediator=d(R);_connectionBehaviour=d(jn);_store=d(T);get _connection(){return this._store.connections.getForCreate()}get _snapConnection(){return this._store.connections.getForSnap()}_targets=[];_sourceRef;_pointerDown=new De;initialize(e,n){this._sourceRef=this._mediator.execute(new rt(e)),this._pointerDown=De.fromRect(G.initialize(n.x,n.y))}prepareDragSequence(){this._collectAndMarkTargets(),this._initSnapConnection(),this._initCreateConnection(),this._connection.show(),this.onPointerMove(A.initialize()),this._result.setData({toConnectorRect:this._pointerDown,canBeConnectedInputs:this._targets,fOutputId:this._sourceRef.connector.fId()})}_collectAndMarkTargets(){this._targets=this._mediator.execute(new Ni(this._sourceRef.connector,this._sourceRef.rect.gravityCenter)),this._mediator.execute(new zn(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 n=this._pointerDown.addPoint(e),o=this._findClosestTarget(n),r=o?.connector.fConnectableSide||L.TOP;this._drawCreateConnection(n,r);let s=this._snapConnection;if(!s)return;let a=o&&o.distance<s.fSnapThreshold?o:void 0;this._drawSnapConnection(a)}_findClosestTarget(e){return this._mediator.execute(new cn(e,this._targets))}_drawCreateConnection(e,n){let o=this._connectionBehaviour.handle(new mt(this._sourceRef.rect,e,this._connection,this._sourceRef.connector.fConnectableSide,n,this._resolveRotationContext(this._sourceRef.connector)));this._connection.setLine(o),this._connection.redraw()}_drawSnapConnection(e){let n=this._snapConnection;if(!n)return;if(!e){n.hide();return}let o=this._connectionBehaviour.handle(new mt(this._sourceRef.rect,e.rect,n,this._sourceRef.connector.fConnectableSide,e.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(e.connector)));n.show(),n.setLine(o),n.redraw()}onPointerUp(){this._connection.redraw(),this._connection.hide(),this._snapConnection?.hide(),this._mediator.execute(new Vn(this._targets.map(e=>e.connector)))}_resolveRotationContext(e){return this._mediator.execute(new Et(e))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),nv=(()=>{let t=class Zr{_result=d(Ht);_mediator=d(R);_store=d(T);_dragContext=d(Y);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 $c)}_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 Xp(e.hostElement)?this._mediator.execute(new Ci(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 wf(this._getTargetOutput(this._getOutput()||this._getOutlet()).fId(),this._getInputUnderPointer(e)?.fId(),e.getPosition()))}_getInputUnderPointer(e){return this._mediator.execute(new Ri(e.getPosition(),this._result.getData().canBeConnectedInputs))}static \u0275fac=function(n){return new(n||Zr)};static \u0275prov=g({token:Zr,factory:Zr.\u0275fac})};return t=C([x(Uc)],t),t})(),xi=class{eventPosition;source;static fToken=Symbol("CreateConnectionCreateDragHandlerRequest");constructor(i,e){this.eventPosition=i,this.source=e}},iv=(()=>{let t=class Qr{_store=d(T);_dragContext=d(Y);_dragInjector=d(Ve);get _transform(){return this._store.transform}handle({source:e,eventPosition:n}){this._dragContext.onPointerDownScale=this._transform.scale;let o=this._toFlowSpace(n);this._dragContext.onPointerDownPosition=o;let r=this._toCanvasSpace(o),s=this._dragInjector.get($c);s.initialize(e,r),this._dragContext.draggableItems=[s]}_toFlowSpace(e){return X.fromPoint(e).elementTransform(this._store.flowHost).div(this._transform.scale)}_toCanvasSpace(e){return X.fromPoint(e).mult(this._transform.scale).sub(this._transform.position).sub(this._transform.scaledPosition).div(this._transform.scale)}static \u0275fac=function(n){return new(n||Qr)};static \u0275prov=g({token:Qr,factory:Qr.\u0275fac})};return t=C([x(xi)],t),t})(),Wc=class{event;node;static fToken=Symbol("CreateConnectionFromOutletPreparationRequest");constructor(i,e){this.event=i,this.node=e}},ov=(()=>{let t=class Jr{_mediator=d(R);_store=d(T);handle({event:e,node:n}){let o=this._findOutlet(n);if(!o||(o.setOutputs(this._getOutputs(n)),!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(n=>e.isContains(n.hostElement))}_getOutputs(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement))}_resolveOutput(e){return this._mediator.execute(new Ci(e))}_startDrag(e,n){this._mediator.execute(new xi(e,n))}static \u0275fac=function(n){return new(n||Jr)};static \u0275prov=g({token:Jr,factory:Jr.\u0275fac})};return t=C([x(Wc)],t),t})(),qc=class{event;node;static fToken=Symbol("CreateConnectionFromOutputPreparationRequest");constructor(i,e){this.event=i,this.node=e}},rv=(()=>{let t=class es{_mediator=d(R);_store=d(T);handle({event:e,node:n}){if(!Kp(e.targetElement)||this._hasOutlet(n))return;let o=this._findOutput(e.targetElement);!o||!o.canBeConnected||this._startDrag(e.getPosition(),o)}_hasOutlet(e){return this._store.outlets.getAll().some(n=>e.isContains(n.hostElement))}_findOutput(e){return this._store.outputs.getAll().find(n=>n.hostElement.contains(e))}_startDrag(e,n){this._mediator.execute(new xi(e,n))}static \u0275fac=function(n){return new(n||es)};static \u0275prov=g({token:es,factory:es.\u0275fac})};return t=C([x(qc)],t),t})(),Xc=class{event;fTrigger;static fToken=Symbol("CreateConnectionPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},sv=(()=>{let t=class ts{_mediator=d(R);_store=d(T);_dragContext=d(Y);handle({event:e,fTrigger:n}){if(!this._isValidConditions()||!this._isValidTrigger(e,n))return;let o=Xp(e.targetElement),r=!o&&Kp(e.targetElement);if(!o&&!r)return;let s=this._findOwnerNode(e.targetElement);s&&(o?this._mediator.execute(new Wc(e,s)):this._mediator.execute(new qc(e,s)))}_findOwnerNode(e){return this._store.nodes.getAll().find(n=>n.isContains(e))}_isValidConditions(){return this._dragContext.isEmpty()&&!!this._store.connections.getForCreate()}_isValidTrigger(e,n){return dt(e.originalEvent,n)}static \u0275fac=function(n){return new(n||ts)};static \u0275prov=g({token:ts,factory:ts.\u0275fac})};return t=C([x(Xc)],t),t})(),Kc=class{event;static fToken=Symbol("ReassignConnectionFinalizeRequest");constructor(i){this.event=i}},Sf=class{connectionId;endpoint;previousSourceId;nextSourceId;previousTargetId;nextTargetId;dropPosition;isSourceReassign;isTargetReassign;oldSourceId;newSourceId;oldTargetId;newTargetId;dropPoint;constructor(i,e,n,o,r,s,a){this.connectionId=i,this.endpoint=e,this.previousSourceId=n,this.nextSourceId=o,this.previousTargetId=r,this.nextTargetId=s,this.dropPosition=a,this.isSourceReassign=e==="source",this.isTargetReassign=e==="target",this.oldSourceId=n,this.newSourceId=o,this.oldTargetId=r,this.newTargetId=s,this.dropPoint=a}},av=(()=>{let t=class ns{_dragResult=d(Ht);_mediator=d(R);_store=d(T);_dragContext=d(Y);get _dragDirective(){return this._store.fDraggable}handle({event:e}){let n=this._findReassignHandler();n&&(this._emitIfChanged(e),n.onPointerUp())}_findReassignHandler(){return this._dragContext.draggableItems.find(n=>n.getEvent().fEventType==="reassign-connection")}_emitIfChanged(e){let n=this._dragResult.getData(),o=this._findConnectableConnector(e,n.candidates);o&&!this._isReassignedToDifferentConnector(n,o)||this._dragDirective.fReassignConnection.emit(this._buildEvent(n,e,o))}_findConnectableConnector(e,n){return this._mediator.execute(new Ri(e.getPosition(),n))}_isReassignedToDifferentConnector(e,n){let o=e.connection;return e.draggedEnd==="target"?o.fInputId()!==n.fId():o.fOutputId()!==n.fId()}_buildEvent(e,n,o){let r=e.connection;return new Sf(r.fId(),e.draggedEnd,r.fOutputId(),e.draggedEnd==="source"?o?.fId():void 0,r.fInputId(),e.draggedEnd==="target"?o?.fId():void 0,n.getPosition())}static \u0275fac=function(n){return new(n||ns)};static \u0275prov=g({token:ns,factory:ns.\u0275fac})};return t=C([x(Kc)],t),t})(),Yc=class{event;fTrigger;static fToken=Symbol("ReassignConnectionPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}};function cv(t,i){return Zp(t,i)||dv(t,i)}function Zp(t,i){return t.fDragHandleEnd()?.point&&Qp(i,t.fDragHandleEnd().point)&&!t.fDraggingDisabled()}function dv(t,i){return!!t.fDragHandleStart()?.point&&Qp(i,t.fDragHandleStart().point)&&!t.fDraggingDisabled()&&t.fReassignableStart()}function Qp(t,i){return(t.x-i.x)**2+(t.y-i.y)**2<=8**2}function Jp(t,i){return t&&t.distance<i.fSnapThreshold?t:void 0}function Zc(t){return De.fromRect(G.initialize(t.x,t.y))}var If=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(i,e,n,o,r){this._mediator=i,this._behaviour=e,this._connection=n,this._sourceRef=o,this._targetRef=r,this._anchorRect=Zc(this._connection.line.point1)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new el(this._target,this._targetRef.rect.gravityCenter)),this._candidates.some(i=>i.connector.fId()===this._source.fId())||this._candidates.push(this._sourceRef),this._mediator.execute(new zn(this._candidates.map(i=>i.connector)))}setSnapConnection(i){this._snap=i,i&&(i.fInputId.set(this._connection.fInputId()),i.initialize())}onPointerMove(i){let e=this._anchorRect.addPoint(i),n=this._findClosest(e.gravityCenter),o=n?.connector.fConnectableSide??this._source.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(Jp(n,r))}_findClosest(i){return this._mediator.execute(new cn(i,this._candidates))}_draw(i,e){let n=this._behaviour.handle(new mt(i,this._targetRef.rect,this._connection,e,this._targetRef.connector.fConnectableSide,void 0,this._resolveRotationContext(this._targetRef.connector)));this._connection.setLine(n),this._connection.redraw()}_drawSnap(i){let e=this._snap;if(!e)return;if(!i){e.hide();return}let n=this._behaviour.handle(new mt(i.rect,this._targetRef.rect,e,i.connector.fConnectableSide,this._target.fConnectableSide,this._resolveRotationContext(i.connector),this._resolveRotationContext(this._targetRef.connector)));e.show(),e.setLine(n),e.redraw()}onPointerUp(){this._draw(this._anchorRect,this._sourceRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Vn(this._candidates.map(i=>i.connector)))}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},Tf=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(i,e,n,o,r){this._mediator=i,this._behaviour=e,this._connection=n,this._sourceRef=o,this._targetRef=r,this._anchorRect=Zc(this._connection.line.point2)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Ni(this._source,this._sourceRef.rect.gravityCenter));let i=this._connection.fInputId();i&&!this._candidates.some(e=>e.connector.fId()===i)&&this._candidates.push(this._targetRef),this._mediator.execute(new zn(this._candidates.map(e=>e.connector)))}setSnapConnection(i){this._snap=i,i&&(i.fOutputId.set(this._connection.fOutputId()),i.initialize())}onPointerMove(i){let e=this._anchorRect.addPoint(i),n=this._findClosest(e.gravityCenter),o=n?.connector.fConnectableSide??this._target.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(Jp(n,r))}onPointerUp(){this._draw(this._anchorRect,this._targetRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Vn(this._candidates.map(i=>i.connector)))}_findClosest(i){return this._mediator.execute(new cn(i,this._candidates))}_draw(i,e){let n=this._behaviour.handle(new mt(this._sourceRef.rect,i,this._connection,this._source.fConnectableSide,e,this._resolveRotationContext(this._sourceRef.connector),void 0));this._connection.setLine(n),this._connection.redraw()}_drawSnap(i){let e=this._snap;if(!e)return;if(!i){e.hide();return}let n=this._behaviour.handle(new mt(this._sourceRef.rect,i.rect,e,this._source.fConnectableSide,i.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(i.connector)));e.show(),e.setLine(n),e.redraw()}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},Ef=(()=>{class t extends Xe{type="reassign-connection";kind="reassign-connection";data(){return{fConnectionId:this._connection.fId()}}_result=d(Ht);_mediator=d(R);_connectionBehaviour=d(jn);_store=d(T);get _snapConnection(){return this._store.connections.getForSnap()}_connection;_draggedEnd;_sourceRef;_targetRef;_reassignHandler;initialize(e,n){this._connection=e,this._draggedEnd=n?"target":"source",this._sourceRef=this._mediator.execute(new rt(this._store.outputs.require(this._connection.fOutputId()))),this._targetRef=this._mediator.execute(new rt(this._store.inputs.require(this._connection.fInputId()))),this._reassignHandler=this._draggedEnd==="target"?this._createTargetHandler():this._createSourceHandler()}_createSourceHandler(){return new If(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}_createTargetHandler(){return new Tf(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:Zc(this._connection.line.point1),targetAnchorRect:Zc(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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),lv=(()=>{let t=class is{_mediator=d(R);_store=d(T);_dragContext=d(Y);_dragInjector=d(Ve);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 n=Un(e.event.getPosition(),this._store.flowHost,this._transform),o=this._findConnectionAt(n);o&&(this._capturePointerDown(e),this._startDrag(o,n),queueMicrotask(()=>this._bringToFront(o)))}_findConnectionAt(e){return this._connections.find(n=>cv(n,e))}_capturePointerDown(e){this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=X.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(this._transform.scale)}_startDrag(e,n){let o=this._dragInjector.get(Ef);o.initialize(e,Zp(e,n)),this._dragContext.draggableItems=[o]}_isValidTrigger(e){return dt(e.event.originalEvent,e.fTrigger)}_bringToFront(e){this._mediator.execute(new ln(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||is)};static \u0275prov=g({token:is,factory:is.\u0275fac})};return t=C([x(Yc)],t),t})(),Qc=class{event;static fToken=Symbol("DragConnectionWaypointFinalizeRequest");constructor(i){this.event=i}},Jc=class{connectionId;waypoints;constructor(i,e){this.connectionId=i,this.waypoints=e}},ed=(()=>{class t extends Xe{type="move-connection-waypoint";kind="drag-connection-waypoint";_store=d(T);_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=ue({},this._pick.candidate),this._waypointsComponent.insert(this._pick.candidate)):this._pick?.waypoint&&(this._point=ue({},this._pick.waypoint),this._waypointsComponent.select(this._pick.waypoint)),this._redrawConnection()}onPointerMove(e){this._waypointsComponent.move(A.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 Jc(this._connection.fId(),this._connection.fWaypoints()?.waypoints()||[])}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),uv=(()=>{let t=class os{_dragContext=d(Y);get _fDragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isDroppedConnectionReassignEvent()&&this._fDragHandler.onPointerUp()}_isDroppedConnectionReassignEvent(){return this._dragContext.draggableItems.some(e=>e instanceof ed)}static \u0275fac=function(n){return new(n||os)};static \u0275prov=g({token:os,factory:os.\u0275fac})};return t=C([x(Qc)],t),t})(),td=class{event;fTrigger;static fToken=Symbol("DragConnectionWaypointPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},fv=(()=>{let t=class rs{_mediator=d(R);_store=d(T);_dragContext=d(Y);_dragInjector=d(Ve);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 n=Un(e.event.getPosition(),this._flowHost,this._transform),o=this._pickControlPoint(n);if(!o||!this._isValidTrigger(e))return;let r=this._dragInjector.get(ed);r.setPick(o),this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=X.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 Bg(this._connections,e)}_isValidTrigger(e){return dt(e.event.originalEvent,e.fTrigger)}_updateConnectionLayer(e){this._mediator.execute(new ln(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||rs)};static \u0275prov=g({token:rs,factory:rs.\u0275fac})};return t=C([x(td)],t),t})(),hv=[nv,iv,ov,tv,rv,sv,av,lv,fv,uv],nd=class{event;static fToken=Symbol("DropToGroupFinalizeRequest");constructor(i){this.event=i}},pv=1,bi=(()=>{class t extends Xe{type="move-node-to-parent";kind="assign-to-container";_store=d(T);_dragSession=d(Y);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(Ne.GROUPING.DROP_ACTIVE)}onPointerMove(e){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._updateActiveTarget(e),pv)}onPointerUp(){this._clearActiveTarget();for(let{node:e}of this._candidateGroups)e.hostElement.classList.remove(Ne.GROUPING.DROP_ACTIVE);this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}_updateActiveTarget(e){let n=this._getPointerInFlow(e),o=this._findTargetUnderPointer(n);o?this._setActiveTarget(o):this._clearActiveTarget()}_getPointerInFlow(e){let n=X.fromPoint(this._dragSession.onPointerDownPosition).add(e),o=X.fromPoint(this._transform.position).add(this._transform.scaledPosition).div(this._transform.scale);return n.sub(o)}_findTargetUnderPointer(e){return this._candidateGroups.find(n=>G.isIncludePoint(n.rect,e))}_setActiveTarget(e){this._activeTarget?.node!==e.node&&(this._clearActiveTarget(),this._activeTarget=e,e.node.setClass(Ne.GROUPING.OVER_BOUNDARY))}_clearActiveTarget(){this._activeTarget?.node.removeClass(Ne.GROUPING.OVER_BOUNDARY),this._activeTarget=null}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),id=class{nodesAndGroups;static fToken=Symbol("CreateDragNodeHierarchyRequest");constructor(i){this.nodesAndGroups=i}},Pf=class{rootHandlers;participants;constructor(i,e){this.rootHandlers=i,this.participants=e}},Mf=class{fNodeIds;constructor(i){this.fNodeIds=i}},th="move-node",nh="drag-node";function mv(t){return t.getEvent().kind===nh||t.getEvent().fEventType===th}var Gt=(()=>{class t extends Xe{type=th;kind=nh;data(){return new Mf(this.items.map(e=>e.nodeOrGroup.fId()))}_magneticLines=null;_magneticRects=null;items;roots;initialize(e,n){this.items=e,this.roots=n}setMagneticLines(e){this._magneticLines=e}setMagneticRects(e){this._magneticRects=e}calculateMagneticLinesGuides(e){return this.calculateMagneticSnaps(e).lines}calculateMagneticSnaps(e){this._previewRoots(e);let n=this._rootsUnionRect();return{lines:this._magneticLines?._computeGuides(n),rects:this._magneticRects?._computeRects(n)}}prepareDragSequence(){for(let e of this.roots)e.prepareDragSequence()}onPointerMove(e){this._previewRoots(e);let n=this._rootsUnionRect();this._magneticLines?.scheduleRender(n),this._magneticRects?.scheduleRender(n)}onPointerUp(){for(let e of this.roots)e.onPointerUp();this._magneticLines?.clearGuides(),this._magneticRects?.clearGuides(),requestAnimationFrame(()=>this._refreshDraggedNodes())}_previewRoots(e){for(let n of this.roots)n.onPointerMove(e)}_rootsUnionRect(){let e=null;for(let n of this.roots){let o=n.getLastRect();e=e?G.union([e,o]):o}return e??G.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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),od=class{_limits;_quantizeStep;constructor(i,e=.5){this._limits=i,this._quantizeStep=e}applyInto(i,e){let{min:n,max:o}=this._limits,r=this._clamp(i.x,n.x,o.x),s=this._clamp(i.y,n.y,o.y),a=i.x-r,l=i.y-s,h=this._quantizeSigned(a,this._quantizeStep),_=this._quantizeSigned(l,this._quantizeStep);e.value.x=r,e.value.y=s,e.edges.left=h<0,e.edges.right=h>0,e.edges.top=_<0,e.edges.bottom=_>0,e.overflow.x=Math.abs(h),e.overflow.y=Math.abs(_)}_quantizeSigned(i,e){if(e<=0||i===0)return 0;let n=i/e;return(i>0?Math.ceil(n):Math.floor(n))*e}_clamp(i,e,n){return Math.min(Math.max(i,e),n)}},Df=class{_pointerDown;_vCellSize;_hCellSize;_snapWhileDragging;constructor(i,e){this._pointerDown=e,this._vCellSize=i.vCellSize(),this._hCellSize=i.hCellSize(),this._snapWhileDragging=i.fCellSizeWhileDragging()}snap(i,e){let n=e||this._snapWhileDragging;return this._strategies[+n](i)}_strategies={0:this._noSnap.bind(this),1:this._snapWithCellSize.bind(this)};_snapWithCellSize(i){return{x:this._snapToGrid(this._pointerDown.x+i.x,this._hCellSize)-this._pointerDown.x,y:this._snapToGrid(this._pointerDown.y+i.y,this._vCellSize)-this._pointerDown.y}}_noSnap(i){return i}_snapToGrid(i,e){return Math.round(i/e)*e}};function hp(){return{value:{x:0,y:0},overflow:{x:0,y:0},edges:{left:!1,right:!1,top:!1,bottom:!1}}}var kf=class{_snapper;_hardClamp;_hardResult=hp();_softClamps=[];_softResults=[];constructor(i,e,n){let o=i.get(T).fDraggable;this._snapper=new Df(o,e),this._hardClamp=new od(n.hard,.5);for(let r of n.soft)this._softClamps.push(new od(r.limits,.5)),this._softResults.push(hp())}apply(i,e=!1){let n=this._snapper.snap(i,e);this._hardClamp.applyInto(n,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(i){return this.apply(i,!0)}};function pp(t,i,e){let{x:n,y:o,width:r,height:s}=t;return e.right&&i.x>0&&(r+=i.x),e.left&&i.x>0&&(n-=i.x,r+=i.x),e.bottom&&i.y>0&&(s+=i.y),e.top&&i.y>0&&(o-=i.y,s+=i.y),G.initialize(n,o,r,s)}var Rf=class extends Xe{_injector;nodeOrGroup;children;sourceConnectionHandlers;targetConnectionHandlers;type=th;kind=nh;_startPosition=A.initialize();_startRect=G.initialize();_applyConstraints=i=>i;_lastSoftResults=[];_deltaConstraints;_constraints;_lastPosition=A.initialize();_softParentConnectionHandlers=[];_mediator;constructor(i,e,n=[],o=[],r=[]){super(),this._injector=i,this.nodeOrGroup=e,this.children=n,this.sourceConnectionHandlers=o,this.targetConnectionHandlers=r,this._mediator=i.get(R),this._startRect=this._mediator.execute(new Te(e.hostElement)),this._startPosition=ue({},e._position)}setConstraints(i){this._constraints=i,this._deltaConstraints=new kf(this._injector,this._startPosition,i),this._applyConstraints=e=>{let n=this._deltaConstraints.apply(e);return this._applySoftExpansions(n.soft),n.hardDelta}}setSoftParentConnectionHandlers(i){this._softParentConnectionHandlers=i}finalizeConstraints(){this._applyConstraints=i=>{let e=this._deltaConstraints.finalize(i);return this._applySoftExpansions(e.soft),e.hardDelta}}getLastRect(){return G.initialize(this._lastPosition.x,this._lastPosition.y,this._startRect.width,this._startRect.height)}prepareDragSequence(){for(let i of this.children)i.prepareDragSequence();this.nodeOrGroup.hostElement.classList.add(Ne.DRAG_AND_DROP.DRAGGING)}onPointerMove(i){let e=this._applyConstraints(i);for(let n of this.children)n.onPointerMove(e);this._redraw(this._startPlus(e));for(let n of this.sourceConnectionHandlers)n.setSourceDelta(e);for(let n of this.targetConnectionHandlers)n.setTargetDelta(e)}onPointerUp(){for(let i of this.children)i.onPointerUp();this.nodeOrGroup.position.set(this.nodeOrGroup._position),this.nodeOrGroup.hostElement.classList.remove(Ne.DRAG_AND_DROP.DRAGGING),this._emitExpandedEvent()}_startPlus(i){return A.sum(this._startPosition,i)}_redraw(i){this._lastPosition=i,this.nodeOrGroup.updatePosition(i),this._mediator.execute(new rn(this.nodeOrGroup.fId(),G.initialize(i.x,i.y,this._startRect.width,this._startRect.height))),this.nodeOrGroup.redraw()}_applySoftExpansions(i){this._lastSoftResults=i;for(let e=0;e<i.length;e++){let n=i[e],o=this._constraints.soft[e],r=pp(o.boundingRect,n.overflow,n.edges);this._commitParentRect(o.nodeOrGroup,r)&&this._updateParentConnectionHandlers(e)}}_commitParentRect(i,e){let n=i._position.x!==e.x||i._position.y!==e.y||i._size?.width!==e.width||i._size?.height!==e.height;return i.updateSize({width:e.width,height:e.height}),i.updatePosition({x:e.x,y:e.y}),this._mediator.execute(new rn(i.fId(),e)),i.redraw(),n}_updateParentConnectionHandlers(i){let e=this._softParentConnectionHandlers[i];if(!e)return;let n=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,n);o.handler.setSourceDelta(this._buildDelta(o.baselineRect,r))}for(let o of e.target){let r=this._readConnectorRect(o.connector,n);o.handler.setTargetDelta(this._buildDelta(o.baselineRect,r))}}_readConnectorRect(i,e){let n=`${i.kind}::${i.fId()}`,o=e.get(n);if(o)return o;let r=this._mediator.execute(new rt(i)).rect;return e.set(n,r),r}_buildDelta(i,e){return A.initialize(e.x-i.x,e.y-i.y)}_emitExpandedEvent(){for(let i=0;i<this._lastSoftResults.length;i++){let e=this._lastSoftResults[i];if(!e.overflow.x&&!e.overflow.y)continue;let n=this._constraints.soft[i],o=pp(n.boundingRect,e.overflow,e.edges);n.nodeOrGroup.sizeChange.emit(o)}}destroy(){for(let i of this.children)i.destroy?.();this.children=[],this.sourceConnectionHandlers=[],this.targetConnectionHandlers=[],this._lastSoftResults=[],this._applyConstraints=i=>i,this._softParentConnectionHandlers=[]}},_v=(()=>{let t=class ss{_injector=d(Ye);handle({nodesAndGroups:e}){let n=this._createHandlerByNodeId(e),o=this._linkParentsAndCollectRoots(e,n);return new Pf(o,Array.from(n.values()))}_createHandlerByNodeId(e){let n=new Map;for(let o of e)n.set(o.fId(),new Rf(this._injector,o));return n}_linkParentsAndCollectRoots(e,n){let o=[];for(let r of e){let s=n.get(r.fId());if(!s)continue;let a=r.fParentId(),l=a?n.get(a):void 0;l?l.children.push(s):o.push(s)}return o}static \u0275fac=function(n){return new(n||ss)};static \u0275prov=g({token:ss,factory:ss.\u0275fac})};return t=C([x(id)],t),t})(),rd=class{nodeOrGroup;static fToken=Symbol("BuildDragNodeConstraintsRequest");constructor(i){this.nodeOrGroup=i}},wi=class{nodeOrGroup;childrenPaddings;static fToken=Symbol("ReadNodeBoundsWithPaddingsRequest");constructor(i,e){this.nodeOrGroup=i,this.childrenPaddings=e}},Nf=class{nodeOrGroup;boundingRect;innerRect;paddings;constructor(i,e,n,o){this.nodeOrGroup=i,this.boundingRect=e,this.innerRect=n,this.paddings=o}},gv=(()=>{let t=class as{_mediator=d(R);handle({nodeOrGroup:e,childrenPaddings:n}){let o=this._readBoundingRect(e),r=this._readOwnPaddings(e,o),s=[r[0]+n[0],r[1]+n[1],r[2]+n[2],r[3]+n[3]],a=G.initialize(o.x+s[0],o.y+s[1],o.width-s[0]-s[2],o.height-s[1]-s[3]);return new Nf(e,o,a,s)}_readBoundingRect(e){return this._mediator.execute(new Te(e.hostElement))}_readOwnPaddings(e,n){return this._mediator.execute(new dn(e,n))}static \u0275fac=function(n){return new(n||as)};static \u0275prov=g({token:as,factory:as.\u0275fac})};return t=C([x(wi)],t),t})(),yv=(()=>{let t=class cs{_mediator=d(R);handle({nodeOrGroup:e}){let n=this._readCurrentRect(e),o=this._readParentsChain(e);return this._buildConstraints(o,n)}_readCurrentRect(e){return this._mediator.execute(new Te(e.hostElement))}_readParentsChain(e){return this._mediator.execute(new Bn(e))??[]}_buildConstraints(e,n){let o=[],r=jp(),s=[0,0,0,0];for(let a of e){let l=this._readParentBounds(a,s);s=l.paddings;let h=this._calculateDifference(l.innerRect,n);if(this._isAutoExpand(a))o.push(this._makeSoftLimit(a,l.boundingRect,h));else{r=h;break}}return{soft:o,hard:r}}_readParentBounds(e,n){return this._mediator.execute(new wi(e,n))}_calculateDifference(e,n){return{min:this._calculateMinimumDifference(e,n),max:this._calculateMaximumDifference(e,n)}}_calculateMinimumDifference(e,n){return A.initialize(e.x-n.x,e.y-n.y)}_calculateMaximumDifference(e,n){return A.initialize(e.x+e.width-(n.x+n.width),e.y+e.height-(n.y+n.height))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeSoftLimit(e,n,o){return{nodeOrGroup:e,boundingRect:n,initialSize:e._size,limits:o}}static \u0275fac=function(n){return new(n||cs)};static \u0275prov=g({token:cs,factory:cs.\u0275fac})};return t=C([x(rd)],t),t})(),sd=class{rootHandlers;participants;static fToken=Symbol("CreateDragNodeHandlerRequest");constructor(i,e){this.rootHandlers=i,this.participants=e}},ad=class{dragHandler;constraints;handlerPool;static fToken=Symbol("AttachSoftParentConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.constraints=e,this.handlerPool=n}},Si=class{_mediator=d(R);_store=d(T);_behaviour=d(jn);_source;_target;_sourceRef;_targetRef;_sourceDelta=A.initialize();_targetDelta=A.initialize();connection;initialize(i){this.connection=i,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(i){this._sourceDelta=i,this._mediator.execute(new on(this._source.fId(),this._source.kind,this._withDelta(this._sourceRef.rect,i)))}setTargetDelta(i){this._targetDelta=i,this._mediator.execute(new on(this._target.fId(),this._target.kind,this._withDelta(this._targetRef.rect,i)))}redraw(){let i=this._buildLine();this.connection.setLine(i),this.connection.redraw()}_buildLine(){let i=De.fromRoundedRect(this._sourceRef.rect).addPoint(this._sourceDelta),e=De.fromRoundedRect(this._targetRef.rect).addPoint(this._targetDelta);return this._behaviour.handle(new mt(i,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(i){return this._mediator.execute(new rt(i))}_withDelta(i,e){return De.fromRoundedRect(i).addPoint(e)}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},Ii=(()=>{class t extends Si{setSourceDelta(e){super.setSourceDelta(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Ti=(()=>{class t extends Si{_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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Ei=(()=>{class t extends Si{setTargetDelta(e){super.setTargetDelta(e),this.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),vv=(()=>{let t=class ds{_store=d(T);_mediator=d(R);_dragInjector=d(Ve);handle({dragHandler:e,constraints:n,handlerPool:o}){let r=n.soft.map(s=>this._buildParentConnectionHandlers(s.nodeOrGroup,o));e.setSoftParentConnectionHandlers(r)}_buildParentConnectionHandlers(e,n){let o=this._store.outputs.getAll().filter(_=>_.fNodeId===e.fId()),r=this._store.inputs.getAll().filter(_=>_.fNodeId===e.fId());if(!o.length&&!r.length)return{source:[],target:[]};let s=new Set(o.map(_=>_.fId())),a=new Set(r.map(_=>_.fId())),l=new Map,h={source:[],target:[]};for(let _ of this._store.connections.getAll()){let v=s.has(_.fOutputId()),b=a.has(_.fInputId());if(!v&&!b)continue;let I=this._getExistingConnectionHandler(n,_);if(I||(I=this._createConnectionHandler(_,v,b),n.push(I)),v){let N=this._store.outputs.require(_.fOutputId());h.source.push({handler:I,connector:N,baselineRect:this._readConnectorRect(N,l)})}if(b){let N=this._store.inputs.require(_.fInputId());h.target.push({handler:I,connector:N,baselineRect:this._readConnectorRect(N,l)})}}return h}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n,o){let r;return n&&o?r=this._dragInjector.createInstance(Ti):n?r=this._dragInjector.createInstance(Ii):r=this._dragInjector.createInstance(Ei),r.initialize(e),r}_readConnectorRect(e,n){let o=`${e.kind}::${e.fId()}`,r=n.get(o);if(r)return r;let s=this._mediator.execute(new rt(e)).rect;return n.set(o,s),s}static \u0275fac=function(n){return new(n||ds)};static \u0275prov=g({token:ds,factory:ds.\u0275fac})};return t=C([x(ad)],t),t})(),Cv=(()=>{let t=class ls{_dragInjector=d(Ve);_mediator=d(R);handle({rootHandlers:e,participants:n}){let o=this._collectConnectionHandlers(n);this._applyConstraintsToRoots(e,o);let r=this._dragInjector.createInstance(Gt);return r.initialize(n,e),r}_applyConstraintsToRoots(e,n){for(let o of e){let r=this._calculateConstraints(o.nodeOrGroup);o.setConstraints(r),this._attachSoftParentConnectionHandlers(o,r,n)}}_collectConnectionHandlers(e){let n=new Map;for(let o of e){for(let r of o.sourceConnectionHandlers)n.set(r.connection.fId(),r);for(let r of o.targetConnectionHandlers)n.set(r.connection.fId(),r)}return Array.from(n.values())}_attachSoftParentConnectionHandlers(e,n,o){this._mediator.execute(new ad(e,n,o))}_calculateConstraints(e){return this._mediator.execute(new rd(e))}static \u0275fac=function(n){return new(n||ls)};static \u0275prov=g({token:ls,factory:ls.\u0275fac})};return t=C([x(sd)],t),t})(),cd=class{dragHandler;sourceIds;handlerPool;static fToken=Symbol("AttachTargetConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.sourceIds=e,this.handlerPool=n}},xv=(()=>{let t=class us{_store=d(T);_dragInjector=d(Ve);get _connections(){return this._store.connections.getAll()}handle(e){this._getInputConnections(e.dragHandler.nodeOrGroup).forEach(n=>{this._createAndSetConnectionToNodeHandler(n,e)})}_getInputConnections(e){let n=new Set(this._getNodeInputIds(e));return this._connections.filter(o=>n.has(o.fInputId()))}_getNodeInputIds(e){return this._store.inputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let o=this._getExistingConnectionHandler(n.handlerPool,e);o||(o=this._createConnectionHandler(n.sourceIds,e),n.handlerPool.push(o)),n.dragHandler.targetConnectionHandlers.push(o)}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n){let o;return e.includes(n.fOutputId())?o=this._dragInjector.createInstance(Ti):o=this._dragInjector.createInstance(Ei),o.initialize(n),o}static \u0275fac=function(n){return new(n||us)};static \u0275prov=g({token:us,factory:us.\u0275fac})};return t=C([x(cd)],t),t})(),dd=class{dragHandler;targetIds;handlerPool;static fToken=Symbol("AttachSourceConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.targetIds=e,this.handlerPool=n}},bv=(()=>{let t=class fs{_store=d(T);_dragInjector=d(Ve);get _connections(){return this._store.connections.getAll()}handle(e){this._getOutputConnections(e.dragHandler.nodeOrGroup).forEach(n=>{this._createAndSetConnectionToNodeHandler(n,e)})}_getOutputConnections(e){let n=new Set(this._getNodeOutputIds(e));return this._connections.filter(o=>n.has(o.fOutputId()))}_getNodeOutputIds(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let o=this._getExistingConnectionHandler(n.handlerPool,e);o||(o=this._createConnectionHandler(n.targetIds,e),n.handlerPool.push(o)),n.dragHandler.sourceConnectionHandlers.push(o)}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n){let o;return e.includes(n.fInputId())?o=this._dragInjector.createInstance(Ti):o=this._dragInjector.createInstance(Ii),o.initialize(n),o}static \u0275fac=function(n){return new(n||fs)};static \u0275prov=g({token:fs,factory:fs.\u0275fac})};return t=C([x(dd)],t),t})(),ld=class{nodeOrGroup;static fToken=Symbol("AttachDragNodeHandlerFromSelectionRequest");constructor(i){this.nodeOrGroup=i}},wv=(()=>{let t=class hs{_mediator=d(R);_store=d(T);_dragSession=d(Y);handle({nodeOrGroup:e}){let n=this._collectSelected(e),o=this._withDeepChildren(n),r=this._mediator.execute(new id(o)),s=this._collectSourceConnectorIds(o),a=this._collectTargetConnectorIds(o);return this._attachConnectionHandlers(r.participants,s,a),this._mediator.execute(new sd(r.rootHandlers,r.participants))}_collectSelected(e){let n=[];for(let o of this._dragSession.selectedItems){let r=this._findNodeByHost(o.hostElement);r&&n.push(r)}return e&&!n.includes(e)&&n.push(e),n}_findNodeByHost(e){return this._store.nodes.getAll().find(n=>n.isContains(e))}_withDeepChildren(e){let n=[];for(let o of e){n.push(o);let r=this._mediator.execute(new Hn(o.fId()));n.push(...r)}return n}_collectSourceConnectorIds(e){return Eu(e,n=>this._store.outputs.getAll().filter(o=>o.fNodeId===n.fId()).map(o=>o.fId()))}_collectTargetConnectorIds(e){return Eu(e,n=>this._store.inputs.getAll().filter(o=>o.fNodeId===n.fId()).map(o=>o.fId()))}_attachConnectionHandlers(e,n,o){let r=[];for(let s of e)this._mediator.execute(new dd(s,o,r)),this._mediator.execute(new cd(s,n,r))}static \u0275fac=function(n){return new(n||hs)};static \u0275prov=g({token:hs,factory:hs.\u0275fac})};return t=C([x(ld)],t),t})(),Sv=[_v,yv,Cv,xv,bv,vv,gv,wv];function Iv(t,i,e=10){let n=i.x,o=i.y,r=n+i.width,s=o+i.height,a=i.gravityCenter.x,l=i.gravityCenter.y,h,_,v=1/0,b,I,N=1/0,D=(k,O)=>{let z=O<0?-O:O;z<=e&&z<v&&(v=z,h=k,_=O)},M=(k,O)=>{let z=O<0?-O:O;z<=e&&z<N&&(N=z,b=k,I=O)};for(let k=0;k<t.length;k++){let O=t[k],z=O.x,V=O.y,W=z+O.width,oe=V+O.height,be=O.gravityCenter.x,re=O.gravityCenter.y;D(z,n-z),D(W,n-W),D(be,a-be),D(z,r-z),D(W,r-W),M(V,o-V),M(oe,o-oe),M(re,l-re),M(V,s-V),M(oe,s-oe)}return{x:{guide:h,delta:_},y:{guide:b,delta:I}}}var mp=["left","top","width","height"],ud=class{_element;constructor(i,e,n="f-line"){this._element=i.document.createElement("div"),this._element.classList.add(n),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(i){for(let e of mp){let n=i[e];n!=null&&(this._element.style[e]=`${n}px`)}}clearRect(){for(let i of mp)this._element.style.removeProperty(i)}destroy(){this._element.remove()}},Of=class{_horizontal;_vertical;constructor(i,e){this._horizontal=new ud(i,e),this._vertical=new ud(i,e),this._horizontal.hide(),this._vertical.hide()}drawVerticalLine(i,e,n){this._vertical.show(),this._vertical.render({left:i*n.scale+n.position.x+n.scaledPosition.x,top:0,width:1,height:e.height})}drawHorizontalLine(i,e,n){this._horizontal.show(),this._horizontal.render({left:0,top:i*n.scale+n.position.y+n.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()}},fd=class{static fToken=Symbol("MagneticLinesPreparationRequest")},Tv=(()=>{let t=class ps{_mediator=d(R);_store=d(T);_browser=d(ke);_injector=d(Ye);_dragSession=d(Y);_renderer;handle(e){let n=this._store.instances.get(ye.MAGNETIC_LINES);if(!n)return;let o=this._dragSession.draggableItems.find(r=>r instanceof Gt);o&&o.setMagneticLines(new Ff(this._injector,this._renderer??this._createRenderer(n),this._flowHostSize(),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_flowHostSize(){return this._store.flowHost.getBoundingClientRect()}_createRenderer({hostElement:e}){return this._renderer=new Of(this._browser,e),this._renderer}_notDraggedRects(e){let n=new Set(e);return this._store.nodes.getAll().filter(r=>!n.has(r)).map(r=>this._mediator.execute(new Te(r.hostElement)))}static \u0275fac=function(n){return new(n||ps)};static \u0275prov=g({token:ps,factory:ps.\u0275fac})};return t=C([x(fd)],t),t})(),Ff=class{_renderer;_size;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;constructor(i,e,n,o){this._renderer=e,this._size=n,this._rects=o;let r=i.get(T);this._alignThreshold=r.instances.require(ye.MAGNETIC_LINES).threshold(),this._canvasTransform=r.transform}scheduleRender(i){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderGuides(this._computeGuides(i)),15)}_renderGuides(i){this._renderVertical(i),this._renderHorizontal(i)}_renderVertical(i){i.x.guide!==void 0?this._renderer.drawVerticalLine(i.x.guide,this._size,this._canvasTransform):this._renderer.hideVertical()}_renderHorizontal(i){i.y.guide!==void 0?this._renderer.drawHorizontalLine(i.y.guide,this._size,this._canvasTransform):this._renderer.hideHorizontal()}_computeGuides(i){return Iv(this._rects,i,this._alignThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},_p=["top","center","bottom"],gp=["left","center","right"];function Ev(t,i,e=10,n=10){let o=i.x,r=i.y,s=o+i.width,a=r+i.height,l=i.gravityCenter.x,h=i.gravityCenter.y,_=Pv(t,i,o,r,s,a,l,h,e,n),v=Mv(t,i,o,r,s,a,l,h,e,n);return _&&(!v||_.absDelta<=v.absDelta)?{axis:"x",delta:_.delta,gap:_.gap,rects:_.rects,alignMode:_.alignMode,crossDelta:_.crossDelta}:v?{axis:"y",delta:v.delta,gap:v.gap,rects:v.rects,alignMode:v.alignMode,crossDelta:v.crossDelta}:{rects:[]}}function Pv(t,i,e,n,o,r,s,a,l,h){let _=1/0,v,b=0,I,N=[],D=0,M=[],k=[],O=[];for(let z=0;z<_p.length;z++){let V=z===0?n:z===1?a:r;M.length=0,k.length=0,O.length=0;let W=1/0,oe=-1/0,be=0,re=1/0,le=1/0;for(let pe=0;pe<t.length;pe++){let se=t[pe],Kn=z===0?se.y:z===1?se.gravityCenter.y:se.y+se.height,pu=V-Kn,bt=En(pu);if(bt>l)continue;M.push(pe),k.push(se.x),O.push(se.x+se.width);let Yn=se.y,Zn=se.y+se.height;Yn<W&&(W=Yn),Zn>oe&&(oe=Zn),(bt<re||bt===re&&pe<le)&&(re=bt,be=Kn,le=pe)}let ie=M.length;if(ie<2)continue;em(M,k,O);let ce=0;for(;ce<ie&&k[ce]<=s;)ce++;let Ge=ce>0&&ce<ie,ve,et;Ge?(ve=ce-1,et=ce):ce<=0?(ve=0,et=1):(ve=ie-2,et=ie-1);let tt=k[et]-O[ve];if(tt<0)continue;let Fe;if(Ge){Fe=O[ve]+tt;let pe=Fe+i.width,se=k[et]-pe;if(En(se-tt)>h)continue}else ce<=0?Fe=k[0]-tt-i.width:Fe=O[ie-1]+tt;let Xn=e-Fe,$t=En(Xn);if($t>h||$t>=_)continue;let ut=Dv(M,k,O,W,oe);if(Ge){let pe=Fe,se=Fe+i.width;ut.push({left:O[ve],top:W,width:pe-O[ve],height:oe-W}),ut.push({left:se,top:W,width:k[et]-se,height:oe-W})}else if(ce<=0){let pe=Fe+i.width;ut.push({left:pe,top:W,width:k[0]-pe,height:oe-W})}else ut.push({left:O[ie-1],top:W,width:Fe-O[ie-1],height:oe-W});let hu=V-be;_=$t,v=Xn,b=tt,I=_p[z],N=ut,D=hu}if(!(v===void 0||I===void 0))return{delta:v,absDelta:_,gap:b,rects:N,alignMode:I,crossDelta:D}}function Mv(t,i,e,n,o,r,s,a,l,h){let _=1/0,v,b=0,I,N=[],D=0,M=[],k=[],O=[];for(let z=0;z<gp.length;z++){let V=z===0?e:z===1?s:o;M.length=0,k.length=0,O.length=0;let W=1/0,oe=-1/0,be=0,re=1/0,le=1/0;for(let pe=0;pe<t.length;pe++){let se=t[pe],Kn=z===0?se.x:z===1?se.gravityCenter.x:se.x+se.width,pu=V-Kn,bt=En(pu);if(bt>l)continue;M.push(pe),k.push(se.y),O.push(se.y+se.height);let Yn=se.x,Zn=se.x+se.width;Yn<W&&(W=Yn),Zn>oe&&(oe=Zn),(bt<re||bt===re&&pe<le)&&(re=bt,be=Kn,le=pe)}let ie=M.length;if(ie<2)continue;em(M,k,O);let ce=0;for(;ce<ie&&k[ce]<=a;)ce++;let Ge=ce>0&&ce<ie,ve,et;Ge?(ve=ce-1,et=ce):ce<=0?(ve=0,et=1):(ve=ie-2,et=ie-1);let tt=k[et]-O[ve];if(tt<0)continue;let Fe;if(Ge){Fe=O[ve]+tt;let pe=Fe+i.height,se=k[et]-pe;if(En(se-tt)>h)continue}else ce<=0?Fe=k[0]-tt-i.height:Fe=O[ie-1]+tt;let Xn=n-Fe,$t=En(Xn);if($t>h||$t>=_)continue;let ut=kv(M,k,O,W,oe);if(Ge){let pe=Fe,se=Fe+i.height;ut.push({left:W,top:O[ve],width:oe-W,height:pe-O[ve]}),ut.push({left:W,top:se,width:oe-W,height:k[et]-se})}else if(ce<=0){let pe=Fe+i.height;ut.push({left:W,top:pe,width:oe-W,height:k[0]-pe})}else ut.push({left:W,top:O[ie-1],width:oe-W,height:Fe-O[ie-1]});let hu=V-be;_=$t,v=Xn,b=tt,I=gp[z],N=ut,D=hu}if(!(v===void 0||I===void 0))return{delta:v,absDelta:_,gap:b,rects:N,alignMode:I,crossDelta:D}}function Dv(t,i,e,n,o){let r=[],s=o-n;for(let a=0;a<t.length-1;a++){let l=i[a+1]-e[a];l<0||r.push({left:e[a],top:n,width:l,height:s})}return r}function kv(t,i,e,n,o){let r=[],s=o-n;for(let a=0;a<t.length-1;a++){let l=i[a+1]-e[a];l<0||r.push({left:n,top:e[a],width:s,height:l})}return r}function em(t,i,e){for(let n=1;n<i.length;n++){let o=i[n],r=e[n],s=t[n],a=n-1;for(;a>=0;){let l=i[a],h=t[a];if(l<o||l===o&&h<s)break;i[a+1]=l,e[a+1]=e[a],t[a+1]=h,a--}i[a+1]=o,e[a+1]=r,t[a+1]=s}}function En(t){return t<0?-t:t}var Af=class{_element;_isVisible=!1;_left=Number.NaN;_top=Number.NaN;_width=Number.NaN;_height=Number.NaN;constructor(i,e,n="f-rect"){this._element=i.document.createElement("div"),this._element.classList.add(n);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(i,e,n,o){let r=this._element.style;i!==this._left&&(this._left=i,r.left=i+"px"),e!==this._top&&(this._top=e,r.top=e+"px"),n!==this._width&&(this._width=n,r.width=n+"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 i=this._element.style;i.removeProperty("left"),i.removeProperty("top"),i.removeProperty("width"),i.removeProperty("height")}destroy(){this._element.remove()}},Lf=class{_browser;_hostElement;_className;_pool=[];_activeCount=0;constructor(i,e,n="f-rect"){this._browser=i,this._hostElement=e,this._className=n}draw(i,e){let n=e.scale,o=e.position.x+e.scaledPosition.x,r=e.position.y+e.scaledPosition.y;for(let s=0;s<i.length;s++){let a=this._getOrCreate(s),l=i[s];a.show(),a.render(l.left*n+o,l.top*n+r,l.width*n,l.height*n)}for(let s=i.length;s<this._activeCount;s++)this._pool[s].hide();this._activeCount=i.length}hideAll(){for(let i=0;i<this._activeCount;i++)this._pool[i].hide();this._activeCount=0}destroy(){for(let i of this._pool)i.destroy();this._pool.length=0,this._activeCount=0}_getOrCreate(i){if(i<this._pool.length)return this._pool[i];let e=new Af(this._browser,this._hostElement,this._className);return this._pool.push(e),e}},hd=class{static fToken=Symbol("MagneticRectsPreparationRequest")},Rv=(()=>{let t=class ms{_mediator=d(R);_store=d(T);_browser=d(ke);_injector=d(Ye);_dragSession=d(Y);_renderer;handle(e){let n=this._store.instances.get(ye.MAGNETIC_RECTS);if(!n)return;let o=this._dragSession.draggableItems.find(r=>r instanceof Gt);o&&o.setMagneticRects(new Bf(this._injector,this._getRenderer(n),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_getRenderer(e){return this._renderer||(this._renderer=new Lf(this._browser,e.hostElement)),this._renderer?.destroy(),this._renderer}_notDraggedRects(e){let n=new Set(e);return this._store.nodes.getAll().filter(r=>!n.has(r)).map(r=>this._mediator.execute(new Te(r.hostElement)))}static \u0275fac=function(n){return new(n||ms)};static \u0275prov=g({token:ms,factory:ms.\u0275fac})};return t=C([x(hd)],t),t})(),Bf=class{_renderer;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;_spacingThreshold=10;constructor(i,e,n){this._renderer=e,this._rects=n;let o=i.get(T),r=o.instances.require(ye.MAGNETIC_RECTS);this._alignThreshold=r.alignThreshold(),this._spacingThreshold=r.spacingThreshold(),this._canvasTransform=o.transform}scheduleRender(i){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderRects(this._computeRects(i)),15)}_renderRects(i){if(i.axis!==void 0&&i.delta!==void 0&&i.rects.length>0){this._renderer.draw(i.rects,this._canvasTransform);return}this._renderer.hideAll()}_computeRects(i){return Ev(this._rects,i,this._alignThreshold,this._spacingThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},pd=class{event;static fToken=Symbol("DragNodeFinalizeRequest");constructor(i){this.event=i}},zf=class{nodes;fNodes;constructor(i){this.nodes=i,this.fNodes=i}},Nv=(()=>{let t=class _s{_mediator=d(R);_store=d(T);_dragSession=d(Y);_dragHandler;handle({event:e}){if(this._dragHandler=this._getDragHandler(),!this._dragHandler)return;let n=this._buildDragDelta(e.getPosition()),o=this._dragHandler.calculateMagneticSnaps(n),r=this._applySnapToDelta(n,o.lines,o.rects);this._finalizeMove(this._dragHandler,r),this._emitNodeIntersectIfNeeded(this._dragHandler)}_getDragHandler(){return this._dragSession.draggableItems.find(mv)}_buildDragDelta(e){return X.fromPoint(e).elementTransform(this._store.flowHost).div(this._dragSession.onPointerDownScale).sub(this._dragSession.onPointerDownPosition)}_applySnapToDelta(e,n,o){let r=e.x,s=e.y;return n&&(r=this._hasLineSnapValue(n.x)?e.x-(n.x.delta||0):r,s=this._hasLineSnapValue(n.y)?e.y-(n.y.delta||0):s),this._hasRectSnapValue(o)&&(o.axis==="x"?(r=e.x-o.delta,s=e.y-(o.crossDelta??0)):(s=e.y-o.delta,r=e.x-(o.crossDelta??0))),{x:r,y:s}}_hasLineSnapValue(e){return e.guide!==void 0&&e.guide!==null}_hasRectSnapValue(e){return!!e&&e.axis!==void 0&&e.delta!==void 0}_finalizeMove(e,n){for(let o of e.roots)o.finalizeConstraints();e.onPointerMove(n),e.onPointerUp?.(),this._store.fDraggable?.fMoveNodes.emit(this._buildMoveNodesEvent(e))}_buildMoveNodesEvent(e){let n=e.getEvent(),s=((n.data??n.fData)?.fNodeIds??[]).map(a=>({id:a,position:this._store.nodes.get(a)?._position}));return new zf(s)}_emitNodeIntersectIfNeeded(e){if(!this._isDraggedJustOneNode(e)||!this._store.fDraggable?.fEmitOnNodeIntersect)return;let n=e.roots[0].nodeOrGroup;queueMicrotask(()=>this._mediator.execute(new Bc(n)))}_isDraggedJustOneNode(e){return e.roots.length===1}static \u0275fac=function(n){return new(n||_s)};static \u0275prov=g({token:_s,factory:_s.\u0275fac})};return t=C([x(pd)],t),t})(),md=class{event;trigger;static fToken=Symbol("DragNodePreparationRequest");constructor(i,e){this.event=i,this.trigger=e}},Ov=(()=>{let t=class gs{_mediator=d(R);_store=d(T);_dragSession=d(Y);handle({event:e,trigger:n}){if(!this._canStartDrag(e,n))return;let o=this._findDraggableNode(e.targetElement);o&&(this._storePointerDownContext(e),this._dragSession.draggableItems=[this._buildDragNodeHandler(o)],this._mediator.execute(new fd),this._mediator.execute(new hd))}_canStartDrag(e,n){return this._dragSession.isEmpty()&&this._isDragHandle(e.targetElement)&&dt(e.originalEvent,n)}_isDragHandle(e){return ii(e,".f-drag-handle")}_findDraggableNode(e){let n=this._store.nodes.getAll();for(let o of n)if(!o.fDraggingDisabled()&&o.isContains(e))return o}_storePointerDownContext(e){this._dragSession.onPointerDownScale=this._store.transform.scale,this._dragSession.onPointerDownPosition=X.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(this._store.transform.scale)}_buildDragNodeHandler(e){return(e.fSelectionDisabled()||!e.isSelected())&&queueMicrotask(()=>{this._mediator.execute(new Gn(e))}),this._mediator.execute(new ld(e))}static \u0275fac=function(n){return new(n||gs)};static \u0275prov=g({token:gs,factory:gs.\u0275fac})};return t=C([x(md)],t),t})(),Fv=[...Sv,Tv,Rv,Nv,Ov],Vf=class{targetGroupId;nodeIds;dropPosition;fTargetNode;fNodes;fDropPosition;constructor(i,e,n){this.targetGroupId=i,this.nodeIds=e,this.dropPosition=n,this.fTargetNode=i,this.fNodes=e,this.fDropPosition=n}},Av=(()=>{let t=class ys{_dragSession=d(Y);_store=d(T);handle({event:e}){let n=this._findDropHandler();if(!n)return;let o=n.activeTarget?.node;o&&this._emitDropToGroupEvent(o.fId(),e),n.onPointerUp?.()}_findDropHandler(){return this._dragSession.draggableItems.find(e=>e instanceof bi)}_emitDropToGroupEvent(e,n){this._store.fDraggable?.fDropToGroup.emit(new Vf(e,this._getTopLevelDraggedIds(),n.getPosition()))}_getTopLevelDraggedIds(){let n=this._getMoveSummaryHandler().items.map(s=>s.nodeOrGroup),o=new Set(n.map(s=>s.fId())),r=[];for(let s of n){let a=s.fParentId();(!a||!o.has(a))&&r.push(s.fId())}return r}_getMoveSummaryHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof Gt);if(!e)throw new Error("DropToGroup requires DragNodeHandler.");return e}static \u0275fac=function(n){return new(n||ys)};static \u0275prov=g({token:ys,factory:ys.\u0275fac})};return t=C([x(nd)],t),t})(),_d=class{event;static fToken=Symbol("DropToGroupPreparationRequest");constructor(i){this.event=i}},gd=class{candidates;static fToken=Symbol("SortDropCandidatesByLayerRequest");constructor(i){this.candidates=i}},Lv=(()=>{let t=class vs{handle({candidates:e}){let n=e.map((o,r)=>({candidate:o,index:r}));return n.sort((o,r)=>{let s=this._compareDomOrder(o.candidate.node.hostElement,r.candidate.node.hostElement);return s!==0?-s:o.index-r.index}),n.map(o=>o.candidate)}_compareDomOrder(e,n){if(e===n)return 0;let o=e.compareDocumentPosition(n);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},s=n.getBoundingClientRect?.()??{top:0,left:0};return r.top!==s.top?r.top<s.top?-1:1:r.left!==s.left?r.left<s.left?-1:1:0}return 0}static \u0275fac=function(n){return new(n||vs)};static \u0275prov=g({token:vs,factory:vs.\u0275fac})};return t=C([x(gd)],t),t})(),Gf=class{_onPointerDown;_limit;_vCellSize;_hCellSize;_adjustCellSize;constructor(i,e,n){this._onPointerDown=e,this._limit=n;let o=i.get(T);this._vCellSize=o.fDraggable.vCellSize(),this._hCellSize=o.fDraggable.hCellSize(),this._adjustCellSize=o.fDraggable.fCellSizeWhileDragging()}limit(i){let{min:e,max:n}=this._limit,{x:o,y:r}=this._cellSizeStrategies[+this._adjustCellSize](i);return{x:this._clamp(o,e.x,n.x),y:this._clamp(r,e.y,n.y)}}_cellSizeStrategies={0:this._skipCellSize.bind(this),1:this._applyCellSize.bind(this)};_applyCellSize(i){return{x:this._snapToGrid(this._onPointerDown.x+i.x,this._hCellSize)-this._onPointerDown.x,y:this._snapToGrid(this._onPointerDown.y+i.y,this._vCellSize)-this._onPointerDown.y}}_skipCellSize(i){return i}_clamp(i,e,n){return Math.min(Math.max(i,e),n)}_snapToGrid(i,e){return Math.round(i/e)*e}},yd=class{externalItem;static fToken=Symbol("DragExternalItemCreatePlaceholderRequest");constructor(i){this.externalItem=i}},Bv=(()=>{let t=class Cs{_browser=d(ke);_containerRef=d(ro);handle({externalItem:e}){let{hostElement:n,placeholder:o}=e,r=o(),s=r?this._fromTemplate(r):this._fromHost(n);return s.classList.add("f-external-item-placeholder"),s.style.pointerEvents="none",s}_fromTemplate(e){return Du(this._createViewRef(e),this._browser.document)}_fromHost(e){return Pu(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}static \u0275fac=function(n){return new(n||Cs)};static \u0275prov=g({token:Cs,factory:Cs.\u0275fac})};return t=C([x(yd)],t),t})(),vd=class{externalItem;static fToken=Symbol("DragExternalItemCreatePreviewRequest");constructor(i){this.externalItem=i}},zv=(()=>{let t=class xs{_browser=d(ke);_containerRef=d(ro);handle({externalItem:e}){let{hostElement:n,preview:o}=e,r=o(),s=r?this._fromTemplate(r):this._fromHost(n);return this._setPreviewStyles(s),Yh(s),s.classList.add("f-external-item-preview"),s}_fromTemplate(e){return Du(this._createViewRef(e),this._browser.document)}_fromHost(e){return Pu(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}_setPreviewStyles(e){Mu(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(n){return new(n||xs)};static \u0275prov=g({token:xs,factory:xs.\u0275fac})};return t=C([x(vd)],t),t})(),Cd=class{event;static fToken=Symbol("DragExternalItemFinalizeRequest");constructor(i){this.event=i}},Hf=class{externalItemRect;data;targetContainerId;dropPosition;rect;fTargetNode;fDropPosition;constructor(i,e,n,o){this.externalItemRect=i,this.data=e,this.targetContainerId=n,this.dropPosition=o,this.rect=i,this.fTargetNode=n,this.fDropPosition=o}},Vv="external-item",Gv="drag-external-item";function Hv(t){return t.getEvent().kind===Gv||t.getEvent().fEventType===Vv}var jv=(()=>{let t=class bs{_result=d(Ht);_mediator=d(R);_store=d(T);_dragSession=d(Y);_browser=d(ke);get _createNodeEmitter(){return this._store.fDraggable?.fCreateNode}handle(e){let n=this._findExternalItemHandler();if(!n)return;let o=this._getDestinationNodeOrGroupId();this._emitEvent(this._getElementsFromPoint(e.event.getPosition()),o,e.event.getPosition()),n.onPointerUp(),this._dragSession.draggableItems=[]}_findExternalItemHandler(){return this._dragSession.draggableItems.find(e=>Hv(e))}_getDestinationNodeOrGroupId(){let e=this._getDropToGroupHandler(),n=e.activeTarget?.node.fId();return e.onPointerUp?.(),n}_getDropToGroupHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof bi);if(!e)throw new Error("NodeDragToParentDragHandler not found");return e}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y).filter(n=>!n.closest(".f-external-item")&&!n.closest(".f-external-item-preview"))}_emitEvent(e,n,o){this._isPointerInCanvasRect(e)&&this._createNodeEmitter?.emit(new Hf(this._getPreviewRect(),this._result.getData().externalItem.data(),n,n?o:void 0))}_isPointerInCanvasRect(e){return e.length?this._store.flowHost.contains(e[0]):!1}_getPreviewRect(){return this._mediator.execute(new Te(this._result.getData().preview))}static \u0275fac=function(n){return new(n||bs)};static \u0275prov=g({token:bs,factory:bs.\u0275fac})};return t=C([x(Cd)],t),t})(),jf=class{data;constructor(i){this.data=i}},xd=class extends Xe{_externalItem;_pointerDownClientPosition;type="external-item";kind="drag-external-item";data(){return new jf(this._externalItem.data())}_result;_mediator;_browser;_store;_previewEl;_placeholderEl;_startRect=G.initialize();_pointerDownRect=G.initialize();_absoluteOffsetFromFlow=A.initialize();_grabOffsetFromPointer=A.initialize();_originalParent;_originalNextSibling;_originalDisplay;_applyConstraints=i=>i;constructor(i,e,n){super(),this._externalItem=e,this._pointerDownClientPosition=n,this._store=i.get(T),this._result=i.get(Ht),this._mediator=i.get(R),this._browser=i.get(ke),this._originalDisplay=this._host.style.display,this._initConstraints(i)}get _host(){return this._externalItem.hostElement}get _overlayRoot(){return this._browser.document.fullscreenElement??this._browser.document.body}get _transform(){return this._store.transform}_initConstraints(i){this._startRect=this._getStartRect();let e=new Gf(i,this._startRect,jp());this._applyConstraints=n=>e.limit(n)}_getStartRect(){return this._mediator.execute(new Te(this._externalItem.hostElement))}prepareDragSequence(){this._pointerDownRect=this._readAbsoluteRect(this._host),this._absoluteOffsetFromFlow=X.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 i=this._host.parentNode;if(!i){this._originalParent=void 0,this._originalNextSibling=null;return}this._originalParent=i,this._originalNextSibling=this._host.nextSibling}_createPreview(){let i=this._mediator.execute(new vd(this._externalItem));return this._externalItem.previewMatchSize()&&this._matchSize(i,this._pointerDownRect),i.style.transform=yp(this._pointerDownRect),i}_createPlaceholder(){return this._mediator.execute(new yd(this._externalItem))}_placePreviewIntoOverlay(){this._overlayRoot.appendChild(this._previewEl)}_swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(){let i=this._originalParent,e=this._placeholderEl;if(!i||!e)return;let n=i.replaceChild(e,this._host);this._overlayRoot.appendChild(n),this._host.style.display="none"}onPointerMove(i,e){if(!this._previewEl)return;let n=this._resolveDeltaFromPointer(i,e),o=this._applyConstraints(n),r=X.fromPoint(this._startRect).add(o),s=this._toAbsolutePoint(r).add(this._absoluteOffsetFromFlow);this._previewEl.style.transform=yp(s)}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 i=this._originalParent,e=this._placeholderEl;if(!(!i||!e)){if(e.parentNode===i){i.replaceChild(this._host,e);return}this._originalNextSibling&&this._originalNextSibling.parentNode===i?i.insertBefore(this._host,this._originalNextSibling):i.appendChild(this._host)}}_matchSize(i,e){i.style.width=`${e.width}px`,i.style.height=`${e.height}px`}_readAbsoluteRect(i){let e=i.getBoundingClientRect(),n=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,o=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return G.initialize(e.left+o,e.top+n,e.width,e.height)}_toAbsolutePoint(i){let e=X.fromPoint(this._transform.position).add(this._transform.scaledPosition);return X.fromPoint(i).mult(this._transform.scale).add(e).add(this._getFlowHostAbsolutePosition())}_resolveDeltaFromPointer(i,e){let n=e?.getPosition();if(!n)return i;let o=this._clientToAbsolute(n).sub(this._grabOffsetFromPointer),r=this._toFlowPoint(o);return X.fromPoint(r).sub(this._startRect)}_toFlowPoint(i){let e=this._getFlowHostAbsolutePosition(),n=X.fromPoint(this._transform.position).add(this._transform.scaledPosition);return X.fromPoint(i).sub(e).sub(n).div(this._transform.scale)}_getFlowHostAbsolutePosition(){let i=this._store.flowHost.getBoundingClientRect(),e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return A.initialize(i.left+n,i.top+e)}_clientToAbsolute(i){let e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return X.fromPoint(i).add(A.initialize(n,e))}};function yp({x:t,y:i}){return`translate3d(${Math.round(t)}px, ${Math.round(i)}px, 0)`}var bd=class{event;fTrigger;static fToken=Symbol("DragExternalItemPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}};function Uv(t){return!!t.closest?.("[fExternalItem]")}function $v(t){return t.closest("[fExternalItem]")}var Wv=(()=>{class t{_byHost=new Map;_items=q([]);items=E(()=>this._items());getByElement(e){let n=$v(e);return n?this._byHost.get(n):void 0}getByHost(e){return this._byHost.get(e)}register(e){let n=e.hostElement,o=this._byHost.get(n);o!==e&&(o&&o!==e&&this._byHost.delete(n),this._byHost.set(n,e),this._sync())}remove(e){let n=e.hostElement;this._byHost.get(n)===e&&(this._byHost.delete(n),this._sync())}_sync(){this._items.set([...this._byHost.values()])}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var qv=(()=>{let t=class ws{_apiService=d(Wv);_dragSession=d(Y);_store=d(T);_injector=d(Ye);get _flowHost(){return this._store.flowHost}get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!dt(e.originalEvent,n))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=X.fromPoint(e.getPosition()).elementTransform(this._flowHost).div(r),this._dragSession.draggableItems=[new xd(this._injector,o,e.getPosition())]}_resolveExternalItem(e){return this._apiService.getByElement(e)}static \u0275fac=function(n){return new(n||ws)};static \u0275prov=g({token:ws,factory:ws.\u0275fac})};return t=C([x(bd)],t),t})(),wd=class{event;static fToken=Symbol("PreventDefaultIsExternalItemRequest");constructor(i){this.event=i}},Xv=(()=>{let t=class Ss{handle(e){this._isTargetItemExternal(e.event)&&e.event.preventDefault()}_isTargetItemExternal(e){let n=this._isExternalItem(e.target),o=this._isExternalItem(e.target.parentNode);return n||o}_isExternalItem(e){let n=!1;try{n=Uv(e)}catch{}return n}static \u0275fac=function(n){return new(n||Ss)};static \u0275prov=g({token:Ss,factory:Ss.\u0275fac})};return t=C([x(wd)],t),t})(),Kv=[Bv,zv,jv,qv,Xv],Yv=(()=>{let t=class Is{_mediator=d(R);_dragContext=d(Y);_store=d(T);_dragInjector=d(Ve);get _allNodes(){return this._store.nodes.getAll()}handle({event:e}){if(!this._canPrepare())return;let n=this._allNodes.find(s=>s.isContains(e.targetElement));if(!n&&!this._hasExternalDrag())throw new Error("Drag target node not found");let o=this._sortedTargetsForDrop();if(n){let s=n.fParentId(),a=this._mediator.execute(new Jd(s));a.length&&(o=o.filter(l=>a.includes(l.node.fId())))}let r=this._dragInjector.get(bi);r.initialize(o),this._dragContext.draggableItems.push(r)}_canPrepare(){return this._hasMoveDrag()||this._hasExternalDrag()}_hasMoveDrag(){return this._dragContext.draggableItems.some(e=>e instanceof Gt)}_hasExternalDrag(){return this._dragContext.draggableItems.some(e=>e instanceof xd)}_sortedTargetsForDrop(){let e=this._getDraggedNodes(),n=e.some(a=>a instanceof bf),o=this._withParents(e),s=this._eligibleTargets(o,n).map(a=>{let l=this._mediator.execute(new Te(a.hostElement));return{node:a,rect:l}});return this._mediator.execute(new gd(s))}_getDraggedNodes(){let e=this._dragContext.draggableItems.find(n=>n instanceof Gt);return e?e.items.map(n=>n.nodeOrGroup):[]}_withParents(e){return e.reduce((n,o)=>{n.push(o);let r=this._mediator.execute(new Bn(o));return n.push(...r),n},[])}_eligibleTargets(e,n){let o=this._allNodes.filter(r=>!e.includes(r));return n?o.filter(r=>r instanceof bf):o}static \u0275fac=function(n){return new(n||Is)};static \u0275prov=g({token:Is,factory:Is.\u0275fac})};return t=C([x(_d)],t),t})(),Zv=[Lv,Yv,Av],Sd=class{event;static fToken=Symbol("PinchToZoomFinalizeRequest");constructor(i){this.event=i}},Qv=.5,Id=(()=>{class t extends Xe{type="pinch-to-zoom";kind="pinch-to-zoom";_store=d(T);get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.require(ye.ZOOM)}_startDistance=null;_startScale=null;_touches;initialize(e){this._touches=e}prepareDragSequence(){let e=vp(this._touches);e!=null&&(this._startDistance=e,this._startScale=this._canvas.transform.scale)}onPointerMove(e,n){if(n.touches.length!==2||this._startDistance==null||this._startScale==null)return;let o=vp(n.touches),r=Jv(n.touches);if(o==null||r==null){this._reset();return}if(Math.abs(o-this._startDistance)<Qv)return;n.preventDefault();let s=o/this._startDistance,a=this._clamp(this._startScale*s);this._canvas.setScale(a,this._castPositionToFlow(r)),this._canvas.redraw()}_clamp(e){return Math.max(this._zoomComponent.minimum,Math.min(e,this._zoomComponent.maximum))}_castPositionToFlow(e){return X.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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();function Jv(t){if(t.length!==2)return null;let i=t[0],e=t[1];return A.initialize((i.clientX+e.clientX)/2,(i.clientY+e.clientY)/2)}function vp(t){if(t.length!==2)return null;let i=t[0],e=t[1];return Math.hypot(e.clientX-i.clientX,e.clientY-i.clientY)}var eC=(()=>{let t=class Ts{_dragSession=d(Y);handle(e){if(this._hasPinchZoomHandler())for(let n of this._dragSession.draggableItems)n.onPointerUp?.()}_hasPinchZoomHandler(){return this._dragSession.draggableItems.some(e=>e instanceof Id)}static \u0275fac=function(n){return new(n||Ts)};static \u0275prov=g({token:Ts,factory:Ts.\u0275fac})};return t=C([x(Sd)],t),t})(),Td=class{event;static fToken=Symbol("PinchToZoomPreparationRequest");constructor(i){this.event=i}},tC=(()=>{let t=class Es{_dragInjector=d(Ve);_store=d(T);_dragSession=d(Y);handle({event:e}){this._canStart(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=new X,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(ye.ZOOM)}_getHandler(e){let n=this._dragInjector.get(Id);return n.initialize(e.touches),n}static \u0275fac=function(n){return new(n||Es)};static \u0275prov=g({token:Es,factory:Es.\u0275fac})};return t=C([x(Td)],t),t})(),nC=[tC,eC],Ed=class{event;static fToken=Symbol("SelectionAreaFinalizeRequest");constructor(i){this.event=i}},iC=(()=>{let t=class Ps{_dragSession=d(Y);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>e.getEvent().kind==="selection-area")}static \u0275fac=function(n){return new(n||Ps)};static \u0275prov=g({token:Ps,factory:Ps.\u0275fac})};return t=C([x(Ed)],t),t})(),Uf=(()=>{class t extends Xe{type="selection-area";kind="selection-area";_store=d(T);_dragSession=d(Y);_mediator=d(R);_canBeSelected=[];_selectedByMove=[];get _transform(){return this._store.transform}get _canvasPosition(){return X.fromPoint(this._transform.position).add(this._transform.scaledPosition)}get _instance(){return this._store.instances.require(ye.SELECTION_AREA)}prepareDragSequence(){this._canBeSelected=this._mediator.execute(new ul),this._show(),this._draw(G.initialize(this._dragSession.onPointerDownPosition.x,this._dragSession.onPointerDownPosition.y))}onPointerMove(e){let n=X.fromPoint(e).add(this._dragSession.onPointerDownPosition),o=this._getMinimumPoint(this._dragSession.onPointerDownPosition,n),r=Math.abs(e.x),s=Math.abs(e.y),a=G.initialize(o.x,o.y,r,s);this._draw(a),this._selectedByMove=[],this._canBeSelected.forEach(l=>{l.element.unmarkAsSelected();let h=G.addPoint(G.mult(l.fRect,this._transform.scale),this._canvasPosition);G.intersectionWithRect(h,a)&&(l.element.markAsSelected(),this._selectedByMove.push(l.element))}),this._mediator.execute(new At)}_getMinimumPoint(e,n){return A.initialize(Math.min(e.x,n.x),Math.min(e.y,n.y))}onPointerUp(){this._hide(),this._dragSession.selectedItems.push(...this._selectedByMove),this._selectedByMove.length>0&&(this._dragSession.isSelectedChanged=!0)}_draw(e){let n=this._instance.hostElement.style;n.left=e.x+"px",n.top=e.y+"px",n.width=e.width+"px",n.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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Pd=class{event;static fToken=Symbol("SelectionAreaPreparationRequest");constructor(i){this.event=i}},oC=(()=>{let t=class Ms{_store=d(T);_dragSession=d(Y);_dragInjector=d(Ve);get _instance(){return this._store.instances.get(ye.SELECTION_AREA)}handle(e){this._isValid(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=X.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost),this._dragSession.draggableItems=[this._dragInjector.createInstance(Uf)])}_isValid(e){return!!this._instance&&this._dragSession.isEmpty()&&dt(e.event.originalEvent,this._instance.fTrigger)}static \u0275fac=function(n){return new(n||Ms)};static \u0275prov=g({token:Ms,factory:Ms.\u0275fac})};return t=C([x(Pd)],t),t})(),rC=[oC,iC],Md=class{rect;childrenBounds;static fToken=Symbol("ApplyChildResizeConstraintsRequest");constructor(i,e){this.rect=i,this.childrenBounds=e}},sC=(()=>{let t=class Ds{handle({rect:e,childrenBounds:n}){n&&this._apply(e,n)}_apply(e,n){this._restrictLeft(e,n),this._restrictTop(e,n),this._restrictRight(e,n),this._restrictBottom(e,n),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_restrictLeft(e,n){let o=e.x-n.x;o>0&&(e.x-=o,e.width+=o)}_restrictTop(e,n){let o=e.y-n.y;o>0&&(e.y-=o,e.height+=o)}_restrictRight(e,n){let o=n.x+n.width;e.x+e.width<=o&&(e.width=o-e.x)}_restrictBottom(e,n){let o=n.y+n.height;e.y+e.height<=o&&(e.height=o-e.y)}static \u0275fac=function(n){return new(n||Ds)};static \u0275prov=g({token:Ds,factory:Ds.\u0275fac})};return t=C([x(Md)],t),t})(),Dd=class{rect;limits;static fToken=Symbol("ApplyParentResizeConstraintsRequest");constructor(i,e){this.rect=i,this.limits=e}},aC=(()=>{let t=class ks{_mediator=d(R);handle({rect:e,limits:n}){this._applyResizeConstraints(e,n)}_applyResizeConstraints(e,n){if(!n)return;let o=this._clampedCopyForCalculation(e,n);this._applySoftParentExpansions(o,n.softLimits),n.hardLimit&&this._clampRectToInner(e,n.hardLimit.innerRect)}_clampedCopyForCalculation(e,n){let o=ue({},e);return n.hardLimit&&this._clampRectToInner(o,n.hardLimit.innerRect),o}_clampRectToInner(e,n){if(e.x<n.x){let s=n.x-e.x;e.x+=s,e.width-=s}if(e.y<n.y){let s=n.y-e.y;e.y+=s,e.height-=s}let o=n.x+n.width;e.x+e.width>o&&(e.width=o-e.x);let r=n.y+n.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,n){if(n?.length)for(let o of n)this._expandParentFromOriginalIfOverflow(e,o)}_expandParentFromOriginalIfOverflow(e,n){let o=n.innerRect,r=n.boundingRect,s=this._computeOverflow(o,e);if(!this._hasOverflow(s)){this._applyParentRect(n,r);return}let a=this._buildExpandedParentRect(r,s);this._applyParentRect(n,a)}_hasOverflow(e){return!!(e.left||e.top||e.right||e.bottom)}_computeOverflow(e,n){let o=Math.max(0,e.x-n.x),r=Math.max(0,e.y-n.y),s=Math.max(0,n.x+n.width-(e.x+e.width)),a=Math.max(0,n.y+n.height-(e.y+e.height));return{left:o,top:r,right:s,bottom:a}}_buildExpandedParentRect(e,n){let o=ue({},e);return n.left&&(o.x=e.x-n.left,o.width=e.width+n.left),n.top&&(o.y=e.y-n.top,o.height=e.height+n.top),n.right&&(o.width=(o.width??e.width)+n.right),n.bottom&&(o.height=(o.height??e.height)+n.bottom),o}_applyParentRect(e,n){e.nodeOrGroup.updatePosition(n),e.nodeOrGroup.updateSize(n),this._mediator.execute(new rn(e.nodeOrGroup.fId(),n)),e.nodeOrGroup.redraw()}static \u0275fac=function(n){return new(n||ks)};static \u0275prov=g({token:ks,factory:ks.\u0275fac})};return t=C([x(Dd)],t),t})(),kd=class{originalRect;difference;handleType;minimumSize;static fToken=Symbol("CalculateChangedRectFromDifferenceRequest");constructor(i,e,n,o){this.originalRect=i,this.difference=e,this.handleType=n,this.minimumSize=o}},Cp={[yt.LEFT]:{x:-1,y:0},[yt.LEFT_TOP]:{x:-1,y:-1},[yt.TOP]:{x:0,y:-1},[yt.RIGHT_TOP]:{x:1,y:-1},[yt.RIGHT]:{x:1,y:0},[yt.RIGHT_BOTTOM]:{x:1,y:1},[yt.BOTTOM]:{x:0,y:1},[yt.LEFT_BOTTOM]:{x:-1,y:1}},cC=(()=>{let t=class Rs{handle({originalRect:e,difference:n,handleType:o,minimumSize:r}){let s=this._changeSizeInRect(e,n,Cp[o],r);return this._changePosition(e,n,Cp[o],s)}_changeSizeInRect(e,n,o,r){let s=e.width+o.x*n.x,a=e.height+o.y*n.y,l=0,h=0;return s<0&&(l=s,s=Math.abs(s)),s<r.width&&(o.x===-1&&(l+=s-r.width),s=r.width),a<0&&(h=a,a=Math.abs(a)),a<r.height&&(o.y===-1&&(h+=a-r.height),a=r.height),G.initialize(l,h,s,a)}_changePosition(e,n,o,r){let s=e.x+(o.x===-1?n.x:0)+r.x,a=e.y+(o.y===-1?n.y:0)+r.y;return G.initialize(s,a,r.width,r.height)}static \u0275fac=function(n){return new(n||Rs)};static \u0275prov=g({token:Rs,factory:Rs.\u0275fac})};return t=C([x(kd)],t),t})(),Rd=class{nodeOrGroup;paddings;static fToken=Symbol("CalculateDirectChildrenUnionRectRequest");constructor(i,e){this.nodeOrGroup=i,this.paddings=e}},dC=(()=>{let t=class Ns{_mediator=d(R);_store=d(T);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle({nodeOrGroup:e,paddings:n}){let o=G.union(this._calculateDirectChildren(e.fId()).map(r=>this._normalizeRect(r)));return o?this._concatRectWithParentPadding(o,n):null}_calculateDirectChildren(e){return this._allNodesAndGroups.filter(n=>n.fParentId()===e)}_normalizeRect(e){return this._mediator.execute(new Te(e.hostElement))}_concatRectWithParentPadding(e,n){return G.initialize(e.x-n[0],e.y-n[1],e.width+n[0]+n[2],e.height+n[1]+n[3])}static \u0275fac=function(n){return new(n||Ns)};static \u0275prov=g({token:Ns,factory:Ns.\u0275fac})};return t=C([x(Rd)],t),t})(),Pi=class{nodeOrGroup;rect;static fToken=Symbol("CalculateResizeLimitsRequest");constructor(i,e){this.nodeOrGroup=i,this.rect=e}},lC=(()=>{let t=class Os{_mediator=d(R);handle({nodeOrGroup:e,rect:n}){let o=this._getParentsChain(e),r=this._calculateNodePaddings(e,n);return{limits:this._buildSoftHardLimits(o),childrenBounds:this._getNormalizedChildrenBounds(e,r),minimumSize:ht.initialize(r[0]+r[2],r[1]+r[3])}}_calculateNodePaddings(e,n){return this._mediator.execute(new dn(e,n))}_getNormalizedChildrenBounds(e,n){return this._mediator.execute(new Rd(e,n))}_getParentsChain(e){return this._mediator.execute(new Bn(e))??[]}_buildSoftHardLimits(e){let n=[],o,r=[0,0,0,0];for(let s of e){let a=this._getParentInfo(s,r);if(r=a.paddings,this._isAutoExpand(s))n.push(this._makeLimit(s,a));else{o=this._makeLimit(s,a);break}}return{softLimits:n,hardLimit:o}}_getParentInfo(e,n){return this._mediator.execute(new wi(e,n))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeLimit(e,{boundingRect:n,innerRect:o}){return{nodeOrGroup:e,boundingRect:n,innerRect:o}}static \u0275fac=function(n){return new(n||Os)};static \u0275prov=g({token:Os,factory:Os.\u0275fac})};return t=C([x(Pi)],t),t})(),Nd=class{event;static fToken=Symbol("ResizeNodeFinalizeRequest");constructor(i){this.event=i}},tm="node-resize",nm="resize-node";function uC(t){return t.getEvent().kind===nm||t.getEvent().fEventType===tm}var fC=(()=>{let t=class Fs{_dragSession=d(Y);handle(e){this._isNodeResizeHandler()&&this._dragSession.draggableItems.forEach(n=>n.onPointerUp?.())}_isNodeResizeHandler(){return this._dragSession.draggableItems.some(e=>uC(e))}static \u0275fac=function(n){return new(n||Fs)};static \u0275prov=g({token:Fs,factory:Fs.\u0275fac})};return t=C([x(Nd)],t),t})(),$f=class{fNodeId;constructor(i){this.fNodeId=i}},Wf=(()=>{class t extends Xe{type=tm;kind=nm;data(){return new $f(this._nodeOrGroup.fId())}_mediator=d(R);_baselineRect;_constraints;_lastRect=null;_nodeOrGroup;_handleType;_nodeConnections={source:[],target:[]};_softParentConnections=[];initialize(e,n){this._nodeOrGroup=e,this._handleType=n}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 n=this._calcNextRect(e);this._applyConstraints(n),this._commitRect(n),this._applyConnectionHandlers(this._nodeConnections);for(let o of this._softParentConnections)this._applyConnectionHandlers(o);this._lastRect=n}onPointerUp(){let e=this._lastRect??this._fallbackRectFromModel();this._nodeOrGroup.sizeChange.emit(e),requestAnimationFrame(()=>this._nodeOrGroup.refresh())}_readBaselineRect(){return this._mediator.execute(new Te(this._nodeOrGroup.hostElement))}_buildConstraints(e){return this._mediator.execute(new Pi(this._nodeOrGroup,e))}_calcNextRect(e){return this._mediator.execute(new kd(this._baselineRect,e,this._handleType,this._constraints.minimumSize))}_applyConstraints(e){this._mediator.execute(new Md(e,this._constraints.childrenBounds)),this._mediator.execute(new Dd(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 rn(this._nodeOrGroup.fId(),e)),this._nodeOrGroup.redraw()}_fallbackRectFromModel(){return G.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 n=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,n);o.handler.setSourceRect(r)}for(let o of e.target){let r=this._readConnectorRect(o.connector,n);o.handler.setTargetRect(r)}}_readConnectorRect(e,n){let o=`${e.kind}::${e.fId()}`,r=n.get(o);if(r)return r;let s=this._mediator.execute(new zt(e.hostElement,!1));return n.set(o,s),s}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Mi=class{_mediator=d(R);_store=d(T);_behaviour=d(jn);_source;_target;_sourceRef;_targetRef;_sourceRect;_targetRect;connection;initialize(i){this.connection=i,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=De.fromRoundedRect(this._sourceRef.rect),this._targetRect=De.fromRoundedRect(this._targetRef.rect)}setSourceRect(i){this._sourceRect=De.fromRoundedRect(i),this._mediator.execute(new on(this._source.fId(),this._source.kind,this._sourceRect))}setTargetRect(i){this._targetRect=De.fromRoundedRect(i),this._mediator.execute(new on(this._target.fId(),this._target.kind,this._targetRect))}redraw(){let i=this._buildLine();this.connection.setLine(i),this.connection.redraw()}_buildLine(){let i=De.fromRoundedRect(this._sourceRect),e=De.fromRoundedRect(this._targetRect);return this._behaviour.handle(new mt(i,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(i){return{connector:i,rect:this._mediator.execute(new zt(i.hostElement,!1))}}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},hC=(()=>{class t extends Mi{_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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),pC=(()=>{class t extends Mi{setSourceRect(e){super.setSourceRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),mC=(()=>{class t extends Mi{setTargetRect(e){super.setTargetRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Od=class{event;fTrigger;static fToken=Symbol("ResizeNodePreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},Fd=class{handler;nodeOrGroup;static fToken=Symbol("AttachResizeConnectionDragHandlersToNodeRequest");constructor(i,e){this.handler=i,this.nodeOrGroup=e}},_C=(()=>{let t=class As{_store=d(T);_mediator=d(R);_dragInjector=d(Ve);handle({handler:e,nodeOrGroup:n}){let o=this._readSoftParents(n),r=[n,...o],s=this._collectSourceConnectorIds(r),a=this._collectTargetConnectorIds(r),l=new Map;e.setNodeConnectionHandlers(this._buildConnectionHandlersForNode(n,s,a,l)),e.setSoftParentConnectionHandlers(o.map(h=>this._buildConnectionHandlersForNode(h,s,a,l)))}_readSoftParents(e){let n=this._mediator.execute(new Te(e.hostElement));return this._mediator.execute(new Pi(e,n)).limits.softLimits.map(r=>r.nodeOrGroup)}_collectSourceConnectorIds(e){let n=new Set(e.map(o=>o.fId()));return new Set(this._store.outputs.getAll().filter(o=>n.has(o.fNodeId)).map(o=>o.fId()))}_collectTargetConnectorIds(e){let n=new Set(e.map(o=>o.fId()));return new Set(this._store.inputs.getAll().filter(o=>n.has(o.fNodeId)).map(o=>o.fId()))}_buildConnectionHandlersForNode(e,n,o,r){let s=this._store.outputs.getAll().filter(v=>v.fNodeId===e.fId()),a=this._store.inputs.getAll().filter(v=>v.fNodeId===e.fId());if(!s.length&&!a.length)return{source:[],target:[]};let l=new Set(s.map(v=>v.fId())),h=new Set(a.map(v=>v.fId())),_={source:[],target:[]};for(let v of this._store.connections.getAll()){let b=l.has(v.fOutputId()),I=h.has(v.fInputId());if(!b&&!I)continue;let N=r.get(v.fId())??this._createConnectionHandler(v,n,o);if(r.set(v.fId(),N),b){let D=this._store.outputs.require(v.fOutputId());_.source.push({handler:N,connector:D})}if(I){let D=this._store.inputs.require(v.fInputId());_.target.push({handler:N,connector:D})}}return _}_createConnectionHandler(e,n,o){let r=n.has(e.fOutputId()),s=o.has(e.fInputId()),a=r&&s?this._dragInjector.createInstance(hC):r?this._dragInjector.createInstance(pC):this._dragInjector.createInstance(mC);return a.initialize(e),a}static \u0275fac=function(n){return new(n||As)};static \u0275prov=g({token:As,factory:As.\u0275fac})};return t=C([x(Fd)],t),t})(),gC=(()=>{let t=class Ls{_mediator=d(R);_store=d(T);_dragSession=d(Y);_dragInjector=d(Ve);get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!this._isResizeHandle(e.targetElement)||!dt(e.originalEvent,n))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=X.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(r);let s=this._dragInjector.createInstance(Wf);s.initialize(o,this._readResizeHandleType(e.targetElement)),this._mediator.execute(new Fd(s,o)),this._dragSession.draggableItems=[s]}_isResizeHandle(e){return ii(e,".f-resize-handle")}_findResizableNode(e){let n=this._store.nodes.getAll().find(o=>o.isContains(e));if(n)return n.fDraggingDisabled()?void 0:n}_selectBeforeResize(e){queueMicrotask(()=>{this._mediator.execute(new Gn(e))})}_readResizeHandleType(e){let n=Zh(e,"fResizeHandleType",".f-resize-handle");return yt[n]}static \u0275fac=function(n){return new(n||Ls)};static \u0275prov=g({token:Ls,factory:Ls.\u0275fac})};return t=C([x(Od)],t),t})(),yC=[sC,aC,cC,dC,lC,_C,fC,gC],Ad=class{event;static fToken=Symbol("RotateNodeFinalizeRequest");constructor(i){this.event=i}},im="node-rotate",om="rotate-node";function vC(t){return t.getEvent().kind===om||t.getEvent().fEventType===im}var CC=(()=>{let t=class Bs{_dragSession=d(Y);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>vC(e))}static \u0275fac=function(n){return new(n||Bs)};static \u0275prov=g({token:Bs,factory:Bs.\u0275fac})};return t=C([x(Ad)],t),t})(),Ld=class{event;fTrigger;static fToken=Symbol("RotateNodePreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},qf=class{fNodeId;constructor(i){this.fNodeId=i}};function xC(t,i,e){let{x:n,y:o}=bC(t,i,e),r=n-t.x,s=o-t.y;return{x:r,y:s}}function bC(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,s=Math.cos(r),a=Math.sin(r),l=n*s-o*a,h=n*a+o*s,_=l+e.x,v=h+e.y;return{x:_,y:v}}var Xf=(()=>{class t extends Xe{type=im;kind=om;data(){return new qf(this._nodeOrGroup.fId())}_store=d(T);_mediator=d(R);_dragSession=d(Y);_nodeOrGroup;_sourceConnections;_targetConnections;_startRotation=0;_nodeRect;_nodeCenter;_pointerDownInFlow;_rotationOffsetDeg=0;get _transform(){return this._store.transform}initialize(e,n,o){this._nodeOrGroup=e,this._sourceConnections=n,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 n=A.sum(this._pointerDownInFlow,e),r=this._angleDeg(n)-this._rotationOffsetDeg;this._applyRotation(r);let s=r-this._startRotation;for(let a of this._sourceConnections)a.connection.setSourceDelta(this._deltaAfterRotation(a.connector,s));for(let a of this._targetConnections)a.connection.setTargetDelta(this._deltaAfterRotation(a.connector,s))}onPointerUp(){this._nodeOrGroup.rotate.set(this._nodeOrGroup._rotate),this._nodeOrGroup.refresh()}_readNodeRect(){return this._mediator.execute(new Te(this._nodeOrGroup.hostElement))}_calculatePointerDownInFlow(){return A.sub(this._dragSession.onPointerDownPosition,A.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,n){return xC(e,n,this._nodeCenter)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),wC=(()=>{let t=class zs{_mediator=d(R);_store=d(T);_dragContext=d(Y);_dragInjector=d(Ve);get _transform(){return this._store.transform}handle(e){if(!this._isPreparationAllowed(e))return;let n=this._findRotatableNode(e.event.targetElement);if(!n)return;this._selectBeforeRotate(n);let o=this._transform.scale;this._dragContext.onPointerDownScale=o,this._dragContext.onPointerDownPosition=X.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(o);let r=this._dragInjector.createInstance(Xf);r.initialize(n,this._buildOutputConnectionHandlers(n),this._buildInputConnectionHandlers(n)),this._dragContext.draggableItems=[r]}_isPreparationAllowed({event:e,fTrigger:n}){return this._dragContext.isEmpty()&&Wy(e.targetElement)&&dt(e.originalEvent,n)}_findRotatableNode(e){for(let n of this._store.nodes.getAll())if(!n.fDraggingDisabled()&&n.isContains(e))return n}_selectBeforeRotate(e){queueMicrotask(()=>{this._mediator.execute(new Gn(e))})}_buildInputConnectionHandlers(e){return this._mediator.execute(new jd(e)).map(n=>{let o=this._store.inputs.require(n.fInputId()),r=this._mediator.execute(new rt(o)),s=this._dragInjector.get(Ei);return s.initialize(n),{connection:s,connector:r.rect.gravityCenter}})}_buildOutputConnectionHandlers(e){return this._mediator.execute(new Qd(e)).map(n=>{let o=this._store.outputs.require(n.fOutputId()),r=this._mediator.execute(new rt(o)),s=this._dragInjector.get(Ii);return s.initialize(n),{connection:s,connector:r.rect.gravityCenter}})}static \u0275fac=function(n){return new(n||zs)};static \u0275prov=g({token:zs,factory:zs.\u0275fac})};return t=C([x(Ld)],t),t})(),SC=[CC,wC],Di=class{flowRect;canvasPosition;eventPoint;minimap;static fToken=Symbol("CalculateFlowPointFromMinimapPointRequest");constructor(i,e,n,o){this.flowRect=i,this.canvasPosition=e,this.eventPoint=n,this.minimap=o}},IC=(()=>{let t=class Vs{_store=d(T);get _canvasScale(){return this._store.transform.scale||1}handle(e){return A.sub(e.canvasPosition,A.sub(this._getPositionInViewBox(e.eventPoint,e.minimap),this._getNormalizedFlowCenter(e.flowRect)))}_getNormalizedFlowCenter(e){return X.fromPoint(e.gravityCenter).sub(e)}_getPositionInViewBox(e,n){let o=this.normalizeEventPoint(e,n);return A.sum(o,G.mult(n.viewBox,this._canvasScale))}normalizeEventPoint(e,n){return this._getEventPointInMinimap(e,n).mult(n.scale).mult(this._canvasScale)}_getEventPointInMinimap(e,n){return X.fromPoint(e).elementTransform(n.element)}static \u0275fac=function(n){return new(n||Vs)};static \u0275prov=g({token:Vs,factory:Vs.\u0275fac})};return t=C([x(Di)],t),t})(),Bd=class{event;static fToken=Symbol("DragMinimapFinalizeRequest");constructor(i){this.event=i}},TC=(()=>{let t=class Gs{_dragSession=d(Y);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(EC)}static \u0275fac=function(n){return new(n||Gs)};static \u0275prov=g({token:Gs,factory:Gs.\u0275fac})};return t=C([x(Bd)],t),t})(),rm="minimap",sm="minimap";function EC(t){return t.getEvent().kind===sm||t.getEvent().fEventType===rm}var Kf=(()=>{class t extends Xe{type=rm;kind=sm;_store=d(T);_mediator=d(R);_lastDelta=null;_flowRect;_startCanvasPosition;_eventPoint;_minimap;initialize(e,n,o,r){this._flowRect=e,this._startCanvasPosition=n,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(X.fromPoint(this._eventPoint).add(e))),this._store.fCanvas?.redraw())}_isSamePoint(e,n){return e.x===n.x&&e.y===n.y}_getNewPosition(e){return this._mediator.execute(new Di(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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),zd=class{event;static fToken=Symbol("DragMinimapPreparationRequest");constructor(i){this.event=i}},PC=(()=>{let t=class Hs{_store=d(T);_mediator=d(R);_dragSession=d(Y);_dragInjector=d(Ve);get _canvas(){return this._store.fCanvas}get _flowHost(){return this._store.flowHost}handle({event:e}){if(!this._isValid(e))return;let n=this._store.instances.require(ye.MINIMAP).state,o=e.getPosition(),r=X.fromPoint(this._store.transform.position),s=G.fromElement(this._flowHost);this._canvas.setPosition(this._calculateCanvasPosition(s,o,n)),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent(),this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=X.fromPoint(o).elementTransform(this._flowHost);let a=this._dragInjector.createInstance(Kf);a.initialize(s,r,o,n),this._dragSession.draggableItems=[a]}_isValid(e){return!(!this._dragSession.isEmpty()||!this._flowHost.contains(e.targetElement)||!e.targetElement.closest(".f-minimap")||!this._store.instances.get(ye.MINIMAP))}_calculateCanvasPosition(e,n,o){return this._mediator.execute(new Di(e,X.fromPoint(this._canvas.transform.position),n,o))}static \u0275fac=function(n){return new(n||Hs)};static \u0275prov=g({token:Hs,factory:Hs.\u0275fac})};return t=C([x(zd)],t),t})(),MC=[IC,TC,PC];function DC(t){return!!t&&typeof t.destroy=="function"}var Ve=(()=>{class t{_injector=d(Ye);_dragInjector=null;_created=[];create(){this._dragInjector=Ye.create({providers:[{provide:Vd,useClass:Vd},{provide:ed,useClass:ed},{provide:$c,useClass:$c},{provide:Ef,useClass:Ef},{provide:bi,useClass:bi},{provide:Ii,useClass:Ii},{provide:Ei,useClass:Ei},{provide:Ti,useClass:Ti},{provide:Gt,useClass:Gt},{provide:Id,useClass:Id},{provide:Uf,useClass:Uf},{provide:Wf,useClass:Wf},{provide:Xf,useClass:Xf},{provide:Kf,useClass:Kf}],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 n=Ch(this._dragInjector,()=>new e);return this._created.push(n),n}destroy(){for(let e of this._created)DC(e)&&e.destroy();this._created=[],this._dragInjector?.destroy?.(),this._dragInjector=null}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Ht=(()=>{class t{_data;setData(e){this._data=ue(ue({},this._data),e)}getData(){return this._data}clear(){this._data=void 0}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),xp="f-canvas-dragging",bp="canvas-dragging",Vd=(()=>{class t extends Xe{type="canvas-move";kind="drag-canvas";_store=d(T);_onPointerDownPosition=A.initialize();constructor(){super(),this._store.fCanvas?.hostElement.classList.add(xp,bp)}prepareDragSequence(){this._onPointerDownPosition=this._store.transform.position}onPointerMove(e){this._store.fCanvas?.setPosition(X.fromPoint(this._onPointerDownPosition).add(e)),this._store.fCanvas?.redraw()}onPointerUp(){this._store.fCanvas?.emitCanvasChangeEvent(),this._store.fCanvas?.hostElement.classList.remove(xp,bp)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),kC=(()=>{let t=class js{_dragContext=d(Y);handle(e){this._isValid()&&this._dragContext.draggableItems.forEach(n=>n.onPointerUp?.())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Vd)}static \u0275fac=function(n){return new(n||js)};static \u0275prov=g({token:js,factory:js.\u0275fac})};return t=C([x(Vc)],t),t})(),Gd=class{event;fTrigger;static fToken=Symbol("DragCanvasPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},RC=(()=>{let t=class Us{_store=d(T);_dragContext=d(Y);_dragInjector=d(Ve);handle({event:e,fTrigger:n}){!this._isValid(e)||!this._isValidTrigger(e,n)||(this._dragContext.onPointerDownScale=1,this._dragContext.onPointerDownPosition=X.fromPoint(e.getPosition()).elementTransform(this._store.flowHost),this._dragContext.draggableItems=[this._dragInjector.get(Vd)])}_isValid(e){return this._dragContext.isEmpty()&&(this._isBackgroundElement(e.targetElement)||this._isDragOnHost(e.targetElement))}_isBackgroundElement(e){return this._store.instances.get(ye.BACKGROUND)?.hostElement.contains(e)}_isDragOnHost(e){return this._store.flowHost.contains(e)&&!this._getNode(e)}_getNode(e){let n=this._store.nodes.getAll().find(o=>o.isContains(e));return n&&n.fDraggingDisabled()&&(n=void 0),n}_isValidTrigger(e,n){return dt(e.originalEvent,n)}static \u0275fac=function(n){return new(n||Us)};static \u0275prov=g({token:Us,factory:Us.\u0275fac})};return t=C([x(Gd)],t),t})(),NC=[kC,RC],Hd=class{event;trigger;static fToken=Symbol("SelectByPointerRequest");constructor(i,e){this.event=i,this.trigger=e}},OC=(()=>{let t=class $s{_mediator=d(R);_store=d(T);_dragSession=d(Y);handle({event:e,trigger:n}){if(!this._isSelectionAllowed(e))return;let o=this._resolveSelectable(e.targetElement);this._deferRaiseLayerFor(o),dt(e.originalEvent,n)?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(n=>n.isContains(e))}_findConnectionAt(e){return this._store.connections.getAll().find(n=>n.isContains(e))}_deferRaiseLayerFor(e){e&&queueMicrotask(()=>{this._mediator.execute(new ln(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 n=this._dragSession.selectedItems.indexOf(e);n>=0&&this._dragSession.selectedItems.splice(n,1),e.unmarkAsSelected(),this._dragSession.markSelectionAsChanged()}static \u0275fac=function(n){return new(n||$s)};static \u0275prov=g({token:$s,factory:$s.\u0275fac})};return t=C([x(Hd)],t),t})(),FC=[OC];var Yf=class extends _f{hostElement=d(Se).nativeElement};function AC(t){return ii(t,".f-drag-blocker")}var am=(()=>{class t extends Yf{_result=d(Ht);_mediator=d(R);_platform=d(Tu);disabled=!1;fMultiSelectTrigger=e=>this._platform.getOS()===Rt.MAC_OS?e.metaKey:e.ctrlKey;fReassignConnectionTrigger=pt;fCreateConnectionTrigger=pt;fConnectionWaypointsTrigger=F(pt);fMoveControlPointTrigger=pt;fNodeResizeTrigger=pt;fNodeRotateTrigger=pt;fNodeMoveTrigger=pt;fCanvasMoveTrigger=pt;fExternalItemTrigger=pt;fSelectionChange=new nt;fNodeIntersectedWithConnections=new nt;fNodeConnectionsIntersection=je();fEmitOnNodeIntersect=!1;fCreateNode=new nt;fMoveNodes=new nt;fReassignConnection=new nt;fCreateConnection=new nt;fConnectionWaypointsChanged=je();fDropToGroup=new nt;vCellSize=F(1,{transform:e=>We(e,1)});hCellSize=F(1,{transform:e=>We(e,1)});fCellSizeWhileDragging=F(!1,{transform:e=>xe(e)});fDragStarted=new nt;fDragEnded=new nt;_dragHandlerInjector=d(Ve);ngOnInit(){this._mediator.execute(new Wd(this))}ngAfterViewInit(){super.subscribe()}onPointerDown(e){if(AC(e.targetElement))return!1;this._dragHandlerInjector.create(),this._result.clear(),this._mediator.execute(new Xd),this._mediator.execute(new Pd(e)),this._mediator.execute(new zd(e)),this._mediator.execute(new Td(e)),this._mediator.execute(new Hd(e,this.fMultiSelectTrigger)),this._mediator.execute(new Yc(e,this.fReassignConnectionTrigger)),this._mediator.execute(new Xc(e,this.fCreateConnectionTrigger)),this._mediator.execute(new td(e,this.fConnectionWaypointsTrigger()));let n=e.isMouseLeftButton();return n||this.finalizeDragSequence(),n}prepareDragSequence(e){this._mediator.execute(new Od(e,this.fNodeResizeTrigger)),this._mediator.execute(new Ld(e,this.fNodeRotateTrigger)),this._mediator.execute(new md(e,this.fNodeMoveTrigger)),this._mediator.execute(new bd(e,this.fExternalItemTrigger)),this._mediator.execute(new _d(e)),this._mediator.execute(new Gd(e,this.fCanvasMoveTrigger)),this._mediator.execute(new Kd)}onSelect(e){this._mediator.execute(new wd(e))}onPointerMove(e){this._mediator.execute(new qd(e))}onPointerUp(e){this._mediator.execute(new Bd(e)),this._mediator.execute(new Ed(e)),this._mediator.execute(new Kc(e)),this._mediator.execute(new Uc(e)),this._mediator.execute(new Nd(e)),this._mediator.execute(new Ad(e)),this._mediator.execute(new pd(e)),this._mediator.execute(new Cd(e)),this._mediator.execute(new nd(e)),this._mediator.execute(new Vc(e)),this._mediator.execute(new Sd(e)),this._mediator.execute(new Qc(e)),this._mediator.execute(new Oc)}finalizeDragSequence(){this._mediator.execute(new Vt),this._mediator.execute(new yi),this._result.clear(),this._dragHandlerInjector.destroy()}ngOnDestroy(){this._mediator.execute(new Vt),this._mediator.execute(new Yd),super.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Ee({type:t,selectors:[["f-flow","fDraggable",""]],inputs:{disabled:[2,"fDraggableDisabled","disabled",xe],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",xe],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:[Re([Ht,Ve]),_e]})}return t})(),LC=[...NC,...hv,...Fy,...FC,...Kv,...jy,...MC,...Fv,...Zv,...yC,...SC,...rC,...nC],BC=(()=>{let t=class Ws{_store=d(T);handle({waypointIndex:e,connectionId:n}){let o=this._store.connections.require(n),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 Jc(e.fId(),e.fWaypoints()?.waypoints()||[])}static \u0275fac=function(n){return new(n||Ws)};static \u0275prov=g({token:Ws,factory:Ws.\u0275fac})};return t=C([x(ff)],t),t})(),Zf=class{static fToken=Symbol("RemoveSnapConnectionFromStoreRequest")},zC=(()=>{let t=class qs{_store=d(T);handle(e){this._store.connections.removeInstanceForSnap()}static \u0275fac=function(n){return new(n||qs)};static \u0275prov=g({token:qs,factory:qs.\u0275fac})};return t=C([x(Zf)],t),t})(),VC=[El,un,Rg,Ng,Og,Fg,P0,oy,N0,Q0,fy,uy,iy,py,_y,my,ny,dy,O0,Cy,ty,ey,J0,q0,Z0,X0,K0,hy,ay,gy,yy,ly,cy,vy,xy,by,wy,zC,BC],ki=class{instance;static fToken=Symbol("AddConnectorToStoreRequest");constructor(i){this.instance=i}},GC=(()=>{let t=class Xs{_store=d(T);_mediator=d(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 mc(e.fId(),e.fNodeId,e.kind,e.hostElement))}static \u0275fac=function(n){return new(n||Xs)};static \u0275prov=g({token:Xs,factory:Xs.\u0275fac})};return t=C([x(ki)],t),t})(),cn=class{position;connectorRefs;static fToken=Symbol("CalculateClosestConnectorRequest");constructor(i,e){this.position=i,this.connectorRefs=e}},HC=(()=>{let t=class Ks{handle({position:e,connectorRefs:n}){let o,r=1/0;for(let s of n){let a=this._distanceToRect(e,s.rect);a<r&&(r=a,o=s)}return o?mu(ue({},o),{distance:r}):void 0}_distanceToRect(e,{x:n,y:o,width:r,height:s}){let a=this._clamp(e.x,n,n+r),l=this._clamp(e.y,o,o+s),h=e.x-a,_=e.y-l;return Math.sqrt(h*h+_*_)}_clamp(e,n,o){return Math.max(n,Math.min(o,e))}static \u0275fac=function(n){return new(n||Ks)};static \u0275prov=g({token:Ks,factory:Ks.\u0275fac})};return t=C([x(cn)],t),t})(),Ri=class{pointerPosition;connectableConnectors;static fToken=Symbol("FindConnectableConnectorUsingPriorityAndPositionRequest");constructor(i,e){this.pointerPosition=i,this.connectableConnectors=e}},jC=(()=>{let t=class Ys{_mediator=d(R);_store=d(T);_browser=d(ke);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 n=this._findConnectorAtPosition(e);return n.length>0?n[0]:void 0}_findConnectorAtPosition(e){let n=[];n.push(...this._filterConnectorsThatLocatedAtPosition(e));let o=this._isSnapConnectionEnabledAndHasClosestConnector(e);o&&n.unshift(o.connector);let r=this._getFirstConnectableConnectorOfNodeAtPosition(e);return r&&n.push(r),n}_filterConnectorsThatLocatedAtPosition(e){return e.connectableConnectors.filter(n=>G.isIncludePoint(n.rect,this._calculatePointerInFlow(e.pointerPosition))).map(n=>n.connector)}_calculatePointerInFlow(e){return Un(e,this._flowHost,this._transform)}_isSnapConnectionEnabledAndHasClosestConnector(e){if(!this._snapConnection)return;let n=this._mediator.execute(new cn(this._calculatePointerInFlow(e.pointerPosition),e.connectableConnectors));return this._isValidClosestInput(n)?n:void 0}_isValidClosestInput(e){return!!e&&e.distance<this._snapConnection.fSnapThreshold}_getFirstConnectableConnectorOfNodeAtPosition(e){return this._getElementsFromPoint(e.pointerPosition).map(n=>this._findConnectableNode(n)).filter(n=>!!n).map(n=>this._findFirstConnectableConnectorOfNode(e.connectableConnectors,n)).find(n=>!!n)}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y)}_findConnectableNode(e){return this._fNodes.find(n=>n.isContains(e)&&n.fConnectOnNode())}_findFirstConnectableConnectorOfNode(e,n){return e.find(o=>o.connector.fNodeId===n.fId())?.connector}static \u0275fac=function(n){return new(n||Ys)};static \u0275prov=g({token:Ys,factory:Ys.\u0275fac})};return t=C([x(Ri)],t),t})(),Ni=class{source;pointer;static fToken=Symbol("CalculateTargetConnectorsToConnectRequest");constructor(i,e){this.source=i,this.pointer=e}},rt=class{connector;static fToken=Symbol("GetConnectorRectReferenceRequest");constructor(i){this.connector=i}},UC=(()=>{let t=class Zs{_mediator=d(R);handle({connector:e}){return{connector:e,rect:this._getRect(e)}}_getRect(e){return this._mediator.execute(new zt(e.hostElement))}static \u0275fac=function(n){return new(n||Zs)};static \u0275prov=g({token:Zs,factory:Zs.\u0275fac})};return t=C([x(rt)],t),t})(),Oi=class{nodeOrGroup;static fToken=Symbol("AddNodeToStoreRequest");constructor(i){this.nodeOrGroup=i}},$C=(()=>{let t=class Qs{_store=d(T);_mediator=d(R);handle({nodeOrGroup:e}){this._store.nodes.add(e),this._mediator.execute(new _c(e.fId(),e.hostElement,e)),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Qs)};static \u0275prov=g({token:Qs,factory:Qs.\u0275fac})};return t=C([x(Oi)],t),t})(),jd=class{nodeOrGroup;static fToken=Symbol("CalculateInputConnectionsRequest");constructor(i){this.nodeOrGroup=i}},WC=(()=>{let t=class Js{_store=d(T);handle({nodeOrGroup:e}){let n=this._collectInputIds(e);return this._collectConnections(n)}_collectInputIds(e){let n=new Set,o=this._store.inputs.getAll();for(let r of o)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fInputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||Js)};static \u0275prov=g({token:Js,factory:Js.\u0275fac})};return t=C([x(jd)],t),t})(),Fn=class{connector;pointerPosition;static fToken=Symbol("CalculateConnectableSideByConnectedPositionsRequest");constructor(i,e){this.connector=i,this.pointerPosition=e}},wp=2,$e=(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})($e||{});function qC(t,i,e,n,o){let r=XC(o),s=e-t,a=n-i,l=KC(s,a);return YC(l,r)?l:ZC(s,a,r,l)}function XC(t){if(!t||t.length===0)return $e.ALL;let i=$e.NONE;for(let e=0;e<t.length;e++)switch(t[e]){case L.LEFT:i|=$e.LEFT;break;case L.RIGHT:i|=$e.RIGHT;break;case L.TOP:i|=$e.TOP;break;case L.BOTTOM:i|=$e.BOTTOM;break}return i||$e.ALL}function KC(t,i){let e=t<0?-t:t,n=i<0?-i:i;return e-n>wp?t<0?L.LEFT:L.RIGHT:(n-e>wp,i<0?L.TOP:L.BOTTOM)}function YC(t,i){switch(t){case L.LEFT:return(i&$e.LEFT)!==0;case L.RIGHT:return(i&$e.RIGHT)!==0;case L.TOP:return(i&$e.TOP)!==0;case L.BOTTOM:return(i&$e.BOTTOM)!==0;default:return!0}}function ZC(t,i,e,n){let o=n,r=-1/0;if(e&$e.RIGHT){let s=t;s>r&&(r=s,o=L.RIGHT)}if(e&$e.LEFT){let s=-t;s>r&&(r=s,o=L.LEFT)}if(e&$e.BOTTOM){let s=i;s>r&&(r=s,o=L.BOTTOM)}if(e&$e.TOP){let s=-i;s>r&&(r=s,o=L.TOP)}return o}function Ud(t){return t===L.CALCULATE||t===L.CALCULATE_HORIZONTAL||t===L.CALCULATE_VERTICAL}var QC={[L.CALCULATE]:[L.TOP,L.BOTTOM,L.LEFT,L.RIGHT],[L.CALCULATE_HORIZONTAL]:[L.LEFT,L.RIGHT],[L.CALCULATE_VERTICAL]:[L.TOP,L.BOTTOM]},JC=(()=>{let t=class ea{_mediator=d(R);handle({connector:e,pointerPosition:n}){let o=e.userFConnectableSide,r=this._getConnectorRect(e.hostElement).gravityCenter,s=this._accumulateConnectedCenters(e.hostElement,e.toConnector,n),a=s.sumX/s.count,l=s.sumY/s.count;return qC(r.x,r.y,a,l,QC[o])}_accumulateConnectedCenters(e,n,o){let r=o?.x||0,s=o?.y||0,a=o?1:0;if(n&&n.length)for(let l=0;l<n.length;l++){let h=n[l].hostElement;if(h===e)continue;let _=this._getConnectorRect(h).gravityCenter;r+=_.x,s+=_.y,a++}return{sumX:r,sumY:s,count:a}}_getConnectorRect(e){return this._mediator.execute(new Te(e))}static \u0275fac=function(n){return new(n||ea)};static \u0275prov=g({token:ea,factory:ea.\u0275fac})};return t=C([x(Fn)],t),t})(),$d=class{connector;static fToken=Symbol("CalculateConnectableSideByInternalPositionRequest");constructor(i){this.connector=i}},Wd=class{fComponent;static fToken=Symbol("AddDndToStoreRequest");constructor(i){this.fComponent=i}},ex=(()=>{let t=class ta{_store=d(T);handle(e){this._store.fDraggable=e.fComponent}static \u0275fac=function(n){return new(n||ta)};static \u0275prov=g({token:ta,factory:ta.\u0275fac})};return t=C([x(Wd)],t),t})(),qd=class{event;static fToken=Symbol("OnPointerMoveRequest");constructor(i){this.event=i}},tx=(()=>{let t=class na{_mediator=d(R);_store=d(T);get _hostElement(){return this._store.fDraggable?.hostElement}_dragContext=d(Y);handle({event:e}){this._dragContext.rememberPointerEvent(e),this._setDifferenceToDraggableItems(this._getDifferenceBetweenPointerAndPointerDown(e),e),this._mediator.execute(new vi)}_setDifferenceToDraggableItems(e,n){this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(ue({},e),n)})}_getDifferenceBetweenPointerAndPointerDown(e){return this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition)}_getPointerPositionInCanvas(e){return X.fromPoint(e.getPosition()).elementTransform(this._hostElement)}static \u0275fac=function(n){return new(n||na)};static \u0275prov=g({token:na,factory:na.\u0275fac})};return t=C([x(qd)],t),t})(),Xd=class{static fToken=Symbol("InitializeDragSequenceRequest")},nx=(()=>{let t=class ia{_dragContext=d(Y);handle(e){this._dragContext.reset()}static \u0275fac=function(n){return new(n||ia)};static \u0275prov=g({token:ia,factory:ia.\u0275fac})};return t=C([x(Xd)],t),t})(),jt=class{static fToken=Symbol("IsDragStartedRequest")},ix=(()=>{let t=class oa{_store=d(T);handle(e){return!!this._store.fDraggable?.isDragStarted}static \u0275fac=function(n){return new(n||oa)};static \u0275prov=g({token:oa,factory:oa.\u0275fac})};return t=C([x(jt)],t),t})(),Kd=class{static fToken=Symbol("PrepareDragSequenceRequest")},ox=(()=>{let t=class ra{_mediator=d(R);_dragContext=d(Y);handle(e){this._callPrepareDragSequence(),this._mediator.execute(new Fc)}_callPrepareDragSequence(){this._dragContext.draggableItems.forEach(e=>e.prepareDragSequence?.())}static \u0275fac=function(n){return new(n||ra)};static \u0275prov=g({token:ra,factory:ra.\u0275fac})};return t=C([x(Kd)],t),t})(),Yd=class{static fToken=Symbol("RemoveDndFromStoreRequest")},rx=(()=>{let t=class sa{_store=d(T);handle(e){this._store.fDraggable=void 0}static \u0275fac=function(n){return new(n||sa)};static \u0275prov=g({token:sa,factory:sa.\u0275fac})};return t=C([x(Yd)],t),t})(),sx=[ex,tx,nx,ox,ix,rx],ax=new fe("CONNECTABLE_SIDE_EPSILON"),cx=(()=>{let t=class aa{_mediator=d(R);_lastSide=new WeakMap;_epsilon=Math.max(0,d(ax,{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 n=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,n),n}_getSideByDelta(e,n,o){let r=G.fromElement(e),s=n.getBoundingClientRect(),a=r.gravityCenter.x,l=r.gravityCenter.y,h=a-s.left,_=s.right-a,v=l-s.top,b=s.bottom-l,I=0,N=h,D=[h,_,v,b];for(let O=1;O<4;O++){let z=D[O];z<N&&(N=z,I=O)}let M=I===0?L.LEFT:I===1?L.RIGHT:I===2?L.TOP:L.BOTTOM,k=this._lastSide.get(o);if(k!==void 0&&k!==M){let O=k===L.LEFT?0:k===L.RIGHT?1:k===L.TOP?2:3;(O===0?h:O===1?_:O===2?v:b)-N<=this._epsilon&&(M=k)}return M}_isDragging(){return this._mediator.execute(new jt)}static \u0275fac=function(n){return new(n||aa)};static \u0275prov=g({token:aa,factory:aa.\u0275fac})};return t=C([x($d)],t),t})(),An=class{nodeOrGroup;static fToken=Symbol("CalculateConnectorsConnectableSidesRequest");constructor(i){this.nodeOrGroup=i}},dx=(()=>{let t=class ca{_mediator=d(R);handle({nodeOrGroup:e}){let n=e.connectors,o=n.length;for(let s=0;s<o;s++){let a=n[s];a.fConnectableSide=this._resolveSideForConnectorFast(a)}let r=new Set;for(let s=0;s<o;s++){let l=n[s].toConnector;if(l&&l.length)for(let h=0,_=l.length;h<_;h++){let v=l[h],b=v.userFConnectableSide;Ud(b)&&r.add(v)}}r.size>0&&r.forEach(s=>{s.fConnectableSide=this._calculateByConnectedPositions(s)})}_resolveSideForConnectorFast(e){let n=e.userFConnectableSide;return n===L.AUTO?this._mediator.execute(new $d(e)):Ud(n)?this._calculateByConnectedPositions(e):n}_calculateByConnectedPositions(e){return this._mediator.execute(new Fn(e))}static \u0275fac=function(n){return new(n||ca)};static \u0275prov=g({token:ca,factory:ca.\u0275fac})};return t=C([x(An)],t),t})(),Ln=class{static fToken=Symbol("CalculateNodesBoundingBoxRequest")},lx=(()=>{let t=class da{_store=d(T);handle(e){return G.union(this._nodesRects())}_nodesRects(){return this._store.nodes.getAll().map(e=>G.fromElement(e.hostElement))}static \u0275fac=function(n){return new(n||da)};static \u0275prov=g({token:da,factory:da.\u0275fac})};return t=C([x(Ln)],t),t})(),Zd=class{fNodes;static fToken=Symbol("CalculateNodesBoundingBoxNormalizedPositionRequest");constructor(i){this.fNodes=i}},ux=(()=>{let t=class la{_store=d(T);_mediator=d(R);handle(e){return G.union(this._getNodesRects(e.fNodes||this._store.nodes.getAll()))}_getNodesRects(e){return e.map(n=>this._getNodeRect(n))}_getNodeRect(e){let n=this._mediator.execute(new Nn(e.hostElement));if(n)return this._getElementRect(e,n);let o=this._mediator.execute(new Te(e.hostElement));return this._getElementRect(e,o)}_getElementRect(e,n){return G.initialize(e._position.x,e._position.y,n.width,n.height)}static \u0275fac=function(n){return new(n||la)};static \u0275prov=g({token:la,factory:la.\u0275fac})};return t=C([x(Zd)],t),t})(),Qd=class{nodeOrGroup;static fToken=Symbol("CalculateOutputConnectionsRequest");constructor(i){this.nodeOrGroup=i}},fx=(()=>{let t=class ua{_store=d(T);handle({nodeOrGroup:e}){let n=this._collectOutputIds(e);return this._collectConnections(n)}_collectOutputIds(e){let n=new Set,o=this._store.outputs.getAll();for(let r of o)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fOutputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||ua)};static \u0275prov=g({token:ua,factory:ua.\u0275fac})};return t=C([x(Qd)],t),t})(),Fi=class{nodeOrGroup;static fToken=Symbol("FitToChildNodesAndGroupsRequest");constructor(i){this.nodeOrGroup=i}},dn=class{fNode;rect;static fToken=Symbol("GetNodePaddingRequest");constructor(i,e){this.fNode=i,this.rect=e}},hx=(()=>{let t=class fa{_browser=d(ke);handle(e){return e.fNode.fIncludePadding()?this._getPaddingData(e.fNode,e.rect):[0,0,0,0]}_getPaddingData(e,n){let o=this._browser.window.getComputedStyle(e.hostElement);return[this._browser.toPixels(o.paddingLeft,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingTop,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingRight,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingBottom,n.width,n.height,o.fontSize)]}static \u0275fac=function(n){return new(n||fa)};static \u0275prov=g({token:fa,factory:fa.\u0275fac})};return t=C([x(dn)],t),t})(),px=(()=>{let t=class ha{_mediator=d(R);_store=d(T);get _nodes(){return this._store.nodes.getAll()}handle({nodeOrGroup:e}){if(e.fAutoSizeToFitChildren()){let r=this._calculateDirectChildren(e);if(r.length){let s=this._boundingRect(e),a=this._calculateChildrenBounding(r,this._paddings(e,s));e.updatePosition(a),e.updateSize(a),e.redraw()}}let n=e.fParentId();if(!n)return;let o=this._nodes.find(r=>r.fId()===n);o&&this._mediator.execute(new Fi(o))}_calculateDirectChildren(e){return this._nodes.filter(n=>n.fParentId()===e.fId())}_unionRect(e){return G.union(e.map(n=>this._boundingRect(n)))||G.initialize()}_boundingRect(e){return this._mediator.execute(new Te(e.hostElement))}_paddings(e,n){return this._mediator.execute(new dn(e,n))}_calculateChildrenBounding(e,[n,o,r,s]){let a=this._unionRect(e);return a=G.initialize(a.x-n,a.y-o,a.width+n+r,a.height+o+s),a}static \u0275fac=function(n){return new(n||ha)};static \u0275prov=g({token:ha,factory:ha.\u0275fac})};return t=C([x(Fi)],t),t})(),Jd=class{id;static fToken=Symbol("GetChildNodeIdsRequest");constructor(i){this.id=i}},mx=(()=>{let t=class pa{_store=d(T);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle(e){if(!e.id)return[];let n=new Set,o=[];return this._collectDescendants(e.id,o,n),o}_collectDescendants(e,n,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(s=>s.fParentId()===e).map(s=>s.fId());n.push(...r);for(let s of r)this._collectDescendants(s,n,o)}static \u0275fac=function(n){return new(n||pa)};static \u0275prov=g({token:pa,factory:pa.\u0275fac})};return t=C([x(Jd)],t),t})(),Bn=class{nodeOrGroup;static fToken=Symbol("GetParentNodesRequest");constructor(i){this.nodeOrGroup=i}},_x=(()=>{let t=class ma{_store=d(T);handle({nodeOrGroup:e}){return this._getParentNodes(e,new Set,[])}_getParentNodes(e,n,o){if(n.has(e.fId()))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e.fId());n.add(e.fId());let r=this._store.nodes.get(e.fParentId());return r?(o.push(r),this._getParentNodes(r,n,o)):o}static \u0275fac=function(n){return new(n||ma)};static \u0275prov=g({token:ma,factory:ma.\u0275fac})};return t=C([x(Bn)],t),t})(),Ai=class{nodeOrGroup;destroyRef;static fToken=Symbol("UpdateNodeWhenStateOrSizeChangedRequest");constructor(i,e){this.nodeOrGroup=i,this.destroyRef=e}},gx=(()=>{let t=class _a{_mediator=d(R);handle({nodeOrGroup:e,destroyRef:n}){let{hostElement:o,stateChanges:r}=e;new vt(new Vu(o),r).listen(n,()=>{this._mediator.execute(new tn),this._isDragging()||(this._mediator.execute(new Rn(e.fId(),"UpdateNodeWhenStateOrSizeChanged")),this._mediator.execute(new An(e)),this._mediator.execute(new Fi(e)))})}_isDragging(){return this._mediator.execute(new jt)}static \u0275fac=function(n){return new(n||_a)};static \u0275prov=g({token:_a,factory:_a.\u0275fac})};return t=C([x(Ai)],t),t})(),Li=class{instance;static fToken=Symbol("RemoveNodeFromStoreRequest");constructor(i){this.instance=i}},yx=(()=>{let t=class ga{_store=d(T);_mediator=d(R);handle({instance:e}){this._store.nodes.remove(e),this._mediator.execute(new gc(e.fId())),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||ga)};static \u0275prov=g({token:ga,factory:ga.\u0275fac})};return t=C([x(Li)],t),t})(),vx=[$C,JC,cx,WC,dx,lx,ux,fx,px,mx,hx,_x,gx,yx],Cx=(()=>{let t=class ya{_mediator=d(R);_store=d(T);get _targets(){return this._store.inputs.getAll()}handle({source:e,pointer:n}){let o=this._getConnectableTargets(e),r=[];for(let s of o)r.push(this._mediator.execute(new rt(s)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableTargets(e){if(e.hasConnectionLimits)return this._targets.filter(o=>e.canConnectTo(o));let n=this._targets.filter(o=>o.canBeConnected);return e.isSelfConnectable||(n=n.filter(o=>o.fNodeId!==e.fNodeId)),n}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:o}of e)Ud(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Fn(e,n))}static \u0275fac=function(n){return new(n||ya)};static \u0275prov=g({token:ya,factory:ya.\u0275fac})};return t=C([x(Ni)],t),t})(),el=class{target;pointer;static fToken=Symbol("CalculateSourceConnectorsToConnectRequest");constructor(i,e){this.target=i,this.pointer=e}},xx=(()=>{let t=class va{_mediator=d(R);_store=d(T);get _sources(){return this._store.outputs.getAll()}handle({target:e,pointer:n}){let o=this._getConnectableSources(e),r=[];for(let s of o)r.push(this._mediator.execute(new rt(s)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableSources(e){return this._sources.filter(n=>{let o=n.canBeConnected;return o&&n.hasConnectionLimits&&(o=n.canConnectTo(e)),o})}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:o}of e)Ud(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Fn(e,n))}static \u0275fac=function(n){return new(n||va)};static \u0275prov=g({token:va,factory:va.\u0275fac})};return t=C([x(el)],t),t})(),zn=class{connectors;static fToken=Symbol("MarkConnectableConnectorsRequest");constructor(i){this.connectors=i}},Ne={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"}},bx=(()=>{let t=class Ca{_store=d(T);handle({connectors:e}){this._store.flowHost.classList.add(Ne.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._markConnector(n))}_markConnector({hostElement:e}){e.classList.add(Ne.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||Ca)};static \u0275prov=g({token:Ca,factory:Ca.\u0275fac})};return t=C([x(zn)],t),t})(),Bi=class{instance;static fToken=Symbol("RemoveConnectorFromStoreRequest");constructor(i){this.instance=i}},wx=(()=>{let t=class xa{_store=d(T);_mediator=d(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 di(e.fId(),e.kind))}static \u0275fac=function(n){return new(n||xa)};static \u0275prov=g({token:xa,factory:xa.\u0275fac})};return t=C([x(Bi)],t),t})(),Vn=class{connectors;static fToken=Symbol("UnmarkConnectableConnectorsRequest");constructor(i){this.connectors=i}},Sx=(()=>{let t=class ba{_store=d(T);handle({connectors:e}){this._store.flowHost.classList.remove(Ne.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._unmarkConnector(n))}_unmarkConnector({hostElement:e}){e.classList.remove(Ne.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||ba)};static \u0275prov=g({token:ba,factory:ba.\u0275fac})};return t=C([x(Vn)],t),t})(),Ix=[GC,wx,HC,jC,xx,Cx,UC,bx,Sx],tl=class{instance;static fToken=Symbol("AddFlowToStoreRequest");constructor(i){this.instance=i}};var ri=(function(t){return t.MANUAL="manual",t.AUTO="auto",t})(ri||{});function Tx(t){let i=[...t.nodes.map(Sp),...t.groups.map(Sp)],e=new Set(t.nodes.map(a=>a.id)),n=new Set(t.groups.map(a=>a.id)),o=new Map,r=new Map;for(let a of[...t.nodes,...t.groups]){for(let l of a.fOutputs)o.set(l.id,a.id);for(let l of a.fInputs)r.set(l.id,a.id)}let s=t.connections.reduce((a,l)=>{let h=o.get(l.fOutputId),_=r.get(l.fInputId);return!h||!_||a.push({source:h,target:_}),a},[]);return{nodes:i,connections:s,nodeIds:e,groupIds:n}}function Sp(t){return{id:t.id,size:t.measuredSize?ue({},t.measuredSize):t.size?ue({},t.size):void 0}}var Ex=1,cm=(()=>{class t{_destroyRef=d(Ze);_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,n){let o=e.fId();this.unregisterFlow(o);let r={flow:e,store:n,nodeSignature:this._buildNodeSignature(n),connectionSignature:this._buildConnectionSignature(n),timeoutId:null,raf1:null,raf2:null,unsubs:[],runId:0,isApplying:!1};r.unsubs.push(n.nodesChanges$.listen(()=>this._handleNodesChanges(o)),n.connectionsChanges$.listen(()=>this._handleConnectionsChanges(o))),this._flows.set(o,r),this._engine?.getMode()===ri.AUTO&&this._scheduleRelayout(o)}unregisterFlow(e){let n=this._flows.get(e);n&&(n.unsubs.forEach(o=>o()),this._clearScheduledWork(n),this._flows.delete(e))}handleModeChanged(e){if(e===ri.AUTO)for(let n of this._flows.keys())this._scheduleRelayout(n)}async relayout(e){if(this._engine){if(e){let n=this._flows.get(e);n&&await this._relayoutRegisteredFlow(e,n);return}for(let[n,o]of this._flows.entries())await this._relayoutRegisteredFlow(n,o)}}_handleNodesChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let o=this._buildNodeSignature(n.store);o!==n.nodeSignature&&(n.nodeSignature=o,this._scheduleRelayout(e))}_handleConnectionsChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let o=this._buildConnectionSignature(n.store);o!==n.connectionSignature&&(n.connectionSignature=o,this._scheduleRelayout(e))}_scheduleRelayout(e){let n=this._flows.get(e);!n||!this._engine||this._engine.getMode()!==ri.AUTO||(n.timeoutId!==null&&clearTimeout(n.timeoutId),this._cancelAnimationFrames(n),n.timeoutId=setTimeout(()=>{n.timeoutId=null,this._runAfterNextPaint(n,()=>{this._relayoutFlowIfReady(e)})},Ex))}async _relayoutFlowIfReady(e){let n=this._flows.get(e);if(!(!n||!this._engine||this._engine.getMode()!==ri.AUTO)){if(n.store.hasPendingProgressiveRender){this._scheduleRelayout(e);return}await this._relayoutRegisteredFlow(e,n)}}async _relayoutRegisteredFlow(e,n){if(!this._engine)return;let o=Tx(n.flow.getState({measuredSize:!0})),r=++n.runId,s=await this._engine.calculate(o.nodes,o.connections,{flowId:e,mode:this._engine.getMode()}),a=this._flows.get(e);if(!(!a||a.runId!==r||!this._applyPositions(a.store,s.nodes).length)){a.isApplying=!0;try{a.flow.redraw(),this._emitWriteback(e,s.nodes,o.nodeIds,o.groupIds)}finally{queueMicrotask(()=>{let h=this._flows.get(e);h&&(h.isApplying=!1)})}}}_emitWriteback(e,n,o,r){let s=this._engine?.getWriteback();s&&s({flowId:e,nodes:n.filter(a=>o.has(a.id)),groups:n.filter(a=>r.has(a.id))})}_applyPositions(e,n){return n.filter(o=>{let r=e.nodes.get(o.id);return!r||A.isEqual(r._position,o.position)?!1:(r.position.set(ue({},o.position)),!0)})}_buildNodeSignature(e){return e.nodes.getAll().map(n=>n.fId()).sort().join("|")}_buildConnectionSignature(e){return e.connections.getAll().map(n=>`${n.fId()}:${n.fOutputId()}:${n.fInputId()}`).sort().join("|")}_runAfterNextPaint(e,n){if(this._cancelAnimationFrames(e),typeof requestAnimationFrame!="function"){n();return}e.raf1=requestAnimationFrame(()=>{e.raf1=null,e.raf2=requestAnimationFrame(()=>{e.raf2=null,n()})})}_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(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();var Px=(()=>{let t=class wa{_store=d(T);_layoutController=d(cm,{optional:!0});handle({instance:e}){this._store.fFlow=e,this._layoutController?.registerFlow(e,this._store)}static \u0275fac=function(n){return new(n||wa)};static \u0275prov=g({token:wa,factory:wa.\u0275fac})};return t=C([x(tl)],t),t})(),nl=class{static fToken=Symbol("GetFlowRequest")},Mx=(()=>{let t=class Sa{_store=d(T);handle(e){let n=this._store.fFlow;if(!n)throw new Error("Flow not found in store");return n}static \u0275fac=function(n){return new(n||Sa)};static \u0275prov=g({token:Sa,factory:Sa.\u0275fac})};return t=C([x(nl)],t),t})(),il=class{static fToken=Symbol("CalculateConnectionsStateRequest")},Dx=(()=>{let t=class Ia{_store=d(T);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(n){return new(n||Ia)};static \u0275prov=g({token:Ia,factory:Ia.\u0275fac})};return t=C([x(il)],t),t})(),zi=class{component;measuredSize;static fToken=Symbol("CalculateNodesStateRequest");constructor(i,e=!1){this.component=i,this.measuredSize=e}},kx=(()=>{let t=class Ta{_store=d(T);_mediator=d(R);handle({component:e,measuredSize:n}){return this._store.nodes.getAll().filter(o=>o instanceof e).map(o=>{let r=n?this._mediator.execute(new Te(o.hostElement)):null;return{id:o.fId(),parentId:o.fParentId()??void 0,position:ue({},o._position),size:o._size?ue({},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(n=>e.contains(n.hostElement)).map(n=>({id:n.fId(),fConnectableSide:n.fConnectableSide}))}_getInputs(e){return this._store.inputs.getAll().filter(n=>e.contains(n.hostElement)).map(n=>({id:n.fId(),fConnectableSide:n.fConnectableSide}))}static \u0275fac=function(n){return new(n||Ta)};static \u0275prov=g({token:Ta,factory:Ta.\u0275fac})};return t=C([x(zi)],t),t})(),ol=class{measuredSize;static fToken=Symbol("CalculateFlowStateRequest");constructor(i=!1){this.measuredSize=i}},Rx=(()=>{let t=class Ea{_mediator=d(R);_store=d(T);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _canvasPosition(){return A.sum(this._transform.position,this._transform.scaledPosition)}handle({measuredSize:e}){return{position:this._canvasPosition,scale:this._canvas.transform.scale,nodes:this._mediator.execute(new zi(Ml,e)),groups:this._mediator.execute(new zi(bf,e)),connections:this._mediator.execute(new il)}}static \u0275fac=function(n){return new(n||Ea)};static \u0275prov=g({token:Ea,factory:Ea.\u0275fac})};return t=C([x(ol)],t),t})(),Nx=[Rx,kx,Dx],rl=class{instance;static fToken=Symbol("RemoveFlowFromStoreRequest");constructor(i){this.instance=i}},Ox=(()=>{let t=class Pa{_store=d(T);_layoutController=d(cm,{optional:!0});handle({instance:e}){this._layoutController?.unregisterFlow(e.fId()),this._store.fFlow=void 0}static \u0275fac=function(n){return new(n||Pa)};static \u0275prov=g({token:Pa,factory:Pa.\u0275fac})};return t=C([x(rl)],t),t})(),Dl=(()=>{class t{isNodesRendered=!1;isFullRendered=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),sl=class{static fToken=Symbol("NotifyNodesRenderedRequest")},ih=new fe("F_FLOW"),Qf=class{},Fx=(()=>{let t=class Ma{_state=d(Dl);_fFlow=d(ih);handle(e){this._state.isNodesRendered||(this._state.isNodesRendered=!0,this._fFlow.fNodesRendered.emit(this._fFlow.fId()))}static \u0275fac=function(n){return new(n||Ma)};static \u0275prov=g({token:Ma,factory:Ma.\u0275fac})};return t=C([x(sl)],t),t})(),al=class{static fToken=Symbol("NotifyFullRenderedRequest")},Ax=(()=>{let t=class Da{_state=d(Dl);_fFlow=d(ih);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(n){return new(n||Da)};static \u0275prov=g({token:Da,factory:Da.\u0275fac})};return t=C([x(al)],t),t})(),Vi=class{targetConnectionsRevision;targetNodesRevision;callback;destroyRef;static fToken=Symbol("WaitForConnectionsRenderedRequest");constructor(i,e,n,o){this.targetConnectionsRevision=i,this.targetNodesRevision=e,this.callback=n,this.destroyRef=o}},Lx=(()=>{let t=class ka{_store=d(T);handle({targetConnectionsRevision:e,targetNodesRevision:n,callback:o,destroyRef:r}){if(this._store.connectionsRenderedRevision>=e&&this._store.connectionsRenderedNodesRevision>=n){o();return}let s=this._store.connectionsRenderedChanges$.listen(()=>{this._store.connectionsRenderedRevision<e||this._store.connectionsRenderedNodesRevision<n||(s(),o())});r.onDestroy(s)}static \u0275fac=function(n){return new(n||ka)};static \u0275prov=g({token:ka,factory:ka.\u0275fac})};return t=C([x(Vi)],t),t})(),cl=class{static fToken=Symbol("ResetRenderLifecycleRequest")},Bx=(()=>{let t=class Ra{_state=d(Dl);handle(e){this._state.isNodesRendered=!1,this._state.isFullRendered=!1}static \u0275fac=function(n){return new(n||Ra)};static \u0275prov=g({token:Ra,factory:Ra.\u0275fac})};return t=C([x(cl)],t),t})(),dl=class{destroyRef;static fToken=Symbol("QueueConnectionRedrawRequest");constructor(i){this.destroyRef=i}},dm=(()=>{class t{isWaitingForViewportAnimation=!1;pendingRedraw=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),zx=(()=>{let t=class Na{_state=d(dm);_store=d(T);_mediator=d(R);handle(e){if(this._state.pendingRedraw=!0,this._state.isWaitingForViewportAnimation)return;this._state.isWaitingForViewportAnimation=!0;let n=this._store.viewportAnimationChanges$.listen(()=>{if(this._store.isViewportAnimating)return;let o=this._state.pendingRedraw;n(),this._state.isWaitingForViewportAnimation=!1,this._state.pendingRedraw=!1,o&&this._mediator.execute(new mi)});e.destroyRef.onDestroy(n)}static \u0275fac=function(n){return new(n||Na)};static \u0275prov=g({token:Na,factory:Na.\u0275fac})};return t=C([x(dl)],t),t})(),Vx=[Px,Mx,...Nx,Ox,Dl,Fx,Ax,Lx,Bx,dm,zx],ll=class{static fToken=Symbol("ClearSelectionRequest")},Gx=(()=>{let t=class Oa{_dragContext=d(Y);handle(e){this._dragContext.selectedItems.forEach(n=>n.unmarkAsSelected()),this._dragContext.selectedItems=[],this._dragContext.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||Oa)};static \u0275prov=g({token:Oa,factory:Oa.\u0275fac})};return t=C([x(ll)],t),t})(),ul=class{static fToken=Symbol("CalculateSelectableItemsRequest")},Hx=(()=>{let t=class Fa{_mediator=d(R);_store=d(T);_dragContext=d(Y);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 Te(e.hostElement))}))}_connectionRects(){return this._connections.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new Te(e.boundingElement))}))}static \u0275fac=function(n){return new(n||Fa)};static \u0275prov=g({token:Fa,factory:Fa.\u0275fac})};return t=C([x(ul)],t),t})(),Gi=class{static fToken=Symbol("GetCurrentSelectionRequest")},jx=(()=>{let t=class Aa{_dragContext=d(Y);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(n){return new(n||Aa)};static \u0275prov=g({token:Aa,factory:Aa.\u0275fac})};return t=C([x(Gi)],t),t})(),fl=class{nodes;connections;isSelectedChanged;static fToken=Symbol("SelectRequest");constructor(i,e,n=!0){this.nodes=i,this.connections=e,this.isSelectedChanged=n}},Ux=(()=>{let t=class La{_dragContext=d(Y);_store=d(T);handle(e){this._dragContext.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragContext.selectedItems=[],e.nodes.forEach(n=>{let o=this._store.nodes.get(n);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),e.connections.forEach(n=>{let o=this._store.connections.get(n);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),this._dragContext.isSelectedChanged=e.isSelectedChanged}static \u0275fac=function(n){return new(n||La)};static \u0275prov=g({token:La,factory:La.\u0275fac})};return t=C([x(fl)],t),t})(),hl=class{static fToken=Symbol("SelectAllRequest")},$x=(()=>{let t=class Ba{_dragSession=d(Y);_store=d(T);handle(e){this._dragSession.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragSession.selectedItems=[],this._store.nodes.getAll().forEach(n=>{n.markAsSelected(),this._dragSession.selectedItems.push(n)}),this._store.connections.getAll().forEach(n=>{n.markAsSelected(),this._dragSession.selectedItems.push(n)}),this._dragSession.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||Ba)};static \u0275prov=g({token:Ba,factory:Ba.\u0275fac})};return t=C([x(hl)],t),t})(),Gn=class{nodeOrGroup;static fToken=Symbol("SelectAndUpdateNodeLayerRequest");constructor(i){this.nodeOrGroup=i}},pl=class{fItemsContainer;allElements;elementsThatShouldBeInFront;targetIndex;static fToken=Symbol("MoveFrontElementsBeforeTargetElementRequest");constructor(i,e,n,o){this.fItemsContainer=i,this.allElements=e,this.elementsThatShouldBeInFront=n,this.targetIndex=o}},Wx=(()=>{let t=class za{handle(e){let n=[];for(let o=e.targetIndex+1;o<e.allElements.length;o++){let r=e.allElements[o];e.elementsThatShouldBeInFront.includes(r)||n.push(r)}n.forEach(o=>{e.fItemsContainer.removeChild(o),e.fItemsContainer.insertBefore(o,e.allElements[e.targetIndex])})}static \u0275fac=function(n){return new(n||za)};static \u0275prov=g({token:za,factory:za.\u0275fac})};return t=C([x(pl)],t),t})(),ln=class{item;itemContainer;static fToken=Symbol("UpdateItemAndChildrenLayersRequest");constructor(i,e){this.item=i,this.itemContainer=e}},Hn=class{nodeOrGroupId;static fToken=Symbol("GetDeepChildrenNodesAndGroupsRequest");constructor(i){this.nodeOrGroupId=i}},qx=(()=>{let t=class Va{_store=d(T);handle({nodeOrGroupId:e}){return this._getChildrenNodes(e)}_getChildrenNodes(e,n=new Set){if(n.has(e))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e);n.add(e);let o=this._store.nodes.getAll().filter(r=>r.fParentId()===e);return o.reduce((r,s)=>r.concat(this._getChildrenNodes(s.fId(),n)),o)}static \u0275fac=function(n){return new(n||Va)};static \u0275prov=g({token:Va,factory:Va.\u0275fac})};return t=C([x(Hn)],t),t})(),Xx=(()=>{let t=class Ga{_store=d(T);_mediator=d(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 n=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenGroups(n);this._updateLayers(this._groupsContainer,e.item.hostElement,o);let r=this._getChildrenNodes(n);r.length&&this._updateLayers(this._nodesContainer,r[0],r)}_handleNode(e){let n=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenNodes(n);this._updateLayers(e.itemContainer,e.item.hostElement,o)}_handleConnection(e){this._updateLayers(e.itemContainer,e.item.hostElement,[])}_updateLayers(e,n,o){let r=Array.from(e.children),s=r.findIndex(a=>a===n);this._isAnythingNeedToBeMoved(r,s,o)&&this._mediator.execute(new pl(e,r,o,s))}_isAnythingNeedToBeMoved(e,n,o){for(let r=n+1;r<e.length;r++)if(!o.includes(e[r]))return!0;return!1}_getChildrenGroups(e){let n=Array.from(this._groupsContainer.children);return e.filter(o=>this._groupsContainer.contains(o)).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodes(e){let n=Array.from(this._nodesContainer.children);return e.filter(o=>this._nodesContainer.contains(o)).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodesAndGroups(e){return this._mediator.execute(new Hn(e)).map(n=>n.hostElement)}static \u0275fac=function(n){return new(n||Ga)};static \u0275prov=g({token:Ga,factory:Ga.\u0275fac})};return t=C([x(ln)],t),t})(),Kx=(()=>{let t=class Ha{_dragSession=d(Y);_mediator=d(R);handle({nodeOrGroup:e}){this._selectNodeIfNotSelected(e),this._mediator.execute(new ln(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(n){return new(n||Ha)};static \u0275prov=g({token:Ha,factory:Ha.\u0275fac})};return t=C([x(Gn)],t),t})(),Yx=[Gx,Hx,jx,Ux,$x,Kx],ml=class{static fToken=Symbol("ResetZoomRequest")},Zx=(()=>{let t=class ja{_store=d(T);get _canvas(){return this._store.fCanvas}handle(e){this._canvas.resetScale(),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=function(n){return new(n||ja)};static \u0275prov=g({token:ja,factory:ja.\u0275fac})};return t=C([x(ml)],t),t})(),_l=class{position;step;direction;animate;static fToken=Symbol("SetZoomRequest");constructor(i,e,n,o=!1){this.position=i,this.step=e,this.direction=n,this.animate=o}},Qx=new Set(["drag-node","drag-external-item","resize-node","rotate-node","create-connection","reassign-connection","drag-connection-waypoint","assign-to-container"]),Jx=new Set(["drag-canvas","selection-area"]),eb=(()=>{let t=class Ua{_mediator=d(R);_store=d(T);_dragContext=d(Y,{optional:!0});get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.get(ye.ZOOM)}get _isDragStarted(){return this._mediator.execute(new jt)}handle(e){if(!this._zoomComponent)return;let n=this._canvas.transform.scale,o=this._clamp(n+e.step*e.direction);if(o===n)return;let r=this._castPositionToFlow(e.position);if(this._isDragStarted){let s=this._getDragZoomMode();if(s==="blocked")return;s==="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 X.fromPoint(e).elementTransform(this._flowHost)}_getDragZoomMode(){if(this._dragContext?.isEmpty())return"blocked";let e=!1;for(let n of this._dragContext?.draggableItems??[]){let o=n.getEvent().kind;if(Qx.has(o)){e=!0;continue}if(!Jx.has(o))return"blocked"}return e?"rebase":"direct"}_rebaseDragContext(e,n){if(!this._dragContext)return;let o=this._dragContext.onPointerDownScale;if(!o||o===n){this._dragContext.onPointerDownScale=n;return}let r=1/n-1/o;this._dragContext.onPointerDownPosition=X.fromPoint(this._dragContext.onPointerDownPosition).add(X.fromPoint(e).mult(r)),this._dragContext.onPointerDownScale=n}static \u0275fac=function(n){return new(n||Ua)};static \u0275prov=g({token:Ua,factory:Ua.\u0275fac})};return t=C([x(_l)],t),t})(),tb=[Zx,eb],gl=class{static fToken=Symbol("MinimapDrawNodesRequest")},nb=(()=>{let t=class $a{_browser=d(ke);_store=d(T);handle(e){let n=this._store.fFlow,o=this._store.fCanvas;return!n||!o?[]:this._store.nodes.getAll().map(s=>this._renderNode(s,n,o))}_renderNode(e,n,o){let r=Pn("rect",this._browser);wu(this._nodeRect(e,n,o),r);let s=e instanceof Ml;return r.classList.add("f-component",s?"f-minimap-node":"f-minimap-group"),r.classList.add(...this._minimapClasses(e)),e.isSelected()&&r.classList.add("f-selected"),r}_nodeRect(e,n,o){let r=G.elementTransform(G.fromElement(e.hostElement),n.hostElement);return G.div(r,o.transform.scale)}_minimapClasses(e){let n=e.fMinimapClass();return Array.isArray(n)?n:[n]}static \u0275fac=function(n){return new(n||$a)};static \u0275prov=g({token:$a,factory:$a.\u0275fac})};return t=C([x(gl)],t),t})(),yl=class{svg;minSize;static fToken=Symbol("MinimapCalculateViewportRequest");constructor(i,e){this.svg=i,this.minSize=e}},ib=(()=>{let t=class Wa{_mediator=d(R);_store=d(T);handle({svg:e,minSize:n}){let o=this._store.fFlow,r=this._store.fCanvas;if(!o||!r)return{scale:1,viewBox:G.initialize(0,0,0,0)};let s=this._contentRectInMinimapSpace(o,r,n),a=this._minimapRectInFlowSpace(e,o),l=this._viewportScale(s,a),h=this._viewportViewBox(s,a,l);return{scale:l,viewBox:h}}_contentRectInMinimapSpace(e,n,o){let r=this._nodesBoundingBox(),s=G.elementTransform(r,e.hostElement),a=G.div(s,n.transform.scale);return $h(a,o)}_nodesBoundingBox(){return this._mediator.execute(new Ln)??G.initialize(0,0,0,0)}_minimapRectInFlowSpace(e,n){return G.elementTransform(G.fromElement(e),n.hostElement)}_viewportScale(e,n){let o=n.width||1,r=n.height||1;return Math.max(e.width/o,e.height/r)}_viewportViewBox(e,n,o){let r=this._viewportSize(n,o),s=e.x-(r.width-e.width)/2,a=e.y-(r.height-e.height)/2;return G.initialize(s,a,r.width,r.height)}_viewportSize(e,n){return ht.initialize(e.width*n||0,e.height*n||0)}static \u0275fac=function(n){return new(n||Wa)};static \u0275prov=g({token:Wa,factory:Wa.\u0275fac})};return t=C([x(yl)],t),t})(),vl=class{static fToken=Symbol("MinimapCalculateViewRectRequest")},ob=(()=>{let t=class qa{_store=d(T);handle(e){let n=this._store.fFlow,o=this._store.fCanvas;if(!n||!o)return G.initialize();let r=G.div(G.fromElement(n.hostElement),o.transform.scale);return r.x=0,r.y=0,r}static \u0275fac=function(n){return new(n||qa)};static \u0275prov=g({token:qa,factory:qa.\u0275fac})};return t=C([x(vl)],t),t})(),Cl=class{element;scale;viewBox;constructor(i,e=1,n=G.initialize(0,0,0,0)){this.element=i,this.scale=e,this.viewBox=n}},rb=[nb,ib,ob],xl=class{position;static fToken=Symbol("GetNormalizedPointRequest");constructor(i){this.position=i}},sb=(()=>{let t=class Xa{_store=d(T);handle({position:e}){return Un(e,this._store.flowHost,this._store.transform)}static \u0275fac=function(n){return new(n||Xa)};static \u0275prov=g({token:Xa,factory:Xa.\u0275fac})};return t=C([x(xl)],t),t})(),bl=class{static fToken=Symbol("SortNodeLayersRequest")},ab=(()=>{let t=class Ka{_store=d(T);_mediator=d(R);_browser=d(ke);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(n=>{this._moveChildrenNodes(this._getSortedChildrenNodes(n))})}_getGroups(){return this._store.nodes.getAll().filter(e=>this._groupsContainer.contains(e.hostElement))}_getSortedChildrenNodes(e){let n=this._fNodeElements;return this._getChildrenNodes(e.fId()).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodes(e){return this._mediator.execute(new Hn(e)).filter(n=>this._nodesContainer.contains(n.hostElement)).map(n=>n.hostElement)}_moveChildrenNodes(e){let n=this._browser.document.createDocumentFragment();e.forEach(o=>{n.appendChild(o)}),this._nodesContainer.appendChild(n)}static \u0275fac=function(n){return new(n||Ka)};static \u0275prov=g({token:Ka,factory:Ka.\u0275fac})};return t=C([x(bl)],t),t})(),Hi=class{itemsContainer;static fToken=Symbol("SortItemsByParentRequest");constructor(i){this.itemsContainer=i}},cb=(()=>{let t=class Ya{_store=d(T);_browser=d(ke);handle({itemsContainer:e}){let n=Array.from(e.children);if(n.length<2)return;let o=this._buildPositions(n),r=this._store.nodes.getAll().filter(l=>e.contains(l.hostElement));if(r.length<2||!r.some(l=>!!l.fParentId()))return;let s=this._buildChildrenByParentId(r),a=new Map;for(let l of r){let h=this._getSortedChildrenBeforeParent(e,o,l,s,a);h.length&&this._moveBeforeNextSibling(e,h,l.hostElement.nextElementSibling)}}_buildPositions(e){let n=new Map;for(let o=0;o<e.length;o++)n.set(e[o],o);return n}_getSortedChildrenBeforeParent(e,n,o,r,s){let a=n.get(o.hostElement);if(a===void 0)return[];let l=this._getDeepChildren(o.fId(),r,s);if(!l.length)return[];let h=[];for(let _ of l){let v=_.hostElement;if(!e.contains(v))continue;let b=n.get(v);b===void 0||b>=a||h.push(v)}return h.sort((_,v)=>(n.get(_)??0)-(n.get(v)??0)),h}_buildChildrenByParentId(e){let n=new Map;for(let o of e){let r=o.fParentId();if(!r)continue;let s=n.get(r)??[];s.push(o),n.set(r,s)}return n}_getDeepChildren(e,n,o){let r=o.get(e);if(r)return r;let s=[],a=[...n.get(e)??[]],l=new Set([e]);for(;a.length;){let h=a.pop();if(!h)continue;let _=h.fId();if(l.has(_))continue;l.add(_),s.push(h);let v=n.get(_);v?.length&&a.push(...v)}return o.set(e,s),s}_moveBeforeNextSibling(e,n,o){let r=this._browser.document.createDocumentFragment();for(let s of n)r.appendChild(s);e.insertBefore(r,o)}static \u0275fac=function(n){return new(n||Ya)};static \u0275prov=g({token:Ya,factory:Ya.\u0275fac})};return t=C([x(Hi)],t),t})(),wl=class{static fToken=Symbol("SortItemLayersRequest")},db=(()=>{let t=class Za{_store=d(T);_mediator=d(R);get _canvas(){return this._store.fCanvas}handle(e){if(!this._canvas)return;let n=this._store.nodes.getAll();n.length<2||!n.some(o=>!!o.fParentId())||(this._mediator.execute(new Hi(this._canvas.fGroupsContainer().nativeElement)),this._mediator.execute(new bl),this._mediator.execute(new Hi(this._canvas.fNodesContainer().nativeElement)))}static \u0275fac=function(n){return new(n||Za)};static \u0275prov=g({token:Za,factory:Za.\u0275fac})};return t=C([x(wl)],t),t})();function Pn(t,i){return i.document.createElementNS("http://www.w3.org/2000/svg",t)}function dt(t,i){return i(t)}function pt(t){return!0}function lb(){return/android|iPad|iPhone|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)}var ub=[...kg,...VC,...Cg,...Ix,...sx,...Vx,...vx,...Yx,...tb,...rb,...$0,qx,W0,Y0,sb,db,cb,ab,Xx,Wx],fb=0,lm=(()=>{class t{_destroyRef=d(Ze);_elementReference=d(Se);_fBrowser=d(ke);_stateChanges=new ct;get hostElement(){return this._elementReference.nativeElement}id=F(`f-pattern-${fb++}`);vColor=F("rgba(0,0,0,0.1)");hColor=F("rgba(0,0,0,0.1)");vSize=F(20,{transform:We});hSize=F(20,{transform:We});_transform=kt.default();_position=A.initialize();_size=ht.initialize(this.hSize(),this.vSize());_pattern;_vLine;_hLine;constructor(){this._createPattern()}_createPattern(){this._pattern=Pn("pattern",this._fBrowser),this._pattern.setAttribute("patternUnits","userSpaceOnUse"),this.hostElement.appendChild(this._pattern),this._vLine=Pn("line",this._fBrowser),this._pattern.appendChild(this._vLine),this._hLine=Pn("line",this._fBrowser),this._pattern.appendChild(this._hLine)}ngOnInit(){this._listenStateChanges()}_listenStateChanges(){new vt(this._stateChanges).pipe(Sl()).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=ht.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,n,o,r,s,a){e.setAttribute("stroke",`${n}`),e.setAttribute("x1",`${o}`),e.setAttribute("x2",`${s}`),e.setAttribute("y1",`${r}`),e.setAttribute("y2",`${a}`)}setTransform(e){this._transform=e,this._refresh()}_refresh(){this._stateChanges.notify()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=te({type:t,selectors:[["f-rect-pattern"]],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.id)},inputs:{id:[1,"id"],vColor:[1,"vColor"],hColor:[1,"hColor"],vSize:[1,"vSize"],hSize:[1,"hSize"]},features:[Re([{provide:Fu,useExisting:t}]),mn],decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})();var hb=new fe("F_BACKGROUND"),pb=(()=>{class t{hostElement=d(Se).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),um=(()=>{class t extends pb{_mediator=d(R);fBackgroundPattern=lo(Fu);ngOnInit(){this._mediator.execute(new Lt(ye.BACKGROUND,this))}ngAfterContentInit(){this._mediator.execute(new Qa(this.fBackgroundPattern()))}setTransform(e){this.fBackgroundPattern()?.setTransform(e)}ngOnDestroy(){this._mediator.execute(new Bt(ye.BACKGROUND))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-background"]],contentQueries:function(n,o,r){n&1&&Cu(r,o.fBackgroundPattern,Fu,5),n&2&&it()},hostAttrs:[1,"f-component","f-background"],features:[Re([{provide:hb,useExisting:t}]),_e],ngContentSelectors:q_,decls:2,vars:0,template:function(n,o){n&1&&(Xt(),Ae(),H(0,"svg"),Me(1),$())},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 Jf=class{position;scale;constructor(i,e){this.position=i,this.scale=e}},mb=new fe("F_CANVAS"),_b=(()=>{class t{transform=kt.default();_fCanvasChange=new ct;destroyRef=d(Ze);getPosition(){return this.transform.position}setPosition(e){this.transform.position=e}emitCanvasChangeEvent(){this._fCanvasChange.notify()}subscribeOnCanvasChange(){new vt(this._fCanvasChange).pipe(Ja(this.debounce())).listen(this.destroyRef,()=>{this.fCanvasChange.emit(new Jf(A.sum(this.transform.position,this.transform.scaledPosition),this.transform.scale))})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),ji=(()=>{class t extends _b{_mediator=d(R);_componentsStore=d(T);_elementReference=d(Se);_injector=d(Ye);_flowId;fCanvasChange=je();position=F(A.initialize(),{transform:A.castToPoint});scale=F(1,{transform:We});debounceTime=F(0,{transform:We});debounce=E(()=>this.debounceTime()<0?0:this.debounceTime());get hostElement(){return this._elementReference.nativeElement}fGroupsContainer=Ie.required("fGroupsContainer");fNodesContainer=Ie.required("fNodesContainer");fConnectionsContainer=Ie.required("fConnectionsContainer");get flowId(){return this._flowId||""}ngOnInit(){this._flowId=this._mediator.execute(new nl).fId(),this._mediator.execute(new tc(this)),this._positionChange(),this._scaleChange(),super.subscribeOnCanvasChange()}_positionChange(){me(()=>{this._mediator.execute(new oc(this.transform,this.position()))},{injector:this._injector})}_scaleChange(){me(()=>{this._mediator.execute(new rc(this.transform,this.scale()))},{injector:this._injector})}redraw(){this._mediator.execute(new ai(this.transform)),this.hostElement.style.removeProperty("transition"),this.hostElement.style.transform=kt.toString(this.transform),this._mediator.execute(new At)}redrawWithAnimation(){this._mediator.execute(new ai(this.transform)),this.hostElement.style.transition=`transform ${lb()?80:150}ms ease-in-out`,this.hostElement.style.transform=kt.toString(this.transform),Ip(this.hostElement,()=>this.redraw())}centerGroupOrNode(e,n=!0){this._afterRedraw(()=>{this._mediator.execute(new nc(e,n))})}fitToScreen(e=A.initialize(),n=!0){this._afterRedraw(()=>{this._mediator.execute(new ic(e,n))})}resetScaleAndCenter(e=!0){this._afterRedraw(()=>{this._mediator.execute(new cc(e))})}getScale(){return this.transform.scale||1}setScale(e,n=A.initialize()){this._mediator.execute(new dc(e,n))}resetScale(){this._mediator.execute(new ac)}ngOnDestroy(){this._mediator.execute(new sc)}_afterRedraw(e){this._mediator.execute(new Vi(this._componentsStore.connectionsRevision,this._componentsStore.nodesRevision,()=>Sh(e,{injector:this._injector}),this.destroyRef))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-canvas"]],viewQuery:function(n,o){n&1&&ft(o.fGroupsContainer,X_,5)(o.fNodesContainer,K_,5)(o.fConnectionsContainer,Y_,5),n&2&&it(3)},hostAttrs:[1,"f-component","f-canvas"],inputs:{position:[1,"position"],scale:[1,"scale"],debounceTime:[1,"debounceTime"]},outputs:{fCanvasChange:"fCanvasChange"},features:[Re([{provide:mb,useExisting:t}]),_e],ngContentSelectors:Q_,decls:12,vars:0,consts:[["fGroupsContainer",""],["fConnectionsContainer",""],["fNodesContainer",""],[1,"f-connections-container"]],template:function(n,o){n&1&&(Xt(Z_),ao(0),H(1,"div",null,0),Me(3),$(),H(4,"div",3,1),Me(6,1),Me(7,2),Me(8,3),$(),H(9,"div",null,2),Me(11,4),$(),co())},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 gb=0,fm=(()=>{class t extends E0{fId=F(`f-connection-${gb++}`,{alias:"fConnectionId"});fOutputId=F("",{transform:e=>On(e)||""});fInputId=F("",{transform:e=>On(e)||""});fRadius=8;fOffset=12;fBehavior=Ot.FIXED;fType=Nt.STRAIGHT;fSelectionDisabled=F(!1,{transform:xe});fReassignableStart=F(!1,{transform:xe});fDraggingDisabled=F(!1,{alias:"fReassignDisabled",transform:xe});fInputSide=F(qe.DEFAULT,{transform:e=>In(e,"fInputSide",qe)});fOutputSide=F(qe.DEFAULT,{transform:e=>In(e,"fOutputSide",qe)});get boundingElement(){return this.fPath().hostElement}_mediator=d(R);ngOnInit(){this._mediator.execute(new lc(this))}ngOnChanges(){this._mediator.execute(new tn)}ngOnDestroy(){this._mediator.execute(new Nc(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-connection"]],hostAttrs:[1,"f-component","f-connection"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("id",o.fId()),de("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",We],fOffset:[2,"fOffset","fOffset",We],fBehavior:[2,"fBehavior","fBehavior",e=>In(e,"fBehavior",Ot)],fType:"fType",fSelectionDisabled:[1,"fSelectionDisabled"],fReassignableStart:[1,"fReassignableStart"],fDraggingDisabled:[1,"fReassignDisabled","fDraggingDisabled"],fInputSide:[1,"fInputSide"],fOutputSide:[1,"fOutputSide"]},exportAs:["fComponent"],standalone:!1,features:[Re([{provide:Il,useExisting:t}]),_e,mn],ngContentSelectors:eg,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(n,o){if(n&1&&(Xt(J_),Ae(),u(0,"svg",1),B(1,"defs",null,0),Me(3),u(4,"g",2),w(5,tg,1,1,":svg:linearGradient",3),B(6,"path",4),u(7,"g"),B(8,"path",5),w(9,ng,1,0,":svg:circle",6),B(10,"circle",7),f()()(),Me(11,1),Me(12,2),Me(13,3),w(14,ig,1,0)),n&2){let r;c(5),S((r=o.fGradient())?5:-1,r),c(),Z("d",o.path),c(2),P("useGradient",!!o.fGradient()),Z("d",o.path),c(),S(o.fReassignableStart()?9:-1),c(5),S(o.fContents().length?14:-1)}},dependencies:[ef,w0,S0,g0,b0],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 yb=new fe("F_MAGNETIC_LINES"),vb=(()=>{class t{hostElement=d(Se).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})();var hm=(()=>{class t extends vb{threshold=F(10,{transform:We,alias:"fAlignThreshold"});_mediator=d(R);ngOnInit(){this._mediator.execute(new Lt(ye.MAGNETIC_LINES,this))}ngOnDestroy(){this._mediator.execute(new Bt(ye.MAGNETIC_LINES))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-line-alignment"]],hostAttrs:[1,"f-line-alignment","f-component"],inputs:{threshold:[1,"fAlignThreshold","threshold"]},exportAs:["fComponent"],standalone:!1,features:[Re([{provide:yb,useExisting:t}]),_e],decls:0,vars:0,template:function(n,o){},styles:[og]})}return t})();var Ru=(()=>{class t{fMinSize=F(1e3);_mediator=d(R);hostElement=d(Se).nativeElement;model=new Cl(this.hostElement);redraw(){let{scale:e,viewBox:n}=this._mediator.execute(new yl(this.hostElement,this.fMinSize()));this.model=new Cl(this.hostElement,e,n),Wh(n,this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,selectors:[["svg","fMinimapFlow",""]],inputs:{fMinSize:[1,"fMinSize"]}})}return t})(),Nu=(()=>{class t{_mediator=d(R);_elementRef=d(Se);hostElement=this._elementRef.nativeElement;redraw(){this.clear();let e=this._elementRef.nativeElement.ownerDocument.createDocumentFragment();this._mediator.execute(new gl).forEach(n=>{e.appendChild(n)}),this.hostElement.appendChild(e)}clear(){this.hostElement.replaceChildren()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,selectors:[["g","fMinimapCanvas",""]]})}return t})(),Ou=(()=>{class t{_mediator=d(R);hostElement=d(Se).nativeElement;redraw(){wu(this._mediator.execute(new vl),this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,selectors:[["rect","fMinimapView",""]],hostAttrs:[1,"f-component","f-minimap-view"]})}return t})(),Cb=new fe("F_MINIMAP_BASE"),xb=(()=>{class t{hostElement=d(Se).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),pm=(()=>{class t extends xb{_destroyRef=d(Ze);_mediator=d(R);_browser=d(ke);_store=d(T);_canvas=Ie.required(Nu);_flow=Ie.required(Ru);_minimapView=Ie.required(Ou);fMinSize=F(1e3);fNodeRenderLimit=F(1500,{transform:We});get state(){return this._flow().model}ngOnInit(){this._mediator.execute(new Lt(ye.MINIMAP,this))}ngAfterViewInit(){this._listenTransformChanges()}_listenTransformChanges(){this._mediator.execute(new ec).pipe(Sl(),cg()).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 Bt(ye.MINIMAP))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-minimap"]],viewQuery:function(n,o){n&1&&ft(o._canvas,Nu,5)(o._flow,Ru,5)(o._minimapView,Ou,5),n&2&&it(3)},hostAttrs:[1,"f-component","f-minimap"],inputs:{fMinSize:[1,"fMinSize"],fNodeRenderLimit:[1,"fNodeRenderLimit"]},exportAs:["fComponent"],features:[Re([{provide:Cb,useExisting:t}]),_e],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(n,o){n&1&&(Ae(),u(0,"svg",0),B(1,"g",1)(2,"rect",2),f()),n&2&&P("fMinSize",o.fMinSize())},dependencies:[Ru,Nu,Ou],styles:["[_nghost-%COMP%]{display:block;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}return t})();var bb=(()=>{class t{hostElement=d(Se).nativeElement;initialize(){this.hostElement.style.display="none"}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Ee({type:t,standalone:!1})}return t})(),mm=(()=>{class t extends bb{_mediator=d(R);fTrigger=e=>e.shiftKey;ngOnInit(){this._mediator.execute(new Lt(ye.SELECTION_AREA,this)),super.initialize()}ngOnDestroy(){this._mediator.execute(new Bt(ye.SELECTION_AREA))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-selection-area"]],hostAttrs:[1,"f-selection-area","f-component"],inputs:{fTrigger:"fTrigger"},features:[_e],decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{position:absolute}"]})}return t})();var wb=0,Sb=120,Ui=(()=>{class t extends Qf{_destroyRef=d(Ze);_mediator=d(R);_browser=d(ke);_componentsStore=d(T);_cache=d(Ct);_injector=d(Ye);fId=F(`f-flow-${wb++}`,{alias:"fFlowId"});fCache=F(!1,{transform:xe});hostElement=d(Se).nativeElement;fNodesRendered=je();fFullRendered=je();fLoaded=je();ngOnInit(){this._mediator.execute(new tl(this)),this._listenCacheChanges()}ngAfterContentInit(){this._browser.isBrowser()&&(this._listenNodesChanges(),this._listenConnectionsChanges())}_listenCacheChanges(){me(()=>{this._cache.enabled=this.fCache()},{injector:this._injector})}_listenNodesChanges(){new vt(this._componentsStore.nodesChanges$,this._componentsStore.progressiveRenderChanges$).pipe(Sl(),Ja(Sb),ag()).listen(this._destroyRef,()=>{this._mediator.execute(new jt)||this._componentsStore.hasPendingProgressiveRender||(this._mediator.execute(new wl),this._mediator.execute(new sl),this._mediator.execute(new Vi(this._componentsStore.connectionsRevision+1,this._componentsStore.nodesRevision,()=>this._mediator.execute(new al),this._destroyRef)),this._mediator.execute(new tn))})}_listenConnectionsChanges(){this._mediator.execute(new Tn).listen(this._destroyRef,()=>{if(!this._mediator.execute(new jt)){if(this._componentsStore.isViewportAnimating){this._mediator.execute(new dl(this._destroyRef));return}this._mediator.execute(new mi)}})}redraw(){this._mediator.execute(new tn)}reset(){this._mediator.execute(new cl)}getNodesBoundingBox(){return this._mediator.execute(new Zd)}getSelection(){return this._mediator.execute(new Gi)}getPositionInFlow(e){return this._mediator.execute(new xl(e))}getState(e){return this._mediator.execute(new ol(e?.measuredSize??!1))}selectAll(){this._mediator.execute(new Tn).pipe(Qh()).listen(this._destroyRef,()=>{this._mediator.execute(new hl)})}select(e,n,o=!0){this._mediator.execute(new Tn).pipe(Qh()).listen(this._destroyRef,()=>{this._mediator.execute(new fl(e,n,o))})}clearSelection(){this._mediator.execute(new ll)}ngOnDestroy(){this._mediator.execute(new rl(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-flow"]],hostAttrs:[1,"f-component","f-flow"],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.fId())},inputs:{fId:[1,"fFlowId","fId"],fCache:[1,"fCache"]},outputs:{fNodesRendered:"fNodesRendered",fFullRendered:"fFullRendered",fLoaded:"fLoaded"},features:[Re([R,..._g,Fp,jn,...ub,Y,...LC,{provide:ih,useExisting:t}]),_e],ngContentSelectors:sg,decls:7,vars:0,template:function(n,o){n&1&&(Xt(rg),ao(0),Me(1),Me(2,1),Me(3,2),Me(4,3),Me(5,4),Me(6,5),co())},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 _m=(()=>{class t{fVirtualForOf=[];fVirtualForTrackBy;_vc=d(ro);_tpl=d(Ih);_zone=d(Qn);_componentsStore=d(T,{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 n=0;this._startProgressiveRender(),this._zone.runOutsideAngular(()=>{let o=()=>{let r=performance.now();for(;n<this.fVirtualForOf.length&&performance.now()-r<10;){let s=this.fVirtualForOf[n],a=this._vc.createEmbeddedView(this._tpl,{$implicit:s,index:n});this._views.push(a),n++}if(n<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(n){return new(n||t)};static \u0275dir=Ee({type:t,selectors:[["","fVirtualFor","","fVirtualForOf",""]],inputs:{fVirtualForOf:"fVirtualForOf",fVirtualForTrackBy:"fVirtualForTrackBy"},features:[mn]})}return t})();var Tt=(function(t){return t[t.ZOOM_IN=1]="ZOOM_IN",t[t.ZOOM_OUT=-1]="ZOOM_OUT",t})(Tt||{}),Ib=new fe("F_ZOOM"),eh=class{},Tb=.1,Eb=1,Pb=.5,Mb=60,Db=.5;function kb(t){return Math.abs(t.deltaY)>=Math.abs(t.deltaX)?t.deltaY:t.deltaX}function Rb(t,i,e){return Nb(t)?Fb(i,e):Ob(i,e)}function Nb(t){return(t.ctrlKey||t.metaKey)&&t.deltaMode===WheelEvent.DOM_DELTA_PIXEL}function Ob(t,i){let e=Math.abs(t)/100,n=gm(e,Tb,Eb);return i*n}function Fb(t,i){if(Math.abs(t)<Pb)return 0;let e=Math.abs(t)/Mb,n=gm(e,0,Db);return i*n}function gm(t,i,e){return Math.max(i,Math.min(e,t))}var $i=(()=>{class t extends eh{_mediator=d(R);_injector=d(Ye);_store=d(T);_triggersListener=he.emptyListener();isEnabled=F(!1,{alias:"fZoom",transform:xe});fWheelTrigger=pt;fDblClickTrigger=pt;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 Lt(ye.ZOOM,this))}ngAfterViewInit(){this._listenZoomEnabledChanges()}_listenZoomEnabledChanges(){me(()=>{this.isEnabled(),gt(()=>this._listenTriggers())},{injector:this._injector})}_listenTriggers(){this._flowHost&&(this._disposeListeners(),this.isEnabled()&&(this._listen("wheel",this._onWheel,he.activeListener()),this._listen("dblclick",this._onDoubleClick),this._triggersListener=()=>{this._unlisten("wheel",this._onWheel,he.activeListener()),this._unlisten("dblclick",this._onDoubleClick)}))}_onWheel=e=>{if(!dt(e,this.fWheelTrigger)||(e.preventDefault(),e.target?.closest("[fLockedContext]")))return;let o=kb(e);if(o===0)return;let r=this._normalizeWheelStep(e,o);r!==0&&this.setZoom(A.initialize(e.clientX,e.clientY),r,this._calculateDirection(o),!1)};_normalizeWheelStep(e,n){return Rb(e,n,this.step)}_calculateDirection(e){return e>0?Tt.ZOOM_OUT:Tt.ZOOM_IN}_onDoubleClick=e=>{if(!dt(e,this.fDblClickTrigger))return;e.preventDefault();let n=e.target;Zy(n)||n?.closest("[fLockedContext]")||this.setZoom(A.initialize(e.clientX,e.clientY),this.dblClickStep,Tt.ZOOM_IN,!0)};_getToCenterPosition(e,n){return A.initialize(e?.x||n.gravityCenter.x,e?.y||n.gravityCenter.y)}zoomIn(e){this._onZoomToCenter(Tt.ZOOM_IN,e)}zoomOut(e){this._onZoomToCenter(Tt.ZOOM_OUT,e)}_onZoomToCenter(e,n){this.setZoom(this._getToCenterPosition(n,G.fromElement(this._flowHost)),this.step,e,!1)}setZoom(e,n,o,r){this._mediator.execute(new _l(e,n,o,r))}getZoomValue(){return this._canvas.transform.scale||1}reset(){this._mediator.execute(new ml)}_disposeListeners(){this._triggersListener(),this._triggersListener=he.emptyListener()}ngOnDestroy(){this._disposeListeners(),this._mediator.execute(new Bt(ye.ZOOM))}_listen(e,n,o){this._flowHost.addEventListener(e,n,o)}_unlisten(e,n,o){this._flowHost.removeEventListener(e,n,o)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Ee({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",We],maximum:[2,"fZoomMaximum","maximum",We],step:[2,"fZoomStep","step",We],dblClickStep:[2,"fZoomDblClickStep","dblClickStep",We]},features:[Re([{provide:Ib,useExisting:t}]),_e]})}return t})();var ym=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=so({type:t});static \u0275inj=no({imports:[uo]})}return t})();var oh={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)"},panel:{resizeLabel:"Resize panel"},resetLayoutConfirm:"Reset all node positions to the automatic layout? This cannot be undone."};var kl={graph:{perf:{cache:!0,virtualization:!1},perfHud:!0}};var vm={a11y:{toolbarLabel:"Toggle node kinds"},favorites:{label:"Favorites"}};function Lb(t,i){if(t&1&&Pt(0,"i",4),t&2){let e=p();Ce(e.piClass()),at("font-size",e.size(),"px")}}function Bb(t,i){if(t&1&&(Ae(),H(0,"svg",1),Pt(1,"path"),$()),t&2){let e=p();Z("width",e.size())("height",e.size()),c(),Z("d",e.svgPath())}}function zb(t,i){if(t&1&&(H(0,"span",4),m(1),$()),t&2){let e=p();at("font-size",e.size(),"px")("line-height",e.size(),"px"),c(),y(e.emoji())}}function Vb(t,i){if(t&1&&(H(0,"span",5),m(1),$()),t&2){let e=p();at("font-size",e.size(),"px")("line-height",e.size(),"px"),c(),y(e.letter())}}var Ut=class t{kindRegistry=d(Dt);kind=F.required();size=F(18);variant=E(()=>{let i=this.kindRegistry.lookup(this.kind());return i?.icon?.kind==="pi"?"pi":i?.icon?.kind==="svg"?"svg":i?.emoji?"emoji":"letter"});piClass=E(()=>{let i=this.kindRegistry.lookup(this.kind())?.icon;return i?.kind==="pi"?`pi ${i.id}`:""});svgPath=E(()=>{let i=this.kindRegistry.lookup(this.kind())?.icon;return i?.kind==="svg"?i.path:""});emoji=E(()=>this.kindRegistry.lookup(this.kind())?.emoji??"");letter=E(()=>this.kindRegistry.labelOf(this.kind()).charAt(0).toUpperCase());static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["sm-kind-icon"]],inputs:{kind:[1,"kind"],size:[1,"size"]},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,n){if(e&1&&w(0,Lb,1,4,"i",0)(1,Bb,2,3,":svg:svg",1)(2,zb,2,5,"span",2)(3,Vb,2,5,"span",3),e&2){let o;S((o=n.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 jb=(t,i)=>i.kind;function Ub(t,i){if(t&1&&(B(0,"sm-kind-icon",5),u(1,"span"),m(2),f()),t&2){let e=p().$implicit;P("kind",e.kind)("size",16),c(2),y(e.count)}}function $b(t,i){if(t&1){let e=ae();u(0,"p-togglebutton",4),K("ngModelChange",function(){let o=j(e).$implicit,r=p();return U(r.toggle(o.kind))}),Pe(1,Ub,3,3,"ng-template",null,0,ei),f()}if(t&2){let e=i.$implicit,n=p();P("ngModel",n.isActive(e.kind))("pTooltip",e.label)("ariaLabel",e.label)("styleClass","kind-palette__btn kind-palette__btn--"+e.kind),Z("data-testid","kind-palette-"+e.kind)}}function Wb(t,i){if(t&1&&(B(0,"i",7),u(1,"span"),m(2),f()),t&2){let e=p(2);Ce(e.favoritesActive()?"pi pi-heart-fill":"pi pi-heart"),c(2),y(e.favoritesCount())}}function qb(t,i){if(t&1){let e=ae();u(0,"p-togglebutton",6),K("ngModelChange",function(){j(e);let o=p();return U(o.toggleFavoritesOnly())}),Pe(1,Wb,3,3,"ng-template",null,0,ei),f()}if(t&2){let e=p();P("ngModel",e.favoritesActive())("pTooltip",e.texts.favorites.label)("ariaLabel",e.texts.favorites.label)}}var Rl=class t{loader=d(Mt);filters=d(vo);kindRegistry=d(Dt);texts=vm;entries=E(()=>{let i=new Map;for(let e of this.loader.nodes())i.set(e.kind,(i.get(e.kind)??0)+1);return this.kindRegistry.kinds().map(e=>({kind:e.name,label:e.label,count:i.get(e.name)??0}))});favoritesCount=E(()=>this.loader.nodes().filter(i=>i.isFavorite===!0).length);showFavorites=E(()=>this.loader.hasAnyFavorites()||this.filters.favoritesOnly());favoritesActive=E(()=>this.filters.favoritesOnly());isActive(i){return this.filters.isKindActive(i)}toggle(i){this.filters.toggleKind(i)}toggleFavoritesOnly(){this.filters.setFavoritesOnly(!this.filters.favoritesOnly())}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-kind-palette"]],decls:4,vars:2,consts:[["content",""],["role","toolbar","data-testid","kind-palette",1,"kind-palette"],[3,"ngModel","pTooltip","ariaLabel","styleClass"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModel","pTooltip","ariaLabel"],[3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass"],[3,"kind","size"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModelChange","ngModel","pTooltip","ariaLabel"],["aria-hidden","true"]],template:function(e,n){e&1&&(u(0,"div",1),J(1,$b,3,5,"p-togglebutton",2,jb),w(3,qb,3,3,"p-togglebutton",3),f()),e&2&&(Z("aria-label",n.texts.a11y.toolbarLabel),c(),ee(n.entries()),c(2),S(n.showFavorites()?3:-1))},dependencies:[bo,Co,xo,So,wo,Ue,Qe,Ut],styles:["[_nghost-%COMP%]{position:absolute;top:16px;left:16px;z-index:2;pointer-events:none}.kind-palette[_ngcontent-%COMP%]{pointer-events:auto;display:flex;flex-direction:column;gap:2px;padding:4px;background:var(--sm-bg-content);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: 999px;--p-togglebutton-content-border-radius: 999px;--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__btn .p-togglebutton-content{width:100%;height:100%;justify-content:flex-start;display:flex;align-items:center;gap:.4rem}[_nghost-%COMP%] .kind-palette__btn .p-togglebutton-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 Wi={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",tools:"tools",tags:"tags"},stats:{errors:t=>`${t} error${t===1?"":"s"}`,warns:t=>`${t} warning${t===1?"":"s"}`,tools:t=>`${t} tool${t===1?"":"s"}`,toolsBreakdown:(t,i)=>`${t} allowlist + ${i} pre-approved`,linksIn:t=>`${t} incoming link${t===1?"":"s"}`,linksOut:t=>`${t} outgoing link${t===1?"":"s"}`,extRefs:t=>`${t} external URL${t===1?"":"s"} in body`,bytes:t=>`${t.toLocaleString("en-US")} bytes`,tokens:t=>`${t.toLocaleString("en-US")} tokens`,daysAgo:(t,i)=>`updated ${t} (${i} day${i===1?"":"s"} ago)`},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."},safety:{injection:t=>`injection${t?`: ${t}`:""}`},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"};function Nl(t){if(!t)return null;let i=t.sidecar?.annotations;if(i&&typeof i.version=="number")return`v${i.version}`;let e=Zt(t.frontmatter)?.version;return typeof e=="string"&&e.length>0?`v${e}`:null}function Ol(t){if(!t)return null;let e=t.sidecar?.annotations?.stability;if(e==="stable"||e==="experimental"||e==="deprecated")return e;let n=Zt(t.frontmatter)?.stability;return n==="stable"||n==="experimental"||n==="deprecated"?n:null}function Cm(t){if(!t)return null;let i=t.sidecar?.root?.audit;if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i.lastBumpedAt;if(typeof e!="string"||e.length===0)return null;let n=new Date(e);if(isNaN(n.getTime()))return null;let o=Math.max(0,Math.floor((Date.now()-n.getTime())/864e5));return{short:`${o}d`,iso:e,days:o}}function rh(t){if(!t)return{agentTools:0,skillBaseAllowedTools:0};let i=t.frontmatter,e=t.kind==="agent"&&Array.isArray(i.tools)?i.tools.length:0,n=0;if(t.kind==="skill"||t.kind==="command"){let o=i["allowed-tools"];Array.isArray(o)?n=o.length:typeof o=="string"&&o.length>0&&(n=1)}return{agentTools:e,skillBaseAllowedTools:n}}function xm(t){let{agentTools:i,skillBaseAllowedTools:e}=rh(t);return i+e}function bm(t){if(!t)return[];let i=t.frontmatter,e=[];if(t.kind==="agent"&&Array.isArray(i.tools))for(let n of i.tools)typeof n=="string"&&n.length>0&&e.push(n);if(t.kind==="skill"||t.kind==="command"){let n=i["allowed-tools"];if(Array.isArray(n))for(let o of n)typeof o=="string"&&o.length>0&&e.push(o);else typeof n=="string"&&n.length>0&&e.push(n)}return e}function Fl(t){return yo(t?.sidecar)}function Al(t,i){switch(t?.sidecar?.status){case"stale-body":return i.staleBody;case"stale-frontmatter":return i.staleFrontmatter;case"stale-both":return i.staleBoth;default:return""}}function sh(t){return t<1e3?`${t}`:t<1e4?`${(t/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${Math.round(t/1e3)}k`}function wm(t){let i=new Date(t);if(isNaN(i.getTime()))return t;let e=Date.now()-i.getTime(),n=Math.floor(e/1e3);if(n<60)return"just now";let o=Math.floor(n/60);if(o<60)return`${o} minute${o===1?"":"s"} ago`;let r=Math.floor(o/60);if(r<24)return`${r} hour${r===1?"":"s"} ago`;let s=Math.floor(r/24);if(s<30)return`${s} day${s===1?"":"s"} ago`;let a=Math.floor(s/30);if(a<12)return`${a} month${a===1?"":"s"} ago`;let l=Math.floor(s/365);return`${l} year${l===1?"":"s"} ago`}var Xb=(t,i)=>i.source+":"+i.tag,Kb=(t,i)=>i.step,Yb=(t,i)=>i.ruleId+i.message;function Zb(t,i){if(t&1&&(u(0,"span",31),m(1),f()),t&2){let e=p(),n=Q(0),o=Q(2);Ce("sm-gnode__llm-marker--"+o),P("pTooltip",e.texts.confidence(n.confidence)),c(),He("",e.confidencePct(),"%")}}function Qb(t,i){t&1&&(u(0,"span",8),m(1),f()),t&2&&(c(),y(i))}function Jb(t,i){if(t&1&&(u(0,"span",12)(1,"span",32),m(2,"T"),f(),m(3),f()),t&2){let e=p(),n=Q(1);P("pTooltip",e.texts.stats.tokens(n.tokensTotal)),c(3),y(e.tokensShort())}}function ew(t,i){if(t&1&&(u(0,"span",13)(1,"span",32),m(2,"B"),f(),m(3),f()),t&2){let e=p(),n=Q(1);P("pTooltip",e.texts.stats.bytes(n.bytesTotal)),c(3),y(e.bytesShort())}}function tw(t,i){if(t&1&&(u(0,"span",14),B(1,"i",33),m(2),f()),t&2){let e=i,n=p();P("pTooltip",n.texts.stats.daysAgo(e.iso,e.days)),c(2),y(e.short)}}function nw(t,i){if(t&1&&(u(0,"span",36),m(1),f()),t&2){let e=i.$implicit;de("sm-gnode__tag-chip--author",e.source==="author")("sm-gnode__tag-chip--user",e.source==="user"),Z("data-tag-source",e.source),c(),y(e.tag)}}function iw(t,i){if(t&1&&(u(0,"span",35),m(1),f()),t&2){p(2);let e=Q(4);c(),He("+",e," more")}}function ow(t,i){if(t&1&&(u(0,"div",17),J(1,nw,2,6,"span",34,Xb),w(3,iw,2,1,"span",35),f()),t&2){p();let e=Q(3),n=Q(4);c(),ee(e),c(2),S(n>0?3:-1)}}function rw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItCovers)}}function sw(t,i){if(t&1&&(u(0,"span",40),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function aw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"div",39),J(4,sw,2,1,"span",40,we),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.topics.tooltip),c(),y(n.texts.llm.topics.label),c(2),ee(e.topics)}}function cw(t,i){if(t&1&&(u(0,"span",40),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function dw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"div",39),J(4,cw,2,1,"span",40,we),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.facts.tooltip),c(),y(n.texts.llm.facts.label),c(2),ee(e.keyFacts)}}function lw(t,i){if(t&1&&(w(0,rw,5,3,"div",37),w(1,aw,6,2,"div",37),w(2,dw,6,2,"div",37)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.topics!=null&&e.topics.length?1:-1),c(),S(e.keyFacts!=null&&e.keyFacts.length?2:-1)}}function uw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItDoes)}}function fw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.when.tooltip),c(),y(n.texts.llm.when.label),c(2),y(e.whenToUse)}}function hw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.style.tooltip),c(),y(n.texts.llm.style.label),c(2),y(e.interactionStyle)}}function pw(t,i){if(t&1&&(u(0,"span",40),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function mw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"div",39),J(4,pw,2,1,"span",40,we),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.does.tooltip),c(),y(n.texts.llm.does.label),c(2),ee(e.capabilities)}}function _w(t,i){if(t&1&&(w(0,uw,5,3,"div",37),w(1,fw,5,3,"div",37),w(2,hw,5,3,"div",37),w(3,mw,6,2,"div",37)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.whenToUse?1:-1),c(),S(e.interactionStyle?2:-1),c(),S(e.capabilities!=null&&e.capabilities.length?3:-1)}}function gw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItDoes)}}function yw(t,i){if(t&1&&m(0),t&2){let e=i.$implicit,n=i.$index,o=i.$count;Dh("",e.step,". ",e.description,"",n===o-1?"":" \xB7 ")}}function vw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"span"),J(4,yw,1,3,null,null,Kb),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.steps.tooltip),c(),y(n.texts.llm.steps.label),c(2),ee(e.recipe)}}function Cw(t,i){if(t&1&&(u(0,"span",40),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function xw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"div",39),J(4,Cw,2,1,"span",40,we),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.pre.tooltip),c(),y(n.texts.llm.pre.label),c(2),ee(e.preconditions)}}function bw(t,i){if(t&1&&(u(0,"span",40),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function ww(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"div",39),J(4,bw,2,1,"span",40,we),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.out.tooltip),c(),y(n.texts.llm.out.label),c(2),ee(e.outputs)}}function Sw(t,i){if(t&1&&(u(0,"span",40),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function Iw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"div",39),J(4,Sw,2,1,"span",40,we),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.fx.tooltip),c(),y(n.texts.llm.fx.label),c(2),ee(e.sideEffects)}}function Tw(t,i){if(t&1&&(w(0,gw,5,3,"div",37),w(1,vw,6,2,"div",37),w(2,xw,6,2,"div",37),w(3,ww,6,2,"div",37),w(4,Iw,6,2,"div",37)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.recipe!=null&&e.recipe.length?1:-1),c(),S(e.preconditions!=null&&e.preconditions.length?2:-1),c(),S(e.outputs!=null&&e.outputs.length?3:-1),c(),S(e.sideEffects!=null&&e.sideEffects.length?4:-1)}}function Ew(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItDoes)}}function Pw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"code",41),m(4),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.eg.tooltip),c(),y(n.texts.llm.eg.label),c(2),y(e.invocationExample)}}function Mw(t,i){if(t&1&&(u(0,"span",40),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function Dw(t,i){if(t&1&&(u(0,"div",37)(1,"span",38),m(2),f(),u(3,"div",39),J(4,Mw,2,1,"span",40,we),f()()),t&2){let e=p(),n=p(2);c(),P("pTooltip",n.texts.llm.fx.tooltip),c(),y(n.texts.llm.fx.label),c(2),ee(e.sideEffects)}}function kw(t,i){if(t&1&&(w(0,Ew,5,3,"div",37),w(1,Pw,5,3,"div",37),w(2,Dw,6,2,"div",37)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.invocationExample?1:-1),c(),S(e.sideEffects!=null&&e.sideEffects.length?2:-1)}}function Rw(t,i){if(t&1&&(u(0,"div",19),w(1,lw,3,3),w(2,_w,4,4),w(3,Tw,5,5),w(4,kw,3,3),f()),t&2){let e,n,o,r,s=p();c(),S((e=s.summaryMarkdown())?1:-1,e),c(),S((n=s.summaryAgent())?2:-1,n),c(),S((o=s.summarySkill())?3:-1,o),c(),S((r=s.summaryCommand())?4:-1,r)}}function Nw(t,i){if(t&1&&(u(0,"div",20),m(1),f()),t&2){let e=p();c(),y(e.description())}}function Ow(t,i){if(t&1&&(u(0,"div",42)(1,"div",43)(2,"span",44),m(3),f(),u(4,"span",45),m(5),f()()()),t&2){let e=p(),n=p();c(3),y(n.texts.meta.model),c(2),y(e.model)}}function Fw(t,i){t&1&&w(0,Ow,6,2,"div",42),t&2&&S(i.model?0:-1)}function Aw(t,i){if(t&1&&(u(0,"div",47),B(1,"i",48),u(2,"code",49),m(3),f(),u(4,"span",50),m(5),f()()),t&2){let e=i.$implicit;Ce("sm-gnode__issue--"+e.severity),P("pTooltip",e.detail??e.ruleId+" \xB7 "+e.message),c(),de("pi",!0)("pi-times-circle",e.severity==="error")("pi-exclamation-triangle",e.severity==="warn"),c(2),y(e.ruleId),c(2),y(e.message)}}function Lw(t,i){if(t&1&&(u(0,"div",21),J(1,Aw,6,11,"div",46,Yb),f()),t&2){let e=p();c(),ee(e.visibleIssues())}}function Bw(t,i){if(t&1&&(u(0,"span",25),B(1,"i",51),u(2,"span",52),m(3),f()()),t&2){let e=p();P("pTooltip",e.texts.stats.errors(e.errorCount())),c(3),y(e.errorCount())}}function zw(t,i){if(t&1&&(u(0,"span",26),B(1,"i",53),u(2,"span",52),m(3),f()()),t&2){let e=p();P("pTooltip",e.texts.stats.warns(e.warnCount())),c(3),y(e.warnCount())}}function Vw(t,i){if(t&1&&(u(0,"span",27),B(1,"i",54),u(2,"span",52),m(3),f()()),t&2){let e=p();P("pTooltip",e.toolsTooltip()),c(3),y(e.toolsCount())}}function Gw(t,i){if(t&1&&(u(0,"span",28),B(1,"i",55),u(2,"span",52),m(3),f()()),t&2){let e=p();P("pTooltip",e.texts.stats.linksIn(e.linksIn())),c(3),y(e.linksIn())}}function Hw(t,i){if(t&1&&(u(0,"span",29),B(1,"i",56),u(2,"span",52),m(3),f()()),t&2){let e=p();P("pTooltip",e.texts.stats.linksOut(e.linksOut())),c(3),y(e.linksOut())}}function jw(t,i){if(t&1&&(u(0,"span",27),B(1,"i",57),u(2,"span",52),m(3),f()()),t&2){let e=p(),n=Q(1);P("pTooltip",e.texts.stats.extRefs(n.externalRefsCount)),c(3),y(n.externalRefsCount)}}function Uw(t,i){if(t&1&&(u(0,"span",58),B(1,"i",60),f()),t&2){let e=p(2);P("pTooltip",e.sidecarTooltip()),Z("data-testid","node-card-stale-badge")}}function $w(t,i){if(t&1&&(u(0,"span",27),Ae(),u(1,"svg",61),B(2,"path",62)(3,"path",63)(4,"path",64),f()()),t&2){let e=p(2);P("pTooltip",e.texts.stability.experimental)}}function Ww(t,i){if(t&1&&(u(0,"span",27),B(1,"i",65),f()),t&2){let e=p(2);P("pTooltip",e.texts.stability.deprecated)}}function qw(t,i){if(t&1&&(u(0,"span",59),Ae(),u(1,"svg",61),B(2,"path",66)(3,"line",67)(4,"line",68),f()()),t&2){let e=p(2);P("pTooltip",e.texts.safety.injection(e.injectionType()))}}function Xw(t,i){if(t&1&&(u(0,"div",30),w(1,Uw,2,2,"span",58),w(2,$w,5,1,"span",27),w(3,Ww,2,1,"span",27),w(4,qw,5,1,"span",59),f()),t&2){let e=p();c(),S(e.isStale()?1:-1),c(),S(e.stability()==="experimental"?2:-1),c(),S(e.stability()==="deprecated"?3:-1),c(),S(e.hasInjection()?4:-1)}}var Ll=class t{node=F.required();stats=F({linksIn:0,linksOut:0});summary=F(null);issues=F([]);selected=F(!1);highlighted=F(!1);dimmed=F(!1);isFavorite=F(!1);favoriteToggle=je();texts=Wi;showLlmWhat=!1;showLlmConfidence=!1;expanded=Kt(!1);fmAgent=E(()=>{let i=this.node();return i.kind==="agent"?i.frontmatter:null});summaryAgent=E(()=>{let i=this.summary();return i?.kind==="agent"?i:null});summarySkill=E(()=>{let i=this.summary();return i?.kind==="skill"?i:null});summaryCommand=E(()=>{let i=this.summary();return i?.kind==="command"?i:null});summaryMarkdown=E(()=>{let i=this.summary();return i?.kind==="markdown"?i:null});hasLlmCluster=E(()=>{let i=this.summary();return i===null?!1:this.showLlmWhat?!0:this.hasNonWhatLlmContent(i)});hasNonWhatLlmContent(i){switch(i.kind){case"markdown":return(i.topics?.length??0)>0||(i.keyFacts?.length??0)>0;case"agent":return!!i.whenToUse||!!i.interactionStyle||(i.capabilities?.length??0)>0;case"skill":return(i.recipe?.length??0)>0||(i.preconditions?.length??0)>0||(i.outputs?.length??0)>0||(i.sideEffects?.length??0)>0;case"command":return!!i.invocationExample||(i.sideEffects?.length??0)>0;default:return!1}}hasInjection=E(()=>this.summary()?.safety.injectionDetected===!0);confidenceTier=E(()=>{let i=this.summary();return i?i.confidence>.8?"high":i.confidence>=.5?"med":"low":null});confidencePct=E(()=>{let i=this.summary();return i?Math.round(i.confidence*100):null});injectionType=E(()=>{let i=this.summary();return i?.safety.injectionDetected?i.safety.injectionType??null:null});visibleIssues=E(()=>this.issues().filter(i=>i.severity==="error"||i.severity==="warn"));errorCount=E(()=>this.visibleIssues().filter(i=>i.severity==="error").length);warnCount=E(()=>this.visibleIssues().filter(i=>i.severity==="warn").length);nodeColor=E(()=>this.agentVendorColor());kindRegistry=d(Dt);providerAccent=E(()=>{let i=this.node();if(!i.provider)return null;let e=this.kindRegistry.lookup(i.kind);return!e||i.provider===e.primaryProviderId?null:e.providers[i.provider]?.color??null});bytesShort=E(()=>{let i=this.stats().bytesTotal;return i===void 0?null:sh(i)});tokensShort=E(()=>{let i=this.stats().tokensTotal;return i===void 0?null:sh(i)});daysAgo=E(()=>Cm(this.node()));version=E(()=>Nl(this.node()));stability=E(()=>Ol(this.node()));tagChips=E(()=>{let i=this.node(),e=[],o=i.frontmatter.tags;if(Array.isArray(o))for(let a of o)typeof a=="string"&&a.length>0&&e.push({tag:a,source:"author"});let s=i.sidecar?.annotations?.tags;if(Array.isArray(s))for(let a of s)typeof a=="string"&&a.length>0&&e.push({tag:a,source:"user"});else{let a=Zt(i.frontmatter)?.tags;if(Array.isArray(a))for(let l of a)typeof l=="string"&&l.length>0&&e.push({tag:l,source:"user"})}return e});visibleTagChips=E(()=>this.tagChips().slice(0,3));moreTagsCount=E(()=>Math.max(0,this.tagChips().length-3));agentVendorColor=E(()=>{let i=this.node();if(i.kind!=="agent")return null;let n=i.frontmatter.color;return typeof n=="string"&&n.length>0?n:null});linksOut=E(()=>this.node().linksOutCount??this.stats().linksOut??0);linksIn=E(()=>this.node().linksInCount??this.stats().linksIn??0);isStale=E(()=>Fl(this.node()));sidecarStatus=E(()=>this.node().sidecar?.status??null);sidecarTooltip=E(()=>Al(this.node(),this.texts.sidecar));displayName=E(()=>this.node().frontmatter.name||this.node().path);description=E(()=>this.node().frontmatter.description??"");toolsCount=E(()=>xm(this.node()));toolsTooltip=E(()=>{let{agentTools:i,skillBaseAllowedTools:e}=rh(this.node());return this.texts.stats.toolsBreakdown(i,e)});toggleExpanded(i){i.stopPropagation(),this.expanded.update(e=>!e)}toggleFavorite(i){i.stopPropagation();let e=!this.isFavorite();this.favoriteToggle.emit({path:this.node().path,value:e})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["sm-node-card"]],hostAttrs:[1,"sm-gnode"],hostVars:26,hostBindings:function(e,n){e&2&&(at("--node-color",n.nodeColor())("--accent",n.providerAccent()),de("sm-gnode--skill",n.node().kind==="skill")("sm-gnode--agent",n.node().kind==="agent")("sm-gnode--command",n.node().kind==="command")("sm-gnode--markdown",n.node().kind==="markdown")("sm-gnode--danger",n.hasInjection())("sm-gnode--with-color",!!n.nodeColor())("sm-gnode--deprecated",n.stability()==="deprecated")("sm-gnode--expanded",n.expanded())("sm-gnode--selected",n.selected())("sm-gnode--highlighted",n.highlighted())("sm-gnode--dimmed",n.dimmed()))},inputs:{node:[1,"node"],stats:[1,"stats"],summary:[1,"summary"],issues:[1,"issues"],selected:[1,"selected"],highlighted:[1,"highlighted"],dimmed:[1,"dimmed"],isFavorite:[1,"isFavorite"],expanded:[1,"expanded"]},outputs:{favoriteToggle:"favoriteToggle",expanded:"expandedChange"},decls:39,vars:34,consts:[[1,"sm-gnode__main"],["aria-hidden","true",1,"sm-gnode__icon-box"],[3,"kind","size"],[1,"sm-gnode__content"],[1,"sm-gnode__name-row"],[1,"sm-gnode__name",3,"pTooltip"],[1,"sm-gnode__actions"],[1,"sm-gnode__confidence",3,"class","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"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--date",3,"pTooltip"],["type","button","data-testid","node-card-favorite",1,"sm-gnode__favorite",3,"click","pTooltip"],["aria-hidden","true"],["data-testid","node-card-tags",1,"sm-gnode__tagrow"],[1,"sm-gnode__panel"],[1,"sm-gnode__llm"],[1,"sm-gnode__desc"],[1,"sm-gnode__issues-block"],[1,"sm-gnode__footer"],["data-debug-slot","card.footer.left",1,"sm-debug-slot"],["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__stat",3,"pTooltip"],["data-testid","node-card-links-in",1,"sm-gnode__stat",3,"pTooltip"],["data-testid","node-card-links-out",1,"sm-gnode__stat",3,"pTooltip"],[1,"sm-gnode__footer-end"],[1,"sm-gnode__confidence",3,"pTooltip"],[1,"sm-gnode__sub-key"],["aria-hidden","true",1,"pi","pi-calendar"],[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,"class","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,"pi","pi-times-circle"],[1,"sm-gnode__stat-num"],["aria-hidden","true",1,"pi","pi-exclamation-triangle"],["aria-hidden","true",1,"pi","pi-wrench"],["aria-hidden","true",1,"pi","pi-arrow-down"],["aria-hidden","true",1,"pi","pi-arrow-up"],["aria-hidden","true",1,"pi","pi-link"],[1,"sm-gnode__stat","sm-gnode__stat--stale",3,"pTooltip"],[1,"sm-gnode__stat","sm-gnode__stat--danger",3,"pTooltip"],["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"],["d","M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"],["x1","12","y1","8","x2","12","y2","12"],["x1","12","y1","16","x2","12.01","y2","16"]],template:function(e,n){if(e&1&&(ot(0)(1)(2)(3)(4),u(5,"div",0)(6,"div",1),B(7,"sm-kind-icon",2),f(),u(8,"div",3)(9,"div",4)(10,"span",5),m(11),f()()(),u(12,"div",6),w(13,Zb,2,4,"span",7),w(14,Qb,2,1,"span",8),u(15,"button",9),K("click",function(r){return n.toggleExpanded(r)}),B(16,"i",10),f()(),u(17,"div",11),w(18,Jb,4,2,"span",12),w(19,ew,4,2,"span",13),w(20,tw,3,2,"span",14),u(21,"button",15),K("click",function(r){return n.toggleFavorite(r)}),B(22,"i",16),f()()(),w(23,ow,4,1,"div",17),u(24,"div",18),w(25,Rw,5,4,"div",19),w(26,Nw,2,1,"div",20),w(27,Fw,1,1),w(28,Lw,3,0,"div",21),f(),u(29,"div",22)(30,"div",23),B(31,"sm-view-contributions-host",24),f(),w(32,Bw,4,2,"span",25),w(33,zw,4,2,"span",26),w(34,Vw,4,2,"span",27),w(35,Gw,4,2,"span",28),w(36,Hw,4,2,"span",29),w(37,jw,4,2,"span",27),w(38,Xw,5,4,"div",30),f()),e&2){let o,r,s,a=n.node(),l=Le(n.summary());c();let h=Le(n.stats());c();let _=Le(n.confidenceTier());c();let v=Le(n.visibleTagChips());c(),Le(n.moreTagsCount()),c(3),P("kind",a.kind)("size",18),c(3),P("pTooltip",n.displayName()),c(),y(n.displayName()),c(2),S(n.showLlmConfidence&&l!==null&&_!==null?13:-1),c(),S((o=n.version())?14:-1,o),c(),Z("aria-label",n.texts.ariaExpand),c(3),S(n.tokensShort()!==null?18:-1),c(),S(n.bytesShort()!==null?19:-1),c(),S((r=n.daysAgo())?20:-1,r),c(),de("sm-gnode__favorite--on",n.isFavorite()),P("pTooltip",n.isFavorite()?n.texts.favoriteRemoveTooltip:n.texts.favoriteAddTooltip),Z("aria-label",n.isFavorite()?n.texts.ariaFavoriteRemove:n.texts.ariaFavoriteAdd),c(),Ce(n.isFavorite()?"pi pi-heart-fill":"pi pi-heart"),c(),S(v.length?23:-1),c(2),S(n.hasLlmCluster()?25:-1),c(),S(n.description()?26:-1),c(),S((s=n.fmAgent())?27:-1,s),c(),S(n.visibleIssues().length?28:-1),c(3),P("node",n.node()),c(),S(n.errorCount()>0?32:-1),c(),S(n.warnCount()>0?33:-1),c(),S(n.toolsCount()>0?34:-1),c(),S(n.linksIn()>0?35:-1),c(),S(n.linksOut()>0?36:-1),c(),S(h.externalRefsCount&&h.externalRefsCount>0?37:-1),c(),S(n.stability()==="experimental"||n.stability()==="deprecated"||n.hasInjection()||n.isStale()?38:-1)}},dependencies:[Ut,Ue,Qe,xn],styles:['[_nghost-%COMP%]{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,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, var(--sm-kind-markdown))}.sm-gnode--skill[_nghost-%COMP%]{--accent: var(--sm-kind-skill)}.sm-gnode--agent[_nghost-%COMP%]{--accent: var(--sm-kind-agent)}.sm-gnode--command[_nghost-%COMP%]{--accent: var(--sm-kind-command)}.sm-gnode--markdown[_nghost-%COMP%]{--accent: var(--sm-kind-markdown)}.sm-gnode--danger[_nghost-%COMP%]{--accent: var(--sm-severity-error)}.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%]{width:38px;height:38px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--kind-bg, var(--sm-kind-markdown-bg));color:var(--kind-fg, var(--sm-kind-markdown-fg));flex:none;font-size:1.05rem;grid-row:1 / span 2;align-self:center}.sm-gnode--skill[_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-skill-bg);--kind-fg: var(--sm-kind-skill-fg)}.sm-gnode--agent[_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-agent-bg);--kind-fg: var(--sm-kind-agent-fg)}.sm-gnode--command[_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-command-bg);--kind-fg: var(--sm-kind-command-fg)}.sm-gnode--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[_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, var(--sm-kind-markdown)) 10%,transparent);padding:.05rem .35rem;border-radius:3px;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:3px}.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:4px;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%]{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:4px;margin-left:auto;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%]{grid-column:2 / -1;grid-row:2;display:flex;flex-wrap:nowrap;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%}.sm-gnode__sub-stat[_ngcontent-%COMP%]{padding:.08rem .35rem;border-radius:3px;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;cursor:help}.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:color-mix(in srgb,var(--sm-kind-agent) 7%,transparent)}.sm-gnode__sub-stat--bytes[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-command) 7%,transparent)}.sm-gnode__sub-stat--date[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-skill) 7%,transparent)}.app-dark[_nghost-%COMP%] .sm-gnode__sub-stat--tokens[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__sub-stat--tokens[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-agent) 22%,transparent);color:var(--sm-kind-agent-fg)}.app-dark[_nghost-%COMP%] .sm-gnode__sub-stat--bytes[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__sub-stat--bytes[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-command) 22%,transparent);color:var(--sm-kind-command-fg)}.app-dark[_nghost-%COMP%] .sm-gnode__sub-stat--date[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__sub-stat--date[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-skill) 22%,transparent);color:var(--sm-kind-skill-fg)}.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:3px;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:3px;font-size:.7rem;font-style:normal;color:var(--p-text-color)}.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:3px}.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:3px;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-end[_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%], .sm-gnode__stat[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{font-size:.6rem;line-height:1;display:block}.sm-gnode__stat[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:1em;height:1em}.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:3px}.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:3px}.sm-gnode__stat--warn[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__stat--danger[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.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:3px;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(--p-primary-color);color:var(--p-primary-color)}.sm-gnode__tag-more[_ngcontent-%COMP%]{font-size:.6rem;color:var(--sm-text-muted);font-style:italic}'],changeDetection:0})};var Sm={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,i)=>`${t}/${i} nodes`,edges:t=>`${t} edges`,cacheAge:t=>`cache ${t}s`}};var Kw=["sparkline"];function Yw(t,i){if(t&1&&(u(0,"span",5),m(1,"\xB7"),f(),u(2,"span",3),m(3),f()),t&2){let e=p(3);c(3),y(e.texts.units.mb(e.heapMb()))}}function Zw(t,i){if(t&1&&(u(0,"span",5),m(1,"\xB7"),f(),u(2,"span",3),m(3),f()),t&2){let e=p(3);c(3),y(e.texts.units.cacheAge(e.cacheAgeSec()))}}function Qw(t,i){if(t&1&&(B(0,"canvas",4,1),u(2,"span",5),m(3,"\xB7"),f(),u(4,"span",3),m(5),f(),w(6,Yw,4,1),u(7,"span",5),m(8,"\xB7"),f(),u(9,"span",3),m(10),f(),u(11,"span",5),m(12,"\xB7"),f(),u(13,"span",3),m(14),f(),u(15,"span",5),m(16,"\xB7"),f(),u(17,"span",3),m(18),f(),u(19,"span",5),m(20,"\xB7"),f(),u(21,"span",3),m(22),f(),w(23,Zw,4,1)),t&2){let e=p(2);c(5),y(e.texts.units.ms(e.frameTimeMs())),c(),S(e.hasHeap()?6:-1),c(4),y(e.texts.units.longTasks(e.longTasks())),c(4),y(e.texts.units.domNodes(e.domNodes())),c(4),y(e.texts.units.nodes(e.visible(),e.total())),c(4),y(e.texts.units.edges(e.edges())),c(),S(e.cacheAgeSec()!==null?23:-1)}}function Jw(t,i){if(t&1&&(u(0,"span",3),m(1),f(),w(2,Qw,24,7)),t&2){let e=p();c(),y(e.texts.units.fps(e.fps())),c(),S(e.expanded()?2:-1)}}var eS=30,ah=60,Bl=14,zl=class t{visible=F(0);total=F(0);edges=F(0);cacheAt=F(null);texts=Sm;destroyRef=d(Ze);zone=d(Qn);fps=q(0);frameTimeMs=q(0);fpsSamples=q([]);sparklineCanvas=Ie("sparkline");heapMb=q(null);longTasks=q(0);domNodes=q(0);nowTick=q(performance.now());expanded=q(tS());cacheAgeSec=E(()=>{let i=this.cacheAt();return i===null?null:Math.max(0,Math.floor((this.nowTick()-i)/1e3))});hasHeap=E(()=>this.heapMb()!==null);constructor(){let i=0,e=0,n=performance.now(),o=n,r=0,s=l=>{let h=l-n;if(n=l,i+=1,e+=h,l-o>=1e3){let _=(l-o)/1e3,v=Math.round(i/_);this.fps.set(v),this.frameTimeMs.set(Math.round(e/Math.max(i,1))),this.heapMb.set(iS()),this.domNodes.set(document.querySelectorAll("*").length),this.nowTick.set(l),this.fpsSamples.update(b=>{let I=b.length>=eS?b.slice(1):b.slice();return I.push(v),I}),i=0,e=0,o=l}r=requestAnimationFrame(s)};this.zone.runOutsideAngular(()=>{r=requestAnimationFrame(s)});let a=null;if(typeof PerformanceObserver<"u")try{a=new PerformanceObserver(l=>{this.longTasks.update(h=>h+l.getEntries().length)}),a.observe({type:"longtask",buffered:!0})}catch{}this.destroyRef.onDestroy(()=>{cancelAnimationFrame(r),a?.disconnect()}),me(()=>{let l=this.sparklineCanvas(),h=this.fpsSamples();l&&oS(l.nativeElement,h)})}setExpanded(i){this.expanded.set(i),nS(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-perf-hud"]],viewQuery:function(e,n){e&1&&ft(n.sparklineCanvas,Kw,5),e&2&&it()},inputs:{visible:[1,"visible"],total:[1,"total"],edges:[1,"edges"],cacheAt:[1,"cacheAt"]},decls:3,vars:2,consts:[["content",""],["sparkline",""],["styleClass","perf-hud","data-testid","perf-hud",3,"ngModelChange","ngModel","ariaLabel"],[1,"perf-hud__cell"],["aria-hidden","true",1,"perf-hud__sparkline"],["aria-hidden","true",1,"perf-hud__sep"]],template:function(e,n){e&1&&(u(0,"p-togglebutton",2),K("ngModelChange",function(r){return n.setExpanded(r)}),Pe(1,Jw,3,2,"ng-template",null,0,ei),f()),e&2&&P("ngModel",n.expanded())("ariaLabel",n.expanded()?n.texts.a11y.collapse:n.texts.a11y.expand)},dependencies:[bo,Co,xo,So,wo],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: 999px;--p-togglebutton-content-border-radius: 999px;--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}[_nghost-%COMP%] .perf-hud .p-togglebutton-content{display:inline-flex;align-items:center;gap:.4rem}.perf-hud__cell[_ngcontent-%COMP%]{white-space:nowrap;font-variant-numeric:tabular-nums}.perf-hud__sep[_ngcontent-%COMP%]{opacity:.45}.perf-hud__sparkline[_ngcontent-%COMP%]{width:60px;height:14px;opacity:.6}"],changeDetection:0})},Im="sm.perf-hud.expanded";function tS(){try{return localStorage.getItem(Im)==="1"}catch{return!1}}function nS(t){try{localStorage.setItem(Im,t?"1":"0")}catch{}}function iS(){let t=performance.memory;return t?Math.round(t.usedJSHeapSize/1024/1024):null}function oS(t,i){let e=window.devicePixelRatio||1,n=ah*e,o=Bl*e;(t.width!==n||t.height!==o)&&(t.width=n,t.height=o);let r=t.getContext("2d");if(!r||(r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,ah,Bl),i.length<2))return;let s=Math.max(60,...i),a=ah/(i.length-1);r.beginPath();for(let l=0;l<i.length;l+=1){let h=l*a,_=Bl-i[l]/s*Bl;l===0?r.moveTo(h,_):r.lineTo(h,_)}r.strokeStyle=getComputedStyle(t).color,r.lineWidth=1,r.stroke()}var rS="debug-perf",Vl=class t{visible=q(this.resolveInitial());resolveInitial(){let e=new URLSearchParams(window.location.search).get(rS);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:kl.graph.perfHud}static \u0275fac=function(e){return new(e||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})};var Tm=`
|
|
210
|
+
`.trim();function Hp(t){return!!jp(t)}function jp(t){let i=t,e=i?.Blob,n=i?.Worker,o=i?.URL;return!e||!n||typeof o?.createObjectURL!="function"||typeof o.revokeObjectURL!="function"?null:{blobCtor:e,workerCtor:n,urlApi:o}}function O0(t){let i=new t.blobCtor([N0],{type:"text/javascript"});return t.urlApi.createObjectURL(i)}function Up(t,i){if(!t)return;let e=i??(typeof URL>"u"?null:URL);typeof e?.revokeObjectURL=="function"&&e.revokeObjectURL(t)}var un=(()=>{class t{worker=null;workerUrl=null;nextRequestId=0;isDisabled=!1;pending=new Map;resetRuntime(e){this.pending.forEach(n=>n.reject(e)),this.pending.clear(),this.worker?.terminate(),this.worker=null,Up(this.workerUrl),this.workerUrl=null}dispose(){this.resetRuntime(new Error("Connection worker was destroyed."))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),hc=class{connection;line;static fToken=Symbol("ApplyConnectionRenderRequest");constructor(i,e){this.connection=i,this.line=e}},F0=(()=>{let t=class er{_mediator=d(R);_renderCache=new WeakMap;handle({connection:e,line:n}){!this._mediator.execute(new kn(e))&&!this._shouldRender(e,n)||(e.setLine(n),e.initialize())}_shouldRender(e,n){let o=e.fPath().hostElement,r=this._createConnectionRenderSignature(e,n),s=this._renderCache.get(e);return s?.signature===r&&s.pathElement===o?!1:(this._renderCache.set(e,{signature:r,pathElement:o}),!0)}_createConnectionRenderSignature(e,n){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(n.point1),this._serializePoint(n.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(n=>[n.position(),n.offset(),n.align()].join(":")).join(";")}static \u0275fac=function(n){return new(n||er)};static \u0275prov=g({token:er,factory:er.\u0275fac})};return t=C([x(hc)],t),t})(),pc=class{source;target;static fToken=Symbol("MarkConnectionConnectorsAsConnectedRequest");constructor(i,e){this.source=i,this.target=e}},A0=(()=>{let t=class tr{_state=d(El);handle({source:e,target:n}){e.setConnected(n),n.setConnected(e),this._state.trackConnectedConnectors(e,n)}static \u0275fac=function(n){return new(n||tr)};static \u0275prov=g({token:tr,factory:tr.\u0275fac})};return t=C([x(pc)],t),t})(),zt=class{element;cache;static fToken=Symbol("GetNormalizedConnectorRectRequest");constructor(i,e=!0){this.element=i,this.cache=e}},L0={enabled:!1},Ct=new fe("F_CACHE_OPTIONS",{providedIn:"root",factory:()=>ue({},L0)});var mc=class{id;nodeId;kind;element;static fToken=Symbol("RegisterFCacheConnectorRequest");constructor(i,e,n,o){this.id=i,this.nodeId=e,this.kind=n,this.element=o}},xt=(()=>{class t{nodeEntries=new Map;nodeIdByElement=new WeakMap;connectorEntries=new Map;connectorKeysByNodeId=new Map;connectorKeyByElement=new WeakMap;static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),cf=class{key;id;kind;nodeId;element;rect;constructor(i,e,n,o,r,s){this.key=i,this.id=e,this.kind=n,this.nodeId=o,this.element=r,this.rect=s}},ci=class{static build(i,e){return`${i}:${e}`}},df=class{id;element;reference;rect;constructor(i,e,n,o){this.id=i,this.element=e,this.reference=n,this.rect=o}},Rn=class{nodeId;reason;static fToken=Symbol("InvalidateFCacheNodeRequest");constructor(i,e="manual"){this.nodeId=i,this.reason=e}},B0=(()=>{let t=class nr{_store=d(xt);_options=d(Ct);handle({nodeId:e,reason:n}){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 s of r){let a=this._store.connectorEntries.get(s);a&&(a.rect=void 0)}}static \u0275fac=function(n){return new(n||nr)};static \u0275prov=g({token:nr,factory:nr.\u0275fac})};return t=C([x(Rn)],t),t})(),_c=class{id;element;reference;static fToken=Symbol("RegisterFCacheNodeRequest");constructor(i,e,n){this.id=i,this.element=e,this.reference=n}},z0=(()=>{let t=class ir{_store=d(xt);_options=d(Ct);handle({id:e,element:n,reference:o}){if(!this._options.enabled)return;let r=new df(e,n,o);this._store.nodeEntries.set(e,r),this._store.nodeIdByElement.set(n,e),this._store.connectorKeysByNodeId.set(e,this._store.connectorKeysByNodeId.get(e)??new Set)}static \u0275fac=function(n){return new(n||ir)};static \u0275prov=g({token:ir,factory:ir.\u0275fac})};return t=C([x(_c)],t),t})(),gc=class{id;static fToken=Symbol("UnregisterFCacheNodeRequest");constructor(i){this.id=i}},V0=(()=>{let t=class or{_store=d(xt);_mediator=d(R);_options=d(Ct);handle({id:e}){if(!this._options.enabled)return;let n=this._store.nodeEntries.get(e);if(!n)return;this._store.nodeEntries.delete(e),this._store.nodeIdByElement.delete(n.element);let o=Array.from(this._store.connectorKeysByNodeId.get(e)??[]);for(let r of o){let s=this._store.connectorEntries.get(r);s&&this._mediator.execute(new di(s.id,s.kind))}this._store.connectorKeysByNodeId.delete(e)}static \u0275fac=function(n){return new(n||or)};static \u0275prov=g({token:or,factory:or.\u0275fac})};return t=C([x(gc)],t),t})(),G0=(()=>{let t=class rr{_store=d(xt);_mediator=d(R);_options=d(Ct);handle({id:e,nodeId:n,kind:o,element:r}){if(!this._options.enabled)return;let s=ci.build(e,o),a=this._store.connectorEntries.get(s);a&&(this._detachConnectorFromNode(a.key,a.nodeId),this._store.connectorKeyByElement.delete(a.element));let l=new cf(s,e,o,n,r);this._store.connectorEntries.set(s,l),this._store.connectorKeyByElement.set(r,s);let h=this._store.connectorKeysByNodeId.get(n)??new Set;h.add(s),this._store.connectorKeysByNodeId.set(n,h),this._mediator.execute(new Rn(n,"connector-registered"))}_detachConnectorFromNode(e,n){let o=this._store.connectorKeysByNodeId.get(n);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||rr)};static \u0275prov=g({token:rr,factory:rr.\u0275fac})};return t=C([x(mc)],t),t})(),di=class{connectorId;kind;static fToken=Symbol("UnregisterFCacheConnectorRequest");constructor(i,e){this.connectorId=i,this.kind=e}},H0=(()=>{let t=class sr{_store=d(xt);_mediator=d(R);_options=d(Ct);handle({connectorId:e,kind:n}){if(!this._options.enabled)return;let o=ci.build(e,n),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 Rn(r.nodeId,"connector-unregistered")))}_detachConnectorFromNode(e,n){let o=this._store.connectorKeysByNodeId.get(n);o&&(o.delete(e),o.size||this._store.connectorKeysByNodeId.delete(n))}static \u0275fac=function(n){return new(n||sr)};static \u0275prov=g({token:sr,factory:sr.\u0275fac})};return t=C([x(di)],t),t})(),Nn=class{element;static fToken=Symbol("GetCachedFCacheRectRequest");constructor(i){this.element=i}},j0=(()=>{let t=class ar{_store=d(xt);_options=d(Ct);handle({element:e}){if(!this._options.enabled)return;let n=this._store.nodeIdByElement.get(e);if(n){let r=this._store.nodeEntries.get(n)?.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(n){return new(n||ar)};static \u0275prov=g({token:ar,factory:ar.\u0275fac})};return t=C([x(Nn)],t),t})(),on=class{connectorId;kind;rect;static fToken=Symbol("SetFCacheConnectorRectRequest");constructor(i,e,n){this.connectorId=i,this.kind=e,this.rect=n}},U0=(()=>{let t=class cr{_store=d(xt);_options=d(Ct);handle({connectorId:e,kind:n,rect:o}){if(!this._options.enabled)return;let r=ci.build(e,n),s=this._store.connectorEntries.get(r);s&&(s.rect=ke.fromRoundedRect(o))}static \u0275fac=function(n){return new(n||cr)};static \u0275prov=g({token:cr,factory:cr.\u0275fac})};return t=C([x(on)],t),t})(),rn=class{nodeId;rect;static fToken=Symbol("SetFCacheNodeRectRequest");constructor(i,e){this.nodeId=i,this.rect=e}},$0=(()=>{let t=class dr{_store=d(xt);_options=d(Ct);handle({nodeId:e,rect:n}){if(!this._options.enabled)return;let o=this._store.nodeEntries.get(e);if(!o)return;let r=o.rect;o.rect=G.initialize(n.x,n.y,n.width,n.height),r&&this._updateConnectorRectsByNodeRect(e,r,o.rect)}_updateConnectorRectsByNodeRect(e,n,o){let r=this._store.connectorKeysByNodeId.get(e);if(!r?.size)return;let s=o.x-n.x,a=o.y-n.y,l=n.width!==0,h=n.height!==0,_=l?o.width/n.width:1,v=h?o.height/n.height:1;for(let b of r){let I=this._store.connectorEntries.get(b);if(!I?.rect)continue;let N=I.rect,D=N.gravityCenter,M=l?o.x+(D.x-n.x)*_:D.x+s,k=h?o.y+(D.y-n.y)*v:D.y+a;I.rect=new ke(M-N.width/2,k-N.height/2,N.width,N.height,N.radius1,N.radius2,N.radius3,N.radius4)}}static \u0275fac=function(n){return new(n||dr)};static \u0275prov=g({token:dr,factory:dr.\u0275fac})};return t=C([x(rn)],t),t})(),li=class{element;rect;static fToken=Symbol("UpdateFCacheRectByElementRequest");constructor(i,e){this.element=i,this.rect=e}},W0=(()=>{let t=class lr{_store=d(xt);_options=d(Ct);handle({element:e,rect:n}){if(!this._options.enabled)return;let o=this._store.nodeIdByElement.get(e);if(o){let a=this._store.nodeEntries.get(o);a&&(a.rect=n);return}let r=this._store.connectorKeyByElement.get(e);if(!r)return;let s=this._store.connectorEntries.get(r);s&&(s.rect=n)}static \u0275fac=function(n){return new(n||lr)};static \u0275prov=g({token:lr,factory:lr.\u0275fac})};return t=C([x(li)],t),t})(),q0=[xt,z0,V0,B0,G0,H0,j0,$0,U0,W0];function Un(t,i,e){return i?X.fromPoint(t).elementTransform(i).sub(e.scaledPosition).sub(e.position).div(e.scale):X.fromPoint(t)}function $p(){return{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}}function On(t){return t?`${t}`:void 0}var X0=(()=>{let t=class ur{_store=d(E);_mediator=d(R);_browser=d(Re);get _transform(){return this._store.transform}handle({element:e,cache:n}){let o=this._mediator.execute(new Nn(e));if(o&&n)return o;let r=this._getElementRoundedRect(e),s=this._normalizePosition(r),a=this._unscaleSize(r),l=this._getUnscaledRect(s,a,r),h=this._getOffsetSize(e,a),_=ke.fromCenter(l,h.width,h.height);return this._mediator.execute(new li(e,_)),_}_getElementRoundedRect(e){return this._getRoundedRect(G.fromElement(e),e,this._getComputedStyle(e))}_getRoundedRect(e,n,o){let[r,s,a,l]=this._normalizeCircularBorderRadii(e.width,e.height,[this._getSystemRadius(o.borderTopLeftRadius,n,o.fontSize),this._getSystemRadius(o.borderTopRightRadius,n,o.fontSize),this._getSystemRadius(o.borderBottomRightRadius,n,o.fontSize),this._getSystemRadius(o.borderBottomLeftRadius,n,o.fontSize)]);return new ke(e.x,e.y,e.width,e.height,r,s,a,l)}_getComputedStyle(e){return this._browser.window.getComputedStyle(e)}_toPixels(e,n,o){return this._browser.toPixels(e,n.clientWidth,n.clientHeight,o)||0}_getSystemRadius(e,n,o){return this._toPixels(e,n,o)*this._transform.scale}_normalizeCircularBorderRadii(e,n,o){let[r,s,a,l]=o.map(_=>Math.max(0,_)),h=Math.min(1,this._getRadiusScaleFactor(e,r+s),this._getRadiusScaleFactor(n,s+a),this._getRadiusScaleFactor(e,a+l),this._getRadiusScaleFactor(n,l+r));return[r*h,s*h,a*h,l*h]}_getRadiusScaleFactor(e,n){return n<=0?1:e<=0?0:e/n}_normalizePosition(e){return Un(e,this._store.flowHost,this._transform)}_unscaleSize(e){return ht.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n,o){return new ke(e.x,e.y,n.width,n.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,n){return ht.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||ur)};static \u0275prov=g({token:ur,factory:ur.\u0275fac})};return t=C([x(zt)],t),t})(),yc=class{connector;cache;static fToken=Symbol("ResolveConnectionEndpointRectRequest");constructor(i,e){this.connector=i,this.cache=e}},K0=(()=>{let t=class fr{_mediator=d(R);handle({connector:e,cache:n}){let o=this._buildCacheKey(e),r=n.get(o)??this._calculateRect(e);return n.set(o,r),r}_buildCacheKey(e){return`${e.kind}::${e.fId()}`}_calculateRect(e){return this._mediator.execute(new zt(e.hostElement))}static \u0275fac=function(n){return new(n||fr)};static \u0275prov=g({token:fr,factory:fr.\u0275fac})};return t=C([x(yc)],t),t})(),vc=class{connection;static fToken=Symbol("ResolveConnectionEndpointsRequest");constructor(i){this.connection=i}},Y0=(()=>{let t=class hr{_store=d(E);handle({connection:e}){let n=this._store.outputs.get(e.fOutputId()),o=this._store.inputs.get(e.fInputId());return!n||!o?null:{source:n,target:o}}static \u0275fac=function(n){return new(n||hr)};static \u0275prov=g({token:hr,factory:hr.\u0275fac})};return t=C([x(vc)],t),t})(),ui=class{connection;cache;static fToken=Symbol("ResolveConnectionGeometryRequest");constructor(i,e){this.connection=i,this.cache=e}},Z0=(()=>{let t=class pr{_mediator=d(R);handle({connection:e,cache:n}){let o=this._resolveConnectionEndpoints(e);return o?mu(ue({},o),{sourceRect:this._resolveEndpointRect(o.source,n),targetRect:this._resolveEndpointRect(o.target,n)}):null}_resolveConnectionEndpoints(e){return this._mediator.execute(new vc(e))}_resolveEndpointRect(e,n){return this._mediator.execute(new yc(e,n))}static \u0275fac=function(n){return new(n||pr)};static \u0275prov=g({token:pr,factory:pr.\u0275fac})};return t=C([x(ui)],t),t})(),Ee=class{element;static fToken=Symbol("GetNormalizedElementRectRequest");constructor(i){this.element=i}},Q0=(()=>{let t=class mr{_store=d(E);_mediator=d(R);get _transform(){return this._store.transform}handle({element:e}){let n=this._mediator.execute(new Nn(e));if(n)return n;let o=G.fromElement(e),r=this._normalizePosition(o),s=this._unscaleSize(o),a=this._getUnscaledRect(r,s),l=this._getOffsetSize(e,s),h=this._fromCenter(a,l.width,l.height);return this._mediator.execute(new li(e,h)),h}_fromCenter(e,n,o){return G.initialize(e.gravityCenter.x-n/2,e.gravityCenter.y-o/2,n,o)}_normalizePosition(e){return Un(e,this._store.flowHost,this._transform)}_unscaleSize(e){return ht.initialize(e.width/this._transform.scale,e.height/this._transform.scale)}_getUnscaledRect(e,n){return new ke(e.x,e.y,n.width,n.height)}_getOffsetSize(e,n){return ht.offsetFromElement(e)||n}static \u0275fac=function(n){return new(n||mr)};static \u0275prov=g({token:mr,factory:mr.\u0275fac})};return t=C([x(Ee)],t),t})(),Et=class{connector;static fToken=Symbol("ResolveConnectionEndpointRotationContextRequest");constructor(i){this.connector=i}},J0=(()=>{let t=class _r{_store=d(E);_mediator=d(R);handle({connector:e}){if(!e)return;let n=this._store.nodes.get(e.fNodeId);if(!n||!n._rotate)return;let o=this._mediator.execute(new Ee(n.hostElement));return{rotationDeg:n._rotate,pivot:o.gravityCenter}}static \u0275fac=function(n){return new(n||_r)};static \u0275prov=g({token:_r,factory:_r.\u0275fac})};return t=C([x(Et)],t),t})(),Cc=class{connection;geometry;static fToken=Symbol("BuildConnectionLineRequest");constructor(i,e){this.connection=i,this.geometry=e}},ey=(()=>{let t=class gr{_mediator=d(R);_connectionBehaviour=d(jn);handle({connection:e,geometry:n}){return this._connectionBehaviour.handle(new mt(n.sourceRect,n.targetRect,e,n.source.fConnectableSide,n.target.fConnectableSide,this._resolveRotationContext(n.source),this._resolveRotationContext(n.target)))}_resolveRotationContext(e){return this._mediator.execute(new Et(e))}static \u0275fac=function(n){return new(n||gr)};static \u0275prov=g({token:gr,factory:gr.\u0275fac})};return t=C([x(Cc)],t),t})(),fi=class{connection;source;target;line;static fToken=Symbol("RenderConnectionWithLineRequest");constructor(i,e,n,o){this.connection=i,this.source=e,this.target=n,this.line=o}},ty=(()=>{let t=class yr{_mediator=d(R);handle({connection:e,source:n,target:o,line:r}){this._mediator.execute(new pc(n,o)),this._mediator.execute(new hc(e,r))}static \u0275fac=function(n){return new(n||yr)};static \u0275prov=g({token:yr,factory:yr.\u0275fac})};return t=C([x(fi)],t),t})(),hi=class{connection;geometry;static fToken=Symbol("RenderConnectionFromGeometryRequest");constructor(i,e){this.connection=i,this.geometry=e}},ny=(()=>{let t=class vr{_mediator=d(R);handle({connection:e,geometry:n}){let o=this._mediator.execute(new Cc(e,n));this._mediator.execute(new fi(e,n.source,n.target,o))}static \u0275fac=function(n){return new(n||vr)};static \u0275prov=g({token:vr,factory:vr.\u0275fac})};return t=C([x(hi)],t),t})(),xc=class{connection;cache;static fToken=Symbol("RenderConnectionRequest");constructor(i,e){this.connection=i,this.cache=e}},iy=(()=>{let t=class Cr{_mediator=d(R);handle({connection:e,cache:n}){let o=this._mediator.execute(new ui(e,n));o&&this._mediator.execute(new hi(e,o))}static \u0275fac=function(n){return new(n||Cr)};static \u0275prov=g({token:Cr,factory:Cr.\u0275fac})};return t=C([x(xc)],t),t})(),sn=class{session;static fToken=Symbol("IsConnectionRedrawCurrentRequest");constructor(i){this.session=i}},oy=(()=>{let t=class xr{_store=d(E);_state=d(El);handle({session:e}){return e.renderTicket===this._state.renderTicket&&e.nodesRevision===this._store.nodesRevision}static \u0275fac=function(n){return new(n||xr)};static \u0275prov=g({token:xr,factory:xr.\u0275fac})};return t=C([x(sn)],t),t})(),pi=class{session;static fToken=Symbol("CompleteConnectionRedrawRequest");constructor(i){this.session=i}},ry=(()=>{let t=class br{_mediator=d(R);_store=d(E);handle({session:e}){this._mediator.execute(new sn(e))&&this._store.completeConnectionsRender(e.connectionsRevision,e.nodesRevision)}static \u0275fac=function(n){return new(n||br)};static \u0275prov=g({token:br,factory:br.\u0275fac})};return t=C([x(pi)],t),t})(),bc=class{batchItem;result;static fToken=Symbol("ApplyConnectionWorkerResultRequest");constructor(i,e){this.batchItem=i,this.result=e}},sy=(()=>{let t=class wr{_mediator=d(R);handle({batchItem:e,result:n}){if(e){if(!this._isSupportedWorkerResult(n)){this._fallbackToMainThread(e);return}try{e.connection._applyResolvedSidesToConnection(n.sourceSide,n.targetSide),this._mediator.execute(new fi(e.connection,e.geometry.source,e.geometry.target,n.line))}catch{this._fallbackToMainThread(e)}}}_fallbackToMainThread(e){this._mediator.execute(new hi(e.connection,e.geometry))}_isSupportedWorkerResult(e){return!!(e?.supported&&e.sourceSide&&e.targetSide&&e.line)}static \u0275fac=function(n){return new(n||wr)};static \u0275prov=g({token:wr,factory:wr.\u0275fac})};return t=C([x(bc)],t),t})(),Ft=class{connections;cache;startIndex;session;batchItems;workerResults;static fToken=Symbol("RunConnectionRedrawSliceRequest");constructor(i,e,n,o,r,s){this.connections=i,this.cache=e,this.startIndex=n,this.session=o,this.batchItems=r,this.workerResults=s}},ay=500,cy=6,dy=(()=>{let t=class Sr{_mediator=d(R);_browser=d(Re);handle({connections:e,cache:n,startIndex:o,session:r,batchItems:s,workerResults:a}){if(!this._isCurrent(r))return;let l=this._now(),h=o,_=0;for(;h<e.length&&_<ay&&this._isWithinSliceBudget(l);){let v=e[h];if(s?this._mediator.execute(new bc(s[h]??null,a?.[h])):this._mediator.execute(new xc(v,n)),h++,_++,!this._isCurrent(r))return}if(h>=e.length){this._mediator.execute(new pi(r));return}this._requestAnimationFrame(()=>this._mediator.execute(new Ft(e,n,h,r,s,a)))}_isCurrent(e){return this._mediator.execute(new sn(e))}_requestAnimationFrame(e){let n=this._browser.document.defaultView;if(!n){e();return}n.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<cy:!0}static \u0275fac=function(n){return new(n||Sr)};static \u0275prov=g({token:Sr,factory:Sr.\u0275fac})};return t=C([x(Ft)],t),t})(),wc=class{static fToken=Symbol("StartConnectionRedrawRequest")},ly=(()=>{let t=class Ir{_store=d(E);_state=d(El);handle(e){return this._state.resetConnectedConnectors(),{renderTicket:this._state.beginRender(),connectionsRevision:this._store.connectionsRevision,nodesRevision:this._store.nodesRevision}}static \u0275fac=function(n){return new(n||Ir)};static \u0275prov=g({token:Ir,factory:Ir.\u0275fac})};return t=C([x(wc)],t),t})(),mi=class{static fToken=Symbol("RedrawConnectionsRequest")},Sc=class{connectionCount;static fToken=Symbol("ShouldUseConnectionWorkerRequest");constructor(i){this.connectionCount=i}},_i=class{static fToken=Symbol("IsConnectionWorkerEnabledRequest")},uy=(()=>{let t=class Tr{_browser=d(Re);_state=d(un);handle(e){if(this._state.isDisabled||!this._isWorkerAvailable())return!1;let n=this._browser.document.defaultView;return Hp(n)}_isWorkerAvailable(){return this._browser.isBrowser()}static \u0275fac=function(n){return new(n||Tr)};static \u0275prov=g({token:Tr,factory:Tr.\u0275fac})};return t=C([x(_i)],t),t})(),fy=(()=>{let t=class Er{_mediator=d(R);handle({connectionCount:e}){return e>0&&this._mediator.execute(new _i)}static \u0275fac=function(n){return new(n||Er)};static \u0275prov=g({token:Er,factory:Er.\u0275fac})};return t=C([x(Sc)],t),t})(),Ic=class{connection;geometry;originalIndex;static fToken=Symbol("BuildConnectionWorkerPayloadItemRequest");constructor(i,e,n){this.connection=i,this.geometry=e,this.originalIndex=n}},hy=(()=>{let t=class Pr{_store=d(E);handle({connection:e,geometry:n,originalIndex:o}){let{source:r,target:s,sourceRect:a,targetRect:l}=n;return{originalIndex:o,behavior:e.fBehavior,outputSide:e.fOutputSide(),inputSide:e.fInputSide(),sourceConnectableSide:r.fConnectableSide,targetConnectableSide:s.fConnectableSide,sourceRotation:this._store.nodes.get(r.fNodeId)?._rotate||0,targetRotation:this._store.nodes.get(s.fNodeId)?._rotate||0,sourceRect:{x:a.x,y:a.y,width:a.width,height:a.height,radius1:a.radius1,radius2:a.radius2,radius3:a.radius3,radius4:a.radius4},targetRect:{x:l.x,y:l.y,width:l.width,height:l.height,radius1:l.radius1,radius2:l.radius2,radius3:l.radius3,radius4:l.radius4}}}static \u0275fac=function(n){return new(n||Pr)};static \u0275prov=g({token:Pr,factory:Pr.\u0275fac})};return t=C([x(Ic)],t),t})(),Tc=class{connections;cache;static fToken=Symbol("BuildConnectionWorkerBatchRequest");constructor(i,e){this.connections=i,this.cache=e}},py=(()=>{let t=class Mr{_mediator=d(R);handle({connections:e,cache:n}){let o=new Array(e.length),r=[];for(let s=0;s<e.length;s++){let a=this._buildBatchItem(e[s],n,s);o[s]=a,a&&r.push(a.payload)}return{items:o,payload:r}}_buildBatchItem(e,n,o){let r=this._mediator.execute(new ui(e,n));return r?{connection:e,geometry:r,payload:this._mediator.execute(new Ic(e,r,o))}:null}static \u0275fac=function(n){return new(n||Mr)};static \u0275prov=g({token:Mr,factory:Mr.\u0275fac})};return t=C([x(Tc)],t),t})(),Ec=class{error;static fToken=Symbol("DisableConnectionWorkerRequest");constructor(i){this.error=i}},gi=class{error;static fToken=Symbol("ResetConnectionWorkerRuntimeRequest");constructor(i){this.error=i}},my=(()=>{let t=class Dr{_state=d(un);handle({error:e}){this._state.resetRuntime(e)}static \u0275fac=function(n){return new(n||Dr)};static \u0275prov=g({token:Dr,factory:Dr.\u0275fac})};return t=C([x(gi)],t),t})(),_y=(()=>{let t=class kr{_state=d(un);_mediator=d(R);handle({error:e}){this._state.isDisabled=!0,this._mediator.execute(new gi(e))}static \u0275fac=function(n){return new(n||kr)};static \u0275prov=g({token:kr,factory:kr.\u0275fac})};return t=C([x(Ec)],t),t})(),Pc=class{message;static fToken=Symbol("HandleConnectionWorkerMessageRequest");constructor(i){this.message=i}},gy=(()=>{let t=class Rr{_state=d(un);handle({message:e}){if(!e||typeof e.requestId!="number")return;let n=this._state.pending.get(e.requestId);if(n){if(this._state.pending.delete(e.requestId),e.error){n.reject(new Error(e.error));return}n.resolve(e.results??[])}}static \u0275fac=function(n){return new(n||Rr)};static \u0275prov=g({token:Rr,factory:Rr.\u0275fac})};return t=C([x(Pc)],t),t})(),Mc=class{static fToken=Symbol("EnsureConnectionWorkerRequest")},yy=(()=>{let t=class Nr{_browser=d(Re);_state=d(un);_mediator=d(R);handle(e){if(this._state.worker)return this._state.worker;let n=this._browser.document.defaultView;if(!Hp(n))return null;let o=jp(n);if(!o)return null;let r=O0(o);try{let s=new o.workerCtor(r,{name:"f-flow-connection-worker"});return s.onmessage=a=>{this._mediator.execute(new Pc(a.data))},s.onerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker runtime error."))},s.onmessageerror=()=>{this._resetWorkerAfterRuntimeError(new Error("Connection worker message deserialization error."))},this._state.workerUrl=r,this._state.worker=s,s}catch(s){return Up(r,o.urlApi),this._disableWorker(s instanceof Error?s:new Error("Connection worker initialization failed.")),null}}_disableWorker(e){this._mediator.execute(new Ec(e))}_resetWorkerAfterRuntimeError(e){this._mediator.execute(new gi(e))}static \u0275fac=function(n){return new(n||Nr)};static \u0275prov=g({token:Nr,factory:Nr.\u0275fac})};return t=C([x(Mc)],t),t})(),Dc=class{payload;static fToken=Symbol("RunConnectionWorkerRequest");constructor(i){this.payload=i}},vy=(()=>{let t=class Or{_state=d(un);_mediator=d(R);handle({payload:e}){if(!e.length)return Promise.resolve([]);if(!this._mediator.execute(new _i))return Promise.reject(new Error("Connection worker is disabled."));this._interruptPendingRequests();let n=this._mediator.execute(new Mc);if(!n)return Promise.reject(new Error("Unable to initialize connection worker."));let o=++this._state.nextRequestId;return new Promise((r,s)=>{this._state.pending.set(o,{resolve:r,reject:s});try{n.postMessage({requestId:o,items:e})}catch(a){this._state.pending.delete(o),s(a instanceof Error?a: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(n=>n.reject(e)),this._state.pending.clear()}static \u0275fac=function(n){return new(n||Or)};static \u0275prov=g({token:Or,factory:Or.\u0275fac})};return t=C([x(Dc)],t),t})(),kc=class{batch;static fToken=Symbol("RunConnectionWorkerBatchRequest");constructor(i){this.batch=i}},Cy=(()=>{let t=class Fr{_mediator=d(R);handle({batch:e}){return e.payload.length?this._mediator.execute(new Dc(e.payload)):Promise.resolve([])}static \u0275fac=function(n){return new(n||Fr)};static \u0275prov=g({token:Fr,factory:Fr.\u0275fac})};return t=C([x(kc)],t),t})(),Rc=class{connections;cache;session;static fToken=Symbol("StartConnectionWorkerRedrawRequest");constructor(i,e,n){this.connections=i,this.cache=e,this.session=n}},xy=(()=>{let t=class Ar{_mediator=d(R);handle({connections:e,cache:n,session:o}){let r=this._mediator.execute(new Tc(e,n));if(!r.payload.length){this._mediator.execute(new Ft(e,n,0,o,r.items));return}this._mediator.execute(new kc(r)).then(s=>{this._mediator.execute(new sn(o))&&this._mediator.execute(new Ft(e,n,0,o,r.items,this._alignWorkerResults(s,e.length)))}).catch(()=>{this._mediator.execute(new sn(o))&&this._mediator.execute(new Ft(e,n,0,o,r.items))})}_alignWorkerResults(e,n){let o=new Array(n);for(let r of e){let s=r.originalIndex;s<0||s>=n||(o[s]=r)}return o}static \u0275fac=function(n){return new(n||Ar)};static \u0275prov=g({token:Ar,factory:Ar.\u0275fac})};return t=C([x(Rc)],t),t})(),by=(()=>{let t=class Lr{_mediator=d(R);_store=d(E);handle(e){let n=this._mediator.execute(new wc);this._createMarkersForCreate(),this._createMarkersForSnap();let o=[...this._store.connections.getAll()],r=new Map;if(!o.length){this._mediator.execute(new pi(n));return}this._shouldUseConnectionWorker(o.length)?this._redrawUsingWorker(o,r,n):this._redrawWithoutWorker(o,r,n)}_createMarkersForCreate(){let e=this._store.connections.getForCreate();e&&this._mediator.execute(new kn(e))}_createMarkersForSnap(){let e=this._store.connections.getForSnap();e&&this._mediator.execute(new kn(e))}_shouldUseConnectionWorker(e){return this._mediator.execute(new Sc(e))}_redrawUsingWorker(e,n,o){this._mediator.execute(new Rc(e,n,o))}_redrawWithoutWorker(e,n,o){this._mediator.execute(new Ft(e,n,0,o))}static \u0275fac=function(n){return new(n||Lr)};static \u0275prov=g({token:Lr,factory:Lr.\u0275fac})};return t=C([x(mi)],t),t})(),lf=class{static fToken=Symbol("RemoveConnectionForCreateFromStoreRequest")},wy=(()=>{let t=class Br{_store=d(E);handle(e){this._store.connections.removeInstanceForCreate()}static \u0275fac=function(n){return new(n||Br)};static \u0275prov=g({token:Br,factory:Br.\u0275fac})};return t=C([x(lf)],t),t})(),Nc=class{connection;static fToken=Symbol("RemoveConnectionFromStoreRequest");constructor(i){this.connection=i}},Sy=(()=>{let t=class zr{_store=d(E);handle({connection:e}){this._store.connections.remove(e),this._store.emitConnectionChanges()}static \u0275fac=function(n){return new(n||zr)};static \u0275prov=g({token:zr,factory:zr.\u0275fac})};return t=C([x(Nc)],t),t})(),uf=class{instance;static fToken=Symbol("RemoveConnectionMarkerFromStoreRequest");constructor(i){this.instance=i}},Iy=(()=>{let t=class Vr{_store=d(E);handle({instance:e}){this._store.connectionMarkers.remove(e),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Vr)};static \u0275prov=g({token:Vr,factory:Vr.\u0275fac})};return t=C([x(uf)],t),t})(),ff=class{waypointIndex;connectionId;static fToken=Symbol("RemoveConnectionWaypointRequest");constructor(i,e){this.waypointIndex=i,this.connectionId=e}},Oc=class{static fToken=Symbol("EmitEndDragSequenceEventRequest")},Ty=(()=>{let t=class Gr{_store=d(E);_dragSession=d(Y);handle(e){this._store.flowHost.classList.remove(Ne.DRAG_AND_DROP.DRAGGING),this._dragSession.reset(),this._emitEvent()}_emitEvent(){this._store.fDraggable?.fDragEnded?.emit()}static \u0275fac=function(n){return new(n||Gr)};static \u0275prov=g({token:Gr,factory:Gr.\u0275fac})};return t=C([x(Oc)],t),t})(),Fc=class{static fToken=Symbol("EmitStartDragSequenceEventRequest")},Ey=(()=>{let t=class Hr{_mediator=d(R);_store=d(E);_dragContext=d(Y);handle(e){this._dragContext.draggableItems.length>0&&(this._store.flowHost.classList.add(Ne.DRAG_AND_DROP.DRAGGING),this._mediator.execute(new yi),this._emitDragStarted())}_emitDragStarted(){let e=this._dragContext.draggableItems[0].getEvent();this._store.fDraggable?.fDragStarted?.emit(new Gc(e.kind,e.data?ue({},e.data):void 0,e.fEventType))}static \u0275fac=function(n){return new(n||Hr)};static \u0275prov=g({token:Hr,factory:Hr.\u0275fac})};return t=C([x(Fc)],t),t})(),yi=class{static fToken=Symbol("EmitSelectionChangeEventRequest")},an=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(i,e){this._event=i,this._target=e}setTarget(i){this._target=i}preventDefault(){this.originalEvent.preventDefault()}get isEventInLockedContext(){return this.targetElement.closest("[fLockedContext]")!==null}},Ac=class extends an{constructor(i,e){super(i,e)}isMouseLeftButton(){return this.originalEvent.button===0}isMouseRightButton(){return this.originalEvent.buttons===2}getPosition(){return{x:this.originalEvent.clientX,y:this.originalEvent.clientY}}},hf=class extends an{constructor(i,e){super(i,e)}isMouseLeftButton(){let i=this.originalEvent;return i.pointerType==="mouse"&&i.button===0||i.pointerType==="touch"}isMouseRightButton(){let i=this.originalEvent;return i.pointerType==="mouse"&&i.button===2||i.pointerType==="touch"}getPosition(){let i=this.originalEvent;return{x:i.clientX,y:i.clientY}}getPointerType(){return this.originalEvent.pointerType}getPointerId(){return this.originalEvent.pointerId}},pf=class extends an{constructor(i){super(i)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let i=this.originalEvent.touches;return{x:i[0].clientX,y:i[0].clientY}}},mf=class extends an{constructor(i,e){super(i,e)}isMouseLeftButton(){return!0}isMouseRightButton(){return!1}getPosition(){let i=this.originalEvent.targetTouches[0];return{x:i.clientX,y:i.clientY}}},he=(()=>{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})(),Py=800,_f=class{_document=d(io);_ngZone=d(Qn,{optional:!0});_mouseListeners=he.emptyListener();_touchListeners=he.emptyListener();_startListeners=he.emptyListener();isSyntheticEvent(i){return!!this._lastTouchEventTime&&this._lastTouchEventTime+Py>Date.now()}_lastTouchEventTime=0;isDragStarted=!1;_dragStartThreshold=3;_dragStartDelay=0;_dragStartTime=0;_dragStartPosition={x:0,y:0};_moveHandler=this._checkDragSequenceToStart;_pointerDownElement=null;_onMouseDown=i=>{let e=this.isSyntheticEvent(i),n=Dy(i),o=new Ac(i);if(e||n||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,he.activeListener()),this._listen("mousemove",this._onMouseMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,he.activeCaptureListener())}),this._mouseListeners=()=>{this._unlisten("selectstart",this._onSelectStart,he.activeListener()),this._unlisten("mousemove",this._onMouseMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,he.activeCaptureListener())})};_onTouchDown=i=>{let e=ky(i),n=new pf(i);if(e||this.disabled||this.isDragStarted)return;this._pointerDownElement=n.targetElement,this.onPointerDown(n)&&(this._dragStartTime=Date.now(),this._dragStartPosition=n.getPosition(),this._ngZone?.runOutsideAngular(()=>{this._listen("selectstart",this._onSelectStart,he.activeListener()),this._listen("touchmove",this._onTouchMove),this._listen("pointerup",this._onPointerUpEvent),this._listen("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._listen("contextmenu",this._preventDuringDrag,he.activeCaptureListener())}),this._touchListeners=()=>{this._unlisten("selectstart",this._onSelectStart,he.activeListener()),this._unlisten("touchmove",this._onTouchMove),this._unlisten("pointerup",this._onPointerUpEvent),this._unlisten("pointercancel",this._onPointerUpEvent,he.activeCaptureListener()),this._unlisten("contextmenu",this._preventDuringDrag,he.activeCaptureListener())})};_onSelectStart=i=>{this.onSelect(i)};_onMouseMove=i=>{this._moveHandler(new Ac(i))};_onTouchMove=i=>{this._moveHandler(new mf(i))};_checkDragSequenceToStart(i){let e=i.getPosition();if(!this.isDragStarted&&this._pointerDownElement){i.setTarget(this._pointerDownElement);let n=Math.abs(e.x-this._dragStartPosition.x),o=Math.abs(e.y-this._dragStartPosition.y);if(n+o>=this._dragStartThreshold){if(!(Date.now()>=this._dragStartTime+this._dragStartDelay)){this._endDragSequence();return}i.preventDefault(),this.prepareDragSequence(i),this.isDragStarted=!0,this._moveHandler=this.onPointerMove,My(i.originalEvent)&&(this._lastTouchEventTime=Date.now())}}}_onPointerUpEvent=i=>{this.isDragStarted&&this.onPointerUp(new hf(i)),this._endDragSequence()};_endDragSequence(){this.isDragStarted=!1,this._pointerDownElement=null,this._moveHandler=this._checkDragSequenceToStart,this._mouseListeners(),this._mouseListeners=he.emptyListener(),this._touchListeners(),this._touchListeners=he.emptyListener(),this.finalizeDragSequence()}subscribe(){this.unsubscribe(),this._ngZone?.runOutsideAngular(()=>{this._listen("mousedown",this._onMouseDown,he.activeListener()),this._listen("touchstart",this._onTouchDown,he.passiveListener())}),this._startListeners=()=>{this._unlisten("mousedown",this._onMouseDown,he.activeListener()),this._unlisten("touchstart",this._onTouchDown,he.passiveListener())}}unsubscribe(){this._startListeners(),this._startListeners=he.emptyListener(),this._touchListeners(),this._touchListeners=he.emptyListener(),this._mouseListeners(),this._mouseListeners=he.emptyListener()}_listen(i,e,n){this._document.addEventListener(i,e,n)}_unlisten(i,e,n){this._document.removeEventListener(i,e,n)}_preventDuringDrag=i=>{this.isDragStarted&&i.preventDefault()}};function My(t){return t.type[0]==="t"}function Dy(t){return t.buttons===0||t.offsetX===0&&t.offsetY===0}function ky(t){let i=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!!i&&i.identifier===-1&&(i.radiusX==null||i.radiusX===1)&&(i.radiusY==null||i.radiusY===1)}var gf=class extends an{_position;_isMouseLeftButton;_isMouseRightButton;constructor(i){super(i.originalEvent,i.targetElement),this._position=i.getPosition(),this._isMouseLeftButton=i.isMouseLeftButton(),this._isMouseRightButton=i.isMouseRightButton()}isMouseLeftButton(){return this._isMouseLeftButton}isMouseRightButton(){return this._isMouseRightButton}getPosition(){return ue({},this._position)}};function Ry(t){return new gf(t)}var Y=(()=>{class t{selectedItems=[];isSelectedChanged=!1;onPointerDownScale=1;onPointerDownPosition=new X(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 X(0,0),this.autoPanFrameId=null,this.lastPointerEvent=null,this.lastPointerPosition=null,this.isAutoPanCanvasMoved=!1}markSelectionAsChanged(){this.isSelectedChanged=!0}rememberPointerEvent(e){this.lastPointerEvent=Ry(e),this.lastPointerPosition=this.lastPointerEvent.getPosition()}isEmpty(){return!this.draggableItems.length}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),yf=class{nodeIds;groupIds;connectionIds;get fNodeIds(){return this.nodeIds}get fGroupIds(){return this.groupIds}get fConnectionIds(){return this.connectionIds}constructor(i,e,n){this.nodeIds=i,this.groupIds=e,this.connectionIds=n}},Ny=(()=>{let t=class jr{_mediator=d(R);_store=d(E);_dragSession=d(Y);handle(e){this._dragSession.isSelectedChanged&&(this._emitSelectionChange(this._getSelection()),this._dragSession.isSelectedChanged=!1,this._mediator.execute(new At))}_getSelection(){return this._mediator.execute(new Gi)}_emitSelectionChange(e){this._store.fDraggable?.fSelectionChange.emit(new yf(e.fNodeIds,e.fGroupIds,e.fConnectionIds))}static \u0275fac=function(n){return new(n||jr)};static \u0275prov=g({token:jr,factory:jr.\u0275fac})};return t=C([x(yi)],t),t})(),vf=class{nodeOrGroup;static fToken=Symbol("GetNormalizedParentNodeRectRequest");constructor(i){this.nodeOrGroup=i}},Oy=(()=>{let t=class Ur{_store=d(E);_mediator=d(R);handle({nodeOrGroup:e}){let n=G.initialize(-1/0,-1/0,1/0,1/0),o=this._getNode(e.fParentId());return o&&(n=this._getParentRect(o)),n}_getNode(e){return this._store.nodes.get(e)}_getParentRect(e){let n=this._getNodeRect(e),o=this._getNodePadding(e,n);return G.initialize(n.x+o[0],n.y+o[1],n.width-o[0]-o[2],n.height-o[1]-o[3])}_getNodeRect(e){return this._mediator.execute(new Ee(e.hostElement))}_getNodePadding(e,n){return this._mediator.execute(new dn(e,n))}static \u0275fac=function(n){return new(n||Ur)};static \u0275prov=g({token:Ur,factory:Ur.\u0275fac})};return t=C([x(vf)],t),t})(),Cf=class{fParentNodes;fDraggedNodes;static fToken=Symbol("IsArrayHasParentNodeRequest");constructor(i,e){this.fParentNodes=i,this.fDraggedNodes=e}},Fy=(()=>{let t=class $r{handle(e){return this._isParentNodeInArray(this._getParentNodeIds(e.fParentNodes),e.fDraggedNodes)}_getParentNodeIds(e){return e.map(n=>n.fId())}_isParentNodeInArray(e,n){return n.some(o=>e.includes(o.fId()))}static \u0275fac=function(n){return new(n||$r)};static \u0275prov=g({token:$r,factory:$r.\u0275fac})};return t=C([x(Cf)],t),t})(),xf=class{fNodeId;fConnectionIds;constructor(i,e){this.fNodeId=i,this.fConnectionIds=e}},Lc=class extends xf{nodeId;connectionIds;constructor(i,e){super(i,e),this.nodeId=i,this.connectionIds=e}},Bc=class{nodeOrGroup;static fToken=Symbol("DetectConnectionsUnderDragNodeRequest");constructor(i){this.nodeOrGroup=i}},Ay=(()=>{let t=class Wr{_mediator=d(R);_store=d(E);handle({nodeOrGroup:e}){let n=this._collectConnectableConnectorIds(e,"source"),o=this._collectConnectableConnectorIds(e,"target");if(!n.size||!o.size)return;let r=this._collectAttachedConnectionIds(n,o),s=this._collectConnectionsUnderNode(e),a=[];for(let l of s){let h=l.fId();r.has(h)||a.push(h)}a.length&&(this._store.fDraggable?.fNodeIntersectedWithConnections.emit(new Lc(e.fId(),a)),this._store.fDraggable?.fNodeConnectionsIntersection.emit(new Lc(e.fId(),a)))}_collectConnectableConnectorIds(e,n){let o=n==="source"?this._store.outputs.getAll():this._store.inputs.getAll(),r=new Set;for(let s of o)s.canBeConnected&&e.isContains(s.hostElement)&&r.add(s.fId());return r}_collectAttachedConnectionIds(e,n){let o=new Set;for(let r of this._store.connections.getAll())(e.has(r.fOutputId())||n.has(r.fInputId()))&&o.add(r.fId());return o}_collectConnectionsUnderNode(e){let n=this._mediator.execute(new zt(e.hostElement,!1)),o=[];for(let r of this._store.connections.getAll())this._hasIntersection(r,n)&&o.push(r);return o}_hasIntersection(e,n){return Sn.getRoundedRectIntersectionsWithSVGPath(e.fPath().hostElement,n).length>0}static \u0275fac=function(n){return new(n||Wr)};static \u0275prov=g({token:Wr,factory:Wr.\u0275fac})};return t=C([x(Bc)],t),t})(),Ly=[Ey,Ty,Ny,Oy,Fy,Ay],By=new Set(["create-connection","reassign-connection","drag-node"]),zy=new Set(["selection-area"]),Vy=new Set(["assign-to-container"]);function Wp(t){let i=null;for(let e of t){if(Vy.has(e))continue;let n=By.has(e)?"rebase":zy.has(e)?"direct":null;if(!n)return null;if(!i){i=n;continue}if(i!==n)return null}return i}function qp(t,i,e,n,o){return L.initialize(dp(t.x,i.left,i.right,e,n,o),dp(t.y,i.top,i.bottom,e,n,o))}function dp(t,i,e,n,o,r){let s=Math.max(0,n),a=Math.max(0,o);if(!s||!a)return 0;if(t<=i+s){let l=up((i+s-t)/s,0,1);return lp(l,a,r)}if(t>=e-s){let l=up((t-(e-s))/s,0,1);return-lp(l,a,r)}return 0}function Gy(t,i,e){let n=e||1;return X.fromPoint(t).add(X.fromPoint(i).div(n))}function lp(t,i,e){return e?i*t:i}function up(t,i,e){return Math.max(i,Math.min(e,t))}var zc=class{static fToken=Symbol("RunAutoPanFrameRequest")},Vt=class{static fToken=Symbol("StopAutoPanRequest")},Hy=(()=>{let t=class qr{_store=d(E);_dragContext=d(Y);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(n){return new(n||qr)};static \u0275prov=g({token:qr,factory:qr.\u0275fac})};return t=C([x(Vt)],t),t})(),vi=class{static fToken=Symbol("SyncAutoPanRequest")},jy=(()=>{let t=class Xr{_mediator=d(R);_store=d(E);_dragContext=d(Y);handle(e){if(!this._canAutoPan()||!this._hasAutoPanDelta()){this._mediator.execute(new Vt);return}this._dragContext.autoPanFrameId===null&&(this._dragContext.autoPanFrameId=requestAnimationFrame(()=>{this._dragContext.autoPanFrameId=null,this._mediator.execute(new zc)}))}_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,n=this._store.fFlow?.hostElement;return!e||!n?L.initialize():qp(e,n.getBoundingClientRect(),this._edgeThreshold(),this._speed(),this._acceleration())}_getAutoPanMode(){return Wp(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(ye.AUTO_PAN)}static \u0275fac=function(n){return new(n||Xr)};static \u0275prov=g({token:Xr,factory:Xr.\u0275fac})};return t=C([x(vi)],t),t})(),Uy=(()=>{let t=class Kr{_mediator=d(R);_store=d(E);_dragContext=d(Y);handle(e){let n=this._getAutoPanMode();if(!this._canAutoPan(n)){this._mediator.execute(new Vt);return}let o=this._getAutoPanDelta();if(!o.x&&!o.y){this._mediator.execute(new Vt);return}this._applyCanvasDelta(o,n),this._replayLastPointerMove(),this._mediator.execute(new vi)}_applyCanvasDelta(e,n){let o=this._store.transform;n==="rebase"&&(this._dragContext.onPointerDownPosition=Gy(this._dragContext.onPointerDownPosition,e,this._dragContext.onPointerDownScale||o.scale||1)),o.position=X.fromPoint(o.position).add(e),this._store.fCanvas?.redraw(),this._dragContext.isAutoPanCanvasMoved=!0}_replayLastPointerMove(){let e=this._dragContext.lastPointerEvent;if(!e)return;let n=this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition);this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(ue({},n),e)})}_getPointerPositionInCanvas(e){return X.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 Wp(this._dragContext.draggableItems.map(e=>e.getEvent().kind))}_getAutoPanDelta(){let e=this._dragContext.lastPointerPosition,n=this._store.fFlow?.hostElement;return!e||!n?L.initialize():qp(e,n.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(ye.AUTO_PAN)}static \u0275fac=function(n){return new(n||Kr)};static \u0275prov=g({token:Kr,factory:Kr.\u0275fac})};return t=C([x(zc)],t),t})(),$y=[jy,Uy,Hy],Vc=class{event;static fToken=Symbol("DragCanvasFinalizeRequest");constructor(i){this.event=i}},Gc=class{kind;data;fEventType;get fData(){return this.data}constructor(i,e,n){this.kind=i,this.data=e,this.fEventType=n??i}},Xe=class{data(){}_features=[];getEvent(){return new Gc(this.kind,this.data(),this.type)}attachFeature(i){this._features.push(i)}featuresPrepare(i){for(let e of this._features)e.onPrepare?.(i)}featuresMove(i,e){for(let n of this._features)n.onMove?.(i,e)}featuresFinalize(i,e){for(let n of this._features)n.onFinalize?.(i,e)}featuresEnd(i){for(let e of this._features)e.onEnd?.(i)}},Hc=class{_isConnected=!1;get isConnected(){return this._isConnected}toConnector=[];isSelfConnectable=!0;fConnectableSide=B.AUTO;userFConnectableSide=B.AUTO;isContains(i){return this.hostElement.contains(i)}setConnected(i){this._isConnected=!0,this.toConnector.push(i)}resetConnected(){this._isConnected=!1,this.toConnector=[]}},Wy=new fe("F_NODE_INPUT"),qy=(()=>{class t extends Hc{kind="input";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Pe({type:t,standalone:!1,features:[_e]})}return t})(),yt=(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})(yt||{});function Xy(t){return ii(t,".f-rotate-handle")}var Xp=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,selectors:[["","fDragHandle",""]],hostAttrs:[1,"f-drag-handle","f-component"],standalone:!1})}return t})(),Pl=new fe("F_NODE"),Ky=zp(class{hostElement;constructor(t){this.hostElement=t}}),jc=class extends Ky{_injector=d(Ye);renderer=d(Th);browser=d(Re);stateChanges=new ct;_position=L.initialize();_rotate=0;_size;connectors=[];positionChanges(){me(()=>{let i=this.position();gt(()=>{L.isEqual(this._position,i)||(this._position=i,this.redraw(),this.refresh())})},{injector:this._injector})}sizeChanges(){me(()=>{let i=this.size();gt(()=>{this._isSizeEqual(i)||(this._size=i,this.redraw(),this.refresh())})},{injector:this._injector})}rotateChanges(){me(()=>{let i=this.rotate();gt(()=>{this._rotate!==i&&(this._rotate=i,this.redraw(),this.refresh())})},{injector:this._injector})}parentChanges(){me(()=>{this.fParentId(),this.fIncludePadding(),this.fAutoSizeToFitChildren(),gt(()=>this.refresh())},{injector:this._injector})}_isSizeEqual(i){return this._size?.width===i?.width&&this._size?.height===i?.height}isContains(i){return this.hostElement.contains(i)}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(i){this._position=i}updateRotate(i){this._rotate=i}updateSize(i){this._size=i}setClass(i){this.hostElement.classList.add(i)}removeClass(i){this.hostElement.classList.remove(i)}addConnector(i){this.connectors.push(i),this.refresh()}removeConnector(i){let e=this.connectors.indexOf(i);e!==-1&&this.connectors.splice(e,1),this.refresh()}},Yy=0,Zy=3,bf=(()=>{class t extends jc{_debounceTimer=null;_destroyRef=d(Ze);_mediator=d(R);fId=F(`f-group-${Yy++}`,{alias:"fGroupId"});fParentId=F(null,{alias:"fGroupParentId"});position=Kt(L.initialize(),{alias:"fGroupPosition"});size=F(void 0,{alias:"fGroupSize"});sizeChange=He({alias:"fGroupSizeChange"});rotate=Kt(0,{alias:"fGroupRotate"});fConnectOnNode=F(!0,{transform:xe});fMinimapClass=F([]);fDraggingDisabled=F(!1,{alias:"fGroupDraggingDisabled",transform:xe});fSelectionDisabled=F(!1,{alias:"fGroupSelectionDisabled",transform:xe});fIncludePadding=F(!0,{transform:xe});fAutoExpandOnChildHit=F(!1,{transform:xe});fAutoSizeToFitChildren=F(!1,{transform:xe});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Oi(this))}setStyle(e,n){this.renderer.setStyle(this.hostElement,e,n)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new At),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),Zy))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new An(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new Ai(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new Li(this))}static \u0275fac=function(n){return new(n||t)(gu(Se))};static \u0275dir=Pe({type:t,selectors:[["","fGroup",""]],hostAttrs:[1,"f-group","f-component"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("data-f-group-id",o.fId()),de("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:[Ie([{provide:Pl,useExisting:t}]),_e]})}return t})(),fp=0,Qy=3,Ml=(()=>{class t extends jc{_debounceTimer=null;_destroyRef=d(Ze);_mediator=d(R);fId=F(`f-node-${fp++}`,{alias:"fNodeId",transform:e=>On(e)||`f-node-${fp++}`});fParentId=F(null,{alias:"fNodeParentId"});position=Kt(L.initialize(),{alias:"fNodePosition"});size=F(void 0,{alias:"fNodeSize"});sizeChange=He({alias:"fNodeSizeChange"});rotate=Kt(0,{alias:"fNodeRotate"});fConnectOnNode=F(!0,{transform:xe});fMinimapClass=F([]);fDraggingDisabled=F(!1,{alias:"fNodeDraggingDisabled",transform:xe});fSelectionDisabled=F(!1,{alias:"fNodeSelectionDisabled",transform:xe});fIncludePadding=F(!0,{transform:xe});fAutoExpandOnChildHit=F(!1,{transform:xe});fAutoSizeToFitChildren=F(!1,{transform:xe});constructor(e){super(e.nativeElement),super.positionChanges(),super.sizeChanges(),super.rotateChanges(),super.parentChanges()}ngOnInit(){super.redraw(),this._mediator.execute(new Oi(this))}setStyle(e,n){this.renderer.setStyle(this.hostElement,e,n)}removeStyle(e){this.renderer.removeStyle(this.hostElement,e)}redraw(){super.redraw(),this._mediator.execute(new At),this._updateConnectorsSides()}_updateConnectorsSides(){this.connectors.length&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._calculateNodeConnectorsConnectableSides(),Qy))}_calculateNodeConnectorsConnectableSides(){this._mediator.execute(new An(this))}ngAfterViewInit(){this.browser.isBrowser()&&this._listenStateSizeChanges()}_listenStateSizeChanges(){this._mediator.execute(new Ai(this,this._destroyRef))}refresh(){this.stateChanges.notify()}ngOnDestroy(){this._mediator.execute(new Li(this))}static \u0275fac=function(n){return new(n||t)(gu(Se))};static \u0275dir=Pe({type:t,selectors:[["","fNode",""]],hostAttrs:[1,"f-node","f-component"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("data-f-node-id",o.fId()),de("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:[Ie([{provide:Pl,useExisting:t}]),_e]})}return t})();function Jy(t){return!!t.closest("[fNode]")}var hp=0,Kp=(()=>{class t extends qy{hostElement=d(Se).nativeElement;_mediator=d(R);_node=d(Pl);fId=F(`f-node-input-${hp++}`,{alias:"fInputId",transform:e=>On(e)||`f-node-input-${hp++}`});category=F(void 0,{alias:"fInputCategory",transform:On});multiple=F(!0,{alias:"fInputMultiple",transform:xe});disabled=F(!1,{alias:"fInputDisabled",transform:xe});userFConnectableSide=B.AUTO;get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new ki(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_CONNECTED,!0),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_CONNECTED,!1),this.hostElement.classList.toggle(Ne.CONNECTOR.INPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new Bi(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Pe({type:t,selectors:[["","fNodeInput",""]],hostAttrs:[1,"f-component","f-node-input"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("data-f-input-id",o.fId()),de("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=>In(e,"fInputConnectableSide",B)]},exportAs:["fNodeInput"],standalone:!1,features:[Ie([{provide:Wy,useExisting:t}]),_e,mn]})}return t})(),ev=(()=>{class t extends Hc{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=ne(t)))(o||t)}})();static \u0275dir=Pe({type:t,standalone:!1,features:[_e]})}return t})();function Yp(t){return!!t.closest("[fNodeOutlet]")}var tv=new fe("F_NODE_OUTPUT"),nv=(()=>{class t extends ev{kind="output";get canBeConnected(){return!this.disabled()&&(this.multiple()?!0:!this.isConnected)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Pe({type:t,standalone:!1,features:[_e]})}return t})();function Zp(t){return!!t.closest("[fNodeOutput]")}var pp=0,Qp=(()=>{class t extends nv{hostElement=d(Se).nativeElement;_mediator=d(R);_node=d(Pl);fId=F(`f-node-output-${pp++}`,{alias:"fOutputId",transform:e=>On(e)||`f-node-output-${pp++}`});multiple=F(!1,{alias:"fOutputMultiple",transform:xe});disabled=F(!1,{alias:"fOutputDisabled",transform:xe});userFConnectableSide=B.AUTO;isSelfConnectable=!0;canBeConnectedInputs=[];get fNodeId(){return this._node.fId()}get fNodeHost(){return this._node.hostElement}ngOnInit(){this._mediator.execute(new ki(this)),this._node.addConnector(this)}ngOnChanges(e){e.userFConnectableSide&&this._node.refresh()}setConnected(e){super.setConnected(e),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_CONNECTED,!0),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}resetConnected(){super.resetConnected(),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_CONNECTED,!1),this.hostElement.classList.toggle(Ne.CONNECTOR.OUTPUT_NOT_CONNECTABLE,!this.canBeConnected)}ngOnDestroy(){this._node.removeConnector(this),this._mediator.execute(new Bi(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Pe({type:t,selectors:[["","fNodeOutput",""]],hostAttrs:[1,"f-component","f-node-output"],hostVars:7,hostBindings:function(n,o){n&2&&(Z("data-f-output-id",o.fId()),de("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=>In(e,"fOutputConnectableSide",B)],isSelfConnectable:"isSelfConnectable",canBeConnectedInputs:[0,"fCanBeConnectedInputs","canBeConnectedInputs"]},exportAs:["fNodeOutput"],standalone:!1,features:[Ie([{provide:tv,useExisting:t}]),_e,mn]})}return t})();var Uc=class{event;static fToken=Symbol("CreateConnectionFinalizeRequest");constructor(i){this.event=i}},Ci=class{outlet;static fToken=Symbol("ResolveConnectableOutputForOutletRequest");constructor(i){this.outlet=i}},iv=(()=>{let t=class Yr{_store=d(E);handle({outlet:e}){let n=this._findOwnerNode(e);if(!n)throw new Error("The fOutlet must belong to an fNode");let o=this._findFirstConnectableOutputInNode(n);if(!o)throw new Error("Outlet requires at least one connectable output in the same node.");return o}_findOwnerNode(e){let n=e.hostElement;return this._store.nodes.getAll().find(o=>o.isContains(n))}_findFirstConnectableOutputInNode(e){return this._store.outputs.getAll().find(n=>e.isContains(n.hostElement)&&n.canBeConnected)}static \u0275fac=function(n){return new(n||Yr)};static \u0275prov=g({token:Yr,factory:Yr.\u0275fac})};return t=C([x(Ci)],t),t})(),wf=class{sourceId;targetId;dropPosition;fOutputId;fInputId;fDropPosition;constructor(i,e,n){this.sourceId=i,this.targetId=e,this.dropPosition=n,this.fOutputId=i,this.fInputId=e,this.fDropPosition=n}},$c=(()=>{class t extends Xe{type="create-connection";kind="create-connection";data(){return{fOutputOrOutletId:this._sourceRef.connector.fId()}}_result=d(Ht);_mediator=d(R);_connectionBehaviour=d(jn);_store=d(E);get _connection(){return this._store.connections.getForCreate()}get _snapConnection(){return this._store.connections.getForSnap()}_targets=[];_sourceRef;_pointerDown=new ke;initialize(e,n){this._sourceRef=this._mediator.execute(new rt(e)),this._pointerDown=ke.fromRect(G.initialize(n.x,n.y))}prepareDragSequence(){this._collectAndMarkTargets(),this._initSnapConnection(),this._initCreateConnection(),this._connection.show(),this.onPointerMove(L.initialize()),this._result.setData({toConnectorRect:this._pointerDown,canBeConnectedInputs:this._targets,fOutputId:this._sourceRef.connector.fId()})}_collectAndMarkTargets(){this._targets=this._mediator.execute(new Ni(this._sourceRef.connector,this._sourceRef.rect.gravityCenter)),this._mediator.execute(new zn(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 n=this._pointerDown.addPoint(e),o=this._findClosestTarget(n),r=o?.connector.fConnectableSide||B.TOP;this._drawCreateConnection(n,r);let s=this._snapConnection;if(!s)return;let a=o&&o.distance<s.fSnapThreshold?o:void 0;this._drawSnapConnection(a)}_findClosestTarget(e){return this._mediator.execute(new cn(e,this._targets))}_drawCreateConnection(e,n){let o=this._connectionBehaviour.handle(new mt(this._sourceRef.rect,e,this._connection,this._sourceRef.connector.fConnectableSide,n,this._resolveRotationContext(this._sourceRef.connector)));this._connection.setLine(o),this._connection.redraw()}_drawSnapConnection(e){let n=this._snapConnection;if(!n)return;if(!e){n.hide();return}let o=this._connectionBehaviour.handle(new mt(this._sourceRef.rect,e.rect,n,this._sourceRef.connector.fConnectableSide,e.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(e.connector)));n.show(),n.setLine(o),n.redraw()}onPointerUp(){this._connection.redraw(),this._connection.hide(),this._snapConnection?.hide(),this._mediator.execute(new Vn(this._targets.map(e=>e.connector)))}_resolveRotationContext(e){return this._mediator.execute(new Et(e))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),ov=(()=>{let t=class Zr{_result=d(Ht);_mediator=d(R);_store=d(E);_dragContext=d(Y);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 $c)}_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 Yp(e.hostElement)?this._mediator.execute(new Ci(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 wf(this._getTargetOutput(this._getOutput()||this._getOutlet()).fId(),this._getInputUnderPointer(e)?.fId(),e.getPosition()))}_getInputUnderPointer(e){return this._mediator.execute(new Ri(e.getPosition(),this._result.getData().canBeConnectedInputs))}static \u0275fac=function(n){return new(n||Zr)};static \u0275prov=g({token:Zr,factory:Zr.\u0275fac})};return t=C([x(Uc)],t),t})(),xi=class{eventPosition;source;static fToken=Symbol("CreateConnectionCreateDragHandlerRequest");constructor(i,e){this.eventPosition=i,this.source=e}},rv=(()=>{let t=class Qr{_store=d(E);_dragContext=d(Y);_dragInjector=d(ze);get _transform(){return this._store.transform}handle({source:e,eventPosition:n}){this._dragContext.onPointerDownScale=this._transform.scale;let o=this._toFlowSpace(n);this._dragContext.onPointerDownPosition=o;let r=this._toCanvasSpace(o),s=this._dragInjector.get($c);s.initialize(e,r),this._dragContext.draggableItems=[s]}_toFlowSpace(e){return X.fromPoint(e).elementTransform(this._store.flowHost).div(this._transform.scale)}_toCanvasSpace(e){return X.fromPoint(e).mult(this._transform.scale).sub(this._transform.position).sub(this._transform.scaledPosition).div(this._transform.scale)}static \u0275fac=function(n){return new(n||Qr)};static \u0275prov=g({token:Qr,factory:Qr.\u0275fac})};return t=C([x(xi)],t),t})(),Wc=class{event;node;static fToken=Symbol("CreateConnectionFromOutletPreparationRequest");constructor(i,e){this.event=i,this.node=e}},sv=(()=>{let t=class Jr{_mediator=d(R);_store=d(E);handle({event:e,node:n}){let o=this._findOutlet(n);if(!o||(o.setOutputs(this._getOutputs(n)),!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(n=>e.isContains(n.hostElement))}_getOutputs(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement))}_resolveOutput(e){return this._mediator.execute(new Ci(e))}_startDrag(e,n){this._mediator.execute(new xi(e,n))}static \u0275fac=function(n){return new(n||Jr)};static \u0275prov=g({token:Jr,factory:Jr.\u0275fac})};return t=C([x(Wc)],t),t})(),qc=class{event;node;static fToken=Symbol("CreateConnectionFromOutputPreparationRequest");constructor(i,e){this.event=i,this.node=e}},av=(()=>{let t=class es{_mediator=d(R);_store=d(E);handle({event:e,node:n}){if(!Zp(e.targetElement)||this._hasOutlet(n))return;let o=this._findOutput(e.targetElement);!o||!o.canBeConnected||this._startDrag(e.getPosition(),o)}_hasOutlet(e){return this._store.outlets.getAll().some(n=>e.isContains(n.hostElement))}_findOutput(e){return this._store.outputs.getAll().find(n=>n.hostElement.contains(e))}_startDrag(e,n){this._mediator.execute(new xi(e,n))}static \u0275fac=function(n){return new(n||es)};static \u0275prov=g({token:es,factory:es.\u0275fac})};return t=C([x(qc)],t),t})(),Xc=class{event;fTrigger;static fToken=Symbol("CreateConnectionPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},cv=(()=>{let t=class ts{_mediator=d(R);_store=d(E);_dragContext=d(Y);handle({event:e,fTrigger:n}){if(!this._isValidConditions()||!this._isValidTrigger(e,n))return;let o=Yp(e.targetElement),r=!o&&Zp(e.targetElement);if(!o&&!r)return;let s=this._findOwnerNode(e.targetElement);s&&(o?this._mediator.execute(new Wc(e,s)):this._mediator.execute(new qc(e,s)))}_findOwnerNode(e){return this._store.nodes.getAll().find(n=>n.isContains(e))}_isValidConditions(){return this._dragContext.isEmpty()&&!!this._store.connections.getForCreate()}_isValidTrigger(e,n){return dt(e.originalEvent,n)}static \u0275fac=function(n){return new(n||ts)};static \u0275prov=g({token:ts,factory:ts.\u0275fac})};return t=C([x(Xc)],t),t})(),Kc=class{event;static fToken=Symbol("ReassignConnectionFinalizeRequest");constructor(i){this.event=i}},Sf=class{connectionId;endpoint;previousSourceId;nextSourceId;previousTargetId;nextTargetId;dropPosition;isSourceReassign;isTargetReassign;oldSourceId;newSourceId;oldTargetId;newTargetId;dropPoint;constructor(i,e,n,o,r,s,a){this.connectionId=i,this.endpoint=e,this.previousSourceId=n,this.nextSourceId=o,this.previousTargetId=r,this.nextTargetId=s,this.dropPosition=a,this.isSourceReassign=e==="source",this.isTargetReassign=e==="target",this.oldSourceId=n,this.newSourceId=o,this.oldTargetId=r,this.newTargetId=s,this.dropPoint=a}},dv=(()=>{let t=class ns{_dragResult=d(Ht);_mediator=d(R);_store=d(E);_dragContext=d(Y);get _dragDirective(){return this._store.fDraggable}handle({event:e}){let n=this._findReassignHandler();n&&(this._emitIfChanged(e),n.onPointerUp())}_findReassignHandler(){return this._dragContext.draggableItems.find(n=>n.getEvent().fEventType==="reassign-connection")}_emitIfChanged(e){let n=this._dragResult.getData(),o=this._findConnectableConnector(e,n.candidates);o&&!this._isReassignedToDifferentConnector(n,o)||this._dragDirective.fReassignConnection.emit(this._buildEvent(n,e,o))}_findConnectableConnector(e,n){return this._mediator.execute(new Ri(e.getPosition(),n))}_isReassignedToDifferentConnector(e,n){let o=e.connection;return e.draggedEnd==="target"?o.fInputId()!==n.fId():o.fOutputId()!==n.fId()}_buildEvent(e,n,o){let r=e.connection;return new Sf(r.fId(),e.draggedEnd,r.fOutputId(),e.draggedEnd==="source"?o?.fId():void 0,r.fInputId(),e.draggedEnd==="target"?o?.fId():void 0,n.getPosition())}static \u0275fac=function(n){return new(n||ns)};static \u0275prov=g({token:ns,factory:ns.\u0275fac})};return t=C([x(Kc)],t),t})(),Yc=class{event;fTrigger;static fToken=Symbol("ReassignConnectionPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}};function lv(t,i){return Jp(t,i)||uv(t,i)}function Jp(t,i){return t.fDragHandleEnd()?.point&&em(i,t.fDragHandleEnd().point)&&!t.fDraggingDisabled()}function uv(t,i){return!!t.fDragHandleStart()?.point&&em(i,t.fDragHandleStart().point)&&!t.fDraggingDisabled()&&t.fReassignableStart()}function em(t,i){return(t.x-i.x)**2+(t.y-i.y)**2<=8**2}function tm(t,i){return t&&t.distance<i.fSnapThreshold?t:void 0}function Zc(t){return ke.fromRect(G.initialize(t.x,t.y))}var If=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(i,e,n,o,r){this._mediator=i,this._behaviour=e,this._connection=n,this._sourceRef=o,this._targetRef=r,this._anchorRect=Zc(this._connection.line.point1)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new el(this._target,this._targetRef.rect.gravityCenter)),this._candidates.some(i=>i.connector.fId()===this._source.fId())||this._candidates.push(this._sourceRef),this._mediator.execute(new zn(this._candidates.map(i=>i.connector)))}setSnapConnection(i){this._snap=i,i&&(i.fInputId.set(this._connection.fInputId()),i.initialize())}onPointerMove(i){let e=this._anchorRect.addPoint(i),n=this._findClosest(e.gravityCenter),o=n?.connector.fConnectableSide??this._source.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(tm(n,r))}_findClosest(i){return this._mediator.execute(new cn(i,this._candidates))}_draw(i,e){let n=this._behaviour.handle(new mt(i,this._targetRef.rect,this._connection,e,this._targetRef.connector.fConnectableSide,void 0,this._resolveRotationContext(this._targetRef.connector)));this._connection.setLine(n),this._connection.redraw()}_drawSnap(i){let e=this._snap;if(!e)return;if(!i){e.hide();return}let n=this._behaviour.handle(new mt(i.rect,this._targetRef.rect,e,i.connector.fConnectableSide,this._target.fConnectableSide,this._resolveRotationContext(i.connector),this._resolveRotationContext(this._targetRef.connector)));e.show(),e.setLine(n),e.redraw()}onPointerUp(){this._draw(this._anchorRect,this._sourceRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Vn(this._candidates.map(i=>i.connector)))}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},Tf=class{_mediator;_behaviour;_connection;_sourceRef;_targetRef;_candidates=[];_snap;_anchorRect;get _source(){return this._sourceRef.connector}get _target(){return this._targetRef.connector}constructor(i,e,n,o,r){this._mediator=i,this._behaviour=e,this._connection=n,this._sourceRef=o,this._targetRef=r,this._anchorRect=Zc(this._connection.line.point2)}candidates(){return this._candidates}collectAndMarkCandidates(){this._candidates=this._mediator.execute(new Ni(this._source,this._sourceRef.rect.gravityCenter));let i=this._connection.fInputId();i&&!this._candidates.some(e=>e.connector.fId()===i)&&this._candidates.push(this._targetRef),this._mediator.execute(new zn(this._candidates.map(e=>e.connector)))}setSnapConnection(i){this._snap=i,i&&(i.fOutputId.set(this._connection.fOutputId()),i.initialize())}onPointerMove(i){let e=this._anchorRect.addPoint(i),n=this._findClosest(e.gravityCenter),o=n?.connector.fConnectableSide??this._target.fConnectableSide;this._draw(e,o);let r=this._snap;r&&this._drawSnap(tm(n,r))}onPointerUp(){this._draw(this._anchorRect,this._targetRef.connector.fConnectableSide),this._snap?.hide(),this._mediator.execute(new Vn(this._candidates.map(i=>i.connector)))}_findClosest(i){return this._mediator.execute(new cn(i,this._candidates))}_draw(i,e){let n=this._behaviour.handle(new mt(this._sourceRef.rect,i,this._connection,this._source.fConnectableSide,e,this._resolveRotationContext(this._sourceRef.connector),void 0));this._connection.setLine(n),this._connection.redraw()}_drawSnap(i){let e=this._snap;if(!e)return;if(!i){e.hide();return}let n=this._behaviour.handle(new mt(this._sourceRef.rect,i.rect,e,this._source.fConnectableSide,i.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(i.connector)));e.show(),e.setLine(n),e.redraw()}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},Ef=(()=>{class t extends Xe{type="reassign-connection";kind="reassign-connection";data(){return{fConnectionId:this._connection.fId()}}_result=d(Ht);_mediator=d(R);_connectionBehaviour=d(jn);_store=d(E);get _snapConnection(){return this._store.connections.getForSnap()}_connection;_draggedEnd;_sourceRef;_targetRef;_reassignHandler;initialize(e,n){this._connection=e,this._draggedEnd=n?"target":"source",this._sourceRef=this._mediator.execute(new rt(this._store.outputs.require(this._connection.fOutputId()))),this._targetRef=this._mediator.execute(new rt(this._store.inputs.require(this._connection.fInputId()))),this._reassignHandler=this._draggedEnd==="target"?this._createTargetHandler():this._createSourceHandler()}_createSourceHandler(){return new If(this._mediator,this._connectionBehaviour,this._connection,this._sourceRef,this._targetRef)}_createTargetHandler(){return new Tf(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:Zc(this._connection.line.point1),targetAnchorRect:Zc(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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),fv=(()=>{let t=class is{_mediator=d(R);_store=d(E);_dragContext=d(Y);_dragInjector=d(ze);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 n=Un(e.event.getPosition(),this._store.flowHost,this._transform),o=this._findConnectionAt(n);o&&(this._capturePointerDown(e),this._startDrag(o,n),queueMicrotask(()=>this._bringToFront(o)))}_findConnectionAt(e){return this._connections.find(n=>lv(n,e))}_capturePointerDown(e){this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=X.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(this._transform.scale)}_startDrag(e,n){let o=this._dragInjector.get(Ef);o.initialize(e,Jp(e,n)),this._dragContext.draggableItems=[o]}_isValidTrigger(e){return dt(e.event.originalEvent,e.fTrigger)}_bringToFront(e){this._mediator.execute(new ln(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||is)};static \u0275prov=g({token:is,factory:is.\u0275fac})};return t=C([x(Yc)],t),t})(),Qc=class{event;static fToken=Symbol("DragConnectionWaypointFinalizeRequest");constructor(i){this.event=i}},Jc=class{connectionId;waypoints;constructor(i,e){this.connectionId=i,this.waypoints=e}},ed=(()=>{class t extends Xe{type="move-connection-waypoint";kind="drag-connection-waypoint";_store=d(E);_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=ue({},this._pick.candidate),this._waypointsComponent.insert(this._pick.candidate)):this._pick?.waypoint&&(this._point=ue({},this._pick.waypoint),this._waypointsComponent.select(this._pick.waypoint)),this._redrawConnection()}onPointerMove(e){this._waypointsComponent.move(L.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 Jc(this._connection.fId(),this._connection.fWaypoints()?.waypoints()||[])}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),hv=(()=>{let t=class os{_dragContext=d(Y);get _fDragHandler(){return this._dragContext.draggableItems[0]}handle(e){this._isDroppedConnectionReassignEvent()&&this._fDragHandler.onPointerUp()}_isDroppedConnectionReassignEvent(){return this._dragContext.draggableItems.some(e=>e instanceof ed)}static \u0275fac=function(n){return new(n||os)};static \u0275prov=g({token:os,factory:os.\u0275fac})};return t=C([x(Qc)],t),t})(),td=class{event;fTrigger;static fToken=Symbol("DragConnectionWaypointPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},pv=(()=>{let t=class rs{_mediator=d(R);_store=d(E);_dragContext=d(Y);_dragInjector=d(ze);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 n=Un(e.event.getPosition(),this._flowHost,this._transform),o=this._pickControlPoint(n);if(!o||!this._isValidTrigger(e))return;let r=this._dragInjector.get(ed);r.setPick(o),this._dragContext.onPointerDownScale=this._transform.scale,this._dragContext.onPointerDownPosition=X.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 Vg(this._connections,e)}_isValidTrigger(e){return dt(e.event.originalEvent,e.fTrigger)}_updateConnectionLayer(e){this._mediator.execute(new ln(e,this._canvas.fConnectionsContainer().nativeElement))}static \u0275fac=function(n){return new(n||rs)};static \u0275prov=g({token:rs,factory:rs.\u0275fac})};return t=C([x(td)],t),t})(),mv=[ov,rv,sv,iv,av,cv,dv,fv,pv,hv],nd=class{event;static fToken=Symbol("DropToGroupFinalizeRequest");constructor(i){this.event=i}},_v=1,bi=(()=>{class t extends Xe{type="move-node-to-parent";kind="assign-to-container";_store=d(E);_dragSession=d(Y);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(Ne.GROUPING.DROP_ACTIVE)}onPointerMove(e){this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>this._updateActiveTarget(e),_v)}onPointerUp(){this._clearActiveTarget();for(let{node:e}of this._candidateGroups)e.hostElement.classList.remove(Ne.GROUPING.DROP_ACTIVE);this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}_updateActiveTarget(e){let n=this._getPointerInFlow(e),o=this._findTargetUnderPointer(n);o?this._setActiveTarget(o):this._clearActiveTarget()}_getPointerInFlow(e){let n=X.fromPoint(this._dragSession.onPointerDownPosition).add(e),o=X.fromPoint(this._transform.position).add(this._transform.scaledPosition).div(this._transform.scale);return n.sub(o)}_findTargetUnderPointer(e){return this._candidateGroups.find(n=>G.isIncludePoint(n.rect,e))}_setActiveTarget(e){this._activeTarget?.node!==e.node&&(this._clearActiveTarget(),this._activeTarget=e,e.node.setClass(Ne.GROUPING.OVER_BOUNDARY))}_clearActiveTarget(){this._activeTarget?.node.removeClass(Ne.GROUPING.OVER_BOUNDARY),this._activeTarget=null}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),id=class{nodesAndGroups;static fToken=Symbol("CreateDragNodeHierarchyRequest");constructor(i){this.nodesAndGroups=i}},Pf=class{rootHandlers;participants;constructor(i,e){this.rootHandlers=i,this.participants=e}},Mf=class{fNodeIds;constructor(i){this.fNodeIds=i}},th="move-node",nh="drag-node";function gv(t){return t.getEvent().kind===nh||t.getEvent().fEventType===th}var Gt=(()=>{class t extends Xe{type=th;kind=nh;data(){return new Mf(this.items.map(e=>e.nodeOrGroup.fId()))}_magneticLines=null;_magneticRects=null;items;roots;initialize(e,n){this.items=e,this.roots=n}setMagneticLines(e){this._magneticLines=e}setMagneticRects(e){this._magneticRects=e}calculateMagneticLinesGuides(e){return this.calculateMagneticSnaps(e).lines}calculateMagneticSnaps(e){this._previewRoots(e);let n=this._rootsUnionRect();return{lines:this._magneticLines?._computeGuides(n),rects:this._magneticRects?._computeRects(n)}}prepareDragSequence(){for(let e of this.roots)e.prepareDragSequence()}onPointerMove(e){this._previewRoots(e);let n=this._rootsUnionRect();this._magneticLines?.scheduleRender(n),this._magneticRects?.scheduleRender(n)}onPointerUp(){for(let e of this.roots)e.onPointerUp();this._magneticLines?.clearGuides(),this._magneticRects?.clearGuides(),requestAnimationFrame(()=>this._refreshDraggedNodes())}_previewRoots(e){for(let n of this.roots)n.onPointerMove(e)}_rootsUnionRect(){let e=null;for(let n of this.roots){let o=n.getLastRect();e=e?G.union([e,o]):o}return e??G.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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),od=class{_limits;_quantizeStep;constructor(i,e=.5){this._limits=i,this._quantizeStep=e}applyInto(i,e){let{min:n,max:o}=this._limits,r=this._clamp(i.x,n.x,o.x),s=this._clamp(i.y,n.y,o.y),a=i.x-r,l=i.y-s,h=this._quantizeSigned(a,this._quantizeStep),_=this._quantizeSigned(l,this._quantizeStep);e.value.x=r,e.value.y=s,e.edges.left=h<0,e.edges.right=h>0,e.edges.top=_<0,e.edges.bottom=_>0,e.overflow.x=Math.abs(h),e.overflow.y=Math.abs(_)}_quantizeSigned(i,e){if(e<=0||i===0)return 0;let n=i/e;return(i>0?Math.ceil(n):Math.floor(n))*e}_clamp(i,e,n){return Math.min(Math.max(i,e),n)}},Df=class{_pointerDown;_vCellSize;_hCellSize;_snapWhileDragging;constructor(i,e){this._pointerDown=e,this._vCellSize=i.vCellSize(),this._hCellSize=i.hCellSize(),this._snapWhileDragging=i.fCellSizeWhileDragging()}snap(i,e){let n=e||this._snapWhileDragging;return this._strategies[+n](i)}_strategies={0:this._noSnap.bind(this),1:this._snapWithCellSize.bind(this)};_snapWithCellSize(i){return{x:this._snapToGrid(this._pointerDown.x+i.x,this._hCellSize)-this._pointerDown.x,y:this._snapToGrid(this._pointerDown.y+i.y,this._vCellSize)-this._pointerDown.y}}_noSnap(i){return i}_snapToGrid(i,e){return Math.round(i/e)*e}};function mp(){return{value:{x:0,y:0},overflow:{x:0,y:0},edges:{left:!1,right:!1,top:!1,bottom:!1}}}var kf=class{_snapper;_hardClamp;_hardResult=mp();_softClamps=[];_softResults=[];constructor(i,e,n){let o=i.get(E).fDraggable;this._snapper=new Df(o,e),this._hardClamp=new od(n.hard,.5);for(let r of n.soft)this._softClamps.push(new od(r.limits,.5)),this._softResults.push(mp())}apply(i,e=!1){let n=this._snapper.snap(i,e);this._hardClamp.applyInto(n,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(i){return this.apply(i,!0)}};function _p(t,i,e){let{x:n,y:o,width:r,height:s}=t;return e.right&&i.x>0&&(r+=i.x),e.left&&i.x>0&&(n-=i.x,r+=i.x),e.bottom&&i.y>0&&(s+=i.y),e.top&&i.y>0&&(o-=i.y,s+=i.y),G.initialize(n,o,r,s)}var Rf=class extends Xe{_injector;nodeOrGroup;children;sourceConnectionHandlers;targetConnectionHandlers;type=th;kind=nh;_startPosition=L.initialize();_startRect=G.initialize();_applyConstraints=i=>i;_lastSoftResults=[];_deltaConstraints;_constraints;_lastPosition=L.initialize();_softParentConnectionHandlers=[];_mediator;constructor(i,e,n=[],o=[],r=[]){super(),this._injector=i,this.nodeOrGroup=e,this.children=n,this.sourceConnectionHandlers=o,this.targetConnectionHandlers=r,this._mediator=i.get(R),this._startRect=this._mediator.execute(new Ee(e.hostElement)),this._startPosition=ue({},e._position)}setConstraints(i){this._constraints=i,this._deltaConstraints=new kf(this._injector,this._startPosition,i),this._applyConstraints=e=>{let n=this._deltaConstraints.apply(e);return this._applySoftExpansions(n.soft),n.hardDelta}}setSoftParentConnectionHandlers(i){this._softParentConnectionHandlers=i}finalizeConstraints(){this._applyConstraints=i=>{let e=this._deltaConstraints.finalize(i);return this._applySoftExpansions(e.soft),e.hardDelta}}getLastRect(){return G.initialize(this._lastPosition.x,this._lastPosition.y,this._startRect.width,this._startRect.height)}prepareDragSequence(){for(let i of this.children)i.prepareDragSequence();this.nodeOrGroup.hostElement.classList.add(Ne.DRAG_AND_DROP.DRAGGING)}onPointerMove(i){let e=this._applyConstraints(i);for(let n of this.children)n.onPointerMove(e);this._redraw(this._startPlus(e));for(let n of this.sourceConnectionHandlers)n.setSourceDelta(e);for(let n of this.targetConnectionHandlers)n.setTargetDelta(e)}onPointerUp(){for(let i of this.children)i.onPointerUp();this.nodeOrGroup.position.set(this.nodeOrGroup._position),this.nodeOrGroup.hostElement.classList.remove(Ne.DRAG_AND_DROP.DRAGGING),this._emitExpandedEvent()}_startPlus(i){return L.sum(this._startPosition,i)}_redraw(i){this._lastPosition=i,this.nodeOrGroup.updatePosition(i),this._mediator.execute(new rn(this.nodeOrGroup.fId(),G.initialize(i.x,i.y,this._startRect.width,this._startRect.height))),this.nodeOrGroup.redraw()}_applySoftExpansions(i){this._lastSoftResults=i;for(let e=0;e<i.length;e++){let n=i[e],o=this._constraints.soft[e],r=_p(o.boundingRect,n.overflow,n.edges);this._commitParentRect(o.nodeOrGroup,r)&&this._updateParentConnectionHandlers(e)}}_commitParentRect(i,e){let n=i._position.x!==e.x||i._position.y!==e.y||i._size?.width!==e.width||i._size?.height!==e.height;return i.updateSize({width:e.width,height:e.height}),i.updatePosition({x:e.x,y:e.y}),this._mediator.execute(new rn(i.fId(),e)),i.redraw(),n}_updateParentConnectionHandlers(i){let e=this._softParentConnectionHandlers[i];if(!e)return;let n=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,n);o.handler.setSourceDelta(this._buildDelta(o.baselineRect,r))}for(let o of e.target){let r=this._readConnectorRect(o.connector,n);o.handler.setTargetDelta(this._buildDelta(o.baselineRect,r))}}_readConnectorRect(i,e){let n=`${i.kind}::${i.fId()}`,o=e.get(n);if(o)return o;let r=this._mediator.execute(new rt(i)).rect;return e.set(n,r),r}_buildDelta(i,e){return L.initialize(e.x-i.x,e.y-i.y)}_emitExpandedEvent(){for(let i=0;i<this._lastSoftResults.length;i++){let e=this._lastSoftResults[i];if(!e.overflow.x&&!e.overflow.y)continue;let n=this._constraints.soft[i],o=_p(n.boundingRect,e.overflow,e.edges);n.nodeOrGroup.sizeChange.emit(o)}}destroy(){for(let i of this.children)i.destroy?.();this.children=[],this.sourceConnectionHandlers=[],this.targetConnectionHandlers=[],this._lastSoftResults=[],this._applyConstraints=i=>i,this._softParentConnectionHandlers=[]}},yv=(()=>{let t=class ss{_injector=d(Ye);handle({nodesAndGroups:e}){let n=this._createHandlerByNodeId(e),o=this._linkParentsAndCollectRoots(e,n);return new Pf(o,Array.from(n.values()))}_createHandlerByNodeId(e){let n=new Map;for(let o of e)n.set(o.fId(),new Rf(this._injector,o));return n}_linkParentsAndCollectRoots(e,n){let o=[];for(let r of e){let s=n.get(r.fId());if(!s)continue;let a=r.fParentId(),l=a?n.get(a):void 0;l?l.children.push(s):o.push(s)}return o}static \u0275fac=function(n){return new(n||ss)};static \u0275prov=g({token:ss,factory:ss.\u0275fac})};return t=C([x(id)],t),t})(),rd=class{nodeOrGroup;static fToken=Symbol("BuildDragNodeConstraintsRequest");constructor(i){this.nodeOrGroup=i}},wi=class{nodeOrGroup;childrenPaddings;static fToken=Symbol("ReadNodeBoundsWithPaddingsRequest");constructor(i,e){this.nodeOrGroup=i,this.childrenPaddings=e}},Nf=class{nodeOrGroup;boundingRect;innerRect;paddings;constructor(i,e,n,o){this.nodeOrGroup=i,this.boundingRect=e,this.innerRect=n,this.paddings=o}},vv=(()=>{let t=class as{_mediator=d(R);handle({nodeOrGroup:e,childrenPaddings:n}){let o=this._readBoundingRect(e),r=this._readOwnPaddings(e,o),s=[r[0]+n[0],r[1]+n[1],r[2]+n[2],r[3]+n[3]],a=G.initialize(o.x+s[0],o.y+s[1],o.width-s[0]-s[2],o.height-s[1]-s[3]);return new Nf(e,o,a,s)}_readBoundingRect(e){return this._mediator.execute(new Ee(e.hostElement))}_readOwnPaddings(e,n){return this._mediator.execute(new dn(e,n))}static \u0275fac=function(n){return new(n||as)};static \u0275prov=g({token:as,factory:as.\u0275fac})};return t=C([x(wi)],t),t})(),Cv=(()=>{let t=class cs{_mediator=d(R);handle({nodeOrGroup:e}){let n=this._readCurrentRect(e),o=this._readParentsChain(e);return this._buildConstraints(o,n)}_readCurrentRect(e){return this._mediator.execute(new Ee(e.hostElement))}_readParentsChain(e){return this._mediator.execute(new Bn(e))??[]}_buildConstraints(e,n){let o=[],r=$p(),s=[0,0,0,0];for(let a of e){let l=this._readParentBounds(a,s);s=l.paddings;let h=this._calculateDifference(l.innerRect,n);if(this._isAutoExpand(a))o.push(this._makeSoftLimit(a,l.boundingRect,h));else{r=h;break}}return{soft:o,hard:r}}_readParentBounds(e,n){return this._mediator.execute(new wi(e,n))}_calculateDifference(e,n){return{min:this._calculateMinimumDifference(e,n),max:this._calculateMaximumDifference(e,n)}}_calculateMinimumDifference(e,n){return L.initialize(e.x-n.x,e.y-n.y)}_calculateMaximumDifference(e,n){return L.initialize(e.x+e.width-(n.x+n.width),e.y+e.height-(n.y+n.height))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeSoftLimit(e,n,o){return{nodeOrGroup:e,boundingRect:n,initialSize:e._size,limits:o}}static \u0275fac=function(n){return new(n||cs)};static \u0275prov=g({token:cs,factory:cs.\u0275fac})};return t=C([x(rd)],t),t})(),sd=class{rootHandlers;participants;static fToken=Symbol("CreateDragNodeHandlerRequest");constructor(i,e){this.rootHandlers=i,this.participants=e}},ad=class{dragHandler;constraints;handlerPool;static fToken=Symbol("AttachSoftParentConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.constraints=e,this.handlerPool=n}},Si=class{_mediator=d(R);_store=d(E);_behaviour=d(jn);_source;_target;_sourceRef;_targetRef;_sourceDelta=L.initialize();_targetDelta=L.initialize();connection;initialize(i){this.connection=i,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(i){this._sourceDelta=i,this._mediator.execute(new on(this._source.fId(),this._source.kind,this._withDelta(this._sourceRef.rect,i)))}setTargetDelta(i){this._targetDelta=i,this._mediator.execute(new on(this._target.fId(),this._target.kind,this._withDelta(this._targetRef.rect,i)))}redraw(){let i=this._buildLine();this.connection.setLine(i),this.connection.redraw()}_buildLine(){let i=ke.fromRoundedRect(this._sourceRef.rect).addPoint(this._sourceDelta),e=ke.fromRoundedRect(this._targetRef.rect).addPoint(this._targetDelta);return this._behaviour.handle(new mt(i,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(i){return this._mediator.execute(new rt(i))}_withDelta(i,e){return ke.fromRoundedRect(i).addPoint(e)}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},Ii=(()=>{class t extends Si{setSourceDelta(e){super.setSourceDelta(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Ti=(()=>{class t extends Si{_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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Ei=(()=>{class t extends Si{setTargetDelta(e){super.setTargetDelta(e),this.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),xv=(()=>{let t=class ds{_store=d(E);_mediator=d(R);_dragInjector=d(ze);handle({dragHandler:e,constraints:n,handlerPool:o}){let r=n.soft.map(s=>this._buildParentConnectionHandlers(s.nodeOrGroup,o));e.setSoftParentConnectionHandlers(r)}_buildParentConnectionHandlers(e,n){let o=this._store.outputs.getAll().filter(_=>_.fNodeId===e.fId()),r=this._store.inputs.getAll().filter(_=>_.fNodeId===e.fId());if(!o.length&&!r.length)return{source:[],target:[]};let s=new Set(o.map(_=>_.fId())),a=new Set(r.map(_=>_.fId())),l=new Map,h={source:[],target:[]};for(let _ of this._store.connections.getAll()){let v=s.has(_.fOutputId()),b=a.has(_.fInputId());if(!v&&!b)continue;let I=this._getExistingConnectionHandler(n,_);if(I||(I=this._createConnectionHandler(_,v,b),n.push(I)),v){let N=this._store.outputs.require(_.fOutputId());h.source.push({handler:I,connector:N,baselineRect:this._readConnectorRect(N,l)})}if(b){let N=this._store.inputs.require(_.fInputId());h.target.push({handler:I,connector:N,baselineRect:this._readConnectorRect(N,l)})}}return h}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n,o){let r;return n&&o?r=this._dragInjector.createInstance(Ti):n?r=this._dragInjector.createInstance(Ii):r=this._dragInjector.createInstance(Ei),r.initialize(e),r}_readConnectorRect(e,n){let o=`${e.kind}::${e.fId()}`,r=n.get(o);if(r)return r;let s=this._mediator.execute(new rt(e)).rect;return n.set(o,s),s}static \u0275fac=function(n){return new(n||ds)};static \u0275prov=g({token:ds,factory:ds.\u0275fac})};return t=C([x(ad)],t),t})(),bv=(()=>{let t=class ls{_dragInjector=d(ze);_mediator=d(R);handle({rootHandlers:e,participants:n}){let o=this._collectConnectionHandlers(n);this._applyConstraintsToRoots(e,o);let r=this._dragInjector.createInstance(Gt);return r.initialize(n,e),r}_applyConstraintsToRoots(e,n){for(let o of e){let r=this._calculateConstraints(o.nodeOrGroup);o.setConstraints(r),this._attachSoftParentConnectionHandlers(o,r,n)}}_collectConnectionHandlers(e){let n=new Map;for(let o of e){for(let r of o.sourceConnectionHandlers)n.set(r.connection.fId(),r);for(let r of o.targetConnectionHandlers)n.set(r.connection.fId(),r)}return Array.from(n.values())}_attachSoftParentConnectionHandlers(e,n,o){this._mediator.execute(new ad(e,n,o))}_calculateConstraints(e){return this._mediator.execute(new rd(e))}static \u0275fac=function(n){return new(n||ls)};static \u0275prov=g({token:ls,factory:ls.\u0275fac})};return t=C([x(sd)],t),t})(),cd=class{dragHandler;sourceIds;handlerPool;static fToken=Symbol("AttachTargetConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.sourceIds=e,this.handlerPool=n}},wv=(()=>{let t=class us{_store=d(E);_dragInjector=d(ze);get _connections(){return this._store.connections.getAll()}handle(e){this._getInputConnections(e.dragHandler.nodeOrGroup).forEach(n=>{this._createAndSetConnectionToNodeHandler(n,e)})}_getInputConnections(e){let n=new Set(this._getNodeInputIds(e));return this._connections.filter(o=>n.has(o.fInputId()))}_getNodeInputIds(e){return this._store.inputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let o=this._getExistingConnectionHandler(n.handlerPool,e);o||(o=this._createConnectionHandler(n.sourceIds,e),n.handlerPool.push(o)),n.dragHandler.targetConnectionHandlers.push(o)}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n){let o;return e.includes(n.fOutputId())?o=this._dragInjector.createInstance(Ti):o=this._dragInjector.createInstance(Ei),o.initialize(n),o}static \u0275fac=function(n){return new(n||us)};static \u0275prov=g({token:us,factory:us.\u0275fac})};return t=C([x(cd)],t),t})(),dd=class{dragHandler;targetIds;handlerPool;static fToken=Symbol("AttachSourceConnectionDragHandlersToNodeRequest");constructor(i,e,n){this.dragHandler=i,this.targetIds=e,this.handlerPool=n}},Sv=(()=>{let t=class fs{_store=d(E);_dragInjector=d(ze);get _connections(){return this._store.connections.getAll()}handle(e){this._getOutputConnections(e.dragHandler.nodeOrGroup).forEach(n=>{this._createAndSetConnectionToNodeHandler(n,e)})}_getOutputConnections(e){let n=new Set(this._getNodeOutputIds(e));return this._connections.filter(o=>n.has(o.fOutputId()))}_getNodeOutputIds(e){return this._store.outputs.getAll().filter(n=>e.isContains(n.hostElement)).map(n=>n.fId())}_createAndSetConnectionToNodeHandler(e,n){let o=this._getExistingConnectionHandler(n.handlerPool,e);o||(o=this._createConnectionHandler(n.targetIds,e),n.handlerPool.push(o)),n.dragHandler.sourceConnectionHandlers.push(o)}_getExistingConnectionHandler(e,n){return e.find(o=>o.connection.fId()===n.fId())}_createConnectionHandler(e,n){let o;return e.includes(n.fInputId())?o=this._dragInjector.createInstance(Ti):o=this._dragInjector.createInstance(Ii),o.initialize(n),o}static \u0275fac=function(n){return new(n||fs)};static \u0275prov=g({token:fs,factory:fs.\u0275fac})};return t=C([x(dd)],t),t})(),ld=class{nodeOrGroup;static fToken=Symbol("AttachDragNodeHandlerFromSelectionRequest");constructor(i){this.nodeOrGroup=i}},Iv=(()=>{let t=class hs{_mediator=d(R);_store=d(E);_dragSession=d(Y);handle({nodeOrGroup:e}){let n=this._collectSelected(e),o=this._withDeepChildren(n),r=this._mediator.execute(new id(o)),s=this._collectSourceConnectorIds(o),a=this._collectTargetConnectorIds(o);return this._attachConnectionHandlers(r.participants,s,a),this._mediator.execute(new sd(r.rootHandlers,r.participants))}_collectSelected(e){let n=[];for(let o of this._dragSession.selectedItems){let r=this._findNodeByHost(o.hostElement);r&&n.push(r)}return e&&!n.includes(e)&&n.push(e),n}_findNodeByHost(e){return this._store.nodes.getAll().find(n=>n.isContains(e))}_withDeepChildren(e){let n=[];for(let o of e){n.push(o);let r=this._mediator.execute(new Hn(o.fId()));n.push(...r)}return n}_collectSourceConnectorIds(e){return Eu(e,n=>this._store.outputs.getAll().filter(o=>o.fNodeId===n.fId()).map(o=>o.fId()))}_collectTargetConnectorIds(e){return Eu(e,n=>this._store.inputs.getAll().filter(o=>o.fNodeId===n.fId()).map(o=>o.fId()))}_attachConnectionHandlers(e,n,o){let r=[];for(let s of e)this._mediator.execute(new dd(s,o,r)),this._mediator.execute(new cd(s,n,r))}static \u0275fac=function(n){return new(n||hs)};static \u0275prov=g({token:hs,factory:hs.\u0275fac})};return t=C([x(ld)],t),t})(),Tv=[yv,Cv,bv,wv,Sv,xv,vv,Iv];function Ev(t,i,e=10){let n=i.x,o=i.y,r=n+i.width,s=o+i.height,a=i.gravityCenter.x,l=i.gravityCenter.y,h,_,v=1/0,b,I,N=1/0,D=(k,O)=>{let z=O<0?-O:O;z<=e&&z<v&&(v=z,h=k,_=O)},M=(k,O)=>{let z=O<0?-O:O;z<=e&&z<N&&(N=z,b=k,I=O)};for(let k=0;k<t.length;k++){let O=t[k],z=O.x,V=O.y,W=z+O.width,oe=V+O.height,be=O.gravityCenter.x,re=O.gravityCenter.y;D(z,n-z),D(W,n-W),D(be,a-be),D(z,r-z),D(W,r-W),M(V,o-V),M(oe,o-oe),M(re,l-re),M(V,s-V),M(oe,s-oe)}return{x:{guide:h,delta:_},y:{guide:b,delta:I}}}var gp=["left","top","width","height"],ud=class{_element;constructor(i,e,n="f-line"){this._element=i.document.createElement("div"),this._element.classList.add(n),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(i){for(let e of gp){let n=i[e];n!=null&&(this._element.style[e]=`${n}px`)}}clearRect(){for(let i of gp)this._element.style.removeProperty(i)}destroy(){this._element.remove()}},Of=class{_horizontal;_vertical;constructor(i,e){this._horizontal=new ud(i,e),this._vertical=new ud(i,e),this._horizontal.hide(),this._vertical.hide()}drawVerticalLine(i,e,n){this._vertical.show(),this._vertical.render({left:i*n.scale+n.position.x+n.scaledPosition.x,top:0,width:1,height:e.height})}drawHorizontalLine(i,e,n){this._horizontal.show(),this._horizontal.render({left:0,top:i*n.scale+n.position.y+n.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()}},fd=class{static fToken=Symbol("MagneticLinesPreparationRequest")},Pv=(()=>{let t=class ps{_mediator=d(R);_store=d(E);_browser=d(Re);_injector=d(Ye);_dragSession=d(Y);_renderer;handle(e){let n=this._store.instances.get(ye.MAGNETIC_LINES);if(!n)return;let o=this._dragSession.draggableItems.find(r=>r instanceof Gt);o&&o.setMagneticLines(new Ff(this._injector,this._renderer??this._createRenderer(n),this._flowHostSize(),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_flowHostSize(){return this._store.flowHost.getBoundingClientRect()}_createRenderer({hostElement:e}){return this._renderer=new Of(this._browser,e),this._renderer}_notDraggedRects(e){let n=new Set(e);return this._store.nodes.getAll().filter(r=>!n.has(r)).map(r=>this._mediator.execute(new Ee(r.hostElement)))}static \u0275fac=function(n){return new(n||ps)};static \u0275prov=g({token:ps,factory:ps.\u0275fac})};return t=C([x(fd)],t),t})(),Ff=class{_renderer;_size;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;constructor(i,e,n,o){this._renderer=e,this._size=n,this._rects=o;let r=i.get(E);this._alignThreshold=r.instances.require(ye.MAGNETIC_LINES).threshold(),this._canvasTransform=r.transform}scheduleRender(i){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderGuides(this._computeGuides(i)),15)}_renderGuides(i){this._renderVertical(i),this._renderHorizontal(i)}_renderVertical(i){i.x.guide!==void 0?this._renderer.drawVerticalLine(i.x.guide,this._size,this._canvasTransform):this._renderer.hideVertical()}_renderHorizontal(i){i.y.guide!==void 0?this._renderer.drawHorizontalLine(i.y.guide,this._size,this._canvasTransform):this._renderer.hideHorizontal()}_computeGuides(i){return Ev(this._rects,i,this._alignThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},yp=["top","center","bottom"],vp=["left","center","right"];function Mv(t,i,e=10,n=10){let o=i.x,r=i.y,s=o+i.width,a=r+i.height,l=i.gravityCenter.x,h=i.gravityCenter.y,_=Dv(t,i,o,r,s,a,l,h,e,n),v=kv(t,i,o,r,s,a,l,h,e,n);return _&&(!v||_.absDelta<=v.absDelta)?{axis:"x",delta:_.delta,gap:_.gap,rects:_.rects,alignMode:_.alignMode,crossDelta:_.crossDelta}:v?{axis:"y",delta:v.delta,gap:v.gap,rects:v.rects,alignMode:v.alignMode,crossDelta:v.crossDelta}:{rects:[]}}function Dv(t,i,e,n,o,r,s,a,l,h){let _=1/0,v,b=0,I,N=[],D=0,M=[],k=[],O=[];for(let z=0;z<yp.length;z++){let V=z===0?n:z===1?a:r;M.length=0,k.length=0,O.length=0;let W=1/0,oe=-1/0,be=0,re=1/0,le=1/0;for(let pe=0;pe<t.length;pe++){let se=t[pe],Kn=z===0?se.y:z===1?se.gravityCenter.y:se.y+se.height,pu=V-Kn,bt=En(pu);if(bt>l)continue;M.push(pe),k.push(se.x),O.push(se.x+se.width);let Yn=se.y,Zn=se.y+se.height;Yn<W&&(W=Yn),Zn>oe&&(oe=Zn),(bt<re||bt===re&&pe<le)&&(re=bt,be=Kn,le=pe)}let ie=M.length;if(ie<2)continue;nm(M,k,O);let ce=0;for(;ce<ie&&k[ce]<=s;)ce++;let Ve=ce>0&&ce<ie,ve,et;Ve?(ve=ce-1,et=ce):ce<=0?(ve=0,et=1):(ve=ie-2,et=ie-1);let tt=k[et]-O[ve];if(tt<0)continue;let Fe;if(Ve){Fe=O[ve]+tt;let pe=Fe+i.width,se=k[et]-pe;if(En(se-tt)>h)continue}else ce<=0?Fe=k[0]-tt-i.width:Fe=O[ie-1]+tt;let Xn=e-Fe,$t=En(Xn);if($t>h||$t>=_)continue;let ut=Rv(M,k,O,W,oe);if(Ve){let pe=Fe,se=Fe+i.width;ut.push({left:O[ve],top:W,width:pe-O[ve],height:oe-W}),ut.push({left:se,top:W,width:k[et]-se,height:oe-W})}else if(ce<=0){let pe=Fe+i.width;ut.push({left:pe,top:W,width:k[0]-pe,height:oe-W})}else ut.push({left:O[ie-1],top:W,width:Fe-O[ie-1],height:oe-W});let hu=V-be;_=$t,v=Xn,b=tt,I=yp[z],N=ut,D=hu}if(!(v===void 0||I===void 0))return{delta:v,absDelta:_,gap:b,rects:N,alignMode:I,crossDelta:D}}function kv(t,i,e,n,o,r,s,a,l,h){let _=1/0,v,b=0,I,N=[],D=0,M=[],k=[],O=[];for(let z=0;z<vp.length;z++){let V=z===0?e:z===1?s:o;M.length=0,k.length=0,O.length=0;let W=1/0,oe=-1/0,be=0,re=1/0,le=1/0;for(let pe=0;pe<t.length;pe++){let se=t[pe],Kn=z===0?se.x:z===1?se.gravityCenter.x:se.x+se.width,pu=V-Kn,bt=En(pu);if(bt>l)continue;M.push(pe),k.push(se.y),O.push(se.y+se.height);let Yn=se.x,Zn=se.x+se.width;Yn<W&&(W=Yn),Zn>oe&&(oe=Zn),(bt<re||bt===re&&pe<le)&&(re=bt,be=Kn,le=pe)}let ie=M.length;if(ie<2)continue;nm(M,k,O);let ce=0;for(;ce<ie&&k[ce]<=a;)ce++;let Ve=ce>0&&ce<ie,ve,et;Ve?(ve=ce-1,et=ce):ce<=0?(ve=0,et=1):(ve=ie-2,et=ie-1);let tt=k[et]-O[ve];if(tt<0)continue;let Fe;if(Ve){Fe=O[ve]+tt;let pe=Fe+i.height,se=k[et]-pe;if(En(se-tt)>h)continue}else ce<=0?Fe=k[0]-tt-i.height:Fe=O[ie-1]+tt;let Xn=n-Fe,$t=En(Xn);if($t>h||$t>=_)continue;let ut=Nv(M,k,O,W,oe);if(Ve){let pe=Fe,se=Fe+i.height;ut.push({left:W,top:O[ve],width:oe-W,height:pe-O[ve]}),ut.push({left:W,top:se,width:oe-W,height:k[et]-se})}else if(ce<=0){let pe=Fe+i.height;ut.push({left:W,top:pe,width:oe-W,height:k[0]-pe})}else ut.push({left:W,top:O[ie-1],width:oe-W,height:Fe-O[ie-1]});let hu=V-be;_=$t,v=Xn,b=tt,I=vp[z],N=ut,D=hu}if(!(v===void 0||I===void 0))return{delta:v,absDelta:_,gap:b,rects:N,alignMode:I,crossDelta:D}}function Rv(t,i,e,n,o){let r=[],s=o-n;for(let a=0;a<t.length-1;a++){let l=i[a+1]-e[a];l<0||r.push({left:e[a],top:n,width:l,height:s})}return r}function Nv(t,i,e,n,o){let r=[],s=o-n;for(let a=0;a<t.length-1;a++){let l=i[a+1]-e[a];l<0||r.push({left:n,top:e[a],width:s,height:l})}return r}function nm(t,i,e){for(let n=1;n<i.length;n++){let o=i[n],r=e[n],s=t[n],a=n-1;for(;a>=0;){let l=i[a],h=t[a];if(l<o||l===o&&h<s)break;i[a+1]=l,e[a+1]=e[a],t[a+1]=h,a--}i[a+1]=o,e[a+1]=r,t[a+1]=s}}function En(t){return t<0?-t:t}var Af=class{_element;_isVisible=!1;_left=Number.NaN;_top=Number.NaN;_width=Number.NaN;_height=Number.NaN;constructor(i,e,n="f-rect"){this._element=i.document.createElement("div"),this._element.classList.add(n);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(i,e,n,o){let r=this._element.style;i!==this._left&&(this._left=i,r.left=i+"px"),e!==this._top&&(this._top=e,r.top=e+"px"),n!==this._width&&(this._width=n,r.width=n+"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 i=this._element.style;i.removeProperty("left"),i.removeProperty("top"),i.removeProperty("width"),i.removeProperty("height")}destroy(){this._element.remove()}},Lf=class{_browser;_hostElement;_className;_pool=[];_activeCount=0;constructor(i,e,n="f-rect"){this._browser=i,this._hostElement=e,this._className=n}draw(i,e){let n=e.scale,o=e.position.x+e.scaledPosition.x,r=e.position.y+e.scaledPosition.y;for(let s=0;s<i.length;s++){let a=this._getOrCreate(s),l=i[s];a.show(),a.render(l.left*n+o,l.top*n+r,l.width*n,l.height*n)}for(let s=i.length;s<this._activeCount;s++)this._pool[s].hide();this._activeCount=i.length}hideAll(){for(let i=0;i<this._activeCount;i++)this._pool[i].hide();this._activeCount=0}destroy(){for(let i of this._pool)i.destroy();this._pool.length=0,this._activeCount=0}_getOrCreate(i){if(i<this._pool.length)return this._pool[i];let e=new Af(this._browser,this._hostElement,this._className);return this._pool.push(e),e}},hd=class{static fToken=Symbol("MagneticRectsPreparationRequest")},Ov=(()=>{let t=class ms{_mediator=d(R);_store=d(E);_browser=d(Re);_injector=d(Ye);_dragSession=d(Y);_renderer;handle(e){let n=this._store.instances.get(ye.MAGNETIC_RECTS);if(!n)return;let o=this._dragSession.draggableItems.find(r=>r instanceof Gt);o&&o.setMagneticRects(new Bf(this._injector,this._getRenderer(n),this._notDraggedRects(this._draggedNodes(o.items))))}_draggedNodes(e){return e.map(n=>n.nodeOrGroup)}_getRenderer(e){return this._renderer||(this._renderer=new Lf(this._browser,e.hostElement)),this._renderer?.destroy(),this._renderer}_notDraggedRects(e){let n=new Set(e);return this._store.nodes.getAll().filter(r=>!n.has(r)).map(r=>this._mediator.execute(new Ee(r.hostElement)))}static \u0275fac=function(n){return new(n||ms)};static \u0275prov=g({token:ms,factory:ms.\u0275fac})};return t=C([x(hd)],t),t})(),Bf=class{_renderer;_rects;_timerId=null;_canvasTransform;_alignThreshold=10;_spacingThreshold=10;constructor(i,e,n){this._renderer=e,this._rects=n;let o=i.get(E),r=o.instances.require(ye.MAGNETIC_RECTS);this._alignThreshold=r.alignThreshold(),this._spacingThreshold=r.spacingThreshold(),this._canvasTransform=o.transform}scheduleRender(i){this._timerId&&clearTimeout(this._timerId),this._timerId=setTimeout(()=>this._renderRects(this._computeRects(i)),15)}_renderRects(i){if(i.axis!==void 0&&i.delta!==void 0&&i.rects.length>0){this._renderer.draw(i.rects,this._canvasTransform);return}this._renderer.hideAll()}_computeRects(i){return Mv(this._rects,i,this._alignThreshold,this._spacingThreshold)}clearGuides(){this._renderer.hideAll(),this._timerId&&(clearTimeout(this._timerId),this._timerId=null)}},pd=class{event;static fToken=Symbol("DragNodeFinalizeRequest");constructor(i){this.event=i}},zf=class{nodes;fNodes;constructor(i){this.nodes=i,this.fNodes=i}},Fv=(()=>{let t=class _s{_mediator=d(R);_store=d(E);_dragSession=d(Y);_dragHandler;handle({event:e}){if(this._dragHandler=this._getDragHandler(),!this._dragHandler)return;let n=this._buildDragDelta(e.getPosition()),o=this._dragHandler.calculateMagneticSnaps(n),r=this._applySnapToDelta(n,o.lines,o.rects);this._finalizeMove(this._dragHandler,r),this._emitNodeIntersectIfNeeded(this._dragHandler)}_getDragHandler(){return this._dragSession.draggableItems.find(gv)}_buildDragDelta(e){return X.fromPoint(e).elementTransform(this._store.flowHost).div(this._dragSession.onPointerDownScale).sub(this._dragSession.onPointerDownPosition)}_applySnapToDelta(e,n,o){let r=e.x,s=e.y;return n&&(r=this._hasLineSnapValue(n.x)?e.x-(n.x.delta||0):r,s=this._hasLineSnapValue(n.y)?e.y-(n.y.delta||0):s),this._hasRectSnapValue(o)&&(o.axis==="x"?(r=e.x-o.delta,s=e.y-(o.crossDelta??0)):(s=e.y-o.delta,r=e.x-(o.crossDelta??0))),{x:r,y:s}}_hasLineSnapValue(e){return e.guide!==void 0&&e.guide!==null}_hasRectSnapValue(e){return!!e&&e.axis!==void 0&&e.delta!==void 0}_finalizeMove(e,n){for(let o of e.roots)o.finalizeConstraints();e.onPointerMove(n),e.onPointerUp?.(),this._store.fDraggable?.fMoveNodes.emit(this._buildMoveNodesEvent(e))}_buildMoveNodesEvent(e){let n=e.getEvent(),s=((n.data??n.fData)?.fNodeIds??[]).map(a=>({id:a,position:this._store.nodes.get(a)?._position}));return new zf(s)}_emitNodeIntersectIfNeeded(e){if(!this._isDraggedJustOneNode(e)||!this._store.fDraggable?.fEmitOnNodeIntersect)return;let n=e.roots[0].nodeOrGroup;queueMicrotask(()=>this._mediator.execute(new Bc(n)))}_isDraggedJustOneNode(e){return e.roots.length===1}static \u0275fac=function(n){return new(n||_s)};static \u0275prov=g({token:_s,factory:_s.\u0275fac})};return t=C([x(pd)],t),t})(),md=class{event;trigger;static fToken=Symbol("DragNodePreparationRequest");constructor(i,e){this.event=i,this.trigger=e}},Av=(()=>{let t=class gs{_mediator=d(R);_store=d(E);_dragSession=d(Y);handle({event:e,trigger:n}){if(!this._canStartDrag(e,n))return;let o=this._findDraggableNode(e.targetElement);o&&(this._storePointerDownContext(e),this._dragSession.draggableItems=[this._buildDragNodeHandler(o)],this._mediator.execute(new fd),this._mediator.execute(new hd))}_canStartDrag(e,n){return this._dragSession.isEmpty()&&this._isDragHandle(e.targetElement)&&dt(e.originalEvent,n)}_isDragHandle(e){return ii(e,".f-drag-handle")}_findDraggableNode(e){let n=this._store.nodes.getAll();for(let o of n)if(!o.fDraggingDisabled()&&o.isContains(e))return o}_storePointerDownContext(e){this._dragSession.onPointerDownScale=this._store.transform.scale,this._dragSession.onPointerDownPosition=X.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(this._store.transform.scale)}_buildDragNodeHandler(e){return(e.fSelectionDisabled()||!e.isSelected())&&queueMicrotask(()=>{this._mediator.execute(new Gn(e))}),this._mediator.execute(new ld(e))}static \u0275fac=function(n){return new(n||gs)};static \u0275prov=g({token:gs,factory:gs.\u0275fac})};return t=C([x(md)],t),t})(),Lv=[...Tv,Pv,Ov,Fv,Av],Vf=class{targetGroupId;nodeIds;dropPosition;fTargetNode;fNodes;fDropPosition;constructor(i,e,n){this.targetGroupId=i,this.nodeIds=e,this.dropPosition=n,this.fTargetNode=i,this.fNodes=e,this.fDropPosition=n}},Bv=(()=>{let t=class ys{_dragSession=d(Y);_store=d(E);handle({event:e}){let n=this._findDropHandler();if(!n)return;let o=n.activeTarget?.node;o&&this._emitDropToGroupEvent(o.fId(),e),n.onPointerUp?.()}_findDropHandler(){return this._dragSession.draggableItems.find(e=>e instanceof bi)}_emitDropToGroupEvent(e,n){this._store.fDraggable?.fDropToGroup.emit(new Vf(e,this._getTopLevelDraggedIds(),n.getPosition()))}_getTopLevelDraggedIds(){let n=this._getMoveSummaryHandler().items.map(s=>s.nodeOrGroup),o=new Set(n.map(s=>s.fId())),r=[];for(let s of n){let a=s.fParentId();(!a||!o.has(a))&&r.push(s.fId())}return r}_getMoveSummaryHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof Gt);if(!e)throw new Error("DropToGroup requires DragNodeHandler.");return e}static \u0275fac=function(n){return new(n||ys)};static \u0275prov=g({token:ys,factory:ys.\u0275fac})};return t=C([x(nd)],t),t})(),_d=class{event;static fToken=Symbol("DropToGroupPreparationRequest");constructor(i){this.event=i}},gd=class{candidates;static fToken=Symbol("SortDropCandidatesByLayerRequest");constructor(i){this.candidates=i}},zv=(()=>{let t=class vs{handle({candidates:e}){let n=e.map((o,r)=>({candidate:o,index:r}));return n.sort((o,r)=>{let s=this._compareDomOrder(o.candidate.node.hostElement,r.candidate.node.hostElement);return s!==0?-s:o.index-r.index}),n.map(o=>o.candidate)}_compareDomOrder(e,n){if(e===n)return 0;let o=e.compareDocumentPosition(n);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},s=n.getBoundingClientRect?.()??{top:0,left:0};return r.top!==s.top?r.top<s.top?-1:1:r.left!==s.left?r.left<s.left?-1:1:0}return 0}static \u0275fac=function(n){return new(n||vs)};static \u0275prov=g({token:vs,factory:vs.\u0275fac})};return t=C([x(gd)],t),t})(),Gf=class{_onPointerDown;_limit;_vCellSize;_hCellSize;_adjustCellSize;constructor(i,e,n){this._onPointerDown=e,this._limit=n;let o=i.get(E);this._vCellSize=o.fDraggable.vCellSize(),this._hCellSize=o.fDraggable.hCellSize(),this._adjustCellSize=o.fDraggable.fCellSizeWhileDragging()}limit(i){let{min:e,max:n}=this._limit,{x:o,y:r}=this._cellSizeStrategies[+this._adjustCellSize](i);return{x:this._clamp(o,e.x,n.x),y:this._clamp(r,e.y,n.y)}}_cellSizeStrategies={0:this._skipCellSize.bind(this),1:this._applyCellSize.bind(this)};_applyCellSize(i){return{x:this._snapToGrid(this._onPointerDown.x+i.x,this._hCellSize)-this._onPointerDown.x,y:this._snapToGrid(this._onPointerDown.y+i.y,this._vCellSize)-this._onPointerDown.y}}_skipCellSize(i){return i}_clamp(i,e,n){return Math.min(Math.max(i,e),n)}_snapToGrid(i,e){return Math.round(i/e)*e}},yd=class{externalItem;static fToken=Symbol("DragExternalItemCreatePlaceholderRequest");constructor(i){this.externalItem=i}},Vv=(()=>{let t=class Cs{_browser=d(Re);_containerRef=d(ro);handle({externalItem:e}){let{hostElement:n,placeholder:o}=e,r=o(),s=r?this._fromTemplate(r):this._fromHost(n);return s.classList.add("f-external-item-placeholder"),s.style.pointerEvents="none",s}_fromTemplate(e){return Du(this._createViewRef(e),this._browser.document)}_fromHost(e){return Pu(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}static \u0275fac=function(n){return new(n||Cs)};static \u0275prov=g({token:Cs,factory:Cs.\u0275fac})};return t=C([x(yd)],t),t})(),vd=class{externalItem;static fToken=Symbol("DragExternalItemCreatePreviewRequest");constructor(i){this.externalItem=i}},Gv=(()=>{let t=class xs{_browser=d(Re);_containerRef=d(ro);handle({externalItem:e}){let{hostElement:n,preview:o}=e,r=o(),s=r?this._fromTemplate(r):this._fromHost(n);return this._setPreviewStyles(s),Qh(s),s.classList.add("f-external-item-preview"),s}_fromTemplate(e){return Du(this._createViewRef(e),this._browser.document)}_fromHost(e){return Pu(e)}_createViewRef(e){let n=this._containerRef.createEmbeddedView(e);return n.detectChanges(),n}_setPreviewStyles(e){Mu(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(n){return new(n||xs)};static \u0275prov=g({token:xs,factory:xs.\u0275fac})};return t=C([x(vd)],t),t})(),Cd=class{event;static fToken=Symbol("DragExternalItemFinalizeRequest");constructor(i){this.event=i}},Hf=class{externalItemRect;data;targetContainerId;dropPosition;rect;fTargetNode;fDropPosition;constructor(i,e,n,o){this.externalItemRect=i,this.data=e,this.targetContainerId=n,this.dropPosition=o,this.rect=i,this.fTargetNode=n,this.fDropPosition=o}},Hv="external-item",jv="drag-external-item";function Uv(t){return t.getEvent().kind===jv||t.getEvent().fEventType===Hv}var $v=(()=>{let t=class bs{_result=d(Ht);_mediator=d(R);_store=d(E);_dragSession=d(Y);_browser=d(Re);get _createNodeEmitter(){return this._store.fDraggable?.fCreateNode}handle(e){let n=this._findExternalItemHandler();if(!n)return;let o=this._getDestinationNodeOrGroupId();this._emitEvent(this._getElementsFromPoint(e.event.getPosition()),o,e.event.getPosition()),n.onPointerUp(),this._dragSession.draggableItems=[]}_findExternalItemHandler(){return this._dragSession.draggableItems.find(e=>Uv(e))}_getDestinationNodeOrGroupId(){let e=this._getDropToGroupHandler(),n=e.activeTarget?.node.fId();return e.onPointerUp?.(),n}_getDropToGroupHandler(){let e=this._dragSession.draggableItems.find(n=>n instanceof bi);if(!e)throw new Error("NodeDragToParentDragHandler not found");return e}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y).filter(n=>!n.closest(".f-external-item")&&!n.closest(".f-external-item-preview"))}_emitEvent(e,n,o){this._isPointerInCanvasRect(e)&&this._createNodeEmitter?.emit(new Hf(this._getPreviewRect(),this._result.getData().externalItem.data(),n,n?o:void 0))}_isPointerInCanvasRect(e){return e.length?this._store.flowHost.contains(e[0]):!1}_getPreviewRect(){return this._mediator.execute(new Ee(this._result.getData().preview))}static \u0275fac=function(n){return new(n||bs)};static \u0275prov=g({token:bs,factory:bs.\u0275fac})};return t=C([x(Cd)],t),t})(),jf=class{data;constructor(i){this.data=i}},xd=class extends Xe{_externalItem;_pointerDownClientPosition;type="external-item";kind="drag-external-item";data(){return new jf(this._externalItem.data())}_result;_mediator;_browser;_store;_previewEl;_placeholderEl;_startRect=G.initialize();_pointerDownRect=G.initialize();_absoluteOffsetFromFlow=L.initialize();_grabOffsetFromPointer=L.initialize();_originalParent;_originalNextSibling;_originalDisplay;_applyConstraints=i=>i;constructor(i,e,n){super(),this._externalItem=e,this._pointerDownClientPosition=n,this._store=i.get(E),this._result=i.get(Ht),this._mediator=i.get(R),this._browser=i.get(Re),this._originalDisplay=this._host.style.display,this._initConstraints(i)}get _host(){return this._externalItem.hostElement}get _overlayRoot(){return this._browser.document.fullscreenElement??this._browser.document.body}get _transform(){return this._store.transform}_initConstraints(i){this._startRect=this._getStartRect();let e=new Gf(i,this._startRect,$p());this._applyConstraints=n=>e.limit(n)}_getStartRect(){return this._mediator.execute(new Ee(this._externalItem.hostElement))}prepareDragSequence(){this._pointerDownRect=this._readAbsoluteRect(this._host),this._absoluteOffsetFromFlow=X.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 i=this._host.parentNode;if(!i){this._originalParent=void 0,this._originalNextSibling=null;return}this._originalParent=i,this._originalNextSibling=this._host.nextSibling}_createPreview(){let i=this._mediator.execute(new vd(this._externalItem));return this._externalItem.previewMatchSize()&&this._matchSize(i,this._pointerDownRect),i.style.transform=Cp(this._pointerDownRect),i}_createPlaceholder(){return this._mediator.execute(new yd(this._externalItem))}_placePreviewIntoOverlay(){this._overlayRoot.appendChild(this._previewEl)}_swapOriginalWithPlaceholderAndMoveOriginalIntoOverlay(){let i=this._originalParent,e=this._placeholderEl;if(!i||!e)return;let n=i.replaceChild(e,this._host);this._overlayRoot.appendChild(n),this._host.style.display="none"}onPointerMove(i,e){if(!this._previewEl)return;let n=this._resolveDeltaFromPointer(i,e),o=this._applyConstraints(n),r=X.fromPoint(this._startRect).add(o),s=this._toAbsolutePoint(r).add(this._absoluteOffsetFromFlow);this._previewEl.style.transform=Cp(s)}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 i=this._originalParent,e=this._placeholderEl;if(!(!i||!e)){if(e.parentNode===i){i.replaceChild(this._host,e);return}this._originalNextSibling&&this._originalNextSibling.parentNode===i?i.insertBefore(this._host,this._originalNextSibling):i.appendChild(this._host)}}_matchSize(i,e){i.style.width=`${e.width}px`,i.style.height=`${e.height}px`}_readAbsoluteRect(i){let e=i.getBoundingClientRect(),n=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,o=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return G.initialize(e.left+o,e.top+n,e.width,e.height)}_toAbsolutePoint(i){let e=X.fromPoint(this._transform.position).add(this._transform.scaledPosition);return X.fromPoint(i).mult(this._transform.scale).add(e).add(this._getFlowHostAbsolutePosition())}_resolveDeltaFromPointer(i,e){let n=e?.getPosition();if(!n)return i;let o=this._clientToAbsolute(n).sub(this._grabOffsetFromPointer),r=this._toFlowPoint(o);return X.fromPoint(r).sub(this._startRect)}_toFlowPoint(i){let e=this._getFlowHostAbsolutePosition(),n=X.fromPoint(this._transform.position).add(this._transform.scaledPosition);return X.fromPoint(i).sub(e).sub(n).div(this._transform.scale)}_getFlowHostAbsolutePosition(){let i=this._store.flowHost.getBoundingClientRect(),e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return L.initialize(i.left+n,i.top+e)}_clientToAbsolute(i){let e=this._browser.window.pageYOffset||this._browser.document.documentElement.scrollTop,n=this._browser.window.pageXOffset||this._browser.document.documentElement.scrollLeft;return X.fromPoint(i).add(L.initialize(n,e))}};function Cp({x:t,y:i}){return`translate3d(${Math.round(t)}px, ${Math.round(i)}px, 0)`}var bd=class{event;fTrigger;static fToken=Symbol("DragExternalItemPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}};function Wv(t){return!!t.closest?.("[fExternalItem]")}function qv(t){return t.closest("[fExternalItem]")}var Xv=(()=>{class t{_byHost=new Map;_items=q([]);items=P(()=>this._items());getByElement(e){let n=qv(e);return n?this._byHost.get(n):void 0}getByHost(e){return this._byHost.get(e)}register(e){let n=e.hostElement,o=this._byHost.get(n);o!==e&&(o&&o!==e&&this._byHost.delete(n),this._byHost.set(n,e),this._sync())}remove(e){let n=e.hostElement;this._byHost.get(n)===e&&(this._byHost.delete(n),this._sync())}_sync(){this._items.set([...this._byHost.values()])}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Kv=(()=>{let t=class ws{_apiService=d(Xv);_dragSession=d(Y);_store=d(E);_injector=d(Ye);get _flowHost(){return this._store.flowHost}get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!dt(e.originalEvent,n))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=X.fromPoint(e.getPosition()).elementTransform(this._flowHost).div(r),this._dragSession.draggableItems=[new xd(this._injector,o,e.getPosition())]}_resolveExternalItem(e){return this._apiService.getByElement(e)}static \u0275fac=function(n){return new(n||ws)};static \u0275prov=g({token:ws,factory:ws.\u0275fac})};return t=C([x(bd)],t),t})(),wd=class{event;static fToken=Symbol("PreventDefaultIsExternalItemRequest");constructor(i){this.event=i}},Yv=(()=>{let t=class Ss{handle(e){this._isTargetItemExternal(e.event)&&e.event.preventDefault()}_isTargetItemExternal(e){let n=this._isExternalItem(e.target),o=this._isExternalItem(e.target.parentNode);return n||o}_isExternalItem(e){let n=!1;try{n=Wv(e)}catch{}return n}static \u0275fac=function(n){return new(n||Ss)};static \u0275prov=g({token:Ss,factory:Ss.\u0275fac})};return t=C([x(wd)],t),t})(),Zv=[Vv,Gv,$v,Kv,Yv],Qv=(()=>{let t=class Is{_mediator=d(R);_dragContext=d(Y);_store=d(E);_dragInjector=d(ze);get _allNodes(){return this._store.nodes.getAll()}handle({event:e}){if(!this._canPrepare())return;let n=this._allNodes.find(s=>s.isContains(e.targetElement));if(!n&&!this._hasExternalDrag())throw new Error("Drag target node not found");let o=this._sortedTargetsForDrop();if(n){let s=n.fParentId(),a=this._mediator.execute(new Jd(s));a.length&&(o=o.filter(l=>a.includes(l.node.fId())))}let r=this._dragInjector.get(bi);r.initialize(o),this._dragContext.draggableItems.push(r)}_canPrepare(){return this._hasMoveDrag()||this._hasExternalDrag()}_hasMoveDrag(){return this._dragContext.draggableItems.some(e=>e instanceof Gt)}_hasExternalDrag(){return this._dragContext.draggableItems.some(e=>e instanceof xd)}_sortedTargetsForDrop(){let e=this._getDraggedNodes(),n=e.some(a=>a instanceof bf),o=this._withParents(e),s=this._eligibleTargets(o,n).map(a=>{let l=this._mediator.execute(new Ee(a.hostElement));return{node:a,rect:l}});return this._mediator.execute(new gd(s))}_getDraggedNodes(){let e=this._dragContext.draggableItems.find(n=>n instanceof Gt);return e?e.items.map(n=>n.nodeOrGroup):[]}_withParents(e){return e.reduce((n,o)=>{n.push(o);let r=this._mediator.execute(new Bn(o));return n.push(...r),n},[])}_eligibleTargets(e,n){let o=this._allNodes.filter(r=>!e.includes(r));return n?o.filter(r=>r instanceof bf):o}static \u0275fac=function(n){return new(n||Is)};static \u0275prov=g({token:Is,factory:Is.\u0275fac})};return t=C([x(_d)],t),t})(),Jv=[zv,Qv,Bv],Sd=class{event;static fToken=Symbol("PinchToZoomFinalizeRequest");constructor(i){this.event=i}},eC=.5,Id=(()=>{class t extends Xe{type="pinch-to-zoom";kind="pinch-to-zoom";_store=d(E);get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.require(ye.ZOOM)}_startDistance=null;_startScale=null;_touches;initialize(e){this._touches=e}prepareDragSequence(){let e=xp(this._touches);e!=null&&(this._startDistance=e,this._startScale=this._canvas.transform.scale)}onPointerMove(e,n){if(n.touches.length!==2||this._startDistance==null||this._startScale==null)return;let o=xp(n.touches),r=tC(n.touches);if(o==null||r==null){this._reset();return}if(Math.abs(o-this._startDistance)<eC)return;n.preventDefault();let s=o/this._startDistance,a=this._clamp(this._startScale*s);this._canvas.setScale(a,this._castPositionToFlow(r)),this._canvas.redraw()}_clamp(e){return Math.max(this._zoomComponent.minimum,Math.min(e,this._zoomComponent.maximum))}_castPositionToFlow(e){return X.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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();function tC(t){if(t.length!==2)return null;let i=t[0],e=t[1];return L.initialize((i.clientX+e.clientX)/2,(i.clientY+e.clientY)/2)}function xp(t){if(t.length!==2)return null;let i=t[0],e=t[1];return Math.hypot(e.clientX-i.clientX,e.clientY-i.clientY)}var nC=(()=>{let t=class Ts{_dragSession=d(Y);handle(e){if(this._hasPinchZoomHandler())for(let n of this._dragSession.draggableItems)n.onPointerUp?.()}_hasPinchZoomHandler(){return this._dragSession.draggableItems.some(e=>e instanceof Id)}static \u0275fac=function(n){return new(n||Ts)};static \u0275prov=g({token:Ts,factory:Ts.\u0275fac})};return t=C([x(Sd)],t),t})(),Td=class{event;static fToken=Symbol("PinchToZoomPreparationRequest");constructor(i){this.event=i}},iC=(()=>{let t=class Es{_dragInjector=d(ze);_store=d(E);_dragSession=d(Y);handle({event:e}){this._canStart(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=new X,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(ye.ZOOM)}_getHandler(e){let n=this._dragInjector.get(Id);return n.initialize(e.touches),n}static \u0275fac=function(n){return new(n||Es)};static \u0275prov=g({token:Es,factory:Es.\u0275fac})};return t=C([x(Td)],t),t})(),oC=[iC,nC],Ed=class{event;static fToken=Symbol("SelectionAreaFinalizeRequest");constructor(i){this.event=i}},rC=(()=>{let t=class Ps{_dragSession=d(Y);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>e.getEvent().kind==="selection-area")}static \u0275fac=function(n){return new(n||Ps)};static \u0275prov=g({token:Ps,factory:Ps.\u0275fac})};return t=C([x(Ed)],t),t})(),Uf=(()=>{class t extends Xe{type="selection-area";kind="selection-area";_store=d(E);_dragSession=d(Y);_mediator=d(R);_canBeSelected=[];_selectedByMove=[];get _transform(){return this._store.transform}get _canvasPosition(){return X.fromPoint(this._transform.position).add(this._transform.scaledPosition)}get _instance(){return this._store.instances.require(ye.SELECTION_AREA)}prepareDragSequence(){this._canBeSelected=this._mediator.execute(new ul),this._show(),this._draw(G.initialize(this._dragSession.onPointerDownPosition.x,this._dragSession.onPointerDownPosition.y))}onPointerMove(e){let n=X.fromPoint(e).add(this._dragSession.onPointerDownPosition),o=this._getMinimumPoint(this._dragSession.onPointerDownPosition,n),r=Math.abs(e.x),s=Math.abs(e.y),a=G.initialize(o.x,o.y,r,s);this._draw(a),this._selectedByMove=[],this._canBeSelected.forEach(l=>{l.element.unmarkAsSelected();let h=G.addPoint(G.mult(l.fRect,this._transform.scale),this._canvasPosition);G.intersectionWithRect(h,a)&&(l.element.markAsSelected(),this._selectedByMove.push(l.element))}),this._mediator.execute(new At)}_getMinimumPoint(e,n){return L.initialize(Math.min(e.x,n.x),Math.min(e.y,n.y))}onPointerUp(){this._hide(),this._dragSession.selectedItems.push(...this._selectedByMove),this._selectedByMove.length>0&&(this._dragSession.isSelectedChanged=!0)}_draw(e){let n=this._instance.hostElement.style;n.left=e.x+"px",n.top=e.y+"px",n.width=e.width+"px",n.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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Pd=class{event;static fToken=Symbol("SelectionAreaPreparationRequest");constructor(i){this.event=i}},sC=(()=>{let t=class Ms{_store=d(E);_dragSession=d(Y);_dragInjector=d(ze);get _instance(){return this._store.instances.get(ye.SELECTION_AREA)}handle(e){this._isValid(e)&&(this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=X.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost),this._dragSession.draggableItems=[this._dragInjector.createInstance(Uf)])}_isValid(e){return!!this._instance&&this._dragSession.isEmpty()&&dt(e.event.originalEvent,this._instance.fTrigger)}static \u0275fac=function(n){return new(n||Ms)};static \u0275prov=g({token:Ms,factory:Ms.\u0275fac})};return t=C([x(Pd)],t),t})(),aC=[sC,rC],Md=class{rect;childrenBounds;static fToken=Symbol("ApplyChildResizeConstraintsRequest");constructor(i,e){this.rect=i,this.childrenBounds=e}},cC=(()=>{let t=class Ds{handle({rect:e,childrenBounds:n}){n&&this._apply(e,n)}_apply(e,n){this._restrictLeft(e,n),this._restrictTop(e,n),this._restrictRight(e,n),this._restrictBottom(e,n),e.width=Math.max(0,e.width),e.height=Math.max(0,e.height)}_restrictLeft(e,n){let o=e.x-n.x;o>0&&(e.x-=o,e.width+=o)}_restrictTop(e,n){let o=e.y-n.y;o>0&&(e.y-=o,e.height+=o)}_restrictRight(e,n){let o=n.x+n.width;e.x+e.width<=o&&(e.width=o-e.x)}_restrictBottom(e,n){let o=n.y+n.height;e.y+e.height<=o&&(e.height=o-e.y)}static \u0275fac=function(n){return new(n||Ds)};static \u0275prov=g({token:Ds,factory:Ds.\u0275fac})};return t=C([x(Md)],t),t})(),Dd=class{rect;limits;static fToken=Symbol("ApplyParentResizeConstraintsRequest");constructor(i,e){this.rect=i,this.limits=e}},dC=(()=>{let t=class ks{_mediator=d(R);handle({rect:e,limits:n}){this._applyResizeConstraints(e,n)}_applyResizeConstraints(e,n){if(!n)return;let o=this._clampedCopyForCalculation(e,n);this._applySoftParentExpansions(o,n.softLimits),n.hardLimit&&this._clampRectToInner(e,n.hardLimit.innerRect)}_clampedCopyForCalculation(e,n){let o=ue({},e);return n.hardLimit&&this._clampRectToInner(o,n.hardLimit.innerRect),o}_clampRectToInner(e,n){if(e.x<n.x){let s=n.x-e.x;e.x+=s,e.width-=s}if(e.y<n.y){let s=n.y-e.y;e.y+=s,e.height-=s}let o=n.x+n.width;e.x+e.width>o&&(e.width=o-e.x);let r=n.y+n.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,n){if(n?.length)for(let o of n)this._expandParentFromOriginalIfOverflow(e,o)}_expandParentFromOriginalIfOverflow(e,n){let o=n.innerRect,r=n.boundingRect,s=this._computeOverflow(o,e);if(!this._hasOverflow(s)){this._applyParentRect(n,r);return}let a=this._buildExpandedParentRect(r,s);this._applyParentRect(n,a)}_hasOverflow(e){return!!(e.left||e.top||e.right||e.bottom)}_computeOverflow(e,n){let o=Math.max(0,e.x-n.x),r=Math.max(0,e.y-n.y),s=Math.max(0,n.x+n.width-(e.x+e.width)),a=Math.max(0,n.y+n.height-(e.y+e.height));return{left:o,top:r,right:s,bottom:a}}_buildExpandedParentRect(e,n){let o=ue({},e);return n.left&&(o.x=e.x-n.left,o.width=e.width+n.left),n.top&&(o.y=e.y-n.top,o.height=e.height+n.top),n.right&&(o.width=(o.width??e.width)+n.right),n.bottom&&(o.height=(o.height??e.height)+n.bottom),o}_applyParentRect(e,n){e.nodeOrGroup.updatePosition(n),e.nodeOrGroup.updateSize(n),this._mediator.execute(new rn(e.nodeOrGroup.fId(),n)),e.nodeOrGroup.redraw()}static \u0275fac=function(n){return new(n||ks)};static \u0275prov=g({token:ks,factory:ks.\u0275fac})};return t=C([x(Dd)],t),t})(),kd=class{originalRect;difference;handleType;minimumSize;static fToken=Symbol("CalculateChangedRectFromDifferenceRequest");constructor(i,e,n,o){this.originalRect=i,this.difference=e,this.handleType=n,this.minimumSize=o}},bp={[yt.LEFT]:{x:-1,y:0},[yt.LEFT_TOP]:{x:-1,y:-1},[yt.TOP]:{x:0,y:-1},[yt.RIGHT_TOP]:{x:1,y:-1},[yt.RIGHT]:{x:1,y:0},[yt.RIGHT_BOTTOM]:{x:1,y:1},[yt.BOTTOM]:{x:0,y:1},[yt.LEFT_BOTTOM]:{x:-1,y:1}},lC=(()=>{let t=class Rs{handle({originalRect:e,difference:n,handleType:o,minimumSize:r}){let s=this._changeSizeInRect(e,n,bp[o],r);return this._changePosition(e,n,bp[o],s)}_changeSizeInRect(e,n,o,r){let s=e.width+o.x*n.x,a=e.height+o.y*n.y,l=0,h=0;return s<0&&(l=s,s=Math.abs(s)),s<r.width&&(o.x===-1&&(l+=s-r.width),s=r.width),a<0&&(h=a,a=Math.abs(a)),a<r.height&&(o.y===-1&&(h+=a-r.height),a=r.height),G.initialize(l,h,s,a)}_changePosition(e,n,o,r){let s=e.x+(o.x===-1?n.x:0)+r.x,a=e.y+(o.y===-1?n.y:0)+r.y;return G.initialize(s,a,r.width,r.height)}static \u0275fac=function(n){return new(n||Rs)};static \u0275prov=g({token:Rs,factory:Rs.\u0275fac})};return t=C([x(kd)],t),t})(),Rd=class{nodeOrGroup;paddings;static fToken=Symbol("CalculateDirectChildrenUnionRectRequest");constructor(i,e){this.nodeOrGroup=i,this.paddings=e}},uC=(()=>{let t=class Ns{_mediator=d(R);_store=d(E);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle({nodeOrGroup:e,paddings:n}){let o=G.union(this._calculateDirectChildren(e.fId()).map(r=>this._normalizeRect(r)));return o?this._concatRectWithParentPadding(o,n):null}_calculateDirectChildren(e){return this._allNodesAndGroups.filter(n=>n.fParentId()===e)}_normalizeRect(e){return this._mediator.execute(new Ee(e.hostElement))}_concatRectWithParentPadding(e,n){return G.initialize(e.x-n[0],e.y-n[1],e.width+n[0]+n[2],e.height+n[1]+n[3])}static \u0275fac=function(n){return new(n||Ns)};static \u0275prov=g({token:Ns,factory:Ns.\u0275fac})};return t=C([x(Rd)],t),t})(),Pi=class{nodeOrGroup;rect;static fToken=Symbol("CalculateResizeLimitsRequest");constructor(i,e){this.nodeOrGroup=i,this.rect=e}},fC=(()=>{let t=class Os{_mediator=d(R);handle({nodeOrGroup:e,rect:n}){let o=this._getParentsChain(e),r=this._calculateNodePaddings(e,n);return{limits:this._buildSoftHardLimits(o),childrenBounds:this._getNormalizedChildrenBounds(e,r),minimumSize:ht.initialize(r[0]+r[2],r[1]+r[3])}}_calculateNodePaddings(e,n){return this._mediator.execute(new dn(e,n))}_getNormalizedChildrenBounds(e,n){return this._mediator.execute(new Rd(e,n))}_getParentsChain(e){return this._mediator.execute(new Bn(e))??[]}_buildSoftHardLimits(e){let n=[],o,r=[0,0,0,0];for(let s of e){let a=this._getParentInfo(s,r);if(r=a.paddings,this._isAutoExpand(s))n.push(this._makeLimit(s,a));else{o=this._makeLimit(s,a);break}}return{softLimits:n,hardLimit:o}}_getParentInfo(e,n){return this._mediator.execute(new wi(e,n))}_isAutoExpand(e){return e.fAutoExpandOnChildHit()}_makeLimit(e,{boundingRect:n,innerRect:o}){return{nodeOrGroup:e,boundingRect:n,innerRect:o}}static \u0275fac=function(n){return new(n||Os)};static \u0275prov=g({token:Os,factory:Os.\u0275fac})};return t=C([x(Pi)],t),t})(),Nd=class{event;static fToken=Symbol("ResizeNodeFinalizeRequest");constructor(i){this.event=i}},im="node-resize",om="resize-node";function hC(t){return t.getEvent().kind===om||t.getEvent().fEventType===im}var pC=(()=>{let t=class Fs{_dragSession=d(Y);handle(e){this._isNodeResizeHandler()&&this._dragSession.draggableItems.forEach(n=>n.onPointerUp?.())}_isNodeResizeHandler(){return this._dragSession.draggableItems.some(e=>hC(e))}static \u0275fac=function(n){return new(n||Fs)};static \u0275prov=g({token:Fs,factory:Fs.\u0275fac})};return t=C([x(Nd)],t),t})(),$f=class{fNodeId;constructor(i){this.fNodeId=i}},Wf=(()=>{class t extends Xe{type=im;kind=om;data(){return new $f(this._nodeOrGroup.fId())}_mediator=d(R);_baselineRect;_constraints;_lastRect=null;_nodeOrGroup;_handleType;_nodeConnections={source:[],target:[]};_softParentConnections=[];initialize(e,n){this._nodeOrGroup=e,this._handleType=n}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 n=this._calcNextRect(e);this._applyConstraints(n),this._commitRect(n),this._applyConnectionHandlers(this._nodeConnections);for(let o of this._softParentConnections)this._applyConnectionHandlers(o);this._lastRect=n}onPointerUp(){let e=this._lastRect??this._fallbackRectFromModel();this._nodeOrGroup.sizeChange.emit(e),requestAnimationFrame(()=>this._nodeOrGroup.refresh())}_readBaselineRect(){return this._mediator.execute(new Ee(this._nodeOrGroup.hostElement))}_buildConstraints(e){return this._mediator.execute(new Pi(this._nodeOrGroup,e))}_calcNextRect(e){return this._mediator.execute(new kd(this._baselineRect,e,this._handleType,this._constraints.minimumSize))}_applyConstraints(e){this._mediator.execute(new Md(e,this._constraints.childrenBounds)),this._mediator.execute(new Dd(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 rn(this._nodeOrGroup.fId(),e)),this._nodeOrGroup.redraw()}_fallbackRectFromModel(){return G.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 n=new Map;for(let o of e.source){let r=this._readConnectorRect(o.connector,n);o.handler.setSourceRect(r)}for(let o of e.target){let r=this._readConnectorRect(o.connector,n);o.handler.setTargetRect(r)}}_readConnectorRect(e,n){let o=`${e.kind}::${e.fId()}`,r=n.get(o);if(r)return r;let s=this._mediator.execute(new zt(e.hostElement,!1));return n.set(o,s),s}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Mi=class{_mediator=d(R);_store=d(E);_behaviour=d(jn);_source;_target;_sourceRef;_targetRef;_sourceRect;_targetRect;connection;initialize(i){this.connection=i,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=ke.fromRoundedRect(this._sourceRef.rect),this._targetRect=ke.fromRoundedRect(this._targetRef.rect)}setSourceRect(i){this._sourceRect=ke.fromRoundedRect(i),this._mediator.execute(new on(this._source.fId(),this._source.kind,this._sourceRect))}setTargetRect(i){this._targetRect=ke.fromRoundedRect(i),this._mediator.execute(new on(this._target.fId(),this._target.kind,this._targetRect))}redraw(){let i=this._buildLine();this.connection.setLine(i),this.connection.redraw()}_buildLine(){let i=ke.fromRoundedRect(this._sourceRect),e=ke.fromRoundedRect(this._targetRect);return this._behaviour.handle(new mt(i,e,this.connection,this._sourceRef.connector.fConnectableSide,this._targetRef.connector.fConnectableSide,this._resolveRotationContext(this._sourceRef.connector),this._resolveRotationContext(this._targetRef.connector)))}_readRectRef(i){return{connector:i,rect:this._mediator.execute(new zt(i.hostElement,!1))}}_resolveRotationContext(i){return this._mediator.execute(new Et(i))}},mC=(()=>{class t extends Mi{_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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),_C=(()=>{class t extends Mi{setSourceRect(e){super.setSourceRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),gC=(()=>{class t extends Mi{setTargetRect(e){super.setTargetRect(e),super.redraw()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Od=class{event;fTrigger;static fToken=Symbol("ResizeNodePreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},Fd=class{handler;nodeOrGroup;static fToken=Symbol("AttachResizeConnectionDragHandlersToNodeRequest");constructor(i,e){this.handler=i,this.nodeOrGroup=e}},yC=(()=>{let t=class As{_store=d(E);_mediator=d(R);_dragInjector=d(ze);handle({handler:e,nodeOrGroup:n}){let o=this._readSoftParents(n),r=[n,...o],s=this._collectSourceConnectorIds(r),a=this._collectTargetConnectorIds(r),l=new Map;e.setNodeConnectionHandlers(this._buildConnectionHandlersForNode(n,s,a,l)),e.setSoftParentConnectionHandlers(o.map(h=>this._buildConnectionHandlersForNode(h,s,a,l)))}_readSoftParents(e){let n=this._mediator.execute(new Ee(e.hostElement));return this._mediator.execute(new Pi(e,n)).limits.softLimits.map(r=>r.nodeOrGroup)}_collectSourceConnectorIds(e){let n=new Set(e.map(o=>o.fId()));return new Set(this._store.outputs.getAll().filter(o=>n.has(o.fNodeId)).map(o=>o.fId()))}_collectTargetConnectorIds(e){let n=new Set(e.map(o=>o.fId()));return new Set(this._store.inputs.getAll().filter(o=>n.has(o.fNodeId)).map(o=>o.fId()))}_buildConnectionHandlersForNode(e,n,o,r){let s=this._store.outputs.getAll().filter(v=>v.fNodeId===e.fId()),a=this._store.inputs.getAll().filter(v=>v.fNodeId===e.fId());if(!s.length&&!a.length)return{source:[],target:[]};let l=new Set(s.map(v=>v.fId())),h=new Set(a.map(v=>v.fId())),_={source:[],target:[]};for(let v of this._store.connections.getAll()){let b=l.has(v.fOutputId()),I=h.has(v.fInputId());if(!b&&!I)continue;let N=r.get(v.fId())??this._createConnectionHandler(v,n,o);if(r.set(v.fId(),N),b){let D=this._store.outputs.require(v.fOutputId());_.source.push({handler:N,connector:D})}if(I){let D=this._store.inputs.require(v.fInputId());_.target.push({handler:N,connector:D})}}return _}_createConnectionHandler(e,n,o){let r=n.has(e.fOutputId()),s=o.has(e.fInputId()),a=r&&s?this._dragInjector.createInstance(mC):r?this._dragInjector.createInstance(_C):this._dragInjector.createInstance(gC);return a.initialize(e),a}static \u0275fac=function(n){return new(n||As)};static \u0275prov=g({token:As,factory:As.\u0275fac})};return t=C([x(Fd)],t),t})(),vC=(()=>{let t=class Ls{_mediator=d(R);_store=d(E);_dragSession=d(Y);_dragInjector=d(ze);get _transform(){return this._store.transform}handle({event:e,fTrigger:n}){if(!this._dragSession.isEmpty()||!this._isResizeHandle(e.targetElement)||!dt(e.originalEvent,n))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=X.fromPoint(e.getPosition()).elementTransform(this._store.flowHost).div(r);let s=this._dragInjector.createInstance(Wf);s.initialize(o,this._readResizeHandleType(e.targetElement)),this._mediator.execute(new Fd(s,o)),this._dragSession.draggableItems=[s]}_isResizeHandle(e){return ii(e,".f-resize-handle")}_findResizableNode(e){let n=this._store.nodes.getAll().find(o=>o.isContains(e));if(n)return n.fDraggingDisabled()?void 0:n}_selectBeforeResize(e){queueMicrotask(()=>{this._mediator.execute(new Gn(e))})}_readResizeHandleType(e){let n=Jh(e,"fResizeHandleType",".f-resize-handle");return yt[n]}static \u0275fac=function(n){return new(n||Ls)};static \u0275prov=g({token:Ls,factory:Ls.\u0275fac})};return t=C([x(Od)],t),t})(),CC=[cC,dC,lC,uC,fC,yC,pC,vC],Ad=class{event;static fToken=Symbol("RotateNodeFinalizeRequest");constructor(i){this.event=i}},rm="node-rotate",sm="rotate-node";function xC(t){return t.getEvent().kind===sm||t.getEvent().fEventType===rm}var bC=(()=>{let t=class Bs{_dragSession=d(Y);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(e=>xC(e))}static \u0275fac=function(n){return new(n||Bs)};static \u0275prov=g({token:Bs,factory:Bs.\u0275fac})};return t=C([x(Ad)],t),t})(),Ld=class{event;fTrigger;static fToken=Symbol("RotateNodePreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},qf=class{fNodeId;constructor(i){this.fNodeId=i}};function wC(t,i,e){let{x:n,y:o}=SC(t,i,e),r=n-t.x,s=o-t.y;return{x:r,y:s}}function SC(t,i,e){let n=t.x-e.x,o=t.y-e.y,r=i*Math.PI/180,s=Math.cos(r),a=Math.sin(r),l=n*s-o*a,h=n*a+o*s,_=l+e.x,v=h+e.y;return{x:_,y:v}}var Xf=(()=>{class t extends Xe{type=rm;kind=sm;data(){return new qf(this._nodeOrGroup.fId())}_store=d(E);_mediator=d(R);_dragSession=d(Y);_nodeOrGroup;_sourceConnections;_targetConnections;_startRotation=0;_nodeRect;_nodeCenter;_pointerDownInFlow;_rotationOffsetDeg=0;get _transform(){return this._store.transform}initialize(e,n,o){this._nodeOrGroup=e,this._sourceConnections=n,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 n=L.sum(this._pointerDownInFlow,e),r=this._angleDeg(n)-this._rotationOffsetDeg;this._applyRotation(r);let s=r-this._startRotation;for(let a of this._sourceConnections)a.connection.setSourceDelta(this._deltaAfterRotation(a.connector,s));for(let a of this._targetConnections)a.connection.setTargetDelta(this._deltaAfterRotation(a.connector,s))}onPointerUp(){this._nodeOrGroup.rotate.set(this._nodeOrGroup._rotate),this._nodeOrGroup.refresh()}_readNodeRect(){return this._mediator.execute(new Ee(this._nodeOrGroup.hostElement))}_calculatePointerDownInFlow(){return L.sub(this._dragSession.onPointerDownPosition,L.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,n){return wC(e,n,this._nodeCenter)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),IC=(()=>{let t=class zs{_mediator=d(R);_store=d(E);_dragContext=d(Y);_dragInjector=d(ze);get _transform(){return this._store.transform}handle(e){if(!this._isPreparationAllowed(e))return;let n=this._findRotatableNode(e.event.targetElement);if(!n)return;this._selectBeforeRotate(n);let o=this._transform.scale;this._dragContext.onPointerDownScale=o,this._dragContext.onPointerDownPosition=X.fromPoint(e.event.getPosition()).elementTransform(this._store.flowHost).div(o);let r=this._dragInjector.createInstance(Xf);r.initialize(n,this._buildOutputConnectionHandlers(n),this._buildInputConnectionHandlers(n)),this._dragContext.draggableItems=[r]}_isPreparationAllowed({event:e,fTrigger:n}){return this._dragContext.isEmpty()&&Xy(e.targetElement)&&dt(e.originalEvent,n)}_findRotatableNode(e){for(let n of this._store.nodes.getAll())if(!n.fDraggingDisabled()&&n.isContains(e))return n}_selectBeforeRotate(e){queueMicrotask(()=>{this._mediator.execute(new Gn(e))})}_buildInputConnectionHandlers(e){return this._mediator.execute(new jd(e)).map(n=>{let o=this._store.inputs.require(n.fInputId()),r=this._mediator.execute(new rt(o)),s=this._dragInjector.get(Ei);return s.initialize(n),{connection:s,connector:r.rect.gravityCenter}})}_buildOutputConnectionHandlers(e){return this._mediator.execute(new Qd(e)).map(n=>{let o=this._store.outputs.require(n.fOutputId()),r=this._mediator.execute(new rt(o)),s=this._dragInjector.get(Ii);return s.initialize(n),{connection:s,connector:r.rect.gravityCenter}})}static \u0275fac=function(n){return new(n||zs)};static \u0275prov=g({token:zs,factory:zs.\u0275fac})};return t=C([x(Ld)],t),t})(),TC=[bC,IC],Di=class{flowRect;canvasPosition;eventPoint;minimap;static fToken=Symbol("CalculateFlowPointFromMinimapPointRequest");constructor(i,e,n,o){this.flowRect=i,this.canvasPosition=e,this.eventPoint=n,this.minimap=o}},EC=(()=>{let t=class Vs{_store=d(E);get _canvasScale(){return this._store.transform.scale||1}handle(e){return L.sub(e.canvasPosition,L.sub(this._getPositionInViewBox(e.eventPoint,e.minimap),this._getNormalizedFlowCenter(e.flowRect)))}_getNormalizedFlowCenter(e){return X.fromPoint(e.gravityCenter).sub(e)}_getPositionInViewBox(e,n){let o=this.normalizeEventPoint(e,n);return L.sum(o,G.mult(n.viewBox,this._canvasScale))}normalizeEventPoint(e,n){return this._getEventPointInMinimap(e,n).mult(n.scale).mult(this._canvasScale)}_getEventPointInMinimap(e,n){return X.fromPoint(e).elementTransform(n.element)}static \u0275fac=function(n){return new(n||Vs)};static \u0275prov=g({token:Vs,factory:Vs.\u0275fac})};return t=C([x(Di)],t),t})(),Bd=class{event;static fToken=Symbol("DragMinimapFinalizeRequest");constructor(i){this.event=i}},PC=(()=>{let t=class Gs{_dragSession=d(Y);handle(e){this._isValid()&&this._dragSession.draggableItems.forEach(n=>{n.onPointerUp?.()})}_isValid(){return this._dragSession.draggableItems.some(MC)}static \u0275fac=function(n){return new(n||Gs)};static \u0275prov=g({token:Gs,factory:Gs.\u0275fac})};return t=C([x(Bd)],t),t})(),am="minimap",cm="minimap";function MC(t){return t.getEvent().kind===cm||t.getEvent().fEventType===am}var Kf=(()=>{class t extends Xe{type=am;kind=cm;_store=d(E);_mediator=d(R);_lastDelta=null;_flowRect;_startCanvasPosition;_eventPoint;_minimap;initialize(e,n,o,r){this._flowRect=e,this._startCanvasPosition=n,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(X.fromPoint(this._eventPoint).add(e))),this._store.fCanvas?.redraw())}_isSamePoint(e,n){return e.x===n.x&&e.y===n.y}_getNewPosition(e){return this._mediator.execute(new Di(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=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),zd=class{event;static fToken=Symbol("DragMinimapPreparationRequest");constructor(i){this.event=i}},DC=(()=>{let t=class Hs{_store=d(E);_mediator=d(R);_dragSession=d(Y);_dragInjector=d(ze);get _canvas(){return this._store.fCanvas}get _flowHost(){return this._store.flowHost}handle({event:e}){if(!this._isValid(e))return;let n=this._store.instances.require(ye.MINIMAP).state,o=e.getPosition(),r=X.fromPoint(this._store.transform.position),s=G.fromElement(this._flowHost);this._canvas.setPosition(this._calculateCanvasPosition(s,o,n)),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent(),this._dragSession.onPointerDownScale=1,this._dragSession.onPointerDownPosition=X.fromPoint(o).elementTransform(this._flowHost);let a=this._dragInjector.createInstance(Kf);a.initialize(s,r,o,n),this._dragSession.draggableItems=[a]}_isValid(e){return!(!this._dragSession.isEmpty()||!this._flowHost.contains(e.targetElement)||!e.targetElement.closest(".f-minimap")||!this._store.instances.get(ye.MINIMAP))}_calculateCanvasPosition(e,n,o){return this._mediator.execute(new Di(e,X.fromPoint(this._canvas.transform.position),n,o))}static \u0275fac=function(n){return new(n||Hs)};static \u0275prov=g({token:Hs,factory:Hs.\u0275fac})};return t=C([x(zd)],t),t})(),kC=[EC,PC,DC];function RC(t){return!!t&&typeof t.destroy=="function"}var ze=(()=>{class t{_injector=d(Ye);_dragInjector=null;_created=[];create(){this._dragInjector=Ye.create({providers:[{provide:Vd,useClass:Vd},{provide:ed,useClass:ed},{provide:$c,useClass:$c},{provide:Ef,useClass:Ef},{provide:bi,useClass:bi},{provide:Ii,useClass:Ii},{provide:Ei,useClass:Ei},{provide:Ti,useClass:Ti},{provide:Gt,useClass:Gt},{provide:Id,useClass:Id},{provide:Uf,useClass:Uf},{provide:Wf,useClass:Wf},{provide:Xf,useClass:Xf},{provide:Kf,useClass:Kf}],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 n=Ch(this._dragInjector,()=>new e);return this._created.push(n),n}destroy(){for(let e of this._created)RC(e)&&e.destroy();this._created=[],this._dragInjector?.destroy?.(),this._dragInjector=null}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Ht=(()=>{class t{_data;setData(e){this._data=ue(ue({},this._data),e)}getData(){return this._data}clear(){this._data=void 0}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),wp="f-canvas-dragging",Sp="canvas-dragging",Vd=(()=>{class t extends Xe{type="canvas-move";kind="drag-canvas";_store=d(E);_onPointerDownPosition=L.initialize();constructor(){super(),this._store.fCanvas?.hostElement.classList.add(wp,Sp)}prepareDragSequence(){this._onPointerDownPosition=this._store.transform.position}onPointerMove(e){this._store.fCanvas?.setPosition(X.fromPoint(this._onPointerDownPosition).add(e)),this._store.fCanvas?.redraw()}onPointerUp(){this._store.fCanvas?.emitCanvasChangeEvent(),this._store.fCanvas?.hostElement.classList.remove(wp,Sp)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),NC=(()=>{let t=class js{_dragContext=d(Y);handle(e){this._isValid()&&this._dragContext.draggableItems.forEach(n=>n.onPointerUp?.())}_isValid(){return this._dragContext.draggableItems.some(e=>e instanceof Vd)}static \u0275fac=function(n){return new(n||js)};static \u0275prov=g({token:js,factory:js.\u0275fac})};return t=C([x(Vc)],t),t})(),Gd=class{event;fTrigger;static fToken=Symbol("DragCanvasPreparationRequest");constructor(i,e){this.event=i,this.fTrigger=e}},OC=(()=>{let t=class Us{_store=d(E);_dragContext=d(Y);_dragInjector=d(ze);handle({event:e,fTrigger:n}){!this._isValid(e)||!this._isValidTrigger(e,n)||(this._dragContext.onPointerDownScale=1,this._dragContext.onPointerDownPosition=X.fromPoint(e.getPosition()).elementTransform(this._store.flowHost),this._dragContext.draggableItems=[this._dragInjector.get(Vd)])}_isValid(e){return this._dragContext.isEmpty()&&(this._isBackgroundElement(e.targetElement)||this._isDragOnHost(e.targetElement))}_isBackgroundElement(e){return this._store.instances.get(ye.BACKGROUND)?.hostElement.contains(e)}_isDragOnHost(e){return this._store.flowHost.contains(e)&&!this._getNode(e)}_getNode(e){let n=this._store.nodes.getAll().find(o=>o.isContains(e));return n&&n.fDraggingDisabled()&&(n=void 0),n}_isValidTrigger(e,n){return dt(e.originalEvent,n)}static \u0275fac=function(n){return new(n||Us)};static \u0275prov=g({token:Us,factory:Us.\u0275fac})};return t=C([x(Gd)],t),t})(),FC=[NC,OC],Hd=class{event;trigger;static fToken=Symbol("SelectByPointerRequest");constructor(i,e){this.event=i,this.trigger=e}},AC=(()=>{let t=class $s{_mediator=d(R);_store=d(E);_dragSession=d(Y);handle({event:e,trigger:n}){if(!this._isSelectionAllowed(e))return;let o=this._resolveSelectable(e.targetElement);this._deferRaiseLayerFor(o),dt(e.originalEvent,n)?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(n=>n.isContains(e))}_findConnectionAt(e){return this._store.connections.getAll().find(n=>n.isContains(e))}_deferRaiseLayerFor(e){e&&queueMicrotask(()=>{this._mediator.execute(new ln(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 n=this._dragSession.selectedItems.indexOf(e);n>=0&&this._dragSession.selectedItems.splice(n,1),e.unmarkAsSelected(),this._dragSession.markSelectionAsChanged()}static \u0275fac=function(n){return new(n||$s)};static \u0275prov=g({token:$s,factory:$s.\u0275fac})};return t=C([x(Hd)],t),t})(),LC=[AC];var Yf=class extends _f{hostElement=d(Se).nativeElement};function BC(t){return ii(t,".f-drag-blocker")}var dm=(()=>{class t extends Yf{_result=d(Ht);_mediator=d(R);_platform=d(Tu);disabled=!1;fMultiSelectTrigger=e=>this._platform.getOS()===Rt.MAC_OS?e.metaKey:e.ctrlKey;fReassignConnectionTrigger=pt;fCreateConnectionTrigger=pt;fConnectionWaypointsTrigger=F(pt);fMoveControlPointTrigger=pt;fNodeResizeTrigger=pt;fNodeRotateTrigger=pt;fNodeMoveTrigger=pt;fCanvasMoveTrigger=pt;fExternalItemTrigger=pt;fSelectionChange=new nt;fNodeIntersectedWithConnections=new nt;fNodeConnectionsIntersection=He();fEmitOnNodeIntersect=!1;fCreateNode=new nt;fMoveNodes=new nt;fReassignConnection=new nt;fCreateConnection=new nt;fConnectionWaypointsChanged=He();fDropToGroup=new nt;vCellSize=F(1,{transform:e=>We(e,1)});hCellSize=F(1,{transform:e=>We(e,1)});fCellSizeWhileDragging=F(!1,{transform:e=>xe(e)});fDragStarted=new nt;fDragEnded=new nt;_dragHandlerInjector=d(ze);ngOnInit(){this._mediator.execute(new Wd(this))}ngAfterViewInit(){super.subscribe()}onPointerDown(e){if(BC(e.targetElement))return!1;this._dragHandlerInjector.create(),this._result.clear(),this._mediator.execute(new Xd),this._mediator.execute(new Pd(e)),this._mediator.execute(new zd(e)),this._mediator.execute(new Td(e)),this._mediator.execute(new Hd(e,this.fMultiSelectTrigger)),this._mediator.execute(new Yc(e,this.fReassignConnectionTrigger)),this._mediator.execute(new Xc(e,this.fCreateConnectionTrigger)),this._mediator.execute(new td(e,this.fConnectionWaypointsTrigger()));let n=e.isMouseLeftButton();return n||this.finalizeDragSequence(),n}prepareDragSequence(e){this._mediator.execute(new Od(e,this.fNodeResizeTrigger)),this._mediator.execute(new Ld(e,this.fNodeRotateTrigger)),this._mediator.execute(new md(e,this.fNodeMoveTrigger)),this._mediator.execute(new bd(e,this.fExternalItemTrigger)),this._mediator.execute(new _d(e)),this._mediator.execute(new Gd(e,this.fCanvasMoveTrigger)),this._mediator.execute(new Kd)}onSelect(e){this._mediator.execute(new wd(e))}onPointerMove(e){this._mediator.execute(new qd(e))}onPointerUp(e){this._mediator.execute(new Bd(e)),this._mediator.execute(new Ed(e)),this._mediator.execute(new Kc(e)),this._mediator.execute(new Uc(e)),this._mediator.execute(new Nd(e)),this._mediator.execute(new Ad(e)),this._mediator.execute(new pd(e)),this._mediator.execute(new Cd(e)),this._mediator.execute(new nd(e)),this._mediator.execute(new Vc(e)),this._mediator.execute(new Sd(e)),this._mediator.execute(new Qc(e)),this._mediator.execute(new Oc)}finalizeDragSequence(){this._mediator.execute(new Vt),this._mediator.execute(new yi),this._result.clear(),this._dragHandlerInjector.destroy()}ngOnDestroy(){this._mediator.execute(new Vt),this._mediator.execute(new Yd),super.unsubscribe()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Pe({type:t,selectors:[["f-flow","fDraggable",""]],inputs:{disabled:[2,"fDraggableDisabled","disabled",xe],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",xe],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:[Ie([Ht,ze]),_e]})}return t})(),zC=[...FC,...mv,...Ly,...LC,...Zv,...$y,...kC,...Lv,...Jv,...CC,...TC,...aC,...oC],VC=(()=>{let t=class Ws{_store=d(E);handle({waypointIndex:e,connectionId:n}){let o=this._store.connections.require(n),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 Jc(e.fId(),e.fWaypoints()?.waypoints()||[])}static \u0275fac=function(n){return new(n||Ws)};static \u0275prov=g({token:Ws,factory:Ws.\u0275fac})};return t=C([x(ff)],t),t})(),Zf=class{static fToken=Symbol("RemoveSnapConnectionFromStoreRequest")},GC=(()=>{let t=class qs{_store=d(E);handle(e){this._store.connections.removeInstanceForSnap()}static \u0275fac=function(n){return new(n||qs)};static \u0275prov=g({token:qs,factory:qs.\u0275fac})};return t=C([x(Zf)],t),t})(),HC=[El,un,Og,Fg,Ag,Lg,D0,sy,F0,ey,py,hy,ry,_y,yy,gy,oy,uy,A0,by,iy,ny,ty,K0,J0,Y0,Z0,my,dy,vy,Cy,fy,ly,xy,wy,Sy,Iy,GC,VC],ki=class{instance;static fToken=Symbol("AddConnectorToStoreRequest");constructor(i){this.instance=i}},jC=(()=>{let t=class Xs{_store=d(E);_mediator=d(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 mc(e.fId(),e.fNodeId,e.kind,e.hostElement))}static \u0275fac=function(n){return new(n||Xs)};static \u0275prov=g({token:Xs,factory:Xs.\u0275fac})};return t=C([x(ki)],t),t})(),cn=class{position;connectorRefs;static fToken=Symbol("CalculateClosestConnectorRequest");constructor(i,e){this.position=i,this.connectorRefs=e}},UC=(()=>{let t=class Ks{handle({position:e,connectorRefs:n}){let o,r=1/0;for(let s of n){let a=this._distanceToRect(e,s.rect);a<r&&(r=a,o=s)}return o?mu(ue({},o),{distance:r}):void 0}_distanceToRect(e,{x:n,y:o,width:r,height:s}){let a=this._clamp(e.x,n,n+r),l=this._clamp(e.y,o,o+s),h=e.x-a,_=e.y-l;return Math.sqrt(h*h+_*_)}_clamp(e,n,o){return Math.max(n,Math.min(o,e))}static \u0275fac=function(n){return new(n||Ks)};static \u0275prov=g({token:Ks,factory:Ks.\u0275fac})};return t=C([x(cn)],t),t})(),Ri=class{pointerPosition;connectableConnectors;static fToken=Symbol("FindConnectableConnectorUsingPriorityAndPositionRequest");constructor(i,e){this.pointerPosition=i,this.connectableConnectors=e}},$C=(()=>{let t=class Ys{_mediator=d(R);_store=d(E);_browser=d(Re);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 n=this._findConnectorAtPosition(e);return n.length>0?n[0]:void 0}_findConnectorAtPosition(e){let n=[];n.push(...this._filterConnectorsThatLocatedAtPosition(e));let o=this._isSnapConnectionEnabledAndHasClosestConnector(e);o&&n.unshift(o.connector);let r=this._getFirstConnectableConnectorOfNodeAtPosition(e);return r&&n.push(r),n}_filterConnectorsThatLocatedAtPosition(e){return e.connectableConnectors.filter(n=>G.isIncludePoint(n.rect,this._calculatePointerInFlow(e.pointerPosition))).map(n=>n.connector)}_calculatePointerInFlow(e){return Un(e,this._flowHost,this._transform)}_isSnapConnectionEnabledAndHasClosestConnector(e){if(!this._snapConnection)return;let n=this._mediator.execute(new cn(this._calculatePointerInFlow(e.pointerPosition),e.connectableConnectors));return this._isValidClosestInput(n)?n:void 0}_isValidClosestInput(e){return!!e&&e.distance<this._snapConnection.fSnapThreshold}_getFirstConnectableConnectorOfNodeAtPosition(e){return this._getElementsFromPoint(e.pointerPosition).map(n=>this._findConnectableNode(n)).filter(n=>!!n).map(n=>this._findFirstConnectableConnectorOfNode(e.connectableConnectors,n)).find(n=>!!n)}_getElementsFromPoint(e){return this._browser.document.elementsFromPoint(e.x,e.y)}_findConnectableNode(e){return this._fNodes.find(n=>n.isContains(e)&&n.fConnectOnNode())}_findFirstConnectableConnectorOfNode(e,n){return e.find(o=>o.connector.fNodeId===n.fId())?.connector}static \u0275fac=function(n){return new(n||Ys)};static \u0275prov=g({token:Ys,factory:Ys.\u0275fac})};return t=C([x(Ri)],t),t})(),Ni=class{source;pointer;static fToken=Symbol("CalculateTargetConnectorsToConnectRequest");constructor(i,e){this.source=i,this.pointer=e}},rt=class{connector;static fToken=Symbol("GetConnectorRectReferenceRequest");constructor(i){this.connector=i}},WC=(()=>{let t=class Zs{_mediator=d(R);handle({connector:e}){return{connector:e,rect:this._getRect(e)}}_getRect(e){return this._mediator.execute(new zt(e.hostElement))}static \u0275fac=function(n){return new(n||Zs)};static \u0275prov=g({token:Zs,factory:Zs.\u0275fac})};return t=C([x(rt)],t),t})(),Oi=class{nodeOrGroup;static fToken=Symbol("AddNodeToStoreRequest");constructor(i){this.nodeOrGroup=i}},qC=(()=>{let t=class Qs{_store=d(E);_mediator=d(R);handle({nodeOrGroup:e}){this._store.nodes.add(e),this._mediator.execute(new _c(e.fId(),e.hostElement,e)),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||Qs)};static \u0275prov=g({token:Qs,factory:Qs.\u0275fac})};return t=C([x(Oi)],t),t})(),jd=class{nodeOrGroup;static fToken=Symbol("CalculateInputConnectionsRequest");constructor(i){this.nodeOrGroup=i}},XC=(()=>{let t=class Js{_store=d(E);handle({nodeOrGroup:e}){let n=this._collectInputIds(e);return this._collectConnections(n)}_collectInputIds(e){let n=new Set,o=this._store.inputs.getAll();for(let r of o)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fInputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||Js)};static \u0275prov=g({token:Js,factory:Js.\u0275fac})};return t=C([x(jd)],t),t})(),Fn=class{connector;pointerPosition;static fToken=Symbol("CalculateConnectableSideByConnectedPositionsRequest");constructor(i,e){this.connector=i,this.pointerPosition=e}},Ip=2,Ue=(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})(Ue||{});function KC(t,i,e,n,o){let r=YC(o),s=e-t,a=n-i,l=ZC(s,a);return QC(l,r)?l:JC(s,a,r,l)}function YC(t){if(!t||t.length===0)return Ue.ALL;let i=Ue.NONE;for(let e=0;e<t.length;e++)switch(t[e]){case B.LEFT:i|=Ue.LEFT;break;case B.RIGHT:i|=Ue.RIGHT;break;case B.TOP:i|=Ue.TOP;break;case B.BOTTOM:i|=Ue.BOTTOM;break}return i||Ue.ALL}function ZC(t,i){let e=t<0?-t:t,n=i<0?-i:i;return e-n>Ip?t<0?B.LEFT:B.RIGHT:(n-e>Ip,i<0?B.TOP:B.BOTTOM)}function QC(t,i){switch(t){case B.LEFT:return(i&Ue.LEFT)!==0;case B.RIGHT:return(i&Ue.RIGHT)!==0;case B.TOP:return(i&Ue.TOP)!==0;case B.BOTTOM:return(i&Ue.BOTTOM)!==0;default:return!0}}function JC(t,i,e,n){let o=n,r=-1/0;if(e&Ue.RIGHT){let s=t;s>r&&(r=s,o=B.RIGHT)}if(e&Ue.LEFT){let s=-t;s>r&&(r=s,o=B.LEFT)}if(e&Ue.BOTTOM){let s=i;s>r&&(r=s,o=B.BOTTOM)}if(e&Ue.TOP){let s=-i;s>r&&(r=s,o=B.TOP)}return o}function Ud(t){return t===B.CALCULATE||t===B.CALCULATE_HORIZONTAL||t===B.CALCULATE_VERTICAL}var ex={[B.CALCULATE]:[B.TOP,B.BOTTOM,B.LEFT,B.RIGHT],[B.CALCULATE_HORIZONTAL]:[B.LEFT,B.RIGHT],[B.CALCULATE_VERTICAL]:[B.TOP,B.BOTTOM]},tx=(()=>{let t=class ea{_mediator=d(R);handle({connector:e,pointerPosition:n}){let o=e.userFConnectableSide,r=this._getConnectorRect(e.hostElement).gravityCenter,s=this._accumulateConnectedCenters(e.hostElement,e.toConnector,n),a=s.sumX/s.count,l=s.sumY/s.count;return KC(r.x,r.y,a,l,ex[o])}_accumulateConnectedCenters(e,n,o){let r=o?.x||0,s=o?.y||0,a=o?1:0;if(n&&n.length)for(let l=0;l<n.length;l++){let h=n[l].hostElement;if(h===e)continue;let _=this._getConnectorRect(h).gravityCenter;r+=_.x,s+=_.y,a++}return{sumX:r,sumY:s,count:a}}_getConnectorRect(e){return this._mediator.execute(new Ee(e))}static \u0275fac=function(n){return new(n||ea)};static \u0275prov=g({token:ea,factory:ea.\u0275fac})};return t=C([x(Fn)],t),t})(),$d=class{connector;static fToken=Symbol("CalculateConnectableSideByInternalPositionRequest");constructor(i){this.connector=i}},Wd=class{fComponent;static fToken=Symbol("AddDndToStoreRequest");constructor(i){this.fComponent=i}},nx=(()=>{let t=class ta{_store=d(E);handle(e){this._store.fDraggable=e.fComponent}static \u0275fac=function(n){return new(n||ta)};static \u0275prov=g({token:ta,factory:ta.\u0275fac})};return t=C([x(Wd)],t),t})(),qd=class{event;static fToken=Symbol("OnPointerMoveRequest");constructor(i){this.event=i}},ix=(()=>{let t=class na{_mediator=d(R);_store=d(E);get _hostElement(){return this._store.fDraggable?.hostElement}_dragContext=d(Y);handle({event:e}){this._dragContext.rememberPointerEvent(e),this._setDifferenceToDraggableItems(this._getDifferenceBetweenPointerAndPointerDown(e),e),this._mediator.execute(new vi)}_setDifferenceToDraggableItems(e,n){this._dragContext.draggableItems.forEach(o=>{o.onPointerMove(ue({},e),n)})}_getDifferenceBetweenPointerAndPointerDown(e){return this._getPointerPositionInCanvas(e).div(this._dragContext.onPointerDownScale).sub(this._dragContext.onPointerDownPosition)}_getPointerPositionInCanvas(e){return X.fromPoint(e.getPosition()).elementTransform(this._hostElement)}static \u0275fac=function(n){return new(n||na)};static \u0275prov=g({token:na,factory:na.\u0275fac})};return t=C([x(qd)],t),t})(),Xd=class{static fToken=Symbol("InitializeDragSequenceRequest")},ox=(()=>{let t=class ia{_dragContext=d(Y);handle(e){this._dragContext.reset()}static \u0275fac=function(n){return new(n||ia)};static \u0275prov=g({token:ia,factory:ia.\u0275fac})};return t=C([x(Xd)],t),t})(),jt=class{static fToken=Symbol("IsDragStartedRequest")},rx=(()=>{let t=class oa{_store=d(E);handle(e){return!!this._store.fDraggable?.isDragStarted}static \u0275fac=function(n){return new(n||oa)};static \u0275prov=g({token:oa,factory:oa.\u0275fac})};return t=C([x(jt)],t),t})(),Kd=class{static fToken=Symbol("PrepareDragSequenceRequest")},sx=(()=>{let t=class ra{_mediator=d(R);_dragContext=d(Y);handle(e){this._callPrepareDragSequence(),this._mediator.execute(new Fc)}_callPrepareDragSequence(){this._dragContext.draggableItems.forEach(e=>e.prepareDragSequence?.())}static \u0275fac=function(n){return new(n||ra)};static \u0275prov=g({token:ra,factory:ra.\u0275fac})};return t=C([x(Kd)],t),t})(),Yd=class{static fToken=Symbol("RemoveDndFromStoreRequest")},ax=(()=>{let t=class sa{_store=d(E);handle(e){this._store.fDraggable=void 0}static \u0275fac=function(n){return new(n||sa)};static \u0275prov=g({token:sa,factory:sa.\u0275fac})};return t=C([x(Yd)],t),t})(),cx=[nx,ix,ox,sx,rx,ax],dx=new fe("CONNECTABLE_SIDE_EPSILON"),lx=(()=>{let t=class aa{_mediator=d(R);_lastSide=new WeakMap;_epsilon=Math.max(0,d(dx,{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 n=this._getSideByDelta(e.hostElement,e.fNodeHost,e);return this._lastSide.set(e,n),n}_getSideByDelta(e,n,o){let r=G.fromElement(e),s=n.getBoundingClientRect(),a=r.gravityCenter.x,l=r.gravityCenter.y,h=a-s.left,_=s.right-a,v=l-s.top,b=s.bottom-l,I=0,N=h,D=[h,_,v,b];for(let O=1;O<4;O++){let z=D[O];z<N&&(N=z,I=O)}let M=I===0?B.LEFT:I===1?B.RIGHT:I===2?B.TOP:B.BOTTOM,k=this._lastSide.get(o);if(k!==void 0&&k!==M){let O=k===B.LEFT?0:k===B.RIGHT?1:k===B.TOP?2:3;(O===0?h:O===1?_:O===2?v:b)-N<=this._epsilon&&(M=k)}return M}_isDragging(){return this._mediator.execute(new jt)}static \u0275fac=function(n){return new(n||aa)};static \u0275prov=g({token:aa,factory:aa.\u0275fac})};return t=C([x($d)],t),t})(),An=class{nodeOrGroup;static fToken=Symbol("CalculateConnectorsConnectableSidesRequest");constructor(i){this.nodeOrGroup=i}},ux=(()=>{let t=class ca{_mediator=d(R);handle({nodeOrGroup:e}){let n=e.connectors,o=n.length;for(let s=0;s<o;s++){let a=n[s];a.fConnectableSide=this._resolveSideForConnectorFast(a)}let r=new Set;for(let s=0;s<o;s++){let l=n[s].toConnector;if(l&&l.length)for(let h=0,_=l.length;h<_;h++){let v=l[h],b=v.userFConnectableSide;Ud(b)&&r.add(v)}}r.size>0&&r.forEach(s=>{s.fConnectableSide=this._calculateByConnectedPositions(s)})}_resolveSideForConnectorFast(e){let n=e.userFConnectableSide;return n===B.AUTO?this._mediator.execute(new $d(e)):Ud(n)?this._calculateByConnectedPositions(e):n}_calculateByConnectedPositions(e){return this._mediator.execute(new Fn(e))}static \u0275fac=function(n){return new(n||ca)};static \u0275prov=g({token:ca,factory:ca.\u0275fac})};return t=C([x(An)],t),t})(),Ln=class{static fToken=Symbol("CalculateNodesBoundingBoxRequest")},fx=(()=>{let t=class da{_store=d(E);handle(e){return G.union(this._nodesRects())}_nodesRects(){return this._store.nodes.getAll().map(e=>G.fromElement(e.hostElement))}static \u0275fac=function(n){return new(n||da)};static \u0275prov=g({token:da,factory:da.\u0275fac})};return t=C([x(Ln)],t),t})(),Zd=class{fNodes;static fToken=Symbol("CalculateNodesBoundingBoxNormalizedPositionRequest");constructor(i){this.fNodes=i}},hx=(()=>{let t=class la{_store=d(E);_mediator=d(R);handle(e){return G.union(this._getNodesRects(e.fNodes||this._store.nodes.getAll()))}_getNodesRects(e){return e.map(n=>this._getNodeRect(n))}_getNodeRect(e){let n=this._mediator.execute(new Nn(e.hostElement));if(n)return this._getElementRect(e,n);let o=this._mediator.execute(new Ee(e.hostElement));return this._getElementRect(e,o)}_getElementRect(e,n){return G.initialize(e._position.x,e._position.y,n.width,n.height)}static \u0275fac=function(n){return new(n||la)};static \u0275prov=g({token:la,factory:la.\u0275fac})};return t=C([x(Zd)],t),t})(),Qd=class{nodeOrGroup;static fToken=Symbol("CalculateOutputConnectionsRequest");constructor(i){this.nodeOrGroup=i}},px=(()=>{let t=class ua{_store=d(E);handle({nodeOrGroup:e}){let n=this._collectOutputIds(e);return this._collectConnections(n)}_collectOutputIds(e){let n=new Set,o=this._store.outputs.getAll();for(let r of o)e.isContains(r.hostElement)&&n.add(r.fId());return n}_collectConnections(e){let n=[],o=this._store.connections.getAll();for(let r of o)e.has(r.fOutputId())&&n.push(r);return n}static \u0275fac=function(n){return new(n||ua)};static \u0275prov=g({token:ua,factory:ua.\u0275fac})};return t=C([x(Qd)],t),t})(),Fi=class{nodeOrGroup;static fToken=Symbol("FitToChildNodesAndGroupsRequest");constructor(i){this.nodeOrGroup=i}},dn=class{fNode;rect;static fToken=Symbol("GetNodePaddingRequest");constructor(i,e){this.fNode=i,this.rect=e}},mx=(()=>{let t=class fa{_browser=d(Re);handle(e){return e.fNode.fIncludePadding()?this._getPaddingData(e.fNode,e.rect):[0,0,0,0]}_getPaddingData(e,n){let o=this._browser.window.getComputedStyle(e.hostElement);return[this._browser.toPixels(o.paddingLeft,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingTop,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingRight,n.width,n.height,o.fontSize),this._browser.toPixels(o.paddingBottom,n.width,n.height,o.fontSize)]}static \u0275fac=function(n){return new(n||fa)};static \u0275prov=g({token:fa,factory:fa.\u0275fac})};return t=C([x(dn)],t),t})(),_x=(()=>{let t=class ha{_mediator=d(R);_store=d(E);get _nodes(){return this._store.nodes.getAll()}handle({nodeOrGroup:e}){if(e.fAutoSizeToFitChildren()){let r=this._calculateDirectChildren(e);if(r.length){let s=this._boundingRect(e),a=this._calculateChildrenBounding(r,this._paddings(e,s));e.updatePosition(a),e.updateSize(a),e.redraw()}}let n=e.fParentId();if(!n)return;let o=this._nodes.find(r=>r.fId()===n);o&&this._mediator.execute(new Fi(o))}_calculateDirectChildren(e){return this._nodes.filter(n=>n.fParentId()===e.fId())}_unionRect(e){return G.union(e.map(n=>this._boundingRect(n)))||G.initialize()}_boundingRect(e){return this._mediator.execute(new Ee(e.hostElement))}_paddings(e,n){return this._mediator.execute(new dn(e,n))}_calculateChildrenBounding(e,[n,o,r,s]){let a=this._unionRect(e);return a=G.initialize(a.x-n,a.y-o,a.width+n+r,a.height+o+s),a}static \u0275fac=function(n){return new(n||ha)};static \u0275prov=g({token:ha,factory:ha.\u0275fac})};return t=C([x(Fi)],t),t})(),Jd=class{id;static fToken=Symbol("GetChildNodeIdsRequest");constructor(i){this.id=i}},gx=(()=>{let t=class pa{_store=d(E);get _allNodesAndGroups(){return this._store.nodes.getAll()}handle(e){if(!e.id)return[];let n=new Set,o=[];return this._collectDescendants(e.id,o,n),o}_collectDescendants(e,n,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(s=>s.fParentId()===e).map(s=>s.fId());n.push(...r);for(let s of r)this._collectDescendants(s,n,o)}static \u0275fac=function(n){return new(n||pa)};static \u0275prov=g({token:pa,factory:pa.\u0275fac})};return t=C([x(Jd)],t),t})(),Bn=class{nodeOrGroup;static fToken=Symbol("GetParentNodesRequest");constructor(i){this.nodeOrGroup=i}},yx=(()=>{let t=class ma{_store=d(E);handle({nodeOrGroup:e}){return this._getParentNodes(e,new Set,[])}_getParentNodes(e,n,o){if(n.has(e.fId()))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e.fId());n.add(e.fId());let r=this._store.nodes.get(e.fParentId());return r?(o.push(r),this._getParentNodes(r,n,o)):o}static \u0275fac=function(n){return new(n||ma)};static \u0275prov=g({token:ma,factory:ma.\u0275fac})};return t=C([x(Bn)],t),t})(),Ai=class{nodeOrGroup;destroyRef;static fToken=Symbol("UpdateNodeWhenStateOrSizeChangedRequest");constructor(i,e){this.nodeOrGroup=i,this.destroyRef=e}},vx=(()=>{let t=class _a{_mediator=d(R);handle({nodeOrGroup:e,destroyRef:n}){let{hostElement:o,stateChanges:r}=e;new vt(new Vu(o),r).listen(n,()=>{this._mediator.execute(new tn),this._isDragging()||(this._mediator.execute(new Rn(e.fId(),"UpdateNodeWhenStateOrSizeChanged")),this._mediator.execute(new An(e)),this._mediator.execute(new Fi(e)))})}_isDragging(){return this._mediator.execute(new jt)}static \u0275fac=function(n){return new(n||_a)};static \u0275prov=g({token:_a,factory:_a.\u0275fac})};return t=C([x(Ai)],t),t})(),Li=class{instance;static fToken=Symbol("RemoveNodeFromStoreRequest");constructor(i){this.instance=i}},Cx=(()=>{let t=class ga{_store=d(E);_mediator=d(R);handle({instance:e}){this._store.nodes.remove(e),this._mediator.execute(new gc(e.fId())),this._store.emitNodeChanges()}static \u0275fac=function(n){return new(n||ga)};static \u0275prov=g({token:ga,factory:ga.\u0275fac})};return t=C([x(Li)],t),t})(),xx=[qC,tx,lx,XC,ux,fx,hx,px,_x,gx,mx,yx,vx,Cx],bx=(()=>{let t=class ya{_mediator=d(R);_store=d(E);get _targets(){return this._store.inputs.getAll()}handle({source:e,pointer:n}){let o=this._getConnectableTargets(e),r=[];for(let s of o)r.push(this._mediator.execute(new rt(s)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableTargets(e){if(e.hasConnectionLimits)return this._targets.filter(o=>e.canConnectTo(o));let n=this._targets.filter(o=>o.canBeConnected);return e.isSelfConnectable||(n=n.filter(o=>o.fNodeId!==e.fNodeId)),n}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:o}of e)Ud(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Fn(e,n))}static \u0275fac=function(n){return new(n||ya)};static \u0275prov=g({token:ya,factory:ya.\u0275fac})};return t=C([x(Ni)],t),t})(),el=class{target;pointer;static fToken=Symbol("CalculateSourceConnectorsToConnectRequest");constructor(i,e){this.target=i,this.pointer=e}},wx=(()=>{let t=class va{_mediator=d(R);_store=d(E);get _sources(){return this._store.outputs.getAll()}handle({target:e,pointer:n}){let o=this._getConnectableSources(e),r=[];for(let s of o)r.push(this._mediator.execute(new rt(s)));return this._scheduleApplyCalculatedSides(r,n),r}_getConnectableSources(e){return this._sources.filter(n=>{let o=n.canBeConnected;return o&&n.hasConnectionLimits&&(o=n.canConnectTo(e)),o})}_scheduleApplyCalculatedSides(e,n){queueMicrotask(()=>this._applyCalculatedConnectableSides(e,n))}_applyCalculatedConnectableSides(e,n){for(let{connector:o}of e)Ud(o.userFConnectableSide)&&(o.fConnectableSide=this._calculateByConnectedPositions(o,n))}_calculateByConnectedPositions(e,n){return this._mediator.execute(new Fn(e,n))}static \u0275fac=function(n){return new(n||va)};static \u0275prov=g({token:va,factory:va.\u0275fac})};return t=C([x(el)],t),t})(),zn=class{connectors;static fToken=Symbol("MarkConnectableConnectorsRequest");constructor(i){this.connectors=i}},Ne={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"}},Sx=(()=>{let t=class Ca{_store=d(E);handle({connectors:e}){this._store.flowHost.classList.add(Ne.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._markConnector(n))}_markConnector({hostElement:e}){e.classList.add(Ne.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||Ca)};static \u0275prov=g({token:Ca,factory:Ca.\u0275fac})};return t=C([x(zn)],t),t})(),Bi=class{instance;static fToken=Symbol("RemoveConnectorFromStoreRequest");constructor(i){this.instance=i}},Ix=(()=>{let t=class xa{_store=d(E);_mediator=d(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 di(e.fId(),e.kind))}static \u0275fac=function(n){return new(n||xa)};static \u0275prov=g({token:xa,factory:xa.\u0275fac})};return t=C([x(Bi)],t),t})(),Vn=class{connectors;static fToken=Symbol("UnmarkConnectableConnectorsRequest");constructor(i){this.connectors=i}},Tx=(()=>{let t=class ba{_store=d(E);handle({connectors:e}){this._store.flowHost.classList.remove(Ne.DRAG_AND_DROP.CONNECTIONS_DRAGGING),e.forEach(n=>this._unmarkConnector(n))}_unmarkConnector({hostElement:e}){e.classList.remove(Ne.CONNECTOR.CONNECTABLE)}static \u0275fac=function(n){return new(n||ba)};static \u0275prov=g({token:ba,factory:ba.\u0275fac})};return t=C([x(Vn)],t),t})(),Ex=[jC,Ix,UC,$C,wx,bx,WC,Sx,Tx],tl=class{instance;static fToken=Symbol("AddFlowToStoreRequest");constructor(i){this.instance=i}};var ri=(function(t){return t.MANUAL="manual",t.AUTO="auto",t})(ri||{});function Px(t){let i=[...t.nodes.map(Tp),...t.groups.map(Tp)],e=new Set(t.nodes.map(a=>a.id)),n=new Set(t.groups.map(a=>a.id)),o=new Map,r=new Map;for(let a of[...t.nodes,...t.groups]){for(let l of a.fOutputs)o.set(l.id,a.id);for(let l of a.fInputs)r.set(l.id,a.id)}let s=t.connections.reduce((a,l)=>{let h=o.get(l.fOutputId),_=r.get(l.fInputId);return!h||!_||a.push({source:h,target:_}),a},[]);return{nodes:i,connections:s,nodeIds:e,groupIds:n}}function Tp(t){return{id:t.id,size:t.measuredSize?ue({},t.measuredSize):t.size?ue({},t.size):void 0}}var Mx=1,lm=(()=>{class t{_destroyRef=d(Ze);_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,n){let o=e.fId();this.unregisterFlow(o);let r={flow:e,store:n,nodeSignature:this._buildNodeSignature(n),connectionSignature:this._buildConnectionSignature(n),timeoutId:null,raf1:null,raf2:null,unsubs:[],runId:0,isApplying:!1};r.unsubs.push(n.nodesChanges$.listen(()=>this._handleNodesChanges(o)),n.connectionsChanges$.listen(()=>this._handleConnectionsChanges(o))),this._flows.set(o,r),this._engine?.getMode()===ri.AUTO&&this._scheduleRelayout(o)}unregisterFlow(e){let n=this._flows.get(e);n&&(n.unsubs.forEach(o=>o()),this._clearScheduledWork(n),this._flows.delete(e))}handleModeChanged(e){if(e===ri.AUTO)for(let n of this._flows.keys())this._scheduleRelayout(n)}async relayout(e){if(this._engine){if(e){let n=this._flows.get(e);n&&await this._relayoutRegisteredFlow(e,n);return}for(let[n,o]of this._flows.entries())await this._relayoutRegisteredFlow(n,o)}}_handleNodesChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let o=this._buildNodeSignature(n.store);o!==n.nodeSignature&&(n.nodeSignature=o,this._scheduleRelayout(e))}_handleConnectionsChanges(e){let n=this._flows.get(e);if(!n||n.isApplying)return;let o=this._buildConnectionSignature(n.store);o!==n.connectionSignature&&(n.connectionSignature=o,this._scheduleRelayout(e))}_scheduleRelayout(e){let n=this._flows.get(e);!n||!this._engine||this._engine.getMode()!==ri.AUTO||(n.timeoutId!==null&&clearTimeout(n.timeoutId),this._cancelAnimationFrames(n),n.timeoutId=setTimeout(()=>{n.timeoutId=null,this._runAfterNextPaint(n,()=>{this._relayoutFlowIfReady(e)})},Mx))}async _relayoutFlowIfReady(e){let n=this._flows.get(e);if(!(!n||!this._engine||this._engine.getMode()!==ri.AUTO)){if(n.store.hasPendingProgressiveRender){this._scheduleRelayout(e);return}await this._relayoutRegisteredFlow(e,n)}}async _relayoutRegisteredFlow(e,n){if(!this._engine)return;let o=Px(n.flow.getState({measuredSize:!0})),r=++n.runId,s=await this._engine.calculate(o.nodes,o.connections,{flowId:e,mode:this._engine.getMode()}),a=this._flows.get(e);if(!(!a||a.runId!==r||!this._applyPositions(a.store,s.nodes).length)){a.isApplying=!0;try{a.flow.redraw(),this._emitWriteback(e,s.nodes,o.nodeIds,o.groupIds)}finally{queueMicrotask(()=>{let h=this._flows.get(e);h&&(h.isApplying=!1)})}}}_emitWriteback(e,n,o,r){let s=this._engine?.getWriteback();s&&s({flowId:e,nodes:n.filter(a=>o.has(a.id)),groups:n.filter(a=>r.has(a.id))})}_applyPositions(e,n){return n.filter(o=>{let r=e.nodes.get(o.id);return!r||L.isEqual(r._position,o.position)?!1:(r.position.set(ue({},o.position)),!0)})}_buildNodeSignature(e){return e.nodes.getAll().map(n=>n.fId()).sort().join("|")}_buildConnectionSignature(e){return e.connections.getAll().map(n=>`${n.fId()}:${n.fOutputId()}:${n.fInputId()}`).sort().join("|")}_runAfterNextPaint(e,n){if(this._cancelAnimationFrames(e),typeof requestAnimationFrame!="function"){n();return}e.raf1=requestAnimationFrame(()=>{e.raf1=null,e.raf2=requestAnimationFrame(()=>{e.raf2=null,n()})})}_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(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();var Dx=(()=>{let t=class wa{_store=d(E);_layoutController=d(lm,{optional:!0});handle({instance:e}){this._store.fFlow=e,this._layoutController?.registerFlow(e,this._store)}static \u0275fac=function(n){return new(n||wa)};static \u0275prov=g({token:wa,factory:wa.\u0275fac})};return t=C([x(tl)],t),t})(),nl=class{static fToken=Symbol("GetFlowRequest")},kx=(()=>{let t=class Sa{_store=d(E);handle(e){let n=this._store.fFlow;if(!n)throw new Error("Flow not found in store");return n}static \u0275fac=function(n){return new(n||Sa)};static \u0275prov=g({token:Sa,factory:Sa.\u0275fac})};return t=C([x(nl)],t),t})(),il=class{static fToken=Symbol("CalculateConnectionsStateRequest")},Rx=(()=>{let t=class Ia{_store=d(E);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(n){return new(n||Ia)};static \u0275prov=g({token:Ia,factory:Ia.\u0275fac})};return t=C([x(il)],t),t})(),zi=class{component;measuredSize;static fToken=Symbol("CalculateNodesStateRequest");constructor(i,e=!1){this.component=i,this.measuredSize=e}},Nx=(()=>{let t=class Ta{_store=d(E);_mediator=d(R);handle({component:e,measuredSize:n}){return this._store.nodes.getAll().filter(o=>o instanceof e).map(o=>{let r=n?this._mediator.execute(new Ee(o.hostElement)):null;return{id:o.fId(),parentId:o.fParentId()??void 0,position:ue({},o._position),size:o._size?ue({},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(n=>e.contains(n.hostElement)).map(n=>({id:n.fId(),fConnectableSide:n.fConnectableSide}))}_getInputs(e){return this._store.inputs.getAll().filter(n=>e.contains(n.hostElement)).map(n=>({id:n.fId(),fConnectableSide:n.fConnectableSide}))}static \u0275fac=function(n){return new(n||Ta)};static \u0275prov=g({token:Ta,factory:Ta.\u0275fac})};return t=C([x(zi)],t),t})(),ol=class{measuredSize;static fToken=Symbol("CalculateFlowStateRequest");constructor(i=!1){this.measuredSize=i}},Ox=(()=>{let t=class Ea{_mediator=d(R);_store=d(E);get _canvas(){return this._store.fCanvas}get _transform(){return this._canvas.transform}get _canvasPosition(){return L.sum(this._transform.position,this._transform.scaledPosition)}handle({measuredSize:e}){return{position:this._canvasPosition,scale:this._canvas.transform.scale,nodes:this._mediator.execute(new zi(Ml,e)),groups:this._mediator.execute(new zi(bf,e)),connections:this._mediator.execute(new il)}}static \u0275fac=function(n){return new(n||Ea)};static \u0275prov=g({token:Ea,factory:Ea.\u0275fac})};return t=C([x(ol)],t),t})(),Fx=[Ox,Nx,Rx],rl=class{instance;static fToken=Symbol("RemoveFlowFromStoreRequest");constructor(i){this.instance=i}},Ax=(()=>{let t=class Pa{_store=d(E);_layoutController=d(lm,{optional:!0});handle({instance:e}){this._layoutController?.unregisterFlow(e.fId()),this._store.fFlow=void 0}static \u0275fac=function(n){return new(n||Pa)};static \u0275prov=g({token:Pa,factory:Pa.\u0275fac})};return t=C([x(rl)],t),t})(),Dl=(()=>{class t{isNodesRendered=!1;isFullRendered=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),sl=class{static fToken=Symbol("NotifyNodesRenderedRequest")},ih=new fe("F_FLOW"),Qf=class{},Lx=(()=>{let t=class Ma{_state=d(Dl);_fFlow=d(ih);handle(e){this._state.isNodesRendered||(this._state.isNodesRendered=!0,this._fFlow.fNodesRendered.emit(this._fFlow.fId()))}static \u0275fac=function(n){return new(n||Ma)};static \u0275prov=g({token:Ma,factory:Ma.\u0275fac})};return t=C([x(sl)],t),t})(),al=class{static fToken=Symbol("NotifyFullRenderedRequest")},Bx=(()=>{let t=class Da{_state=d(Dl);_fFlow=d(ih);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(n){return new(n||Da)};static \u0275prov=g({token:Da,factory:Da.\u0275fac})};return t=C([x(al)],t),t})(),Vi=class{targetConnectionsRevision;targetNodesRevision;callback;destroyRef;static fToken=Symbol("WaitForConnectionsRenderedRequest");constructor(i,e,n,o){this.targetConnectionsRevision=i,this.targetNodesRevision=e,this.callback=n,this.destroyRef=o}},zx=(()=>{let t=class ka{_store=d(E);handle({targetConnectionsRevision:e,targetNodesRevision:n,callback:o,destroyRef:r}){if(this._store.connectionsRenderedRevision>=e&&this._store.connectionsRenderedNodesRevision>=n){o();return}let s=this._store.connectionsRenderedChanges$.listen(()=>{this._store.connectionsRenderedRevision<e||this._store.connectionsRenderedNodesRevision<n||(s(),o())});r.onDestroy(s)}static \u0275fac=function(n){return new(n||ka)};static \u0275prov=g({token:ka,factory:ka.\u0275fac})};return t=C([x(Vi)],t),t})(),cl=class{static fToken=Symbol("ResetRenderLifecycleRequest")},Vx=(()=>{let t=class Ra{_state=d(Dl);handle(e){this._state.isNodesRendered=!1,this._state.isFullRendered=!1}static \u0275fac=function(n){return new(n||Ra)};static \u0275prov=g({token:Ra,factory:Ra.\u0275fac})};return t=C([x(cl)],t),t})(),dl=class{destroyRef;static fToken=Symbol("QueueConnectionRedrawRequest");constructor(i){this.destroyRef=i}},um=(()=>{class t{isWaitingForViewportAnimation=!1;pendingRedraw=!1;static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})(),Gx=(()=>{let t=class Na{_state=d(um);_store=d(E);_mediator=d(R);handle(e){if(this._state.pendingRedraw=!0,this._state.isWaitingForViewportAnimation)return;this._state.isWaitingForViewportAnimation=!0;let n=this._store.viewportAnimationChanges$.listen(()=>{if(this._store.isViewportAnimating)return;let o=this._state.pendingRedraw;n(),this._state.isWaitingForViewportAnimation=!1,this._state.pendingRedraw=!1,o&&this._mediator.execute(new mi)});e.destroyRef.onDestroy(n)}static \u0275fac=function(n){return new(n||Na)};static \u0275prov=g({token:Na,factory:Na.\u0275fac})};return t=C([x(dl)],t),t})(),Hx=[Dx,kx,...Fx,Ax,Dl,Lx,Bx,zx,Vx,um,Gx],ll=class{static fToken=Symbol("ClearSelectionRequest")},jx=(()=>{let t=class Oa{_dragContext=d(Y);handle(e){this._dragContext.selectedItems.forEach(n=>n.unmarkAsSelected()),this._dragContext.selectedItems=[],this._dragContext.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||Oa)};static \u0275prov=g({token:Oa,factory:Oa.\u0275fac})};return t=C([x(ll)],t),t})(),ul=class{static fToken=Symbol("CalculateSelectableItemsRequest")},Ux=(()=>{let t=class Fa{_mediator=d(R);_store=d(E);_dragContext=d(Y);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 Ee(e.hostElement))}))}_connectionRects(){return this._connections.filter(e=>!e.fSelectionDisabled()).map(e=>({element:e,fRect:this._mediator.execute(new Ee(e.boundingElement))}))}static \u0275fac=function(n){return new(n||Fa)};static \u0275prov=g({token:Fa,factory:Fa.\u0275fac})};return t=C([x(ul)],t),t})(),Gi=class{static fToken=Symbol("GetCurrentSelectionRequest")},$x=(()=>{let t=class Aa{_dragContext=d(Y);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(n){return new(n||Aa)};static \u0275prov=g({token:Aa,factory:Aa.\u0275fac})};return t=C([x(Gi)],t),t})(),fl=class{nodes;connections;isSelectedChanged;static fToken=Symbol("SelectRequest");constructor(i,e,n=!0){this.nodes=i,this.connections=e,this.isSelectedChanged=n}},Wx=(()=>{let t=class La{_dragContext=d(Y);_store=d(E);handle(e){this._dragContext.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragContext.selectedItems=[],e.nodes.forEach(n=>{let o=this._store.nodes.get(n);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),e.connections.forEach(n=>{let o=this._store.connections.get(n);o&&(o.markAsSelected(),this._dragContext.selectedItems.push(o))}),this._dragContext.isSelectedChanged=e.isSelectedChanged}static \u0275fac=function(n){return new(n||La)};static \u0275prov=g({token:La,factory:La.\u0275fac})};return t=C([x(fl)],t),t})(),hl=class{static fToken=Symbol("SelectAllRequest")},qx=(()=>{let t=class Ba{_dragSession=d(Y);_store=d(E);handle(e){this._dragSession.selectedItems.forEach(n=>{n.unmarkAsSelected()}),this._dragSession.selectedItems=[],this._store.nodes.getAll().forEach(n=>{n.markAsSelected(),this._dragSession.selectedItems.push(n)}),this._store.connections.getAll().forEach(n=>{n.markAsSelected(),this._dragSession.selectedItems.push(n)}),this._dragSession.isSelectedChanged=!0}static \u0275fac=function(n){return new(n||Ba)};static \u0275prov=g({token:Ba,factory:Ba.\u0275fac})};return t=C([x(hl)],t),t})(),Gn=class{nodeOrGroup;static fToken=Symbol("SelectAndUpdateNodeLayerRequest");constructor(i){this.nodeOrGroup=i}},pl=class{fItemsContainer;allElements;elementsThatShouldBeInFront;targetIndex;static fToken=Symbol("MoveFrontElementsBeforeTargetElementRequest");constructor(i,e,n,o){this.fItemsContainer=i,this.allElements=e,this.elementsThatShouldBeInFront=n,this.targetIndex=o}},Xx=(()=>{let t=class za{handle(e){let n=[];for(let o=e.targetIndex+1;o<e.allElements.length;o++){let r=e.allElements[o];e.elementsThatShouldBeInFront.includes(r)||n.push(r)}n.forEach(o=>{e.fItemsContainer.removeChild(o),e.fItemsContainer.insertBefore(o,e.allElements[e.targetIndex])})}static \u0275fac=function(n){return new(n||za)};static \u0275prov=g({token:za,factory:za.\u0275fac})};return t=C([x(pl)],t),t})(),ln=class{item;itemContainer;static fToken=Symbol("UpdateItemAndChildrenLayersRequest");constructor(i,e){this.item=i,this.itemContainer=e}},Hn=class{nodeOrGroupId;static fToken=Symbol("GetDeepChildrenNodesAndGroupsRequest");constructor(i){this.nodeOrGroupId=i}},Kx=(()=>{let t=class Va{_store=d(E);handle({nodeOrGroupId:e}){return this._getChildrenNodes(e)}_getChildrenNodes(e,n=new Set){if(n.has(e))throw new Error("Circular reference detected in the node hierarchy. Node id: "+e);n.add(e);let o=this._store.nodes.getAll().filter(r=>r.fParentId()===e);return o.reduce((r,s)=>r.concat(this._getChildrenNodes(s.fId(),n)),o)}static \u0275fac=function(n){return new(n||Va)};static \u0275prov=g({token:Va,factory:Va.\u0275fac})};return t=C([x(Hn)],t),t})(),Yx=(()=>{let t=class Ga{_store=d(E);_mediator=d(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 n=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenGroups(n);this._updateLayers(this._groupsContainer,e.item.hostElement,o);let r=this._getChildrenNodes(n);r.length&&this._updateLayers(this._nodesContainer,r[0],r)}_handleNode(e){let n=this._getChildrenNodesAndGroups(e.item.fId()),o=this._getChildrenNodes(n);this._updateLayers(e.itemContainer,e.item.hostElement,o)}_handleConnection(e){this._updateLayers(e.itemContainer,e.item.hostElement,[])}_updateLayers(e,n,o){let r=Array.from(e.children),s=r.findIndex(a=>a===n);this._isAnythingNeedToBeMoved(r,s,o)&&this._mediator.execute(new pl(e,r,o,s))}_isAnythingNeedToBeMoved(e,n,o){for(let r=n+1;r<e.length;r++)if(!o.includes(e[r]))return!0;return!1}_getChildrenGroups(e){let n=Array.from(this._groupsContainer.children);return e.filter(o=>this._groupsContainer.contains(o)).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodes(e){let n=Array.from(this._nodesContainer.children);return e.filter(o=>this._nodesContainer.contains(o)).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodesAndGroups(e){return this._mediator.execute(new Hn(e)).map(n=>n.hostElement)}static \u0275fac=function(n){return new(n||Ga)};static \u0275prov=g({token:Ga,factory:Ga.\u0275fac})};return t=C([x(ln)],t),t})(),Zx=(()=>{let t=class Ha{_dragSession=d(Y);_mediator=d(R);handle({nodeOrGroup:e}){this._selectNodeIfNotSelected(e),this._mediator.execute(new ln(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(n){return new(n||Ha)};static \u0275prov=g({token:Ha,factory:Ha.\u0275fac})};return t=C([x(Gn)],t),t})(),Qx=[jx,Ux,$x,Wx,qx,Zx],ml=class{static fToken=Symbol("ResetZoomRequest")},Jx=(()=>{let t=class ja{_store=d(E);get _canvas(){return this._store.fCanvas}handle(e){this._canvas.resetScale(),this._canvas.redraw(),this._canvas.emitCanvasChangeEvent()}static \u0275fac=function(n){return new(n||ja)};static \u0275prov=g({token:ja,factory:ja.\u0275fac})};return t=C([x(ml)],t),t})(),_l=class{position;step;direction;animate;static fToken=Symbol("SetZoomRequest");constructor(i,e,n,o=!1){this.position=i,this.step=e,this.direction=n,this.animate=o}},eb=new Set(["drag-node","drag-external-item","resize-node","rotate-node","create-connection","reassign-connection","drag-connection-waypoint","assign-to-container"]),tb=new Set(["drag-canvas","selection-area"]),nb=(()=>{let t=class Ua{_mediator=d(R);_store=d(E);_dragContext=d(Y,{optional:!0});get _flowHost(){return this._store.flowHost}get _canvas(){return this._store.fCanvas}get _zoomComponent(){return this._store.instances.get(ye.ZOOM)}get _isDragStarted(){return this._mediator.execute(new jt)}handle(e){if(!this._zoomComponent)return;let n=this._canvas.transform.scale,o=this._clamp(n+e.step*e.direction);if(o===n)return;let r=this._castPositionToFlow(e.position);if(this._isDragStarted){let s=this._getDragZoomMode();if(s==="blocked")return;s==="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 X.fromPoint(e).elementTransform(this._flowHost)}_getDragZoomMode(){if(this._dragContext?.isEmpty())return"blocked";let e=!1;for(let n of this._dragContext?.draggableItems??[]){let o=n.getEvent().kind;if(eb.has(o)){e=!0;continue}if(!tb.has(o))return"blocked"}return e?"rebase":"direct"}_rebaseDragContext(e,n){if(!this._dragContext)return;let o=this._dragContext.onPointerDownScale;if(!o||o===n){this._dragContext.onPointerDownScale=n;return}let r=1/n-1/o;this._dragContext.onPointerDownPosition=X.fromPoint(this._dragContext.onPointerDownPosition).add(X.fromPoint(e).mult(r)),this._dragContext.onPointerDownScale=n}static \u0275fac=function(n){return new(n||Ua)};static \u0275prov=g({token:Ua,factory:Ua.\u0275fac})};return t=C([x(_l)],t),t})(),ib=[Jx,nb],gl=class{static fToken=Symbol("MinimapDrawNodesRequest")},ob=(()=>{let t=class $a{_browser=d(Re);_store=d(E);handle(e){let n=this._store.fFlow,o=this._store.fCanvas;return!n||!o?[]:this._store.nodes.getAll().map(s=>this._renderNode(s,n,o))}_renderNode(e,n,o){let r=Pn("rect",this._browser);wu(this._nodeRect(e,n,o),r);let s=e instanceof Ml;return r.classList.add("f-component",s?"f-minimap-node":"f-minimap-group"),r.classList.add(...this._minimapClasses(e)),e.isSelected()&&r.classList.add("f-selected"),r}_nodeRect(e,n,o){let r=G.elementTransform(G.fromElement(e.hostElement),n.hostElement);return G.div(r,o.transform.scale)}_minimapClasses(e){let n=e.fMinimapClass();return Array.isArray(n)?n:[n]}static \u0275fac=function(n){return new(n||$a)};static \u0275prov=g({token:$a,factory:$a.\u0275fac})};return t=C([x(gl)],t),t})(),yl=class{svg;minSize;static fToken=Symbol("MinimapCalculateViewportRequest");constructor(i,e){this.svg=i,this.minSize=e}},rb=(()=>{let t=class Wa{_mediator=d(R);_store=d(E);handle({svg:e,minSize:n}){let o=this._store.fFlow,r=this._store.fCanvas;if(!o||!r)return{scale:1,viewBox:G.initialize(0,0,0,0)};let s=this._contentRectInMinimapSpace(o,r,n),a=this._minimapRectInFlowSpace(e,o),l=this._viewportScale(s,a),h=this._viewportViewBox(s,a,l);return{scale:l,viewBox:h}}_contentRectInMinimapSpace(e,n,o){let r=this._nodesBoundingBox(),s=G.elementTransform(r,e.hostElement),a=G.div(s,n.transform.scale);return qh(a,o)}_nodesBoundingBox(){return this._mediator.execute(new Ln)??G.initialize(0,0,0,0)}_minimapRectInFlowSpace(e,n){return G.elementTransform(G.fromElement(e),n.hostElement)}_viewportScale(e,n){let o=n.width||1,r=n.height||1;return Math.max(e.width/o,e.height/r)}_viewportViewBox(e,n,o){let r=this._viewportSize(n,o),s=e.x-(r.width-e.width)/2,a=e.y-(r.height-e.height)/2;return G.initialize(s,a,r.width,r.height)}_viewportSize(e,n){return ht.initialize(e.width*n||0,e.height*n||0)}static \u0275fac=function(n){return new(n||Wa)};static \u0275prov=g({token:Wa,factory:Wa.\u0275fac})};return t=C([x(yl)],t),t})(),vl=class{static fToken=Symbol("MinimapCalculateViewRectRequest")},sb=(()=>{let t=class qa{_store=d(E);handle(e){let n=this._store.fFlow,o=this._store.fCanvas;if(!n||!o)return G.initialize();let r=G.div(G.fromElement(n.hostElement),o.transform.scale);return r.x=0,r.y=0,r}static \u0275fac=function(n){return new(n||qa)};static \u0275prov=g({token:qa,factory:qa.\u0275fac})};return t=C([x(vl)],t),t})(),Cl=class{element;scale;viewBox;constructor(i,e=1,n=G.initialize(0,0,0,0)){this.element=i,this.scale=e,this.viewBox=n}},ab=[ob,rb,sb],xl=class{position;static fToken=Symbol("GetNormalizedPointRequest");constructor(i){this.position=i}},cb=(()=>{let t=class Xa{_store=d(E);handle({position:e}){return Un(e,this._store.flowHost,this._store.transform)}static \u0275fac=function(n){return new(n||Xa)};static \u0275prov=g({token:Xa,factory:Xa.\u0275fac})};return t=C([x(xl)],t),t})(),bl=class{static fToken=Symbol("SortNodeLayersRequest")},db=(()=>{let t=class Ka{_store=d(E);_mediator=d(R);_browser=d(Re);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(n=>{this._moveChildrenNodes(this._getSortedChildrenNodes(n))})}_getGroups(){return this._store.nodes.getAll().filter(e=>this._groupsContainer.contains(e.hostElement))}_getSortedChildrenNodes(e){let n=this._fNodeElements;return this._getChildrenNodes(e.fId()).sort((o,r)=>n.indexOf(o)-n.indexOf(r))}_getChildrenNodes(e){return this._mediator.execute(new Hn(e)).filter(n=>this._nodesContainer.contains(n.hostElement)).map(n=>n.hostElement)}_moveChildrenNodes(e){let n=this._browser.document.createDocumentFragment();e.forEach(o=>{n.appendChild(o)}),this._nodesContainer.appendChild(n)}static \u0275fac=function(n){return new(n||Ka)};static \u0275prov=g({token:Ka,factory:Ka.\u0275fac})};return t=C([x(bl)],t),t})(),Hi=class{itemsContainer;static fToken=Symbol("SortItemsByParentRequest");constructor(i){this.itemsContainer=i}},lb=(()=>{let t=class Ya{_store=d(E);_browser=d(Re);handle({itemsContainer:e}){let n=Array.from(e.children);if(n.length<2)return;let o=this._buildPositions(n),r=this._store.nodes.getAll().filter(l=>e.contains(l.hostElement));if(r.length<2||!r.some(l=>!!l.fParentId()))return;let s=this._buildChildrenByParentId(r),a=new Map;for(let l of r){let h=this._getSortedChildrenBeforeParent(e,o,l,s,a);h.length&&this._moveBeforeNextSibling(e,h,l.hostElement.nextElementSibling)}}_buildPositions(e){let n=new Map;for(let o=0;o<e.length;o++)n.set(e[o],o);return n}_getSortedChildrenBeforeParent(e,n,o,r,s){let a=n.get(o.hostElement);if(a===void 0)return[];let l=this._getDeepChildren(o.fId(),r,s);if(!l.length)return[];let h=[];for(let _ of l){let v=_.hostElement;if(!e.contains(v))continue;let b=n.get(v);b===void 0||b>=a||h.push(v)}return h.sort((_,v)=>(n.get(_)??0)-(n.get(v)??0)),h}_buildChildrenByParentId(e){let n=new Map;for(let o of e){let r=o.fParentId();if(!r)continue;let s=n.get(r)??[];s.push(o),n.set(r,s)}return n}_getDeepChildren(e,n,o){let r=o.get(e);if(r)return r;let s=[],a=[...n.get(e)??[]],l=new Set([e]);for(;a.length;){let h=a.pop();if(!h)continue;let _=h.fId();if(l.has(_))continue;l.add(_),s.push(h);let v=n.get(_);v?.length&&a.push(...v)}return o.set(e,s),s}_moveBeforeNextSibling(e,n,o){let r=this._browser.document.createDocumentFragment();for(let s of n)r.appendChild(s);e.insertBefore(r,o)}static \u0275fac=function(n){return new(n||Ya)};static \u0275prov=g({token:Ya,factory:Ya.\u0275fac})};return t=C([x(Hi)],t),t})(),wl=class{static fToken=Symbol("SortItemLayersRequest")},ub=(()=>{let t=class Za{_store=d(E);_mediator=d(R);get _canvas(){return this._store.fCanvas}handle(e){if(!this._canvas)return;let n=this._store.nodes.getAll();n.length<2||!n.some(o=>!!o.fParentId())||(this._mediator.execute(new Hi(this._canvas.fGroupsContainer().nativeElement)),this._mediator.execute(new bl),this._mediator.execute(new Hi(this._canvas.fNodesContainer().nativeElement)))}static \u0275fac=function(n){return new(n||Za)};static \u0275prov=g({token:Za,factory:Za.\u0275fac})};return t=C([x(wl)],t),t})();function Pn(t,i){return i.document.createElementNS("http://www.w3.org/2000/svg",t)}function dt(t,i){return i(t)}function pt(t){return!0}function fb(){return/android|iPad|iPhone|iPod/i.test(navigator.userAgent||navigator.vendor||window.opera)}var hb=[...Ng,...HC,...bg,...Ex,...cx,...Hx,...xx,...Qx,...ib,...ab,...q0,Kx,X0,Q0,cb,ub,lb,db,Yx,Xx],pb=0,fm=(()=>{class t{_destroyRef=d(Ze);_elementReference=d(Se);_fBrowser=d(Re);_stateChanges=new ct;get hostElement(){return this._elementReference.nativeElement}id=F(`f-pattern-${pb++}`);vColor=F("rgba(0,0,0,0.1)");hColor=F("rgba(0,0,0,0.1)");vSize=F(20,{transform:We});hSize=F(20,{transform:We});_transform=kt.default();_position=L.initialize();_size=ht.initialize(this.hSize(),this.vSize());_pattern;_vLine;_hLine;constructor(){this._createPattern()}_createPattern(){this._pattern=Pn("pattern",this._fBrowser),this._pattern.setAttribute("patternUnits","userSpaceOnUse"),this.hostElement.appendChild(this._pattern),this._vLine=Pn("line",this._fBrowser),this._pattern.appendChild(this._vLine),this._hLine=Pn("line",this._fBrowser),this._pattern.appendChild(this._hLine)}ngOnInit(){this._listenStateChanges()}_listenStateChanges(){new vt(this._stateChanges).pipe(Sl()).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=ht.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,n,o,r,s,a){e.setAttribute("stroke",`${n}`),e.setAttribute("x1",`${o}`),e.setAttribute("x2",`${s}`),e.setAttribute("y1",`${r}`),e.setAttribute("y2",`${a}`)}setTransform(e){this._transform=e,this._refresh()}_refresh(){this._stateChanges.notify()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=te({type:t,selectors:[["f-rect-pattern"]],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.id)},inputs:{id:[1,"id"],vColor:[1,"vColor"],hColor:[1,"hColor"],vSize:[1,"vSize"],hSize:[1,"hSize"]},features:[Ie([{provide:Fu,useExisting:t}]),mn],decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})();var mb=new fe("F_BACKGROUND"),_b=(()=>{class t{hostElement=d(Se).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,standalone:!1})}return t})(),hm=(()=>{class t extends _b{_mediator=d(R);fBackgroundPattern=lo(Fu);ngOnInit(){this._mediator.execute(new Lt(ye.BACKGROUND,this))}ngAfterContentInit(){this._mediator.execute(new Qa(this.fBackgroundPattern()))}setTransform(e){this.fBackgroundPattern()?.setTransform(e)}ngOnDestroy(){this._mediator.execute(new Bt(ye.BACKGROUND))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-background"]],contentQueries:function(n,o,r){n&1&&vu(r,o.fBackgroundPattern,Fu,5),n&2&&it()},hostAttrs:[1,"f-component","f-background"],features:[Ie([{provide:mb,useExisting:t}]),_e],ngContentSelectors:K_,decls:2,vars:0,template:function(n,o){n&1&&(Xt(),$e(),H(0,"svg"),De(1),$())},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 Jf=class{position;scale;constructor(i,e){this.position=i,this.scale=e}},gb=new fe("F_CANVAS"),yb=(()=>{class t{transform=kt.default();_fCanvasChange=new ct;destroyRef=d(Ze);getPosition(){return this.transform.position}setPosition(e){this.transform.position=e}emitCanvasChangeEvent(){this._fCanvasChange.notify()}subscribeOnCanvasChange(){new vt(this._fCanvasChange).pipe(Ja(this.debounce())).listen(this.destroyRef,()=>{this.fCanvasChange.emit(new Jf(L.sum(this.transform.position,this.transform.scaledPosition),this.transform.scale))})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,standalone:!1})}return t})(),ji=(()=>{class t extends yb{_mediator=d(R);_componentsStore=d(E);_elementReference=d(Se);_injector=d(Ye);_flowId;fCanvasChange=He();position=F(L.initialize(),{transform:L.castToPoint});scale=F(1,{transform:We});debounceTime=F(0,{transform:We});debounce=P(()=>this.debounceTime()<0?0:this.debounceTime());get hostElement(){return this._elementReference.nativeElement}fGroupsContainer=Te.required("fGroupsContainer");fNodesContainer=Te.required("fNodesContainer");fConnectionsContainer=Te.required("fConnectionsContainer");get flowId(){return this._flowId||""}ngOnInit(){this._flowId=this._mediator.execute(new nl).fId(),this._mediator.execute(new tc(this)),this._positionChange(),this._scaleChange(),super.subscribeOnCanvasChange()}_positionChange(){me(()=>{this._mediator.execute(new oc(this.transform,this.position()))},{injector:this._injector})}_scaleChange(){me(()=>{this._mediator.execute(new rc(this.transform,this.scale()))},{injector:this._injector})}redraw(){this._mediator.execute(new ai(this.transform)),this.hostElement.style.removeProperty("transition"),this.hostElement.style.transform=kt.toString(this.transform),this._mediator.execute(new At)}redrawWithAnimation(){this._mediator.execute(new ai(this.transform)),this.hostElement.style.transition=`transform ${fb()?80:150}ms ease-in-out`,this.hostElement.style.transform=kt.toString(this.transform),Ep(this.hostElement,()=>this.redraw())}centerGroupOrNode(e,n=!0){this._afterRedraw(()=>{this._mediator.execute(new nc(e,n))})}fitToScreen(e=L.initialize(),n=!0){this._afterRedraw(()=>{this._mediator.execute(new ic(e,n))})}resetScaleAndCenter(e=!0){this._afterRedraw(()=>{this._mediator.execute(new cc(e))})}getScale(){return this.transform.scale||1}setScale(e,n=L.initialize()){this._mediator.execute(new dc(e,n))}resetScale(){this._mediator.execute(new ac)}ngOnDestroy(){this._mediator.execute(new sc)}_afterRedraw(e){this._mediator.execute(new Vi(this._componentsStore.connectionsRevision,this._componentsStore.nodesRevision,()=>Sh(e,{injector:this._injector}),this.destroyRef))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-canvas"]],viewQuery:function(n,o){n&1&&ft(o.fGroupsContainer,Y_,5)(o.fNodesContainer,Z_,5)(o.fConnectionsContainer,Q_,5),n&2&&it(3)},hostAttrs:[1,"f-component","f-canvas"],inputs:{position:[1,"position"],scale:[1,"scale"],debounceTime:[1,"debounceTime"]},outputs:{fCanvasChange:"fCanvasChange"},features:[Ie([{provide:gb,useExisting:t}]),_e],ngContentSelectors:eg,decls:12,vars:0,consts:[["fGroupsContainer",""],["fConnectionsContainer",""],["fNodesContainer",""],[1,"f-connections-container"]],template:function(n,o){n&1&&(Xt(J_),ao(0),H(1,"div",null,0),De(3),$(),H(4,"div",3,1),De(6,1),De(7,2),De(8,3),$(),H(9,"div",null,2),De(11,4),$(),co())},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 vb=0,pm=(()=>{class t extends M0{fId=F(`f-connection-${vb++}`,{alias:"fConnectionId"});fOutputId=F("",{transform:e=>On(e)||""});fInputId=F("",{transform:e=>On(e)||""});fRadius=8;fOffset=12;fBehavior=Ot.FIXED;fType=Nt.STRAIGHT;fSelectionDisabled=F(!1,{transform:xe});fReassignableStart=F(!1,{transform:xe});fDraggingDisabled=F(!1,{alias:"fReassignDisabled",transform:xe});fInputSide=F(qe.DEFAULT,{transform:e=>In(e,"fInputSide",qe)});fOutputSide=F(qe.DEFAULT,{transform:e=>In(e,"fOutputSide",qe)});get boundingElement(){return this.fPath().hostElement}_mediator=d(R);ngOnInit(){this._mediator.execute(new lc(this))}ngOnChanges(){this._mediator.execute(new tn)}ngOnDestroy(){this._mediator.execute(new Nc(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-connection"]],hostAttrs:[1,"f-component","f-connection"],hostVars:5,hostBindings:function(n,o){n&2&&(Z("id",o.fId()),de("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",We],fOffset:[2,"fOffset","fOffset",We],fBehavior:[2,"fBehavior","fBehavior",e=>In(e,"fBehavior",Ot)],fType:"fType",fSelectionDisabled:[1,"fSelectionDisabled"],fReassignableStart:[1,"fReassignableStart"],fDraggingDisabled:[1,"fReassignDisabled","fDraggingDisabled"],fInputSide:[1,"fInputSide"],fOutputSide:[1,"fOutputSide"]},exportAs:["fComponent"],standalone:!1,features:[Ie([{provide:Il,useExisting:t}]),_e,mn],ngContentSelectors:ng,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(n,o){if(n&1&&(Xt(tg),$e(),u(0,"svg",1),A(1,"defs",null,0),De(3),u(4,"g",2),w(5,ig,1,1,":svg:linearGradient",3),A(6,"path",4),u(7,"g"),A(8,"path",5),w(9,og,1,0,":svg:circle",6),A(10,"circle",7),f()()(),De(11,1),De(12,2),De(13,3),w(14,rg,1,0)),n&2){let r;c(5),S((r=o.fGradient())?5:-1,r),c(),Z("d",o.path),c(2),T("useGradient",!!o.fGradient()),Z("d",o.path),c(),S(o.fReassignableStart()?9:-1),c(5),S(o.fContents().length?14:-1)}},dependencies:[ef,I0,T0,v0,S0],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 Cb=new fe("F_MAGNETIC_LINES"),xb=(()=>{class t{hostElement=d(Se).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,standalone:!1})}return t})();var mm=(()=>{class t extends xb{threshold=F(10,{transform:We,alias:"fAlignThreshold"});_mediator=d(R);ngOnInit(){this._mediator.execute(new Lt(ye.MAGNETIC_LINES,this))}ngOnDestroy(){this._mediator.execute(new Bt(ye.MAGNETIC_LINES))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-line-alignment"]],hostAttrs:[1,"f-line-alignment","f-component"],inputs:{threshold:[1,"fAlignThreshold","threshold"]},exportAs:["fComponent"],standalone:!1,features:[Ie([{provide:Cb,useExisting:t}]),_e],decls:0,vars:0,template:function(n,o){},styles:[sg]})}return t})();var Ru=(()=>{class t{fMinSize=F(1e3);_mediator=d(R);hostElement=d(Se).nativeElement;model=new Cl(this.hostElement);redraw(){let{scale:e,viewBox:n}=this._mediator.execute(new yl(this.hostElement,this.fMinSize()));this.model=new Cl(this.hostElement,e,n),Xh(n,this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,selectors:[["svg","fMinimapFlow",""]],inputs:{fMinSize:[1,"fMinSize"]}})}return t})(),Nu=(()=>{class t{_mediator=d(R);_elementRef=d(Se);hostElement=this._elementRef.nativeElement;redraw(){this.clear();let e=this._elementRef.nativeElement.ownerDocument.createDocumentFragment();this._mediator.execute(new gl).forEach(n=>{e.appendChild(n)}),this.hostElement.appendChild(e)}clear(){this.hostElement.replaceChildren()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,selectors:[["g","fMinimapCanvas",""]]})}return t})(),Ou=(()=>{class t{_mediator=d(R);hostElement=d(Se).nativeElement;redraw(){wu(this._mediator.execute(new vl),this.hostElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,selectors:[["rect","fMinimapView",""]],hostAttrs:[1,"f-component","f-minimap-view"]})}return t})(),bb=new fe("F_MINIMAP_BASE"),wb=(()=>{class t{hostElement=d(Se).nativeElement;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,standalone:!1})}return t})(),_m=(()=>{class t extends wb{_destroyRef=d(Ze);_mediator=d(R);_browser=d(Re);_store=d(E);_canvas=Te.required(Nu);_flow=Te.required(Ru);_minimapView=Te.required(Ou);fMinSize=F(1e3);fNodeRenderLimit=F(1500,{transform:We});get state(){return this._flow().model}ngOnInit(){this._mediator.execute(new Lt(ye.MINIMAP,this))}ngAfterViewInit(){this._listenTransformChanges()}_listenTransformChanges(){this._mediator.execute(new ec).pipe(Sl(),lg()).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 Bt(ye.MINIMAP))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-minimap"]],viewQuery:function(n,o){n&1&&ft(o._canvas,Nu,5)(o._flow,Ru,5)(o._minimapView,Ou,5),n&2&&it(3)},hostAttrs:[1,"f-component","f-minimap"],inputs:{fMinSize:[1,"fMinSize"],fNodeRenderLimit:[1,"fNodeRenderLimit"]},exportAs:["fComponent"],features:[Ie([{provide:bb,useExisting:t}]),_e],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(n,o){n&1&&($e(),u(0,"svg",0),A(1,"g",1)(2,"rect",2),f()),n&2&&T("fMinSize",o.fMinSize())},dependencies:[Ru,Nu,Ou],styles:["[_nghost-%COMP%]{display:block;position:absolute}[_nghost-%COMP%] svg[_ngcontent-%COMP%]{overflow:hidden}"],changeDetection:0})}return t})();var Sb=(()=>{class t{hostElement=d(Se).nativeElement;initialize(){this.hostElement.style.display="none"}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Pe({type:t,standalone:!1})}return t})(),gm=(()=>{class t extends Sb{_mediator=d(R);fTrigger=e=>e.shiftKey;ngOnInit(){this._mediator.execute(new Lt(ye.SELECTION_AREA,this)),super.initialize()}ngOnDestroy(){this._mediator.execute(new Bt(ye.SELECTION_AREA))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-selection-area"]],hostAttrs:[1,"f-selection-area","f-component"],inputs:{fTrigger:"fTrigger"},features:[_e],decls:0,vars:0,template:function(n,o){},styles:["[_nghost-%COMP%]{position:absolute}"]})}return t})();var Ib=0,Tb=120,Ui=(()=>{class t extends Qf{_destroyRef=d(Ze);_mediator=d(R);_browser=d(Re);_componentsStore=d(E);_cache=d(Ct);_injector=d(Ye);fId=F(`f-flow-${Ib++}`,{alias:"fFlowId"});fCache=F(!1,{transform:xe});hostElement=d(Se).nativeElement;fNodesRendered=He();fFullRendered=He();fLoaded=He();ngOnInit(){this._mediator.execute(new tl(this)),this._listenCacheChanges()}ngAfterContentInit(){this._browser.isBrowser()&&(this._listenNodesChanges(),this._listenConnectionsChanges())}_listenCacheChanges(){me(()=>{this._cache.enabled=this.fCache()},{injector:this._injector})}_listenNodesChanges(){new vt(this._componentsStore.nodesChanges$,this._componentsStore.progressiveRenderChanges$).pipe(Sl(),Ja(Tb),dg()).listen(this._destroyRef,()=>{this._mediator.execute(new jt)||this._componentsStore.hasPendingProgressiveRender||(this._mediator.execute(new wl),this._mediator.execute(new sl),this._mediator.execute(new Vi(this._componentsStore.connectionsRevision+1,this._componentsStore.nodesRevision,()=>this._mediator.execute(new al),this._destroyRef)),this._mediator.execute(new tn))})}_listenConnectionsChanges(){this._mediator.execute(new Tn).listen(this._destroyRef,()=>{if(!this._mediator.execute(new jt)){if(this._componentsStore.isViewportAnimating){this._mediator.execute(new dl(this._destroyRef));return}this._mediator.execute(new mi)}})}redraw(){this._mediator.execute(new tn)}reset(){this._mediator.execute(new cl)}getNodesBoundingBox(){return this._mediator.execute(new Zd)}getSelection(){return this._mediator.execute(new Gi)}getPositionInFlow(e){return this._mediator.execute(new xl(e))}getState(e){return this._mediator.execute(new ol(e?.measuredSize??!1))}selectAll(){this._mediator.execute(new Tn).pipe(ep()).listen(this._destroyRef,()=>{this._mediator.execute(new hl)})}select(e,n,o=!0){this._mediator.execute(new Tn).pipe(ep()).listen(this._destroyRef,()=>{this._mediator.execute(new fl(e,n,o))})}clearSelection(){this._mediator.execute(new ll)}ngOnDestroy(){this._mediator.execute(new rl(this))}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["f-flow"]],hostAttrs:[1,"f-component","f-flow"],hostVars:1,hostBindings:function(n,o){n&2&&Z("id",o.fId())},inputs:{fId:[1,"fFlowId","fId"],fCache:[1,"fCache"]},outputs:{fNodesRendered:"fNodesRendered",fFullRendered:"fFullRendered",fLoaded:"fLoaded"},features:[Ie([R,...yg,Lp,jn,...hb,Y,...zC,{provide:ih,useExisting:t}]),_e],ngContentSelectors:cg,decls:7,vars:0,template:function(n,o){n&1&&(Xt(ag),ao(0),De(1),De(2,1),De(3,2),De(4,3),De(5,4),De(6,5),co())},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 ym=(()=>{class t{fVirtualForOf=[];fVirtualForTrackBy;_vc=d(ro);_tpl=d(Ih);_zone=d(Qn);_componentsStore=d(E,{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 n=0;this._startProgressiveRender(),this._zone.runOutsideAngular(()=>{let o=()=>{let r=performance.now();for(;n<this.fVirtualForOf.length&&performance.now()-r<10;){let s=this.fVirtualForOf[n],a=this._vc.createEmbeddedView(this._tpl,{$implicit:s,index:n});this._views.push(a),n++}if(n<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(n){return new(n||t)};static \u0275dir=Pe({type:t,selectors:[["","fVirtualFor","","fVirtualForOf",""]],inputs:{fVirtualForOf:"fVirtualForOf",fVirtualForTrackBy:"fVirtualForTrackBy"},features:[mn]})}return t})();var Tt=(function(t){return t[t.ZOOM_IN=1]="ZOOM_IN",t[t.ZOOM_OUT=-1]="ZOOM_OUT",t})(Tt||{}),Eb=new fe("F_ZOOM"),eh=class{},Pb=.1,Mb=1,Db=.5,kb=60,Rb=.5;function Nb(t){return Math.abs(t.deltaY)>=Math.abs(t.deltaX)?t.deltaY:t.deltaX}function Ob(t,i,e){return Fb(t)?Lb(i,e):Ab(i,e)}function Fb(t){return(t.ctrlKey||t.metaKey)&&t.deltaMode===WheelEvent.DOM_DELTA_PIXEL}function Ab(t,i){let e=Math.abs(t)/100,n=vm(e,Pb,Mb);return i*n}function Lb(t,i){if(Math.abs(t)<Db)return 0;let e=Math.abs(t)/kb,n=vm(e,0,Rb);return i*n}function vm(t,i,e){return Math.max(i,Math.min(e,t))}var $i=(()=>{class t extends eh{_mediator=d(R);_injector=d(Ye);_store=d(E);_triggersListener=he.emptyListener();isEnabled=F(!1,{alias:"fZoom",transform:xe});fWheelTrigger=pt;fDblClickTrigger=pt;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 Lt(ye.ZOOM,this))}ngAfterViewInit(){this._listenZoomEnabledChanges()}_listenZoomEnabledChanges(){me(()=>{this.isEnabled(),gt(()=>this._listenTriggers())},{injector:this._injector})}_listenTriggers(){this._flowHost&&(this._disposeListeners(),this.isEnabled()&&(this._listen("wheel",this._onWheel,he.activeListener()),this._listen("dblclick",this._onDoubleClick),this._triggersListener=()=>{this._unlisten("wheel",this._onWheel,he.activeListener()),this._unlisten("dblclick",this._onDoubleClick)}))}_onWheel=e=>{if(!dt(e,this.fWheelTrigger)||(e.preventDefault(),e.target?.closest("[fLockedContext]")))return;let o=Nb(e);if(o===0)return;let r=this._normalizeWheelStep(e,o);r!==0&&this.setZoom(L.initialize(e.clientX,e.clientY),r,this._calculateDirection(o),!1)};_normalizeWheelStep(e,n){return Ob(e,n,this.step)}_calculateDirection(e){return e>0?Tt.ZOOM_OUT:Tt.ZOOM_IN}_onDoubleClick=e=>{if(!dt(e,this.fDblClickTrigger))return;e.preventDefault();let n=e.target;Jy(n)||n?.closest("[fLockedContext]")||this.setZoom(L.initialize(e.clientX,e.clientY),this.dblClickStep,Tt.ZOOM_IN,!0)};_getToCenterPosition(e,n){return L.initialize(e?.x||n.gravityCenter.x,e?.y||n.gravityCenter.y)}zoomIn(e){this._onZoomToCenter(Tt.ZOOM_IN,e)}zoomOut(e){this._onZoomToCenter(Tt.ZOOM_OUT,e)}_onZoomToCenter(e,n){this.setZoom(this._getToCenterPosition(n,G.fromElement(this._flowHost)),this.step,e,!1)}setZoom(e,n,o,r){this._mediator.execute(new _l(e,n,o,r))}getZoomValue(){return this._canvas.transform.scale||1}reset(){this._mediator.execute(new ml)}_disposeListeners(){this._triggersListener(),this._triggersListener=he.emptyListener()}ngOnDestroy(){this._disposeListeners(),this._mediator.execute(new Bt(ye.ZOOM))}_listen(e,n,o){this._flowHost.addEventListener(e,n,o)}_unlisten(e,n,o){this._flowHost.removeEventListener(e,n,o)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275dir=Pe({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",We],maximum:[2,"fZoomMaximum","maximum",We],step:[2,"fZoomStep","step",We],dblClickStep:[2,"fZoomDblClickStep","dblClickStep",We]},features:[Ie([{provide:Eb,useExisting:t}]),_e]})}return t})();var Cm=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=so({type:t});static \u0275inj=no({imports:[uo]})}return t})();var oh={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)"},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 kl={graph:{perf:{cache:!0,virtualization:!1},perfHud:!0}};var xm={a11y:{toolbarLabel:"Toggle node kinds"},favorites:{label:"Favorites"}};function zb(t,i){if(t&1&&Pt(0,"i",4),t&2){let e=p();Ce(e.piClass()),at("font-size",e.size(),"px")}}function Vb(t,i){if(t&1&&($e(),H(0,"svg",1),Pt(1,"path"),$()),t&2){let e=p();Z("width",e.size())("height",e.size()),c(),Z("d",e.svgPath())}}function Gb(t,i){if(t&1&&(H(0,"span",4),m(1),$()),t&2){let e=p();at("font-size",e.size(),"px")("line-height",e.size(),"px"),c(),y(e.emoji())}}function Hb(t,i){if(t&1&&(H(0,"span",5),m(1),$()),t&2){let e=p();at("font-size",e.size(),"px")("line-height",e.size(),"px"),c(),y(e.letter())}}var Ut=class t{kindRegistry=d(Dt);kind=F.required();size=F(18);variant=P(()=>{let i=this.kindRegistry.lookup(this.kind());return i?.icon?.kind==="pi"?"pi":i?.icon?.kind==="svg"?"svg":i?.emoji?"emoji":"letter"});piClass=P(()=>{let i=this.kindRegistry.lookup(this.kind())?.icon;return i?.kind==="pi"?`pi ${i.id}`:""});svgPath=P(()=>{let i=this.kindRegistry.lookup(this.kind())?.icon;return i?.kind==="svg"?i.path:""});emoji=P(()=>this.kindRegistry.lookup(this.kind())?.emoji??"");letter=P(()=>this.kindRegistry.labelOf(this.kind()).charAt(0).toUpperCase());static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["sm-kind-icon"]],inputs:{kind:[1,"kind"],size:[1,"size"]},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,n){if(e&1&&w(0,zb,1,4,"i",0)(1,Vb,2,3,":svg:svg",1)(2,Gb,2,5,"span",2)(3,Hb,2,5,"span",3),e&2){let o;S((o=n.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 $b=(t,i)=>i.kind;function Wb(t,i){if(t&1&&(A(0,"sm-kind-icon",5),u(1,"span"),m(2),f()),t&2){let e=p().$implicit;T("kind",e.kind)("size",16),c(2),y(e.count)}}function qb(t,i){if(t&1){let e=ae();u(0,"p-togglebutton",4),K("ngModelChange",function(){let o=j(e).$implicit,r=p();return U(r.toggle(o.kind))}),Me(1,Wb,3,3,"ng-template",null,0,ei),f()}if(t&2){let e=i.$implicit,n=p();T("ngModel",n.isActive(e.kind))("pTooltip",e.label)("ariaLabel",e.label)("styleClass","kind-palette__btn kind-palette__btn--"+e.kind),Z("data-testid","kind-palette-"+e.kind)}}function Xb(t,i){if(t&1&&(A(0,"i",7),u(1,"span"),m(2),f()),t&2){let e=p(2);Ce(e.favoritesActive()?"pi pi-heart-fill":"pi pi-heart"),c(2),y(e.favoritesCount())}}function Kb(t,i){if(t&1){let e=ae();u(0,"p-togglebutton",6),K("ngModelChange",function(){j(e);let o=p();return U(o.toggleFavoritesOnly())}),Me(1,Xb,3,3,"ng-template",null,0,ei),f()}if(t&2){let e=p();T("ngModel",e.favoritesActive())("pTooltip",e.texts.favorites.label)("ariaLabel",e.texts.favorites.label)}}var Rl=class t{loader=d(Mt);filters=d(vo);kindRegistry=d(Dt);texts=xm;entries=P(()=>{let i=new Map;for(let e of this.loader.nodes())i.set(e.kind,(i.get(e.kind)??0)+1);return this.kindRegistry.kinds().map(e=>({kind:e.name,label:e.label,count:i.get(e.name)??0}))});favoritesCount=P(()=>this.loader.nodes().filter(i=>i.isFavorite===!0).length);showFavorites=P(()=>this.loader.hasAnyFavorites()||this.filters.favoritesOnly());favoritesActive=P(()=>this.filters.favoritesOnly());isActive(i){return this.filters.isKindActive(i)}toggle(i){this.filters.toggleKind(i)}toggleFavoritesOnly(){this.filters.setFavoritesOnly(!this.filters.favoritesOnly())}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-kind-palette"]],decls:4,vars:2,consts:[["content",""],["role","toolbar","data-testid","kind-palette",1,"kind-palette"],[3,"ngModel","pTooltip","ariaLabel","styleClass"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModel","pTooltip","ariaLabel"],[3,"ngModelChange","ngModel","pTooltip","ariaLabel","styleClass"],[3,"kind","size"],["styleClass","kind-palette__btn kind-palette__btn--favorites","data-testid","kind-palette-favorites",3,"ngModelChange","ngModel","pTooltip","ariaLabel"],["aria-hidden","true"]],template:function(e,n){e&1&&(u(0,"div",1),J(1,qb,3,5,"p-togglebutton",2,$b),w(3,Kb,3,3,"p-togglebutton",3),f()),e&2&&(Z("aria-label",n.texts.a11y.toolbarLabel),c(),ee(n.entries()),c(2),S(n.showFavorites()?3:-1))},dependencies:[bo,Co,xo,So,wo,je,Qe,Ut],styles:["[_nghost-%COMP%]{position:absolute;top:16px;left:16px;z-index:2;pointer-events:none}.kind-palette[_ngcontent-%COMP%]{pointer-events:auto;display:flex;flex-direction:column;gap:2px;padding:4px;background:var(--sm-bg-content);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: 999px;--p-togglebutton-content-border-radius: 999px;--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__btn .p-togglebutton-content{width:100%;height:100%;justify-content:flex-start;display:flex;align-items:center;gap:.4rem}[_nghost-%COMP%] .kind-palette__btn .p-togglebutton-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 Wi={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",tools:"tools",tags:"tags"},stats:{errors:t=>`${t} error${t===1?"":"s"}`,warns:t=>`${t} warning${t===1?"":"s"}`,tools:t=>`${t} tool${t===1?"":"s"}`,toolsBreakdown:(t,i)=>`${t} allowlist + ${i} pre-approved`,linksIn:t=>`${t} incoming link${t===1?"":"s"}`,linksOut:t=>`${t} outgoing link${t===1?"":"s"}`,extRefs:t=>`${t} external URL${t===1?"":"s"} in body`,bytes:t=>`${t.toLocaleString("en-US")} bytes`,tokens:t=>`${t.toLocaleString("en-US")} tokens`,daysAgo:(t,i)=>`updated ${t} (${i} day${i===1?"":"s"} ago)`},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."},safety:{injection:t=>`injection${t?`: ${t}`:""}`},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"};function Nl(t){if(!t)return null;let i=t.sidecar?.annotations;if(i&&typeof i.version=="number")return`v${i.version}`;let e=Zt(t.frontmatter)?.version;return typeof e=="string"&&e.length>0?`v${e}`:null}function Ol(t){if(!t)return null;let e=t.sidecar?.annotations?.stability;if(e==="stable"||e==="experimental"||e==="deprecated")return e;let n=Zt(t.frontmatter)?.stability;return n==="stable"||n==="experimental"||n==="deprecated"?n:null}function bm(t){if(!t)return null;let i=t.sidecar?.root?.audit;if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i.lastBumpedAt;if(typeof e!="string"||e.length===0)return null;let n=new Date(e);if(isNaN(n.getTime()))return null;let o=Math.max(0,Math.floor((Date.now()-n.getTime())/864e5));return{short:`${o}d`,iso:e,days:o}}function rh(t){if(!t)return{agentTools:0,skillBaseAllowedTools:0};let i=t.frontmatter,e=t.kind==="agent"&&Array.isArray(i.tools)?i.tools.length:0,n=0;if(t.kind==="skill"||t.kind==="command"){let o=i["allowed-tools"];Array.isArray(o)?n=o.length:typeof o=="string"&&o.length>0&&(n=1)}return{agentTools:e,skillBaseAllowedTools:n}}function wm(t){let{agentTools:i,skillBaseAllowedTools:e}=rh(t);return i+e}function Sm(t){if(!t)return[];let i=t.frontmatter,e=[];if(t.kind==="agent"&&Array.isArray(i.tools))for(let n of i.tools)typeof n=="string"&&n.length>0&&e.push(n);if(t.kind==="skill"||t.kind==="command"){let n=i["allowed-tools"];if(Array.isArray(n))for(let o of n)typeof o=="string"&&o.length>0&&e.push(o);else typeof n=="string"&&n.length>0&&e.push(n)}return e}function Fl(t){return yo(t?.sidecar)}function Al(t,i){switch(t?.sidecar?.status){case"stale-body":return i.staleBody;case"stale-frontmatter":return i.staleFrontmatter;case"stale-both":return i.staleBoth;default:return""}}function sh(t){return t<1e3?`${t}`:t<1e4?`${(t/1e3).toFixed(1).replace(/\.0$/,"")}k`:`${Math.round(t/1e3)}k`}function Im(t){let i=new Date(t);if(isNaN(i.getTime()))return t;let e=Date.now()-i.getTime(),n=Math.floor(e/1e3);if(n<60)return"just now";let o=Math.floor(n/60);if(o<60)return`${o} minute${o===1?"":"s"} ago`;let r=Math.floor(o/60);if(r<24)return`${r} hour${r===1?"":"s"} ago`;let s=Math.floor(r/24);if(s<30)return`${s} day${s===1?"":"s"} ago`;let a=Math.floor(s/30);if(a<12)return`${a} month${a===1?"":"s"} ago`;let l=Math.floor(s/365);return`${l} year${l===1?"":"s"} ago`}var Yb=(t,i)=>i.source+":"+i.tag,Zb=(t,i)=>i.step,Qb=(t,i)=>i.analyzerId+i.message;function Jb(t,i){if(t&1&&(u(0,"span",38),m(1),f()),t&2){let e=p(),n=Q(0),o=Q(2);Ce("sm-gnode__llm-marker--"+o),T("pTooltip",e.texts.confidence(n.confidence)),c(),Ge("",e.confidencePct(),"%")}}function ew(t,i){t&1&&(u(0,"span",10),m(1),f()),t&2&&(c(),y(i))}function tw(t,i){if(t&1&&(u(0,"span",14)(1,"span",39),m(2,"T"),f(),m(3),f()),t&2){let e=p(),n=Q(1);T("pTooltip",e.texts.stats.tokens(n.tokensTotal)),c(3),y(e.tokensShort())}}function nw(t,i){if(t&1&&(u(0,"span",15)(1,"span",39),m(2,"B"),f(),m(3),f()),t&2){let e=p(),n=Q(1);T("pTooltip",e.texts.stats.bytes(n.bytesTotal)),c(3),y(e.bytesShort())}}function iw(t,i){if(t&1&&(u(0,"span",16),A(1,"i",40),m(2),f()),t&2){let e=i,n=p();T("pTooltip",n.texts.stats.daysAgo(e.iso,e.days)),c(2),y(e.short)}}function ow(t,i){if(t&1&&(u(0,"span",43),m(1),f()),t&2){let e=i.$implicit;de("sm-gnode__tag-chip--author",e.source==="author")("sm-gnode__tag-chip--user",e.source==="user"),Z("data-tag-source",e.source),c(),y(e.tag)}}function rw(t,i){if(t&1&&(u(0,"span",42),m(1),f()),t&2){p(2);let e=Q(4);c(),Ge("+",e," more")}}function sw(t,i){if(t&1&&(u(0,"div",21),J(1,ow,2,6,"span",41,Yb),w(3,rw,2,1,"span",42),f()),t&2){p();let e=Q(3),n=Q(4);c(),ee(e),c(2),S(n>0?3:-1)}}function aw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItCovers)}}function cw(t,i){if(t&1&&(u(0,"span",47),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function dw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"div",46),J(4,cw,2,1,"span",47,we),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.topics.tooltip),c(),y(n.texts.llm.topics.label),c(2),ee(e.topics)}}function lw(t,i){if(t&1&&(u(0,"span",47),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function uw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"div",46),J(4,lw,2,1,"span",47,we),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.facts.tooltip),c(),y(n.texts.llm.facts.label),c(2),ee(e.keyFacts)}}function fw(t,i){if(t&1&&(w(0,aw,5,3,"div",44),w(1,dw,6,2,"div",44),w(2,uw,6,2,"div",44)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.topics!=null&&e.topics.length?1:-1),c(),S(e.keyFacts!=null&&e.keyFacts.length?2:-1)}}function hw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItDoes)}}function pw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.when.tooltip),c(),y(n.texts.llm.when.label),c(2),y(e.whenToUse)}}function mw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.style.tooltip),c(),y(n.texts.llm.style.label),c(2),y(e.interactionStyle)}}function _w(t,i){if(t&1&&(u(0,"span",47),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function gw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"div",46),J(4,_w,2,1,"span",47,we),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.does.tooltip),c(),y(n.texts.llm.does.label),c(2),ee(e.capabilities)}}function yw(t,i){if(t&1&&(w(0,hw,5,3,"div",44),w(1,pw,5,3,"div",44),w(2,mw,5,3,"div",44),w(3,gw,6,2,"div",44)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.whenToUse?1:-1),c(),S(e.interactionStyle?2:-1),c(),S(e.capabilities!=null&&e.capabilities.length?3:-1)}}function vw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItDoes)}}function Cw(t,i){if(t&1&&m(0),t&2){let e=i.$implicit,n=i.$index,o=i.$count;Dh("",e.step,". ",e.description,"",n===o-1?"":" \xB7 ")}}function xw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"span"),J(4,Cw,1,3,null,null,Zb),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.steps.tooltip),c(),y(n.texts.llm.steps.label),c(2),ee(e.recipe)}}function bw(t,i){if(t&1&&(u(0,"span",47),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function ww(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"div",46),J(4,bw,2,1,"span",47,we),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.pre.tooltip),c(),y(n.texts.llm.pre.label),c(2),ee(e.preconditions)}}function Sw(t,i){if(t&1&&(u(0,"span",47),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function Iw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"div",46),J(4,Sw,2,1,"span",47,we),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.out.tooltip),c(),y(n.texts.llm.out.label),c(2),ee(e.outputs)}}function Tw(t,i){if(t&1&&(u(0,"span",47),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function Ew(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"div",46),J(4,Tw,2,1,"span",47,we),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.fx.tooltip),c(),y(n.texts.llm.fx.label),c(2),ee(e.sideEffects)}}function Pw(t,i){if(t&1&&(w(0,vw,5,3,"div",44),w(1,xw,6,2,"div",44),w(2,ww,6,2,"div",44),w(3,Iw,6,2,"div",44),w(4,Ew,6,2,"div",44)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.recipe!=null&&e.recipe.length?1:-1),c(),S(e.preconditions!=null&&e.preconditions.length?2:-1),c(),S(e.outputs!=null&&e.outputs.length?3:-1),c(),S(e.sideEffects!=null&&e.sideEffects.length?4:-1)}}function Mw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"span"),m(4),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.what.tooltip),c(),y(n.texts.llm.what.label),c(2),y(e.whatItDoes)}}function Dw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"code",48),m(4),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.eg.tooltip),c(),y(n.texts.llm.eg.label),c(2),y(e.invocationExample)}}function kw(t,i){if(t&1&&(u(0,"span",47),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function Rw(t,i){if(t&1&&(u(0,"div",44)(1,"span",45),m(2),f(),u(3,"div",46),J(4,kw,2,1,"span",47,we),f()()),t&2){let e=p(),n=p(2);c(),T("pTooltip",n.texts.llm.fx.tooltip),c(),y(n.texts.llm.fx.label),c(2),ee(e.sideEffects)}}function Nw(t,i){if(t&1&&(w(0,Mw,5,3,"div",44),w(1,Dw,5,3,"div",44),w(2,Rw,6,2,"div",44)),t&2){let e=i,n=p(2);S(n.showLlmWhat?0:-1),c(),S(e.invocationExample?1:-1),c(),S(e.sideEffects!=null&&e.sideEffects.length?2:-1)}}function Ow(t,i){if(t&1&&(u(0,"div",23),w(1,fw,3,3),w(2,yw,4,4),w(3,Pw,5,5),w(4,Nw,3,3),f()),t&2){let e,n,o,r,s=p();c(),S((e=s.summaryMarkdown())?1:-1,e),c(),S((n=s.summaryAgent())?2:-1,n),c(),S((o=s.summarySkill())?3:-1,o),c(),S((r=s.summaryCommand())?4:-1,r)}}function Fw(t,i){if(t&1&&(u(0,"div",24),m(1),f()),t&2){let e=p();c(),y(e.description())}}function Aw(t,i){if(t&1&&(u(0,"div",49)(1,"div",50)(2,"span",51),m(3),f(),u(4,"span",52),m(5),f()()()),t&2){let e=p(),n=p();c(3),y(n.texts.meta.model),c(2),y(e.model)}}function Lw(t,i){t&1&&w(0,Aw,6,2,"div",49),t&2&&S(i.model?0:-1)}function Bw(t,i){if(t&1&&(u(0,"div",54),A(1,"i",55),u(2,"code",56),m(3),f(),u(4,"span",57),m(5),f()()),t&2){let e=i.$implicit;Ce("sm-gnode__issue--"+e.severity),T("pTooltip",e.detail??e.analyzerId+" \xB7 "+e.message),c(),de("pi",!0)("pi-times-circle",e.severity==="error")("pi-exclamation-triangle",e.severity==="warn"),c(2),y(e.analyzerId),c(2),y(e.message)}}function zw(t,i){if(t&1&&(u(0,"div",25),J(1,Bw,6,11,"div",53,Qb),f()),t&2){let e=p();c(),ee(e.visibleIssues())}}function Vw(t,i){if(t&1&&(u(0,"span",29),A(1,"i",58),u(2,"span",59),m(3),f()()),t&2){let e=p();T("pTooltip",e.texts.stats.errors(e.errorCount())),c(3),y(e.errorCount())}}function Gw(t,i){if(t&1&&(u(0,"span",30),A(1,"i",60),u(2,"span",59),m(3),f()()),t&2){let e=p();T("pTooltip",e.texts.stats.warns(e.warnCount())),c(3),y(e.warnCount())}}function Hw(t,i){if(t&1&&(u(0,"span",31),A(1,"i",61),u(2,"span",59),m(3),f()()),t&2){let e=p();T("pTooltip",e.toolsTooltip()),c(3),y(e.toolsCount())}}function jw(t,i){if(t&1&&(u(0,"span",32),A(1,"i",62),u(2,"span",59),m(3),f()()),t&2){let e=p();T("pTooltip",e.texts.stats.linksIn(e.linksIn())),c(3),y(e.linksIn())}}function Uw(t,i){if(t&1&&(u(0,"span",33),A(1,"i",63),u(2,"span",59),m(3),f()()),t&2){let e=p();T("pTooltip",e.texts.stats.linksOut(e.linksOut())),c(3),y(e.linksOut())}}function $w(t,i){if(t&1&&(u(0,"span",31),A(1,"i",64),u(2,"span",59),m(3),f()()),t&2){let e=p(),n=Q(1);T("pTooltip",e.texts.stats.extRefs(n.externalRefsCount)),c(3),y(n.externalRefsCount)}}function Ww(t,i){if(t&1&&(u(0,"span",65),A(1,"i",67),f()),t&2){let e=p(2);T("pTooltip",e.sidecarTooltip()),Z("data-testid","node-card-stale-badge")}}function qw(t,i){if(t&1&&(u(0,"span",31),$e(),u(1,"svg",68),A(2,"path",69)(3,"path",70)(4,"path",71),f()()),t&2){let e=p(2);T("pTooltip",e.texts.stability.experimental)}}function Xw(t,i){if(t&1&&(u(0,"span",31),A(1,"i",72),f()),t&2){let e=p(2);T("pTooltip",e.texts.stability.deprecated)}}function Kw(t,i){if(t&1&&(u(0,"span",66),$e(),u(1,"svg",68),A(2,"path",73)(3,"line",74)(4,"line",75),f()()),t&2){let e=p(2);T("pTooltip",e.texts.safety.injection(e.injectionType()))}}function Yw(t,i){if(t&1&&(u(0,"div",35),w(1,Ww,2,2,"span",65),w(2,qw,5,1,"span",31),w(3,Xw,2,1,"span",31),w(4,Kw,5,1,"span",66),f()),t&2){let e=p();c(),S(e.isStale()?1:-1),c(),S(e.stability()==="experimental"?2:-1),c(),S(e.stability()==="deprecated"?3:-1),c(),S(e.hasInjection()?4:-1)}}var Ll=class t{node=F.required();stats=F({linksIn:0,linksOut:0});summary=F(null);issues=F([]);selected=F(!1);highlighted=F(!1);dimmed=F(!1);isFavorite=F(!1);favoriteToggle=He();texts=Wi;showLlmWhat=!1;showLlmConfidence=!1;expanded=Kt(!1);fmAgent=P(()=>{let i=this.node();return i.kind==="agent"?i.frontmatter:null});summaryAgent=P(()=>{let i=this.summary();return i?.kind==="agent"?i:null});summarySkill=P(()=>{let i=this.summary();return i?.kind==="skill"?i:null});summaryCommand=P(()=>{let i=this.summary();return i?.kind==="command"?i:null});summaryMarkdown=P(()=>{let i=this.summary();return i?.kind==="markdown"?i:null});hasLlmCluster=P(()=>{let i=this.summary();return i===null?!1:this.showLlmWhat?!0:this.hasNonWhatLlmContent(i)});hasNonWhatLlmContent(i){switch(i.kind){case"markdown":return(i.topics?.length??0)>0||(i.keyFacts?.length??0)>0;case"agent":return!!i.whenToUse||!!i.interactionStyle||(i.capabilities?.length??0)>0;case"skill":return(i.recipe?.length??0)>0||(i.preconditions?.length??0)>0||(i.outputs?.length??0)>0||(i.sideEffects?.length??0)>0;case"command":return!!i.invocationExample||(i.sideEffects?.length??0)>0;default:return!1}}hasInjection=P(()=>this.summary()?.safety.injectionDetected===!0);confidenceTier=P(()=>{let i=this.summary();return i?i.confidence>.8?"high":i.confidence>=.5?"med":"low":null});confidencePct=P(()=>{let i=this.summary();return i?Math.round(i.confidence*100):null});injectionType=P(()=>{let i=this.summary();return i?.safety.injectionDetected?i.safety.injectionType??null:null});visibleIssues=P(()=>this.issues().filter(i=>i.severity==="error"||i.severity==="warn"));errorCount=P(()=>this.visibleIssues().filter(i=>i.severity==="error").length);warnCount=P(()=>this.visibleIssues().filter(i=>i.severity==="warn").length);nodeColor=P(()=>this.agentVendorColor());kindRegistry=d(Dt);providerAccent=P(()=>{let i=this.node();if(!i.provider)return null;let e=this.kindRegistry.lookup(i.kind);return!e||i.provider===e.primaryProviderId?null:e.providers[i.provider]?.color??null});bytesShort=P(()=>{let i=this.stats().bytesTotal;return i===void 0?null:sh(i)});tokensShort=P(()=>{let i=this.stats().tokensTotal;return i===void 0?null:sh(i)});daysAgo=P(()=>bm(this.node()));version=P(()=>Nl(this.node()));stability=P(()=>Ol(this.node()));tagChips=P(()=>{let i=this.node(),e=[],o=i.frontmatter.tags;if(Array.isArray(o))for(let a of o)typeof a=="string"&&a.length>0&&e.push({tag:a,source:"author"});let s=i.sidecar?.annotations?.tags;if(Array.isArray(s))for(let a of s)typeof a=="string"&&a.length>0&&e.push({tag:a,source:"user"});else{let a=Zt(i.frontmatter)?.tags;if(Array.isArray(a))for(let l of a)typeof l=="string"&&l.length>0&&e.push({tag:l,source:"user"})}return e});visibleTagChips=P(()=>this.tagChips().slice(0,3));moreTagsCount=P(()=>Math.max(0,this.tagChips().length-3));agentVendorColor=P(()=>{let i=this.node();if(i.kind!=="agent")return null;let n=i.frontmatter.color;return typeof n=="string"&&n.length>0?n:null});linksOut=P(()=>this.node().linksOutCount??this.stats().linksOut??0);linksIn=P(()=>this.node().linksInCount??this.stats().linksIn??0);isStale=P(()=>Fl(this.node()));sidecarStatus=P(()=>this.node().sidecar?.status??null);sidecarTooltip=P(()=>Al(this.node(),this.texts.sidecar));displayName=P(()=>this.node().frontmatter.name||this.node().path);description=P(()=>this.node().frontmatter.description??"");toolsCount=P(()=>wm(this.node()));toolsTooltip=P(()=>{let{agentTools:i,skillBaseAllowedTools:e}=rh(this.node());return this.texts.stats.toolsBreakdown(i,e)});toggleExpanded(i){i.stopPropagation(),this.expanded.update(e=>!e)}toggleFavorite(i){i.stopPropagation();let e=!this.isFavorite();this.favoriteToggle.emit({path:this.node().path,value:e})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["sm-node-card"]],hostAttrs:[1,"sm-gnode"],hostVars:26,hostBindings:function(e,n){e&2&&(at("--node-color",n.nodeColor())("--accent",n.providerAccent()),de("sm-gnode--skill",n.node().kind==="skill")("sm-gnode--agent",n.node().kind==="agent")("sm-gnode--command",n.node().kind==="command")("sm-gnode--markdown",n.node().kind==="markdown")("sm-gnode--danger",n.hasInjection())("sm-gnode--with-color",!!n.nodeColor())("sm-gnode--deprecated",n.stability()==="deprecated")("sm-gnode--expanded",n.expanded())("sm-gnode--selected",n.selected())("sm-gnode--highlighted",n.highlighted())("sm-gnode--dimmed",n.dimmed()))},inputs:{node:[1,"node"],stats:[1,"stats"],summary:[1,"summary"],issues:[1,"issues"],selected:[1,"selected"],highlighted:[1,"highlighted"],dimmed:[1,"dimmed"],isFavorite:[1,"isFavorite"],expanded:[1,"expanded"]},outputs:{favoriteToggle:"favoriteToggle",expanded:"expandedChange"},decls:46,vars:37,consts:[[1,"sm-gnode__main"],["aria-hidden","true",1,"sm-gnode__icon-box"],[3,"kind","size"],[1,"sm-gnode__content"],[1,"sm-gnode__name-row"],[1,"sm-gnode__name",3,"pTooltip"],["data-debug-slot","card.title.right",1,"sm-debug-slot"],["slot","card.title.right",3,"node"],[1,"sm-gnode__actions"],[1,"sm-gnode__confidence",3,"class","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"],[1,"sm-gnode__sub-stat","sm-gnode__sub-stat--date",3,"pTooltip"],["data-debug-slot","card.subtitle.left",1,"sm-debug-slot"],["slot","card.subtitle.left",3,"node"],["type","button","data-testid","node-card-favorite",1,"sm-gnode__favorite",3,"click","pTooltip"],["aria-hidden","true"],["data-testid","node-card-tags",1,"sm-gnode__tagrow"],[1,"sm-gnode__panel"],[1,"sm-gnode__llm"],[1,"sm-gnode__desc"],[1,"sm-gnode__issues-block"],[1,"sm-gnode__footer"],["data-debug-slot","card.footer.left.counter",1,"sm-debug-slot"],["slot","card.footer.left.counter",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__stat",3,"pTooltip"],["data-testid","node-card-links-in",1,"sm-gnode__stat",3,"pTooltip"],["data-testid","node-card-links-out",1,"sm-gnode__stat",3,"pTooltip"],[1,"sm-gnode__footer-right-cluster"],[1,"sm-gnode__footer-end"],["data-debug-slot","card.footer.right",1,"sm-debug-slot"],["slot","card.footer.right",3,"node"],[1,"sm-gnode__confidence",3,"pTooltip"],[1,"sm-gnode__sub-key"],["aria-hidden","true",1,"pi","pi-calendar"],[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,"class","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,"pi","pi-times-circle"],[1,"sm-gnode__stat-num"],["aria-hidden","true",1,"pi","pi-exclamation-triangle"],["aria-hidden","true",1,"pi","pi-wrench"],["aria-hidden","true",1,"pi","pi-arrow-down"],["aria-hidden","true",1,"pi","pi-arrow-up"],["aria-hidden","true",1,"pi","pi-link"],[1,"sm-gnode__stat","sm-gnode__stat--stale",3,"pTooltip"],[1,"sm-gnode__stat","sm-gnode__stat--danger",3,"pTooltip"],["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"],["d","M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"],["x1","12","y1","8","x2","12","y2","12"],["x1","12","y1","16","x2","12.01","y2","16"]],template:function(e,n){if(e&1&&(ot(0)(1)(2)(3)(4),u(5,"div",0)(6,"div",1),A(7,"sm-kind-icon",2),f(),u(8,"div",3)(9,"div",4)(10,"span",5),m(11),f(),u(12,"div",6),A(13,"sm-view-contributions-host",7),f()()(),u(14,"div",8),w(15,Jb,2,4,"span",9),w(16,ew,2,1,"span",10),u(17,"button",11),K("click",function(r){return n.toggleExpanded(r)}),A(18,"i",12),f()(),u(19,"div",13),w(20,tw,4,2,"span",14),w(21,nw,4,2,"span",15),w(22,iw,3,2,"span",16),u(23,"div",17),A(24,"sm-view-contributions-host",18),f(),u(25,"button",19),K("click",function(r){return n.toggleFavorite(r)}),A(26,"i",20),f()()(),w(27,sw,4,1,"div",21),u(28,"div",22),w(29,Ow,5,4,"div",23),w(30,Fw,2,1,"div",24),w(31,Lw,1,1),w(32,zw,3,0,"div",25),f(),u(33,"div",26)(34,"div",27),A(35,"sm-view-contributions-host",28),f(),w(36,Vw,4,2,"span",29),w(37,Gw,4,2,"span",30),w(38,Hw,4,2,"span",31),w(39,jw,4,2,"span",32),w(40,Uw,4,2,"span",33),w(41,$w,4,2,"span",31),u(42,"div",34),w(43,Yw,5,4,"div",35),u(44,"div",36),A(45,"sm-view-contributions-host",37),f()()()),e&2){let o,r,s,a=n.node(),l=Ae(n.summary());c();let h=Ae(n.stats());c();let _=Ae(n.confidenceTier());c();let v=Ae(n.visibleTagChips());c(),Ae(n.moreTagsCount()),c(3),T("kind",a.kind)("size",18),c(3),T("pTooltip",n.displayName()),c(),y(n.displayName()),c(2),T("node",n.node()),c(2),S(n.showLlmConfidence&&l!==null&&_!==null?15:-1),c(),S((o=n.version())?16:-1,o),c(),Z("aria-label",n.texts.ariaExpand),c(3),S(n.tokensShort()!==null?20:-1),c(),S(n.bytesShort()!==null?21:-1),c(),S((r=n.daysAgo())?22:-1,r),c(2),T("node",n.node()),c(),de("sm-gnode__favorite--on",n.isFavorite()),T("pTooltip",n.isFavorite()?n.texts.favoriteRemoveTooltip:n.texts.favoriteAddTooltip),Z("aria-label",n.isFavorite()?n.texts.ariaFavoriteRemove:n.texts.ariaFavoriteAdd),c(),Ce(n.isFavorite()?"pi pi-heart-fill":"pi pi-heart"),c(),S(v.length?27:-1),c(2),S(n.hasLlmCluster()?29:-1),c(),S(n.description()?30:-1),c(),S((s=n.fmAgent())?31:-1,s),c(),S(n.visibleIssues().length?32:-1),c(3),T("node",n.node()),c(),S(n.errorCount()>0?36:-1),c(),S(n.warnCount()>0?37:-1),c(),S(n.toolsCount()>0?38:-1),c(),S(n.linksIn()>0?39:-1),c(),S(n.linksOut()>0?40:-1),c(),S(h.externalRefsCount&&h.externalRefsCount>0?41:-1),c(2),S(n.stability()==="experimental"||n.stability()==="deprecated"||n.hasInjection()||n.isStale()?43:-1),c(2),T("node",n.node())}},dependencies:[Ut,je,Qe,xn],styles:['[_nghost-%COMP%]{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,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, var(--sm-kind-markdown))}.sm-gnode--skill[_nghost-%COMP%]{--accent: var(--sm-kind-skill)}.sm-gnode--agent[_nghost-%COMP%]{--accent: var(--sm-kind-agent)}.sm-gnode--command[_nghost-%COMP%]{--accent: var(--sm-kind-command)}.sm-gnode--markdown[_nghost-%COMP%]{--accent: var(--sm-kind-markdown)}.sm-gnode--danger[_nghost-%COMP%]{--accent: var(--sm-severity-error)}.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%]{width:38px;height:38px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--kind-bg, var(--sm-kind-markdown-bg));color:var(--kind-fg, var(--sm-kind-markdown-fg));flex:none;font-size:1.05rem;grid-row:1 / span 2;align-self:center}.sm-gnode--skill[_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-skill-bg);--kind-fg: var(--sm-kind-skill-fg)}.sm-gnode--agent[_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-agent-bg);--kind-fg: var(--sm-kind-agent-fg)}.sm-gnode--command[_nghost-%COMP%] .sm-gnode__icon-box[_ngcontent-%COMP%]{--kind-bg: var(--sm-kind-command-bg);--kind-fg: var(--sm-kind-command-fg)}.sm-gnode--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-debug-slot[data-debug-slot="card.title.right"][_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, var(--sm-kind-markdown)) 10%,transparent);padding:.05rem .35rem;border-radius:3px;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:3px}.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:4px;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%]{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:4px;margin-left:auto;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%]{grid-column:2 / -1;grid-row:2;display:flex;flex-wrap:nowrap;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%}.sm-gnode__sub-stat[_ngcontent-%COMP%]{padding:.08rem .35rem;border-radius:3px;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;cursor:help}.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:color-mix(in srgb,var(--sm-kind-agent) 7%,transparent)}.sm-gnode__sub-stat--bytes[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-command) 7%,transparent)}.sm-gnode__sub-stat--date[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-skill) 7%,transparent)}.app-dark[_nghost-%COMP%] .sm-gnode__sub-stat--tokens[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__sub-stat--tokens[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-agent) 22%,transparent);color:var(--sm-kind-agent-fg)}.app-dark[_nghost-%COMP%] .sm-gnode__sub-stat--bytes[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__sub-stat--bytes[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-command) 22%,transparent);color:var(--sm-kind-command-fg)}.app-dark[_nghost-%COMP%] .sm-gnode__sub-stat--date[_ngcontent-%COMP%], .app-dark [_nghost-%COMP%] .sm-gnode__sub-stat--date[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--sm-kind-skill) 22%,transparent);color:var(--sm-kind-skill-fg)}.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:3px;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:3px;font-size:.7rem;font-style:normal;color:var(--p-text-color)}.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:3px}.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:3px;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__footer-end[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.7rem}.sm-gnode__stat[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;line-height:1}.sm-gnode__stat[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .sm-gnode__stat[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{font-size:.6rem;line-height:1;display:block}.sm-gnode__stat[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:1em;height:1em}.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:3px}.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:3px}.sm-gnode__stat--warn[_ngcontent-%COMP%] .sm-gnode__stat-num[_ngcontent-%COMP%]{color:var(--sm-severity-warn)}.sm-gnode__stat--danger[_ngcontent-%COMP%]{color:var(--sm-severity-error)}.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:3px;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(--p-primary-color);color:var(--p-primary-color)}.sm-gnode__tag-more[_ngcontent-%COMP%]{font-size:.6rem;color:var(--sm-text-muted);font-style:italic}'],changeDetection:0})};var Tm={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,i)=>`${t}/${i} nodes`,edges:t=>`${t} edges`,cacheAge:t=>`cache ${t}s`}};var Zw=["sparkline"];function Qw(t,i){if(t&1&&(u(0,"span",5),m(1,"\xB7"),f(),u(2,"span",3),m(3),f()),t&2){let e=p(3);c(3),y(e.texts.units.mb(e.heapMb()))}}function Jw(t,i){if(t&1&&(u(0,"span",5),m(1,"\xB7"),f(),u(2,"span",3),m(3),f()),t&2){let e=p(3);c(3),y(e.texts.units.cacheAge(e.cacheAgeSec()))}}function eS(t,i){if(t&1&&(A(0,"canvas",4,1),u(2,"span",5),m(3,"\xB7"),f(),u(4,"span",3),m(5),f(),w(6,Qw,4,1),u(7,"span",5),m(8,"\xB7"),f(),u(9,"span",3),m(10),f(),u(11,"span",5),m(12,"\xB7"),f(),u(13,"span",3),m(14),f(),u(15,"span",5),m(16,"\xB7"),f(),u(17,"span",3),m(18),f(),u(19,"span",5),m(20,"\xB7"),f(),u(21,"span",3),m(22),f(),w(23,Jw,4,1)),t&2){let e=p(2);c(5),y(e.texts.units.ms(e.frameTimeMs())),c(),S(e.hasHeap()?6:-1),c(4),y(e.texts.units.longTasks(e.longTasks())),c(4),y(e.texts.units.domNodes(e.domNodes())),c(4),y(e.texts.units.nodes(e.visible(),e.total())),c(4),y(e.texts.units.edges(e.edges())),c(),S(e.cacheAgeSec()!==null?23:-1)}}function tS(t,i){if(t&1&&(u(0,"span",3),m(1),f(),w(2,eS,24,7)),t&2){let e=p();c(),y(e.texts.units.fps(e.fps())),c(),S(e.expanded()?2:-1)}}var nS=30,ah=60,Bl=14,zl=class t{visible=F(0);total=F(0);edges=F(0);cacheAt=F(null);texts=Tm;destroyRef=d(Ze);zone=d(Qn);fps=q(0);frameTimeMs=q(0);fpsSamples=q([]);sparklineCanvas=Te("sparkline");heapMb=q(null);longTasks=q(0);domNodes=q(0);nowTick=q(performance.now());expanded=q(iS());cacheAgeSec=P(()=>{let i=this.cacheAt();return i===null?null:Math.max(0,Math.floor((this.nowTick()-i)/1e3))});hasHeap=P(()=>this.heapMb()!==null);constructor(){let i=0,e=0,n=performance.now(),o=n,r=0,s=l=>{let h=l-n;if(n=l,i+=1,e+=h,l-o>=1e3){let _=(l-o)/1e3,v=Math.round(i/_);this.fps.set(v),this.frameTimeMs.set(Math.round(e/Math.max(i,1))),this.heapMb.set(rS()),this.domNodes.set(document.querySelectorAll("*").length),this.nowTick.set(l),this.fpsSamples.update(b=>{let I=b.length>=nS?b.slice(1):b.slice();return I.push(v),I}),i=0,e=0,o=l}r=requestAnimationFrame(s)};this.zone.runOutsideAngular(()=>{r=requestAnimationFrame(s)});let a=null;if(typeof PerformanceObserver<"u")try{a=new PerformanceObserver(l=>{this.longTasks.update(h=>h+l.getEntries().length)}),a.observe({type:"longtask",buffered:!0})}catch{}this.destroyRef.onDestroy(()=>{cancelAnimationFrame(r),a?.disconnect()}),me(()=>{let l=this.sparklineCanvas(),h=this.fpsSamples();l&&sS(l.nativeElement,h)})}setExpanded(i){this.expanded.set(i),oS(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-perf-hud"]],viewQuery:function(e,n){e&1&&ft(n.sparklineCanvas,Zw,5),e&2&&it()},inputs:{visible:[1,"visible"],total:[1,"total"],edges:[1,"edges"],cacheAt:[1,"cacheAt"]},decls:3,vars:2,consts:[["content",""],["sparkline",""],["styleClass","perf-hud","data-testid","perf-hud",3,"ngModelChange","ngModel","ariaLabel"],[1,"perf-hud__cell"],["aria-hidden","true",1,"perf-hud__sparkline"],["aria-hidden","true",1,"perf-hud__sep"]],template:function(e,n){e&1&&(u(0,"p-togglebutton",2),K("ngModelChange",function(r){return n.setExpanded(r)}),Me(1,tS,3,2,"ng-template",null,0,ei),f()),e&2&&T("ngModel",n.expanded())("ariaLabel",n.expanded()?n.texts.a11y.collapse:n.texts.a11y.expand)},dependencies:[bo,Co,xo,So,wo],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: 999px;--p-togglebutton-content-border-radius: 999px;--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}[_nghost-%COMP%] .perf-hud .p-togglebutton-content{display:inline-flex;align-items:center;gap:.4rem}.perf-hud__cell[_ngcontent-%COMP%]{white-space:nowrap;font-variant-numeric:tabular-nums}.perf-hud__sep[_ngcontent-%COMP%]{opacity:.45}.perf-hud__sparkline[_ngcontent-%COMP%]{width:60px;height:14px;opacity:.6}"],changeDetection:0})},Em="sm.perf-hud.expanded";function iS(){try{return localStorage.getItem(Em)==="1"}catch{return!1}}function oS(t){try{localStorage.setItem(Em,t?"1":"0")}catch{}}function rS(){let t=performance.memory;return t?Math.round(t.usedJSHeapSize/1024/1024):null}function sS(t,i){let e=window.devicePixelRatio||1,n=ah*e,o=Bl*e;(t.width!==n||t.height!==o)&&(t.width=n,t.height=o);let r=t.getContext("2d");if(!r||(r.setTransform(e,0,0,e,0,0),r.clearRect(0,0,ah,Bl),i.length<2))return;let s=Math.max(60,...i),a=ah/(i.length-1);r.beginPath();for(let l=0;l<i.length;l+=1){let h=l*a,_=Bl-i[l]/s*Bl;l===0?r.moveTo(h,_):r.lineTo(h,_)}r.strokeStyle=getComputedStyle(t).color,r.lineWidth=1,r.stroke()}var aS="debug-perf",Vl=class t{visible=q(this.resolveInitial());resolveInitial(){let e=new URLSearchParams(window.location.search).get(aS);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:kl.graph.perfHud}static \u0275fac=function(e){return new(e||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})};var Pm=`
|
|
211
211
|
.p-card {
|
|
212
212
|
background: dt('card.background');
|
|
213
213
|
color: dt('card.color');
|
|
@@ -238,10 +238,10 @@ function getSidePoint(rect, side) {
|
|
|
238
238
|
.p-card-subtitle {
|
|
239
239
|
color: dt('card.subtitle.color');
|
|
240
240
|
}
|
|
241
|
-
`;var
|
|
242
|
-
${
|
|
241
|
+
`;var cS=["header"],dS=["title"],lS=["subtitle"],uS=["content"],fS=["footer"],hS=["*",[["p-header"]],[["p-footer"]]],pS=["*","p-header","p-footer"];function mS(t,i){t&1&&_n(0)}function _S(t,i){if(t&1&&(u(0,"div",1),De(1,1),Me(2,mS,1,0,"ng-container",2),f()),t&2){let e=p();Ce(e.cx("header")),T("pBind",e.ptm("header")),c(2),T("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)}}function gS(t,i){if(t&1&&(Wt(0),m(1),qt()),t&2){let e=p(2);c(),y(e.header)}}function yS(t,i){t&1&&_n(0)}function vS(t,i){if(t&1&&(u(0,"div",1),Me(1,gS,2,1,"ng-container",3)(2,yS,1,0,"ng-container",2),f()),t&2){let e=p();Ce(e.cx("title")),T("pBind",e.ptm("title")),c(),T("ngIf",e.header&&!e._titleTemplate&&!e.titleTemplate),c(),T("ngTemplateOutlet",e.titleTemplate||e._titleTemplate)}}function CS(t,i){if(t&1&&(Wt(0),m(1),qt()),t&2){let e=p(2);c(),y(e.subheader)}}function xS(t,i){t&1&&_n(0)}function bS(t,i){if(t&1&&(u(0,"div",1),Me(1,CS,2,1,"ng-container",3)(2,xS,1,0,"ng-container",2),f()),t&2){let e=p();Ce(e.cx("subtitle")),T("pBind",e.ptm("subtitle")),c(),T("ngIf",e.subheader&&!e._subtitleTemplate&&!e.subtitleTemplate),c(),T("ngTemplateOutlet",e.subtitleTemplate||e._subtitleTemplate)}}function wS(t,i){t&1&&_n(0)}function SS(t,i){t&1&&_n(0)}function IS(t,i){if(t&1&&(u(0,"div",1),De(1,2),Me(2,SS,1,0,"ng-container",2),f()),t&2){let e=p();Ce(e.cx("footer")),T("pBind",e.ptm("footer")),c(2),T("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}var TS=`
|
|
242
|
+
${Pm}
|
|
243
243
|
|
|
244
244
|
.p-card {
|
|
245
245
|
display: block;
|
|
246
246
|
}
|
|
247
|
-
`,IS={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"},Em=(()=>{class t extends zh{name="card";style=SS;classes=IS;static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();var Pm=new fe("CARD_INSTANCE"),qi=(()=>{class t extends Hh{componentName="Card";$pcCard=d(Pm,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=d(ti,{self:!0});_componentStyle=d(Em);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}header;subheader;set style(e){Ah(this._style(),e)||(this._style.set(e),this.el?.nativeElement&&e&&Object.keys(e).forEach(n=>{this.el.nativeElement.style[n]=e[n]}))}get style(){return this._style()}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=q(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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["p-card"]],contentQueries:function(n,o,r){if(n&1&&Ph(r,Lh,5)(r,Bh,5)(r,sS,4)(r,aS,4)(r,cS,4)(r,dS,4)(r,lS,4)(r,gn,4),n&2){let s;wt(s=St())&&(o.headerFacet=s.first),wt(s=St())&&(o.footerFacet=s.first),wt(s=St())&&(o.headerTemplate=s.first),wt(s=St())&&(o.titleTemplate=s.first),wt(s=St())&&(o.subtitleTemplate=s.first),wt(s=St())&&(o.contentTemplate=s.first),wt(s=St())&&(o.footerTemplate=s.first),wt(s=St())&&(o.templates=s)}},hostVars:4,hostBindings:function(n,o){n&2&&(Mh(o._style()),Ce(o.cn(o.cx("root"),o.styleClass)))},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[Re([Em,{provide:Pm,useExisting:t},{provide:Gh,useExisting:t}]),Eh([ti]),_e],ngContentSelectors:fS,decls:8,vars:11,consts:[[3,"pBind","class",4,"ngIf"],[3,"pBind"],[4,"ngTemplateOutlet"],[4,"ngIf"]],template:function(n,o){n&1&&(Xt(uS),Pe(0,pS,3,4,"div",0),u(1,"div",1),Pe(2,gS,3,5,"div",0)(3,CS,3,5,"div",0),u(4,"div",1),Me(5),Pe(6,xS,1,0,"ng-container",2),f(),Pe(7,wS,3,4,"div",0),f()),n&2&&(P("ngIf",o.headerFacet||o.headerTemplate||o._headerTemplate),c(),Ce(o.cx("body")),P("pBind",o.ptm("body")),c(),P("ngIf",o.header||o.titleTemplate||o._titleTemplate),c(),P("ngIf",o.subheader||o.subtitleTemplate||o._subtitleTemplate),c(),Ce(o.cx("content")),P("pBind",o.ptm("content")),c(2),P("ngTemplateOutlet",o.contentTemplate||o._contentTemplate),c(),P("ngIf",o.footerFacet||o.footerTemplate||o._footerTemplate))},dependencies:[uo,kh,Rh,mo,go,ti],encapsulation:2,changeDetection:0})}return t})(),Gl=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=so({type:t});static \u0275inj=no({imports:[qi,mo,go,mo,go]})}return t})();var Hl={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 \u2014 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 \u2014 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."},audit:{header:"Audit",headerSummary:(t,i)=>`last bumped ${t} by ${i}`,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 jl=class t{http=d(ho);dataSource=d(Cn);loader=d(Mt);destroyRef=d(Ze);constructor(){this.dataSource.events().pipe(to(i=>Uh(i)),_o(this.destroyRef)).subscribe(i=>{let e=i;this.loader.patchSidecarFromBump({nodePath:e.data.nodePath,version:e.data.version,status:e.data.status})})}async bump(i,e={}){let n={nodePath:i};e.force!==void 0&&(n.force=e.force);try{return await eo(this.http.post("/api/sidecar/bump",n))}catch(o){throw TS(o)}}static \u0275fac=function(e){return new(e||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})};function TS(t){if(t instanceof Yt)return t;if(t instanceof Nh){let e=ES(t.error);return e?new Yt(e.error.code,e.error.message,e.error.details):new Yt("internal",t.message||"Request failed.")}let i=t instanceof Error?t.message:String(t);return new Yt("internal",i)}function ES(t){if(typeof t!="object"||t===null)return null;let i=t;if(i.ok!==!1)return null;let e=i.error;if(typeof e!="object"||e===null)return null;let n=e;return typeof n.code!="string"||typeof n.message!="string"?null:{ok:!1,error:{code:n.code,message:n.message,details:n.details}}}var Dm={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",requires:"Requires",conflictsWith:"Conflicts with",related:"Related",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 DS=(t,i)=>"a:"+i,kS=(t,i)=>"u:"+i;function RS(t,i){if(t&1&&(u(0,"p",0),m(1),f()),t&2){let e=p(2);c(),y(e.texts.emptyOverlay)}}function NS(t,i){if(t&1&&(u(0,"p",1),m(1),f()),t&2){let e=p(2);c(),y(e.texts.emptyAnnotations)}}function OS(t,i){if(t&1&&w(0,RS,2,1,"p",0)(1,NS,2,1,"p",1),t&2){let e,n=p();S((e=n.overlay())!=null&&e.present?1:0)}}function FS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",9)(3,"code"),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.version),c(3),y(e.version)}}function AS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd"),B(3,"p-tag",10),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.stability),c(2),P("value",e.stability)("severity",n.stabilitySeverity(e.stability))("rounded",!0)}}function LS(t,i){if(t&1&&(ot(0),u(1,"section",2)(2,"h4",7),m(3),f(),u(4,"dl",8),w(5,FS,5,2),w(6,AS,4,4),f()()),t&2){let e=p(2),n=Le(e.lifecycle());c(3),y(e.texts.sections.lifecycle),c(2),S(n.version!==null?5:-1),c(),S(n.stability!==null?6:-1)}}function BS(t,i){if(t&1){let e=ae();u(0,"h5"),m(1),f(),u(2,"div",11)(3,"p-chip",12),K("click",function(){j(e),p();let o=Q(0),r=p(2);return U(r.onOpenPath(o.supersededBy))}),f()()}if(t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.supersededBy),c(2),P("label",e.supersededBy)("styleClass",n.isBroken(e.supersededBy)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e.supersededBy)?n.texts.brokenRefTooltip:"")}}function zS(t,i){if(t&1){let e=ae();u(0,"p-chip",12),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpenPath(o))}),f()}if(t&2){let e=i.$implicit,n=p(4);P("label",e)("styleClass",n.isBroken(e)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e)?n.texts.brokenRefTooltip:"")}}function VS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,zS,1,3,"p-chip",13,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.supersedes),c(2),ee(e.supersedes)}}function GS(t,i){if(t&1){let e=ae();u(0,"p-chip",12),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpenPath(o))}),f()}if(t&2){let e=i.$implicit,n=p(4);P("label",e)("styleClass",n.isBroken(e)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e)?n.texts.brokenRefTooltip:"")}}function HS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,GS,1,3,"p-chip",13,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.requires),c(2),ee(e.requires)}}function jS(t,i){if(t&1){let e=ae();u(0,"p-chip",12),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpenPath(o))}),f()}if(t&2){let e=i.$implicit,n=p(4);P("label",e)("styleClass",n.isBroken(e)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e)?n.texts.brokenRefTooltip:"")}}function US(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,jS,1,3,"p-chip",13,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.related),c(2),ee(e.related)}}function $S(t,i){if(t&1&&B(0,"p-chip",14),t&2){let e=i.$implicit;P("label",e)}}function WS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,$S,1,1,"p-chip",14,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.conflictsWith),c(2),ee(e.conflictsWith)}}function qS(t,i){if(t&1&&(ot(0),u(1,"section",3)(2,"h4",7),m(3),f(),w(4,BS,4,4),w(5,VS,5,1),w(6,HS,5,1),w(7,US,5,1),w(8,WS,5,1),f()),t&2){let e=p(2),n=Le(e.supersession());c(3),y(e.texts.sections.supersession),c(),S(n.supersededBy!==null?4:-1),c(),S(n.supersedes.length?5:-1),c(),S(n.requires.length?6:-1),c(),S(n.related.length?7:-1),c(),S(n.conflictsWith.length?8:-1)}}function XS(t,i){if(t&1&&B(0,"p-chip",15),t&2){let e=i.$implicit;P("label",e)}}function KS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,XS,1,1,"p-chip",15,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.authors),c(2),ee(e.authors)}}function YS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd"),m(3),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.license),c(2),y(e.license)}}function ZS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"a",16),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.source),c(2),P("href",e.source,gu),c(),y(e.source)}}function QS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.sourceVersion),c(3),y(e.sourceVersion)}}function JS(t,i){if(t&1&&(ot(0),u(1,"section",4)(2,"h4",7),m(3),f(),w(4,KS,5,1),u(5,"dl",8),w(6,YS,4,2),w(7,ZS,5,3),w(8,QS,5,2),f()()),t&2){let e=p(2),n=Le(e.provenance());c(3),y(e.texts.sections.provenance),c(),S(n.authors.length?4:-1),c(2),S(n.license!==null?6:-1),c(),S(n.source!==null?7:-1),c(),S(n.sourceVersion!==null?8:-1)}}function e1(t,i){if(t&1){let e=ae();u(0,"p-chip",20),K("click",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.enter",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.space",function(o){let r=j(e).$implicit;return p(3).tagClick.emit(r),U(o.preventDefault())}),f()}if(t&2){let e=i.$implicit,n=p(3);P("label",e)("styleClass","ann-panel__chip ann-panel__chip--author"+(n.isActiveTag(e)?" ann-panel__chip--active":""))}}function t1(t,i){if(t&1){let e=ae();u(0,"p-chip",21),K("click",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.enter",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.space",function(o){let r=j(e).$implicit;return p(3).tagClick.emit(r),U(o.preventDefault())}),f()}if(t&2){let e=i.$implicit,n=p(3);P("label",e)("styleClass","ann-panel__chip ann-panel__chip--user"+(n.isActiveTag(e)?" ann-panel__chip--active":""))}}function n1(t,i){if(t&1&&(u(0,"section",5)(1,"h4",7),m(2),f(),u(3,"h5"),m(4),f(),u(5,"div",17),J(6,e1,1,2,"p-chip",18,DS),J(8,t1,1,2,"p-chip",19,kS),f()()),t&2){let e=p(2),n=e.taxonomy();c(2),y(e.texts.sections.taxonomy),c(2),y(e.texts.fields.tags),c(2),ee(n.authorTags),c(2),ee(n.userTags)}}function i1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"a",16),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.docsUrl),c(2),P("href",e.docsUrl,gu),c(),y(e.docsUrl)}}function o1(t,i){if(t&1&&(ot(0),u(1,"section",6)(2,"h4",7),m(3),f(),u(4,"dl",8),w(5,i1,5,3),f()()),t&2){let e=p(2),n=Le(e.docs());c(3),y(e.texts.sections.docs),c(2),S(n.docsUrl!==null?5:-1)}}function r1(t,i){if(t&1&&(w(0,LS,7,4,"section",2),w(1,qS,9,7,"section",3),w(2,JS,9,6,"section",4),w(3,n1,10,2,"section",5),w(4,o1,6,3,"section",6)),t&2){let e=p();S(e.hasLifecycle()?0:-1),c(),S(e.hasSupersession()?1:-1),c(),S(e.hasProvenance()?2:-1),c(),S(e.hasTaxonomy()?3:-1),c(),S(e.hasDocs()?4:-1)}}var s1={stable:"success",experimental:"info",deprecated:"warn"},$l=class t{overlay=F(void 0);authorTags=F([]);knownPaths=F(null);openPath=new nt;tagClick=new nt;activeTag=F(null);isActiveTag(i){return this.activeTag()===i}texts=Dm;annotations=E(()=>{let i=this.overlay();return!i||!i.present?null:i.annotations??null});hasAnnotations=E(()=>{let i=this.annotations();return i!==null&&Object.keys(i).length>0});hasAnyContent=E(()=>this.hasLifecycle()||this.hasSupersession()||this.hasProvenance()||this.hasTaxonomy()||this.hasDocs());lifecycle=E(()=>{let i=this.annotations()??{};return{version:a1(i.version),stability:c1(i.stability)}});hasLifecycle=E(()=>Ul(this.lifecycle()));supersession=E(()=>{let i=this.annotations()??{};return{supersedes:Wn(i.supersedes),supersededBy:Xi(i.supersededBy),requires:Wn(i.requires),conflictsWith:Wn(i.conflictsWith),related:Wn(i.related)}});hasSupersession=E(()=>Ul(this.supersession()));provenance=E(()=>{let i=this.annotations()??{};return{authors:Wn(i.authors),license:Xi(i.license),source:Xi(i.source),sourceVersion:Xi(i.sourceVersion)}});hasProvenance=E(()=>Ul(this.provenance()));taxonomy=E(()=>{let i=this.annotations()??{};return{authorTags:this.authorTags(),userTags:Wn(i.tags)}});hasTaxonomy=E(()=>{let i=this.taxonomy();return i.authorTags.length>0||i.userTags.length>0});docs=E(()=>{let i=this.annotations()??{};return{docsUrl:Xi(i.docsUrl)}});hasDocs=E(()=>Ul(this.docs()));stabilitySeverity(i){return s1[i]}isBroken(i){let e=this.knownPaths();return e?!e.has(i):!1}onOpenPath(i){this.isBroken(i)||this.openPath.emit(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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"],["styleClass","chip--warn",3,"label"],[3,"label"],["target","_blank","rel","noopener",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,n){e&1&&w(0,OS,2,1)(1,r1,5,5),e&2&&S(n.hasAnyContent()?1:0)},dependencies:[wn,To,bn,Io,Ue,Qe],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 .p-chip{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, white);border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-200, rgba(99, 102, 241, .25))}"],changeDetection:0})};function a1(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Xi(t){return typeof t=="string"&&t.length>0?t:null}function c1(t){return t==="stable"||t==="experimental"||t==="deprecated"?t:null}function Wn(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"&&i.length>0):[]}function Ul(t){for(let i of Object.values(t))if(i!=null){if(Array.isArray(i)){if(i.length>0)return!0;continue}if(typeof i=="string"){if(i.length>0)return!0;continue}return!0}return!1}var Wl=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=te({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,n){if(e&1&&(H(0,"div",0),Pt(1,"span",1),H(2,"p",2),m(3),$(),H(4,"p",3),m(5),$()()),e&2){let o=n.testId();Z("data-testid",o),c(),Ce(n.icon()),c(2),y(n.title()),c(2),y(n.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 km={cardHeader:"Linked nodes",refreshLabel:"Refresh links",outgoingHeader:"Outgoing",incomingHeader:"Incoming",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:", "};var Nm=(t,i)=>i.source+"|"+i.target+"|"+i.kind+"|"+((i.trigger==null?null:i.trigger.normalizedTrigger)??"");function l1(t,i){if(t&1){let e=ae();u(0,"div",4)(1,"h3",5),m(2),f(),u(3,"p-button",6),K("onClick",function(){j(e);let o=p(2);return U(o.refresh())}),f()()}if(t&2){let e=p(2);c(2),y(e.texts.cardHeader),c(),P("rounded",!0)("text",!0)("ariaLabel",e.texts.refreshLabel)("pTooltip",e.texts.refreshLabel)("disabled",e.state()==="loading")}}function u1(t,i){if(t&1&&(u(0,"p",2),m(1),f()),t&2){let e=p(2);c(),y(e.texts.loading)}}function f1(t,i){if(t&1&&(u(0,"p",3),m(1),f()),t&2){let e=p(2);c(),y(e.texts.error)}}function h1(t,i){if(t&1&&(u(0,"p",9),m(1),f()),t&2){let e=p(3);c(),y(e.texts.emptyOutgoing)}}function p1(t,i){if(t&1&&(u(0,"span",17),m(1),f()),t&2){let e=p().$implicit,n=p(4);c(),Jn(" ",n.texts.sourcesPrefix,"",e.sources.join(n.texts.sourcesSeparator)," ")}}function m1(t,i){if(t&1){let e=ae();u(0,"li",13),B(1,"p-tag",14),u(2,"button",15),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpen(o.target))}),m(3),f(),B(4,"p-tag",16),w(5,p1,2,2,"span",17),f()}if(t&2){let e=i.$implicit,n=p(4);Z("data-testid","linked-nodes-outgoing-row-"+e.target),c(),P("value",e.kind)("severity",n.kindSeverity(e.kind)),c(),Z("data-testid","linked-nodes-outgoing-link-"+e.target),c(),He(" ",e.target," "),c(),P("value",n.confidenceLabel(e.confidence))("severity",n.confidenceSeverity(e.confidence))("rounded",!0),c(),S(e.sources.length?5:-1)}}function _1(t,i){if(t&1&&(u(0,"ul",10),J(1,m1,6,9,"li",13,Nm),f()),t&2){let e=p(3);c(),ee(e.outgoing())}}function g1(t,i){if(t&1&&(u(0,"p",12),m(1),f()),t&2){let e=p(3);c(),y(e.texts.emptyIncoming)}}function y1(t,i){if(t&1&&(u(0,"span",17),m(1),f()),t&2){let e=p().$implicit,n=p(4);c(),Jn(" ",n.texts.sourcesPrefix,"",e.sources.join(n.texts.sourcesSeparator)," ")}}function v1(t,i){if(t&1){let e=ae();u(0,"li",13),B(1,"p-tag",14),u(2,"button",15),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpen(o.source))}),m(3),f(),B(4,"p-tag",16),w(5,y1,2,2,"span",17),f()}if(t&2){let e=i.$implicit,n=p(4);Z("data-testid","linked-nodes-incoming-row-"+e.source),c(),P("value",e.kind)("severity",n.kindSeverity(e.kind)),c(),Z("data-testid","linked-nodes-incoming-link-"+e.source),c(),He(" ",e.source," "),c(),P("value",n.confidenceLabel(e.confidence))("severity",n.confidenceSeverity(e.confidence))("rounded",!0),c(),S(e.sources.length?5:-1)}}function C1(t,i){if(t&1&&(u(0,"ul",10),J(1,v1,6,9,"li",13,Nm),f()),t&2){let e=p(3);c(),ee(e.incoming())}}function x1(t,i){if(t&1&&(u(0,"section",7)(1,"h4",8),m(2),f(),w(3,h1,2,1,"p",9)(4,_1,3,0,"ul",10),f(),u(5,"section",11)(6,"h4",8),m(7),f(),w(8,g1,2,1,"p",12)(9,C1,3,0,"ul",10),f()),t&2){let e=p(2);c(2),y(e.texts.outgoingHeader),c(),S(e.outgoing().length===0?3:4),c(4),y(e.texts.incomingHeader),c(),S(e.incoming().length===0?8:9)}}function b1(t,i){if(t&1&&(u(0,"p-card",0),Pe(1,l1,4,6,"ng-template",1),w(2,u1,2,1,"p",2)(3,f1,2,1,"p",3)(4,x1,10,4),f()),t&2){let e,n=p();c(2),S((e=n.state())==="loading"?2:e==="error"?3:e==="ready"?4:-1)}}var w1={invokes:"warn",references:"info",mentions:"secondary",supersedes:"success"},S1={high:"success",medium:"info",low:"warn"},ql=class t{dataSource=d(Cn);destroyRef=d(Ze);texts=km;path=F(null);openPath=je();state=q("idle");outgoing=q([]);incoming=q([]);fetchToken=0;hasResults=E(()=>this.state()==="ready"&&(this.outgoing().length>0||this.incoming().length>0));constructor(){this.dataSource.events().pipe(to(i=>i.type==="scan.completed"),_o(this.destroyRef)).subscribe(()=>{let i=this.path();i&&this.fetch(i)}),me(()=>{let i=this.path();if(!i){this.fetchToken++,this.state.set("idle"),this.outgoing.set([]),this.incoming.set([]);return}this.fetch(i)})}refresh(){let i=this.path();i&&this.fetch(i)}onOpen(i){this.openPath.emit(i)}kindSeverity(i){return w1[i]??"secondary"}confidenceSeverity(i){return S1[i]??"info"}confidenceLabel(i){return this.texts.confidence[i]??i}async fetch(i){let e=++this.fetchToken;this.state.set("loading");try{let[n,o]=await Promise.all([this.dataSource.listLinks({from:i}),this.dataSource.listLinks({to:i})]);if(e!==this.fetchToken)return;this.outgoing.set(n.items),this.incoming.set(o.items),this.state.set("ready")}catch{if(e!==this.fetchToken)return;this.outgoing.set([]),this.incoming.set([]),this.state.set("error")}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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-outgoing",1,"linked-nodes-panel__section"],[1,"linked-nodes-panel__section-title"],["data-testid","linked-nodes-outgoing-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__rows"],["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"],[3,"value","severity"],["type","button",1,"linked-nodes-panel__path",3,"click"],[3,"value","severity","rounded"],[1,"linked-nodes-panel__sources"]],template:function(e,n){e&1&&w(0,b1,5,1,"p-card",0),e&2&&S(n.path()?0:-1)},dependencies:[Gl,qi,gn,bn,Io,wn,vn,yn,Ue,Qe],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:4px;background:var(--p-content-background);border:1px solid var(--p-content-border-color)}.linked-nodes-panel__path[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.85rem;color:var(--p-primary-color);background:none;border:none;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.linked-nodes-panel__path[_ngcontent-%COMP%]:hover{text-decoration:none}.linked-nodes-panel__sources[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);margin-left:auto}"],changeDetection:0})};var Om={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 I1=(t,i)=>i.name,T1=(t,i)=>i.event;function E1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.model),c(3),y(i)}}function P1(t,i){if(t&1&&B(0,"p-chip",12),t&2){let e=i.$implicit;P("label",e)}}function M1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",11),J(3,P1,1,1,"p-chip",12,we),f()),t&2){let e=p(4);c(),y(e.texts.fields.tools),c(2),ee(e.tools())}}function D1(t,i){if(t&1){let e=ae();u(0,"p-chip",14),K("click",function(){let o=j(e).$implicit,r=p(5);return U(r.onSkillChipClick(o))}),f()}if(t&2){let e=i.$implicit,n=p(5);P("label",e)("styleClass",n.isSkillKnown(e)?"chip--link":"")}}function k1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",11),J(3,D1,1,2,"p-chip",13,we),f()),t&2){let e=p(4);c(),y(e.texts.fields.skills),c(2),ee(e.skills())}}function R1(t,i){if(t&1&&B(0,"p-chip",15),t&2){let e=i.$implicit;P("label",e)}}function N1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",11),J(3,R1,1,1,"p-chip",15,we),f()),t&2){let e=p(4);c(),y(e.texts.fields.disallowedTools),c(2),ee(e.disallowedTools())}}function O1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.permissionMode),c(3),y(i)}}function F1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd"),m(3),f()),t&2){let e=p(4);c(),y(e.texts.fields.maxTurns),c(2),y(e.maxTurns())}}function A1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.effort),c(3),y(i)}}function L1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.memory),c(3),y(i)}}function B1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4,"true"),f()()),t&2){let e=p(4);c(),y(e.texts.fields.background)}}function z1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.isolation),c(3),y(i)}}function V1(t,i){if(t&1&&(u(0,"blockquote",18),m(1),f()),t&2){let e=p();c(),y(e)}}function G1(t,i){if(t&1&&(u(0,"p",19),m(1),f()),t&2){let e=p();c(),Jn("",e.slice(0,80),"",e.length>80?"\u2026":"")}}function H1(t,i){if(t&1){let e=ae();u(0,"div",9)(1,"h5",16)(2,"button",17),K("click",function(){j(e);let o=p(4);return U(o.toggleInitialPrompt())}),B(3,"i",4),m(4),f()(),w(5,V1,2,1,"blockquote",18)(6,G1,2,2,"p",19),f()}if(t&2){let e=p(4);c(2),Z("aria-label",e.texts.initialPromptToggle),c(),de("pi-chevron-right",!e.initialPromptExpanded())("pi-chevron-down",e.initialPromptExpanded()),c(),He(" ",e.texts.fields.initialPrompt," "),c(),S(e.initialPromptExpanded()?5:6)}}function j1(t,i){if(t&1&&(u(0,"code",23),m(1),f()),t&2){let e=p().$implicit;c(),y(e.command)}}function U1(t,i){if(t&1&&(u(0,"li",21)(1,"code",22),m(2),f(),w(3,j1,2,1,"code",23),f()),t&2){let e=i.$implicit;c(2),y(e.name),c(),S(e.command!==null?3:-1)}}function $1(t,i){if(t&1&&(u(0,"div",10)(1,"h5",16),m(2),f(),u(3,"ul",20),J(4,U1,4,2,"li",21,I1),f()()),t&2){let e=p(4);c(2),y(e.texts.fields.mcpServers),c(2),ee(e.mcpServers())}}function W1(t,i){if(t&1&&(u(0,"code"),m(1),f(),m(2)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;c(),y(e),c(),He("",n===o-1?"":", "," ")}}function q1(t,i){if(t&1&&(u(0,"span",24),J(1,W1,3,2,null,null,we),f()),t&2){let e=p().$implicit;c(),ee(e.keys)}}function X1(t,i){if(t&1&&(u(0,"li",21)(1,"code",22),m(2),f(),w(3,q1,3,0,"span",24),f()),t&2){let e=i.$implicit;c(2),y(e.event),c(),S(e.keys.length?3:-1)}}function K1(t,i){if(t&1&&(u(0,"div",10)(1,"h5",16),m(2),f(),u(3,"ul",20),J(4,X1,4,2,"li",21,T1),f()()),t&2){let e=p(4);c(2),y(e.texts.fields.hooks),c(2),ee(e.hooks())}}function Y1(t,i){if(t&1&&(u(0,"dl",8),w(1,E1,5,2),w(2,M1,5,1),w(3,k1,5,1),w(4,N1,5,1),w(5,O1,5,2),w(6,F1,4,2),w(7,A1,5,2),w(8,L1,5,2),w(9,B1,5,1),w(10,z1,5,2),f(),w(11,H1,7,7,"div",9),w(12,$1,6,1,"div",10),w(13,K1,6,1,"div",10)),t&2){let e,n,o,r,s,a,l=p(3);c(),S((e=l.model())?1:-1,e),c(),S(l.tools().length?2:-1),c(),S(l.skills().length?3:-1),c(),S(l.disallowedTools().length?4:-1),c(),S((n=l.permissionMode())?5:-1,n),c(),S(l.maxTurns()!==null?6:-1),c(),S((o=l.effort())?7:-1,o),c(),S((r=l.memory())?8:-1,r),c(),S(l.background()?9:-1),c(),S((s=l.isolation())?10:-1,s),c(),S((a=l.initialPrompt())?11:-1,a),c(),S(l.mcpServers().length?12:-1),c(),S(l.hooks().length?13:-1)}}function Z1(t,i){if(t&1&&(u(0,"dt"),m(1,"when_to_use"),f(),u(2,"dd"),m(3),f()),t&2){p();let e=Q(0);c(3),y(e.when_to_use)}}function Q1(t,i){if(t&1&&(u(0,"dt"),m(1,"argument-hint"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.argumentHint)}}function J1(t,i){if(t&1&&B(0,"p-chip",12),t&2){let e=i.$implicit;P("label",e)}}function eI(t,i){if(t&1&&(u(0,"dt"),m(1,"arguments"),f(),u(2,"dd",11),J(3,J1,1,1,"p-chip",12,we),f()),t&2){p();let e=Q(0);c(3),ee(e.arguments)}}function tI(t,i){if(t&1&&B(0,"p-chip",12),t&2){let e=i.$implicit;P("label",e)}}function nI(t,i){if(t&1&&(u(0,"dt"),m(1,"allowed-tools"),f(),u(2,"dd",11),J(3,tI,1,1,"p-chip",12,we),f()),t&2){p();let e=Q(0);c(3),ee(e.allowedTools)}}function iI(t,i){if(t&1&&(u(0,"dt"),m(1,"model"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.model)}}function oI(t,i){if(t&1&&(u(0,"dt"),m(1,"effort"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.effort)}}function rI(t,i){if(t&1&&(u(0,"dt"),m(1,"context"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.context)}}function sI(t,i){if(t&1&&(u(0,"dt"),m(1,"agent"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.agent)}}function aI(t,i){if(t&1&&(u(0,"dt"),m(1,"shell"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.shell)}}function cI(t,i){if(t&1&&B(0,"p-chip",12),t&2){let e=i.$implicit;P("label",e)}}function dI(t,i){if(t&1&&(u(0,"dt"),m(1,"paths"),f(),u(2,"dd",11),J(3,cI,1,1,"p-chip",12,we),f()),t&2){p();let e=Q(0);c(3),ee(e.paths)}}function lI(t,i){t&1&&(u(0,"dt"),m(1,"disable-model-invocation"),f(),u(2,"dd")(3,"code"),m(4,"true"),f()())}function uI(t,i){if(t&1&&(u(0,"dt"),m(1,"user-invocable"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.userInvocable)}}function fI(t,i){if(t&1&&(ot(0),u(1,"dl",7),w(2,Z1,4,1),w(3,Q1,5,1),w(4,eI,5,0),w(5,nI,5,0),w(6,iI,5,1),w(7,oI,5,1),w(8,rI,5,1),w(9,sI,5,1),w(10,aI,5,1),w(11,dI,5,0),w(12,lI,5,0),w(13,uI,5,1),f()),t&2){let e=Le(p(3).skillBase());c(2),S(e.when_to_use!==null?2:-1),c(),S(e.argumentHint!==null?3:-1),c(),S(e.arguments.length?4:-1),c(),S(e.allowedTools.length?5:-1),c(),S(e.model!==null?6:-1),c(),S(e.effort!==null?7:-1),c(),S(e.context!==null?8:-1),c(),S(e.agent!==null?9:-1),c(),S(e.shell!==null?10:-1),c(),S(e.paths.length?11:-1),c(),S(e.disableModelInvocation?12:-1),c(),S(e.userInvocable!==null?13:-1)}}function hI(t,i){if(t&1&&(u(0,"div",6),w(1,Y1,14,13)(2,fI,14,13,"dl",7),f()),t&2){let e=p(2);c(),S(e.isAgent()?1:e.isSkillOrCommand()?2:-1)}}function pI(t,i){if(t&1){let e=ae();u(0,"div",0)(1,"section",1)(2,"h4",2)(3,"button",3),K("click",function(){j(e);let o=p();return U(o.toggleSection())}),B(4,"i",4),m(5),u(6,"span",5),m(7),f()()(),w(8,hI,3,1,"div",6),f()()}if(t&2){let e=p();c(3),Z("aria-expanded",e.sectionExpanded()),c(),de("pi-chevron-right",!e.sectionExpanded())("pi-chevron-down",e.sectionExpanded()),c(),He(" ",e.texts.providerSpecificHeader," "),c(2),He("(",e.texts.fieldCount(e.populatedFieldCount()),")"),c(),S(e.sectionExpanded()?8:-1)}}var Kl=class t{frontmatter=F.required();kind=F.required();provider=F(void 0);knownPaths=F(null);onSkillClick=F(null);texts=Om;hasVendorSurface=E(()=>{let i=this.kind();return i==="agent"||i==="skill"||i==="command"});isAgent=E(()=>this.kind()==="agent");isSkillOrCommand=E(()=>{let i=this.kind();return i==="skill"||i==="command"});tools=E(()=>Xl(this.fm().tools));model=E(()=>st(this.fm().model));skills=E(()=>Xl(this.fm().skills));disallowedTools=E(()=>Xl(this.fm().disallowedTools));initialPrompt=E(()=>st(this.fm().initialPrompt));initialPromptExpanded=q(!1);permissionMode=E(()=>st(this.fm().permissionMode));maxTurns=E(()=>mI(this.fm().maxTurns));memory=E(()=>st(this.fm().memory));background=E(()=>this.fm().background===!0);effort=E(()=>st(this.fm().effort));isolation=E(()=>st(this.fm().isolation));mcpServers=E(()=>{let i=this.fm().mcpServers;return Array.isArray(i)?i.filter(e=>typeof e=="object"&&e!==null).map((e,n)=>({name:typeof e.name=="string"&&e.name.length>0?e.name:`mcpServer[${n}]`,command:typeof e.command=="string"?e.command:null})):[]});hooks=E(()=>{let i=this.fm().hooks;if(typeof i!="object"||i===null)return[];let e=[];for(let[n,o]of Object.entries(i)){let r=typeof o=="object"&&o!==null?Object.keys(o):[];e.push({event:n,keys:r})}return e});skillBase=E(()=>{let i=this.fm();return{when_to_use:st(i.when_to_use),argumentHint:st(i["argument-hint"]),arguments:ch(i.arguments),disableModelInvocation:i["disable-model-invocation"]===!0,userInvocable:typeof i["user-invocable"]=="boolean"?i["user-invocable"]:null,allowedTools:ch(i["allowed-tools"]),model:st(i.model),effort:st(i.effort),context:st(i.context),agent:st(i.agent),paths:ch(i.paths),shell:st(i.shell)}});populatedFieldCount=E(()=>{if(this.isAgent()){let i=0;return this.model()!==null&&i++,this.tools().length&&i++,this.skills().length&&i++,this.disallowedTools().length&&i++,this.permissionMode()!==null&&i++,this.maxTurns()!==null&&i++,this.effort()!==null&&i++,this.memory()!==null&&i++,this.background()&&i++,this.isolation()!==null&&i++,this.initialPrompt()!==null&&i++,this.mcpServers().length&&i++,this.hooks().length&&i++,i}if(this.isSkillOrCommand()){let i=this.skillBase(),e=0;return i.when_to_use!==null&&e++,i.argumentHint!==null&&e++,i.arguments.length&&e++,i.allowedTools.length&&e++,i.model!==null&&e++,i.effort!==null&&e++,i.context!==null&&e++,i.agent!==null&&e++,i.shell!==null&&e++,i.paths.length&&e++,i.disableModelInvocation&&e++,i.userInvocable!==null&&e++,e}return 0});hasAnyContent=E(()=>this.hasVendorSurface()&&this.populatedFieldCount()>0);sectionExpanded=q(!1);toggleSection(){this.sectionExpanded.update(i=>!i)}toggleInitialPrompt(){this.initialPromptExpanded.update(i=>!i)}onSkillChipClick(i){let e=this.onSkillClick();e&&e(i)}isSkillKnown(i){let e=this.knownPaths();return e?e.has(i):!1}fm(){return this.frontmatter()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){e&1&&w(0,pI,9,8,"div",0),e&2&&S(n.hasAnyContent()?0:-1)},dependencies:[wn,To,Ue],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:3px}.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 .p-chip{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}"],changeDetection:0})};function st(t){return typeof t=="string"&&t.length>0?t:null}function mI(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Xl(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"&&i.length>0):[]}function ch(t){return typeof t=="string"?t.length>0?[t]:[]:Array.isArray(t)?Xl(t):[]}var Fm={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 Bm=(t,i)=>i.key,_I=(t,i)=>i.pluginId;function gI(t,i){if(t&1&&(u(0,"p",0),m(1),f()),t&2){let e=p();c(),y(e.texts.empty)}}function yI(t,i){if(t&1&&(u(0,"span",5),m(1),f()),t&2){let e=p().$implicit,n=p(3);c(),y(n.texts.rootContribBadge(e.pluginId))}}function vI(t,i){if(t&1&&(u(0,"div",3)(1,"code",4),m(2),f(),w(3,yI,2,1,"span",5),u(4,"pre",6),m(5),f()()),t&2){let e=i.$implicit;c(2),y(e.key),c(),S(e.pluginId!==null?3:-1),c(2),y(e.value)}}function CI(t,i){if(t&1&&(u(0,"div",1),J(1,vI,6,3,"div",3,Bm),f()),t&2){let e=p(2);c(),ee(e.rootContributions())}}function xI(t,i){if(t&1&&(u(0,"span",10),m(1),f()),t&2){let e=p(4);c(),y(e.texts.unregisteredBadge)}}function bI(t,i){if(t&1&&(u(0,"dt",12),m(1),f(),u(2,"dd")(3,"pre"),m(4),f()()),t&2){let e=i.$implicit;P("pTooltip",e.description??""),c(),y(e.key),c(3),y(e.value)}}function wI(t,i){if(t&1&&(u(0,"section",7)(1,"h5",8)(2,"span",9),m(3),f(),w(4,xI,2,1,"span",10),f(),u(5,"dl",11),J(6,bI,5,3,null,null,Bm),f()()),t&2){let e=i.$implicit;Z("data-testid","plugin-contributions-ns-"+e.pluginId),c(3),y(e.pluginId),c(),S(e.registered?-1:4),c(2),ee(e.rows)}}function SI(t,i){if(t&1&&(u(0,"div",2),J(1,wI,8,3,"section",7,_I),f()),t&2){let e=p(2);c(),ee(e.namespaces())}}function II(t,i){if(t&1&&(w(0,CI,3,0,"div",1),w(1,SI,3,0,"div",2)),t&2){let e=p();S(e.rootContributions().length?0:-1),c(),S(e.namespaces().length?1:-1)}}var Am=new Set(["identity","annotations","settings","audit"]),Yl=class t{http=d(ho);sidecarRoot=F(void 0);texts=Fm;catalog=q(null);constructor(){this.fetchCatalog()}namespaces=E(()=>{let i=this.sidecarRoot();if(!i)return[];let e=this.catalog(),n=new Map;if(e)for(let r of e){if(r.location!=="namespaced")continue;let s=n.get(r.pluginId);s?s.push(r):n.set(r.pluginId,[r])}let o=[];for(let[r,s]of Object.entries(i)){if(Am.has(r)||this.isRegisteredRootKey(r))continue;let l=typeof s=="object"&&s!==null&&!Array.isArray(s)?s:{value:s},h=n.has(r),_=n.get(r)??[],v=Object.entries(l).map(([b,I])=>({key:b,value:Lm(I),description:h?TI(_,b):null}));o.push({pluginId:r,registered:h,rows:v})}return o});rootContributions=E(()=>{let i=this.sidecarRoot();if(!i)return[];let e=this.catalog();if(!e)return[];let n=new Map;for(let r of e)r.location==="root"&&n.set(r.key,r);let o=[];for(let[r,s]of Object.entries(i)){if(Am.has(r))continue;let a=n.get(r);a&&o.push({key:r,pluginId:a.pluginId,value:Lm(s)})}return o});count=E(()=>this.namespaces().length+this.rootContributions().length);isEmpty=E(()=>this.count()===0);isRegisteredRootKey(i){let e=this.catalog();return e?e.some(n=>n.location==="root"&&n.key===i):!1}async fetchCatalog(){try{let i=await eo(this.http.get("/api/annotations/registered"));this.catalog.set(i.items)}catch{this.catalog.set([])}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){e&1&&w(0,gI,2,1,"p",0)(1,II,2,2),e&2&&S(n.isEmpty()?0:1)},dependencies:[Ue,Qe],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:3px;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:3px}.pcp__root-value[_ngcontent-%COMP%]{flex:1 1 100%;margin:.2rem 0 0;padding:.45rem .6rem;background:var(--sm-bg-hover);border-radius:3px;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:3px}.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 Lm(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 TI(t,i){for(let e of t)if(e.key===i){let n=e.schema.description;return typeof n=="string"&&n.length>0?n:null}return null}var zm={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 EI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function PI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function MI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.bodyHashDrift()),c(),y(i)}}function DI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function kI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.bodyHashDrift()),c(),y(i)}}function RI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function NI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.frontmatterHashDrift()),c(),y(i)}}function OI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function FI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.frontmatterHashDrift()),c(),y(i)}}function AI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function LI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function BI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.notSetMarker)}}function zI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function VI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.notSetMarker)}}function GI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function HI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}var Zl=class t{node=F.required();sidecarRoot=F(null);overlay=F(void 0);texts=zm;identityBlock=E(()=>{let i=this.sidecarRoot(),e={path:null,bodyHash:null,frontmatterHash:null,resolvedProvider:null,resolvedKind:null};if(!i)return e;let n=i.identity;if(typeof n!="object"||n===null)return e;let o=n,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=E(()=>this.node().bodyHash??null);frontmatterHashLive=E(()=>this.node().frontmatterHash??null);bodyHashDrift=E(()=>{let i=this.identityBlock().bodyHash,e=this.bodyHashLive();return i!==null&&e!==null&&i!==e});frontmatterHashDrift=E(()=>{let i=this.identityBlock().frontmatterHash,e=this.frontmatterHashLive();return i!==null&&e!==null&&i!==e});sidecarStatusLiteral=E(()=>{let i=this.overlay();if(!i)return null;let e=i.status??null;return e===null?null:String(e)});sidecarPresent=E(()=>this.overlay()?.present===!0);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){if(e&1&&(H(0,"dl",0)(1,"dt"),m(2),$(),H(3,"dd",1),w(4,EI,2,1,"code")(5,PI,2,1,"span",2),$(),H(6,"dt"),m(7),$(),H(8,"dd",3),w(9,MI,2,3,"code",4)(10,DI,2,1,"span",2),$(),H(11,"dt"),m(12),$(),H(13,"dd",5),w(14,kI,2,3,"code",4)(15,RI,2,1,"span",2),$(),H(16,"dt"),m(17),$(),H(18,"dd",6),w(19,NI,2,3,"code",4)(20,OI,2,1,"span",2),$(),H(21,"dt"),m(22),$(),H(23,"dd",7),w(24,FI,2,3,"code",4)(25,AI,2,1,"span",2),$(),H(26,"dt"),m(27),$(),H(28,"dd",8),w(29,LI,2,1,"code")(30,BI,2,1,"span",2),$(),H(31,"dt"),m(32),$(),H(33,"dd",9),w(34,zI,2,1,"code")(35,VI,2,1,"span",2),$(),H(36,"dt"),m(37),$(),H(38,"dd",10),w(39,GI,2,1,"code")(40,HI,2,1,"span",2),$(),H(41,"dt"),m(42),$(),H(43,"dd",11)(44,"code"),m(45),$()()()),e&2){let o,r,s,a,l,h,_,v;c(2),y(n.texts.fields.forPath),c(2),S((o=n.identityBlock().path)?4:5,o),c(3),y(n.texts.fields.bodyHashStored),c(2),S((r=n.identityBlock().bodyHash)?9:10,r),c(3),y(n.texts.fields.bodyHashLive),c(2),S((s=n.bodyHashLive())?14:15,s),c(3),y(n.texts.fields.frontmatterHashStored),c(2),S((a=n.identityBlock().frontmatterHash)?19:20,a),c(3),y(n.texts.fields.frontmatterHashLive),c(2),S((l=n.frontmatterHashLive())?24:25,l),c(3),y(n.texts.fields.resolvedProvider),c(2),S((h=n.identityBlock().resolvedProvider)?29:30,h),c(3),y(n.texts.fields.resolvedKind),c(2),S((_=n.identityBlock().resolvedKind)?34:35,_),c(3),y(n.texts.fields.sidecarStatus),c(2),S((v=n.sidecarStatusLiteral())?39:40,v),c(3),y(n.texts.fields.sidecarPresent),c(3),y(n.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:3px;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 jI(t,i){if(t&1&&(H(0,"span",3),m(1),H(2,"code"),m(3),$()()),t&2){p(2);let e=Q(0),n=p();c(),He(" ",n.texts.fields.lastBumpedBy," "),c(2),y(e.lastBumpedBy)}}function UI(t,i){if(t&1&&(H(0,"dt"),m(1),$(),H(2,"dd")(3,"span",2),m(4),$(),w(5,jI,4,2,"span",3),$()),t&2){p();let e=Q(0),n=p();c(),y(n.texts.fields.lastBumpedAt),c(2),vu("title",e.lastBumpedAt),c(),y(n.lastBumpedRel()),c(),S(e.lastBumpedBy!==null?5:-1)}}function $I(t,i){if(t&1&&(H(0,"span",3),m(1),H(2,"code"),m(3),$()()),t&2){p(2);let e=Q(0),n=p();c(),He(" ",n.texts.fields.createdBy," "),c(2),y(e.createdBy)}}function WI(t,i){if(t&1&&(H(0,"dt"),m(1),$(),H(2,"dd")(3,"span",2),m(4),$(),w(5,$I,4,2,"span",3),$()),t&2){p();let e=Q(0),n=p();c(),y(n.texts.fields.createdAt),c(2),vu("title",e.createdAt),c(),y(n.createdRel()),c(),S(e.createdBy!==null?5:-1)}}function qI(t,i){if(t&1&&(ot(0),H(1,"dl",0),w(2,UI,6,4),w(3,WI,6,4),$()),t&2){let e=Le(p().audit());c(2),S(e.lastBumpedAt!==null?2:-1),c(),S(e.createdAt!==null?3:-1)}}function XI(t,i){if(t&1&&(H(0,"p",1),m(1),$()),t&2){let e=p();c(),y(e.texts.headerEmpty)}}var Jl=class t{sidecarRoot=F(null);texts=Hl.audit;audit=E(()=>{let i=this.sidecarRoot(),e={lastBumpedAt:null,lastBumpedBy:null,createdAt:null,createdBy:null};if(!i)return e;let n=i.audit;if(typeof n!="object"||n===null)return e;let o=n;return{lastBumpedAt:Ql(o.lastBumpedAt),lastBumpedBy:Ql(o.lastBumpedBy),createdAt:Ql(o.createdAt),createdBy:Ql(o.createdBy)}});hasContent=E(()=>{let i=this.audit();return i.lastBumpedAt!==null||i.lastBumpedBy!==null||i.createdAt!==null||i.createdBy!==null});headerSummary=E(()=>{let i=this.audit();if(i.lastBumpedAt===null)return this.texts.headerEmpty;let e=dh(i.lastBumpedAt);return this.texts.headerSummary(e,i.lastBumpedBy??"?")});lastBumpedRel=E(()=>{let i=this.audit().lastBumpedAt;return i===null?null:dh(i)});createdRel=E(()=>{let i=this.audit().createdAt;return i===null?null:dh(i)});static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){e&1&&w(0,qI,4,3,"dl",0)(1,XI,2,1,"p",1),e&2&&S(n.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 Ql(t){return typeof t=="string"&&t.length>0?t:null}function dh(t){let i=new Date(t);if(isNaN(i.getTime()))return t;let e=Date.now()-i.getTime(),n=Math.floor(e/1e3);if(n<60)return"just now";let o=Math.floor(n/60);if(o<60)return`${o} minute${o===1?"":"s"} ago`;let r=Math.floor(o/60);if(r<24)return`${r} hour${r===1?"":"s"} ago`;let s=Math.floor(r/24);if(s<30)return`${s} day${s===1?"":"s"} ago`;let a=Math.floor(s/30);if(a<12)return`${a} month${a===1?"":"s"} ago`;let l=Math.floor(s/365);return`${l} year${l===1?"":"s"} ago`}var KI=["closeBtn"];function YI(t,i){if(t&1&&(u(0,"section",1)(1,"div",2),B(2,"span",3),u(3,"p",4),m(4),f(),u(5,"p",5),m(6),u(7,"a",6),m(8),f(),m(9),u(10,"a",7),m(11),f(),m(12),f()()()),t&2){let e=p();c(4),y(e.texts.emptyNoSelection.title),c(2),y(e.texts.emptyNoSelection.descPrefix),c(2),y(e.texts.emptyNoSelection.listLink),c(),y(e.texts.emptyNoSelection.descMiddle),c(2),y(e.texts.emptyNoSelection.graphLink),c(),y(e.texts.emptyNoSelection.descSuffix)}}function ZI(t,i){if(t&1&&(u(0,"section",1)(1,"div",8),B(2,"span",9),u(3,"p",4),m(4),f(),u(5,"p",5)(6,"code"),m(7),f(),m(8),u(9,"a",6),m(10),f(),m(11),f()()()),t&2){let e=p();c(4),y(e.texts.emptyNotFound.title),c(3),y(e.path()),c(),y(e.texts.emptyNotFound.descSuffix),c(2),y(e.texts.emptyNotFound.backLink),c(),y(e.texts.emptyNotFound.descAfterLink)}}function QI(t,i){if(t&1&&(u(0,"span",20),B(1,"i",65),f()),t&2){let e=p(2);P("pTooltip",e.headerStaleTooltip())}}function JI(t,i){if(t&1&&(u(0,"span",21),Ae(),u(1,"svg",66),B(2,"path",67)(3,"path",68)(4,"path",69),f()()),t&2){let e=p(2);P("pTooltip",e.cardTexts.stability.experimental)}}function eT(t,i){if(t&1&&(u(0,"span",21),B(1,"i",70),f()),t&2){let e=p(2);P("pTooltip",e.cardTexts.stability.deprecated)}}function tT(t,i){t&1&&(u(0,"span",22),m(1),f()),t&2&&(c(),y(i))}function nT(t,i){if(t&1){let e=ae();u(0,"button",71,0),K("click",function(o){j(e);let r=p(2);return U(r.onCloseClick(o))}),B(2,"i",72),f()}if(t&2){let e=p(2);P("pTooltip",e.texts.close.tooltip),Z("aria-label",e.texts.close.label)}}function iT(t,i){if(t&1&&(u(0,"span",73),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function oT(t,i){if(t&1&&(u(0,"div",34),J(1,iT,2,1,"span",73,we),f()),t&2){let e=p(2);c(),ee(e.headerTools())}}function rT(t,i){if(t&1&&(u(0,"a",39),m(1),f()),t&2){let e=p(2);c(),y(e.texts.backToList)}}function sT(t,i){if(t&1&&(u(0,"div",40),B(1,"i",74),u(2,"span"),m(3),f()()),t&2){let e=p(2);c(3),y(e.texts.supersededByBanner(i))}}function aT(t,i){if(t&1){let e=ae();u(0,"div",41)(1,"span"),m(2),f(),u(3,"button",75),K("click",function(){j(e);let o=p(2);return U(o.dismissBumpError())}),B(4,"i",72),f()()}t&2&&(c(2),y(i))}function cT(t,i){if(t&1&&(u(0,"p",42),m(1),f()),t&2){p();let e=Q(1);c(),y(e.description)}}function dT(t,i){if(t&1&&(u(0,"div",43),B(1,"sm-inspector-debug-panel",76),f()),t&2){p();let e=Q(0),n=p();c(),P("node",e)("sidecarRoot",n.sidecarRoot())("overlay",e.sidecar)}}function lT(t,i){if(t&1&&B(0,"sm-empty-state",77)(1,"sm-empty-state",78)(2,"sm-empty-state",79),t&2){let e=p(2);P("title",e.texts.placeholders.enrichmentTitle)("body",e.texts.placeholders.body),c(),P("title",e.texts.placeholders.summaryTitle)("body",e.texts.placeholders.body),c(),P("title",e.texts.placeholders.findingsTitle)("body",e.texts.placeholders.body)}}function uT(t,i){if(t&1){let e=ae();u(0,"p-card",45)(1,"sm-annotations-panel",80),K("openPath",function(o){j(e);let r=p(2);return U(r.openPath(o))})("tagClick",function(o){j(e);let r=p(2);return U(r.tagSelect.emit(o))}),f()()}if(t&2){p();let e=Q(0),n=p();P("header",n.texts.cardsAnnotations),c(),P("overlay",e.sidecar)("authorTags",n.authorTags())("knownPaths",n.pathSet())("activeTag",n.activeTag())}}function fT(t,i){if(t&1&&(u(0,"dt"),m(1,"Bytes"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.bytesTotal)}}function hT(t,i){if(t&1&&(u(0,"dt"),m(1,"Tokens"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.tokensTotal)}}function pT(t,i){if(t&1&&(m(0," \xB7 "),u(1,"code"),m(2),f(),m(3," ext ")),t&2){p();let e=Q(0);c(2),y(e.externalRefsCount)}}function mT(t,i){if(t&1){let e=ae();u(0,"button",81),K("click",function(){j(e);let o=p(2);return U(o.toggleAudit())}),B(1,"i",82),u(2,"span",83),m(3),f(),u(4,"span",84),m(5),f()()}if(t&2){let e=p(2);Z("aria-expanded",e.auditExpanded()),c(),de("pi-chevron-right",!e.auditExpanded())("pi-chevron-down",e.auditExpanded()),c(2),y(e.texts.audit.header),c(2),He(" \xB7 ",e.auditSummary()," ")}}function _T(t,i){if(t&1&&B(0,"sm-inspector-audit-panel",54),t&2){let e=p(2);P("sidecarRoot",e.sidecarRoot())}}function gT(t,i){if(t&1){let e=ae();u(0,"button",85),K("click",function(){j(e);let o=p(2);return U(o.togglePlugins())}),B(1,"i",82),u(2,"span",83),m(3,"Plugin contributions"),f()()}if(t&2){let e=p(2);Z("aria-expanded",e.pluginsExpanded()),c(),de("pi-chevron-right",!e.pluginsExpanded())("pi-chevron-down",e.pluginsExpanded())}}function yT(t,i){if(t&1&&B(0,"sm-plugin-contributions",54),t&2){let e=p(2);P("sidecarRoot",e.sidecarRoot())}}function vT(t,i){if(t&1){let e=ae();u(0,"div",86)(1,"h3",87),m(2),f(),u(3,"p-button",88),K("onClick",function(){j(e);let o=p(2);return U(o.refreshBody())}),f()()}if(t&2){let e=p(2);c(2),y(e.texts.cards.body),c(),P("rounded",!0)("text",!0)("ariaLabel",e.texts.body.refreshLabel)("pTooltip",e.texts.body.refreshLabel)("disabled",e.bodyState()==="loading"||!e.path())}}function CT(t,i){if(t&1&&(u(0,"p",60),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.loading)}}function xT(t,i){if(t&1&&(u(0,"p",61),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.empty)}}function bT(t,i){if(t&1&&(u(0,"p",62),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.unavailable)}}function wT(t,i){if(t&1&&(u(0,"p",63),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.renderError)}}function ST(t,i){if(t&1&&B(0,"div",64),t&2){let e=p(2);P("innerHTML",e.bodyHtml(),xh)}}function IT(t,i){if(t&1){let e=ae();ot(0)(1),u(2,"section",1)(3,"header",10)(4,"div",11),B(5,"sm-kind-icon",12),f(),u(6,"div",13)(7,"div",14)(8,"h2",15),m(9),f()(),u(10,"code",16),m(11),f()(),u(12,"div",17)(13,"button",18),K("click",function(o){j(e);let r=p();return U(r.toggleFavorite(o))}),B(14,"i",19),f(),w(15,QI,2,1,"span",20),w(16,JI,5,1,"span",21),w(17,eT,2,1,"span",21),w(18,tT,2,1,"span",22),u(19,"div",23),B(20,"sm-view-contributions-host",24),f(),w(21,nT,3,2,"button",25),f(),u(22,"div",26)(23,"span",27),m(24,"Actions"),f(),u(25,"button",28),B(26,"i",29),u(27,"span"),m(28,"Generate summary"),f()(),u(29,"button",30),B(30,"i",31),u(31,"span"),m(32,"Run audit"),f()(),u(33,"button",32),B(34,"i",33),u(35,"span"),m(36,"Validate"),f()()(),w(37,oT,3,0,"div",34),f(),u(38,"div",35)(39,"button",36),K("click",function(){j(e);let o=p();return U(o.toggleDebug())}),B(40,"i",37),f(),u(41,"p-button",38),K("onClick",function(){j(e);let o=p();return U(o.onBumpClick())}),f(),w(42,rT,2,1,"a",39),f(),w(43,sT,4,1,"div",40),w(44,aT,5,1,"div",41),w(45,cT,2,1,"p",42),w(46,dT,2,3,"div",43),u(47,"div",44),w(48,lT,3,6),w(49,uT,2,5,"p-card",45),u(50,"p-card",46),B(51,"sm-vendor-frontmatter",47),f(),u(52,"div",48)(53,"sm-linked-nodes-panel",49),K("openPath",function(o){j(e);let r=p();return U(r.openPath(o))}),f()(),u(54,"p-card",50)(55,"dl",51),w(56,fT,5,1),w(57,hT,5,1),u(58,"dt"),m(59,"Links"),f(),u(60,"dd")(61,"code"),m(62),f(),m(63," out \xB7 "),u(64,"code"),m(65),f(),m(66," in "),w(67,pT,4,1),f()()(),u(68,"p-card",52),Pe(69,mT,6,7,"ng-template",53),w(70,_T,1,1,"sm-inspector-audit-panel",54),f(),u(71,"p-card",55),Pe(72,gT,4,5,"ng-template",53),w(73,yT,1,1,"sm-plugin-contributions",54),f(),u(74,"p-card",56)(75,"div",57),B(76,"sm-view-contributions-host",58),f()(),u(77,"p-card",59),Pe(78,vT,4,6,"ng-template",53),w(79,CT,2,1,"p",60)(80,xT,2,1,"p",61)(81,bT,2,1,"p",62)(82,wT,2,1,"p",63)(83,ST,1,1,"div",64),f()()()}if(t&2){let e,n,o,r,s=p(),a=Le(s.node());c();let l=Le(a.frontmatter);c(2),at("--node-color",s.headerTitleColor()),de("inspector__header--skill",a.kind==="skill")("inspector__header--agent",a.kind==="agent")("inspector__header--command",a.kind==="command")("inspector__header--markdown",a.kind==="markdown"),c(2),P("kind",a.kind)("size",18),c(4),y(l.name),c(2),y(a.path),c(2),de("inspector__favorite--on",a.isFavorite===!0),P("pTooltip",a.isFavorite===!0?s.cardTexts.favoriteRemoveTooltip:s.cardTexts.favoriteAddTooltip),Z("aria-label",a.isFavorite===!0?s.cardTexts.ariaFavoriteRemove:s.cardTexts.ariaFavoriteAdd),c(),Ce(a.isFavorite===!0?"pi pi-heart-fill":"pi pi-heart"),c(),S(s.headerIsStale()?15:-1),c(),S(s.headerStability()==="experimental"?16:-1),c(),S(s.headerStability()==="deprecated"?17:-1),c(),S((e=s.headerVersion())?18:-1,e),c(2),P("node",a),c(),S(s.mode()==="embedded"?21:-1),c(16),S(s.headerTools().length>0?37:-1),c(2),de("inspector__debug-toggle--active",s.debugVisible()),P("pTooltip",s.texts.debugToggleTooltip),Z("aria-label",s.texts.debugToggleAriaLabel)("aria-pressed",s.debugVisible()),c(2),P("label",s.texts.bump.label)("disabled",!s.canBump()||s.bumpInFlight())("loading",s.bumpInFlight())("pTooltip",s.bumpTooltip()),c(),S(s.mode()==="standalone"?42:-1),c(),S((n=s.headerSupersededBy())?43:-1,n),c(),S((o=s.bumpError())?44:-1,o),c(),S(l.description?45:-1),c(),S(s.debugVisible()?46:-1),c(2),S(s.mode()==="standalone"?48:-1),c(),S(a.sidecar!=null&&a.sidecar.present||s.authorTags().length>0?49:-1),c(),P("header",s.texts.cards.agent),c(),P("frontmatter",l)("kind",a.kind)("provider",a.provider)("knownPaths",s.pathSet())("onSkillClick",s.onSkillChip),c(2),P("path",a.path),c(3),S(a.bytesTotal!==void 0?56:-1),c(),S(a.tokensTotal!==void 0?57:-1),c(5),y(a.linksOutCount??0),c(3),y(a.linksInCount??0),c(2),S(a.externalRefsCount!==void 0&&a.externalRefsCount>0?67:-1),c(3),S(s.auditExpanded()?70:-1),c(3),S(s.pluginsExpanded()?73:-1),c(3),P("node",s.node()),c(3),S((r=s.bodyState())==="loading"?79:r==="empty"?80:r==="unavailable"?81:r==="error"?82:r==="ready"?83:-1)}}var TT={stable:"success",experimental:"info",deprecated:"warn"},eu=class t{loader=d(Mt);router=d(po);kindRegistry=d(Dt);dataSource=d(Cn);markdown=d(jh);sidecarService=d(jl);texts=Hl;cardTexts=Wi;path=F(void 0);mode=F("standalone");activeTag=F(null);close=je();tagSelect=je();closeBtn=Ie("closeBtn");node=E(()=>{let i=this.path();return i?this.loader.nodes().find(e=>e.path===i)??null:null});pathSet=E(()=>{let i=new Set;for(let e of this.loader.nodes())i.add(e.path);return i});headerVersion=E(()=>Nl(this.node()));headerStability=E(()=>Ol(this.node()));headerTitleColor=E(()=>{let i=this.node();if(!i)return null;let n=i.frontmatter.color;return typeof n=="string"&&n.length>0?n:`var(--sm-kind-${i.kind})`});headerTools=E(()=>bm(this.node()));authorTags=E(()=>{let e=(this.node()?.frontmatter??{}).tags;if(!Array.isArray(e))return[];let n=e.filter(o=>typeof o=="string"&&o.length>0);return[...new Set(n)].sort()});headerIsStale=E(()=>Fl(this.node()));headerStaleTooltip=E(()=>Al(this.node(),Wi.sidecar));headerSupersededBy=E(()=>{let i=this.node();if(!i)return null;let n=i.sidecar?.annotations?.supersededBy;if(typeof n=="string"&&n.length>0)return n;let o=Zt(i.frontmatter)?.supersededBy;return typeof o=="string"&&o.length>0?o:null});bodyState=q("idle");bodyHtml=q(null);fetchToken=0;verifiedAlive=q(new Set);verifiedDead=q(new Set);verifyInFlight=q(new Set);auditExpanded=q(!1);pluginsExpanded=q(!1);debugVisible=q(!1);constructor(){me(()=>{let i=this.path(),e=++this.fetchToken;if(this.bodyHtml.set(null),!i){this.bodyState.set("idle");return}this.bodyState.set("loading"),this.fetchAndRenderBody(i,e)}),me(()=>{this.path(),this.verifiedAlive.set(new Set),this.verifiedDead.set(new Set),this.verifyInFlight.set(new Set)}),me(()=>{this.path(),this.auditExpanded.set(!1),this.pluginsExpanded.set(!1),this.debugVisible.set(!1)}),me(()=>{let i=this.path();this.mode()==="embedded"&&i&&queueMicrotask(()=>this.closeBtn()?.nativeElement.focus({preventScroll:!0}))})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}kindLabel(i){return this.kindRegistry.labelOf(i)}kindStyle(i){return{background:`var(--sm-kind-${i}-bg)`,color:`var(--sm-kind-${i}-fg)`}}stabilitySeverity(i){return TT[i]}openPath(i){this.router.navigate(["/graph"],{queryParams:{path:i}})}onSkillChip=i=>{this.openPath(i)};pathExists(i){return this.pathSet().has(i)}sidecarRoot=E(()=>{let i=this.node()?.sidecar;if(!i||!i.present)return null;if(i.root)return i.root;let e={};return i.annotations&&(e.annotations=i.annotations),e});auditSummary=E(()=>{let i=this.sidecarRoot();if(!i)return this.texts.audit.headerEmpty;let e=i.audit;if(typeof e!="object"||e===null)return this.texts.audit.headerEmpty;let n=e,o=typeof n.lastBumpedAt=="string"?n.lastBumpedAt:null,r=typeof n.lastBumpedBy=="string"?n.lastBumpedBy:null;return o===null?this.texts.audit.headerEmpty:this.texts.audit.headerSummary(wm(o),r??"?")});linkStatus(i){return this.pathSet().has(i)||this.verifiedAlive().has(i)?"live":this.verifiedDead().has(i)?"dead-confirmed":"dead-heuristic"}isVerifying(i){return this.verifyInFlight().has(i)}async verifyDeadLink(i){if(!(this.verifiedAlive().has(i)||this.verifiedDead().has(i))&&!this.verifyInFlight().has(i)){this.verifyInFlight.update(e=>new Set(e).add(i));try{await this.dataSource.getNode(i)===null?this.verifiedDead.update(n=>new Set(n).add(i)):this.verifiedAlive.update(n=>new Set(n).add(i))}catch{}finally{this.verifyInFlight.update(e=>{let n=new Set(e);return n.delete(i),n})}}}refreshBody(){let i=this.path();if(!i||this.bodyState()==="loading")return;let e=++this.fetchToken;this.bodyHtml.set(null),this.bodyState.set("loading"),this.fetchAndRenderBody(i,e)}toggleFavorite(i){i.stopPropagation();let e=this.node();e&&this.loader.toggleFavorite(e.path,!e.isFavorite)}onCloseClick(i){i.stopPropagation(),this.close.emit()}toggleAudit(){this.auditExpanded.update(i=>!i)}togglePlugins(){this.pluginsExpanded.update(i=>!i)}toggleDebug(){this.debugVisible.update(i=>!i)}canBump=E(()=>{let i=this.node();if(!i)return!1;let e=i.sidecar;return!e||e.present===!1?!0:e.status==="fresh"?!1:yo(e)});bumpInFlight=q(!1);bumpError=q(null);bumpTooltip=E(()=>this.canBump()?this.texts.bump.tooltipEnabled:this.texts.bump.tooltipDisabledFresh);async onBumpClick(){let i=this.node();if(i&&this.canBump()&&!this.bumpInFlight()){this.bumpInFlight.set(!0),this.bumpError.set(null);try{await this.sidecarService.bump(i.path)}catch(e){this.bumpError.set(this.formatBumpError(e))}finally{this.bumpInFlight.set(!1)}}}dismissBumpError(){this.bumpError.set(null)}formatBumpError(i){if(i instanceof Yt)switch(i.code){case"sidecar-fresh":return`${this.texts.bump.errorPrefix} ${this.texts.bump.errorFresh}`;case"not-found":return`${this.texts.bump.errorPrefix} ${this.texts.bump.errorNotFound}`;default:return`${this.texts.bump.errorPrefix} ${i.message||this.texts.bump.errorGeneric}`}let e=i instanceof Error?i.message:String(i);return`${this.texts.bump.errorPrefix} ${e||this.texts.bump.errorGeneric}`}async fetchAndRenderBody(i,e){try{let n=await this.dataSource.getNode(i,{includeBody:!0});if(e!==this.fetchToken)return;if(n===null){this.bodyState.set("unavailable");return}let o=n.item.body;if(o===null){this.bodyState.set("unavailable");return}if(o===void 0||o.trim().length===0){this.bodyState.set("empty");return}let r=await this.markdown.render(o);if(e!==this.fetchToken)return;this.bodyHtml.set(r),this.bodyState.set("ready")}catch{if(e!==this.fetchToken)return;this.bodyState.set("error")}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-inspector-view"]],viewQuery:function(e,n){e&1&&ft(n.closeBtn,KI,5),e&2&&it()},hostVars:2,hostBindings:function(e,n){e&2&&de("inspector-view--embedded",n.mode()==="embedded")},inputs:{path:[1,"path"],mode:[1,"mode"],activeTag:[1,"activeTag"]},outputs:{close:"close",tagSelect:"tagSelect"},decls:3,vars:1,consts:[["closeBtn",""],["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","pi","pi-question-circle",2,"color","var(--sm-severity-warn)","opacity","1"],["data-testid","inspector-title",1,"inspector__header"],["aria-hidden","true",1,"inspector__icon-box"],[3,"kind","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"],["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"],["data-debug-slot","inspector.header.badge",1,"sm-debug-slot"],["slot","inspector.header.badge",3,"node"],["type","button","data-testid","inspector-close",1,"inspector__close",3,"pTooltip"],["data-testid","inspector-plugin-actions",1,"inspector__plugin-actions"],[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"],["data-testid","inspector-header-tools",1,"inspector__tools"],[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"],["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"],[3,"frontmatter","kind","provider","knownPaths","onSkillClick"],["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"],["data-debug-slot","inspector.body.panel",1,"sm-debug-slot"],["slot","inspector.body.panel",3,"node"],["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"],["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__tool-tag"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],["type","button","aria-label","Dismiss",1,"inspector__bump-error-dismiss",3,"click"],[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"],["icon","pi pi-search","testId","inspector-empty-findings",3,"title","body"],[3,"openPath","tagClick","overlay","authorTags","knownPaths","activeTag"],["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"],[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"]],template:function(e,n){e&1&&w(0,YI,13,6,"section",1)(1,ZI,12,5,"section",1)(2,IT,84,61,"section",1),e&2&&S(n.path()?n.node()?2:1:0)},dependencies:[Fh,bn,gn,Gl,qi,vn,yn,Ue,Qe,Wl,ql,$l,Kl,Yl,xn,Zl,Jl,Ut],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:.25rem;font-size:.85rem}.inspector__header[_ngcontent-%COMP%]{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, var(--sm-kind-markdown)) 75%,#475569);color:#fff;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__icon-box[_ngcontent-%COMP%]{width:42px;height:42px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:#fff3;color:#fff;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:#fff;flex:0 1 auto;min-width:0}.inspector__path-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;color:#ffffffeb;background:#ffffff29;padding:.1rem .4rem;border-radius:3px;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:#ffffffeb;border-radius:4px;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:#ffffff2e;color:#fff}.inspector__favorite[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(255,255,255,.7);outline-offset:1px}.inspector__favorite--on[_ngcontent-%COMP%]{color:#fff}.inspector__stability-icon[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;color:#ffffffeb;cursor:help}.inspector__stale-icon[_ngcontent-%COMP%]{color:#fde68a}.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:#ffffff29;border:1px solid rgba(255,255,255,.32);border-radius:4px;padding:0;margin-left:.25rem;color:#fff;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:#ffffff42;border-color:#ffffff73}.inspector__close[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(255,255,255,.7);outline-offset:1px}.inspector__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.66rem;color:#fffffff2;background:#fff3;padding:.06rem .4rem;border-radius:3px;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:#ffffffbf;margin-right:.15rem}.inspector__plugin-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .75rem;border:1px solid rgba(255,255,255,.32);border-radius:999px;background:#ffffff29;color:#fff;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:#ffffff42;border-color:#ffffff73}.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:3px;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}.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 .p-card{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:4px;padding:.75rem;margin:.75rem 0;white-space:pre-wrap;word-wrap:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;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:3px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;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:.25rem;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 .p-chip{cursor:pointer;background:var(--p-primary-50);color:var(--p-primary-color);transition:background .15s ease}[_nghost-%COMP%] .chip--link:hover .p-chip{background:var(--p-primary-100)}[_nghost-%COMP%] .chip--dead .p-chip{background:var(--sm-bg-hover);color:var(--p-text-muted-color);text-decoration:line-through;cursor:not-allowed}[_nghost-%COMP%] .chip--warn .p-chip{background:var(--sm-kind-command-bg);color:var(--sm-kind-command-fg)}[_nghost-%COMP%] .chip--dead-confirmed .p-chip{background:var(--sm-bg-hover);color:var(--sm-severity-error);border:1px dashed var(--sm-severity-error)}.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:.25rem;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:.25rem;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__header[_ngcontent-%COMP%]{margin:-1rem -1.1rem 0}.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:4px;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:4px;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:4px;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}"],changeDetection:0})};function lh(t,i){var e,n=1;t==null&&(t=0),i==null&&(i=0);function o(){var r,s=e.length,a,l=0,h=0;for(r=0;r<s;++r)a=e[r],l+=a.x,h+=a.y;for(l=(l/s-t)*n,h=(h/s-i)*n,r=0;r<s;++r)a=e[r],a.x-=l,a.y-=h}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?(i=+r,o):i},o.strength=function(r){return arguments.length?(n=+r,o):n},o}function Vm(t){let i=+this._x.call(null,t),e=+this._y.call(null,t);return Gm(this.cover(i,e),i,e,t)}function Gm(t,i,e,n){if(isNaN(i)||isNaN(e))return t;var o,r=t._root,s={data:n},a=t._x0,l=t._y0,h=t._x1,_=t._y1,v,b,I,N,D,M,k,O;if(!r)return t._root=s,t;for(;r.length;)if((D=i>=(v=(a+h)/2))?a=v:h=v,(M=e>=(b=(l+_)/2))?l=b:_=b,o=r,!(r=r[k=M<<1|D]))return o[k]=s,t;if(I=+t._x.call(null,r.data),N=+t._y.call(null,r.data),i===I&&e===N)return s.next=r,o?o[k]=s:t._root=s,t;do o=o?o[k]=new Array(4):t._root=new Array(4),(D=i>=(v=(a+h)/2))?a=v:h=v,(M=e>=(b=(l+_)/2))?l=b:_=b;while((k=M<<1|D)===(O=(N>=b)<<1|I>=v));return o[O]=r,o[k]=s,t}function Hm(t){var i,e,n=t.length,o,r,s=new Array(n),a=new Array(n),l=1/0,h=1/0,_=-1/0,v=-1/0;for(e=0;e<n;++e)isNaN(o=+this._x.call(null,i=t[e]))||isNaN(r=+this._y.call(null,i))||(s[e]=o,a[e]=r,o<l&&(l=o),o>_&&(_=o),r<h&&(h=r),r>v&&(v=r));if(l>_||h>v)return this;for(this.cover(l,h).cover(_,v),e=0;e<n;++e)Gm(this,s[e],a[e],t[e]);return this}function jm(t,i){if(isNaN(t=+t)||isNaN(i=+i))return this;var e=this._x0,n=this._y0,o=this._x1,r=this._y1;if(isNaN(e))o=(e=Math.floor(t))+1,r=(n=Math.floor(i))+1;else{for(var s=o-e||1,a=this._root,l,h;e>t||t>=o||n>i||i>=r;)switch(h=(i<n)<<1|t<e,l=new Array(4),l[h]=a,a=l,s*=2,h){case 0:o=e+s,r=n+s;break;case 1:e=o-s,r=n+s;break;case 2:o=e+s,n=r-s;break;case 3:e=o-s,n=r-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=e,this._y0=n,this._x1=o,this._y1=r,this}function Um(){var t=[];return this.visit(function(i){if(!i.length)do t.push(i.data);while(i=i.next)}),t}function $m(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 ze(t,i,e,n,o){this.node=t,this.x0=i,this.y0=e,this.x1=n,this.y1=o}function Wm(t,i,e){var n,o=this._x0,r=this._y0,s,a,l,h,_=this._x1,v=this._y1,b=[],I=this._root,N,D;for(I&&b.push(new ze(I,o,r,_,v)),e==null?e=1/0:(o=t-e,r=i-e,_=t+e,v=i+e,e*=e);N=b.pop();)if(!(!(I=N.node)||(s=N.x0)>_||(a=N.y0)>v||(l=N.x1)<o||(h=N.y1)<r))if(I.length){var M=(s+l)/2,k=(a+h)/2;b.push(new ze(I[3],M,k,l,h),new ze(I[2],s,k,M,h),new ze(I[1],M,a,l,k),new ze(I[0],s,a,M,k)),(D=(i>=k)<<1|t>=M)&&(N=b[b.length-1],b[b.length-1]=b[b.length-1-D],b[b.length-1-D]=N)}else{var O=t-+this._x.call(null,I.data),z=i-+this._y.call(null,I.data),V=O*O+z*z;if(V<e){var W=Math.sqrt(e=V);o=t-W,r=i-W,_=t+W,v=i+W,n=I.data}}return n}function qm(t){if(isNaN(_=+this._x.call(null,t))||isNaN(v=+this._y.call(null,t)))return this;var i,e=this._root,n,o,r,s=this._x0,a=this._y0,l=this._x1,h=this._y1,_,v,b,I,N,D,M,k;if(!e)return this;if(e.length)for(;;){if((N=_>=(b=(s+l)/2))?s=b:l=b,(D=v>=(I=(a+h)/2))?a=I:h=I,i=e,!(e=e[M=D<<1|N]))return this;if(!e.length)break;(i[M+1&3]||i[M+2&3]||i[M+3&3])&&(n=i,k=M)}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):i?(r?i[M]=r:delete i[M],(e=i[0]||i[1]||i[2]||i[3])&&e===(i[3]||i[2]||i[1]||i[0])&&!e.length&&(n?n[k]=e:this._root=e),this):(this._root=r,this)}function Xm(t){for(var i=0,e=t.length;i<e;++i)this.remove(t[i]);return this}function Km(){return this._root}function Ym(){var t=0;return this.visit(function(i){if(!i.length)do++t;while(i=i.next)}),t}function Zm(t){var i=[],e,n=this._root,o,r,s,a,l;for(n&&i.push(new ze(n,this._x0,this._y0,this._x1,this._y1));e=i.pop();)if(!t(n=e.node,r=e.x0,s=e.y0,a=e.x1,l=e.y1)&&n.length){var h=(r+a)/2,_=(s+l)/2;(o=n[3])&&i.push(new ze(o,h,_,a,l)),(o=n[2])&&i.push(new ze(o,r,_,h,l)),(o=n[1])&&i.push(new ze(o,h,s,a,_)),(o=n[0])&&i.push(new ze(o,r,s,h,_))}return this}function Qm(t){var i=[],e=[],n;for(this._root&&i.push(new ze(this._root,this._x0,this._y0,this._x1,this._y1));n=i.pop();){var o=n.node;if(o.length){var r,s=n.x0,a=n.y0,l=n.x1,h=n.y1,_=(s+l)/2,v=(a+h)/2;(r=o[0])&&i.push(new ze(r,s,a,_,v)),(r=o[1])&&i.push(new ze(r,_,a,l,v)),(r=o[2])&&i.push(new ze(r,s,v,_,h)),(r=o[3])&&i.push(new ze(r,_,v,l,h))}e.push(n)}for(;n=e.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this}function Jm(t){return t[0]}function e_(t){return arguments.length?(this._x=t,this):this._x}function t_(t){return t[1]}function n_(t){return arguments.length?(this._y=t,this):this._y}function fn(t,i,e){var n=new uh(i??Jm,e??t_,NaN,NaN,NaN,NaN);return t==null?n:n.addAll(t)}function uh(t,i,e,n,o,r){this._x=t,this._y=i,this._x0=e,this._y0=n,this._x1=o,this._y1=r,this._root=void 0}function i_(t){for(var i={data:t.data},e=i;t=t.next;)e=e.next={data:t.data};return i}var Ke=fn.prototype=uh.prototype;Ke.copy=function(){var t=new uh(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root,e,n;if(!i)return t;if(!i.length)return t._root=i_(i),t;for(e=[{source:i,target:t._root=new Array(4)}];i=e.pop();)for(var o=0;o<4;++o)(n=i.source[o])&&(n.length?e.push({source:n,target:i.target[o]=new Array(4)}):i.target[o]=i_(n));return t};Ke.add=Vm;Ke.addAll=Hm;Ke.cover=jm;Ke.data=Um;Ke.extent=$m;Ke.find=Wm;Ke.remove=qm;Ke.removeAll=Xm;Ke.root=Km;Ke.size=Ym;Ke.visit=Zm;Ke.visitAfter=Qm;Ke.x=e_;Ke.y=n_;function Oe(t){return function(){return t}}function _t(t){return(t()-.5)*1e-6}function ET(t){return t.x+t.vx}function PT(t){return t.y+t.vy}function tu(t){var i,e,n,o=1,r=1;typeof t!="function"&&(t=Oe(t==null?1:+t));function s(){for(var h,_=i.length,v,b,I,N,D,M,k=0;k<r;++k)for(v=fn(i,ET,PT).visitAfter(a),h=0;h<_;++h)b=i[h],D=e[b.index],M=D*D,I=b.x+b.vx,N=b.y+b.vy,v.visit(O);function O(z,V,W,oe,be){var re=z.data,le=z.r,ie=D+le;if(re){if(re.index>b.index){var ce=I-re.x-re.vx,Ge=N-re.y-re.vy,ve=ce*ce+Ge*Ge;ve<ie*ie&&(ce===0&&(ce=_t(n),ve+=ce*ce),Ge===0&&(Ge=_t(n),ve+=Ge*Ge),ve=(ie-(ve=Math.sqrt(ve)))/ve*o,b.vx+=(ce*=ve)*(ie=(le*=le)/(M+le)),b.vy+=(Ge*=ve)*ie,re.vx-=ce*(ie=1-ie),re.vy-=Ge*ie)}return}return V>I+ie||oe<I-ie||W>N+ie||be<N-ie}}function a(h){if(h.data)return h.r=e[h.data.index];for(var _=h.r=0;_<4;++_)h[_]&&h[_].r>h.r&&(h.r=h[_].r)}function l(){if(i){var h,_=i.length,v;for(e=new Array(_),h=0;h<_;++h)v=i[h],e[v.index]=+t(v,h,i)}}return s.initialize=function(h,_){i=h,n=_,l()},s.iterations=function(h){return arguments.length?(r=+h,s):r},s.strength=function(h){return arguments.length?(o=+h,s):o},s.radius=function(h){return arguments.length?(t=typeof h=="function"?h:Oe(+h),l(),s):t},s}function MT(t){return t.index}function o_(t,i){var e=t.get(i);if(!e)throw new Error("node not found: "+i);return e}function nu(t){var i=MT,e=v,n,o=Oe(30),r,s,a,l,h,_=1;t==null&&(t=[]);function v(M){return 1/Math.min(a[M.source.index],a[M.target.index])}function b(M){for(var k=0,O=t.length;k<_;++k)for(var z=0,V,W,oe,be,re,le,ie;z<O;++z)V=t[z],W=V.source,oe=V.target,be=oe.x+oe.vx-W.x-W.vx||_t(h),re=oe.y+oe.vy-W.y-W.vy||_t(h),le=Math.sqrt(be*be+re*re),le=(le-r[z])/le*M*n[z],be*=le,re*=le,oe.vx-=be*(ie=l[z]),oe.vy-=re*ie,W.vx+=be*(ie=1-ie),W.vy+=re*ie}function I(){if(s){var M,k=s.length,O=t.length,z=new Map(s.map((W,oe)=>[i(W,oe,s),W])),V;for(M=0,a=new Array(k);M<O;++M)V=t[M],V.index=M,typeof V.source!="object"&&(V.source=o_(z,V.source)),typeof V.target!="object"&&(V.target=o_(z,V.target)),a[V.source.index]=(a[V.source.index]||0)+1,a[V.target.index]=(a[V.target.index]||0)+1;for(M=0,l=new Array(O);M<O;++M)V=t[M],l[M]=a[V.source.index]/(a[V.source.index]+a[V.target.index]);n=new Array(O),N(),r=new Array(O),D()}}function N(){if(s)for(var M=0,k=t.length;M<k;++M)n[M]=+e(t[M],M,t)}function D(){if(s)for(var M=0,k=t.length;M<k;++M)r[M]=+o(t[M],M,t)}return b.initialize=function(M,k){s=M,h=k,I()},b.links=function(M){return arguments.length?(t=M,I(),b):t},b.id=function(M){return arguments.length?(i=M,b):i},b.iterations=function(M){return arguments.length?(_=+M,b):_},b.strength=function(M){return arguments.length?(e=typeof M=="function"?M:Oe(+M),N(),b):e},b.distance=function(M){return arguments.length?(o=typeof M=="function"?M:Oe(+M),D(),b):o},b}var DT={value:()=>{}};function s_(){for(var t=0,i=arguments.length,e={},n;t<i;++t){if(!(n=arguments[t]+"")||n in e||/[\s.]/.test(n))throw new Error("illegal type: "+n);e[n]=[]}return new iu(e)}function iu(t){this._=t}function kT(t,i){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");if(o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),e&&!i.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}iu.prototype=s_.prototype={constructor:iu,on:function(t,i){var e=this._,n=kT(t+"",e),o,r=-1,s=n.length;if(arguments.length<2){for(;++r<s;)if((o=(t=n[r]).type)&&(o=RT(e[o],t.name)))return o;return}if(i!=null&&typeof i!="function")throw new Error("invalid callback: "+i);for(;++r<s;)if(o=(t=n[r]).type)e[o]=r_(e[o],t.name,i);else if(i==null)for(o in e)e[o]=r_(e[o],t.name,null);return this},copy:function(){var t={},i=this._;for(var e in i)t[e]=i[e].slice();return new iu(t)},call:function(t,i){if((o=arguments.length-2)>0)for(var e=new Array(o),n=0,o,r;n<o;++n)e[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],n=0,o=r.length;n<o;++n)r[n].value.apply(i,e)},apply:function(t,i,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,r=n.length;o<r;++o)n[o].value.apply(i,e)}};function RT(t,i){for(var e=0,n=t.length,o;e<n;++e)if((o=t[e]).name===i)return o.value}function r_(t,i,e){for(var n=0,o=t.length;n<o;++n)if(t[n].name===i){t[n]=DT,t=t.slice(0,n).concat(t.slice(n+1));break}return e!=null&&t.push({name:i,value:e}),t}var fh=s_;var qn=0,Yi=0,Ki=0,c_=1e3,ou,Zi,ru=0,hn=0,su=0,Qi=typeof performance=="object"&&performance.now?performance:Date,d_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mh(){return hn||(d_(NT),hn=Qi.now()+su)}function NT(){hn=0}function hh(){this._call=this._time=this._next=null}hh.prototype=au.prototype={constructor:hh,restart:function(t,i,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?mh():+e)+(i==null?0:+i),!this._next&&Zi!==this&&(Zi?Zi._next=this:ou=this,Zi=this),this._call=t,this._time=e,ph()},stop:function(){this._call&&(this._call=null,this._time=1/0,ph())}};function au(t,i,e){var n=new hh;return n.restart(t,i,e),n}function l_(){mh(),++qn;for(var t=ou,i;t;)(i=hn-t._time)>=0&&t._call.call(void 0,i),t=t._next;--qn}function a_(){hn=(ru=Qi.now())+su,qn=Yi=0;try{l_()}finally{qn=0,FT(),hn=0}}function OT(){var t=Qi.now(),i=t-ru;i>c_&&(su-=i,ru=t)}function FT(){for(var t,i=ou,e,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:ou=e);Zi=t,ph(n)}function ph(t){if(!qn){Yi&&(Yi=clearTimeout(Yi));var i=t-hn;i>24?(t<1/0&&(Yi=setTimeout(a_,t-Qi.now()-su)),Ki&&(Ki=clearInterval(Ki))):(Ki||(ru=Qi.now(),Ki=setInterval(OT,c_)),qn=1,d_(a_))}}function u_(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}function f_(t){return t.x}function h_(t){return t.y}var AT=10,LT=Math.PI*(3-Math.sqrt(5));function cu(t){var i,e=1,n=.001,o=1-Math.pow(n,1/300),r=0,s=.6,a=new Map,l=au(v),h=fh("tick","end"),_=u_();t==null&&(t=[]);function v(){b(),h.call("tick",i),e<n&&(l.stop(),h.call("end",i))}function b(D){var M,k=t.length,O;D===void 0&&(D=1);for(var z=0;z<D;++z)for(e+=(r-e)*o,a.forEach(function(V){V(e)}),M=0;M<k;++M)O=t[M],O.fx==null?O.x+=O.vx*=s:(O.x=O.fx,O.vx=0),O.fy==null?O.y+=O.vy*=s:(O.y=O.fy,O.vy=0);return i}function I(){for(var D=0,M=t.length,k;D<M;++D){if(k=t[D],k.index=D,k.fx!=null&&(k.x=k.fx),k.fy!=null&&(k.y=k.fy),isNaN(k.x)||isNaN(k.y)){var O=AT*Math.sqrt(.5+D),z=D*LT;k.x=O*Math.cos(z),k.y=O*Math.sin(z)}(isNaN(k.vx)||isNaN(k.vy))&&(k.vx=k.vy=0)}}function N(D){return D.initialize&&D.initialize(t,_),D}return I(),i={tick:b,restart:function(){return l.restart(v),i},stop:function(){return l.stop(),i},nodes:function(D){return arguments.length?(t=D,I(),a.forEach(N),i):t},alpha:function(D){return arguments.length?(e=+D,i):e},alphaMin:function(D){return arguments.length?(n=+D,i):n},alphaDecay:function(D){return arguments.length?(o=+D,i):+o},alphaTarget:function(D){return arguments.length?(r=+D,i):r},velocityDecay:function(D){return arguments.length?(s=1-D,i):1-s},randomSource:function(D){return arguments.length?(_=D,a.forEach(N),i):_},force:function(D,M){return arguments.length>1?(M==null?a.delete(D):a.set(D,N(M)),i):a.get(D)},find:function(D,M,k){var O=0,z=t.length,V,W,oe,be,re;for(k==null?k=1/0:k*=k,O=0;O<z;++O)be=t[O],V=D-be.x,W=M-be.y,oe=V*V+W*W,oe<k&&(re=be,k=oe);return re},on:function(D,M){return arguments.length>1?(h.on(D,M),i):h.on(D)}}}function du(){var t,i,e,n,o=Oe(-30),r,s=1,a=1/0,l=.81;function h(I){var N,D=t.length,M=fn(t,f_,h_).visitAfter(v);for(n=I,N=0;N<D;++N)i=t[N],M.visit(b)}function _(){if(t){var I,N=t.length,D;for(r=new Array(N),I=0;I<N;++I)D=t[I],r[D.index]=+o(D,I,t)}}function v(I){var N=0,D,M,k=0,O,z,V;if(I.length){for(O=z=V=0;V<4;++V)(D=I[V])&&(M=Math.abs(D.value))&&(N+=D.value,k+=M,O+=M*D.x,z+=M*D.y);I.x=O/k,I.y=z/k}else{D=I,D.x=D.data.x,D.y=D.data.y;do N+=r[D.data.index];while(D=D.next)}I.value=N}function b(I,N,D,M){if(!I.value)return!0;var k=I.x-i.x,O=I.y-i.y,z=M-N,V=k*k+O*O;if(z*z/l<V)return V<a&&(k===0&&(k=_t(e),V+=k*k),O===0&&(O=_t(e),V+=O*O),V<s&&(V=Math.sqrt(s*V)),i.vx+=k*I.value*n/V,i.vy+=O*I.value*n/V),!0;if(I.length||V>=a)return;(I.data!==i||I.next)&&(k===0&&(k=_t(e),V+=k*k),O===0&&(O=_t(e),V+=O*O),V<s&&(V=Math.sqrt(s*V)));do I.data!==i&&(z=r[I.data.index]*n/V,i.vx+=k*z,i.vy+=O*z);while(I=I.next)}return h.initialize=function(I,N){t=I,e=N,_()},h.strength=function(I){return arguments.length?(o=typeof I=="function"?I:Oe(+I),_(),h):o},h.distanceMin=function(I){return arguments.length?(s=I*I,h):Math.sqrt(s)},h.distanceMax=function(I){return arguments.length?(a=I*I,h):Math.sqrt(a)},h.theta=function(I){return arguments.length?(l=I*I,h):Math.sqrt(l)},h}function lu(t){var i=Oe(.1),e,n,o;typeof t!="function"&&(t=Oe(t==null?0:+t));function r(a){for(var l=0,h=e.length,_;l<h;++l)_=e[l],_.vx+=(o[l]-_.x)*n[l]*a}function s(){if(e){var a,l=e.length;for(n=new Array(l),o=new Array(l),a=0;a<l;++a)n[a]=isNaN(o[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return r.initialize=function(a){e=a,s()},r.strength=function(a){return arguments.length?(i=typeof a=="function"?a:Oe(+a),s(),r):i},r.x=function(a){return arguments.length?(t=typeof a=="function"?a:Oe(+a),s(),r):t},r}function uu(t){var i=Oe(.1),e,n,o;typeof t!="function"&&(t=Oe(t==null?0:+t));function r(a){for(var l=0,h=e.length,_;l<h;++l)_=e[l],_.vy+=(o[l]-_.y)*n[l]*a}function s(){if(e){var a,l=e.length;for(n=new Array(l),o=new Array(l),a=0;a<l;++a)n[a]=isNaN(o[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return r.initialize=function(a){e=a,s()},r.strength=function(a){return arguments.length?(i=typeof a=="function"?a:Oe(+a),s(),r):i},r.y=function(a){return arguments.length?(t=typeof a=="function"?a:Oe(+a),s(),r):t},r}var Ji=260,_h=120;function BT(t,i){let e=t.map(o=>o.path).sort(),n=i.map(o=>o.id).sort();return`${e.length}|${e.join(",")}|${n.length}|${n.join(",")}`}function p_(){let t=null;return(i,e)=>{let n=new Set(i.map(b=>b.path)),o=new Map,r=e?.links??[];for(let b of r){if(!n.has(b.source)||!n.has(b.target)||b.source===b.target)continue;let I=GT(b.kind,b.source,b.target);o.has(I)||o.set(I,{id:I,from:b.source,to:b.target,kind:b.kind})}let s=[...o.values()],a=new Map;for(let b of i)a.set(b.path,b);let l=new Map;for(let b of e?.nodes??[])l.set(b.path,b);let h=BT(i,s);if(t&&t.fingerprint===h)return{nodesByPath:a,apiNodesByPath:l,edges:t.edges,positions:t.positions,computedAt:t.computedAt};let _=zT(i,s),v=performance.now();return t={fingerprint:h,positions:_,edges:s,computedAt:v},{nodesByPath:a,apiNodesByPath:l,edges:s,positions:_,computedAt:v}}}function zT(t,i){let e=t.map(a=>({id:a.path})),n=i.map(a=>({source:a.from,target:a.to})),o=cu(e).force("link",nu(n).id(a=>a.id).distance(90).strength(1)).force("charge",du().strength(-200)).force("center",lh(0,0)).force("x",lu(0).strength(.06)).force("y",uu(0).strength(.06)).force("collide",tu(Ji/2+12)).stop(),r=400;for(let a=0;a<r;a++)o.tick();let s=new Map;for(let a of e)s.set(a.id,{x:(a.x??0)-Ji/2,y:(a.y??0)-_h/2});return s}function m_(t,i,e,n){let o=new Set(n),r=t.map(_=>{let v={id:_.path};if(o.has(_.path))return v;let b=e[_.path];if(!b)return v;let I=b.x+Ji/2,N=b.y+_h/2;return v.x=I,v.y=N,v.fx=I,v.fy=N,v}),s=i.map(_=>({source:_.from,target:_.to})),a=cu(r).force("link",nu(s).id(_=>_.id).distance(90).strength(1)).force("charge",du().strength(-200)).force("x",lu(0).strength(.06)).force("y",uu(0).strength(.06)).force("collide",tu(Ji/2+12)).stop(),l=200;for(let _=0;_<l;_++)a.tick();let h=new Map;for(let _ of r)o.has(_.id)&&h.set(_.id,{x:(_.x??0)-Ji/2,y:(_.y??0)-_h/2});return h}function __(t,i,e){let n=t.edges.filter(a=>i.has(a.from)&&i.has(a.to)),o=new Map,r=new Map;for(let a of n)o.set(a.from,(o.get(a.from)??0)+1),r.set(a.to,(r.get(a.to)??0)+1);let s=[];for(let a of i){let l=t.nodesByPath.get(a);if(!l)continue;let h=t.apiNodesByPath.get(a),_=e[a],v=t.positions.get(a)??{x:0,y:0},b=_?{x:_.x,y:_.y}:v;s.push({id:a,path:a,view:l,kind:l.kind,position:b,stats:{linksIn:r.get(a)??0,linksOut:o.get(a)??0,bytesTotal:h?.bytes.total,tokensTotal:h?.tokens?.total,externalRefsCount:h?.externalRefsCount},summary:VT(l)})}return{nodes:s,edges:n}}function VT(t){let i={injectionDetected:!1,contentQuality:"clean"},e=(t.frontmatter.description??t.frontmatter.name??"").trim();return{kind:"markdown",confidence:.6,safety:i,whatItCovers:e||`${t.kind} entry`,topics:[],keyFacts:[]}}function GT(t,i,e){let[n,o]=[i,e].sort();return`${t}:${n}::${o}`}var HT=["canvasWrap"],w_=(t,i)=>i.id;function jT(t,i){if(t&1&&(u(0,"div",2),B(1,"span",6),u(2,"p",7),m(3),f()()),t&2){let e=p();c(3),y(e.texts.loading)}}function UT(t,i){if(t&1&&(u(0,"div",3),B(1,"span",8),u(2,"p",7),m(3),f(),u(4,"p",9),m(5),f()()),t&2){let e=p();c(3),y(e.texts.errorTitle),c(2),y(e.error())}}function $T(t,i){if(t&1&&(u(0,"div",4),B(1,"span",10),u(2,"p",7),m(3),f(),u(4,"p",9),m(5),f()()),t&2){let e=p();c(3),y(e.texts.emptyTitle),c(2),y(e.texts.emptyDesc)}}function WT(t,i){if(t&1&&(u(0,"f-connection",28),B(1,"f-connection-marker-arrow",29),f()),t&2){let e=i.$implicit,n=p(2);Ce("f-conn--"+e.kind),de("f-conn--highlighted",n.isEdgeHighlighted(e))("f-conn--dimmed",n.isEdgeDimmed(e)),P("fOutputId",e.from+"-out")("fInputId",e.to+"-in")("fType",n.connectionType)("fBehavior",n.connectionBehavior)("fOffset",4)("fReassignDisabled",!0)("fSelectionDisabled",!0),c(),P("type",n.markerEnd)}}function qT(t,i){if(t&1){let e=ae();Wt(0,17),u(1,"div",31),K("fNodePositionChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.onNodePositionChange(r.id,o))})("pointerdown",function(o){j(e);let r=p(3);return U(r.onNodePointerDown(o))})("click",function(o){let r=j(e).$implicit,s=p(3);return U(s.selectNode(r,o))})("dblclick",function(){let o=j(e).$implicit,r=p(3);return U(r.openNode(o))}),B(2,"div",32),u(3,"sm-node-card",33),K("expandedChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.setExpanded(r.id,o))})("favoriteToggle",function(o){j(e);let r=p(3);return U(r.onFavoriteToggle(o))}),f(),u(4,"div",34)(5,"div",35)(6,"span",36),Ae(),u(7,"svg",37),B(8,"path",38)(9,"path",39)(10,"path",40),f()(),_u(),B(11,"sm-view-contributions-host",41),f()(),B(12,"div",42),f(),qt()}if(t&2){let e=i.$implicit,n=p(3);c(),P("fNodeId",e.id)("fNodePosition",e.position),Z("data-testid","graph-node-"+e.id),c(),P("fInputId",e.id+"-in")("fInputConnectableSide",n.inputSide),c(),P("node",e.view)("stats",e.stats)("summary",e.summary)("selected",n.isSelected(e.id))("highlighted",n.isHighlighted(e.id))("dimmed",n.isDimmed(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),c(8),P("node",e.view),c(),P("fOutputId",e.id+"-out")("fOutputConnectableSide",n.outputSide)}}function XT(t,i){if(t&1&&Pe(0,qT,13,16,"ng-container",30),t&2){let e=p(2);P("fVirtualForOf",e.graph().nodes)}}function KT(t,i){if(t&1){let e=ae();u(0,"div",31),K("fNodePositionChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.onNodePositionChange(r.id,o))})("pointerdown",function(o){j(e);let r=p(3);return U(r.onNodePointerDown(o))})("click",function(o){let r=j(e).$implicit,s=p(3);return U(s.selectNode(r,o))})("dblclick",function(){let o=j(e).$implicit,r=p(3);return U(r.openNode(o))}),B(1,"div",32),u(2,"sm-node-card",33),K("expandedChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.setExpanded(r.id,o))})("favoriteToggle",function(o){j(e);let r=p(3);return U(r.onFavoriteToggle(o))}),f(),u(3,"div",34)(4,"div",35)(5,"span",36),Ae(),u(6,"svg",37),B(7,"path",38)(8,"path",39)(9,"path",40),f()(),_u(),B(10,"sm-view-contributions-host",41),f()(),B(11,"div",42),f()}if(t&2){let e=i.$implicit,n=p(3);P("fNodeId",e.id)("fNodePosition",e.position),Z("data-testid","graph-node-"+e.id),c(),P("fInputId",e.id+"-in")("fInputConnectableSide",n.inputSide),c(),P("node",e.view)("stats",e.stats)("summary",e.summary)("selected",n.isSelected(e.id))("highlighted",n.isHighlighted(e.id))("dimmed",n.isDimmed(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),c(8),P("node",e.view),c(),P("fOutputId",e.id+"-out")("fOutputConnectableSide",n.outputSide)}}function YT(t,i){if(t&1&&(Wt(0,17),J(1,KT,12,16,"div",43,w_),qt()),t&2){let e=p(2);c(),ee(e.graph().nodes)}}function ZT(t,i){if(t&1&&B(0,"app-perf-hud",21),t&2){let e=p(2);P("visible",e.visibleCount())("total",e.totalCount())("edges",e.edgeCount())("cacheAt",e.layoutComputedAt())}}function QT(t,i){if(t&1){let e=ae();u(0,"div",11,0),K("mousedown",function(o){j(e);let r=p();return U(r.onCanvasMouseDown(o))})("click",function(o){j(e);let r=p();return U(r.onCanvasClick(o))}),u(2,"f-flow",12),K("fLoaded",function(){j(e);let o=p();return U(o.onLoaded())}),B(3,"f-selection-area"),u(4,"f-background"),B(5,"f-rect-pattern"),f(),B(6,"f-line-alignment",13),u(7,"f-canvas",14),K("fCanvasChange",function(o){j(e);let r=p();return U(r.onCanvasChange(o))}),Wt(8,15),J(9,WT,2,14,"f-connection",16,w_),qt(),w(11,XT,1,1,"ng-container",17)(12,YT,3,0,"ng-container",17),f(),B(13,"f-minimap"),f(),B(14,"app-kind-palette"),u(15,"aside",18)(16,"div",19),K("mousedown",function(o){j(e);let r=p();return U(r.onPanelResizeStart(o))}),f(),u(17,"app-inspector-view",20),K("close",function(){j(e);let o=p();return U(o.closePanel())})("tagSelect",function(o){j(e);let r=p();return U(r.onTagSelect(o))}),f()(),w(18,ZT,1,4,"app-perf-hud",21),u(19,"div",22)(20,"p-button",23),K("onClick",function(){j(e);let o=p();return U(o.zoomIn())}),f(),u(21,"p-button",24),K("onClick",function(){j(e);let o=p();return U(o.zoomOut())}),f(),u(22,"p-button",25),K("onClick",function(){j(e);let o=p();return U(o.fitToScreen())}),f(),B(23,"span",26),u(24,"p-button",27),K("onClick",function(){j(e);let o=p();return U(o.resetLayout())}),f()()()}if(t&2){let e=p();c(2),P("fCache",e.perf.cache),c(4),P("fAlignThreshold",20),c(),P("position",e.viewportPosition())("scale",e.viewportScale())("fZoomStep",.06)("fZoomDblClickStep",.35)("debounceTime",150),c(2),ee(e.graph().edges),c(2),S(e.perf.virtualization?11:12),c(4),at("width",e.clampedPanelWidth(),"px"),de("is-open",e.selectedNodeId()!==null),Z("aria-label",e.texts.a11y.panel),c(),Z("aria-label",e.texts.panel.resizeLabel),c(),P("path",e.selectedPath())("activeTag",e.activeTagSelection()),c(),S(e.perfHud()?18:-1),c(),Z("aria-label",e.texts.a11y.toolbar),c(),P("ariaLabel",e.texts.toolbar.zoomIn)("pTooltip",e.texts.toolbar.zoomIn)("text",!0)("rounded",!0)("disabled",!e.canZoomIn()),c(),P("ariaLabel",e.texts.toolbar.zoomOut)("pTooltip",e.texts.toolbar.zoomOut)("text",!0)("rounded",!0)("disabled",!e.canZoomOut()),c(),P("ariaLabel",e.texts.toolbar.fitToScreen)("pTooltip",e.texts.toolbar.fitToScreen)("text",!0)("rounded",!0),c(2),P("ariaLabel",e.texts.toolbar.resetLayoutLabel)("pTooltip",e.texts.toolbar.resetLayoutTooltip)("text",!0)("rounded",!0)}}var g_=.1,JT=4,y_=320,v_=.2,S_="sm.graph.viewport",I_="sm.graph.node-positions",T_="sm.graph.node-expanded",E_="sm.graph.panel-width",gh=400,fu=400,C_=80,x_=class t{loader=d(Mt);filters=d(vo);router=d(po);route=d(Oh);flow=Ie(Ui);canvas=Ie(ji);zoom=Ie($i);canvasWrap=Ie("canvasWrap");outputSide=L.BOTTOM;inputSide=L.TOP;connectionType=Nt.SEGMENT;connectionBehavior=Ot.FIXED;markerEnd=ge.END_ALL_STATES;perf=kl.graph.perf;perfHud=d(Vl).visible;pointerDownAt=null;savedViewport=eE();hasCompletedInitialLayout=!1;viewportPosition=q(this.savedViewport?{x:this.savedViewport.x,y:this.savedViewport.y}:{x:0,y:0});viewportScale=q(this.savedViewport?.scale??1);canZoomIn=E(()=>this.viewportScale()<JT-1e-6);canZoomOut=E(()=>this.viewportScale()>g_+1e-6);texts=oh;middlePanOrigin=null;nodePositions=q(tE());expandedNodeIds=q(nE());panelWidth=q(iE()??gh);viewportWidth=q(typeof window>"u"?1920:window.innerWidth);clampedPanelWidth=E(()=>{let i=Math.max(fu,this.viewportWidth()-C_),e=this.panelWidth();return e>i||e<fu?Math.min(gh,i):e});panelResizeStart=null;loading=this.loader.loading;error=this.loader.error;visibleNodes=E(()=>this.filters.apply(this.loader.nodes()));computeLayout=p_();fullLayout=E(()=>this.computeLayout(this.loader.nodes(),this.loader.scan()));graph=E(()=>{let i=new Set(this.visibleNodes().map(e=>e.path));return __(this.fullLayout(),i,this.nodePositions())});hasData=E(()=>this.graph().nodes.length>0);visibleCount=E(()=>this.graph().nodes.length);totalCount=E(()=>this.loader.nodes().length);edgeCount=E(()=>this.graph().edges.length);layoutComputedAt=E(()=>this.fullLayout().computedAt);selectedNodeId=q(null);selectedPath=E(()=>{let i=this.selectedNodeId();return i?this.graph().nodes.find(n=>n.id===i)?.view.path:void 0});adjacency=E(()=>{let i=new Map;for(let e of this.graph().edges)i.has(e.from)||i.set(e.from,new Set),i.has(e.to)||i.set(e.to,new Set),i.get(e.from).add(e.to),i.get(e.to).add(e.from);return i});selectionGuard=me(()=>{let i=this.selectedNodeId();if(i===null)return;this.graph().nodes.some(n=>n.id===i)||this.selectedNodeId.set(null)});deepLinkPath=Vh(this.route.queryParamMap.pipe(vh(i=>i.get("path"))),{initialValue:this.route.snapshot.queryParamMap.get("path")});deepLinkEffect=me(()=>{let i=this.deepLinkPath(),e=this.graph().nodes;if(e.length===0||!i)return;let n=gt(()=>this.selectedNodeId());if(n!==null&&e.find(s=>s.id===n)?.view.path===i)return;let o=e.find(r=>r.view.path===i);o&&this.selectedNodeId.set(o.id)});urlWriterEffect=me(()=>{let i=this.selectedPath(),e=gt(()=>this.deepLinkPath());(i??null)!==(e??null)&&this.router.navigate([],{relativeTo:this.route,queryParams:{path:i??null},queryParamsHandling:"merge",replaceUrl:!0})});pathsFingerprint=E(()=>this.loader.nodes().map(i=>i.path).sort().join("|"));lastPathsFingerprint=null;constructor(){me(()=>{let i=this.visibleNodes();this.hasCompletedInitialLayout||i.length!==0&&queueMicrotask(()=>{this.hasCompletedInitialLayout=!0,this.savedViewport||this.canvas()?.fitToScreen({x:40,y:40},!1)})}),me(()=>{let i=this.pathsFingerprint();if(!this.hasCompletedInitialLayout){this.lastPathsFingerprint=i;return}this.lastPathsFingerprint!==i&&(this.lastPathsFingerprint=i,queueMicrotask(()=>this.canvas()?.fitToScreen({x:40,y:40},!0)))}),me(()=>{let i=new Set(this.loader.nodes().map(r=>r.path));if(i.size===0)return;let e=this.expandedNodeIds();if(e.size===0)return;let n=!1,o=new Set;for(let r of e)i.has(r)?o.add(r):n=!0;n&&(this.expandedNodeIds.set(o),yh(o))}),me(()=>{let i=this.loader.nodes();if(i.length===0)return;let e=this.nodePositions(),n=new Set(i.map(a=>a.path)),o=!1,r=ue({},e);for(let a of Object.keys(r))n.has(a)||(delete r[a],o=!0);let s=[];for(let a of n)a in r||s.push(a);if(s.length>0){let a=this.fullLayout();if(Object.keys(r).length===0)for(let l of s){let h=a.positions.get(l);h&&(r[l]={x:h.x,y:h.y})}else{let l=m_(i,a.edges,r,s);for(let h of s){let _=l.get(h);_&&(r[h]=_)}}o=!0}o&&(this.nodePositions.set(r),b_(r))})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}onLoaded(){}onCanvasChange(i){if(this.viewportPosition.set({x:i.position.x,y:i.position.y}),this.viewportScale.set(i.scale),!this.hasCompletedInitialLayout)return;let e={x:i.position.x,y:i.position.y,scale:i.scale};try{localStorage.setItem(S_,JSON.stringify(e))}catch{}}onNodePositionChange(i,e){this.dragBuffer||(this.dragBuffer=ue({},this.nodePositions())),this.dragBuffer[i]={x:e.x,y:e.y},this.nodeDragInProgress=!0}zoomIn(){this.zoom()?.setZoom(this.getViewportCenter(),v_,Tt.ZOOM_IN,!0)}zoomOut(){this.zoom()?.setZoom(this.getViewportCenter(),v_,Tt.ZOOM_OUT,!0)}fitToScreen(){this.canvas()?.fitToScreen({x:40,y:40},!0)}resetLayout(){window.confirm(oh.resetLayoutConfirm)&&(this.nodePositions.set({}),this.expandedNodeIds.set(new Set),yh(new Set),queueMicrotask(()=>this.canvas()?.fitToScreen({x:40,y:40},!0)))}getViewportCenter(){let i=this.canvasWrap()?.nativeElement;if(!i)return{x:0,y:0};let e=i.getBoundingClientRect();return{x:e.width/2,y:e.height/2}}onCanvasMouseDown(i){if(i.button!==1)return;i.preventDefault();let e=this.canvas()?.getPosition()??{x:0,y:0};this.middlePanOrigin={mouseX:i.clientX,mouseY:i.clientY,canvasX:e.x,canvasY:e.y},document.addEventListener("mousemove",this.onMiddlePanMove),document.addEventListener("mouseup",this.onMiddlePanEnd)}middlePanRafId=null;pendingPanPosition=null;onMiddlePanMove=i=>{this.middlePanOrigin&&(this.pendingPanPosition={x:this.middlePanOrigin.canvasX+(i.clientX-this.middlePanOrigin.mouseX),y:this.middlePanOrigin.canvasY+(i.clientY-this.middlePanOrigin.mouseY)},this.middlePanRafId===null&&(this.middlePanRafId=requestAnimationFrame(()=>{this.middlePanRafId=null;let e=this.canvas();!e||!this.pendingPanPosition||(e.setPosition(this.pendingPanPosition),e.redraw())})))};onMiddlePanEnd=()=>{this.middlePanRafId!==null&&(cancelAnimationFrame(this.middlePanRafId),this.middlePanRafId=null),this.pendingPanPosition=null,this.middlePanOrigin=null,document.removeEventListener("mousemove",this.onMiddlePanMove),document.removeEventListener("mouseup",this.onMiddlePanEnd),this.canvas()?.emitCanvasChangeEvent()};ngOnDestroy(){this.onMiddlePanEnd()}onNodePointerDown(i){this.pointerDownAt={x:i.clientX,y:i.clientY},document.addEventListener("mouseup",this.onNodeMouseUp,{once:!0})}nodeDragInProgress=!1;dragBuffer=null;onNodeMouseUp=()=>{queueMicrotask(()=>{if(!this.nodeDragInProgress){this.dragBuffer=null;return}this.nodeDragInProgress=!1,this.dragBuffer&&(this.nodePositions.set(this.dragBuffer),this.dragBuffer=null),b_(this.nodePositions())})};selectNode(i,e){this.isClickWithoutDrag(e)&&this.selectedNodeId.set(i.id)}activeTagSelection=q(null);viewportBeforeTagSelect=null;viewportAnimToken=0;onTagSelect(i){let e=this.flow();if(!e)return;if(this.activeTagSelection()===i){e.clearSelection(),this.activeTagSelection.set(null),this.restoreViewportFromTagSnapshot();return}let n=this.loader.nodes().filter(o=>aE(o,i)).map(o=>o.path);if(n.length===0){e.clearSelection(),this.activeTagSelection.set(null),this.restoreViewportFromTagSnapshot();return}this.viewportBeforeTagSelect===null&&(this.viewportBeforeTagSelect={position:ue({},this.viewportPosition()),scale:this.viewportScale()}),e.select(n,[]),this.activeTagSelection.set(i),this.fitViewportToPaths(n)}fitViewportToPaths(i){let e=this.canvasWrap()?.nativeElement;if(!e||i.length===0)return;let n=this.fullLayout(),o=[];for(let le of i){let ie=n.positions.get(le);ie&&o.push(ie)}if(o.length===0)return;let r=260,s=120,a=80,l=2,h=1/0,_=1/0,v=-1/0,b=-1/0;for(let le of o)le.x<h&&(h=le.x),le.y<_&&(_=le.y),le.x+r>v&&(v=le.x+r),le.y+s>b&&(b=le.y+s);let I=this.selectedNodeId()!==null?this.clampedPanelWidth():0,N=Math.max(1,e.clientWidth-I),D=Math.max(1,v-h),M=Math.max(1,b-_),k=Math.max(1,N-a*2),O=Math.max(1,e.clientHeight-a*2),z=Math.min(k/D,O/M),V=Math.min(l,Math.max(g_,z)),W=(h+v)/2,oe=(_+b)/2,be=N/2-W*V,re=e.clientHeight/2-oe*V;this.animateViewportTo({x:be,y:re},V,y_)}restoreViewportFromTagSnapshot(){let i=this.viewportBeforeTagSelect;i&&(this.viewportBeforeTagSelect=null,this.animateViewportTo(i.position,i.scale,y_))}animateViewportTo(i,e,n){let o=++this.viewportAnimToken;if(typeof requestAnimationFrame>"u"||n<=0){this.viewportPosition.set(i),this.viewportScale.set(e);return}let r=this.viewportPosition(),s=this.viewportScale(),a=performance.now(),l=_=>1-Math.pow(1-_,3),h=_=>{if(o!==this.viewportAnimToken)return;let v=Math.min(1,(_-a)/n),b=l(v);this.viewportPosition.set({x:r.x+(i.x-r.x)*b,y:r.y+(i.y-r.y)*b}),this.viewportScale.set(s+(e-s)*b),v<1&&requestAnimationFrame(h)};requestAnimationFrame(h)}closePanel(){this.selectedNodeId.set(null)}onEscape(){this.selectedNodeId()!==null&&this.closePanel()}onWindowResize(){typeof window>"u"||this.viewportWidth.set(window.innerWidth)}onPanelResizeStart(i){i.button===0&&(i.preventDefault(),i.stopPropagation(),this.panelResizeStart={mouseX:i.clientX,widthAtStart:this.clampedPanelWidth()},document.addEventListener("mousemove",this.onPanelResizeMove),document.addEventListener("mouseup",this.onPanelResizeEnd))}onPanelResizeMove=i=>{if(!this.panelResizeStart)return;let e=i.clientX-this.panelResizeStart.mouseX,n=this.panelResizeStart.widthAtStart-e,o=Math.max(fu,this.viewportWidth()-C_),r=Math.min(o,Math.max(fu,n));this.panelWidth.set(r)};onPanelResizeEnd=()=>{this.panelResizeStart&&(this.panelResizeStart=null,document.removeEventListener("mousemove",this.onPanelResizeMove),document.removeEventListener("mouseup",this.onPanelResizeEnd),oE(this.panelWidth()))};openNode(i){this.selectedNodeId.set(i.id)}onCanvasClick(i){let e=i.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(i){return this.selectedNodeId()===i}isHighlighted(i){let e=this.selectedNodeId();return e===null||e===i?!1:this.adjacency().get(e)?.has(i)??!1}isDimmed(i){if(this.activeTagSelection()!==null)return!1;let e=this.selectedNodeId();return e===null||e===i?!1:!(this.adjacency().get(e)?.has(i)??!1)}isExpanded(i){return this.expandedNodeIds().has(i)}setExpanded(i,e){let n=this.expandedNodeIds();if(n.has(i)===e)return;let o=new Set(n);e?o.add(i):o.delete(i),this.expandedNodeIds.set(o),yh(o)}onFavoriteToggle(i){this.loader.toggleFavorite(i.path,i.value)}isEdgeHighlighted(i){let e=this.selectedNodeId();return e!==null&&(i.from===e||i.to===e)}isEdgeDimmed(i){if(this.activeTagSelection()!==null)return!1;let e=this.selectedNodeId();return e===null?!1:i.from!==e&&i.to!==e}isClickWithoutDrag(i){let e=this.pointerDownAt;if(this.pointerDownAt=null,!e)return!0;let n=i.clientX-e.x,o=i.clientY-e.y;return Math.hypot(n,o)<=4}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-graph-view"]],viewQuery:function(e,n){e&1&&ft(n.flow,Ui,5)(n.canvas,ji,5)(n.zoom,$i,5)(n.canvasWrap,HT,5),e&2&&it(4)},hostBindings:function(e,n){e&1&&K("keydown.escape",function(){return n.onEscape()},wh)("resize",function(){return n.onWindowResize()},bh)},decls:5,vars:1,consts:[["canvasWrap",""],["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"],[1,"empty-state__icon","pi","pi-spin","pi-spinner"],[1,"empty-state__title"],[1,"empty-state__icon","pi","pi-exclamation-circle",2,"color","var(--sm-severity-error)","opacity","1"],[1,"empty-state__desc"],[1,"empty-state__icon","pi","pi-filter-slash"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"mousedown","click"],["fDraggable","",3,"fLoaded","fCache"],[3,"fAlignThreshold"],["fZoom","",3,"fCanvasChange","position","scale","fZoomStep","fZoomDblClickStep","debounceTime"],["ngProjectAs","[fConnections]",5,["","fConnections",""]],[3,"fOutputId","fInputId","fType","fBehavior","fOffset","fReassignDisabled","fSelectionDisabled","class","f-conn--highlighted","f-conn--dimmed"],["ngProjectAs","[fNodes]",5,["","fNodes",""]],["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"],["mode","embedded",3,"close","tagSelect","path","activeTag"],[3,"visible","total","edges","cacheAt"],["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-refresh","severity","secondary","size","small","data-testid","graph-reset-layout",3,"onClick","ariaLabel","pTooltip","text","rounded"],[3,"fOutputId","fInputId","fType","fBehavior","fOffset","fReassignDisabled","fSelectionDisabled"],[3,"type"],["ngProjectAs","[fNodes]",5,["","fNodes",""],4,"fVirtualFor","fVirtualForOf"],["fNode","","fDragHandle","",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition"],["fNodeInput","",1,"sm-gnode__connector","sm-gnode__connector--in",3,"fInputId","fInputConnectableSide"],[3,"expandedChange","favoriteToggle","node","stats","summary","selected","highlighted","dimmed","expanded","isFavorite"],[1,"sm-gnode__marker-anchor"],["data-debug-slot","graph.node.alert",1,"sm-debug-slot"],["aria-hidden","true",1,"sm-gnode__marker-stub"],["width","14","height","14","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["d","m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"],["d","M12 9v4"],["d","M12 17h.01"],["slot","graph.node.alert",3,"node"],["fNodeOutput","",1,"sm-gnode__connector","sm-gnode__connector--out",3,"fOutputId","fOutputConnectableSide"],["fNode","","fDragHandle","",1,"sm-gnode-host",3,"fNodeId","fNodePosition"]],template:function(e,n){e&1&&(u(0,"section",1),w(1,jT,4,1,"div",2)(2,UT,6,2,"div",3)(3,$T,6,2,"div",4)(4,QT,25,36,"div",5),f()),e&2&&(c(),S(n.loading()&&!n.hasData()?1:n.error()&&!n.hasData()?2:n.hasData()?4:3))},dependencies:[ym,Ui,ji,um,lm,$i,mm,Pp,fm,qp,Yp,hm,pm,Ml,Wp,_m,am,Rl,Ll,zl,eu,vn,yn,Ue,Qe,xn],styles:["[_nghost-%COMP%]{display:block;height:100%}.graph[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%]{position:relative;flex:1;min-height:0;border:1px solid var(--sm-border);border-radius:.75rem;background:var(--sm-bg-content);overflow:hidden;--ff-connection-drag-handle-stroke: transparent;--ff-connector-background-color: transparent;--ff-connector-border-color: transparent;--ff-connector-connected-color: transparent;--ff-connector-node-ring-color: transparent;--ff-canvas-background-color: transparent}.graph__canvas-wrap[_ngcontent-%COMP%] f-flow[_ngcontent-%COMP%]{width:100%;height:100%}.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;overflow-y:auto}.graph__panel.is-open[_ngcontent-%COMP%]{transform:translate(0);pointer-events: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:999px;box-shadow:var(--sm-shadow-floating);z-index:2;pointer-events:auto}.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, rgba(99, 102, 241, .45)))}.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)}.sm-gnode__connector[_ngcontent-%COMP%]{position:absolute;pointer-events:none}.sm-gnode__connector--out[_ngcontent-%COMP%]{bottom:calc(var(--ff-connector-size) / -2);left:50%;transform:translate(-50%)}.sm-gnode__connector--in[_ngcontent-%COMP%]{top:calc(var(--ff-connector-size) / -2);left:50%;transform:translate(-50%)}.f-conn--invokes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes);--ff-connection-width: 2.5px;--ff-marker-color: var(--sm-edge-invokes)}.f-conn--references[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references);--ff-connection-width: 2px;--ff-marker-color: var(--sm-edge-references)}.f-conn--mentions[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions);--ff-connection-width: 1.5px;--ff-marker-color: var(--sm-edge-mentions)}.f-conn--supersedes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes);--ff-connection-width: 2px;--ff-marker-color: var(--sm-edge-supersedes)}.graph__canvas-wrap[_ngcontent-%COMP%] .f-conn--supersedes .f-connection-path{stroke-dasharray:8 4}.f-conn--highlighted[_ngcontent-%COMP%]{--ff-connection-width: 3px}.f-conn--dimmed[_ngcontent-%COMP%]{opacity:.15}.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}.sm-gnode__marker-stub[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;background:var(--sm-bg-content);color:var(--p-text-color);border-radius:50%;box-shadow:0 1px 3px #00000040}"],changeDetection:0})};function eE(){let t=null;try{t=localStorage.getItem(S_)}catch{return null}if(!t)return null;let i;try{i=JSON.parse(t)}catch{return null}return sE(i)?i:null}function tE(){let t=null;try{t=localStorage.getItem(I_)}catch{return{}}if(!t)return{};let i;try{i=JSON.parse(t)}catch{return{}}if(typeof i!="object"||i===null)return{};let e={};for(let[n,o]of Object.entries(i))rE(o)&&(e[n]={x:o.x,y:o.y});return e}function b_(t){try{localStorage.setItem(I_,JSON.stringify(t))}catch{}}function nE(){let t=null;try{t=localStorage.getItem(T_)}catch{return new Set}if(!t)return new Set;let i;try{i=JSON.parse(t)}catch{return new Set}if(!Array.isArray(i))return new Set;let e=new Set;for(let n of i)typeof n=="string"&&n.length>0&&e.add(n);return e}function yh(t){try{localStorage.setItem(T_,JSON.stringify([...t]))}catch{}}function iE(){let t=null;try{t=localStorage.getItem(E_)}catch{return null}if(!t)return null;let i=Number(t);return!Number.isFinite(i)||i<=0?null:i}function oE(t){try{localStorage.setItem(E_,String(Math.round(t)))}catch{}}function rE(t){if(typeof t!="object"||t===null)return!1;let i=t;return typeof i.x=="number"&&typeof i.y=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)}function sE(t){if(typeof t!="object"||t===null)return!1;let i=t;return typeof i.x=="number"&&typeof i.y=="number"&&typeof i.scale=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.scale)&&i.scale>0}function aE(t,i){let n=t.frontmatter.tags;if(Array.isArray(n)&&n.includes(i))return!0;let r=t.sidecar?.annotations?.tags;return!!(Array.isArray(r)&&r.includes(i))}export{x_ as GraphView};
|
|
247
|
+
`,ES={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"},Mm=(()=>{class t extends zh{name="card";style=TS;classes=ES;static \u0275fac=(()=>{let e;return function(o){return(e||(e=ne(t)))(o||t)}})();static \u0275prov=g({token:t,factory:t.\u0275fac})}return t})();var Dm=new fe("CARD_INSTANCE"),qi=(()=>{class t extends Hh{componentName="Card";$pcCard=d(Dm,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=d(ti,{self:!0});_componentStyle=d(Mm);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}header;subheader;set style(e){Ah(this._style(),e)||(this._style.set(e),this.el?.nativeElement&&e&&Object.keys(e).forEach(n=>{this.el.nativeElement.style[n]=e[n]}))}get style(){return this._style()}styleClass;headerFacet;footerFacet;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_headerTemplate;_titleTemplate;_subtitleTemplate;_contentTemplate;_footerTemplate;_style=q(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=ne(t)))(o||t)}})();static \u0275cmp=te({type:t,selectors:[["p-card"]],contentQueries:function(n,o,r){if(n&1&&Ph(r,Lh,5)(r,Bh,5)(r,cS,4)(r,dS,4)(r,lS,4)(r,uS,4)(r,fS,4)(r,gn,4),n&2){let s;wt(s=St())&&(o.headerFacet=s.first),wt(s=St())&&(o.footerFacet=s.first),wt(s=St())&&(o.headerTemplate=s.first),wt(s=St())&&(o.titleTemplate=s.first),wt(s=St())&&(o.subtitleTemplate=s.first),wt(s=St())&&(o.contentTemplate=s.first),wt(s=St())&&(o.footerTemplate=s.first),wt(s=St())&&(o.templates=s)}},hostVars:4,hostBindings:function(n,o){n&2&&(Mh(o._style()),Ce(o.cn(o.cx("root"),o.styleClass)))},inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},features:[Ie([Mm,{provide:Dm,useExisting:t},{provide:Gh,useExisting:t}]),Eh([ti]),_e],ngContentSelectors:pS,decls:8,vars:11,consts:[[3,"pBind","class",4,"ngIf"],[3,"pBind"],[4,"ngTemplateOutlet"],[4,"ngIf"]],template:function(n,o){n&1&&(Xt(hS),Me(0,_S,3,4,"div",0),u(1,"div",1),Me(2,vS,3,5,"div",0)(3,bS,3,5,"div",0),u(4,"div",1),De(5),Me(6,wS,1,0,"ng-container",2),f(),Me(7,IS,3,4,"div",0),f()),n&2&&(T("ngIf",o.headerFacet||o.headerTemplate||o._headerTemplate),c(),Ce(o.cx("body")),T("pBind",o.ptm("body")),c(),T("ngIf",o.header||o.titleTemplate||o._titleTemplate),c(),T("ngIf",o.subheader||o.subtitleTemplate||o._subtitleTemplate),c(),Ce(o.cx("content")),T("pBind",o.ptm("content")),c(2),T("ngTemplateOutlet",o.contentTemplate||o._contentTemplate),c(),T("ngIf",o.footerFacet||o.footerTemplate||o._footerTemplate))},dependencies:[uo,kh,Rh,mo,go,ti],encapsulation:2,changeDetection:0})}return t})(),Gl=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=so({type:t});static \u0275inj=no({imports:[qi,mo,go,mo,go]})}return t})();var Hl={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 \u2014 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 \u2014 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."},audit:{header:"Audit",headerSummary:(t,i)=>`last bumped ${t} by ${i}`,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 jl=class t{http=d(ho);dataSource=d(Cn);loader=d(Mt);destroyRef=d(Ze);constructor(){this.dataSource.events().pipe(to(i=>Wh(i)),_o(this.destroyRef)).subscribe(i=>{let e=i;this.loader.patchSidecarFromBump({nodePath:e.data.nodePath,version:e.data.version,status:e.data.status})})}async bump(i,e={}){let n={nodePath:i};e.force!==void 0&&(n.force=e.force);try{return await eo(this.http.post("/api/sidecar/bump",n))}catch(o){throw PS(o)}}static \u0275fac=function(e){return new(e||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})};function PS(t){if(t instanceof Yt)return t;if(t instanceof Nh){let e=MS(t.error);return e?new Yt(e.error.code,e.error.message,e.error.details):new Yt("internal",t.message||"Request failed.")}let i=t instanceof Error?t.message:String(t);return new Yt("internal",i)}function MS(t){if(typeof t!="object"||t===null)return null;let i=t;if(i.ok!==!1)return null;let e=i.error;if(typeof e!="object"||e===null)return null;let n=e;return typeof n.code!="string"||typeof n.message!="string"?null:{ok:!1,error:{code:n.code,message:n.message,details:n.details}}}var Rm={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",requires:"Requires",conflictsWith:"Conflicts with",related:"Related",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 RS=(t,i)=>"a:"+i,NS=(t,i)=>"u:"+i;function OS(t,i){if(t&1&&(u(0,"p",0),m(1),f()),t&2){let e=p(2);c(),y(e.texts.emptyOverlay)}}function FS(t,i){if(t&1&&(u(0,"p",1),m(1),f()),t&2){let e=p(2);c(),y(e.texts.emptyAnnotations)}}function AS(t,i){if(t&1&&w(0,OS,2,1,"p",0)(1,FS,2,1,"p",1),t&2){let e,n=p();S((e=n.overlay())!=null&&e.present?1:0)}}function LS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",9)(3,"code"),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.version),c(3),y(e.version)}}function BS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd"),A(3,"p-tag",10),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.stability),c(2),T("value",e.stability)("severity",n.stabilitySeverity(e.stability))("rounded",!0)}}function zS(t,i){if(t&1&&(ot(0),u(1,"section",2)(2,"h4",7),m(3),f(),u(4,"dl",8),w(5,LS,5,2),w(6,BS,4,4),f()()),t&2){let e=p(2),n=Ae(e.lifecycle());c(3),y(e.texts.sections.lifecycle),c(2),S(n.version!==null?5:-1),c(),S(n.stability!==null?6:-1)}}function VS(t,i){if(t&1){let e=ae();u(0,"h5"),m(1),f(),u(2,"div",11)(3,"p-chip",12),K("click",function(){j(e),p();let o=Q(0),r=p(2);return U(r.onOpenPath(o.supersededBy))}),f()()}if(t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.supersededBy),c(2),T("label",e.supersededBy)("styleClass",n.isBroken(e.supersededBy)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e.supersededBy)?n.texts.brokenRefTooltip:"")}}function GS(t,i){if(t&1){let e=ae();u(0,"p-chip",12),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpenPath(o))}),f()}if(t&2){let e=i.$implicit,n=p(4);T("label",e)("styleClass",n.isBroken(e)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e)?n.texts.brokenRefTooltip:"")}}function HS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,GS,1,3,"p-chip",13,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.supersedes),c(2),ee(e.supersedes)}}function jS(t,i){if(t&1){let e=ae();u(0,"p-chip",12),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpenPath(o))}),f()}if(t&2){let e=i.$implicit,n=p(4);T("label",e)("styleClass",n.isBroken(e)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e)?n.texts.brokenRefTooltip:"")}}function US(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,jS,1,3,"p-chip",13,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.requires),c(2),ee(e.requires)}}function $S(t,i){if(t&1){let e=ae();u(0,"p-chip",12),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpenPath(o))}),f()}if(t&2){let e=i.$implicit,n=p(4);T("label",e)("styleClass",n.isBroken(e)?"chip--broken":"chip--link")("pTooltip",n.isBroken(e)?n.texts.brokenRefTooltip:"")}}function WS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,$S,1,3,"p-chip",13,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.related),c(2),ee(e.related)}}function qS(t,i){if(t&1&&A(0,"p-chip",14),t&2){let e=i.$implicit;T("label",e)}}function XS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,qS,1,1,"p-chip",14,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.conflictsWith),c(2),ee(e.conflictsWith)}}function KS(t,i){if(t&1&&(ot(0),u(1,"section",3)(2,"h4",7),m(3),f(),w(4,VS,4,4),w(5,HS,5,1),w(6,US,5,1),w(7,WS,5,1),w(8,XS,5,1),f()),t&2){let e=p(2),n=Ae(e.supersession());c(3),y(e.texts.sections.supersession),c(),S(n.supersededBy!==null?4:-1),c(),S(n.supersedes.length?5:-1),c(),S(n.requires.length?6:-1),c(),S(n.related.length?7:-1),c(),S(n.conflictsWith.length?8:-1)}}function YS(t,i){if(t&1&&A(0,"p-chip",15),t&2){let e=i.$implicit;T("label",e)}}function ZS(t,i){if(t&1&&(u(0,"h5"),m(1),f(),u(2,"div",11),J(3,YS,1,1,"p-chip",15,we),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.authors),c(2),ee(e.authors)}}function QS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd"),m(3),f()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.license),c(2),y(e.license)}}function JS(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"a",16),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.source),c(2),T("href",e.source,_u),c(),y(e.source)}}function e1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.sourceVersion),c(3),y(e.sourceVersion)}}function t1(t,i){if(t&1&&(ot(0),u(1,"section",4)(2,"h4",7),m(3),f(),w(4,ZS,5,1),u(5,"dl",8),w(6,QS,4,2),w(7,JS,5,3),w(8,e1,5,2),f()()),t&2){let e=p(2),n=Ae(e.provenance());c(3),y(e.texts.sections.provenance),c(),S(n.authors.length?4:-1),c(2),S(n.license!==null?6:-1),c(),S(n.source!==null?7:-1),c(),S(n.sourceVersion!==null?8:-1)}}function n1(t,i){if(t&1){let e=ae();u(0,"p-chip",20),K("click",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.enter",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.space",function(o){let r=j(e).$implicit;return p(3).tagClick.emit(r),U(o.preventDefault())}),f()}if(t&2){let e=i.$implicit,n=p(3);T("label",e)("styleClass","ann-panel__chip ann-panel__chip--author"+(n.isActiveTag(e)?" ann-panel__chip--active":""))}}function i1(t,i){if(t&1){let e=ae();u(0,"p-chip",21),K("click",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.enter",function(){let o=j(e).$implicit,r=p(3);return U(r.tagClick.emit(o))})("keydown.space",function(o){let r=j(e).$implicit;return p(3).tagClick.emit(r),U(o.preventDefault())}),f()}if(t&2){let e=i.$implicit,n=p(3);T("label",e)("styleClass","ann-panel__chip ann-panel__chip--user"+(n.isActiveTag(e)?" ann-panel__chip--active":""))}}function o1(t,i){if(t&1&&(u(0,"section",5)(1,"h4",7),m(2),f(),u(3,"h5"),m(4),f(),u(5,"div",17),J(6,n1,1,2,"p-chip",18,RS),J(8,i1,1,2,"p-chip",19,NS),f()()),t&2){let e=p(2),n=e.taxonomy();c(2),y(e.texts.sections.taxonomy),c(2),y(e.texts.fields.tags),c(2),ee(n.authorTags),c(2),ee(n.userTags)}}function r1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"a",16),m(4),f()()),t&2){p();let e=Q(0),n=p(2);c(),y(n.texts.fields.docsUrl),c(2),T("href",e.docsUrl,_u),c(),y(e.docsUrl)}}function s1(t,i){if(t&1&&(ot(0),u(1,"section",6)(2,"h4",7),m(3),f(),u(4,"dl",8),w(5,r1,5,3),f()()),t&2){let e=p(2),n=Ae(e.docs());c(3),y(e.texts.sections.docs),c(2),S(n.docsUrl!==null?5:-1)}}function a1(t,i){if(t&1&&(w(0,zS,7,4,"section",2),w(1,KS,9,7,"section",3),w(2,t1,9,6,"section",4),w(3,o1,10,2,"section",5),w(4,s1,6,3,"section",6)),t&2){let e=p();S(e.hasLifecycle()?0:-1),c(),S(e.hasSupersession()?1:-1),c(),S(e.hasProvenance()?2:-1),c(),S(e.hasTaxonomy()?3:-1),c(),S(e.hasDocs()?4:-1)}}var c1={stable:"success",experimental:"info",deprecated:"warn"},$l=class t{overlay=F(void 0);authorTags=F([]);knownPaths=F(null);openPath=new nt;tagClick=new nt;activeTag=F(null);isActiveTag(i){return this.activeTag()===i}texts=Rm;annotations=P(()=>{let i=this.overlay();return!i||!i.present?null:i.annotations??null});hasAnnotations=P(()=>{let i=this.annotations();return i!==null&&Object.keys(i).length>0});hasAnyContent=P(()=>this.hasLifecycle()||this.hasSupersession()||this.hasProvenance()||this.hasTaxonomy()||this.hasDocs());lifecycle=P(()=>{let i=this.annotations()??{};return{version:d1(i.version),stability:l1(i.stability)}});hasLifecycle=P(()=>Ul(this.lifecycle()));supersession=P(()=>{let i=this.annotations()??{};return{supersedes:Wn(i.supersedes),supersededBy:Xi(i.supersededBy),requires:Wn(i.requires),conflictsWith:Wn(i.conflictsWith),related:Wn(i.related)}});hasSupersession=P(()=>Ul(this.supersession()));provenance=P(()=>{let i=this.annotations()??{};return{authors:Wn(i.authors),license:Xi(i.license),source:Xi(i.source),sourceVersion:Xi(i.sourceVersion)}});hasProvenance=P(()=>Ul(this.provenance()));taxonomy=P(()=>{let i=this.annotations()??{};return{authorTags:this.authorTags(),userTags:Wn(i.tags)}});hasTaxonomy=P(()=>{let i=this.taxonomy();return i.authorTags.length>0||i.userTags.length>0});docs=P(()=>{let i=this.annotations()??{};return{docsUrl:Xi(i.docsUrl)}});hasDocs=P(()=>Ul(this.docs()));stabilitySeverity(i){return c1[i]}isBroken(i){let e=this.knownPaths();return e?!e.has(i):!1}onOpenPath(i){this.isBroken(i)||this.openPath.emit(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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"],["styleClass","chip--warn",3,"label"],[3,"label"],["target","_blank","rel","noopener",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,n){e&1&&w(0,AS,2,1)(1,a1,5,5),e&2&&S(n.hasAnyContent()?1:0)},dependencies:[wn,To,bn,Io,je,Qe],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 .p-chip{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, white);border-color:var(--p-primary-color);box-shadow:0 0 0 2px var(--p-primary-color-200, rgba(99, 102, 241, .25))}"],changeDetection:0})};function d1(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Xi(t){return typeof t=="string"&&t.length>0?t:null}function l1(t){return t==="stable"||t==="experimental"||t==="deprecated"?t:null}function Wn(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"&&i.length>0):[]}function Ul(t){for(let i of Object.values(t))if(i!=null){if(Array.isArray(i)){if(i.length>0)return!0;continue}if(typeof i=="string"){if(i.length>0)return!0;continue}return!0}return!1}var Wl=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=te({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,n){if(e&1&&(H(0,"div",0),Pt(1,"span",1),H(2,"p",2),m(3),$(),H(4,"p",3),m(5),$()()),e&2){let o=n.testId();Z("data-testid",o),c(),Ce(n.icon()),c(2),y(n.title()),c(2),y(n.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 Nm={cardHeader:"Linked nodes",refreshLabel:"Refresh links",outgoingHeader:"Outgoing",incomingHeader:"Incoming",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:", "};var Fm=(t,i)=>i.source+"|"+i.target+"|"+i.kind+"|"+((i.trigger==null?null:i.trigger.normalizedTrigger)??"");function f1(t,i){if(t&1){let e=ae();u(0,"div",4)(1,"h3",5),m(2),f(),u(3,"p-button",6),K("onClick",function(){j(e);let o=p(2);return U(o.refresh())}),f()()}if(t&2){let e=p(2);c(2),y(e.texts.cardHeader),c(),T("rounded",!0)("text",!0)("ariaLabel",e.texts.refreshLabel)("pTooltip",e.texts.refreshLabel)("disabled",e.state()==="loading")}}function h1(t,i){if(t&1&&(u(0,"p",2),m(1),f()),t&2){let e=p(2);c(),y(e.texts.loading)}}function p1(t,i){if(t&1&&(u(0,"p",3),m(1),f()),t&2){let e=p(2);c(),y(e.texts.error)}}function m1(t,i){if(t&1&&(u(0,"p",9),m(1),f()),t&2){let e=p(3);c(),y(e.texts.emptyOutgoing)}}function _1(t,i){if(t&1&&(u(0,"span",17),m(1),f()),t&2){let e=p().$implicit,n=p(4);c(),Jn(" ",n.texts.sourcesPrefix,"",e.sources.join(n.texts.sourcesSeparator)," ")}}function g1(t,i){if(t&1){let e=ae();u(0,"li",13),A(1,"p-tag",14),u(2,"button",15),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpen(o.target))}),m(3),f(),A(4,"p-tag",16),w(5,_1,2,2,"span",17),f()}if(t&2){let e=i.$implicit,n=p(4);Z("data-testid","linked-nodes-outgoing-row-"+e.target),c(),T("value",e.kind)("severity",n.kindSeverity(e.kind)),c(),Z("data-testid","linked-nodes-outgoing-link-"+e.target),c(),Ge(" ",e.target," "),c(),T("value",n.confidenceLabel(e.confidence))("severity",n.confidenceSeverity(e.confidence))("rounded",!0),c(),S(e.sources.length?5:-1)}}function y1(t,i){if(t&1&&(u(0,"ul",10),J(1,g1,6,9,"li",13,Fm),f()),t&2){let e=p(3);c(),ee(e.outgoing())}}function v1(t,i){if(t&1&&(u(0,"p",12),m(1),f()),t&2){let e=p(3);c(),y(e.texts.emptyIncoming)}}function C1(t,i){if(t&1&&(u(0,"span",17),m(1),f()),t&2){let e=p().$implicit,n=p(4);c(),Jn(" ",n.texts.sourcesPrefix,"",e.sources.join(n.texts.sourcesSeparator)," ")}}function x1(t,i){if(t&1){let e=ae();u(0,"li",13),A(1,"p-tag",14),u(2,"button",15),K("click",function(){let o=j(e).$implicit,r=p(4);return U(r.onOpen(o.source))}),m(3),f(),A(4,"p-tag",16),w(5,C1,2,2,"span",17),f()}if(t&2){let e=i.$implicit,n=p(4);Z("data-testid","linked-nodes-incoming-row-"+e.source),c(),T("value",e.kind)("severity",n.kindSeverity(e.kind)),c(),Z("data-testid","linked-nodes-incoming-link-"+e.source),c(),Ge(" ",e.source," "),c(),T("value",n.confidenceLabel(e.confidence))("severity",n.confidenceSeverity(e.confidence))("rounded",!0),c(),S(e.sources.length?5:-1)}}function b1(t,i){if(t&1&&(u(0,"ul",10),J(1,x1,6,9,"li",13,Fm),f()),t&2){let e=p(3);c(),ee(e.incoming())}}function w1(t,i){if(t&1&&(u(0,"section",7)(1,"h4",8),m(2),f(),w(3,m1,2,1,"p",9)(4,y1,3,0,"ul",10),f(),u(5,"section",11)(6,"h4",8),m(7),f(),w(8,v1,2,1,"p",12)(9,b1,3,0,"ul",10),f()),t&2){let e=p(2);c(2),y(e.texts.outgoingHeader),c(),S(e.outgoing().length===0?3:4),c(4),y(e.texts.incomingHeader),c(),S(e.incoming().length===0?8:9)}}function S1(t,i){if(t&1&&(u(0,"p-card",0),Me(1,f1,4,6,"ng-template",1),w(2,h1,2,1,"p",2)(3,p1,2,1,"p",3)(4,w1,10,4),f()),t&2){let e,n=p();c(2),S((e=n.state())==="loading"?2:e==="error"?3:e==="ready"?4:-1)}}var I1={invokes:"warn",references:"info",mentions:"secondary",supersedes:"success"},T1={high:"success",medium:"info",low:"warn"},ql=class t{dataSource=d(Cn);destroyRef=d(Ze);texts=Nm;path=F(null);openPath=He();state=q("idle");outgoing=q([]);incoming=q([]);fetchToken=0;hasResults=P(()=>this.state()==="ready"&&(this.outgoing().length>0||this.incoming().length>0));constructor(){this.dataSource.events().pipe(to(i=>i.type==="scan.completed"),_o(this.destroyRef)).subscribe(()=>{let i=this.path();i&&this.fetch(i)}),me(()=>{let i=this.path();if(!i){this.fetchToken++,this.state.set("idle"),this.outgoing.set([]),this.incoming.set([]);return}this.fetch(i)})}refresh(){let i=this.path();i&&this.fetch(i)}onOpen(i){this.openPath.emit(i)}kindSeverity(i){return I1[i]??"secondary"}confidenceSeverity(i){return T1[i]??"info"}confidenceLabel(i){return this.texts.confidence[i]??i}async fetch(i){let e=++this.fetchToken;this.state.set("loading");try{let[n,o]=await Promise.all([this.dataSource.listLinks({from:i}),this.dataSource.listLinks({to:i})]);if(e!==this.fetchToken)return;this.outgoing.set(n.items),this.incoming.set(o.items),this.state.set("ready")}catch{if(e!==this.fetchToken)return;this.outgoing.set([]),this.incoming.set([]),this.state.set("error")}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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-outgoing",1,"linked-nodes-panel__section"],[1,"linked-nodes-panel__section-title"],["data-testid","linked-nodes-outgoing-empty",1,"linked-nodes-panel__status"],[1,"linked-nodes-panel__rows"],["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"],[3,"value","severity"],["type","button",1,"linked-nodes-panel__path",3,"click"],[3,"value","severity","rounded"],[1,"linked-nodes-panel__sources"]],template:function(e,n){e&1&&w(0,S1,5,1,"p-card",0),e&2&&S(n.path()?0:-1)},dependencies:[Gl,qi,gn,bn,Io,wn,vn,yn,je,Qe],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:4px;background:var(--p-content-background);border:1px solid var(--p-content-border-color)}.linked-nodes-panel__path[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.85rem;color:var(--p-primary-color);background:none;border:none;padding:0;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.linked-nodes-panel__path[_ngcontent-%COMP%]:hover{text-decoration:none}.linked-nodes-panel__sources[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);margin-left:auto}"],changeDetection:0})};var Am={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 E1=(t,i)=>i.name,P1=(t,i)=>i.event;function M1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.model),c(3),y(i)}}function D1(t,i){if(t&1&&A(0,"p-chip",12),t&2){let e=i.$implicit;T("label",e)}}function k1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",11),J(3,D1,1,1,"p-chip",12,we),f()),t&2){let e=p(4);c(),y(e.texts.fields.tools),c(2),ee(e.tools())}}function R1(t,i){if(t&1){let e=ae();u(0,"p-chip",14),K("click",function(){let o=j(e).$implicit,r=p(5);return U(r.onSkillChipClick(o))}),f()}if(t&2){let e=i.$implicit,n=p(5);T("label",e)("styleClass",n.isSkillKnown(e)?"chip--link":"")}}function N1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",11),J(3,R1,1,2,"p-chip",13,we),f()),t&2){let e=p(4);c(),y(e.texts.fields.skills),c(2),ee(e.skills())}}function O1(t,i){if(t&1&&A(0,"p-chip",15),t&2){let e=i.$implicit;T("label",e)}}function F1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd",11),J(3,O1,1,1,"p-chip",15,we),f()),t&2){let e=p(4);c(),y(e.texts.fields.disallowedTools),c(2),ee(e.disallowedTools())}}function A1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.permissionMode),c(3),y(i)}}function L1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd"),m(3),f()),t&2){let e=p(4);c(),y(e.texts.fields.maxTurns),c(2),y(e.maxTurns())}}function B1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.effort),c(3),y(i)}}function z1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.memory),c(3),y(i)}}function V1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4,"true"),f()()),t&2){let e=p(4);c(),y(e.texts.fields.background)}}function G1(t,i){if(t&1&&(u(0,"dt"),m(1),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){let e=p(4);c(),y(e.texts.fields.isolation),c(3),y(i)}}function H1(t,i){if(t&1&&(u(0,"blockquote",18),m(1),f()),t&2){let e=p();c(),y(e)}}function j1(t,i){if(t&1&&(u(0,"p",19),m(1),f()),t&2){let e=p();c(),Jn("",e.slice(0,80),"",e.length>80?"\u2026":"")}}function U1(t,i){if(t&1){let e=ae();u(0,"div",9)(1,"h5",16)(2,"button",17),K("click",function(){j(e);let o=p(4);return U(o.toggleInitialPrompt())}),A(3,"i",4),m(4),f()(),w(5,H1,2,1,"blockquote",18)(6,j1,2,2,"p",19),f()}if(t&2){let e=p(4);c(2),Z("aria-label",e.texts.initialPromptToggle),c(),de("pi-chevron-right",!e.initialPromptExpanded())("pi-chevron-down",e.initialPromptExpanded()),c(),Ge(" ",e.texts.fields.initialPrompt," "),c(),S(e.initialPromptExpanded()?5:6)}}function $1(t,i){if(t&1&&(u(0,"code",23),m(1),f()),t&2){let e=p().$implicit;c(),y(e.command)}}function W1(t,i){if(t&1&&(u(0,"li",21)(1,"code",22),m(2),f(),w(3,$1,2,1,"code",23),f()),t&2){let e=i.$implicit;c(2),y(e.name),c(),S(e.command!==null?3:-1)}}function q1(t,i){if(t&1&&(u(0,"div",10)(1,"h5",16),m(2),f(),u(3,"ul",20),J(4,W1,4,2,"li",21,E1),f()()),t&2){let e=p(4);c(2),y(e.texts.fields.mcpServers),c(2),ee(e.mcpServers())}}function X1(t,i){if(t&1&&(u(0,"code"),m(1),f(),m(2)),t&2){let e=i.$implicit,n=i.$index,o=i.$count;c(),y(e),c(),Ge("",n===o-1?"":", "," ")}}function K1(t,i){if(t&1&&(u(0,"span",24),J(1,X1,3,2,null,null,we),f()),t&2){let e=p().$implicit;c(),ee(e.keys)}}function Y1(t,i){if(t&1&&(u(0,"li",21)(1,"code",22),m(2),f(),w(3,K1,3,0,"span",24),f()),t&2){let e=i.$implicit;c(2),y(e.event),c(),S(e.keys.length?3:-1)}}function Z1(t,i){if(t&1&&(u(0,"div",10)(1,"h5",16),m(2),f(),u(3,"ul",20),J(4,Y1,4,2,"li",21,P1),f()()),t&2){let e=p(4);c(2),y(e.texts.fields.hooks),c(2),ee(e.hooks())}}function Q1(t,i){if(t&1&&(u(0,"dl",8),w(1,M1,5,2),w(2,k1,5,1),w(3,N1,5,1),w(4,F1,5,1),w(5,A1,5,2),w(6,L1,4,2),w(7,B1,5,2),w(8,z1,5,2),w(9,V1,5,1),w(10,G1,5,2),f(),w(11,U1,7,7,"div",9),w(12,q1,6,1,"div",10),w(13,Z1,6,1,"div",10)),t&2){let e,n,o,r,s,a,l=p(3);c(),S((e=l.model())?1:-1,e),c(),S(l.tools().length?2:-1),c(),S(l.skills().length?3:-1),c(),S(l.disallowedTools().length?4:-1),c(),S((n=l.permissionMode())?5:-1,n),c(),S(l.maxTurns()!==null?6:-1),c(),S((o=l.effort())?7:-1,o),c(),S((r=l.memory())?8:-1,r),c(),S(l.background()?9:-1),c(),S((s=l.isolation())?10:-1,s),c(),S((a=l.initialPrompt())?11:-1,a),c(),S(l.mcpServers().length?12:-1),c(),S(l.hooks().length?13:-1)}}function J1(t,i){if(t&1&&(u(0,"dt"),m(1,"when_to_use"),f(),u(2,"dd"),m(3),f()),t&2){p();let e=Q(0);c(3),y(e.when_to_use)}}function eI(t,i){if(t&1&&(u(0,"dt"),m(1,"argument-hint"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.argumentHint)}}function tI(t,i){if(t&1&&A(0,"p-chip",12),t&2){let e=i.$implicit;T("label",e)}}function nI(t,i){if(t&1&&(u(0,"dt"),m(1,"arguments"),f(),u(2,"dd",11),J(3,tI,1,1,"p-chip",12,we),f()),t&2){p();let e=Q(0);c(3),ee(e.arguments)}}function iI(t,i){if(t&1&&A(0,"p-chip",12),t&2){let e=i.$implicit;T("label",e)}}function oI(t,i){if(t&1&&(u(0,"dt"),m(1,"allowed-tools"),f(),u(2,"dd",11),J(3,iI,1,1,"p-chip",12,we),f()),t&2){p();let e=Q(0);c(3),ee(e.allowedTools)}}function rI(t,i){if(t&1&&(u(0,"dt"),m(1,"model"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.model)}}function sI(t,i){if(t&1&&(u(0,"dt"),m(1,"effort"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.effort)}}function aI(t,i){if(t&1&&(u(0,"dt"),m(1,"context"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.context)}}function cI(t,i){if(t&1&&(u(0,"dt"),m(1,"agent"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.agent)}}function dI(t,i){if(t&1&&(u(0,"dt"),m(1,"shell"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.shell)}}function lI(t,i){if(t&1&&A(0,"p-chip",12),t&2){let e=i.$implicit;T("label",e)}}function uI(t,i){if(t&1&&(u(0,"dt"),m(1,"paths"),f(),u(2,"dd",11),J(3,lI,1,1,"p-chip",12,we),f()),t&2){p();let e=Q(0);c(3),ee(e.paths)}}function fI(t,i){t&1&&(u(0,"dt"),m(1,"disable-model-invocation"),f(),u(2,"dd")(3,"code"),m(4,"true"),f()())}function hI(t,i){if(t&1&&(u(0,"dt"),m(1,"user-invocable"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.userInvocable)}}function pI(t,i){if(t&1&&(ot(0),u(1,"dl",7),w(2,J1,4,1),w(3,eI,5,1),w(4,nI,5,0),w(5,oI,5,0),w(6,rI,5,1),w(7,sI,5,1),w(8,aI,5,1),w(9,cI,5,1),w(10,dI,5,1),w(11,uI,5,0),w(12,fI,5,0),w(13,hI,5,1),f()),t&2){let e=Ae(p(3).skillBase());c(2),S(e.when_to_use!==null?2:-1),c(),S(e.argumentHint!==null?3:-1),c(),S(e.arguments.length?4:-1),c(),S(e.allowedTools.length?5:-1),c(),S(e.model!==null?6:-1),c(),S(e.effort!==null?7:-1),c(),S(e.context!==null?8:-1),c(),S(e.agent!==null?9:-1),c(),S(e.shell!==null?10:-1),c(),S(e.paths.length?11:-1),c(),S(e.disableModelInvocation?12:-1),c(),S(e.userInvocable!==null?13:-1)}}function mI(t,i){if(t&1&&(u(0,"div",6),w(1,Q1,14,13)(2,pI,14,13,"dl",7),f()),t&2){let e=p(2);c(),S(e.isAgent()?1:e.isSkillOrCommand()?2:-1)}}function _I(t,i){if(t&1){let e=ae();u(0,"div",0)(1,"section",1)(2,"h4",2)(3,"button",3),K("click",function(){j(e);let o=p();return U(o.toggleSection())}),A(4,"i",4),m(5),u(6,"span",5),m(7),f()()(),w(8,mI,3,1,"div",6),f()()}if(t&2){let e=p();c(3),Z("aria-expanded",e.sectionExpanded()),c(),de("pi-chevron-right",!e.sectionExpanded())("pi-chevron-down",e.sectionExpanded()),c(),Ge(" ",e.texts.providerSpecificHeader," "),c(2),Ge("(",e.texts.fieldCount(e.populatedFieldCount()),")"),c(),S(e.sectionExpanded()?8:-1)}}var Kl=class t{frontmatter=F.required();kind=F.required();provider=F(void 0);knownPaths=F(null);onSkillClick=F(null);texts=Am;hasVendorSurface=P(()=>{let i=this.kind();return i==="agent"||i==="skill"||i==="command"});isAgent=P(()=>this.kind()==="agent");isSkillOrCommand=P(()=>{let i=this.kind();return i==="skill"||i==="command"});tools=P(()=>Xl(this.fm().tools));model=P(()=>st(this.fm().model));skills=P(()=>Xl(this.fm().skills));disallowedTools=P(()=>Xl(this.fm().disallowedTools));initialPrompt=P(()=>st(this.fm().initialPrompt));initialPromptExpanded=q(!1);permissionMode=P(()=>st(this.fm().permissionMode));maxTurns=P(()=>gI(this.fm().maxTurns));memory=P(()=>st(this.fm().memory));background=P(()=>this.fm().background===!0);effort=P(()=>st(this.fm().effort));isolation=P(()=>st(this.fm().isolation));mcpServers=P(()=>{let i=this.fm().mcpServers;return Array.isArray(i)?i.filter(e=>typeof e=="object"&&e!==null).map((e,n)=>({name:typeof e.name=="string"&&e.name.length>0?e.name:`mcpServer[${n}]`,command:typeof e.command=="string"?e.command:null})):[]});hooks=P(()=>{let i=this.fm().hooks;if(typeof i!="object"||i===null)return[];let e=[];for(let[n,o]of Object.entries(i)){let r=typeof o=="object"&&o!==null?Object.keys(o):[];e.push({event:n,keys:r})}return e});skillBase=P(()=>{let i=this.fm();return{when_to_use:st(i.when_to_use),argumentHint:st(i["argument-hint"]),arguments:ch(i.arguments),disableModelInvocation:i["disable-model-invocation"]===!0,userInvocable:typeof i["user-invocable"]=="boolean"?i["user-invocable"]:null,allowedTools:ch(i["allowed-tools"]),model:st(i.model),effort:st(i.effort),context:st(i.context),agent:st(i.agent),paths:ch(i.paths),shell:st(i.shell)}});populatedFieldCount=P(()=>{if(this.isAgent()){let i=0;return this.model()!==null&&i++,this.tools().length&&i++,this.skills().length&&i++,this.disallowedTools().length&&i++,this.permissionMode()!==null&&i++,this.maxTurns()!==null&&i++,this.effort()!==null&&i++,this.memory()!==null&&i++,this.background()&&i++,this.isolation()!==null&&i++,this.initialPrompt()!==null&&i++,this.mcpServers().length&&i++,this.hooks().length&&i++,i}if(this.isSkillOrCommand()){let i=this.skillBase(),e=0;return i.when_to_use!==null&&e++,i.argumentHint!==null&&e++,i.arguments.length&&e++,i.allowedTools.length&&e++,i.model!==null&&e++,i.effort!==null&&e++,i.context!==null&&e++,i.agent!==null&&e++,i.shell!==null&&e++,i.paths.length&&e++,i.disableModelInvocation&&e++,i.userInvocable!==null&&e++,e}return 0});hasAnyContent=P(()=>this.hasVendorSurface()&&this.populatedFieldCount()>0);sectionExpanded=q(!1);toggleSection(){this.sectionExpanded.update(i=>!i)}toggleInitialPrompt(){this.initialPromptExpanded.update(i=>!i)}onSkillChipClick(i){let e=this.onSkillClick();e&&e(i)}isSkillKnown(i){let e=this.knownPaths();return e?e.has(i):!1}fm(){return this.frontmatter()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){e&1&&w(0,_I,9,8,"div",0),e&2&&S(n.hasAnyContent()?0:-1)},dependencies:[wn,To,je],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:3px}.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 .p-chip{background:var(--sm-severity-error-bg);color:var(--sm-severity-error)}"],changeDetection:0})};function st(t){return typeof t=="string"&&t.length>0?t:null}function gI(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Xl(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"&&i.length>0):[]}function ch(t){return typeof t=="string"?t.length>0?[t]:[]:Array.isArray(t)?Xl(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 Vm=(t,i)=>i.key,yI=(t,i)=>i.pluginId;function vI(t,i){if(t&1&&(u(0,"p",0),m(1),f()),t&2){let e=p();c(),y(e.texts.empty)}}function CI(t,i){if(t&1&&(u(0,"span",5),m(1),f()),t&2){let e=p().$implicit,n=p(3);c(),y(n.texts.rootContribBadge(e.pluginId))}}function xI(t,i){if(t&1&&(u(0,"div",3)(1,"code",4),m(2),f(),w(3,CI,2,1,"span",5),u(4,"pre",6),m(5),f()()),t&2){let e=i.$implicit;c(2),y(e.key),c(),S(e.pluginId!==null?3:-1),c(2),y(e.value)}}function bI(t,i){if(t&1&&(u(0,"div",1),J(1,xI,6,3,"div",3,Vm),f()),t&2){let e=p(2);c(),ee(e.rootContributions())}}function wI(t,i){if(t&1&&(u(0,"span",10),m(1),f()),t&2){let e=p(4);c(),y(e.texts.unregisteredBadge)}}function SI(t,i){if(t&1&&(u(0,"dt",12),m(1),f(),u(2,"dd")(3,"pre"),m(4),f()()),t&2){let e=i.$implicit;T("pTooltip",e.description??""),c(),y(e.key),c(3),y(e.value)}}function II(t,i){if(t&1&&(u(0,"section",7)(1,"h5",8)(2,"span",9),m(3),f(),w(4,wI,2,1,"span",10),f(),u(5,"dl",11),J(6,SI,5,3,null,null,Vm),f()()),t&2){let e=i.$implicit;Z("data-testid","plugin-contributions-ns-"+e.pluginId),c(3),y(e.pluginId),c(),S(e.registered?-1:4),c(2),ee(e.rows)}}function TI(t,i){if(t&1&&(u(0,"div",2),J(1,II,8,3,"section",7,yI),f()),t&2){let e=p(2);c(),ee(e.namespaces())}}function EI(t,i){if(t&1&&(w(0,bI,3,0,"div",1),w(1,TI,3,0,"div",2)),t&2){let e=p();S(e.rootContributions().length?0:-1),c(),S(e.namespaces().length?1:-1)}}var Bm=new Set(["identity","annotations","settings","audit"]),Yl=class t{http=d(ho);sidecarRoot=F(void 0);texts=Lm;catalog=q(null);constructor(){this.fetchCatalog()}namespaces=P(()=>{let i=this.sidecarRoot();if(!i)return[];let e=this.catalog(),n=new Map;if(e)for(let r of e){if(r.location!=="namespaced")continue;let s=n.get(r.pluginId);s?s.push(r):n.set(r.pluginId,[r])}let o=[];for(let[r,s]of Object.entries(i)){if(Bm.has(r)||this.isRegisteredRootKey(r))continue;let l=typeof s=="object"&&s!==null&&!Array.isArray(s)?s:{value:s},h=n.has(r),_=n.get(r)??[],v=Object.entries(l).map(([b,I])=>({key:b,value:zm(I),description:h?PI(_,b):null}));o.push({pluginId:r,registered:h,rows:v})}return o});rootContributions=P(()=>{let i=this.sidecarRoot();if(!i)return[];let e=this.catalog();if(!e)return[];let n=new Map;for(let r of e)r.location==="root"&&n.set(r.key,r);let o=[];for(let[r,s]of Object.entries(i)){if(Bm.has(r))continue;let a=n.get(r);a&&o.push({key:r,pluginId:a.pluginId,value:zm(s)})}return o});count=P(()=>this.namespaces().length+this.rootContributions().length);isEmpty=P(()=>this.count()===0);isRegisteredRootKey(i){let e=this.catalog();return e?e.some(n=>n.location==="root"&&n.key===i):!1}async fetchCatalog(){try{let i=await eo(this.http.get("/api/annotations/registered"));this.catalog.set(i.items)}catch{this.catalog.set([])}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){e&1&&w(0,vI,2,1,"p",0)(1,EI,2,2),e&2&&S(n.isEmpty()?0:1)},dependencies:[je,Qe],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:3px;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:3px}.pcp__root-value[_ngcontent-%COMP%]{flex:1 1 100%;margin:.2rem 0 0;padding:.45rem .6rem;background:var(--sm-bg-hover);border-radius:3px;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:3px}.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 PI(t,i){for(let e of t)if(e.key===i){let n=e.schema.description;return typeof n=="string"&&n.length>0?n:null}return null}var Gm={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 MI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function DI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function kI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.bodyHashDrift()),c(),y(i)}}function RI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function NI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.bodyHashDrift()),c(),y(i)}}function OI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function FI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.frontmatterHashDrift()),c(),y(i)}}function AI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function LI(t,i){if(t&1&&(H(0,"code"),m(1),$()),t&2){let e=p();de("dbg__diff",e.frontmatterHashDrift()),c(),y(i)}}function BI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}function zI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function VI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.notSetMarker)}}function GI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function HI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.notSetMarker)}}function jI(t,i){t&1&&(H(0,"code"),m(1),$()),t&2&&(c(),y(i))}function UI(t,i){if(t&1&&(H(0,"span",2),m(1),$()),t&2){let e=p();c(),y(e.texts.absentMarker)}}var Zl=class t{node=F.required();sidecarRoot=F(null);overlay=F(void 0);texts=Gm;identityBlock=P(()=>{let i=this.sidecarRoot(),e={path:null,bodyHash:null,frontmatterHash:null,resolvedProvider:null,resolvedKind:null};if(!i)return e;let n=i.identity;if(typeof n!="object"||n===null)return e;let o=n,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=P(()=>this.node().bodyHash??null);frontmatterHashLive=P(()=>this.node().frontmatterHash??null);bodyHashDrift=P(()=>{let i=this.identityBlock().bodyHash,e=this.bodyHashLive();return i!==null&&e!==null&&i!==e});frontmatterHashDrift=P(()=>{let i=this.identityBlock().frontmatterHash,e=this.frontmatterHashLive();return i!==null&&e!==null&&i!==e});sidecarStatusLiteral=P(()=>{let i=this.overlay();if(!i)return null;let e=i.status??null;return e===null?null:String(e)});sidecarPresent=P(()=>this.overlay()?.present===!0);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){if(e&1&&(H(0,"dl",0)(1,"dt"),m(2),$(),H(3,"dd",1),w(4,MI,2,1,"code")(5,DI,2,1,"span",2),$(),H(6,"dt"),m(7),$(),H(8,"dd",3),w(9,kI,2,3,"code",4)(10,RI,2,1,"span",2),$(),H(11,"dt"),m(12),$(),H(13,"dd",5),w(14,NI,2,3,"code",4)(15,OI,2,1,"span",2),$(),H(16,"dt"),m(17),$(),H(18,"dd",6),w(19,FI,2,3,"code",4)(20,AI,2,1,"span",2),$(),H(21,"dt"),m(22),$(),H(23,"dd",7),w(24,LI,2,3,"code",4)(25,BI,2,1,"span",2),$(),H(26,"dt"),m(27),$(),H(28,"dd",8),w(29,zI,2,1,"code")(30,VI,2,1,"span",2),$(),H(31,"dt"),m(32),$(),H(33,"dd",9),w(34,GI,2,1,"code")(35,HI,2,1,"span",2),$(),H(36,"dt"),m(37),$(),H(38,"dd",10),w(39,jI,2,1,"code")(40,UI,2,1,"span",2),$(),H(41,"dt"),m(42),$(),H(43,"dd",11)(44,"code"),m(45),$()()()),e&2){let o,r,s,a,l,h,_,v;c(2),y(n.texts.fields.forPath),c(2),S((o=n.identityBlock().path)?4:5,o),c(3),y(n.texts.fields.bodyHashStored),c(2),S((r=n.identityBlock().bodyHash)?9:10,r),c(3),y(n.texts.fields.bodyHashLive),c(2),S((s=n.bodyHashLive())?14:15,s),c(3),y(n.texts.fields.frontmatterHashStored),c(2),S((a=n.identityBlock().frontmatterHash)?19:20,a),c(3),y(n.texts.fields.frontmatterHashLive),c(2),S((l=n.frontmatterHashLive())?24:25,l),c(3),y(n.texts.fields.resolvedProvider),c(2),S((h=n.identityBlock().resolvedProvider)?29:30,h),c(3),y(n.texts.fields.resolvedKind),c(2),S((_=n.identityBlock().resolvedKind)?34:35,_),c(3),y(n.texts.fields.sidecarStatus),c(2),S((v=n.sidecarStatusLiteral())?39:40,v),c(3),y(n.texts.fields.sidecarPresent),c(3),y(n.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:3px;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 $I(t,i){if(t&1&&(H(0,"span",3),m(1),H(2,"code"),m(3),$()()),t&2){p(2);let e=Q(0),n=p();c(),Ge(" ",n.texts.fields.lastBumpedBy," "),c(2),y(e.lastBumpedBy)}}function WI(t,i){if(t&1&&(H(0,"dt"),m(1),$(),H(2,"dd")(3,"span",2),m(4),$(),w(5,$I,4,2,"span",3),$()),t&2){p();let e=Q(0),n=p();c(),y(n.texts.fields.lastBumpedAt),c(2),yu("title",e.lastBumpedAt),c(),y(n.lastBumpedRel()),c(),S(e.lastBumpedBy!==null?5:-1)}}function qI(t,i){if(t&1&&(H(0,"span",3),m(1),H(2,"code"),m(3),$()()),t&2){p(2);let e=Q(0),n=p();c(),Ge(" ",n.texts.fields.createdBy," "),c(2),y(e.createdBy)}}function XI(t,i){if(t&1&&(H(0,"dt"),m(1),$(),H(2,"dd")(3,"span",2),m(4),$(),w(5,qI,4,2,"span",3),$()),t&2){p();let e=Q(0),n=p();c(),y(n.texts.fields.createdAt),c(2),yu("title",e.createdAt),c(),y(n.createdRel()),c(),S(e.createdBy!==null?5:-1)}}function KI(t,i){if(t&1&&(ot(0),H(1,"dl",0),w(2,WI,6,4),w(3,XI,6,4),$()),t&2){let e=Ae(p().audit());c(2),S(e.lastBumpedAt!==null?2:-1),c(),S(e.createdAt!==null?3:-1)}}function YI(t,i){if(t&1&&(H(0,"p",1),m(1),$()),t&2){let e=p();c(),y(e.texts.headerEmpty)}}var Jl=class t{sidecarRoot=F(null);texts=Hl.audit;audit=P(()=>{let i=this.sidecarRoot(),e={lastBumpedAt:null,lastBumpedBy:null,createdAt:null,createdBy:null};if(!i)return e;let n=i.audit;if(typeof n!="object"||n===null)return e;let o=n;return{lastBumpedAt:Ql(o.lastBumpedAt),lastBumpedBy:Ql(o.lastBumpedBy),createdAt:Ql(o.createdAt),createdBy:Ql(o.createdBy)}});hasContent=P(()=>{let i=this.audit();return i.lastBumpedAt!==null||i.lastBumpedBy!==null||i.createdAt!==null||i.createdBy!==null});headerSummary=P(()=>{let i=this.audit();if(i.lastBumpedAt===null)return this.texts.headerEmpty;let e=dh(i.lastBumpedAt);return this.texts.headerSummary(e,i.lastBumpedBy??"?")});lastBumpedRel=P(()=>{let i=this.audit().lastBumpedAt;return i===null?null:dh(i)});createdRel=P(()=>{let i=this.audit().createdAt;return i===null?null:dh(i)});static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({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,n){e&1&&w(0,KI,4,3,"dl",0)(1,YI,2,1,"p",1),e&2&&S(n.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 Ql(t){return typeof t=="string"&&t.length>0?t:null}function dh(t){let i=new Date(t);if(isNaN(i.getTime()))return t;let e=Date.now()-i.getTime(),n=Math.floor(e/1e3);if(n<60)return"just now";let o=Math.floor(n/60);if(o<60)return`${o} minute${o===1?"":"s"} ago`;let r=Math.floor(o/60);if(r<24)return`${r} hour${r===1?"":"s"} ago`;let s=Math.floor(r/24);if(s<30)return`${s} day${s===1?"":"s"} ago`;let a=Math.floor(s/30);if(a<12)return`${a} month${a===1?"":"s"} ago`;let l=Math.floor(s/365);return`${l} year${l===1?"":"s"} ago`}var ZI=["closeBtn"];function QI(t,i){if(t&1&&(u(0,"section",1)(1,"div",2),A(2,"span",3),u(3,"p",4),m(4),f(),u(5,"p",5),m(6),u(7,"a",6),m(8),f(),m(9),u(10,"a",7),m(11),f(),m(12),f()()()),t&2){let e=p();c(4),y(e.texts.emptyNoSelection.title),c(2),y(e.texts.emptyNoSelection.descPrefix),c(2),y(e.texts.emptyNoSelection.listLink),c(),y(e.texts.emptyNoSelection.descMiddle),c(2),y(e.texts.emptyNoSelection.graphLink),c(),y(e.texts.emptyNoSelection.descSuffix)}}function JI(t,i){if(t&1&&(u(0,"section",1)(1,"div",8),A(2,"span",9),u(3,"p",4),m(4),f(),u(5,"p",5)(6,"code"),m(7),f(),m(8),u(9,"a",6),m(10),f(),m(11),f()()()),t&2){let e=p();c(4),y(e.texts.emptyNotFound.title),c(3),y(e.path()),c(),y(e.texts.emptyNotFound.descSuffix),c(2),y(e.texts.emptyNotFound.backLink),c(),y(e.texts.emptyNotFound.descAfterLink)}}function eT(t,i){if(t&1&&(u(0,"span",20),A(1,"i",77),f()),t&2){let e=p(2);T("pTooltip",e.headerStaleTooltip())}}function tT(t,i){if(t&1&&(u(0,"span",21),$e(),u(1,"svg",78),A(2,"path",79)(3,"path",80)(4,"path",81),f()()),t&2){let e=p(2);T("pTooltip",e.cardTexts.stability.experimental)}}function nT(t,i){if(t&1&&(u(0,"span",21),A(1,"i",82),f()),t&2){let e=p(2);T("pTooltip",e.cardTexts.stability.deprecated)}}function iT(t,i){t&1&&(u(0,"span",22),m(1),f()),t&2&&(c(),y(i))}function oT(t,i){if(t&1){let e=ae();u(0,"button",83,0),K("click",function(o){j(e);let r=p(2);return U(r.onCloseClick(o))}),A(2,"i",84),f()}if(t&2){let e=p(2);T("pTooltip",e.texts.close.tooltip),Z("aria-label",e.texts.close.label)}}function rT(t,i){if(t&1&&(u(0,"span",85),m(1),f()),t&2){let e=i.$implicit;c(),y(e)}}function sT(t,i){if(t&1&&(u(0,"div",36),J(1,rT,2,1,"span",85,we),f()),t&2){let e=p(2);c(),ee(e.headerTools())}}function aT(t,i){if(t&1&&(u(0,"a",41),m(1),f()),t&2){let e=p(2);c(),y(e.texts.backToList)}}function cT(t,i){if(t&1&&(u(0,"div",42),A(1,"i",86),u(2,"span"),m(3),f()()),t&2){let e=p(2);c(3),y(e.texts.supersededByBanner(i))}}function dT(t,i){if(t&1){let e=ae();u(0,"div",43)(1,"span"),m(2),f(),u(3,"button",87),K("click",function(){j(e);let o=p(2);return U(o.dismissBumpError())}),A(4,"i",84),f()()}t&2&&(c(2),y(i))}function lT(t,i){if(t&1&&(u(0,"p",44),m(1),f()),t&2){p();let e=Q(1);c(),y(e.description)}}function uT(t,i){if(t&1&&(u(0,"div",45),A(1,"sm-inspector-debug-panel",88),f()),t&2){p();let e=Q(0),n=p();c(),T("node",e)("sidecarRoot",n.sidecarRoot())("overlay",e.sidecar)}}function fT(t,i){if(t&1&&A(0,"sm-empty-state",89)(1,"sm-empty-state",90)(2,"sm-empty-state",91),t&2){let e=p(2);T("title",e.texts.placeholders.enrichmentTitle)("body",e.texts.placeholders.body),c(),T("title",e.texts.placeholders.summaryTitle)("body",e.texts.placeholders.body),c(),T("title",e.texts.placeholders.findingsTitle)("body",e.texts.placeholders.body)}}function hT(t,i){if(t&1){let e=ae();u(0,"p-card",47)(1,"sm-annotations-panel",92),K("openPath",function(o){j(e);let r=p(2);return U(r.openPath(o))})("tagClick",function(o){j(e);let r=p(2);return U(r.tagSelect.emit(o))}),f()()}if(t&2){p();let e=Q(0),n=p();T("header",n.texts.cardsAnnotations),c(),T("overlay",e.sidecar)("authorTags",n.authorTags())("knownPaths",n.pathSet())("activeTag",n.activeTag())}}function pT(t,i){if(t&1&&(u(0,"dt"),m(1,"Bytes"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.bytesTotal)}}function mT(t,i){if(t&1&&(u(0,"dt"),m(1,"Tokens"),f(),u(2,"dd")(3,"code"),m(4),f()()),t&2){p();let e=Q(0);c(4),y(e.tokensTotal)}}function _T(t,i){if(t&1&&(m(0," \xB7 "),u(1,"code"),m(2),f(),m(3," ext ")),t&2){p();let e=Q(0);c(2),y(e.externalRefsCount)}}function gT(t,i){if(t&1){let e=ae();u(0,"button",93),K("click",function(){j(e);let o=p(2);return U(o.toggleAudit())}),A(1,"i",94),u(2,"span",95),m(3),f(),u(4,"span",96),m(5),f()()}if(t&2){let e=p(2);Z("aria-expanded",e.auditExpanded()),c(),de("pi-chevron-right",!e.auditExpanded())("pi-chevron-down",e.auditExpanded()),c(2),y(e.texts.audit.header),c(2),Ge(" \xB7 ",e.auditSummary()," ")}}function yT(t,i){if(t&1&&A(0,"sm-inspector-audit-panel",56),t&2){let e=p(2);T("sidecarRoot",e.sidecarRoot())}}function vT(t,i){if(t&1){let e=ae();u(0,"button",97),K("click",function(){j(e);let o=p(2);return U(o.togglePlugins())}),A(1,"i",94),u(2,"span",95),m(3,"Plugin contributions"),f()()}if(t&2){let e=p(2);Z("aria-expanded",e.pluginsExpanded()),c(),de("pi-chevron-right",!e.pluginsExpanded())("pi-chevron-down",e.pluginsExpanded())}}function CT(t,i){if(t&1&&A(0,"sm-plugin-contributions",56),t&2){let e=p(2);T("sidecarRoot",e.sidecarRoot())}}function xT(t,i){if(t&1){let e=ae();u(0,"div",98)(1,"h3",99),m(2),f(),u(3,"p-button",100),K("onClick",function(){j(e);let o=p(2);return U(o.refreshBody())}),f()()}if(t&2){let e=p(2);c(2),y(e.texts.cards.body),c(),T("rounded",!0)("text",!0)("ariaLabel",e.texts.body.refreshLabel)("pTooltip",e.texts.body.refreshLabel)("disabled",e.bodyState()==="loading"||!e.path())}}function bT(t,i){if(t&1&&(u(0,"p",72),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.loading)}}function wT(t,i){if(t&1&&(u(0,"p",73),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.empty)}}function ST(t,i){if(t&1&&(u(0,"p",74),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.unavailable)}}function IT(t,i){if(t&1&&(u(0,"p",75),m(1),f()),t&2){let e=p(2);c(),y(e.texts.body.renderError)}}function TT(t,i){if(t&1&&A(0,"div",76),t&2){let e=p(2);T("innerHTML",e.bodyHtml(),xh)}}function ET(t,i){if(t&1){let e=ae();ot(0)(1),u(2,"section",1)(3,"header",10)(4,"div",11),A(5,"sm-kind-icon",12),f(),u(6,"div",13)(7,"div",14)(8,"h2",15),m(9),f()(),u(10,"code",16),m(11),f()(),u(12,"div",17)(13,"button",18),K("click",function(o){j(e);let r=p();return U(r.toggleFavorite(o))}),A(14,"i",19),f(),w(15,eT,2,1,"span",20),w(16,tT,5,1,"span",21),w(17,nT,2,1,"span",21),w(18,iT,2,1,"span",22),u(19,"div",23),A(20,"sm-view-contributions-host",24),f(),u(21,"div",25),A(22,"sm-view-contributions-host",26),f(),w(23,oT,3,2,"button",27),f(),u(24,"div",28)(25,"span",29),m(26,"Actions"),f(),u(27,"button",30),A(28,"i",31),u(29,"span"),m(30,"Generate summary"),f()(),u(31,"button",32),A(32,"i",33),u(33,"span"),m(34,"Run audit"),f()(),u(35,"button",34),A(36,"i",35),u(37,"span"),m(38,"Validate"),f()()(),w(39,sT,3,0,"div",36),f(),u(40,"div",37)(41,"button",38),K("click",function(){j(e);let o=p();return U(o.toggleDebug())}),A(42,"i",39),f(),u(43,"p-button",40),K("onClick",function(){j(e);let o=p();return U(o.onBumpClick())}),f(),w(44,aT,2,1,"a",41),f(),w(45,cT,4,1,"div",42),w(46,dT,5,1,"div",43),w(47,lT,2,1,"p",44),w(48,uT,2,3,"div",45),u(49,"div",46),w(50,fT,3,6),w(51,hT,2,5,"p-card",47),u(52,"p-card",48),A(53,"sm-vendor-frontmatter",49),f(),u(54,"div",50)(55,"sm-linked-nodes-panel",51),K("openPath",function(o){j(e);let r=p();return U(r.openPath(o))}),f()(),u(56,"p-card",52)(57,"dl",53),w(58,pT,5,1),w(59,mT,5,1),u(60,"dt"),m(61,"Links"),f(),u(62,"dd")(63,"code"),m(64),f(),m(65," out \xB7 "),u(66,"code"),m(67),f(),m(68," in "),w(69,_T,4,1),f()()(),u(70,"p-card",54),Me(71,gT,6,7,"ng-template",55),w(72,yT,1,1,"sm-inspector-audit-panel",56),f(),u(73,"p-card",57),Me(74,vT,4,5,"ng-template",55),w(75,CT,1,1,"sm-plugin-contributions",56),f(),u(76,"p-card",58)(77,"div",59),A(78,"sm-view-contributions-host",60),f(),u(79,"div",61),A(80,"sm-view-contributions-host",62),f(),u(81,"div",63),A(82,"sm-view-contributions-host",64),f(),u(83,"div",65),A(84,"sm-view-contributions-host",66),f(),u(85,"div",67),A(86,"sm-view-contributions-host",68),f(),u(87,"div",69),A(88,"sm-view-contributions-host",70),f()(),u(89,"p-card",71),Me(90,xT,4,6,"ng-template",55),w(91,bT,2,1,"p",72)(92,wT,2,1,"p",73)(93,ST,2,1,"p",74)(94,IT,2,1,"p",75)(95,TT,1,1,"div",76),f()()()}if(t&2){let e,n,o,r,s=p(),a=Ae(s.node());c();let l=Ae(a.frontmatter);c(2),at("--node-color",s.headerTitleColor()),de("inspector__header--skill",a.kind==="skill")("inspector__header--agent",a.kind==="agent")("inspector__header--command",a.kind==="command")("inspector__header--markdown",a.kind==="markdown"),c(2),T("kind",a.kind)("size",18),c(4),y(l.name),c(2),y(a.path),c(2),de("inspector__favorite--on",a.isFavorite===!0),T("pTooltip",a.isFavorite===!0?s.cardTexts.favoriteRemoveTooltip:s.cardTexts.favoriteAddTooltip),Z("aria-label",a.isFavorite===!0?s.cardTexts.ariaFavoriteRemove:s.cardTexts.ariaFavoriteAdd),c(),Ce(a.isFavorite===!0?"pi pi-heart-fill":"pi pi-heart"),c(),S(s.headerIsStale()?15:-1),c(),S(s.headerStability()==="experimental"?16:-1),c(),S(s.headerStability()==="deprecated"?17:-1),c(),S((e=s.headerVersion())?18:-1,e),c(2),T("node",a),c(2),T("node",a),c(),S(s.mode()==="embedded"?23:-1),c(16),S(s.headerTools().length>0?39:-1),c(2),de("inspector__debug-toggle--active",s.debugVisible()),T("pTooltip",s.texts.debugToggleTooltip),Z("aria-label",s.texts.debugToggleAriaLabel)("aria-pressed",s.debugVisible()),c(2),T("label",s.texts.bump.label)("disabled",!s.canBump()||s.bumpInFlight())("loading",s.bumpInFlight())("pTooltip",s.bumpTooltip()),c(),S(s.mode()==="standalone"?44:-1),c(),S((n=s.headerSupersededBy())?45:-1,n),c(),S((o=s.bumpError())?46:-1,o),c(),S(l.description?47:-1),c(),S(s.debugVisible()?48:-1),c(2),S(s.mode()==="standalone"?50:-1),c(),S(a.sidecar!=null&&a.sidecar.present||s.authorTags().length>0?51:-1),c(),T("header",s.texts.cards.agent),c(),T("frontmatter",l)("kind",a.kind)("provider",a.provider)("knownPaths",s.pathSet())("onSkillClick",s.onSkillChip),c(2),T("path",a.path),c(3),S(a.bytesTotal!==void 0?58:-1),c(),S(a.tokensTotal!==void 0?59:-1),c(5),y(a.linksOutCount??0),c(3),y(a.linksInCount??0),c(2),S(a.externalRefsCount!==void 0&&a.externalRefsCount>0?69:-1),c(3),S(s.auditExpanded()?72:-1),c(3),S(s.pluginsExpanded()?75:-1),c(3),T("node",s.node()),c(2),T("node",s.node()),c(2),T("node",s.node()),c(2),T("node",s.node()),c(2),T("node",s.node()),c(2),T("node",s.node()),c(3),S((r=s.bodyState())==="loading"?91:r==="empty"?92:r==="unavailable"?93:r==="error"?94:r==="ready"?95:-1)}}var PT={stable:"success",experimental:"info",deprecated:"warn"},eu=class t{loader=d(Mt);router=d(po);kindRegistry=d(Dt);dataSource=d(Cn);markdown=d($h);sidecarService=d(jl);texts=Hl;cardTexts=Wi;path=F(void 0);mode=F("standalone");activeTag=F(null);close=He();tagSelect=He();closeBtn=Te("closeBtn");node=P(()=>{let i=this.path();return i?this.loader.nodes().find(e=>e.path===i)??null:null});pathSet=P(()=>{let i=new Set;for(let e of this.loader.nodes())i.add(e.path);return i});headerVersion=P(()=>Nl(this.node()));headerStability=P(()=>Ol(this.node()));headerTitleColor=P(()=>{let i=this.node();if(!i)return null;let n=i.frontmatter.color;return typeof n=="string"&&n.length>0?n:`var(--sm-kind-${i.kind})`});headerTools=P(()=>Sm(this.node()));authorTags=P(()=>{let e=(this.node()?.frontmatter??{}).tags;if(!Array.isArray(e))return[];let n=e.filter(o=>typeof o=="string"&&o.length>0);return[...new Set(n)].sort()});headerIsStale=P(()=>Fl(this.node()));headerStaleTooltip=P(()=>Al(this.node(),Wi.sidecar));headerSupersededBy=P(()=>{let i=this.node();if(!i)return null;let n=i.sidecar?.annotations?.supersededBy;if(typeof n=="string"&&n.length>0)return n;let o=Zt(i.frontmatter)?.supersededBy;return typeof o=="string"&&o.length>0?o:null});bodyState=q("idle");bodyHtml=q(null);fetchToken=0;verifiedAlive=q(new Set);verifiedDead=q(new Set);verifyInFlight=q(new Set);auditExpanded=q(!1);pluginsExpanded=q(!1);debugVisible=q(!1);constructor(){me(()=>{let i=this.path(),e=++this.fetchToken;if(this.bodyHtml.set(null),!i){this.bodyState.set("idle");return}this.bodyState.set("loading"),this.fetchAndRenderBody(i,e)}),me(()=>{this.path(),this.verifiedAlive.set(new Set),this.verifiedDead.set(new Set),this.verifyInFlight.set(new Set)}),me(()=>{this.path(),this.auditExpanded.set(!1),this.pluginsExpanded.set(!1),this.debugVisible.set(!1)}),me(()=>{let i=this.path();this.mode()==="embedded"&&i&&queueMicrotask(()=>this.closeBtn()?.nativeElement.focus({preventScroll:!0}))})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}kindLabel(i){return this.kindRegistry.labelOf(i)}kindStyle(i){return{background:`var(--sm-kind-${i}-bg)`,color:`var(--sm-kind-${i}-fg)`}}stabilitySeverity(i){return PT[i]}openPath(i){this.router.navigate(["/graph"],{queryParams:{path:i}})}onSkillChip=i=>{this.openPath(i)};pathExists(i){return this.pathSet().has(i)}sidecarRoot=P(()=>{let i=this.node()?.sidecar;if(!i||!i.present)return null;if(i.root)return i.root;let e={};return i.annotations&&(e.annotations=i.annotations),e});auditSummary=P(()=>{let i=this.sidecarRoot();if(!i)return this.texts.audit.headerEmpty;let e=i.audit;if(typeof e!="object"||e===null)return this.texts.audit.headerEmpty;let n=e,o=typeof n.lastBumpedAt=="string"?n.lastBumpedAt:null,r=typeof n.lastBumpedBy=="string"?n.lastBumpedBy:null;return o===null?this.texts.audit.headerEmpty:this.texts.audit.headerSummary(Im(o),r??"?")});linkStatus(i){return this.pathSet().has(i)||this.verifiedAlive().has(i)?"live":this.verifiedDead().has(i)?"dead-confirmed":"dead-heuristic"}isVerifying(i){return this.verifyInFlight().has(i)}async verifyDeadLink(i){if(!(this.verifiedAlive().has(i)||this.verifiedDead().has(i))&&!this.verifyInFlight().has(i)){this.verifyInFlight.update(e=>new Set(e).add(i));try{await this.dataSource.getNode(i)===null?this.verifiedDead.update(n=>new Set(n).add(i)):this.verifiedAlive.update(n=>new Set(n).add(i))}catch{}finally{this.verifyInFlight.update(e=>{let n=new Set(e);return n.delete(i),n})}}}refreshBody(){let i=this.path();if(!i||this.bodyState()==="loading")return;let e=++this.fetchToken;this.bodyHtml.set(null),this.bodyState.set("loading"),this.fetchAndRenderBody(i,e)}toggleFavorite(i){i.stopPropagation();let e=this.node();e&&this.loader.toggleFavorite(e.path,!e.isFavorite)}onCloseClick(i){i.stopPropagation(),this.close.emit()}toggleAudit(){this.auditExpanded.update(i=>!i)}togglePlugins(){this.pluginsExpanded.update(i=>!i)}toggleDebug(){this.debugVisible.update(i=>!i)}canBump=P(()=>{let i=this.node();if(!i)return!1;let e=i.sidecar;return!e||e.present===!1?!0:e.status==="fresh"?!1:yo(e)});bumpInFlight=q(!1);bumpError=q(null);bumpTooltip=P(()=>this.canBump()?this.texts.bump.tooltipEnabled:this.texts.bump.tooltipDisabledFresh);async onBumpClick(){let i=this.node();if(i&&this.canBump()&&!this.bumpInFlight()){this.bumpInFlight.set(!0),this.bumpError.set(null);try{await this.sidecarService.bump(i.path)}catch(e){this.bumpError.set(this.formatBumpError(e))}finally{this.bumpInFlight.set(!1)}}}dismissBumpError(){this.bumpError.set(null)}formatBumpError(i){if(i instanceof Yt)switch(i.code){case"sidecar-fresh":return`${this.texts.bump.errorPrefix} ${this.texts.bump.errorFresh}`;case"not-found":return`${this.texts.bump.errorPrefix} ${this.texts.bump.errorNotFound}`;default:return`${this.texts.bump.errorPrefix} ${i.message||this.texts.bump.errorGeneric}`}let e=i instanceof Error?i.message:String(i);return`${this.texts.bump.errorPrefix} ${e||this.texts.bump.errorGeneric}`}async fetchAndRenderBody(i,e){try{let n=await this.dataSource.getNode(i,{includeBody:!0});if(e!==this.fetchToken)return;if(n===null){this.bodyState.set("unavailable");return}let o=n.item.body;if(o===null){this.bodyState.set("unavailable");return}if(o===void 0||o.trim().length===0){this.bodyState.set("empty");return}let r=await this.markdown.render(o);if(e!==this.fetchToken)return;this.bodyHtml.set(r),this.bodyState.set("ready")}catch{if(e!==this.fetchToken)return;this.bodyState.set("error")}}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-inspector-view"]],viewQuery:function(e,n){e&1&&ft(n.closeBtn,ZI,5),e&2&&it()},hostVars:2,hostBindings:function(e,n){e&2&&de("inspector-view--embedded",n.mode()==="embedded")},inputs:{path:[1,"path"],mode:[1,"mode"],activeTag:[1,"activeTag"]},outputs:{close:"close",tagSelect:"tagSelect"},decls:3,vars:1,consts:[["closeBtn",""],["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","pi","pi-question-circle",2,"color","var(--sm-severity-warn)","opacity","1"],["data-testid","inspector-title",1,"inspector__header"],["aria-hidden","true",1,"inspector__icon-box"],[3,"kind","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"],["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"],["data-debug-slot","inspector.header.badge.counter",1,"sm-debug-slot"],["slot","inspector.header.badge.counter",3,"node"],["data-debug-slot","inspector.header.badge.tag",1,"sm-debug-slot"],["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"],[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"],["data-testid","inspector-header-tools",1,"inspector__tools"],[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"],["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"],[3,"frontmatter","kind","provider","knownPaths","onSkillClick"],["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"],["data-debug-slot","inspector.body.panel.breakdown",1,"sm-debug-slot"],["slot","inspector.body.panel.breakdown",3,"node"],["data-debug-slot","inspector.body.panel.records",1,"sm-debug-slot"],["slot","inspector.body.panel.records",3,"node"],["data-debug-slot","inspector.body.panel.tree",1,"sm-debug-slot"],["slot","inspector.body.panel.tree",3,"node"],["data-debug-slot","inspector.body.panel.key-values",1,"sm-debug-slot"],["slot","inspector.body.panel.key-values",3,"node"],["data-debug-slot","inspector.body.panel.link-list",1,"sm-debug-slot"],["slot","inspector.body.panel.link-list",3,"node"],["data-debug-slot","inspector.body.panel.markdown",1,"sm-debug-slot"],["slot","inspector.body.panel.markdown",3,"node"],["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"],["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__tool-tag"],["aria-hidden","true",1,"pi","pi-arrow-up-right"],["type","button","aria-label","Dismiss",1,"inspector__bump-error-dismiss",3,"click"],[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"],["icon","pi pi-search","testId","inspector-empty-findings",3,"title","body"],[3,"openPath","tagClick","overlay","authorTags","knownPaths","activeTag"],["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"],[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"]],template:function(e,n){e&1&&w(0,QI,13,6,"section",1)(1,JI,12,5,"section",1)(2,ET,96,67,"section",1),e&2&&S(n.path()?n.node()?2:1:0)},dependencies:[Fh,bn,gn,Gl,qi,vn,yn,je,Qe,Wl,ql,$l,Kl,Yl,xn,Zl,Jl,Ut],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:.25rem;font-size:.85rem}.inspector__header[_ngcontent-%COMP%]{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, var(--sm-kind-markdown)) 75%,#475569);color:#fff;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__icon-box[_ngcontent-%COMP%]{width:42px;height:42px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:#fff3;color:#fff;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:#fff;flex:0 1 auto;min-width:0}.inspector__path-code[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.7rem;color:#ffffffeb;background:#ffffff29;padding:.1rem .4rem;border-radius:3px;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:#ffffffeb;border-radius:4px;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:#ffffff2e;color:#fff}.inspector__favorite[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(255,255,255,.7);outline-offset:1px}.inspector__favorite--on[_ngcontent-%COMP%]{color:#fff}.inspector__stability-icon[_ngcontent-%COMP%], .inspector__stale-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;color:#ffffffeb;cursor:help}.inspector__stale-icon[_ngcontent-%COMP%]{color:#fde68a}.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:#ffffff29;border:1px solid rgba(255,255,255,.32);border-radius:4px;padding:0;margin-left:.25rem;color:#fff;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:#ffffff42;border-color:#ffffff73}.inspector__close[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(255,255,255,.7);outline-offset:1px}.inspector__name-version[_ngcontent-%COMP%]{font-family:var(--sm-font-mono);font-size:.66rem;color:#fffffff2;background:#fff3;padding:.06rem .4rem;border-radius:3px;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:#ffffffbf;margin-right:.15rem}.inspector__plugin-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .75rem;border:1px solid rgba(255,255,255,.32);border-radius:999px;background:#ffffff29;color:#fff;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:#ffffff42;border-color:#ffffff73}.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:3px;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}.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 .p-card{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:4px;padding:.75rem;margin:.75rem 0;white-space:pre-wrap;word-wrap:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;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:3px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;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:.25rem;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 .p-chip{cursor:pointer;background:var(--p-primary-50);color:var(--p-primary-color);transition:background .15s ease}[_nghost-%COMP%] .chip--link:hover .p-chip{background:var(--p-primary-100)}[_nghost-%COMP%] .chip--dead .p-chip{background:var(--sm-bg-hover);color:var(--p-text-muted-color);text-decoration:line-through;cursor:not-allowed}[_nghost-%COMP%] .chip--warn .p-chip{background:var(--sm-kind-command-bg);color:var(--sm-kind-command-fg)}[_nghost-%COMP%] .chip--dead-confirmed .p-chip{background:var(--sm-bg-hover);color:var(--sm-severity-error);border:1px dashed var(--sm-severity-error)}.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:.25rem;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:.25rem;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__header[_ngcontent-%COMP%]{margin:-1rem -1.1rem 0}.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:4px;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:4px;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:4px;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}"],changeDetection:0})};function lh(t,i){var e,n=1;t==null&&(t=0),i==null&&(i=0);function o(){var r,s=e.length,a,l=0,h=0;for(r=0;r<s;++r)a=e[r],l+=a.x,h+=a.y;for(l=(l/s-t)*n,h=(h/s-i)*n,r=0;r<s;++r)a=e[r],a.x-=l,a.y-=h}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?(i=+r,o):i},o.strength=function(r){return arguments.length?(n=+r,o):n},o}function Hm(t){let i=+this._x.call(null,t),e=+this._y.call(null,t);return jm(this.cover(i,e),i,e,t)}function jm(t,i,e,n){if(isNaN(i)||isNaN(e))return t;var o,r=t._root,s={data:n},a=t._x0,l=t._y0,h=t._x1,_=t._y1,v,b,I,N,D,M,k,O;if(!r)return t._root=s,t;for(;r.length;)if((D=i>=(v=(a+h)/2))?a=v:h=v,(M=e>=(b=(l+_)/2))?l=b:_=b,o=r,!(r=r[k=M<<1|D]))return o[k]=s,t;if(I=+t._x.call(null,r.data),N=+t._y.call(null,r.data),i===I&&e===N)return s.next=r,o?o[k]=s:t._root=s,t;do o=o?o[k]=new Array(4):t._root=new Array(4),(D=i>=(v=(a+h)/2))?a=v:h=v,(M=e>=(b=(l+_)/2))?l=b:_=b;while((k=M<<1|D)===(O=(N>=b)<<1|I>=v));return o[O]=r,o[k]=s,t}function Um(t){var i,e,n=t.length,o,r,s=new Array(n),a=new Array(n),l=1/0,h=1/0,_=-1/0,v=-1/0;for(e=0;e<n;++e)isNaN(o=+this._x.call(null,i=t[e]))||isNaN(r=+this._y.call(null,i))||(s[e]=o,a[e]=r,o<l&&(l=o),o>_&&(_=o),r<h&&(h=r),r>v&&(v=r));if(l>_||h>v)return this;for(this.cover(l,h).cover(_,v),e=0;e<n;++e)jm(this,s[e],a[e],t[e]);return this}function $m(t,i){if(isNaN(t=+t)||isNaN(i=+i))return this;var e=this._x0,n=this._y0,o=this._x1,r=this._y1;if(isNaN(e))o=(e=Math.floor(t))+1,r=(n=Math.floor(i))+1;else{for(var s=o-e||1,a=this._root,l,h;e>t||t>=o||n>i||i>=r;)switch(h=(i<n)<<1|t<e,l=new Array(4),l[h]=a,a=l,s*=2,h){case 0:o=e+s,r=n+s;break;case 1:e=o-s,r=n+s;break;case 2:o=e+s,n=r-s;break;case 3:e=o-s,n=r-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=e,this._y0=n,this._x1=o,this._y1=r,this}function Wm(){var t=[];return this.visit(function(i){if(!i.length)do t.push(i.data);while(i=i.next)}),t}function qm(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 Be(t,i,e,n,o){this.node=t,this.x0=i,this.y0=e,this.x1=n,this.y1=o}function Xm(t,i,e){var n,o=this._x0,r=this._y0,s,a,l,h,_=this._x1,v=this._y1,b=[],I=this._root,N,D;for(I&&b.push(new Be(I,o,r,_,v)),e==null?e=1/0:(o=t-e,r=i-e,_=t+e,v=i+e,e*=e);N=b.pop();)if(!(!(I=N.node)||(s=N.x0)>_||(a=N.y0)>v||(l=N.x1)<o||(h=N.y1)<r))if(I.length){var M=(s+l)/2,k=(a+h)/2;b.push(new Be(I[3],M,k,l,h),new Be(I[2],s,k,M,h),new Be(I[1],M,a,l,k),new Be(I[0],s,a,M,k)),(D=(i>=k)<<1|t>=M)&&(N=b[b.length-1],b[b.length-1]=b[b.length-1-D],b[b.length-1-D]=N)}else{var O=t-+this._x.call(null,I.data),z=i-+this._y.call(null,I.data),V=O*O+z*z;if(V<e){var W=Math.sqrt(e=V);o=t-W,r=i-W,_=t+W,v=i+W,n=I.data}}return n}function Km(t){if(isNaN(_=+this._x.call(null,t))||isNaN(v=+this._y.call(null,t)))return this;var i,e=this._root,n,o,r,s=this._x0,a=this._y0,l=this._x1,h=this._y1,_,v,b,I,N,D,M,k;if(!e)return this;if(e.length)for(;;){if((N=_>=(b=(s+l)/2))?s=b:l=b,(D=v>=(I=(a+h)/2))?a=I:h=I,i=e,!(e=e[M=D<<1|N]))return this;if(!e.length)break;(i[M+1&3]||i[M+2&3]||i[M+3&3])&&(n=i,k=M)}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):i?(r?i[M]=r:delete i[M],(e=i[0]||i[1]||i[2]||i[3])&&e===(i[3]||i[2]||i[1]||i[0])&&!e.length&&(n?n[k]=e:this._root=e),this):(this._root=r,this)}function Ym(t){for(var i=0,e=t.length;i<e;++i)this.remove(t[i]);return this}function Zm(){return this._root}function Qm(){var t=0;return this.visit(function(i){if(!i.length)do++t;while(i=i.next)}),t}function Jm(t){var i=[],e,n=this._root,o,r,s,a,l;for(n&&i.push(new Be(n,this._x0,this._y0,this._x1,this._y1));e=i.pop();)if(!t(n=e.node,r=e.x0,s=e.y0,a=e.x1,l=e.y1)&&n.length){var h=(r+a)/2,_=(s+l)/2;(o=n[3])&&i.push(new Be(o,h,_,a,l)),(o=n[2])&&i.push(new Be(o,r,_,h,l)),(o=n[1])&&i.push(new Be(o,h,s,a,_)),(o=n[0])&&i.push(new Be(o,r,s,h,_))}return this}function e_(t){var i=[],e=[],n;for(this._root&&i.push(new Be(this._root,this._x0,this._y0,this._x1,this._y1));n=i.pop();){var o=n.node;if(o.length){var r,s=n.x0,a=n.y0,l=n.x1,h=n.y1,_=(s+l)/2,v=(a+h)/2;(r=o[0])&&i.push(new Be(r,s,a,_,v)),(r=o[1])&&i.push(new Be(r,_,a,l,v)),(r=o[2])&&i.push(new Be(r,s,v,_,h)),(r=o[3])&&i.push(new Be(r,_,v,l,h))}e.push(n)}for(;n=e.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this}function t_(t){return t[0]}function n_(t){return arguments.length?(this._x=t,this):this._x}function i_(t){return t[1]}function o_(t){return arguments.length?(this._y=t,this):this._y}function fn(t,i,e){var n=new uh(i??t_,e??i_,NaN,NaN,NaN,NaN);return t==null?n:n.addAll(t)}function uh(t,i,e,n,o,r){this._x=t,this._y=i,this._x0=e,this._y0=n,this._x1=o,this._y1=r,this._root=void 0}function r_(t){for(var i={data:t.data},e=i;t=t.next;)e=e.next={data:t.data};return i}var Ke=fn.prototype=uh.prototype;Ke.copy=function(){var t=new uh(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root,e,n;if(!i)return t;if(!i.length)return t._root=r_(i),t;for(e=[{source:i,target:t._root=new Array(4)}];i=e.pop();)for(var o=0;o<4;++o)(n=i.source[o])&&(n.length?e.push({source:n,target:i.target[o]=new Array(4)}):i.target[o]=r_(n));return t};Ke.add=Hm;Ke.addAll=Um;Ke.cover=$m;Ke.data=Wm;Ke.extent=qm;Ke.find=Xm;Ke.remove=Km;Ke.removeAll=Ym;Ke.root=Zm;Ke.size=Qm;Ke.visit=Jm;Ke.visitAfter=e_;Ke.x=n_;Ke.y=o_;function Oe(t){return function(){return t}}function _t(t){return(t()-.5)*1e-6}function MT(t){return t.x+t.vx}function DT(t){return t.y+t.vy}function tu(t){var i,e,n,o=1,r=1;typeof t!="function"&&(t=Oe(t==null?1:+t));function s(){for(var h,_=i.length,v,b,I,N,D,M,k=0;k<r;++k)for(v=fn(i,MT,DT).visitAfter(a),h=0;h<_;++h)b=i[h],D=e[b.index],M=D*D,I=b.x+b.vx,N=b.y+b.vy,v.visit(O);function O(z,V,W,oe,be){var re=z.data,le=z.r,ie=D+le;if(re){if(re.index>b.index){var ce=I-re.x-re.vx,Ve=N-re.y-re.vy,ve=ce*ce+Ve*Ve;ve<ie*ie&&(ce===0&&(ce=_t(n),ve+=ce*ce),Ve===0&&(Ve=_t(n),ve+=Ve*Ve),ve=(ie-(ve=Math.sqrt(ve)))/ve*o,b.vx+=(ce*=ve)*(ie=(le*=le)/(M+le)),b.vy+=(Ve*=ve)*ie,re.vx-=ce*(ie=1-ie),re.vy-=Ve*ie)}return}return V>I+ie||oe<I-ie||W>N+ie||be<N-ie}}function a(h){if(h.data)return h.r=e[h.data.index];for(var _=h.r=0;_<4;++_)h[_]&&h[_].r>h.r&&(h.r=h[_].r)}function l(){if(i){var h,_=i.length,v;for(e=new Array(_),h=0;h<_;++h)v=i[h],e[v.index]=+t(v,h,i)}}return s.initialize=function(h,_){i=h,n=_,l()},s.iterations=function(h){return arguments.length?(r=+h,s):r},s.strength=function(h){return arguments.length?(o=+h,s):o},s.radius=function(h){return arguments.length?(t=typeof h=="function"?h:Oe(+h),l(),s):t},s}function kT(t){return t.index}function s_(t,i){var e=t.get(i);if(!e)throw new Error("node not found: "+i);return e}function nu(t){var i=kT,e=v,n,o=Oe(30),r,s,a,l,h,_=1;t==null&&(t=[]);function v(M){return 1/Math.min(a[M.source.index],a[M.target.index])}function b(M){for(var k=0,O=t.length;k<_;++k)for(var z=0,V,W,oe,be,re,le,ie;z<O;++z)V=t[z],W=V.source,oe=V.target,be=oe.x+oe.vx-W.x-W.vx||_t(h),re=oe.y+oe.vy-W.y-W.vy||_t(h),le=Math.sqrt(be*be+re*re),le=(le-r[z])/le*M*n[z],be*=le,re*=le,oe.vx-=be*(ie=l[z]),oe.vy-=re*ie,W.vx+=be*(ie=1-ie),W.vy+=re*ie}function I(){if(s){var M,k=s.length,O=t.length,z=new Map(s.map((W,oe)=>[i(W,oe,s),W])),V;for(M=0,a=new Array(k);M<O;++M)V=t[M],V.index=M,typeof V.source!="object"&&(V.source=s_(z,V.source)),typeof V.target!="object"&&(V.target=s_(z,V.target)),a[V.source.index]=(a[V.source.index]||0)+1,a[V.target.index]=(a[V.target.index]||0)+1;for(M=0,l=new Array(O);M<O;++M)V=t[M],l[M]=a[V.source.index]/(a[V.source.index]+a[V.target.index]);n=new Array(O),N(),r=new Array(O),D()}}function N(){if(s)for(var M=0,k=t.length;M<k;++M)n[M]=+e(t[M],M,t)}function D(){if(s)for(var M=0,k=t.length;M<k;++M)r[M]=+o(t[M],M,t)}return b.initialize=function(M,k){s=M,h=k,I()},b.links=function(M){return arguments.length?(t=M,I(),b):t},b.id=function(M){return arguments.length?(i=M,b):i},b.iterations=function(M){return arguments.length?(_=+M,b):_},b.strength=function(M){return arguments.length?(e=typeof M=="function"?M:Oe(+M),N(),b):e},b.distance=function(M){return arguments.length?(o=typeof M=="function"?M:Oe(+M),D(),b):o},b}var RT={value:()=>{}};function c_(){for(var t=0,i=arguments.length,e={},n;t<i;++t){if(!(n=arguments[t]+"")||n in e||/[\s.]/.test(n))throw new Error("illegal type: "+n);e[n]=[]}return new iu(e)}function iu(t){this._=t}function NT(t,i){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");if(o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),e&&!i.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}iu.prototype=c_.prototype={constructor:iu,on:function(t,i){var e=this._,n=NT(t+"",e),o,r=-1,s=n.length;if(arguments.length<2){for(;++r<s;)if((o=(t=n[r]).type)&&(o=OT(e[o],t.name)))return o;return}if(i!=null&&typeof i!="function")throw new Error("invalid callback: "+i);for(;++r<s;)if(o=(t=n[r]).type)e[o]=a_(e[o],t.name,i);else if(i==null)for(o in e)e[o]=a_(e[o],t.name,null);return this},copy:function(){var t={},i=this._;for(var e in i)t[e]=i[e].slice();return new iu(t)},call:function(t,i){if((o=arguments.length-2)>0)for(var e=new Array(o),n=0,o,r;n<o;++n)e[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],n=0,o=r.length;n<o;++n)r[n].value.apply(i,e)},apply:function(t,i,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],o=0,r=n.length;o<r;++o)n[o].value.apply(i,e)}};function OT(t,i){for(var e=0,n=t.length,o;e<n;++e)if((o=t[e]).name===i)return o.value}function a_(t,i,e){for(var n=0,o=t.length;n<o;++n)if(t[n].name===i){t[n]=RT,t=t.slice(0,n).concat(t.slice(n+1));break}return e!=null&&t.push({name:i,value:e}),t}var fh=c_;var qn=0,Yi=0,Ki=0,l_=1e3,ou,Zi,ru=0,hn=0,su=0,Qi=typeof performance=="object"&&performance.now?performance:Date,u_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mh(){return hn||(u_(FT),hn=Qi.now()+su)}function FT(){hn=0}function hh(){this._call=this._time=this._next=null}hh.prototype=au.prototype={constructor:hh,restart:function(t,i,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?mh():+e)+(i==null?0:+i),!this._next&&Zi!==this&&(Zi?Zi._next=this:ou=this,Zi=this),this._call=t,this._time=e,ph()},stop:function(){this._call&&(this._call=null,this._time=1/0,ph())}};function au(t,i,e){var n=new hh;return n.restart(t,i,e),n}function f_(){mh(),++qn;for(var t=ou,i;t;)(i=hn-t._time)>=0&&t._call.call(void 0,i),t=t._next;--qn}function d_(){hn=(ru=Qi.now())+su,qn=Yi=0;try{f_()}finally{qn=0,LT(),hn=0}}function AT(){var t=Qi.now(),i=t-ru;i>l_&&(su-=i,ru=t)}function LT(){for(var t,i=ou,e,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:ou=e);Zi=t,ph(n)}function ph(t){if(!qn){Yi&&(Yi=clearTimeout(Yi));var i=t-hn;i>24?(t<1/0&&(Yi=setTimeout(d_,t-Qi.now()-su)),Ki&&(Ki=clearInterval(Ki))):(Ki||(ru=Qi.now(),Ki=setInterval(AT,l_)),qn=1,u_(d_))}}function h_(){let t=1;return()=>(t=(1664525*t+1013904223)%4294967296)/4294967296}function p_(t){return t.x}function m_(t){return t.y}var BT=10,zT=Math.PI*(3-Math.sqrt(5));function cu(t){var i,e=1,n=.001,o=1-Math.pow(n,1/300),r=0,s=.6,a=new Map,l=au(v),h=fh("tick","end"),_=h_();t==null&&(t=[]);function v(){b(),h.call("tick",i),e<n&&(l.stop(),h.call("end",i))}function b(D){var M,k=t.length,O;D===void 0&&(D=1);for(var z=0;z<D;++z)for(e+=(r-e)*o,a.forEach(function(V){V(e)}),M=0;M<k;++M)O=t[M],O.fx==null?O.x+=O.vx*=s:(O.x=O.fx,O.vx=0),O.fy==null?O.y+=O.vy*=s:(O.y=O.fy,O.vy=0);return i}function I(){for(var D=0,M=t.length,k;D<M;++D){if(k=t[D],k.index=D,k.fx!=null&&(k.x=k.fx),k.fy!=null&&(k.y=k.fy),isNaN(k.x)||isNaN(k.y)){var O=BT*Math.sqrt(.5+D),z=D*zT;k.x=O*Math.cos(z),k.y=O*Math.sin(z)}(isNaN(k.vx)||isNaN(k.vy))&&(k.vx=k.vy=0)}}function N(D){return D.initialize&&D.initialize(t,_),D}return I(),i={tick:b,restart:function(){return l.restart(v),i},stop:function(){return l.stop(),i},nodes:function(D){return arguments.length?(t=D,I(),a.forEach(N),i):t},alpha:function(D){return arguments.length?(e=+D,i):e},alphaMin:function(D){return arguments.length?(n=+D,i):n},alphaDecay:function(D){return arguments.length?(o=+D,i):+o},alphaTarget:function(D){return arguments.length?(r=+D,i):r},velocityDecay:function(D){return arguments.length?(s=1-D,i):1-s},randomSource:function(D){return arguments.length?(_=D,a.forEach(N),i):_},force:function(D,M){return arguments.length>1?(M==null?a.delete(D):a.set(D,N(M)),i):a.get(D)},find:function(D,M,k){var O=0,z=t.length,V,W,oe,be,re;for(k==null?k=1/0:k*=k,O=0;O<z;++O)be=t[O],V=D-be.x,W=M-be.y,oe=V*V+W*W,oe<k&&(re=be,k=oe);return re},on:function(D,M){return arguments.length>1?(h.on(D,M),i):h.on(D)}}}function du(){var t,i,e,n,o=Oe(-30),r,s=1,a=1/0,l=.81;function h(I){var N,D=t.length,M=fn(t,p_,m_).visitAfter(v);for(n=I,N=0;N<D;++N)i=t[N],M.visit(b)}function _(){if(t){var I,N=t.length,D;for(r=new Array(N),I=0;I<N;++I)D=t[I],r[D.index]=+o(D,I,t)}}function v(I){var N=0,D,M,k=0,O,z,V;if(I.length){for(O=z=V=0;V<4;++V)(D=I[V])&&(M=Math.abs(D.value))&&(N+=D.value,k+=M,O+=M*D.x,z+=M*D.y);I.x=O/k,I.y=z/k}else{D=I,D.x=D.data.x,D.y=D.data.y;do N+=r[D.data.index];while(D=D.next)}I.value=N}function b(I,N,D,M){if(!I.value)return!0;var k=I.x-i.x,O=I.y-i.y,z=M-N,V=k*k+O*O;if(z*z/l<V)return V<a&&(k===0&&(k=_t(e),V+=k*k),O===0&&(O=_t(e),V+=O*O),V<s&&(V=Math.sqrt(s*V)),i.vx+=k*I.value*n/V,i.vy+=O*I.value*n/V),!0;if(I.length||V>=a)return;(I.data!==i||I.next)&&(k===0&&(k=_t(e),V+=k*k),O===0&&(O=_t(e),V+=O*O),V<s&&(V=Math.sqrt(s*V)));do I.data!==i&&(z=r[I.data.index]*n/V,i.vx+=k*z,i.vy+=O*z);while(I=I.next)}return h.initialize=function(I,N){t=I,e=N,_()},h.strength=function(I){return arguments.length?(o=typeof I=="function"?I:Oe(+I),_(),h):o},h.distanceMin=function(I){return arguments.length?(s=I*I,h):Math.sqrt(s)},h.distanceMax=function(I){return arguments.length?(a=I*I,h):Math.sqrt(a)},h.theta=function(I){return arguments.length?(l=I*I,h):Math.sqrt(l)},h}function lu(t){var i=Oe(.1),e,n,o;typeof t!="function"&&(t=Oe(t==null?0:+t));function r(a){for(var l=0,h=e.length,_;l<h;++l)_=e[l],_.vx+=(o[l]-_.x)*n[l]*a}function s(){if(e){var a,l=e.length;for(n=new Array(l),o=new Array(l),a=0;a<l;++a)n[a]=isNaN(o[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return r.initialize=function(a){e=a,s()},r.strength=function(a){return arguments.length?(i=typeof a=="function"?a:Oe(+a),s(),r):i},r.x=function(a){return arguments.length?(t=typeof a=="function"?a:Oe(+a),s(),r):t},r}function uu(t){var i=Oe(.1),e,n,o;typeof t!="function"&&(t=Oe(t==null?0:+t));function r(a){for(var l=0,h=e.length,_;l<h;++l)_=e[l],_.vy+=(o[l]-_.y)*n[l]*a}function s(){if(e){var a,l=e.length;for(n=new Array(l),o=new Array(l),a=0;a<l;++a)n[a]=isNaN(o[a]=+t(e[a],a,e))?0:+i(e[a],a,e)}}return r.initialize=function(a){e=a,s()},r.strength=function(a){return arguments.length?(i=typeof a=="function"?a:Oe(+a),s(),r):i},r.y=function(a){return arguments.length?(t=typeof a=="function"?a:Oe(+a),s(),r):t},r}var Ji=260,_h=120;function VT(t,i){let e=t.map(o=>o.path).sort(),n=i.map(o=>o.id).sort();return`${e.length}|${e.join(",")}|${n.length}|${n.join(",")}`}function __(){let t=null;return(i,e)=>{let n=new Set(i.map(b=>b.path)),o=new Map,r=e?.links??[];for(let b of r){if(!n.has(b.source)||!n.has(b.target)||b.source===b.target)continue;let I=jT(b.kind,b.source,b.target);o.has(I)||o.set(I,{id:I,from:b.source,to:b.target,kind:b.kind})}let s=[...o.values()],a=new Map;for(let b of i)a.set(b.path,b);let l=new Map;for(let b of e?.nodes??[])l.set(b.path,b);let h=VT(i,s);if(t&&t.fingerprint===h)return{nodesByPath:a,apiNodesByPath:l,edges:t.edges,positions:t.positions,computedAt:t.computedAt};let _=GT(i,s),v=performance.now();return t={fingerprint:h,positions:_,edges:s,computedAt:v},{nodesByPath:a,apiNodesByPath:l,edges:s,positions:_,computedAt:v}}}function GT(t,i){let e=t.map(a=>({id:a.path})),n=i.map(a=>({source:a.from,target:a.to})),o=cu(e).force("link",nu(n).id(a=>a.id).distance(90).strength(1)).force("charge",du().strength(-200)).force("center",lh(0,0)).force("x",lu(0).strength(.06)).force("y",uu(0).strength(.06)).force("collide",tu(Ji/2+12)).stop(),r=400;for(let a=0;a<r;a++)o.tick();let s=new Map;for(let a of e)s.set(a.id,{x:(a.x??0)-Ji/2,y:(a.y??0)-_h/2});return s}function g_(t,i,e,n){let o=new Set(n),r=t.map(_=>{let v={id:_.path};if(o.has(_.path))return v;let b=e[_.path];if(!b)return v;let I=b.x+Ji/2,N=b.y+_h/2;return v.x=I,v.y=N,v.fx=I,v.fy=N,v}),s=i.map(_=>({source:_.from,target:_.to})),a=cu(r).force("link",nu(s).id(_=>_.id).distance(90).strength(1)).force("charge",du().strength(-200)).force("x",lu(0).strength(.06)).force("y",uu(0).strength(.06)).force("collide",tu(Ji/2+12)).stop(),l=200;for(let _=0;_<l;_++)a.tick();let h=new Map;for(let _ of r)o.has(_.id)&&h.set(_.id,{x:(_.x??0)-Ji/2,y:(_.y??0)-_h/2});return h}function y_(t,i,e){let n=t.edges.filter(a=>i.has(a.from)&&i.has(a.to)),o=new Map,r=new Map;for(let a of n)o.set(a.from,(o.get(a.from)??0)+1),r.set(a.to,(r.get(a.to)??0)+1);let s=[];for(let a of i){let l=t.nodesByPath.get(a);if(!l)continue;let h=t.apiNodesByPath.get(a),_=e[a],v=t.positions.get(a)??{x:0,y:0},b=_?{x:_.x,y:_.y}:v;s.push({id:a,path:a,view:l,kind:l.kind,position:b,stats:{linksIn:r.get(a)??0,linksOut:o.get(a)??0,bytesTotal:h?.bytes.total,tokensTotal:h?.tokens?.total,externalRefsCount:h?.externalRefsCount},summary:HT(l)})}return{nodes:s,edges:n}}function HT(t){let i={injectionDetected:!1,contentQuality:"clean"},e=(t.frontmatter.description??t.frontmatter.name??"").trim();return{kind:"markdown",confidence:.6,safety:i,whatItCovers:e||`${t.kind} entry`,topics:[],keyFacts:[]}}function jT(t,i,e){let[n,o]=[i,e].sort();return`${t}:${n}::${o}`}var UT=["canvasWrap"],I_=(t,i)=>i.id;function $T(t,i){if(t&1&&(u(0,"div",2),A(1,"span",7),u(2,"p",8),m(3),f()()),t&2){let e=p();c(3),y(e.texts.loading)}}function WT(t,i){if(t&1&&(u(0,"div",3),A(1,"span",9),u(2,"p",8),m(3),f(),u(4,"p",10),m(5),f()()),t&2){let e=p();c(3),y(e.texts.errorTitle),c(2),y(e.error())}}function qT(t,i){if(t&1&&(u(0,"div",4),A(1,"span",11),u(2,"p",8),m(3),f(),u(4,"p",10),m(5),f()()),t&2){let e=p();c(3),y(e.texts.emptyTitle),c(2),y(e.texts.emptyDesc)}}function XT(t,i){if(t&1&&(u(0,"f-connection",29),A(1,"f-connection-marker-arrow",30),f()),t&2){let e=i.$implicit,n=p(2);Ce("f-conn--"+e.kind),de("f-conn--highlighted",n.isEdgeHighlighted(e))("f-conn--dimmed",n.isEdgeDimmed(e)),T("fOutputId",e.from+"-out")("fInputId",e.to+"-in")("fType",n.connectionType)("fBehavior",n.connectionBehavior)("fOffset",4)("fReassignDisabled",!0)("fSelectionDisabled",!0),c(),T("type",n.markerEnd)}}function KT(t,i){if(t&1){let e=ae();Wt(0,18),u(1,"div",32),K("fNodePositionChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.onNodePositionChange(r.id,o))})("pointerdown",function(o){j(e);let r=p(3);return U(r.onNodePointerDown(o))})("click",function(o){let r=j(e).$implicit,s=p(3);return U(s.selectNode(r,o))})("dblclick",function(){let o=j(e).$implicit,r=p(3);return U(r.openNode(o))}),A(2,"div",33),u(3,"sm-node-card",34),K("expandedChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.setExpanded(r.id,o))})("favoriteToggle",function(o){j(e);let r=p(3);return U(r.onFavoriteToggle(o))}),f(),u(4,"div",35)(5,"div",36),A(6,"sm-view-contributions-host",37),f()(),A(7,"div",38),f(),qt()}if(t&2){let e=i.$implicit,n=p(3);c(),T("fNodeId",e.id)("fNodePosition",e.position),Z("data-testid","graph-node-"+e.id),c(),T("fInputId",e.id+"-in")("fInputConnectableSide",n.inputSide),c(),T("node",e.view)("stats",e.stats)("summary",e.summary)("selected",n.isSelected(e.id))("highlighted",n.isHighlighted(e.id))("dimmed",n.isDimmed(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),c(3),T("node",e.view),c(),T("fOutputId",e.id+"-out")("fOutputConnectableSide",n.outputSide)}}function YT(t,i){if(t&1&&Me(0,KT,8,16,"ng-container",31),t&2){let e=p(2);T("fVirtualForOf",e.graph().nodes)}}function ZT(t,i){if(t&1){let e=ae();u(0,"div",32),K("fNodePositionChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.onNodePositionChange(r.id,o))})("pointerdown",function(o){j(e);let r=p(3);return U(r.onNodePointerDown(o))})("click",function(o){let r=j(e).$implicit,s=p(3);return U(s.selectNode(r,o))})("dblclick",function(){let o=j(e).$implicit,r=p(3);return U(r.openNode(o))}),A(1,"div",33),u(2,"sm-node-card",34),K("expandedChange",function(o){let r=j(e).$implicit,s=p(3);return U(s.setExpanded(r.id,o))})("favoriteToggle",function(o){j(e);let r=p(3);return U(r.onFavoriteToggle(o))}),f(),u(3,"div",35)(4,"div",36),A(5,"sm-view-contributions-host",37),f()(),A(6,"div",38),f()}if(t&2){let e=i.$implicit,n=p(3);T("fNodeId",e.id)("fNodePosition",e.position),Z("data-testid","graph-node-"+e.id),c(),T("fInputId",e.id+"-in")("fInputConnectableSide",n.inputSide),c(),T("node",e.view)("stats",e.stats)("summary",e.summary)("selected",n.isSelected(e.id))("highlighted",n.isHighlighted(e.id))("dimmed",n.isDimmed(e.id))("expanded",n.isExpanded(e.id))("isFavorite",e.view.isFavorite===!0),c(3),T("node",e.view),c(),T("fOutputId",e.id+"-out")("fOutputConnectableSide",n.outputSide)}}function QT(t,i){if(t&1&&(Wt(0,18),J(1,ZT,7,16,"div",39,I_),qt()),t&2){let e=p(2);c(),ee(e.graph().nodes)}}function JT(t,i){if(t&1&&A(0,"app-perf-hud",22),t&2){let e=p(2);T("visible",e.visibleCount())("total",e.totalCount())("edges",e.edgeCount())("cacheAt",e.layoutComputedAt())}}function eE(t,i){if(t&1){let e=ae();u(0,"div",12,0),K("mousedown",function(o){j(e);let r=p();return U(r.onCanvasMouseDown(o))})("click",function(o){j(e);let r=p();return U(r.onCanvasClick(o))}),u(2,"f-flow",13),K("fLoaded",function(){j(e);let o=p();return U(o.onLoaded())}),A(3,"f-selection-area"),u(4,"f-background"),A(5,"f-rect-pattern"),f(),A(6,"f-line-alignment",14),u(7,"f-canvas",15),K("fCanvasChange",function(o){j(e);let r=p();return U(r.onCanvasChange(o))}),Wt(8,16),J(9,XT,2,14,"f-connection",17,I_),qt(),w(11,YT,1,1,"ng-container",18)(12,QT,3,0,"ng-container",18),f(),A(13,"f-minimap"),f(),A(14,"app-kind-palette"),u(15,"aside",19)(16,"div",20),K("mousedown",function(o){j(e);let r=p();return U(r.onPanelResizeStart(o))}),f(),u(17,"app-inspector-view",21),K("close",function(){j(e);let o=p();return U(o.closePanel())})("tagSelect",function(o){j(e);let r=p();return U(r.onTagSelect(o))}),f()(),w(18,JT,1,4,"app-perf-hud",22),u(19,"div",23)(20,"p-button",24),K("onClick",function(){j(e);let o=p();return U(o.zoomIn())}),f(),u(21,"p-button",25),K("onClick",function(){j(e);let o=p();return U(o.zoomOut())}),f(),u(22,"p-button",26),K("onClick",function(){j(e);let o=p();return U(o.fitToScreen())}),f(),A(23,"span",27),u(24,"p-button",28),K("onClick",function(){j(e);let o=p();return U(o.resetLayout())}),f()()()}if(t&2){let e=p();c(2),T("fCache",e.perf.cache),c(4),T("fAlignThreshold",20),c(),T("position",e.viewportPosition())("scale",e.viewportScale())("fZoomStep",.06)("fZoomDblClickStep",.35)("debounceTime",150),c(2),ee(e.graph().edges),c(2),S(e.perf.virtualization?11:12),c(4),at("width",e.clampedPanelWidth(),"px"),de("is-open",e.selectedNodeId()!==null),Z("aria-label",e.texts.a11y.panel),c(),Z("aria-label",e.texts.panel.resizeLabel),c(),T("path",e.selectedPath())("activeTag",e.activeTagSelection()),c(),S(e.perfHud()?18:-1),c(),Z("aria-label",e.texts.a11y.toolbar),c(),T("ariaLabel",e.texts.toolbar.zoomIn)("pTooltip",e.texts.toolbar.zoomIn)("text",!0)("rounded",!0)("disabled",!e.canZoomIn()),c(),T("ariaLabel",e.texts.toolbar.zoomOut)("pTooltip",e.texts.toolbar.zoomOut)("text",!0)("rounded",!0)("disabled",!e.canZoomOut()),c(),T("ariaLabel",e.texts.toolbar.fitToScreen)("pTooltip",e.texts.toolbar.fitToScreen)("text",!0)("rounded",!0),c(2),T("ariaLabel",e.texts.toolbar.resetLayoutLabel)("pTooltip",e.texts.toolbar.resetLayoutTooltip)("text",!0)("rounded",!0)}}var v_=.1,tE=4,C_=320,x_=.2,T_="sm.graph.viewport",E_="sm.graph.node-positions",P_="sm.graph.node-expanded",M_="sm.graph.panel-width",gh=400,fu=400,b_=80,w_=class t{loader=d(Mt);filters=d(vo);router=d(po);route=d(Oh);confirmationService=d(xu);flow=Te(Ui);canvas=Te(ji);zoom=Te($i);canvasWrap=Te("canvasWrap");outputSide=B.BOTTOM;inputSide=B.TOP;connectionType=Nt.SEGMENT;connectionBehavior=Ot.FIXED;markerEnd=ge.END_ALL_STATES;perf=kl.graph.perf;perfHud=d(Vl).visible;pointerDownAt=null;savedViewport=nE();hasCompletedInitialLayout=!1;viewportPosition=q(this.savedViewport?{x:this.savedViewport.x,y:this.savedViewport.y}:{x:0,y:0});viewportScale=q(this.savedViewport?.scale??1);canZoomIn=P(()=>this.viewportScale()<tE-1e-6);canZoomOut=P(()=>this.viewportScale()>v_+1e-6);texts=oh;middlePanOrigin=null;nodePositions=q(iE());expandedNodeIds=q(oE());panelWidth=q(rE()??gh);viewportWidth=q(typeof window>"u"?1920:window.innerWidth);clampedPanelWidth=P(()=>{let i=Math.max(fu,this.viewportWidth()-b_),e=this.panelWidth();return e>i||e<fu?Math.min(gh,i):e});panelResizeStart=null;loading=this.loader.loading;error=this.loader.error;visibleNodes=P(()=>this.filters.apply(this.loader.nodes()));computeLayout=__();fullLayout=P(()=>this.computeLayout(this.loader.nodes(),this.loader.scan()));graph=P(()=>{let i=new Set(this.visibleNodes().map(e=>e.path));return y_(this.fullLayout(),i,this.nodePositions())});hasData=P(()=>this.graph().nodes.length>0);visibleCount=P(()=>this.graph().nodes.length);totalCount=P(()=>this.loader.nodes().length);edgeCount=P(()=>this.graph().edges.length);layoutComputedAt=P(()=>this.fullLayout().computedAt);selectedNodeId=q(null);selectedPath=P(()=>{let i=this.selectedNodeId();return i?this.graph().nodes.find(n=>n.id===i)?.view.path:void 0});adjacency=P(()=>{let i=new Map;for(let e of this.graph().edges)i.has(e.from)||i.set(e.from,new Set),i.has(e.to)||i.set(e.to,new Set),i.get(e.from).add(e.to),i.get(e.to).add(e.from);return i});selectionGuard=me(()=>{let i=this.selectedNodeId();if(i===null)return;this.graph().nodes.some(n=>n.id===i)||this.selectedNodeId.set(null)});deepLinkPath=Vh(this.route.queryParamMap.pipe(vh(i=>i.get("path"))),{initialValue:this.route.snapshot.queryParamMap.get("path")});deepLinkEffect=me(()=>{let i=this.deepLinkPath(),e=this.graph().nodes;if(e.length===0||!i)return;let n=gt(()=>this.selectedNodeId());if(n!==null&&e.find(s=>s.id===n)?.view.path===i)return;let o=e.find(r=>r.view.path===i);o&&this.selectedNodeId.set(o.id)});urlWriterEffect=me(()=>{let i=this.selectedPath(),e=gt(()=>this.deepLinkPath());(i??null)!==(e??null)&&this.router.navigate([],{relativeTo:this.route,queryParams:{path:i??null},queryParamsHandling:"merge",replaceUrl:!0})});pathsFingerprint=P(()=>this.loader.nodes().map(i=>i.path).sort().join("|"));lastPathsFingerprint=null;constructor(){me(()=>{let i=this.visibleNodes();this.hasCompletedInitialLayout||i.length!==0&&queueMicrotask(()=>{this.hasCompletedInitialLayout=!0,this.savedViewport||this.canvas()?.fitToScreen({x:40,y:40},!1)})}),me(()=>{let i=this.pathsFingerprint();if(!this.hasCompletedInitialLayout){this.lastPathsFingerprint=i;return}this.lastPathsFingerprint!==i&&(this.lastPathsFingerprint=i,queueMicrotask(()=>this.canvas()?.fitToScreen({x:40,y:40},!0)))}),me(()=>{let i=new Set(this.loader.nodes().map(r=>r.path));if(i.size===0)return;let e=this.expandedNodeIds();if(e.size===0)return;let n=!1,o=new Set;for(let r of e)i.has(r)?o.add(r):n=!0;n&&(this.expandedNodeIds.set(o),yh(o))}),me(()=>{let i=this.loader.nodes();if(i.length===0)return;let e=this.nodePositions(),n=new Set(i.map(a=>a.path)),o=!1,r=ue({},e);for(let a of Object.keys(r))n.has(a)||(delete r[a],o=!0);let s=[];for(let a of n)a in r||s.push(a);if(s.length>0){let a=this.fullLayout();if(Object.keys(r).length===0)for(let l of s){let h=a.positions.get(l);h&&(r[l]={x:h.x,y:h.y})}else{let l=g_(i,a.edges,r,s);for(let h of s){let _=l.get(h);_&&(r[h]=_)}}o=!0}o&&(this.nodePositions.set(r),S_(r))})}ngOnInit(){this.loader.nodes().length===0&&!this.loader.loading()&&this.loader.load()}onLoaded(){}onCanvasChange(i){if(this.viewportPosition.set({x:i.position.x,y:i.position.y}),this.viewportScale.set(i.scale),!this.hasCompletedInitialLayout)return;let e={x:i.position.x,y:i.position.y,scale:i.scale};try{localStorage.setItem(T_,JSON.stringify(e))}catch{}}onNodePositionChange(i,e){this.dragBuffer||(this.dragBuffer=ue({},this.nodePositions())),this.dragBuffer[i]={x:e.x,y:e.y},this.nodeDragInProgress=!0}zoomIn(){this.zoom()?.setZoom(this.getViewportCenter(),x_,Tt.ZOOM_IN,!0)}zoomOut(){this.zoom()?.setZoom(this.getViewportCenter(),x_,Tt.ZOOM_OUT,!0)}fitToScreen(){this.canvas()?.fitToScreen({x:40,y:40},!0)}resetLayout(){let i=oh.resetLayoutConfirm;this.confirmationService.confirm({header:i.header,message:i.message,icon:"pi pi-exclamation-triangle",acceptButtonProps:{label:i.accept,severity:"danger"},rejectButtonProps:{label:i.reject,severity:"secondary",outlined:!0},accept:()=>{this.nodePositions.set({}),this.expandedNodeIds.set(new Set),yh(new Set),queueMicrotask(()=>this.canvas()?.fitToScreen({x:40,y:40},!0))}})}getViewportCenter(){let i=this.canvasWrap()?.nativeElement;if(!i)return{x:0,y:0};let e=i.getBoundingClientRect();return{x:e.width/2,y:e.height/2}}onCanvasMouseDown(i){if(i.button!==1)return;i.preventDefault();let e=this.canvas()?.getPosition()??{x:0,y:0};this.middlePanOrigin={mouseX:i.clientX,mouseY:i.clientY,canvasX:e.x,canvasY:e.y},document.addEventListener("mousemove",this.onMiddlePanMove),document.addEventListener("mouseup",this.onMiddlePanEnd)}middlePanRafId=null;pendingPanPosition=null;onMiddlePanMove=i=>{this.middlePanOrigin&&(this.pendingPanPosition={x:this.middlePanOrigin.canvasX+(i.clientX-this.middlePanOrigin.mouseX),y:this.middlePanOrigin.canvasY+(i.clientY-this.middlePanOrigin.mouseY)},this.middlePanRafId===null&&(this.middlePanRafId=requestAnimationFrame(()=>{this.middlePanRafId=null;let e=this.canvas();!e||!this.pendingPanPosition||(e.setPosition(this.pendingPanPosition),e.redraw())})))};onMiddlePanEnd=()=>{this.middlePanRafId!==null&&(cancelAnimationFrame(this.middlePanRafId),this.middlePanRafId=null),this.pendingPanPosition=null,this.middlePanOrigin=null,document.removeEventListener("mousemove",this.onMiddlePanMove),document.removeEventListener("mouseup",this.onMiddlePanEnd),this.canvas()?.emitCanvasChangeEvent()};ngOnDestroy(){this.onMiddlePanEnd()}onNodePointerDown(i){this.pointerDownAt={x:i.clientX,y:i.clientY},document.addEventListener("mouseup",this.onNodeMouseUp,{once:!0})}nodeDragInProgress=!1;dragBuffer=null;onNodeMouseUp=()=>{queueMicrotask(()=>{if(!this.nodeDragInProgress){this.dragBuffer=null;return}this.nodeDragInProgress=!1,this.dragBuffer&&(this.nodePositions.set(this.dragBuffer),this.dragBuffer=null),S_(this.nodePositions())})};selectNode(i,e){this.isClickWithoutDrag(e)&&this.selectedNodeId.set(i.id)}activeTagSelection=q(null);viewportBeforeTagSelect=null;viewportAnimToken=0;onTagSelect(i){let e=this.flow();if(!e)return;if(this.activeTagSelection()===i){e.clearSelection(),this.activeTagSelection.set(null),this.restoreViewportFromTagSnapshot();return}let n=this.loader.nodes().filter(o=>dE(o,i)).map(o=>o.path);if(n.length===0){e.clearSelection(),this.activeTagSelection.set(null),this.restoreViewportFromTagSnapshot();return}this.viewportBeforeTagSelect===null&&(this.viewportBeforeTagSelect={position:ue({},this.viewportPosition()),scale:this.viewportScale()}),e.select(n,[]),this.activeTagSelection.set(i),this.fitViewportToPaths(n)}fitViewportToPaths(i){let e=this.canvasWrap()?.nativeElement;if(!e||i.length===0)return;let n=this.fullLayout(),o=[];for(let le of i){let ie=n.positions.get(le);ie&&o.push(ie)}if(o.length===0)return;let r=260,s=120,a=80,l=2,h=1/0,_=1/0,v=-1/0,b=-1/0;for(let le of o)le.x<h&&(h=le.x),le.y<_&&(_=le.y),le.x+r>v&&(v=le.x+r),le.y+s>b&&(b=le.y+s);let I=this.selectedNodeId()!==null?this.clampedPanelWidth():0,N=Math.max(1,e.clientWidth-I),D=Math.max(1,v-h),M=Math.max(1,b-_),k=Math.max(1,N-a*2),O=Math.max(1,e.clientHeight-a*2),z=Math.min(k/D,O/M),V=Math.min(l,Math.max(v_,z)),W=(h+v)/2,oe=(_+b)/2,be=N/2-W*V,re=e.clientHeight/2-oe*V;this.animateViewportTo({x:be,y:re},V,C_)}restoreViewportFromTagSnapshot(){let i=this.viewportBeforeTagSelect;i&&(this.viewportBeforeTagSelect=null,this.animateViewportTo(i.position,i.scale,C_))}animateViewportTo(i,e,n){let o=++this.viewportAnimToken;if(typeof requestAnimationFrame>"u"||n<=0){this.viewportPosition.set(i),this.viewportScale.set(e);return}let r=this.viewportPosition(),s=this.viewportScale(),a=performance.now(),l=_=>1-Math.pow(1-_,3),h=_=>{if(o!==this.viewportAnimToken)return;let v=Math.min(1,(_-a)/n),b=l(v);this.viewportPosition.set({x:r.x+(i.x-r.x)*b,y:r.y+(i.y-r.y)*b}),this.viewportScale.set(s+(e-s)*b),v<1&&requestAnimationFrame(h)};requestAnimationFrame(h)}closePanel(){this.selectedNodeId.set(null)}onEscape(){this.selectedNodeId()!==null&&this.closePanel()}onWindowResize(){typeof window>"u"||this.viewportWidth.set(window.innerWidth)}onPanelResizeStart(i){i.button===0&&(i.preventDefault(),i.stopPropagation(),this.panelResizeStart={mouseX:i.clientX,widthAtStart:this.clampedPanelWidth()},document.addEventListener("mousemove",this.onPanelResizeMove),document.addEventListener("mouseup",this.onPanelResizeEnd))}onPanelResizeMove=i=>{if(!this.panelResizeStart)return;let e=i.clientX-this.panelResizeStart.mouseX,n=this.panelResizeStart.widthAtStart-e,o=Math.max(fu,this.viewportWidth()-b_),r=Math.min(o,Math.max(fu,n));this.panelWidth.set(r)};onPanelResizeEnd=()=>{this.panelResizeStart&&(this.panelResizeStart=null,document.removeEventListener("mousemove",this.onPanelResizeMove),document.removeEventListener("mouseup",this.onPanelResizeEnd),sE(this.panelWidth()))};openNode(i){this.selectedNodeId.set(i.id)}onCanvasClick(i){let e=i.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(i){return this.selectedNodeId()===i}isHighlighted(i){let e=this.selectedNodeId();return e===null||e===i?!1:this.adjacency().get(e)?.has(i)??!1}isDimmed(i){if(this.activeTagSelection()!==null)return!1;let e=this.selectedNodeId();return e===null||e===i?!1:!(this.adjacency().get(e)?.has(i)??!1)}isExpanded(i){return this.expandedNodeIds().has(i)}setExpanded(i,e){let n=this.expandedNodeIds();if(n.has(i)===e)return;let o=new Set(n);e?o.add(i):o.delete(i),this.expandedNodeIds.set(o),yh(o)}onFavoriteToggle(i){this.loader.toggleFavorite(i.path,i.value)}isEdgeHighlighted(i){let e=this.selectedNodeId();return e!==null&&(i.from===e||i.to===e)}isEdgeDimmed(i){if(this.activeTagSelection()!==null)return!1;let e=this.selectedNodeId();return e===null?!1:i.from!==e&&i.to!==e}isClickWithoutDrag(i){let e=this.pointerDownAt;if(this.pointerDownAt=null,!e)return!0;let n=i.clientX-e.x,o=i.clientY-e.y;return Math.hypot(n,o)<=4}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=te({type:t,selectors:[["app-graph-view"]],viewQuery:function(e,n){e&1&&ft(n.flow,Ui,5)(n.canvas,ji,5)(n.zoom,$i,5)(n.canvasWrap,UT,5),e&2&&it(4)},hostBindings:function(e,n){e&1&&K("keydown.escape",function(){return n.onEscape()},wh)("resize",function(){return n.onWindowResize()},bh)},features:[Ie([xu])],decls:6,vars:1,consts:[["canvasWrap",""],["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"],["styleClass","graph__confirm","maskStyleClass","graph__confirm-mask","data-testid","graph-reset-layout-confirm"],[1,"empty-state__icon","pi","pi-spin","pi-spinner"],[1,"empty-state__title"],[1,"empty-state__icon","pi","pi-exclamation-circle",2,"color","var(--sm-severity-error)","opacity","1"],[1,"empty-state__desc"],[1,"empty-state__icon","pi","pi-filter-slash"],["data-testid","graph-canvas-wrap",1,"graph__canvas-wrap",3,"mousedown","click"],["fDraggable","",3,"fLoaded","fCache"],[3,"fAlignThreshold"],["fZoom","",3,"fCanvasChange","position","scale","fZoomStep","fZoomDblClickStep","debounceTime"],["ngProjectAs","[fConnections]",5,["","fConnections",""]],[3,"fOutputId","fInputId","fType","fBehavior","fOffset","fReassignDisabled","fSelectionDisabled","class","f-conn--highlighted","f-conn--dimmed"],["ngProjectAs","[fNodes]",5,["","fNodes",""]],["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"],["mode","embedded",3,"close","tagSelect","path","activeTag"],[3,"visible","total","edges","cacheAt"],["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-refresh","severity","secondary","size","small","data-testid","graph-reset-layout",3,"onClick","ariaLabel","pTooltip","text","rounded"],[3,"fOutputId","fInputId","fType","fBehavior","fOffset","fReassignDisabled","fSelectionDisabled"],[3,"type"],["ngProjectAs","[fNodes]",5,["","fNodes",""],4,"fVirtualFor","fVirtualForOf"],["fNode","","fDragHandle","",1,"sm-gnode-host",3,"fNodePositionChange","pointerdown","click","dblclick","fNodeId","fNodePosition"],["fNodeInput","",1,"sm-gnode__connector","sm-gnode__connector--in",3,"fInputId","fInputConnectableSide"],[3,"expandedChange","favoriteToggle","node","stats","summary","selected","highlighted","dimmed","expanded","isFavorite"],[1,"sm-gnode__marker-anchor"],["data-debug-slot","graph.node.alert",1,"sm-debug-slot"],["slot","graph.node.alert",3,"node"],["fNodeOutput","",1,"sm-gnode__connector","sm-gnode__connector--out",3,"fOutputId","fOutputConnectableSide"],["fNode","","fDragHandle","",1,"sm-gnode-host",3,"fNodeId","fNodePosition"]],template:function(e,n){e&1&&(u(0,"section",1),w(1,$T,4,1,"div",2)(2,WT,6,2,"div",3)(3,qT,6,2,"div",4)(4,eE,25,36,"div",5),A(5,"p-confirmdialog",6),f()),e&2&&(c(),S(n.loading()&&!n.hasData()?1:n.error()&&!n.hasData()?2:n.hasData()?4:3))},dependencies:[Cm,Ui,ji,hm,fm,$i,gm,Dp,pm,Kp,Qp,mm,_m,Ml,Xp,ym,dm,Rl,Ll,zl,eu,vn,yn,Uh,jh,je,Qe,xn],styles:["[_nghost-%COMP%]{display:block;height:100%}.graph[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%}.graph__canvas-wrap[_ngcontent-%COMP%]{position:relative;flex:1;min-height:0;border:1px solid var(--sm-border);border-radius:.75rem;background:var(--sm-bg-content);overflow:hidden;--ff-connection-drag-handle-stroke: transparent;--ff-connector-background-color: transparent;--ff-connector-border-color: transparent;--ff-connector-connected-color: transparent;--ff-connector-node-ring-color: transparent;--ff-canvas-background-color: transparent}.graph__canvas-wrap[_ngcontent-%COMP%] f-flow[_ngcontent-%COMP%]{width:100%;height:100%}.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;overflow-y:auto}.graph__panel.is-open[_ngcontent-%COMP%]{transform:translate(0);pointer-events: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:999px;box-shadow:var(--sm-shadow-floating);z-index:2;pointer-events:auto}.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, rgba(99, 102, 241, .45)))}.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)}.sm-gnode__connector[_ngcontent-%COMP%]{position:absolute;pointer-events:none}.sm-gnode__connector--out[_ngcontent-%COMP%]{bottom:calc(var(--ff-connector-size) / -2);left:50%;transform:translate(-50%)}.sm-gnode__connector--in[_ngcontent-%COMP%]{top:calc(var(--ff-connector-size) / -2);left:50%;transform:translate(-50%)}.f-conn--invokes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-invokes);--ff-connection-width: 2.5px;--ff-marker-color: var(--sm-edge-invokes)}.f-conn--references[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-references);--ff-connection-width: 2px;--ff-marker-color: var(--sm-edge-references)}.f-conn--mentions[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-mentions);--ff-connection-width: 1.5px;--ff-marker-color: var(--sm-edge-mentions)}.f-conn--supersedes[_ngcontent-%COMP%]{--ff-connection-color: var(--sm-edge-supersedes);--ff-connection-width: 2px;--ff-marker-color: var(--sm-edge-supersedes)}.graph__canvas-wrap[_ngcontent-%COMP%] .f-conn--supersedes .f-connection-path{stroke-dasharray:8 4}.f-conn--highlighted[_ngcontent-%COMP%]{--ff-connection-width: 3px}.f-conn--dimmed[_ngcontent-%COMP%]{opacity:.15}.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}"],changeDetection:0})};function nE(){let t=null;try{t=localStorage.getItem(T_)}catch{return null}if(!t)return null;let i;try{i=JSON.parse(t)}catch{return null}return cE(i)?i:null}function iE(){let t=null;try{t=localStorage.getItem(E_)}catch{return{}}if(!t)return{};let i;try{i=JSON.parse(t)}catch{return{}}if(typeof i!="object"||i===null)return{};let e={};for(let[n,o]of Object.entries(i))aE(o)&&(e[n]={x:o.x,y:o.y});return e}function S_(t){try{localStorage.setItem(E_,JSON.stringify(t))}catch{}}function oE(){let t=null;try{t=localStorage.getItem(P_)}catch{return new Set}if(!t)return new Set;let i;try{i=JSON.parse(t)}catch{return new Set}if(!Array.isArray(i))return new Set;let e=new Set;for(let n of i)typeof n=="string"&&n.length>0&&e.add(n);return e}function yh(t){try{localStorage.setItem(P_,JSON.stringify([...t]))}catch{}}function rE(){let t=null;try{t=localStorage.getItem(M_)}catch{return null}if(!t)return null;let i=Number(t);return!Number.isFinite(i)||i<=0?null:i}function sE(t){try{localStorage.setItem(M_,String(Math.round(t)))}catch{}}function aE(t){if(typeof t!="object"||t===null)return!1;let i=t;return typeof i.x=="number"&&typeof i.y=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)}function cE(t){if(typeof t!="object"||t===null)return!1;let i=t;return typeof i.x=="number"&&typeof i.y=="number"&&typeof i.scale=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.scale)&&i.scale>0}function dE(t,i){let n=t.frontmatter.tags;if(Array.isArray(n)&&n.includes(i))return!0;let r=t.sidecar?.annotations?.tags;return!!(Array.isArray(r)&&r.includes(i))}export{w_ as GraphView};
|