@softistx/pulsarix-widget 0.9.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -27
- package/dist/chunks/{abnfDiagram-XWFEHMT6.xef4vppv.js → abnfDiagram-XWFEHMT6.9n16jbeh.js} +1 -1
- package/dist/chunks/architecture-WOLXFQ4H.04w48nbq.js +1 -0
- package/dist/chunks/architectureDiagram-CSQXQB3N.3c7xm6kb.js +36 -0
- package/dist/chunks/{blockDiagram-BEDRHYPZ.wgdr8xfr.js → blockDiagram-BEDRHYPZ.b7d9kkgr.js} +11 -11
- package/dist/chunks/{c4Diagram-M2UUVUY5.t09pndbz.js → c4Diagram-M2UUVUY5.f883rrpb.js} +3 -3
- package/dist/chunks/{chat-markdown-CQ4fSIYN.cv3fprzq.js → chat-markdown-BSu4FB_l.ngsfz1hc.js} +29 -29
- package/dist/chunks/{classDiagram-v2-KXABOMEV.9yfjtevj.js → classDiagram-v2-KXABOMEV.6gcf0jbx.js} +8 -8
- package/dist/chunks/cose-bilkent-JH36ORCC.900yznpf.js +1 -0
- package/dist/chunks/cynefin-EF2NZ3EQ.jp3enwcw.js +1 -0
- package/dist/chunks/{cynefinDiagram-NJNITYFG.k6mhek0s.js → cynefinDiagram-NJNITYFG.7y6esx64.js} +1 -1
- package/dist/chunks/{dagre-KIHZ2IZ3.sqeg911s.js → dagre-KIHZ2IZ3.2xtjsjjb.js} +2 -2
- package/dist/chunks/{diagram-7YQZDPLS.k1qvmctj.js → diagram-7YQZDPLS.5a4btxfh.js} +2 -2
- package/dist/chunks/{diagram-QBROCOUO.v7fe7e4g.js → diagram-QBROCOUO.je55sz0f.js} +24 -24
- package/dist/chunks/{diagram-RJJCUUZO.12s15pm6.js → diagram-RJJCUUZO.19nj7yqv.js} +4 -4
- package/dist/chunks/{diagram-WERXNKYE.tmrcv4we.js → diagram-WERXNKYE.h15fxc8e.js} +2 -2
- package/dist/chunks/diagram-YHHI257C.rjb588jf.js +3 -0
- package/dist/chunks/{diagram-YR4HJLHV.nytxr7pa.js → diagram-YR4HJLHV.5cj602t4.js} +1 -1
- package/dist/chunks/{ebnfDiagram-N527522P.6eqw92nv.js → ebnfDiagram-N527522P.edah3bz7.js} +1 -1
- package/dist/chunks/editor-shortcuts-dialog-Cz3T8435.kb0b5cra.js +1 -0
- package/dist/chunks/editor.ywaw7sz9.js +4 -0
- package/dist/chunks/{elk-O5DQBFGD.a5rqryhg.js → elk-O5DQBFGD.qnxmxe5n.js} +13 -13
- package/dist/chunks/emoji-picker-00Bw2c2b.2985hrzf.js +4 -0
- package/dist/chunks/{erDiagram-K3K3BIDK.exfeddaa.js → erDiagram-K3K3BIDK.9wh4fsa9.js} +8 -8
- package/dist/chunks/eventmodeling-K75KTNOO.xt3yb4h8.js +1 -0
- package/dist/chunks/{flow-diagram-Byy7DBZZ.pf5vdbkn.js → flow-diagram-DGZOc1z1.1276ykn3.js} +6 -6
- package/dist/chunks/flowDiagram-Z6JWZHQI.3t1zqq9x.js +1 -0
- package/dist/chunks/{ganttDiagram-3PRQTZWP.0tjaeqjw.js → ganttDiagram-3PRQTZWP.4t4r8jy0.js} +5 -5
- package/dist/chunks/gitGraph-VSP46ZUC.v9e8d46n.js +1 -0
- package/dist/chunks/{gitGraphDiagram-VXDFKS5L.6vvbj88t.js → gitGraphDiagram-VXDFKS5L.x4pypqh9.js} +19 -19
- package/dist/chunks/{grid-E2QIVN74.frpdy6t3.js → grid-E2QIVN74.8njsnft0.js} +1 -1
- package/dist/chunks/illustration-BcaGDjvB.ahkxq9mz.js +1 -0
- package/dist/chunks/{index.sv013f1z.js → index.0tz15aew.js} +1 -1
- package/dist/chunks/{index.zjykrx6y.js → index.0yskyw4t.js} +4 -4
- package/dist/chunks/{index.0kv7tp87.js → index.10k18jx6.js} +2 -2
- package/dist/chunks/{index.93zpfh3k.js → index.28jrnjz5.js} +2 -2
- package/dist/chunks/{index.f6jhkm5c.js → index.2j6fty9j.js} +35 -35
- package/dist/chunks/index.3c95g5mh.js +2 -0
- package/dist/chunks/{index.d8b8y928.js → index.3y8baz7q.js} +10 -10
- package/dist/chunks/{index.7q6v461v.js → index.5n55ccv6.js} +2 -2
- package/dist/chunks/{index.yfbwd99n.js → index.5sj251kq.js} +106 -106
- package/dist/chunks/{index.3pn4wy4j.js → index.a7m06kba.js} +1 -1
- package/dist/chunks/{index.fv9af3wd.js → index.d57x7pg9.js} +6 -6
- package/dist/chunks/{index.mcyw2bze.js → index.f1bfv6bh.js} +1 -1
- package/dist/chunks/{index.xrg5yg8d.js → index.gzgeb5ax.js} +2 -2
- package/dist/chunks/{index.nrd5w1x0.js → index.mjp06b03.js} +2 -2
- package/dist/chunks/{index.a6rz456z.js → index.mtrj86e8.js} +2 -2
- package/dist/chunks/index.n53k66q8.js +2 -0
- package/dist/chunks/index.pg4f51t3.js +44 -0
- package/dist/chunks/index.q39061xn.js +2 -0
- package/dist/chunks/{index.pyz71tqx.js → index.tnx5y2zc.js} +2 -2
- package/dist/chunks/{index.nsckd1vt.js → index.yhmqh641.js} +2 -2
- package/dist/chunks/{index.kh3f3gw8.js → index.znt11tbm.js} +2 -2
- package/dist/chunks/info-OHQRW6UA.atpz16bq.js +1 -0
- package/dist/chunks/{infoDiagram-EZ3ZOAHP.qh2bwz3m.js → infoDiagram-EZ3ZOAHP.mq5603w2.js} +2 -2
- package/dist/chunks/{ishikawaDiagram-S3EKX5GW.w2v6vnwd.js → ishikawaDiagram-S3EKX5GW.sx08qj3j.js} +5 -5
- package/dist/chunks/{journeyDiagram-POQNLL5X.ftkfdsrw.js → journeyDiagram-POQNLL5X.c3e37ws5.js} +5 -5
- package/dist/chunks/{kanban-definition-BH5XI6FM.9scqhcx5.js → kanban-definition-BH5XI6FM.6b85jkvt.js} +7 -7
- package/dist/chunks/markup-color-chrome-ykGNUl8y.76asgnkk.js +1 -0
- package/dist/chunks/markup-custom-color-MM-HnrqY.de5f5c2g.js +1 -0
- package/dist/chunks/mention-list-6cR5VSPa.r7r4w0q8.js +1 -0
- package/dist/chunks/{mermaid.core.tnh468qk.js → mermaid.core.kh4z9f22.js} +7 -7
- package/dist/chunks/{mindmap-definition-WVAN44T4.gskntx1f.js → mindmap-definition-WVAN44T4.07nv313g.js} +6 -6
- package/dist/chunks/packet-JDAUHWVQ.dmnq0wwq.js +1 -0
- package/dist/chunks/panel.zcphrx3e.js +7 -0
- package/dist/chunks/{pegDiagram-D4NLKWP3.yb58dpky.js → pegDiagram-D4NLKWP3.2mqrk2xy.js} +1 -1
- package/dist/chunks/pie-XZMESJXO.0rpk8mwa.js +1 -0
- package/dist/chunks/pieDiagram-36ENHN4W.kx9bhkyj.js +39 -0
- package/dist/chunks/plated-illustration-pTqcYOQg.a24pxzgf.js +1 -0
- package/dist/chunks/{quadrantDiagram-ZQUDMS73.1a721ces.js → quadrantDiagram-ZQUDMS73.68vxq0vb.js} +4 -4
- package/dist/chunks/radar-ABXABTNO.xt7snfyy.js +1 -0
- package/dist/chunks/railroad-I3PHUGI6.bjssfxkf.js +1 -0
- package/dist/chunks/railroad-abnf-LNEFI6M7.mchc5mex.js +1 -0
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.wz1e7a1n.js +1 -0
- package/dist/chunks/railroad-peg-JR7BVNR7.xg4e4nsz.js +1 -0
- package/dist/chunks/{railroadDiagram-JIZHGYPL.xpgkt1zp.js → railroadDiagram-JIZHGYPL.dnj3h1n0.js} +1 -1
- package/dist/chunks/{render-VIF2ZAQL.khtqjmgm.js → render-VIF2ZAQL.cawqkxpf.js} +1 -1
- package/dist/chunks/{requirementDiagram-AXW2TVFA.ms6anxwg.js → requirementDiagram-AXW2TVFA.5z51j1hn.js} +4 -4
- package/dist/chunks/{sankeyDiagram-FBCJTAIF.40yzed7d.js → sankeyDiagram-FBCJTAIF.0dqdm7yd.js} +6 -6
- package/dist/chunks/{sequenceDiagram-3LA2ROMG.z0h3shw2.js → sequenceDiagram-3LA2ROMG.0fpdfwg0.js} +11 -11
- package/dist/chunks/{sizeCapture-2Q2CQKSF.4dh5g271.js → sizeCapture-2Q2CQKSF.gverqc02.js} +1 -1
- package/dist/chunks/{stateDiagram-v2-ATKHQDJO.5ftcgs8s.js → stateDiagram-v2-ATKHQDJO.56dj904f.js} +8 -8
- package/dist/chunks/{swimlanes-YQL5WMAO.r6vmskrb.js → swimlanes-YQL5WMAO.frj4npw4.js} +1 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.834hahmm.js +8 -0
- package/dist/chunks/{timeline-definition-7Z437IG3.eke70hfq.js → timeline-definition-7Z437IG3.v99ghwdb.js} +9 -9
- package/dist/chunks/treeView-D4JQ5SDB.tbqcaq5q.js +1 -0
- package/dist/chunks/treemap-SAJKECNS.jgfv37a0.js +1 -0
- package/dist/chunks/{usecaseDiagram-RDK6N6HP.d8p4tnc6.js → usecaseDiagram-RDK6N6HP.b6317ne8.js} +57 -57
- package/dist/chunks/{vennDiagram-SHRQU5PJ.4s46abxd.js → vennDiagram-SHRQU5PJ.adr331gc.js} +7 -7
- package/dist/chunks/wardley-7MLQ67FV.4653yv6a.js +1 -0
- package/dist/chunks/{wardleyDiagram-F3OXNVQS.mq49fny4.js → wardleyDiagram-F3OXNVQS.5tt3knhg.js} +4 -4
- package/dist/chunks/{xychartDiagram-GDYJKCDI.d7he0fxa.js → xychartDiagram-GDYJKCDI.dqs1thzc.js} +5 -5
- package/dist/index.js +48 -21
- package/dist/types/config.d.ts +1 -1
- package/dist/types/mount.d.ts +1 -1
- package/docs/integration.md +32 -26
- package/package.json +4 -4
- package/dist/chunks/architecture-WOLXFQ4H.pp4drcrh.js +0 -1
- package/dist/chunks/architectureDiagram-CSQXQB3N.0bddzt5e.js +0 -36
- package/dist/chunks/cose-bilkent-JH36ORCC.qam7r9b1.js +0 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.wgr8qmb2.js +0 -1
- package/dist/chunks/diagram-YHHI257C.7735ve6v.js +0 -3
- package/dist/chunks/editor-shortcuts-dialog-VmvMTjnq.mm7ab69f.js +0 -1
- package/dist/chunks/editor.wb4jsrjy.js +0 -4
- package/dist/chunks/emoji-picker-bnO0yA8e.bymgjc9a.js +0 -4
- package/dist/chunks/eventmodeling-K75KTNOO.nkahp6zg.js +0 -1
- package/dist/chunks/flowDiagram-Z6JWZHQI.54yz6gfm.js +0 -1
- package/dist/chunks/gitGraph-VSP46ZUC.2a0am491.js +0 -1
- package/dist/chunks/illustration-BfueshiW.syv54ccw.js +0 -1
- package/dist/chunks/index.bs3ygyp2.js +0 -2
- package/dist/chunks/index.newjn1k4.js +0 -2
- package/dist/chunks/index.rn0vxns6.js +0 -44
- package/dist/chunks/index.yexf86bf.js +0 -2
- package/dist/chunks/info-OHQRW6UA.4824y3cd.js +0 -1
- package/dist/chunks/markup-color-chrome-ykGNUl8y.8cysjsfb.js +0 -1
- package/dist/chunks/markup-custom-color-CytmKw-R.d25j0pcj.js +0 -1
- package/dist/chunks/mention-list-5h2lZwEU.wffam6eb.js +0 -1
- package/dist/chunks/packet-JDAUHWVQ.w0pv2dxr.js +0 -1
- package/dist/chunks/panel.dq8vt40k.js +0 -7
- package/dist/chunks/pie-XZMESJXO.zq72f2fq.js +0 -1
- package/dist/chunks/pieDiagram-36ENHN4W.7pgn8ayz.js +0 -39
- package/dist/chunks/plated-illustration-VrnsTz7H.tcyq0sxa.js +0 -1
- package/dist/chunks/radar-ABXABTNO.288gs0b8.js +0 -1
- package/dist/chunks/railroad-I3PHUGI6.aadrd13j.js +0 -1
- package/dist/chunks/railroad-abnf-LNEFI6M7.6btgmncj.js +0 -1
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.y44ppt8p.js +0 -1
- package/dist/chunks/railroad-peg-JR7BVNR7.328jgxkz.js +0 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.exhrz16x.js +0 -8
- package/dist/chunks/treeView-D4JQ5SDB.xz61fh4x.js +0 -1
- package/dist/chunks/treemap-SAJKECNS.8gv7pmqr.js +0 -1
- package/dist/chunks/wardley-7MLQ67FV.6v9j3be8.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{No,vc}from"./index.0tz15aew.js";import"./index.pg4f51t3.js";export{vc as Illustration,No as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_,
|
|
1
|
+
import{_,he,ie,Ha,H,w,r,ve,la,si,ca,Qr,Zr,Hs,Us,Uo,Ci,zl,Si,qo,jo,ba}from"./index.pg4f51t3.js";var I=Symbol("glyphs");function x(e){let t=Math.trunc(e)*2654435761>>>0||1;return()=>{t=t+1831565813|0;let a=Math.imul(t^t>>>15,1|t);return a=a+Math.imul(a^a>>>7,61|a)^a,((a^a>>>14)>>>0)/4294967296}}var P={2:[[[40,42,30],[204,50,26]],[[206,48,32],[36,138,28]],[[44,48,28],[200,104,32]]],3:[[[40,42,30],[204,50,26],[202,138,28]],[[198,38,30],[40,76,26],[192,146,26]],[[44,148,28],[198,44,30],[208,142,24]],[[38,130,30],[122,22,24],[208,104,28]],[[202,36,28],[34,100,28],[122,154,22]],[[34,56,28],[208,60,28],[120,156,22]]],4:[[[40,42,30],[204,50,26],[202,138,28],[38,140,24]],[[36,44,26],[122,24,22],[206,64,26],[204,142,26]]]},C=[7,6,4.5,4],R=[[[88,26],[172,160],[214,96],[24,92]],[[170,24],[60,160],[26,100],[220,120]],[[30,26],[210,24],[150,162],[100,164]],[[120,170],[70,26],[222,74],[18,70]]],G=(e,t,a)=>`M${e} ${t-a}Q${e} ${t} ${e+a} ${t}Q${e} ${t} ${e} ${t+a}Q${e} ${t} ${e-a} ${t}Q${e} ${t} ${e} ${t-a}Z`;function D(e){let t=e.satellites??[];if(t.length>4)throw new ve("count",`${t.length} satellites: at most 4 are drawn.`);let a=e.sparkles??4;if(!(a>=0&&a<=4))throw new ve("count",`${a} sparkles: use 0 to 4.`);let n=e.layout??0;if(!(Number.isInteger(n)&&n>=0))throw new ve("count","The layout is a whole number, 0 or more.");let s=P[Math.min(4,Math.max(2,t.length))];return{sats:t,sparkles:a,places:s[(n>>2)%s.length],sparks:R[n&3]}}var Q=64,i=(e,t,a)=>a?{tag:e,attrs:t,children:a}:{tag:e,attrs:t};function U(e,t,a,n,s,o,{styles:c,rand:d,spriteBase:m,mapIcon:p,glyphs:l}){let u=typeof e==="string"?{name:e}:e;if(!ca(u.name))throw new ve("name",`${JSON.stringify(u.name)} is not an icon name: use lowercase words joined by dashes ("graduation-cap").`);let g=l&&Object.hasOwn(l,u.name)?l[u.name]:void 0;if(g){let v=n-o/2,S=s-o/2,{d:O,detail:M}=g,L=Math.round(o/Q*1000)/1000;return i("g",{id:t,class:a},[i("rect",{class:"ic-box",fill:"none",x:v,y:S,width:o,height:o}),i("g",{transform:`translate(${v} ${S}) scale(${L})`},[i("path",{d:M,fill:"currentColor","fill-opacity":0.4}),i("path",{d:O,fill:"currentColor"})])])}let y=c[c.length>1?Math.floor(d()*c.length):0],[b]=ba({family:u.family??y.family,type:u.type??y.type}),k={name:u.name,...b},h=n-o/2,f=s-o/2;return i("g",{id:t,class:a},[i("rect",{class:"ic-box",fill:"none",x:h,y:f,width:o,height:o}),i("use",{href:si(p?p(k):k,m),x:h,y:f,width:o,height:o})])}function q(e,t){let a=(typeof e==="string"?t?.(e):e?.d)??"M124 62A62 62 0 1 1 0 62A62 62 0 1 1 124 62Z";if(!/^[\d\sMLHVCSQTAZmlhvcsqtaz.,+eE-]*$/.test(a))throw new ve("name","A plate path holds path commands and numbers only.");return a}var E={empty:["cookie-9","primary",0,"box-open","inbox","folder-open"],"no-results":["soft-burst","secondary",0,"magnifying-glass","file-circle-question","sparkles"],"not-found":["flower","tertiary",0,"compass","map","location-dot","ghost"],error:["gem","error",0,"triangle-exclamation","server","bug","gear"],offline:["clover-4","warning",0,"wifi-slash","cloud-slash","plug-circle-xmark"],success:["sunny","success",0,"circle-check","party-horn","trophy"],welcome:["squircle","primary",0,"hand-wave","rocket","lightbulb","star"],forbidden:["gem","error",2,"lock-keyhole","ban","shield-halved","key"],maintenance:["triangle","warning",20,"screwdriver-wrench","gear","helmet-safety","traffic-cone"],invitation:["flower","primary",17,"envelope-open-text","user-plus","paper-plane","handshake"],"sign-in":["squircle","tertiary",15,"door-open","key","user","lock"],"empty-inbox":["oval","secondary",4,"envelope-open","inbox","circle-check","bell"]},N=Object.keys(E);function Mo(e,{idPrefix:t,spriteBase:a=la,plates:n,mapIcon:s}){if(!/^[A-Za-z][\w-]*$/.test(t))throw new ve("name",`The id prefix ${JSON.stringify(t)} is not safe: letters, digits, "_" and "-", a letter first.`);let{sats:o,sparkles:c,places:d,sparks:m}=D(e),p=ba(e.iconStyle),l=x(e.seed??0),u=(h)=>`${t}-${h}`,g=(h,f,v,S,O,M)=>U(h,u(f),v,S,O,M,{styles:p,rand:l,spriteBase:a,mapIcon:s,glyphs:e.glyphs}),y=B(u("plate"),q(e.plate,n)),b=o.flatMap((h,f)=>{let[v,S,O]=d[f];return[i("circle",{class:`ill-satbg ill-s${f}`,cx:v,cy:S,r:Math.round(O*78)/100}),g(h,`sat${f}`,`ill-sat ill-s${f}`,v,S,O)]}),k=g(e.hero,"hero","ill-hero",120,90,76);return i("svg",{id:u("root"),class:`ill ill-${e.tone??"primary"} ill-duo-${e.duotone??"opacity"}`,viewBox:"0 0 240 180",preserveAspectRatio:"xMidYMid meet","aria-hidden":"true",focusable:"false"},[...y,...b,k,...J(m,c)])}var B=(e,t)=>[i("g",{transform:"translate(58 28)"},[i("path",{id:e,class:"ill-plate",d:t})]),i("circle",{class:"ill-ring",cx:120,cy:90,r:74,fill:"none","stroke-dasharray":"2 5"})],J=(e,t)=>Array.from({length:t},(a,n)=>{let[s,o]=e[n];return i("path",{class:`ill-spark ill-k${n%2}`,d:G(s,o,C[n])})});function A(e,t={},a=E){if(!Object.hasOwn(a,e))throw new ve("name",`${JSON.stringify(e)} is not a scene of the table: use one of its ids.`);let[n,s,o,c,...d]=a[e],m=a[I];return{hero:c,satellites:d,plate:n,tone:s,layout:o,...m?{glyphs:m}:{},...t}}var Y=/^(aria|data)-/,Z=(e)=>e==="class"?"className":Y.test(e)?e:e.replace(/-([a-z])/g,(t,a)=>a.toUpperCase()),No=Ha(function e({node:t}){let a=Object.fromEntries(Object.entries(t.attrs).map(([n,s])=>[Z(n),s]));return ie(t.tag,a,...(t.children??[]).map((n,s)=>r(e,{node:n},s)))});function K(e,t,a){let n=Uo(),s=a??(V(e)?void 0:zl(n,e)),o=Hs(),c=Us(),d=`ill${H().replace(/[^\w-]/g,"-")}`,m=JSON.stringify([t,Ci(n,e),n?.iconStyle]);return{built:w(()=>{let p=Object.fromEntries(Object.entries(t).filter(([,l])=>l!==void 0));try{let l=A(e,{...n?.iconStyle===void 0?{}:{iconStyle:n.iconStyle},...Ci(n,e),...p},s);return{spec:l,flat:Mo(l,{idPrefix:d,spriteBase:o,...c==="free"?{mapIcon:Qr}:{}})}}catch(l){if(!(l instanceof ve))throw l;return F(`Illustration: ${l.message} Drawing the built-in art instead.`),null}},[e,s,m,d,o,c]),idPrefix:d,base:o,edition:c}}var j=new Set;function F(e){Zr()||j.has(e)||(j.add(e),console.warn(e))}var V=(e)=>N.includes(e);function T({kind:e}){return r(Si,{kind:e,"data-fallback":"",className:"h-full w-full"})}var X=qo("plated-illustration",async()=>(await (_("a24pxzgf"),import("./plated-illustration-pTqcYOQg.a24pxzgf.js"))).default,T);function vc({scene:e,scenes:t,size:a="md",title:n,animated:s,monochrome:o,hero:c,satellites:d,iconStyle:m,tone:p,duotone:l,className:u,...g}){let y=jo[e]??"empty",{built:b,idPrefix:k,base:h,edition:f}=K(e,{hero:c,satellites:d,iconStyle:m,tone:p,duotone:l},t);return r("div",{"data-slot":"illustration",...g,...n?{role:"img","aria-label":n}:{"aria-hidden":!0},"data-scene":e,"data-size":a,"data-animated":s?"":void 0,"data-monochrome":o?"":void 0,className:u,children:b?r(he,{fallback:r(No,{node:b.flat}),children:r(X,{spec:b.spec,idPrefix:k,base:h,edition:f,kind:y})}):r(T,{kind:y})})}export{Mo,No,vc};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{e,n,
|
|
2
|
-
`),n.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),ee=e(()=>D,"getAccDescription"),te=
|
|
1
|
+
import{e,n,Ie,k,q,j,A,u,X}from"./index.5sj251kq.js";var M="",O="",D="",E=[],b=new Map,S=e((t)=>q(t,u()),"sanitizeText"),R=e((t)=>{switch(t.type){case"terminal":return{...t,value:S(t.value)};case"nonterminal":return{...t,name:S(t.name)};case"sequence":return{...t,elements:t.elements.map(R)};case"choice":return{...t,alternatives:t.alternatives.map(R)};case"optional":return{...t,element:R(t.element)};case"repetition":return{...t,element:R(t.element),separator:t.separator?R(t.separator):void 0};case"special":return{...t,text:S(t.text)}}},"sanitizeAstNode"),G=e(()=>{M="",O="",D="",E.length=0,b.clear(),A(),n.debug("[Railroad] Database cleared")},"clear"),Y=e((t)=>{M=S(t),n.debug("[Railroad] Title set:",t)},"setTitle"),P=e(()=>M,"getTitle"),U=e((t)=>{let a={...t,name:S(t.name),definition:R(t.definition),comment:t.comment?S(t.comment):void 0};if(n.debug("[Railroad] Adding rule:",a.name),b.has(a.name))n.warn(`[Railroad] Rule '${a.name}' is already defined. Overwriting.`);E.push(a),b.set(a.name,a)},"addRule"),K=e(()=>E,"getRules"),J=e((t)=>b.get(t),"getRule"),Q=e((t)=>{O=S(t).replace(/^\s+/g,""),n.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Z=e(()=>O,"getAccTitle"),V=e((t)=>{D=S(t).replace(/\n\s+/g,`
|
|
2
|
+
`),n.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),ee=e(()=>D,"getAccDescription"),te=Y,re=P,se={clear:G,setTitle:Y,getTitle:P,addRule:U,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},T={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ie=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ne=/^[\w "',.-]+$/,ae=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=e((t)=>{if(!t)return!1;return Object.keys(t).every((a)=>a==="railroad"||ae.has(a))},"isRailroadStyleOptions"),oe=e((t)=>{if(!t)return{};if("railroad"in t&&t.railroad)return t.railroad;return L(t)?t:{}},"extractRailroadOverrides"),le=e((t)=>{if(!t||L(t))return{};let{railroad:a,svgId:l,theme:i,look:r,...o}=t;return o},"extractThemeOverrides"),p=e((t,a)=>{if(typeof t!=="string")return a;let l=t.trim();return ie.test(l)?l:a},"sanitizeColorValue"),I=e((t,a)=>{if(typeof t!=="string")return a;let l=t.trim();return ne.test(l)?l:a},"sanitizeFontFamilyValue"),y=e((t,a)=>{let l=typeof t==="number"?t:typeof t==="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(l)&&l>=0?l:a},"sanitizeNumberValue"),de=e((t)=>{let a=typeof t==="number"?t:typeof t==="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(a)&&a>0?a:void 0},"parseThemeFontSize"),ce=e((t)=>{let a=I(t.fontFamily,T.fontFamily),l=de(t.fontSize)??T.fontSize;return{...T,fontFamily:a,fontSize:l,terminalFill:p(t.secondBkg??t.secondaryColor,T.terminalFill),terminalStroke:p(t.secondaryBorderColor??t.lineColor,T.terminalStroke),terminalTextColor:p(t.secondaryTextColor??t.textColor,T.terminalTextColor),nonTerminalFill:p(t.mainBkg??t.background,T.nonTerminalFill),nonTerminalStroke:p(t.primaryBorderColor??t.lineColor,T.nonTerminalStroke),nonTerminalTextColor:p(t.primaryTextColor??t.textColor,T.nonTerminalTextColor),lineColor:p(t.lineColor,T.lineColor),markerFill:p(t.lineColor,T.markerFill),commentFill:p(t.labelBackground??t.tertiaryColor,T.commentFill),commentStroke:p(t.tertiaryBorderColor??t.lineColor,T.commentStroke),commentTextColor:p(t.tertiaryTextColor??t.textColor,T.commentTextColor),specialFill:p(t.tertiaryColor??t.secondaryColor,T.specialFill),specialStroke:p(t.tertiaryBorderColor??t.secondaryBorderColor,T.specialStroke),ruleNameColor:p(t.titleColor??t.textColor,T.ruleNameColor)}},"buildThemeDefaults"),W=e((t)=>{let a=k(),l={...Ie(),...a.themeVariables??{},...le(t)},i=ce(l),r={...a.railroad??{},...oe(t)};return{compactMode:r.compactMode??i.compactMode,padding:y(r.padding,i.padding),verticalSeparation:y(r.verticalSeparation,i.verticalSeparation),horizontalSeparation:y(r.horizontalSeparation,i.horizontalSeparation),arcRadius:y(r.arcRadius,i.arcRadius),fontSize:y(r.fontSize,i.fontSize),fontFamily:I(r.fontFamily,i.fontFamily),terminalFill:p(r.terminalFill,i.terminalFill),terminalStroke:p(r.terminalStroke,i.terminalStroke),terminalTextColor:p(r.terminalTextColor,i.terminalTextColor),nonTerminalFill:p(r.nonTerminalFill,i.nonTerminalFill),nonTerminalStroke:p(r.nonTerminalStroke,i.nonTerminalStroke),nonTerminalTextColor:p(r.nonTerminalTextColor,i.nonTerminalTextColor),lineColor:p(r.lineColor,i.lineColor),strokeWidth:y(r.strokeWidth,i.strokeWidth),markerFill:p(r.markerFill,i.markerFill),commentFill:p(r.commentFill,i.commentFill),commentStroke:p(r.commentStroke,i.commentStroke),commentTextColor:p(r.commentTextColor,i.commentTextColor),specialFill:p(r.specialFill,i.specialFill),specialStroke:p(r.specialStroke,i.specialStroke),ruleNameColor:p(r.ruleNameColor,i.ruleNameColor),showMarkers:r.showMarkers??i.showMarkers,markerRadius:y(r.markerRadius,i.markerRadius)}},"buildRailroadStyleOptions"),qt=e((t)=>{let{fontFamily:a,fontSize:l,terminalFill:i,terminalStroke:r,terminalTextColor:o,nonTerminalFill:g,nonTerminalStroke:c,nonTerminalTextColor:s,lineColor:f,strokeWidth:h,markerFill:m,commentFill:C,commentStroke:d,commentTextColor:x,specialFill:z,specialStroke:F,ruleNameColor:v}=W(t);return`
|
|
3
3
|
.railroad-diagram {
|
|
4
4
|
font-family: ${a};
|
|
5
5
|
font-size: ${l}px;
|
|
@@ -85,5 +85,5 @@ import{e,n,Me,k,q,j,A,u,Y}from"./index.yfbwd99n.js";var M="",O="",D="",E=[],b=ne
|
|
|
85
85
|
/* Grouping container, no specific styles */
|
|
86
86
|
}
|
|
87
87
|
`},"getStyles"),w=class{constructor(){this.d=""}static{e(this,"PathBuilder")}moveTo(t,a){return this.d+=`M ${t} ${a} `,this}lineTo(t,a){return this.d+=`L ${t} ${a} `,this}horizontalTo(t){return this.d+=`H ${t} `,this}verticalTo(t){return this.d+=`V ${t} `,this}arcTo(t,a,l,i,r,o,g){return this.d+=`A ${t} ${a} ${l} ${i?1:0} ${r?1:0} ${o} ${g} `,this}build(){return this.d.trim()}},me=class{constructor(t,a=W()){this.textCache=new Map,this.svg=t,this.config=a}static{e(this,"RailroadRenderer")}measureText(t){if(this.textCache.has(t))return this.textCache.get(t);let a=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(t),l=a.node().getBBox(),i={width:l.width,height:l.height};return a.remove(),this.textCache.set(t,i),i}renderTerminal(t,a){let l=this.measureText(a),i=l.width+this.config.padding*2,r=l.height+this.config.padding*2,o=t.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r).attr("rx",10).attr("ry",10),o.append("text").attr("x",i/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:i,height:r,up:r/2,down:r/2}}}renderNonTerminal(t,a){let l=this.measureText(a),i=l.width+this.config.padding*2,r=l.height+this.config.padding*2,o=t.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r),o.append("text").attr("x",i/2).attr("y",r/2).text(a),{element:o.node(),dimensions:{width:i,height:r,up:r/2,down:r/2}}}renderSequence(t,a){let l=a.map((s)=>this.renderExpression(t,s)),i=0,r=0,o=0;for(let s of l)i+=s.dimensions.width,r=Math.max(r,s.dimensions.up),o=Math.max(o,s.dimensions.down);i+=(l.length-1)*this.config.horizontalSeparation;let g=t.append("g").attr("class","railroad-sequence"),c=0;for(let s=0;s<l.length;s++){let f=l[s],h=r-f.dimensions.up;if(g.node().appendChild(f.element).setAttribute("transform",`translate(${c}, ${h})`),s<l.length-1){let C=c+f.dimensions.width,d=C+this.config.horizontalSeparation,x=r;g.append("path").attr("class","railroad-line").attr("d",new w().moveTo(C,x).lineTo(d,x).build())}c+=f.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:i,height:r+o,up:r,down:o}}}renderChoice(t,a){let l=a.map((m)=>this.renderExpression(t,m)),i=0,r=0;for(let m of l)i=Math.max(i,m.dimensions.width),r+=m.dimensions.height;r+=(l.length-1)*this.config.verticalSeparation;let o=this.config.arcRadius,g=o*4,c=i+g,s=t.append("g").attr("class","railroad-choice"),f=0,h=r/2;for(let m of l){let C=f,d=C+m.dimensions.up,x=o*2+(i-m.dimensions.width)/2;s.node().appendChild(m.element).setAttribute("transform",`translate(${x}, ${C})`);let F=new w,v=d>h;if(d===h)F.moveTo(0,h).lineTo(x,d);else F.moveTo(0,h).arcTo(o,o,0,!1,v,o,h+(v?o:-o)).lineTo(o,d-(v?o:-o)).arcTo(o,o,0,!1,!v,o*2,d).lineTo(x,d);s.append("path").attr("class","railroad-line").attr("d",F.build());let N=new w,_=x+m.dimensions.width,H=c-o*2;if(d===h)N.moveTo(_,d).lineTo(c,h);else N.moveTo(_,d).lineTo(H,d).arcTo(o,o,0,!1,!v,c-o,d+(v?-o:o)).lineTo(c-o,h+(v?o:-o)).arcTo(o,o,0,!1,v,c,h);s.append("path").attr("class","railroad-line").attr("d",N.build()),f+=m.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:c,height:r,up:h,down:r-h}}}renderOptional(t,a){let l=this.renderExpression(t,a),i=this.config.arcRadius,r=i*2,o=l.dimensions.width+i*4,g=l.dimensions.height+r,c=t.append("g").attr("class","railroad-optional"),s=i*2,f=r;c.node().appendChild(l.element).setAttribute("transform",`translate(${s}, ${f})`);let m=f+l.dimensions.up,C=new w().moveTo(0,m).lineTo(i*2,m);c.append("path").attr("class","railroad-line").attr("d",C.build());let d=new w().moveTo(s+l.dimensions.width,m).lineTo(o,m);c.append("path").attr("class","railroad-line").attr("d",d.build());let x=new w().moveTo(0,m).arcTo(i,i,0,!1,!1,i,m-i).lineTo(i,i).arcTo(i,i,0,!1,!0,i*2,0).lineTo(o-i*2,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,m-i).arcTo(i,i,0,!1,!1,o,m);return c.append("path").attr("class","railroad-line").attr("d",x.build()),{element:c.node(),dimensions:{width:o,height:g,up:m,down:g-m}}}renderRepetition(t,a,l){let i=this.renderExpression(t,a),r=this.config.arcRadius,o=r*2,g=i.dimensions.width+r*4,c=l===0,s=i.dimensions.height+o+(c?o:0),f=t.append("g").attr("class","railroad-repetition"),h=r*2,m=c?o:0;f.node().appendChild(i.element).setAttribute("transform",`translate(${h}, ${m})`);let d=m+i.dimensions.up;f.append("path").attr("class","railroad-line").attr("d",new w().moveTo(0,d).lineTo(r*2,d).build()),f.append("path").attr("class","railroad-line").attr("d",new w().moveTo(h+i.dimensions.width,d).lineTo(g,d).build());let x=m+i.dimensions.height+r,z=new w().moveTo(h+i.dimensions.width,d).arcTo(r,r,0,!1,!0,h+i.dimensions.width+r,d+r).lineTo(h+i.dimensions.width+r,x).arcTo(r,r,0,!1,!0,h+i.dimensions.width,x+r).lineTo(r*2,x+r).arcTo(r,r,0,!1,!0,r,x).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(f.append("path").attr("class","railroad-line").attr("d",z.build()),c){let F=new w().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(g-r*2,0).arcTo(r,r,0,!1,!0,g-r,r).lineTo(g-r,d-r).arcTo(r,r,0,!1,!1,g,d);f.append("path").attr("class","railroad-line").attr("d",F.build())}return{element:f.node(),dimensions:{width:g,height:s,up:d,down:s-d}}}renderSpecial(t,a){let l=this.measureText("? "+a+" ?"),i=l.width+this.config.padding*2,r=l.height+this.config.padding*2,o=t.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",r),o.append("text").attr("x",i/2).attr("y",r/2).text("? "+a+" ?"),{element:o.node(),dimensions:{width:i,height:r,up:r/2,down:r/2}}}renderExpression(t,a){switch(a.type){case"terminal":return this.renderTerminal(t,a.value);case"nonterminal":return this.renderNonTerminal(t,a.name);case"sequence":return this.renderSequence(t,a.elements);case"choice":return this.renderChoice(t,a.alternatives);case"optional":return this.renderOptional(t,a.element);case"repetition":return this.renderRepetition(t,a.element,a.min);case"special":return this.renderSpecial(t,a.text);default:throw Error(`Unknown node type: ${a.type}`)}}renderRule(t,a){let l=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${a})`),i=t.name+" =",r=this.measureText(i).width+20,o=r+20,g=l.append("g"),c=this.renderExpression(g,t.definition),s=Math.max(20,c.dimensions.up),f=s-c.dimensions.up;return g.attr("transform",`translate(${o}, ${f})`),l.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(i),l.append("g").attr("class","railroad-start").append("circle").attr("cx",r).attr("cy",s).attr("r",this.config.markerRadius),l.append("g").attr("class","railroad-end").append("circle").attr("cx",o+c.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),l.append("path").attr("class","railroad-line").attr("d",new w().moveTo(r+this.config.markerRadius,s).lineTo(o,s).build()),l.append("path").attr("class","railroad-line").attr("d",new w().moveTo(o+c.dimensions.width,s).lineTo(o+c.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,f+c.dimensions.height+this.config.padding*2),width:o+c.dimensions.width+10+this.config.markerRadius}}renderDiagram(t){let a=this.config.padding,l=0;for(let i of t){let r=this.renderRule(i,a);a+=r.height+this.config.verticalSeparation,l=Math.max(l,r.width)}return{width:l+this.config.padding*2,height:a+this.config.padding}}},B=e((t,a,l)=>{j(t,a.height,a.width,l),t.attr("viewBox",`0 0 ${a.width} ${a.height}`)},"configureRailroadSvgSize"),he=e((t,a,l)=>{n.debug(`[Railroad] Rendering diagram
|
|
88
|
-
`+t);try{let i=
|
|
89
|
-
export{
|
|
88
|
+
`+t);try{let i=X(a);i.attr("class","railroad-diagram");let o=k().railroad?.useMaxWidth??!0,g=se.getRules();if(n.debug(`[Railroad] Rendering ${g.length} rules`),g.length===0){n.warn("[Railroad] No rules to render"),B(i,{height:100,width:200},o);return}let s=new me(i,W()).renderDiagram(g);B(i,s,o),n.debug("[Railroad] Render complete")}catch(i){throw n.error("[Railroad] Render error:",i),i}},"draw"),jt={draw:he};
|
|
89
|
+
export{se,qt,jt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e,
|
|
2
|
-
export{Mt
|
|
1
|
+
import{e,xe,Xr}from"./index.5sj251kq.js";var O=0.00001,X=2,Y=0.6;function Rt(t){if(t===!1)return!1;return t==="gap"?"gap":"arc"}e(Rt,"normalizeLineHops");var w=0.000001;function P(t){let n=[];for(let c=0;c<t.length-1;c++)n.push({a:t[c],b:t[c+1]});return n}e(P,"buildSegmentList");function v(t,n,c,a){let i=n.x-t.x,r=n.y-t.y,d=a.x-c.x,l=a.y-c.y,p=i*l-r*d;if(p===0)return null;let s=c.x-t.x,o=c.y-t.y,u=(s*l-o*d)/p,f=(s*r-o*i)/p;if(u<=w||u>=1-w||f<=w||f>=1-w)return null;return{point:{x:t.x+u*i,y:t.y+u*r},tA:u,tB:f}}e(v,"segmentIntersection");function N(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}e(N,"isHorizontalSeg");function B(t,n,c){if(t.curve!=="rounded")return!1;let a=t.points,i=a[n],r=a[n+1];if(!i||!r)return!1;let d=Math.hypot(r.x-i.x,r.y-i.y),l=c*d,p=Xr(t.cornerRadius),s=n>0?R(a[n-1],i,r,p):null;if(s&&l<s.cutLen)return!0;let o=n+2<a.length?R(i,r,a[n+2],p):null;return o!==null&&d-l<o.cutLen}e(B,"crossingSitsInRoundedCorner");function C(t){let n=[];for(let c=0;c<t.length;c++){let a=t[c],i=P(a.points);for(let r=c+1;r<t.length;r++){let d=t[r],l=P(d.points);for(let[p,s]of i.entries())for(let[o,u]of l.entries()){let f=v(s.a,s.b,u.a,u.b);if(!f)continue;if(B(a,p,f.tA)||B(d,o,f.tB))continue;let y=N(s),E=N(u);if(y!==E?y:!1)n.push({jumpEdgeId:a.id,otherEdgeId:d.id,segIndex:p,t:f.tA,point:f.point});else n.push({jumpEdgeId:d.id,otherEdgeId:a.id,segIndex:o,t:f.tB,point:f.point})}}}return n}e(C,"findEdgeIntersections");function b(t){let n=Math.round(t*1000)/1000;return Number.isInteger(n)?`${n}`:`${n}`}e(b,"fmt");function I(t){return`${b(t.x)},${b(t.y)}`}e(I,"pointToString");function H(t){let n=t.b.x-t.a.x,c=t.b.y-t.a.y;if(Math.abs(n)>=Math.abs(c))return n>=0?1:0;return c>=0?1:0}e(H,"getArcSweepFlag");function _(t,n){if(t.length<2)return t.map((r)=>({...r}));let c=t.map((r)=>({...r})),a=n.arrowTypeStart&&xe[n.arrowTypeStart];if(a){let r=t[0],d=t[1],l=Math.atan2(d.y-r.y,d.x-r.x);c[0].x=r.x+a*Math.cos(l),c[0].y=r.y+a*Math.sin(l)}let i=n.arrowTypeEnd&&xe[n.arrowTypeEnd];if(i){let r=t.length,d=t[r-2],l=t[r-1],p=Math.atan2(l.y-d.y,l.x-d.x);c[r-1].x=l.x-i*Math.cos(p),c[r-1].y=l.y-i*Math.sin(p)}return c}e(_,"applyMarkerOffsets");function D(t,n,c,a,i){let r=t.point.x,d=t.point.y,l={x:r-n*t.r,y:d-c*t.r},p={x:r+n*t.r,y:d+c*t.r},s=[`L${I(l)}`];if(i==="arc")s.push(`A${b(t.r)},${b(t.r)} 0 0 ${a} ${I(p)}`);else s.push(`M${I(p)}`);return s}e(D,"emitJump");function R(t,n,c,a){let i=n.x-t.x,r=n.y-t.y,d=c.x-n.x,l=c.y-n.y,p=Math.hypot(i,r),s=Math.hypot(d,l);if(p<O||s<O)return null;let o=i/p,u=r/p,f=d/s,y=l/s,E=o*f+u*y,S=Math.max(-1,Math.min(1,E)),M=Math.acos(S);if(M<O||Math.abs(Math.PI-M)<O)return null;let g=Math.min(a/Math.sin(M/2),p/2,s/2);return{startX:n.x-o*g,startY:n.y-u*g,endX:n.x+f*g,endY:n.y+y*g,ctrlX:n.x,ctrlY:n.y,cutLen:g}}e(R,"computeRoundedCorner");function k(t,n,c){let a=t.points;if(a.length<2)return"";let i=_(a,t),r=t.curve==="rounded",d=Xr(t.cornerRadius),l=P(i),p=new Map;for(let o of n){let u=l[o.segIndex];if(!u)continue;let f=Math.hypot(u.b.x-u.a.x,u.b.y-u.a.y),y=p.get(o.segIndex)??[];y.push({t:o.t,point:o.point,d:o.t*f,r:c.jumpRadius}),p.set(o.segIndex,y)}let s=[`M${I(i[0])}`];for(let o=0;o<l.length;o++){let u=l[o],f=Math.hypot(u.b.x-u.a.x,u.b.y-u.a.y),y=f===0?0:(u.b.x-u.a.x)/f,E=f===0?0:(u.b.y-u.a.y)/f,S=H(u),M=0;if(r&&o>0){let h=R(i[o-1],i[o],i[o+1]??i[o],d);if(h)M=h.cutLen}let g=f,m=null;if(r&&o<l.length-1){if(m=R(i[o],i[o+1],i[o+2]??i[o+1],d),m)g=f-m.cutLen}let A=c.jumpRadius*Y,x=[...p.get(o)??[]].sort((h,L)=>h.t-L.t).filter((h)=>{let L=Math.min(h.d-M,g-h.d)-X;return h.r=Math.min(h.r,L),h.r>=A});for(let h=0;h<x.length-1;h++){let L=x[h+1].d-x[h].d;if(x[h].r+x[h+1].r>L){let T=L/2;x[h].r=Math.min(x[h].r,T),x[h+1].r=Math.min(x[h+1].r,T)}}for(let h of x){if(h.r<A)continue;s.push(...D(h,y,E,S,c.jumpStyle))}if(r&&m)s.push(`L${b(m.startX)},${b(m.startY)}`),s.push(`Q${b(m.ctrlX)},${b(m.ctrlY)} ${b(m.endX)},${b(m.endY)}`);else s.push(`L${I(u.b)}`)}return s.join(" ")}e(k,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}e(J,"isStraightPath");function j(t){if(!t)return!0;return t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter"}e(j,"curveSupportsLineHops");function z(t){if(!t)return null;try{let n=typeof atob==="function"?atob(t):Buffer.from(t,"base64").toString(),c=JSON.parse(n);if(!Array.isArray(c))return null;let a=[];for(let i of c)if(i&&typeof i.x==="number"&&typeof i.y==="number")a.push({x:i.x,y:i.y});return a.length>=2?a:null}catch{return null}}e(z,"decodeDataPoints");function Mt(t,n,c){if(!c.enabled)return;let a=t.node();if(!a)return;let i=new Map;for(let s of n)i.set(s.id,s);let r=new Map;for(let s of a.querySelectorAll("path[data-id]")){let o=s.getAttribute("data-id");if(o!==null&&!r.has(o))r.set(o,s)}let d=[];for(let s of n){let o=r.get(s.id);if(!o)continue;let f=z(o.getAttribute("data-points"))??s.points;d.push({...s,points:f})}let l=C(d);if(l.length===0)return;let p=new Map;for(let s of l){let o=p.get(s.jumpEdgeId)??[];o.push(s),p.set(s.jumpEdgeId,o)}for(let s of d){let o=p.get(s.id);if(!o||o.length===0)continue;let f=i.get(s.id)?.curve;if(f!==void 0&&!j(f))continue;let y=r.get(s.id);if(!y)continue;if(f===void 0){let A=y.getAttribute("d")??"";if(!J(A))continue}let E=y.getAttribute("style")??"",S=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(E),M=S?Number.parseFloat(S[1]):null,g=S?Number.parseFloat(S[2]):null,m=k(s,o,c);if(y.setAttribute("d",m),M!==null&&g!==null&&typeof y.getTotalLength==="function"){let A=y.getTotalLength(),x=Math.max(0,A-M-g),h=`0 ${M} ${x} ${g}`,L=E.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${h};`).replace(/;\s*;+/g,";");y.setAttribute("style",L)}}}e(Mt,"applyLineJumpsToSvg");
|
|
2
|
+
export{Rt,Mt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e,n,k,u,z,
|
|
2
|
-
export{
|
|
1
|
+
import{e,n,k,u,F,z,Pt,Bt,Tl,Ct,mr,Cl,vn,ze,Sl,_s,Ft,Ls,gr,xn}from"./index.5sj251kq.js";import{le}from"./index.n53k66q8.js";import{_}from"./index.pg4f51t3.js";function Mi(t,{edgePathsClass:s="edges edgePaths"}={}){let r=t.insert("g").attr("class","root"),o=r.insert("g").attr("class","clusters"),i=r.insert("g").attr("class",s),a=r.insert("g").attr("class","edgeLabels"),l=r.insert("g").attr("class","nodes");return{clusters:o,edgePaths:i,edgeLabels:a,nodes:l,rootGroups:r}}e(Mi,"createLayoutElementGroups");async function L(t,s,r){if(s.label){let{shapeSvg:o,bbox:i}=await z(t,r===void 0?s:{...s,width:r});s.labelBBox={width:i.width,height:i.height},o.remove()}else s.labelBBox={width:0,height:0}}e(L,"measureGroupLabel");async function Ni(t,s,r){let o=await Bt(t,s,r),i=o.node()?.getBBox()??{width:0,height:0};return s.width=i.width,s.height=i.height,o}e(Ni,"insertMeasuredNode");function x(t,s,r){let o=t,i=new Set;while(o){if(o.dir)return o.dir;if(!o.parentId||i.has(o.parentId))break;i.add(o.parentId),o=s.get(o.parentId)}return r}e(x,"resolveNodeDir");async function D(t,s,r={}){let o=new le({multigraph:!0,compound:!0}),i=[...s.edges],a=u(),l=Mi(t),{edgeLabels:d,nodes:c}=l,g=new Map,b=new Map(s.nodes.map((f)=>[f.id,f])),E=s.direction,h=t.node()!=null;await Promise.all(s.nodes.map(async(f)=>{if(f.isGroup){if(h){let w=r.unwrapGroupLabels&&f.labelType!=="markdown";await L(c,f,w?Number.POSITIVE_INFINITY:void 0)}o.setNode(f.id,{...f})}else{if(h){let w=await Ni(c,f,{config:a,dir:x(f,b,E)});g.set(f.id,w)}o.setNode(f.id,{...f})}}));for(let f of i){if(h&&_s(f))await Ft(d,f);if(o.setEdge(f.start,f.end,{...f},f.id),!s.edges.some((v)=>v.id===f.id))s.edges.push(f)}if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:f}=await (_("gverqc02"),import("./sizeCapture-2Q2CQKSF.gverqc02.js"));f(t,s)}return{graph:o,groups:l,nodeElements:g}}e(D,"createGraphWithElements");var Z=new Map,m=new Map,S=new Map,q=e(()=>{m.clear(),S.clear(),Z.clear()},"clear"),p=e((t,s)=>{let r=m.get(s)||[];return n.trace("In isDescendant",s," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),K=e((t,s)=>{let r=m.get(s)||[];if(n.info("Descendants of ",s," is ",r),n.info("Edge is ",t),t.v===s||t.w===s)return!1;if(!r)return n.debug("Tilt, ",s,",not in descendants"),!1;return r.includes(t.v)||p(t.v,s)||p(t.w,s)||r.includes(t.w)},"edgeInCluster"),R=e((t,s,r,o)=>{n.debug("Copying children of ",t,"root",o,"data",s.node(t),o);let i=s.children(t)||[];if(t!==o)i.push(t);n.debug("Copying (nodes) clusterId",t,"nodes",i),i.forEach((a)=>{if(s.children(a).length>0)R(a,s,r,o);else{let l=s.node(a);if(n.info("cp ",a," to ",o," with parent ",t),r.setNode(a,l),o!==s.parent(a))n.debug("Setting parent",a,s.parent(a)),r.setParent(a,s.parent(a));if(t!==o&&a!==t)n.debug("Setting parent",a,t),r.setParent(a,t);else n.info("In copy ",t,"root",o,"data",s.node(t),o),n.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==o,"node!==clusterId",a!==t);let d=s.edges(a);n.debug("Copying Edges",d),d.forEach((c)=>{n.info("Edge",c);let g=s.edge(c.v,c.w,c.name);n.info("Edge data",g,o);try{if(K(c,o))n.info("Copying as ",c.v,c.w,g,c.name),r.setEdge(c.v,c.w,g,c.name),n.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else n.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",o," clusterId:",t)}catch(b){n.error(b)}})}n.debug("Removing node",a),s.removeNode(a)})},"copy"),T=e((t,s)=>{let r=s.children(t),o=[...r];for(let i of r)S.set(i,t),o=[...o,...T(i,s)];return o},"extractDescendants"),Q=e((t,s,r)=>{let o=t.edges().filter((c)=>c.v===s||c.w===s),i=t.edges().filter((c)=>c.v===r||c.w===r),a=o.map((c)=>({v:c.v===s?r:c.v,w:c.w===s?s:c.w})),l=i.map((c)=>({v:c.v,w:c.w}));return a.filter((c)=>l.some((g)=>c.v===g.v&&c.w===g.w))},"findCommonEdges"),dn=e((t,s,r)=>{let o=s.children(t);if(n.trace("Searching children of id ",t,o),o.length<1)return t;let i;for(let a of o){let l=dn(a,s,r),d=Q(s,r,l);if(l)if(d.length>0)i=l;else return l}return i},"findNonClusterChild"),y=e((t)=>{if(!Z.has(t))return t;if(!Z.get(t).externalConnections)return t;if(Z.has(t))return Z.get(t).id;return t},"getAnchorId"),ul=e((t,s)=>{if(!t||s>10){n.debug("Opting out, no graph ");return}else n.debug("Opting in, graph ");t.nodes().forEach(function(r){if(t.children(r).length>0)n.debug("Cluster identified",r," Replacement id in edges: ",dn(r,t,r)),m.set(r,T(r,t)),Z.set(r,{id:dn(r,t,r),clusterData:t.node(r)})}),t.nodes().forEach(function(r){let o=t.children(r),i=t.edges();if(o.length>0)n.debug("Cluster identified",r,m),i.forEach((a)=>{let l=p(a.v,r),d=p(a.w,r);if(l^d)n.debug("Edge: ",a," leaves cluster ",r),n.debug("Descendants of XXX ",r,": ",m.get(r)),Z.get(r).externalConnections=!0});else n.debug("Not a cluster ",r,m)});for(let r of Z.keys()){let o=Z.get(r).id,i=t.parent(o);if(i!==r&&Z.has(i)&&!Z.get(i).externalConnections)Z.get(r).id=i;let a=t.edges().some((l)=>l.v===r);if(o&&Z.get(r)?.externalConnections&&a&&M(t,o,r)){let l=U(t,r,t.parent(o));if(l)Z.get(r).id=l}}t.edges().forEach(function(r){let o=t.edge(r);n.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),n.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let{v:i,w:a}=r;if(n.debug("Fix XXX",Z,"ids:",r.v,r.w,"Translating: ",Z.get(r.v)," --- ",Z.get(r.w)),Z.get(r.v)||Z.get(r.w)){if(n.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),i=y(r.v),a=y(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){let l=t.parent(i);Z.get(l).externalConnections=!0,o.fromCluster=r.v}if(a!==r.w){let l=t.parent(a);Z.get(l).externalConnections=!0,o.toCluster=r.w}n.debug("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,o,r.name)}}),P(t,0),n.trace(Z)},"adjustClustersAndEdges"),P=e((t,s)=>{if(s>10){n.error("Bailing out");return}let r=t.nodes(),o=!1;for(let i of r){let a=t.children(i);o=o||a.length>0}if(!o){n.debug("Done, no node has children",t.nodes());return}n.debug("Nodes = ",r,s);for(let i of r)if(n.debug("Extracting node",i,Z,Z.has(i)&&!Z.get(i).externalConnections,!t.parent(i),t.node(i),t.children("D")," Depth ",s),!Z.has(i))n.debug("Not a cluster",i,s);else if(!Z.get(i).externalConnections&&t.children(i)&&t.children(i).length>0){n.debug("Cluster without external connections, without a parent and with children",i,s);let l=t.graph().rankdir==="TB"?"LR":"TB";if(Z.get(i)?.clusterData?.dir)l=Z.get(i).clusterData.dir,n.debug("Fixing dir",Z.get(i).clusterData.dir,l);let d=new le({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});R(i,t,d,i),t.setNode(i,{clusterNode:!0,id:i,clusterData:Z.get(i).clusterData,label:Z.get(i).label,graph:d})}else n.debug("Cluster ** ",i," **not meeting the criteria !externalConnections:",!Z.get(i).externalConnections," no parent: ",!t.parent(i)," children ",t.children(i)&&t.children(i).length>0,t.children("D"),s),n.debug(Z);r=t.nodes(),n.debug("New list of nodes",r);for(let i of r){let a=t.node(i);if(n.debug(" Now next level",i,a),a?.clusterNode)P(a.graph,s+1)}},"extractor"),B=e((t,s)=>{if(s.length===0)return[];let r=Object.assign([],s);return s.forEach((o)=>{let i=t.children(o),a=B(t,i);r=[...r,...a]}),r},"sorter"),Oi=e((t)=>B(t,t.children()),"sortNodesByHierarchy"),M=e((t,s,r)=>{let o=t.parent(s);while(o&&o!==r){let i=Z.get(o);if(i&&!i.externalConnections)return!0;o=t.parent(o)}return!1},"isNodeInExtractableCluster"),U=e((t,s,r)=>{let o=t.children(s)??[];for(let i of o){if(i===r||p(i,r))continue;let a=dn(i,t,s);if(!a)continue;if(!M(t,a,s))return a}return null},"findSafeAnchorNode");function it({prepareLayout:t,measureLayout:s,runLayoutCore:r,paintLayout:o,afterPaint:i,paintOptions:a}){let l=s??fn;return e(async function(c,g,b,E){let h=g.select("g");(b?.insertMarkers??xn)(h,c.markers,c.type,c.diagramId),Di();let f={element:h,helpers:b,options:E};f.preparedLayout=await t?.(c,f);let w=await l(c,f),v=await r(c,f),C={...f,measure:w};if(o)await o(c,C,v);else await A(c,C,a);await i?.(c,C,v)},"render")}e(it,"createCommonLayoutRenderer");function Di(){Tl(),Sl(),Cl(),q()}e(Di,"clearLayoutRenderState");async function fn(t,{element:s},r){return await D(s,t,r)}e(fn,"defaultMeasureLayout");async function A(t,s,r={}){let{measure:o}=s,{groups:i}=o;for(let l of r.getNodes?.(t,s)??t.nodes){if(r.skipNode?.(l,s))continue;await X(i,l,s,r)}let a=O(t.nodes);for(let l of t.edges){if(j(l,r))continue;await H(i,l,a,t,r,s)}}e(A,"paintLayoutData");async function X(t,s,r,o){if(s.clusterNode)Ct(s);else if(G(s,r,o))await mr(t.clusters,s);else Ct(s)}e(X,"paintLayoutNode");function G(t,s,r){return t.isGroup===!0&&(r.isCluster?.(t,s)??!0)}e(G,"shouldPaintAsCluster");function O(t){let s=new Map;for(let r of t)if(r?.id)s.set(r.id,r);return s}e(O,"buildNodeLookup");function j(t,s){return t.isLayoutOnly||Boolean(s.skipEdge?.(t))}e(j,"shouldSkipPaintEdge");async function H(t,s,r,o,i,a){let l=gr(t.edgePaths,{...s},i.clusterDb??new Map,o.type,N(s.start,s,r,a,i),N(s.end,s,r,a,i),o.diagramId,J(s,i),o.layoutAlgorithm);if(_s(s)){if(!vn.has(s.id))await Ft(t.edgeLabels,s);W(s,l)}}e(H,"paintLayoutEdge");function N(t,s,r,o,i){return i.getEdgeNode?.(t,s,o)??(t?r.get(t)??{}:{})}e(N,"getRenderedNode");function J(t,s){return typeof s.skipIntersect==="function"?s.skipIntersect(t):s.skipIntersect??!1}e(J,"shouldSkipIntersect");function W(t,s){let r=s?.updatedPath??s?.originalPath,o=k(),{subGraphTitleTotalMargin:i}=Pt({flowchart:o.flowchart??{}});if(t.label){let a=vn.get(t.id),{x:l,y:d}=Ls(t,s);a.attr("transform",`translate(${l}, ${d+i/2})`)}for(let[a,l]of[["startLeft",t.startLabelLeft],["startRight",t.startLabelRight],["endLeft",t.endLabelLeft],["endRight",t.endLabelRight]])if(l){let{x:d,y:c}=V(t,a,r);ze.get(t.id)[a].attr("transform",`translate(${d}, ${c})`)}}e(W,"positionRenderedEdgeLabel");var I={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function V(t,s,r){let o=t.terminalLabelCenters?.[s];if(o)return{...o};if(!r)return{x:t.x,y:t.y};let i=s.startsWith("start")?t.arrowTypeStart:t.arrowTypeEnd;return F.calcTerminalLabelPosition(i?10:0,I[s],r)}e(V,"terminalLabelTranslate");
|
|
2
|
+
export{Mi,Ni,Z,dn,ul,Oi,it,Di,fn};
|