dimcode 0.0.6-beta.2 → 0.0.6-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/assets/gui/200.html +12 -0
- package/assets/gui/404.html +12 -0
- package/assets/gui/_nuxt/0OuYuFdd.js +1 -0
- package/assets/gui/_nuxt/1fcVKlQD.js +1 -0
- package/assets/gui/_nuxt/4latAK5N.js +68 -0
- package/assets/gui/_nuxt/5J0xJHOV.js +321 -0
- package/assets/gui/_nuxt/5tCQ9P9x.js +1 -0
- package/assets/gui/_nuxt/B-QRPBiU.js +220 -0
- package/assets/gui/_nuxt/B-ocCvqj.js +4 -0
- package/assets/gui/_nuxt/B41oyhUX.js +139 -0
- package/assets/gui/_nuxt/BAsEomiL.js +61 -0
- package/assets/gui/_nuxt/BB51-bYG.js +1 -0
- package/assets/gui/_nuxt/BCdCHJrs.js +22 -0
- package/assets/gui/_nuxt/BHBA7_9A.js +24 -0
- package/assets/gui/_nuxt/BHmwI27Q.js +7 -0
- package/assets/gui/_nuxt/BIK3UA9H.js +1 -0
- package/assets/gui/_nuxt/BJgShMaj.js +122 -0
- package/assets/gui/_nuxt/BMPUUilT.js +60 -0
- package/assets/gui/_nuxt/Be9sogz8.js +1 -0
- package/assets/gui/_nuxt/BojRNRsE.js +1 -0
- package/assets/gui/_nuxt/BtytU9Nc.js +65 -0
- package/assets/gui/_nuxt/C2r5gH2d.js +1 -0
- package/assets/gui/_nuxt/C5QU6AII.js +267 -0
- package/assets/gui/_nuxt/CM2Ru5jE.js +128 -0
- package/assets/gui/_nuxt/CR-veSvi.js +1 -0
- package/assets/gui/_nuxt/CRt9G2a3.js +1 -0
- package/assets/gui/_nuxt/CW5-BTm0.js +1 -0
- package/assets/gui/_nuxt/CYh22N6Z.js +15 -0
- package/assets/gui/_nuxt/C_nwuZOL.js +17 -0
- package/assets/gui/_nuxt/CctfDgzL.js +1 -0
- package/assets/gui/_nuxt/CgCvTYUb.js +1 -0
- package/assets/gui/_nuxt/CjaZXJmO.js +1 -0
- package/assets/gui/_nuxt/CvBv_9Ii.js +43 -0
- package/assets/gui/_nuxt/Cx8lgPkP.js +162 -0
- package/assets/gui/_nuxt/CxrwCJPS.js +1 -0
- package/assets/gui/_nuxt/DCBWnvUv.js +1 -0
- package/assets/gui/_nuxt/DDwo0uwT.js +1 -0
- package/assets/gui/_nuxt/DGBBJ9Xx.js +1 -0
- package/assets/gui/_nuxt/DJ0FGiPu.js +1 -0
- package/assets/gui/_nuxt/DLps5vLc.js +1 -0
- package/assets/gui/_nuxt/DNM2C9RQ.js +1 -0
- package/assets/gui/_nuxt/DQcJWYOz.js +10 -0
- package/assets/gui/_nuxt/DYanJOYX.js +1 -0
- package/assets/gui/_nuxt/Dgtmkgv6.js +145 -0
- package/assets/gui/_nuxt/DhXJpUyf.js +261 -0
- package/assets/gui/_nuxt/DhgdKvf3.js +4 -0
- package/assets/gui/_nuxt/DlAUqK2U.js +1 -0
- package/assets/gui/_nuxt/DoSvhc5U.js +1 -0
- package/assets/gui/_nuxt/Dr-RzAtV.js +1 -0
- package/assets/gui/_nuxt/DuPuI2eK.js +10 -0
- package/assets/gui/_nuxt/DvJDa2y1.js +1 -0
- package/assets/gui/_nuxt/FdVDP1dJ.js +350 -0
- package/assets/gui/_nuxt/Fi3JZ7gi.js +1 -0
- package/assets/gui/_nuxt/FmGx3-yC.js +1 -0
- package/assets/gui/_nuxt/Gi6I4Gst.js +1 -0
- package/assets/gui/_nuxt/I4qJV1od.js +89 -0
- package/assets/gui/_nuxt/JhHowHQY.js +64 -0
- package/assets/gui/_nuxt/QrFbBF0x.js +36 -0
- package/assets/gui/_nuxt/VvxifOG2.js +250 -0
- package/assets/gui/_nuxt/WbTodJZi.js +2 -0
- package/assets/gui/_nuxt/XbL3y5x-.js +261 -0
- package/assets/gui/_nuxt/a4I2nS0P.js +165 -0
- package/assets/gui/_nuxt/builds/latest.json +1 -0
- package/assets/gui/_nuxt/builds/meta/61e794b6-fdf7-4843-93ff-0e0358069cb4.json +1 -0
- package/assets/gui/_nuxt/eM4IBQGT.js +1 -0
- package/assets/gui/_nuxt/entry.DKEE1mdx.css +1 -0
- package/assets/gui/_nuxt/error-404.BAwq3L4-.css +1 -0
- package/assets/gui/_nuxt/error-500.DFXMopWe.css +1 -0
- package/assets/gui/_nuxt/fGWXVeDl.js +7 -0
- package/assets/gui/_nuxt/gw8YJBUN.js +1 -0
- package/assets/gui/_nuxt/index.CeD9Flb2.css +1 -0
- package/assets/gui/_nuxt/m1p94B0o.js +24 -0
- package/assets/gui/_nuxt/moIhOSp_.js +30 -0
- package/assets/gui/_nuxt/waGmH_zw.js +1 -0
- package/assets/gui/_nuxt/yG4UzpsV.js +1 -0
- package/assets/gui/_nuxt/zPZrJS7V.js +1 -0
- package/assets/gui/favicon.ico +0 -0
- package/assets/gui/index.html +12 -0
- package/assets/gui/robots.txt +2 -0
- package/dist/cli.mjs +1278 -970
- package/dist/models/aihubmix.json +19601 -0
- package/dist/models/openrouter.json +7848 -0
- package/dist/models/siliconflow-com.json +2130 -0
- package/dist/models/siliconflow.json +3560 -0
- package/dist/models/zenmux.json +2337 -0
- package/package.json +13 -7
- package/scripts/postinstall.mjs +3 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{e as rt,d as ut,A as st,q as M,G as Ee,c as Et,w as W,f as Nt,C as ct,g as F,m as ke,D as g,E as Ke,j as H,r as Ne,l as u,F as Ye,H as ze,I as zt,p as U,k as Qe,v as et,z as oe,J as B,K as tt,Y as Tt,L as nt,M as $t,N as Ht,o as Dt,O as Lt,P as jt,Q as Yt,R as ye,Z as Vt}from"./FdVDP1dJ.js";import{e as ae}from"./DvJDa2y1.js";var Wt=Object.defineProperty,It=Object.defineProperties,qt=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,lt=(p,m,k)=>m in p?Wt(p,m,{enumerable:!0,configurable:!0,writable:!0,value:k}):p[m]=k,Te=(p,m)=>{for(var k in m||(m={}))Rt.call(m,k)&<(p,k,m[k]);if(ot)for(var k of ot(m))At.call(m,k)&<(p,k,m[k]);return p},it=(p,m)=>It(p,qt(m)),Y=(p,m,k)=>new Promise((l,I)=>{var N=d=>{try{f(k.next(d))}catch(X){I(X)}},b=d=>{try{f(k.throw(d))}catch(X){I(X)}},f=d=>d.done?l(d.value):Promise.resolve(d.value).then(N,b);f((k=k.apply(p,m)).next())});const Xt={class:"markstream-vue"},Gt={class:"html-preview-frame__header"},Jt={class:"html-preview-frame__title"},Ut={class:"html-preview-frame__label"},Zt=["srcdoc"],Kt=rt(ut({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},onClose:{type:Function},title:{}},setup(p){const m=p,{t:k}=st(),l=B(()=>{const N=m.code||"",b=N.trim().toLowerCase();return b.startsWith("<!doctype")||b.startsWith("<html")||b.startsWith("<body")?N:`<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<style>
|
|
7
|
+
html, body {
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
height: 100%;
|
|
11
|
+
background-color: ${m.isDark?"#020617":"#ffffff"};
|
|
12
|
+
color: ${m.isDark?"#e5e7eb":"#020617"};
|
|
13
|
+
}
|
|
14
|
+
body {
|
|
15
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
${N}
|
|
21
|
+
</body>
|
|
22
|
+
</html>`});function I(N){var b;N.key!=="Escape"&&N.key!=="Esc"||(b=m.onClose)==null||b.call(m)}return Dt(()=>{typeof window<"u"&&window.addEventListener("keydown",I)}),ct(()=>{typeof window<"u"&&window.removeEventListener("keydown",I)}),(N,b)=>(F(),ke(jt,{to:"body"},[u("div",Xt,[u("div",{class:oe(["html-preview-frame__backdrop",{"html-preview-frame__backdrop--dark":m.isDark}]),onClick:b[2]||(b[2]=f=>{var d;return(d=m.onClose)==null?void 0:d.call(m)})},[u("div",{class:oe(["html-preview-frame",{"html-preview-frame--dark":m.isDark}]),onClick:b[1]||(b[1]=Lt(()=>{},["stop"]))},[u("div",Gt,[u("div",Jt,[b[3]||(b[3]=u("span",{class:"html-preview-frame__dot"},null,-1)),u("span",Ut,Ye(m.title||g(k)("common.preview")||"Preview"),1)]),u("button",{type:"button",class:oe(["html-preview-frame__close",{"html-preview-frame__close--dark":m.isDark}]),onClick:b[0]||(b[0]=f=>{var d;return(d=m.onClose)==null?void 0:d.call(m)})}," × ",2)]),u("iframe",{class:"html-preview-frame__iframe",sandbox:"allow-scripts allow-same-origin",srcdoc:l.value},null,8,Zt)],2)],2)])]))}}),[["__scopeId","data-v-296dd89d"]]);let te=null,$e=null,re=null,ne=null,He=null,De=null;const Le=new WeakMap;let Qt=0;const en={key:0,class:"code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",style:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))","background-color":"var(--vscode-editor-background, var(--markstream-code-fallback-bg))"}},tn={class:"flex items-center gap-x-2 flex-1 overflow-hidden"},nn=["innerHTML"],on={class:"text-sm font-medium font-mono truncate"},ln={class:"flex items-center gap-x-2"},an=["aria-pressed"],rn=["disabled"],un=["disabled"],sn=["disabled"],cn=["aria-label"],dn={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},vn={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},mn=["aria-pressed"],fn={key:0,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},pn={key:1,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},hn=["aria-label"],wn={class:"code-editor-layer"},gn={class:"code-loading-placeholder"},yn={class:"sr-only","aria-live":"polite",role:"status"},at="__markstreamMonacoPassiveTouch__",je=rt(ut({__name:"CodeBlockNode",props:{node:{},isDark:{type:Boolean},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:void 0},lightTheme:{default:void 0},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},customId:{}},emits:["previewCode","copy"],setup(p,{emit:m}){var k;const l=p,I=m;typeof window<"u"&&(function(){var t;try{const e=window;if(e[at])return;const n=(t=window.Element)==null?void 0:t.prototype,o=n?.addEventListener;if(!n||!o)return;n.addEventListener=function(i,a,c){return i==="touchstart"&&(function(r,y){if(!r)return!1;const s=r;return!(typeof s.closest!="function"||!s.closest(".monaco-editor, .monaco-diff-editor")||y&&typeof y=="object"&&"passive"in y)})(this,c)?o.call(this,i,a,(function(r){return r==null?{passive:!0}:typeof r=="boolean"?{capture:r,passive:!0}:typeof r=="object"?"passive"in r?r:it(Te({},r),{passive:!0}):{passive:!0}})(c)):o.call(this,i,a,c)},e[at]=!0}catch{}})();const N=Ht(),b=B(()=>{const t=N?.vnode.props;return!(!t||!t.onPreviewCode&&!t.onPreviewCode)}),{t:f}=st(),d=M(null),X=M(null),Z=M(!1),D=M(Ee(l.node.language)),le=B(()=>Vt(D.value)),S=M(!1),O=M(!1),ue=M(!1),K=M(!1),se=M(!1),G=M(null);let be=0;const dt=Et(),ie=M(null),q=M(typeof window>"u");typeof window<"u"&&W(()=>X.value,t=>{var e;if((e=ie.value)==null||e.destroy(),ie.value=null,!t)return void(q.value=!1);const n=dt(t,{rootMargin:"400px"});ie.value=n,q.value=n.isVisible.value,n.whenVisible.then(()=>{q.value=!0})},{immediate:!0}),Nt(()=>{var t;(t=ie.value)==null||t.destroy(),ie.value=null});let L=null,ce=null,xe=()=>{},Me=()=>{},de=()=>null,j=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),$=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),Ce=()=>{},ve=()=>{},Q=null,Ve=()=>{var t;return String((t=l.node.language)!=null?t:"plaintext")},Be=()=>Y(null,null,function*(){});const P=B(()=>l.node.diff),We=B(()=>P.value?"diff":"single"),vt=M(We.value),me=M(!1),mt=B(()=>{var t;const e=(t=l.monacoOptions)==null?void 0:t.wordWrap;return e==null||String(e)!=="off"}),Ie=B(()=>typeof window<"u"&&!me.value&&!K.value),fe=M(!1);typeof window<"u"&&Y(null,null,function*(){try{const t=yield Yt();if(!t)return void(me.value=!0);const e=t.useMonaco,n=t.detectLanguage;if(typeof n=="function"&&(Ve=n),typeof e=="function"){const o=Je();if(o&&l.themes&&Array.isArray(l.themes)&&!l.themes.includes(o))throw new Error("Preferred theme not in provided themes array");const i=e(it(Te({wordWrap:"on",wrappingIndent:"same",themes:l.themes,theme:o},l.monacoOptions||{}),{onThemeChange(){Fe()}}));L=i.createEditor||L,ce=i.createDiffEditor||ce,xe=i.updateCode||xe,Me=i.updateDiff||Me,de=i.getEditor||de,j=i.getEditorView||j,$=i.getDiffEditorView||$,Ce=i.cleanupEditor||Ce,ve=i.safeClean||i.cleanupEditor||ve,Be=i.setTheme||Be,se.value=!0,d.value&&(yield he(d.value))}}catch{me.value=!0}});const z=M(typeof((k=l.monacoOptions)==null?void 0:k.fontSize)=="number"?l.monacoOptions.fontSize:Number.NaN),h=M(z.value),ft=B(()=>{const t=z.value,e=h.value;return typeof t=="number"&&Number.isFinite(t)&&t>0&&typeof e=="number"&&Number.isFinite(e)&&e>0}),qe=B(()=>{var t;const e=(t=l.monacoOptions)==null?void 0:t.fontSize;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;const n=h.value;return typeof n=="number"&&Number.isFinite(n)&&n>0?n:12}),pt=B(()=>{var t;const e=(t=l.monacoOptions)==null?void 0:t.lineHeight;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:Math.round(1.5*qe.value)}),ht=B(()=>{var t;const e=(t=l.monacoOptions)==null?void 0:t.tabSize;return typeof e=="number"&&Number.isFinite(e)&&e>0?e:4}),wt=B(()=>{var t;const e=(t=l.monacoOptions)==null?void 0:t.fontFamily;return Te({fontSize:`${qe.value}px`,lineHeight:`${pt.value}px`,tabSize:ht.value},typeof e=="string"&&e.trim()?{"--markstream-code-font-family":e.trim()}:{})});function Re(){var t,e,n,o,i;try{const a=P.value?(n=(e=(t=$())==null?void 0:t.getModifiedEditor)==null?void 0:e.call(t))!=null?n:$():j(),c=de(),r=(o=c?.EditorOption)==null?void 0:o.fontInfo;if(a&&r!=null){const y=(i=a.getOption)==null?void 0:i.call(a,r),s=y?.fontSize;if(typeof s=="number"&&Number.isFinite(s)&&s>0)return s}}catch{}try{const a=d.value;if(a){const c=a.querySelector(".view-lines .view-line");if(c)try{if(typeof window<"u"&&typeof window.getComputedStyle=="function"){const r=window.getComputedStyle(c).fontSize,y=r&&r.match(/^(\d+(?:\.\d+)?)/);if(y)return Number.parseFloat(y[1])}}catch{}}}catch{}return null}function Se(t){var e,n;try{const a=de(),c=(e=a?.EditorOption)==null?void 0:e.lineHeight;if(c!=null){const r=(n=t?.getOption)==null?void 0:n.call(t,c);if(typeof r=="number"&&r>0)return r}}catch{}const o=(function(){try{const a=d.value;if(!a)return null;const c=a.querySelector(".view-lines .view-line");if(c){const r=Math.ceil(c.getBoundingClientRect().height);if(r>0)return r}}catch{}return null})();if(o&&o>0)return o;const i=Number.isFinite(h.value)&&h.value>0?h.value:12;return Math.max(12,Math.round(1.35*i))}function Oe(){var t;if(Number.isFinite(h.value)&&h.value>0&&Number.isFinite(z.value))return h.value;const e=Re();return typeof((t=l.monacoOptions)==null?void 0:t.fontSize)=="number"?(z.value=l.monacoOptions.fontSize,h.value=l.monacoOptions.fontSize,h.value):e&&e>0?(z.value=e,h.value=e,e):(z.value=12,h.value=12,12)}function Ae(){var t,e,n,o,i,a,c,r,y,s,v,V,R,x;try{const w=P.value?$():j();if(!w)return null;if(P.value&&w?.getOriginalEditor&&w?.getModifiedEditor){const C=(t=w.getOriginalEditor)==null?void 0:t.call(w),E=(e=w.getModifiedEditor)==null?void 0:e.call(w);(n=C?.layout)==null||n.call(C),(o=E?.layout)==null||o.call(E);const ge=((i=C?.getContentHeight)==null?void 0:i.call(C))||0,Ue=((a=E?.getContentHeight)==null?void 0:a.call(E))||0,Ze=Math.max(ge,Ue);if(Ze>0)return Math.ceil(Ze+1);const Ot=((y=(r=(c=C?.getModel)==null?void 0:c.call(C))==null?void 0:r.getLineCount)==null?void 0:y.call(r))||1,Ft=((V=(v=(s=E?.getModel)==null?void 0:s.call(E))==null?void 0:v.getLineCount)==null?void 0:V.call(v))||1,_t=Math.max(Ot,Ft),Pt=Math.max(Se(C),Se(E));return Math.ceil(_t*(Pt+1.5)+0+1)}if(w?.getContentHeight){(R=w?.layout)==null||R.call(w);const C=w.getContentHeight();if(C>0)return Math.ceil(C+1)}const A=(x=w?.getModel)==null?void 0:x.call(w);let we=1;A&&typeof A.getLineCount=="function"&&(we=A.getLineCount());const Pe=Se(w);return Math.ceil(we*(Pe+1.5)+0+1)}catch{return null}}function Fe(){var t,e,n,o,i,a,c,r;const y=d.value,s=X.value;if(!y||!s)return;const v=y.querySelector(".monaco-editor")||y,V=v.querySelector(".monaco-editor-background")||v,R=v.querySelector(".view-lines")||v;let x=null,w=null,A=null;try{typeof window<"u"&&typeof window.getComputedStyle=="function"&&(x=window.getComputedStyle(v),w=V===v?x:window.getComputedStyle(V),A=R===v?x:window.getComputedStyle(R))}catch{x=null,w=null,A=null}const we=String((t=x?.getPropertyValue("--vscode-editor-foreground"))!=null?t:"").trim(),Pe=String((e=x?.getPropertyValue("--vscode-editor-background"))!=null?e:"").trim(),C=String((o=(n=x?.getPropertyValue("--vscode-editor-selectionBackground"))!=null?n:x?.getPropertyValue("--vscode-editor-hoverHighlightBackground"))!=null?o:"").trim(),E=we||String((a=(i=A?.color)!=null?i:x?.color)!=null?a:"").trim(),ge=Pe||String((r=(c=w?.backgroundColor)!=null?c:x?.backgroundColor)!=null?r:"").trim();E&&s.style.setProperty("--vscode-editor-foreground",E),ge&&s.style.setProperty("--vscode-editor-background",ge),C&&s.style.setProperty("--vscode-editor-selectionBackground",C)}function J(){try{const t=d.value;if(!t)return;const e=t.getBoundingClientRect(),n=window.scrollY+e.top,o=Ae();if(o!=null&&o>0){const i=e.height;t.style.height=`${Math.ceil(o)}px`,t.style.maxHeight="none";const a=Math.ceil(o)-i;a!==0&&n<window.scrollY&&window.scrollBy(0,a)}}catch{}}function ee(){var t;try{const e=d.value;if(!e)return;const n=e.getBoundingClientRect(),o=window.scrollY+n.top,i=n.height,a=(function(){var s,v;const V=(v=(s=l.monacoOptions)==null?void 0:s.MAX_HEIGHT)!=null?v:500;if(typeof V=="number")return V;const R=String(V).match(/^(\d+(?:\.\d+)?)/);return R?Number.parseFloat(R[1]):500})();if(be>0&&(be--,G.value!=null)){const s=Math.min(G.value,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const v=Math.ceil(s)-i;return void(v!==0&&o<window.scrollY&&window.scrollBy(0,v))}const c=Ae();if(c!=null&&c>0){const s=Math.min(c,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const v=Math.ceil(s)-i;return void(v!==0&&o<window.scrollY&&window.scrollBy(0,v))}if(G.value!=null){const s=Math.min(G.value,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const v=Math.ceil(s)-i;return void(v!==0&&o<window.scrollY&&window.scrollBy(0,v))}const r=Math.ceil(((t=e.getBoundingClientRect)==null?void 0:t.call(e).height)||0);if(r>0){const s=Math.min(r,a);e.style.height=`${Math.ceil(s)}px`,e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto";const v=Math.ceil(s)-i;return void(v!==0&&o<window.scrollY&&window.scrollBy(0,v))}const y=Number.parseFloat(e.style.height);if(!Number.isNaN(y)&&y>0){const s=Math.ceil(Math.min(y,a));e.style.height=`${s}px`;const v=s-i;v!==0&&o<window.scrollY&&window.scrollBy(0,v)}else{const s=Math.ceil(a);e.style.height=`${s}px`;const v=s-i;v!==0&&o<window.scrollY&&window.scrollBy(0,v)}e.style.maxHeight=`${Math.ceil(a)}px`,e.style.overflow="auto"}catch{}}const _e=B(()=>l.isShowPreview&&(D.value==="html"||D.value==="svg"));W(()=>l.node.language,t=>{D.value=Ee(t)}),W(()=>l.node.code,t=>Y(null,null,function*(){var e,n;if(l.stream!==!1){if(D.value||(D.value=Ee(Ve(t))),L&&!ue.value&&d.value)try{yield he(d.value)}catch{}P.value?Me(String((e=l.node.originalCode)!=null?e:""),String((n=l.node.updatedCode)!=null?n:""),le.value):xe(t,le.value),S.value&&ae(()=>J())}}));const gt=B(()=>{const t=D.value;return t?tt[t]||t.charAt(0).toUpperCase()+t.slice(1):tt[""]}),yt=B(()=>Tt(D.value||"")),kt=B(()=>{const t={},e=i=>{if(i!=null)return typeof i=="number"?`${i}px`:String(i)},n=e(l.minWidth),o=e(l.maxWidth);return n&&(t.minWidth=n),o&&(t.maxWidth=o),t});function bt(){return Y(this,null,function*(){try{typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&(yield navigator.clipboard.writeText(l.node.code)),Z.value=!0,I("copy",l.node.code),setTimeout(()=>{Z.value=!1},1e3)}catch(t){console.error("复制失败:",t)}})}function Xe(t){return!t||t.disabled}function T(t,e,n="top"){if(Xe(t.currentTarget))return;const o=t,i=o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0;nt(t.currentTarget,e,n,!1,i,l.isDark)}function _(){$t()}function Ge(t){if(Xe(t.currentTarget))return;const e=Z.value?f("common.copied")||"Copied":f("common.copy")||"Copy",n=t,o=n?.clientX!=null&&n?.clientY!=null?{x:n.clientX,y:n.clientY}:void 0;nt(t.currentTarget,e,"top",!1,o,l.isDark)}function xt(){S.value=!S.value;const t=P.value?$():j(),e=d.value;t&&e&&(S.value?(pe(!0),e.style.maxHeight="none",e.style.overflow="visible",J()):(pe(!1),e.style.overflow="auto",ee()))}function Mt(){var t,e,n;if(O.value=!O.value,O.value){if(d.value){const o=Math.ceil(((e=(t=d.value).getBoundingClientRect)==null?void 0:e.call(t).height)||0);o>0&&(G.value=o)}pe(!1)}else{S.value&&pe(!0),d.value&&G.value!=null&&(d.value.style.height=`${G.value}px`);const o=P.value?$():j();try{(n=o?.layout)==null||n.call(o)}catch{}be=2,ae(()=>{S.value?J():ee()})}}function Ct(){if(!_e.value)return;const t=D.value;if(b.value){const e=t==="html"?"text/html":"image/svg+xml",n=t==="html"?f("artifacts.htmlPreviewTitle")||"HTML Preview":f("artifacts.svgPreviewTitle")||"SVG Preview";return void I("previewCode",{node:l.node,artifactType:e,artifactTitle:n,id:`temp-${t}-${Date.now()}`})}t==="html"&&(fe.value=!fe.value)}function pe(t){var e,n;try{if(P.value){const o=$();(e=o?.updateOptions)==null||e.call(o,{automaticLayout:t})}else{const o=j();(n=o?.updateOptions)==null||n.call(o,{automaticLayout:t})}}catch{}}function he(t){return L?Q||(ue.value=!0,Q=Y(null,null,function*(){yield(function(n){return Y(this,null,function*(){var o,i,a;if(!L)return;P.value?(ve(),ce?yield ce(n,String((o=l.node.originalCode)!=null?o:""),String((i=l.node.updatedCode)!=null?i:""),le.value):yield L(n,l.node.code,le.value)):yield L(n,l.node.code,le.value);const c=P.value?$():j();if(typeof((a=l.monacoOptions)==null?void 0:a.fontSize)=="number")c?.updateOptions({fontSize:l.monacoOptions.fontSize,automaticLayout:!1}),z.value=l.monacoOptions.fontSize,h.value=l.monacoOptions.fontSize;else{const r=Re();r&&r>0?(z.value=r,h.value=r):(z.value=12,h.value=12)}S.value||O.value||ee(),l.loading===!1&&(yield ye(),ae(()=>{S.value&&!O.value?J():O.value||ee()})),yield ye(),K.value=!0,Fe()})})(t)}).finally(()=>{Q=null}),Q):null}W(()=>h.value,(t,e)=>{const n=P.value?$():j();n&&typeof t=="number"&&Number.isFinite(t)&&t>0&&(n.updateOptions({fontSize:t}),S.value&&!O.value&&J())},{flush:"post",immediate:!1});const Bt=W(()=>[d.value,P.value,l.stream,l.loading,se.value,q.value],t=>Y(null,[t],function*([e,n,o,i,a,c]){if(!e||!L||!c||o===!1&&i!==!1)return;const r=he(e);if(r){try{yield r}catch{K.value=!1}Bt()}}));function Je(){return l.isDark?l.darkTheme:l.lightTheme}W(We,(t,e)=>Y(null,null,function*(){if(t!==e&&(vt.value=t,L&&d.value&&ue.value&&(l.stream!==!1||l.loading===!1)&&q.value))try{K.value=!1,ue.value=!1,Q=null,ve(),yield ye(),yield he(d.value)}catch{K.value=!1}})),W(()=>[l.isDark,l.darkTheme,l.lightTheme,se.value],()=>{se.value&&(function(){const t=Je();t&&(function(e,n){const o=(function(i){if(i==null)return null;if(typeof i=="string")return i;if(typeof i=="object"&&i&&"name"in i)return String(i.name);if(typeof i=="object"){const a=Le.get(i);if(a)return a;try{const r=JSON.stringify(i);if(r)return Le.set(i,r),r}catch{}const c="__theme_"+ ++Qt;return Le.set(i,c),c}return String(i)})(n);return o?(De=e,te||He!==o?te?(ne===o||$e===o||(re=n,ne=o),te):(re=n,ne=o,te=Y(null,null,function*(){for(;ne&&re!=null;){const i=re,a=ne;if(re=null,ne=null,He!==a)try{$e=a,yield(De??e)(i),He=a}catch{}}}).finally(()=>{te=null,$e=null}),te):Promise.resolve()):Promise.resolve()})(Be,t).then(()=>{K.value&&ae(()=>Fe())})})()}),W(()=>[l.monacoOptions,q.value],()=>{var t,e;if(!L||!q.value)return;const n=P.value?$():j(),o=typeof((t=l.monacoOptions)==null?void 0:t.fontSize)=="number"?l.monacoOptions.fontSize:Number.isFinite(h.value)?h.value:void 0;typeof o=="number"&&Number.isFinite(o)&&o>0&&((e=n?.updateOptions)==null||e.call(n,{fontSize:o})),S.value&&!O.value?J():O.value||ee()},{deep:!0});const St=W(()=>[l.loading,q.value],t=>Y(null,[t],function*([e,n]){n&&(e||(yield ye(),ae(()=>{O.value||(S.value?J():ee()),St()})))}),{immediate:!0,flush:"post"});return ct(()=>{Ce()}),(t,e)=>me.value?(F(),ke(g(Ke),{key:0,node:p.node,loading:l.loading},null,8,["node","loading"])):(F(),H("div",{key:1,ref_key:"container",ref:X,style:ze(kt.value),class:oe(["code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",[l.isDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":l.loading,"is-dark":l.isDark}]])},[l.showHeader?(F(),H("div",en,[Ne(t.$slots,"header-left",{},()=>[u("div",tn,[u("span",{class:"icon-slot h-4 w-4 flex-shrink-0",innerHTML:yt.value},null,8,nn),u("span",on,Ye(gt.value),1)])],!0),Ne(t.$slots,"header-right",{},()=>[u("div",ln,[u("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":O.value,onClick:Mt,onMouseenter:e[0]||(e[0]=n=>T(n,O.value?g(f)("common.expand")||"Expand":g(f)("common.collapse")||"Collapse")),onFocus:e[1]||(e[1]=n=>T(n,O.value?g(f)("common.expand")||"Expand":g(f)("common.collapse")||"Collapse")),onMouseleave:_,onBlur:_},[(F(),H("svg",{style:ze({rotate:O.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[...e[17]||(e[17]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,an),l.showFontSizeButtons&&l.enableFontSizeControl?(F(),H(zt,{key:0},[u("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(h.value)&&h.value<=10,onClick:e[2]||(e[2]=n=>(function(){const o=Oe(),i=Math.max(10,o-1);h.value=i})()),onMouseenter:e[3]||(e[3]=n=>T(n,g(f)("common.decrease")||"Decrease")),onFocus:e[4]||(e[4]=n=>T(n,g(f)("common.decrease")||"Decrease")),onMouseleave:_,onBlur:_},[...e[18]||(e[18]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)])],40,rn),u("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!ft.value||h.value===z.value,onClick:e[5]||(e[5]=n=>(Oe(),void(Number.isFinite(z.value)&&(h.value=z.value)))),onMouseenter:e[6]||(e[6]=n=>T(n,g(f)("common.reset")||"Reset")),onFocus:e[7]||(e[7]=n=>T(n,g(f)("common.reset")||"Reset")),onMouseleave:_,onBlur:_},[...e[19]||(e[19]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[u("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[u("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),u("path",{d:"M3 3v5h5"})])],-1)])],40,un),u("button",{type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",disabled:!!Number.isFinite(h.value)&&h.value>=36,onClick:e[8]||(e[8]=n=>(function(){const o=Oe(),i=Math.min(36,o+1);h.value=i})()),onMouseenter:e[9]||(e[9]=n=>T(n,g(f)("common.increase")||"Increase")),onFocus:e[10]||(e[10]=n=>T(n,g(f)("common.increase")||"Increase")),onMouseleave:_,onBlur:_},[...e[20]||(e[20]=[u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"w-3 h-3"},[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)])],40,sn)],64)):U("",!0),l.showCopyButton?(F(),H("button",{key:1,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":Z.value?g(f)("common.copied")||"Copied":g(f)("common.copy")||"Copy",onClick:bt,onMouseenter:e[11]||(e[11]=n=>Ge(n)),onFocus:e[12]||(e[12]=n=>Ge(n)),onMouseleave:_,onBlur:_},[Z.value?(F(),H("svg",vn,[...e[22]||(e[22]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(F(),H("svg",dn,[...e[21]||(e[21]=[u("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[u("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),u("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,cn)):U("",!0),l.showExpandButton?(F(),H("button",{key:2,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-pressed":S.value,onClick:xt,onMouseenter:e[13]||(e[13]=n=>T(n,S.value?g(f)("common.collapse")||"Collapse":g(f)("common.expand")||"Expand")),onFocus:e[14]||(e[14]=n=>T(n,S.value?g(f)("common.collapse")||"Collapse":g(f)("common.expand")||"Expand")),onMouseleave:_,onBlur:_},[S.value?(F(),H("svg",fn,[...e[23]||(e[23]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])):(F(),H("svg",pn,[...e[24]||(e[24]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])]))],40,mn)):U("",!0),_e.value&&l.showPreviewButton?(F(),H("button",{key:3,type:"button",class:"code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]","aria-label":g(f)("common.preview")||"Preview",onClick:Ct,onMouseenter:e[15]||(e[15]=n=>T(n,g(f)("common.preview")||"Preview")),onFocus:e[16]||(e[16]=n=>T(n,g(f)("common.preview")||"Preview")),onMouseleave:_,onBlur:_},[...e[25]||(e[25]=[u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"},[u("g",{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"},[u("path",{d:"M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496"}),u("path",{d:"M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23"})])],-1)])],40,hn)):U("",!0)])],!0)])):U("",!0),Qe(u("div",wn,[u("div",{ref_key:"codeEditor",ref:d,class:oe(["code-editor-container",[p.stream?"":"code-height-placeholder",{"is-hidden":Ie.value}]])},null,2),Ie.value?(F(),ke(g(Ke),{key:0,class:oe(["code-pre-fallback",{"is-wrap":mt.value}]),style:ze(wt.value),node:p.node},null,8,["class","style","node"])):U("",!0)],512),[[et,!(O.value||!p.stream&&p.loading)]]),fe.value&&!b.value&&_e.value&&D.value==="html"?(F(),ke(Kt,{key:1,code:p.node.code,"is-dark":l.isDark,"on-close":()=>fe.value=!1},null,8,["code","is-dark","on-close"])):U("",!0),Qe(u("div",gn,[Ne(t.$slots,"loading",{loading:p.loading,stream:p.stream},()=>[e[26]||(e[26]=u("div",{class:"loading-skeleton"},[u("div",{class:"skeleton-line"}),u("div",{class:"skeleton-line"}),u("div",{class:"skeleton-line short"})],-1))],!0)],512),[[et,!p.stream&&p.loading]]),u("span",yn,Ye(Z.value?g(f)("common.copied")||"Copied":""),1)],6))}}),[["__scopeId","data-v-bf41db7f"]]);je.install=p=>{p.component(je.__name,je)};export{je as default};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{_ as w,D as te,F as ae,H as he,e as ue,l as K,b9 as P,d as Y,b as pe,a as fe,p as me,q as ge,g as ye,s as Se,E as ve,ba as xe,y as be}from"./VvxifOG2.js";import{s as we}from"./C2r5gH2d.js";import{p as Ce}from"./eM4IBQGT.js";import{p as Te}from"./CM2Ru5jE.js";import{b as O}from"./DNM2C9RQ.js";import{o as J}from"./DGBBJ9Xx.js";import"./FdVDP1dJ.js";import"./BIK3UA9H.js";import"./1fcVKlQD.js";import"./Gi6I4Gst.js";function Le(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function $e(){return this.eachAfter(Le)}function Ae(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Fe(t,a){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function ke(t,a){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)t.call(a,l,++m,this);return this}function Ne(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Me(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,o=n&&n.length;--o>=0;)l+=n[o].value;a.value=l})}function _e(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ze(t){for(var a=this,l=Ve(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var o=n.length;t!==l;)n.splice(o,0,t),t=t.parent;return n}function Ve(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),o=null;for(t=l.pop(),a=n.pop();t===a;)o=t,t=l.pop(),a=n.pop();return o}function De(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Pe(){return Array.from(this)}function Be(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Ee(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Re(){var t=this,a,l=[t],n,o,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ie)):a===void 0&&(a=He);for(var l=new U(t),n,o=[l],s,d,h,m;n=o.pop();)if((d=a(n.data))&&(m=(d=Array.from(d)).length))for(n.children=d,h=m-1;h>=0;--h)o.push(s=d[h]=new U(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(qe)}function We(){return Q(this).eachBefore(Oe)}function He(t){return t.children}function Ie(t){return Array.isArray(t)?t[1]:null}function Oe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function qe(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=Q.prototype={constructor:U,count:$e,each:Ae,eachAfter:ke,eachBefore:Fe,find:Ne,sum:Me,sort:_e,path:ze,ancestors:De,descendants:Pe,leaves:Be,links:Ee,copy:We,[Symbol.iterator]:Re};function Ge(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function Xe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function je(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(n-a)/t.value;++h<m;)d=s[h],d.y0=l,d.y1=o,d.x0=a,d.x1=a+=d.value*c}function Ye(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(o-l)/t.value;++h<m;)d=s[h],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var Ue=(1+Math.sqrt(5))/2;function Ze(t,a,l,n,o,s){for(var d=[],h=a.children,m,c,u=0,b=0,r=h.length,x,S,v=a.value,p,g,N,k,V,R,M;u<r;){x=o-l,S=s-n;do p=h[b++].value;while(!p&&b<r);for(g=N=p,R=Math.max(S/x,x/S)/(v*t),M=p*p*R,V=Math.max(N/M,M/g);b<r;++b){if(p+=c=h[b].value,c<g&&(g=c),c>N&&(N=c),M=p*p*R,k=Math.max(N/M,M/g),k>V){p-=c;break}V=k}d.push(m={value:p,dice:x<S,children:h.slice(u,b)}),m.dice?je(m,l,n,o,v?n+=S*p/v:s):Ye(m,l,n,v?l+=x*p/v:o,s),v-=p,u=b}return d}const Je=(function t(a){function l(n,o,s,d,h){Ze(a,n,o,s,d,h)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(Ue);function Ke(){var t=Je,a=!1,l=1,n=1,o=[0],s=q,d=q,h=q,m=q,c=q;function u(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(b),o=[0],a&&r.eachBefore(Xe),r}function b(r){var x=o[r.depth],S=r.x0+x,v=r.y0+x,p=r.x1-x,g=r.y1-x;p<S&&(S=p=(S+p)/2),g<v&&(v=g=(v+g)/2),r.x0=S,r.y0=v,r.x1=p,r.y1=g,r.children&&(x=o[r.depth+1]=s(r)/2,S+=c(r)-x,v+=d(r)-x,p-=h(r)-x,g-=m(r)-x,p<S&&(S=p=(S+p)/2),g<v&&(v=g=(v+g)/2),t(r,S,v,p,g))}return u.round=function(r){return arguments.length?(a=!!r,u):a},u.size=function(r){return arguments.length?(l=+r[0],n=+r[1],u):[l,n]},u.tile=function(r){return arguments.length?(t=Ge(r),u):t},u.padding=function(r){return arguments.length?u.paddingInner(r).paddingOuter(r):u.paddingInner()},u.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:G(+r),u):s},u.paddingOuter=function(r){return arguments.length?u.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):u.paddingTop()},u.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:G(+r),u):d},u.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:G(+r),u):h},u.paddingBottom=function(r){return arguments.length?(m=typeof r=="function"?r:G(+r),u):m},u.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:G(+r),u):c},u}var E,ne=(E=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=pe,this.getAccTitle=fe,this.setDiagramTitle=me,this.getDiagramTitle=ge,this.getAccDescription=ye,this.setAccDescription=Se}getNodes(){return this.nodes}getConfig(){const a=ve,l=ae();return te({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{xe(s)&&(n?.textStyles?n.textStyles.push(s):n.textStyles=[s]),n?.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(E,"TreeMapDB"),E);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n?.classSelector,n?.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),a}w(le,"buildHierarchy");var Qe=w((t,a)=>{Ce(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c.join(";"):void 0,b={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};l.push(b)}const n=le(l),o=w((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),et=w(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:w(async t=>{try{const l=await Te("treemap",t);K.debug("Treemap AST:",l);const n=re.parser?.yy;if(!(n instanceof ne))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Qe(l,n)}catch(a){throw K.error("Error parsing treemap:",a),a}},"parse")},tt=10,B=10,X=25,at=w((t,a,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??tt,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=ae();if(!m)return;const u=h?30:0,b=he(a),r=s.nodeWidth?s.nodeWidth*B:960,x=s.nodeHeight?s.nodeHeight*B:500,S=r,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(i=>"$"+O(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),f=i?i[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);p=w(f=>"$"+O(i||"")(f),"valueFormat")}else p=O(e)}catch(e){K.error("Error creating format function:",e),p=O(",")}const g=J().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=J().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=J().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=Q(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),ee=Ke().size([r,x]).paddingTop(e=>e.children&&e.children.length>0?X+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(R),se=ee.descendants().filter(e=>e.children&&e.children.length>0),W=V.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),W.append("clipPath").attr("id",(e,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>g(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=P({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=Y(this),f=e.data.name;i.text(f);const C=e.x1-e.x0,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),y=i.node();if(y.getComputedTextLength()>A){let T=f;for(;T.length>0;){if(T=f.substring(0,T.length-1),T.length===0){i.text("..."),y.getComputedTextLength()>A&&i.text("");break}if(i.text(T+"..."),y.getComputedTextLength()<=A)break}}}),s.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const ie=ee.leaves(),j=V.selectAll(".treemapLeafGroup").data(ie).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?g(e.parent.data.name):g(e.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(e,i)=>`clip-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${a}-${i})`).text(e=>e.data.name).each(function(e){const i=Y(this),f=e.x1-e.x0,C=e.y1-e.y0,L=i.node(),$=4,D=f-2*$,A=C-2*$;if(D<10||A<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,F=28,T=.6,z=6,H=2;for(;L.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let I=Math.max(z,Math.min(F,Math.round(y*T))),Z=y+H+I;for(;Z>A&&y>_&&(y--,I=Math.max(z,Math.min(F,Math.round(y*T))),!(I<z&&y===_));)i.style("font-size",`${y}px`),Z=y+H+I;i.style("font-size",`${y}px`),(L.getComputedTextLength()>D||y<_||A<y)&&i.style("display","none")}),s.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(i.value):"").each(function(i){const f=Y(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=Y(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const $=parseFloat(L.style("font-size")),D=28,A=.6,y=6,_=2,F=Math.max(y,Math.min(D,Math.round($*A)));f.style("font-size",`${F}px`);const z=(i.y1-i.y0)/2+$/2+_;f.attr("y",z);const H=i.x1-i.x0,ce=i.y1-i.y0-4,de=H-8;f.node().getComputedTextLength()>de||z+F>ce||F<y?f.style("display","none"):f.style("display",null)});const oe=s.diagramPadding??8;we(b,oe,"flowchart",s?.useMaxWidth||!1)},"draw"),nt=w(function(t,a){return a.db.getClasses()},"getClasses"),lt={draw:at,getClasses:nt},rt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},st=w(({treemap:t}={})=>{const a=te(rt,t);return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${a.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${a.sectionStrokeWidth};
|
|
5
|
+
fill: ${a.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${a.leafStrokeColor};
|
|
9
|
+
stroke-width: ${a.leafStrokeWidth};
|
|
10
|
+
fill: ${a.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${a.labelColor};
|
|
14
|
+
font-size: ${a.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${a.valueColor};
|
|
18
|
+
font-size: ${a.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${a.titleColor};
|
|
22
|
+
font-size: ${a.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),it=st,vt={parser:re,get db(){return new ne},renderer:lt,styles:it};export{vt as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{s as _e,g as Ae,q as ie,p as ke,a as Fe,b as Pe,_ as o,c as zt,l as bt,d as Lt,e as ve,y as Ce,E as D,i as Le,K as Ee}from"./VvxifOG2.js";import{l as ee}from"./Be9sogz8.js";import"./FdVDP1dJ.js";import"./Gi6I4Gst.js";import"./DNM2C9RQ.js";var Et=(function(){var t=o(function(M,r,l,x){for(l=l||{},x=M.length;x--;l[M[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],A=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],G=[1,14],ht=[1,23],xt=[1,18],ft=[1,19],gt=[1,20],ct=[1,21],_t=[1,22],dt=[1,24],i=[1,25],Vt=[1,26],It=[1,27],wt=[1,28],Bt=[1,29],W=[1,32],U=[1,33],k=[1,34],F=[1,39],P=[1,40],v=[1,42],C=[1,44],O=[1,62],H=[1,61],L=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Rt=[1,65],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],I=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,90],Z=[1,91],J=[1,92],$=[1,99],tt=[1,93],et=[1,96],it=[1,94],at=[1,95],nt=[1,97],st=[1,98],At=[1,102],Kt=[10,55,56,57],R=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,A,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:q,12:m,13:b,14:g,18:G,25:ht,35:xt,37:ft,39:gt,41:ct,42:_t,48:dt,50:i,51:Vt,52:It,53:wt,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(y,[2,34]),{27:45,55:d,56:h,57:p},t(a,[2,37]),t(a,A,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:u,5:T,10:q,12:m,13:b,14:g,18:G,25:ht,35:xt,37:ft,39:gt,41:ct,42:_t,48:dt,50:i,51:Vt,52:It,53:wt,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(a,[2,45]),t(a,[2,46]),{18:[1,50]},{4:u,5:T,10:q,12:m,13:b,14:g,43:51,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:u,5:T,10:q,12:m,13:b,14:g,43:52,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:u,5:T,10:q,12:m,13:b,14:g,43:53,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:u,5:T,10:q,12:m,13:b,14:g,43:54,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:u,5:T,10:q,12:m,13:b,14:g,43:55,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:u,5:T,10:q,12:m,13:b,14:g,43:56,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,44:[1,57],47:[1,58],58:60,59:59,63:k,64:F,65:P,66:v,67:C},t(L,[2,64]),t(L,[2,66]),t(L,[2,67]),t(L,[2,70]),t(L,[2,71]),t(L,[2,72]),t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(L,[2,80]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:64,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,21:63},t(a,[2,53],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,49:[1,77],63:k,64:F,65:P,66:v,67:C}),t(a,[2,56],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,49:[1,78],63:k,64:F,65:P,66:v,67:C}),t(a,[2,57],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(a,[2,58],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(a,[2,59],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(a,[2,60],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),{45:[1,79]},{44:[1,80]},t(L,[2,65]),t(L,[2,81]),t(L,[2,82]),t(L,[2,83]),{3:82,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,18:[1,81]},t(I,[2,23]),t(I,[2,1]),t(I,[2,2]),t(I,[2,3]),t(I,[2,4]),t(I,[2,5]),t(I,[2,6]),t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12]),t(a,[2,52],{58:31,43:83,4:u,5:T,10:q,12:m,13:b,14:g,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,55],{58:31,43:84,4:u,5:T,10:q,12:m,13:b,14:g,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),{46:[1,85]},{45:[1,86]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:89,17:it,18:at,19:nt,20:st,22:88,23:87},t(I,[2,24]),t(a,[2,51],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(a,[2,54],{59:59,58:60,4:u,5:T,8:O,10:q,12:m,13:b,14:g,18:H,63:k,64:F,65:P,66:v,67:C}),t(a,[2,47],{22:88,16:89,23:100,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,101]},t(a,[2,29],{10:At}),t(Kt,[2,27],{16:103,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(R,[2,25]),t(R,[2,13]),t(R,[2,14]),t(R,[2,15]),t(R,[2,16]),t(R,[2,17]),t(R,[2,18]),t(R,[2,19]),t(R,[2,20]),t(R,[2,21]),t(R,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:88,16:89,23:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:89,17:it,18:at,19:nt,20:st,22:105},t(R,[2,26]),t(a,[2,50],{10:At}),t(Kt,[2,28],{16:103,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Zt=0,qe=2,Jt=1,me=e.slice.call(arguments,1),E=Object.create(this.lexer),Y={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(Y.yy[Ft]=this.yy[Ft]);E.setInput(r,Y.yy),Y.yy.lexer=E,Y.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var Pt=E.yylloc;e.push(Pt);var be=E.options&&E.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(B){x.length=x.length-2*B,S.length=S.length-B,e.length=e.length-B}o(Se,"popStack");function $t(){var B;return B=c.pop()||E.lex()||Jt,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=l.symbols_[B]||B),B}o($t,"lex");for(var w,j,N,vt,rt={},Tt,X,te,qt;;){if(j=x[x.length-1],this.defaultActions[j]?N=this.defaultActions[j]:((w===null||typeof w>"u")&&(w=$t()),N=ut[j]&&ut[j][w]),typeof N>"u"||!N.length||!N[0]){var Ct="";qt=[];for(Tt in ut[j])this.terminals_[Tt]&&Tt>qe&&qt.push("'"+this.terminals_[Tt]+"'");E.showPosition?Ct="Parse error on line "+(yt+1)+`:
|
|
2
|
+
`+E.showPosition()+`
|
|
3
|
+
Expecting `+qt.join(", ")+", got '"+(this.terminals_[w]||w)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(w==Jt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(Ct,{text:E.match,token:this.terminals_[w]||w,line:E.yylineno,loc:Pt,expected:qt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+w);switch(N[0]){case 1:x.push(w),S.push(E.yytext),e.push(E.yylloc),x.push(N[1]),w=null,Zt=E.yyleng,s=E.yytext,yt=E.yylineno,Pt=E.yylloc;break;case 2:if(X=this.productions_[N[1]][1],rt.$=S[S.length-X],rt._$={first_line:e[e.length-(X||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(X||1)].first_column,last_column:e[e.length-1].last_column},be&&(rt._$.range=[e[e.length-(X||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Zt,yt,Y.yy,N[1],S,e].concat(me)),typeof vt<"u")return vt;X&&(x=x.slice(0,-1*X*2),S=S.slice(0,-1*X),e=e.slice(0,-1*X)),x.push(this.productions_[N[1]][0]),S.push(rt.$),e.push(rt._$),te=ut[x[x.length-2]][x[x.length-1]],x.push(te);break;case 3:return!0}}return!0},"parse")},Te=(function(){var M={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+l+"^"},"showPosition"),test_match:o(function(r,l){var x,c,S;if(this.options.backtrack_lexer&&(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(S.yylloc.range=this.yylloc.range.slice(0))),c=r[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],x=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var e in S)this[e]=S[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,x,c;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),e=0;e<S.length;e++)if(x=this._input.match(this.rules[S[e]]),x&&(!l||x[0].length>l[0].length)){if(l=x,c=e,this.options.backtrack_lexer){if(r=this.test_match(x,S[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,S[c]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,x,c,S){switch(c){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:return 65;case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};return M})();kt.lexer=Te;function pt(){this.yy={}}return o(pt,"Parser"),pt.prototype=kt,kt.Parser=pt,new pt})();Et.parser=Et;var De=Et,V=Ee(),ot,ze=(ot=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:D.quadrantChart?.chartWidth||500,chartWidth:D.quadrantChart?.chartHeight||500,titlePadding:D.quadrantChart?.titlePadding||10,titleFontSize:D.quadrantChart?.titleFontSize||20,quadrantPadding:D.quadrantChart?.quadrantPadding||5,xAxisLabelPadding:D.quadrantChart?.xAxisLabelPadding||5,yAxisLabelPadding:D.quadrantChart?.yAxisLabelPadding||5,xAxisLabelFontSize:D.quadrantChart?.xAxisLabelFontSize||16,yAxisLabelFontSize:D.quadrantChart?.yAxisLabelFontSize||16,quadrantLabelFontSize:D.quadrantChart?.quadrantLabelFontSize||16,quadrantTextTopPadding:D.quadrantChart?.quadrantTextTopPadding||5,pointTextPadding:D.quadrantChart?.pointTextPadding||5,pointLabelFontSize:D.quadrantChart?.pointLabelFontSize||12,pointRadius:D.quadrantChart?.pointRadius||5,xAxisPosition:D.quadrantChart?.xAxisPosition||"top",yAxisPosition:D.quadrantChart?.yAxisPosition||"left",quadrantInternalBorderStrokeWidth:D.quadrantChart?.quadrantInternalBorderStrokeWidth||1,quadrantExternalBorderStrokeWidth:D.quadrantChart?.quadrantExternalBorderStrokeWidth||2}}getDefaultThemeConfig(){return{quadrant1Fill:V.quadrant1Fill,quadrant2Fill:V.quadrant2Fill,quadrant3Fill:V.quadrant3Fill,quadrant4Fill:V.quadrant4Fill,quadrant1TextFill:V.quadrant1TextFill,quadrant2TextFill:V.quadrant2TextFill,quadrant3TextFill:V.quadrant3TextFill,quadrant4TextFill:V.quadrant4TextFill,quadrantPointFill:V.quadrantPointFill,quadrantPointTextFill:V.quadrantPointTextFill,quadrantXAxisTextFill:V.quadrantXAxisTextFill,quadrantYAxisTextFill:V.quadrantYAxisTextFill,quadrantTitleFill:V.quadrantTitleFill,quadrantInternalBorderStrokeFill:V.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:V.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,bt.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,f){this.classes.set(n,f)}setConfig(n){bt.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){bt.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,f,d,h){const p=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,y={top:n==="top"&&f?p:0,bottom:n==="bottom"&&f?p:0},_=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&d?_:0,right:this.config.yAxisPosition==="right"&&d?_:0},A=this.config.titleFontSize+this.config.titlePadding*2,u={top:h?A:0},T=this.config.quadrantPadding+a.left,q=this.config.quadrantPadding+y.top+u.top,m=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,b=this.config.chartHeight-this.config.quadrantPadding*2-y.top-y.bottom-u.top,g=m/2,G=b/2;return{xAxisSpace:y,yAxisSpace:a,titleSpace:u,quadrantSpace:{quadrantLeft:T,quadrantTop:q,quadrantWidth:m,quadrantHalfWidth:g,quadrantHeight:b,quadrantHalfHeight:G}}}getAxisLabels(n,f,d,h){const{quadrantSpace:p,titleSpace:y}=h,{quadrantHalfHeight:_,quadrantHeight:a,quadrantLeft:A,quadrantHalfWidth:u,quadrantTop:T,quadrantWidth:q}=p,m=!!this.data.xAxisRightText,b=!!this.data.yAxisTopText,g=[];return this.data.xAxisLeftText&&f&&g.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:A+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&f&&g.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:A+u+(m?u/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:m?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&d&&g.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+A+q+this.config.quadrantPadding,y:T+a-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&d&&g.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+A+q+this.config.quadrantPadding,y:T+_-(b?_/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),g}getQuadrants(n){const{quadrantSpace:f}=n,{quadrantHalfHeight:d,quadrantLeft:h,quadrantHalfWidth:p,quadrantTop:y}=f,_=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y,width:p,height:d,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y,width:p,height:d,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y:y+d,width:p,height:d,fill:this.themeConfig.quadrant4Fill}];for(const a of _)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return _}getQuadrantPoints(n){const{quadrantSpace:f}=n,{quadrantHeight:d,quadrantLeft:h,quadrantTop:p,quadrantWidth:y}=f,_=ee().domain([0,1]).range([h,y+h]),a=ee().domain([0,1]).range([d+p,p]);return this.data.points.map(u=>{const T=this.classes.get(u.className);return T&&(u={...T,...u}),{x:_(u.x),y:a(u.y),fill:u.color??this.themeConfig.quadrantPointFill,radius:u.radius??this.config.pointRadius,text:{text:u.text,fill:this.themeConfig.quadrantPointTextFill,x:_(u.x),y:a(u.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:u.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:u.strokeWidth??"0px"}})}getBorders(n){const f=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:d}=n,{quadrantHalfHeight:h,quadrantHeight:p,quadrantLeft:y,quadrantHalfWidth:_,quadrantTop:a,quadrantWidth:A}=d;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a,x2:y+A+f,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y+A,y1:a+f,x2:y+A,y2:a+p-f},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-f,y1:a+p,x2:y+A+f,y2:a+p},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y,y1:a+f,x2:y,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+_,y1:a+f,x2:y+_,y2:a+p-f},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+f,y1:a+h,x2:y+A-f,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),f=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),d=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,p=this.calculateSpace(h,n,f,d);return{points:this.getQuadrantPoints(p),quadrants:this.getQuadrants(p),axisLabels:this.getAxisLabels(h,n,f,p),borderLines:this.getBorders(p),title:this.getTitle(d)}}},o(ot,"QuadrantBuilder"),ot),lt,mt=(lt=class extends Error{constructor(n,f,d){super(`value for ${n} ${f} is invalid, please use a valid ${d}`),this.name="InvalidStyleError"}},o(lt,"InvalidStyleError"),lt);function Dt(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}o(Dt,"validateHexCode");function ae(t){return!/^\d+$/.test(t)}o(ae,"validateNumber");function ne(t){return!/^\d+px$/.test(t)}o(ne,"validateSizeInPixels");var Ve=zt();function Q(t){return Le(t.trim(),Ve)}o(Q,"textSanitizer");var z=new ze;function se(t){z.setData({quadrant1Text:Q(t.text)})}o(se,"setQuadrant1Text");function re(t){z.setData({quadrant2Text:Q(t.text)})}o(re,"setQuadrant2Text");function oe(t){z.setData({quadrant3Text:Q(t.text)})}o(oe,"setQuadrant3Text");function le(t){z.setData({quadrant4Text:Q(t.text)})}o(le,"setQuadrant4Text");function he(t){z.setData({xAxisLeftText:Q(t.text)})}o(he,"setXAxisLeftText");function ce(t){z.setData({xAxisRightText:Q(t.text)})}o(ce,"setXAxisRightText");function de(t){z.setData({yAxisTopText:Q(t.text)})}o(de,"setYAxisTopText");function ue(t){z.setData({yAxisBottomText:Q(t.text)})}o(ue,"setYAxisBottomText");function St(t){const n={};for(const f of t){const[d,h]=f.trim().split(/\s*:\s*/);if(d==="radius"){if(ae(h))throw new mt(d,h,"number");n.radius=parseInt(h)}else if(d==="color"){if(Dt(h))throw new mt(d,h,"hex code");n.color=h}else if(d==="stroke-color"){if(Dt(h))throw new mt(d,h,"hex code");n.strokeColor=h}else if(d==="stroke-width"){if(ne(h))throw new mt(d,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${d} is not supported.`)}return n}o(St,"parseStyles");function xe(t,n,f,d,h){const p=St(h);z.addPoints([{x:f,y:d,text:Q(t.text),className:n,...p}])}o(xe,"addPoint");function fe(t,n){z.addClass(t,St(n))}o(fe,"addClass");function ge(t){z.setConfig({chartWidth:t})}o(ge,"setWidth");function pe(t){z.setConfig({chartHeight:t})}o(pe,"setHeight");function ye(){const t=zt(),{themeVariables:n,quadrantChart:f}=t;return f&&z.setConfig(f),z.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),z.setData({titleText:ie()}),z.build()}o(ye,"getQuadrantData");var Ie=o(function(){z.clear(),Ce()},"clear"),we={setWidth:ge,setHeight:pe,setQuadrant1Text:se,setQuadrant2Text:re,setQuadrant3Text:oe,setQuadrant4Text:le,setXAxisLeftText:he,setXAxisRightText:ce,setYAxisTopText:de,setYAxisBottomText:ue,parseStyles:St,addPoint:xe,addClass:fe,getQuadrantData:ye,clear:Ie,setAccTitle:Pe,getAccTitle:Fe,setDiagramTitle:ke,getDiagramTitle:ie,getAccDescription:Ae,setAccDescription:_e},Be=o((t,n,f,d)=>{function h(i){return i==="top"?"hanging":"middle"}o(h,"getDominantBaseLine");function p(i){return i==="left"?"start":"middle"}o(p,"getTextAnchor");function y(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}o(y,"getTransformation");const _=zt();bt.debug(`Rendering quadrant chart
|
|
7
|
+
`+t);const a=_.securityLevel;let A;a==="sandbox"&&(A=Lt("#i"+n));const T=(a==="sandbox"?Lt(A.nodes()[0].contentDocument.body):Lt("body")).select(`[id="${n}"]`),q=T.append("g").attr("class","main"),m=_.quadrantChart?.chartWidth??500,b=_.quadrantChart?.chartHeight??500;ve(T,b,m,_.quadrantChart?.useMaxWidth??!0),T.attr("viewBox","0 0 "+m+" "+b),d.db.setHeight(b),d.db.setWidth(m);const g=d.db.getQuadrantData(),G=q.append("g").attr("class","quadrants"),ht=q.append("g").attr("class","border"),xt=q.append("g").attr("class","data-points"),ft=q.append("g").attr("class","labels"),gt=q.append("g").attr("class","title");g.title&>.append("text").attr("x",0).attr("y",0).attr("fill",g.title.fill).attr("font-size",g.title.fontSize).attr("dominant-baseline",h(g.title.horizontalPos)).attr("text-anchor",p(g.title.verticalPos)).attr("transform",y(g.title)).text(g.title.text),g.borderLines&&ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const ct=G.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class","quadrant");ct.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),ct.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const dt=xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class","data-point");dt.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),dt.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Re={draw:Be},He={parser:De,db:we,renderer:Re,styles:o(()=>"","styles")};export{He as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b,a as m,c as d,d as h,i as l}from"./1fcVKlQD.js";import{aD as g,aE as o,aF as p}from"./VvxifOG2.js";function L(a){var n=a==null?0:a.length;return n?b(a):[]}function v(a,n){var s=-1,t=g(a)?Array(a.length):[];return m(a,function(f,i,e){t[++s]=n(f,i,e)}),t}function M(a,n){var s=o(a)?h:v;return s(a,d(n))}function x(a,n){return a<n}function A(a,n,s){for(var t=-1,f=a.length;++t<f;){var i=a[t],e=n(i);if(e!=null&&(r===void 0?e===e&&!l(e):s(e,r)))var r=e,u=i}return u}function k(a){return a&&a.length?A(a,p,x):void 0}export{x as a,A as b,v as c,k as d,L as f,M as m};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import{g as oe}from"./CYh22N6Z.js";import{_ as d,F as rt,d as O,e as he,l as L,y as de,A as ge,ak as ue,R as pe,S as fe,c as R,O as xe,al as j,am as Wt,an as ye,u as $,k as be,ao as we,ap as xt,i as yt,aq as me}from"./VvxifOG2.js";import{c as Le}from"./Dr-RzAtV.js";import{G as Se}from"./FmGx3-yC.js";import{c as ke}from"./CW5-BTm0.js";import"./FdVDP1dJ.js";import"./1fcVKlQD.js";var bt=(function(){var e=d(function(D,y,g,f){for(g=g||{},f=D.length;f--;g[D[f]]=y);return g},"o"),t=[1,15],a=[1,7],i=[1,13],l=[1,14],s=[1,19],r=[1,16],n=[1,17],c=[1,18],u=[8,30],o=[8,10,21,28,29,30,31,39,43,46],x=[1,23],w=[1,24],b=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],k={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:d(function(y,g,f,m,E,h,W){var p=h.length-1;switch(E){case 4:m.getLogger().debug("Rule: separator (NL) ");break;case 5:m.getLogger().debug("Rule: separator (Space) ");break;case 6:m.getLogger().debug("Rule: separator (EOF) ");break;case 7:m.getLogger().debug("Rule: hierarchy: ",h[p-1]),m.setHierarchy(h[p-1]);break;case 8:m.getLogger().debug("Stop NL ");break;case 9:m.getLogger().debug("Stop EOF ");break;case 10:m.getLogger().debug("Stop NL2 ");break;case 11:m.getLogger().debug("Stop EOF2 ");break;case 12:m.getLogger().debug("Rule: statement: ",h[p]),typeof h[p].length=="number"?this.$=h[p]:this.$=[h[p]];break;case 13:m.getLogger().debug("Rule: statement #2: ",h[p-1]),this.$=[h[p-1]].concat(h[p]);break;case 14:m.getLogger().debug("Rule: link: ",h[p],y),this.$={edgeTypeStr:h[p],label:""};break;case 15:m.getLogger().debug("Rule: LABEL link: ",h[p-3],h[p-1],h[p]),this.$={edgeTypeStr:h[p],label:h[p-1]};break;case 18:const I=parseInt(h[p]),Z=m.generateId();this.$={id:Z,type:"space",label:"",width:I,children:[]};break;case 23:m.getLogger().debug("Rule: (nodeStatement link node) ",h[p-2],h[p-1],h[p]," typestr: ",h[p-1].edgeTypeStr);const V=m.edgeStrToEdgeData(h[p-1].edgeTypeStr);this.$=[{id:h[p-2].id,label:h[p-2].label,type:h[p-2].type,directions:h[p-2].directions},{id:h[p-2].id+"-"+h[p].id,start:h[p-2].id,end:h[p].id,label:h[p-1].label,type:"edge",directions:h[p].directions,arrowTypeEnd:V,arrowTypeStart:"arrow_open"},{id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions}];break;case 24:m.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[p-1],h[p]),this.$={id:h[p-1].id,label:h[p-1].label,type:m.typeStr2Type(h[p-1].typeStr),directions:h[p-1].directions,widthInColumns:parseInt(h[p],10)};break;case 25:m.getLogger().debug("Rule: nodeStatement (node) ",h[p]),this.$={id:h[p].id,label:h[p].label,type:m.typeStr2Type(h[p].typeStr),directions:h[p].directions,widthInColumns:1};break;case 26:m.getLogger().debug("APA123",this?this:"na"),m.getLogger().debug("COLUMNS: ",h[p]),this.$={type:"column-setting",columns:h[p]==="auto"?-1:parseInt(h[p])};break;case 27:m.getLogger().debug("Rule: id-block statement : ",h[p-2],h[p-1]),m.generateId(),this.$={...h[p-2],type:"composite",children:h[p-1]};break;case 28:m.getLogger().debug("Rule: blockStatement : ",h[p-2],h[p-1],h[p]);const at=m.generateId();this.$={id:at,type:"composite",label:"",children:h[p-1]};break;case 29:m.getLogger().debug("Rule: node (NODE_ID separator): ",h[p]),this.$={id:h[p]};break;case 30:m.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[p-1],h[p]),this.$={id:h[p-1],label:h[p].label,typeStr:h[p].typeStr,directions:h[p].directions};break;case 31:m.getLogger().debug("Rule: dirList: ",h[p]),this.$=[h[p]];break;case 32:m.getLogger().debug("Rule: dirList: ",h[p-1],h[p]),this.$=[h[p-1]].concat(h[p]);break;case 33:m.getLogger().debug("Rule: nodeShapeNLabel: ",h[p-2],h[p-1],h[p]),this.$={typeStr:h[p-2]+h[p],label:h[p-1]};break;case 34:m.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[p-3],h[p-2]," #3:",h[p-1],h[p]),this.$={typeStr:h[p-3]+h[p],label:h[p-2],directions:h[p-1]};break;case 35:case 36:this.$={type:"classDef",id:h[p-1].trim(),css:h[p].trim()};break;case 37:this.$={type:"applyClass",id:h[p-1].trim(),styleClass:h[p].trim()};break;case 38:this.$={type:"applyStyles",id:h[p-1].trim(),stylesStr:h[p].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:i,29:l,31:s,39:r,43:n,46:c}),e(o,[2,16],{14:22,15:x,16:w}),e(o,[2,17]),e(o,[2,18]),e(o,[2,19]),e(o,[2,20]),e(o,[2,21]),e(o,[2,22]),e(b,[2,25],{27:[1,25]}),e(o,[2,26]),{19:26,26:12,31:s},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:s},{31:[2,14]},{17:[1,36]},e(b,[2,24]),{10:t,11:37,13:4,14:22,15:x,16:w,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:s,39:r,43:n,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(o,[2,28]),e(o,[2,35]),e(o,[2,36]),e(o,[2,37]),e(o,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(o,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:d(function(y,g){if(g.recoverable)this.trace(y);else{var f=new Error(y);throw f.hash=g,f}},"parseError"),parse:d(function(y){var g=this,f=[0],m=[],E=[null],h=[],W=this.table,p="",I=0,Z=0,V=2,at=1,ne=h.slice.call(arguments,1),z=Object.create(this.lexer),q={yy:{}};for(var gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,gt)&&(q.yy[gt]=this.yy[gt]);z.setInput(y,q.yy),q.yy.lexer=z,q.yy.parser=this,typeof z.yylloc>"u"&&(z.yylloc={});var ut=z.yylloc;h.push(ut);var le=z.options&&z.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(P){f.length=f.length-2*P,E.length=E.length-P,h.length=h.length-P}d(ce,"popStack");function Nt(){var P;return P=m.pop()||z.lex()||at,typeof P!="number"&&(P instanceof Array&&(m=P,P=m.pop()),P=g.symbols_[P]||P),P}d(Nt,"lex");for(var F,J,H,pt,Q={},st,G,Tt,it;;){if(J=f[f.length-1],this.defaultActions[J]?H=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=Nt()),H=W[J]&&W[J][F]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in W[J])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");z.showPosition?ft="Parse error on line "+(I+1)+`:
|
|
2
|
+
`+z.showPosition()+`
|
|
3
|
+
Expecting `+it.join(", ")+", got '"+(this.terminals_[F]||F)+"'":ft="Parse error on line "+(I+1)+": Unexpected "+(F==at?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(ft,{text:z.match,token:this.terminals_[F]||F,line:z.yylineno,loc:ut,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(H[0]){case 1:f.push(F),E.push(z.yytext),h.push(z.yylloc),f.push(H[1]),F=null,Z=z.yyleng,p=z.yytext,I=z.yylineno,ut=z.yylloc;break;case 2:if(G=this.productions_[H[1]][1],Q.$=E[E.length-G],Q._$={first_line:h[h.length-(G||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(G||1)].first_column,last_column:h[h.length-1].last_column},le&&(Q._$.range=[h[h.length-(G||1)].range[0],h[h.length-1].range[1]]),pt=this.performAction.apply(Q,[p,Z,I,q.yy,H[1],E,h].concat(ne)),typeof pt<"u")return pt;G&&(f=f.slice(0,-1*G*2),E=E.slice(0,-1*G),h=h.slice(0,-1*G)),f.push(this.productions_[H[1]][0]),E.push(Q.$),h.push(Q._$),Tt=W[f[f.length-2]][f[f.length-1]],f.push(Tt);break;case 3:return!0}}return!0},"parse")},B=(function(){var D={EOF:1,parseError:d(function(g,f){if(this.yy.parser)this.yy.parser.parseError(g,f);else throw new Error(g)},"parseError"),setInput:d(function(y,g){return this.yy=g||this.yy||{},this._input=y,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var y=this._input[0];this.yytext+=y,this.yyleng++,this.offset++,this.match+=y,this.matched+=y;var g=y.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),y},"input"),unput:d(function(y){var g=y.length,f=y.split(/(?:\r\n?|\n)/g);this._input=y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),f.length-1&&(this.yylineno-=f.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===m.length?this.yylloc.first_column:0)+m[m.length-f.length].length-f[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(y){this.unput(this.match.slice(y))},"less"),pastInput:d(function(){var y=this.matched.substr(0,this.matched.length-this.match.length);return(y.length>20?"...":"")+y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var y=this.match;return y.length<20&&(y+=this._input.substr(0,20-y.length)),(y.substr(0,20)+(y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var y=this.pastInput(),g=new Array(y.length+1).join("-");return y+this.upcomingInput()+`
|
|
5
|
+
`+g+"^"},"showPosition"),test_match:d(function(y,g){var f,m,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),m=y[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(y[0].length),this.matched+=y[0],f=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var h in E)this[h]=E[h];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var y,g,f,m;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),h=0;h<E.length;h++)if(f=this._input.match(this.rules[E[h]]),f&&(!g||f[0].length>g[0].length)){if(g=f,m=h,this.options.backtrack_lexer){if(y=this.test_match(f,E[h]),y!==!1)return y;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(y=this.test_match(g,E[m]),y!==!1?y:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var g=this.next();return g||this.lex()},"lex"),begin:d(function(g){this.conditionStack.push(g)},"begin"),popState:d(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:d(function(g){this.begin(g)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:d(function(g,f,m,E){switch(m){case 0:return g.getLogger().debug("Found block-beta"),10;case 1:return g.getLogger().debug("Found id-block"),29;case 2:return g.getLogger().debug("Found block"),10;case 3:g.getLogger().debug(".",f.yytext);break;case 4:g.getLogger().debug("_",f.yytext);break;case 5:return 5;case 6:return f.yytext=-1,28;case 7:return f.yytext=f.yytext.replace(/columns\s+/,""),g.getLogger().debug("COLUMNS (LEX)",f.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:g.getLogger().debug("LEX: POPPING STR:",f.yytext),this.popState();break;case 13:return g.getLogger().debug("LEX: STR end:",f.yytext),"STR";case 14:return f.yytext=f.yytext.replace(/space\:/,""),g.getLogger().debug("SPACE NUM (LEX)",f.yytext),21;case 15:return f.yytext="1",g.getLogger().debug("COLUMNS (LEX)",f.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),g.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),g.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),g.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),g.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),g.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),g.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),g.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),g.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),g.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),g.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return g.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return g.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return g.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return g.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return g.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return g.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return g.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),g.getLogger().debug("LEX ARR START"),37;case 74:return g.getLogger().debug("Lex: NODE_ID",f.yytext),31;case 75:return g.getLogger().debug("Lex: EOF",f.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:g.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:g.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return g.getLogger().debug("LEX: NODE_DESCR:",f.yytext),"NODE_DESCR";case 83:g.getLogger().debug("LEX POPPING"),this.popState();break;case 84:g.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (right): dir:",f.yytext),"DIR";case 86:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (left):",f.yytext),"DIR";case 87:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (x):",f.yytext),"DIR";case 88:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (y):",f.yytext),"DIR";case 89:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (up):",f.yytext),"DIR";case 90:return f.yytext=f.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (down):",f.yytext),"DIR";case 91:return f.yytext="]>",g.getLogger().debug("Lex (ARROW_DIR end):",f.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 93:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 94:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 95:return g.getLogger().debug("Lex: LINK",f.yytext),15;case 96:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 97:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 98:return g.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return g.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),g.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 102:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 103:return this.popState(),g.getLogger().debug("Lex: LINK",f.yytext),15;case 104:return g.getLogger().debug("Lex: COLON",f.yytext),f.yytext=f.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return D})();k.lexer=B;function _(){this.yy={}}return d(_,"Parser"),_.prototype=k,k.Parser=_,new _})();bt.parser=bt;var ve=bt,X=new Map,kt=[],wt=new Map,Bt="color",Ct="fill",Ee="bgFill",Pt=",",_e=R(),ct=new Map,De=d(e=>be.sanitizeText(e,_e),"sanitizeText"),Ne=d(function(e,t=""){let a=ct.get(e);a||(a={id:e,styles:[],textStyles:[]},ct.set(e,a)),t?.split(Pt).forEach(i=>{const l=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Bt).exec(i)){const r=l.replace(Ct,Ee).replace(Bt,Ct);a.textStyles.push(r)}a.styles.push(l)})},"addStyleClass"),Te=d(function(e,t=""){const a=X.get(e);t!=null&&(a.styles=t.split(Pt))},"addStyle2Node"),Be=d(function(e,t){e.split(",").forEach(function(a){let i=X.get(a);if(i===void 0){const l=a.trim();i={id:l,type:"na",children:[]},X.set(l,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Yt=d((e,t)=>{const a=e.flat(),i=[],s=a.find(r=>r?.type==="column-setting")?.columns??-1;for(const r of a){if(typeof s=="number"&&s>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>s&&L.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${s}`),r.label&&(r.label=De(r.label)),r.type==="classDef"){Ne(r.id,r.css);continue}if(r.type==="applyClass"){Be(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&Te(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(wt.get(r.id)??0)+1;wt.set(r.id,n),r.id=n+"-"+r.id,kt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=X.get(r.id);if(n===void 0?X.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Yt(r.children,r),r.type==="space"){const c=r.width??1;for(let u=0;u<c;u++){const o=Le(r);o.id=o.id+"-"+u,X.set(o.id,o),i.push(o)}}else n===void 0&&i.push(r)}}t.children=i},"populateBlockDatabase"),vt=[],et={id:"root",type:"composite",children:[],columns:-1},Ce=d(()=>{L.debug("Clear called"),de(),et={id:"root",type:"composite",children:[],columns:-1},X=new Map([["root",et]]),vt=[],ct=new Map,kt=[],wt=new Map},"clear");function Ht(e){switch(L.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return L.debug("we have a round"),"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"}}d(Ht,"typeStr2Type");function Kt(e){return L.debug("typeStr2Type",e),e==="=="?"thick":"normal"}d(Kt,"edgeTypeStr2Type");function Xt(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}d(Xt,"edgeStrToEdgeData");var It=0,Ie=d(()=>(It++,"id-"+Math.random().toString(36).substr(2,12)+"-"+It),"generateId"),Oe=d(e=>{et.children=e,Yt(e,et),vt=et.children},"setHierarchy"),Re=d(e=>{const t=X.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),ze=d(()=>[...X.values()],"getBlocksFlat"),Ae=d(()=>vt||[],"getBlocks"),Me=d(()=>kt,"getEdges"),Fe=d(e=>X.get(e),"getBlock"),We=d(e=>{X.set(e.id,e)},"setBlock"),Pe=d(()=>L,"getLogger"),Ye=d(function(){return ct},"getClasses"),He={getConfig:d(()=>rt().block,"getConfig"),typeStr2Type:Ht,edgeTypeStr2Type:Kt,edgeStrToEdgeData:Xt,getLogger:Pe,getBlocksFlat:ze,getBlocks:Ae,getEdges:Me,setHierarchy:Oe,getBlock:Fe,setBlock:We,getColumns:Re,getClasses:Ye,clear:Ce,generateId:Ie},Ke=He,nt=d((e,t)=>{const a=ke,i=a(e,"r"),l=a(e,"g"),s=a(e,"b");return ge(i,l,s,t)},"fade"),Xe=d(e=>`.label {
|
|
7
|
+
font-family: ${e.fontFamily};
|
|
8
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
9
|
+
}
|
|
10
|
+
.cluster-label text {
|
|
11
|
+
fill: ${e.titleColor};
|
|
12
|
+
}
|
|
13
|
+
.cluster-label span,p {
|
|
14
|
+
color: ${e.titleColor};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
.label text,span,p {
|
|
20
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
21
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.node rect,
|
|
25
|
+
.node circle,
|
|
26
|
+
.node ellipse,
|
|
27
|
+
.node polygon,
|
|
28
|
+
.node path {
|
|
29
|
+
fill: ${e.mainBkg};
|
|
30
|
+
stroke: ${e.nodeBorder};
|
|
31
|
+
stroke-width: 1px;
|
|
32
|
+
}
|
|
33
|
+
.flowchart-label text {
|
|
34
|
+
text-anchor: middle;
|
|
35
|
+
}
|
|
36
|
+
// .flowchart-label .text-outer-tspan {
|
|
37
|
+
// text-anchor: middle;
|
|
38
|
+
// }
|
|
39
|
+
// .flowchart-label .text-inner-tspan {
|
|
40
|
+
// text-anchor: start;
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
.node .label {
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
.node.clickable {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.arrowheadPath {
|
|
51
|
+
fill: ${e.arrowheadColor};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.edgePath .path {
|
|
55
|
+
stroke: ${e.lineColor};
|
|
56
|
+
stroke-width: 2.0px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.flowchart-link {
|
|
60
|
+
stroke: ${e.lineColor};
|
|
61
|
+
fill: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edgeLabel {
|
|
65
|
+
background-color: ${e.edgeLabelBackground};
|
|
66
|
+
rect {
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
background-color: ${e.edgeLabelBackground};
|
|
69
|
+
fill: ${e.edgeLabelBackground};
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* For html labels only */
|
|
75
|
+
.labelBkg {
|
|
76
|
+
background-color: ${nt(e.edgeLabelBackground,.5)};
|
|
77
|
+
// background-color:
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.node .cluster {
|
|
81
|
+
// fill: ${nt(e.mainBkg,.5)};
|
|
82
|
+
fill: ${nt(e.clusterBkg,.5)};
|
|
83
|
+
stroke: ${nt(e.clusterBorder,.2)};
|
|
84
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
85
|
+
stroke-width: 1px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.cluster text {
|
|
89
|
+
fill: ${e.titleColor};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cluster span,p {
|
|
93
|
+
color: ${e.titleColor};
|
|
94
|
+
}
|
|
95
|
+
/* .cluster div {
|
|
96
|
+
color: ${e.titleColor};
|
|
97
|
+
} */
|
|
98
|
+
|
|
99
|
+
div.mermaidTooltip {
|
|
100
|
+
position: absolute;
|
|
101
|
+
text-align: center;
|
|
102
|
+
max-width: 200px;
|
|
103
|
+
padding: 2px;
|
|
104
|
+
font-family: ${e.fontFamily};
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
background: ${e.tertiaryColor};
|
|
107
|
+
border: 1px solid ${e.border2};
|
|
108
|
+
border-radius: 2px;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
z-index: 100;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.flowchartTitleText {
|
|
114
|
+
text-anchor: middle;
|
|
115
|
+
font-size: 18px;
|
|
116
|
+
fill: ${e.textColor};
|
|
117
|
+
}
|
|
118
|
+
${oe()}
|
|
119
|
+
`,"getStyles"),Ue=Xe,je=d((e,t,a,i)=>{t.forEach(l=>{rr[l](e,a,i)})},"insertMarkers"),Ve=d((e,t,a)=>{L.trace("Making markers for ",a),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Ge=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Ze=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),qe=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Je=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Qe=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),$e=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),tr=d((e,t,a)=>{e.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),er=d((e,t,a)=>{e.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),rr={extension:Ve,composition:Ge,aggregation:Ze,dependency:qe,lollipop:Je,point:Qe,circle:$e,cross:tr,barb:er},ar=je,C=R()?.block?.padding??8;function Ut(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const a=t%e,i=Math.floor(t/e);return{px:a,py:i}}d(Ut,"calculateBlockPosition");var sr=d(e=>{let t=0,a=0;for(const i of e.children){const{width:l,height:s,x:r,y:n}=i.size??{width:0,height:0,x:0,y:0};L.debug("getMaxChildSize abc95 child:",i.id,"width:",l,"height:",s,"x:",r,"y:",n,i.type),i.type!=="space"&&(l>t&&(t=l/(e.widthInColumns??1)),s>a&&(a=s))}return{width:t,height:a}},"getMaxChildSize");function ot(e,t,a=0,i=0){L.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",a),e?.size?.width||(e.size={width:a,height:i,x:0,y:0});let l=0,s=0;if(e.children?.length>0){for(const b of e.children)ot(b,t);const r=sr(e);l=r.width,s=r.height,L.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",l,s);for(const b of e.children)b.size&&(L.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${l} ${s} ${JSON.stringify(b.size)}`),b.size.width=l*(b.widthInColumns??1)+C*((b.widthInColumns??1)-1),b.size.height=s,b.size.x=0,b.size.y=0,L.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${l} maxHeight:${s}`));for(const b of e.children)ot(b,t,l,s);const n=e.columns??-1;let c=0;for(const b of e.children)c+=b.widthInColumns??1;let u=e.children.length;n>0&&n<c&&(u=n);const o=Math.ceil(c/u);let x=u*(l+C)+C,w=o*(s+C)+C;if(x<a){L.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${i} width ${x}`),x=a,w=i;const b=(a-u*C-C)/u,S=(i-o*C-C)/o;L.debug("Size indata abc88",e.id,"childWidth",b,"maxWidth",l),L.debug("Size indata abc88",e.id,"childHeight",S,"maxHeight",s),L.debug("Size indata abc88 xSize",u,"padding",C);for(const v of e.children)v.size&&(v.size.width=b,v.size.height=S,v.size.x=0,v.size.y=0)}if(L.debug(`abc95 (finale calc) ${e.id} xSize ${u} ySize ${o} columns ${n}${e.children.length} width=${Math.max(x,e.size?.width||0)}`),x<(e?.size?.width||0)){x=e?.size?.width||0;const b=n>0?Math.min(e.children.length,n):e.children.length;if(b>0){const S=(x-b*C-C)/b;L.debug("abc95 (growing to fit) width",e.id,x,e.size?.width,S);for(const v of e.children)v.size&&(v.size.width=S)}}e.size={width:x,height:w,x:0,y:0}}L.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}d(ot,"setBlockSizes");function Et(e,t){L.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const a=e.columns??-1;if(L.debug("layoutBlocks columns abc95",e.id,"=>",a,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,l=e.children.length*i+(e.children.length-1)*C;L.debug("widthOfChildren 88",l,"posX");let s=0;L.debug("abc91 block?.size?.x",e.id,e?.size?.x);let r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,n=0;for(const c of e.children){const u=e;if(!c.size)continue;const{width:o,height:x}=c.size,{px:w,py:b}=Ut(a,s);if(b!=n&&(n=b,r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-C,L.debug("New row in layout for block",e.id," and child ",c.id,n)),L.debug(`abc89 layout blocks (child) id: ${c.id} Pos: ${s} (px, py) ${w},${b} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${o}${C}`),u.size){const v=o/2;c.size.x=r+C+v,L.debug(`abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${r} new startingPosX${c.size.x} ${v} padding=${C} width=${o} halfWidth=${v} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${o*(c?.widthInColumns??1)/2}`),r=c.size.x+v,c.size.y=u.size.y-u.size.height/2+b*(x+C)+x/2+C,L.debug(`abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${r}${C}${v}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${o*(c?.widthInColumns??1)/2}`)}c.children&&Et(c);let S=c?.widthInColumns??1;a>0&&(S=Math.min(S,a-s%a)),s+=S,L.debug("abc88 columnsPos",c,s)}}L.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}d(Et,"layoutBlocks");function _t(e,{minX:t,minY:a,maxX:i,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:s,y:r,width:n,height:c}=e.size;s-n/2<t&&(t=s-n/2),r-c/2<a&&(a=r-c/2),s+n/2>i&&(i=s+n/2),r+c/2>l&&(l=r+c/2)}if(e.children)for(const s of e.children)({minX:t,minY:a,maxX:i,maxY:l}=_t(s,{minX:t,minY:a,maxX:i,maxY:l}));return{minX:t,minY:a,maxX:i,maxY:l}}d(_t,"findBounds");function jt(e){const t=e.getBlock("root");if(!t)return;ot(t,e,0,0),Et(t),L.debug("getBlocks",JSON.stringify(t,null,2));const{minX:a,minY:i,maxX:l,maxY:s}=_t(t),r=s-i,n=l-a;return{x:a,y:i,width:n,height:r}}d(jt,"layout");function mt(e,t){t&&e.attr("style",t)}d(mt,"applyStyle");function Vt(e,t){const a=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=a.append("xhtml:div"),l=e.label,s=e.isNode?"nodeLabel":"edgeLabel",r=i.append("span");return r.html(yt(l,t)),mt(r,e.labelStyle),r.attr("class",s),mt(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),a.node()}d(Vt,"addHtmlLabel");var ir=d(async(e,t,a,i)=>{let l=e||"";typeof l=="object"&&(l=l[0]);const s=R();if(j(s.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),L.debug("vertexText"+l);const r=await we(xt(l)),n={isNode:i,label:r,labelStyle:t.replace("fill:","color:")};return Vt(n,s)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?n=l:n=[];for(const c of n){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),a?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=c.trim(),r.appendChild(u)}return r}},"createLabel"),K=ir,nr=d((e,t,a,i,l)=>{t.arrowTypeStart&&Ot(e,"start",t.arrowTypeStart,a,i,l),t.arrowTypeEnd&&Ot(e,"end",t.arrowTypeEnd,a,i,l)},"addEdgeMarkers"),lr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Ot=d((e,t,a,i,l,s)=>{const r=lr[a];if(!r){L.warn(`Unknown arrow type: ${a}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${s}-${r}${n})`)},"addEdgeMarker"),Lt={},M={},cr=d(async(e,t)=>{const a=R(),i=j(a.flowchart.htmlLabels),l=t.labelType==="markdown"?Wt(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:!0},a):await K(t.label,t.labelStyle),s=e.insert("g").attr("class","edgeLabel"),r=s.insert("g").attr("class","label");r.node().appendChild(l);let n=l.getBBox();if(i){const u=l.children[0],o=O(l);n=u.getBoundingClientRect(),o.attr("width",n.width),o.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Lt[t.id]=s,t.width=n.width,t.height=n.height;let c;if(t.startLabelLeft){const u=await K(t.startLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startLeft=o,tt(c,t.startLabelLeft)}if(t.startLabelRight){const u=await K(t.startLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=o.node().appendChild(u),x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),M[t.id]||(M[t.id]={}),M[t.id].startRight=o,tt(c,t.startLabelRight)}if(t.endLabelLeft){const u=await K(t.endLabelLeft,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endLeft=o,tt(c,t.endLabelLeft)}if(t.endLabelRight){const u=await K(t.endLabelRight,t.labelStyle),o=e.insert("g").attr("class","edgeTerminals"),x=o.insert("g").attr("class","inner");c=x.node().appendChild(u);const w=u.getBBox();x.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),o.node().appendChild(u),M[t.id]||(M[t.id]={}),M[t.id].endRight=o,tt(c,t.endLabelRight)}return l},"insertEdgeLabel");function tt(e,t){R().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}d(tt,"setTerminalWidth");var or=d((e,t)=>{L.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let a=t.updatedPath?t.updatedPath:t.originalPath;const i=R(),{subGraphTitleTotalMargin:l}=ye(i);if(e.label){const s=Lt[e.id];let r=e.x,n=e.y;if(a){const c=$.calcLabelPosition(a);L.debug("Moving label "+e.label+" from (",r,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(r=c.x,n=c.y)}s.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){const s=M[e.id].startLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const s=M[e.id].startRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const s=M[e.id].endLeft;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const s=M[e.id].endRight;let r=e.x,n=e.y;if(a){const c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",a);r=c.x,n=c.y}s.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),hr=d((e,t)=>{const a=e.x,i=e.y,l=Math.abs(t.x-a),s=Math.abs(t.y-i),r=e.width/2,n=e.height/2;return l>=r||s>=n},"outsideNode"),dr=d((e,t,a)=>{L.debug(`intersection calc abc89:
|
|
120
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
121
|
+
insidePoint : ${JSON.stringify(a)}
|
|
122
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,l=e.y,s=Math.abs(i-a.x),r=e.width/2;let n=a.x<t.x?r-s:r+s;const c=e.height/2,u=Math.abs(t.y-a.y),o=Math.abs(t.x-a.x);if(Math.abs(l-t.y)*r>Math.abs(i-t.x)*c){let x=a.y<t.y?t.y-c-l:l-c-t.y;n=o*x/u;const w={x:a.x<t.x?a.x+n:a.x-o+n,y:a.y<t.y?a.y+u-x:a.y-u+x};return n===0&&(w.x=t.x,w.y=t.y),o===0&&(w.x=t.x),u===0&&(w.y=t.y),L.debug(`abc89 topp/bott calc, Q ${u}, q ${x}, R ${o}, r ${n}`,w),w}else{a.x<t.x?n=t.x-r-i:n=i-r-t.x;let x=u*n/o,w=a.x<t.x?a.x+o-n:a.x-o+n,b=a.y<t.y?a.y+x:a.y-x;return L.debug(`sides calc abc89, Q ${u}, q ${x}, R ${o}, r ${n}`,{_x:w,_y:b}),n===0&&(w=t.x,b=t.y),o===0&&(w=t.x),u===0&&(b=t.y),{x:w,y:b}}},"intersection"),Rt=d((e,t)=>{L.debug("abc88 cutPathAtIntersect",e,t);let a=[],i=e[0],l=!1;return e.forEach(s=>{if(!hr(t,s)&&!l){const r=dr(t,i,s);let n=!1;a.forEach(c=>{n=n||c.x===r.x&&c.y===r.y}),a.some(c=>c.x===r.x&&c.y===r.y)||a.push(r),l=!0}else i=s,l||a.push(s)}),a},"cutPathAtIntersect"),gr=d(function(e,t,a,i,l,s,r){let n=a.points;L.debug("abc88 InsertEdge: edge=",a,"e=",t);let c=!1;const u=s.node(t.v);var o=s.node(t.w);o?.intersect&&u?.intersect&&(n=n.slice(1,a.points.length-1),n.unshift(u.intersect(n[0])),n.push(o.intersect(n[n.length-1]))),a.toCluster&&(L.debug("to cluster abc88",i[a.toCluster]),n=Rt(a.points,i[a.toCluster].node),c=!0),a.fromCluster&&(L.debug("from cluster abc88",i[a.fromCluster]),n=Rt(n.reverse(),i[a.fromCluster].node).reverse(),c=!0);const x=n.filter(y=>!Number.isNaN(y.y));let w=fe;a.curve&&(l==="graph"||l==="flowchart")&&(w=a.curve);const{x:b,y:S}=ue(a),v=pe().x(b).y(S).curve(w);let k;switch(a.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-thick";break;default:k=""}switch(a.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break}const B=e.append("path").attr("d",v(x)).attr("id",a.id).attr("class"," "+k+(a.classes?" "+a.classes:"")).attr("style",a.style);let _="";(R().flowchart.arrowMarkerAbsolute||R().state.arrowMarkerAbsolute)&&(_=xe(!0)),nr(B,a,_,r,l);let D={};return c&&(D.updatedPath=n),D.originalPath=a.points,D},"insertEdge"),ur=d(e=>{const t=new Set;for(const a of e)switch(a){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(a);break}return t},"expandAndDeduplicateDirections"),pr=d((e,t,a)=>{const i=ur(e),l=2,s=t.height+2*a.padding,r=s/l,n=t.width+2*r+a.padding,c=a.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:r,y:0},{x:n/2,y:2*c},{x:n-r,y:0},{x:n,y:0},{x:n,y:-s/3},{x:n+2*c,y:-s/2},{x:n,y:-2*s/3},{x:n,y:-s},{x:n-r,y:-s},{x:n/2,y:-s-2*c},{x:r,y:-s},{x:0,y:-s},{x:0,y:-2*s/3},{x:-2*c,y:-s/2},{x:0,y:-s/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:r,y:-s},{x:n-r,y:-s},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-s+r},{x:0,y:-s}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-s+r},{x:n,y:-s}]:i.has("right")&&i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-s}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-s}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-s}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-s}]:i.has("right")?[{x:r,y:-c},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s+c}]:i.has("left")?[{x:r,y:0},{x:r,y:-c},{x:n-r,y:-c},{x:n-r,y:-s+c},{x:r,y:-s+c},{x:r,y:-s},{x:0,y:-s/2}]:i.has("up")?[{x:r,y:-c},{x:r,y:-s+c},{x:0,y:-s+c},{x:n/2,y:-s},{x:n,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-c},{x:r,y:-c},{x:r,y:-s+c},{x:n-r,y:-s+c},{x:n-r,y:-c},{x:n,y:-c}]:[{x:0,y:0}]},"getArrowPoints");function Gt(e,t){return e.intersect(t)}d(Gt,"intersectNode");var fr=Gt;function Zt(e,t,a,i){var l=e.x,s=e.y,r=l-i.x,n=s-i.y,c=Math.sqrt(t*t*n*n+a*a*r*r),u=Math.abs(t*a*r/c);i.x<l&&(u=-u);var o=Math.abs(t*a*n/c);return i.y<s&&(o=-o),{x:l+u,y:s+o}}d(Zt,"intersectEllipse");var qt=Zt;function Jt(e,t,a){return qt(e,t,t,a)}d(Jt,"intersectCircle");var xr=Jt;function Qt(e,t,a,i){var l,s,r,n,c,u,o,x,w,b,S,v,k,B,_;if(l=t.y-e.y,r=e.x-t.x,c=t.x*e.y-e.x*t.y,w=l*a.x+r*a.y+c,b=l*i.x+r*i.y+c,!(w!==0&&b!==0&&St(w,b))&&(s=i.y-a.y,n=a.x-i.x,u=i.x*a.y-a.x*i.y,o=s*e.x+n*e.y+u,x=s*t.x+n*t.y+u,!(o!==0&&x!==0&&St(o,x))&&(S=l*n-s*r,S!==0)))return v=Math.abs(S/2),k=r*u-n*c,B=k<0?(k-v)/S:(k+v)/S,k=s*c-l*u,_=k<0?(k-v)/S:(k+v)/S,{x:B,y:_}}d(Qt,"intersectLine");function St(e,t){return e*t>0}d(St,"sameSign");var yr=Qt,br=$t;function $t(e,t,a){var i=e.x,l=e.y,s=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(S){r=Math.min(r,S.x),n=Math.min(n,S.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-r,u=l-e.height/2-n,o=0;o<t.length;o++){var x=t[o],w=t[o<t.length-1?o+1:0],b=yr(e,a,{x:c+x.x,y:u+x.y},{x:c+w.x,y:u+w.y});b&&s.push(b)}return s.length?(s.length>1&&s.sort(function(S,v){var k=S.x-a.x,B=S.y-a.y,_=Math.sqrt(k*k+B*B),D=v.x-a.x,y=v.y-a.y,g=Math.sqrt(D*D+y*y);return _<g?-1:_===g?0:1}),s[0]):e}d($t,"intersectPolygon");var wr=d((e,t)=>{var a=e.x,i=e.y,l=t.x-a,s=t.y-i,r=e.width/2,n=e.height/2,c,u;return Math.abs(s)*r>Math.abs(l)*n?(s<0&&(n=-n),c=s===0?0:n*l/s,u=n):(l<0&&(r=-r),c=r,u=l===0?0:r*s/l),{x:a+c,y:i+u}},"intersectRect"),mr=wr,N={node:fr,circle:xr,ellipse:qt,polygon:br,rect:mr},A=d(async(e,t,a,i)=>{const l=R();let s;const r=t.useHtmlLabels||j(l.flowchart.htmlLabels);a?s=a:s="node default";const n=e.insert("g").attr("class",s).attr("id",t.domId||t.id),c=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];const o=c.node();let x;t.labelType==="markdown"?x=Wt(c,yt(xt(u),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):x=o.appendChild(await K(yt(xt(u),l),t.labelStyle,!1,i));let w=x.getBBox();const b=t.padding/2;if(j(l.flowchart.htmlLabels)){const S=x.children[0],v=O(x),k=S.getElementsByTagName("img");if(k){const B=u.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(_=>new Promise(D=>{function y(){if(_.style.display="flex",_.style.flexDirection="column",B){const g=l.fontSize?l.fontSize:window.getComputedStyle(document.body).fontSize,m=parseInt(g,10)*5+"px";_.style.minWidth=m,_.style.maxWidth=m}else _.style.width="100%";D(_)}d(y,"setupImage"),setTimeout(()=>{_.complete&&y()}),_.addEventListener("error",y),_.addEventListener("load",y)})))}w=S.getBoundingClientRect(),v.attr("width",w.width),v.attr("height",w.height)}return r?c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"):c.attr("transform","translate(0, "+-w.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-w.width/2+", "+-w.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:n,bbox:w,halfPadding:b,label:c}},"labelHelper"),T=d((e,t)=>{const a=t.node().getBBox();e.width=a.width,e.height=a.height},"updateNodeBounds");function U(e,t,a,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+a/2+")")}d(U,"insertPolygonShape");var Lr=d(async(e,t)=>{t.useHtmlLabels||R().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:i,bbox:l,halfPadding:s}=await A(e,t,"node "+t.classes,!0);L.info("Classes = ",t.classes);const r=i.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-l.width/2-s).attr("y",-l.height/2-s).attr("width",l.width+t.padding).attr("height",l.height+t.padding),T(t,r),t.intersect=function(n){return N.rect(t,n)},i},"note"),Sr=Lr,zt=d(e=>e?" "+e:"","formatClass"),Y=d((e,t)=>`${t||"node default"}${zt(e.classes)} ${zt(e.class)}`,"getClassesFromNode"),At=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=l+s,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];L.info("Question main (Circle)");const c=U(a,r,r,n);return c.attr("style",t.style),T(t,c),t.intersect=function(u){return L.warn("Intersect called"),N.polygon(t,n,u)},a},"question"),kr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return a.insert("polygon",":first-child").attr("points",l.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return N.circle(t,14,r)},a},"choice"),vr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=4,s=i.height+t.padding,r=s/l,n=i.width+2*r+t.padding,c=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-s/2},{x:n-r,y:-s},{x:r,y:-s},{x:0,y:-s/2}],u=U(a,n,s,c);return u.attr("style",t.style),T(t,u),t.intersect=function(o){return N.polygon(t,c,o)},a},"hexagon"),Er=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,void 0,!0),l=2,s=i.height+2*t.padding,r=s/l,n=i.width+2*r+t.padding,c=pr(t.directions,i,t),u=U(a,n,s,c);return u.attr("style",t.style),T(t,u),t.intersect=function(o){return N.polygon(t,c,o)},a},"block_arrow"),_r=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-s/2,y:0},{x:l,y:0},{x:l,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return U(a,l,s,r).attr("style",t.style),t.width=l+s,t.height=s,t.intersect=function(c){return N.polygon(t,r,c)},a},"rect_left_inv_arrow"),Dr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"lean_right"),Nr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:2*s/6,y:0},{x:l+s/6,y:0},{x:l-2*s/6,y:-s},{x:-s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"lean_left"),Tr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:-2*s/6,y:0},{x:l+2*s/6,y:0},{x:l-s/6,y:-s},{x:s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"trapezoid"),Br=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:s/6,y:0},{x:l-s/6,y:0},{x:l+2*s/6,y:-s},{x:-2*s/6,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"inv_trapezoid"),Cr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l+s/2,y:0},{x:l,y:-s/2},{x:l+s/2,y:-s},{x:0,y:-s}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"rect_right_inv_arrow"),Ir=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=l/2,r=s/(2.5+l/50),n=i.height+r+t.padding,c="M 0,"+r+" a "+s+","+r+" 0,0,0 "+l+" 0 a "+s+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+s+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,u=a.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-l/2+","+-(n/2+r)+")");return T(t,u),t.intersect=function(o){const x=N.rect(t,o),w=x.x-t.x;if(s!=0&&(Math.abs(w)<t.width/2||Math.abs(w)==t.width/2&&Math.abs(x.y-t.y)>t.height/2-r)){let b=r*r*(1-w*w/(s*s));b!=0&&(b=Math.sqrt(b)),b=r-b,o.y-t.y>0&&(b=-b),x.y+=b}return x},a},"cylinder"),Or=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes+" "+t.class,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return T(t,s),t.intersect=function(o){return N.rect(t,o)},a},"rect"),Rr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes,!0),s=a.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(s.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){const o=new Set(Object.keys(t.props));t.props.borders&&(ht(s,t.props.borders,r,n),o.delete("borders")),o.forEach(x=>{L.warn(`Unknown node property ${x}`)})}return T(t,s),t.intersect=function(o){return N.rect(t,o)},a},"composite"),zr=d(async(e,t)=>{const{shapeSvg:a}=await A(e,t,"label",!0);L.trace("Classes = ",t.class);const i=a.insert("rect",":first-child"),l=0,s=0;if(i.attr("width",l).attr("height",s),a.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ht(i,t.props.borders,l,s),r.delete("borders")),r.forEach(n=>{L.warn(`Unknown node property ${n}`)})}return T(t,i),t.intersect=function(r){return N.rect(t,r)},a},"labelRect");function ht(e,t,a,i){const l=[],s=d(n=>{l.push(n,0)},"addBorder"),r=d(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(L.debug("add top border"),s(a)):r(a),t.includes("r")?(L.debug("add right border"),s(i)):r(i),t.includes("b")?(L.debug("add bottom border"),s(a)):r(a),t.includes("l")?(L.debug("add left border"),s(i)):r(i),e.attr("stroke-dasharray",l.join(" "))}d(ht,"applyNodePropertyBorders");var Ar=d(async(e,t)=>{let a;t.classes?a="node "+t.classes:a="node default";const i=e.insert("g").attr("class",a).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),s=i.insert("line"),r=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let c="";typeof n=="object"?c=n[0]:c=n,L.info("Label text abc79",c,n,typeof n=="object");const u=r.node().appendChild(await K(c,t.labelStyle,!0,!0));let o={width:0,height:0};if(j(R().flowchart.htmlLabels)){const v=u.children[0],k=O(u);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}L.info("Text 2",n);const x=n.slice(1,n.length);let w=u.getBBox();const b=r.node().appendChild(await K(x.join?x.join("<br/>"):x,t.labelStyle,!0,!0));if(j(R().flowchart.htmlLabels)){const v=b.children[0],k=O(b);o=v.getBoundingClientRect(),k.attr("width",o.width),k.attr("height",o.height)}const S=t.padding/2;return O(b).attr("transform","translate( "+(o.width>w.width?0:(w.width-o.width)/2)+", "+(w.height+S+5)+")"),O(u).attr("transform","translate( "+(o.width<w.width?0:-(w.width-o.width)/2)+", 0)"),o=r.node().getBBox(),r.attr("transform","translate("+-o.width/2+", "+(-o.height/2-S+3)+")"),l.attr("class","outer title-state").attr("x",-o.width/2-S).attr("y",-o.height/2-S).attr("width",o.width+t.padding).attr("height",o.height+t.padding),s.attr("class","divider").attr("x1",-o.width/2-S).attr("x2",o.width/2+S).attr("y1",-o.height/2-S+w.height+S).attr("y2",-o.height/2-S+w.height+S),T(t,l),t.intersect=function(v){return N.rect(t,v)},i},"rectWithTitle"),Mr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.height+t.padding,s=i.width+l/4+t.padding,r=a.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-s/2).attr("y",-l/2).attr("width",s).attr("height",l);return T(t,r),t.intersect=function(n){return N.rect(t,n)},a},"stadium"),Fr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=a.insert("circle",":first-child");return s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),L.info("Circle main"),T(t,s),t.intersect=function(r){return L.info("Circle intersect",t,i.width/2+l,r),N.circle(t,i.width/2+l,r)},a},"circle"),Wr=d(async(e,t)=>{const{shapeSvg:a,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),s=5,r=a.insert("g",":first-child"),n=r.insert("circle"),c=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+s).attr("width",i.width+t.padding+s*2).attr("height",i.height+t.padding+s*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),L.info("DoubleCircle main"),T(t,n),t.intersect=function(u){return L.info("DoubleCircle intersect",t,i.width/2+l+s,u),N.circle(t,i.width/2+l+s,u)},a},"doublecircle"),Pr=d(async(e,t)=>{const{shapeSvg:a,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,s=i.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],n=U(a,l,s,r);return n.attr("style",t.style),T(t,n),t.intersect=function(c){return N.polygon(t,r,c)},a},"subroutine"),Yr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),T(t,i),t.intersect=function(l){return N.circle(t,7,l)},a},"start"),Mt=d((e,t,a)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,s=10;a==="LR"&&(l=10,s=70);const r=i.append("rect").attr("x",-1*l/2).attr("y",-1*s/2).attr("width",l).attr("height",s).attr("class","fork-join");return T(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return N.rect(t,n)},i},"forkJoin"),Hr=d((e,t)=>{const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=a.insert("circle",":first-child"),l=a.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),T(t,l),t.intersect=function(s){return N.circle(t,7,s)},a},"end"),Kr=d(async(e,t)=>{const a=t.padding/2,i=4,l=8;let s;t.classes?s="node "+t.classes:s="node default";const r=e.insert("g").attr("class",s).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),c=r.insert("line"),u=r.insert("line");let o=0,x=i;const w=r.insert("g").attr("class","label");let b=0;const S=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",k=w.node().appendChild(await K(v,t.labelStyle,!0,!0));let B=k.getBBox();if(j(R().flowchart.htmlLabels)){const E=k.children[0],h=O(k);B=E.getBoundingClientRect(),h.attr("width",B.width),h.attr("height",B.height)}t.classData.annotations[0]&&(x+=B.height+i,o+=B.width);let _=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(R().flowchart.htmlLabels?_+="<"+t.classData.type+">":_+="<"+t.classData.type+">");const D=w.node().appendChild(await K(_,t.labelStyle,!0,!0));O(D).attr("class","classTitle");let y=D.getBBox();if(j(R().flowchart.htmlLabels)){const E=D.children[0],h=O(D);y=E.getBoundingClientRect(),h.attr("width",y.width),h.attr("height",y.height)}x+=y.height+i,y.width>o&&(o=y.width);const g=[];t.classData.members.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(/</g,"<").replace(/>/g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,g.push(p)}),x+=l;const f=[];if(t.classData.methods.forEach(async E=>{const h=E.getDisplayDetails();let W=h.displayText;R().flowchart.htmlLabels&&(W=W.replace(/</g,"<").replace(/>/g,">"));const p=w.node().appendChild(await K(W,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let I=p.getBBox();if(j(R().flowchart.htmlLabels)){const Z=p.children[0],V=O(p);I=Z.getBoundingClientRect(),V.attr("width",I.width),V.attr("height",I.height)}I.width>o&&(o=I.width),x+=I.height+i,f.push(p)}),x+=l,S){let E=(o-B.width)/2;O(k).attr("transform","translate( "+(-1*o/2+E)+", "+-1*x/2+")"),b=B.height+i}let m=(o-y.width)/2;return O(D).attr("transform","translate( "+(-1*o/2+m)+", "+(-1*x/2+b)+")"),b+=y.height+i,c.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,g.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b+l/2)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),b+=l,u.attr("class","divider").attr("x1",-o/2-a).attr("x2",o/2+a).attr("y1",-x/2-a+l+b).attr("y2",-x/2-a+l+b),b+=l,f.forEach(E=>{O(E).attr("transform","translate( "+-o/2+", "+(-1*x/2+b)+")");const h=E?.getBBox();b+=(h?.height??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-o/2-a).attr("y",-(x/2)-a).attr("width",o+t.padding).attr("height",x+t.padding),T(t,n),t.intersect=function(E){return N.rect(t,E)},r},"class_box"),Ft={rhombus:At,composite:Rr,question:At,rect:Or,labelRect:zr,rectWithTitle:Ar,choice:kr,circle:Fr,doublecircle:Wr,stadium:Mr,hexagon:vr,block_arrow:Er,rect_left_inv_arrow:_r,lean_right:Dr,lean_left:Nr,trapezoid:Tr,inv_trapezoid:Br,rect_right_inv_arrow:Cr,cylinder:Ir,start:Yr,end:Hr,note:Sr,subroutine:Pr,fork:Mt,join:Mt,class_box:Kr},lt={},te=d(async(e,t,a)=>{let i,l;if(t.link){let s;R().securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s),l=await Ft[t.shape](i,t,a)}else l=await Ft[t.shape](e,t,a),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),lt[t.id]=i,t.haveCallback&<[t.id].attr("class",lt[t.id].attr("class")+" clickable"),i},"insertNode"),Xr=d(e=>{const t=lt[e.id];L.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const a=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-a)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Dt(e,t,a=!1){const i=e;let l="default";(i?.classes?.length||0)>0&&(l=(i?.classes??[]).join(" ")),l=l+" flowchart-label";let s=0,r="",n;switch(i.type){case"round":s=5,r="rect";break;case"composite":s=0,r="composite",n=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const c=me(i?.styles??[]),u=i.label,o=i.size??{width:0,height:0,x:0,y:0};return{labelStyle:c.labelStyle,shape:r,labelText:u,rx:s,ry:s,class:l,style:c.style,id:i.id,directions:i.directions,width:o.width,height:o.height,x:o.x,y:o.y,positioned:a,intersect:void 0,type:i.type,padding:n??rt()?.block?.padding??0}}d(Dt,"getNodeFromBlock");async function ee(e,t,a){const i=Dt(t,a,!1);if(i.type==="group")return;const l=rt(),s=await te(e,i,{config:l}),r=s.node().getBBox(),n=a.getBlock(i.id);n.size={width:r.width,height:r.height,x:0,y:0,node:s},a.setBlock(n),s.remove()}d(ee,"calculateBlockSize");async function re(e,t,a){const i=Dt(t,a,!0);if(a.getBlock(i.id).type!=="space"){const s=rt();await te(e,i,{config:s}),t.intersect=i?.intersect,Xr(i)}}d(re,"insertBlockPositioned");async function dt(e,t,a,i){for(const l of t)await i(e,l,a),l.children&&await dt(e,l.children,a,i)}d(dt,"performOperations");async function ae(e,t,a){await dt(e,t,a,ee)}d(ae,"calculateBlockSizes");async function se(e,t,a){await dt(e,t,a,re)}d(se,"insertBlocks");async function ie(e,t,a,i,l){const s=new Se({multigraph:!0,compound:!0});s.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of a)r.size&&s.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=i.getBlock(r.start),c=i.getBlock(r.end);if(n?.size&&c?.size){const u=n.size,o=c.size,x=[{x:u.x,y:u.y},{x:u.x+(o.x-u.x)/2,y:u.y+(o.y-u.y)/2},{x:o.x,y:o.y}];gr(e,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",s,l),r.label&&(await cr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),or({...r,x:x[1].x,y:x[1].y},{originalPath:x}))}}}d(ie,"insertEdges");var Ur=d(function(e,t){return t.db.getClasses()},"getClasses"),jr=d(async function(e,t,a,i){const{securityLevel:l,block:s}=rt(),r=i.db;let n;l==="sandbox"&&(n=O("#i"+t));const c=l==="sandbox"?O(n.nodes()[0].contentDocument.body):O("body"),u=l==="sandbox"?c.select(`[id="${t}"]`):O(`[id="${t}"]`);ar(u,["point","circle","cross"],i.type,t);const x=r.getBlocks(),w=r.getBlocksFlat(),b=r.getEdges(),S=u.insert("g").attr("class","block");await ae(S,x,r);const v=jt(r);if(await se(S,x,r),await ie(S,b,w,r,t),v){const k=v,B=Math.max(1,Math.round(.125*(k.width/k.height))),_=k.height+B+10,D=k.width+10,{useMaxWidth:y}=s;he(u,_,D,!!y),L.debug("Here Bounds",v,k),u.attr("viewBox",`${k.x-5} ${k.y-5} ${k.width+10} ${k.height+10}`)}},"draw"),Vr={draw:jr,getClasses:Ur},ea={parser:ve,db:Ke,renderer:Vr,styles:Ue};export{ea as diagram};
|