import{_ as e,a as t,g as n,i as r,l as i,o as a,t as o,v as s,y as c}from"./chunk-NNHCCRGN.BGI6DATj.js";var l,u,d=(l=class extends o{constructor(){super([`eventmodeling`])}},n(l,`EventModelingTokenBuilder`),l),f=new Set([`cmd`,`command`]),p=new Set([`evt`,`event`]),m=new Set([`rmo`,`readmodel`]),h=new Set([`pcr`,`processor`]),g=new Set([`ui`]);function _(e){let t=e.validation.EventModelingValidator,n=e.validation.ValidationRegistry;if(n){let e={EmTimeFrame:t.checkSourceFrameTypes.bind(t),EmResetFrame:t.checkSourceFrameTypes.bind(t)};n.register(e,t)}}n(_,`registerValidationChecks`);var v=(u=class{checkSourceFrameTypes(e,t){e.sourceFrames.length!==0&&(f.has(e.modelEntityType)?this.validateSources(e,new Set([...g,...h]),`command`,`ui or processor`,t):p.has(e.modelEntityType)?this.validateSources(e,f,`event`,`command`,t):m.has(e.modelEntityType)?this.validateSources(e,p,`read model`,`event`,t):h.has(e.modelEntityType)?this.validateSources(e,m,`processor`,`read model`,t):g.has(e.modelEntityType)&&this.validateSources(e,m,`ui`,`read model`,t))}validateSources(e,t,n,r,i){for(let a of e.sourceFrames){let o=a.ref;o!==void 0&&!t.has(o.modelEntityType)&&i(`error`,`A ${n} can only receive input from a ${r}, not from '${o.modelEntityType}'.`,{node:e,property:`sourceFrames`})}}},n(u,`EventModelingValidator`),u),y={parser:{TokenBuilder:n(()=>new d,`TokenBuilder`),ValueConverter:n(()=>new r,`ValueConverter`)},validation:{EventModelingValidator:n(()=>new v,`EventModelingValidator`)}};function b(n=t){let r=c(s(n),i),o=c(e({shared:r}),a,y);return r.ServiceRegistry.register(o),_(o),{shared:r,EventModel:o}}n(b,`createEventModelingServices`);export{b as n,y as t};
//# sourceMappingURL=chunk-N66VUXT2.BnRcapSN.js.map