1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2466],{2466:function(t,e,a){let i;a.d(e,{diagram:function(){return h}});var r=a(11507),d=a(64218),n=a(62865),s=a(45625),o=a(93883);a(27484),a(17967),a(22424);let c={},keys=()=>Object.keys(c),l={get:t=>c[t],set:(t,e)=>{c[t]=e},keys,size:()=>keys().length},drawStartState=t=>t.append("circle").attr("class","start-state").attr("r",(0,o.c)().state.sizeUnit).attr("cx",(0,o.c)().state.padding+(0,o.c)().state.sizeUnit).attr("cy",(0,o.c)().state.padding+(0,o.c)().state.sizeUnit),drawDivider=t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",(0,o.c)().state.textHeight).attr("class","divider").attr("x2",2*(0,o.c)().state.textHeight).attr("y1",0).attr("y2",0),drawSimpleState=(t,e)=>{let a=t.append("text").attr("x",2*(0,o.c)().state.padding).attr("y",(0,o.c)().state.textHeight+2*(0,o.c)().state.padding).attr("font-size",(0,o.c)().state.fontSize).attr("class","state-title").text(e.id),i=a.node().getBBox();return t.insert("rect",":first-child").attr("x",(0,o.c)().state.padding).attr("y",(0,o.c)().state.padding).attr("width",i.width+2*(0,o.c)().state.padding).attr("height",i.height+2*(0,o.c)().state.padding).attr("rx",(0,o.c)().state.radius),a},drawDescrState=(t,e)=>{let addTspan=function(t,e,a){let i=t.append("tspan").attr("x",2*(0,o.c)().state.padding).text(e);a||i.attr("dy",(0,o.c)().state.textHeight)},a=t.append("text").attr("x",2*(0,o.c)().state.padding).attr("y",(0,o.c)().state.textHeight+1.3*(0,o.c)().state.padding).attr("font-size",(0,o.c)().state.fontSize).attr("class","state-title").text(e.descriptions[0]),i=a.node().getBBox(),r=i.height,d=t.append("text").attr("x",(0,o.c)().state.padding).attr("y",r+.4*(0,o.c)().state.padding+(0,o.c)().state.dividerMargin+(0,o.c)().state.textHeight).attr("class","state-description"),n=!0,s=!0;e.descriptions.forEach(function(t){n||(addTspan(d,t,s),s=!1),n=!1});let c=t.append("line").attr("x1",(0,o.c)().state.padding).attr("y1",(0,o.c)().state.padding+r+(0,o.c)().state.dividerMargin/2).attr("y2",(0,o.c)().state.padding+r+(0,o.c)().state.dividerMargin/2).attr("class","descr-divider"),l=d.node().getBBox(),g=Math.max(l.width,i.width);return c.attr("x2",g+3*(0,o.c)().state.padding),t.insert("rect",":first-child").attr("x",(0,o.c)().state.padding).attr("y",(0,o.c)().state.padding).attr("width",g+2*(0,o.c)().state.padding).attr("height",l.height+r+2*(0,o.c)().state.padding).attr("rx",(0,o.c)().state.radius),t},addTitleAndBox=(t,e,a)=>{let i;let r=(0,o.c)().state.padding,d=2*(0,o.c)().state.padding,n=t.node().getBBox(),s=n.width,c=n.x,l=t.append("text").attr("x",0).attr("y",(0,o.c)().state.titleShift).attr("font-size",(0,o.c)().state.fontSize).attr("class","state-title").text(e.id),g=l.node().getBBox(),p=g.width+d,h=Math.max(p,s);h===s&&(h+=d);let x=t.node().getBBox();e.doc,i=c-r,p>s&&(i=(s-h)/2+r),Math.abs(c-x.x)<r&&p>s&&(i=c-(p-s)/2);let u=1-(0,o.c)().state.textHeight;return t.insert("rect",":first-child").attr("x",i).attr("y",u).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",x.height+(0,o.c)().state.textHeight+(0,o.c)().state.titleShift+1).attr("rx","0"),l.attr("x",i+r),p<=s&&l.attr("x",c+(h-d)/2-p/2+r),t.insert("rect",":first-child").attr("x",i).attr("y",(0,o.c)().state.titleShift-(0,o.c)().state.textHeight-(0,o.c)().state.padding).attr("width",h).attr("height",3*(0,o.c)().state.textHeight).attr("rx",(0,o.c)().state.radius),t.insert("rect",":first-child").attr("x",i).attr("y",(0,o.c)().state.titleShift-(0,o.c)().state.textHeight-(0,o.c)().state.padding).attr("width",h).attr("height",x.height+3+2*(0,o.c)().state.textHeight).attr("rx",(0,o.c)().state.radius),t},drawEndState=t=>(t.append("circle").attr("class","end-state-outer").attr("r",(0,o.c)().state.sizeUnit+(0,o.c)().state.miniPadding).attr("cx",(0,o.c)().state.padding+(0,o.c)().state.sizeUnit+(0,o.c)().state.miniPadding).attr("cy",(0,o.c)().state.padding+(0,o.c)().state.sizeUnit+(0,o.c)().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",(0,o.c)().state.sizeUnit).attr("cx",(0,o.c)().state.padding+(0,o.c)().state.sizeUnit+2).attr("cy",(0,o.c)().state.padding+(0,o.c)().state.sizeUnit+2)),drawForkJoinState=(t,e)=>{let a=(0,o.c)().state.forkWidth,i=(0,o.c)().state.forkHeight;if(e.parentId){let t=a;a=i,i=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",i).attr("x",(0,o.c)().state.padding).attr("y",(0,o.c)().state.padding)},_drawLongText=(t,e,a,i)=>{let r=0,d=i.append("text");d.style("text-anchor","start"),d.attr("class","noteText");let n=t.replace(/\r\n/g,"<br/>");n=n.replace(/\n/g,"<br/>");let s=n.split(o.e.lineBreakRegex),c=1.25*(0,o.c)().state.noteMargin;for(let t of s){let i=t.trim();if(i.length>0){let t=d.append("tspan");if(t.text(i),0===c){let e=t.node().getBBox();c+=e.height}r+=c,t.attr("x",e+(0,o.c)().state.noteMargin),t.attr("y",a+r+1.25*(0,o.c)().state.noteMargin)}}return{textWidth:d.node().getBBox().width,textHeight:r}},drawNote=(t,e)=>{e.attr("class","state-note");let a=e.append("rect").attr("x",0).attr("y",(0,o.c)().state.padding),i=e.append("g"),{textWidth:r,textHeight:d}=_drawLongText(t,0,0,i);return a.attr("height",d+2*(0,o.c)().state.noteMargin),a.attr("width",r+2*(0,o.c)().state.noteMargin),a},drawState=function(t,e){let a=e.id,i={id:a,label:e.id,width:0,height:0},r=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&drawStartState(r),"end"===e.type&&drawEndState(r),("fork"===e.type||"join"===e.type)&&drawForkJoinState(r,e),"note"===e.type&&drawNote(e.note.text,r),"divider"===e.type&&drawDivider(r),"default"===e.type&&0===e.descriptions.length&&drawSimpleState(r,e),"default"===e.type&&e.descriptions.length>0&&drawDescrState(r,e);let d=r.node().getBBox();return i.width=d.width+2*(0,o.c)().state.padding,i.height=d.height+2*(0,o.c)().state.padding,l.set(a,i),i},g=0,drawEdge=function(t,e,a){e.points=e.points.filter(t=>!Number.isNaN(t.y));let i=e.points,n=(0,d.jvg)().x(function(t){return t.x}).y(function(t){return t.y}).curve(d.$0Z),s=t.append("path").attr("d",n(i)).attr("id","edge"+g).attr("class","transition"),c="";if((0,o.c)().state.arrowMarkerAbsolute&&(c=(c=(c=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),s.attr("marker-end","url("+c+"#"+function(t){switch(t){case r.d.relationType.AGGREGATION:return"aggregation";case r.d.relationType.EXTENSION:return"extension";case r.d.relationType.COMPOSITION:return"composition";case r.d.relationType.DEPENDENCY:return"dependency"}}(r.d.relationType.DEPENDENCY)+"End)"),void 0!==a.title){let i=t.append("g").attr("class","stateLabel"),{x:r,y:d}=o.u.calcLabelPosition(e.points),n=o.e.getRows(a.title),s=0,c=[],l=0,g=0;for(let t=0;t<=n.length;t++){let e=i.append("text").attr("text-anchor","middle").text(n[t]).attr("x",r).attr("y",d+s),a=e.node().getBBox();if(l=Math.max(l,a.width),g=Math.min(g,a.x),o.l.info(a.x,r,d+s),0===s){let t=e.node().getBBox();s=t.height,o.l.info("Title height",s,d)}c.push(e)}let p=s*n.length;if(n.length>1){let t=(n.length-1)*s*.5;
1c.forEach((e,a)=>e.attr("y",d+a*s-t)),p=s*n.length}let h=i.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",r-l/2-(0,o.c)().state.padding/2).attr("y",d-p/2-(0,o.c)().state.padding/2-3.5).attr("width",l+(0,o.c)().state.padding).attr("height",p+(0,o.c)().state.padding),o.l.info(h)}g++},p={},insertMarkers=function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},getLabelWidth=t=>t?t.length*i.fontSizeFactor:1,renderDoc=(t,e,a,r,d,c,l)=>{let g;let h=new s.k({compound:!0,multigraph:!0}),x=!0;for(g=0;g<t.length;g++)if("relation"===t[g].stmt){x=!1;break}a?h.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:x?1:i.edgeLengthFactor,nodeSep:x?1:50,isMultiGraph:!0}):h.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:x?1:i.edgeLengthFactor,nodeSep:x?1:50,ranker:"tight-tree",isMultiGraph:!0}),h.setDefaultEdgeLabel(function(){return{}}),l.db.extract(t);let u=l.db.getStates(),f=l.db.getRelations(),w=Object.keys(u);for(let t of w){let n;let s=u[t];if(a&&(s.parentId=a),s.doc){let t=e.append("g").attr("id",s.id).attr("class","stateGroup");n=renderDoc(s.doc,t,s.id,!r,d,c,l);{let e=(t=addTitleAndBox(t,s,r)).node().getBBox();n.width=e.width,n.height=e.height+i.padding/2,p[s.id]={y:i.compositTitleSize}}}else n=drawState(e,s);if(s.note){let t={descriptions:[],id:s.id+"-note",note:s.note,type:"note"},a=drawState(e,t);"left of"===s.note.position?(h.setNode(n.id+"-note",a),h.setNode(n.id,n)):(h.setNode(n.id,n),h.setNode(n.id+"-note",a)),h.setParent(n.id,n.id+"-group"),h.setParent(n.id+"-note",n.id+"-group")}else h.setNode(n.id,n)}o.l.debug("Count=",h.nodeCount(),h);let y=0;f.forEach(function(t){y++,o.l.debug("Setting edge",t),h.setEdge(t.id1,t.id2,{relation:t,width:getLabelWidth(t.title),height:i.labelHeight*o.e.getRows(t.title).length,labelpos:"c"},"id"+y)}),(0,n.bK)(h),o.l.debug("Graph after layout",h.nodes());let b=e.node();h.nodes().forEach(function(t){if(void 0!==t&&void 0!==h.node(t)){o.l.warn("Node "+t+": "+JSON.stringify(h.node(t))),d.select("#"+b.id+" #"+t).attr("transform","translate("+(h.node(t).x-h.node(t).width/2)+","+(h.node(t).y+(p[t]?p[t].y:0)-h.node(t).height/2)+" )"),d.select("#"+b.id+" #"+t).attr("data-x-shift",h.node(t).x-h.node(t).width/2);let e=c.querySelectorAll("#"+b.id+" #"+t+" .divider");e.forEach(t=>{let e=t.parentElement,a=0,i=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),Number.isNaN(i=parseInt(e.getAttribute("data-x-shift"),10))&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",a-i-8)})}else o.l.debug("No Node "+t+": "+JSON.stringify(h.node(t)))});let B=b.getBBox();
1h.edges().forEach(function(t){void 0!==t&&void 0!==h.edge(t)&&(o.l.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(h.edge(t))),drawEdge(e,h.edge(t),h.edge(t).relation))}),B=b.getBBox();let m={id:a||"root",label:a||"root",width:0,height:0};return m.width=B.width+2*i.padding,m.height=B.height+2*i.padding,o.l.debug("Doc rendered",m,h),m},h={parser:r.p,db:r.d,renderer:{setConf:function(){},draw:function(t,e,a,r){let n;i=(0,o.c)().state;let s=(0,o.c)().securityLevel;"sandbox"===s&&(n=(0,d.Ys)("#i"+e));let c="sandbox"===s?(0,d.Ys)(n.nodes()[0].contentDocument.body):(0,d.Ys)("body"),l="sandbox"===s?n.nodes()[0].contentDocument:document;o.l.debug("Rendering diagram "+t);let g=c.select(`[id='${e}']`);insertMarkers(g);let p=r.db.getRootDoc();renderDoc(p,g,void 0,!1,c,l,r);let h=i.padding,x=g.node().getBBox(),u=x.width+2*h,f=x.height+2*h,w=1.75*u;(0,o.i)(g,f,w,i.useMaxWidth),g.attr("viewBox",`${x.x-i.padding} ${x.y-i.padding} `+u+" "+f)}},styles:r.s,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,r.d.clear()}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.