%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/nextcloud.varak.net/apps/text/js/
Upload File :
Create Path :
Current File : /www/varak.net/nextcloud.varak.net/apps/text/js/stateDiagram-v2-d93cdb3a-fWEFHomj.chunk.mjs

/*! third party licenses: js/vendor.LICENSE.txt */
import{p as K,d as L,s as Q,D as j,a as U,S as X,b as Y,c as Z}from"./styles-6aaf32cf-DJGE2hlQ.chunk.mjs";import{G as tt}from"./graph-RO1Bel_o.chunk.mjs";import{l as p,c as S,h as A,z as et,i as st,j as v}from"./mermaid.core-ChD64xgE.chunk.mjs";import{r as ot}from"./index-3862675e-tbT_gb_H.chunk.mjs";import"./layout-CSM-pooY.chunk.mjs";import"./modulepreload-polyfill-DMTabKmO.chunk.mjs";import"./emoji-picker-SoWZqoso.chunk.mjs";import"./vue.runtime.esm-fZsuJKoo.chunk.mjs";import"./clone-CdZcBlbr.chunk.mjs";import"./edges-e0da2a9e-CfclYjfq.chunk.mjs";import"./createText-2e5e7dd3-CGeVxhlf.chunk.mjs";import"./line-DE4vEKog.chunk.mjs";import"./array-CNYCUCI1.chunk.mjs";import"./path-D16fQfbf.chunk.mjs";const w="rect",k="rectWithTitle",at="start",rt="end",it="divider",nt="roundedWithTitle",dt="note",ct="noteGroup",u="statediagram",lt="state",pt="".concat(u,"-").concat(lt),I="transition",bt="note",gt="note-edge",ht="".concat(I," ").concat(gt),ut="".concat(u,"-").concat(bt),yt="cluster",mt="".concat(u,"-").concat(yt),ft="cluster-alt",$t="".concat(u,"-").concat(ft),P="parent",W="note",xt="state",R="----",wt="".concat(R).concat(W),M="".concat(R).concat(P),O="fill:none",_="fill: #333",q="c",F="text",H="normal";let T={},l=0;const Tt=function(t){const a=Object.keys(t);for(const e of a)t[e]},St=function(t,a){return a.db.extract(a.db.getRootDocV2()),a.db.getClasses()};function Dt(t){return t==null?"":t.classes?t.classes.join(" "):""}function B(t="",a=0,e="",r=R){const i=e!==null&&e.length>0?"".concat(r).concat(e):"";return"".concat(xt,"-").concat(t).concat(i,"-").concat(a)}const x=(t,a,e,r,i,n)=>{const s=e.id,y=Dt(r[s]);if(s!=="root"){let g=w;e.start===!0&&(g=at),e.start===!1&&(g=rt),e.type!==j&&(g=e.type),T[s]||(T[s]={id:s,shape:g,description:v.sanitizeText(s,S()),classes:"".concat(y," ").concat(pt)});const o=T[s];e.description&&(Array.isArray(o.description)?(o.shape=k,o.description.push(e.description)):o.description.length>0?(o.shape=k,o.description===s?o.description=[e.description]:o.description=[o.description,e.description]):(o.shape=w,o.description=e.description),o.description=v.sanitizeTextOrArray(o.description,S())),o.description.length===1&&o.shape===k&&(o.shape=w),!o.type&&e.doc&&(p.info("Setting cluster for ",s,E(e)),o.type="group",o.dir=E(e),o.shape=e.type===U?it:nt,o.classes=o.classes+" "+mt+" "+(n?$t:""));const h={labelStyle:"",shape:o.shape,labelText:o.description,classes:o.classes,style:"",id:s,dir:o.dir,domId:B(s,l),type:o.type,padding:15};if(h.centerLabel=!0,e.note){const d={labelStyle:"",shape:dt,labelText:e.note.text,classes:ut,style:"",id:s+wt+"-"+l,domId:B(s,l,W),type:o.type,padding:15},c={labelStyle:"",shape:ct,labelText:e.note.text,classes:o.classes,style:"",id:s+M,domId:B(s,l,P),type:"group",padding:0};l++;const m=s+M;t.setNode(m,c),t.setNode(d.id,d),t.setNode(s,h),t.setParent(s,m),t.setParent(d.id,m);let b=s,f=d.id;e.note.position==="left of"&&(b=d.id,f=s),t.setEdge(b,f,{arrowhead:"none",arrowType:"",style:O,labelStyle:"",classes:ht,arrowheadStyle:_,labelpos:q,labelType:F,thickness:H})}else t.setNode(s,h)}a&&a.id!=="root"&&(p.trace("Setting node ",s," to be child of its parent ",a.id),t.setParent(s,a.id)),e.doc&&(p.trace("Adding nodes children "),At(t,e,e.doc,r,i,!n))},At=(t,a,e,r,i,n)=>{p.trace("items",e),e.forEach(s=>{switch(s.stmt){case Y:x(t,a,s,r,i,n);break;case j:x(t,a,s,r,i,n);break;case X:{x(t,a,s.state1,r,i,n),x(t,a,s.state2,r,i,n);const y={id:"edge"+l,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:O,labelStyle:"",label:v.sanitizeText(s.description,S()),arrowheadStyle:_,labelpos:q,labelType:F,thickness:H,classes:I};t.setEdge(s.state1.id,s.state2.id,y,l),l++}break}})},E=(t,a=Z)=>{let e=a;if(t.doc)for(let r=0;r<t.doc.length;r++){const i=t.doc[r];i.stmt==="dir"&&(e=i.value)}return e},kt=async function(t,a,e,r){p.info("Drawing state diagram (v2)",a),T={},r.db.getDirection();const{securityLevel:i,state:n}=S(),s=n.nodeSpacing||50,y=n.rankSpacing||50;p.info(r.db.getRootDocV2()),r.db.extract(r.db.getRootDocV2()),p.info(r.db.getRootDocV2());const g=r.db.getStates(),o=new tt({multigraph:!0,compound:!0}).setGraph({rankdir:E(r.db.getRootDocV2()),nodesep:s,ranksep:y,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});x(o,void 0,r.db.getRootDocV2(),g,r.db,!0);let h;i==="sandbox"&&(h=A("#i"+a));const d=i==="sandbox"?A(h.nodes()[0].contentDocument.body):A("body"),c=d.select('[id="'.concat(a,'"]')),m=d.select("#"+a+" g");await ot(m,o,["barb"],u,a);const b=8;et.insertTitle(c,"statediagramTitleText",n.titleTopMargin,r.db.getDiagramTitle());const f=c.node().getBBox(),N=f.width+b*2,V=f.height+b*2;c.attr("class",u);const C=c.node().getBBox();st(c,V,N,n.useMaxWidth);const z="".concat(C.x-b," ").concat(C.y-b," ").concat(N," ").concat(V);p.debug("viewBox ".concat(z)),c.attr("viewBox",z);const J=document.querySelectorAll('[id="'+a+'"] .edgeLabel .label');for(const D of J){const G=D.getBBox(),$=document.createElementNS("http://www.w3.org/2000/svg",w);$.setAttribute("rx",0),$.setAttribute("ry",0),$.setAttribute("width",G.width),$.setAttribute("height",G.height),D.insertBefore($,D.firstChild)}},Bt={setConf:Tt,getClasses:St,draw:kt},Ot={parser:K,db:L,renderer:Bt,styles:Q,init:t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,L.clear()}};export{Ot as diagram};

Zerion Mini Shell 1.0