isorite 0.15.0 → 0.17.0
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/dist/main.js +507 -62
- package/guide/out-of-the-base/web-and-code-links.md +3 -1
- package/package.json +1 -1
- package/web/_app/immutable/assets/0.DVQOzs4l.css +1 -0
- package/web/_app/immutable/assets/4.Dn5sJ8uq.css +1 -0
- package/web/_app/immutable/assets/5.DJhOSn7C.css +1 -0
- package/web/_app/immutable/assets/NoteList.Wxp_AH0Y.css +1 -0
- package/web/_app/immutable/chunks/{BAVnZFPa.js → 0KrpTYPM.js} +1 -1
- package/web/_app/immutable/chunks/{f7mFVWQS.js → 1MewxdCy.js} +1 -1
- package/web/_app/immutable/chunks/{DFo4P1vU.js → 1W6iRjg5.js} +1 -1
- package/web/_app/immutable/chunks/{BQeONalw.js → 2BcU70Iq.js} +1 -1
- package/web/_app/immutable/chunks/{CVqwkR8N.js → B-04K_Pl.js} +1 -1
- package/web/_app/immutable/chunks/{B_x6_Y3m.js → BBU5FdEo.js} +1 -1
- package/web/_app/immutable/chunks/{Djo-ijeo.js → BBhr3bLI.js} +1 -1
- package/web/_app/immutable/chunks/{CSKABQj2.js → BCsFs14H.js} +1 -1
- package/web/_app/immutable/chunks/BJOSVfg-.js +1 -0
- package/web/_app/immutable/chunks/{zasx25UV.js → BNlziJ_1.js} +3 -3
- package/web/_app/immutable/chunks/{BPpUSQ2Y.js → BbvUCVY_.js} +1 -1
- package/web/_app/immutable/chunks/{e7GRa0yc.js → BjLgp18-.js} +1 -1
- package/web/_app/immutable/chunks/{OG9GsKke.js → Bx_Vz2qr.js} +1 -1
- package/web/_app/immutable/chunks/{D7jLdCNu.js → C2EzU0qX.js} +1 -1
- package/web/_app/immutable/chunks/{DH_19--P.js → C2QvvHIN.js} +1 -1
- package/web/_app/immutable/chunks/{DJQ6favH.js → CAuYgj5q.js} +1 -1
- package/web/_app/immutable/chunks/{hjSZ041d.js → CB6ztdCQ.js} +1 -1
- package/web/_app/immutable/chunks/CHjmZsHD.js +1 -0
- package/web/_app/immutable/chunks/CM4EA3Wo.js +1 -0
- package/web/_app/immutable/chunks/{BsY4iMci.js → CMN7rSZK.js} +1 -1
- package/web/_app/immutable/chunks/CQhfj5-f.js +9 -0
- package/web/_app/immutable/chunks/{CSTv2fL0.js → CRbUrapz.js} +1 -1
- package/web/_app/immutable/chunks/{BLzZIf7l.js → CabmfniL.js} +1 -1
- package/web/_app/immutable/chunks/{C9Qdslk3.js → CcRcjPTM.js} +1 -1
- package/web/_app/immutable/chunks/{BDJlNL-I.js → CccIbhmH.js} +85 -85
- package/web/_app/immutable/chunks/{C1FDDux-.js → CdD6waB-.js} +1 -1
- package/web/_app/immutable/chunks/{CwHHpacD.js → CfTuc06U.js} +1 -1
- package/web/_app/immutable/chunks/{Mwr1r9aw.js → Cl-Xmm9N.js} +1 -1
- package/web/_app/immutable/chunks/{DxRGLDbV.js → CmFzeyfe.js} +1 -1
- package/web/_app/immutable/chunks/{CUNetmvQ.js → Cn7j5NKi.js} +1 -1
- package/web/_app/immutable/chunks/{DWwu8a1P.js → CpJ4vfn-.js} +1 -1
- package/web/_app/immutable/chunks/{MrW4zd8l.js → CwcA6hab.js} +1 -1
- package/web/_app/immutable/chunks/{AnnzTlE8.js → CxEu-Di8.js} +1 -1
- package/web/_app/immutable/chunks/{CUB9vnd0.js → DEwfz-Il.js} +1 -1
- package/web/_app/immutable/chunks/DH2bqH7t.js +517 -0
- package/web/_app/immutable/chunks/{CZSmkKvQ.js → DJHLXLij.js} +1 -1
- package/web/_app/immutable/chunks/{Kem7IXj7.js → DK9wjWIk.js} +1 -1
- package/web/_app/immutable/chunks/{BLe29cGh.js → DMTkA0aK.js} +1 -1
- package/web/_app/immutable/chunks/{D1MhxXyn.js → DMpFmiFg.js} +1 -1
- package/web/_app/immutable/chunks/{DW5uy3Jw.js → DQJRaTNz.js} +1 -1
- package/web/_app/immutable/chunks/{DJT73ARj.js → DRKiKCov.js} +1 -1
- package/web/_app/immutable/chunks/{DEQsS4Ez.js → DS7XcdHs.js} +1 -1
- package/web/_app/immutable/chunks/{0B47b24t.js → D_xpsaTJ.js} +1 -1
- package/web/_app/immutable/chunks/{LbnMg2Kc.js → Ddw9FbDu.js} +1 -1
- package/web/_app/immutable/chunks/{D4EpFhYZ.js → DeazQJkV.js} +1 -1
- package/web/_app/immutable/chunks/{Ch5Z7cbP.js → Df3spPXn.js} +1 -1
- package/web/_app/immutable/chunks/{1j--pDqt.js → DfLI-CvW.js} +1 -1
- package/web/_app/immutable/chunks/{Bytzbt5l.js → Dns-yz2Q.js} +1 -1
- package/web/_app/immutable/chunks/{mhWk5y4o.js → DqZ4UzUH.js} +1 -1
- package/web/_app/immutable/chunks/{BtcGx-KQ.js → DrPF-vh8.js} +1 -1
- package/web/_app/immutable/chunks/{DAVMwq6b.js → Ds9L6FPB.js} +1 -1
- package/web/_app/immutable/chunks/{CWc-mNzo.js → Dzu8v7nB.js} +1 -1
- package/web/_app/immutable/chunks/IECP4ppk.js +1 -0
- package/web/_app/immutable/chunks/NgkOM4d0.js +1 -0
- package/web/_app/immutable/chunks/{ZTEErEOd.js → ZDjPMhAb.js} +1 -1
- package/web/_app/immutable/chunks/ZDkogIhD.js +1 -0
- package/web/_app/immutable/chunks/{CcE14TDI.js → _zY4mrA0.js} +1 -1
- package/web/_app/immutable/chunks/{B7LnLClC.js → fpNFwizw.js} +1 -1
- package/web/_app/immutable/chunks/{BZX8cNYL.js → qfBACIi9.js} +1 -1
- package/web/_app/immutable/chunks/{Cpjqsnqr.js → rv_cF9pp.js} +1 -1
- package/web/_app/immutable/chunks/{DY0M2GMn.js → sBy91tGs.js} +1 -1
- package/web/_app/immutable/chunks/{BiHyHFlW.js → vGOSIW7X.js} +1 -1
- package/web/_app/immutable/chunks/{Ih6r6QR2.js → yYKJ4mbq.js} +1 -1
- package/web/_app/immutable/chunks/{DbtvzL7r.js → yy6sD_us.js} +1 -1
- package/web/_app/immutable/entry/app.CX19wIuG.js +2 -0
- package/web/_app/immutable/entry/start.DaiosA4i.js +1 -0
- package/web/_app/immutable/nodes/0.B6_Ycc14.js +3 -0
- package/web/_app/immutable/nodes/1.JA1sPybf.js +1 -0
- package/web/_app/immutable/nodes/2.DN2phYmE.js +1 -0
- package/web/_app/immutable/nodes/3.CbnLNp2F.js +1 -0
- package/web/_app/immutable/nodes/4.CIsG7Kdu.js +3 -0
- package/web/_app/immutable/nodes/5.D__u9ji8.js +19 -0
- package/web/_app/immutable/nodes/6.DBP0fpLt.js +1 -0
- package/web/_app/immutable/nodes/7.DuaH9aUr.js +1 -0
- package/web/_app/immutable/workers/worker-C_nKscAW.js +1 -0
- package/web/_app/version.json +1 -1
- package/web/fonts/LythMono-LICENSE.md +112 -0
- package/web/fonts/lyth-mono-latin-bold.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-bolditalic.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-italic.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-regular.woff2 +0 -0
- package/web/index.html +19 -17
- package/web/_app/immutable/assets/0.CtWz9d2A.css +0 -1
- package/web/_app/immutable/assets/4.fOHsAKBF.css +0 -1
- package/web/_app/immutable/assets/NoteList.E6jC-AtZ.css +0 -1
- package/web/_app/immutable/chunks/B7Bf3hc7.js +0 -1
- package/web/_app/immutable/chunks/B9TKPEJD.js +0 -1
- package/web/_app/immutable/chunks/C7qBBO-i.js +0 -1
- package/web/_app/immutable/chunks/DtEVmiYo.js +0 -1
- package/web/_app/immutable/chunks/Dx_7xlS4.js +0 -523
- package/web/_app/immutable/chunks/wD7RSG2d.js +0 -1
- package/web/_app/immutable/entry/app.Av5W3V8v.js +0 -2
- package/web/_app/immutable/entry/start.CbpxCvWi.js +0 -1
- package/web/_app/immutable/nodes/0.BTVYyqUm.js +0 -3
- package/web/_app/immutable/nodes/1.DR-b7PMP.js +0 -1
- package/web/_app/immutable/nodes/2.BePyTqoa.js +0 -1
- package/web/_app/immutable/nodes/3.D2rfIXQP.js +0 -1
- package/web/_app/immutable/nodes/4.7tuUcODS.js +0 -15
- package/web/_app/immutable/nodes/5.Cs9hcGU9.js +0 -1
- package/web/_app/immutable/nodes/6.DzvF0ZPt.js +0 -1
- package/web/_app/immutable/workers/worker-CWkpeSVG.js +0 -1
- /package/web/_app/immutable/assets/{6.C00vyVPo.css → 7.C00vyVPo.css} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./
|
|
1
|
+
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DS7XcdHs.js";import{n as o,r as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./Dzu8v7nB.js";import{PeleError as w,u as T}from"./BNlziJ_1.js";var E=32;function D(e){return new w(e,`semantic`,{type:`radar`})}function O(e,t){let n=e.axes.map(e=>({name:e.name,label:e.label??e.name})),r=e.curves.map(e=>{let t;if(e.entries[0].axis===void 0)t=e.entries.map(e=>e.value);else{if(n.length===0)throw D(`Axes must be populated before curves for reference entries`);let r=new Map;for(let t of e.entries)t.axis!==void 0&&!r.has(t.axis.$refText)&&r.set(t.axis.$refText,t.value);t=n.map(e=>{let t=r.get(e.name);if(t===void 0)throw D(`Missing entry for axis `+e.label);return t})}return{name:e.name,label:e.label??e.name,entries:t}}),i={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`};for(let t of e.options)t.name===`showLegend`?i.showLegend=t.value:t.name===`graticule`?i.graticule=t.value:i[t.name]=t.value;return i.ticks>E&&(i.ticks=E),{type:`radar`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,axes:n,curves:r,options:i}}var k=0,A=0;function j(e,t){let n=t;for(let t=e.charCodeAt(n);t>=48&&t<=57;t=e.charCodeAt(n))n++;return n}function M(e,t){(t<k||t>=A)&&(k=t,A=j(e,t));let n=A;if(n===t)return-1;let r=e.charCodeAt(n)===46;if(r){let t=j(e,n+1),r=t-n-1;if(r>0&&e.charCodeAt(t)!==46)return t;if(r>1)return t-1}return e.charCodeAt(t)===48?t+1:r?n-1>t?n-1:-1:n}var N=c.pattern,P=/[\t ]*accDescr\s*{/y,F=-2;function I(e,t){return P.lastIndex=t,P.test(e)&&(F===-2&&(F=e.lastIndexOf(`}`)),P.lastIndex>F)?-1:(N.lastIndex=t,N.test(e)?N.lastIndex:-1)}var L={name:`ID`,pattern:/[\w]([-\w]*\w)?/y},R=e=>({name:e,pattern:e,longer:[L]}),z=e=>({name:e,pattern:e}),B=[z(`radar-beta:`),{...m(`radar-beta`),longer:[L]},R(`showLegend`),R(`graticule`),R(`curve`),R(`ticks`),R(`axis`),R(`max`),R(`min`),z(`:`),z(`,`),z(`[`),z(`]`),z(`{`),z(`}`),{name:`GRATICULE`,pattern:/circle|polygon/y},{name:`BOOLEAN`,pattern:/true|false/y},{...c,match:I},S,y,{name:`NUMBER`,pattern:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/y,match:M},g,L,h,C,b,v,x];function V(e){return k=A=0,F=-2,_(e,B,`radar`)}function H(e){let t=new p(V(e),B,`radar`),n={$type:`Radar`,axes:[],curves:[],options:[]},r=()=>{for(;t.kind===23;)t.i++},i=()=>{t.kind!==-1&&(t.kind!==23&&t.fail(`a line break or the end of input`),r())},a=()=>{if(!t.accept(11))return;let e=d(t.expect(21));return t.expect(12),e},o=e=>{if(!e)return{$type:`Entry`,value:Number(t.expect(20))};let n={$refText:t.expect(22)};return t.accept(9),{$type:`Entry`,axis:n,value:Number(t.expect(20))}},s=()=>{let e=t.expect(22),n=a(),i={$type:`Curve`,name:e,entries:[]};n!==void 0&&(i.label=n),t.expect(13),r(),t.kind!==20&&t.kind!==22&&t.fail(`a number or an axis name`);let s=t.kind===22;for(i.entries.push(o(s));t.accept(10);)r(),i.entries.push(o(s));return r(),t.expect(14),i},c=()=>{let e={$type:`Axis`,name:t.expect(22)},n=a();return n!==void 0&&(e.label=n),e},m=()=>{let e=t.kind,n=t.take(),r;return r=e===2?t.expect(16)===`true`:e===3?t.expect(15):Number(t.expect(20)),{$type:`Option`,name:n,value:r}},h=()=>t.kind===2||t.kind===5||t.kind===7||t.kind===8||t.kind===3;for(r(),t.accept(0)||(t.expect(1),t.accept(9)),r();t.kind!==-1;)switch(t.kind){case 23:t.i++;break;case 17:n.accDescr=l(t.take()),i();break;case 18:n.accTitle=f(t.take()),i();break;case 19:n.title=u(t.take()),i();break;case 6:t.i++;do n.axes.push(c());while(t.accept(10));break;case 4:t.i++;do n.curves.push(s());while(t.accept(10));break;default:for(h()||t.fail(`an axis, a curve, an option, a title, or a line break`),n.options.push(m());t.accept(10);)h()||t.fail(`an option`),n.options.push(m())}return n}var U=12,W=26,G=24;function K(e,t,n,r,i){let a=e.radar?.[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function ee(e,t,n,r){let i=Math.min(Math.max(e,t),n),a=r*(i-t);return Number.isFinite(a)?a/(n-t):r*((i-t)/(n-t))}function te(e,t){let n=e.length,r=`M${a(e[0].x)},${a(e[0].y)}`;for(let i=0;i<n;i++){let o=e[(i-1+n)%n],s=e[i],c=e[(i+1)%n],l=e[(i+2)%n];r+=` C${a(s.x+(c.x-o.x)*t)},${a(s.y+(c.y-o.y)*t)} ${a(c.x-(l.x-s.x)*t)},${a(c.y-(l.y-s.y)*t)} ${a(c.x)},${a(c.y)}`}return r+` Z`}function q(e){let t=``;for(let n of e)t+=(t?` `:``)+a(n.x)+`,`+a(n.y);return t}function J(e,t,n){let r=K(t,`width`,320,1,4e3);return o(n,r,160,(i,a)=>Y(e,t,n,i,K(t,`height`,320,1,4e3)*i/r,a))}function Y(o,c,l,u,d,f){let p=l.fontSize??16,m=Math.round(p*.875),h=l.measurer??T(l.fontFamily,l.fontFamilyMono),g=l.padding??8,_=K(c,`axisScaleFactor`,1,0,10),v=K(c,`axisLabelFactor`,1.05,0,10),y=K(c,`curveTension`,.17,0,1),b=Math.min(u,d)/2,{axes:x,curves:S}=o,{ticks:C,graticule:w,min:E}=o.options,D=x.length,O=x.map((e,t)=>{let n=2*Math.PI*t/D-Math.PI/2;return{x:Math.cos(n),y:Math.sin(n)}}),k=o.options.max;if(k===null){k=-1/0;for(let e of S)for(let t of e.entries)t>k&&(k=t)}let A=-u/2-K(c,`marginLeft`,16,0,2e3),j=u/2+K(c,`marginRight`,16,0,2e3),M=-d/2-K(c,`marginTop`,16,0,2e3),N=d/2+K(c,`marginBottom`,16,0,2e3),P=``;for(let e=0;e<C;e++){let t=Math.min(b,b*(e+1)/C);P+=w===`circle`?`<circle r="${a(t)}"/>`:`<polygon points="${q(O.map(e=>({x:e.x*t,y:e.y*t})))}"/>`}let F=``,I=``;O.forEach((e,t)=>{let o=b*_;F+=`M0,0L${a(e.x*o)},${a(e.y*o)}`;let s=i(x[t].label,!1,h,m,4e3),c=b*v+6,l=e.x*c+(e.x>.01?s.width/2:e.x<-.01?-s.width/2:0),u=e.y*c+(e.y>.01?s.height/2:e.y<-.01?-s.height/2:0);I+=`<g class="pele-axis-label" data-id="${n(x[t].name)}">${r(s,l,u,``)}</g>`,A=Math.min(A,l-s.width/2),j=Math.max(j,l+s.width/2),M=Math.min(M,u-s.height/2),N=Math.max(N,u+s.height/2)});let L=``;S.forEach((e,r)=>{if(e.entries.length!==D)return;let i=e.entries.map((e,t)=>{let n=ee(e,E,k,b),r=Number.isFinite(n)?n:0;return{x:O[t].x*r,y:O[t].y*r}}),a=t(r),o=` class="pele-curve" data-id="${n(e.name)}" fill="${a}" stroke="${a}"`;L+=w===`circle`?`<path${o} d="${te(i,y)}"/>`:`<polygon${o} points="${q(i)}"/>`});let R=o.options.showLegend?S.map(e=>i(e.label,!1,h,m,4e3)):[],z=0;for(let e of R)z=Math.max(z,e.width);let B=R.length*W,V=f?-(U+8+z)/2:j+G,H=f?N+G/2:-B/2;R.length>0&&f?(A=Math.min(A,V),j=Math.max(j,-V),N=H+B):R.length>0&&(j=V+U+8+z,M=Math.min(M,-B/2),N=Math.max(N,B/2));let J=``;R.forEach((e,i)=>{let o=H+i*W+W/2,s=t(i);J+=`<g class="pele-legend-item" data-id="${n(S[i].name)}"><rect x="${a(V)}" y="${a(o-U/2)}" width="${U}" height="${U}" rx="2" fill="${s}" fill-opacity="0.4" stroke="${s}"/>`+r(e,V+U+8+e.width/2,o,``)+`</g>`});let Y=i(o.title,!1,h,p,s(l),1),X=Y.height>0?Y.height+8:0,Z=Math.max(j-A,Y.width),Q=Math.ceil(Z+2*g),$=Math.ceil(N-M+X+2*g),ne=`translate(${a(g+(Z-(j-A))/2-A)},${a(g+X-M)})`,re=r(Y,Q/2,g+Y.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="${ne}">`+(P?`<g class="pele-graticule" fill="none" stroke="var(--_a)">${P}</g>`:``)+(F?`<path class="pele-axes" d="${F}" fill="none" stroke="var(--_b)"/>`:``)+(L?`<g class="pele-curves" fill-opacity="0.2" stroke-width="1.5" stroke-linejoin="round">${L}</g>`:``)+(I?`<g class="pele-axis-labels" font-size="${m}">${I}</g>`:``)+(J?`<g class="pele-legend" font-size="${m}">${J}</g>`:``)+`</g>`;return{svg:e(`radar`,Q,$,p,l,o,re),width:Q,height:$,links:[]}}var X={type:`radar`,parse:(e,t,n)=>O(H(e),n),render:J};export{X as radar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ft as e}from"./CxEu-Di8.js";e();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./IECP4ppk.js","./CfTuc06U.js","./DS7XcdHs.js","./DciMwFJ1.js","./DK9wjWIk.js","./CdD6waB-.js","./_zY4mrA0.js","./DrPF-vh8.js","./D6QVYUu9.js","./DQJRaTNz.js","./Bx_Vz2qr.js","./CggtIYAM.js","./C2EzU0qX.js","./Dzu8v7nB.js","./C2QvvHIN.js","./BZmnMkFw.js","./1W6iRjg5.js","./2BcU70Iq.js","./BbvUCVY_.js","./vGOSIW7X.js","./CmFzeyfe.js","./qfBACIi9.js","./D_xpsaTJ.js","./CcRcjPTM.js","./0KrpTYPM.js","./CgA1WoRv.js","./yy6sD_us.js","./Ds9L6FPB.js","./DfLI-CvW.js","./CwcA6hab.js","./DMTkA0aK.js","./ZDjPMhAb.js","./DJHLXLij.js","./Ce_hS451.js","./CabmfniL.js","./BCsFs14H.js","./Df3spPXn.js","./1MewxdCy.js","./Cn7j5NKi.js","./yYKJ4mbq.js","./CB6ztdCQ.js","./BjLgp18-.js","./B-04K_Pl.js","./sBy91tGs.js","./Cl-Xmm9N.js","./CAuYgj5q.js","./CpJ4vfn-.js","./Dns-yz2Q.js","./DEwfz-Il.js","./DqZ4UzUH.js","./fpNFwizw.js","./rv_cF9pp.js","./DRKiKCov.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{vt as e}from"./CxEu-Di8.js";import{t}from"./CRzLMJPS.js";function n(e){return e<128?e===32||e>=9&&e<=13:e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function r(e){return e===32||e===9}function i(e){return e===10||e===13||e===8232||e===8233}function a(e){return e>=48&&e<=57}function o(e){return e>=65&&e<=90||e>=97&&e<=122}function s(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function c(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95}var l=class extends Error{code;type;mermaidType;line;column;snippet;constructor(e,t=`syntax`,n={}){super(e),this.name=`PeleError`,this.code=t,this.type=n.type??null,this.mermaidType=n.mermaidType??null,this.line=n.line??0,this.column=n.column??0,this.snippet=n.snippet??``}};function u(e,t,n){return Array.from(e.matchAll(t),e=>[e.index,e.index+e[0].length,n])}function d(e,t){let n=0;for(let[r,i,a]of e){let e=r-n;if(t<e)break;if(t<e+a)return r+Math.min(t-e,i-r-1);n+=i-r-a}return t+n}function f(e,t){for(let n=e.length-1;n>=0;n--)t=d(e[n],t);return t}var p;function m(e,t){let n=p;p=e;try{return t()}finally{p=n}}function h(e,t){return p!==void 0&&e===p.parsed?p.find(t):[e,t]}function g(e,t){[e,t]=h(e,t);let n=1,r=0;for(let i=e.indexOf(`
|
|
3
3
|
`);i!==-1&&i<t;i=e.indexOf(`
|
|
4
4
|
`,i+1))n++,r=i+1;let i=e.indexOf(`
|
|
5
5
|
`,t);i===-1&&(i=e.length);let a=t-r+1,o=e.slice(r,i);return{line:n,column:a,snippet:o+`
|
|
@@ -42,4 +42,4 @@ ${r}`,`syntax`,{type:e,...a})}var v=`amp:38,lt:60,gt:62,quot:34,apos:39,nbsp:160
|
|
|
42
42
|
`,e+1))o++;n=n.slice(s.length),t?.push([[0,s.length,0]])}return n=Ge(n,i,t),{text:ze(n),title:a,config:i,withComments:n,lineOffset:o}}var qe=/#\w+;/g,Je=/^\+?\d+$/,Ye=RegExp(`[\\n\\r\u2028\u2029]`,`g`);function Xe(e){if(e===void 0)return;let t=[];return e.push(t),t}function Ze(e,t,r){let i=Xe(r),a=e.indexOf(t);if(a===-1)return e;let o=``,s=0;for(;a!==-1;){Ye.lastIndex=a;let r=Ye.test(e)?Ye.lastIndex-1:e.length,c=!1,l=-1;for(let i=a+t.length;i<r;i++){let t=e.charCodeAt(i);if(t===58)c=!0;else if(t===35){if(c){l=i;break}}else n(t)&&(c=!1)}if(l!==-1){let t=e.lastIndexOf(`;`,r-1);t>l&&(i?.push([t,t+1,0]),o+=e.slice(s,t),s=t+1)}a=r>=e.length?-1:e.indexOf(t,r+1)}return s===0?e:o+e.slice(s)}function Qe(e,t){if(!e.includes(`#`))return e;e=Ze(Ze(e,`style`,t),`classDef`,t);let n=Xe(t);return e.replace(qe,(e,t)=>{let r=e.substring(1,e.length-1),i=(Je.test(r)?`fl°°`:`fl°`)+r+`¶ß`;return n?.push([t,t+e.length,i.length]),i})}function Z(e){return e.ownerDocument?.defaultView??globalThis}function $e(e,t){let n=e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0);return n>0?n:0}function et(e,t,n,r,i){let a=t.width/n,o=t.height/n,s=(e,t,n)=>t>=n?Math.min(Math.max(e,n-t),0):Math.min(Math.max(e,0),n-t);return{x:s(r,a,e.width),y:s(i,o,e.height),width:a,height:o}}var Q=1.25,tt=48,nt=`--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_b:var(--pele-border,#8a8a8a);position:absolute;top:var(--pele-zoom-top,8px);right:var(--pele-zoom-right,8px);bottom:var(--pele-zoom-bottom,auto);left:var(--pele-zoom-left,auto);display:flex;flex-direction:column;gap:2px;padding:2px;width:auto;max-width:none;border:1px solid var(--_b);border-radius:var(--pele-radius,4px);background:var(--_bg);color:var(--_fg);line-height:0`,rt=`appearance:none;display:grid;place-items:center;width:24px;height:24px;margin:0;padding:0;border:0;border-radius:calc(var(--pele-radius,4px) - 1px);background:transparent;color:inherit;font:inherit;cursor:var(--pele-zoom-cursor,pointer)`,it={zoomIn:`M5 12h14M12 5v14`,zoomOut:`M5 12h14`,reset:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8M3 3v5h5`},at={zoomIn:`Zoom in`,zoomOut:`Zoom out`,reset:`Reset zoom`};function ot(e,t={}){return st(e,t,!0)}function st(e,t,n){let r=null,i={width:0,height:0},a={width:0,height:0},o={width:0,height:0},s=!1,c=``,l={width:``,height:``,maxWidth:``,margin:``,display:``},u=0,d=0,f=0,p=0,m=()=>Z(e),h=()=>i.width>0&&a.width>0?a.width/i.width:1,g=()=>Math.max(h(),t.maxScale??3),_=()=>r!==null&&i.width>0&&(t.always===!0||h()<.999),v=()=>{if(!r||u!==0)return;let t=r.getBoundingClientRect();a={width:t.width,height:t.height},o={width:Math.max(a.width,e.clientWidth),height:Math.max(a.height,e.clientHeight)},s=o.width>a.width+1||o.height>a.height+1,s||(o=a);let n=m().getComputedStyle(e);c=[`Top`,`Right`,`Bottom`,`Left`].map(e=>`${-(parseFloat(n.getPropertyValue(`padding-${e.toLowerCase()}`))||0)}px`).join(` `)},y,b={},x=!1,S=()=>{if(t.controls===!1)return;let n=_();if(!y){if(!n)return;let r=e.ownerDocument;y=r.createElement(`div`),y.className=`pele pele-zoom`,y.setAttribute(`style`,nt);let i={zoomIn:()=>T((u||h())*Q*Q),zoomOut:()=>T((u||h())/(Q*Q)),reset:()=>w()};for(let e of[`zoomIn`,`zoomOut`,`reset`]){let n=r.createElement(`button`),a=t.labels?.[e]??at[e];n.type=`button`,n.className=`pele-zoom-${e===`zoomIn`?`in`:e===`zoomOut`?`out`:`reset`}`,n.setAttribute(`style`,rt),n.setAttribute(`aria-label`,a),n.title=a,n.innerHTML=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${it[e]}"/></svg>`,n.addEventListener(`click`,i[e]),b[e]=n,y.append(n)}}n&&!x&&m().getComputedStyle(e).position===`static`&&(e.style.position=`relative`,x=!0),n&&y.parentNode!==e&&e.append(y),y.hidden=!n,y.style.display=n?`flex`:`none`;let r=(e,t)=>{e&&(e.disabled=t,e.style.opacity=t?`0.35`:``,e.style.cursor=t?`default`:`var(--pele-zoom-cursor,pointer)`)};r(b.zoomIn,(u||h())>=g()*.999),r(b.zoomOut,u===0),b.reset&&(b.reset.style.display=u===0?`none`:`grid`)},C=e=>y!==void 0&&e.target instanceof m().Node&&y.contains(e.target),w=()=>{r&&(u=0,r.setAttribute(`viewBox`,`0 0 ${i.width} ${i.height}`),r.style.width=l.width,r.style.height=l.height,r.style.maxWidth=l.maxWidth,r.style.margin=l.margin,r.style.display=l.display,r.style.cursor=``,r.style.userSelect=``,v(),r.style.touchAction=_()?`pan-y`:``,_()?r.setAttribute(`tabindex`,`0`):r.removeAttribute(`tabindex`),B(_()),S())},T=(e,t,n)=>{if(!r||(u===0&&v(),!_()))return;let i=u||h(),a=Math.min(Math.max(e,h()),g());if(a<=h()*1.001){w();return}let l=r.getBoundingClientRect(),p=t??l.left+l.width/2,m=n??l.top+l.height/2,y=(u?d:0)+(p-l.left)/i,b=(u?f:0)+(m-l.top)/i;u=a;let x=l;s&&(r.style.maxWidth=`none`,r.style.margin=c,r.style.display=`block`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,x=r.getBoundingClientRect()),E(y-(p-x.left)/u,b-(m-x.top)/u),r.style.cursor=`grab`,r.style.userSelect=`none`,r.style.touchAction=`none`,S()},E=(e,t)=>{if(!r)return;let n=et(i,o,u,e,t);d=n.x,f=n.y,r.setAttribute(`viewBox`,`${d} ${f} ${n.width} ${n.height}`)},D=(e,t)=>{u!==0&&E(d-e/u,f-t/u)},O=()=>{j();let t=e.clientWidth+e.clientHeight;t!==p&&(p=t,w())},k,A,j=()=>{if(!n)return;let t=m();t!==A&&(k?.disconnect(),A=t,k=t.ResizeObserver?new t.ResizeObserver(O):void 0,k?.observe(e))},M=()=>{j();let t=e.firstElementChild;r=t&&t.localName===`svg`?t:null,u=0,r?(i={width:Number(r.getAttribute(`width`))||0,height:Number(r.getAttribute(`height`))||0},l={width:r.style.width,height:r.style.height,maxWidth:r.style.maxWidth,margin:r.style.margin,display:r.style.display},w()):(y?.remove(),B(!1))},N=new Map,P=!1,F=0,I=0,L=()=>{let[e,t]=[...N.values()];return{distance:Math.hypot(e.x-t.x,e.y-t.y),x:(e.x+t.x)/2,y:(e.y+t.y)/2}},R=t=>{!_()||C(t)||t.pointerType===`mouse`&&t.button!==0||(N.set(t.pointerId,{x:t.clientX,y:t.clientY}),F=0,N.size===2&&(I=L().distance),(N.size===2||u!==0)&&(e.setPointerCapture?.(t.pointerId),r&&(r.style.cursor=`grabbing`)))},ee=e=>{let t=N.get(e.pointerId);if(t){if(N.size===2){let t=L();N.set(e.pointerId,{x:e.clientX,y:e.clientY});let n=L();I>0&&n.distance>0&&T((u||h())*(n.distance/t.distance),n.x,n.y),D(n.x-t.x,n.y-t.y),P=!0;return}N.set(e.pointerId,{x:e.clientX,y:e.clientY}),u!==0&&(F+=Math.abs(e.clientX-t.x)+Math.abs(e.clientY-t.y),F>4&&(P=!0),D(e.clientX-t.x,e.clientY-t.y))}},te=e=>{N.delete(e.pointerId)&&(I=0,N.size===0&&r&&u!==0&&(r.style.cursor=`grab`))},ne=e=>{P&&(P=!1,e.preventDefault(),e.stopPropagation())},re=e=>{if(!(e.ctrlKey||e.metaKey)||!_())return;e.preventDefault(),u===0&&v();let t=Math.min(Math.max(-e.deltaY,-24),24);T((u||h())*2**(t*.02),e.clientX,e.clientY)},ie=e=>{!_()||C(e)||(e.preventDefault(),u===0?T(Math.max(1,h()*2),e.clientX,e.clientY):w())},ae=e=>{if(!_()||C(e)||e.ctrlKey||e.metaKey||e.altKey)return;let t=e.key;if(t===`+`||t===`=`)T((u||h())*Q);else if(t===`-`)T((u||h())/Q);else{if(u===0)return;if(t===`0`||t===`Escape`)w();else if(t===`ArrowLeft`)D(tt,0);else if(t===`ArrowRight`)D(-tt,0);else if(t===`ArrowUp`)D(0,tt);else if(t===`ArrowDown`)D(0,-tt);else return}e.preventDefault()},oe=e=>{if(!r||e.target!==r)return;let t=!0;try{t=r.matches(`:focus-visible`)}catch{}r.style.outline=t?``:`none`},z=0,se=e=>{_()&&(e.preventDefault(),u===0&&v(),z=u||h())},ce=e=>{if(z===0)return;e.preventDefault();let{scale:t,clientX:n,clientY:r}=e;T(z*t,n,r)},le=()=>{z=0},ue=[[`pointerdown`,R],[`pointermove`,ee],[`pointerup`,te],[`pointercancel`,te],[`click`,ne,{capture:!0}],[`dblclick`,ie],[`keydown`,ae],[`focusin`,oe]];for(let[t,n,r]of ue)e.addEventListener(t,n,r);let de=[[`wheel`,re,{passive:!1}],[`gesturestart`,se,{passive:!1}],[`gesturechange`,ce,{passive:!1}],[`gestureend`,le,{passive:!1}]],fe=!1;function B(t){if(t!==fe){fe=t;for(let[n,r,i]of de)t?e.addEventListener(n,r,i):e.removeEventListener(n,r,i);t||(z=0)}}return p=e.clientWidth+e.clientHeight,M(),{get scale(){return u||h()},get fit(){return h()},zoomBy(e){T((u||h())*e)},zoomTo(e){T(e)},reset:w,refresh:M,resized:O,destroy(){w(),r&&(r.style.touchAction=``,r.removeAttribute(`tabindex`)),y?.remove(),x&&(e.style.position=``),k?.disconnect(),B(!1);for(let[t,n,r]of ue)e.removeEventListener(t,n,r)}}}function ct(e,t){let n=t?Z(t).getComputedStyle(t):e;return{family:n.getPropertyValue(`--pele-font`).trim()||e.fontFamily||void 0,mono:n.getPropertyValue(`--pele-font-mono`).trim()||void 0}}function lt(e){return[...new Set([e.ownerDocument?.fonts,globalThis.document?.fonts])].filter(e=>e!==void 0)}var ut=new WeakMap;function dt(e){let t=ut.get(e);return t||(t=e.ready.then(()=>{ut.delete(e),he()}),ut.set(e,t)),t}var ft=new WeakMap;function pt(e,t){Promise.all(e.map(dt)).then(()=>{let e=t.deref();e&&ft.get(e)?.()})}var mt=new WeakMap,ht=0,gt=Math.random().toString(36).slice(2,7),_t=`position:relative;height:1.3em;margin-top:-1.3em;line-height:1.3;font-size:0.8em;color:var(--pele-error,#e45756);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;`,vt=`margin:0;font-size:0.8em;font-family:var(--pele-font-mono,monospace);color:var(--pele-error,#e45756);white-space:pre-wrap;`;function yt(e){return e instanceof Error?e.message:String(e)}function bt(e){let t=e.split(`
|
|
43
43
|
`).filter(e=>e.trim()!==``);return t.length>1?`${t[0]} ${t[t.length-1]}`:t[0]??``}function xt(e,t,n,r={}){mt.get(t)?.destroy();let i=n,a=r,o,s,c=!1,l,u,d,f=`pele-${gt}-${++ht}`,p={},m,h=-1,g=!1,_=!1,v=!1,y=(n,r)=>{let{onRender:i,onError:s,sanitize:c,...l}=a,d={...l,idPrefix:l.idPrefix??f,fontFamily:l.fontFamily??p.family,fontFamilyMono:l.fontFamilyMono??p.mono,maxWidth:void 0};r&&(u=e.render(o,d),m=void 0);let g=a.maxWidth??$e(t,n);return h=g,g>0&&g<u.width&&(m??=e.render(o,{...d,maxWidth:1}).svg!==u.svg,m)?e.render(o,{...d,maxWidth:g}):u},b=e=>{a.sanitize?t.replaceChildren(a.sanitize(e)):t.innerHTML=e},x,S=()=>{let e=d?t.firstElementChild:null;if(e?.style&&(e.style.opacity=l===void 0?``:`0.4`),l===void 0){x?.remove(),x=void 0;return}let n=t.ownerDocument;if(!n)return;x??=n.createElement(`div`),x.className=`pele pele-error`;let r=yt(l);e?(x.textContent=bt(r),x.title=r,x.setAttribute(`style`,_t),x.parentNode!==t&&t.append(x)):(x.textContent=r,x.removeAttribute(`title`),x.setAttribute(`style`,vt),t.replaceChildren(x))},C=e=>{l=e,S(),a.onError?.(e)},w=()=>{if(_||v)return;let e=lt(t).filter(e=>e.status===`loading`);e.length!==0&&(_=!0,pt(e,new WeakRef(R)))},T=()=>{_=!1,g=!0,M()},E=(e,n=!e)=>{let r=Z(t).getComputedStyle(t),i=t.firstElementChild??null,f={fonts:p,natural:u,adapts:m,drawnFor:h,stale:g},_;try{if(e&&(p=ct(r,i),g=t.isConnected===!1),_=y(r,e),n&&_.svg===d?.svg){e&&(s=o),c&&l!==void 0&&(l=void 0,S());return}b(_.svg)}catch(e){throw{fonts:p,natural:u,adapts:m,drawnFor:h,stale:g}=f,e}if(e&&(s=o),e&&!i&&t.firstElementChild){let e=ct(r,t.firstElementChild);if(e.family!==p.family||e.mono!==p.mono){let t={fonts:p,natural:u,adapts:m,drawnFor:h};p=e;try{let e=y(r,!0);b(e.svg),_=e}catch{({fonts:p,natural:u,adapts:m,drawnFor:h}=t)}}}d=_,c&&(l=void 0),S(),D?.refresh(),w(),a.onRender?.(_)},D,O=!1,k=()=>{let e=a.zoom??`auto`;e!==O&&(D?.destroy(),O=e,D=e===!1?void 0:st(t,typeof e==`object`?e:{always:e===!0},!1))},A=()=>t.isConnected===!1||!(t.clientWidth>0),j=()=>t.isConnected!==!1&&!(t.clientWidth>0),M=()=>{if(v||(L(),!o||A()))return;let e=Z(t).getComputedStyle(t),n=ct(e,t.firstElementChild??null);try{if(g||n.family!==p.family||n.mono!==p.mono)E(!0,!0);else if(m!==!1&&a.maxWidth===void 0){let n=$e(t,e);n!==h&&n!==d?.width&&E(!1)}}catch(e){g=!1,c&&(l=e),o!==s&&(o=s,c=!1),S(),a.onError?.(e)}D?.resized(),w()},N,P,F,I=()=>{F!==void 0&&N?.cancelAnimationFrame(F),F=void 0},L=()=>{let e=Z(t);e!==N&&(P?.disconnect(),I(),N=e,P=e.ResizeObserver?new e.ResizeObserver(()=>{if(F===void 0){if(!e.requestAnimationFrame)return M();F=e.requestAnimationFrame(()=>{F=void 0,M()})}}):void 0,P?.observe(t))},R={get result(){return d},get source(){return i},get error(){return l},get zoom(){return D},update(t,n=a){let r=!c||t!==i||n.limit!==a.limit||n.maxEdges!==a.maxEdges||n.config!==a.config;i=t,a=n;let l=o;if(r)try{l=e.parse(t,n)}catch(e){c=!1,C(e),k();return}let u=d;if(o=l,c=!0,j())g=!0,k();else{try{E(!0)}catch(e){if(d!==u)throw k(),e;o=s,c=!1,C(e)}k()}},refresh:M,destroy(){v=!0,P?.disconnect(),P=void 0,I(),N=void 0,D?.destroy(),ft.delete(R),mt.get(t)===R&&mt.delete(t)}};ft.set(R,T);try{o=e.parse(n,r),c=!0,E(!0)}catch(e){if(d)throw e;o=s,c=!1,C(e)}return k(),L(),mt.set(t,R),R}var St=new Map;function Ct(...e){for(let t of e)St.set(t.type,t)}function wt(e){return St.has(e)}var Tt=5e4,Et=4e6,Dt=5e3;function Ot(e){try{return e()}catch(e){throw e instanceof RangeError?new l(`Diagram is nested too deeply.`,`limit`):e}}function kt(e,t){try{return t()}catch(t){if(t instanceof RangeError)throw new l(`Diagram is nested too deeply.`,`limit`,e);if(t instanceof l){t.type??=e.type,t.mermaidType??=e.mermaidType;let n=D(t.message);n!==t.message&&(t.stack=t.stack?.replace(t.message,()=>n),t.message=n),t.snippet=D(t.snippet)}throw t}}var At=new WeakMap;function jt(e,t=Tt,n=Dt,r){if(e.length>t)throw new l(`Diagram source is longer than the limit of ${t} characters.`,`limit`);let i=Ke(e),a=Ne(i.text);if(a===null)throw new l(`No diagram type detected for the given text.`,`unsupported-diagram`);let o=St.get(a.type);if(o===void 0)throw new l(`Diagram type "${a.type}" is not supported yet.`,`unsupported-diagram`,a);let s=r?{...r,...i.config}:i.config,c=o.keepComments===!0,u=Qe(c?i.withComments:i.text)+`
|
|
44
44
|
`,d=kt(a,()=>m({parsed:u,find:Mt(e,c)},()=>o.parse(u,s,i.title,i.lineOffset,{maxEdges:n})));return{...a,diagram:o,model:d,config:s}}function Mt(e,t){let n,r=``;return i=>{if(n===void 0){n=[];let i=Ke(e,n);Qe(t?i.withComments:ze(i.withComments,n),n),r=Be(e)+`
|
|
45
|
-
`}return[r,f(n,i)]}}function Nt(e,t){if(typeof e==`string`)return jt(e,t.limit,t.maxEdges,t.config);let n=At.get(e);if(n===void 0)throw TypeError(`render() takes diagram text or a model that parse() returned.`);return n}function $(e){return Ne(Ke(e).text)?.type??null}function Pt(e){try{let t=$(e);return t!==null&&St.has(t)}catch{return!1}}function Ft(e,t={}){return Ot(()=>{let n=jt(e,t.limit,t.maxEdges,t.config),r=n.model;return Object.defineProperty(r,"mermaidType",{value:n.mermaidType,enumerable:!0}),At.set(r,n),r})}function It(e,t={}){return Ot(()=>{let{type:n,mermaidType:r,diagram:i,model:a,config:o}=Nt(e,t),s=o[i.section??n],c=typeof s==`object`&&!!s&&!Array.isArray(s)&&s.useMaxWidth===!1,u=t.responsive??!c,d=t.icons,f=d&&(e=>d(O(e))),p=kt({type:n,mermaidType:r},()=>F(i.math?t.math:void 0,()=>j(f,()=>i.render(a,o,{...t,responsive:u,icons:f})))),m=t.outputLimit??Et;if(p.svg.length>m)throw new l(`Diagram output is longer than the limit of ${m} characters.`,`limit`,{type:n,mermaidType:r});for(let e of p.links)e.id=O(e.id);return{type:n,mermaidType:r,...p}})}function Lt(e,t,n={}){return xt({parse:Ft,render:It},e,t,n)}var Rt=e({PeleError:()=>l,detectType:()=>$,enableZoom:()=>ot,forgetTextWidths:()=>he,load:()=>Vt,mount:()=>Lt,mountAsync:()=>Ut,parse:()=>Ft,register:()=>Ct,registered:()=>wt,render:()=>It,renderAsync:()=>Ht,supports:()=>Pt}),zt=new Map([[`flowchart`,()=>t(()=>import(`./
|
|
45
|
+
`}return[r,f(n,i)]}}function Nt(e,t){if(typeof e==`string`)return jt(e,t.limit,t.maxEdges,t.config);let n=At.get(e);if(n===void 0)throw TypeError(`render() takes diagram text or a model that parse() returned.`);return n}function $(e){return Ne(Ke(e).text)?.type??null}function Pt(e){try{let t=$(e);return t!==null&&St.has(t)}catch{return!1}}function Ft(e,t={}){return Ot(()=>{let n=jt(e,t.limit,t.maxEdges,t.config),r=n.model;return Object.defineProperty(r,"mermaidType",{value:n.mermaidType,enumerable:!0}),At.set(r,n),r})}function It(e,t={}){return Ot(()=>{let{type:n,mermaidType:r,diagram:i,model:a,config:o}=Nt(e,t),s=o[i.section??n],c=typeof s==`object`&&!!s&&!Array.isArray(s)&&s.useMaxWidth===!1,u=t.responsive??!c,d=t.icons,f=d&&(e=>d(O(e))),p=kt({type:n,mermaidType:r},()=>F(i.math?t.math:void 0,()=>j(f,()=>i.render(a,o,{...t,responsive:u,icons:f})))),m=t.outputLimit??Et;if(p.svg.length>m)throw new l(`Diagram output is longer than the limit of ${m} characters.`,`limit`,{type:n,mermaidType:r});for(let e of p.links)e.id=O(e.id);return{type:n,mermaidType:r,...p}})}function Lt(e,t,n={}){return xt({parse:Ft,render:It},e,t,n)}var Rt=e({PeleError:()=>l,detectType:()=>$,enableZoom:()=>ot,forgetTextWidths:()=>he,load:()=>Vt,mount:()=>Lt,mountAsync:()=>Ut,parse:()=>Ft,register:()=>Ct,registered:()=>wt,render:()=>It,renderAsync:()=>Ht,supports:()=>Pt}),zt=new Map([[`flowchart`,()=>t(()=>import(`./IECP4ppk.js`).then(e=>e.flowchart),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)],[`pie`,()=>t(()=>import(`./C2EzU0qX.js`).then(e=>e.pie),__vite__mapDeps([12,2,3,13]),import.meta.url)],[`er`,()=>t(()=>import(`./C2QvvHIN.js`).then(e=>e.er),__vite__mapDeps([14,2,3,4,5,7,15,9,10]),import.meta.url)],[`mindmap`,()=>t(()=>import(`./1W6iRjg5.js`).then(e=>e.mindmap),__vite__mapDeps([16,2,3,17,5,6]),import.meta.url)],[`kanban`,()=>t(()=>import(`./BbvUCVY_.js`).then(e=>e.kanban),__vite__mapDeps([18,2,3,17,5,7]),import.meta.url)],[`timeline`,()=>t(()=>import(`./vGOSIW7X.js`).then(e=>e.timeline),__vite__mapDeps([19,20,2,21,3,4]),import.meta.url)],[`journey`,()=>t(()=>import(`./D_xpsaTJ.js`).then(e=>e.journey),__vite__mapDeps([22,20,2,21,3]),import.meta.url)],[`class`,()=>t(()=>import(`./CcRcjPTM.js`).then(e=>e.classDiagram),__vite__mapDeps([23,2,3,4,5,6,7,15,8,9,10]),import.meta.url)],[`quadrantChart`,()=>t(()=>import(`./0KrpTYPM.js`).then(e=>e.quadrantChart),__vite__mapDeps([24,2,3,25]),import.meta.url)],[`xychart`,()=>t(()=>import(`./yy6sD_us.js`).then(e=>e.xychart),__vite__mapDeps([26,2,3,25]),import.meta.url)],[`state`,()=>t(()=>import(`./Ds9L6FPB.js`).then(e=>e.state),__vite__mapDeps([27,2,3,4,5,6,7,10]),import.meta.url)],[`gantt`,()=>t(()=>import(`./DfLI-CvW.js`).then(e=>e.gantt),__vite__mapDeps([28,2,3,7]),import.meta.url)],[`architecture`,()=>t(()=>import(`./CwcA6hab.js`).then(e=>e.architecture),__vite__mapDeps([29,2,3,4,13]),import.meta.url)],[`requirement`,()=>t(()=>import(`./DMTkA0aK.js`).then(e=>e.requirement),__vite__mapDeps([30,2,3,4,5,10]),import.meta.url)],[`sankey`,()=>t(()=>import(`./ZDjPMhAb.js`).then(e=>e.sankey),__vite__mapDeps([31,2,3]),import.meta.url)],[`packet`,()=>t(()=>import(`./DJHLXLij.js`).then(e=>e.packet),__vite__mapDeps([32,2,3,13,33,34]),import.meta.url)],[`radar`,()=>t(()=>import(`./BCsFs14H.js`).then(e=>e.radar),__vite__mapDeps([35,2,3,13]),import.meta.url)],[`treemap`,()=>t(()=>import(`./Df3spPXn.js`).then(e=>e.treemap),__vite__mapDeps([36,2,3,13,33]),import.meta.url)],[`info`,()=>t(()=>import(`./1MewxdCy.js`).then(e=>e.info),__vite__mapDeps([37,2,13]),import.meta.url)],[`sequence`,()=>t(()=>import(`./Cn7j5NKi.js`).then(e=>e.sequence),__vite__mapDeps([38,2,3,4,5,34]),import.meta.url)],[`gitGraph`,()=>t(()=>import(`./yYKJ4mbq.js`).then(e=>e.gitGraph),__vite__mapDeps([39,2,21,3,13]),import.meta.url)],[`c4`,()=>t(()=>import(`./CB6ztdCQ.js`).then(e=>e.c4),__vite__mapDeps([40,2,3,4,6,7,34]),import.meta.url)],[`block`,()=>t(()=>import(`./BjLgp18-.js`).then(e=>e.block),__vite__mapDeps([41,2,3,4,5,6]),import.meta.url)],[`railroad`,()=>t(()=>import(`./B-04K_Pl.js`).then(e=>e.railroad),__vite__mapDeps([42,2,3,13]),import.meta.url)],[`agentflow`,()=>t(()=>import(`./sBy91tGs.js`).then(e=>e.agentflow),__vite__mapDeps([43,2,3,4,6,7,8,9,10,11]),import.meta.url)],[`treeView`,()=>t(()=>import(`./Cl-Xmm9N.js`).then(e=>e.treeView),__vite__mapDeps([44,2,3,13,34,45]),import.meta.url)],[`cynefin`,()=>t(()=>import(`./CpJ4vfn-.js`).then(e=>e.cynefin),__vite__mapDeps([46,2,4,13]),import.meta.url)],[`wardley`,()=>t(()=>import(`./Dns-yz2Q.js`).then(e=>e.wardley),__vite__mapDeps([47,2,3,4,13,45]),import.meta.url)],[`eventmodeling`,()=>t(()=>import(`./DEwfz-Il.js`).then(e=>e.eventmodeling),__vite__mapDeps([48,2,3,4,13,34,45]),import.meta.url)],[`usecase`,()=>t(()=>import(`./DqZ4UzUH.js`).then(e=>e.usecase),__vite__mapDeps([49,2,3,4,5,9,10]),import.meta.url)],[`venn`,()=>t(()=>import(`./fpNFwizw.js`).then(e=>e.venn),__vite__mapDeps([50,2]),import.meta.url)],[`ishikawa`,()=>t(()=>import(`./rv_cF9pp.js`).then(e=>e.ishikawa),__vite__mapDeps([51,2,3,4,34]),import.meta.url)],[`swimlane`,()=>t(()=>import(`./DRKiKCov.js`).then(e=>e.swimlane),__vite__mapDeps([52,2,4,1,3,5,6,7,8,9,10,11]),import.meta.url)]]),Bt=new Map;function Vt(e){if(e===null)return Promise.resolve(!1);if(wt(e))return Promise.resolve(!0);let t=Bt.get(e);if(t===void 0){let n=zt.get(e);if(n===void 0)return Promise.resolve(!1);t=n().then(e=>(Ct(e),!0),t=>{throw Bt.delete(e),t}),Bt.set(e,t)}return t}async function Ht(e,t={}){let n=null;try{n=$(e)}catch{}return await Vt(n),It(e,t)}async function Ut(e,t,n={}){let r=null;try{r=$(t)}catch{}return await Vt(r),Lt(e,t,n)}export{l as PeleError,i as _,h as a,o as b,u as c,O as d,$ as detectType,ot as enableZoom,M as f,he as forgetTextWidths,c as g,n as h,f as i,ee as l,Vt as load,R as m,Lt as mount,Ut as mountAsync,je as n,g as o,I as p,Ft as parse,D as r,Ct as register,wt as registered,It as render,Ht as renderAsync,_ as s,Pt as supports,Rt as t,me as u,r as v,s as x,a as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,g as r,h as i,i as a,o,p as s,r as c,t as l,u,x as d,y as f}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,g as r,h as i,i as a,o,p as s,r as c,t as l,u,x as d,y as f}from"./DS7XcdHs.js";import{r as p}from"./DciMwFJ1.js";import{n as m,r as h,t as g}from"./2BcU70Iq.js";import{t as ee}from"./CdD6waB-.js";import{i as te,r as ne,s as re}from"./DrPF-vh8.js";import{PeleError as _,f as v,n as y,u as ie}from"./BNlziJ_1.js";var b=class{type=`kanban`;title;sections=[];getType=g;last;sectionLevel=0;misplaced;addNode(e,t,n,r,i){let a={id:t,level:e,label:n};if(i!==void 0){let e=i.includes(`
|
|
2
2
|
`)?i+`
|
|
3
3
|
`:`{
|
|
4
4
|
`+i+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,b as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./
|
|
1
|
+
import{_ as e,b as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./DS7XcdHs.js";import{o as c,r as l}from"./DciMwFJ1.js";import{a as u,i as d,s as f}from"./DK9wjWIk.js";import{t as p}from"./CdD6waB-.js";import{a as m,i as h,o as g}from"./_zY4mrA0.js";import{PeleError as _,g as v,h as y,s as b,u as x}from"./BNlziJ_1.js";var S=1e5;function C(e){switch(e){case`[]`:return`square`;case`()`:return`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}function w(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}function T(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}function E(e){return e.includes(`==`)?`thick`:`normal`}function D(e){return e.includes(`.-`)?`dotted`:`solid`}function O(e,t){let n=e.flat(),r=-1;for(let e of n)if(e.type===`column-setting`){r=e.columns??-1;break}return{list:n,at:0,parent:t,children:[],columns:r}}var k=class{type=`block`;title;root={id:`root`,type:`composite`,children:[],columns:-1};blocks=[];edges=[];classes=new Map;byId=new Map;typeStr2Type=C;edgeStrToEdgeData=w;edgeStrToEdgeStartData=T;edgeStrToThickness=E;edgeStrToPattern=D;warn;pending=new Set;edgeCount=new Map;ids=0;colors=0;spaces=0;constructor(e={}){this.warn=e.warn}generateId(){return`id-`+ ++this.ids}addStyleClass(e,t=``){let n=this.classes.get(e);n||(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n));for(let e of t.split(`,`)){let t=e.indexOf(`;`),r=(t===-1?e:e.slice(0,t)+e.slice(t+1)).trim();e.includes(`color`)&&n.textStyles.push(r.replace(`fill`,`bgFill`).replace(`color`,`fill`)),n.styles.push(r)}}addStyle2Node(e,t=``){this.named(e).styles=t.split(`,`)}setCssClass(e,t){for(let n of e.split(`,`))(this.named(n.trim()).classes??=[]).push(t)}named(e){let t=this.byId.get(e);return t===void 0&&(t={id:e,type:`na`,children:[]},this.byId.set(e,t),this.pending.add(e)),t}setHierarchy(e){let t=[O(e,this.root)];for(;t.length>0;){let e=t[t.length-1];if(e.at===e.list.length){e.parent.children=e.children,t.pop();continue}let n=e.list[e.at++];switch(e.columns>0&&n.type!==`column-setting`&&typeof n.widthInColumns==`number`&&n.widthInColumns>e.columns&&this.warn?.(`Block ${n.id} width ${n.widthInColumns} exceeds configured column width ${e.columns}`),n.type){case`classDef`:this.addStyleClass(n.id,n.css);continue;case`applyClass`:this.setCssClass(n.id,n.styleClass??``);continue;case`applyStyles`:n.stylesStr&&this.addStyle2Node(n.id,n.stylesStr);continue;case`column-setting`:e.parent.columns=n.columns??-1;continue;case`edge`:{let e=(this.edgeCount.get(n.id)??0)+1;this.edgeCount.set(n.id,e),n.id=e+`-`+n.id,this.edges.push(n);continue}}n.id??=this.generateId(),n.label||=n.type===`composite`?``:n.id;let r=this.byId.get(n.id),i=r===void 0||this.pending.delete(n.id);i?(r&&(n.classes=r.classes,n.styles=r.styles),n.type===`composite`&&(n.colorIndex=this.colors++),this.byId.set(n.id,n)):(n.type!==`na`&&(r.type=n.type),n.label!==n.id&&(r.label=n.label));let a=n.children;if(n.children=[],n.type===`space`){let t=n.width??1;if(!(t<=S-this.spaces))throw new _(`A block diagram can hold at most ${S} space blocks.`,`limit`,{type:`block`});this.spaces+=Math.max(t,0);for(let r=0;r<t;r++){let t={...n,id:n.id+`-`+r,children:[]};this.byId.set(t.id,t),e.children.push(t)}}else i&&e.children.push(n);a&&a.length>0&&t.push(O(a,n))}this.blocks=this.root.children??[]}},A=`$end.INVALID.BLOCK_DIAGRAM_KEY.id-block.COLUMNS.MD_STR.STR.SPACE_BLOCK.DEFAULT.LINKSTYLE.INTERPOLATE.classDef.DEFAULT_CLASSDEF_ID.CLASSDEF_ID.CLASSDEF_STYLEOPTS.class.CLASSENTITY_IDS.STYLECLASS.style.STYLE_ENTITY_IDS.STYLE_DEFINITION_DATA.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.end.NODE_DSTART.NODE_DEND.BLOCK_ARROW_START.BLOCK_ARROW_END.DIR.NODE_ID.LINK.START_LINK.LINK_LABEL.SIZE.EOF`.split(`.`),j=[`right`,`left`,`x`,`y`,`up`,`down`],M=new Uint8Array(128);for(let e of[9,10,11,12,13,32,40,41,45,58,60,61,62,91,123,125])M[e]=1;function ee(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=(e,t,a)=>(n.push(e),r.push(t),i.push(s),s=a,!0),l=(t,n)=>c(t,e.slice(s,n),n),u=e=>{a.push(o),o=e},d=()=>{a.length>0&&(o=a.pop())},f=n=>{for(;n<t&&y(e.charCodeAt(n));)n++;return n},p=n=>{for(;n<t;){let t=e.charCodeAt(n);if(t<48||t>57)break;n++}return n},m=n=>{for(;n<t&&v(e.charCodeAt(n));)n++;return n},h=t=>e.startsWith(t,s)&&!v(e.charCodeAt(s+t.length)),g=()=>(e.charCodeAt(s+1)===96?(u(2),s+=2):(u(1),s++),!0),_=t=>{if(e.charCodeAt(t)!==46)return-1;do t++;while(e.charCodeAt(t)===46);if(e.charCodeAt(t)!==45)return-1;let n=e.charCodeAt(t+1);return n===120||n===111||n===62?t+2:t+1},b=t=>{let n=e.charCodeAt(t);(n===120||n===111||n===60)&&t++;let r=e.charCodeAt(t);if(r===46)return _(t);if(r!==45&&r!==61)return-1;let i=t+1;for(;e.charCodeAt(i)===r;)i++;if(i-t===1)return r===45?_(i):-1;let a=e.charCodeAt(i);return a===120||a===111||a===62?i+1:i-t>=3?i:-1},x=()=>{let t=b(s);if(t>=0)return l(33,f(t));let n=e.charCodeAt(s)===60?s+1:s,r=e.charCodeAt(n),i=e.charCodeAt(n+1);return r===45&&(i===45||i===46)||r===61&&i===61?(u(6),l(34,f(n+2))):!1},S=n=>{let r=e.indexOf(`
|
|
2
2
|
`,s);return r===-1&&(r=t),d(),l(n,r)},C=(t,n)=>{let r=m(s);if(r===s)return!1;for(;e.charCodeAt(r)===44;){let e=f(r+1),t=m(e);if(t===e)break;r=t}return o=n,l(t,r)},w=n=>{if(y(n))return s=f(s+1),!0;let r;switch(n){case 98:if(e.startsWith(`block`,s)){if(h(`block-beta`))return l(2,s+10);if(e.charCodeAt(s+5)===58)return l(3,s+6);if(!v(e.charCodeAt(s+5)))return l(2,s+5)}break;case 99:if(e.startsWith(`columns`,s)){if(r=f(s+7),r>s+7){if(e.startsWith(`auto`,r)&&!v(e.charCodeAt(r+4)))return c(4,`-1`,r+4);let t=p(r);if(t>r)return c(4,e.slice(r,t),t)}}else if(e.startsWith(`class`,s)){let t=e.startsWith(`Def`,s+5),n=t?s+8:s+5;if(r=f(n),r>n)return u(t?7:9),l(t?11:15,r)}break;case 34:return g();case 115:if(e.startsWith(`space`,s)){if(e.charCodeAt(s+5)===58){let t=p(s+6);if(t>s+6)return c(7,e.slice(s+6,t),t)}if(!v(e.charCodeAt(s+5)))return c(7,`1`,s+5)}else if(e.startsWith(`style`,s)&&(r=f(s+5),r>s+5))return u(11),l(18,r);break;case 100:if(h(`default`))return l(8,s+7);break;case 108:if(h(`linkStyle`))return l(9,s+9);break;case 105:if(h(`interpolate`))return l(10,s+11);break;case 97:if(e.startsWith(`accTitle`,s)){if(r=f(s+8),e.charCodeAt(r)===58)return u(13),l(21,f(r+1))}else if(e.startsWith(`accDescr`,s)){r=f(s+8);let t=e.charCodeAt(r);if(t===58)return u(14),l(23,f(r+1));if(t===123)return u(15),s=f(r+1),!0}break;case 101:if(h(`end`))return l(26,f(s+3));break;case 45:return e.charCodeAt(s+1)===41?(u(3),l(27,s+2)):x();case 61:return x();case 60:return e.charCodeAt(s+1)===91?(u(4),l(29,s+2)):x();case 40:{let t=e.charCodeAt(s+1),n=t===45||t===91?2:t===40?e.charCodeAt(s+2)===40?3:2:1;return u(3),l(27,s+n)}case 41:case 123:return u(3),l(27,e.charCodeAt(s+1)===n?s+2:s+1);case 62:return u(3),l(27,s+1);case 91:{let t=e.charCodeAt(s+1);return u(3),l(27,t===91||t===124||t===40||t===92||t===47?s+2:s+1)}case 58:{let t=p(s+1);return t>s+1&&c(36,e.slice(s+1,t),t)}}for(r=s;r<t;){let t=e.charCodeAt(r);if(t<128?M[t]===1:y(t))break;r++}return r>s&&l(32,r)},T=t=>{let n=e.charCodeAt(s+1),r=0;switch(t){case 34:return g();case 40:r=n===45?2:n===40?e.charCodeAt(s+2)===40?3:2:1;break;case 41:r=n===41?e.charCodeAt(s+2)===41?3:2:n===93?2:1;break;case 125:r=n===125?2:1;break;case 45:r=n===41?2:0;break;case 93:r=n===93||n===41||n===62?2:1;break;case 92:case 47:r=n===93?2:0}return r!==0&&(d(),l(28,s+r))},E=t=>{if(t===41)return d(),d(),c(30,`]>`,f(s+1));let n=f(t===44?s+1:s);for(let r of j)if(e.startsWith(r,n)){let i=f(n+r.length);return c(31,e.slice(t===44?n:s,i),i)}return!1};for(;;){if(s>=t){let e=-1;switch(o){case 0:e=37;break;case 1:e=6;break;case 8:e=14;break;case 10:e=17;break;case 12:e=20;break;case 13:e=22;break;case 14:e=24;break;case 15:e=25}s=t,e!==-1&&c(e,``,t);break}let a=e.charCodeAt(s),p=!0;switch(o){case 0:p=w(a);break;case 1:if(a===34)d(),s++;else{let n=e.indexOf(`"`,s);l(6,n===-1?t:n)}break;case 2:if(a===96)p=e.charCodeAt(s+1)===34,p&&(d(),s+=2);else if(a===34)p=!1;else{let n=s+1;for(;n<t;){let t=e.charCodeAt(n);if(t===96||t===34)break;n++}l(5,n)}break;case 3:p=T(a);break;case 4:if(a===34)g();else if(a===93&&e.charCodeAt(s+1)===62){let t=f(s+2);p=e.charCodeAt(t)===40,p&&(u(5),s=t+1)}else p=!1;break;case 5:p=E(a);break;case 6:if(a===34)e.charCodeAt(s+1)===96?g():(l(35,s+1),u(1));else{let e=b(f(s));p=e>=0,p&&(d(),l(33,f(e)))}break;case 7:{let t=12,n=e.startsWith(`DEFAULT`,s)?s+7:s,r=f(n);(n===s||r===n)&&(t=13,n=m(s),r=f(n)),p=n>s&&r>n,p&&(o=8,l(t,r));break}case 8:S(14);break;case 9:p=C(16,10);break;case 10:S(17);break;case 11:p=C(19,12);break;case 12:S(20);break;case 13:S(22);break;case 14:S(24);break;case 15:if(a===125)d(),s++;else{let n=e.indexOf(`}`,s);l(25,n===-1?t:n)}}if(!p)return n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}}return n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var N=`'NODE_ID', 'COLUMNS', 'SPACE_BLOCK', 'BLOCK_DIAGRAM_KEY', 'id-block', 'classDef', 'class', 'style'`;function P(e){let t=e[e.length-1];return Array.isArray(t)?(e.pop(),e.concat(t)):e}function te(e,t){let{types:n,texts:r,starts:i}=ee(e),a=0,o=t=>{let r=n[a];throw r===1?b(`block`,e,i[a],``,!0):b(`block`,e,i[a],`Expecting ${t}, got '${A[r]}'`)},s=e=>(n[a]!==e&&o(`'${A[e]}'`),r[a++]),c=()=>{let e=s(32);if(n[a]===27){let t=r[a++];return{id:e,label:s(6),typeStr:t+s(28)}}if(n[a]===29){let t=r[a++],i=s(6),o=[s(31)];for(;n[a]===31;)o.push(r[a++]);return{id:e,label:i,typeStr:t+s(30),directions:o}}return{id:e}},l=()=>{let e=c(),i=n[a]===36?parseInt(r[a++],10):1,o={id:e.id,label:e.label,type:t.typeStr2Type(e.typeStr),directions:e.directions,widthInColumns:i},l;for(;n[a]===33||n[a]===34;){let e=``;n[a++]===34&&(s(35),e=s(6),s(33));let i=r[a-1],u=c(),d=t.edgeStrToEdgeData(i),f=t.edgeStrToEdgeStartData(i),p=t.edgeStrToThickness(i),m=t.edgeStrToPattern(i);l??=[{id:o.id,label:o.label,type:o.type,directions:o.directions}],o={id:u.id,label:u.label,type:t.typeStr2Type(u.typeStr),directions:u.directions},l.push({id:l[l.length-1].id+`-`+u.id,start:l[l.length-1].id,end:u.id,label:e,type:`edge`,thickness:p,pattern:m,directions:u.directions,arrowTypeEnd:d,arrowTypeStart:f},o)}return l??o};s(2);let u=[],d=[];for(;;)switch(n[a]){case 32:d.push(l());break;case 4:d.push({type:`column-setting`,columns:parseInt(r[a++],10)});break;case 7:{let e=parseInt(r[a++],10);d.push({id:t.generateId(),type:`space`,label:``,width:e,children:[]});break}case 2:a++,u.push({list:d,header:void 0}),d=[];break;case 3:a++,n[a]!==32&&o(`'NODE_ID'`),u.push({list:d,header:l()}),d=[];break;case 26:{let e=u.pop();if(e===void 0||d.length===0)return o(N);a++;let n=t.generateId(),r=P(d);d=e.list,d.push(e.header===void 0?{id:n,type:`composite`,label:``,children:r}:{...e.header,type:`composite`,children:r});break}case 11:{a++;let e=s(13).trim();d.push({type:`classDef`,id:e,css:s(14).trim()});break}case 15:{a++;let e=s(16).trim();d.push({type:`applyClass`,id:e,styleClass:s(17).trim()});break}case 18:{a++;let e=s(19).trim();d.push({type:`applyStyles`,id:e,stylesStr:s(20).trim()});break}case 37:u.length>0&&o(N+`, 'end'`),d.length===0&&o(N),t.setHierarchy(P(d));return;default:o(d.length===0?N:N+(u.length>0?`, 'end'`:`, 'EOF'`))}}var F=1,I=2,L=4,R=8,z=7,B=20,V=12;function ne(e){let t=0;if(e)for(let n of e)switch(n.trim()){case`right`:t|=F;break;case`left`:t|=I;break;case`up`:t|=L;break;case`down`:t|=R;break;case`x`:t|=F|I;break;case`y`:t|=L|R}return t}var H=(e,t)=>e&t?1:0;function U(e){return e!==0&&(e&(L|R))===0?`x`:e!==0&&(e&(F|I))===0?`y`:``}function re(e,t,n){let r=U(e),i=H(e,I)-H(e,F),a=H(e,L)-H(e,R);if(r===`x`){let r=Math.max(n+8,14)+2*z,a=Math.min(r/2,B);return{w:Math.max(t+12,16)+a*(e===(F|I)?2:1),h:r,dx:i*a/2,dy:0}}if(r===`y`){let r=Math.max(t+16,14)+2*z,i=Math.min(r/2,B);return{w:r,h:Math.max(n+8,16)+i*(e===(L|R)?2:1),dx:0,dy:a*i/2}}return{w:Math.max(t+16,24)+V*(H(e,I)+H(e,F)),h:Math.max(n+8,24)+V*(H(e,L)+H(e,R)),dx:i*V/2,dy:a*V/2}}function ie(e,t,n,r){let i=U(e),a=t/2,o=n/2,c;if(i===`x`){let t=Math.min(o,B),n=o-z,r=e&I?-a+t:-a,i=e&F?a-t:a;c=[r,-n,i,-n],e&F&&c.push(i,-o,a,0,i,o),c.push(i,n,r,n),e&I&&c.push(r,o,-a,0,r,-o)}else if(i===`y`){let t=Math.min(a,B),n=a-z,r=e&L?-o+t:-o,i=e&R?o-t:o;c=[n,r,n,i],e&R&&c.push(a,i,0,o,-a,i),c.push(-n,i,-n,r),e&L&&c.push(-a,r,0,-o,a,r)}else{let t=e&I?-a+V:-a,n=e&F?a-V:a,r=e&L?-o+V:-o,i=e&R?o-V:o,s=(t+n)/2,l=(r+i)/2,u=Math.min(10,(n-t)/2),d=Math.min(10,(i-r)/2);c=[t,r],e&L&&c.push(s-u,r,s,-o,s+u,r),c.push(n,r),e&F&&c.push(n,l-d,a,l,n,l+d),c.push(n,i),e&R&&c.push(s+u,i,s,o,s-u,i),c.push(t,i),e&I&&c.push(t,l+d,-a,l,t,l-d)}let l=``;for(let e=0;e<c.length;e+=2)l+=(e?` `:``)+s(c[e])+`,`+s(c[e+1]);return`<polygon points="${l}" stroke-linejoin="round"${r}/>`}var ae=1e3;function W(e,t){if(e===0||!Number.isInteger(e))throw new _(`Columns must be an integer !== 0.`,`semantic`,{type:`block`});if(t<0||!Number.isInteger(t))throw new _(`Position must be a non-negative integer.`+t,`semantic`,{type:`block`});return e<0?{px:t,py:0}:{px:t%e,py:Math.floor(t/e)}}function G(e,t,n){let r=e.columns,i=[],a=0,o=0,s=0,c=0;for(let n of e.children){let{px:e,py:l}=W(r,a),u=n.span>=1?Math.min(n.span,ae):1;if(r>0&&u>r-e&&(u=r-e),n.span=u,n.col=e,n.row=l,a+=u,e+u>o&&(o=e+u),l===i.length&&i.push(0),n.children.length===0?i[l]=-1:i[l]>=0&&n.nh>i[l]&&(i[l]=n.nh),n.space)continue;let d=(n.nw-t*(u-1))/u;d>s&&(s=d),n.nh>c&&(c=n.nh)}let l=(i.length-1)*t;for(let e=0;e<i.length;e++)i[e]<0&&(i[e]=c),l+=i[e];e.cols=o,e.heights=i,e.nw=Math.max(e.nw,o*s+(o-1)*t+2*n),e.nh=l+2*n+e.head}function K(e,t,n){let{cols:r,heights:i}=e,a=i.length,o=(e.w-2*n-(r-1)*t)/r,s=e.h-2*n-e.head-(a-1)*t,c=0;for(let e of i)c+=e;let l=c>0?s/c:0,u=c>0?0:s/a,d=e.x-e.w/2+n,f=e.y-e.h/2+n+e.head,p=0;for(let n of e.children){for(;p<n.row;p++)f+=i[p]*l+u+t;n.w=o*n.span+t*(n.span-1),n.h=i[p]*l+u,n.x=d+n.col*(o+t)+n.w/2,n.y=f+n.h/2}}function oe(e,t){let n=[e];for(let e=0;e<n.length;e++)for(let t of n[e].children)n.push(t);for(let e=n.length-1;e>=0;e--){let r=n[e];r.children.length>0&&G(r,t,e===0?0:t)}e.w=e.nw,e.h=e.nh,e.x=e.w/2,e.y=e.h/2;for(let e=0;e<n.length;e++){let r=n[e];r.children.length>0&&K(r,t,e===0?0:t)}return{width:e.w,height:e.h}}var se=12,ce=200,q=8,le=` fill="var(--_s)" stroke="var(--_b)"`,ue=` stroke="var(--_b)"`,de=[],fe=[],pe=[],me=[`default`],he=2e6,ge=new Map([[`square`,`rect`],[`round`,`rounded`],[`circle`,`circle`],[`doublecircle`,`dbl-circ`],[`diamond`,`diam`],[`hexagon`,`hex`],[`stadium`,`stadium`],[`subroutine`,`fr-rect`],[`cylinder`,`cyl`],[`rect_left_inv_arrow`,`odd`],[`lean_right`,`lean-r`],[`lean_left`,`lean-l`],[`trapezoid`,`trap-b`],[`inv_trapezoid`,`trap-t`]]),_e=new Set([`circle`,`dbl-circ`,`diam`]),ve=new Set([`stadium`,`hex`,`odd`,`lean-r`,`lean-l`,`trap-b`,`trap-t`]);function J(e){return e.kind===0&&(e.shape===`circle`||e.shape===`dbl-circ`)}function Y(e,t,n){let r=e.bw/2,i=e.bh/2,a=Math.abs(t-e.x),o=i;return J(e)?o=Math.sqrt(Math.max(r*r-a*a,0)):e.kind===0&&e.shape===`diam`?o=i*Math.max(1-a/r,0):e.kind===0?o=i-g(e.shape,e.bw,e.bh,n>0?2:0):e.kind===1&&U(e.mask)===`x`&&(o=i-z),e.y+n*o}function X(e,t,n){let r=e.bw/2,i=e.bh/2,a=Math.abs(t-e.y),o=r;return J(e)?o=Math.sqrt(Math.max(i*i-a*a,0)):e.kind===0&&e.shape===`diam`?o=r*Math.max(1-a/i,0):e.kind===0?o=r-g(e.shape,e.bw,e.bh,n>0?1:3):e.kind===1&&U(e.mask)===`y`&&(o=r-z),e.x+n*o}function Z(e,t,n,r){let i=t-e.x,a=n-e.y,o=e.bw/2,s=e.bh/2,c;c=J(e)?o/(Math.hypot(i,a)||1):e.kind===0&&e.shape===`diam`?1/(Math.abs(i)/o+Math.abs(a)/s||1):Math.min(i===0?1/0:o/Math.abs(i),a===0?1/0:s/Math.abs(a)),c===1/0&&(c=0),r.push(e.x+i*c,e.y+a*c)}function ye(e,t,n,r,i){let a=i.x-i.bw/2+1,o=i.x+i.bw/2-1,s=i.y-i.bh/2+1,c=i.y+i.bh/2-1;if(e<a&&n<a||e>o&&n>o||t<s&&r<s||t>c&&r>c)return!1;if(e===n||t===r)return!0;let l=n-e,u=r-t,d=(n,r)=>Math.sign(l*(r-t)-u*(n-e)),f=d(a,s);return f===0||d(o,s)!==f||d(o,c)!==f||d(a,c)!==f}function Q(e,t,n,r){let i=0;for(let a of r)if(a!==t&&a!==n){for(let t=0;t+3<e.length;t+=2)if(ye(e[t],e[t+1],e[t+2],e[t+3],a)){i++;break}}return i}function be(e,t,n,r){let i=e.x-e.bw/2,a=e.x+e.bw/2,o=e.y-e.bh/2,s=e.y+e.bh/2,c=t.x-t.bw/2,l=t.x+t.bw/2,u=t.y-t.bh/2,d=t.y+t.bh/2,f=Math.max(i,c),p=Math.min(a,l),m=Math.max(o,u),h=Math.min(s,d),g=p-f>6,_=h-m>6;if(g&&_){let n=e.bw*e.bh<=t.bw*t.bh?e:t,r=n===e?t:e,i=n.y-n.bh/2-(r.y-r.bh/2),a=r.y+r.bh/2-(n.y+n.bh/2),o=n.x-n.bw/2-(r.x-r.bw/2),s=r.x+r.bw/2-(n.x+n.bw/2),c=Math.min(i,a,o,s),l;return l=c===a?[n.x,Y(n,n.x,1),n.x,r.y+r.bh/2]:c===i?[n.x,Y(n,n.x,-1),n.x,r.y-r.bh/2]:c===s?[X(n,n.y,1),n.y,r.x+r.bw/2,n.y]:[X(n,n.y,-1),n.y,r.x-r.bw/2,n.y],n===e?l:[l[2],l[3],l[0],l[1]]}if(g){let r=Math.min(6,(p-f)/2),i=Math.min(Math.max((f+p)/2+n,f+r),p-r),a=t.y>e.y?1:-1;return[i,Y(e,i,a),i,Y(t,i,-a)]}if(_){let r=Math.min(6,(h-m)/2),i=Math.min(Math.max((m+h)/2+n,m+r),h-r),a=t.x>e.x?1:-1;return[X(e,i,a),i,X(t,i,-a),i]}let v=t.x>e.x?1:-1,y=t.y>e.y?1:-1,b=[X(e,e.y,v),e.y,t.x,e.y,t.x,Y(t,t.x,-y)],x=[e.x,Y(e,e.x,y),e.x,t.y,X(t,t.y,-v),t.y],S=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y),C=S?b:x;if(r===void 0)return C;let w=Q(C,e,t,r);if(w===0)return C;let T=S?x:b,E=Q(T,e,t,r);if(E<w&&(C=T,w=E),w===0)return C;let D=[];return Z(e,t.x,t.y,D),Z(t,e.x,e.y,D),Q(D,e,t,r)<w?D:C}function xe(e,t,n){let r=e.length,i=e[0],a=e[1],o=e[r-2],c=e[r-1],l=e[2]-i,u=e[3]-a,d=Math.hypot(l,u);l/=d||1,u/=d||1;let f=o-e[r-4],p=c-e[r-3],m=Math.hypot(f,p);if(f/=m||1,p/=m||1,r===4&&t+n>d){let e=d/(t+n);t*=e,n*=e}t=Math.min(t,d),n=Math.min(n,m);let h=`M${s(i+l*t)},${s(a+u*t)}`;if(r===6){let r=Math.max(0,Math.min(q,d-t,m-n));h+=`L${s(e[2]-l*r)},${s(e[3]-u*r)}Q${s(e[2])},${s(e[3])} ${s(e[2]+f*r)},${s(e[3]+p*r)}`}return h+=`L${s(o-f*n)},${s(c-p*n)}`,{d:h,sx:i,sy:a,sdx:-l,sdy:-u,ex:o,ey:c,edx:f,edy:p}}function Se(e,t){let n=e.bw/2,r=e.bh/2,i=Math.max(1,Math.min(10+5*(t-1),n,r));if(J(e)){let t=e.x+n*Math.SQRT1_2,r=e.y-n*Math.SQRT1_2,a=2*Math.asin(Math.min(1,i/(2*n))),o=i=>Math.atan2(e.y-n*Math.sin(i)-r,e.x+n*Math.cos(i)-t);return[t,r,i,o(Math.PI/4+a),o(Math.PI/4-a)]}if(e.kind===0&&e.shape===`diam`){let t=Math.atan2(r,n);return[e.x+n/2,e.y-r/2,i,t+Math.PI,t]}return[e.x+n,e.y-r,i,Math.PI,Math.PI/2]}function Ce(e,t,n,r){let[i,a,o,c,l]=Se(e,t),u=c+n/o,d=l-r/o,f=(d-u)%(2*Math.PI);f<=0&&(f+=2*Math.PI);let p=i+o*Math.cos(u),m=a+o*Math.sin(u),h=i+o*Math.cos(d),g=a+o*Math.sin(d),_=i+o*Math.cos(c),v=a+o*Math.sin(c),y=i+o*Math.cos(l),b=a+o*Math.sin(l),x=Math.hypot(_-p,v-m),S=Math.hypot(y-h,b-g);return{d:`M${s(p)},${s(m)}A${s(o)},${s(o)} 0 ${+(f>Math.PI)} 1 ${s(h)},${s(g)}`,sx:_,sy:v,sdx:x>0?(_-p)/x:Math.sin(c),sdy:x>0?(v-m)/x:-Math.cos(c),ex:y,ey:b,edx:S>0?(y-h)/S:-Math.sin(l),edy:S>0?(b-g)/S:Math.cos(l)}}var $=[.5,.3,.7,.15,.85];function we(e,t,n,r,i,a,o){if(o===void 0)return .5;for(let s of $){let c=e[t]+(e[t+2]-e[t])*s,l=e[t+1]+(e[t+3]-e[t+1])*s,u=!0;for(let e of o)if(e!==i&&e!==a&&Math.abs(c-e.x)<(n+e.bw)/2&&Math.abs(l-e.y)<(r+e.bh)/2){u=!1;break}if(u)return s}return .5}function Te(e,t,n){return c(n,r=>Ee(e,t,n,r))}function Ee(c,g,_,v){let y=_.fontSize??16,b=Math.round(y*.875),S=_.measurer??x(_.fontFamily,_.fontFamilyMono),C=_.padding??8,w=_.icons,T=g.block?.padding,E=Math.min(typeof T==`number`&&T>=0?Math.min(T,200):se,v?6:1/0),D=v?80:ce,O=e=>{let t=[],n=e=>{for(let n of e)for(let e of n.split(`;`))t.push(e)};for(let t of e.classes&&e.classes.length>0?e.classes:me){let e=c.classes.get(t);e&&n(e.styles)}return e.styles&&n(e.styles),a(t)},k=(e,t)=>{let n=e.type,r=n===`space`?a(de):O(e),i=+!!r.bold|(r.italic?2:0),s=r.fontSize??y,c=0,u=``,d,f=0,p=0,m=0,g=0,b=0,x=0;if(n===`space`)c=3,d=o(void 0,!1,S,s,D);else if(n===`composite`)c=2,d=o(e.label,!1,S,s,v?l(_):4e3,i),m=d.height>0?d.height+4:0,f=d.width+2*E,p=m+2*E;else if(n===`block_arrow`){c=1,d=o(e.label,!1,S,s,D,i);let t=!0;for(let e of d.lines)for(let n of e)(n.icon!==void 0||n.text.trim()!==``)&&(t=!1);g=ne(e.directions);let n=t?re(g,0,0):re(g,d.width,d.height);f=n.w,p=n.h,b=n.dx,x=n.dy}else{u=ge.get(n??``)??`rect`,d=o(e.label,!1,S,s,D,i);let t=h(u,d.width,d.height);f=t.w,p=u===`cyl`?Math.max(t.h,d.height+40):t.h,x=t.dy}return{children:[],columns:c===2?e.columns??-1:-1,span:c===3?1:e.widthInColumns??1,space:c===3,head:m,nw:f,nh:p,col:0,row:0,cols:0,heights:pe,x:0,y:0,w:0,h:0,block:e,kind:c,index:t,shape:u,label:d,style:r,mask:g,dx:b,dy:x,bw:0,bh:0}},A=k(c.root,0);A.nw=0,A.nh=0;let j=[A],M=new Map;for(let e=0;e<j.length;e++){let t=j[e];if(t.kind===2)for(let e of t.block.children??fe){let n=k(e,j.length);t.children.push(n),j.push(n),n.kind!==3&&M.set(e.id,n)}}let ee=oe(A,E),N=[];for(let e of j)e.kind===0&&_e.has(e.shape)?(e.bw=e.nw,e.bh=e.nh):e.kind===1?(e.bw=e.span>1?e.w:e.nw,e.bh=e.nh):(e.bw=e.w,e.bh=e.kind===0&&ve.has(e.shape)?e.nh:e.h),e.kind===0&&e.shape===`cyl`&&(e.dy=Math.min(12,Math.max(6,e.bw/14))/2),(e.kind===0||e.kind===1)&&N.push(e);let P=new Map,te=new Set,F=[],I=[];for(let e of c.edges){let t=M.get(e.start??``),n=M.get(e.end??``);if(t===void 0||n===void 0)continue;let r=Math.min(t.index,n.index)*j.length+Math.max(t.index,n.index);P.set(r,(P.get(r)??0)+1),e.label&&te.add(r),F.push([t,n]),I.push(e)}let L=I.length*N.length<=he?N:void 0,R=new Map,z=[],B=0,V=0,H=ee.width,U=ee.height,ae=(e,t,n,r)=>{e-n/2<B&&(B=e-n/2),e+n/2>H&&(H=e+n/2),t-r/2<V&&(V=t-r/2),t+r/2>U&&(U=t+r/2)};for(let e=0;e<I.length;e++){let[t,n]=F[e],r=Math.min(t.index,n.index)*j.length+Math.max(t.index,n.index),i=P.get(r)??1,a=R.get(r)??0;R.set(r,a+1);let s=o(I[e].label,!1,S,b,ce),c,l,u;if(t===n){let[e,n,r]=Se(t,a+1);c=[],ae(e,n,2*r+2,2*r+2),l=e+r+6+s.width/2,u=n-r/2}else{let e=te.has(r)?Math.round(b*1.5)+2:14;c=be(t,n,(a-(i-1)/2)*e,L);let o=c.length,d=Math.abs(c[2]-c[0])+Math.abs(c[3]-c[1]),f=Math.abs(c[o-2]-c[o-4])+Math.abs(c[o-1]-c[o-3]),p=o===6&&f>d?2:0,m=s.width>0?we(c,p,s.width+8,s.height,t,n,L):.5;l=c[p]+(c[p+2]-c[p])*m,u=c[p+1]+(c[p+3]-c[p+1])*m}s.width>0&&ae(l,u,s.width+8,s.height),z.push({edge:I[e],points:c,loop:t===n?a+1:0,label:s,lx:l,ly:u})}let W=p(c.title,S,y,v?l(_):4e3),G=W.height>0?W.height+12:0,K=Math.max(H-B,W.width),q=C-B+(K-(H-B))/2,J=C+G-V;for(let e of j)e.x+=q,e.y+=J;let Y=Math.ceil(K+2*C),X=Math.ceil(U-V+G+2*C),Z=``,ye=``;for(let e=1;e<j.length;e++){let a=j[e];if(a.kind===3)continue;let o=t((a.block.classes??de).join(` `)),c=r(a.block.id);if(a.kind===2){let e=a.y-a.h/2;Z+=`<g class="pele-cluster${o}" data-id="${c}"><rect x="${s(a.x-a.w/2)}" y="${s(e)}" width="${s(a.w)}" height="${s(a.h)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${n(a.style.shape)}/>`+i(a.label,a.x,e+(a.head+E)/2+2,` class="pele-cluster-label" fill="var(--_m)"${a.style.text}`,w)+`</g>`;continue}let l=a.kind===1;ye+=`<g class="pele-node pele-shape-${l?`block-arrow`:a.shape}${o}" data-id="${c}" transform="translate(${s(a.x)},${s(a.y)})">`+(l?ie(a.mask,a.bw,a.bh,le+a.style.shape):m(a.shape,a.bw,a.bh,le+a.style.shape,ue+a.style.line))+i(a.label,a.dx,a.dy,` class="pele-label"${a.style.text}`,w)+`</g>`}let Q=``,$=``;for(let e=0;e<z.length;e++){let{edge:t,points:n,loop:i,label:a}=z[e],o=t.arrowTypeStart??``,s=t.arrowTypeEnd??``,c;if(i>0)c=Ce(F[e][0],i,u(o),u(s));else{for(let e=0;e<n.length;e+=2)n[e]+=q,n[e+1]+=J;c=xe(n,u(o),u(s))}let l=r(t.id);if(Q+=`<g class="pele-edge" data-id="${l}"><path d="${c.d}"${t.thickness===`thick`?` stroke-width="2.5"`:``}${t.pattern===`dotted`?` stroke-dasharray="3 4"`:``}/>`+f(o,c.sx,c.sy,c.sdx,c.sdy,`var(--_l)`)+f(s,c.ex,c.ey,c.edx,c.edy,`var(--_l)`)+`</g>`,a.width>0){let n=z[e].lx+q,r=z[e].ly+J;$+=d(t.id,a,n,r,``,w)}}return{svg:e(`block`,Y,X,y,_,c,i(W,Y/2,C+W.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(Z?`<g class="pele-clusters">${Z}</g>`:``)+(Q?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${Q}</g>`:``)+`<g class="pele-nodes">${ye}</g>`+($?`<g class="pele-edge-labels" font-size="${b}">${$}</g>`:``)),width:Y,height:X,links:[]}}var De={type:`block`,math:!0,parse(e,t,n){let r=new k;return r.title=n,te(e,r),r},render:Te};export{De as block};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,f as t,n,o as r,r as i,t as a}from"./Kem7IXj7.js";function o(e){return e===`BT`||e===`LR`||e===`RL`?e:`TB`}var s=4e4,c=400,l=500,u=1.5,d=4;function f(e,t,n,r){let i=[];for(let t of e)i.push(t.x,t.y,t.w,t.h);let a=[];for(let e of t)a.push(e.labelX,e.labelY);let o=[];for(let e of n){o.push(e.x,e.y);for(let t of e.ports)o.push(t.px,t.py)}return{nodes:i,routes:t.map(e=>e.route),labels:a,levels:o,total:r}}function p(e,t,n,r){t.forEach((t,n)=>{t.x=e.nodes[4*n],t.y=e.nodes[4*n+1],t.w=e.nodes[4*n+2],t.h=e.nodes[4*n+3]}),n.forEach((t,n)=>{t.route=e.routes[n],t.labelX=e.labels[2*n],t.labelY=e.labels[2*n+1]});let i=0;for(let t of r){t.x=e.levels[i++],t.y=e.levels[i++];for(let n of t.ports)n.px=e.levels[i++],n.py=e.levels[i++]}return e.total}var m=24,h=.5,g=3,_=2,v=Math.max(3,g,_+1),y=.62,b=128;function x(e){return e.tracks?1:e.straight?2:0}function S(e,t,n=0){let r=0;for(let e of t)e.src!==e.dst&&e.route.length>3&&(r+=(e.route.length/3-1)*v);let a=new Float64Array(r),o=new Float64Array(r),s=new Float64Array(r),c=new Float64Array(r),l=new Float64Array(r),u=new Float64Array(r),d=new Int32Array(r),f=new Uint8Array(r),p=0,x=1/0,S=-1/0,C=NaN,w=NaN,T=NaN,E=NaN,D=(e,t,n,r,i,m)=>{let h=p-1;n===T&&r===E&&(m===r&&w===r||i===n&&C===n)&&d[h]===e&&f[h]===t&&(n-C)*(i-n)+(r-w)*(m-r)>0&&(p--,n=C,r=w),C=n,w=r,T=i,E=m,f[p]=t,a[p]=Math.min(n,i),s[p]=Math.max(n,i),o[p]=n<=i?r:m,c[p]=n<=i?m:r,l[p]=Math.min(r,m),u[p]=Math.max(r,m),l[p]<x&&(x=l[p]),u[p]>S&&(S=u[p]),d[p++]=e};for(let e=0;e<t.length;e++){let r=t[e];if(r.src===r.dst)continue;let a=r.route,o=e=>Math.abs(a[e]-a[e-3])<.01||Math.abs(a[e+1]-a[e-2])<.01,s=e=>Math.abs(a[e]-a[e-3])+Math.abs(a[e+1]-a[e-2]),c=e=>n===0&&e>0&&e<a.length-3&&o(e)&&o(e+3)&&s(e)>=.01&&s(e+3)>=.01&&Math.abs(a[e]-a[e-3])<.01!=Math.abs(a[e+3]-a[e])<.01,l=a[0],u=a[1];for(let t=3;t<a.length;t+=3){let r=+(t===3)|(t===a.length-3?2:0),d=l,f=u,p=a[t],m=a[t+1];if(l=p,u=m,o(t)||n===2){if(!c(t)){D(e,r,d,f,p,m);continue}let n=c(t-3)?s(t)/2:s(t),i=c(t+3)?s(t+3)/2:s(t+3),o=(p-a[t-3])/s(t),h=(m-a[t-2])/s(t),g=(a[t+3]-p)/s(t+3),v=(a[t+4]-m)/s(t+3),b=p-o*n,x=m-h*n;D(e,r,d,f,b,x);let S=p-o*n*(1-y),C=m-h*n*(1-y),w=p+g*i*(1-y),T=m+v*i*(1-y);l=p+g*i,u=m+v*i;let E=r|(t+3===a.length-3?2:0),O=b,k=x;for(let t=1;t<=_;t++){let n=t/_,r=1-n,i=r*r*r*b+3*r*r*n*S+3*r*n*n*w+n*n*n*l,a=r*r*r*x+3*r*r*n*C+3*r*n*n*T+n*n*n*u;D(e,E,O,k,i,a),O=i,k=a}continue}if(n===1){let n=a[t+2]===0,i=n?d:(d+p)/2,o=n?(f+m)/2:f;D(e,r,d,f,i,o),D(e,r,i,o,n?p:i,n?o:m),D(e,r,n?p:i,n?o:m,p,m);continue}let h=a[t+2]===0,v=h?i(p-d,m-f):i(m-f,p-d),b=d,x=f;for(let t=1;t<=g;t++){let n=t/g,i=1-n,a=n*n*(3-2*n),o=3*v*n*i*i+3*(1-v)*n*n*i+n*n*n,s=d+(p-d)*(h?a:o),c=f+(m-f)*(h?o:a);D(e,r,b,x,s,c),b=s,x=c}}}let O=S>x?Math.round(Math.sqrt(p)):1,k=S>x?O/(S-x):0,A=e=>Math.min(O-1,Math.floor((e-x)*k)),j=new Int32Array(p),M=new Int32Array(O+1);for(let e=0;e<p;e++){j[e]=A(l[e]);for(let t=j[e],n=A(u[e]);t<=n;t++)M[t+1]++}for(let e=0;e<O;e++)M[e+1]+=M[e];let N=M.slice(0,O),P=new Int32Array(M[O]);for(let e=0;e<p;e++)for(let t=j[e],n=A(u[e]);t<=n;t++)P[N[t]++]=e;let F=new Float64Array(t.length*8),I=(e,t,n,r)=>Math.abs(e[t]-e[n])<h&&Math.abs(e[t]-e[r])<h||Math.abs(e[t+1]-e[n+1])<h&&Math.abs(e[t+1]-e[r+1])<h;for(let e=0;e<t.length;e++){let n=t[e].route;if(n.length<6)continue;let r=3;for(;r+3<n.length&&I(n,0,r,r+3);)r+=3;let i=n.length-3,a=i-3;for(;a>=3&&I(n,i,a,a-3);)a-=3;F.set([n[0],n[1],n[r],n[r+1],n[a],n[a+1],n[i],n[i+1]],e*8)}let L=(e,t,n,r)=>{let i=e*8+(t===1?0:4),a=F[i],o=F[i+1],s=F[i+2]-a,c=F[i+3]-o,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((n-a)*s+(r-o)*c)/l)):0;return Math.hypot(n-a-u*s,r-o-u*c)<h},R=0;for(let n=0;n<O;n++){let r=M[n+1];if(r-M[n]>b)P.subarray(M[n],r).sort((e,t)=>a[e]-a[t]||e-t);else for(let e=M[n]+1;e<r;e++){let t=P[e],r=e;for(;r>M[n]&&a[P[r-1]]>a[t];r--)P[r]=P[r-1];P[r]=t}for(let i=M[n];i<r;i++){let p=P[i],h=s[p]-a[p],g=c[p]-o[p],_=j[p]===n;for(let v=i+1;v<r;v++){let r=P[v];if(a[r]>s[p])break;if(u[r]<l[p]||l[r]>u[p]||d[p]===d[r]||!_&&j[r]!==n)continue;let i=h*(o[r]-o[p])-g*(a[r]-a[p]),y=h*(c[r]-o[p])-g*(s[r]-a[p]);if(i>0==y>0)continue;let b=s[r]-a[r],x=c[r]-o[r],S=b*(o[p]-o[r])-x*(a[p]-a[r]),C=b*(c[p]-o[r])-x*(s[p]-a[r]);if(S>0==C>0)continue;let w=t[d[p]],T=t[d[r]],E=S/(S-C),D=a[p]+E*h,O=o[p]+E*g,k=(t,n,i)=>(f[p]&n)!==0&&(f[r]&i)!==0||Math.abs(D-e[t].x)<e[t].w/2+m&&Math.abs(O-e[t].y)<e[t].h/2+m||L(d[p],n,D,O)&&L(d[r],i,D,O);w.src===T.src&&k(w.src,1,1)||w.src===T.dst&&k(w.src,1,2)||w.dst===T.src&&k(w.dst,2,1)||w.dst===T.dst&&k(w.dst,2,2)||R++}}}return R}function C(e,t,n,r){for(let t of e)t.x+=n,t.y+=r;for(let e of t){for(let t=0;t<e.route.length;t+=3)e.route[t]+=n,e.route[t+1]+=r;e.labelX+=n,e.labelY+=r}}function w(e,t,n=-1){return{w:e,h:t,parent:n,isGroup:!1,dir:void 0,padX:0,padTop:0,padBottom:0,minW:0,seq:0,span:0,x:0,y:0}}function T(e){return e===`TB`?0:e===`BT`?2:e===`LR`?3:1}function E(e){return e+2&3}function D(i,o,m,g){let _=i.length,v=new Map,y=[],b=(e,t)=>{let n={id:e,dir:t,items:[],edges:[],ports:[],portOf:new Map,routes:new Map,x:0,y:0};return v.set(e,n),n},C=b(-1,m),w=[];for(let e=0;e<_;e++)w.push([]);let D=[];for(let e=0;e<_;e++){let t=i[e].parent;t>=0&&t<_&&t!==e&&i[t].isGroup?w[t].push(e):(i[e].parent=-1,D.push(e))}C.items=D,y.push(C);let O=new Int32Array(_),k=new Uint8Array(_),A=e=>{for(let t=e;t<y.length;t++){let e=y[t];for(let t of e.items)if(k[t]=1,O[t]=e.id<0?0:O[e.id]+1,i[t].isGroup){let n=b(t,i[t].dir??e.dir);n.items=w[t],y.push(n)}}};A(0);for(let e=0;e<_;e++){if(k[e])continue;let t=i[e].parent;if(w[t]=w[t].filter(t=>t!==e),i[e].parent=-1,C.items.push(e),k[e]=1,O[e]=0,i[e].isGroup){let t=y.length,n=b(e,i[e].dir??m);n.items=w[e],y.push(n),A(t)}}for(let e=y.length-1;e>0;e--){let t=y[e],n=1/0;for(let e of t.items)i[e].seq<n&&(n=i[e].seq);n!==1/0&&(i[t.id].seq=n)}for(let e of y)e.items.sort((e,t)=>i[e].seq-i[t].seq||e-t);let j=0;for(let e of o){let t=e.src,n=e.dst,r=0;for(;O[t]>O[n];r++)t=i[t].parent;for(;O[n]>O[t];r++)n=i[n].parent;for(;t!==n&&i[t].parent!==i[n].parent;r+=2)t=i[t].parent,n=i[n].parent;t!==n&&(j+r>s?(e.src=t,e.dst=n):j+=r)}let M=[],N=[];for(let e=0;e<o.length;e++){let t=o[e];if(t.route=[],t.src===t.dst){M.push(e);continue}let n=t.src,r=t.dst,a=[],s=[];for(;O[n]>O[r];)a.push(n),n=i[n].parent;for(;O[r]>O[n];)s.push(r),r=i[r].parent;if(n===r)N.push(e);else{for(;i[n].parent!==i[r].parent;)a.push(n),s.push(r),n=i[n].parent,r=i[r].parent;v.get(i[n].parent).edges.push({e,a:n,b:r});for(let[t,n]of[[a,!0],[s,!1]])for(let r of t){let t=v.get(i[r].parent),a={e,inner:r,out:n,side:0,hint:NaN,px:0,py:0,route:[]};t.ports.push(a),t.portOf.set(e*2+ +!n,a)}}}let P=new Int32Array(_),F=(e,t,n)=>(n?t.src:t.dst)!==e,I=(e,t)=>{let n=e.dir===`TB`||e.dir===`BT`,s=T(e.dir),c=[],l=[];e.items.forEach((e,a)=>{P[e]=a;let o=i[e],s=t?r(n?o.w:o.h,n?o.h:o.w):r(0,0);s.span=o.isGroup?Math.min(o.span,s.w-2*o.padX):o.span,s.key=z?R[e]:NaN,c.push(s)});let u=(e,t,n)=>i[e].isGroup&&F(e,o[t],n),d=(e,r,a)=>{if(!t||!i[e].isGroup||!F(e,o[r],a))return 0;let s=v.get(e).portOf.get(r*2+ +!a);return n?s.px-i[e].w/2:s.py-i[e].h/2};for(let r of e.edges){let e=o[r.e],i=a(P[r.a],P[r.b],e.minlen);t&&(i.labelW=n?e.labelW:e.labelH,i.labelH=n?e.labelH:e.labelW,i.tailDx=d(r.a,r.e,!0),i.headDx=d(r.b,r.e,!1),i.tailFixed=u(r.a,r.e,!0),i.headFixed=u(r.b,r.e,!1)),l.push(i)}let f=new Int32Array(e.ports.length).fill(-1);return e.ports.forEach((t,n)=>{if(t.side===s||t.side===E(s)){let i=c.length,p=r(0,0,t.side===s?3:4);p.key=z?R[t.out?o[t.e].dst:o[t.e].src]:NaN,p.hint=Number.isNaN(t.hint)&&z&&V?V(e,t):t.hint,c.push(p),f[n]=i;let m=t.out?a(P[t.inner],i):a(i,P[t.inner]);t.out?(m.tailDx=d(t.inner,t.e,!0),m.tailFixed=u(t.inner,t.e,!0)):(m.headDx=d(t.inner,t.e,!1),m.headFixed=u(t.inner,t.e,!1)),l.push(m)}else c[P[t.inner]].pin=t.side===0||t.side===3?-1:1}),{lnodes:c,ledges:l,dummies:f}},L=j>1&&j<=c&&o.length<=l,R=new Float64Array(_).fill(NaN),z=!1,B=0,V,H=y.length>1&&L;for(let e of y)e.dir!==m&&(H=!1);if(H){let t=m===`TB`||m===`BT`,n=new Int32Array(_).fill(-1),s=new Int32Array(_).fill(-1),c=[],l=[],u=[];for(let e=0;e<_;e++)i[e].isGroup&&(s[e]=u.length,u.push(-1));for(let e=0;e<_;e++){let a=i[e].parent;i[e].isGroup?u[s[e]]=a>=0?s[a]:-1:(n[e]=c.length,c.push(r(t?i[e].w:i[e].h,t?i[e].h:i[e].w)),l.push(a>=0?s[a]:-1))}let d=[],f=new Int32Array(o.length).fill(-1);o.forEach((e,r)=>{e.src===e.dst||n[e.src]<0||n[e.dst]<0||(f[r]=d.length,d.push(a(n[e.src],n[e.dst],e.minlen,t?e.labelW:e.labelH,t?e.labelH:e.labelW)))});let p=e(c,d,{...g,groups:{of:Int32Array.from(l),parent:Int32Array.from(u)},orderOnly:!0});B=Math.min(p.crossings??0,p.declared??0);let h=new Float64Array(_),v=new Int32Array(_),y=new Int32Array(_).fill(-1);for(let e=0;e<_;e++)if(!(n[e]<0)){R[e]=c[n[e]].x;for(let t=i[e].parent;t>=0;t=i[t].parent)h[t]+=R[e],v[t]++,y[t]=Math.max(y[t],c[n[e]].rank)}for(let e=0;e<_;e++)v[e]>0&&(R[e]=h[e]/v[e]);V=(e,t)=>{let n=f[t.e];if(n<0||e.id<0||!t.out||t.side!==E(T(e.dir)))return NaN;let r=d[n].points,i=R[o[t.e].src],a=0;for(let t=0;t<r.length;t+=2)r[t]===y[e.id]&&(i=r[t+1]),r[t]===y[e.id]+1&&(a=r[t+1]);return i+a*1e-6}}let U=new Map,W=(t,n,r)=>{if(!L)return{lnodes:n,ledges:r,size:e(n,r,g)};let i=[];for(let e of n)i.push(e.w,e.h,e.kind,e.pin,e.hint,e.key,e.span);for(let e of r)i.push(e.tail,e.head,e.minlen,e.labelW,e.labelH,e.tailDx,e.headDx,+e.tailFixed,+e.headFixed);let a=U.get(t.id);a||U.set(t.id,a=[]);for(let e of a){let t=e.given.length===i.length;for(let n=0;t&&n<i.length;n++)t=Object.is(e.given[n],i[n]);if(t)return e}let o={given:i,lnodes:n,ledges:r,size:e(n,r,g)};return a.push(o),o},G={width:0,height:0},K=()=>{for(let e of y){for(let t of e.ports)i[t.inner].isGroup&&F(t.inner,o[t.e],t.out)&&(v.get(t.inner).portOf.get(t.e*2+ +!t.out).side=t.side);if(e.edges.length===0)continue;let r=!1;for(let t of e.edges){let e=o[t.e];(i[t.a].isGroup&&e.src!==t.a||i[t.b].isGroup&&e.dst!==t.b)&&(r=!0)}if(!r)continue;let{lnodes:a,ledges:s}=I(e,!1);t(a,s),n(a,s,1);let c=T(e.dir);e.edges.forEach((e,t)=>{let n=o[e.e],r=!s[t].reversed;i[e.a].isGroup&&n.src!==e.a&&(v.get(e.a).portOf.get(e.e*2).side=r?E(c):c),i[e.b].isGroup&&n.dst!==e.b&&(v.get(e.b).portOf.get(e.e*2+1).side=r?c:E(c))})}for(let e=y.length-1;e>=0;e--){let t=y[e],n=t.id>=0?i[t.id]:void 0,r=t.dir===`TB`||t.dir===`BT`,a=t.dir===`BT`||t.dir===`RL`,s=I(t,!0),{lnodes:c,ledges:l,size:u}=W(t,s.lnodes,s.ledges),d=s.dummies,f=r?u.width:u.height,p=r?u.height:u.width,m=n?n.padX:0,h=n?n.padTop:0,g=Math.max(f+2*m,n?n.minW:0),_=p+h+(n?n.padBottom:0),b=(g-f)/2,x=h,S=(e,t)=>b+(r?e:a?u.height-t:t),C=(e,t)=>x+(r?a?u.height-t:t:e),w=+!r,T=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(S(e[n],e[n+1]),C(e[n],e[n+1]),w);return t};t.items.forEach((e,t)=>{i[e].x=S(c[t].x,c[t].y),i[e].y=C(c[t].x,c[t].y)}),t.edges.forEach((e,n)=>{let r=l[n];t.routes.set(e.e,T(r.points));let i=o[e.e];i.labelW>0&&(i.labelX=S(r.labelX,r.labelY),i.labelY=C(r.labelX,r.labelY))});let E=t.edges.length;t.ports.forEach((e,t)=>{let n=i[e.inner];if(d[t]>=0){let t=T(l[E++].points),n=e.out?t.length-3:0,r=t[n],i=t[n+1];e.side===0?i=0:e.side===2?i=_:r=e.side===3?0:g,e.out?t.push(r,i,w):t.unshift(r,i,w),e.px=r,e.py=i,e.route=t;return}let r=n.x,a=n.y;if(n.isGroup&&F(e.inner,o[e.e],e.out)){let t=v.get(e.inner).portOf.get(e.e*2+ +!e.out);r+=t.px-n.w/2,a+=t.py-n.h/2}else e.side===0?a-=n.h/2:e.side===2?a+=n.h/2:e.side===3?r-=n.w/2:r+=n.w/2;let s=r,c=a;e.side===0?c=0:e.side===2?c=_:s=e.side===3?0:g;let u=e.side===0||e.side===2?0:1;e.px=s,e.py=c,e.route=e.out?[r,a,u,s,c,u]:[s,c,u,r,a,u]}),n?(n.w=g,n.h=_):G={width:g,height:_}}for(let e of y){let t=e.x,n=e.y;for(let r of e.items){let e=i[r];if(e.x+=t,e.y+=n,e.isGroup){let t=v.get(r);t.x=e.x-e.w/2,t.y=e.y-e.h/2}}}let e=(e,t,n,r)=>{for(let i=0;i<t.length;i+=3){let a=t[i]+n,o=t[i+1]+r,s=e.length;s>=3&&Math.abs(e[s-3]-a)<.01&&Math.abs(e[s-2]-o)<.01||e.push(a,o,t[i+2])}};for(let t of y)for(let n of t.edges){let r=o[n.e],a=[],s=[];for(let e=r.src;i[e].parent!==t.id;e=i[e].parent)s.push(v.get(i[e].parent));for(let t of s)e(a,t.portOf.get(n.e*2).route,t.x,t.y);e(a,t.routes.get(n.e),t.x,t.y);let c=[];for(let e=r.dst;i[e].parent!==t.id;e=i[e].parent)c.push(v.get(i[e].parent));for(let t=c.length-1;t>=0;t--)e(a,c[t].portOf.get(n.e*2+1).route,c[t].x,c[t].y);r.route=a,r.labelW>0&&(r.labelX+=t.x,r.labelY+=t.y)}},q=x(g);z=H,K();let J=-1;if(H&&(J=S(i,o,q),J>B*u+d)){let e=f(i,o,y,G);z=!1,K();let t=S(i,o,q);t>=J?(z=!0,G=p(e,i,o,y)):J=t}if(z===H&&L){let e=!1;for(let t of y){if(t.id<0)continue;let n=i[t.id],r=t.dir===`TB`||t.dir===`BT`,a=E(T(t.dir)),s=[];for(let e of t.ports){if(e.side!==a)continue;let i=o[e.e].route,c=t.x+e.px,l=t.y+e.py,u=-1;for(let t=0;t<i.length&&(u<0||e.out);t+=3)Math.abs(i[t]-c)<.01&&Math.abs(i[t+1]-l)<.01&&(u=t);if(u<0)continue;let d=+!r,f=e.out?u+3:u-3;for(;f>=0&&f<i.length&&Math.abs(i[f+d]-i[u+d])<h;)f+=e.out?3:-3;f<0||f>=i.length||(e.hint=i[f+d]-(r?n.x-n.w/2:n.y-n.h/2),s.push([r?e.px:e.py,e.hint]))}s.sort((e,t)=>e[0]-t[0]);for(let t=1;t<s.length;t++)s[t-1][1]>s[t][1]&&(e=!0)}if(e){let e=J>=0?J:S(i,o,q),t=e>0?f(i,o,y,G):void 0;t&&(K(),S(i,o,q)>=e&&(G=p(t,i,o,y)))}}for(let e of N){let t=o[e],n=i[t.src],r=i[t.dst];t.route=[n.x,n.y,0,r.x,r.y,0],t.labelX=(n.x+r.x)/2,t.labelY=(n.y+r.y)/2}for(let e of M){let t=o[e],n=i[t.src];t.labelX=n.x+n.w/2+28+t.labelW/2,t.labelY=n.y}return G}export{D as i,C as n,o as r,w as t};
|
|
1
|
+
import{c as e,f as t,n,o as r,r as i,t as a}from"./DK9wjWIk.js";function o(e){return e===`BT`||e===`LR`||e===`RL`?e:`TB`}var s=4e4,c=400,l=500,u=1.5,d=4;function f(e,t,n,r){let i=[];for(let t of e)i.push(t.x,t.y,t.w,t.h);let a=[];for(let e of t)a.push(e.labelX,e.labelY);let o=[];for(let e of n){o.push(e.x,e.y);for(let t of e.ports)o.push(t.px,t.py)}return{nodes:i,routes:t.map(e=>e.route),labels:a,levels:o,total:r}}function p(e,t,n,r){t.forEach((t,n)=>{t.x=e.nodes[4*n],t.y=e.nodes[4*n+1],t.w=e.nodes[4*n+2],t.h=e.nodes[4*n+3]}),n.forEach((t,n)=>{t.route=e.routes[n],t.labelX=e.labels[2*n],t.labelY=e.labels[2*n+1]});let i=0;for(let t of r){t.x=e.levels[i++],t.y=e.levels[i++];for(let n of t.ports)n.px=e.levels[i++],n.py=e.levels[i++]}return e.total}var m=24,h=.5,g=3,_=2,v=Math.max(3,g,_+1),y=.62,b=128;function x(e){return e.tracks?1:e.straight?2:0}function S(e,t,n=0){let r=0;for(let e of t)e.src!==e.dst&&e.route.length>3&&(r+=(e.route.length/3-1)*v);let a=new Float64Array(r),o=new Float64Array(r),s=new Float64Array(r),c=new Float64Array(r),l=new Float64Array(r),u=new Float64Array(r),d=new Int32Array(r),f=new Uint8Array(r),p=0,x=1/0,S=-1/0,C=NaN,w=NaN,T=NaN,E=NaN,D=(e,t,n,r,i,m)=>{let h=p-1;n===T&&r===E&&(m===r&&w===r||i===n&&C===n)&&d[h]===e&&f[h]===t&&(n-C)*(i-n)+(r-w)*(m-r)>0&&(p--,n=C,r=w),C=n,w=r,T=i,E=m,f[p]=t,a[p]=Math.min(n,i),s[p]=Math.max(n,i),o[p]=n<=i?r:m,c[p]=n<=i?m:r,l[p]=Math.min(r,m),u[p]=Math.max(r,m),l[p]<x&&(x=l[p]),u[p]>S&&(S=u[p]),d[p++]=e};for(let e=0;e<t.length;e++){let r=t[e];if(r.src===r.dst)continue;let a=r.route,o=e=>Math.abs(a[e]-a[e-3])<.01||Math.abs(a[e+1]-a[e-2])<.01,s=e=>Math.abs(a[e]-a[e-3])+Math.abs(a[e+1]-a[e-2]),c=e=>n===0&&e>0&&e<a.length-3&&o(e)&&o(e+3)&&s(e)>=.01&&s(e+3)>=.01&&Math.abs(a[e]-a[e-3])<.01!=Math.abs(a[e+3]-a[e])<.01,l=a[0],u=a[1];for(let t=3;t<a.length;t+=3){let r=+(t===3)|(t===a.length-3?2:0),d=l,f=u,p=a[t],m=a[t+1];if(l=p,u=m,o(t)||n===2){if(!c(t)){D(e,r,d,f,p,m);continue}let n=c(t-3)?s(t)/2:s(t),i=c(t+3)?s(t+3)/2:s(t+3),o=(p-a[t-3])/s(t),h=(m-a[t-2])/s(t),g=(a[t+3]-p)/s(t+3),v=(a[t+4]-m)/s(t+3),b=p-o*n,x=m-h*n;D(e,r,d,f,b,x);let S=p-o*n*(1-y),C=m-h*n*(1-y),w=p+g*i*(1-y),T=m+v*i*(1-y);l=p+g*i,u=m+v*i;let E=r|(t+3===a.length-3?2:0),O=b,k=x;for(let t=1;t<=_;t++){let n=t/_,r=1-n,i=r*r*r*b+3*r*r*n*S+3*r*n*n*w+n*n*n*l,a=r*r*r*x+3*r*r*n*C+3*r*n*n*T+n*n*n*u;D(e,E,O,k,i,a),O=i,k=a}continue}if(n===1){let n=a[t+2]===0,i=n?d:(d+p)/2,o=n?(f+m)/2:f;D(e,r,d,f,i,o),D(e,r,i,o,n?p:i,n?o:m),D(e,r,n?p:i,n?o:m,p,m);continue}let h=a[t+2]===0,v=h?i(p-d,m-f):i(m-f,p-d),b=d,x=f;for(let t=1;t<=g;t++){let n=t/g,i=1-n,a=n*n*(3-2*n),o=3*v*n*i*i+3*(1-v)*n*n*i+n*n*n,s=d+(p-d)*(h?a:o),c=f+(m-f)*(h?o:a);D(e,r,b,x,s,c),b=s,x=c}}}let O=S>x?Math.round(Math.sqrt(p)):1,k=S>x?O/(S-x):0,A=e=>Math.min(O-1,Math.floor((e-x)*k)),j=new Int32Array(p),M=new Int32Array(O+1);for(let e=0;e<p;e++){j[e]=A(l[e]);for(let t=j[e],n=A(u[e]);t<=n;t++)M[t+1]++}for(let e=0;e<O;e++)M[e+1]+=M[e];let N=M.slice(0,O),P=new Int32Array(M[O]);for(let e=0;e<p;e++)for(let t=j[e],n=A(u[e]);t<=n;t++)P[N[t]++]=e;let F=new Float64Array(t.length*8),I=(e,t,n,r)=>Math.abs(e[t]-e[n])<h&&Math.abs(e[t]-e[r])<h||Math.abs(e[t+1]-e[n+1])<h&&Math.abs(e[t+1]-e[r+1])<h;for(let e=0;e<t.length;e++){let n=t[e].route;if(n.length<6)continue;let r=3;for(;r+3<n.length&&I(n,0,r,r+3);)r+=3;let i=n.length-3,a=i-3;for(;a>=3&&I(n,i,a,a-3);)a-=3;F.set([n[0],n[1],n[r],n[r+1],n[a],n[a+1],n[i],n[i+1]],e*8)}let L=(e,t,n,r)=>{let i=e*8+(t===1?0:4),a=F[i],o=F[i+1],s=F[i+2]-a,c=F[i+3]-o,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((n-a)*s+(r-o)*c)/l)):0;return Math.hypot(n-a-u*s,r-o-u*c)<h},R=0;for(let n=0;n<O;n++){let r=M[n+1];if(r-M[n]>b)P.subarray(M[n],r).sort((e,t)=>a[e]-a[t]||e-t);else for(let e=M[n]+1;e<r;e++){let t=P[e],r=e;for(;r>M[n]&&a[P[r-1]]>a[t];r--)P[r]=P[r-1];P[r]=t}for(let i=M[n];i<r;i++){let p=P[i],h=s[p]-a[p],g=c[p]-o[p],_=j[p]===n;for(let v=i+1;v<r;v++){let r=P[v];if(a[r]>s[p])break;if(u[r]<l[p]||l[r]>u[p]||d[p]===d[r]||!_&&j[r]!==n)continue;let i=h*(o[r]-o[p])-g*(a[r]-a[p]),y=h*(c[r]-o[p])-g*(s[r]-a[p]);if(i>0==y>0)continue;let b=s[r]-a[r],x=c[r]-o[r],S=b*(o[p]-o[r])-x*(a[p]-a[r]),C=b*(c[p]-o[r])-x*(s[p]-a[r]);if(S>0==C>0)continue;let w=t[d[p]],T=t[d[r]],E=S/(S-C),D=a[p]+E*h,O=o[p]+E*g,k=(t,n,i)=>(f[p]&n)!==0&&(f[r]&i)!==0||Math.abs(D-e[t].x)<e[t].w/2+m&&Math.abs(O-e[t].y)<e[t].h/2+m||L(d[p],n,D,O)&&L(d[r],i,D,O);w.src===T.src&&k(w.src,1,1)||w.src===T.dst&&k(w.src,1,2)||w.dst===T.src&&k(w.dst,2,1)||w.dst===T.dst&&k(w.dst,2,2)||R++}}}return R}function C(e,t,n,r){for(let t of e)t.x+=n,t.y+=r;for(let e of t){for(let t=0;t<e.route.length;t+=3)e.route[t]+=n,e.route[t+1]+=r;e.labelX+=n,e.labelY+=r}}function w(e,t,n=-1){return{w:e,h:t,parent:n,isGroup:!1,dir:void 0,padX:0,padTop:0,padBottom:0,minW:0,seq:0,span:0,x:0,y:0}}function T(e){return e===`TB`?0:e===`BT`?2:e===`LR`?3:1}function E(e){return e+2&3}function D(i,o,m,g){let _=i.length,v=new Map,y=[],b=(e,t)=>{let n={id:e,dir:t,items:[],edges:[],ports:[],portOf:new Map,routes:new Map,x:0,y:0};return v.set(e,n),n},C=b(-1,m),w=[];for(let e=0;e<_;e++)w.push([]);let D=[];for(let e=0;e<_;e++){let t=i[e].parent;t>=0&&t<_&&t!==e&&i[t].isGroup?w[t].push(e):(i[e].parent=-1,D.push(e))}C.items=D,y.push(C);let O=new Int32Array(_),k=new Uint8Array(_),A=e=>{for(let t=e;t<y.length;t++){let e=y[t];for(let t of e.items)if(k[t]=1,O[t]=e.id<0?0:O[e.id]+1,i[t].isGroup){let n=b(t,i[t].dir??e.dir);n.items=w[t],y.push(n)}}};A(0);for(let e=0;e<_;e++){if(k[e])continue;let t=i[e].parent;if(w[t]=w[t].filter(t=>t!==e),i[e].parent=-1,C.items.push(e),k[e]=1,O[e]=0,i[e].isGroup){let t=y.length,n=b(e,i[e].dir??m);n.items=w[e],y.push(n),A(t)}}for(let e=y.length-1;e>0;e--){let t=y[e],n=1/0;for(let e of t.items)i[e].seq<n&&(n=i[e].seq);n!==1/0&&(i[t.id].seq=n)}for(let e of y)e.items.sort((e,t)=>i[e].seq-i[t].seq||e-t);let j=0;for(let e of o){let t=e.src,n=e.dst,r=0;for(;O[t]>O[n];r++)t=i[t].parent;for(;O[n]>O[t];r++)n=i[n].parent;for(;t!==n&&i[t].parent!==i[n].parent;r+=2)t=i[t].parent,n=i[n].parent;t!==n&&(j+r>s?(e.src=t,e.dst=n):j+=r)}let M=[],N=[];for(let e=0;e<o.length;e++){let t=o[e];if(t.route=[],t.src===t.dst){M.push(e);continue}let n=t.src,r=t.dst,a=[],s=[];for(;O[n]>O[r];)a.push(n),n=i[n].parent;for(;O[r]>O[n];)s.push(r),r=i[r].parent;if(n===r)N.push(e);else{for(;i[n].parent!==i[r].parent;)a.push(n),s.push(r),n=i[n].parent,r=i[r].parent;v.get(i[n].parent).edges.push({e,a:n,b:r});for(let[t,n]of[[a,!0],[s,!1]])for(let r of t){let t=v.get(i[r].parent),a={e,inner:r,out:n,side:0,hint:NaN,px:0,py:0,route:[]};t.ports.push(a),t.portOf.set(e*2+ +!n,a)}}}let P=new Int32Array(_),F=(e,t,n)=>(n?t.src:t.dst)!==e,I=(e,t)=>{let n=e.dir===`TB`||e.dir===`BT`,s=T(e.dir),c=[],l=[];e.items.forEach((e,a)=>{P[e]=a;let o=i[e],s=t?r(n?o.w:o.h,n?o.h:o.w):r(0,0);s.span=o.isGroup?Math.min(o.span,s.w-2*o.padX):o.span,s.key=z?R[e]:NaN,c.push(s)});let u=(e,t,n)=>i[e].isGroup&&F(e,o[t],n),d=(e,r,a)=>{if(!t||!i[e].isGroup||!F(e,o[r],a))return 0;let s=v.get(e).portOf.get(r*2+ +!a);return n?s.px-i[e].w/2:s.py-i[e].h/2};for(let r of e.edges){let e=o[r.e],i=a(P[r.a],P[r.b],e.minlen);t&&(i.labelW=n?e.labelW:e.labelH,i.labelH=n?e.labelH:e.labelW,i.tailDx=d(r.a,r.e,!0),i.headDx=d(r.b,r.e,!1),i.tailFixed=u(r.a,r.e,!0),i.headFixed=u(r.b,r.e,!1)),l.push(i)}let f=new Int32Array(e.ports.length).fill(-1);return e.ports.forEach((t,n)=>{if(t.side===s||t.side===E(s)){let i=c.length,p=r(0,0,t.side===s?3:4);p.key=z?R[t.out?o[t.e].dst:o[t.e].src]:NaN,p.hint=Number.isNaN(t.hint)&&z&&V?V(e,t):t.hint,c.push(p),f[n]=i;let m=t.out?a(P[t.inner],i):a(i,P[t.inner]);t.out?(m.tailDx=d(t.inner,t.e,!0),m.tailFixed=u(t.inner,t.e,!0)):(m.headDx=d(t.inner,t.e,!1),m.headFixed=u(t.inner,t.e,!1)),l.push(m)}else c[P[t.inner]].pin=t.side===0||t.side===3?-1:1}),{lnodes:c,ledges:l,dummies:f}},L=j>1&&j<=c&&o.length<=l,R=new Float64Array(_).fill(NaN),z=!1,B=0,V,H=y.length>1&&L;for(let e of y)e.dir!==m&&(H=!1);if(H){let t=m===`TB`||m===`BT`,n=new Int32Array(_).fill(-1),s=new Int32Array(_).fill(-1),c=[],l=[],u=[];for(let e=0;e<_;e++)i[e].isGroup&&(s[e]=u.length,u.push(-1));for(let e=0;e<_;e++){let a=i[e].parent;i[e].isGroup?u[s[e]]=a>=0?s[a]:-1:(n[e]=c.length,c.push(r(t?i[e].w:i[e].h,t?i[e].h:i[e].w)),l.push(a>=0?s[a]:-1))}let d=[],f=new Int32Array(o.length).fill(-1);o.forEach((e,r)=>{e.src===e.dst||n[e.src]<0||n[e.dst]<0||(f[r]=d.length,d.push(a(n[e.src],n[e.dst],e.minlen,t?e.labelW:e.labelH,t?e.labelH:e.labelW)))});let p=e(c,d,{...g,groups:{of:Int32Array.from(l),parent:Int32Array.from(u)},orderOnly:!0});B=Math.min(p.crossings??0,p.declared??0);let h=new Float64Array(_),v=new Int32Array(_),y=new Int32Array(_).fill(-1);for(let e=0;e<_;e++)if(!(n[e]<0)){R[e]=c[n[e]].x;for(let t=i[e].parent;t>=0;t=i[t].parent)h[t]+=R[e],v[t]++,y[t]=Math.max(y[t],c[n[e]].rank)}for(let e=0;e<_;e++)v[e]>0&&(R[e]=h[e]/v[e]);V=(e,t)=>{let n=f[t.e];if(n<0||e.id<0||!t.out||t.side!==E(T(e.dir)))return NaN;let r=d[n].points,i=R[o[t.e].src],a=0;for(let t=0;t<r.length;t+=2)r[t]===y[e.id]&&(i=r[t+1]),r[t]===y[e.id]+1&&(a=r[t+1]);return i+a*1e-6}}let U=new Map,W=(t,n,r)=>{if(!L)return{lnodes:n,ledges:r,size:e(n,r,g)};let i=[];for(let e of n)i.push(e.w,e.h,e.kind,e.pin,e.hint,e.key,e.span);for(let e of r)i.push(e.tail,e.head,e.minlen,e.labelW,e.labelH,e.tailDx,e.headDx,+e.tailFixed,+e.headFixed);let a=U.get(t.id);a||U.set(t.id,a=[]);for(let e of a){let t=e.given.length===i.length;for(let n=0;t&&n<i.length;n++)t=Object.is(e.given[n],i[n]);if(t)return e}let o={given:i,lnodes:n,ledges:r,size:e(n,r,g)};return a.push(o),o},G={width:0,height:0},K=()=>{for(let e of y){for(let t of e.ports)i[t.inner].isGroup&&F(t.inner,o[t.e],t.out)&&(v.get(t.inner).portOf.get(t.e*2+ +!t.out).side=t.side);if(e.edges.length===0)continue;let r=!1;for(let t of e.edges){let e=o[t.e];(i[t.a].isGroup&&e.src!==t.a||i[t.b].isGroup&&e.dst!==t.b)&&(r=!0)}if(!r)continue;let{lnodes:a,ledges:s}=I(e,!1);t(a,s),n(a,s,1);let c=T(e.dir);e.edges.forEach((e,t)=>{let n=o[e.e],r=!s[t].reversed;i[e.a].isGroup&&n.src!==e.a&&(v.get(e.a).portOf.get(e.e*2).side=r?E(c):c),i[e.b].isGroup&&n.dst!==e.b&&(v.get(e.b).portOf.get(e.e*2+1).side=r?c:E(c))})}for(let e=y.length-1;e>=0;e--){let t=y[e],n=t.id>=0?i[t.id]:void 0,r=t.dir===`TB`||t.dir===`BT`,a=t.dir===`BT`||t.dir===`RL`,s=I(t,!0),{lnodes:c,ledges:l,size:u}=W(t,s.lnodes,s.ledges),d=s.dummies,f=r?u.width:u.height,p=r?u.height:u.width,m=n?n.padX:0,h=n?n.padTop:0,g=Math.max(f+2*m,n?n.minW:0),_=p+h+(n?n.padBottom:0),b=(g-f)/2,x=h,S=(e,t)=>b+(r?e:a?u.height-t:t),C=(e,t)=>x+(r?a?u.height-t:t:e),w=+!r,T=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(S(e[n],e[n+1]),C(e[n],e[n+1]),w);return t};t.items.forEach((e,t)=>{i[e].x=S(c[t].x,c[t].y),i[e].y=C(c[t].x,c[t].y)}),t.edges.forEach((e,n)=>{let r=l[n];t.routes.set(e.e,T(r.points));let i=o[e.e];i.labelW>0&&(i.labelX=S(r.labelX,r.labelY),i.labelY=C(r.labelX,r.labelY))});let E=t.edges.length;t.ports.forEach((e,t)=>{let n=i[e.inner];if(d[t]>=0){let t=T(l[E++].points),n=e.out?t.length-3:0,r=t[n],i=t[n+1];e.side===0?i=0:e.side===2?i=_:r=e.side===3?0:g,e.out?t.push(r,i,w):t.unshift(r,i,w),e.px=r,e.py=i,e.route=t;return}let r=n.x,a=n.y;if(n.isGroup&&F(e.inner,o[e.e],e.out)){let t=v.get(e.inner).portOf.get(e.e*2+ +!e.out);r+=t.px-n.w/2,a+=t.py-n.h/2}else e.side===0?a-=n.h/2:e.side===2?a+=n.h/2:e.side===3?r-=n.w/2:r+=n.w/2;let s=r,c=a;e.side===0?c=0:e.side===2?c=_:s=e.side===3?0:g;let u=e.side===0||e.side===2?0:1;e.px=s,e.py=c,e.route=e.out?[r,a,u,s,c,u]:[s,c,u,r,a,u]}),n?(n.w=g,n.h=_):G={width:g,height:_}}for(let e of y){let t=e.x,n=e.y;for(let r of e.items){let e=i[r];if(e.x+=t,e.y+=n,e.isGroup){let t=v.get(r);t.x=e.x-e.w/2,t.y=e.y-e.h/2}}}let e=(e,t,n,r)=>{for(let i=0;i<t.length;i+=3){let a=t[i]+n,o=t[i+1]+r,s=e.length;s>=3&&Math.abs(e[s-3]-a)<.01&&Math.abs(e[s-2]-o)<.01||e.push(a,o,t[i+2])}};for(let t of y)for(let n of t.edges){let r=o[n.e],a=[],s=[];for(let e=r.src;i[e].parent!==t.id;e=i[e].parent)s.push(v.get(i[e].parent));for(let t of s)e(a,t.portOf.get(n.e*2).route,t.x,t.y);e(a,t.routes.get(n.e),t.x,t.y);let c=[];for(let e=r.dst;i[e].parent!==t.id;e=i[e].parent)c.push(v.get(i[e].parent));for(let t=c.length-1;t>=0;t--)e(a,c[t].portOf.get(n.e*2+1).route,c[t].x,c[t].y);r.route=a,r.labelW>0&&(r.labelX+=t.x,r.labelY+=t.y)}},q=x(g);z=H,K();let J=-1;if(H&&(J=S(i,o,q),J>B*u+d)){let e=f(i,o,y,G);z=!1,K();let t=S(i,o,q);t>=J?(z=!0,G=p(e,i,o,y)):J=t}if(z===H&&L){let e=!1;for(let t of y){if(t.id<0)continue;let n=i[t.id],r=t.dir===`TB`||t.dir===`BT`,a=E(T(t.dir)),s=[];for(let e of t.ports){if(e.side!==a)continue;let i=o[e.e].route,c=t.x+e.px,l=t.y+e.py,u=-1;for(let t=0;t<i.length&&(u<0||e.out);t+=3)Math.abs(i[t]-c)<.01&&Math.abs(i[t+1]-l)<.01&&(u=t);if(u<0)continue;let d=+!r,f=e.out?u+3:u-3;for(;f>=0&&f<i.length&&Math.abs(i[f+d]-i[u+d])<h;)f+=e.out?3:-3;f<0||f>=i.length||(e.hint=i[f+d]-(r?n.x-n.w/2:n.y-n.h/2),s.push([r?e.px:e.py,e.hint]))}s.sort((e,t)=>e[0]-t[0]);for(let t=1;t<s.length;t++)s[t-1][1]>s[t][1]&&(e=!0)}if(e){let e=J>=0?J:S(i,o,q),t=e>0?f(i,o,y,G):void 0;t&&(K(),S(i,o,q)>=e&&(G=p(t,i,o,y)))}}for(let e of N){let t=o[e],n=i[t.src],r=i[t.dst];t.route=[n.x,n.y,0,r.x,r.y,0],t.labelX=(n.x+r.x)/2,t.labelY=(n.y+r.y)/2}for(let e of M){let t=o[e],n=i[t.src];t.labelX=n.x+n.w/2+28+t.labelW/2,t.labelY=n.y}return G}export{D as i,C as n,o as r,w as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./
|
|
1
|
+
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DS7XcdHs.js";import{n as o,r as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./Dzu8v7nB.js";import{PeleError as w,u as ee}from"./BNlziJ_1.js";function T(e,t){let n=new Map;for(let{label:t,value:r}of e.sections){if(r<0)throw new w(`"${t}" has invalid value: ${r}. Negative values are not allowed in pie charts. All slice values must be >= 0.`,`semantic`,{type:`pie`});n.has(t)||n.set(t,r)}return{type:`pie`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,showData:e.showData,sections:n}}function E(e,t){let n=t;for(let t=e.charCodeAt(n);t>=48&&t<=57;t=e.charCodeAt(n))n++;return n}function D(){let e=0,t=0,n=-1;return(r,i)=>{let a=r.charCodeAt(i)===45?i+1:i;if((a<e||a>=t)&&(e=a,t=E(r,a),n=-1,t>a&&r.charCodeAt(t)===46)){let e=E(r,t+1),i=e-t-1;i>0&&r.charCodeAt(e)!==46?n=e:i>1&&(n=e-1)}return t===a?-1:n>=0?n:r.charCodeAt(a)===48?r.charCodeAt(a+1)===46?-1:a+1:r.charCodeAt(t)===46?t-1>a?t-1:-1:t}}var O=[m(`showData`),m(`pie`),{name:`:`,pattern:`:`},{name:`NUMBER_PIE`,pattern:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/y,scanner:D,first:`-0123456789`},c,S,y,g,h,C,b,v,x];function k(e){let t=new p(_(e,O,`pie`),O,`pie`),n={$type:`Pie`,showData:!1,sections:[]},r=()=>{if(t.kind!==-1)for(t.kind!==8&&t.fail(`a line break or the end of input`);t.kind===8;)t.i++};for(;t.kind===8;)t.i++;for(t.expect(1),n.showData=t.accept(0);t.kind!==-1;)switch(t.kind){case 8:t.i++;break;case 4:n.accDescr=l(t.take()),r();break;case 5:n.accTitle=f(t.take()),r();break;case 6:n.title=u(t.take()),r();break;case 7:{let e=d(t.take());t.expect(2);let i=Number(t.expect(3));n.sections.push({$type:`PieSection`,label:e,value:i}),r();break}default:t.fail(`a section, a title, or a line break`)}return n}var A=120,j=12,M=26,N=32,P=28;function F(e,t){return e.pie?.[t]}function I(e,t){return`${a(Math.sin(e)*t)},${a(-Math.cos(e)*t)}`}function te(e,t,n,r){if(t-e>=Math.PI*2-1e-9){let e=(e,t)=>`M0,${a(-e)}A${a(e)},${a(e)} 0 1 ${t} 0,${a(e)}A${a(e)},${a(e)} 0 1 ${t} 0,${a(-e)}Z`;return e(n,1)+(r>0?e(r,0):``)}let i=+(t-e>Math.PI);return r<=0?`M0,0L${I(e,n)}A${a(n)},${a(n)} 0 ${i} 1 ${I(t,n)}Z`:`M${I(e,n)}A${a(n)},${a(n)} 0 ${i} 1 ${I(t,n)}L${I(t,r)}A${a(r)},${a(r)} 0 ${i} 0 ${I(e,r)}Z`}function L(e,t,n){return o(n,A*2,140,(r,i)=>R(e,t,n,r/2,i))}function R(o,c,l,u,d){let f=l.fontSize??16,p=Math.round(f*.875),m=l.measurer??ee(l.fontFamily,l.fontFamilyMono),h=l.padding??8,g=F(c,`textPosition`),_=typeof g==`number`&&g>=0&&g<=1?g:.75,v=F(c,`donutHole`),y=typeof v==`number`&&v>0&&v<=.9?v*u:0,b=String(F(c,`legendPosition`)??`right`),x=d&&(b===`left`||b===`right`)?`bottom`:b,S=[...o.sections],C=0;for(let[,e]of S)C+=e;let w=S.map(([e,t])=>i(o.showData?`${e} [${t}]`:e,!1,m,p,4e3)),T=0;for(let e of w)T=Math.max(T,e.width);T+=w.length>0?j+8:0;let E=w.length*M,D=i(o.title,!1,m,f,s(l),1),O=D.height>0?D.height+16:0,k=S.map(([,e])=>{let t=C>0?e/C:0;return t*100>=1&&(t*100).toFixed(0)!==`0`?t:0}),A=k.map(e=>e===0||e>=.5?!1:2*u*_*Math.sin(e*Math.PI)<m.width((e*100).toFixed(0)+`%`,p,0)+6),I=A.includes(!0)?P:0,L=x===`left`||x===`right`||x===`center`?x:``,R=x===`top`||x===`bottom`,z=(u+I)*2,B=z,V=z;L===`left`||L===`right`?(B+=T>0?N+T:0,V=Math.max(V,E)):R&&(B=Math.max(B,T),V+=E>0?20+E:0),B=Math.max(B,D.width);let H=h+(L===`left`?T+N+z/2:L===`right`?z/2:B/2),U=h+O,W=U+(x===`top`?E+20+z/2:R?z/2:V/2),G=``,K=``,q=``,J=0,Y=u+P/2,ne=[],re=(e,t,n)=>ne.every(r=>Math.abs(e-r.x)>=(n+r.width)/2+2||Math.abs(t-r.y)>=p+2);S.forEach(([e],r)=>{let i=k[r];if(i===0)return;let o=J+i*Math.PI*2;G+=`<path class="pele-slice" data-id="${n(e)}" d="${te(J,o,u,y)}" fill="${t(r)}"/>`;let s=(J+o)/2,c=(i*100).toFixed(0)+`%`;if(A[r]){let e=m.width(c,p,0),t=s;for(let n=0;n<360&&!re(Math.sin(t)*Y,-Math.cos(t)*Y,e);n++)t+=2/Y;let n=Math.sin(t)*Y,r=-Math.cos(t)*Y;ne.push({x:n,y:r,width:e}),q+=`<text x="${a(n)}" y="${a(r+p*.35)}">${c}</text>`}else{let e=u*_;K+=`<text x="${a(Math.sin(s)*e)}" y="${a(-Math.cos(s)*e+p*.35)}">${c}</text>`}J=o}),G===``&&(G=`<circle class="pele-slice" r="${u}" fill="none" stroke="var(--_b)"/>`);let X=``,Z,Q;L===`right`?(Z=H+z/2+N,Q=U+(V-E)/2):L===`left`?(Z=h,Q=U+(V-E)/2):L===`center`?(Z=H-T/2,Q=W-E/2):(Z=h+(B-T)/2,Q=x===`top`?U:U+z+20),w.forEach((e,i)=>{let o=Q+i*M+M/2;X+=`<g class="pele-legend-item" data-id="${n(S[i][0])}"><rect x="${a(Z)}" y="${a(o-j/2)}" width="${j}" height="${j}" rx="2" fill="${t(i)}"/>`+r(e,Z+j+8+e.width/2,o,``)+`</g>`});let $=Math.ceil(B+2*h),ie=Math.ceil(V+O+2*h),ae=r(D,$/2,h+D.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g class="pele-slices" transform="translate(${a(H)},${a(W)})" stroke="var(--_bg)" stroke-width="1" stroke-linejoin="round">${G}</g>`+(K?`<g class="pele-slice-labels" transform="translate(${a(H)},${a(W)})" font-size="${p}" text-anchor="middle" fill="var(--_bg)">${K}</g>`:``)+(q?`<g class="pele-slice-labels" transform="translate(${a(H)},${a(W)})" font-size="${p}" text-anchor="middle">${q}</g>`:``)+(X?`<g class="pele-legend" font-size="${p}">${X}</g>`:``);return{svg:e(`pie`,$,ie,f,l,o,ae),width:$,height:ie,links:[]}}var z={type:`pie`,parse:(e,t,n)=>T(k(e),n),render:L};export{z as pie};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,r as l,s as u,t as d,u as f,v as p,x as m,y as h}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,r as l,s as u,t as d,u as f,v as p,x as m,y as h}from"./DS7XcdHs.js";import{a as g,t as _}from"./DciMwFJ1.js";import{i as v,l as y}from"./DK9wjWIk.js";import{t as b}from"./CdD6waB-.js";import{a as x,r as S}from"./DrPF-vh8.js";import{t as C}from"./BZmnMkFw.js";import{n as w,r as ee}from"./DQJRaTNz.js";import{i as te,n as ne,r as T,t as re}from"./Bx_Vz2qr.js";import{d as ie,g as E,h as D,s as O,u as ae,y as k}from"./BNlziJ_1.js";function A(e){return e===`markdown`||e===`string`||e===`text`?e:`markdown`}var oe=class{type=`er`;direction=`TB`;entities=new Map;relationships=[];classes=new Map;subgraphs=[];title;accTitle;accDescr;subgraphLookup=new Map;claimed=new Set;addEntity(e,t=``){let n=this.entities.get(e);return n===void 0?(n={id:`entity-${e}-${this.entities.size}`,label:e,alias:t,attributes:[],cssClasses:`default`,cssStyles:[]},this.entities.set(e,n)):!n.alias&&t&&(n.alias=t),n}addAttributes(e,t){let n=this.addEntity(e);for(let e=t.length-1;e>=0;e--){let r=t[e];r.keys??=[],r.comment??=``,n.attributes.push(r)}}addRelationship(e,t,n,r){let i=this.subgraphLookup.has(e)?e:this.addEntity(e).id,a=this.subgraphLookup.has(n)?n:this.addEntity(n).id;this.relationships.push({entityA:i,roleA:t,entityB:a,relSpec:r})}setDirection(e){this.direction=e}addCssStyles(e,t){if(t)for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssStyles.push(n);let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.cssStyles.push(e)}}addClass(e,t){for(let n of e){let e=this.classes.get(n);if(e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e)),t)for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n)}}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subgraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}addSubGraph(e,t,n){let r=e.text.trim(),i=new Set,a=[],o;for(let e of t.flat()){if(typeof e!=`string`){e?.stmt===`dir`&&(o=e.value);continue}let t=e.trim();t===``||i.has(t)||(i.add(t),this.claimed.has(e)||a.push(e))}for(let e of a)this.claimed.add(e);let s={id:r,nodes:a,title:(n.text||``).trim(),classes:[],cssStyles:[],dir:o,labelType:A(n.type)};return this.subgraphs.push(s),this.subgraphLookup.set(r,s),r}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}},j=`$end.INVALID.ER_DIAGRAM.EOF.NEWLINE.COLON.STYLE_SEPARATOR.BLOCK_START.BLOCK_STOP.SQS.SQE.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.END.SUBGRAPH.direction_tb.direction_bt.direction_rl.direction_lr.CLASSDEF.UNICODE_TEXT.STYLE_TEXT.COMMA.CLASS.STYLE.SEMI.NUM.BRKT.ENTITY_NAME.DECIMAL_NUM.ENTITY_ONE.ATTRIBUTE_WORD.ATTRIBUTE_KEY.COMMENT.ZERO_OR_ONE.ZERO_OR_MORE.ONE_OR_MORE.ONLY_ONE.MD_PARENT.NON_IDENTIFYING.IDENTIFYING.WORD.CHAR`.split(`.`),M=1,N=2,P=4,F=8,I=new Uint8Array(128);for(let e=0;e<128;e++){let t=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95,n=t&&(e<48||e>57);t&&(I[e]|=M|N|F),n&&(I[e]|=P)}for(let e of`-*`)I[e.charCodeAt(0)]|=M|N|F;I[46]|=M|F,I[42]|=P;for(let e of`[](),`)I[e.charCodeAt(0)]|=F;var L=/accTitle\s*:\s*/iy,R=/accDescr\s*:\s*/iy,z=/accDescr\s*\{\s*/iy,se=[/.*direction\s+TB[^\n]*/iy,/.*direction\s+BT[^\n]*/iy,/.*direction\s+RL[^\n]*/iy,/.*direction\s+LR[^\n]*/iy],B=/direction/gi,V=/[\n\r\u2028\u2029]/g;function H(e,t){return e<128?(I[e]&t)!==0:e>=192||e===181}function U(e){let t=e.length,n=[],r=[],i=[],a=0,o=0,s=-2,c=0,l=-1,u=-2,d=-1,f=-1,p=-1,m=(t,a,s)=>{n.push(t),r.push(e.slice(a,s)),i.push(a),o=s},h=(t,n)=>(t.lastIndex=n,t.test(e)?t.lastIndex:-1),g=t=>{for(let n=0;n<t.length;n++){let r=t.charCodeAt(n),i=e.charCodeAt(o+n);if(i!==r&&(r<97||r>122||(i|32)!==r))return!1}return!0},_=t=>g(t)&&!E(e.charCodeAt(o+t.length)),v=t=>{let n=e.charCodeAt(t);return n>=65&&n<=90?n+32:n},y=n=>(V.lastIndex=n,V.test(e)?V.lastIndex-1:t),b=t=>{for(;k(e.charCodeAt(t));)t++;return t},x=()=>{if(s===-1||s<o&&(B.lastIndex=o,s=B.test(e)?B.lastIndex-9:-1,s===-1)||o<c||(l<o&&(l=y(o)),s>=l))return!1;for(let e=0;e<4;e++){let t=h(se[e],o);if(t>=0)return m(18+e,o,t),!0}return c=l,!1},S=()=>{let t=e.indexOf(`"`,o+1);if(t===-1){m(45,o,o+1);return}let n=t>o+1;for(let r=o+1;n&&r<t;r++){let t=e.charCodeAt(r);(t===37||t===92||t===13||t===10||t===11||t===8)&&(n=!1)}m(n?31:44,o,t+1)},C=t=>{let n=e.charCodeAt(o+1);if(n===43&&(t===49||t===48)){m(t===49?39:38,o,o+2);return}let r=b(o+1);if(e.charCodeAt(r)===46&&k(e.charCodeAt(r+1)))m(32,o,b(r+2));else{if(t===49){if(D(n)){let t=o+2;for(;D(e.charCodeAt(t));)t++;let n=e.charCodeAt(t);if(E(n)||n===34||n===39){m(40,o,o+1);return}}else if(n===45||n===46){let t=e.charCodeAt(o+2);if(t===45||t===46){m(40,o,o+1);return}}if(!E(n)){m(33,o,o+1);return}}m(29,o,r)}},w=t=>{let n=e.charCodeAt(o+1);switch(t){case 101:if(_(`erdiagram`))m(2,o,o+9);else if(_(`end`)){let t=o+3;for(;D(e.charCodeAt(t));)t++;m(16,o,t)}else return!1;return!0;case 115:if(_(`style`))a=6,m(27,o,o+5);else if(_(`subgraph`))m(17,o,o+8);else return!1;return!0;case 99:if(_(`classdef`))a=6,m(22,o,o+8);else if(_(`class`))m(26,o,o+5);else return!1;return!0;case 111:if(_(`one or zero`))m(37,o,o+11);else if(_(`one or more`)||_(`one or many`))m(39,o,o+11);else if(_(`one`))m(40,o,o+3);else if(_(`only one`))m(40,o,o+8);else if(n===124)m(37,o,o+2);else if(n===123)m(38,o,o+2);else if(_(`optionally to`))m(42,o,o+13);else return!1;return!0;case 122:if(_(`zero or one`))m(37,o,o+11);else if(_(`zero or more`)||_(`zero or many`))m(38,o,o+12);else return!1;return!0;case 109:if(g(`many(0)`))m(38,o,o+7);else if(g(`many(1)`))m(39,o,o+7);else if(_(`many`))m(38,o,o+4);else return!1;return!0;case 116:return _(`to`)?(m(43,o,o+2),!0):!1;case 117:return n!==46&&n!==45&&n!==124?!1:(m(41,o,o+1),!0);case 124:if(v(o+1)===111&&!E(e.charCodeAt(o+2)))m(37,o,o+2);else if(n===124)m(40,o,o+2);else if(n===123)m(39,o,o+2);else return!1;return!0;case 125:if(v(o+1)===111&&!E(e.charCodeAt(o+2)))m(38,o,o+2);else if(n===124)m(39,o,o+2);else return!1;return!0;case 46:return n!==46&&n!==45?!1:(m(42,o,o+2),!0);case 45:if(n===45)m(43,o,o+2);else if(n===46)m(42,o,o+2);else return!1;return!0}return!1},ee=t=>{let n;if((t===97||t===65)&&g(`acc`)){if((n=h(L,o))>=0){a=3,m(11,o,n);return}if((n=h(R,o))>=0){a=4,m(13,o,n);return}if((n=h(z,o))>=0){a=5,o=n;return}}if(!x()){switch(t){case 32:case 9:case 13:n=o+1;for(let t=e.charCodeAt(n);t===32||t===9||t===13;t=e.charCodeAt(n))n++;o=n;return;case 10:for(n=o+1;e.charCodeAt(n)===10;)n++;m(4,o,n);return;case 34:S();return;case 123:a=1,m(7,o,o+1);return;case 35:m(30,o,o+1);return;case 44:m(25,o,o+1);return;case 58:e.charCodeAt(o+1)===58&&e.charCodeAt(o+2)===58?m(6,o,o+3):m(5,o,o+1);return;case 91:m(9,o,o+1);return;case 93:m(10,o,o+1);return}if(k(t)){C(t);return}if(!w(t>=65&&t<=90?t+32:t)){if(t>=128||(I[t]&M)!==0){n=o+1;for(let t=e.charCodeAt(n);t>=128||(I[t]&M)!==0;t=e.charCodeAt(n))n++;m(23,o,n);return}m(45,o,o+1)}}},te=()=>{if(u===-1||u<o&&(u=e.indexOf(`~`,o),u===-1))return!1;if(p<o){let n=o;for(;n<t&&!D(e.charCodeAt(n));)n++;p=n}if(u>=p||(d<o&&(d=y(o),f=e.lastIndexOf(`~`,d-1)),f<=u))return!1;let n=f+1;for(;n<t&&!D(e.charCodeAt(n));)n++;return m(34,o,n),!0},ne=n=>{if(D(n)){for(o++;D(e.charCodeAt(o));)o++;return}let r=n|32;if((r===112||r===102||r===117)&&(e.charCodeAt(o+1)|32)==107&&!E(e.charCodeAt(o+2)))m(35,o,o+2);else if(!te()){if(H(n,P)){let n=o+1;for(;n<t&&H(e.charCodeAt(n),F);)n++;m(34,o,n);return}if(n===96){a=2,o++;return}if(n===34){let t=e.indexOf(`"`,o+1);if(t!==-1){m(36,o,t+1);return}}else if(n===125){a=0,m(8,o,o+1);return}m(45,o,o+1)}};for(;o<t;){let s=e.charCodeAt(o),c;switch(a){case 0:ee(s);break;case 1:ne(s);break;case 2:s===96?(a=1,o++):(c=e.indexOf("`",o),m(34,o,c===-1?t:c));break;case 3:case 4:c=e.indexOf(`
|
|
3
3
|
`,o),m(a===3?12:14,o,c===-1?t:c),a=0;break;case 5:s===125?(a=0,o++):(c=e.indexOf(`}`,o),m(15,o,c===-1?t:c));break;case 6:if(s===10){for(c=o+1;e.charCodeAt(c)===10;)c++;a=0,m(4,o,c)}else if(D(s))for(o++;D(e.charCodeAt(o));)o++;else if(s===58)m(5,o,o+1);else if(s===44)m(25,o,o+1);else if(s===35)m(30,o,o+1);else if(s===59)m(28,o,o+1);else if(s>=128||(I[s]&N)!==0){c=o+1;for(let t=e.charCodeAt(c);t>=128||(I[t]&N)!==0;t=e.charCodeAt(c))c++;m(24,o,c)}else return n.push(1),r.push(``),i.push(o),{types:n,texts:r,starts:i}}}let T=a===0?3:a===3?12:a===4?14:a===5?15:-1;return T!==-1&&(n.push(T),r.push(``),i.push(t)),n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var W=new Map([[37,`ZERO_OR_ONE`],[38,`ZERO_OR_MORE`],[39,`ONE_OR_MORE`],[40,`ONLY_ONE`],[41,`MD_PARENT`]]),ce=[`TB`,`BT`,`RL`,`LR`],G=`'UNICODE_TEXT', 'NUM', 'ENTITY_NAME', 'DECIMAL_NUM', 'ENTITY_ONE'`,le=`'ZERO_OR_ONE', 'ZERO_OR_MORE', 'ONE_OR_MORE', 'ONLY_ONE', 'MD_PARENT'`,K=`'EOF', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'SUBGRAPH', 'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'CLASSDEF', 'CLASS', 'STYLE', `+G;function q(e,t){let{types:n,texts:r,starts:i}=U(e),a=0,o=t=>{let o=n[a];throw o===1?O(`er`,e,i[a],``,!0):O(`er`,e,i[a],`Expecting ${t}, got '${o===45?r[a]:j[o]}'`)},s=e=>(n[a]!==e&&o(`'${j[e]}'`),r[a++]),c=()=>{let e=n[a];e!==4&&e!==28&&e!==3&&o(`'EOF', 'NEWLINE', 'SEMI'`),a++},l=e=>e===23||e===31||e===29||e===32||e===33,u=()=>{let e=n[a];l(e)||o(G);let t=r[a++];return e===31?t.slice(1,-1):t},d=()=>{let e=[];for(;;){let t=n[a];if(t!==23&&t!==24&&o(`'UNICODE_TEXT', 'STYLE_TEXT'`),e.push(r[a++]),n[a]!==25)return e;a++}},f=e=>e===24||e===29||e===5||e===30,p=()=>{let e=[];for(;;){f(n[a])||o(`'STYLE_TEXT', 'COLON', 'NUM', 'BRKT'`);let t=r[a++];for(;f(n[a]);)t+=r[a++];if(e.push(t),n[a]!==25)return e;a++}},m=()=>{let e=W.get(n[a++]),t=n[a];t!==43&&t!==42&&o(`'NON_IDENTIFYING', 'IDENTIFYING'`);let r=t===43?`IDENTIFYING`:`NON_IDENTIFYING`;a++;let i=W.get(n[a]);return i===void 0?o(le):(a++,{cardA:i,relType:r,cardB:e})},h=()=>{let e=n[a];e!==44&&e!==31&&e!==23&&o(`'UNICODE_TEXT', 'ENTITY_NAME', 'WORD'`);let t=r[a++];return e===23?t:t.slice(1,-1)},g=e=>n[a]===45&&r[a]===e,_=()=>{let e=[];do{let t=s(34);g(`?`)&&(t+=r[a++]),n[a]!==34&&o(t.endsWith(`?`)?`'ATTRIBUTE_WORD'`:`'ATTRIBUTE_WORD', '?'`);let i={type:t,name:r[a++]};if(n[a]===35){let e=[r[a++]];for(;g(`,`);)a++,e.push(s(35));i.keys=e}n[a]===36&&(i.comment=r[a++].slice(1,-1)),e.push(i)}while(n[a]!==8);return e.reverse()},v=()=>{if(n[a]!==7)return;if(a++,n[a]===8){a++;return}let e=_();return a++,e},y=()=>{let e=u(),r=n[a];if(r===9){a++;let r=u();s(10);let i;n[a]===6&&(a++,i=d());let o=v();return t.addEntity(e,r),o&&t.addAttributes(e,o),i&&t.setClass([e],i),[e]}let i;if(r===6&&(a++,i=d(),r=n[a]),W.has(r)){let r=m(),o=u(),c;n[a]===6&&(a++,c=d()),s(5);let l=h();return t.addEntity(e),t.addEntity(o),t.addRelationship(e,l,o,r),i&&t.setClass([e],i),c&&t.setClass([o],c),[e,o]}let o=v();return t.addEntity(e),o&&t.addAttributes(e,o),i&&t.setClass([e],i),[e]};s(2);let b=[{id:``,title:``,list:[]}],x=b[0],S=!1;for(;;){let e=n[a];switch(e){case 4:a++;break;case 3:a++,S&&o(`'END', ${K}`);return;case 16:{S||o(K),a++;let e=t.addSubGraph({text:x.id},x.list,{text:x.title});b.pop(),x=b[b.length-1],S=b.length>1,S&&x.list.push(e);break}case 17:{a++;let e=u(),t=e;if(n[a]===9){for(a++,t=u();l(n[a]);)t+=` `+u();s(10)}c(),x={id:e,title:t,list:[]},b.push(x),S=!0;break}case 11:{a++;let e=s(12).trim();t.setAccTitle(e),S&&x.list.push(e);break}case 13:{a++;let e=s(14).trim();t.setAccDescription(e),S&&x.list.push(e);break}case 15:{let e=r[a++].trim();t.setAccDescription(e),S&&x.list.push(e);break}case 18:case 19:case 20:case 21:{a++;let n=ce[e-18];S?x.list.push({stmt:`dir`,value:n}):t.setDirection(n);break}case 22:{let e=r[a++],n=d(),i=p();c(),t.addClass(n,i),S&&x.list.push(e);break}case 26:{let e=r[a++],n=d();t.setClass(n,d()),S&&x.list.push(e);break}case 27:{let e=r[a++],n=d(),i=p();c(),t.addCssStyles(n,i),S&&x.list.push(e);break}default:{l(e)||o(S?`'END', ${K}`:K);let t=y();if(S)for(let e of t)x.list.push(e)}}}}var ue=[];function de(e){let t=[],n=[],r=e.subgraphs,i=t=>{let n=[];for(let r of t){let t=e.classes.get(r);if(t!==void 0){for(let e of t.styles)n.push(e.trim());for(let e of t.textStyles)n.push(e.trim())}}return n},a=new Map,o=new Set;for(let e=r.length-1;e>=0;e--){let t=r[e];o.add(t.id);for(let e of t.nodes)a.set(e,t.id)}for(let e=r.length-1;e>=0;e--){let n=r[e];t.push({id:n.id,label:n.title,alias:``,attributes:ue,isGroup:!0,parentId:a.get(n.id),cssStyles:n.cssStyles,cssCompiledStyles:i(n.classes),cssClasses:n.classes.join(` `),dir:n.dir,labelType:n.labelType})}let s=new Map;for(let[n,r]of e.entities)o.has(n)?s.set(r.id,n):t.push({id:r.id,label:r.label,alias:r.alias,attributes:r.attributes,isGroup:!1,parentId:a.get(n),cssStyles:r.cssStyles,cssCompiledStyles:i(r.cssClasses.split(` `)),cssClasses:r.cssClasses,dir:void 0,labelType:`markdown`});return e.relationships.forEach((e,t)=>{n.push({id:`id_${e.entityA}_${e.entityB}_${t}`,start:s.get(e.entityA)??e.entityA,end:s.get(e.entityB)??e.entityB,label:e.roleA,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType===`IDENTIFYING`?`solid`:`dashed`})}),{nodes:t,edges:n}}var J=18,fe=5,pe=6,me=10,he=3.5;function Y(e,t,n,r,i){let a=(e,a)=>m(t-r*e-i*a)+`,`+m(n-i*e+r*a),o=e=>`M${a(e,-fe)}L${a(e,fe)}`,s=`M${a(0,-pe)}L${a(me,0)}L${a(0,pe)}`,c=e=>`<circle class="pele-marker" cx="${m(t-r*e)}" cy="${m(n-i*e)}" r="${he}" fill="var(--_bg)"/>`,l=e=>`<path class="pele-marker" d="${e}"/>`;switch(e){case`only_one`:return l(o(6)+o(10));case`zero_or_one`:return l(o(6))+c(13.5);case`one_or_more`:return l(s+o(me+3.5));case`zero_or_more`:return l(s)+c(me+he+.5);case`md_parent`:return`<path class="pele-marker" d="M${a(0,0)}L${a(6,4)}L${a(12,0)}L${a(6,-4)}Z" fill="var(--_bg)"/>`}return``}var ge=48,_e=20,ve=64,X=20,Z=28,ye=38,be=96,xe=18,Se=12,Ce=9,we=12,Te=16,Ee=9,De=260,Oe=1e6,ke=[],Ae=18,je=14,Me=` fill="var(--_s)" stroke="var(--_b)"`;function Ne(e,t,n){let r=e.er?.[t];return typeof r==`number`&&r>0?Math.min(r,2e3):n}function Q(e,n,i,l,u){let f=e.lines;if(f.length===0)return``;let g=f.length===1&&f[0].length===1?f[0][0]:void 0;if(g&&g.icon===void 0&&g.math===void 0&&g.style===0)return`<text${l} x="${m(n)}" y="${m(i)}">${t(g.text)}</text>`;let _=r(e),v=e.size*.35,y=i-v-e.lineHeight/2,b=``,x=``;for(let r=0;r<f.length;r++){let d=f[r],g=y+c(e,r);if(p(d)){x+=s(h(e,r),n+e.widths[r]/2,g,l,u);continue}i=g+v;let S=!1;for(let e of d)e.icon!==void 0&&(S=!0);let C=n,w=!1;for(let n of d){if(n.icon!==void 0){let t=e.size*1.1;x+=`<svg class="pele-icon" data-icon="${a(n.icon)}" x="${m(C)}" y="${m(i-e.size*.35-t/2)}" width="${m(t)}" height="${m(t)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${u?.(n.icon)??``}</svg>`}else if(n.text!==``){let e=S||!w?` x="${m(C)}" y="${m(i)}"`:``;b+=`<tspan${e}${o(n.style&~_)}>${t(n.text)}</tspan>`,w=!0}C+=n.width}}return`<text${d(l,_)} xml:space="preserve">${b}</text>${x}`}function $(e){let t=C(e);return t===e?e:t.replace(/</g,`<`).replace(/>/g,`>`)}function Pe(e,t,n){return g(e.direction)?_(n,r=>Fe(e,t,n,r)):Fe(e,t,n,!1)}function Fe(r,o,c,d){let p=de(r),h=c.fontSize??16,g=Math.round(h*.875),_=c.measurer??ae(c.fontFamily,c.fontFamilyMono),C=c.padding??8,E=c.icons,D=new Map,O=[],k=[];p.nodes.forEach((e,t)=>D.set(e.id,t));let A=[],oe=[],j=[],M=new Map,N=[];for(let e of p.edges){let t=D.get(e.start),n=D.get(e.end);if(t===void 0||n===void 0)continue;let r=f(e.label,!0,_,g,200),i;if(t===n){i={label:r,band:0,at:0};let e=M.get(t);e?e.push(i):M.set(t,[i])}N.push(i),j.push(e),oe.push(r),A.push({src:t,dst:n,minlen:1,labelW:r.width>0?r.width+12:0,labelH:r.height>0?r.height+4:0,route:[],labelX:0,labelY:0})}let P=e=>{let t=e;for(let e=0;e<p.nodes.length;e++){let e=p.nodes[t].parentId,n=e===void 0?void 0:D.get(e);if(n===void 0)break;let r=p.nodes[n].dir;if(r)return r===`LR`||r===`RL`;t=n}return r.direction===`LR`||r.direction===`RL`};for(let e=0;e<p.nodes.length;e++){let t=p.nodes[e],n=u(t.cssStyles.length>0?t.cssCompiledStyles.concat(t.cssStyles):t.cssCompiledStyles),r=+!!n.bold|(n.italic?2:0),i=n.fontSize??h,a=n.fontSize??g,o=n.fontSize??Math.round(h*.75),s=t.isGroup?f(t.label,!0,_,i,4e3,r):f(t.alias||t.label,!0,_,i,240,r),c=M.get(e)??ke,l=c.length>0&&!t.isGroup&&P(e),d={node:t,style:n,label:s,w:0,h:0,headH:0,rows:[],cols:[],rowSize:a,keySize:o,below:l},m=0,v=0;for(let e of c)e.band=Math.max(ye,l?e.label.width+12:e.label.height+6),v+=e.band,m=Math.max(m,l?e.label.height:e.label.width);let y=Math.max(be,l?v+8:0),b;if(t.isGroup)b=re(0,0),b.isGroup=!0,b.dir=t.dir?T(t.dir):void 0,b.padX=X,b.padTop=d.label.height>0?d.label.height+16:X,b.padBottom=X,b.minW=Math.max(d.label.width+2*X-12,be);else{let e=Math.max(s.height,Math.round(i*1.5));if(t.attributes.length===0)d.w=Math.max(s.width+2*xe,y),d.h=Math.max(e+2*Se,l?0:v+8);else{let n=Math.round(a*1.5),i=[0,0,0,0];for(let e of t.attributes){let t=[f($(e.type),!0,_,a,Oe,r),f($(e.name),!0,_,a,Oe,r),f(e.keys.join(`, `),!1,_,o,Oe,r),f($(e.comment),!0,_,a,De,r)],s=n;for(let e=0;e<4;e++)t[e].width>i[e]&&(i[e]=t[e].width),t[e].height>s&&(s=t[e].height);d.rows.push({cells:t,h:s+Ee}),d.h+=s+Ee}let c=0,l=0;for(let e of i)e!==0&&(l+=e+(c>0?Te:0),c++);d.w=Math.max(l+2*we,s.width+2*xe,y);let u=c>0?(d.w-l-2*we)/c:0,p=we;for(let e of i)d.cols.push(p),e>0&&(p+=e+u+Te);d.headH=e+2*Ce,d.h+=d.headH}let n=c.length>0?2*(J+Z*.75+10+m):0;b=l?re(d.w,d.h+n):re(d.w+n,d.h)}b.seq=O.length,O.push(d),k.push(b)}p.nodes.forEach((e,t)=>{k[t].parent=e.parentId===void 0?-1:D.get(e.parentId)??-1});let F=te(k,A,d?`TB`:T(r.direction),{nodeSep:Ne(o,`nodeSpacing`,ge),edgeSep:_e,rankSep:Ne(o,`rankSpacing`,ve),portSep:24});Le(A,k,O);let I=F.width;for(let[e,t]of M){let n=k[e];if(!n.isGroup)continue;let r=0;for(let e of t)r=Math.max(r,e.label.width);I=Math.max(I,n.x+n.w/2+J+Z*.75+10+r)}let L=b(r.title,_,h,4e3),R=L.height>0?L.height+12:0,z=Math.max(I,L.width),se=C+(z-I)/2,B=C+R;ne(k,A,se,B);let V=Math.ceil(z+2*C),H=Math.ceil(F.height+R+2*C),U=[],W=new Map,ce=!1;for(let e of k)e.isGroup&&(ce=!0);if(ce)for(let e of A)ee(W,e.route);let G=``,le=``;for(let e=0;e<O.length;e++){let r=O[e],o=k[e],u=r.node,d=n(u.cssClasses.replace(/^default\s?/,``));if(o.isGroup){r.w=o.w,r.h=o.h;let e=o.x-o.w/2,t=o.y-o.h/2,n=w(o,r.label.width,W,X);G+=`<g class="pele-cluster${d}" data-id="${a(u.id)}"><rect x="${m(e)}" y="${m(t)}" width="${m(o.w)}" height="${m(o.h)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${i(r.style.shape)}/>`+s(r.label,n,t+8+r.label.height/2,` class="pele-cluster-label" fill="var(--_m)"${r.style.text}`,E)+`</g>`;continue}let f=r.w,p=r.h,h=-f/2,g=-p/2,_=r.style.text,v=`x="${m(h)}" y="${m(g)}" width="${m(f)}" height="${m(p)}"`,y=s(r.label,0,r.rows.length>0?g+r.headH/2:0,` class="pele-label"${_}`,E),b=ie(u.alias||u.label);if(/ internal-link(?: |$)/.test(d+` `)&&y!==``&&c.links!==!1){let e=x(b,c),n=t(b);y=`<a class="internal-link"${e?` href="${n}"${S(c)}`:``} data-href="${n}">${y}</a>`,U.push({id:u.label,href:b,internal:!0})}let C;if(r.rows.length===0)C=`<rect ${v}${i(Me+r.style.shape)}/>`+y;else{let e=Math.round(r.rowSize*1.5),n=r.style.stroke?t(r.style.stroke):`var(--_b)`,a=``,o=``,s=g+r.headH;for(let t=0;t<r.rows.length;t++){let n=r.rows[t];if(t%2==0){let e=`x="${m(h)}" width="${m(f)}"`;t===r.rows.length-1?a+=`<rect ${e} y="${m(s)}" height="${m(n.h)}"${l}/><rect ${e} y="${m(s)}" height="${m(n.h/2)}"/>`:a+=`<rect ${e} y="${m(s)}" height="${m(n.h)}"/>`}let i=s+Ee/2+e/2+r.rowSize*.35,[c,u,d,p]=n.cells;o+=Q(c,h+r.cols[0],i,` class="pele-er-type" fill="var(--_m)"${_}`,E)+Q(u,h+r.cols[1],i,` class="pele-er-name"${_}`,E)+Q(d,h+r.cols[2],i,` class="pele-er-keys" font-size="${r.keySize}" fill="var(--_m)"${_}`,E)+Q(p,h+r.cols[3],i,` class="pele-er-comment" fill="var(--_m)"${_}`,E),s+=n.h}let c=m(g+r.headH);C=`<rect ${v}${i(Me+r.style.shape)}/><g class="pele-er-stripes" fill="var(--_bg)"${r.style.shape.includes(`fill:`)?` opacity="0.6"`:``}>${a}</g><path class="pele-er-divider" d="M${m(h)},${c}H${m(h+f)}" stroke="${n}"/><rect ${v} fill="none" stroke="var(--_b)"${i(r.style.line)}/>`+y+`<g class="pele-er-attributes" font-size="${r.rowSize}">${o}</g>`}le+=`<g class="pele-node pele-entity${d}" data-id="${a(u.label)}" transform="translate(${m(o.x)},${m(o.y)})">${C}</g>`}for(let[e,t]of M){let n=O[e],r=0;for(let e of t)r+=e.band;let i=Math.min(1,Math.max((n.below?n.w:n.h)-8,0)/r),a=-r*i/2;for(let e of t)e.band*=i,e.at=a+e.band/2,a+=e.band}let K=``,q=``;for(let e=0;e<A.length;e++){let t=A[e],n=j[e],r=oe[e],i,o,s,c=N[e];if(c){let e=k[t.src],a=O[t.src],l=Math.max(Math.min(c.band/2-6,13),1),u=J+Z*.75+6;if(a.below){let d=e.x+c.at,f=e.y+a.h/2,p=m(f+J),h=m(f+J+Z);i=`M${m(d-l)},${m(f)}V${p}C${m(d-l)},${h} ${m(d+l)},${h} ${m(d+l)},${p}V${m(f)}`,o=Y(n.arrowTypeStart,d-l,f,0,-1),s=Y(n.arrowTypeEnd,d+l,f,0,-1),t.labelX=d,t.labelY=f+u+r.height/2}else{let d=e.x+a.w/2,f=e.y+c.at,p=m(d+J),h=m(d+J+Z);i=`M${m(d)},${m(f-l)}H${p}C${h},${m(f-l)} ${h},${m(f+l)} ${p},${m(f+l)}H${m(d)}`,o=Y(n.arrowTypeStart,d,f-l,-1,0),s=Y(n.arrowTypeEnd,d,f+l,-1,0),t.labelX=d+u+r.width/2,t.labelY=f}}else{let e=Ie(t.route);if(e.length<6)continue;Re(e,0,O[t.src],k[t.src]),Re(e,e.length-3,O[t.dst],k[t.dst]);let r=Math.abs(e[e.length-3]-e[0]),a=Math.abs(e[e.length-2]-e[1]),c=e.length===6&&(r<.01||a<.01||Math.hypot(r,a)<=3*J)?0:J,l=y(e,void 0,c,c);i=c>0?`M${m(l.sx)},${m(l.sy)}L${l.d.slice(1)}L${m(l.ex)},${m(l.ey)}`:l.d,o=Y(n.arrowTypeStart,l.sx,l.sy,l.sdx,l.sdy),s=Y(n.arrowTypeEnd,l.ex,l.ey,l.edx,l.edy)}let l=n.pattern===`dashed`;if(K+=`<g class="pele-edge pele-er-${l?`non-identifying`:`identifying`}" data-id="${a(n.id)}"><path d="${i}"${l?` stroke-dasharray="4 3"`:``}/>`+o+s+`</g>`,r.width>0){let e=t.labelX,i=t.labelY;q+=v(n.id,r,e,i,``,E)}}return{svg:e(`er`,V,H,h,c,r,s(L,V/2,C+L.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(G?`<g class="pele-clusters">${G}</g>`:``)+(K?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${K}</g>`:``)+(q?`<g class="pele-edge-labels" font-size="${g}">${q}</g>`:``)+`<g class="pele-nodes">${le}</g>`),width:V,height:H,links:U}}function Ie(e){let t=e.slice(0,3);for(let n=3;n<e.length;n+=3){let r=t.length-3,i=i=>Math.abs(t[r+i]-e[n+i])<.01&&Math.abs(e[n+i]-e[n+3+i])<.01;n+3<e.length&&(i(0)||i(1))||t.push(e[n],e[n+1],e[n+2])}return t}function Le(e,t,n){let r=new Map,i=(e,n,i,a)=>{let o=t[e],s=n[i]-o.x,c=n[i+1]-o.y,l;if(Math.abs(Math.abs(c)-o.h/2)<.5)l=c<0?0:2;else if(Math.abs(Math.abs(s)-o.w/2)<.5)l=s<0?3:1;else return;let u=e*4+l,d={route:n,at:i,toward:n[a+(l&1?1:0)]},f=r.get(u);f?f.push(d):r.set(u,[d])};for(let t of e){let e=t.route.length-3;t.src===t.dst||e<3||(i(t.src,t.route,0,3),i(t.dst,t.route,e,e-3))}for(let[e,i]of r){if(i.length<2)continue;let r=e>>2,a=(e&1)==1,o=t[r].isGroup?t[r]:n[r],s=a?o.h:o.w,c=Math.max(Math.min(Ae,(s-2*je)/(i.length-1)),0),l=a?t[r].y:t[r].x;i.sort((e,t)=>e.toward-t.toward);for(let e=0;e<i.length;e++)i[e].route[i[e].at+ +!!a]=l+(e-(i.length-1)/2)*c}}function Re(e,t,n,r){if(r.isGroup)return;let i=e[t]-r.x,a=e[t+1]-r.y;r.w!==n.w&&Math.abs(Math.abs(i)-r.w/2)<.5&&(e[t]-=Math.sign(i)*(r.w-n.w)/2),r.h!==n.h&&Math.abs(Math.abs(a)-r.h/2)<.5&&(e[t+1]-=Math.sign(a)*(r.h-n.h)/2)}var ze={type:`er`,math:!0,parse(e,t,n){let r=new oe;return n&&(r.title=n),q(e,r),r},render:Pe};export{ze as er};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./
|
|
1
|
+
import{a as e}from"./Dzu8v7nB.js";var t=/[\t ]*accDescr(?:[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)|\s*({))/y;function n(){let e=!1;return(n,r)=>{t.lastIndex=r;let i=t.exec(n);if(i===null)return-1;let a=t.lastIndex;if(i[1]===void 0)return a;if(e)return-1;let o=n.indexOf(`}`,a);return e=o===-1,o+1||-1}}function r(t=`ACC_DESCR`){return{...e,name:t,scanner:n}}export{r as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./
|
|
1
|
+
import{_ as e,a as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./DS7XcdHs.js";import{o as c,r as l}from"./DciMwFJ1.js";import{a as u,s as d}from"./DK9wjWIk.js";import{a as f}from"./_zY4mrA0.js";import{o as p,t as m}from"./DrPF-vh8.js";import{n as h}from"./CabmfniL.js";import{PeleError as g,g as _,h as v,s as y,u as b}from"./BNlziJ_1.js";var x=new Set([`label`,`type`,`descr`,`techn`,`sprite`,`tags`,`link`,`bgColor`,`fontColor`,`borderColor`,`shadowing`,`shape`,`legendText`,`legendSprite`]),S=new Set([`label`,`descr`,`techn`,`sprite`,`tags`,`link`,`textColor`,`lineColor`]);function C(e,t){let{key:n,value:r}=t;`from`in e&&(n===`offsetX`||n===`offsetY`)?e[n]=parseInt(r):(`from`in e?S:x).has(n)?e[n]=r:(e.extra??=new Map).set(n,r)}function w(e,t,n){n!==void 0&&(typeof n==`string`?e[t]=n:C(e,n))}function T(e,t,n){n===void 0?e[t]??=``:w(e,t,n)}function E(e,t){e.labelAttr=void 0,typeof t==`object`?(e.label=``,e.labelAttr=t,C(e,t)):e.label=t??``}var D=class{type=`c4`;c4Type;title;accTitle;accDescr;shapes=[];boundaries=[{alias:`global`,label:`global`,type:`global`,parent:void 0}];rels=[];shapeInRow=4;boundaryInRow=2;shapeIndex=new Map;boundaryIndex=new Map;relIndex=new Map;current=this.boundaries[0];stack=[];setC4Type(e){this.c4Type=e}setTitle(e){this.title=e}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}element(e,t,n,r){let i=typeof n==`string`?t.get(n):void 0;return i===void 0&&(i={alias:``,label:``,parent:void 0},e.push(i),typeof n==`string`?(i.alias=n,t.set(n,i)):(i.aliasAttr=n,C(i,n))),E(i,r),i}addPersonOrSystem(e,t){let n=this.element(this.shapes,this.shapeIndex,t[0],t[1]);T(n,`descr`,t[2]),this.finishShape(n,e,t,3)}addContainer(e,t){let n=this.element(this.shapes,this.shapeIndex,t[0],t[1]);T(n,`techn`,t[2]),T(n,`descr`,t[3]),this.finishShape(n,e,t,4)}addComponent(e,t){this.addContainer(e,t)}finishShape(e,t,n,r){w(e,`sprite`,n[r]),w(e,`tags`,n[r+1]),w(e,`link`,n[r+2]),e.kind=t,e.parent=this.current}boundary(e,t){let n=this.element(this.boundaries,this.boundaryIndex,e[0],e[1]);return e[2]===void 0?n.type=t:w(n,`type`,e[2]),n}open(e){e.parent=this.current,this.stack.push(this.current),this.current=e}addPersonOrSystemBoundary(e,t=`system`){let n=this.boundary(e,t);w(n,`tags`,e[3]),w(n,`link`,e[4]),this.open(n)}addContainerBoundary(e){this.addPersonOrSystemBoundary(e,`container`)}addDeploymentNode(e,t){let n=this.boundary(t,`node`);T(n,`descr`,t[3]),w(n,`sprite`,t[4]),w(n,`tags`,t[5]),w(n,`link`,t[6]),n.nodeType=e,this.open(n)}popBoundaryParseStack(){this.current=this.stack.pop()??this.boundaries[0]}addRel(e,t){let n=t[0],r=t[1];if(n===void 0||r===void 0||t[2]===void 0)return;let i=typeof n==`string`&&typeof r==`string`,a=i?this.relIndex.get(n)?.get(r):void 0;if(a===void 0){if(a={type:e,from:``,to:``,label:``},this.rels.push(a),i){let e=this.relIndex.get(n);e===void 0&&this.relIndex.set(n,e=new Map),e.set(r,a)}typeof n==`string`?a.from=n:a.fromAttr=n,typeof r==`string`?a.to=r:a.toAttr=r}a.type=e,E(a,t[2]),T(a,`techn`,t[3]),T(a,`descr`,t[4]),w(a,`sprite`,t[5]),w(a,`tags`,t[6]),w(a,`link`,t[7])}getC4Shape(e){return this.shapeIndex.get(e)??this.boundaryIndex.get(e)}updateElStyle(e,t){let n=typeof t[0]==`string`?this.getC4Shape(t[0]):void 0;n!==void 0&&(w(n,`bgColor`,t[1]),w(n,`fontColor`,t[2]),w(n,`borderColor`,t[3]),w(n,`shadowing`,t[4]),w(n,`shape`,t[5]),w(n,`sprite`,t[6]),w(n,`techn`,t[7]),w(n,`legendText`,t[8]),w(n,`legendSprite`,t[9]))}updateRelStyle(e,t){let n=t[0],r=t[1],i=typeof n==`string`&&typeof r==`string`?this.relIndex.get(n)?.get(r):void 0;if(i===void 0)return;w(i,`textColor`,t[2]),w(i,`lineColor`,t[3]);let a=t[4],o=t[5];typeof a==`string`?i.offsetX=parseInt(a):a!==void 0&&C(i,a),typeof o==`string`?i.offsetY=parseInt(o):o!==void 0&&C(i,o)}updateLayoutConfig(e,t){let n=e=>e===void 0?NaN:parseInt(typeof e==`string`?e:e.value),r=n(t[0]),i=n(t[1]);r>=1&&(this.shapeInRow=r),i>=1&&(this.boundaryInRow=i)}},O=`$end.INVALID.direction_tb.direction_bt.direction_rl.direction_lr.title.accDescription.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.NEWLINE.C4_CONTEXT.C4_CONTAINER.C4_COMPONENT.C4_DYNAMIC.C4_DEPLOYMENT.PERSON.PERSON_EXT.SYSTEM.SYSTEM_DB.SYSTEM_QUEUE.SYSTEM_EXT.SYSTEM_EXT_DB.SYSTEM_EXT_QUEUE.CONTAINER.CONTAINER_DB.CONTAINER_QUEUE.CONTAINER_EXT.CONTAINER_EXT_DB.CONTAINER_EXT_QUEUE.COMPONENT.COMPONENT_DB.COMPONENT_QUEUE.COMPONENT_EXT.COMPONENT_EXT_DB.COMPONENT_EXT_QUEUE.ENTERPRISE_BOUNDARY.SYSTEM_BOUNDARY.BOUNDARY.CONTAINER_BOUNDARY.NODE.NODE_L.NODE_R.REL.BIREL.REL_U.REL_D.REL_L.REL_R.REL_B.REL_INDEX.UPDATE_EL_STYLE.UPDATE_REL_STYLE.UPDATE_LAYOUT_CONFIG.EOF_IN_STRUCT.ATTRIBUTE_EMPTY.STR.STR_KEY.STR_VALUE.LBRACE.RBRACE.EOF`.split(`.`),k=new Map([[`C4Context`,14],[`C4Container`,15],[`C4Component`,16],[`C4Dynamic`,17],[`C4Deployment`,18],[`Person`,19],[`Person_Ext`,20],[`System`,21],[`SystemDb`,22],[`SystemQueue`,23],[`System_Ext`,24],[`SystemDb_Ext`,25],[`SystemQueue_Ext`,26],[`Container`,27],[`ContainerDb`,28],[`ContainerQueue`,29],[`Container_Ext`,30],[`ContainerDb_Ext`,31],[`ContainerQueue_Ext`,32],[`Component`,33],[`ComponentDb`,34],[`ComponentQueue`,35],[`Component_Ext`,36],[`ComponentDb_Ext`,37],[`ComponentQueue_Ext`,38],[`Enterprise_Boundary`,39],[`System_Boundary`,40],[`Boundary`,41],[`Container_Boundary`,42],[`Deployment_Node`,43],[`Node`,43],[`Node_L`,44],[`Node_R`,45],[`Rel`,46],[`BiRel`,47],[`Rel_Up`,48],[`Rel_U`,48],[`Rel_Down`,49],[`Rel_D`,49],[`Rel_Left`,50],[`Rel_L`,50],[`Rel_Right`,51],[`Rel_R`,51],[`Rel_Back`,52],[`RelIndex`,53],[`UpdateElementStyle`,54],[`UpdateRelStyle`,55],[`UpdateLayoutConfig`,56]]),A=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y],j=/[\n\r\u2028\u2029]/g,M=/title[^\S\r\n]*(?=[\r\n]|$)\s*/y;function N(e){let t=e.length,n=[],r=[],i=[],a=0,o=9,s=0,c=!1,l=-2,u=-1,d=0,f=(e,t,a)=>{n.push(e),r.push(t),i.push(a),s=a},p=n=>{for(;n<t&&v(e.charCodeAt(n));)n++;return n},m=(n,r)=>{let i=e.indexOf(n,r);return i===-1?t:i},h=(n,r)=>{let i=s+n.length;if(!e.startsWith(n,s)||!v(e.charCodeAt(i)))return!1;let a=++i;for(;i<t;){let t=e.charCodeAt(i);if(t===35||t===10||t===59)break;i++}return i!==a&&(f(r,s,i),!0)};for(;;){if(c){f(0,t,t);break}s>=t&&(c=!0);let n=e.charCodeAt(s);if(a===0){if(s>=t){f(64,t,t);continue}if(l!==-1&&s>=d&&(l<s&&(l=e.indexOf(`direction`,s)),l!==-1&&(u<s&&(j.lastIndex=s,u=j.test(e)?j.lastIndex-1:t),l<u))){let t=!1;for(let n=0;n<4&&!t;n++)A[n].lastIndex=s,A[n].test(e)&&(f(2+n,s,A[n].lastIndex),t=!0);if(t)continue;d=u}if(n===116){if(M.lastIndex=s,M.test(e)){s=M.lastIndex;continue}if(h(`title`,6))continue}if(n===97){if(h(`accDescription`,7))continue;let t=e.startsWith(`accTitle`,s);if(t||e.startsWith(`accDescr`,s)){let n=p(s+8),r=e.charCodeAt(n);if(r===58){f(t?8:10,s,p(n+1)),o=t?9:11,a=7;continue}if(r===123&&!t){s=p(n+1),a=8;continue}}}if(n===37&&e.charCodeAt(s+1)===37){let n=m(`
|
|
3
3
|
`,s+2);for(;n<t&&(e.charCodeAt(n)===10||e.charCodeAt(n)===13);)n++;s=n;continue}if(v(n)){let n=s,r=-1;for(;n<t;){let t=e.charCodeAt(n);if(!v(t))break;t===10&&(r=n),n++}r===-1?s=n:f(13,s,r+1);continue}if(n===123){f(62,s,s+1);continue}if(n===125){f(63,s,s+1);continue}if(_(n)){let n=s+1;for(;n<t&&_(e.charCodeAt(n));)n++;let r=n-s<=19?k.get(e.slice(s,n)):void 0;if(r!==void 0){r>18&&(a=1),f(r,s,n);continue}}f(1,s,s);break}if(a===1){if(s>=t)f(57,t,t);else if(n===40){let t=s+1;for(;e.charCodeAt(t)===32;)t++;e.charCodeAt(t)===44?f(58,s,t+1):s++,a=2}else if(n===41)s++,a=0;else{f(1,s,s);break}}else if(a===2){if(s>=t)continue;if(n===41)s++,a=0;else if(n===44)e.charCodeAt(s+1)===44?f(58,s,s+2):s++;else{let t=s;for(;e.charCodeAt(t)===32;)t++;let n=e.charCodeAt(t);n===34?e.charCodeAt(t+1)===34?f(58,s,t+2):(s=t+1,a=3):n===36?(s=t+1,a=4):f(59,s,m(`,`,s))}}else if(a===3)n===34?(s++,a=2):f(59,s,m(`"`,s));else if(a===4)f(60,s,m(`=`,s)),a=5;else if(a===5){if(s>=t)continue;let r=s+1;if(n===61)for(;e.charCodeAt(r)===32;)r++;if(n!==61||e.charCodeAt(r)!==34){f(1,s,s);break}s=r+1,a=6}else if(a===6){if(s>=t)continue;n===34?(s++,a=2):f(61,s,m(`"`,s))}else a===7?(f(o,s,m(`
|
|
4
4
|
`,s)),a=0):n===125?(s++,a=0):f(12,s,m(`}`,s))}return{types:n,starts:r,ends:i}}var P=[`person`,`external_person`,`system`,`system_db`,`system_queue`,`external_system`,`external_system_db`,`external_system_queue`,`container`,`container_db`,`container_queue`,`external_container`,`external_container_db`,`external_container_queue`,`component`,`component_db`,`component_queue`,`external_component`,`external_component_db`,`external_component_queue`],F=[`rel`,`birel`,`rel_u`,`rel_d`,`rel_l`,`rel_r`,`rel_b`,`rel`],I=[`node`,`nodeL`,`nodeR`],ee=`'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'C4_CONTEXT', 'C4_CONTAINER', 'C4_COMPONENT', 'C4_DYNAMIC', 'C4_DEPLOYMENT'`,te=`'STR', 'STR_KEY', 'ATTRIBUTE', 'ATTRIBUTE_EMPTY'`;function L(e){return e===6||e===7||e===8||e===10||e===12}function ne(e){return e>=19&&e<=56}function R(e,t){let{types:n,starts:r,ends:i}=N(e),a=0,o=t=>e.slice(r[t],i[t]),s=t=>{let i=n[a];throw i===1?y(`c4`,e,r[a],``,!0):y(`c4`,e,r[a],`Expecting ${t}, got '${O[i]}'`)},c=e=>{n[a]!==e&&s(`'${O[e]}'`),a++},l=()=>{let e=[];for(;;){let t=n[a];if(t===59)e.push(o(a++).trim());else if(t===58)e.push(``),a++;else if(t===60)a++,n[a]!==61&&s(`'STR_VALUE'`),e.push({key:o(a-1).trim(),value:o(a).trim()}),a++;else break}return e.length===0&&s(te),e},u=e=>{e===6?t.setTitle(o(a++).substring(6)):e===7?t.setAccDescription(o(a++).substring(15)):e===12?t.setAccDescription(o(a++).trim()):(a++,e===8?(n[a]!==9&&s(`'acc_title_value'`),t.setTitle(o(a++).trim())):(n[a]!==11&&s(`'acc_descr_value'`),t.setAccDescription(o(a++).trim())))},d=e=>{a++;let r=l();if(e<=26)t.addPersonOrSystem(P[e-19],r);else if(e<=32)t.addContainer(P[e-19],r);else if(e<=38)t.addComponent(P[e-19],r);else{if(e<=45)return e===39?r.splice(2,0,`ENTERPRISE`):e===40?r.splice(2,0,`SYSTEM`):e===42&&r.splice(2,0,`CONTAINER`),e>=43?t.addDeploymentNode(I[e-43],r):e===42?t.addContainerBoundary(r):t.addPersonOrSystemBoundary(r),n[a]===62?(a++,c(13)):n[a]===13?(a++,c(62),n[a]===13&&a++):s(`'NEWLINE', 'LBRACE'`),!0;e<=53?(e===53&&r.splice(0,1),t.addRel(F[e-46],r)):e===54?t.updateElStyle(`update_el_style`,r):e===55?t.updateRelStyle(`update_rel_style`,r):t.updateLayoutConfig(`update_layout_config`,r)}return!1},f=n[a];(f<14||f>18)&&s(ee),a++,c(13);let p=0,m=0;for(;;){let e=n[a];if(m===3||m===4){if(e===13){a++,m=2;continue}if(m===3&&ne(e)){m=1;continue}}else if(ne(e)){d(e)?(p++,m=1):m=4;continue}else if(L(e)&&m!==1){u(e),m=3;continue}else m!==2&&s(`'title', 'accDescription', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'PERSON', 'REL'`);if(p>0)e!==63&&s(`'NEWLINE', 'RBRACE'`),a++,t.popBoundaryParseStack(),p--,m=4;else{e!==64&&s(`'NEWLINE', 'EOF'`),a++,c(0),t.setC4Type(o(0));return}}}var z=28,B=20,V=7,H=8,U=30,W=88,G=160,re=8,ie=26,ae=e=>Math.min(12,Math.max(6,e/14)),oe=e=>Math.min(12,e/4);function K(e,t,n,r,i,a,o,s){let c=0,l=1;if(o===0){if(i<e||i>n)return 1/0}else{let t=(e-i)/o,r=(n-i)/o;c=Math.max(c,Math.min(t,r)),l=Math.min(l,Math.max(t,r))}if(s===0){if(a<t||a>r)return 1/0}else{let e=(t-a)/s,n=(r-a)/s;c=Math.max(c,Math.min(e,n)),l=Math.min(l,Math.max(e,n))}return c<=l?c:1/0}function q(e,t,n,r,i,a,o,s){let c=o/n,l=s/r,u=(i-e)/n,d=(a-t)/r,f=c*c+l*l,p=2*(c*u+l*d),m=u*u+d*d-1,h=p*p-4*f*m;if(f===0||h<0)return 1/0;let g=(-p-Math.sqrt(h))/(2*f);return g>=0&&g<=1?g:m<=0?0:1/0}function J(e,t,n,r,i){let{x:a,y:o,w:s,h:c}=e,l=r-t,u=i-n;if(e.form===`person`)return Math.min(K(a,o+ie,a+s,o+c,t,n,l,u),q(a+s/2,o+14,13,13,t,n,l,u));if(e.form===`cyl`){let e=ae(s);return Math.min(K(a,o+e,a+s,o+c-e,t,n,l,u),q(a+s/2,o+e,s/2,e,t,n,l,u),q(a+s/2,o+c-e,s/2,e,t,n,l,u))}if(e.form===`h-cyl`){let e=oe(c);return Math.min(K(a+e,o,a+s-e,o+c,t,n,l,u),q(a+e,o+c/2,e,c/2,t,n,l,u),q(a+s-e,o+c/2,e,c/2,t,n,l,u))}return K(a,o,a+s,o+c,t,n,l,u)}function se(e,t,n,r,i){for(let a=2;a<e.length;a+=2){let o=e[a-2],s=e[a-1];if(K(t,n,r,i,o,s,e[a]-o,e[a+1]-s)<=1)return!0}return!1}function Y(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.w>=t.x+t.w&&e.y+e.h>=t.y+t.h}function ce(e,t,n){let r=e.x+e.w/2,i=e.y+e.h/2,a=t.x+t.w/2,o=t.y+t.h/2,s=Y(e,t);if(s||Y(t,e)){let n=s?e:t,r=s?t:e,i=r.x+r.w/2,a=r.y+r.h/2,o=r.x-n.x,c=n.x+n.w-r.x-r.w,l=r.y-n.y,u=n.y+n.h-r.y-r.h,d=Math.min(o,c,l,u),f=d===o?n.x:d===c?n.x+n.w:i,p=d===o||d===c?a:d===u?n.y+n.h:n.y,m=Math.min(J(r,f,p,i,a),1),h=f+(i-f)*m,g=p+(a-p)*m;return s?[f,p,h,g]:[h,g,f,p]}let c=r,l=i,u=a,d=o,f=Math.max(e.x,t.x),p=Math.min(e.x+e.w,t.x+t.w),m=Math.max(e.y,t.y),h=Math.min(e.y+e.h,t.y+t.h);f<p?c=u=(f+p)/2:m<h&&(l=d=(m+h)/2);let g=Math.hypot(u-c,d-l)||1,_=-(d-l)/g*n,v=(u-c)/g*n,y=J(e,u+_,d+v,c+_,l+v),b=J(t,c+_,l+v,u+_,d+v);return y<=1&&b<=1?(c+=_,l+=v,u+=_,d+=v):(c=r,l=i,u=a,d=o,y=Math.min(J(e,u,d,c,l),1),b=Math.min(J(t,c,l,u,d),1)),[u+(c-u)*y,d+(l-d)*y,c+(u-c)*b,l+(d-l)*b]}var le=6,ue=3,de=12,fe=class{upright=[];level=[];frames=[[],[]];taken=new Map;squeezed=0;free(e,t,n,r){let i=Math.min(n,r),a=Math.max(n,r),o=(e,n)=>{for(let r=0;r<e.length;r+=3)if(Math.abs(e[r]-t)<n&&e[r+1]<a&&e[r+2]>i)return!0;return!1};return!o(e?this.upright:this.level,le)&&!o(this.frames[+!e],ue)}crossings(e){let t=0;for(let n=2;n<e.length;n+=2){let r=e[n]===e[n-2],i=r?e[n]:e[n+1],a=Math.min(r?e[n-1]:e[n-2],r?e[n+1]:e[n]),o=Math.max(r?e[n-1]:e[n-2],r?e[n+1]:e[n]),s=r?this.level:this.upright;for(let e=0;e<s.length;e+=3)s[e]>a&&s[e]<o&&s[e+1]<i&&s[e+2]>i&&t++}return t}frame(e){this.frames[0].push(e.x,e.y,e.y+e.h,e.x+e.w,e.y,e.y+e.h),this.frames[1].push(e.y,e.x,e.x+e.w,e.y+e.h,e.x,e.x+e.w)}take(e){for(let t=2;t<e.length;t+=2)e[t]===e[t-2]?this.upright.push(e[t],Math.min(e[t-1],e[t+1]),Math.max(e[t-1],e[t+1])):e[t+1]===e[t-1]&&this.level.push(e[t+1],Math.min(e[t-2],e[t]),Math.max(e[t-2],e[t]))}ports(e,t,n,r,i){let a=this.taken.get(e)??[],o=[];for(let e=0;e<9&&o.length<4;e++){let s=n+(e&1?1:-1)*Math.ceil(e/2)*de;if(s<r||s>i)continue;let c=!0;for(let e=0;e<a.length;e+=2)a[e]===t&&Math.abs(a[e+1]-s)<de&&(c=!1);c&&o.push(s)}return o.length?o:[n]}claim(e,t,n){let r=this.taken.get(e);r?r.push(t,n):this.taken.set(e,[t,n])}};function pe(e,t,n){let r=e.length,i=Math.sign(e[2]-e[0]),a=Math.sign(e[3]-e[1]),o=`M${s(e[0]+i*t)},${s(e[1]+a*t)}`;for(let t=2;t<r-2;t+=2){let n=e[t],r=e[t+1],i=Math.sign(n-e[t-2]),a=Math.sign(r-e[t-1]),c=Math.sign(e[t+2]-n),l=Math.sign(e[t+3]-r),u=Math.min(H,Math.abs(n-e[t-2]+r-e[t-1])/2,Math.abs(e[t+2]-n+e[t+3]-r)/2);o+=`${i?`H`+s(n-i*u):`V`+s(r-a*u)}Q${s(n)},${s(r)} ${s(n+c*u)},${s(r+l*u)}`}let c=Math.sign(e[r-2]-e[r-4]),l=Math.sign(e[r-1]-e[r-3]);return o+(c?`H`+s(e[r-2]-c*n):`V`+s(e[r-1]-l*n))}function me(e,t,n,r){for(let i of t)if(i!==n&&i!==r&&se(e,i.x,i.y,i.x+i.w,i.y+i.h))return!1;return!0}function he(e,t,n,r,i){let a=e.length;return{d:pe(e,n,r),sx:e[0],sy:e[1],sdx:-Math.sign(e[2]-e[0]),sdy:-Math.sign(e[3]-e[1]),ex:e[a-2],ey:e[a-1],edx:Math.sign(e[a-2]-e[a-4]),edy:Math.sign(e[a-1]-e[a-3]),x0:e[t],y0:e[t+1],x1:e[t+2],y1:e[t+3],nx:0,ny:0,lean:0,room:G,...i,points:e}}function ge(e,t){let n=[],r=(e+t)/2,i=Math.max(V,(t-e)/4);for(let a=0;a<9;a++){let o=r+(a&1?1:-1)*Math.ceil(a/2)*i;o>=e+le&&o<=t-le&&n.push(o)}return n}function _e(e,t,n,r,i,a){let o=e.x+e.w/2,s=e.y+e.h/2,c=t.x+t.w/2,l=t.y+t.h/2,u,d=(i,a,o)=>{if(!me(i,n,e,t))return;for(let e=2;e<i.length;e+=2){let t=i[e]===i[e-2];if(!r.free(t,t?i[e]:i[e+1],t?i[e-1]:i[e-2],t?i[e+1]:i[e]))return}let s=r.crossings(i)*1e6;for(let e=2;e<i.length;e+=2)s+=Math.abs(i[e]-i[e-2])+Math.abs(i[e+1]-i[e-1]);(!u||s<u.cost)&&(u={points:i,cost:s,upright:a,sides:o})};if(e.x+e.w<=t.x||t.x+t.w<=e.x){let n=c>o,i=Math.sign(l-s),a=n?[1,0]:[0,1],f=ge(n?e.x+e.w:t.x+t.w,n?t.x:e.x);e:for(let n of r.ports(e,a[0],s+i*e.h/4,e.y+8,e.y+e.h-8))for(let s of r.ports(t,a[1],l-i*t.h/4,t.y+8,t.y+t.h-8))for(let r of f){let i=r+(o-r)*Math.min(J(e,r,n,o,n),1),l=r+(c-r)*Math.min(J(t,r,s,c,s),1),f=u;if(d([i,n,r,n,r,s,l,s],!0,a),u!==f)break e}}if(e.y+e.h<=t.y||t.y+t.h<=e.y){let n=l>s,i=Math.sign(c-o),a=n?[3,2]:[2,3],f=ge(n?e.y+e.h:t.y+t.h,n?t.y:e.y);e:for(let n of r.ports(e,a[0],o+i*e.w/4,e.x+8,e.x+e.w-8))for(let o of r.ports(t,a[1],c-i*t.w/4,t.x+8,t.x+t.w-8))for(let r of f){let i=r+(s-r)*Math.min(J(e,n,r,n,s),1),c=r+(l-r)*Math.min(J(t,o,r,o,l),1),f=u;if(d([n,i,n,r,o,r,o,c],!1,a),u!==f)break e}}if(!u)return;let{points:f,upright:p,sides:m}=u;return r.take(f),r.claim(e,m[0],p?f[1]:f[0]),r.claim(t,m[1],p?f[7]:f[6]),he(f,2,i,a,{room:p?W:G})}function ve(e,t,n,r,i,a,o){if(e===t){let t=Math.min(e.h/2-4,10),n=Math.hypot(z,t),r=e.x+e.w,i=e.y+e.h/2,c=z/n,l=t/n;return{d:`M${s(r+c*a)},${s(i-t-l*a)}C${s(r+z)},${s(i-t*2)} ${s(r+z)},${s(i+t*2)} ${s(r+c*o)},${s(i+t+l*o)}`,sx:r,sy:i-t,sdx:-c,sdy:l,ex:r,ey:i+t,edx:-c,edy:-l,x0:r+z+4,y0:i,x1:r+z+4,y1:i,nx:1,ny:0,lean:0,room:64,points:[]}}let[c,l,u,d]=ce(e,t,n),f=c===u,p=!1;if(r&&!Y(e,t)&&!Y(t,e))for(let n of r)n!==e&&n!==t&&K(n.x,n.y,n.x+n.w,n.y+n.h,c,l,u-c,d-l)<=1&&(p=!0);if(r&&p&&!f&&l!==d){let n=_e(e,t,r,i,a,o);if(n)return n;i.squeezed++}if(r&&p&&(f||l===d)){let n=n=>{let i=n?-1/0:1/0,a=e=>{let t=f?e.x:e.y;i=n?Math.max(i,t+(f?e.w:e.h)):Math.min(i,t)};a(e),a(t);for(let n of r)n!==e&&n!==t&&K(n.x,n.y,n.x+n.w,n.y+n.h,c,l,u-c,d-l)<=1&&a(n);return i},s=f?Math.min(e.y,t.y):Math.min(e.x,t.x),p=f?Math.max(e.y+e.h,t.y+t.h):Math.max(e.x+e.w,t.x+t.w),m=(n,i)=>{for(let a of r){if(a===e||a===t)continue;let r=f?a.y<p&&a.y+a.h>s:a.x<p&&a.x+a.w>s,o=f?a.x:a.y,c=o+(f?a.w:a.h);if(r&&(n?c>i:o<i))return!1}return!0},h=e.x+e.w/2,g=e.y+e.h/2,_=t.x+t.w/2,v=t.y+t.h/2,y=Math.sign(f?v-g:_-h),b=a=>{let o=n(a),s=a?1:-1,c=f?+!!a:a?3:2,l=f?i.ports(e,c,g+y*e.h/4,e.y+8,e.y+e.h-8)[0]:i.ports(e,c,h+y*e.w/4,e.x+8,e.x+e.w-8)[0],u=f?i.ports(t,c,v-y*t.h/4,t.y+8,t.y+t.h-8)[0]:i.ports(t,c,_-y*t.w/4,t.x+8,t.x+t.w-8)[0],d=n=>{if(f){let r=n+(h-n)*Math.min(J(e,n,l,h,l),1),i=n+(_-n)*Math.min(J(t,n,u,_,u),1);return[r,l,n,l,n,u,i,u]}let r=n+(g-n)*Math.min(J(e,l,n,l,g),1),i=n+(v-n)*Math.min(J(t,u,n,u,v),1);return[l,r,l,n,u,n,u,i]},p=d(o+s*B);for(let n=0;n<=4;n++){let a=o+s*(B+n*V),m=d(a);if(me(m,r,e,t)&&(p=m,i.free(f,a,l,u)))return{points:p,side:c,p0:l,p1:u,step:n}}return{points:p,side:c,p0:l,p1:u,step:5}},x=f?d>l:u<c,S=m(x,n(x)),C=m(!x,n(!x)),w=b(x),T=S===C?b(!x):void 0,E=e=>i.crossings(e.points)*8+e.step,D=C&&!S||T&&E(T)<E(w)?!x:x,{points:O,side:k,p0:A,p1:j,step:M}=D===x?w:T??b(!x),N=D?1:-1;return M>4&&i.squeezed++,i.take(O),i.claim(e,k,A),i.claim(t,k,j),he(O,2,a,o,f?{nx:N,lean:U,room:W}:{room:G})}let m=Math.hypot(u-c,d-l)||1,h=(u-c)/m,g=(d-l)/m;return(f||l===d)&&i.take([c,l,u,d]),{d:`M${s(c+h*a)},${s(l+g*a)}L${s(u-h*o)},${s(d-g*o)}`,sx:c,sy:l,sdx:-h,sdy:-g,ex:u,ey:d,edx:h,edy:g,x0:c,y0:l,x1:u,y1:d,nx:n?-g:0,ny:n?h:0,lean:0,room:Math.abs(h)>Math.abs(g)?W:G,points:[c,l,u,d]}}var ye=216,be=64,xe=14,Se=12,Ce=W+re+24,we=88,Te=B+8,X=48,Z=16,Ee=10,De=new Map([[`person`,`person`],[`box`,`rect`],[`rounded`,`rect`],[`component`,`rect`],[`cylinder`,`cyl`],[`database`,`cyl`],[`db`,`cyl`],[`queue`,`h-cyl`],[`pipe`,`h-cyl`]]);function Oe(e){let t=De.get((e.shape??``).toLowerCase())??De.get((e.sprite??``).toLowerCase());if(t)return t;if(e.tags)for(let t of e.tags.split(`,`)){let e=De.get(t.trim().toLowerCase());if(e)return e}let n=e.kind;return n.endsWith(`person`)?`person`:n.endsWith(`_db`)?`cyl`:n.endsWith(`_queue`)?`h-cyl`:`rect`}function ke(e,t,n,r,i=ye){let a=Oe(e),s=a===`h-cyl`?36:0,c=a===`person`?ie:a===`cyl`?24:0,l=i-2*xe-s,u=[o(`«`+e.kind.replace(/_/g,` `)+`»`,!1,t,r-1,l),o(e.label,!1,t,n,l,1),o(e.techn?`[${e.techn}]`:void 0,!1,t,r,l),o(e.descr,!1,t,r,l)],d=0,f=u[3].height>0?4:0;for(let e of u)d=Math.max(d,e.width),f+=e.height;return{shape:e,form:a,labels:u,textH:f,x:0,y:0,w:Math.max(i,d+2*xe+s),h:Math.max(be,f+2*Se+c)}}function Ae(e,t,n,r,i){let a=0,o=0;for(let s=0;s<e.length;s+=t){let c=Math.min(e.length,s+t),l=0,u=0;for(let t=s;t<c;t++)u=Math.max(u,e[t].h);for(let t=s;t<c;t++){let r=e[t];r.x=l,r.y=o,i&&(r.h=u),l+=r.w+n}a=Math.max(a,l-n),o+=u+r}return[a,e.length>0?o-r:0]}function je(e,t,n,r,i,a){let s=i===void 0?Te:12,c=new Map;for(let a of e.boundaries){let e=i===void 0?4e3:Math.max(80,i-2*Z-2*Te*2),l=a.parent?[o(a.label,!1,t,n,e,1),o(a.type?`[${a.type}]`:void 0,!1,t,r,e),o(a.descr,!1,t,r,e)]:[],u=0,d=0;for(let e of l)u+=e.height,d=Math.max(d,e.width);c.set(a,{boundary:a,kids:[],nodes:[],labels:l,head:u>0?u+Ee+6+B:s,headW:d,headX:Z,x:0,y:0,w:0,h:0,form:`rect`})}let l=c.get(e.boundaries[0]);for(let e of c.values()){let t=e.boundary.parent;t&&c.get(t)?.kids.push(e)}let u=[l],d=new Map([[l.boundary,0]]);for(let e=0;e<u.length;e++)for(let t of u[e].kids)d.set(t.boundary,d.get(u[e].boundary)+1),u.push(t);for(let a of e.shapes)if(a.parent){let e=d.get(a.parent)??0,o=i===void 0?ye:Math.max(100,Math.min(ye,i-2*e*s-32));c.get(a.parent)?.nodes.push(ke(a,t,n,r,o))}let f=Math.max(1,e.shapeInRow),p=Math.max(1,e.boundaryInRow),m=new Map;for(let e=u.length-1;e>=0;e--){let t=u[e],n=i===void 0?Ce:a,r=(e,t,n)=>{if(i===void 0)return t;let r=1;for(let t of e)r=Math.max(r,t.w);return Math.max(1,Math.min(t,Math.floor((i+n-2*s)/(r+n))))},[o,c]=Ae(t.nodes,r(t.nodes,f,n),n,we,!0),[d,h]=Ae(t.kids,r(t.kids,p,X),X,X,!1),g=c>0&&h>0?X:0,_=t===l?0:s;m.set(t,c+g),t.w=Math.max(o,d,t.headW+2*Z-2*_)+2*_,t.h=(_&&t.head)+c+g+h+_}let h=new Map;for(let e of u){let t=e.x+(e===l?0:s),n=e.y+(e===l?0:e.head);for(let r of e.nodes)r.x+=t,r.y+=n,h.set(r.shape,r);for(let r of e.kids)r.x+=t,r.y+=n+m.get(e);e!==l&&h.set(e.boundary,e)}return{order:u,boxes:h}}var Me=7,Q=36,Ne=24,Pe=2e3,$=8,Fe=[.5,.4,.6,.3,.7,.2,.8],Ie=2e6;function Le(e,t,n){let r=[];return e&&r.push(`fill:`+e),t&&r.push(`stroke:`+t),n&&r.push(`color:`+n),a(r)}function Re(e,t,n,r,i){return t?m(e,p(t.includes(`¶ß`)?t.replace(/\ufb02\u00b0\u00b0?/g,`#`).replace(/\u00b6\u00df/g,`;`):t),n,r,i):e}function ze(e,t,n){return c(n,r=>{if(!r)return Be(e,t,n,!1)[0];let[i,a]=Be(e,t,n,!0,Q);for(let r=Q+Ne;a>0&&r<=Q+3*Ne;r+=Ne){let[o,s]=Be(e,t,n,!0,r);s<a&&([i,a]=[o,s])}return i})}function Be(a,c,p,m,_=Q){let v=p.fontSize??16,y=Math.round(v*.8125),x=p.measurer??b(p.fontFamily,p.fontFamilyMono),S=p.padding??8,C=[],{order:w,boxes:T}=je(a,x,v,y,m?Math.max(80,(p.maxWidth??320)-2*S):void 0,_),E=w[0],D=0,O=0,k=E.w,A=E.h,j=(e,t,n,r)=>{D=Math.min(D,e),O=Math.min(O,t),k=Math.max(k,n),A=Math.max(A,r)},M=[],N=new Map;for(let e of a.rels){let t=e.fromAttr?void 0:a.getC4Shape(e.from),n=e.toAttr?void 0:a.getC4Shape(e.to),r=t&&T.get(t),i=n&&T.get(n);if(!r||!i)throw new g(`C4 rel "${e.from}" -> "${e.to}" references an unknown shape or boundary`,`semantic`,{type:`c4`});M.push(r,i);let o=N.get(r);o||N.set(r,o=new Set),o.add(i)}let P=[],F=[];for(let e of w)for(let t of e.nodes)P.push(t),F.push(t.x+$,t.y+$,t.x+t.w-$,t.y+t.h-$);let I=a.rels.length*(P.length+w.length+3*a.rels.length)<=Ie,ee=(e,t,n,r)=>{let i=0;for(let a=0;a<F.length;a+=4){let o=Math.min(n,F[a+2])-Math.max(e,F[a]);if(o<=0)continue;let s=Math.min(r,F[a+3])-Math.max(t,F[a+1]);s>0&&(i+=o*s)}return i},te=e=>e?Math.max(-Pe,Math.min(Pe,e)):0,L=``,ne=u(`arrow_point`),R=new fe;for(let e of w)e!==E&&R.frame(e);let z=a.rels.map((e,n)=>{let i=M[n*2],a=M[n*2+1],o=Le(void 0,e.lineColor,void 0),s=o.stroke?t(o.stroke):`var(--_l)`,c=e.type===`birel`||e.type===`rel_b`,l=e.type!==`rel_b`,u=ve(i,a,i!==a&&N.get(a)?.has(i)===!0?Me:0,I?P:void 0,R,c?ne:0,l?ne:0);return j(Math.min(u.x0,u.x1),Math.min(u.y0,u.y1),Math.max(u.x0,u.x1),Math.max(u.y0,u.y1)),c&&I&&F.push(u.sx-8,u.sy-8,u.sx+8,u.sy+8),l&&I&&F.push(u.ex-8,u.ey-8,u.ex+8,u.ey+8),L+=`<g class="pele-edge" data-id="${r(e.from+`-`+e.to)}"${o.line}><path d="${u.d}"/>`+(c?d(`arrow_point`,u.sx,u.sy,u.sdx,u.sdy,s):``)+(l?d(`arrow_point`,u.ex,u.ey,u.edx,u.edy,s):``)+`</g>`,u});for(let e of w){if(!I||e.headW===0)continue;let t=e.y+Ee,n=e.y+e.head-B,r=1/0;for(let i of[Z,(e.w-e.headW)/2,e.w-Z-e.headW]){let a=0;for(let r of z)se(r.points,e.x+i-4,t,e.x+i+e.headW+4,n)&&a++;if(a<r&&(r=a,e.headX=i),a===0)break}F.push(e.x+e.headX-4,t,e.x+e.headX+e.headW+4,n)}let V=``;a.rels.forEach((e,t)=>{let n=z[t],c=e.from+`-`+e.to,l=Le(void 0,void 0,e.textColor),u=(a.c4Type===`C4Dynamic`?t+1+`: `:``)+e.label,d=o(u,!1,x,y,n.room),f=o(e.techn?`[${e.techn}]`:void 0,!1,x,y,n.room,2),h=Math.max(d.width,f.width)+re,g=d.height+f.height;if(g===0)return;let _=Math.abs(n.nx)*(h/2)+Math.abs(n.ny)*(g/2)+2,v=n.lean?Math.max(0,Math.min(n.lean,_-14)):_,b=n.nx*v+(m?0:te(e.offsetX)),S=n.ny*v+(m?0:te(e.offsetY)),w=.5;if(I){let e=1/0,t=b!==n.nx*v||S!==n.ny*v;for(let r=0;r<(t?2:1)&&e>0;r++){let t=r?n.nx*v:b,i=r?n.ny*v:S;for(let r of Fe){let a=n.x0+(n.x1-n.x0)*r+t,o=n.y0+(n.y1-n.y0)*r+i,s=ee(a-h/2,o-g/2,a+h/2,o+g/2);if(s<e&&(e=s,w=r,b=t,S=i),s===0)break}}}let T=n.x0+(n.x1-n.x0)*w+b,E=n.y0+(n.y1-n.y0)*w+S-g/2;I&&F.push(T-h/2,E,T+h/2,E+g),j(T-h/2,E,T+h/2,E+g),V+=`<g class="pele-edge-label" data-id="${r(c)}">`+(e.descr?`<title>${r(e.descr)}</title>`:``)+`<rect x="${s(T-h/2)}" y="${s(E)}" width="${s(h)}" height="${s(g)}" rx="3" fill="var(--_bg)"/>`+Re(i(d,T,E+d.height/2,l.text)+i(f,T,E+d.height+f.height/2,` class="pele-c4-techn" fill="var(--_m)"${l.text}`),e.link,c,C,p)+`</g>`});let H=``,U=``;for(let e of w){if(e!==E){let t=e.boundary,i=Le(t.bgColor,t.borderColor,t.fontColor),a=e.x+e.headX,o=e.y+Ee,c=h(e.labels[0],a,o,` class="pele-cluster-label" font-weight="var(--_hw)"${i.text}`);o+=e.labels[0].height,c+=h(e.labels[1],a,o,` class="pele-c4-type" font-size="${y}" fill="var(--_m)"${i.text}`),o+=e.labels[1].height,c+=h(e.labels[2],a,o,` class="pele-c4-descr" font-size="${y}" fill="var(--_m)"${i.text}`),H+=`<g class="pele-cluster pele-c4-${t.nodeType?`node`:`boundary`}" data-id="${r(t.alias)}"><rect x="${s(e.x)}" y="${s(e.y)}" width="${s(e.w)}" height="${s(e.h)}" fill="none" stroke="var(--_b)"${t.nodeType?``:` stroke-dasharray="6 4"`}${n(i.shape)}/>`+Re(c,t.link,t.alias,C,p)+`</g>`}for(let t of e.nodes){let e=t.shape,n=e.kind.startsWith(`external`),a=Le(e.bgColor,e.borderColor,e.fontColor),o=` stroke="var(--_b)"`+(n?` stroke-dasharray="4 3"`:``),{w:c,h:l,form:u,labels:d}=t,m=u===`h-cyl`?-oe(l)/2:0,h=u===`person`?ie/2:u===`cyl`?ae(c)/2:0,g=` fill="var(--_m)"${a.text}`,_=h-t.textH/2,v=i(d[0],m,_+d[0].height/2,` class="pele-c4-type" font-size="${y-1}"${g}`);_+=d[0].height,v+=i(d[1],m,_+d[1].height/2,` class="pele-label" font-weight="var(--_hw)"${a.text}`),_+=d[1].height,v+=i(d[2],m,_+d[2].height/2,` class="pele-c4-techn" font-size="${y}"${g}`),_+=d[2].height+4,v+=i(d[3],m,_+d[3].height/2,` class="pele-c4-descr" font-size="${y}"${a.text}`),U+=`<g class="pele-node pele-shape-${u} pele-c4-${e.kind}${n?` pele-c4-external`:``}" data-id="${r(e.alias)}" transform="translate(${s(t.x+c/2)},${s(t.y+l/2)})">`+Re(f(u,c,l,` fill="var(${n?`--_bg`:`--_s`})"${o}${a.shape}`,o+a.line)+v,e.link,e.alias,C,p)+`</g>`}}let W=o(a.title,!1,x,v,m?l(p):4e3,1),G=W.height>0?W.height+12:0,K=Math.max(k-D,W.width),q=Math.ceil(K+2*S),J=Math.ceil(A-O+G+2*S),Y=S-D+(K-(k-D))/2,ce=S+G-O;return[{svg:e(`c4`,q,J,v,p,a,i(W,q/2,S+W.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${s(Y)},${s(ce)})">`+(H?`<g class="pele-clusters">${H}</g>`:``)+(L?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${L}</g>`:``)+(U?`<g class="pele-nodes">${U}</g>`:``)+(V?`<g class="pele-edge-labels" font-size="${y}">${V}</g>`:``)+`</g>`),width:q,height:J,links:C},R.squeezed]}var Ve={type:`c4`,parse(e,t,n){let r=new D;return n&&(r.title=n),R(e,r),r},render:ze};export{Ve as c4};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,L as t,M as n,O as r,P as i,Q as a,R as o,T as s,V as c,at as l,d as u,et as d,f,i as p,it as m,lt as h,mt as g,q as _,rt as v,tt as y,u as b,ut as x,v as S,z as C}from"./CxEu-Di8.js";import"./xihTtKlq.js";import{t as w}from"./CccIbhmH.js";import{i as T}from"./CM4EA3Wo.js";var E=e=>e.kind===`passage`?`passage:${e.id}:${e.text}`:`${e.kind}:${e.id}`,D=new class{#e=m([]);get parts(){return c(this.#e)}set parts(e){v(this.#e,e)}#t=m(``);get fresh(){return c(this.#t)}set fresh(e){v(this.#t,e,!0)}#n=m(null);get carrying(){return c(this.#n)}set carrying(e){v(this.#n,e)}has(e,t){return this.parts.some(n=>n.kind===e&&n.id===t)}add(e){return!this.parts.some(t=>E(t)===E(e))&&(this.parts=[...this.parts,e],this.fresh=E(e),T.focus!==`iso`&&T.unseen++,!0)}remove(e){this.parts=this.parts.filter(t=>E(t)!==E(e))}toggle(e){return this.parts.some(t=>E(t)===E(e))?(this.remove(e),!1):(this.add(e),!0)}clear(){this.parts=[]}get sent(){return this.parts}keyOf=E},O=i(`<li role="option"><button type="button" tabindex="-1" class="svelte-35e6rs"><span class="dir svelte-35e6rs"> </span><span class="detail svelte-35e6rs"> </span></button></li>`),k=i(`<ul class="suggest svelte-35e6rs" role="listbox" aria-label="folders"></ul>`),A=i(`<span class="field-wrap svelte-35e6rs"><input autocomplete="off" spellcheck="false" role="combobox" aria-autocomplete="list"/> <!></span>`);function j(t,i){x(i,!0);let T=p(i,`value`,15,``),E=p(i,`placeholder`,3,``),D=p(i,`id`,3,`folder`),j=p(i,`quiet`,3,!1),M=m(!1),N=m(0),P=l(()=>T().trim().replace(/^\/+|\/+$/g,``).toLowerCase()),F=e=>w.listing.notes.filter(t=>t.dir===e).length,I=l(()=>{let e=w.listing.dirs.filter(e=>e.toLowerCase().includes(c(P))),t=e=>e.split(`/`).at(-1).toLowerCase().startsWith(c(P))?0:e.toLowerCase().startsWith(c(P))?1:2,n=e.sort((e,n)=>t(e)-t(n)||e.localeCompare(n)).map(e=>({dir:e,made:!1}));return c(P)&&!w.listing.dirs.some(e=>e.toLowerCase()===c(P))&&n.push({dir:T().trim().replace(/^\/+|\/+$/g,``),made:!0}),n.slice(0,8)});function L(e){T(e),v(M,!1),i.onpick?.(e)}function R(e){if(c(M)&&c(I).length){if(e.key===`ArrowDown`){v(N,(c(N)+1)%c(I).length),e.preventDefault();return}if(e.key===`ArrowUp`){v(N,(c(N)-1+c(I).length)%c(I).length),e.preventDefault();return}if((e.key===`Enter`||e.key===`Tab`)&&c(I)[c(N)]&&(e.key===`Enter`||c(P))){e.key===`Enter`&&e.preventDefault(),L(c(I)[c(N)].dir);return}if(e.key===`Escape`){v(M,!1),e.stopPropagation();return}}i.onkeydown?.(e)}var z=A(),B=a(z);u(B);let V;var H=y(B,2),U=t=>{var r=k();s(r,23,()=>c(I),e=>e.dir+e.made,(t,r,i)=>{var s=O();let l;var u=a(s),p=a(u),m=d(p,!0),h=y(p),b=d(h,!0);g(u),g(s),_(t=>{f(s,`id`,`${D()??``}-opt-${c(i)??``}`),f(s,`aria-selected`,c(i)===c(N)),l=S(s,1,`svelte-35e6rs`,null,l,{at:c(i)===c(N)}),e(m,c(r).dir),e(b,t)},[()=>c(r).made?`new folder`:`${F(c(r).dir)} ${F(c(r).dir)===1?`note`:`notes`}`]),o(`mousedown`,u,e=>e.preventDefault()),o(`click`,u,()=>L(c(r).dir)),C(`mouseenter`,u,()=>v(N,c(i),!0)),n(t,s)}),g(r),_(()=>f(r,`id`,`${D()??``}-list`)),n(t,r)};r(H,e=>{c(M)&&c(I).length&&e(U)}),g(z),_(()=>{f(B,`id`,D()),V=S(B,1,`mono svelte-35e6rs`,null,V,{field:!j(),quiet:j()}),f(B,`placeholder`,E()),f(B,`aria-label`,i.label),f(B,`aria-expanded`,c(M)&&c(I).length>0),f(B,`aria-controls`,`${D()??``}-list`),f(B,`aria-activedescendant`,c(M)&&c(I)[c(N)]?`${D()}-opt-${c(N)}`:void 0)}),C(`focus`,B,()=>{v(M,!0),v(N,0)}),o(`input`,B,()=>{v(M,!0),v(N,0)}),C(`blur`,B,()=>setTimeout(()=>v(M,!1),120)),o(`keydown`,B,R),b(B,T),n(t,z),h()}t([`input`,`keydown`,`mousedown`,`click`]);export{D as n,j as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as e,it as t,nt as n,rt as r}from"./CxEu-Di8.js";import{s as i,t as a}from"./Ddw9FbDu.js";import{i as o,l as s}from"./CccIbhmH.js";var c=(e,t)=>{try{return localStorage.getItem(e)??t}catch{return t}},l=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},u=(e,t)=>{try{return{...t,...JSON.parse(c(e,`{}`))}}catch{return t}},d=[`note`,`atlas`,`iso`],f=[`cols`,`stack`,`one`],p={note:[`provenance`,`timeline`],atlas:[`questions`,`problems`,`web`,`code`,`pictures`,`context`],iso:[`notes`,`files`,`run`]},m={provenance:!1,timeline:!1,questions:!0,problems:!0,web:!1,code:!1,pictures:!1,context:!1,notes:!0,files:!1,run:!1},h={note:1.25,atlas:1,iso:1.05},g={min:.4,max:3},_=new class{#e=t(n(f.includes(c(`isorite.layout`,``))?c(`isorite.layout`,``):`cols`));get layout(){return e(this.#e)}set layout(e){r(this.#e,e,!0)}#t=t(n(u(`isorite.show`,{note:!0,atlas:!0,iso:!0})));get show(){return e(this.#t)}set show(e){r(this.#t,e,!0)}#n=t(n(u(`isorite.widths`,h)));get widths(){return e(this.#n)}set widths(e){r(this.#n,e,!0)}#r=t(n(u(`isorite.switches`,m)));get on(){return e(this.#r)}set on(e){r(this.#r,e,!0)}#i=t(`note`);get focus(){return e(this.#i)}set focus(e){r(this.#i,e,!0)}#a=t(!1);get narrow(){return e(this.#a)}set narrow(e){r(this.#a,e,!0)}#o=t(0);get unseen(){return e(this.#o)}set unseen(e){r(this.#o,e,!0)}#s=t(!1);get tree(){return e(this.#s)}set tree(e){r(this.#s,e,!0)}#c=t(``);get fresh(){return e(this.#c)}set fresh(e){r(this.#c,e,!0)}#l=t(null);get settings(){return e(this.#l)}set settings(e){r(this.#l,e,!0)}#u=t(n(c(s(`isorite.last`),``)));get last(){return e(this.#u)}set last(e){r(this.#u,e,!0)}get standing(){if(this.narrow)return[...d];let e=d.filter(e=>this.show[e]);return this.layout===`one`?[e.includes(this.focus)?this.focus:e[0]??`note`]:e}setLayout(e){this.layout=e,l(`isorite.layout`,e)}nextLayout(){this.setLayout(f[(f.indexOf(this.layout)+1)%f.length])}toggle(e){this.show[e]&&d.filter(e=>this.show[e]).length===1||(this.show[e]=!this.show[e],l(`isorite.show`,JSON.stringify(this.show)),!this.show[e]&&this.focus===e&&(this.focus=d.find(e=>this.show[e])))}setWidth(e,t){this.widths[e]=Math.min(g.max,Math.max(g.min,t)),l(`isorite.widths`,JSON.stringify(this.widths))}to(e){!this.narrow&&!this.show[e]&&this.toggle(e),this.focus=e,e===`iso`&&(this.unseen=0),this.scroll?.(e)}scroll=null;step(e){let t=this.narrow?[...d]:d.filter(e=>this.show[e]),n=t.indexOf(this.focus);this.to(t[(n+e+t.length)%t.length])}flip(e,t=!this.on[e]){this.on[e]=t,l(`isorite.switches`,JSON.stringify(this.on)),e===`notes`&&this.notesFlipped?.(t)}notesFlipped=null;busy(e){let t=typeof document>`u`?null:document.activeElement;return!!t&&!!t.closest(`[data-pane="${e}"]`)&&(t.matches(`input, textarea, [contenteditable=true]`)||!!t.closest(`.cm-editor`))}#d=t(!1);get attached(){return e(this.#d)}set attached(e){r(this.#d,e,!0)}setAttached(e){this.attached=e}setLast(e){e&&!e.startsWith(`@`)&&(this.last=e,l(s(`isorite.last`),e))}async open(e,t=this.narrow){await a(o(e)),t&&this.to(`note`)}async home(){await a(i(`/notes`))}};export{_ as i,d as n,p as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as e,M as t,bt as n,o as r,r as i}from"./BxTFtVqu.js";import{c as a}from"./CQhfj5-f.js";import{n as o,r as s}from"./Cq5C893B.js";import{javascriptLanguage as c}from"./K_3X9lyC.js";var l=1,u=33,d=34,f=35,p=36,m=new o(e=>{let t=e.pos;for(;;){if(e.next==10){e.advance();break}if(e.next==123&&e.peek(1)==123||e.next<0)break;e.advance()}e.pos>t&&e.acceptToken(l)});function h(e,t,n){return new o(r=>{let i=r.pos;for(;r.next!=e&&r.next>=0&&(n||r.next!=38&&(r.next!=123||r.peek(1)!=123));)r.advance();r.pos>i&&r.acceptToken(t)})}var g=h(39,u,!1),_=h(34,d,!1),v=h(39,f,!0),y=h(34,p,!0),b=s.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<<GrOOQO<<Gr<<GrOOQO1G/[1G/[OOOS-E6x-E6xOOQO1G.}1G.}OOOQ-E6y-E6yOOQOAN=^AN=^",stateData:"&d~OvOS~OPROSQOVROWRO~OZTO[XO^VOaUOhWO~OR]OU^O~O[`O^aO~O[bO~O[cO~O[dO~ObeO~ObfO~ObgO~ORhO~O]kOwiO~O[lO~O_mO~OynOzoO~OysOztO~O[uO~O]wOwiO~O_yOwiO~OtzO~Os|O~OSQOV!OOW!OOr!OOy!QO~OSQOV!ROW!ROq!ROz!QO~O_!TOwiO~O]!UO~Oy!VO~Oz!VO~OSQOV!OOW!OOr!OOy!XO~OSQOV!ROW!ROq!ROz!XO~O]!ZO~O",goto:"#dyPPPPPzPPPP!WPPPPP!WPP!Z!^!a!d!dP!g!j!m!p!v#Q#WPPPPPPPP#^SROSS!Os!PT!Rt!SRYPRqeR{nR}oRZPRqfR[PRqgQSOR_SQj`SvjxRxlQ!PsR!W!PQ!StR!Y!SQpeRrf",nodeNames:`⚠ Text Content }} {{ Interpolation InterpolationContent Entity InvalidEntity Attribute BoundAttributeName [ Identifier ] ( ) ReferenceName # Is ExpressionAttributeValue AttributeInterpolation AttributeInterpolation EventName DirectiveName * StatementAttributeValue AttributeName AttributeValue`,maxTerm:42,nodeProps:[[`openedBy`,3,`{{`,15,`(`],[`closedBy`,4,`}}`,14,`)`],[`isolate`,-4,5,19,25,27,``]],skippedNodes:[0],repeatNodeCount:4,tokenData:"0r~RyOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mqr#rrs%jst&Qtv#rvw&hwx)zxy*byz*xz{+`{}#r}!O+v!O!P-]!P!Q#r!Q![+v![!]+v!]!_#r!_!`-s!`!c#r!c!}+v!}#O.Z#O#P#r#P#Q.q#Q#R#r#R#S+v#S#T#r#T#o+v#o#p/X#p#q#r#q#r0Z#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vQ#wTUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rQ$ZSO#q#r#r;'S#r;'S;=`$g<%lO#rQ$jP;=`<%l#rR$t[UQvPOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mq#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR%qTyPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&XTaPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&oXUQWPOp'[pq#rq!]'[!]!^#r!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R'aXUQOp'[pq#rq!]'[!]!^'|!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R(TTVPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR(gXOp'[pq#rq!]'[!]!^'|!^#q'[#q#r)S#r;'S'[;'S;=`)t<%lO'[P)VUOp)Sq!])S!]!^)i!^;'S)S;'S;=`)n<%lO)SP)nOVPP)qP;=`<%l)SR)wP;=`<%l'[R*RTzPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR*iT^PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+PT_PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+gThPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+}b[PUQO}#r}!O+v!O!Q#r!Q![+v![!]+v!]!c#r!c!}+v!}#R#r#R#S+v#S#T#r#T#o+v#o#q#r#q#r$W#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vR-YP;=`<%l+vR-dTwPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR-zTUQbPO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.bTZPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.xT]PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/^VUQO#o#r#o#p/s#p#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/zTSPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#r~0^TO#q#r#q#r0m#r;'S#r;'S;=`$g<%lO#r~0rOR~",tokenizers:[m,g,_,v,y,0,1],topRules:{Content:[0,2],Attribute:[1,9]},tokenPrec:0}),x=c.parser.configure({top:`SingleExpression`}),S=b.configure({props:[e({Text:t.content,Is:t.definitionOperator,AttributeName:t.attributeName,"AttributeValue ExpressionAttributeValue StatementAttributeValue":t.attributeValue,Entity:t.character,InvalidEntity:t.invalid,"BoundAttributeName/Identifier":t.attributeName,"EventName/Identifier":t.special(t.attributeName),"ReferenceName/Identifier":t.variableName,"DirectiveName/Identifier":t.keyword,"{{ }}":t.brace,"( )":t.paren,"[ ]":t.bracket,"# '*'":t.punctuation})]}),C={parser:x},w={parser:c.parser},T=S.configure({wrap:n((e,t)=>e.name==`InterpolationContent`?C:null)}),E=S.configure({wrap:n((e,t)=>e.name==`InterpolationContent`?C:e.name==`AttributeInterpolation`?e.node.parent?.name==`StatementAttributeValue`?w:C:null),top:`Attribute`}),D={parser:T},O={parser:E},k=a({selfClosingTags:!0});function A(e){return e.configure({wrap:n(M)},`angular`)}var j=A(k.language);function M(e,t){switch(e.name){case`Attribute`:return/^[*#(\[]|\{\{/.test(t.read(e.from,e.to))?O:null;case`Text`:return D}return null}function N(e={}){let t=k;if(e.base){if(e.base.language.name!=`html`||!(e.base.language instanceof i))throw RangeError(`The base option must be the result of calling html(...)`);t=e.base}return new r(t.language==k.language?j:A(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/})])}export{N as angular};
|