ultisuite-client/out/_next/static/chunks/1553.ad2126a1a1402a8a.js
R3D347HR4Y d6d18f911b
Some checks failed
E2E / Playwright e2e (push) Has been cancelled
Lots of stuff and mobile app
2026-06-17 00:13:28 +02:00

1 line
11 KiB
JavaScript

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1553],{1553:(e,t,i)=>{i.d(t,{diagram:()=>ei});var n=i(73018),a=i(50001),r=i(93913),o=i(85448),l=i(46229),d=i(51874),s="position frame",m="frame positioned",c="position relation",x="relation positioned",u=(0,o.K2)(function(e){o.Rm.debug("options str",e)},"setOptions"),f=(0,o.K2)(function(){return{}},"getOptions"),g=(0,o.K2)(function(){h(),(0,r.IU)()},"clear");function h(){w={}}(0,o.K2)(h,"reset");var b=r.UI.eventmodeling,p=(0,o.K2)(()=>(0,a.$t)({...b,...(0,r.zj)().eventmodeling}),"getConfig"),w={};function v(){let e=M,{ast:t}=w,i=P();if(!t)throw Error("No data for EventModel");return t.frames.forEach((n,a)=>{let r=$(n,t.dataEntities,i);e=G(e,{$kind:s,index:a,frame:n,textProps:r}),C(n)?(o.Rm.debug("source frame",n.sourceFrames),t.frames.filter(e=>n.sourceFrames.some(t=>t.$refText===e.name)).forEach(t=>{e=G(e,{$kind:c,index:a,frame:n,sourceFrame:t})})):e=G(e,{$kind:c,index:a,frame:n})}),e={...e,sortedSwimlanesArray:D(e.swimlanes)}}function y(e){w.ast=e}(0,o.K2)(v,"getState"),(0,o.K2)(y,"setAst");var k={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function P(){return k}(0,o.K2)(P,"getDiagramProps");var M={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function K(e){let t=e.split(".");if(2===t.length)return t[0]}function S(e){let t=e.split(".");return 2===t.length?t[1]:e}function B(e,t){if(t&&0!==t.length)return Object.values(e).find(e=>e.namespace===t)}function F(e,t,i){return Math.max(t,...Object.keys(e).filter(e=>{let n=Number.parseInt(e);return n>t&&n<i}).map(e=>Number.parseInt(e)))+1}function R(e,t){let i=K(e.entityIdentifier),n=B(t,i);switch(e.modelEntityType){case"ui":case"pcr":case"processor":if(n)return{index:n.index,label:n.namespace||k.labelUiAutomation};if(i)return{index:F(t,0,100),label:k.labelUiAutomationPrefix+i};return{index:0,label:k.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":if(n)return{index:n.index,label:n.namespace||k.labelCommandReadModel};if(i)return{index:F(t,100,200),label:k.labelCommandReadModelPrefix+i};return{index:100,label:k.labelCommandReadModel};default:if(n)return{index:n.index,label:n.namespace||k.labelEvents};if(i)return{index:F(t,200,300),label:k.labelEventsPrefix+i};return{index:200,label:k.labelEvents}}}function E(e){let{themeVariables:t}=(0,r.zj)();switch(e.modelEntityType){case"ui":return{fill:t.emUiFill??"white",stroke:t.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:t.emProcessorFill??"#edb3f6",stroke:t.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:t.emReadModelFill??"#d3f1a2",stroke:t.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:t.emCommandFill??"#bcd6fe",stroke:t.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:t.emEventFill??"#ffb778",stroke:t.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}function $(e,t,i){let n,l=(0,r.zj)(),d=(0,r.jZ)(S(e.entityIdentifier)??"",l),s={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},m=(0,a.bH)(d,i.textMaxWidth,s),c=`<b>${m}</b>`;if(e.dataInlineValue&&(n=(n=(n=e.dataInlineValue).substring(n.indexOf("{")+1)).substring(0,n.lastIndexOf("}")-1),n=(0,r.jZ)(n,l),n=(n=(0,a.bH)(n,i.textMaxWidth,s)).replaceAll(" ","&nbsp;")),e.dataReference){let o=t.find(t=>t.name===e.dataReference?.$refText);o&&(n=(n=(n=o.dataBlockValue).substring(n.indexOf("{\n")+2)).substring(0,n.lastIndexOf("}")-1),n=(0,r.jZ)(n,l),n=(n=(0,a.bH)(n,i.textMaxWidth,s)).replaceAll(" ","&nbsp;")+"<br/>")}let x=void 0!==n;x&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${i.textMaxWidth}px">${n}</code>`);let u={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},f=(0,a.PX)(c,u),g={content:c,width:x?f.width/3:f.width,height:f.height};return o.Rm.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}function A(e,t){let i=E(t.frame),n={width:t.textProps.width+2*k.boxTextPadding,height:t.textProps.height+2*k.boxTextPadding};return[{$kind:m,frame:t.frame,index:t.index,visual:i,dimension:n,textProps:t.textProps}]}function T(e,t,i){return void 0===t?k.contentStartX:t.index===e.index&&e.r?e.r+k.boxPadding:void 0===i?k.contentStartX:i.r-k.boxOverlap+k.boxPadding}function W(e,t){return Math.max(...e.map(e=>e.r),t)}function D(e){return Object.values(e).sort((e,t)=>e.index-t.index)}function H(e,t){let i,n=R(t.frame,e.swimlanes);i=n.index in e.swimlanes?e.swimlanes[n.index]:{index:n.index,label:n.label,r:0,y:n.index*k.swimlaneMinHeight+k.swimlaneGap,height:k.swimlaneMinHeight,maxHeight:k.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,r=void 0!==e.previousSwimlaneNumber?e.swimlanes[e.previousSwimlaneNumber]:void 0,o={width:Math.max(k.boxMinWidth,Math.min(k.boxMaxWidth,t.dimension.width))+2*k.boxPadding,height:Math.max(k.boxMinHeight,Math.min(k.boxMaxHeight,t.dimension.height))+2*k.boxPadding},l=T(i,r,a),d=l+o.width+k.boxPadding,s=W(Object.values(e.swimlanes),d);i.r=l+o.width,i.maxHeight=Math.max(i.maxHeight,o.height),i.height=Math.max(k.swimlaneMinHeight,i.maxHeight)+2*k.swimlanePadding;let m={x:l,y:k.swimlanePadding+i.y,r:d,dimension:o,leftSibling:!1,swimlane:i,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},c={...e,boxes:[...e.boxes,m],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:n.index,previousFrame:t.frame,maxR:s},x=D(c.swimlanes);x.length>0&&(x[0].y=0);for(let e=1;e<x.length;e++){let t=x[e],i=x[e-1];t.y=i.y+i.height+k.swimlaneGap}return c}function I(e,t){return 0===e&&0===t.sourceFrames.length}function C(e){return void 0!==e.sourceFrames&&null!==e.sourceFrames&&e.sourceFrames.length>0}function O(e,t){if(null!=t)return e.find(e=>e.frame.name===t.name)}function j(e,t,i){if(!(i<0))for(let n=i;n>=0;n--){let i=e[n];if(i.swimlane.index!==t)return i}}function N(e,t){let i;if((0,l.F5)(t.frame)||I(t.index,t.frame))return[];let n=O(e.boxes,t.frame);if(void 0===n)throw Error(`Target box not found for frame ${t.frame.name}`);return void 0===(i=t.sourceFrame?O(e.boxes,t.sourceFrame):j(e.boxes,n.swimlane.index,t.index-1))?[]:[{$kind:x,frame:t.frame,index:t.index,sourceBox:i,targetBox:n}]}function U(e,t){let i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}(0,o.K2)(K,"extractNamespace"),(0,o.K2)(S,"extractName"),(0,o.K2)(B,"findSwimlaneByNamespace"),(0,o.K2)(F,"findNextAvailableIndex"),(0,o.K2)(R,"calculateSwimlaneProps"),(0,o.K2)(E,"calculateEntityVisualProps"),(0,o.K2)($,"calculateTextProps"),(0,o.K2)(A,"decidePositionFrame"),(0,o.K2)(T,"calculateX"),(0,o.K2)(W,"calculateMaxRight"),(0,o.K2)(D,"sortedSwimlanesArray"),(0,o.K2)(H,"evolveFramePositioned"),(0,o.K2)(I,"isFirstFrame"),(0,o.K2)(C,"hasSourceFrame"),(0,o.K2)(O,"findBoxByFrame"),(0,o.K2)(j,"findBoxByLineIndex"),(0,o.K2)(N,"decidePositionRelation"),(0,o.K2)(U,"evolveRelationPositioned");var z={[s]:A,[c]:N},X={[m]:H,[x]:U};function V(e,t){let i=z[t.$kind];if(null==i)return[];let n=i(e,t);return o.Rm.debug("decided events",n),n}function _(e,t){let i=t.reduce((e,t)=>{let i=X[t.$kind];return null==i?e:i(e,t)},e);return o.Rm.debug("evolve events",{state:e,newState:i,events:t}),i}function G(e,t){let i=V(e,t);return _(e,i)}(0,o.K2)(V,"decide"),(0,o.K2)(_,"evolve"),(0,o.K2)(G,"dispatch");var L={getConfig:p,setOptions:u,getOptions:f,clear:g,setAccTitle:r.SV,getAccTitle:r.iN,getAccDescription:r.m7,setAccDescription:r.EI,setDiagramTitle:r.ke,getDiagramTitle:r.ab,setAst:y,getDiagramProps:P,getState:v},Z={parse:(0,o.K2)(async e=>{let t=await (0,l.qg)("eventmodeling",e);o.Rm.debug(t),L.setAst(t),(0,n.S)(t,L)},"parse")},Y=(0,r.D7)(),q=Y?.eventmodeling;function J(e,t){return i=>{let n=i.swimlane.y+t.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",i.x).attr("y",n).attr("rx","3").attr("width",i.dimension.width).attr("height",i.dimension.height).attr("stroke",i.visual.stroke).attr("fill",i.visual.fill),a.append("foreignObject").attr("x",i.x+t.boxPadding).attr("y",n+10).attr("width",i.dimension.width-2*t.boxPadding).attr("height",i.dimension.height-2*t.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(i.text)}}function Q(e,t){return e>t}function ee(e,t,i,n){return a=>{let r,l,d=a.sourceBox.swimlane.y+t.swimlanePadding,s=a.targetBox.swimlane.y+t.swimlanePadding,m=Q(d,s),c=a.sourceBox.x+2*a.sourceBox.dimension.width/3,x=a.targetBox.x+a.targetBox.dimension.width/3;o.Rm.debug(`rendering relation up=${m} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),m?(r=d,l=s+a.targetBox.dimension.height):(r=d+a.sourceBox.dimension.height,l=s);let u=n.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",u).attr("stroke-width","1").attr("marker-end",`url(#${i})`).attr("d",`M${c} ${r} L${x} ${l}`)}}function et(e,t,i,n){return a=>{let r=e.append("g").attr("class","em-swimlane"),o=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=n.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",t+i.swimlanePadding).attr("height",a.height).attr("fill",o).attr("stroke",l),r.append("text").attr("font-weight",i.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}(0,o.K2)(J,"renderD3Box"),(0,o.K2)(Q,"dirUpwards"),(0,o.K2)(ee,"renderD3Relation"),(0,o.K2)(et,"renderD3Swimlane");var ei={parser:Z,db:L,renderer:{draw:(0,o.K2)(function(e,t,i,n){if(o.Rm.debug("in eventmodeling renderer",e+"\n","id:",t,i),!q)throw Error("EventModeling config not found");let a=n.db,{themeVariables:l,eventmodeling:s}=(0,r.D7)(),m=(0,d.Ltv)(`[id="${t}"]`),c=a.getDiagramProps(),x=a.getState(),u=`em-arrowhead-${t}`,f=l.emArrowhead??"#000000";x.sortedSwimlanesArray.forEach(et(m,x.maxR,c,l)),x.boxes.forEach(J(m,c)),x.relations.forEach(ee(m,c,u,l)),m.append("defs").append("marker").attr("id",u).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",f),(0,r.mj)(void 0,m,s?.padding??30,s?.useMaxWidth)},"draw")},styles:(0,o.K2)(e=>"","getStyles")}},73018:(e,t,i)=>{function n(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}i.d(t,{S:()=>n}),(0,i(85448).K2)(n,"populateCommonDb")}}]);