@kensnzk/koyu 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/plan/README.md +18 -0
- package/assets/plan/catalog.muro +87 -0
- package/assets/plan/library.muro +26 -0
- package/assets/plan/svg/bathtub.svg +9 -0
- package/assets/plan/svg/bed-double.svg +9 -0
- package/assets/plan/svg/bed-single.svg +8 -0
- package/assets/plan/svg/cabinet.svg +9 -0
- package/assets/plan/svg/chair.svg +8 -0
- package/assets/plan/svg/desk.svg +9 -0
- package/assets/plan/svg/hedge-2m.svg +7 -0
- package/assets/plan/svg/kitchen-sink.svg +10 -0
- package/assets/plan/svg/locker.svg +9 -0
- package/assets/plan/svg/office-chair.svg +25 -0
- package/assets/plan/svg/potted-plant.svg +14 -0
- package/assets/plan/svg/refrigerator.svg +10 -0
- package/assets/plan/svg/shelf.svg +9 -0
- package/assets/plan/svg/shrub-1m.svg +7 -0
- package/assets/plan/svg/sofa-2.svg +9 -0
- package/assets/plan/svg/sofa-3.svg +9 -0
- package/assets/plan/svg/table-rect.svg +7 -0
- package/assets/plan/svg/table-round.svg +7 -0
- package/assets/plan/svg/tree-3m.svg +8 -0
- package/assets/plan/svg/urinal.svg +9 -0
- package/assets/plan/svg/washing-machine-pan.svg +13 -0
- package/assets/plan/svg/washing-machine.svg +10 -0
- package/assets/plan/svg/washstand-500.svg +12 -0
- package/assets/plan/svg/washstand.svg +12 -0
- package/assets/plan/svg/wc-cabinet.svg +14 -0
- package/assets/plan/svg/wc.svg +9 -0
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/core/components.d.ts +31 -0
- package/dist/core/components.d.ts.map +1 -0
- package/dist/core/components.js +167 -0
- package/dist/core/components.js.map +1 -0
- package/dist/core/derive.d.ts +9 -1
- package/dist/core/derive.d.ts.map +1 -1
- package/dist/core/derive.js +33 -3
- package/dist/core/derive.js.map +1 -1
- package/dist/core/diagnose.d.ts +6 -0
- package/dist/core/diagnose.d.ts.map +1 -1
- package/dist/core/diagnose.js +137 -4
- package/dist/core/diagnose.js.map +1 -1
- package/dist/core/model.d.ts +5 -5
- package/dist/core/model.d.ts.map +1 -1
- package/dist/core/model.js +6 -1
- package/dist/core/model.js.map +1 -1
- package/dist/core/parse.d.ts.map +1 -1
- package/dist/core/parse.js +5 -4
- package/dist/core/parse.js.map +1 -1
- package/dist/core/section.d.ts +27 -2
- package/dist/core/section.d.ts.map +1 -1
- package/dist/core/section.js +63 -11
- package/dist/core/section.js.map +1 -1
- package/dist/core/vocabulary.d.ts +20 -4
- package/dist/core/vocabulary.d.ts.map +1 -1
- package/dist/core/vocabulary.js +107 -9
- package/dist/core/vocabulary.js.map +1 -1
- package/dist/draw/component-files.d.ts +8 -0
- package/dist/draw/component-files.d.ts.map +1 -0
- package/dist/draw/component-files.js +35 -0
- package/dist/draw/component-files.js.map +1 -0
- package/dist/draw/component-svg.d.ts +14 -0
- package/dist/draw/component-svg.d.ts.map +1 -0
- package/dist/draw/component-svg.js +67 -0
- package/dist/draw/component-svg.js.map +1 -0
- package/dist/draw/conventions/architectural.d.ts +32 -0
- package/dist/draw/conventions/architectural.d.ts.map +1 -0
- package/dist/draw/conventions/architectural.js +29 -0
- package/dist/draw/conventions/architectural.js.map +1 -0
- package/dist/draw/index.d.ts +2 -2
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/index.js +2 -2
- package/dist/draw/index.js.map +1 -1
- package/dist/draw/marks.d.ts +37 -12
- package/dist/draw/marks.d.ts.map +1 -1
- package/dist/draw/marks.js +508 -38
- package/dist/draw/marks.js.map +1 -1
- package/dist/draw/plan.d.ts +3 -1
- package/dist/draw/plan.d.ts.map +1 -1
- package/dist/draw/plan.js +247 -85
- package/dist/draw/plan.js.map +1 -1
- package/dist/draw/section.d.ts +20 -2
- package/dist/draw/section.d.ts.map +1 -1
- package/dist/draw/section.js +43 -10
- package/dist/draw/section.js.map +1 -1
- package/dist/form.d.ts +2 -2
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.js +21 -3
- package/dist/mcp.js.map +1 -1
- package/dist/parse-file.d.ts +1 -0
- package/dist/parse-file.d.ts.map +1 -1
- package/dist/parse-file.js +1 -0
- package/dist/parse-file.js.map +1 -1
- package/dist/validate/builtin/index.d.ts +4 -2
- package/dist/validate/builtin/index.d.ts.map +1 -1
- package/dist/validate/builtin/index.js +9 -2
- package/dist/validate/builtin/index.js.map +1 -1
- package/dist/validate/builtin/opening-operations.d.ts +63 -0
- package/dist/validate/builtin/opening-operations.d.ts.map +1 -0
- package/dist/validate/builtin/opening-operations.js +406 -0
- package/dist/validate/builtin/opening-operations.js.map +1 -0
- package/editors/vscode/syntaxes/koyu.tmLanguage.json +3 -3
- package/examples/basement/main.muro +3 -3
- package/examples/complex/L1.muro +1 -1
- package/examples/complex/assets.muro +2 -2
- package/examples/complex/main.muro +1 -1
- package/examples/house/L1.muro +3 -3
- package/examples/house/L2.muro +2 -2
- package/examples/house/assets.muro +8 -8
- package/examples/house/main.muro +1 -1
- package/examples/house/site.muro +2 -2
- package/examples/house.muro +6 -6
- package/examples/mansion.muro +1 -1
- package/examples/office.muro +1 -1
- package/examples/steps/06-finished.muro +1 -1
- package/examples/tower/assets.muro +1 -1
- package/examples/tower/main.muro +1 -1
- package/examples/twin/assets.muro +2 -2
- package/examples/twin/main.muro +1 -1
- package/examples/two-rooms.canonical.json +1 -1
- package/examples/two-rooms.muro +1 -1
- package/package.json +7 -4
- package/src/cli.ts +2 -2
- package/src/core/components.ts +224 -0
- package/src/core/derive.ts +47 -4
- package/src/core/diagnose.ts +182 -4
- package/src/core/model.ts +10 -5
- package/src/core/parse.ts +5 -4
- package/src/core/section.ts +107 -8
- package/src/core/vocabulary.ts +115 -9
- package/src/draw/component-files.ts +36 -0
- package/src/draw/component-svg.ts +79 -0
- package/src/draw/conventions/architectural.ts +60 -0
- package/src/draw/index.ts +9 -2
- package/src/draw/marks.ts +564 -44
- package/src/draw/plan.ts +253 -88
- package/src/draw/section.ts +78 -14
- package/src/form.ts +4 -0
- package/src/index.ts +1 -1
- package/src/mcp.ts +21 -3
- package/src/parse-file.ts +1 -0
- package/src/validate/builtin/index.ts +14 -2
- package/src/validate/builtin/opening-operations.ts +519 -0
package/dist/core/vocabulary.js
CHANGED
|
@@ -44,6 +44,86 @@ const retired = (after, instead, base = free()) => ({
|
|
|
44
44
|
* 一つでもドットがあれば運搬層である、というだけの規則にしてある。
|
|
45
45
|
*/
|
|
46
46
|
export const CARRY_NAMESPACE = /^[a-z][a-z0-9_-]*(\.[a-z0-9_-]+)+$/;
|
|
47
|
+
/** Opening operations introduced after the original hinged / sliding / auto set. */
|
|
48
|
+
export const MURO_1_5_OPENING_STYLES = [
|
|
49
|
+
"hinged-double",
|
|
50
|
+
"hinged-unequal",
|
|
51
|
+
"sliding-double",
|
|
52
|
+
"sliding-bypass",
|
|
53
|
+
"auto-single",
|
|
54
|
+
"auto-double",
|
|
55
|
+
"entrance",
|
|
56
|
+
"gate-hinged",
|
|
57
|
+
"gate-hinged-double",
|
|
58
|
+
"gate-sliding",
|
|
59
|
+
"rolling-shutter",
|
|
60
|
+
"overhead",
|
|
61
|
+
"fixed",
|
|
62
|
+
"projecting",
|
|
63
|
+
"curtain-wall",
|
|
64
|
+
];
|
|
65
|
+
/** Every interpreted value accepted by an opening's `style:` attribute. */
|
|
66
|
+
export const OPENING_STYLE_VALUES = [
|
|
67
|
+
"hinged",
|
|
68
|
+
"sliding",
|
|
69
|
+
"auto",
|
|
70
|
+
...MURO_1_5_OPENING_STYLES,
|
|
71
|
+
];
|
|
72
|
+
/** Opening presentation attributes introduced in muro 1.5. */
|
|
73
|
+
export const MURO_1_5_OPENING_ATTRS = ["panels"];
|
|
74
|
+
/** Area attributes introduced with component placement in muro 1.5. */
|
|
75
|
+
export const MURO_1_5_COMPONENT_AREA_ATTRS = [
|
|
76
|
+
"asset",
|
|
77
|
+
"align-x",
|
|
78
|
+
"align-y",
|
|
79
|
+
"offset-x",
|
|
80
|
+
"offset-y",
|
|
81
|
+
"rotate",
|
|
82
|
+
];
|
|
83
|
+
const DOOR_OPENING_STYLES = new Set([
|
|
84
|
+
"hinged",
|
|
85
|
+
"hinged-double",
|
|
86
|
+
"hinged-unequal",
|
|
87
|
+
"sliding",
|
|
88
|
+
"sliding-double",
|
|
89
|
+
"sliding-bypass",
|
|
90
|
+
"auto",
|
|
91
|
+
"auto-single",
|
|
92
|
+
"auto-double",
|
|
93
|
+
"entrance",
|
|
94
|
+
"gate-hinged",
|
|
95
|
+
"gate-hinged-double",
|
|
96
|
+
"gate-sliding",
|
|
97
|
+
"rolling-shutter",
|
|
98
|
+
"overhead",
|
|
99
|
+
]);
|
|
100
|
+
const WINDOW_OPENING_STYLES = new Set([
|
|
101
|
+
"hinged",
|
|
102
|
+
"hinged-double",
|
|
103
|
+
"sliding",
|
|
104
|
+
"sliding-double",
|
|
105
|
+
"sliding-bypass",
|
|
106
|
+
"fixed",
|
|
107
|
+
"projecting",
|
|
108
|
+
"curtain-wall",
|
|
109
|
+
]);
|
|
110
|
+
/**
|
|
111
|
+
* Whether a known opening operation applies to the declared opening kind.
|
|
112
|
+
*
|
|
113
|
+
* Unknown values return true because ATT02 owns that contradiction. This check only partitions
|
|
114
|
+
* the closed vocabulary and therefore never emits a second diagnostic for one misspelling.
|
|
115
|
+
*/
|
|
116
|
+
export function openingStyleAppliesTo(kind, style) {
|
|
117
|
+
if (!OPENING_STYLE_VALUES.includes(style))
|
|
118
|
+
return true;
|
|
119
|
+
return (kind === "door" ? DOOR_OPENING_STYLES : WINDOW_OPENING_STYLES).has(style);
|
|
120
|
+
}
|
|
121
|
+
/** The other opening kind for a known operation that does not apply to `kind`. */
|
|
122
|
+
export function openingStyleOwner(kind, style) {
|
|
123
|
+
if (openingStyleAppliesTo(kind, style))
|
|
124
|
+
return undefined;
|
|
125
|
+
return kind === "door" ? "window" : "door";
|
|
126
|
+
}
|
|
47
127
|
/** そのキーが名前空間つきの運搬層かどうか */
|
|
48
128
|
export function isNamespaced(key) {
|
|
49
129
|
return CARRY_NAMESPACE.test(key);
|
|
@@ -130,11 +210,12 @@ export const ATTR_LEDGER = {
|
|
|
130
210
|
edge: structure(),
|
|
131
211
|
hinge: structure(),
|
|
132
212
|
swing: structure(),
|
|
133
|
-
//
|
|
134
|
-
style: one(
|
|
135
|
-
|
|
136
|
-
//
|
|
137
|
-
|
|
213
|
+
// Interpreted.
|
|
214
|
+
style: one(...OPENING_STYLE_VALUES), // selects the plan opening symbol
|
|
215
|
+
panels: num(), // explicit equal panel count for a curtain wall
|
|
216
|
+
name: free(), // unique within the boundary: the opening's identity key
|
|
217
|
+
// Carried.
|
|
218
|
+
sill: carry(), // window sill height
|
|
138
219
|
spec: carry(),
|
|
139
220
|
fire: carry(),
|
|
140
221
|
},
|
|
@@ -142,6 +223,22 @@ export const ATTR_LEDGER = {
|
|
|
142
223
|
floor: carry(),
|
|
143
224
|
name: free(),
|
|
144
225
|
spec: carry(),
|
|
226
|
+
// A named uncounted area is the sole placement frame for a component asset. Position remains
|
|
227
|
+
// relative to the written extent, so changing the extent moves the component with it.
|
|
228
|
+
asset: free(),
|
|
229
|
+
"align-x": one("min", "center", "max"),
|
|
230
|
+
"align-y": one("min", "center", "max"),
|
|
231
|
+
"offset-x": free(),
|
|
232
|
+
"offset-y": free(),
|
|
233
|
+
rotate: free(),
|
|
234
|
+
},
|
|
235
|
+
component: {
|
|
236
|
+
w: num(),
|
|
237
|
+
d: num(),
|
|
238
|
+
"plan-svg": free(),
|
|
239
|
+
name: free(),
|
|
240
|
+
category: carry(),
|
|
241
|
+
spec: carry(),
|
|
145
242
|
},
|
|
146
243
|
seg: {
|
|
147
244
|
// 構造 — parse が持ち上げる
|
|
@@ -188,9 +285,10 @@ export function known(elem, key) {
|
|
|
188
285
|
export function attrSpec(elem, key) {
|
|
189
286
|
return ATTR_LEDGER[elem]?.[key];
|
|
190
287
|
}
|
|
191
|
-
/**
|
|
192
|
-
* asset は開口の既定値の束なので、開口と同じ台帳で読む (ADR-0010)。
|
|
193
|
-
* 「アセットに書けて開口に書けない属性」を作らないための同一視である。
|
|
194
|
-
*/
|
|
288
|
+
/** Door and window assets use the opening ledger unchanged. */
|
|
195
289
|
export const ASSET_ELEM = "opening";
|
|
290
|
+
/** Door/window assets share the opening ledger; placed component assets have their own ledger. */
|
|
291
|
+
export function assetElem(kind) {
|
|
292
|
+
return kind === "component" ? "component" : ASSET_ELEM;
|
|
293
|
+
}
|
|
196
294
|
//# sourceMappingURL=vocabulary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/core/vocabulary.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,oCAAoC;AACpC,EAAE;AACF,sDAAsD;AACtD,yEAAyE;AACzE,8EAA8E;AAC9E,2EAA2E;AAC3E,yEAAyE;AACzE,EAAE;AACF,yCAAyC;AACzC,EAAE;AACF,6DAA6D;AAC7D,+DAA+D;AAC/D,wDAAwD;AACxD,EAAE;AACF,+CAA+C;AAC/C,kDAAkD;AAClD,EAAE;AACF,oDAAoD;AACpD,wDAAwD;AACxD,sDAAsD;AACtD,EAAE;AACF,oCAAoC;AACpC,qCAAqC;AA0BrC,uBAAuB;AACvB,MAAM,GAAG,GAAG,GAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;AACjE,MAAM,GAAG,GAAG,CAAC,GAAG,EAA0B,EAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;AACvF,MAAM,IAAI,GAAG,GAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;AACvD,MAAM,KAAK,GAAG,GAAa,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE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AO,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AAEpC,kGAAkG;AAClG,MAAM,UAAU,SAAS,CAAC,IAAqC;IAC7D,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Model } from "../core/model.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read component plan artwork for a filesystem-backed model. The bytes enter drawing only: they
|
|
4
|
+
* are absent from Model, canonical JSON and Form. A composed override resolves relative to the
|
|
5
|
+
* layer that supplied the winning plan-svg value.
|
|
6
|
+
*/
|
|
7
|
+
export declare function componentSvgFiles(model: Model, level?: string): Readonly<Record<string, string>>;
|
|
8
|
+
//# sourceMappingURL=component-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-files.d.ts","sourceRoot":"","sources":["../../src/draw/component-files.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAwBhG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { placedComponents } from "../core/components.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read component plan artwork for a filesystem-backed model. The bytes enter drawing only: they
|
|
6
|
+
* are absent from Model, canonical JSON and Form. A composed override resolves relative to the
|
|
7
|
+
* layer that supplied the winning plan-svg value.
|
|
8
|
+
*/
|
|
9
|
+
export function componentSvgFiles(model, level) {
|
|
10
|
+
const sources = {};
|
|
11
|
+
const needed = new Set(placedComponents(model).components
|
|
12
|
+
.filter((component) => level === undefined || component.level === level)
|
|
13
|
+
.map((component) => component.asset));
|
|
14
|
+
for (const asset of model.assets.values()) {
|
|
15
|
+
if (asset.kind !== "component" || !needed.has(asset.name))
|
|
16
|
+
continue;
|
|
17
|
+
const ref = asset.attrs["plan-svg"];
|
|
18
|
+
if (typeof ref !== "string" || (!ref.startsWith("./") && !ref.startsWith("../")))
|
|
19
|
+
continue;
|
|
20
|
+
const layer = model.attrSrc.get(`asset:${asset.name}:plan-svg`);
|
|
21
|
+
const from = layer === undefined ? asset.file : model.layers[layer] ?? asset.file;
|
|
22
|
+
if (!from) {
|
|
23
|
+
throw new Error(`Component asset ${asset.name} plan-svg cannot be resolved from a source file`);
|
|
24
|
+
}
|
|
25
|
+
const file = resolve(dirname(from), ref);
|
|
26
|
+
try {
|
|
27
|
+
sources[asset.name] = readFileSync(file, "utf8");
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
throw new Error(`Cannot read plan SVG for component asset ${asset.name}: ${ref}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return sources;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=component-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-files.js","sourceRoot":"","sources":["../../src/draw/component-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAY,EAAE,KAAc;IAC5D,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,gBAAgB,CAAC,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MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,4CAA4C,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Asset } from "../core/model.js";
|
|
2
|
+
export interface ComponentSvg {
|
|
3
|
+
dataUri: string;
|
|
4
|
+
viewBox: {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Validate an SVG before it is embedded as an isolated image. Isolation preserves Figma-style
|
|
11
|
+
* defs, masks and clip paths without letting IDs collide with the plan sheet.
|
|
12
|
+
*/
|
|
13
|
+
export declare function componentSvg(asset: Asset, source: string): ComponentSvg;
|
|
14
|
+
//# sourceMappingURL=component-svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-svg.d.ts","sourceRoot":"","sources":["../../src/draw/component-svg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CA0DvE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate an SVG before it is embedded as an isolated image. Isolation preserves Figma-style
|
|
3
|
+
* defs, masks and clip paths without letting IDs collide with the plan sheet.
|
|
4
|
+
*/
|
|
5
|
+
export function componentSvg(asset, source) {
|
|
6
|
+
const text = source.trim();
|
|
7
|
+
const root = /<svg\b([^>]*)>/i.exec(text);
|
|
8
|
+
if (!root)
|
|
9
|
+
throw new Error(`Component asset ${asset.name} plan-svg does not contain an svg root`);
|
|
10
|
+
const number = "[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?";
|
|
11
|
+
const viewBox = new RegExp(`\\bviewBox\\s*=\\s*["']\\s*(${number})\\s+(${number})\\s+(${number})\\s+(${number})\\s*["']`, "i").exec(root[1]);
|
|
12
|
+
if (!viewBox)
|
|
13
|
+
throw new Error(`Component asset ${asset.name} plan-svg requires a positive viewBox`);
|
|
14
|
+
const width = Number(viewBox[3]);
|
|
15
|
+
const height = Number(viewBox[4]);
|
|
16
|
+
if (!(width > 0 && height > 0))
|
|
17
|
+
throw new Error(`Component asset ${asset.name} plan-svg requires a positive viewBox`);
|
|
18
|
+
const forbidden = [
|
|
19
|
+
/<!DOCTYPE/i,
|
|
20
|
+
/<!ENTITY/i,
|
|
21
|
+
/<script\b/i,
|
|
22
|
+
/<foreignObject\b/i,
|
|
23
|
+
/<(?:animate|animateMotion|animateTransform|set)\b/i,
|
|
24
|
+
/\s(?:[A-Za-z_][\w.-]*:)?on[a-z]+\s*=/i,
|
|
25
|
+
/javascript\s*:/i,
|
|
26
|
+
/@import\b/i,
|
|
27
|
+
];
|
|
28
|
+
if (forbidden.some((pattern) => pattern.test(text))) {
|
|
29
|
+
throw new Error(`Component asset ${asset.name} plan-svg contains active or external content`);
|
|
30
|
+
}
|
|
31
|
+
for (const match of text.matchAll(/\b(?:href|src)\s*=\s*["']([^"']+)["']/gi)) {
|
|
32
|
+
const value = match[1];
|
|
33
|
+
if (!safeReference(value)) {
|
|
34
|
+
throw new Error(`Component asset ${asset.name} plan-svg contains an external reference: ${value}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
for (const match of text.matchAll(/url\(\s*([^)]+?)\s*\)/gi)) {
|
|
38
|
+
const value = match[1].replace(/^["']|["']$/g, "").trim();
|
|
39
|
+
if (!safeReference(value)) {
|
|
40
|
+
throw new Error(`Component asset ${asset.name} plan-svg contains an external reference: ${value}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const w = asset.attrs["w"];
|
|
44
|
+
const d = asset.attrs["d"];
|
|
45
|
+
if (typeof w !== "number" || !(w > 0) || typeof d !== "number" || !(d > 0)) {
|
|
46
|
+
throw new Error(`Component asset ${asset.name} requires positive w: and d:`);
|
|
47
|
+
}
|
|
48
|
+
const sourceRatio = width / height;
|
|
49
|
+
const physicalRatio = w / d;
|
|
50
|
+
const ratioError = Math.abs(sourceRatio - physicalRatio) / physicalRatio;
|
|
51
|
+
if (ratioError > 0.001) {
|
|
52
|
+
throw new Error(`Component asset ${asset.name} plan-svg viewBox ratio ${round(sourceRatio)} does not match w:d ratio ${round(physicalRatio)}`);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
dataUri: `data:image/svg+xml,${encodeURIComponent(text).replace(/'/g, "%27").replace(/"/g, "%22")}`,
|
|
56
|
+
viewBox: { width, height },
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function safeReference(value) {
|
|
60
|
+
if (value.startsWith("#"))
|
|
61
|
+
return true;
|
|
62
|
+
return /^data:image\/(?:png|jpeg|webp|gif);base64,/i.test(value);
|
|
63
|
+
}
|
|
64
|
+
function round(value) {
|
|
65
|
+
return Math.round(value * 10000) / 10000;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=component-svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-svg.js","sourceRoot":"","sources":["../../src/draw/component-svg.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,MAAc;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI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ACL,OAAO,EAAE,sBAAsB,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;QACnG,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;KAC3B,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,6CAA6C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ArchitecturalPlanConvention {
|
|
2
|
+
readonly openings: {
|
|
3
|
+
/** Clear paper distance from the wall face to a sliding panel, in model millimetres. */
|
|
4
|
+
readonly slidingGapMm: number;
|
|
5
|
+
/** Extra overlap used to make two bypass leaves legible as separate panels. */
|
|
6
|
+
readonly bypassOverlapRatio: number;
|
|
7
|
+
/** Length of an automatic-door direction chevron relative to the aperture width. */
|
|
8
|
+
readonly automaticDirectionRatio: number;
|
|
9
|
+
/** Meeting point of the larger leaf in an unequal pair, measured from the first jamb. */
|
|
10
|
+
readonly unequalLeafMeetingRatio: number;
|
|
11
|
+
};
|
|
12
|
+
readonly stairs: {
|
|
13
|
+
/** How far an arrow enters a landing, relative to the narrower adjoining flight. */
|
|
14
|
+
readonly landingOffsetFlightWidthRatio: number;
|
|
15
|
+
readonly breakGlyph: {
|
|
16
|
+
/** Rotation from the line that crosses the flight. */
|
|
17
|
+
readonly angleDegrees: number;
|
|
18
|
+
/** Source-glyph proportions. The glyph is scaled to the flight width. */
|
|
19
|
+
readonly width: number;
|
|
20
|
+
readonly height: number;
|
|
21
|
+
readonly notch: number;
|
|
22
|
+
};
|
|
23
|
+
readonly arrowHead: {
|
|
24
|
+
/** SVG-space sizes: legibility belongs to paper, not to the building model. */
|
|
25
|
+
readonly length: number;
|
|
26
|
+
readonly halfWidth: number;
|
|
27
|
+
readonly startRadius: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export declare const ARCHITECTURAL_PLAN_CONVENTION: ArchitecturalPlanConvention;
|
|
32
|
+
//# sourceMappingURL=architectural.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architectural.d.ts","sourceRoot":"","sources":["../../../src/draw/conventions/architectural.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,QAAQ,EAAE;QACjB,wFAAwF;QACxF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,+EAA+E;QAC/E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;QACpC,oFAAoF;QACpF,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;QACzC,yFAAyF;QACzF,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;KAC1C,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE;QACf,oFAAoF;QACpF,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;QAC/C,QAAQ,CAAC,UAAU,EAAE;YACnB,sDAAsD;YACtD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;YAC9B,yEAAyE;YACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;YACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;YACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,QAAQ,CAAC,SAAS,EAAE;YAClB,+EAA+E;YAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;YACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;YAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;SAC9B,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,2BAqB3C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Shared architectural plan conventions.
|
|
2
|
+
//
|
|
3
|
+
// These values describe paper symbols, never building geometry. They live outside core and Form
|
|
4
|
+
// so another drawing convention can replace them without changing a `.muro` file, canonical JSON,
|
|
5
|
+
// circulation, area or validation. The current set is broadly shared architectural practice; a
|
|
6
|
+
// jurisdiction module should override only a convention that is actually different.
|
|
7
|
+
export const ARCHITECTURAL_PLAN_CONVENTION = {
|
|
8
|
+
openings: {
|
|
9
|
+
slidingGapMm: 60,
|
|
10
|
+
bypassOverlapRatio: 0.12,
|
|
11
|
+
automaticDirectionRatio: 0.08,
|
|
12
|
+
unequalLeafMeetingRatio: 2 / 3,
|
|
13
|
+
},
|
|
14
|
+
stairs: {
|
|
15
|
+
landingOffsetFlightWidthRatio: 0.5,
|
|
16
|
+
breakGlyph: {
|
|
17
|
+
angleDegrees: 30,
|
|
18
|
+
width: 10,
|
|
19
|
+
height: 40,
|
|
20
|
+
notch: 3.5,
|
|
21
|
+
},
|
|
22
|
+
arrowHead: {
|
|
23
|
+
length: 8,
|
|
24
|
+
halfWidth: 3.5,
|
|
25
|
+
startRadius: 2.8,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=architectural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architectural.js","sourceRoot":"","sources":["../../../src/draw/conventions/architectural.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,gGAAgG;AAChG,kGAAkG;AAClG,+FAA+F;AAC/F,oFAAoF;AAiCpF,MAAM,CAAC,MAAM,6BAA6B,GAAgC;IACxE,QAAQ,EAAE;QACR,YAAY,EAAE,EAAE;QAChB,kBAAkB,EAAE,IAAI;QACxB,uBAAuB,EAAE,IAAI;QAC7B,uBAAuB,EAAE,CAAC,GAAG,CAAC;KAC/B;IACD,MAAM,EAAE;QACN,6BAA6B,EAAE,GAAG;QAClC,UAAU,EAAE;YACV,YAAY,EAAE,EAAE;YAChB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,GAAG;SACX;QACD,SAAS,EAAE;YACT,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,GAAG;SACjB;KACF;CACF,CAAC"}
|
package/dist/draw/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { svgPlan, type PlanOptions } from "./plan.js";
|
|
2
|
-
export { planMarks,
|
|
2
|
+
export { planMarks, SLIDE_GAP, type Mark, type MarkArc, type MarkNote, type MarkOptions, type MarkRole, type MarkSubject, } from "./marks.js";
|
|
3
3
|
export { svgAxo, type AxoOptions } from "./axo.js";
|
|
4
4
|
export { sceneOf, type Scene, type SceneFacts, type SceneLevel, type SceneLine, type SceneMark, type SceneNode, type ScenePrism, type SceneRole, type SceneSubject, } from "./scene.js";
|
|
5
|
-
export { svgSection, svgElevation, type
|
|
5
|
+
export { svgSection, svgElevation, type ElevationOptions, type LineSectionOptions, type SectionGuide, type SectionOptions, } from "./section.js";
|
|
6
6
|
export { writtenOf, type Written } from "./written.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/draw/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,OAAO,EACP,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/draw/index.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
// ルートからも同じものが出ている (`@kensnzk/koyu`)。分けてあるのは、
|
|
8
8
|
// **凍る面と凍らない面を、import 一行で見分けられるようにするため**である。
|
|
9
9
|
export { svgPlan } from "./plan.js";
|
|
10
|
-
export { planMarks,
|
|
10
|
+
export { planMarks, SLIDE_GAP, } from "./marks.js";
|
|
11
11
|
export { svgAxo } from "./axo.js";
|
|
12
12
|
export { sceneOf, } from "./scene.js";
|
|
13
|
-
export { svgSection, svgElevation } from "./section.js";
|
|
13
|
+
export { svgSection, svgElevation, } from "./section.js";
|
|
14
14
|
export { writtenOf } from "./written.js";
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/dist/draw/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,uEAAuE;AACvE,2CAA2C;AAC3C,uBAAuB;AACvB,EAAE;AACF,6CAA6C;AAC7C,6CAA6C;AAE7C,OAAO,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,uEAAuE;AACvE,2CAA2C;AAC3C,uBAAuB;AACvB,EAAE;AACF,6CAA6C;AAC7C,6CAA6C;AAE7C,OAAO,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,SAAS,GAOV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAmB,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,OAAO,GAUR,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,YAAY,GAKb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC"}
|
package/dist/draw/marks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Form, type PlanClass, type PlanEntity } from "../core/derive.js";
|
|
2
2
|
import { type Pt } from "../core/model.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type RunDevice, type Seg2 } from "../core/vertical.js";
|
|
4
4
|
/**
|
|
5
5
|
* A mark's role. The consumer decides stroke weight, colour, dash and every word from it.
|
|
6
6
|
*
|
|
@@ -26,16 +26,40 @@ export type MarkRole =
|
|
|
26
26
|
| "open"
|
|
27
27
|
/** the band of a segment that does not count */
|
|
28
28
|
| "seg"
|
|
29
|
-
/** a
|
|
29
|
+
/** a window opening, carrying the Form polygon whose two long edges continue the wall faces */
|
|
30
30
|
| "window"
|
|
31
31
|
/** hinge to leaf tip */
|
|
32
32
|
| "door-leaf"
|
|
33
33
|
/** the swing trace */
|
|
34
34
|
| "door-arc"
|
|
35
|
-
/** a sliding door's
|
|
35
|
+
/** a sliding door's closed leaf */
|
|
36
36
|
| "slide-panel"
|
|
37
|
-
/**
|
|
38
|
-
| "slide-
|
|
37
|
+
/** the short line across the centre of a sliding leaf */
|
|
38
|
+
| "slide-centre"
|
|
39
|
+
/** its travel into the pocket */
|
|
40
|
+
| "slide-tail"
|
|
41
|
+
/** the direction in which an automatic door opens */
|
|
42
|
+
| "auto-direction"
|
|
43
|
+
/** a general entrance threshold, without a claimed door operation */
|
|
44
|
+
| "entrance"
|
|
45
|
+
/** a gate jamb or post */
|
|
46
|
+
| "gate-post"
|
|
47
|
+
/** a vertically coiling shutter at the opening line */
|
|
48
|
+
| "rolling-shutter"
|
|
49
|
+
/** a sectional door that rises above the opening */
|
|
50
|
+
| "overhead-door"
|
|
51
|
+
/** an operable window leaf */
|
|
52
|
+
| "window-leaf"
|
|
53
|
+
/** an operable window's swing trace */
|
|
54
|
+
| "window-arc"
|
|
55
|
+
/** a sliding or projecting window sash */
|
|
56
|
+
| "window-sash"
|
|
57
|
+
/** the centre mark of a fixed window */
|
|
58
|
+
| "window-fixed"
|
|
59
|
+
/** a curtain-wall mullion at an explicitly divided panel boundary */
|
|
60
|
+
| "curtain-wall-mullion"
|
|
61
|
+
/** the meeting or overlap mark between window sashes */
|
|
62
|
+
| "window-sash-centre" | "column" | "run-outline" | "run-tread"
|
|
39
63
|
/** where the plane crosses the run — one line; making two of it is the consumer's convention */
|
|
40
64
|
| "run-break" | "run-arrow"
|
|
41
65
|
/** a seat only. The note has no geometry, and no words either */
|
|
@@ -52,7 +76,7 @@ export type MarkSubject = "space" | "boundary" | "opening" | "column" | "run" |
|
|
|
52
76
|
* belongs to them, not here.
|
|
53
77
|
*/
|
|
54
78
|
export type MarkNote =
|
|
55
|
-
/** direction
|
|
79
|
+
/** direction shown by an arrow; stair presentation always points towards the upper landing */
|
|
56
80
|
{
|
|
57
81
|
of: "direction";
|
|
58
82
|
up: boolean;
|
|
@@ -81,7 +105,7 @@ export interface Mark {
|
|
|
81
105
|
ref: string;
|
|
82
106
|
/**
|
|
83
107
|
* The classification `Form` gave the subject, carried through unchanged. Marks with no backing
|
|
84
|
-
* entity (`seg`, `void-hatch`, the
|
|
108
|
+
* entity (`seg`, `void-hatch`, the sliding marks) carry `"cut"` — they show at the cut.
|
|
85
109
|
*/
|
|
86
110
|
class: PlanClass;
|
|
87
111
|
polygon?: Pt[];
|
|
@@ -107,15 +131,16 @@ export interface Mark {
|
|
|
107
131
|
};
|
|
108
132
|
}
|
|
109
133
|
/**
|
|
110
|
-
*
|
|
134
|
+
* Clear distance from a wall face to a sliding door's panel, mm.
|
|
111
135
|
*
|
|
112
136
|
* **A drafting convention, not a derivation default.** It is not in the ledger of derivation
|
|
113
|
-
* constants because no shape of the building depends on it
|
|
137
|
+
* constants because no shape of the building depends on it. The actual offset from the wall
|
|
138
|
+
* centreline is half the opening's wall thickness plus this gap.
|
|
114
139
|
*/
|
|
115
|
-
export declare const
|
|
140
|
+
export declare const SLIDE_GAP: number;
|
|
116
141
|
export interface MarkOptions {
|
|
117
|
-
/** override `
|
|
118
|
-
|
|
142
|
+
/** override `SLIDE_GAP` */
|
|
143
|
+
slideGap?: number;
|
|
119
144
|
}
|
|
120
145
|
/**
|
|
121
146
|
* The marks drawn on one level's plan, from `Form`.
|
package/dist/draw/marks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marks.d.ts","sourceRoot":"","sources":["../../src/draw/marks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"marks.d.ts","sourceRoot":"","sources":["../../src/draw/marks.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAQ,KAAK,IAAI,EAAiD,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpI,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAW,KAAK,SAAS,EAAgB,KAAK,IAAI,EAAE,MAAM,qBAAqB,CAAC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