schematex 0.9.3 → 0.9.4
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 +21 -2
- package/README.zh-CN.md +2 -2
- package/dist/ai/ai-sdk.cjs +23 -23
- package/dist/ai/ai-sdk.d.cts +3 -3
- package/dist/ai/ai-sdk.d.ts +3 -3
- package/dist/ai/ai-sdk.js +18 -18
- package/dist/ai/index.cjs +32 -32
- package/dist/ai/index.d.cts +4 -4
- package/dist/ai/index.d.ts +4 -4
- package/dist/ai/index.js +19 -19
- package/dist/{api-DXOhuK3e.d.ts → api-1xoGiseb.d.cts} +2 -2
- package/dist/{api-B7C7qGiG.d.cts → api-CgXRSnCn.d.ts} +2 -2
- package/dist/browser.cjs +24 -24
- package/dist/browser.d.cts +3 -3
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +18 -18
- package/dist/{chunk-C2BNO3CI.cjs → chunk-35NGXDT2.cjs} +12 -12
- package/dist/{chunk-C2BNO3CI.cjs.map → chunk-35NGXDT2.cjs.map} +1 -1
- package/dist/{chunk-ZUK4BY55.js → chunk-3J4DZPZC.js} +3 -3
- package/dist/{chunk-ZUK4BY55.js.map → chunk-3J4DZPZC.js.map} +1 -1
- package/dist/{chunk-JEQGWH5N.js → chunk-3PH2MQGN.js} +3 -3
- package/dist/{chunk-JEQGWH5N.js.map → chunk-3PH2MQGN.js.map} +1 -1
- package/dist/{chunk-ZQECHIBI.js → chunk-3WX24RCH.js} +3 -3
- package/dist/{chunk-ZQECHIBI.js.map → chunk-3WX24RCH.js.map} +1 -1
- package/dist/{chunk-ATE7LD6I.cjs → chunk-4AC6I7KJ.cjs} +4 -4
- package/dist/{chunk-ATE7LD6I.cjs.map → chunk-4AC6I7KJ.cjs.map} +1 -1
- package/dist/{chunk-D4QZ6UDO.js → chunk-4MRVJI7G.js} +110 -3
- package/dist/chunk-4MRVJI7G.js.map +1 -0
- package/dist/{chunk-VOFND6ZQ.cjs → chunk-4OC3CTGE.cjs} +4 -4
- package/dist/{chunk-VOFND6ZQ.cjs.map → chunk-4OC3CTGE.cjs.map} +1 -1
- package/dist/{chunk-VG5LP5A4.cjs → chunk-5ZQRHDMQ.cjs} +4 -4
- package/dist/{chunk-VG5LP5A4.cjs.map → chunk-5ZQRHDMQ.cjs.map} +1 -1
- package/dist/{chunk-6W6RFZND.cjs → chunk-627GHE2N.cjs} +5 -5
- package/dist/{chunk-6W6RFZND.cjs.map → chunk-627GHE2N.cjs.map} +1 -1
- package/dist/{chunk-TDSGQT7R.js → chunk-64LABNTF.js} +3 -3
- package/dist/{chunk-TDSGQT7R.js.map → chunk-64LABNTF.js.map} +1 -1
- package/dist/{chunk-AEZVCGH4.cjs → chunk-6QZQTASC.cjs} +12 -12
- package/dist/{chunk-AEZVCGH4.cjs.map → chunk-6QZQTASC.cjs.map} +1 -1
- package/dist/{chunk-FFAJQ36U.cjs → chunk-6ZD7TCWO.cjs} +15 -15
- package/dist/{chunk-FFAJQ36U.cjs.map → chunk-6ZD7TCWO.cjs.map} +1 -1
- package/dist/{chunk-PUD7PIY5.js → chunk-AXMBXAEA.js} +3 -3
- package/dist/{chunk-PUD7PIY5.js.map → chunk-AXMBXAEA.js.map} +1 -1
- package/dist/{chunk-X3GEGVW2.js → chunk-B4CMWA6Y.js} +3 -3
- package/dist/{chunk-X3GEGVW2.js.map → chunk-B4CMWA6Y.js.map} +1 -1
- package/dist/{chunk-O6A2GJLI.cjs → chunk-C4Y24X3U.cjs} +4 -4
- package/dist/{chunk-O6A2GJLI.cjs.map → chunk-C4Y24X3U.cjs.map} +1 -1
- package/dist/{chunk-CAAMBDEN.cjs → chunk-ENUM7GMZ.cjs} +110 -2
- package/dist/chunk-ENUM7GMZ.cjs.map +1 -0
- package/dist/{chunk-IOD2EFMX.cjs → chunk-GAQ36VFD.cjs} +4 -4
- package/dist/{chunk-IOD2EFMX.cjs.map → chunk-GAQ36VFD.cjs.map} +1 -1
- package/dist/{chunk-AHSSFGDJ.cjs → chunk-GTCAJPQR.cjs} +1738 -217
- package/dist/chunk-GTCAJPQR.cjs.map +1 -0
- package/dist/{chunk-6GHXO3WQ.js → chunk-GYYYULBL.js} +3 -3
- package/dist/{chunk-6GHXO3WQ.js.map → chunk-GYYYULBL.js.map} +1 -1
- package/dist/{chunk-IU26USXA.cjs → chunk-INVLJYAE.cjs} +4 -4
- package/dist/{chunk-IU26USXA.cjs.map → chunk-INVLJYAE.cjs.map} +1 -1
- package/dist/{chunk-BXS53MLV.cjs → chunk-ITI3STJ6.cjs} +4 -4
- package/dist/{chunk-BXS53MLV.cjs.map → chunk-ITI3STJ6.cjs.map} +1 -1
- package/dist/{chunk-XAYD5NVJ.js → chunk-JEMAOC2D.js} +3 -3
- package/dist/{chunk-XAYD5NVJ.js.map → chunk-JEMAOC2D.js.map} +1 -1
- package/dist/{chunk-PZCYFT2A.js → chunk-M26ORU4P.js} +3 -3
- package/dist/{chunk-PZCYFT2A.js.map → chunk-M26ORU4P.js.map} +1 -1
- package/dist/{chunk-JCJWSW5Y.js → chunk-NIYB6CHH.js} +326 -4
- package/dist/chunk-NIYB6CHH.js.map +1 -0
- package/dist/{chunk-U4AJLMHC.js → chunk-NKYR4PAS.js} +3 -3
- package/dist/{chunk-U4AJLMHC.js.map → chunk-NKYR4PAS.js.map} +1 -1
- package/dist/{chunk-TFNH2NLJ.cjs → chunk-OJ3P4IC4.cjs} +4 -4
- package/dist/{chunk-TFNH2NLJ.cjs.map → chunk-OJ3P4IC4.cjs.map} +1 -1
- package/dist/{chunk-7P4C5DMD.js → chunk-PFZKW3HE.js} +3 -3
- package/dist/chunk-PFZKW3HE.js.map +1 -0
- package/dist/{chunk-QHZEGWE7.js → chunk-RDYACU2G.js} +3 -3
- package/dist/{chunk-QHZEGWE7.js.map → chunk-RDYACU2G.js.map} +1 -1
- package/dist/{chunk-UNLLWCQK.js → chunk-SXOAAQNY.js} +3 -3
- package/dist/{chunk-UNLLWCQK.js.map → chunk-SXOAAQNY.js.map} +1 -1
- package/dist/{chunk-LFJE64RD.cjs → chunk-TX3YWZZX.cjs} +328 -6
- package/dist/chunk-TX3YWZZX.cjs.map +1 -0
- package/dist/{chunk-BP6MLXJU.js → chunk-UFXDAIDD.js} +1552 -31
- package/dist/chunk-UFXDAIDD.js.map +1 -0
- package/dist/{chunk-MZWVJFTV.cjs → chunk-VY6UZYYL.cjs} +15 -15
- package/dist/{chunk-MZWVJFTV.cjs.map → chunk-VY6UZYYL.cjs.map} +1 -1
- package/dist/{chunk-Y4OBXYGW.cjs → chunk-VYQXB2RC.cjs} +12 -12
- package/dist/{chunk-Y4OBXYGW.cjs.map → chunk-VYQXB2RC.cjs.map} +1 -1
- package/dist/{chunk-JYAL26WQ.cjs → chunk-WJXLF42K.cjs} +4 -4
- package/dist/chunk-WJXLF42K.cjs.map +1 -0
- package/dist/{chunk-OND4N5ZZ.js → chunk-XCCXG6RR.js} +3 -3
- package/dist/{chunk-OND4N5ZZ.js.map → chunk-XCCXG6RR.js.map} +1 -1
- package/dist/{chunk-4CLAD7VZ.js → chunk-ZCHGIWJK.js} +3 -3
- package/dist/{chunk-4CLAD7VZ.js.map → chunk-ZCHGIWJK.js.map} +1 -1
- package/dist/{diagnostics-fyjWjeDa.d.ts → diagnostics-CDwnQ65n.d.cts} +1 -1
- package/dist/{diagnostics-fyjWjeDa.d.cts → diagnostics-CDwnQ65n.d.ts} +1 -1
- package/dist/diagrams/blockdiagram/index.cjs +6 -6
- package/dist/diagrams/blockdiagram/index.d.cts +1 -1
- package/dist/diagrams/blockdiagram/index.d.ts +1 -1
- package/dist/diagrams/blockdiagram/index.js +2 -2
- package/dist/diagrams/circuit/index.cjs +9 -9
- package/dist/diagrams/circuit/index.d.cts +1 -1
- package/dist/diagrams/circuit/index.d.ts +1 -1
- package/dist/diagrams/circuit/index.js +2 -2
- package/dist/diagrams/ecomap/index.cjs +7 -7
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/ecomap/index.js +2 -2
- package/dist/diagrams/entity/index.cjs +6 -6
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/entity/index.js +2 -2
- package/dist/diagrams/fishbone/index.cjs +8 -8
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/fishbone/index.js +2 -2
- package/dist/diagrams/flowchart/index.cjs +8 -8
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/flowchart/index.js +2 -2
- package/dist/diagrams/genogram/index.cjs +9 -9
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/genogram/index.js +2 -2
- package/dist/diagrams/ladder/index.cjs +6 -6
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.js +2 -2
- package/dist/diagrams/logic/index.cjs +8 -8
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/logic/index.js +2 -2
- package/dist/diagrams/orgchart/index.cjs +8 -8
- package/dist/diagrams/orgchart/index.d.cts +1 -1
- package/dist/diagrams/orgchart/index.d.ts +1 -1
- package/dist/diagrams/orgchart/index.js +2 -2
- package/dist/diagrams/pedigree/index.cjs +7 -7
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/pedigree/index.js +2 -2
- package/dist/diagrams/phylo/index.cjs +7 -7
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.js +2 -2
- package/dist/diagrams/sld/index.cjs +8 -8
- package/dist/diagrams/sld/index.d.cts +1 -1
- package/dist/diagrams/sld/index.d.ts +1 -1
- package/dist/diagrams/sld/index.js +2 -2
- package/dist/diagrams/sociogram/index.cjs +6 -6
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/sociogram/index.js +2 -2
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/venn/index.cjs +9 -9
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/diagrams/venn/index.js +2 -2
- package/dist/{index-CFaKjWPy.d.ts → index-CYSH3_ca.d.ts} +1 -1
- package/dist/{index-DZNmJWGg.d.cts → index-DNOoLmYX.d.cts} +1 -1
- package/dist/index.cjs +86 -86
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +22 -22
- package/dist/react.cjs +18 -18
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +17 -17
- package/dist/{tools-BDNih0Mb.d.ts → tools-BhTti-oG.d.ts} +3 -3
- package/dist/{tools-C23t_WeN.d.cts → tools-CbYmQ3hH.d.cts} +3 -3
- package/package.json +1 -1
- package/dist/chunk-7P4C5DMD.js.map +0 -1
- package/dist/chunk-AHSSFGDJ.cjs.map +0 -1
- package/dist/chunk-BP6MLXJU.js.map +0 -1
- package/dist/chunk-CAAMBDEN.cjs.map +0 -1
- package/dist/chunk-D4QZ6UDO.js.map +0 -1
- package/dist/chunk-JCJWSW5Y.js.map +0 -1
- package/dist/chunk-JYAL26WQ.cjs.map +0 -1
- package/dist/chunk-LFJE64RD.cjs.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
3
|
+
var chunk4OC3CTGE_cjs = require('./chunk-4OC3CTGE.cjs');
|
|
4
|
+
var chunk4AC6I7KJ_cjs = require('./chunk-4AC6I7KJ.cjs');
|
|
5
|
+
var chunkC4Y24X3U_cjs = require('./chunk-C4Y24X3U.cjs');
|
|
6
|
+
var chunkINVLJYAE_cjs = require('./chunk-INVLJYAE.cjs');
|
|
7
|
+
var chunkWJXLF42K_cjs = require('./chunk-WJXLF42K.cjs');
|
|
8
|
+
var chunkGAQ36VFD_cjs = require('./chunk-GAQ36VFD.cjs');
|
|
9
|
+
var chunk627GHE2N_cjs = require('./chunk-627GHE2N.cjs');
|
|
10
|
+
var chunkITI3STJ6_cjs = require('./chunk-ITI3STJ6.cjs');
|
|
11
|
+
var chunkOJ3P4IC4_cjs = require('./chunk-OJ3P4IC4.cjs');
|
|
12
|
+
var chunkVY6UZYYL_cjs = require('./chunk-VY6UZYYL.cjs');
|
|
13
|
+
var chunkVYQXB2RC_cjs = require('./chunk-VYQXB2RC.cjs');
|
|
14
|
+
var chunk6QZQTASC_cjs = require('./chunk-6QZQTASC.cjs');
|
|
15
15
|
var chunk3KRL2EGN_cjs = require('./chunk-3KRL2EGN.cjs');
|
|
16
|
-
var
|
|
17
|
-
var
|
|
16
|
+
var chunk6ZD7TCWO_cjs = require('./chunk-6ZD7TCWO.cjs');
|
|
17
|
+
var chunk35NGXDT2_cjs = require('./chunk-35NGXDT2.cjs');
|
|
18
18
|
var chunkJHJJT5H5_cjs = require('./chunk-JHJJT5H5.cjs');
|
|
19
|
-
var
|
|
20
|
-
var
|
|
19
|
+
var chunk5ZQRHDMQ_cjs = require('./chunk-5ZQRHDMQ.cjs');
|
|
20
|
+
var chunkENUM7GMZ_cjs = require('./chunk-ENUM7GMZ.cjs');
|
|
21
21
|
var chunkVHDSPI6A_cjs = require('./chunk-VHDSPI6A.cjs');
|
|
22
22
|
var chunk3WNW5Y7P_cjs = require('./chunk-3WNW5Y7P.cjs');
|
|
23
23
|
|
|
@@ -1211,7 +1211,7 @@ function round2(n) {
|
|
|
1211
1211
|
return Math.round(n * 100) / 100;
|
|
1212
1212
|
}
|
|
1213
1213
|
function renderInfluence(ast, config) {
|
|
1214
|
-
const t =
|
|
1214
|
+
const t = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
1215
1215
|
const layout = layoutInfluence(ast);
|
|
1216
1216
|
const titleOffset = ast.title ? 36 : 10;
|
|
1217
1217
|
const width = Math.ceil(layout.width);
|
|
@@ -1577,7 +1577,7 @@ function wrapText(text2, maxChars) {
|
|
|
1577
1577
|
}
|
|
1578
1578
|
function renderDecisionTree(ast, config) {
|
|
1579
1579
|
if ("arcs" in ast) return renderInfluence(ast, config);
|
|
1580
|
-
const t =
|
|
1580
|
+
const t = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
1581
1581
|
const layout = layoutDecisionTree(ast);
|
|
1582
1582
|
const titleOffset = ast.title ? 36 : 10;
|
|
1583
1583
|
const width = Math.ceil(layout.width);
|
|
@@ -1878,7 +1878,7 @@ function parseTimeline(src) {
|
|
|
1878
1878
|
let i = 0;
|
|
1879
1879
|
let autoId = 0;
|
|
1880
1880
|
const nextId2 = (prefix) => `${prefix}-${++autoId}`;
|
|
1881
|
-
const
|
|
1881
|
+
const ordinal2 = { index: 0 };
|
|
1882
1882
|
const first = lines[0];
|
|
1883
1883
|
if (/^timeline\b/i.test(first.text)) {
|
|
1884
1884
|
const rest = first.text.replace(/^timeline\b/i, "").trim();
|
|
@@ -1949,7 +1949,7 @@ function parseTimeline(src) {
|
|
|
1949
1949
|
i++;
|
|
1950
1950
|
continue;
|
|
1951
1951
|
}
|
|
1952
|
-
const parsed2 = parseEventLine(child.text, child.line, nextId2,
|
|
1952
|
+
const parsed2 = parseEventLine(child.text, child.line, nextId2, ordinal2);
|
|
1953
1953
|
if (!parsed2) throw new TimelineParseError(`Unrecognized line in ${keyword}: ${child.text}`, child.line);
|
|
1954
1954
|
parsed2.event.trackId = trackId;
|
|
1955
1955
|
ast.events.push(parsed2.event);
|
|
@@ -1963,7 +1963,7 @@ function parseTimeline(src) {
|
|
|
1963
1963
|
}
|
|
1964
1964
|
continue;
|
|
1965
1965
|
}
|
|
1966
|
-
const parsed = parseEventLine(text2, L.line, nextId2,
|
|
1966
|
+
const parsed = parseEventLine(text2, L.line, nextId2, ordinal2);
|
|
1967
1967
|
if (parsed) {
|
|
1968
1968
|
ast.events.push(parsed.event);
|
|
1969
1969
|
i++;
|
|
@@ -1987,12 +1987,12 @@ function safeParseDate(raw, line2) {
|
|
|
1987
1987
|
throw new TimelineParseError(msg, line2);
|
|
1988
1988
|
}
|
|
1989
1989
|
}
|
|
1990
|
-
function parseRowKey(raw,
|
|
1990
|
+
function parseRowKey(raw, ordinal2) {
|
|
1991
1991
|
const parsed = tryParseDate(raw);
|
|
1992
1992
|
if (parsed) return parsed;
|
|
1993
|
-
|
|
1993
|
+
ordinal2.index += 1;
|
|
1994
1994
|
return {
|
|
1995
|
-
value:
|
|
1995
|
+
value: ordinal2.index,
|
|
1996
1996
|
raw,
|
|
1997
1997
|
precision: "ordinal"
|
|
1998
1998
|
};
|
|
@@ -2029,7 +2029,7 @@ function applyConfig(ast, k, v, line2) {
|
|
|
2029
2029
|
(ast.metadata ??= {})[k] = v;
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
|
-
function parseEventLine(text2, line2, nextId2,
|
|
2032
|
+
function parseEventLine(text2, line2, nextId2, ordinal2) {
|
|
2033
2033
|
const { props, rest } = parseProperties(text2, line2);
|
|
2034
2034
|
const { date, end, body } = splitDateAndBody(rest, line2);
|
|
2035
2035
|
let kind = end ? "range" : "point";
|
|
@@ -2046,8 +2046,8 @@ function parseEventLine(text2, line2, nextId2, ordinal) {
|
|
|
2046
2046
|
id: nextId2("ev"),
|
|
2047
2047
|
label,
|
|
2048
2048
|
kind,
|
|
2049
|
-
start: parseRowKey(date,
|
|
2050
|
-
end: end ? parseRowKey(end,
|
|
2049
|
+
start: parseRowKey(date, ordinal2),
|
|
2050
|
+
end: end ? parseRowKey(end, ordinal2) : void 0,
|
|
2051
2051
|
icon: props["icon"],
|
|
2052
2052
|
shape: props["shape"],
|
|
2053
2053
|
color: props["color"],
|
|
@@ -2650,7 +2650,7 @@ var ERA_ROW_GAP = 2;
|
|
|
2650
2650
|
function renderTimeline(src, config) {
|
|
2651
2651
|
const ast = parseTimeline(src);
|
|
2652
2652
|
const layout = layoutTimeline(ast);
|
|
2653
|
-
const theme =
|
|
2653
|
+
const theme = chunkENUM7GMZ_cjs.resolveTimelineTheme(config?.theme ?? "default");
|
|
2654
2654
|
const styleBlock = styleForTheme(theme, config?.fontFamily);
|
|
2655
2655
|
const children = [
|
|
2656
2656
|
chunk3WNW5Y7P_cjs.title(ast.title ? `Timeline \u2014 ${ast.title}` : "Timeline"),
|
|
@@ -2695,7 +2695,7 @@ function renderTimeline(src, config) {
|
|
|
2695
2695
|
function styleForTheme(theme, fontFamily) {
|
|
2696
2696
|
const font = fontFamily ?? "system-ui, -apple-system, sans-serif";
|
|
2697
2697
|
return `
|
|
2698
|
-
.st-timeline { ${
|
|
2698
|
+
.st-timeline { ${chunkENUM7GMZ_cjs.cssCustomProperties(theme)}
|
|
2699
2699
|
--st-axis: ${theme.axis};
|
|
2700
2700
|
--st-axis-label: ${theme.axisLabel};
|
|
2701
2701
|
--st-era-label: ${theme.eraLabel};
|
|
@@ -3831,7 +3831,7 @@ function layoutStateDiagram(ast) {
|
|
|
3831
3831
|
}
|
|
3832
3832
|
return true;
|
|
3833
3833
|
});
|
|
3834
|
-
const fcResult =
|
|
3834
|
+
const fcResult = chunkOJ3P4IC4_cjs.layoutFlowchart(fcAst);
|
|
3835
3835
|
const stateById = /* @__PURE__ */ new Map();
|
|
3836
3836
|
const collectStates = (s) => {
|
|
3837
3837
|
stateById.set(s.id, s);
|
|
@@ -4406,7 +4406,7 @@ function renderNote(n) {
|
|
|
4406
4406
|
}
|
|
4407
4407
|
function renderStateDiagram(ast, config) {
|
|
4408
4408
|
const layout = layoutStateDiagram(ast);
|
|
4409
|
-
return renderLayout(layout,
|
|
4409
|
+
return renderLayout(layout, chunkENUM7GMZ_cjs.resolveStateTheme(config?.theme ?? "default"));
|
|
4410
4410
|
}
|
|
4411
4411
|
function renderLayout(layout, t) {
|
|
4412
4412
|
const titleNode = layout.title ? chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 22, class: "lt-title", "text-anchor": "middle" }, layout.title) : "";
|
|
@@ -7609,7 +7609,7 @@ function approxLineWidth(line2) {
|
|
|
7609
7609
|
return line2.text.length * charW;
|
|
7610
7610
|
}
|
|
7611
7611
|
function renderPrismaLayout(layout, config) {
|
|
7612
|
-
const t =
|
|
7612
|
+
const t = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
7613
7613
|
const children = [];
|
|
7614
7614
|
children.push(chunk3WNW5Y7P_cjs.title(layout.title ?? "PRISMA 2020 flow diagram"));
|
|
7615
7615
|
children.push(
|
|
@@ -9080,7 +9080,7 @@ function renderTree(tr) {
|
|
|
9080
9080
|
);
|
|
9081
9081
|
}
|
|
9082
9082
|
function renderUsecaseLayout(layout, config) {
|
|
9083
|
-
const t =
|
|
9083
|
+
const t = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
9084
9084
|
const children = [];
|
|
9085
9085
|
const nInclude = layout.ast.relations.filter((r6) => r6.kind === "include").length;
|
|
9086
9086
|
const nExtend = layout.ast.relations.filter((r6) => r6.kind === "extend").length;
|
|
@@ -10869,7 +10869,7 @@ function summaryText(summary) {
|
|
|
10869
10869
|
return { plain, critPath };
|
|
10870
10870
|
}
|
|
10871
10871
|
function renderPertLayout(layout, config) {
|
|
10872
|
-
const t =
|
|
10872
|
+
const t = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
10873
10873
|
const children = [];
|
|
10874
10874
|
const cp = layout.summary.criticalPath;
|
|
10875
10875
|
children.push(chunk3WNW5Y7P_cjs.title(`PERT network${layout.title ? " \u2014 " + layout.title : ""}`));
|
|
@@ -12078,7 +12078,7 @@ function renderDestroy(d) {
|
|
|
12078
12078
|
]);
|
|
12079
12079
|
}
|
|
12080
12080
|
function renderSequenceLayout(layout, config) {
|
|
12081
|
-
const t =
|
|
12081
|
+
const t = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
12082
12082
|
const children = [];
|
|
12083
12083
|
const nMsg = layout.messages.length;
|
|
12084
12084
|
const nFrag = layout.fragments.length;
|
|
@@ -12933,7 +12933,7 @@ function renderArc2(ag) {
|
|
|
12933
12933
|
);
|
|
12934
12934
|
}
|
|
12935
12935
|
function renderPetriLayout(layout, config) {
|
|
12936
|
-
const t =
|
|
12936
|
+
const t = chunkENUM7GMZ_cjs.resolvePetriTheme(config?.theme ?? "default");
|
|
12937
12937
|
const children = [];
|
|
12938
12938
|
const marking = layout.places.filter((p) => p.tokens > 0).map((p) => `${p.place.id}:${p.tokens}`).join(", ");
|
|
12939
12939
|
const descParts = [
|
|
@@ -14450,7 +14450,7 @@ function renderDevice(b, t) {
|
|
|
14450
14450
|
return chunk3WNW5Y7P_cjs.group(attrs, parts);
|
|
14451
14451
|
}
|
|
14452
14452
|
function renderNetworkLayout(layout, config) {
|
|
14453
|
-
const t =
|
|
14453
|
+
const t = chunkENUM7GMZ_cjs.resolveNetworkTheme(config?.theme ?? "default");
|
|
14454
14454
|
const children = [];
|
|
14455
14455
|
const counts = /* @__PURE__ */ new Map();
|
|
14456
14456
|
for (const b of layout.devices) counts.set(b.device.kind, (counts.get(b.device.kind) ?? 0) + 1);
|
|
@@ -16220,8 +16220,8 @@ function renderUmlClass(text2, config) {
|
|
|
16220
16220
|
return renderUmlClassLayout(layout, config);
|
|
16221
16221
|
}
|
|
16222
16222
|
function renderUmlClassLayout(layout, config) {
|
|
16223
|
-
const theme =
|
|
16224
|
-
const fontFamily = config?.fontFamily ??
|
|
16223
|
+
const theme = chunkENUM7GMZ_cjs.resolveUmlClassTheme(config?.theme ?? "default");
|
|
16224
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
16225
16225
|
const pad = config?.padding ?? 0;
|
|
16226
16226
|
const width = layout.width + pad * 2;
|
|
16227
16227
|
const height = layout.height + pad * 2;
|
|
@@ -16236,25 +16236,25 @@ function renderUmlClassLayout(layout, config) {
|
|
|
16236
16236
|
.sx-umlclass-box-stroke { stroke: ${theme.classifierStroke}; stroke-width: ${BOX_STROKE_W}; fill: none; }
|
|
16237
16237
|
.sx-umlclass-header-fill { fill: ${theme.headerFill}; }
|
|
16238
16238
|
.sx-umlclass-divider { stroke: ${theme.classifierStroke}; stroke-width: ${DIVIDER_STROKE_W}; }
|
|
16239
|
-
.sx-umlclass-classname { fill: ${theme.nameText}; font-size: ${
|
|
16239
|
+
.sx-umlclass-classname { fill: ${theme.nameText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label + 1}px; font-weight: 700; letter-spacing: -0.01em; }
|
|
16240
16240
|
.sx-umlclass-classname[data-abstract="true"] { font-style: italic; }
|
|
16241
|
-
.sx-umlclass-stereotype { fill: ${theme.stereotypeText}; font-size: ${
|
|
16242
|
-
.sx-umlclass-member { fill: ${theme.memberText}; font-size: ${
|
|
16241
|
+
.sx-umlclass-stereotype { fill: ${theme.stereotypeText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-style: italic; }
|
|
16242
|
+
.sx-umlclass-member { fill: ${theme.memberText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 500; }
|
|
16243
16243
|
.sx-umlclass-member[data-static] { text-decoration: underline; }
|
|
16244
16244
|
.sx-umlclass-member[data-abstract] { font-style: italic; }
|
|
16245
|
-
.sx-umlclass-visibility { fill: ${theme.visibilityText}; font-size: ${
|
|
16245
|
+
.sx-umlclass-visibility { fill: ${theme.visibilityText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 500; }
|
|
16246
16246
|
.sx-umlclass-rel-line { stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; fill: none; }
|
|
16247
16247
|
.sx-umlclass-rel-line[data-dashed="true"] { stroke-dasharray: 5 4; }
|
|
16248
16248
|
.sx-umlclass-triangle { fill: ${theme.adornmentHollowFill}; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16249
16249
|
.sx-umlclass-diamond-hollow { fill: ${theme.adornmentHollowFill}; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16250
16250
|
.sx-umlclass-diamond-filled { fill: ${theme.adornmentFill}; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16251
16251
|
.sx-umlclass-arrowhead { fill: none; stroke: ${theme.relationStroke}; stroke-width: ${REL_STROKE_W}; stroke-linejoin: miter; }
|
|
16252
|
-
.sx-umlclass-edge-label { fill: ${theme.edgeLabel}; font-size: ${
|
|
16253
|
-
.sx-umlclass-edge-name { fill: ${theme.edgeLabel}; font-size: ${
|
|
16252
|
+
.sx-umlclass-edge-label { fill: ${theme.edgeLabel}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 500; }
|
|
16253
|
+
.sx-umlclass-edge-name { fill: ${theme.edgeLabel}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-style: italic; }
|
|
16254
16254
|
.sx-umlclass-edge-name-halo { fill: ${theme.bg}; stroke: ${theme.bg}; stroke-width: ${UMLCLASS_CONST.EDGE_LABEL_HALO}; stroke-linejoin: round; }
|
|
16255
|
-
.sx-umlclass-title { fill: ${theme.nameText}; font-size: ${
|
|
16255
|
+
.sx-umlclass-title { fill: ${theme.nameText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
16256
16256
|
.sx-umlclass-package { fill: ${theme.packageFill}; stroke: ${theme.packageStroke}; stroke-width: 1; }
|
|
16257
|
-
.sx-umlclass-package-label { fill: ${theme.packageLabel}; font-size: ${
|
|
16257
|
+
.sx-umlclass-package-label { fill: ${theme.packageLabel}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
16258
16258
|
`.trim()
|
|
16259
16259
|
);
|
|
16260
16260
|
const children = [
|
|
@@ -17590,8 +17590,8 @@ function renderFaultTree(text2, config) {
|
|
|
17590
17590
|
return renderFaultTreeLayout(layout, config);
|
|
17591
17591
|
}
|
|
17592
17592
|
function renderFaultTreeLayout(layout, config) {
|
|
17593
|
-
const theme =
|
|
17594
|
-
const fontFamily = config?.fontFamily ??
|
|
17593
|
+
const theme = chunkENUM7GMZ_cjs.resolveReliabilityTheme(config?.theme ?? "default");
|
|
17594
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
17595
17595
|
const pad = config?.padding ?? 0;
|
|
17596
17596
|
const { ast, analysis } = layout;
|
|
17597
17597
|
const showProb = ast.analysis.probability;
|
|
@@ -17603,27 +17603,27 @@ function renderFaultTreeLayout(layout, config) {
|
|
|
17603
17603
|
{},
|
|
17604
17604
|
`
|
|
17605
17605
|
.sx-ft-bg { fill: ${theme.bg}; }
|
|
17606
|
-
.sx-ft-event { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17606
|
+
.sx-ft-event { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17607
17607
|
.sx-ft-event[data-role="top"] { stroke: ${theme.topEventStroke}; stroke-width: 2.25; }
|
|
17608
|
-
.sx-ft-basic { fill: ${theme.basicFill}; stroke: ${theme.basicStroke}; stroke-width: ${
|
|
17609
|
-
.sx-ft-undeveloped { fill: ${theme.undevelopedFill}; stroke: ${theme.basicStroke}; stroke-width: ${
|
|
17610
|
-
.sx-ft-house { fill: ${theme.houseFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17611
|
-
.sx-ft-gate { fill: ${theme.gateFill}; stroke: ${theme.gateStroke}; stroke-width: ${
|
|
17612
|
-
.sx-ft-cond { fill: ${theme.conditionFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17613
|
-
.sx-ft-pin, .sx-ft-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${
|
|
17614
|
-
.sx-ft-shared-mark { fill: none; stroke: ${theme.basicStroke}; stroke-width: ${
|
|
17615
|
-
.sx-ft-label { fill: ${theme.eventStroke}; font-size: ${
|
|
17616
|
-
.sx-ft-id { fill: ${theme.eventStroke}; font-size: ${
|
|
17617
|
-
.sx-ft-cap { fill: ${theme.eventStroke}; font-size: ${
|
|
17618
|
-
.sx-ft-prob { fill: ${theme.probText}; font-size: ${
|
|
17619
|
-
.sx-ft-gate-label { fill: ${theme.gateStroke}; font-size: ${
|
|
17620
|
-
.sx-ft-cond-text { fill: ${theme.eventStroke}; font-size: ${
|
|
17621
|
-
.sx-ft-cutset { fill: ${theme.cutsetFill}; stroke: ${theme.cutsetStroke}; stroke-width: ${
|
|
17622
|
-
.sx-ft-cutset[data-spof="true"] { stroke: ${theme.spofStroke}; stroke-width: ${
|
|
17623
|
-
.sx-ft-ptop { fill: ${theme.probText}; font-size: ${
|
|
17624
|
-
.sx-ft-transfer { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
17625
|
-
.sx-ft-transfer-label { fill: ${theme.eventStroke}; font-size: ${
|
|
17626
|
-
.sx-ft-title { fill: ${theme.eventStroke}; font-size: ${
|
|
17608
|
+
.sx-ft-basic { fill: ${theme.basicFill}; stroke: ${theme.basicStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17609
|
+
.sx-ft-undeveloped { fill: ${theme.undevelopedFill}; stroke: ${theme.basicStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17610
|
+
.sx-ft-house { fill: ${theme.houseFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17611
|
+
.sx-ft-gate { fill: ${theme.gateFill}; stroke: ${theme.gateStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; stroke-linejoin: round; }
|
|
17612
|
+
.sx-ft-cond { fill: ${theme.conditionFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
17613
|
+
.sx-ft-pin, .sx-ft-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17614
|
+
.sx-ft-shared-mark { fill: none; stroke: ${theme.basicStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17615
|
+
.sx-ft-label { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
17616
|
+
.sx-ft-id { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
17617
|
+
.sx-ft-cap { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
17618
|
+
.sx-ft-prob { fill: ${theme.probText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 600; }
|
|
17619
|
+
.sx-ft-gate-label { fill: ${theme.gateStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
17620
|
+
.sx-ft-cond-text { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
17621
|
+
.sx-ft-cutset { fill: ${theme.cutsetFill}; stroke: ${theme.cutsetStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17622
|
+
.sx-ft-cutset[data-spof="true"] { stroke: ${theme.spofStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
17623
|
+
.sx-ft-ptop { fill: ${theme.probText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
17624
|
+
.sx-ft-transfer { fill: ${theme.eventFill}; stroke: ${theme.eventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
17625
|
+
.sx-ft-transfer-label { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 600; }
|
|
17626
|
+
.sx-ft-title { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
17627
17627
|
`.trim()
|
|
17628
17628
|
);
|
|
17629
17629
|
const instById = new Map(layout.events.map((e) => [e.instanceId, e]));
|
|
@@ -18294,8 +18294,8 @@ function renderBowtie(text2, config) {
|
|
|
18294
18294
|
}
|
|
18295
18295
|
function renderBowtieLayout(layout, config) {
|
|
18296
18296
|
const themeName = config?.theme ?? "default";
|
|
18297
|
-
const theme =
|
|
18298
|
-
const fontFamily = config?.fontFamily ??
|
|
18297
|
+
const theme = chunkENUM7GMZ_cjs.resolveBowtieTheme(themeName);
|
|
18298
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
18299
18299
|
const pad = config?.padding ?? 0;
|
|
18300
18300
|
const { ast, topEvent } = layout;
|
|
18301
18301
|
const mono = themeName === "monochrome";
|
|
@@ -18307,22 +18307,22 @@ function renderBowtieLayout(layout, config) {
|
|
|
18307
18307
|
{},
|
|
18308
18308
|
`
|
|
18309
18309
|
.sx-bowtie-bg { fill: ${theme.bg}; }
|
|
18310
|
-
.sx-bowtie-line { fill: none; stroke: ${theme.lineStroke}; stroke-width: ${
|
|
18310
|
+
.sx-bowtie-line { fill: none; stroke: ${theme.lineStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
18311
18311
|
.sx-bowtie-arrow { fill: ${theme.lineStroke}; stroke: none; }
|
|
18312
|
-
.sx-bowtie-escalation-line { fill: none; stroke: ${theme.escalationLineStroke}; stroke-width: ${
|
|
18313
|
-
.sx-bowtie-hazard { fill: ${theme.hazardFill}; stroke: ${theme.hazardStroke}; stroke-width: ${
|
|
18314
|
-
.sx-bowtie-topevent { fill: ${theme.topEventFill}; stroke: ${theme.topEventStroke}; stroke-width: ${
|
|
18315
|
-
.sx-bowtie-topevent-ring { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${
|
|
18316
|
-
.sx-bowtie-threat { fill: ${theme.threatFill}; stroke: ${theme.threatStroke}; stroke-width: ${
|
|
18317
|
-
.sx-bowtie-barrier { fill: ${theme.barrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${
|
|
18318
|
-
.sx-bowtie-consequence { fill: ${theme.consequenceFill}; stroke: ${theme.consequenceStroke}; stroke-width: ${
|
|
18319
|
-
.sx-bowtie-escalation { fill: ${theme.escalationFill}; stroke: ${theme.escalationStroke}; stroke-width: ${
|
|
18320
|
-
.sx-bowtie-ef-barrier { fill: ${theme.efBarrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${
|
|
18321
|
-
.sx-bowtie-label { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18322
|
-
.sx-bowtie-elabel { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18312
|
+
.sx-bowtie-escalation-line { fill: none; stroke: ${theme.escalationLineStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin};${mono ? " stroke-dasharray: 4 3;" : ""} }
|
|
18313
|
+
.sx-bowtie-hazard { fill: ${theme.hazardFill}; stroke: ${theme.hazardStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
18314
|
+
.sx-bowtie-topevent { fill: ${theme.topEventFill}; stroke: ${theme.topEventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
18315
|
+
.sx-bowtie-topevent-ring { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
18316
|
+
.sx-bowtie-threat { fill: ${theme.threatFill}; stroke: ${theme.threatStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
18317
|
+
.sx-bowtie-barrier { fill: ${theme.barrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
18318
|
+
.sx-bowtie-consequence { fill: ${theme.consequenceFill}; stroke: ${theme.consequenceStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
18319
|
+
.sx-bowtie-escalation { fill: ${theme.escalationFill}; stroke: ${theme.escalationStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal};${mono ? " stroke-dasharray: 5 3;" : ""} }
|
|
18320
|
+
.sx-bowtie-ef-barrier { fill: ${theme.efBarrierFill}; stroke: ${theme.barrierStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
18321
|
+
.sx-bowtie-label { fill: ${theme.labelText}; stroke: none; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; }
|
|
18322
|
+
.sx-bowtie-elabel { fill: ${theme.labelText}; stroke: none; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
18323
18323
|
.sx-bowtie-topevent-label { fill: ${theme.labelText}; stroke: none; font-size: 11px; font-weight: 700; }
|
|
18324
|
-
.sx-bowtie-title { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18325
|
-
.sx-bowtie-legend-label { fill: ${theme.labelText}; stroke: none; font-size: ${
|
|
18324
|
+
.sx-bowtie-title { fill: ${theme.labelText}; stroke: none; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
18325
|
+
.sx-bowtie-legend-label { fill: ${theme.labelText}; stroke: none; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
18326
18326
|
`.trim()
|
|
18327
18327
|
);
|
|
18328
18328
|
const children = [
|
|
@@ -18920,8 +18920,8 @@ function renderEventTree(text2, config) {
|
|
|
18920
18920
|
return renderEventTreeLayout(layout, config);
|
|
18921
18921
|
}
|
|
18922
18922
|
function renderEventTreeLayout(layout, config) {
|
|
18923
|
-
const theme =
|
|
18924
|
-
const fontFamily = config?.fontFamily ??
|
|
18923
|
+
const theme = chunkENUM7GMZ_cjs.resolveReliabilityTheme(config?.theme ?? "default");
|
|
18924
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
18925
18925
|
const pad = config?.padding ?? 0;
|
|
18926
18926
|
const { ast } = layout;
|
|
18927
18927
|
const width = layout.width + pad * 2;
|
|
@@ -18932,22 +18932,22 @@ function renderEventTreeLayout(layout, config) {
|
|
|
18932
18932
|
{},
|
|
18933
18933
|
`
|
|
18934
18934
|
.sx-et-bg { fill: ${theme.bg}; }
|
|
18935
|
-
.sx-et-title { fill: ${theme.eventStroke}; font-size: ${
|
|
18936
|
-
.sx-et-header { fill: ${theme.eventStroke}; font-size: ${
|
|
18937
|
-
.sx-et-grid { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${
|
|
18938
|
-
.sx-et-headrule { fill: none; stroke: ${theme.eventStroke}; stroke-width: ${
|
|
18939
|
-
.sx-et-ie { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${
|
|
18940
|
-
.sx-et-ie-label { fill: ${theme.eventStroke}; font-size: ${
|
|
18941
|
-
.sx-et-ie-freq { fill: ${theme.probText}; font-size: ${
|
|
18942
|
-
.sx-et-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${
|
|
18935
|
+
.sx-et-title { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
18936
|
+
.sx-et-header { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
18937
|
+
.sx-et-grid { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; stroke-dasharray: 4 4; opacity: 0.5; }
|
|
18938
|
+
.sx-et-headrule { fill: none; stroke: ${theme.eventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
18939
|
+
.sx-et-ie { fill: none; stroke: ${theme.topEventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
18940
|
+
.sx-et-ie-label { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
18941
|
+
.sx-et-ie-freq { fill: ${theme.probText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 600; }
|
|
18942
|
+
.sx-et-edge { fill: none; stroke: ${theme.edgeStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
18943
18943
|
.sx-et-edge[data-leg="s"] {}
|
|
18944
|
-
.sx-et-leg-label { fill: ${theme.eventStroke}; font-size: ${
|
|
18945
|
-
.sx-et-leg-prob { fill: ${theme.probText}; font-size: ${
|
|
18946
|
-
.sx-et-outcome { fill: ${theme.eventStroke}; font-size: ${
|
|
18947
|
-
.sx-et-freq { fill: ${theme.probText}; font-size: ${
|
|
18948
|
-
.sx-et-seqid { fill: ${theme.eventStroke}; font-size: ${
|
|
18944
|
+
.sx-et-leg-label { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
18945
|
+
.sx-et-leg-prob { fill: ${theme.probText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
18946
|
+
.sx-et-outcome { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
18947
|
+
.sx-et-freq { fill: ${theme.probText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 600; }
|
|
18948
|
+
.sx-et-seqid { fill: ${theme.eventStroke}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; opacity: 0.7; }
|
|
18949
18949
|
.sx-et-dot { fill: ${theme.basicStroke}; stroke: none; }
|
|
18950
|
-
.sx-et-edge[data-dominant="true"] { stroke: ${theme.cutsetStroke}; stroke-width: ${
|
|
18950
|
+
.sx-et-edge[data-dominant="true"] { stroke: ${theme.cutsetStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
18951
18951
|
.sx-et-outcome[data-dominant="true"] { fill: ${theme.spofStroke}; }
|
|
18952
18952
|
.sx-et-freq[data-dominant="true"] { fill: ${theme.spofStroke}; font-weight: 700; }
|
|
18953
18953
|
.sx-et-dot[data-dominant="true"] { fill: ${theme.spofStroke}; }
|
|
@@ -20024,7 +20024,7 @@ function renderFmea(text2, config) {
|
|
|
20024
20024
|
}
|
|
20025
20025
|
function renderFmeaLayout(layout, config) {
|
|
20026
20026
|
const p = resolvePalette(config?.theme ?? "default");
|
|
20027
|
-
const fontFamily = config?.fontFamily ??
|
|
20027
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
20028
20028
|
const pad = config?.padding ?? 0;
|
|
20029
20029
|
const { ast, analysis } = layout;
|
|
20030
20030
|
const width = layout.width + pad * 2;
|
|
@@ -20205,25 +20205,25 @@ function buildCss9(p) {
|
|
|
20205
20205
|
const isMono = p === PALETTE_MONO;
|
|
20206
20206
|
return `
|
|
20207
20207
|
.sx-fmea-bg { fill: ${p.bg}; }
|
|
20208
|
-
.sx-fmea-border { fill: none; stroke: ${p.border}; stroke-width: ${
|
|
20209
|
-
.sx-fmea-cell { fill: ${p.bg}; stroke: ${p.grid}; stroke-width: ${
|
|
20208
|
+
.sx-fmea-border { fill: none; stroke: ${p.border}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
20209
|
+
.sx-fmea-cell { fill: ${p.bg}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20210
20210
|
.sx-fmea-cell-alt { fill: ${p.cellAltFill}; }
|
|
20211
|
-
.sx-fmea-headcell { fill: ${p.headerFill}; stroke: ${p.grid}; stroke-width: ${
|
|
20212
|
-
.sx-fmea-band { fill: ${p.bandFill}; stroke: ${p.grid}; stroke-width: ${
|
|
20213
|
-
.sx-fmea-band-text { fill: ${p.bandText}; font-size: ${
|
|
20214
|
-
.sx-fmea-headtext { fill: ${p.headerText}; font-size: ${
|
|
20215
|
-
.sx-fmea-text { fill: ${p.cellText}; font-size: ${
|
|
20216
|
-
.sx-fmea-risk-text { fill: ${p.riskText}; font-size: ${
|
|
20217
|
-
.sx-fmea-title { fill: ${p.cellText}; font-size: ${
|
|
20218
|
-
.sx-fmea-meta { fill: ${p.metaText}; font-size: ${
|
|
20219
|
-
.sx-fmea-legend { fill: ${p.metaText}; font-size: ${
|
|
20220
|
-
.sx-fmea-rpn-high { fill: ${p.rpnHigh}; stroke: ${p.grid}; stroke-width: ${
|
|
20221
|
-
.sx-fmea-rpn-mid { fill: ${p.rpnMid}; stroke: ${p.grid}; stroke-width: ${
|
|
20222
|
-
.sx-fmea-rpn-low { fill: ${p.rpnLow}; stroke: ${p.grid}; stroke-width: ${
|
|
20223
|
-
.sx-fmea-ap-high { fill: ${p.apHigh}; stroke: ${p.grid}; stroke-width: ${
|
|
20224
|
-
.sx-fmea-ap-mid { fill: ${p.apMid}; stroke: ${p.grid}; stroke-width: ${
|
|
20225
|
-
.sx-fmea-ap-low { fill: ${p.apLow}; stroke: ${p.grid}; stroke-width: ${
|
|
20226
|
-
.sx-fmea-flag { fill: none; stroke: ${p.flagStroke}; stroke-width: ${
|
|
20211
|
+
.sx-fmea-headcell { fill: ${p.headerFill}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20212
|
+
.sx-fmea-band { fill: ${p.bandFill}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20213
|
+
.sx-fmea-band-text { fill: ${p.bandText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 700; letter-spacing: 0.06em; }
|
|
20214
|
+
.sx-fmea-headtext { fill: ${p.headerText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
20215
|
+
.sx-fmea-text { fill: ${p.cellText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; }
|
|
20216
|
+
.sx-fmea-risk-text { fill: ${p.riskText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
20217
|
+
.sx-fmea-title { fill: ${p.cellText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
20218
|
+
.sx-fmea-meta { fill: ${p.metaText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; }
|
|
20219
|
+
.sx-fmea-legend { fill: ${p.metaText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 600; }
|
|
20220
|
+
.sx-fmea-rpn-high { fill: ${p.rpnHigh}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20221
|
+
.sx-fmea-rpn-mid { fill: ${p.rpnMid}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20222
|
+
.sx-fmea-rpn-low { fill: ${p.rpnLow}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20223
|
+
.sx-fmea-ap-high { fill: ${p.apHigh}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20224
|
+
.sx-fmea-ap-mid { fill: ${p.apMid}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20225
|
+
.sx-fmea-ap-low { fill: ${p.apLow}; stroke: ${p.grid}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
20226
|
+
.sx-fmea-flag { fill: none; stroke: ${p.flagStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; ${isMono ? "stroke-dasharray: 4 2;" : ""} }
|
|
20227
20227
|
`.trim();
|
|
20228
20228
|
}
|
|
20229
20229
|
|
|
@@ -20904,7 +20904,7 @@ function renderCausalLoop(text2, config) {
|
|
|
20904
20904
|
}
|
|
20905
20905
|
function renderCausalLoopLayout(layout, config) {
|
|
20906
20906
|
const theme = resolveTokens(config?.theme ?? "default");
|
|
20907
|
-
const fontFamily = config?.fontFamily ??
|
|
20907
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
20908
20908
|
const pad = config?.padding ?? 0;
|
|
20909
20909
|
const { ast } = layout;
|
|
20910
20910
|
const width = layout.width + pad * 2;
|
|
@@ -20915,17 +20915,17 @@ function renderCausalLoopLayout(layout, config) {
|
|
|
20915
20915
|
{},
|
|
20916
20916
|
`
|
|
20917
20917
|
.sx-cld-bg { fill: ${theme.bg}; }
|
|
20918
|
-
.sx-cld-link { fill: none; stroke: ${theme.ink}; stroke-width: ${
|
|
20918
|
+
.sx-cld-link { fill: none; stroke: ${theme.ink}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
20919
20919
|
.sx-cld-arrow { fill: ${theme.ink}; stroke: none; }
|
|
20920
|
-
.sx-cld-var { fill: ${theme.ink}; font-size: ${
|
|
20921
|
-
.sx-cld-polarity { fill: ${theme.ink}; font-size: ${
|
|
20922
|
-
.sx-cld-link-label { fill: ${theme.ink}; font-size: ${
|
|
20923
|
-
.sx-cld-delay { stroke: ${theme.delay}; stroke-width: ${
|
|
20924
|
-
.sx-cld-glyph { fill: none; stroke: ${theme.accent}; stroke-width: ${
|
|
20920
|
+
.sx-cld-var { fill: ${theme.ink}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label + 1}px; font-weight: 600; }
|
|
20921
|
+
.sx-cld-polarity { fill: ${theme.ink}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label + 2}px; font-weight: 700; }
|
|
20922
|
+
.sx-cld-link-label { fill: ${theme.ink}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
20923
|
+
.sx-cld-delay { stroke: ${theme.delay}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
20924
|
+
.sx-cld-glyph { fill: none; stroke: ${theme.accent}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
20925
20925
|
.sx-cld-glyph-head { fill: ${theme.accent}; stroke: none; }
|
|
20926
|
-
.sx-cld-glyph-label { fill: ${theme.accent}; font-size: ${
|
|
20927
|
-
.sx-cld-glyph-phrase { fill: ${theme.accent}; font-size: ${
|
|
20928
|
-
.sx-cld-title { fill: ${theme.ink}; font-size: ${
|
|
20926
|
+
.sx-cld-glyph-label { fill: ${theme.accent}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 700; }
|
|
20927
|
+
.sx-cld-glyph-phrase { fill: ${theme.accent}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-style: italic; }
|
|
20928
|
+
.sx-cld-title { fill: ${theme.ink}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
20929
20929
|
`.trim()
|
|
20930
20930
|
);
|
|
20931
20931
|
const children = [
|
|
@@ -21903,7 +21903,7 @@ function selfLoopGeom(tr, c, ringCenter, layout, C2) {
|
|
|
21903
21903
|
|
|
21904
21904
|
// src/diagrams/markov/renderer.ts
|
|
21905
21905
|
function palette(name) {
|
|
21906
|
-
const b =
|
|
21906
|
+
const b = chunkENUM7GMZ_cjs.resolveBaseTheme(name);
|
|
21907
21907
|
const mono = name === "monochrome";
|
|
21908
21908
|
return {
|
|
21909
21909
|
stateFill: b.fillMuted,
|
|
@@ -22759,7 +22759,7 @@ function renderGitGraph(text2, config) {
|
|
|
22759
22759
|
}
|
|
22760
22760
|
function renderGitGraphLayout(layout, config) {
|
|
22761
22761
|
const pal = resolvePalette2(config?.theme);
|
|
22762
|
-
const fontFamily = config?.fontFamily ??
|
|
22762
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
22763
22763
|
const pad = config?.padding ?? 0;
|
|
22764
22764
|
const { ast } = layout;
|
|
22765
22765
|
const width = layout.width + pad * 2;
|
|
@@ -22983,9 +22983,9 @@ function renderCommitLabel(id, x, y, rotate, fontFamily) {
|
|
|
22983
22983
|
}
|
|
22984
22984
|
function buildStyle2(pal, showBranches) {
|
|
22985
22985
|
const laneStyle = showBranches ? `
|
|
22986
|
-
.sx-gg-lane { stroke-width: ${
|
|
22986
|
+
.sx-gg-lane { stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; stroke-linecap: round; opacity: 0.9; }
|
|
22987
22987
|
.sx-gg-pill { stroke: none; }
|
|
22988
|
-
.sx-gg-pill-text { font-size: ${
|
|
22988
|
+
.sx-gg-pill-text { font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 700; }` : "";
|
|
22989
22989
|
const laneRules = pal.lanes.map((col, i) => {
|
|
22990
22990
|
const ink = pal.laneInk[i] ?? "#ffffff";
|
|
22991
22991
|
return [
|
|
@@ -23000,17 +23000,17 @@ function buildStyle2(pal, showBranches) {
|
|
|
23000
23000
|
{},
|
|
23001
23001
|
`
|
|
23002
23002
|
.sx-gg-bg { fill: ${pal.bg}; }${laneStyle}
|
|
23003
|
-
.sx-gg-edge { fill: none; stroke-width: ${
|
|
23003
|
+
.sx-gg-edge { fill: none; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
23004
23004
|
.sx-gg-edge-merge { stroke-dasharray: none; }
|
|
23005
|
-
.sx-gg-node { stroke-width: ${
|
|
23005
|
+
.sx-gg-node { stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
23006
23006
|
.sx-gg-dot { stroke: none; }
|
|
23007
|
-
.sx-gg-merge { fill: ${pal.mergeCenter}; stroke-width: ${
|
|
23008
|
-
.sx-gg-highlight { fill: none; stroke-width: ${
|
|
23009
|
-
.sx-gg-reverse-mark { stroke: ${pal.mergeCenter}; stroke-width: ${
|
|
23010
|
-
.sx-gg-cherry { fill: none; stroke-width: ${
|
|
23011
|
-
.sx-gg-id { fill: ${pal.labelInk}; font-size: ${
|
|
23012
|
-
.sx-gg-tag { fill: ${pal.tagFill}; stroke: ${pal.tagStroke}; stroke-width: ${
|
|
23013
|
-
.sx-gg-tag-text { fill: ${pal.tagInk}; font-size: ${
|
|
23007
|
+
.sx-gg-merge { fill: ${pal.mergeCenter}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
23008
|
+
.sx-gg-highlight { fill: none; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
23009
|
+
.sx-gg-reverse-mark { stroke: ${pal.mergeCenter}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; stroke-linecap: round; }
|
|
23010
|
+
.sx-gg-cherry { fill: none; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
23011
|
+
.sx-gg-id { fill: ${pal.labelInk}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 600; }
|
|
23012
|
+
.sx-gg-tag { fill: ${pal.tagFill}; stroke: ${pal.tagStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
23013
|
+
.sx-gg-tag-text { fill: ${pal.tagInk}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
23014
23014
|
${laneRules}
|
|
23015
23015
|
`.trim()
|
|
23016
23016
|
);
|
|
@@ -23770,7 +23770,7 @@ function borderPoint(from, to, _isLR) {
|
|
|
23770
23770
|
|
|
23771
23771
|
// src/diagrams/epc/renderer.ts
|
|
23772
23772
|
function epcPalette(themeName) {
|
|
23773
|
-
const base =
|
|
23773
|
+
const base = chunkENUM7GMZ_cjs.resolveBaseTheme(themeName);
|
|
23774
23774
|
if (themeName === "monochrome") {
|
|
23775
23775
|
return {
|
|
23776
23776
|
eventFill: "#ffffff",
|
|
@@ -23829,7 +23829,7 @@ function renderEpc(text2, config) {
|
|
|
23829
23829
|
function renderEpcLayout(layout, config) {
|
|
23830
23830
|
const themeName = config?.theme ?? "default";
|
|
23831
23831
|
const pal = epcPalette(themeName);
|
|
23832
|
-
const fontFamily = config?.fontFamily ??
|
|
23832
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
23833
23833
|
const pad = config?.padding ?? 0;
|
|
23834
23834
|
const { ast } = layout;
|
|
23835
23835
|
const width = layout.width + pad * 2;
|
|
@@ -23839,22 +23839,22 @@ function renderEpcLayout(layout, config) {
|
|
|
23839
23839
|
"style",
|
|
23840
23840
|
{},
|
|
23841
23841
|
`
|
|
23842
|
-
.sx-epc-bg { fill: ${
|
|
23843
|
-
.sx-epc-event { fill: ${pal.eventFill}; stroke: ${pal.eventStroke}; stroke-width: ${
|
|
23844
|
-
.sx-epc-func { fill: ${pal.funcFill}; stroke: ${pal.funcStroke}; stroke-width: ${
|
|
23845
|
-
.sx-epc-conn { fill: ${pal.connFill}; stroke: ${pal.connStroke}; stroke-width: ${
|
|
23842
|
+
.sx-epc-bg { fill: ${chunkENUM7GMZ_cjs.resolveBaseTheme(themeName).bg}; }
|
|
23843
|
+
.sx-epc-event { fill: ${pal.eventFill}; stroke: ${pal.eventStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; stroke-linejoin: round; }
|
|
23844
|
+
.sx-epc-func { fill: ${pal.funcFill}; stroke: ${pal.funcStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
23845
|
+
.sx-epc-conn { fill: ${pal.connFill}; stroke: ${pal.connStroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
23846
23846
|
.sx-epc-node[data-flagged="true"] .sx-epc-event,
|
|
23847
23847
|
.sx-epc-node[data-flagged="true"] .sx-epc-func,
|
|
23848
|
-
.sx-epc-node[data-flagged="true"] .sx-epc-conn { stroke: ${pal.flag}; stroke-width: ${
|
|
23849
|
-
.sx-epc-flagring { fill: none; stroke: ${pal.flag}; stroke-width: ${
|
|
23850
|
-
.sx-epc-label { fill: ${pal.labelText}; font-size: ${
|
|
23848
|
+
.sx-epc-node[data-flagged="true"] .sx-epc-conn { stroke: ${pal.flag}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
23849
|
+
.sx-epc-flagring { fill: none; stroke: ${pal.flag}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; stroke-dasharray: 4 3; }
|
|
23850
|
+
.sx-epc-label { fill: ${pal.labelText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
23851
23851
|
.sx-epc-glyph { fill: ${pal.connGlyph}; font-size: 17px; font-weight: 700; }
|
|
23852
|
-
.sx-epc-edge { fill: none; stroke: ${pal.edge}; stroke-width: ${
|
|
23852
|
+
.sx-epc-edge { fill: none; stroke: ${pal.edge}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
23853
23853
|
.sx-epc-edge[data-back="true"] { stroke: ${pal.backEdge}; stroke-dasharray: 5 4; }
|
|
23854
23854
|
.sx-epc-arrow { fill: ${pal.edge}; stroke: none; }
|
|
23855
23855
|
.sx-epc-arrow-back { fill: ${pal.backEdge}; stroke: none; }
|
|
23856
|
-
.sx-epc-edge-label { fill: ${pal.edgeLabel}; font-size: ${
|
|
23857
|
-
.sx-epc-title { fill: ${pal.labelText}; font-size: ${
|
|
23856
|
+
.sx-epc-edge-label { fill: ${pal.edgeLabel}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
23857
|
+
.sx-epc-title { fill: ${pal.labelText}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
23858
23858
|
`.trim()
|
|
23859
23859
|
);
|
|
23860
23860
|
const children = [
|
|
@@ -24584,8 +24584,8 @@ function renderIdef0(text2, config) {
|
|
|
24584
24584
|
return renderIdef0Layout(layout, config);
|
|
24585
24585
|
}
|
|
24586
24586
|
function renderIdef0Layout(layout, config) {
|
|
24587
|
-
const theme =
|
|
24588
|
-
const fontFamily = config?.fontFamily ??
|
|
24587
|
+
const theme = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
24588
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
24589
24589
|
const pad = config?.padding ?? 0;
|
|
24590
24590
|
const { ast } = layout;
|
|
24591
24591
|
const width = layout.width + pad * 2;
|
|
@@ -24596,22 +24596,22 @@ function renderIdef0Layout(layout, config) {
|
|
|
24596
24596
|
{},
|
|
24597
24597
|
`
|
|
24598
24598
|
.sx-idef0-bg { fill: ${theme.bg}; }
|
|
24599
|
-
.sx-idef0-frame { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
24600
|
-
.sx-idef0-box { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${
|
|
24601
|
-
.sx-idef0-box-name { fill: ${theme.text}; font-size: ${
|
|
24602
|
-
.sx-idef0-box-num { fill: ${theme.textMuted}; font-size: ${
|
|
24603
|
-
.sx-idef0-arrow { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
24599
|
+
.sx-idef0-frame { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
24600
|
+
.sx-idef0-box { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
24601
|
+
.sx-idef0-box-name { fill: ${theme.text}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
24602
|
+
.sx-idef0-box-num { fill: ${theme.textMuted}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; font-weight: 700; }
|
|
24603
|
+
.sx-idef0-arrow { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
24604
24604
|
.sx-idef0-arrow[data-margin="true"] { stroke: ${theme.accent}; }
|
|
24605
24605
|
.sx-idef0-arrow[data-tunneled="true"] { stroke-dasharray: 5 3; }
|
|
24606
24606
|
.sx-idef0-head { fill: ${theme.stroke}; }
|
|
24607
24607
|
.sx-idef0-arrow[data-margin="true"] + .sx-idef0-head, .sx-idef0-head[data-margin="true"] { fill: ${theme.accent}; }
|
|
24608
|
-
.sx-idef0-label { fill: ${theme.text}; font-size: ${
|
|
24609
|
-
.sx-idef0-icom { fill: ${theme.textMuted}; font-size: ${
|
|
24610
|
-
.sx-idef0-title { fill: ${theme.text}; font-size: ${
|
|
24611
|
-
.sx-idef0-meta { fill: ${theme.textMuted}; font-size: ${
|
|
24612
|
-
.sx-idef0-tb { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
24613
|
-
.sx-idef0-tb-text { fill: ${theme.text}; font-size: ${
|
|
24614
|
-
.sx-idef0-tb-key { fill: ${theme.textMuted}; font-size: ${
|
|
24608
|
+
.sx-idef0-label { fill: ${theme.text}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; }
|
|
24609
|
+
.sx-idef0-icom { fill: ${theme.textMuted}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
24610
|
+
.sx-idef0-title { fill: ${theme.text}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
24611
|
+
.sx-idef0-meta { fill: ${theme.textMuted}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; }
|
|
24612
|
+
.sx-idef0-tb { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thin}; }
|
|
24613
|
+
.sx-idef0-tb-text { fill: ${theme.text}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small + 1}px; }
|
|
24614
|
+
.sx-idef0-tb-key { fill: ${theme.textMuted}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
24615
24615
|
`.trim()
|
|
24616
24616
|
);
|
|
24617
24617
|
const children = [
|
|
@@ -25397,8 +25397,8 @@ function renderThreatModel(text2, config) {
|
|
|
25397
25397
|
return renderThreatModelLayout(layout, config);
|
|
25398
25398
|
}
|
|
25399
25399
|
function renderThreatModelLayout(layout, config) {
|
|
25400
|
-
const theme =
|
|
25401
|
-
const fontFamily = config?.fontFamily ??
|
|
25400
|
+
const theme = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
25401
|
+
const fontFamily = config?.fontFamily ?? chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY;
|
|
25402
25402
|
const pad = config?.padding ?? 0;
|
|
25403
25403
|
const width = layout.width + pad * 2;
|
|
25404
25404
|
const height = layout.height + pad * 2;
|
|
@@ -25409,24 +25409,24 @@ function renderThreatModelLayout(layout, config) {
|
|
|
25409
25409
|
{},
|
|
25410
25410
|
`
|
|
25411
25411
|
.sx-tm-bg { fill: ${theme.bg}; }
|
|
25412
|
-
.sx-tm-title { fill: ${theme.text}; font-size: ${
|
|
25413
|
-
.sx-tm-external { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${
|
|
25414
|
-
.sx-tm-process { fill: ${theme.fill}; stroke: ${theme.stroke}; stroke-width: ${
|
|
25415
|
-
.sx-tm-store-line { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
25412
|
+
.sx-tm-title { fill: ${theme.text}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.title}px; font-weight: 700; }
|
|
25413
|
+
.sx-tm-external { fill: ${theme.fillMuted}; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
25414
|
+
.sx-tm-process { fill: ${theme.fill}; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
25415
|
+
.sx-tm-store-line { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
25416
25416
|
.sx-tm-store-bg { fill: ${theme.bg}; stroke: none; }
|
|
25417
|
-
.sx-tm-label { fill: ${theme.text}; font-size: ${
|
|
25418
|
-
.sx-tm-flow { fill: none; stroke: ${theme.stroke}; stroke-width: ${
|
|
25419
|
-
.sx-tm-flow[data-crossing="true"] { stroke: ${danger}; stroke-width: ${
|
|
25417
|
+
.sx-tm-label { fill: ${theme.text}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.label}px; font-weight: 600; }
|
|
25418
|
+
.sx-tm-flow { fill: none; stroke: ${theme.stroke}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; }
|
|
25419
|
+
.sx-tm-flow[data-crossing="true"] { stroke: ${danger}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.thick}; }
|
|
25420
25420
|
.sx-tm-arrow { fill: ${theme.stroke}; stroke: none; }
|
|
25421
25421
|
.sx-tm-arrow[data-crossing="true"] { fill: ${danger}; }
|
|
25422
|
-
.sx-tm-flow-label { fill: ${theme.text}; font-size: ${
|
|
25422
|
+
.sx-tm-flow-label { fill: ${theme.text}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; }
|
|
25423
25423
|
.sx-tm-flow-label[data-crossing="true"] { fill: ${danger}; font-weight: 700; }
|
|
25424
25424
|
.sx-tm-flow-halo { fill: ${theme.bg}; stroke: none; }
|
|
25425
|
-
.sx-tm-boundary { fill: none; stroke: ${danger}; stroke-width: ${
|
|
25426
|
-
.sx-tm-boundary-label { fill: ${danger}; font-size: ${
|
|
25425
|
+
.sx-tm-boundary { fill: none; stroke: ${danger}; stroke-width: ${chunkENUM7GMZ_cjs.STROKE_WIDTH.normal}; stroke-dasharray: 6 4; }
|
|
25426
|
+
.sx-tm-boundary-label { fill: ${danger}; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
25427
25427
|
.sx-tm-badge { fill: ${theme.accent}; }
|
|
25428
25428
|
.sx-tm-badge[data-cond-r="true"] { fill: ${danger}; }
|
|
25429
|
-
.sx-tm-badge-text { fill: #ffffff; font-size: ${
|
|
25429
|
+
.sx-tm-badge-text { fill: #ffffff; font-size: ${chunkENUM7GMZ_cjs.FONT_SIZE.small}px; font-weight: 700; }
|
|
25430
25430
|
`.trim()
|
|
25431
25431
|
);
|
|
25432
25432
|
const markerDefs = chunk3WNW5Y7P_cjs.defs([
|
|
@@ -27303,7 +27303,7 @@ function renderNode5(n, color, theme, fontFamily, orderClass) {
|
|
|
27303
27303
|
);
|
|
27304
27304
|
}
|
|
27305
27305
|
function renderMindmapAST(ast, themeName = "default", fontFamily = "system-ui, -apple-system, sans-serif") {
|
|
27306
|
-
const theme =
|
|
27306
|
+
const theme = chunkENUM7GMZ_cjs.resolveMindmapTheme(ast.themeOverride ?? themeName);
|
|
27307
27307
|
const mode = modeOf(ast);
|
|
27308
27308
|
const isWheel = mode === "futureswheel";
|
|
27309
27309
|
const layout = layoutMindmap(ast);
|
|
@@ -28377,7 +28377,7 @@ function layoutQfd(ast) {
|
|
|
28377
28377
|
const weightW = QFD_WEIGHT_W;
|
|
28378
28378
|
const maxHowW = Math.max(
|
|
28379
28379
|
0,
|
|
28380
|
-
...(ast.qfd?.hows ?? []).map((h) =>
|
|
28380
|
+
...(ast.qfd?.hows ?? []).map((h) => chunkVYQXB2RC_cjs.estimateTextWidth(h.label, QFD_HOW_FONT))
|
|
28381
28381
|
);
|
|
28382
28382
|
const howLabelH = Math.max(48, Math.min(220, Math.ceil(maxHowW * QFD_HOW_ANGLE_SIN) + 26));
|
|
28383
28383
|
const footerH = QFD_FOOTER_H;
|
|
@@ -29387,7 +29387,7 @@ function wrapToLines(textStr, maxChars, maxLines) {
|
|
|
29387
29387
|
return kept;
|
|
29388
29388
|
}
|
|
29389
29389
|
function renderSipocAST(ast, config) {
|
|
29390
|
-
const t =
|
|
29390
|
+
const t = chunkENUM7GMZ_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29391
29391
|
const sipoc = ast.sipoc ?? { suppliers: [], inputs: [], process: [], outputs: [], customers: [] };
|
|
29392
29392
|
const lay = layoutSipoc(ast);
|
|
29393
29393
|
const nodes = [];
|
|
@@ -29509,7 +29509,7 @@ function renderQfdRelationshipSymbol(strength, cx, cy, r6) {
|
|
|
29509
29509
|
});
|
|
29510
29510
|
}
|
|
29511
29511
|
function renderQfdAST(ast, config) {
|
|
29512
|
-
const t =
|
|
29512
|
+
const t = chunkENUM7GMZ_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29513
29513
|
const qfd = ast.qfd ?? { whats: [], hows: [], relationships: [], roof: [], normalize: false };
|
|
29514
29514
|
const lay = layoutQfd(ast);
|
|
29515
29515
|
const importance = computeQfdImportance(qfd);
|
|
@@ -29714,7 +29714,7 @@ function genotypeText(parent, genes) {
|
|
|
29714
29714
|
}).join("");
|
|
29715
29715
|
}
|
|
29716
29716
|
function renderPunnettAST(ast, config) {
|
|
29717
|
-
const t =
|
|
29717
|
+
const t = chunkENUM7GMZ_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29718
29718
|
const pd = ast.punnett;
|
|
29719
29719
|
const lay = layoutPunnett(ast);
|
|
29720
29720
|
const svgWrap = (body, descText2) => chunk3WNW5Y7P_cjs.svgRoot(
|
|
@@ -29829,7 +29829,7 @@ function renderMatrixAST(ast, config) {
|
|
|
29829
29829
|
if (ast.mode === "sipoc") return renderSipocAST(ast, config);
|
|
29830
29830
|
if (ast.mode === "qfd") return renderQfdAST(ast, config);
|
|
29831
29831
|
if (ast.mode === "punnett") return renderPunnettAST(ast, config);
|
|
29832
|
-
const t =
|
|
29832
|
+
const t = chunkENUM7GMZ_cjs.resolveMatrixTheme(config?.theme ?? "default");
|
|
29833
29833
|
const lay = layoutMatrix(ast);
|
|
29834
29834
|
const needsLegendSpace = lay.categories.length > 0 || ast.mode === "correlation";
|
|
29835
29835
|
const extraWidth = needsLegendSpace && lay.plot.x0 + lay.plot.w + 140 > lay.canvasWidth ? 160 : 0;
|
|
@@ -31007,7 +31007,7 @@ function renderEdge7(edge) {
|
|
|
31007
31007
|
return chunk3WNW5Y7P_cjs.group({ class: "lt-erd-edge-group" }, parts);
|
|
31008
31008
|
}
|
|
31009
31009
|
function renderErdAst(result, themeName = "default") {
|
|
31010
|
-
const theme =
|
|
31010
|
+
const theme = chunkENUM7GMZ_cjs.resolveBaseTheme(themeName);
|
|
31011
31011
|
const { entities, edges, width, height, ast } = result;
|
|
31012
31012
|
const cssBlock = chunk3WNW5Y7P_cjs.el("style", {}, buildCss11(theme));
|
|
31013
31013
|
const titleNode = chunk3WNW5Y7P_cjs.title(ast.title ?? "Schematex ERD");
|
|
@@ -32226,7 +32226,7 @@ function renderWire(lw) {
|
|
|
32226
32226
|
return path2 + dot1 + dot2;
|
|
32227
32227
|
}
|
|
32228
32228
|
function renderBreadboardLayout(layout, config) {
|
|
32229
|
-
const theme =
|
|
32229
|
+
const theme = chunkENUM7GMZ_cjs.resolveBaseTheme(config?.theme ?? "default");
|
|
32230
32230
|
const css = buildCss12(theme);
|
|
32231
32231
|
const titleStr = layout.ast.title ?? "Breadboard";
|
|
32232
32232
|
const titleNode = layout.ast.title ? chunk3WNW5Y7P_cjs.text({ x: layout.width / 2, y: 22, class: "lt-bb-title", "text-anchor": "middle" }, layout.ast.title) : "";
|
|
@@ -33099,7 +33099,7 @@ function renderBpmn(textInput, config) {
|
|
|
33099
33099
|
}
|
|
33100
33100
|
function renderBpmnLayout(layout, config) {
|
|
33101
33101
|
const { width, height, ast } = layout;
|
|
33102
|
-
const t =
|
|
33102
|
+
const t = chunkENUM7GMZ_cjs.resolveBpmnTheme(config?.theme ?? "default");
|
|
33103
33103
|
const out = [];
|
|
33104
33104
|
out.push(chunk3WNW5Y7P_cjs.title(ast.title ?? "BPMN diagram"));
|
|
33105
33105
|
out.push(chunk3WNW5Y7P_cjs.desc(`BPMN ${ast.direction} \u2014 ${ast.pools.length} pool(s), ${layout.objects.length} flow object(s).`));
|
|
@@ -38034,8 +38034,8 @@ function resolveOpening(op, rooms, byId, u, unit, errors, warnings) {
|
|
|
38034
38034
|
var r24 = (n) => Math.round(n * 100) / 100;
|
|
38035
38035
|
function buildCss13(t) {
|
|
38036
38036
|
return `
|
|
38037
|
-
.sx-fp { font-family: ${
|
|
38038
|
-
.sx-fp-title { font: ${
|
|
38037
|
+
.sx-fp { font-family: ${chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY}; }
|
|
38038
|
+
.sx-fp-title { font: ${chunkENUM7GMZ_cjs.TITLE.weight} ${chunkENUM7GMZ_cjs.TITLE.size}px sans-serif; fill: ${t.text}; }
|
|
38039
38039
|
.sx-fp-wall { fill: ${t.wallFill}; stroke: none; }
|
|
38040
38040
|
.sx-fp-furn { fill: ${t.furnFill}; stroke: ${t.furnStroke}; stroke-width: 1.2; }
|
|
38041
38041
|
.sx-fp-furn-nofill { fill: none; stroke: ${t.furnStroke}; stroke-width: 1.2; }
|
|
@@ -38073,7 +38073,7 @@ function renderErrorPanel(lay, t) {
|
|
|
38073
38073
|
const w = Math.max(560, ...lines.map((l) => l.length * 6.6 + 48));
|
|
38074
38074
|
const h = 56 + lines.length * 19;
|
|
38075
38075
|
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
38076
|
-
{ viewBox: `0 0 ${r24(w)} ${h}`, class: "sx-fp", role: "img" },
|
|
38076
|
+
{ viewBox: `0 0 ${r24(w)} ${h}`, width: r24(w), height: h, class: "sx-fp", role: "img" },
|
|
38077
38077
|
[
|
|
38078
38078
|
chunk3WNW5Y7P_cjs.title(lay.title),
|
|
38079
38079
|
chunk3WNW5Y7P_cjs.desc(`Floor plan validation failed with ${lines.length} error${lines.length === 1 ? "" : "s"}.`),
|
|
@@ -38275,7 +38275,7 @@ function renderDim(d, c) {
|
|
|
38275
38275
|
);
|
|
38276
38276
|
}
|
|
38277
38277
|
function renderFloorplanLayout(lay, config) {
|
|
38278
|
-
const t =
|
|
38278
|
+
const t = chunkENUM7GMZ_cjs.resolveFloorplanTheme(config?.theme ?? "default");
|
|
38279
38279
|
if (lay.errors.length > 0) return renderErrorPanel(lay, t);
|
|
38280
38280
|
const scale = FLOORPLAN_CONST.scale;
|
|
38281
38281
|
const px = (m) => r24(m * scale);
|
|
@@ -38292,7 +38292,7 @@ function renderFloorplanLayout(lay, config) {
|
|
|
38292
38292
|
const X = (m) => px(m + ox);
|
|
38293
38293
|
const Y = (m) => px(m + oy);
|
|
38294
38294
|
const ctx = { X, Y, px, t, wallT: lay.wallT };
|
|
38295
|
-
const titleH =
|
|
38295
|
+
const titleH = chunkENUM7GMZ_cjs.TITLE.bandH;
|
|
38296
38296
|
const warnH = lay.warnings.length ? lay.warnings.length * 17 + 10 : 0;
|
|
38297
38297
|
const W2 = px(lay.bounds.maxX - lay.bounds.minX + band + tail);
|
|
38298
38298
|
const H2 = px(lay.bounds.maxY - lay.bounds.minY + band + tail) + titleH + warnH;
|
|
@@ -38409,13 +38409,13 @@ function renderFloorplanLayout(lay, config) {
|
|
|
38409
38409
|
const nRooms = lay.rooms.length;
|
|
38410
38410
|
const descText = `${nRooms} room${nRooms === 1 ? "" : "s"}, ${formatArea(lay.totalAreaM2, lay.unit)} total. ${lay.items.length} furniture item${lay.items.length === 1 ? "" : "s"}.` + (lay.warnings.length ? ` Warnings: ${lay.warnings.join("; ")}.` : "");
|
|
38411
38411
|
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
38412
|
-
{ viewBox: `0 0 ${W2} ${H2}`, class: "sx-fp", role: "img" },
|
|
38412
|
+
{ viewBox: `0 0 ${W2} ${H2}`, width: W2, height: H2, class: "sx-fp", role: "img" },
|
|
38413
38413
|
[
|
|
38414
38414
|
chunk3WNW5Y7P_cjs.title(lay.title),
|
|
38415
38415
|
chunk3WNW5Y7P_cjs.desc(descText),
|
|
38416
38416
|
chunk3WNW5Y7P_cjs.el("style", {}, buildCss13(t)),
|
|
38417
38417
|
chunk3WNW5Y7P_cjs.rect({ fill: t.bg, x: 0, y: 0, width: W2, height: H2 }),
|
|
38418
|
-
chunk3WNW5Y7P_cjs.text({ class: "sx-fp-title", x: titleX, y:
|
|
38418
|
+
chunk3WNW5Y7P_cjs.text({ class: "sx-fp-title", x: titleX, y: chunkENUM7GMZ_cjs.TITLE.y, "text-anchor": "middle" }, lay.title),
|
|
38419
38419
|
chunk3WNW5Y7P_cjs.group({ transform: `translate(0,${titleH})` }, [
|
|
38420
38420
|
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-floors" }, floors),
|
|
38421
38421
|
chunk3WNW5Y7P_cjs.group({ class: "sx-fp-furniture" }, furniture),
|
|
@@ -38475,26 +38475,1546 @@ var floorplan = {
|
|
|
38475
38475
|
}
|
|
38476
38476
|
};
|
|
38477
38477
|
|
|
38478
|
+
// src/diagrams/playbook/parser.ts
|
|
38479
|
+
var PlaybookParseError = class extends Error {
|
|
38480
|
+
line;
|
|
38481
|
+
constructor(message, line2) {
|
|
38482
|
+
super(`line ${line2}: ${message}`);
|
|
38483
|
+
this.name = "PlaybookParseError";
|
|
38484
|
+
this.line = line2;
|
|
38485
|
+
}
|
|
38486
|
+
};
|
|
38487
|
+
var isStr2 = (t) => t !== void 0 && "str" in t;
|
|
38488
|
+
var isWord2 = (t, w) => t !== void 0 && "word" in t && (w === void 0 || t.word.toLowerCase() === w);
|
|
38489
|
+
var tokDisplay = (t) => "word" in t ? t.word : `"${t.str}"`;
|
|
38490
|
+
var normalizeQuotes4 = (s) => s.replace(/[“”「」『』]/g, '"').replace(/[‘’]/g, "'");
|
|
38491
|
+
function tokenize8(line2) {
|
|
38492
|
+
const out = [];
|
|
38493
|
+
const re = /"([^"]*)"|(\S+)/g;
|
|
38494
|
+
let m;
|
|
38495
|
+
while (m = re.exec(line2)) {
|
|
38496
|
+
if (m[1] !== void 0) out.push({ str: m[1] });
|
|
38497
|
+
else out.push({ word: m[2] });
|
|
38498
|
+
}
|
|
38499
|
+
return out;
|
|
38500
|
+
}
|
|
38501
|
+
function parseNum2(t, what, ln) {
|
|
38502
|
+
if (!isWord2(t)) throw new PlaybookParseError(`expected a number for ${what}`, ln);
|
|
38503
|
+
const v = Number(t.word);
|
|
38504
|
+
if (!Number.isFinite(v)) throw new PlaybookParseError(`expected a number for ${what}, got "${t.word}"`, ln);
|
|
38505
|
+
return v;
|
|
38506
|
+
}
|
|
38507
|
+
function parseId2(t, what, ln) {
|
|
38508
|
+
if (!isWord2(t)) throw new PlaybookParseError(`expected ${what}`, ln);
|
|
38509
|
+
return t.word;
|
|
38510
|
+
}
|
|
38511
|
+
var COORD = /^([+-]?\d*\.?\d+),([+-]?\d*\.?\d+)$/;
|
|
38512
|
+
var POSITIONS = ["o", "c", "ol", "qb", "rb", "wr", "te", "x", "dl", "lb", "db", "s", "gk"];
|
|
38513
|
+
var NAMED_ROUTES = [
|
|
38514
|
+
"go",
|
|
38515
|
+
"fly",
|
|
38516
|
+
"streak",
|
|
38517
|
+
"vertical",
|
|
38518
|
+
"slant",
|
|
38519
|
+
"flat",
|
|
38520
|
+
"hitch",
|
|
38521
|
+
"out",
|
|
38522
|
+
"in",
|
|
38523
|
+
"dig",
|
|
38524
|
+
"curl",
|
|
38525
|
+
"comeback",
|
|
38526
|
+
"corner",
|
|
38527
|
+
"flag",
|
|
38528
|
+
"post",
|
|
38529
|
+
"wheel",
|
|
38530
|
+
"cross",
|
|
38531
|
+
"drag",
|
|
38532
|
+
"seam",
|
|
38533
|
+
"screen",
|
|
38534
|
+
"dive",
|
|
38535
|
+
"iso",
|
|
38536
|
+
"power",
|
|
38537
|
+
"counter",
|
|
38538
|
+
"sweep",
|
|
38539
|
+
"toss",
|
|
38540
|
+
"draw",
|
|
38541
|
+
"trap"
|
|
38542
|
+
];
|
|
38543
|
+
var RUN_CONCEPTS = /* @__PURE__ */ new Set(["dive", "iso", "power", "counter", "sweep", "toss", "draw", "trap"]);
|
|
38544
|
+
var FORMATIONS = [
|
|
38545
|
+
"i-form",
|
|
38546
|
+
"shotgun",
|
|
38547
|
+
"singleback",
|
|
38548
|
+
"pistol",
|
|
38549
|
+
"trips",
|
|
38550
|
+
"spread",
|
|
38551
|
+
"trips-right",
|
|
38552
|
+
"trips-left",
|
|
38553
|
+
"empty",
|
|
38554
|
+
"goal-line",
|
|
38555
|
+
"wishbone",
|
|
38556
|
+
"4-4-2",
|
|
38557
|
+
"4-3-3",
|
|
38558
|
+
"4-2-3-1",
|
|
38559
|
+
"3-5-2",
|
|
38560
|
+
"4-4-1-1",
|
|
38561
|
+
"4-5-1",
|
|
38562
|
+
"3-4-3",
|
|
38563
|
+
"horns",
|
|
38564
|
+
"1-4-high",
|
|
38565
|
+
"1-4-low",
|
|
38566
|
+
"box",
|
|
38567
|
+
"spread-pnr",
|
|
38568
|
+
"5-out",
|
|
38569
|
+
"4-out"
|
|
38570
|
+
];
|
|
38571
|
+
var DEFENSES = [
|
|
38572
|
+
"4-3",
|
|
38573
|
+
"3-4",
|
|
38574
|
+
"4-4",
|
|
38575
|
+
"nickel",
|
|
38576
|
+
"dime",
|
|
38577
|
+
"cover-0",
|
|
38578
|
+
"cover-1",
|
|
38579
|
+
"cover-2",
|
|
38580
|
+
"cover-3",
|
|
38581
|
+
"cover-4",
|
|
38582
|
+
"cover-6",
|
|
38583
|
+
"man",
|
|
38584
|
+
"zone-2-3",
|
|
38585
|
+
"zone-3-2",
|
|
38586
|
+
"zone-1-3-1",
|
|
38587
|
+
"low-block",
|
|
38588
|
+
"mid-block",
|
|
38589
|
+
"high-press"
|
|
38590
|
+
];
|
|
38591
|
+
var DIRS = ["left", "right"];
|
|
38592
|
+
function parseHeader4(tok, ast, ln) {
|
|
38593
|
+
while (tok.length) {
|
|
38594
|
+
const t = tok.shift();
|
|
38595
|
+
if (isStr2(t)) ast.title = t.str;
|
|
38596
|
+
else if (isWord2(t, "sport")) {
|
|
38597
|
+
const s = parseId2(tok.shift(), "sport", ln).toLowerCase();
|
|
38598
|
+
if (s !== "football" && s !== "basketball" && s !== "soccer") {
|
|
38599
|
+
throw new PlaybookParseError(`sport must be football|basketball|soccer, got "${s}"`, ln);
|
|
38600
|
+
}
|
|
38601
|
+
ast.sport = s;
|
|
38602
|
+
} else throw new PlaybookParseError(`playbook: unexpected token "${tokDisplay(t)}"`, ln);
|
|
38603
|
+
}
|
|
38604
|
+
}
|
|
38605
|
+
function parseField(tok, ast, ln) {
|
|
38606
|
+
while (tok.length) {
|
|
38607
|
+
const t = tok.shift();
|
|
38608
|
+
if (isWord2(t, "down")) ast.down = parseNum2(tok.shift(), "down", ln);
|
|
38609
|
+
else if (isWord2(t, "distance") || isWord2(t, "togo")) ast.distance = parseNum2(tok.shift(), "distance", ln);
|
|
38610
|
+
else if (isWord2(t, "los") || isWord2(t, "ball")) ast.losYard = parseNum2(tok.shift(), "los", ln);
|
|
38611
|
+
else if (isWord2(t, "goal") || isWord2(t, "togoal")) ast.toGoal = parseNum2(tok.shift(), "goal", ln);
|
|
38612
|
+
else if (isWord2(t, "view")) {
|
|
38613
|
+
const v = parseId2(tok.shift(), "view (full|half)", ln).toLowerCase();
|
|
38614
|
+
if (v !== "full" && v !== "half" && v !== "auto") throw new PlaybookParseError(`view must be full|half`, ln);
|
|
38615
|
+
ast.view = v;
|
|
38616
|
+
} else if (isWord2(t, "hash")) {
|
|
38617
|
+
const h = parseId2(tok.shift(), "hash (nfl|college|none)", ln).toLowerCase();
|
|
38618
|
+
if (h !== "nfl" && h !== "college" && h !== "none") throw new PlaybookParseError(`hash must be nfl|college|none`, ln);
|
|
38619
|
+
ast.hash = h;
|
|
38620
|
+
} else throw new PlaybookParseError(`field: unexpected token "${tokDisplay(t)}"`, ln);
|
|
38621
|
+
}
|
|
38622
|
+
}
|
|
38623
|
+
function parseFormation(tok, ast, ln) {
|
|
38624
|
+
let name = parseId2(tok.shift(), "a formation", ln).toLowerCase();
|
|
38625
|
+
let side;
|
|
38626
|
+
const hy = /^(.*)-(left|right)$/.exec(name);
|
|
38627
|
+
if (hy && FORMATIONS.includes(hy[1]) && hy[1] !== "trips") {
|
|
38628
|
+
name = hy[1];
|
|
38629
|
+
side = hy[2];
|
|
38630
|
+
}
|
|
38631
|
+
if (!FORMATIONS.includes(name)) {
|
|
38632
|
+
throw new PlaybookParseError(`unknown formation "${name}"`, ln);
|
|
38633
|
+
}
|
|
38634
|
+
ast.formation = name;
|
|
38635
|
+
while (tok.length) {
|
|
38636
|
+
const t = tok.shift();
|
|
38637
|
+
if (isWord2(t, "left") || isWord2(t, "right")) side = t.word.toLowerCase();
|
|
38638
|
+
else throw new PlaybookParseError(`formation: unexpected token "${tokDisplay(t)}"`, ln);
|
|
38639
|
+
}
|
|
38640
|
+
if (name === "trips-right") ast.formationSide = "right";
|
|
38641
|
+
else if (name === "trips-left") ast.formationSide = "left";
|
|
38642
|
+
else if (side) ast.formationSide = side;
|
|
38643
|
+
}
|
|
38644
|
+
function parseDefense(tok, ast, ln) {
|
|
38645
|
+
const d = parseId2(tok.shift(), "a defensive scheme", ln).toLowerCase();
|
|
38646
|
+
if (!DEFENSES.includes(d)) throw new PlaybookParseError(`unknown defense "${d}"`, ln);
|
|
38647
|
+
ast.defense = d;
|
|
38648
|
+
}
|
|
38649
|
+
function parsePlayer(tok, ast, ln) {
|
|
38650
|
+
const id = parseId2(tok.shift(), "a player id", ln);
|
|
38651
|
+
const posRaw = parseId2(tok.shift(), "a position", ln).toLowerCase();
|
|
38652
|
+
if (!POSITIONS.includes(posRaw)) throw new PlaybookParseError(`unknown position "${posRaw}"`, ln);
|
|
38653
|
+
const isDef = posRaw === "x" || posRaw === "dl" || posRaw === "lb" || posRaw === "db" || posRaw === "s";
|
|
38654
|
+
const p = { id, side: isDef ? "defense" : "offense", pos: posRaw, label: id, line: ln };
|
|
38655
|
+
while (tok.length) {
|
|
38656
|
+
const t = tok.shift();
|
|
38657
|
+
if (isStr2(t)) p.label = t.str;
|
|
38658
|
+
else if (isWord2(t, "label")) {
|
|
38659
|
+
const lt = tok.shift();
|
|
38660
|
+
p.label = isStr2(lt) ? lt.str : parseId2(lt, "a label", ln);
|
|
38661
|
+
} else if (isWord2(t, "at")) {
|
|
38662
|
+
const c = COORD.exec(parseId2(tok.shift(), "x,y", ln));
|
|
38663
|
+
if (!c) throw new PlaybookParseError(`expected "x,y" after at`, ln);
|
|
38664
|
+
p.at = { x: Number(c[1]), y: Number(c[2]) };
|
|
38665
|
+
} else if (isWord2(t, "side")) {
|
|
38666
|
+
const sv = parseId2(tok.shift(), "side", ln).toLowerCase();
|
|
38667
|
+
if (sv !== "offense" && sv !== "defense") throw new PlaybookParseError(`side must be offense|defense`, ln);
|
|
38668
|
+
p.side = sv;
|
|
38669
|
+
} else throw new PlaybookParseError(`player: unexpected token "${tokDisplay(t)}"`, ln);
|
|
38670
|
+
}
|
|
38671
|
+
ast.players.push(p);
|
|
38672
|
+
}
|
|
38673
|
+
function splitNameDir(token) {
|
|
38674
|
+
const m = /^(.*)-(left|right)$/.exec(token.toLowerCase());
|
|
38675
|
+
if (m) return { name: m[1], dir: m[2] };
|
|
38676
|
+
return { name: token.toLowerCase() };
|
|
38677
|
+
}
|
|
38678
|
+
function parseDests(tok) {
|
|
38679
|
+
const pts = [];
|
|
38680
|
+
while (tok.length) {
|
|
38681
|
+
const t = tok.shift();
|
|
38682
|
+
if (isWord2(t, "to") || isWord2(t, "then") || isWord2(t, "->")) continue;
|
|
38683
|
+
if (!isWord2(t)) continue;
|
|
38684
|
+
const c = COORD.exec(t.word);
|
|
38685
|
+
if (c) {
|
|
38686
|
+
const rel = /^[+]/.test(c[1]) || /^[+]/.test(c[2]);
|
|
38687
|
+
pts.push({ x: Number(c[1]), y: Number(c[2]), rel });
|
|
38688
|
+
} else {
|
|
38689
|
+
pts.push({ ref: t.word });
|
|
38690
|
+
}
|
|
38691
|
+
}
|
|
38692
|
+
return pts;
|
|
38693
|
+
}
|
|
38694
|
+
function parseRouteRun(kind, tok, ast, ln) {
|
|
38695
|
+
const player = parseId2(tok.shift(), "a player id", ln);
|
|
38696
|
+
const m = { player, kind, line: ln };
|
|
38697
|
+
const first = tok[0];
|
|
38698
|
+
if (isWord2(first, "to") || isWord2(first, "path")) {
|
|
38699
|
+
tok.shift();
|
|
38700
|
+
m.points = parseDests(tok);
|
|
38701
|
+
ast.moves.push(m);
|
|
38702
|
+
return;
|
|
38703
|
+
}
|
|
38704
|
+
if (isWord2(first)) {
|
|
38705
|
+
const { name, dir } = splitNameDir(first.word);
|
|
38706
|
+
if (NAMED_ROUTES.includes(name)) {
|
|
38707
|
+
tok.shift();
|
|
38708
|
+
m.named = name;
|
|
38709
|
+
if (dir) m.dir = dir;
|
|
38710
|
+
if (kind === "route" && RUN_CONCEPTS.has(name)) m.kind = "run";
|
|
38711
|
+
while (tok.length) {
|
|
38712
|
+
const t = tok.shift();
|
|
38713
|
+
if (isWord2(t) && DIRS.includes(t.word.toLowerCase())) m.dir = t.word.toLowerCase();
|
|
38714
|
+
else if (isWord2(t) && Number.isFinite(Number(t.word))) m.depth = Number(t.word);
|
|
38715
|
+
else if (isWord2(t, "depth")) m.depth = parseNum2(tok.shift(), "depth", ln);
|
|
38716
|
+
else throw new PlaybookParseError(`${kind}: unexpected token "${tokDisplay(t)}"`, ln);
|
|
38717
|
+
}
|
|
38718
|
+
ast.moves.push(m);
|
|
38719
|
+
return;
|
|
38720
|
+
}
|
|
38721
|
+
}
|
|
38722
|
+
m.points = parseDests(tok);
|
|
38723
|
+
if (m.points.length === 0) throw new PlaybookParseError(`${kind} ${player}: needs a route name or destination`, ln);
|
|
38724
|
+
ast.moves.push(m);
|
|
38725
|
+
}
|
|
38726
|
+
function parsePoly(kind, tok, ast, ln) {
|
|
38727
|
+
const player = parseId2(tok.shift(), "a player id", ln);
|
|
38728
|
+
const points = parseDests(tok);
|
|
38729
|
+
if (points.length === 0) throw new PlaybookParseError(`${kind} ${player}: needs a destination (x,y or a landmark)`, ln);
|
|
38730
|
+
ast.moves.push({ player, kind, points, line: ln });
|
|
38731
|
+
}
|
|
38732
|
+
function parseTargeted(kind, tok, ast, ln, optionalTarget = false) {
|
|
38733
|
+
const player = parseId2(tok.shift(), "a player id", ln);
|
|
38734
|
+
const nxt = tok[0];
|
|
38735
|
+
if (isWord2(nxt, "to")) tok.shift();
|
|
38736
|
+
const tgt = tok.shift();
|
|
38737
|
+
if (!tgt) {
|
|
38738
|
+
if (optionalTarget) {
|
|
38739
|
+
ast.moves.push({ player, kind, line: ln });
|
|
38740
|
+
return;
|
|
38741
|
+
}
|
|
38742
|
+
throw new PlaybookParseError(`${kind} ${player}: needs a target (player id, landmark, or x,y)`, ln);
|
|
38743
|
+
}
|
|
38744
|
+
const target = isWord2(tgt) ? tgt.word : tgt.str;
|
|
38745
|
+
ast.moves.push({ player, kind, target, line: ln });
|
|
38746
|
+
}
|
|
38747
|
+
function parsePull(tok, ast, ln) {
|
|
38748
|
+
const player = parseId2(tok.shift(), "a lineman id", ln);
|
|
38749
|
+
const dt = tok.shift();
|
|
38750
|
+
const { dir } = splitNameDir(isWord2(dt) ? dt.word : "");
|
|
38751
|
+
let d = dir;
|
|
38752
|
+
if (!d && isWord2(dt) && DIRS.includes(dt.word.toLowerCase())) d = dt.word.toLowerCase();
|
|
38753
|
+
if (!d) throw new PlaybookParseError(`pull: expected left|right`, ln);
|
|
38754
|
+
ast.moves.push({ player, kind: "pull", named: "power", dir: d, line: ln });
|
|
38755
|
+
}
|
|
38756
|
+
function parseMotion(tok, ast, ln) {
|
|
38757
|
+
const player = parseId2(tok.shift(), "a player id", ln);
|
|
38758
|
+
const m = { player, kind: "motion", line: ln };
|
|
38759
|
+
const dt = tok.shift();
|
|
38760
|
+
if (isWord2(dt) && DIRS.includes(dt.word.toLowerCase())) {
|
|
38761
|
+
m.dir = dt.word.toLowerCase();
|
|
38762
|
+
const n = tok.shift();
|
|
38763
|
+
if (isWord2(n) && Number.isFinite(Number(n.word))) m.depth = Number(n.word);
|
|
38764
|
+
} else if (isWord2(dt, "to")) {
|
|
38765
|
+
m.points = parseDests(tok);
|
|
38766
|
+
} else if (isWord2(dt)) {
|
|
38767
|
+
const c = COORD.exec(dt.word);
|
|
38768
|
+
if (c) m.points = [{ x: Number(c[1]), y: Number(c[2]), rel: /^[+]/.test(c[1]) }];
|
|
38769
|
+
else m.points = [{ ref: dt.word }];
|
|
38770
|
+
} else throw new PlaybookParseError(`motion: expected left|right or a destination`, ln);
|
|
38771
|
+
ast.moves.push(m);
|
|
38772
|
+
}
|
|
38773
|
+
function parseZone(tok, ast, ln) {
|
|
38774
|
+
const z = { x: 0, y: 0, rx: 6, ry: 5, line: ln };
|
|
38775
|
+
while (tok.length) {
|
|
38776
|
+
const t = tok.shift();
|
|
38777
|
+
if (isStr2(t)) z.label = t.str;
|
|
38778
|
+
else if (isWord2(t, "at")) {
|
|
38779
|
+
const c = COORD.exec(parseId2(tok.shift(), "x,y", ln));
|
|
38780
|
+
if (!c) throw new PlaybookParseError(`zone: expected "x,y" after at`, ln);
|
|
38781
|
+
z.x = Number(c[1]);
|
|
38782
|
+
z.y = Number(c[2]);
|
|
38783
|
+
} else if (isWord2(t, "size")) {
|
|
38784
|
+
const st = tok.shift();
|
|
38785
|
+
const m = /^(\d*\.?\d+)x(\d*\.?\d+)$/i.exec(isWord2(st) ? st.word : "");
|
|
38786
|
+
if (!m) throw new PlaybookParseError(`zone size expects "rxXry"`, ln);
|
|
38787
|
+
z.rx = Number(m[1]);
|
|
38788
|
+
z.ry = Number(m[2]);
|
|
38789
|
+
} else if (isWord2(t, "label")) {
|
|
38790
|
+
const lt = tok.shift();
|
|
38791
|
+
z.label = isStr2(lt) ? lt.str : parseId2(lt, "a label", ln);
|
|
38792
|
+
} else throw new PlaybookParseError(`zone: unexpected token "${tokDisplay(t)}"`, ln);
|
|
38793
|
+
}
|
|
38794
|
+
ast.zones.push(z);
|
|
38795
|
+
}
|
|
38796
|
+
function parseHandoff(tok, ast, ln) {
|
|
38797
|
+
const from = parseId2(tok.shift(), "the source id", ln);
|
|
38798
|
+
const to = parseId2(tok.shift(), "the target id", ln);
|
|
38799
|
+
ast.moves.push({ player: from, kind: "handoff", target: to, line: ln });
|
|
38800
|
+
}
|
|
38801
|
+
function parsePlaybook(text2) {
|
|
38802
|
+
const ast = {
|
|
38803
|
+
type: "playbook",
|
|
38804
|
+
title: "Football Play",
|
|
38805
|
+
sport: "football",
|
|
38806
|
+
down: 0,
|
|
38807
|
+
distance: 0,
|
|
38808
|
+
hash: "nfl",
|
|
38809
|
+
view: "auto",
|
|
38810
|
+
formationSide: "right",
|
|
38811
|
+
players: [],
|
|
38812
|
+
moves: [],
|
|
38813
|
+
zones: []
|
|
38814
|
+
};
|
|
38815
|
+
let sawHeader = false;
|
|
38816
|
+
let titleSetByUser = false;
|
|
38817
|
+
const lines = text2.split(/\r?\n/);
|
|
38818
|
+
for (let i = 0; i < lines.length; i++) {
|
|
38819
|
+
const ln = i + 1;
|
|
38820
|
+
const raw = normalizeQuotes4(lines[i]).trim();
|
|
38821
|
+
if (!raw) continue;
|
|
38822
|
+
const all = tokenize8(raw);
|
|
38823
|
+
const tok = [];
|
|
38824
|
+
for (const t of all) {
|
|
38825
|
+
if (isWord2(t) && (t.word.startsWith("#") || t.word.startsWith("//"))) break;
|
|
38826
|
+
tok.push(t);
|
|
38827
|
+
}
|
|
38828
|
+
if (tok.length === 0) continue;
|
|
38829
|
+
const head = tok.shift();
|
|
38830
|
+
if (!isWord2(head)) throw new PlaybookParseError(`unexpected string at line start`, ln);
|
|
38831
|
+
const kw = head.word.toLowerCase();
|
|
38832
|
+
if (kw === "playbook") {
|
|
38833
|
+
const before = ast.title;
|
|
38834
|
+
parseHeader4(tok, ast, ln);
|
|
38835
|
+
if (ast.title !== before) titleSetByUser = true;
|
|
38836
|
+
sawHeader = true;
|
|
38837
|
+
continue;
|
|
38838
|
+
}
|
|
38839
|
+
if (!sawHeader) throw new PlaybookParseError(`the first statement must be the "playbook" header`, ln);
|
|
38840
|
+
if (kw === "field") parseField(tok, ast, ln);
|
|
38841
|
+
else if (kw === "view") {
|
|
38842
|
+
const v = parseId2(tok.shift(), "view (full|half)", ln).toLowerCase();
|
|
38843
|
+
if (v !== "full" && v !== "half" && v !== "auto") throw new PlaybookParseError(`view must be full|half`, ln);
|
|
38844
|
+
ast.view = v;
|
|
38845
|
+
} else if (kw === "formation" || kw === "set") parseFormation(tok, ast, ln);
|
|
38846
|
+
else if (kw === "defense" || kw === "def") parseDefense(tok, ast, ln);
|
|
38847
|
+
else if (kw === "player") parsePlayer(tok, ast, ln);
|
|
38848
|
+
else if (kw === "route") parseRouteRun("route", tok, ast, ln);
|
|
38849
|
+
else if (kw === "run") parseRouteRun("run", tok, ast, ln);
|
|
38850
|
+
else if (kw === "cut") parsePoly("cut", tok, ast, ln);
|
|
38851
|
+
else if (kw === "move") parsePoly("move", tok, ast, ln);
|
|
38852
|
+
else if (kw === "dribble" || kw === "drive") parsePoly("dribble", tok, ast, ln);
|
|
38853
|
+
else if (kw === "pass") parseTargeted("pass", tok, ast, ln);
|
|
38854
|
+
else if (kw === "screen") parseTargeted("screen", tok, ast, ln);
|
|
38855
|
+
else if (kw === "block") parseTargeted("block", tok, ast, ln);
|
|
38856
|
+
else if (kw === "shot" || kw === "shoot") parseTargeted("shot", tok, ast, ln, true);
|
|
38857
|
+
else if (kw === "pull") parsePull(tok, ast, ln);
|
|
38858
|
+
else if (kw === "handoff") parseHandoff(tok, ast, ln);
|
|
38859
|
+
else if (kw === "motion") parseMotion(tok, ast, ln);
|
|
38860
|
+
else if (kw === "zone") parseZone(tok, ast, ln);
|
|
38861
|
+
else throw new PlaybookParseError(`unknown keyword "${kw}"`, ln);
|
|
38862
|
+
}
|
|
38863
|
+
if (!titleSetByUser) {
|
|
38864
|
+
ast.title = ast.sport === "basketball" ? "Basketball Play" : ast.sport === "soccer" ? "Soccer Tactic" : "Football Play";
|
|
38865
|
+
}
|
|
38866
|
+
return ast;
|
|
38867
|
+
}
|
|
38868
|
+
|
|
38869
|
+
// src/diagrams/playbook/geometry/football.ts
|
|
38870
|
+
var K = {
|
|
38871
|
+
scale: 14,
|
|
38872
|
+
olSplit: 1.4,
|
|
38873
|
+
wrSplit: 13,
|
|
38874
|
+
slotSplit: 6,
|
|
38875
|
+
minHalfWidth: 20,
|
|
38876
|
+
margin: 2,
|
|
38877
|
+
hashNfl: 3.08,
|
|
38878
|
+
hashCollege: 6.67
|
|
38879
|
+
};
|
|
38880
|
+
var r25 = (n) => Math.round(n * 100) / 100;
|
|
38881
|
+
var round22 = (p) => ({ x: Math.round(p.x * 100) / 100, y: Math.round(p.y * 100) / 100 });
|
|
38882
|
+
var dirSign = (d) => d === "right" ? 1 : -1;
|
|
38883
|
+
function offensiveLine() {
|
|
38884
|
+
return [
|
|
38885
|
+
{ id: "LT", pos: "ol", label: "T", x: -2 * K.olSplit, y: 0 },
|
|
38886
|
+
{ id: "LG", pos: "ol", label: "G", x: -1 * K.olSplit, y: 0 },
|
|
38887
|
+
{ id: "C", pos: "c", label: "C", x: 0, y: 0 },
|
|
38888
|
+
{ id: "RG", pos: "ol", label: "G", x: 1 * K.olSplit, y: 0 },
|
|
38889
|
+
{ id: "RT", pos: "ol", label: "T", x: 2 * K.olSplit, y: 0 }
|
|
38890
|
+
];
|
|
38891
|
+
}
|
|
38892
|
+
function tightEnd(side) {
|
|
38893
|
+
const s = side === "right" ? 1 : -1;
|
|
38894
|
+
return { id: "Y", pos: "te", label: "Y", x: s * (2 * K.olSplit + 1.3), y: 0 };
|
|
38895
|
+
}
|
|
38896
|
+
function formationRoster(formation, side) {
|
|
38897
|
+
const s = side === "right" ? 1 : -1;
|
|
38898
|
+
const ol = offensiveLine();
|
|
38899
|
+
const X = { id: "X", pos: "wr", label: "X", x: -s * K.wrSplit, y: 0 };
|
|
38900
|
+
const Z = { id: "Z", pos: "wr", label: "Z", x: s * K.wrSplit, y: -1 };
|
|
38901
|
+
switch (formation) {
|
|
38902
|
+
case "i-form":
|
|
38903
|
+
return [
|
|
38904
|
+
...ol,
|
|
38905
|
+
tightEnd(side),
|
|
38906
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -1.5 },
|
|
38907
|
+
{ id: "FB", pos: "rb", label: "F", x: 0, y: -3.6 },
|
|
38908
|
+
{ id: "RB", pos: "rb", label: "RB", x: 0, y: -6.2 },
|
|
38909
|
+
X,
|
|
38910
|
+
Z
|
|
38911
|
+
];
|
|
38912
|
+
case "wishbone":
|
|
38913
|
+
return [
|
|
38914
|
+
...ol,
|
|
38915
|
+
tightEnd(side),
|
|
38916
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -1.5 },
|
|
38917
|
+
{ id: "FB", pos: "rb", label: "F", x: 0, y: -3.4 },
|
|
38918
|
+
{ id: "LH", pos: "rb", label: "H", x: -3.5, y: -5.2 },
|
|
38919
|
+
{ id: "RB", pos: "rb", label: "H", x: 3.5, y: -5.2 },
|
|
38920
|
+
X
|
|
38921
|
+
];
|
|
38922
|
+
case "singleback":
|
|
38923
|
+
return [
|
|
38924
|
+
...ol,
|
|
38925
|
+
tightEnd(side),
|
|
38926
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -1.5 },
|
|
38927
|
+
{ id: "RB", pos: "rb", label: "RB", x: 0, y: -5 },
|
|
38928
|
+
X,
|
|
38929
|
+
{ id: "H", pos: "wr", label: "H", x: s * K.slotSplit, y: -1 },
|
|
38930
|
+
Z
|
|
38931
|
+
];
|
|
38932
|
+
case "pistol":
|
|
38933
|
+
return [
|
|
38934
|
+
...ol,
|
|
38935
|
+
tightEnd(side),
|
|
38936
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -4 },
|
|
38937
|
+
{ id: "RB", pos: "rb", label: "RB", x: 0, y: -7 },
|
|
38938
|
+
X,
|
|
38939
|
+
Z
|
|
38940
|
+
];
|
|
38941
|
+
case "shotgun":
|
|
38942
|
+
return [
|
|
38943
|
+
...ol,
|
|
38944
|
+
tightEnd(side),
|
|
38945
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -5 },
|
|
38946
|
+
{ id: "RB", pos: "rb", label: "RB", x: s * 1.8, y: -5 },
|
|
38947
|
+
X,
|
|
38948
|
+
Z
|
|
38949
|
+
];
|
|
38950
|
+
case "spread":
|
|
38951
|
+
return [
|
|
38952
|
+
...ol,
|
|
38953
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -5 },
|
|
38954
|
+
{ id: "RB", pos: "rb", label: "RB", x: s * 1.8, y: -5 },
|
|
38955
|
+
{ id: "X", pos: "wr", label: "X", x: -13 - 1, y: 0 },
|
|
38956
|
+
{ id: "H", pos: "wr", label: "H", x: -6, y: -1 },
|
|
38957
|
+
{ id: "Y", pos: "wr", label: "Y", x: K.slotSplit, y: -1 },
|
|
38958
|
+
{ id: "Z", pos: "wr", label: "Z", x: K.wrSplit + 1, y: 0 }
|
|
38959
|
+
];
|
|
38960
|
+
case "trips":
|
|
38961
|
+
case "trips-right":
|
|
38962
|
+
case "trips-left": {
|
|
38963
|
+
const t = formation === "trips-left" ? -1 : formation === "trips-right" ? 1 : s;
|
|
38964
|
+
return [
|
|
38965
|
+
...ol,
|
|
38966
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -5 },
|
|
38967
|
+
{ id: "RB", pos: "rb", label: "RB", x: -t * 1.8, y: -5 },
|
|
38968
|
+
{ id: "X", pos: "wr", label: "X", x: -t * (K.wrSplit + 1), y: 0 },
|
|
38969
|
+
{ id: "Z", pos: "wr", label: "Z", x: t * (K.wrSplit + 1), y: 0 },
|
|
38970
|
+
{ id: "H", pos: "wr", label: "H", x: t * 9, y: -1 },
|
|
38971
|
+
{ id: "Y", pos: "wr", label: "Y", x: t * 5, y: -1 }
|
|
38972
|
+
];
|
|
38973
|
+
}
|
|
38974
|
+
case "empty":
|
|
38975
|
+
return [
|
|
38976
|
+
...ol,
|
|
38977
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -5 },
|
|
38978
|
+
{ id: "X", pos: "wr", label: "X", x: -13 - 1, y: 0 },
|
|
38979
|
+
{ id: "H", pos: "wr", label: "H", x: -6 - 1, y: -1 },
|
|
38980
|
+
{ id: "Z", pos: "wr", label: "Z", x: K.wrSplit + 1, y: 0 },
|
|
38981
|
+
{ id: "Y", pos: "wr", label: "Y", x: K.slotSplit + 1, y: -1 },
|
|
38982
|
+
{ id: "H2", pos: "wr", label: "h", x: K.slotSplit - 2, y: -1 }
|
|
38983
|
+
];
|
|
38984
|
+
case "goal-line":
|
|
38985
|
+
return [
|
|
38986
|
+
...ol,
|
|
38987
|
+
{ id: "Y", pos: "te", label: "Y", x: 2 * K.olSplit + 1.3, y: 0 },
|
|
38988
|
+
{ id: "TE2", pos: "te", label: "Y", x: -4.1, y: 0 },
|
|
38989
|
+
{ id: "QB", pos: "qb", label: "QB", x: 0, y: -1.5 },
|
|
38990
|
+
{ id: "FB", pos: "rb", label: "F", x: 0, y: -3.4 },
|
|
38991
|
+
{ id: "RB", pos: "rb", label: "RB", x: 0, y: -5.4 },
|
|
38992
|
+
{ id: "Z", pos: "wr", label: "Z", x: s * 9, y: 0 }
|
|
38993
|
+
];
|
|
38994
|
+
default:
|
|
38995
|
+
return [...ol, { id: "QB", pos: "qb", label: "QB", x: 0, y: -1.5 }];
|
|
38996
|
+
}
|
|
38997
|
+
}
|
|
38998
|
+
function front43(side) {
|
|
38999
|
+
const s = side === "right" ? 1 : -1;
|
|
39000
|
+
return [
|
|
39001
|
+
{ id: "DE_W", pos: "dl", label: "E", x: -3.6, y: 1 },
|
|
39002
|
+
{ id: "DT_W", pos: "dl", label: "T", x: -1.2, y: 1 },
|
|
39003
|
+
{ id: "DT_S", pos: "dl", label: "T", x: 1.2, y: 1 },
|
|
39004
|
+
{ id: "DE_S", pos: "dl", label: "E", x: 3.6, y: 1 },
|
|
39005
|
+
{ id: "WLB", pos: "lb", label: "W", x: -4.5, y: 4.3 },
|
|
39006
|
+
{ id: "MLB", pos: "lb", label: "M", x: 0, y: 4.8 },
|
|
39007
|
+
{ id: "SLB", pos: "lb", label: "S", x: s * 4.5, y: 4.3 }
|
|
39008
|
+
];
|
|
39009
|
+
}
|
|
39010
|
+
function front34(side) {
|
|
39011
|
+
const s = side === "right" ? 1 : -1;
|
|
39012
|
+
return [
|
|
39013
|
+
{ id: "DE_W", pos: "dl", label: "E", x: -2.6, y: 1 },
|
|
39014
|
+
{ id: "NT", pos: "dl", label: "N", x: 0, y: 1 },
|
|
39015
|
+
{ id: "DE_S", pos: "dl", label: "E", x: 2.6, y: 1 },
|
|
39016
|
+
{ id: "WOLB", pos: "lb", label: "W", x: -5.4, y: 3.6 },
|
|
39017
|
+
{ id: "WILB", pos: "lb", label: "M", x: -1.6, y: 4.6 },
|
|
39018
|
+
{ id: "SILB", pos: "lb", label: "M", x: 1.6, y: 4.6 },
|
|
39019
|
+
{ id: "SOLB", pos: "lb", label: "S", x: s * 5.4, y: 3.6 }
|
|
39020
|
+
];
|
|
39021
|
+
}
|
|
39022
|
+
function defensePreset(scheme, side) {
|
|
39023
|
+
const s = side === "right" ? 1 : -1;
|
|
39024
|
+
const cb = (sign, y, label = "C") => ({ id: sign < 0 ? "LCB" : "RCB", pos: "db", label, x: sign * K.wrSplit, y });
|
|
39025
|
+
let front;
|
|
39026
|
+
let cover;
|
|
39027
|
+
let showZones = true;
|
|
39028
|
+
if (scheme === "3-4") {
|
|
39029
|
+
front = front34(side);
|
|
39030
|
+
cover = "cover-2";
|
|
39031
|
+
showZones = false;
|
|
39032
|
+
} else if (scheme === "4-4") {
|
|
39033
|
+
front = [...front43(side), { id: "SS", pos: "s", label: "$", x: s * 6, y: 4.6 }];
|
|
39034
|
+
cover = "cover-3";
|
|
39035
|
+
} else if (scheme === "nickel") {
|
|
39036
|
+
front = front43(side).slice(0, 6);
|
|
39037
|
+
cover = "cover-2";
|
|
39038
|
+
} else if (scheme === "dime") {
|
|
39039
|
+
front = front43(side).slice(0, 5);
|
|
39040
|
+
cover = "cover-3";
|
|
39041
|
+
} else if (scheme.startsWith("cover")) {
|
|
39042
|
+
front = front43(side);
|
|
39043
|
+
cover = scheme;
|
|
39044
|
+
} else {
|
|
39045
|
+
front = front43(side);
|
|
39046
|
+
cover = "cover-2";
|
|
39047
|
+
showZones = false;
|
|
39048
|
+
}
|
|
39049
|
+
const sec = [];
|
|
39050
|
+
const zones = [];
|
|
39051
|
+
switch (cover) {
|
|
39052
|
+
case "cover-0":
|
|
39053
|
+
sec.push(cb(-1, 5.5), cb(1, 5.5), { id: "FS", pos: "s", label: "F", x: -6, y: 5 }, { id: "SS", pos: "s", label: "$", x: s * 6, y: 5 });
|
|
39054
|
+
break;
|
|
39055
|
+
case "cover-1":
|
|
39056
|
+
sec.push(cb(-1, 6), cb(1, 6), { id: "SS", pos: "s", label: "$", x: s * 6, y: 5 }, { id: "FS", pos: "s", label: "F", x: 0, y: 13.5 });
|
|
39057
|
+
zones.push({ x: 0, y: 13.5, rx: 5, ry: 3.5, label: "deep middle" });
|
|
39058
|
+
break;
|
|
39059
|
+
case "cover-2":
|
|
39060
|
+
sec.push(cb(-1, 5), cb(1, 5), { id: "FS", pos: "s", label: "F", x: -9, y: 12.5 }, { id: "SS", pos: "s", label: "$", x: 9, y: 12.5 });
|
|
39061
|
+
zones.push({ x: -9, y: 12.5, rx: 9, ry: 4, label: "deep half" }, { x: 9, y: 12.5, rx: 9, ry: 4, label: "deep half" });
|
|
39062
|
+
break;
|
|
39063
|
+
case "cover-3":
|
|
39064
|
+
sec.push(cb(-1, 11.5), cb(1, 11.5), { id: "FS", pos: "s", label: "F", x: 0, y: 14 }, { id: "SS", pos: "s", label: "$", x: s * 6, y: 5 });
|
|
39065
|
+
zones.push({ x: -13.5, y: 12, rx: 5.8, ry: 3.6, label: "deep \u2153" }, { x: 0, y: 14.5, rx: 5.8, ry: 3.6, label: "deep \u2153" }, { x: 13.5, y: 12, rx: 5.8, ry: 3.6, label: "deep \u2153" });
|
|
39066
|
+
break;
|
|
39067
|
+
case "cover-4":
|
|
39068
|
+
sec.push(cb(-1, 10), cb(1, 10), { id: "FS", pos: "s", label: "F", x: -6, y: 12.5 }, { id: "SS", pos: "s", label: "$", x: 6, y: 12.5 });
|
|
39069
|
+
zones.push({ x: -13, y: 12, rx: 6.5, ry: 4, label: "deep \xBC" }, { x: -5, y: 13, rx: 6.5, ry: 4, label: "deep \xBC" }, { x: 5, y: 13, rx: 6.5, ry: 4, label: "deep \xBC" }, { x: 13, y: 12, rx: 6.5, ry: 4, label: "deep \xBC" });
|
|
39070
|
+
break;
|
|
39071
|
+
case "cover-6":
|
|
39072
|
+
sec.push(cb(-1, 10), cb(1, 5), { id: "FS", pos: "s", label: "F", x: -7, y: 12.5 }, { id: "SS", pos: "s", label: "$", x: 9, y: 12.5 });
|
|
39073
|
+
zones.push({ x: -7, y: 12.5, rx: 7, ry: 4, label: "deep \xBC" }, { x: -13, y: 12, rx: 6.5, ry: 4, label: "deep \xBC" }, { x: 9, y: 12.5, rx: 9, ry: 4, label: "deep \xBD" });
|
|
39074
|
+
break;
|
|
39075
|
+
default:
|
|
39076
|
+
sec.push(cb(-1, 5), cb(1, 5), { id: "FS", pos: "s", label: "F", x: -9, y: 12.5 }, { id: "SS", pos: "s", label: "$", x: 9, y: 12.5 });
|
|
39077
|
+
}
|
|
39078
|
+
return { defenders: [...front, ...sec].slice(0, 11), zones: showZones ? zones : [] };
|
|
39079
|
+
}
|
|
39080
|
+
function passRoute(named, depth, outSign, inSign) {
|
|
39081
|
+
const d = depth;
|
|
39082
|
+
switch (named) {
|
|
39083
|
+
case "go":
|
|
39084
|
+
case "fly":
|
|
39085
|
+
case "streak":
|
|
39086
|
+
case "vertical":
|
|
39087
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 16 }];
|
|
39088
|
+
case "seam":
|
|
39089
|
+
return [{ x: 0, y: 0 }, { x: inSign * 0.5, y: d ?? 14 }];
|
|
39090
|
+
case "slant":
|
|
39091
|
+
return [{ x: 0, y: 0 }, { x: 0, y: 1.6 }, { x: inSign * 4.5, y: 6 }];
|
|
39092
|
+
case "flat":
|
|
39093
|
+
return [{ x: 0, y: 0 }, { x: outSign * 1.5, y: 1 }, { x: outSign * 5.5, y: 2.2 }];
|
|
39094
|
+
case "hitch":
|
|
39095
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 5.5 }, { x: inSign * 1, y: (d ?? 5.5) - 1.2 }];
|
|
39096
|
+
case "out":
|
|
39097
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 10 }, { x: outSign * 5.5, y: d ?? 10 }];
|
|
39098
|
+
case "in":
|
|
39099
|
+
case "dig":
|
|
39100
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 10 }, { x: inSign * 6.5, y: d ?? 10 }];
|
|
39101
|
+
case "curl":
|
|
39102
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 12 }, { x: inSign * 1.6, y: (d ?? 12) - 1.6 }];
|
|
39103
|
+
case "comeback":
|
|
39104
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 14 }, { x: outSign * 2.2, y: (d ?? 14) - 2.4 }];
|
|
39105
|
+
case "corner":
|
|
39106
|
+
case "flag":
|
|
39107
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 10 }, { x: outSign * 5.5, y: (d ?? 10) + 5 }];
|
|
39108
|
+
case "post":
|
|
39109
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 10 }, { x: inSign * 5.5, y: (d ?? 10) + 6 }];
|
|
39110
|
+
case "wheel":
|
|
39111
|
+
return [{ x: 0, y: 0 }, { x: outSign * 3, y: 1 }, { x: outSign * 4, y: d ?? 11 }];
|
|
39112
|
+
case "cross":
|
|
39113
|
+
case "drag":
|
|
39114
|
+
return [{ x: 0, y: 0 }, { x: 0, y: 1.5 }, { x: inSign * 14, y: 3.2 }];
|
|
39115
|
+
case "screen":
|
|
39116
|
+
return [{ x: 0, y: 0 }, { x: 0, y: -1 }, { x: outSign * 4.5, y: -1 }];
|
|
39117
|
+
default:
|
|
39118
|
+
return [{ x: 0, y: 0 }, { x: 0, y: d ?? 10 }];
|
|
39119
|
+
}
|
|
39120
|
+
}
|
|
39121
|
+
function runPath(named, start, dir) {
|
|
39122
|
+
const k = dirSign(dir);
|
|
39123
|
+
switch (named) {
|
|
39124
|
+
case "dive":
|
|
39125
|
+
case "trap":
|
|
39126
|
+
return [start, { x: k * 1, y: 0.5 }, { x: k * 1.6, y: 3.2 }];
|
|
39127
|
+
case "iso":
|
|
39128
|
+
return [start, { x: k * 0.4, y: 0.5 }, { x: k * 0.8, y: 3.4 }];
|
|
39129
|
+
case "power":
|
|
39130
|
+
return [start, { x: start.x + k * 1.4, y: start.y + 1.5 }, { x: k * 2.6, y: 0.6 }, { x: k * 3.6, y: 4.2 }];
|
|
39131
|
+
case "counter":
|
|
39132
|
+
return [start, { x: -k * 1.6, y: start.y + 0.3 }, { x: k * 2.2, y: 0.6 }, { x: k * 3.2, y: 4.2 }];
|
|
39133
|
+
case "sweep":
|
|
39134
|
+
case "toss":
|
|
39135
|
+
return [start, { x: k * 5, y: start.y + 0.6 }, { x: k * 7, y: 1.2 }, { x: k * 7, y: 5 }];
|
|
39136
|
+
case "draw":
|
|
39137
|
+
return [start, { x: 0, y: start.y + 1.5 }, { x: k * 1, y: 3.4 }];
|
|
39138
|
+
default:
|
|
39139
|
+
return [start, { x: k * 1.4, y: 3.2 }];
|
|
39140
|
+
}
|
|
39141
|
+
}
|
|
39142
|
+
var footballModule = {
|
|
39143
|
+
scale: K.scale,
|
|
39144
|
+
yUp: true,
|
|
39145
|
+
buildPlayers(ast) {
|
|
39146
|
+
const players = [];
|
|
39147
|
+
const byId = /* @__PURE__ */ new Map();
|
|
39148
|
+
const add = (p) => {
|
|
39149
|
+
if (byId.has(p.id)) players[byId.get(p.id)] = p;
|
|
39150
|
+
else {
|
|
39151
|
+
byId.set(p.id, players.length);
|
|
39152
|
+
players.push(p);
|
|
39153
|
+
}
|
|
39154
|
+
};
|
|
39155
|
+
if (ast.formation) for (const sl of formationRoster(ast.formation, ast.formationSide)) add({ id: sl.id, side: "offense", pos: sl.pos, label: sl.label, x: sl.x, y: sl.y });
|
|
39156
|
+
if (ast.defense) for (const d of defensePreset(ast.defense, ast.formationSide).defenders) add({ id: d.id, side: "defense", pos: d.pos, label: d.label, x: d.x, y: d.y });
|
|
39157
|
+
for (const p of ast.players) {
|
|
39158
|
+
const at = p.at ?? (byId.has(p.id) ? { x: players[byId.get(p.id)].x, y: players[byId.get(p.id)].y } : { x: 0, y: 0 });
|
|
39159
|
+
add({ id: p.id, side: p.side, pos: p.pos, label: p.label, x: at.x, y: at.y });
|
|
39160
|
+
}
|
|
39161
|
+
return players;
|
|
39162
|
+
},
|
|
39163
|
+
buildZones(ast) {
|
|
39164
|
+
const zones = [];
|
|
39165
|
+
if (ast.defense) zones.push(...defensePreset(ast.defense, ast.formationSide).zones);
|
|
39166
|
+
for (const z of ast.zones) zones.push({ x: z.x, y: z.y, rx: z.rx, ry: z.ry, label: z.label });
|
|
39167
|
+
return zones;
|
|
39168
|
+
},
|
|
39169
|
+
resolveNamed(m, src, players, byId) {
|
|
39170
|
+
const endFor2 = (kind) => m.end ?? ("arrow");
|
|
39171
|
+
if (m.kind === "pull") {
|
|
39172
|
+
const k = dirSign(m.dir ?? "right");
|
|
39173
|
+
const offTackle = 2 * K.olSplit + 0.8;
|
|
39174
|
+
const pts = [{ x: src.x, y: 0 }, { x: src.x, y: -1.3 }, { x: k * offTackle, y: -1.3 }, { x: k * offTackle, y: 1.6 }];
|
|
39175
|
+
return { player: m.player, kind: "pull", style: "solid", points: pts.map(round22), end: "arrow" };
|
|
39176
|
+
}
|
|
39177
|
+
if ((m.kind === "run" || m.kind === "route") && m.named) {
|
|
39178
|
+
if (m.kind === "run") {
|
|
39179
|
+
return { player: m.player, kind: "run", style: "solid", points: runPath(m.named, src, m.dir ?? "right").map(round22), end: "arrow" };
|
|
39180
|
+
}
|
|
39181
|
+
const outSign = m.dir ? dirSign(m.dir) : src.x >= 0 ? 1 : -1;
|
|
39182
|
+
const rel = passRoute(m.named, m.depth, outSign, -outSign);
|
|
39183
|
+
return { player: m.player, kind: "route", style: "solid", points: rel.map((p) => round22({ x: src.x + p.x, y: src.y + p.y })), end: endFor2() };
|
|
39184
|
+
}
|
|
39185
|
+
return null;
|
|
39186
|
+
},
|
|
39187
|
+
bounds(ast, players, moves, zones) {
|
|
39188
|
+
let minX = -20, maxX = K.minHalfWidth, minY = -7, maxY = 6;
|
|
39189
|
+
const ext = (x, y) => {
|
|
39190
|
+
minX = Math.min(minX, x);
|
|
39191
|
+
maxX = Math.max(maxX, x);
|
|
39192
|
+
minY = Math.min(minY, y);
|
|
39193
|
+
maxY = Math.max(maxY, y);
|
|
39194
|
+
};
|
|
39195
|
+
for (const p of players) ext(p.x, p.y);
|
|
39196
|
+
for (const mv of moves) for (const pt of mv.points) ext(pt.x, pt.y);
|
|
39197
|
+
for (const z of zones) {
|
|
39198
|
+
ext(z.x - z.rx, z.y - z.ry);
|
|
39199
|
+
ext(z.x + z.rx, z.y + z.ry);
|
|
39200
|
+
}
|
|
39201
|
+
if (ast.toGoal !== void 0) maxY = Math.max(maxY, ast.toGoal + 11);
|
|
39202
|
+
const m = K.margin;
|
|
39203
|
+
return { minX: minX - m, maxX: maxX + m, minY: minY - m, maxY: maxY + m };
|
|
39204
|
+
},
|
|
39205
|
+
drawField(lay, ctx, t) {
|
|
39206
|
+
const b = lay.bounds;
|
|
39207
|
+
const parts = [];
|
|
39208
|
+
const x1 = ctx.X(b.minX), x2 = ctx.X(b.maxX);
|
|
39209
|
+
if (lay.toGoal !== void 0) {
|
|
39210
|
+
const gl = lay.toGoal;
|
|
39211
|
+
const ezTop = Math.min(gl + 10, b.maxY);
|
|
39212
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-endzone", x: r25(x1), y: r25(ctx.Y(ezTop)), width: r25((b.maxX - b.minX) * K.scale), height: r25((ezTop - gl) * K.scale) }));
|
|
39213
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-goalline", x1: r25(x1), y1: r25(ctx.Y(gl)), x2: r25(x2), y2: r25(ctx.Y(gl)) }));
|
|
39214
|
+
const gy = ctx.Y(Math.min(gl + 10, b.maxY) - 0.2);
|
|
39215
|
+
const cx = ctx.X(0);
|
|
39216
|
+
const up = ctx.px(2.2);
|
|
39217
|
+
const cross = ctx.px(3);
|
|
39218
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-goalpost", x1: r25(cx), y1: r25(gy), x2: r25(cx), y2: r25(gy + ctx.px(1)) }));
|
|
39219
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-goalpost", x1: r25(cx - cross / 2), y1: r25(gy), x2: r25(cx + cross / 2), y2: r25(gy) }));
|
|
39220
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-goalpost", x1: r25(cx - cross / 2), y1: r25(gy), x2: r25(cx - cross / 2), y2: r25(gy - up) }));
|
|
39221
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-goalpost", x1: r25(cx + cross / 2), y1: r25(gy), x2: r25(cx + cross / 2), y2: r25(gy - up) }));
|
|
39222
|
+
}
|
|
39223
|
+
const startY = Math.ceil(b.minY / 5) * 5;
|
|
39224
|
+
for (let yd = startY; yd <= b.maxY; yd += 5) {
|
|
39225
|
+
if (Math.abs(yd) < 1e-6) continue;
|
|
39226
|
+
if (lay.toGoal !== void 0 && yd > lay.toGoal + 0.01) continue;
|
|
39227
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-yard", x1: r25(x1), y1: r25(ctx.Y(yd)), x2: r25(x2), y2: r25(ctx.Y(yd)) }));
|
|
39228
|
+
if (lay.toGoal !== void 0) {
|
|
39229
|
+
const yardNum = lay.toGoal - yd;
|
|
39230
|
+
if (yardNum > 0 && yardNum % 10 === 0) {
|
|
39231
|
+
parts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-yardnum", x: r25(x1 + 12), y: r25(ctx.Y(yd) + 4), "text-anchor": "middle" }, String(yardNum)));
|
|
39232
|
+
parts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-yardnum", x: r25(x2 - 12), y: r25(ctx.Y(yd) + 4), "text-anchor": "middle" }, String(yardNum)));
|
|
39233
|
+
}
|
|
39234
|
+
}
|
|
39235
|
+
}
|
|
39236
|
+
if (lay.hash !== "none") {
|
|
39237
|
+
const hx = lay.hash === "college" ? K.hashCollege : K.hashNfl;
|
|
39238
|
+
const top = lay.toGoal !== void 0 ? Math.min(b.maxY, lay.toGoal) : b.maxY;
|
|
39239
|
+
for (let yd = Math.ceil(b.minY); yd <= top; yd += 1) {
|
|
39240
|
+
for (const sgn of [-1, 1]) {
|
|
39241
|
+
const xc = ctx.X(sgn * hx);
|
|
39242
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-hash", x1: r25(xc - 2), y1: r25(ctx.Y(yd)), x2: r25(xc + 2), y2: r25(ctx.Y(yd)) }));
|
|
39243
|
+
}
|
|
39244
|
+
}
|
|
39245
|
+
}
|
|
39246
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-los", x1: r25(x1), y1: r25(ctx.Y(0)), x2: r25(x2), y2: r25(ctx.Y(0)) }));
|
|
39247
|
+
return chunk3WNW5Y7P_cjs.group({ class: "sx-pb-field-g" }, parts);
|
|
39248
|
+
},
|
|
39249
|
+
legend(lay) {
|
|
39250
|
+
const items = [
|
|
39251
|
+
{ kind: "offense", label: "Offense" },
|
|
39252
|
+
{ kind: "defense", label: "Defense" },
|
|
39253
|
+
{ kind: "run", label: "Route / run" },
|
|
39254
|
+
{ kind: "screen", label: "Block" },
|
|
39255
|
+
{ kind: "motion", label: "Motion" }
|
|
39256
|
+
];
|
|
39257
|
+
if (lay.zones.length) items.push({ kind: "zone", label: "Zone" });
|
|
39258
|
+
return items;
|
|
39259
|
+
}
|
|
39260
|
+
};
|
|
39261
|
+
|
|
39262
|
+
// src/diagrams/playbook/geometry/basketball.ts
|
|
39263
|
+
var K2 = {
|
|
39264
|
+
scale: 11,
|
|
39265
|
+
// x ∈ [-25, 25]
|
|
39266
|
+
half: 47,
|
|
39267
|
+
rimY: 5.25,
|
|
39268
|
+
laneHalf: 8,
|
|
39269
|
+
// NBA lane half-width
|
|
39270
|
+
ftY: 15,
|
|
39271
|
+
ftR: 6,
|
|
39272
|
+
threeR: 23.75,
|
|
39273
|
+
cornerX: 22,
|
|
39274
|
+
cornerMeetY: 14.2,
|
|
39275
|
+
restrictedR: 4,
|
|
39276
|
+
centerR: 6,
|
|
39277
|
+
margin: 2.5
|
|
39278
|
+
};
|
|
39279
|
+
var r26 = (n) => Math.round(n * 100) / 100;
|
|
39280
|
+
var LANDMARKS = {
|
|
39281
|
+
top: { x: 0, y: 28 },
|
|
39282
|
+
rslot: { x: 8, y: 26 },
|
|
39283
|
+
lslot: { x: -8, y: 26 },
|
|
39284
|
+
slot: { x: 8, y: 26 },
|
|
39285
|
+
rwing: { x: 19, y: 17 },
|
|
39286
|
+
lwing: { x: -19, y: 17 },
|
|
39287
|
+
wing: { x: 19, y: 17 },
|
|
39288
|
+
rcorner: { x: 22, y: 3 },
|
|
39289
|
+
lcorner: { x: -22, y: 3 },
|
|
39290
|
+
corner: { x: 22, y: 3 },
|
|
39291
|
+
"rshort-corner": { x: 12, y: 2 },
|
|
39292
|
+
"lshort-corner": { x: -12, y: 2 },
|
|
39293
|
+
relbow: { x: 8, y: 15 },
|
|
39294
|
+
lelbow: { x: -8, y: 15 },
|
|
39295
|
+
elbow: { x: 8, y: 15 },
|
|
39296
|
+
rblock: { x: 8, y: 7 },
|
|
39297
|
+
lblock: { x: -8, y: 7 },
|
|
39298
|
+
block: { x: 8, y: 7 },
|
|
39299
|
+
rdunker: { x: 9, y: 4 },
|
|
39300
|
+
ldunker: { x: -9, y: 4 },
|
|
39301
|
+
"high-post": { x: 0, y: 15 },
|
|
39302
|
+
ft: { x: 0, y: 15 },
|
|
39303
|
+
"free-throw": { x: 0, y: 15 },
|
|
39304
|
+
"rlow-post": { x: 9, y: 8 },
|
|
39305
|
+
"llow-post": { x: -9, y: 8 },
|
|
39306
|
+
rim: { x: 0, y: 5.25 },
|
|
39307
|
+
basket: { x: 0, y: 5.25 },
|
|
39308
|
+
hoop: { x: 0, y: 5.25 },
|
|
39309
|
+
paint: { x: 0, y: 10 }
|
|
39310
|
+
};
|
|
39311
|
+
function setRoster(formation) {
|
|
39312
|
+
const L = LANDMARKS;
|
|
39313
|
+
const at = (lm) => L[lm];
|
|
39314
|
+
const slots = (pts) => pts.map((p, i) => ({ id: String(i + 1), label: String(i + 1), x: p.x, y: p.y }));
|
|
39315
|
+
switch (formation) {
|
|
39316
|
+
case "horns":
|
|
39317
|
+
return slots([at("top"), at("lcorner"), at("rcorner"), at("lelbow"), at("relbow")]);
|
|
39318
|
+
case "1-4-high":
|
|
39319
|
+
return slots([at("top"), at("lwing"), at("rwing"), at("lelbow"), at("relbow")]);
|
|
39320
|
+
case "1-4-low":
|
|
39321
|
+
return slots([at("top"), at("lcorner"), at("rcorner"), at("lblock"), at("rblock")]);
|
|
39322
|
+
case "box":
|
|
39323
|
+
return slots([at("top"), at("lelbow"), at("relbow"), at("lblock"), at("rblock")]);
|
|
39324
|
+
case "spread-pnr":
|
|
39325
|
+
return slots([at("top"), at("lcorner"), at("rcorner"), at("lwing"), { x: 8, y: 24 }]);
|
|
39326
|
+
case "4-out":
|
|
39327
|
+
return slots([at("top"), at("lwing"), at("rwing"), at("lcorner"), at("rblock")]);
|
|
39328
|
+
case "5-out":
|
|
39329
|
+
default:
|
|
39330
|
+
return slots([at("top"), at("lwing"), at("rwing"), at("lcorner"), at("rcorner")]);
|
|
39331
|
+
}
|
|
39332
|
+
}
|
|
39333
|
+
function defenseRoster(scheme, offense) {
|
|
39334
|
+
const zones = [];
|
|
39335
|
+
if (scheme === "man") {
|
|
39336
|
+
const defenders2 = offense.filter((p) => p.side === "offense").slice(0, 5).map((o) => {
|
|
39337
|
+
const dx = -o.x * 0.12;
|
|
39338
|
+
const dy = (K2.rimY - o.y) * 0.18;
|
|
39339
|
+
return { id: "X" + o.id, label: "X" + o.label, x: o.x + dx, y: o.y + dy };
|
|
39340
|
+
});
|
|
39341
|
+
return { defenders: defenders2, zones };
|
|
39342
|
+
}
|
|
39343
|
+
let pts;
|
|
39344
|
+
if (scheme === "zone-3-2") pts = [{ x: 0, y: 20 }, { x: -13, y: 17 }, { x: 13, y: 17 }, { x: -8, y: 8 }, { x: 8, y: 8 }];
|
|
39345
|
+
else if (scheme === "zone-1-3-1") pts = [{ x: 0, y: 22 }, { x: -12, y: 14 }, { x: 0, y: 13 }, { x: 12, y: 14 }, { x: 0, y: 5.5 }];
|
|
39346
|
+
else pts = [{ x: -7, y: 18 }, { x: 7, y: 18 }, { x: 0, y: 9 }, { x: -13, y: 6 }, { x: 13, y: 6 }];
|
|
39347
|
+
const defenders = pts.map((p, i) => ({ id: "X" + (i + 1), label: "X", x: p.x, y: p.y }));
|
|
39348
|
+
return { defenders, zones };
|
|
39349
|
+
}
|
|
39350
|
+
var basketballModule = {
|
|
39351
|
+
scale: K2.scale,
|
|
39352
|
+
yUp: false,
|
|
39353
|
+
buildPlayers(ast) {
|
|
39354
|
+
const players = [];
|
|
39355
|
+
const byId = /* @__PURE__ */ new Map();
|
|
39356
|
+
const add = (p) => {
|
|
39357
|
+
if (byId.has(p.id)) players[byId.get(p.id)] = p;
|
|
39358
|
+
else {
|
|
39359
|
+
byId.set(p.id, players.length);
|
|
39360
|
+
players.push(p);
|
|
39361
|
+
}
|
|
39362
|
+
};
|
|
39363
|
+
for (const sl of setRoster(ast.formation)) add({ id: sl.id, side: "offense", pos: "o", label: sl.label, x: sl.x, y: sl.y });
|
|
39364
|
+
if (ast.defense) for (const d of defenseRoster(ast.defense, players).defenders) add({ id: d.id, side: "defense", pos: "x", label: d.label, x: d.x, y: d.y });
|
|
39365
|
+
for (const p of ast.players) {
|
|
39366
|
+
const at = p.at ?? (byId.has(p.id) ? { x: players[byId.get(p.id)].x, y: players[byId.get(p.id)].y } : { x: 0, y: 0 });
|
|
39367
|
+
add({ id: p.id, side: p.side, pos: p.pos === "c" || p.pos === "ol" ? "o" : p.pos, label: p.label, x: at.x, y: at.y });
|
|
39368
|
+
}
|
|
39369
|
+
return players;
|
|
39370
|
+
},
|
|
39371
|
+
buildZones(ast) {
|
|
39372
|
+
return ast.zones.map((z) => ({ x: z.x, y: z.y, rx: z.rx, ry: z.ry, label: z.label }));
|
|
39373
|
+
},
|
|
39374
|
+
resolveLandmark(name) {
|
|
39375
|
+
return LANDMARKS[name.toLowerCase()] ?? null;
|
|
39376
|
+
},
|
|
39377
|
+
bounds(_ast, players, moves, zones) {
|
|
39378
|
+
let minX = -25, maxX = 25, minY = 0, maxY = 30;
|
|
39379
|
+
const ext = (x, y) => {
|
|
39380
|
+
minX = Math.min(minX, x);
|
|
39381
|
+
maxX = Math.max(maxX, x);
|
|
39382
|
+
minY = Math.min(minY, y);
|
|
39383
|
+
maxY = Math.max(maxY, y);
|
|
39384
|
+
};
|
|
39385
|
+
for (const p of players) ext(p.x, p.y);
|
|
39386
|
+
for (const mv of moves) for (const pt of mv.points) ext(pt.x, pt.y);
|
|
39387
|
+
for (const z of zones) {
|
|
39388
|
+
ext(z.x - z.rx, z.y - z.ry);
|
|
39389
|
+
ext(z.x + z.rx, z.y + z.ry);
|
|
39390
|
+
}
|
|
39391
|
+
const m = K2.margin;
|
|
39392
|
+
return { minX: Math.min(-25, minX) - m * 0.4, maxX: Math.max(25, maxX) + m * 0.4, minY: Math.min(0, minY) - m * 0.4, maxY: Math.min(K2.half, maxY + m * 0.6) };
|
|
39393
|
+
},
|
|
39394
|
+
drawField(_lay, ctx, t) {
|
|
39395
|
+
const parts = [];
|
|
39396
|
+
const X = ctx.X, Y = ctx.Y, px = ctx.px;
|
|
39397
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-court-line", fill: "none", x: r26(X(-8)), y: r26(Y(0)), width: r26(px(2 * K2.laneHalf)), height: r26(px(K2.ftY)) }));
|
|
39398
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-pb-court-line", fill: "none", cx: r26(X(0)), cy: r26(Y(K2.ftY)), r: r26(px(K2.ftR)) }));
|
|
39399
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-court-line", x1: r26(X(-3)), y1: r26(Y(4)), x2: r26(X(3)), y2: r26(Y(4)) }));
|
|
39400
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-pb-rim", fill: "none", cx: r26(X(0)), cy: r26(Y(K2.rimY)), r: r26(px(0.75)) }));
|
|
39401
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: "sx-pb-court-line", fill: "none", d: `M ${r26(X(-4))} ${r26(Y(K2.rimY))} A ${r26(px(K2.restrictedR))} ${r26(px(K2.restrictedR))} 0 0 0 ${r26(X(K2.restrictedR))} ${r26(Y(K2.rimY))}` }));
|
|
39402
|
+
parts.push(chunk3WNW5Y7P_cjs.path({
|
|
39403
|
+
class: "sx-pb-court-line",
|
|
39404
|
+
fill: "none",
|
|
39405
|
+
d: `M ${r26(X(-22))} ${r26(Y(0))} L ${r26(X(-22))} ${r26(Y(K2.cornerMeetY))} A ${r26(px(K2.threeR))} ${r26(px(K2.threeR))} 0 0 0 ${r26(X(K2.cornerX))} ${r26(Y(K2.cornerMeetY))} L ${r26(X(K2.cornerX))} ${r26(Y(0))}`
|
|
39406
|
+
}));
|
|
39407
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: "sx-pb-court-line", fill: "none", d: `M ${r26(X(-6))} ${r26(Y(K2.half))} A ${r26(px(K2.centerR))} ${r26(px(K2.centerR))} 0 0 1 ${r26(X(K2.centerR))} ${r26(Y(K2.half))}` }));
|
|
39408
|
+
return chunk3WNW5Y7P_cjs.group({ class: "sx-pb-field-g" }, parts);
|
|
39409
|
+
},
|
|
39410
|
+
legend() {
|
|
39411
|
+
return [
|
|
39412
|
+
{ kind: "offense", label: "Offense (1\u20135)" },
|
|
39413
|
+
{ kind: "defense", label: "Defense (X)" },
|
|
39414
|
+
{ kind: "run", label: "Cut" },
|
|
39415
|
+
{ kind: "pass", label: "Pass" },
|
|
39416
|
+
{ kind: "dribble", label: "Dribble" },
|
|
39417
|
+
{ kind: "screen", label: "Screen" }
|
|
39418
|
+
];
|
|
39419
|
+
}
|
|
39420
|
+
};
|
|
39421
|
+
|
|
39422
|
+
// src/diagrams/playbook/geometry/soccer.ts
|
|
39423
|
+
var K3 = {
|
|
39424
|
+
scale: 8,
|
|
39425
|
+
L: 105,
|
|
39426
|
+
W: 68,
|
|
39427
|
+
circleR: 9.15,
|
|
39428
|
+
paDepth: 16.5,
|
|
39429
|
+
paHalf: 20.16,
|
|
39430
|
+
// 40.32 / 2
|
|
39431
|
+
gaDepth: 5.5,
|
|
39432
|
+
gaHalf: 9.16,
|
|
39433
|
+
// 18.32 / 2
|
|
39434
|
+
penDist: 11,
|
|
39435
|
+
goalHalf: 3.66,
|
|
39436
|
+
// 7.32 / 2
|
|
39437
|
+
cornerR: 1,
|
|
39438
|
+
margin: 3
|
|
39439
|
+
};
|
|
39440
|
+
var r27 = (n) => Math.round(n * 100) / 100;
|
|
39441
|
+
function formationRoster2(formation) {
|
|
39442
|
+
const p = (id, x, y, gk2 = false) => ({ id, label: id, x, y, gk: gk2 });
|
|
39443
|
+
const back4 = [p("2", 20, 12), p("4", 20, 27), p("5", 20, 41), p("3", 20, 56)];
|
|
39444
|
+
const gk = p("1", 5, 34, true);
|
|
39445
|
+
switch (formation) {
|
|
39446
|
+
case "4-4-2":
|
|
39447
|
+
return [gk, ...back4, p("7", 50, 10), p("6", 50, 27), p("8", 50, 41), p("11", 50, 58), p("9", 80, 28), p("10", 80, 40)];
|
|
39448
|
+
case "4-2-3-1":
|
|
39449
|
+
return [gk, ...back4, p("6", 40, 28), p("8", 40, 40), p("7", 65, 12), p("10", 65, 34), p("11", 65, 56), p("9", 85, 34)];
|
|
39450
|
+
case "4-5-1":
|
|
39451
|
+
return [gk, ...back4, p("6", 48, 27), p("8", 48, 41), p("7", 52, 10), p("11", 52, 58), p("10", 62, 34), p("9", 85, 34)];
|
|
39452
|
+
case "4-4-1-1":
|
|
39453
|
+
return [gk, ...back4, p("7", 50, 10), p("6", 50, 27), p("8", 50, 41), p("11", 50, 58), p("10", 68, 34), p("9", 84, 34)];
|
|
39454
|
+
case "3-5-2":
|
|
39455
|
+
return [gk, p("4", 20, 20), p("5", 20, 34), p("6", 20, 48), p("2", 52, 6), p("3", 52, 62), p("8", 50, 25), p("10", 55, 43), p("7", 45, 34), p("9", 82, 28), p("11", 82, 40)];
|
|
39456
|
+
case "3-4-3":
|
|
39457
|
+
return [gk, p("4", 20, 20), p("5", 20, 34), p("6", 20, 48), p("2", 48, 8), p("8", 48, 28), p("10", 48, 40), p("3", 48, 60), p("7", 82, 14), p("9", 82, 34), p("11", 82, 54)];
|
|
39458
|
+
case "4-3-3":
|
|
39459
|
+
default:
|
|
39460
|
+
return [gk, ...back4, p("6", 42, 34), p("8", 52, 24), p("10", 52, 44), p("7", 82, 12), p("9", 82, 34), p("11", 82, 56)];
|
|
39461
|
+
}
|
|
39462
|
+
}
|
|
39463
|
+
function opponentBlock(scheme) {
|
|
39464
|
+
const cx = scheme === "high-press" ? 45 : scheme === "mid-block" ? 70 : 88;
|
|
39465
|
+
const p = (i, x, y) => ({ id: "X" + i, label: "X", x, y });
|
|
39466
|
+
return [
|
|
39467
|
+
p(1, cx + 12, 34),
|
|
39468
|
+
p(2, cx, 12),
|
|
39469
|
+
p(3, cx, 27),
|
|
39470
|
+
p(4, cx, 41),
|
|
39471
|
+
p(5, cx, 56),
|
|
39472
|
+
p(6, cx - 14, 14),
|
|
39473
|
+
p(7, cx - 14, 28),
|
|
39474
|
+
p(8, cx - 14, 40),
|
|
39475
|
+
p(9, cx - 14, 54),
|
|
39476
|
+
p(10, cx - 26, 28),
|
|
39477
|
+
p(11, cx - 26, 40)
|
|
39478
|
+
];
|
|
39479
|
+
}
|
|
39480
|
+
var LANDMARKS2 = {
|
|
39481
|
+
center: { x: 52.5, y: 34 },
|
|
39482
|
+
"centre-spot": { x: 52.5, y: 34 },
|
|
39483
|
+
box: { x: 96, y: 34 },
|
|
39484
|
+
"top-box": { x: 88.5, y: 34 },
|
|
39485
|
+
d: { x: 84.85, y: 34 },
|
|
39486
|
+
"penalty-arc": { x: 84.85, y: 34 },
|
|
39487
|
+
"penalty-spot": { x: 94, y: 34 },
|
|
39488
|
+
"near-post": { x: 105, y: 30.5 },
|
|
39489
|
+
"far-post": { x: 105, y: 37.7 },
|
|
39490
|
+
goal: { x: 105, y: 34 },
|
|
39491
|
+
"rcorner": { x: 105, y: 2 },
|
|
39492
|
+
"lcorner": { x: 105, y: 66 },
|
|
39493
|
+
"six-yard": { x: 101, y: 34 }
|
|
39494
|
+
};
|
|
39495
|
+
var soccerModule = {
|
|
39496
|
+
scale: K3.scale,
|
|
39497
|
+
yUp: false,
|
|
39498
|
+
buildPlayers(ast) {
|
|
39499
|
+
const players = [];
|
|
39500
|
+
const byId = /* @__PURE__ */ new Map();
|
|
39501
|
+
const add = (pl2) => {
|
|
39502
|
+
if (byId.has(pl2.id)) players[byId.get(pl2.id)] = pl2;
|
|
39503
|
+
else {
|
|
39504
|
+
byId.set(pl2.id, players.length);
|
|
39505
|
+
players.push(pl2);
|
|
39506
|
+
}
|
|
39507
|
+
};
|
|
39508
|
+
for (const sl of formationRoster2(ast.formation)) add({ id: sl.id, side: "offense", pos: sl.gk ? "gk" : "o", label: sl.label, x: sl.x, y: sl.y });
|
|
39509
|
+
if (ast.defense) for (const d of opponentBlock(ast.defense)) add({ id: d.id, side: "defense", pos: "x", label: d.label, x: d.x, y: d.y });
|
|
39510
|
+
for (const pl2 of ast.players) {
|
|
39511
|
+
const at = pl2.at ?? (byId.has(pl2.id) ? { x: players[byId.get(pl2.id)].x, y: players[byId.get(pl2.id)].y } : { x: 0, y: 0 });
|
|
39512
|
+
add({ id: pl2.id, side: pl2.side, pos: pl2.pos === "c" || pl2.pos === "ol" ? "o" : pl2.pos, label: pl2.label, x: at.x, y: at.y });
|
|
39513
|
+
}
|
|
39514
|
+
return players;
|
|
39515
|
+
},
|
|
39516
|
+
buildZones(ast) {
|
|
39517
|
+
return ast.zones.map((z) => ({ x: z.x, y: z.y, rx: z.rx, ry: z.ry, label: z.label }));
|
|
39518
|
+
},
|
|
39519
|
+
resolveLandmark(name) {
|
|
39520
|
+
return LANDMARKS2[name.toLowerCase()] ?? null;
|
|
39521
|
+
},
|
|
39522
|
+
bounds(ast) {
|
|
39523
|
+
const m = K3.margin;
|
|
39524
|
+
if (ast.view === "half") return { minX: 52.5 - m, maxX: K3.L + m, minY: -m, maxY: K3.W + m };
|
|
39525
|
+
return { minX: -m, maxX: K3.L + m, minY: -m, maxY: K3.W + m };
|
|
39526
|
+
},
|
|
39527
|
+
drawField(_lay, ctx, t) {
|
|
39528
|
+
const X = ctx.X, Y = ctx.Y, px = ctx.px;
|
|
39529
|
+
const parts = [];
|
|
39530
|
+
const ln = (x1, y1, x2, y2) => chunk3WNW5Y7P_cjs.line({ class: "sx-pb-pitch-line", x1: r27(X(x1)), y1: r27(Y(y1)), x2: r27(X(x2)), y2: r27(Y(y2)) });
|
|
39531
|
+
const bands = 10;
|
|
39532
|
+
for (let i = 0; i < bands; i++) {
|
|
39533
|
+
if (i % 2 === 0) continue;
|
|
39534
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-stripe", x: r27(X(i * K3.L / bands)), y: r27(Y(0)), width: r27(px(K3.L / bands)), height: r27(px(K3.W)) }));
|
|
39535
|
+
}
|
|
39536
|
+
const cr = px(K3.cornerR);
|
|
39537
|
+
const corners = [[0, 0, 0], [K3.L, 0, 1], [0, K3.W, 2], [K3.L, K3.W, 3]];
|
|
39538
|
+
for (const [cxF, cyF, q] of corners) {
|
|
39539
|
+
const cx = X(cxF), cy = Y(cyF);
|
|
39540
|
+
const sx = cxF === 0 ? 1 : -1;
|
|
39541
|
+
const sy = cyF === 0 ? 1 : -1;
|
|
39542
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: "sx-pb-pitch-line", fill: "none", d: `M ${r27(cx + sx * cr)} ${r27(cy)} A ${r27(cr)} ${r27(cr)} 0 0 ${q === 1 || q === 2 ? 1 : 0} ${r27(cx)} ${r27(cy + sy * cr)}` }));
|
|
39543
|
+
}
|
|
39544
|
+
parts.push(ln(52.5, 0, 52.5, K3.W));
|
|
39545
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-pb-pitch-line", fill: "none", cx: r27(X(52.5)), cy: r27(Y(34)), r: r27(px(K3.circleR)) }));
|
|
39546
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-pb-pitch-dot", cx: r27(X(52.5)), cy: r27(Y(34)), r: 1.6 }));
|
|
39547
|
+
const topY = (half) => Math.min(Y(34 - half), Y(34 + half));
|
|
39548
|
+
for (const end of [0, 1]) {
|
|
39549
|
+
const gx = end === 0 ? 0 : K3.L;
|
|
39550
|
+
const sgn = end === 0 ? 1 : -1;
|
|
39551
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-pitch-line", fill: "none", x: r27(X(Math.min(gx, gx + sgn * K3.paDepth))), y: r27(topY(K3.paHalf)), width: r27(px(K3.paDepth)), height: r27(px(2 * K3.paHalf)) }));
|
|
39552
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-pitch-line", fill: "none", x: r27(X(Math.min(gx, gx + sgn * K3.gaDepth))), y: r27(topY(K3.gaHalf)), width: r27(px(K3.gaDepth)), height: r27(px(2 * K3.gaHalf)) }));
|
|
39553
|
+
const spotX = gx + sgn * K3.penDist;
|
|
39554
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-pb-pitch-dot", cx: r27(X(spotX)), cy: r27(Y(34)), r: 1.4 }));
|
|
39555
|
+
const edgeX = gx + sgn * K3.paDepth;
|
|
39556
|
+
const dy = Math.sqrt(K3.circleR * K3.circleR - (K3.paDepth - K3.penDist) * (K3.paDepth - K3.penDist));
|
|
39557
|
+
const sweep = end === 0 ? 1 : 0;
|
|
39558
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: "sx-pb-pitch-line", fill: "none", d: `M ${r27(X(edgeX))} ${r27(Y(34 - dy))} A ${r27(px(K3.circleR))} ${r27(px(K3.circleR))} 0 0 ${sweep} ${r27(X(edgeX))} ${r27(Y(34 + dy))}` }));
|
|
39559
|
+
const goalX = gx - sgn * 2.2;
|
|
39560
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-goalbox", x: r27(X(Math.min(gx, goalX))), y: r27(topY(K3.goalHalf)), width: r27(px(2.2)), height: r27(px(2 * K3.goalHalf)) }));
|
|
39561
|
+
}
|
|
39562
|
+
return chunk3WNW5Y7P_cjs.group({ class: "sx-pb-field-g" }, parts);
|
|
39563
|
+
},
|
|
39564
|
+
legend() {
|
|
39565
|
+
return [
|
|
39566
|
+
{ kind: "offense", label: "Team" },
|
|
39567
|
+
{ kind: "gk", label: "Keeper" },
|
|
39568
|
+
{ kind: "defense", label: "Opponent" },
|
|
39569
|
+
{ kind: "pass", label: "Pass" },
|
|
39570
|
+
{ kind: "run", label: "Run" },
|
|
39571
|
+
{ kind: "dribble", label: "Dribble" },
|
|
39572
|
+
{ kind: "shot", label: "Shot" }
|
|
39573
|
+
];
|
|
39574
|
+
}
|
|
39575
|
+
};
|
|
39576
|
+
|
|
39577
|
+
// src/diagrams/playbook/layout.ts
|
|
39578
|
+
var MODULES = {
|
|
39579
|
+
football: footballModule,
|
|
39580
|
+
basketball: basketballModule,
|
|
39581
|
+
soccer: soccerModule
|
|
39582
|
+
};
|
|
39583
|
+
function sportModule(sport) {
|
|
39584
|
+
return MODULES[sport];
|
|
39585
|
+
}
|
|
39586
|
+
var round23 = (p) => ({ x: Math.round(p.x * 100) / 100, y: Math.round(p.y * 100) / 100 });
|
|
39587
|
+
function styleFor(sport, kind) {
|
|
39588
|
+
if (kind === "dribble") return "wavy";
|
|
39589
|
+
if (kind === "shot") return sport === "soccer" ? "double" : "solid";
|
|
39590
|
+
if (kind === "pass") return sport === "soccer" ? "solid" : "dashed";
|
|
39591
|
+
if (kind === "motion") return "dashed";
|
|
39592
|
+
if (sport === "soccer" && (kind === "run" || kind === "cut" || kind === "move")) return "dashed";
|
|
39593
|
+
return "solid";
|
|
39594
|
+
}
|
|
39595
|
+
function endFor(kind, override) {
|
|
39596
|
+
if (override) return override;
|
|
39597
|
+
if (kind === "screen" || kind === "block") return "tee";
|
|
39598
|
+
if (kind === "handoff") return "none";
|
|
39599
|
+
return "arrow";
|
|
39600
|
+
}
|
|
39601
|
+
function findPlayer(ref, byId) {
|
|
39602
|
+
if (byId.has(ref)) return byId.get(ref);
|
|
39603
|
+
const lower = ref.toLowerCase();
|
|
39604
|
+
for (const [k, v] of byId) if (k.toLowerCase() === lower) return v;
|
|
39605
|
+
return void 0;
|
|
39606
|
+
}
|
|
39607
|
+
function resolveRef(token, byId, players, mod) {
|
|
39608
|
+
const coord = /^(-?\d*\.?\d+),(-?\d*\.?\d+)$/.exec(token);
|
|
39609
|
+
if (coord) return { x: Number(coord[1]), y: Number(coord[2]) };
|
|
39610
|
+
const pi = findPlayer(token, byId);
|
|
39611
|
+
if (pi !== void 0) return { x: players[pi].x, y: players[pi].y };
|
|
39612
|
+
const lm = mod.resolveLandmark?.(token);
|
|
39613
|
+
if (lm) return { x: lm.x, y: lm.y };
|
|
39614
|
+
return null;
|
|
39615
|
+
}
|
|
39616
|
+
function layoutPlaybook(ast) {
|
|
39617
|
+
const mod = MODULES[ast.sport];
|
|
39618
|
+
const errors = [];
|
|
39619
|
+
const warnings = [];
|
|
39620
|
+
const players = mod.buildPlayers(ast);
|
|
39621
|
+
const byId = /* @__PURE__ */ new Map();
|
|
39622
|
+
players.forEach((p, i) => byId.set(p.id, i));
|
|
39623
|
+
if (players.length === 0) {
|
|
39624
|
+
errors.push("no players \u2014 add a `formation`/set or explicit `player` statements");
|
|
39625
|
+
}
|
|
39626
|
+
const zones = mod.buildZones(ast, players);
|
|
39627
|
+
const moves = [];
|
|
39628
|
+
for (const m of ast.moves) {
|
|
39629
|
+
const srcIdx = findPlayer(m.player, byId);
|
|
39630
|
+
if (srcIdx === void 0) {
|
|
39631
|
+
warnings.push(`move on unknown player "${m.player}" \u2014 skipped`);
|
|
39632
|
+
continue;
|
|
39633
|
+
}
|
|
39634
|
+
const src = { x: players[srcIdx].x, y: players[srcIdx].y };
|
|
39635
|
+
const named = mod.resolveNamed?.(m, src, players, byId, warnings);
|
|
39636
|
+
if (named) {
|
|
39637
|
+
moves.push(named);
|
|
39638
|
+
continue;
|
|
39639
|
+
}
|
|
39640
|
+
const geom = resolveGeneric(m, src, byId, players, mod, ast.sport, warnings);
|
|
39641
|
+
if (geom) moves.push(geom);
|
|
39642
|
+
}
|
|
39643
|
+
const bounds = mod.bounds(ast, players, moves, zones);
|
|
39644
|
+
return {
|
|
39645
|
+
title: ast.title,
|
|
39646
|
+
sport: ast.sport,
|
|
39647
|
+
down: ast.down,
|
|
39648
|
+
distance: ast.distance,
|
|
39649
|
+
losYard: ast.losYard,
|
|
39650
|
+
toGoal: ast.toGoal,
|
|
39651
|
+
hash: ast.hash,
|
|
39652
|
+
view: ast.view === "half" ? "half" : "full",
|
|
39653
|
+
players,
|
|
39654
|
+
moves,
|
|
39655
|
+
zones,
|
|
39656
|
+
bounds,
|
|
39657
|
+
errors,
|
|
39658
|
+
warnings
|
|
39659
|
+
};
|
|
39660
|
+
}
|
|
39661
|
+
function resolveGeneric(m, src, byId, players, mod, sport, warnings) {
|
|
39662
|
+
const style = styleFor(sport, m.kind);
|
|
39663
|
+
if (m.points && m.points.length) {
|
|
39664
|
+
const pts = [{ x: src.x, y: src.y }];
|
|
39665
|
+
let cur = { x: src.x, y: src.y };
|
|
39666
|
+
for (const p of m.points) {
|
|
39667
|
+
if (p.ref) {
|
|
39668
|
+
const r6 = resolveRef(p.ref, byId, players, mod);
|
|
39669
|
+
if (!r6) {
|
|
39670
|
+
warnings.push(`${m.kind} ${m.player}: unknown destination "${p.ref}" \u2014 skipped`);
|
|
39671
|
+
return null;
|
|
39672
|
+
}
|
|
39673
|
+
cur = r6;
|
|
39674
|
+
} else if (p.rel) {
|
|
39675
|
+
cur = { x: cur.x + (p.x ?? 0), y: cur.y + (p.y ?? 0) };
|
|
39676
|
+
} else {
|
|
39677
|
+
cur = { x: p.x ?? cur.x, y: p.y ?? cur.y };
|
|
39678
|
+
}
|
|
39679
|
+
pts.push(cur);
|
|
39680
|
+
}
|
|
39681
|
+
return { player: m.player, kind: m.kind, style, points: pts.map(round23), end: endFor(m.kind, m.end) };
|
|
39682
|
+
}
|
|
39683
|
+
let dest = null;
|
|
39684
|
+
if (m.target) dest = resolveRef(m.target, byId, players, mod);
|
|
39685
|
+
else if (m.kind === "shot") dest = mod.resolveLandmark?.("rim") ?? mod.resolveLandmark?.("goal") ?? null;
|
|
39686
|
+
if (!dest) {
|
|
39687
|
+
warnings.push(`${m.kind} ${m.player}: needs a target/destination \u2014 skipped`);
|
|
39688
|
+
return null;
|
|
39689
|
+
}
|
|
39690
|
+
if (m.kind === "screen" || m.kind === "block") {
|
|
39691
|
+
const dx = dest.x - src.x, dy = dest.y - src.y;
|
|
39692
|
+
const len = Math.hypot(dx, dy) || 1;
|
|
39693
|
+
const gap = sport === "football" ? 0.6 : sport === "basketball" ? 1.2 : 1.6;
|
|
39694
|
+
const stop = Math.max(0, len - gap);
|
|
39695
|
+
const end = { x: src.x + dx / len * stop, y: src.y + dy / len * stop };
|
|
39696
|
+
return { player: m.player, kind: m.kind, style, points: [round23(src), round23(end)], end: "tee" };
|
|
39697
|
+
}
|
|
39698
|
+
return { player: m.player, kind: m.kind, style, points: [round23(src), round23(dest)], end: endFor(m.kind, m.end) };
|
|
39699
|
+
}
|
|
39700
|
+
|
|
39701
|
+
// src/diagrams/playbook/renderer.ts
|
|
39702
|
+
var r28 = (n) => Math.round(n * 100) / 100;
|
|
39703
|
+
function buildCss14(t) {
|
|
39704
|
+
return `
|
|
39705
|
+
.sx-pb { font-family: ${chunkENUM7GMZ_cjs.DEFAULT_FONT_FAMILY}; }
|
|
39706
|
+
.sx-pb-title { font: ${chunkENUM7GMZ_cjs.TITLE.weight} ${chunkENUM7GMZ_cjs.TITLE.size}px sans-serif; fill: ${t.text}; }
|
|
39707
|
+
.sx-pb-field, .sx-pb-turf { fill: ${t.surface}; }
|
|
39708
|
+
.sx-pb-court { fill: ${t.courtSurface}; }
|
|
39709
|
+
.sx-pb-surround { fill: ${t.surround}; }
|
|
39710
|
+
.sx-pb-surround-court { fill: ${t.courtSurround}; }
|
|
39711
|
+
.sx-pb-boundary { fill: none; stroke: ${t.lineBold}; stroke-width: 2.6; }
|
|
39712
|
+
.sx-pb-boundary-court { fill: none; stroke: ${t.courtLine}; stroke-width: 2.6; }
|
|
39713
|
+
.sx-pb-stripe { fill: ${t.surfaceAlt}; }
|
|
39714
|
+
.sx-pb-yard, .sx-pb-pitch-line, .sx-pb-goalbox { fill: none; stroke: ${t.lineSoft}; stroke-width: 1.4; }
|
|
39715
|
+
.sx-pb-court-line { fill: none; stroke: ${t.courtLine}; stroke-width: 1.5; }
|
|
39716
|
+
.sx-pb-hash { fill: none; stroke: ${t.lineSoft}; stroke-width: 1.2; }
|
|
39717
|
+
.sx-pb-los, .sx-pb-goalline { fill: none; stroke: ${t.lineBold}; stroke-width: 2.4; }
|
|
39718
|
+
.sx-pb-goalline { stroke: ${t.goalAccent}; }
|
|
39719
|
+
.sx-pb-goalpost { fill: none; stroke: ${t.goalAccent}; stroke-width: 2.4; stroke-linecap: round; }
|
|
39720
|
+
.sx-pb-endzone { fill: ${t.endzoneFill}; }
|
|
39721
|
+
.sx-pb-yardnum { font: 600 11px sans-serif; fill: ${t.surfaceText}; }
|
|
39722
|
+
.sx-pb-rim { stroke: ${t.rim}; stroke-width: 2.4; }
|
|
39723
|
+
.sx-pb-pitch-dot { fill: ${t.lineBold}; }
|
|
39724
|
+
.sx-pb-zone { fill: ${t.zoneFill}; stroke: ${t.zoneStroke}; stroke-width: 1.3; stroke-dasharray: 5 4; }
|
|
39725
|
+
.sx-pb-zone-text { font: 9px sans-serif; fill: ${t.zoneStroke}; }
|
|
39726
|
+
.sx-pb-move { fill: none; stroke: ${t.moveStroke}; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
|
|
39727
|
+
.sx-pb-move-dash { fill: none; stroke: ${t.moveStroke}; stroke-width: 2.2; stroke-dasharray: 6 4; stroke-linejoin: round; stroke-linecap: round; }
|
|
39728
|
+
.sx-pb-shot { fill: none; stroke: ${t.shotStroke}; stroke-width: 3.4; stroke-linecap: round; }
|
|
39729
|
+
.sx-pb-motion { fill: none; stroke: ${t.motionStroke}; stroke-width: 1.9; stroke-dasharray: 4 3; }
|
|
39730
|
+
.sx-pb-move-fill { fill: ${t.moveStroke}; stroke: none; }
|
|
39731
|
+
.sx-pb-shot-fill { fill: ${t.shotStroke}; stroke: none; }
|
|
39732
|
+
.sx-pb-motion-fill { fill: ${t.motionStroke}; stroke: none; }
|
|
39733
|
+
.sx-pb-o { fill: ${t.offenseFill}; stroke: ${t.offenseStroke}; stroke-width: 2; }
|
|
39734
|
+
.sx-pb-gk { fill: ${t.gkFill}; stroke: ${t.offenseStroke}; stroke-width: 2; }
|
|
39735
|
+
.sx-pb-o-text { font: 700 10.5px sans-serif; fill: ${t.offenseLabel}; }
|
|
39736
|
+
.sx-pb-x { fill: none; stroke: ${t.defenseStroke}; stroke-width: 2.6; stroke-linecap: round; }
|
|
39737
|
+
.sx-pb-x-text { font: 700 9px sans-serif; fill: ${t.defenseStroke}; }
|
|
39738
|
+
.sx-pb-ball { fill: ${t.ballFill}; stroke: ${t.lineBold}; stroke-width: 0.8; }
|
|
39739
|
+
.sx-pb-anno { font: 600 12px sans-serif; fill: ${t.annotation}; }
|
|
39740
|
+
.sx-pb-legend { font: 11px sans-serif; fill: ${t.annotation}; }
|
|
39741
|
+
.sx-pb-error-box { fill: ${t.bg}; stroke: ${t.negative}; stroke-width: 1.5; }
|
|
39742
|
+
.sx-pb-error-title { font: 700 13px ui-monospace, Menlo, monospace; fill: ${t.negative}; }
|
|
39743
|
+
.sx-pb-error-line { font: 12px ui-monospace, Menlo, monospace; fill: ${t.negative}; }
|
|
39744
|
+
`.trim();
|
|
39745
|
+
}
|
|
39746
|
+
function renderErrorPanel2(lay, t) {
|
|
39747
|
+
const lines = lay.errors;
|
|
39748
|
+
const w = Math.max(520, ...lines.map((l) => l.length * 6.6 + 48));
|
|
39749
|
+
const h = 56 + lines.length * 19;
|
|
39750
|
+
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
39751
|
+
{ viewBox: `0 0 ${r28(w)} ${h}`, width: r28(w), height: h, class: "sx-pb", role: "img" },
|
|
39752
|
+
[
|
|
39753
|
+
chunk3WNW5Y7P_cjs.title(lay.title),
|
|
39754
|
+
chunk3WNW5Y7P_cjs.desc(`Playbook validation failed with ${lines.length} error${lines.length === 1 ? "" : "s"}.`),
|
|
39755
|
+
chunk3WNW5Y7P_cjs.el("style", {}, buildCss14(t)),
|
|
39756
|
+
chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-error-box", x: 1, y: 1, width: r28(w - 2), height: h - 2, rx: 6 }),
|
|
39757
|
+
chunk3WNW5Y7P_cjs.text({ class: "sx-pb-error-title", x: 16, y: 26 }, `playbook: ${lines.length} validation error${lines.length === 1 ? "" : "s"}`),
|
|
39758
|
+
...lines.map((e, i) => chunk3WNW5Y7P_cjs.text({ class: "sx-pb-error-line", x: 16, y: 50 + i * 19 }, `\u26A0 ${e}`))
|
|
39759
|
+
]
|
|
39760
|
+
);
|
|
39761
|
+
}
|
|
39762
|
+
function wavyPath(pts, amp = 3.4, wl = 11) {
|
|
39763
|
+
const flat = [];
|
|
39764
|
+
let acc = 0;
|
|
39765
|
+
for (let i = 1; i < pts.length; i++) {
|
|
39766
|
+
const a = pts[i - 1], b = pts[i];
|
|
39767
|
+
const dx = b.x - a.x, dy = b.y - a.y;
|
|
39768
|
+
const segLen = Math.hypot(dx, dy) || 1;
|
|
39769
|
+
const ux = dx / segLen, uy = dy / segLen;
|
|
39770
|
+
const nx = -uy, ny = ux;
|
|
39771
|
+
const lastSeg = i === pts.length - 1;
|
|
39772
|
+
const straightTail = lastSeg ? 9 : 0;
|
|
39773
|
+
const usable = Math.max(0, segLen - straightTail);
|
|
39774
|
+
const steps = Math.max(2, Math.round(usable / 2));
|
|
39775
|
+
for (let s = 0; s <= steps; s++) {
|
|
39776
|
+
const d = usable * s / steps;
|
|
39777
|
+
const off = amp * Math.sin(2 * Math.PI * (acc + d) / wl);
|
|
39778
|
+
flat.push({ x: a.x + ux * d + nx * off, y: a.y + uy * d + ny * off });
|
|
39779
|
+
}
|
|
39780
|
+
acc += usable;
|
|
39781
|
+
if (lastSeg) flat.push({ x: b.x, y: b.y });
|
|
39782
|
+
}
|
|
39783
|
+
return flat.map((p, i) => `${i === 0 ? "M" : "L"} ${r28(p.x)} ${r28(p.y)}`).join(" ");
|
|
39784
|
+
}
|
|
39785
|
+
function arrowHead4(pts, cls) {
|
|
39786
|
+
if (pts.length < 2) return "";
|
|
39787
|
+
const a = pts[pts.length - 2], b = pts[pts.length - 1];
|
|
39788
|
+
const ang = Math.atan2(b.y - a.y, b.x - a.x);
|
|
39789
|
+
const size = 8, wing = 0.42;
|
|
39790
|
+
const p2 = `${r28(b.x - size * Math.cos(ang - wing))},${r28(b.y - size * Math.sin(ang - wing))}`;
|
|
39791
|
+
const p3 = `${r28(b.x - size * Math.cos(ang + wing))},${r28(b.y - size * Math.sin(ang + wing))}`;
|
|
39792
|
+
return chunk3WNW5Y7P_cjs.polygon({ class: cls, points: `${r28(b.x)},${r28(b.y)} ${p2} ${p3}` });
|
|
39793
|
+
}
|
|
39794
|
+
function teeBar(pts, cls) {
|
|
39795
|
+
if (pts.length < 2) return "";
|
|
39796
|
+
const a = pts[pts.length - 2], b = pts[pts.length - 1];
|
|
39797
|
+
const ang = Math.atan2(b.y - a.y, b.x - a.x) + Math.PI / 2;
|
|
39798
|
+
const half = 7;
|
|
39799
|
+
return chunk3WNW5Y7P_cjs.line({ class: cls, x1: r28(b.x - half * Math.cos(ang)), y1: r28(b.y - half * Math.sin(ang)), x2: r28(b.x + half * Math.cos(ang)), y2: r28(b.y + half * Math.sin(ang)) });
|
|
39800
|
+
}
|
|
39801
|
+
function renderMove(mv, ctx) {
|
|
39802
|
+
const pts = mv.points.map((p) => ({ x: ctx.X(p.x), y: ctx.Y(p.y) }));
|
|
39803
|
+
const strokeCls = mv.kind === "motion" ? "sx-pb-motion" : mv.kind === "shot" ? "sx-pb-shot" : mv.style === "dashed" ? "sx-pb-move-dash" : "sx-pb-move";
|
|
39804
|
+
const headCls = mv.kind === "motion" ? "sx-pb-motion-fill" : mv.kind === "shot" ? "sx-pb-shot-fill" : "sx-pb-move-fill";
|
|
39805
|
+
const parts = [];
|
|
39806
|
+
if (mv.style === "wavy") {
|
|
39807
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: strokeCls, d: wavyPath(pts) }));
|
|
39808
|
+
} else {
|
|
39809
|
+
parts.push(chunk3WNW5Y7P_cjs.path({ class: strokeCls, d: pts.map((p, i) => `${i === 0 ? "M" : "L"} ${r28(p.x)} ${r28(p.y)}`).join(" ") }));
|
|
39810
|
+
}
|
|
39811
|
+
if (mv.end === "arrow") parts.push(arrowHead4(pts, headCls));
|
|
39812
|
+
else if (mv.end === "tee") parts.push(teeBar(pts, strokeCls));
|
|
39813
|
+
return chunk3WNW5Y7P_cjs.group({ class: "sx-pb-move-g", "data-kind": mv.kind, "data-player": mv.player }, parts);
|
|
39814
|
+
}
|
|
39815
|
+
function playerSymbol(p, ctx) {
|
|
39816
|
+
const cx = ctx.X(p.x), cy = ctx.Y(p.y), r6 = 10;
|
|
39817
|
+
const parts = [];
|
|
39818
|
+
if (p.side === "defense" || p.pos === "x") {
|
|
39819
|
+
const k = r6 * 0.78;
|
|
39820
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-x", x1: r28(cx - k), y1: r28(cy - k), x2: r28(cx + k), y2: r28(cy + k) }));
|
|
39821
|
+
parts.push(chunk3WNW5Y7P_cjs.line({ class: "sx-pb-x", x1: r28(cx - k), y1: r28(cy + k), x2: r28(cx + k), y2: r28(cy - k) }));
|
|
39822
|
+
if (p.label) parts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-x-text", x: r28(cx + k + 5), y: r28(cy - k + 2), "text-anchor": "middle" }, p.label));
|
|
39823
|
+
} else if (p.pos === "gk") {
|
|
39824
|
+
const h = r6 * 1.15;
|
|
39825
|
+
parts.push(chunk3WNW5Y7P_cjs.polygon({ class: "sx-pb-gk", points: `${r28(cx)},${r28(cy - h)} ${r28(cx + h)},${r28(cy + h * 0.8)} ${r28(cx - h)},${r28(cy + h * 0.8)}` }));
|
|
39826
|
+
parts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-o-text", x: r28(cx), y: r28(cy + 6), "text-anchor": "middle" }, p.label));
|
|
39827
|
+
} else if (p.pos === "c") {
|
|
39828
|
+
parts.push(chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-o", x: r28(cx - r6 * 0.82), y: r28(cy - r6 * 0.82), width: r28(r6 * 1.64), height: r28(r6 * 1.64) }));
|
|
39829
|
+
parts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-o-text", x: r28(cx), y: r28(cy + 3.6), "text-anchor": "middle" }, p.label));
|
|
39830
|
+
} else {
|
|
39831
|
+
parts.push(chunk3WNW5Y7P_cjs.circle({ class: "sx-pb-o", cx: r28(cx), cy: r28(cy), r: r6 }));
|
|
39832
|
+
parts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-o-text", x: r28(cx), y: r28(cy + 3.6), "text-anchor": "middle" }, p.label));
|
|
39833
|
+
}
|
|
39834
|
+
return chunk3WNW5Y7P_cjs.group({ class: "sx-pb-player", "data-side": p.side, "data-id": p.id }, parts);
|
|
39835
|
+
}
|
|
39836
|
+
function legendSwatch(kind, sport) {
|
|
39837
|
+
const moveCls = (dashed) => dashed ? "sx-pb-move-dash" : "sx-pb-move";
|
|
39838
|
+
const arrow2 = chunk3WNW5Y7P_cjs.polygon({ class: "sx-pb-move-fill", points: "20,0 13,-3.5 13,3.5" });
|
|
39839
|
+
switch (kind) {
|
|
39840
|
+
case "offense":
|
|
39841
|
+
return chunk3WNW5Y7P_cjs.circle({ class: "sx-pb-o", cx: 8, cy: 0, r: 6 });
|
|
39842
|
+
case "gk":
|
|
39843
|
+
return chunk3WNW5Y7P_cjs.polygon({ class: "sx-pb-gk", points: "8,-7 15,5 1,5" });
|
|
39844
|
+
case "defense":
|
|
39845
|
+
return `${chunk3WNW5Y7P_cjs.line({ class: "sx-pb-x", x1: 3, y1: -5, x2: 13, y2: 5 })}${chunk3WNW5Y7P_cjs.line({ class: "sx-pb-x", x1: 3, y1: 5, x2: 13, y2: -5 })}`;
|
|
39846
|
+
case "run":
|
|
39847
|
+
return `${chunk3WNW5Y7P_cjs.line({ class: moveCls(sport === "soccer"), x1: 0, y1: 0, x2: 14, y2: 0 })}${arrow2}`;
|
|
39848
|
+
case "pass":
|
|
39849
|
+
return `${chunk3WNW5Y7P_cjs.line({ class: moveCls(sport !== "soccer"), x1: 0, y1: 0, x2: 14, y2: 0 })}${arrow2}`;
|
|
39850
|
+
case "dribble":
|
|
39851
|
+
return `${chunk3WNW5Y7P_cjs.path({ class: "sx-pb-move", d: "M0,0 Q3,-4 6,0 T12,0" })}${chunk3WNW5Y7P_cjs.polygon({ class: "sx-pb-move-fill", points: "20,0 13,-3.5 13,3.5" })}`;
|
|
39852
|
+
case "screen":
|
|
39853
|
+
return `${chunk3WNW5Y7P_cjs.line({ class: "sx-pb-move", x1: 0, y1: 0, x2: 16, y2: 0 })}${chunk3WNW5Y7P_cjs.line({ class: "sx-pb-move", x1: 16, y1: -5, x2: 16, y2: 5 })}`;
|
|
39854
|
+
case "shot":
|
|
39855
|
+
return `${chunk3WNW5Y7P_cjs.line({ class: "sx-pb-shot", x1: 0, y1: 0, x2: 14, y2: 0 })}${chunk3WNW5Y7P_cjs.polygon({ class: "sx-pb-shot-fill", points: "20,0 13,-3.5 13,3.5" })}`;
|
|
39856
|
+
case "motion":
|
|
39857
|
+
return `${chunk3WNW5Y7P_cjs.line({ class: "sx-pb-motion", x1: 0, y1: 0, x2: 14, y2: 0 })}${chunk3WNW5Y7P_cjs.polygon({ class: "sx-pb-motion-fill", points: "20,0 13,-3.5 13,3.5" })}`;
|
|
39858
|
+
case "zone":
|
|
39859
|
+
return chunk3WNW5Y7P_cjs.rect({ class: "sx-pb-zone", x: 0, y: -6, width: 18, height: 12, rx: 6 });
|
|
39860
|
+
default:
|
|
39861
|
+
return "";
|
|
39862
|
+
}
|
|
39863
|
+
}
|
|
39864
|
+
function renderLegend4(items, y, sport) {
|
|
39865
|
+
const parts = [];
|
|
39866
|
+
let cx = 12;
|
|
39867
|
+
for (const it of items) {
|
|
39868
|
+
parts.push(chunk3WNW5Y7P_cjs.group({ transform: `translate(${r28(cx)},${r28(y)})` }, [legendSwatch(it.kind, sport)]));
|
|
39869
|
+
parts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-legend", x: r28(cx + 26), y: r28(y + 4) }, it.label));
|
|
39870
|
+
cx += 26 + it.label.length * 6.5 + 20;
|
|
39871
|
+
}
|
|
39872
|
+
return chunk3WNW5Y7P_cjs.group({ class: "sx-pb-legend-g" }, parts);
|
|
39873
|
+
}
|
|
39874
|
+
function ordinal(n) {
|
|
39875
|
+
return n === 1 ? "1st" : n === 2 ? "2nd" : n === 3 ? "3rd" : n === 4 ? "4th" : `${n}th`;
|
|
39876
|
+
}
|
|
39877
|
+
function renderPlaybookLayout(lay, config) {
|
|
39878
|
+
let themeName = config?.theme ?? "default";
|
|
39879
|
+
if (lay.sport === "soccer" && themeName === "dark") themeName = "default";
|
|
39880
|
+
const t = chunkENUM7GMZ_cjs.resolvePlaybookTheme(themeName);
|
|
39881
|
+
if (lay.errors.length > 0) return renderErrorPanel2(lay, t);
|
|
39882
|
+
const mod = sportModule(lay.sport);
|
|
39883
|
+
const scale = mod.scale;
|
|
39884
|
+
const b = lay.bounds;
|
|
39885
|
+
const titleH = chunkENUM7GMZ_cjs.TITLE.bandH;
|
|
39886
|
+
const annoH = lay.sport === "football" && (lay.down || lay.distance || lay.losYard !== void 0) ? 20 : 0;
|
|
39887
|
+
const topH = titleH + annoH;
|
|
39888
|
+
const legendH = 30;
|
|
39889
|
+
const EDGE = 16;
|
|
39890
|
+
const fieldW = (b.maxX - b.minX) * scale;
|
|
39891
|
+
const fieldH = (b.maxY - b.minY) * scale;
|
|
39892
|
+
const W2 = r28(fieldW + EDGE * 2);
|
|
39893
|
+
const fieldTop = topH + EDGE;
|
|
39894
|
+
const H2 = r28(fieldH + topH + EDGE * 2 + legendH);
|
|
39895
|
+
const X = (u) => r28((u - b.minX) * scale + EDGE);
|
|
39896
|
+
const Y = (v) => r28(mod.yUp ? (b.maxY - v) * scale + fieldTop : (v - b.minY) * scale + fieldTop);
|
|
39897
|
+
const px = (u) => r28(u * scale);
|
|
39898
|
+
const ctx = { X, Y, px };
|
|
39899
|
+
const isCourt = lay.sport === "basketball";
|
|
39900
|
+
const surfaceCls = isCourt ? "sx-pb-court" : lay.sport === "soccer" ? "sx-pb-turf" : "sx-pb-field";
|
|
39901
|
+
const surroundCls = isCourt ? "sx-pb-surround-court" : "sx-pb-surround";
|
|
39902
|
+
const boundaryCls = isCourt ? "sx-pb-boundary-court" : "sx-pb-boundary";
|
|
39903
|
+
const fieldRx = 7;
|
|
39904
|
+
const surround = chunk3WNW5Y7P_cjs.rect({ class: surroundCls, x: 2, y: r28(topH), width: r28(W2 - 4), height: r28(fieldH + EDGE * 2), rx: 12 });
|
|
39905
|
+
const surfaceBase = chunk3WNW5Y7P_cjs.rect({ class: surfaceCls, x: EDGE, y: r28(fieldTop), width: r28(fieldW), height: r28(fieldH), rx: fieldRx });
|
|
39906
|
+
const boundary = chunk3WNW5Y7P_cjs.rect({ class: boundaryCls, x: EDGE, y: r28(fieldTop), width: r28(fieldW), height: r28(fieldH), rx: fieldRx });
|
|
39907
|
+
const clipId = "sx-pb-clip";
|
|
39908
|
+
const clip6 = chunk3WNW5Y7P_cjs.el("clipPath", { id: clipId }, [chunk3WNW5Y7P_cjs.rect({ x: EDGE, y: r28(fieldTop), width: r28(fieldW), height: r28(fieldH), rx: fieldRx })]);
|
|
39909
|
+
const field = chunk3WNW5Y7P_cjs.group({ "clip-path": `url(#${clipId})` }, [mod.drawField(lay, ctx, t)]);
|
|
39910
|
+
const zones = [];
|
|
39911
|
+
for (const z of lay.zones) {
|
|
39912
|
+
zones.push(chunk3WNW5Y7P_cjs.el("ellipse", { class: "sx-pb-zone", cx: X(z.x), cy: Y(z.y), rx: px(z.rx), ry: px(z.ry) }));
|
|
39913
|
+
if (z.label) zones.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-zone-text", x: X(z.x), y: r28(Y(z.y) - px(z.ry) + (mod.yUp ? 11 : -4)), "text-anchor": "middle" }, z.label));
|
|
39914
|
+
}
|
|
39915
|
+
const moves = lay.moves.map((m) => renderMove(m, ctx));
|
|
39916
|
+
const players = lay.players.map((p) => playerSymbol(p, ctx));
|
|
39917
|
+
const ball = lay.sport === "football" ? chunk3WNW5Y7P_cjs.el("ellipse", { class: "sx-pb-ball", cx: X(0), cy: Y(0), rx: 4.5, ry: 2.7 }) : "";
|
|
39918
|
+
const annoParts = [];
|
|
39919
|
+
if (annoH) {
|
|
39920
|
+
const bits = [];
|
|
39921
|
+
if (lay.down) bits.push(ordinal(lay.down) + (lay.distance ? ` & ${lay.distance}` : ""));
|
|
39922
|
+
else if (lay.distance) bits.push(`${lay.distance} to go`);
|
|
39923
|
+
if (lay.losYard !== void 0) bits.push(`ball on ${lay.losYard}`);
|
|
39924
|
+
annoParts.push(chunk3WNW5Y7P_cjs.text({ class: "sx-pb-anno", x: 8, y: titleH + 14 }, bits.join(" \xB7 ")));
|
|
39925
|
+
}
|
|
39926
|
+
const nOff = lay.players.filter((p) => p.side === "offense").length;
|
|
39927
|
+
const nDef = lay.players.filter((p) => p.side === "defense").length;
|
|
39928
|
+
const descText = `${lay.sport} play. ${nOff} ${lay.sport === "football" ? "offensive players" : "players"}, ${nDef} ${lay.sport === "football" ? "defenders" : "opponents"}, ${lay.moves.length} assignment${lay.moves.length === 1 ? "" : "s"}.` + (lay.warnings.length ? ` Warnings: ${lay.warnings.join("; ")}.` : "");
|
|
39929
|
+
return chunk3WNW5Y7P_cjs.svgRoot(
|
|
39930
|
+
{ viewBox: `0 0 ${W2} ${H2}`, width: W2, height: H2, class: "sx-pb", role: "img" },
|
|
39931
|
+
[
|
|
39932
|
+
chunk3WNW5Y7P_cjs.title(lay.title),
|
|
39933
|
+
chunk3WNW5Y7P_cjs.desc(descText),
|
|
39934
|
+
chunk3WNW5Y7P_cjs.el("style", {}, buildCss14(t)),
|
|
39935
|
+
chunk3WNW5Y7P_cjs.rect({ fill: t.bg, x: 0, y: 0, width: W2, height: H2 }),
|
|
39936
|
+
chunk3WNW5Y7P_cjs.el("defs", {}, [clip6]),
|
|
39937
|
+
chunk3WNW5Y7P_cjs.text({ class: "sx-pb-title", x: r28(W2 / 2), y: chunkENUM7GMZ_cjs.TITLE.y, "text-anchor": "middle" }, lay.title),
|
|
39938
|
+
...annoParts,
|
|
39939
|
+
surround,
|
|
39940
|
+
surfaceBase,
|
|
39941
|
+
field,
|
|
39942
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-pb-zones", "clip-path": `url(#${clipId})` }, zones),
|
|
39943
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-pb-moves" }, moves),
|
|
39944
|
+
boundary,
|
|
39945
|
+
chunk3WNW5Y7P_cjs.group({ class: "sx-pb-players" }, players),
|
|
39946
|
+
ball,
|
|
39947
|
+
renderLegend4(mod.legend(lay), fieldH + topH + EDGE * 2 + 18, lay.sport)
|
|
39948
|
+
]
|
|
39949
|
+
);
|
|
39950
|
+
}
|
|
39951
|
+
function renderPlaybook(text2, config) {
|
|
39952
|
+
return renderPlaybookLayout(layoutPlaybook(parsePlaybook(text2)), config);
|
|
39953
|
+
}
|
|
39954
|
+
|
|
39955
|
+
// src/diagrams/playbook/index.ts
|
|
39956
|
+
var playbook = {
|
|
39957
|
+
type: "playbook",
|
|
39958
|
+
detect(text2) {
|
|
39959
|
+
for (const raw of text2.split(/\r?\n/)) {
|
|
39960
|
+
const t = raw.trim();
|
|
39961
|
+
if (!t) continue;
|
|
39962
|
+
if (t.startsWith("#") || t.startsWith("//")) continue;
|
|
39963
|
+
return /^playbook\b/i.test(t);
|
|
39964
|
+
}
|
|
39965
|
+
return false;
|
|
39966
|
+
},
|
|
39967
|
+
parse: parsePlaybook,
|
|
39968
|
+
render(text2, config) {
|
|
39969
|
+
return renderPlaybook(text2, config);
|
|
39970
|
+
},
|
|
39971
|
+
lint(text2) {
|
|
39972
|
+
try {
|
|
39973
|
+
const lay = layoutPlaybook(parsePlaybook(text2));
|
|
39974
|
+
return [
|
|
39975
|
+
...lay.errors.map(
|
|
39976
|
+
(message) => ({
|
|
39977
|
+
severity: "error",
|
|
39978
|
+
code: "playbook/validation",
|
|
39979
|
+
message,
|
|
39980
|
+
fatal: false
|
|
39981
|
+
})
|
|
39982
|
+
),
|
|
39983
|
+
...lay.warnings.map(
|
|
39984
|
+
(message) => ({
|
|
39985
|
+
severity: "warning",
|
|
39986
|
+
code: "playbook/warning",
|
|
39987
|
+
message,
|
|
39988
|
+
fatal: false
|
|
39989
|
+
})
|
|
39990
|
+
)
|
|
39991
|
+
];
|
|
39992
|
+
} catch {
|
|
39993
|
+
return [];
|
|
39994
|
+
}
|
|
39995
|
+
}
|
|
39996
|
+
};
|
|
39997
|
+
|
|
38478
39998
|
// src/core/api.ts
|
|
38479
39999
|
var plugins = [
|
|
38480
|
-
|
|
38481
|
-
|
|
38482
|
-
|
|
38483
|
-
|
|
38484
|
-
|
|
40000
|
+
chunkVY6UZYYL_cjs.genogram,
|
|
40001
|
+
chunkVYQXB2RC_cjs.ecomap,
|
|
40002
|
+
chunk6QZQTASC_cjs.pedigree,
|
|
40003
|
+
chunk6ZD7TCWO_cjs.phylo,
|
|
40004
|
+
chunk35NGXDT2_cjs.sociogram,
|
|
38485
40005
|
chunkJHJJT5H5_cjs.timing,
|
|
38486
|
-
|
|
38487
|
-
|
|
38488
|
-
|
|
38489
|
-
|
|
38490
|
-
|
|
38491
|
-
|
|
38492
|
-
|
|
38493
|
-
|
|
38494
|
-
|
|
40006
|
+
chunk5ZQRHDMQ_cjs.logic,
|
|
40007
|
+
chunk4AC6I7KJ_cjs.circuit,
|
|
40008
|
+
chunkC4Y24X3U_cjs.blockdiagram,
|
|
40009
|
+
chunkINVLJYAE_cjs.ladder,
|
|
40010
|
+
chunkWJXLF42K_cjs.sld,
|
|
40011
|
+
chunkGAQ36VFD_cjs.entity,
|
|
40012
|
+
chunk627GHE2N_cjs.fishbone,
|
|
40013
|
+
chunkITI3STJ6_cjs.venn,
|
|
40014
|
+
chunkOJ3P4IC4_cjs.flowchart,
|
|
38495
40015
|
mindmap,
|
|
38496
40016
|
matrix,
|
|
38497
|
-
|
|
40017
|
+
chunk4OC3CTGE_cjs.orgchart,
|
|
38498
40018
|
decisiontree,
|
|
38499
40019
|
timeline,
|
|
38500
40020
|
state,
|
|
@@ -38522,7 +40042,8 @@ var plugins = [
|
|
|
38522
40042
|
idef0,
|
|
38523
40043
|
threatmodel,
|
|
38524
40044
|
welding,
|
|
38525
|
-
floorplan
|
|
40045
|
+
floorplan,
|
|
40046
|
+
playbook
|
|
38526
40047
|
];
|
|
38527
40048
|
function detectPlugin(text2, config) {
|
|
38528
40049
|
if (config?.type) {
|
|
@@ -38533,7 +40054,7 @@ function detectPlugin(text2, config) {
|
|
|
38533
40054
|
if (plugin.detect(text2)) return plugin;
|
|
38534
40055
|
}
|
|
38535
40056
|
throw new Error(
|
|
38536
|
-
"Cannot detect diagram type. Start your text with 'genogram', 'ecomap', 'pedigree', 'phylo', 'sociogram', 'timing', 'logic', 'circuit', 'blockdiagram', 'ladder', 'sld', 'entity-structure', 'fishbone', 'venn', 'flowchart', 'mindmap', 'matrix', 'orgchart', 'state', 'pid', 'erd', 'breadboard', 'bpmn', 'fbd', 'sfc', 'prisma', 'usecase', 'pert', 'sequence', 'petri', 'network', 'umlclass', 'faulttree', 'bowtie', or '
|
|
40057
|
+
"Cannot detect diagram type. Start your text with 'genogram', 'ecomap', 'pedigree', 'phylo', 'sociogram', 'timing', 'logic', 'circuit', 'blockdiagram', 'ladder', 'sld', 'entity-structure', 'fishbone', 'venn', 'flowchart', 'mindmap', 'matrix', 'orgchart', 'state', 'pid', 'erd', 'breadboard', 'bpmn', 'fbd', 'sfc', 'prisma', 'usecase', 'pert', 'sequence', 'petri', 'network', 'umlclass', 'faulttree', 'bowtie', 'floorplan', or 'playbook'."
|
|
38537
40058
|
);
|
|
38538
40059
|
}
|
|
38539
40060
|
function stripCodeFences(text2) {
|
|
@@ -38702,5 +40223,5 @@ exports.timeline = timeline;
|
|
|
38702
40223
|
exports.umlclass = umlclass;
|
|
38703
40224
|
exports.usecase = usecase;
|
|
38704
40225
|
exports.welding = welding;
|
|
38705
|
-
//# sourceMappingURL=chunk-
|
|
38706
|
-
//# sourceMappingURL=chunk-
|
|
40226
|
+
//# sourceMappingURL=chunk-GTCAJPQR.cjs.map
|
|
40227
|
+
//# sourceMappingURL=chunk-GTCAJPQR.cjs.map
|