import{u as I}from"./vue-flow-core-arQEjB1F.js";import{e as G,b as B,N as g,f as v,g as d,h as f,k as u,n as y,j as w,p as l,J as L,a5 as b}from"./jwt-decode.esm-BYfS37aG.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="52d2e632-b9bd-4333-929d-9d82cd2a7879",e._sentryDebugIdIdentifier="sentry-dbid-52d2e632-b9bd-4333-929d-9d82cd2a7879")}catch{}})();var a=(e=>(e.Lines="lines",e.Dots="dots",e))(a||{});const m=function({dimensions:e,size:o,color:n}){return b("path",{stroke:n,"stroke-width":o,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},p=function({radius:e,color:o}){return b("circle",{cx:e,cy:e,r:e,fill:o})};a.Lines+"",a.Dots+"";const A={[a.Dots]:"#81818a",[a.Lines]:"#eee"},S=["id","x","y","width","height","patternTransform"],E={key:2,height:"100",width:"100"},M=["fill"],N=["x","y","fill"],O={name:"Background",compatConfig:{MODE:3}},P=G({...O,props:{id:{},variant:{default:()=>a.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:o,viewport:n}=I(),s=B(()=>{const t=n.value.zoom,[h,$]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],i=[h*t||1,$*t||1],D=e.size*t,[k,z]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],C=[k*t||1+i[0]/2,z*t||1+i[1]/2];return{scaledGap:i,offset:C,size:D}}),r=g(()=>`pattern-${o}${e.id?`-${e.id}`:""}`),c=g(()=>e.color||e.patternColor||A[e.variant||a.Dots]);return(t,h)=>(d(),v("svg",{class:"vue-flow__background vue-flow__container",style:L({height:`${t.height>100?100:t.height}%`,width:`${t.width>100?100:t.width}%`})},[f(t.$slots,"pattern-container",{id:r.value},()=>[u("pattern",{id:r.value,x:l(n).x%s.value.scaledGap[0],y:l(n).y%s.value.scaledGap[1],width:s.value.scaledGap[0],height:s.value.scaledGap[1],patternTransform:`translate(-${s.value.offset[0]},-${s.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[f(t.$slots,"pattern",{},()=>[t.variant===l(a).Lines?(d(),y(l(m),{key:0,size:t.lineWidth,color:c.value,dimensions:s.value.scaledGap},null,8,["size","color","dimensions"])):t.variant===l(a).Dots?(d(),y(l(p),{key:1,color:c.value,radius:s.value.size/2},null,8,["color","radius"])):w("",!0),t.bgColor?(d(),v("svg",E,[u("rect",{width:"100%",height:"100%",fill:t.bgColor},null,8,M)])):w("",!0)])],8,S)]),u("rect",{x:t.x,y:t.y,width:"100%",height:"100%",fill:`url(#${r.value})`},null,8,N),f(t.$slots,"default",{id:r.value})],4))}});export{P as _};
//# sourceMappingURL=vue-flow-background-Dkpfu6En.js.map
