@nubisco/ui 1.39.1 → 1.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Blueprint.context.d.ts +9 -1
- package/dist/components/Blueprint.context.d.ts.map +1 -1
- package/dist/components/Blueprint.renderer.d.ts +85 -0
- package/dist/components/Blueprint.renderer.d.ts.map +1 -0
- package/dist/components/Blueprint.types.d.ts +179 -0
- package/dist/components/Blueprint.types.d.ts.map +1 -1
- package/dist/components/Blueprint.vue.d.ts +24 -6
- package/dist/components/Blueprint.vue.d.ts.map +1 -1
- package/dist/components/BlueprintCard.vue.d.ts.map +1 -1
- package/dist/components/BlueprintControls.vue.d.ts +11 -0
- package/dist/components/BlueprintControls.vue.d.ts.map +1 -0
- package/dist/components/BlueprintDomRenderer.vue.d.ts +30 -0
- package/dist/components/BlueprintDomRenderer.vue.d.ts.map +1 -0
- package/dist/components/BlueprintMinimap.vue.d.ts +11 -0
- package/dist/components/BlueprintMinimap.vue.d.ts.map +1 -0
- package/dist/components/BlueprintPixiRenderer.vue.d.ts +32 -0
- package/dist/components/BlueprintPixiRenderer.vue.d.ts.map +1 -0
- package/dist/components/Charts/InterpolationChart.vue.d.ts +1 -1
- package/dist/components/DatePicker.vue.d.ts +3 -3
- package/dist/components/Grid.vue.d.ts +1 -1
- package/dist/components/JsonTree.vue.d.ts +1 -1
- package/dist/components/NumberInput.vue.d.ts +3 -3
- package/dist/components/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/Radio.vue.d.ts +2 -2
- package/dist/components/Select.vue.d.ts +1 -1
- package/dist/components/Slider.vue.d.ts +2 -2
- package/dist/components/TextInput.vue.d.ts +3 -3
- package/dist/components/TextInput.vue.d.ts.map +1 -1
- package/dist/components/TreeNode.vue.d.ts +2 -2
- package/dist/components/blueprint-pixi/level-color.d.ts +2 -0
- package/dist/components/blueprint-pixi/level-color.d.ts.map +1 -0
- package/dist/components/blueprint-pixi/live-data.d.ts +19 -0
- package/dist/components/blueprint-pixi/live-data.d.ts.map +1 -0
- package/dist/components/blueprint-pixi/pixi-color.d.ts +10 -0
- package/dist/components/blueprint-pixi/pixi-color.d.ts.map +1 -0
- package/dist/components/blueprint-pixi/pixi-scene.d.ts +103 -0
- package/dist/components/blueprint-pixi/pixi-scene.d.ts.map +1 -0
- package/dist/components/blueprint-pixi/wire-path.d.ts +25 -0
- package/dist/components/blueprint-pixi/wire-path.d.ts.map +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/labs/Spreadsheet.vue.d.ts +2 -2
- package/dist/components/labs/Spreadsheet.vue.d.ts.map +1 -1
- package/dist/composables/useBlueprint.composable.d.ts +23 -0
- package/dist/composables/useBlueprint.composable.d.ts.map +1 -0
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +11712 -11053
- package/dist/index.mjs.map +1 -1
- package/dist/main.d.ts +8 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/pixi-scene-BKcn6pWT.js +300 -0
- package/dist/pixi-scene-BKcn6pWT.js.map +1 -0
- package/dist/pixi-scene-D8kAPyID.cjs +2 -0
- package/dist/pixi-scene-D8kAPyID.cjs.map +1 -0
- package/dist/ui.css +1 -1
- package/package.json +8 -1
package/dist/main.d.ts
CHANGED
|
@@ -70,13 +70,20 @@ export type { TBottomPanelSize } from './components/BottomPanel.d';
|
|
|
70
70
|
export { default as NbShellPanel } from './components/ShellPanel.vue';
|
|
71
71
|
export type { TShellPanelSize } from './components/ShellPanel.d';
|
|
72
72
|
export { default as NbBlueprint } from './components/Blueprint.vue';
|
|
73
|
-
export type { IBlueprintConnection, IBlueprintCard, IBlueprintCardMove, IBlueprintProps, } from './components/Blueprint.types';
|
|
73
|
+
export type { IBlueprintConnection, IBlueprintCard, IBlueprintCardMove, IBlueprintProps, IBlueprintController, IBlueprintCanvasPoint, IBlueprintScreenPoint, IBlueprintCardPaint, TBlueprintRenderer, TBlueprintBackground, } from './components/Blueprint.types';
|
|
74
|
+
export { default as NbBlueprintControls } from './components/BlueprintControls.vue';
|
|
75
|
+
export type { IBlueprintControlsProps, TBlueprintChromePosition, } from './components/BlueprintControls.d';
|
|
76
|
+
export { default as NbBlueprintMinimap } from './components/BlueprintMinimap.vue';
|
|
77
|
+
export type { IBlueprintMinimapProps } from './components/BlueprintMinimap.d';
|
|
78
|
+
export { NB_BLUEPRINT_CONTEXT, NB_BLUEPRINT_CONTROLLER, } from './components/Blueprint.context';
|
|
79
|
+
export { BlueprintLiveData } from './components/blueprint-pixi/live-data';
|
|
74
80
|
export { default as NbBlueprintCard } from './components/BlueprintCard.vue';
|
|
75
81
|
export type { IBlueprintPort, IBlueprintCardProps, IBlueprintCardParameter, } from './components/BlueprintCard.types';
|
|
76
82
|
export { default as nbTooltipDirective } from './directives/ToolTip.directive';
|
|
77
83
|
export { dismissAllTooltips } from './directives/ToolTip.directive';
|
|
78
84
|
export { useCommandPalette } from './composables/useCommandPalette.composable';
|
|
79
85
|
export { useContextMenu } from './composables/useContextMenu.composable';
|
|
86
|
+
export { useBlueprint } from './composables/useBlueprint.composable';
|
|
80
87
|
export { NbCommandPalettePlugin } from './plugins/commandPalette';
|
|
81
88
|
export { default as NubiscoUILabs } from './labs';
|
|
82
89
|
export { default as NbSpreadsheet } from './components/labs/Spreadsheet.vue';
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;;iBAMf,GAAG;;AADlB,wBAMC;AAED,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC1E,YAAY,EACV,WAAW,EACX,kBAAkB,GACnB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAC3D,YAAY,EACV,YAAY,EAC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AAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
//#region src/components/blueprint-pixi/pixi-color.ts
|
|
2
|
+
var e = /var\(\s*(--[\w-]+)\s*(?:,\s*([^)]+))?\)/;
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let r = /* @__PURE__ */ new Map();
|
|
5
|
+
function i(t) {
|
|
6
|
+
let r = t.match(e);
|
|
7
|
+
if (!r) return t;
|
|
8
|
+
let a = r[1], o = r[2]?.trim();
|
|
9
|
+
return getComputedStyle(n).getPropertyValue(a).trim() || (o ? i(o) : t);
|
|
10
|
+
}
|
|
11
|
+
return (e, n) => {
|
|
12
|
+
if (!e) return n;
|
|
13
|
+
let a = r.get(e);
|
|
14
|
+
if (a !== void 0) return a;
|
|
15
|
+
let o;
|
|
16
|
+
try {
|
|
17
|
+
let n = e.includes("var(") ? i(e) : e;
|
|
18
|
+
o = new t.Color(n).toNumber();
|
|
19
|
+
} catch {
|
|
20
|
+
o = n;
|
|
21
|
+
}
|
|
22
|
+
return r.set(e, o), o;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/blueprint-pixi/wire-path.ts
|
|
27
|
+
var n = /-?\d*\.?\d+(?:e[-+]?\d+)?/gi;
|
|
28
|
+
function r(e) {
|
|
29
|
+
let t = e.match(n);
|
|
30
|
+
if (!t || t.length < 8) return null;
|
|
31
|
+
let r = t.slice(0, 8).map(Number);
|
|
32
|
+
return r.some((e) => Number.isNaN(e)) ? null : {
|
|
33
|
+
p0: [r[0], r[1]],
|
|
34
|
+
c1: [r[2], r[3]],
|
|
35
|
+
c2: [r[4], r[5]],
|
|
36
|
+
p3: [r[6], r[7]]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function i(e, t) {
|
|
40
|
+
let n = 1 - t, r = n * n * n, i = 3 * n * n * t, a = 3 * n * t * t, o = t * t * t;
|
|
41
|
+
return [r * e.p0[0] + i * e.c1[0] + a * e.c2[0] + o * e.p3[0], r * e.p0[1] + i * e.c1[1] + a * e.c2[1] + o * e.p3[1]];
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/components/blueprint-pixi/level-color.ts
|
|
45
|
+
function a(e) {
|
|
46
|
+
let t = Math.max(0, Math.min(1, e)), n = [
|
|
47
|
+
34,
|
|
48
|
+
197,
|
|
49
|
+
94
|
|
50
|
+
], r = [
|
|
51
|
+
250,
|
|
52
|
+
204,
|
|
53
|
+
21
|
|
54
|
+
], i = [
|
|
55
|
+
239,
|
|
56
|
+
68,
|
|
57
|
+
68
|
|
58
|
+
], a, o, s;
|
|
59
|
+
t <= .5 ? (a = n, o = r, s = t * 2) : (a = r, o = i, s = (t - .5) * 2);
|
|
60
|
+
let c = (e, t) => Math.round(e + (t - e) * s);
|
|
61
|
+
return c(a[0], o[0]) << 16 | c(a[1], o[1]) << 8 | c(a[2], o[2]);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/components/blueprint-pixi/pixi-scene.ts
|
|
65
|
+
var o = 24, s = .45, c = 2.5, l = .4, u = 40, d = class e {
|
|
66
|
+
app;
|
|
67
|
+
world;
|
|
68
|
+
grid;
|
|
69
|
+
wireLayer;
|
|
70
|
+
wireNodes = /* @__PURE__ */ new Map();
|
|
71
|
+
flowLayer;
|
|
72
|
+
flowSprites = [];
|
|
73
|
+
dotTexture;
|
|
74
|
+
meterLayer;
|
|
75
|
+
meterNodes = /* @__PURE__ */ new Map();
|
|
76
|
+
pendingMeters = [];
|
|
77
|
+
metersDirty = !1;
|
|
78
|
+
trackColor = 1447454;
|
|
79
|
+
resolveColor;
|
|
80
|
+
connectedColor = 6514417;
|
|
81
|
+
flowNodes = [];
|
|
82
|
+
flowPhase = 0;
|
|
83
|
+
zoom = 1;
|
|
84
|
+
needsRender = !1;
|
|
85
|
+
rafId = 0;
|
|
86
|
+
lastAnimMs = 0;
|
|
87
|
+
liveData;
|
|
88
|
+
levelsDirty = !1;
|
|
89
|
+
pendingWires = [];
|
|
90
|
+
pendingShouldFlow = () => !1;
|
|
91
|
+
wiresDirty = !1;
|
|
92
|
+
wiresDrawnOnce = !1;
|
|
93
|
+
bezierCache = /* @__PURE__ */ new Map();
|
|
94
|
+
destroyed = !1;
|
|
95
|
+
background = "dots";
|
|
96
|
+
gridColor = 2763320;
|
|
97
|
+
gridTexture;
|
|
98
|
+
constructor(e) {
|
|
99
|
+
this.Pixi = e, this.app = new e.Application();
|
|
100
|
+
}
|
|
101
|
+
static async create(t, n) {
|
|
102
|
+
let r = new e(t);
|
|
103
|
+
return await r.init(n), r;
|
|
104
|
+
}
|
|
105
|
+
async init(e) {
|
|
106
|
+
if (await this.app.init({
|
|
107
|
+
canvas: e.canvas,
|
|
108
|
+
width: e.width,
|
|
109
|
+
height: e.height,
|
|
110
|
+
backgroundAlpha: 0,
|
|
111
|
+
antialias: !0,
|
|
112
|
+
resolution: e.resolution,
|
|
113
|
+
autoDensity: !0,
|
|
114
|
+
preference: "webgl",
|
|
115
|
+
autoStart: !1
|
|
116
|
+
}), this.destroyed) {
|
|
117
|
+
this.app.destroy({ removeView: !1 }, { children: !0 });
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.resolveColor = t(this.Pixi, e.el), this.connectedColor = this.resolveColor("var(--nb-c-primary)", 6514417), this.liveData = e.liveData, this.liveData && (this.liveData.onChange = () => {
|
|
121
|
+
this.destroyed || (this.levelsDirty = !0, this.ensureRaf());
|
|
122
|
+
}), this.background = e.background, this.gridColor = this.resolveColor("var(--nb-blueprint-grid-color, var(--nb-c-border))", 2763320), this.grid = this.buildGrid(e.width, e.height), this.app.stage.addChild(this.grid), this.world = new this.Pixi.Container(), this.app.stage.addChild(this.world), this.wireLayer = new this.Pixi.Container(), this.meterLayer = new this.Pixi.Container(), this.flowLayer = new this.Pixi.Container(), this.world.addChild(this.wireLayer, this.meterLayer, this.flowLayer), this.dotTexture = this.makeDotTexture(), this.trackColor = this.resolveColor("var(--nb-c-layer-2)", 1447454), this.app.ticker.stop();
|
|
123
|
+
}
|
|
124
|
+
buildGrid(e, t) {
|
|
125
|
+
this.gridTexture = this.makeGridTexture(this.background);
|
|
126
|
+
let n = new this.Pixi.TilingSprite({
|
|
127
|
+
texture: this.gridTexture,
|
|
128
|
+
width: e,
|
|
129
|
+
height: t
|
|
130
|
+
});
|
|
131
|
+
return n.alpha = .4, n.visible = this.background !== "none", n;
|
|
132
|
+
}
|
|
133
|
+
makeGridTexture(e) {
|
|
134
|
+
let t = new this.Pixi.Graphics();
|
|
135
|
+
t.rect(0, 0, o, o).fill({
|
|
136
|
+
color: 16777215,
|
|
137
|
+
alpha: 0
|
|
138
|
+
}), e === "dots" ? t.circle(1, 1, 1).fill({
|
|
139
|
+
color: this.gridColor,
|
|
140
|
+
alpha: 1
|
|
141
|
+
}) : e === "lines" && (t.rect(0, 0, o, 1).fill({
|
|
142
|
+
color: this.gridColor,
|
|
143
|
+
alpha: 1
|
|
144
|
+
}), t.rect(0, 0, 1, o).fill({
|
|
145
|
+
color: this.gridColor,
|
|
146
|
+
alpha: 1
|
|
147
|
+
}));
|
|
148
|
+
let n = this.app.renderer.generateTexture(t);
|
|
149
|
+
return n.source.scaleMode = "linear", t.destroy(), n;
|
|
150
|
+
}
|
|
151
|
+
setBackground(e) {
|
|
152
|
+
if (this.destroyed || e === this.background) return;
|
|
153
|
+
this.background = e;
|
|
154
|
+
let t = this.gridTexture;
|
|
155
|
+
this.gridTexture = this.makeGridTexture(e), this.grid.texture = this.gridTexture, this.grid.visible = e !== "none", t?.destroy(!0), this.requestRender();
|
|
156
|
+
}
|
|
157
|
+
setCamera(e, t, n) {
|
|
158
|
+
this.destroyed || (this.zoom = n, this.world.position.set(e, t), this.world.scale.set(n), this.grid.tilePosition.set(e, t), this.grid.tileScale.set(n), this.updateGridAlpha(n), this.requestRender());
|
|
159
|
+
}
|
|
160
|
+
updateGridAlpha(e) {
|
|
161
|
+
if (this.background === "none") return;
|
|
162
|
+
let t = o * e, n = Math.max(0, Math.min(1, (t - 6) / 10));
|
|
163
|
+
this.grid.alpha = l * n;
|
|
164
|
+
}
|
|
165
|
+
setWires(e, t) {
|
|
166
|
+
this.destroyed || (this.pendingWires = e, this.pendingShouldFlow = t, this.wiresDirty = !0, this.ensureRaf());
|
|
167
|
+
}
|
|
168
|
+
reconcileWireGeometry() {
|
|
169
|
+
this.wiresDirty = !1, this.wiresDrawnOnce = !0;
|
|
170
|
+
let e = /* @__PURE__ */ new Set(), t = [];
|
|
171
|
+
for (let n of this.pendingWires) {
|
|
172
|
+
let i = this.bezierCache.get(n.path);
|
|
173
|
+
if (i === void 0 && (i = r(n.path), this.bezierCache.set(n.path, i)), !i) continue;
|
|
174
|
+
let a = n.conn, o = `${a.fromNode}|${a.fromPort}|${a.toNode}|${a.toPort}`;
|
|
175
|
+
e.add(o);
|
|
176
|
+
let s = a.active === !1, c = this.wireNodes.get(o);
|
|
177
|
+
if (!c) {
|
|
178
|
+
let e = new this.Pixi.Graphics();
|
|
179
|
+
c = {
|
|
180
|
+
gfx: e,
|
|
181
|
+
path: "",
|
|
182
|
+
bezier: i,
|
|
183
|
+
baseColor: 0,
|
|
184
|
+
isMidi: n.isMidi,
|
|
185
|
+
dim: s,
|
|
186
|
+
flows: !1,
|
|
187
|
+
key: o
|
|
188
|
+
}, this.wireNodes.set(o, c), this.wireLayer.addChild(e);
|
|
189
|
+
}
|
|
190
|
+
c.bezier = i, c.baseColor = this.resolveColor(n.color, this.connectedColor), c.isMidi = n.isMidi, c.dim = s, c.flows = !s && this.pendingShouldFlow(a), c.path !== n.path && (c.path = n.path, c.gfx.clear(), c.gfx.moveTo(i.p0[0], i.p0[1]).bezierCurveTo(i.c1[0], i.c1[1], i.c2[0], i.c2[1], i.p3[0], i.p3[1]).stroke({
|
|
191
|
+
width: 1,
|
|
192
|
+
pixelLine: !0,
|
|
193
|
+
color: 16777215
|
|
194
|
+
})), c.gfx.alpha = s ? .25 : .55, c.flows && t.push(c);
|
|
195
|
+
}
|
|
196
|
+
for (let [t, n] of this.wireNodes) e.has(t) || (n.gfx.destroy(), this.wireNodes.delete(t));
|
|
197
|
+
if (this.flowNodes = t, t.length || this.clearFlow(), this.bezierCache.size > e.size * 2 + 64) {
|
|
198
|
+
let e = new Set([...this.wireNodes.values()].map((e) => e.path));
|
|
199
|
+
for (let t of this.bezierCache.keys()) e.has(t) || this.bezierCache.delete(t);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
wireColorFor(e) {
|
|
203
|
+
if (this.liveData && !e.isMidi && !e.dim) {
|
|
204
|
+
let t = this.liveData.get(e.key);
|
|
205
|
+
if (t > 0) return a(t);
|
|
206
|
+
}
|
|
207
|
+
return e.baseColor;
|
|
208
|
+
}
|
|
209
|
+
applyWireColors() {
|
|
210
|
+
for (let e of this.wireNodes.values()) e.gfx.tint = this.wireColorFor(e);
|
|
211
|
+
}
|
|
212
|
+
setMeters(e) {
|
|
213
|
+
if (this.destroyed) return;
|
|
214
|
+
let t = [];
|
|
215
|
+
for (let n of e) if (n.meters) for (let e of n.meters) t.push({
|
|
216
|
+
id: e.id,
|
|
217
|
+
x: n.x + e.x,
|
|
218
|
+
y: n.y + e.y,
|
|
219
|
+
w: e.w,
|
|
220
|
+
h: e.h
|
|
221
|
+
});
|
|
222
|
+
this.pendingMeters = t, this.metersDirty = !0, this.ensureRaf();
|
|
223
|
+
}
|
|
224
|
+
reconcileMeters() {
|
|
225
|
+
this.metersDirty = !1;
|
|
226
|
+
let e = /* @__PURE__ */ new Set();
|
|
227
|
+
for (let t of this.pendingMeters) {
|
|
228
|
+
e.add(t.id);
|
|
229
|
+
let n = `${Math.round(t.x)},${Math.round(t.y)},${Math.round(t.w)},${Math.round(t.h)}`, r = this.meterNodes.get(t.id);
|
|
230
|
+
if (!r) {
|
|
231
|
+
let e = new this.Pixi.Sprite(this.Pixi.Texture.WHITE), n = new this.Pixi.Sprite(this.Pixi.Texture.WHITE);
|
|
232
|
+
e.tint = this.trackColor, n.anchor.set(0, 1), this.meterLayer.addChild(e, n), r = {
|
|
233
|
+
track: e,
|
|
234
|
+
fill: n,
|
|
235
|
+
sig: ""
|
|
236
|
+
}, this.meterNodes.set(t.id, r);
|
|
237
|
+
}
|
|
238
|
+
r.sig !== n && (r.sig = n, r.track.position.set(t.x, t.y), r.track.width = t.w, r.track.height = t.h, r.fill.position.set(t.x, t.y + t.h), r.fill.width = t.w);
|
|
239
|
+
}
|
|
240
|
+
for (let [t, n] of this.meterNodes) e.has(t) || (n.track.destroy(), n.fill.destroy(), this.meterNodes.delete(t));
|
|
241
|
+
}
|
|
242
|
+
updateMeterValues() {
|
|
243
|
+
if (!this.meterNodes.size) return;
|
|
244
|
+
let e = this.liveData;
|
|
245
|
+
for (let [t, n] of this.meterNodes) {
|
|
246
|
+
let r = e ? Math.max(0, Math.min(1, e.get(t))) : 0, i = Math.round(Number(n.sig.split(",")[3]));
|
|
247
|
+
n.fill.height = r * i, n.fill.tint = a(r);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
makeDotTexture() {
|
|
251
|
+
let e = new this.Pixi.Graphics();
|
|
252
|
+
e.circle(8, 8, 8).fill({
|
|
253
|
+
color: 16777215,
|
|
254
|
+
alpha: 1
|
|
255
|
+
});
|
|
256
|
+
let t = this.app.renderer.generateTexture(e);
|
|
257
|
+
return t.source.scaleMode = "linear", e.destroy(), t;
|
|
258
|
+
}
|
|
259
|
+
resize(e, t, n) {
|
|
260
|
+
this.destroyed || (this.app.renderer.resolution = n, this.app.renderer.resize(e, t), this.grid.width = e, this.grid.height = t, this.requestRender());
|
|
261
|
+
}
|
|
262
|
+
requestRender() {
|
|
263
|
+
this.needsRender = !0, this.ensureRaf();
|
|
264
|
+
}
|
|
265
|
+
ensureRaf() {
|
|
266
|
+
this.rafId || this.destroyed || (this.rafId = requestAnimationFrame(this.frame));
|
|
267
|
+
}
|
|
268
|
+
frame = (e) => {
|
|
269
|
+
if (this.rafId = 0, this.destroyed) return;
|
|
270
|
+
let t = this.needsRender;
|
|
271
|
+
this.needsRender = !1;
|
|
272
|
+
let n = e - this.lastAnimMs >= u, r = this.wiresDirty && (!this.wiresDrawnOnce || n), i = r || this.levelsDirty && n;
|
|
273
|
+
if (r && this.reconcileWireGeometry(), this.metersDirty && (this.reconcileMeters(), this.updateMeterValues(), t = !0), i && (this.levelsDirty = !1, this.applyWireColors(), this.updateMeterValues(), t = !0), this.flowNodes.length && n) {
|
|
274
|
+
let n = this.lastAnimMs ? e - this.lastAnimMs : u;
|
|
275
|
+
this.flowPhase = (this.flowPhase + n / 1e3 * s) % 1, this.drawFlow(), t = !0;
|
|
276
|
+
}
|
|
277
|
+
n && (this.lastAnimMs = e), t && this.app.render(), (this.needsRender || this.wiresDirty || this.levelsDirty || this.metersDirty || this.flowNodes.length) && this.ensureRaf();
|
|
278
|
+
};
|
|
279
|
+
drawFlow() {
|
|
280
|
+
let e = c / Math.max(this.zoom, .01) / 8, t = 0;
|
|
281
|
+
for (let n of this.flowNodes) {
|
|
282
|
+
let [r, a] = i(n.bezier, this.flowPhase), o = this.flowSprites[t];
|
|
283
|
+
o || (o = new this.Pixi.Sprite(this.dotTexture), o.anchor.set(.5), o.alpha = .9, this.flowLayer.addChild(o), this.flowSprites[t] = o), o.visible = !0, o.position.set(r, a), o.scale.set(e), o.tint = this.wireColorFor(n), t++;
|
|
284
|
+
}
|
|
285
|
+
for (; t < this.flowSprites.length; t++) this.flowSprites[t].visible = !1;
|
|
286
|
+
}
|
|
287
|
+
clearFlow() {
|
|
288
|
+
for (let e of this.flowSprites) e.visible = !1;
|
|
289
|
+
}
|
|
290
|
+
destroy() {
|
|
291
|
+
this.destroyed || (this.destroyed = !0, this.rafId &&= (cancelAnimationFrame(this.rafId), 0), this.wireNodes.clear(), this.flowSprites = [], this.flowNodes = [], this.meterNodes.clear(), this.app.destroy({ removeView: !1 }, {
|
|
292
|
+
children: !0,
|
|
293
|
+
texture: !0
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
//#endregion
|
|
298
|
+
export { d as PixiScene };
|
|
299
|
+
|
|
300
|
+
//# sourceMappingURL=pixi-scene-BKcn6pWT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixi-scene-BKcn6pWT.js","names":[],"sources":["../src/components/blueprint-pixi/pixi-color.ts","../src/components/blueprint-pixi/wire-path.ts","../src/components/blueprint-pixi/level-color.ts","../src/components/blueprint-pixi/pixi-scene.ts"],"sourcesContent":["// CSS-color → PixiJS numeric color, with CSS custom-property resolution.\n//\n// Wire and card colors arrive as CSS color strings: concrete (`#38bdf8`,\n// `rgb(...)`) for resolved wires, but possibly a `var(--token)` for card\n// accents or the grid. PixiJS `Color` parses concrete strings but not\n// `var(...)`, so we resolve custom properties against a reference element's\n// computed style first, then hand the result to `Color`. Lookups are cached\n// because getComputedStyle is not free and the same tokens recur across\n// thousands of wires.\n\nimport type * as PIXI from 'pixi.js'\n\nexport type TColorResolver = (\n css: string | undefined,\n fallback: number,\n) => number\n\nconst VAR_RE = /var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*([^)]+))?\\)/\n\n/**\n * Build a resolver bound to a PixiJS module and a reference element (used to\n * resolve CSS custom properties). The returned function converts a CSS color\n * string to a 24-bit RGB number, returning `fallback` for empty/unparseable\n * input so a bad token never throws mid-render.\n */\nexport function makeColorResolver(\n Pixi: typeof PIXI,\n el: HTMLElement,\n): TColorResolver {\n const cache = new Map<string, number>()\n\n function resolveVar(css: string): string {\n const m = css.match(VAR_RE)\n if (!m) return css\n const token = m[1]!\n const fallbackExpr = m[2]?.trim()\n const styles = getComputedStyle(el)\n const value = styles.getPropertyValue(token).trim()\n if (value) return value\n // Nested var fallback (e.g. var(--a, var(--b, #fff))): recurse.\n if (fallbackExpr) return resolveVar(fallbackExpr)\n return css\n }\n\n return (css, fallback) => {\n if (!css) return fallback\n const hit = cache.get(css)\n if (hit !== undefined) return hit\n let out: number\n try {\n const resolved = css.includes('var(') ? resolveVar(css) : css\n out = new Pixi.Color(resolved).toNumber()\n } catch {\n out = fallback\n }\n cache.set(css, out)\n return out\n }\n}\n","// Parsing and sampling for the cubic-bezier wire paths NbBlueprint produces.\n//\n// NbBlueprint's `computedWires` emits each wire as an SVG path string of the\n// exact form `M fx fy C c1x c1y, c2x c2y, tx ty` (see Blueprint.vue). The\n// PixiJS renderer re-draws those same curves with `Graphics.bezierCurveTo`,\n// and the flow animation samples them into points. This module turns the\n// path string into structured control points and sampled polylines. It has\n// no PixiJS dependency so it stays in the always-loaded bundle and is unit\n// testable without a WebGL context.\n\nexport interface ICubicBezier {\n /** Start point [x, y]. */\n p0: [number, number]\n /** First control point. */\n c1: [number, number]\n /** Second control point. */\n c2: [number, number]\n /** End point. */\n p3: [number, number]\n}\n\nconst NUMBER_RE = /-?\\d*\\.?\\d+(?:e[-+]?\\d+)?/gi\n\n/**\n * Parse a `M x y C x y x y x y` cubic path string into control points.\n * Returns null if the string does not contain the expected 8 numbers (so a\n * malformed or non-cubic path is skipped rather than throwing).\n */\nexport function parseCubicPath(d: string): ICubicBezier | null {\n const m = d.match(NUMBER_RE)\n if (!m || m.length < 8) return null\n const n = m.slice(0, 8).map(Number)\n if (n.some((v) => Number.isNaN(v))) return null\n return {\n p0: [n[0]!, n[1]!],\n c1: [n[2]!, n[3]!],\n c2: [n[4]!, n[5]!],\n p3: [n[6]!, n[7]!],\n }\n}\n\n/** Evaluate a cubic bezier at parameter t in [0, 1]. */\nexport function cubicAt(b: ICubicBezier, t: number): [number, number] {\n const mt = 1 - t\n const a = mt * mt * mt\n const c = 3 * mt * mt * t\n const e = 3 * mt * t * t\n const f = t * t * t\n return [\n a * b.p0[0] + c * b.c1[0] + e * b.c2[0] + f * b.p3[0],\n a * b.p0[1] + c * b.c1[1] + e * b.c2[1] + f * b.p3[1],\n ]\n}\n\n/**\n * Sample a cubic bezier into `segments + 1` points. Used by the flow\n * animation to walk evenly-ish along the wire. `segments` is a fixed count\n * (not arc-length parameterised) which is plenty for a short connector.\n */\nexport function sampleCubic(\n b: ICubicBezier,\n segments: number,\n): [number, number][] {\n const pts: [number, number][] = []\n for (let i = 0; i <= segments; i++) pts.push(cubicAt(b, i / segments))\n return pts\n}\n","// Map an audio level (0..1) to a green -> yellow -> red colour as a PixiJS\n// numeric colour (0xRRGGBB). The same ramp the DOM path uses for wire levels,\n// but returned as a number so the GPU layer never parses a CSS string per\n// frame. Level <= 0.5 interpolates green -> yellow; above, yellow -> red.\nexport function levelToColorNumber(level: number): number {\n const l = Math.max(0, Math.min(1, level))\n const green = [34, 197, 94]\n const yellow = [250, 204, 21]\n const red = [239, 68, 68]\n let a: number[], b: number[], t: number\n if (l <= 0.5) {\n a = green\n b = yellow\n t = l * 2\n } else {\n a = yellow\n b = red\n t = (l - 0.5) * 2\n }\n const mix = (x: number, y: number): number => Math.round(x + (y - x) * t)\n return (\n (mix(a[0]!, b[0]!) << 16) | (mix(a[1]!, b[1]!) << 8) | mix(a[2]!, b[2]!)\n )\n}\n","// PixiJS scene manager for the Blueprint renderer.\n//\n// Owns the Application, a single panned/zoomed `world` Container (the camera),\n// an infinite dot-grid background, a batched wire layer, and an animated flow\n// layer. Cards are NOT drawn here: they stay real interactive DOM in the\n// overlay above this canvas at all times (no painted/snapshot substitute). This\n// scene only accelerates the grid + wires + flow on the GPU. The Vue component\n// (BlueprintPixiRenderer.vue) drives it with the culled scene NbBlueprint feeds\n// every renderer; this module has all the PixiJS specifics.\n//\n// PixiJS is passed in (not imported) so it stays a dynamically-loaded,\n// externalized optional peer dependency; only `import type` references reach\n// this module statically, and those are erased at build time.\n\nimport type * as PIXI from 'pixi.js'\nimport type { IBlueprintCard, TBlueprintBackground } from '../Blueprint.types'\nimport type { IBlueprintWire } from '../Blueprint.renderer'\nimport { makeColorResolver } from './pixi-color'\nimport { parseCubicPath, cubicAt, type ICubicBezier } from './wire-path'\nimport { levelToColorNumber } from './level-color'\nimport type { BlueprintLiveData } from './live-data'\n\nconst GRID_TILE = 24\nconst FLOW_SPEED = 0.45 // fraction of a wire traversed per second\nconst FLOW_DOT_R = 2.5\n// Wire/flow geometry lives in the zoomed `world`. A normal world-space stroke\n// shrinks on screen as you zoom out (wires vanish at far zoom); `pixelLine`\n// renders a crisp screen-space line instead, constant at every zoom, so the\n// wire layer is drawn once and never re-stroked as the camera moves.\nconst GRID_BASE_ALPHA = 0.4\n// This scene renders ON DEMAND: there is no free-running 60fps loop. A state\n// change (camera, wires, background) requests a single repaint, and when\n// nothing changes the scene renders nothing and costs ~0 CPU, which matters in\n// an audio host where the GPU/CPU budget belongs to DSP. Animated modes\n// (\"levels\"/flow) push updates as fast as ~60Hz; we coalesce those and repaint\n// at most this often, so an always-animating mode stays cheap. ~25fps reads as\n// smooth for level/flow motion at a fraction of the cost of 60.\nconst ANIM_FRAME_MS = 40\n\nexport interface IPixiSceneOptions {\n canvas: HTMLCanvasElement\n /** Reference element for resolving CSS custom properties (the container). */\n el: HTMLElement\n width: number\n height: number\n resolution: number\n background: TBlueprintBackground\n /** Non-reactive live values (wire levels, ...) the host writes at audio rate;\n * the scene reads them on its throttled render tick. */\n liveData?: BlueprintLiveData\n}\n\n// One meter's GPU geometry in world coords (resolved from a card + its local\n// meter box). Recomputed only when a card moves or the visible set changes.\ninterface IMeterGeom {\n id: string\n x: number\n y: number\n w: number\n h: number\n}\n\n// A drawn meter: a static dark track and an animated fill, plus a signature so\n// geometry is only re-laid-out when it actually changes.\ninterface IMeterNode {\n track: PIXI.Sprite\n fill: PIXI.Sprite\n sig: string\n}\n\n// One wire drawn once (geometry baked, stroked white) and recoloured by `tint`.\n// Animating the level colour is then a uniform change, NOT a re-tessellation,\n// which is what eliminates the per-frame GPU-geometry churn (and its GC spikes).\ninterface IWireNode {\n gfx: PIXI.Graphics\n path: string\n bezier: ICubicBezier\n baseColor: number\n isMidi: boolean\n dim: boolean\n flows: boolean\n key: string\n}\n\nexport class PixiScene {\n private app: PIXI.Application\n private world!: PIXI.Container\n private grid!: PIXI.TilingSprite\n // Wire layer: a container of per-wire Graphics (see IWireNode). Flow layer: a\n // pool of reused dot sprites repositioned each frame (no re-tessellation).\n private wireLayer!: PIXI.Container\n private wireNodes = new Map<string, IWireNode>()\n private flowLayer!: PIXI.Container\n private flowSprites: PIXI.Sprite[] = []\n private dotTexture!: PIXI.Texture\n // Meter layer: each declared card meter is a static dark track + an animated\n // fill sprite (scale.y + tint from the live channel). Drawn over wires, on the\n // back canvas; the DOM card leaves a transparent hole so it shows through.\n private meterLayer!: PIXI.Container\n private meterNodes = new Map<string, IMeterNode>()\n private pendingMeters: IMeterGeom[] = []\n private metersDirty = false\n private trackColor = 0x16161e\n private resolveColor!: ReturnType<typeof makeColorResolver>\n // Fallback colour for a wire whose own colour does not resolve.\n private connectedColor = 0x6366f1\n private flowNodes: IWireNode[] = []\n private flowPhase = 0\n private zoom = 1\n // Render-on-demand scheduler. `needsRender` is the immediate path (camera,\n // background, resize). `rafId` holds the single in-flight frame; the loop\n // only stays alive while there is pending or ongoing (animation) work, then\n // stops so the scene costs nothing at rest. `lastAnimMs` paces the throttled\n // animation/wire-rebuild path.\n private needsRender = false\n private rafId = 0\n private lastAnimMs = 0\n // Live wire levels (host writes at audio rate, bypassing Vue). `levelsDirty`\n // is set when a write lands; the frame loop recolours wires on the throttled\n // animation cadence, then idles when the host stops writing.\n private liveData: BlueprintLiveData | undefined\n private levelsDirty = false\n // Coalesced wire state: setWires only stashes the latest set + marks dirty;\n // the frame loop rebuilds it (immediately the first time, then throttled to\n // ANIM_FRAME_MS). Parsed beziers are cached by path string so unchanged\n // geometry (levels mode only shifts colour) never pays the regex parse again.\n private pendingWires: IBlueprintWire[] = []\n private pendingShouldFlow: (conn: IBlueprintWire['conn']) => boolean = () =>\n false\n private wiresDirty = false\n private wiresDrawnOnce = false\n private bezierCache = new Map<string, ICubicBezier | null>()\n private destroyed = false\n private background: TBlueprintBackground = 'dots'\n private gridColor = 0x2a2a38\n private gridTexture!: PIXI.Texture\n\n private constructor(private readonly Pixi: typeof PIXI) {\n this.app = new Pixi.Application()\n }\n\n /** Create and initialise a scene. Async because PixiJS v8 `app.init` is. */\n static async create(\n Pixi: typeof PIXI,\n opts: IPixiSceneOptions,\n ): Promise<PixiScene> {\n const scene = new PixiScene(Pixi)\n await scene.init(opts)\n return scene\n }\n\n private async init(opts: IPixiSceneOptions): Promise<void> {\n await this.app.init({\n canvas: opts.canvas,\n width: opts.width,\n height: opts.height,\n backgroundAlpha: 0,\n antialias: true,\n resolution: opts.resolution,\n autoDensity: true,\n preference: 'webgl',\n // No free-running render loop: we drive app.render() on demand so an idle\n // blueprint costs ~0 CPU (the audio engine gets the budget).\n autoStart: false,\n })\n if (this.destroyed) {\n this.app.destroy({ removeView: false }, { children: true })\n return\n }\n\n this.resolveColor = makeColorResolver(this.Pixi, opts.el)\n this.connectedColor = this.resolveColor('var(--nb-c-primary)', 0x6366f1)\n\n this.liveData = opts.liveData\n if (this.liveData) {\n // A host write wakes the loop; the actual recolour is throttled in frame().\n this.liveData.onChange = () => {\n if (this.destroyed) return\n this.levelsDirty = true\n this.ensureRaf()\n }\n }\n\n this.background = opts.background\n this.gridColor = this.resolveColor(\n 'var(--nb-blueprint-grid-color, var(--nb-c-border))',\n 0x2a2a38,\n )\n this.grid = this.buildGrid(opts.width, opts.height)\n this.app.stage.addChild(this.grid)\n\n this.world = new this.Pixi.Container()\n this.app.stage.addChild(this.world)\n\n this.wireLayer = new this.Pixi.Container()\n this.meterLayer = new this.Pixi.Container()\n this.flowLayer = new this.Pixi.Container()\n // Order: wires (back) -> meters (over the card area) -> flow dots (top).\n this.world.addChild(this.wireLayer, this.meterLayer, this.flowLayer)\n this.dotTexture = this.makeDotTexture()\n this.trackColor = this.resolveColor('var(--nb-c-layer-2)', 0x16161e)\n // Stop Pixi's shared ticker for good measure; rendering is fully on-demand.\n this.app.ticker.stop()\n }\n\n private buildGrid(width: number, height: number): PIXI.TilingSprite {\n // A GRID_TILE-sized pattern tile, tiled across the screen. The grid lives\n // in stage (screen) space; panning/zooming maps to the tiling sprite's\n // tilePosition/tileScale (= zoom), which is far cheaper than redrawing a\n // world-space pattern every camera change.\n this.gridTexture = this.makeGridTexture(this.background)\n const sprite = new this.Pixi.TilingSprite({\n texture: this.gridTexture,\n width,\n height,\n })\n sprite.alpha = 0.4\n sprite.visible = this.background !== 'none'\n return sprite\n }\n\n private makeGridTexture(bg: TBlueprintBackground): PIXI.Texture {\n // A transparent full-tile rect fixes the texture size to GRID_TILE; the\n // pattern (dot, or top+left edge lines) is drawn over it so tiling yields\n // an evenly spaced grid.\n const g = new this.Pixi.Graphics()\n g.rect(0, 0, GRID_TILE, GRID_TILE).fill({ color: 0xffffff, alpha: 0 })\n if (bg === 'dots') {\n g.circle(1, 1, 1).fill({ color: this.gridColor, alpha: 1 })\n } else if (bg === 'lines') {\n g.rect(0, 0, GRID_TILE, 1).fill({ color: this.gridColor, alpha: 1 })\n g.rect(0, 0, 1, GRID_TILE).fill({ color: this.gridColor, alpha: 1 })\n }\n const texture = this.app.renderer.generateTexture(g)\n // Linear sampling softens the pattern when it is minified (zoomed out),\n // which together with the far-zoom alpha fade (see updateGridAlpha) avoids\n // the moiré a nearest-sampled 1px dot/line grid produces at fractional\n // tile scales.\n texture.source.scaleMode = 'linear'\n g.destroy()\n return texture\n }\n\n /** Switch the background pattern at runtime. */\n setBackground(bg: TBlueprintBackground): void {\n if (this.destroyed || bg === this.background) return\n this.background = bg\n const old = this.gridTexture\n this.gridTexture = this.makeGridTexture(bg)\n this.grid.texture = this.gridTexture\n this.grid.visible = bg !== 'none'\n old?.destroy(true)\n this.requestRender()\n }\n\n setCamera(panX: number, panY: number, zoom: number): void {\n if (this.destroyed) return\n this.zoom = zoom\n this.world.position.set(panX, panY)\n this.world.scale.set(zoom)\n // Grid follows the camera: the GRID_TILE-sized pattern scales with zoom\n // and slides with pan.\n this.grid.tilePosition.set(panX, panY)\n this.grid.tileScale.set(zoom)\n this.updateGridAlpha(zoom)\n // Wires use pixelLine (constant screen width), so the camera never needs to\n // re-stroke them: panning and zooming are a pure GPU transform of the layer.\n this.requestRender()\n }\n\n /** Fade the grid out as tiles approach sub-pixel density (far zoom): the\n * pattern is meaningless when that dense and is the source of moiré. */\n private updateGridAlpha(zoom: number): void {\n if (this.background === 'none') return\n const tilePx = GRID_TILE * zoom\n const fade = Math.max(0, Math.min(1, (tilePx - 6) / 10))\n this.grid.alpha = GRID_BASE_ALPHA * fade\n }\n\n /** Stash the latest wire set; the frame loop reconciles geometry + colours it\n * (the first set at once, later ones coalesced to ANIM_FRAME_MS). */\n setWires(\n wires: IBlueprintWire[],\n shouldFlow: (conn: IBlueprintWire['conn']) => boolean,\n ): void {\n if (this.destroyed) return\n this.pendingWires = wires\n this.pendingShouldFlow = shouldFlow\n this.wiresDirty = true\n this.ensureRaf()\n }\n\n /** Reconcile the per-wire Graphics against the pending set. Geometry is\n * stroked (white, pixelLine) only when a wire is new or its path changed;\n * colour is NOT baked here (see applyWireColors). This runs on a\n * topology/geometry change, never per animation frame. */\n private reconcileWireGeometry(): void {\n this.wiresDirty = false\n this.wiresDrawnOnce = true\n const seen = new Set<string>()\n const flow: IWireNode[] = []\n for (const wire of this.pendingWires) {\n let b = this.bezierCache.get(wire.path)\n if (b === undefined) {\n b = parseCubicPath(wire.path)\n this.bezierCache.set(wire.path, b)\n }\n if (!b) continue\n const c = wire.conn\n const key = `${c.fromNode}|${c.fromPort}|${c.toNode}|${c.toPort}`\n seen.add(key)\n const dim = c.active === false\n let node = this.wireNodes.get(key)\n if (!node) {\n const gfx = new this.Pixi.Graphics()\n node = {\n gfx,\n path: '',\n bezier: b,\n baseColor: 0,\n isMidi: wire.isMidi,\n dim,\n flows: false,\n key,\n }\n this.wireNodes.set(key, node)\n this.wireLayer.addChild(gfx)\n }\n node.bezier = b\n node.baseColor = this.resolveColor(wire.color, this.connectedColor)\n node.isMidi = wire.isMidi\n node.dim = dim\n node.flows = !dim && this.pendingShouldFlow(c)\n // Re-stroke only when the geometry actually changed.\n if (node.path !== wire.path) {\n node.path = wire.path\n node.gfx.clear()\n node.gfx\n .moveTo(b.p0[0], b.p0[1])\n .bezierCurveTo(b.c1[0], b.c1[1], b.c2[0], b.c2[1], b.p3[0], b.p3[1])\n .stroke({ width: 1, pixelLine: true, color: 0xffffff })\n }\n node.gfx.alpha = dim ? 0.25 : 0.55\n if (node.flows) flow.push(node)\n }\n for (const [key, node] of this.wireNodes) {\n if (seen.has(key)) continue\n node.gfx.destroy()\n this.wireNodes.delete(key)\n }\n this.flowNodes = flow\n if (!flow.length) this.clearFlow()\n if (this.bezierCache.size > seen.size * 2 + 64) {\n const live = new Set([...this.wireNodes.values()].map((n) => n.path))\n for (const path of this.bezierCache.keys()) {\n if (!live.has(path)) this.bezierCache.delete(path)\n }\n }\n }\n\n /** The current colour of a wire: its live level (audio, active, non-MIDI) or\n * its base accent. Applied as a cheap tint, no geometry rebuild. */\n private wireColorFor(node: IWireNode): number {\n if (this.liveData && !node.isMidi && !node.dim) {\n const level = this.liveData.get(node.key)\n if (level > 0) return levelToColorNumber(level)\n }\n return node.baseColor\n }\n\n /** Recolour every wire by tint only (no re-tessellation). Cheap enough to run\n * on every level tick. */\n private applyWireColors(): void {\n for (const node of this.wireNodes.values()) {\n node.gfx.tint = this.wireColorFor(node)\n }\n }\n\n /** Stash the visible cards' meter geometry (world coords). Runs when the\n * visible set or a card position changes, NOT per animation frame. */\n setMeters(cards: IBlueprintCard[]): void {\n if (this.destroyed) return\n const geoms: IMeterGeom[] = []\n for (const card of cards) {\n if (!card.meters) continue\n for (const m of card.meters) {\n geoms.push({\n id: m.id,\n x: card.x + m.x,\n y: card.y + m.y,\n w: m.w,\n h: m.h,\n })\n }\n }\n this.pendingMeters = geoms\n this.metersDirty = true\n this.ensureRaf()\n }\n\n /** Reconcile meter sprites against the pending geometry. Lays out a track +\n * fill per meter only when its box changes; values are applied separately. */\n private reconcileMeters(): void {\n this.metersDirty = false\n const seen = new Set<string>()\n for (const g of this.pendingMeters) {\n seen.add(g.id)\n const sig = `${Math.round(g.x)},${Math.round(g.y)},${Math.round(g.w)},${Math.round(g.h)}`\n let node = this.meterNodes.get(g.id)\n if (!node) {\n const track = new this.Pixi.Sprite(this.Pixi.Texture.WHITE)\n const fill = new this.Pixi.Sprite(this.Pixi.Texture.WHITE)\n track.tint = this.trackColor\n fill.anchor.set(0, 1) // grow up from the bottom\n this.meterLayer.addChild(track, fill)\n node = { track, fill, sig: '' }\n this.meterNodes.set(g.id, node)\n }\n if (node.sig !== sig) {\n node.sig = sig\n node.track.position.set(g.x, g.y)\n node.track.width = g.w\n node.track.height = g.h\n node.fill.position.set(g.x, g.y + g.h)\n node.fill.width = g.w\n }\n }\n for (const [id, node] of this.meterNodes) {\n if (seen.has(id)) continue\n node.track.destroy()\n node.fill.destroy()\n this.meterNodes.delete(id)\n }\n }\n\n /** Set each meter's fill height + colour from the live channel. Cheap (a\n * sprite scale + tint), no geometry rebuild; runs on the live tick. */\n private updateMeterValues(): void {\n if (!this.meterNodes.size) return\n const live = this.liveData\n for (const [id, node] of this.meterNodes) {\n const v = live ? Math.max(0, Math.min(1, live.get(id))) : 0\n const h = Math.round(Number(node.sig.split(',')[3]))\n node.fill.height = v * h\n node.fill.tint = levelToColorNumber(v)\n }\n }\n\n /** A small white dot, tinted per flow wire. Built once. */\n private makeDotTexture(): PIXI.Texture {\n const g = new this.Pixi.Graphics()\n g.circle(8, 8, 8).fill({ color: 0xffffff, alpha: 1 })\n const tex = this.app.renderer.generateTexture(g)\n tex.source.scaleMode = 'linear'\n g.destroy()\n return tex\n }\n\n resize(width: number, height: number, resolution: number): void {\n if (this.destroyed) return\n this.app.renderer.resolution = resolution\n this.app.renderer.resize(width, height)\n this.grid.width = width\n this.grid.height = height\n this.requestRender()\n }\n\n // ── Render-on-demand scheduler ────────────────────────────────────────\n\n /** Request a single repaint for an immediate change (camera/background/resize). */\n private requestRender(): void {\n this.needsRender = true\n this.ensureRaf()\n }\n\n /** Ensure exactly one frame is scheduled. */\n private ensureRaf(): void {\n if (this.rafId || this.destroyed) return\n this.rafId = requestAnimationFrame(this.frame)\n }\n\n /** The only place app.render() is called. Runs a frame, then reschedules\n * itself ONLY while there is pending or ongoing (animation) work, so an idle\n * scene drops to zero scheduled frames and zero CPU. */\n private frame = (ts: number): void => {\n this.rafId = 0\n if (this.destroyed) return\n let render = this.needsRender\n this.needsRender = false\n\n const animWindow = ts - this.lastAnimMs >= ANIM_FRAME_MS\n // Geometry reconcile (topology/path change) runs at once the first time then\n // throttled; colour (base or live level) is a cheap tint pass, no\n // re-tessellation, so a 60Hz level stream costs almost nothing.\n const doGeometry = this.wiresDirty && (!this.wiresDrawnOnce || animWindow)\n const doColors = doGeometry || (this.levelsDirty && animWindow)\n if (doGeometry) this.reconcileWireGeometry()\n // Meter geometry reconciles when the visible set / a card moves (infrequent,\n // not throttled); values animate from the live channel on the same throttled\n // cadence as wire colours.\n if (this.metersDirty) {\n this.reconcileMeters()\n this.updateMeterValues()\n render = true\n }\n if (doColors) {\n this.levelsDirty = false\n this.applyWireColors()\n this.updateMeterValues()\n render = true\n }\n // Flow dots: advance + reposition pooled sprites on the anim cadence.\n if (this.flowNodes.length && animWindow) {\n const dt = this.lastAnimMs ? ts - this.lastAnimMs : ANIM_FRAME_MS\n this.flowPhase = (this.flowPhase + FLOW_SPEED * (dt / 1000)) % 1\n this.drawFlow()\n render = true\n }\n if (animWindow) this.lastAnimMs = ts\n\n if (render) this.app.render()\n\n // Keep looping only while work remains; otherwise stop (0 CPU at rest).\n if (\n this.needsRender ||\n this.wiresDirty ||\n this.levelsDirty ||\n this.metersDirty ||\n this.flowNodes.length\n ) {\n this.ensureRaf()\n }\n }\n\n /** Position a pooled, tinted dot sprite on each flowing wire. Reuses sprites\n * (no per-frame geometry/allocation), so flow animation does not churn. */\n private drawFlow(): void {\n const scale = FLOW_DOT_R / Math.max(this.zoom, 0.01) / 8\n let i = 0\n for (const node of this.flowNodes) {\n const [x, y] = cubicAt(node.bezier, this.flowPhase)\n let sprite = this.flowSprites[i]\n if (!sprite) {\n sprite = new this.Pixi.Sprite(this.dotTexture)\n sprite.anchor.set(0.5)\n sprite.alpha = 0.9\n this.flowLayer.addChild(sprite)\n this.flowSprites[i] = sprite\n }\n sprite.visible = true\n sprite.position.set(x, y)\n sprite.scale.set(scale)\n sprite.tint = this.wireColorFor(node)\n i++\n }\n for (; i < this.flowSprites.length; i++)\n this.flowSprites[i]!.visible = false\n }\n\n private clearFlow(): void {\n for (const s of this.flowSprites) s.visible = false\n }\n\n destroy(): void {\n if (this.destroyed) return\n this.destroyed = true\n if (this.rafId) {\n cancelAnimationFrame(this.rafId)\n this.rafId = 0\n }\n this.wireNodes.clear()\n this.flowSprites = []\n this.flowNodes = []\n this.meterNodes.clear()\n // removeView:false — the <canvas> is Vue-owned and unmounts with the\n // component; we only tear down the GPU scene + textures.\n this.app.destroy({ removeView: false }, { children: true, texture: true })\n }\n}\n"],"mappings":";AAiBA,IAAM,IAAS;AAQf,SAAgB,EACd,GACA,GACgB;CAChB,IAAM,oBAAQ,IAAI,KAAqB;CAEvC,SAAS,EAAW,GAAqB;EACvC,IAAM,IAAI,EAAI,MAAM,EAAO;AAC3B,MAAI,CAAC,EAAG,QAAO;EACf,IAAM,IAAQ,EAAE,IACV,IAAe,EAAE,IAAI,MAAM;AAMjC,SALe,iBAAiB,EAAG,CACd,iBAAiB,EAAM,CAAC,MAAM,KAG/C,IAAqB,EAAW,EAAa,GAC1C;;AAGT,SAAQ,GAAK,MAAa;AACxB,MAAI,CAAC,EAAK,QAAO;EACjB,IAAM,IAAM,EAAM,IAAI,EAAI;AAC1B,MAAI,MAAQ,KAAA,EAAW,QAAO;EAC9B,IAAI;AACJ,MAAI;GACF,IAAM,IAAW,EAAI,SAAS,OAAO,GAAG,E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AAK,IAAI,QAAQ,GAI3B,KAAK,eACL,KAAK,cACL,KAAK,eACL,KAAK,eACL,KAAK,UAAU,WAEf,KAAK,WAAW;;CAMpB,WAAyB;EACvB,IAAM,IAAQ,IAAa,KAAK,IAAI,KAAK,MAAM,IAAK,GAAG,GACnD,IAAI;AACR,OAAK,IAAM,KAAQ,KAAK,WAAW;GACjC,IAAM,CAAC,GAAG,KAAK,EAAQ,EAAK,QAAQ,KAAK,UAAU,EAC/C,IAAS,KAAK,YAAY;AAY9B,GAXK,MACH,IAAS,IAAI,KAAK,KAAK,OAAO,KAAK,WAAW,EAC9C,EAAO,OAAO,IAAI,GAAI,EACtB,EAAO,QAAQ,IACf,KAAK,UAAU,SAAS,EAAO,EAC/B,KAAK,YAAY,KAAK,IAExB,EAAO,UAAU,IACjB,EAAO,SAAS,IAAI,GAAG,EAAE,EACzB,EAAO,MAAM,IAAI,EAAM,EACvB,EAAO,OAAO,KAAK,aAAa,EAAK,EACrC;;AAEF,SAAO,IAAI,KAAK,YAAY,QAAQ,IAClC,MAAK,YAAY,GAAI,UAAU;;CAGnC,YAA0B;AACxB,OAAK,IAAM,KAAK,KAAK,YAAa,GAAE,UAAU;;CAGhD,UAAgB;AACV,OAAK,cACT,KAAK,YAAY,IACjB,AAEE,KAAK,WADL,qBAAqB,KAAK,MAAM,EACnB,IAEf,KAAK,UAAU,OAAO,EACtB,KAAK,cAAc,EAAE,EACrB,KAAK,YAAY,EAAE,EACnB,KAAK,WAAW,OAAO,EAGvB,KAAK,IAAI,QAAQ,EAAE,YAAY,IAAO,EAAE;GAAE,UAAU;GAAM,SAAS;GAAM,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=/var\(\s*(--[\w-]+)\s*(?:,\s*([^)]+))?\)/;function t(t,n){let r=new Map;function i(t){let r=t.match(e);if(!r)return t;let a=r[1],o=r[2]?.trim();return getComputedStyle(n).getPropertyValue(a).trim()||(o?i(o):t)}return(e,n)=>{if(!e)return n;let a=r.get(e);if(a!==void 0)return a;let o;try{let n=e.includes(`var(`)?i(e):e;o=new t.Color(n).toNumber()}catch{o=n}return r.set(e,o),o}}var n=/-?\d*\.?\d+(?:e[-+]?\d+)?/gi;function r(e){let t=e.match(n);if(!t||t.length<8)return null;let r=t.slice(0,8).map(Number);return r.some(e=>Number.isNaN(e))?null:{p0:[r[0],r[1]],c1:[r[2],r[3]],c2:[r[4],r[5]],p3:[r[6],r[7]]}}function i(e,t){let n=1-t,r=n*n*n,i=3*n*n*t,a=3*n*t*t,o=t*t*t;return[r*e.p0[0]+i*e.c1[0]+a*e.c2[0]+o*e.p3[0],r*e.p0[1]+i*e.c1[1]+a*e.c2[1]+o*e.p3[1]]}function a(e){let t=Math.max(0,Math.min(1,e)),n=[34,197,94],r=[250,204,21],i=[239,68,68],a,o,s;t<=.5?(a=n,o=r,s=t*2):(a=r,o=i,s=(t-.5)*2);let c=(e,t)=>Math.round(e+(t-e)*s);return c(a[0],o[0])<<16|c(a[1],o[1])<<8|c(a[2],o[2])}var o=24,s=.45,c=2.5,l=.4,u=40,d=class e{app;world;grid;wireLayer;wireNodes=new Map;flowLayer;flowSprites=[];dotTexture;meterLayer;meterNodes=new Map;pendingMeters=[];metersDirty=!1;trackColor=1447454;resolveColor;connectedColor=6514417;flowNodes=[];flowPhase=0;zoom=1;needsRender=!1;rafId=0;lastAnimMs=0;liveData;levelsDirty=!1;pendingWires=[];pendingShouldFlow=()=>!1;wiresDirty=!1;wiresDrawnOnce=!1;bezierCache=new Map;destroyed=!1;background=`dots`;gridColor=2763320;gridTexture;constructor(e){this.Pixi=e,this.app=new e.Application}static async create(t,n){let r=new e(t);return await r.init(n),r}async init(e){if(await this.app.init({canvas:e.canvas,width:e.width,height:e.height,backgroundAlpha:0,antialias:!0,resolution:e.resolution,autoDensity:!0,preference:`webgl`,autoStart:!1}),this.destroyed){this.app.destroy({removeView:!1},{children:!0});return}this.resolveColor=t(this.Pixi,e.el),this.connectedColor=this.resolveColor(`var(--nb-c-primary)`,6514417),this.liveData=e.liveData,this.liveData&&(this.liveData.onChange=()=>{this.destroyed||(this.levelsDirty=!0,this.ensureRaf())}),this.background=e.background,this.gridColor=this.resolveColor(`var(--nb-blueprint-grid-color, var(--nb-c-border))`,2763320),this.grid=this.buildGrid(e.width,e.height),this.app.stage.addChild(this.grid),this.world=new this.Pixi.Container,this.app.stage.addChild(this.world),this.wireLayer=new this.Pixi.Container,this.meterLayer=new this.Pixi.Container,this.flowLayer=new this.Pixi.Container,this.world.addChild(this.wireLayer,this.meterLayer,this.flowLayer),this.dotTexture=this.makeDotTexture(),this.trackColor=this.resolveColor(`var(--nb-c-layer-2)`,1447454),this.app.ticker.stop()}buildGrid(e,t){this.gridTexture=this.makeGridTexture(this.background);let n=new this.Pixi.TilingSprite({texture:this.gridTexture,width:e,height:t});return n.alpha=.4,n.visible=this.background!==`none`,n}makeGridTexture(e){let t=new this.Pixi.Graphics;t.rect(0,0,o,o).fill({color:16777215,alpha:0}),e===`dots`?t.circle(1,1,1).fill({color:this.gridColor,alpha:1}):e===`lines`&&(t.rect(0,0,o,1).fill({color:this.gridColor,alpha:1}),t.rect(0,0,1,o).fill({color:this.gridColor,alpha:1}));let n=this.app.renderer.generateTexture(t);return n.source.scaleMode=`linear`,t.destroy(),n}setBackground(e){if(this.destroyed||e===this.background)return;this.background=e;let t=this.gridTexture;this.gridTexture=this.makeGridTexture(e),this.grid.texture=this.gridTexture,this.grid.visible=e!==`none`,t?.destroy(!0),this.requestRender()}setCamera(e,t,n){this.destroyed||(this.zoom=n,this.world.position.set(e,t),this.world.scale.set(n),this.grid.tilePosition.set(e,t),this.grid.tileScale.set(n),this.updateGridAlpha(n),this.requestRender())}updateGridAlpha(e){if(this.background===`none`)return;let t=o*e,n=Math.max(0,Math.min(1,(t-6)/10));this.grid.alpha=l*n}setWires(e,t){this.destroyed||(this.pendingWires=e,this.pendingShouldFlow=t,this.wiresDirty=!0,this.ensureRaf())}reconcileWireGeometry(){this.wiresDirty=!1,this.wiresDrawnOnce=!0;let e=new Set,t=[];for(let n of this.pendingWires){let i=this.bezierCache.get(n.path);if(i===void 0&&(i=r(n.path),this.bezierCache.set(n.path,i)),!i)continue;let a=n.conn,o=`${a.fromNode}|${a.fromPort}|${a.toNode}|${a.toPort}`;e.add(o);let s=a.active===!1,c=this.wireNodes.get(o);if(!c){let e=new this.Pixi.Graphics;c={gfx:e,path:``,bezier:i,baseColor:0,isMidi:n.isMidi,dim:s,flows:!1,key:o},this.wireNodes.set(o,c),this.wireLayer.addChild(e)}c.bezier=i,c.baseColor=this.resolveColor(n.color,this.connectedColor),c.isMidi=n.isMidi,c.dim=s,c.flows=!s&&this.pendingShouldFlow(a),c.path!==n.path&&(c.path=n.path,c.gfx.clear(),c.gfx.moveTo(i.p0[0],i.p0[1]).bezierCurveTo(i.c1[0],i.c1[1],i.c2[0],i.c2[1],i.p3[0],i.p3[1]).stroke({width:1,pixelLine:!0,color:16777215})),c.gfx.alpha=s?.25:.55,c.flows&&t.push(c)}for(let[t,n]of this.wireNodes)e.has(t)||(n.gfx.destroy(),this.wireNodes.delete(t));if(this.flowNodes=t,t.length||this.clearFlow(),this.bezierCache.size>e.size*2+64){let e=new Set([...this.wireNodes.values()].map(e=>e.path));for(let t of this.bezierCache.keys())e.has(t)||this.bezierCache.delete(t)}}wireColorFor(e){if(this.liveData&&!e.isMidi&&!e.dim){let t=this.liveData.get(e.key);if(t>0)return a(t)}return e.baseColor}applyWireColors(){for(let e of this.wireNodes.values())e.gfx.tint=this.wireColorFor(e)}setMeters(e){if(this.destroyed)return;let t=[];for(let n of e)if(n.meters)for(let e of n.meters)t.push({id:e.id,x:n.x+e.x,y:n.y+e.y,w:e.w,h:e.h});this.pendingMeters=t,this.metersDirty=!0,this.ensureRaf()}reconcileMeters(){this.metersDirty=!1;let e=new Set;for(let t of this.pendingMeters){e.add(t.id);let n=`${Math.round(t.x)},${Math.round(t.y)},${Math.round(t.w)},${Math.round(t.h)}`,r=this.meterNodes.get(t.id);if(!r){let e=new this.Pixi.Sprite(this.Pixi.Texture.WHITE),n=new this.Pixi.Sprite(this.Pixi.Texture.WHITE);e.tint=this.trackColor,n.anchor.set(0,1),this.meterLayer.addChild(e,n),r={track:e,fill:n,sig:``},this.meterNodes.set(t.id,r)}r.sig!==n&&(r.sig=n,r.track.position.set(t.x,t.y),r.track.width=t.w,r.track.height=t.h,r.fill.position.set(t.x,t.y+t.h),r.fill.width=t.w)}for(let[t,n]of this.meterNodes)e.has(t)||(n.track.destroy(),n.fill.destroy(),this.meterNodes.delete(t))}updateMeterValues(){if(!this.meterNodes.size)return;let e=this.liveData;for(let[t,n]of this.meterNodes){let r=e?Math.max(0,Math.min(1,e.get(t))):0,i=Math.round(Number(n.sig.split(`,`)[3]));n.fill.height=r*i,n.fill.tint=a(r)}}makeDotTexture(){let e=new this.Pixi.Graphics;e.circle(8,8,8).fill({color:16777215,alpha:1});let t=this.app.renderer.generateTexture(e);return t.source.scaleMode=`linear`,e.destroy(),t}resize(e,t,n){this.destroyed||(this.app.renderer.resolution=n,this.app.renderer.resize(e,t),this.grid.width=e,this.grid.height=t,this.requestRender())}requestRender(){this.needsRender=!0,this.ensureRaf()}ensureRaf(){this.rafId||this.destroyed||(this.rafId=requestAnimationFrame(this.frame))}frame=e=>{if(this.rafId=0,this.destroyed)return;let t=this.needsRender;this.needsRender=!1;let n=e-this.lastAnimMs>=u,r=this.wiresDirty&&(!this.wiresDrawnOnce||n),i=r||this.levelsDirty&&n;if(r&&this.reconcileWireGeometry(),this.metersDirty&&(this.reconcileMeters(),this.updateMeterValues(),t=!0),i&&(this.levelsDirty=!1,this.applyWireColors(),this.updateMeterValues(),t=!0),this.flowNodes.length&&n){let n=this.lastAnimMs?e-this.lastAnimMs:u;this.flowPhase=(this.flowPhase+n/1e3*s)%1,this.drawFlow(),t=!0}n&&(this.lastAnimMs=e),t&&this.app.render(),(this.needsRender||this.wiresDirty||this.levelsDirty||this.metersDirty||this.flowNodes.length)&&this.ensureRaf()};drawFlow(){let e=c/Math.max(this.zoom,.01)/8,t=0;for(let n of this.flowNodes){let[r,a]=i(n.bezier,this.flowPhase),o=this.flowSprites[t];o||(o=new this.Pixi.Sprite(this.dotTexture),o.anchor.set(.5),o.alpha=.9,this.flowLayer.addChild(o),this.flowSprites[t]=o),o.visible=!0,o.position.set(r,a),o.scale.set(e),o.tint=this.wireColorFor(n),t++}for(;t<this.flowSprites.length;t++)this.flowSprites[t].visible=!1}clearFlow(){for(let e of this.flowSprites)e.visible=!1}destroy(){this.destroyed||(this.destroyed=!0,this.rafId&&=(cancelAnimationFrame(this.rafId),0),this.wireNodes.clear(),this.flowSprites=[],this.flowNodes=[],this.meterNodes.clear(),this.app.destroy({removeView:!1},{children:!0,texture:!0}))}};exports.PixiScene=d;
|
|
2
|
+
//# sourceMappingURL=pixi-scene-D8kAPyID.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixi-scene-D8kAPyID.cjs","names":[],"sources":["../src/components/blueprint-pixi/pixi-color.ts","../src/components/blueprint-pixi/wire-path.ts","../src/components/blueprint-pixi/level-color.ts","../src/components/blueprint-pixi/pixi-scene.ts"],"sourcesContent":["// CSS-color → PixiJS numeric color, with CSS custom-property resolution.\n//\n// Wire and card colors arrive as CSS color strings: concrete (`#38bdf8`,\n// `rgb(...)`) for resolved wires, but possibly a `var(--token)` for card\n// accents or the grid. PixiJS `Color` parses concrete strings but not\n// `var(...)`, so we resolve custom properties against a reference element's\n// computed style first, then hand the result to `Color`. Lookups are cached\n// because getComputedStyle is not free and the same tokens recur across\n// thousands of wires.\n\nimport type * as PIXI from 'pixi.js'\n\nexport type TColorResolver = (\n css: string | undefined,\n fallback: number,\n) => number\n\nconst VAR_RE = /var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*([^)]+))?\\)/\n\n/**\n * Build a resolver bound to a PixiJS module and a reference element (used to\n * resolve CSS custom properties). The returned function converts a CSS color\n * string to a 24-bit RGB number, returning `fallback` for empty/unparseable\n * input so a bad token never throws mid-render.\n */\nexport function makeColorResolver(\n Pixi: typeof PIXI,\n el: HTMLElement,\n): TColorResolver {\n const cache = new Map<string, number>()\n\n function resolveVar(css: string): string {\n const m = css.match(VAR_RE)\n if (!m) return css\n const token = m[1]!\n const fallbackExpr = m[2]?.trim()\n const styles = getComputedStyle(el)\n const value = styles.getPropertyValue(token).trim()\n if (value) return value\n // Nested var fallback (e.g. var(--a, var(--b, #fff))): recurse.\n if (fallbackExpr) return resolveVar(fallbackExpr)\n return css\n }\n\n return (css, fallback) => {\n if (!css) return fallback\n const hit = cache.get(css)\n if (hit !== undefined) return hit\n let out: number\n try {\n const resolved = css.includes('var(') ? resolveVar(css) : css\n out = new Pixi.Color(resolved).toNumber()\n } catch {\n out = fallback\n }\n cache.set(css, out)\n return out\n }\n}\n","// Parsing and sampling for the cubic-bezier wire paths NbBlueprint produces.\n//\n// NbBlueprint's `computedWires` emits each wire as an SVG path string of the\n// exact form `M fx fy C c1x c1y, c2x c2y, tx ty` (see Blueprint.vue). The\n// PixiJS renderer re-draws those same curves with `Graphics.bezierCurveTo`,\n// and the flow animation samples them into points. This module turns the\n// path string into structured control points and sampled polylines. It has\n// no PixiJS dependency so it stays in the always-loaded bundle and is unit\n// testable without a WebGL context.\n\nexport interface ICubicBezier {\n /** Start point [x, y]. */\n p0: [number, number]\n /** First control point. */\n c1: [number, number]\n /** Second control point. */\n c2: [number, number]\n /** End point. */\n p3: [number, number]\n}\n\nconst NUMBER_RE = /-?\\d*\\.?\\d+(?:e[-+]?\\d+)?/gi\n\n/**\n * Parse a `M x y C x y x y x y` cubic path string into control points.\n * Returns null if the string does not contain the expected 8 numbers (so a\n * malformed or non-cubic path is skipped rather than throwing).\n */\nexport function parseCubicPath(d: string): ICubicBezier | null {\n const m = d.match(NUMBER_RE)\n if (!m || m.length < 8) return null\n const n = m.slice(0, 8).map(Number)\n if (n.some((v) => Number.isNaN(v))) return null\n return {\n p0: [n[0]!, n[1]!],\n c1: [n[2]!, n[3]!],\n c2: [n[4]!, n[5]!],\n p3: [n[6]!, n[7]!],\n }\n}\n\n/** Evaluate a cubic bezier at parameter t in [0, 1]. */\nexport function cubicAt(b: ICubicBezier, t: number): [number, number] {\n const mt = 1 - t\n const a = mt * mt * mt\n const c = 3 * mt * mt * t\n const e = 3 * mt * t * t\n const f = t * t * t\n return [\n a * b.p0[0] + c * b.c1[0] + e * b.c2[0] + f * b.p3[0],\n a * b.p0[1] + c * b.c1[1] + e * b.c2[1] + f * b.p3[1],\n ]\n}\n\n/**\n * Sample a cubic bezier into `segments + 1` points. Used by the flow\n * animation to walk evenly-ish along the wire. `segments` is a fixed count\n * (not arc-length parameterised) which is plenty for a short connector.\n */\nexport function sampleCubic(\n b: ICubicBezier,\n segments: number,\n): [number, number][] {\n const pts: [number, number][] = []\n for (let i = 0; i <= segments; i++) pts.push(cubicAt(b, i / segments))\n return pts\n}\n","// Map an audio level (0..1) to a green -> yellow -> red colour as a PixiJS\n// numeric colour (0xRRGGBB). The same ramp the DOM path uses for wire levels,\n// but returned as a number so the GPU layer never parses a CSS string per\n// frame. Level <= 0.5 interpolates green -> yellow; above, yellow -> red.\nexport function levelToColorNumber(level: number): number {\n const l = Math.max(0, Math.min(1, level))\n const green = [34, 197, 94]\n const yellow = [250, 204, 21]\n const red = [239, 68, 68]\n let a: number[], b: number[], t: number\n if (l <= 0.5) {\n a = green\n b = yellow\n t = l * 2\n } else {\n a = yellow\n b = red\n t = (l - 0.5) * 2\n }\n const mix = (x: number, y: number): number => Math.round(x + (y - x) * t)\n return (\n (mix(a[0]!, b[0]!) << 16) | (mix(a[1]!, b[1]!) << 8) | mix(a[2]!, b[2]!)\n )\n}\n","// PixiJS scene manager for the Blueprint renderer.\n//\n// Owns the Application, a single panned/zoomed `world` Container (the camera),\n// an infinite dot-grid background, a batched wire layer, and an animated flow\n// layer. Cards are NOT drawn here: they stay real interactive DOM in the\n// overlay above this canvas at all times (no painted/snapshot substitute). This\n// scene only accelerates the grid + wires + flow on the GPU. The Vue component\n// (BlueprintPixiRenderer.vue) drives it with the culled scene NbBlueprint feeds\n// every renderer; this module has all the PixiJS specifics.\n//\n// PixiJS is passed in (not imported) so it stays a dynamically-loaded,\n// externalized optional peer dependency; only `import type` references reach\n// this module statically, and those are erased at build time.\n\nimport type * as PIXI from 'pixi.js'\nimport type { IBlueprintCard, TBlueprintBackground } from '../Blueprint.types'\nimport type { IBlueprintWire } from '../Blueprint.renderer'\nimport { makeColorResolver } from './pixi-color'\nimport { parseCubicPath, cubicAt, type ICubicBezier } from './wire-path'\nimport { levelToColorNumber } from './level-color'\nimport type { BlueprintLiveData } from './live-data'\n\nconst GRID_TILE = 24\nconst FLOW_SPEED = 0.45 // fraction of a wire traversed per second\nconst FLOW_DOT_R = 2.5\n// Wire/flow geometry lives in the zoomed `world`. A normal world-space stroke\n// shrinks on screen as you zoom out (wires vanish at far zoom); `pixelLine`\n// renders a crisp screen-space line instead, constant at every zoom, so the\n// wire layer is drawn once and never re-stroked as the camera moves.\nconst GRID_BASE_ALPHA = 0.4\n// This scene renders ON DEMAND: there is no free-running 60fps loop. A state\n// change (camera, wires, background) requests a single repaint, and when\n// nothing changes the scene renders nothing and costs ~0 CPU, which matters in\n// an audio host where the GPU/CPU budget belongs to DSP. Animated modes\n// (\"levels\"/flow) push updates as fast as ~60Hz; we coalesce those and repaint\n// at most this often, so an always-animating mode stays cheap. ~25fps reads as\n// smooth for level/flow motion at a fraction of the cost of 60.\nconst ANIM_FRAME_MS = 40\n\nexport interface IPixiSceneOptions {\n canvas: HTMLCanvasElement\n /** Reference element for resolving CSS custom properties (the container). */\n el: HTMLElement\n width: number\n height: number\n resolution: number\n background: TBlueprintBackground\n /** Non-reactive live values (wire levels, ...) the host writes at audio rate;\n * the scene reads them on its throttled render tick. */\n liveData?: BlueprintLiveData\n}\n\n// One meter's GPU geometry in world coords (resolved from a card + its local\n// meter box). Recomputed only when a card moves or the visible set changes.\ninterface IMeterGeom {\n id: string\n x: number\n y: number\n w: number\n h: number\n}\n\n// A drawn meter: a static dark track and an animated fill, plus a signature so\n// geometry is only re-laid-out when it actually changes.\ninterface IMeterNode {\n track: PIXI.Sprite\n fill: PIXI.Sprite\n sig: string\n}\n\n// One wire drawn once (geometry baked, stroked white) and recoloured by `tint`.\n// Animating the level colour is then a uniform change, NOT a re-tessellation,\n// which is what eliminates the per-frame GPU-geometry churn (and its GC spikes).\ninterface IWireNode {\n gfx: PIXI.Graphics\n path: string\n bezier: ICubicBezier\n baseColor: number\n isMidi: boolean\n dim: boolean\n flows: boolean\n key: string\n}\n\nexport class PixiScene {\n private app: PIXI.Application\n private world!: PIXI.Container\n private grid!: PIXI.TilingSprite\n // Wire layer: a container of per-wire Graphics (see IWireNode). Flow layer: a\n // pool of reused dot sprites repositioned each frame (no re-tessellation).\n private wireLayer!: PIXI.Container\n private wireNodes = new Map<string, IWireNode>()\n private flowLayer!: PIXI.Container\n private flowSprites: PIXI.Sprite[] = []\n private dotTexture!: PIXI.Texture\n // Meter layer: each declared card meter is a static dark track + an animated\n // fill sprite (scale.y + tint from the live channel). Drawn over wires, on the\n // back canvas; the DOM card leaves a transparent hole so it shows through.\n private meterLayer!: PIXI.Container\n private meterNodes = new Map<string, IMeterNode>()\n private pendingMeters: IMeterGeom[] = []\n private metersDirty = false\n private trackColor = 0x16161e\n private resolveColor!: ReturnType<typeof makeColorResolver>\n // Fallback colour for a wire whose own colour does not resolve.\n private connectedColor = 0x6366f1\n private flowNodes: IWireNode[] = []\n private flowPhase = 0\n private zoom = 1\n // Render-on-demand scheduler. `needsRender` is the immediate path (camera,\n // background, resize). `rafId` holds the single in-flight frame; the loop\n // only stays alive while there is pending or ongoing (animation) work, then\n // stops so the scene costs nothing at rest. `lastAnimMs` paces the throttled\n // animation/wire-rebuild path.\n private needsRender = false\n private rafId = 0\n private lastAnimMs = 0\n // Live wire levels (host writes at audio rate, bypassing Vue). `levelsDirty`\n // is set when a write lands; the frame loop recolours wires on the throttled\n // animation cadence, then idles when the host stops writing.\n private liveData: BlueprintLiveData | undefined\n private levelsDirty = false\n // Coalesced wire state: setWires only stashes the latest set + marks dirty;\n // the frame loop rebuilds it (immediately the first time, then throttled to\n // ANIM_FRAME_MS). Parsed beziers are cached by path string so unchanged\n // geometry (levels mode only shifts colour) never pays the regex parse again.\n private pendingWires: IBlueprintWire[] = []\n private pendingShouldFlow: (conn: IBlueprintWire['conn']) => boolean = () =>\n false\n private wiresDirty = false\n private wiresDrawnOnce = false\n private bezierCache = new Map<string, ICubicBezier | null>()\n private destroyed = false\n private background: TBlueprintBackground = 'dots'\n private gridColor = 0x2a2a38\n private gridTexture!: PIXI.Texture\n\n private constructor(private readonly Pixi: typeof PIXI) {\n this.app = new Pixi.Application()\n }\n\n /** Create and initialise a scene. Async because PixiJS v8 `app.init` is. */\n static async create(\n Pixi: typeof PIXI,\n opts: IPixiSceneOptions,\n ): Promise<PixiScene> {\n const scene = new PixiScene(Pixi)\n await scene.init(opts)\n return scene\n }\n\n private async init(opts: IPixiSceneOptions): Promise<void> {\n await this.app.init({\n canvas: opts.canvas,\n width: opts.width,\n height: opts.height,\n backgroundAlpha: 0,\n antialias: true,\n resolution: opts.resolution,\n autoDensity: true,\n preference: 'webgl',\n // No free-running render loop: we drive app.render() on demand so an idle\n // blueprint costs ~0 CPU (the audio engine gets the budget).\n autoStart: false,\n })\n if (this.destroyed) {\n this.app.destroy({ removeView: false }, { children: true })\n return\n }\n\n this.resolveColor = makeColorResolver(this.Pixi, opts.el)\n this.connectedColor = this.resolveColor('var(--nb-c-primary)', 0x6366f1)\n\n this.liveData = opts.liveData\n if (this.liveData) {\n // A host write wakes the loop; the actual recolour is throttled in frame().\n this.liveData.onChange = () => {\n if (this.destroyed) return\n this.levelsDirty = true\n this.ensureRaf()\n }\n }\n\n this.background = opts.background\n this.gridColor = this.resolveColor(\n 'var(--nb-blueprint-grid-color, var(--nb-c-border))',\n 0x2a2a38,\n )\n this.grid = this.buildGrid(opts.width, opts.height)\n this.app.stage.addChild(this.grid)\n\n this.world = new this.Pixi.Container()\n this.app.stage.addChild(this.world)\n\n this.wireLayer = new this.Pixi.Container()\n this.meterLayer = new this.Pixi.Container()\n this.flowLayer = new this.Pixi.Container()\n // Order: wires (back) -> meters (over the card area) -> flow dots (top).\n this.world.addChild(this.wireLayer, this.meterLayer, this.flowLayer)\n this.dotTexture = this.makeDotTexture()\n this.trackColor = this.resolveColor('var(--nb-c-layer-2)', 0x16161e)\n // Stop Pixi's shared ticker for good measure; rendering is fully on-demand.\n this.app.ticker.stop()\n }\n\n private buildGrid(width: number, height: number): PIXI.TilingSprite {\n // A GRID_TILE-sized pattern tile, tiled across the screen. The grid lives\n // in stage (screen) space; panning/zooming maps to the tiling sprite's\n // tilePosition/tileScale (= zoom), which is far cheaper than redrawing a\n // world-space pattern every camera change.\n this.gridTexture = this.makeGridTexture(this.background)\n const sprite = new this.Pixi.TilingSprite({\n texture: this.gridTexture,\n width,\n height,\n })\n sprite.alpha = 0.4\n sprite.visible = this.background !== 'none'\n return sprite\n }\n\n private makeGridTexture(bg: TBlueprintBackground): PIXI.Texture {\n // A transparent full-tile rect fixes the texture size to GRID_TILE; the\n // pattern (dot, or top+left edge lines) is drawn over it so tiling yields\n // an evenly spaced grid.\n const g = new this.Pixi.Graphics()\n g.rect(0, 0, GRID_TILE, GRID_TILE).fill({ color: 0xffffff, alpha: 0 })\n if (bg === 'dots') {\n g.circle(1, 1, 1).fill({ color: this.gridColor, alpha: 1 })\n } else if (bg === 'lines') {\n g.rect(0, 0, GRID_TILE, 1).fill({ color: this.gridColor, alpha: 1 })\n g.rect(0, 0, 1, GRID_TILE).fill({ color: this.gridColor, alpha: 1 })\n }\n const texture = this.app.renderer.generateTexture(g)\n // Linear sampling softens the pattern when it is minified (zoomed out),\n // which together with the far-zoom alpha fade (see updateGridAlpha) avoids\n // the moiré a nearest-sampled 1px dot/line grid produces at fractional\n // tile scales.\n texture.source.scaleMode = 'linear'\n g.destroy()\n return texture\n }\n\n /** Switch the background pattern at runtime. */\n setBackground(bg: TBlueprintBackground): void {\n if (this.destroyed || bg === this.background) return\n this.background = bg\n const old = this.gridTexture\n this.gridTexture = this.makeGridTexture(bg)\n this.grid.texture = this.gridTexture\n this.grid.visible = bg !== 'none'\n old?.destroy(true)\n this.requestRender()\n }\n\n setCamera(panX: number, panY: number, zoom: number): void {\n if (this.destroyed) return\n this.zoom = zoom\n this.world.position.set(panX, panY)\n this.world.scale.set(zoom)\n // Grid follows the camera: the GRID_TILE-sized pattern scales with zoom\n // and slides with pan.\n this.grid.tilePosition.set(panX, panY)\n this.grid.tileScale.set(zoom)\n this.updateGridAlpha(zoom)\n // Wires use pixelLine (constant screen width), so the camera never needs to\n // re-stroke them: panning and zooming are a pure GPU transform of the layer.\n this.requestRender()\n }\n\n /** Fade the grid out as tiles approach sub-pixel density (far zoom): the\n * pattern is meaningless when that dense and is the source of moiré. */\n private updateGridAlpha(zoom: number): void {\n if (this.background === 'none') return\n const tilePx = GRID_TILE * zoom\n const fade = Math.max(0, Math.min(1, (tilePx - 6) / 10))\n this.grid.alpha = GRID_BASE_ALPHA * fade\n }\n\n /** Stash the latest wire set; the frame loop reconciles geometry + colours it\n * (the first set at once, later ones coalesced to ANIM_FRAME_MS). */\n setWires(\n wires: IBlueprintWire[],\n shouldFlow: (conn: IBlueprintWire['conn']) => boolean,\n ): void {\n if (this.destroyed) return\n this.pendingWires = wires\n this.pendingShouldFlow = shouldFlow\n this.wiresDirty = true\n this.ensureRaf()\n }\n\n /** Reconcile the per-wire Graphics against the pending set. Geometry is\n * stroked (white, pixelLine) only when a wire is new or its path changed;\n * colour is NOT baked here (see applyWireColors). This runs on a\n * topology/geometry change, never per animation frame. */\n private reconcileWireGeometry(): void {\n this.wiresDirty = false\n this.wiresDrawnOnce = true\n const seen = new Set<string>()\n const flow: IWireNode[] = []\n for (const wire of this.pendingWires) {\n let b = this.bezierCache.get(wire.path)\n if (b === undefined) {\n b = parseCubicPath(wire.path)\n this.bezierCache.set(wire.path, b)\n }\n if (!b) continue\n const c = wire.conn\n const key = `${c.fromNode}|${c.fromPort}|${c.toNode}|${c.toPort}`\n seen.add(key)\n const dim = c.active === false\n let node = this.wireNodes.get(key)\n if (!node) {\n const gfx = new this.Pixi.Graphics()\n node = {\n gfx,\n path: '',\n bezier: b,\n baseColor: 0,\n isMidi: wire.isMidi,\n dim,\n flows: false,\n key,\n }\n this.wireNodes.set(key, node)\n this.wireLayer.addChild(gfx)\n }\n node.bezier = b\n node.baseColor = this.resolveColor(wire.color, this.connectedColor)\n node.isMidi = wire.isMidi\n node.dim = dim\n node.flows = !dim && this.pendingShouldFlow(c)\n // Re-stroke only when the geometry actually changed.\n if (node.path !== wire.path) {\n node.path = wire.path\n node.gfx.clear()\n node.gfx\n .moveTo(b.p0[0], b.p0[1])\n .bezierCurveTo(b.c1[0], b.c1[1], b.c2[0], b.c2[1], b.p3[0], b.p3[1])\n .stroke({ width: 1, pixelLine: true, color: 0xffffff })\n }\n node.gfx.alpha = dim ? 0.25 : 0.55\n if (node.flows) flow.push(node)\n }\n for (const [key, node] of this.wireNodes) {\n if (seen.has(key)) continue\n node.gfx.destroy()\n this.wireNodes.delete(key)\n }\n this.flowNodes = flow\n if (!flow.length) this.clearFlow()\n if (this.bezierCache.size > seen.size * 2 + 64) {\n const live = new Set([...this.wireNodes.values()].map((n) => n.path))\n for (const path of this.bezierCache.keys()) {\n if (!live.has(path)) this.bezierCache.delete(path)\n }\n }\n }\n\n /** The current colour of a wire: its live level (audio, active, non-MIDI) or\n * its base accent. Applied as a cheap tint, no geometry rebuild. */\n private wireColorFor(node: IWireNode): number {\n if (this.liveData && !node.isMidi && !node.dim) {\n const level = this.liveData.get(node.key)\n if (level > 0) return levelToColorNumber(level)\n }\n return node.baseColor\n }\n\n /** Recolour every wire by tint only (no re-tessellation). Cheap enough to run\n * on every level tick. */\n private applyWireColors(): void {\n for (const node of this.wireNodes.values()) {\n node.gfx.tint = this.wireColorFor(node)\n }\n }\n\n /** Stash the visible cards' meter geometry (world coords). Runs when the\n * visible set or a card position changes, NOT per animation frame. */\n setMeters(cards: IBlueprintCard[]): void {\n if (this.destroyed) return\n const geoms: IMeterGeom[] = []\n for (const card of cards) {\n if (!card.meters) continue\n for (const m of card.meters) {\n geoms.push({\n id: m.id,\n x: card.x + m.x,\n y: card.y + m.y,\n w: m.w,\n h: m.h,\n })\n }\n }\n this.pendingMeters = geoms\n this.metersDirty = true\n this.ensureRaf()\n }\n\n /** Reconcile meter sprites against the pending geometry. Lays out a track +\n * fill per meter only when its box changes; values are applied separately. */\n private reconcileMeters(): void {\n this.metersDirty = false\n const seen = new Set<string>()\n for (const g of this.pendingMeters) {\n seen.add(g.id)\n const sig = `${Math.round(g.x)},${Math.round(g.y)},${Math.round(g.w)},${Math.round(g.h)}`\n let node = this.meterNodes.get(g.id)\n if (!node) {\n const track = new this.Pixi.Sprite(this.Pixi.Texture.WHITE)\n const fill = new this.Pixi.Sprite(this.Pixi.Texture.WHITE)\n track.tint = this.trackColor\n fill.anchor.set(0, 1) // grow up from the bottom\n this.meterLayer.addChild(track, fill)\n node = { track, fill, sig: '' }\n this.meterNodes.set(g.id, node)\n }\n if (node.sig !== sig) {\n node.sig = sig\n node.track.position.set(g.x, g.y)\n node.track.width = g.w\n node.track.height = g.h\n node.fill.position.set(g.x, g.y + g.h)\n node.fill.width = g.w\n }\n }\n for (const [id, node] of this.meterNodes) {\n if (seen.has(id)) continue\n node.track.destroy()\n node.fill.destroy()\n this.meterNodes.delete(id)\n }\n }\n\n /** Set each meter's fill height + colour from the live channel. Cheap (a\n * sprite scale + tint), no geometry rebuild; runs on the live tick. */\n private updateMeterValues(): void {\n if (!this.meterNodes.size) return\n const live = this.liveData\n for (const [id, node] of this.meterNodes) {\n const v = live ? Math.max(0, Math.min(1, live.get(id))) : 0\n const h = Math.round(Number(node.sig.split(',')[3]))\n node.fill.height = v * h\n node.fill.tint = levelToColorNumber(v)\n }\n }\n\n /** A small white dot, tinted per flow wire. Built once. */\n private makeDotTexture(): PIXI.Texture {\n const g = new this.Pixi.Graphics()\n g.circle(8, 8, 8).fill({ color: 0xffffff, alpha: 1 })\n const tex = this.app.renderer.generateTexture(g)\n tex.source.scaleMode = 'linear'\n g.destroy()\n return tex\n }\n\n resize(width: number, height: number, resolution: number): void {\n if (this.destroyed) return\n this.app.renderer.resolution = resolution\n this.app.renderer.resize(width, height)\n this.grid.width = width\n this.grid.height = height\n this.requestRender()\n }\n\n // ── Render-on-demand scheduler ────────────────────────────────────────\n\n /** Request a single repaint for an immediate change (camera/background/resize). */\n private requestRender(): void {\n this.needsRender = true\n this.ensureRaf()\n }\n\n /** Ensure exactly one frame is scheduled. */\n private ensureRaf(): void {\n if (this.rafId || this.destroyed) return\n this.rafId = requestAnimationFrame(this.frame)\n }\n\n /** The only place app.render() is called. Runs a frame, then reschedules\n * itself ONLY while there is pending or ongoing (animation) work, so an idle\n * scene drops to zero scheduled frames and zero CPU. */\n private frame = (ts: number): void => {\n this.rafId = 0\n if (this.destroyed) return\n let render = this.needsRender\n this.needsRender = false\n\n const animWindow = ts - this.lastAnimMs >= ANIM_FRAME_MS\n // Geometry reconcile (topology/path change) runs at once the first time then\n // throttled; colour (base or live level) is a cheap tint pass, no\n // re-tessellation, so a 60Hz level stream costs almost nothing.\n const doGeometry = this.wiresDirty && (!this.wiresDrawnOnce || animWindow)\n const doColors = doGeometry || (this.levelsDirty && animWindow)\n if (doGeometry) this.reconcileWireGeometry()\n // Meter geometry reconciles when the visible set / a card moves (infrequent,\n // not throttled); values animate from the live channel on the same throttled\n // cadence as wire colours.\n if (this.metersDirty) {\n this.reconcileMeters()\n this.updateMeterValues()\n render = true\n }\n if (doColors) {\n this.levelsDirty = false\n this.applyWireColors()\n this.updateMeterValues()\n render = true\n }\n // Flow dots: advance + reposition pooled sprites on the anim cadence.\n if (this.flowNodes.length && animWindow) {\n const dt = this.lastAnimMs ? ts - this.lastAnimMs : ANIM_FRAME_MS\n this.flowPhase = (this.flowPhase + FLOW_SPEED * (dt / 1000)) % 1\n this.drawFlow()\n render = true\n }\n if (animWindow) this.lastAnimMs = ts\n\n if (render) this.app.render()\n\n // Keep looping only while work remains; otherwise stop (0 CPU at rest).\n if (\n this.needsRender ||\n this.wiresDirty ||\n this.levelsDirty ||\n this.metersDirty ||\n this.flowNodes.length\n ) {\n this.ensureRaf()\n }\n }\n\n /** Position a pooled, tinted dot sprite on each flowing wire. Reuses sprites\n * (no per-frame geometry/allocation), so flow animation does not churn. */\n private drawFlow(): void {\n const scale = FLOW_DOT_R / Math.max(this.zoom, 0.01) / 8\n let i = 0\n for (const node of this.flowNodes) {\n const [x, y] = cubicAt(node.bezier, this.flowPhase)\n let sprite = this.flowSprites[i]\n if (!sprite) {\n sprite = new this.Pixi.Sprite(this.dotTexture)\n sprite.anchor.set(0.5)\n sprite.alpha = 0.9\n this.flowLayer.addChild(sprite)\n this.flowSprites[i] = sprite\n }\n sprite.visible = true\n sprite.position.set(x, y)\n sprite.scale.set(scale)\n sprite.tint = this.wireColorFor(node)\n i++\n }\n for (; i < this.flowSprites.length; i++)\n this.flowSprites[i]!.visible = false\n }\n\n private clearFlow(): void {\n for (const s of this.flowSprites) s.visible = false\n }\n\n destroy(): void {\n if (this.destroyed) return\n this.destroyed = true\n if (this.rafId) {\n cancelAnimationFrame(this.rafId)\n this.rafId = 0\n }\n this.wireNodes.clear()\n this.flowSprites = []\n this.flowNodes = []\n this.meterNodes.clear()\n // removeView:false — the <canvas> is Vue-owned and unmounts with the\n // component; we only tear down the GPU scene + textures.\n this.app.destroy({ removeView: false }, { children: true, texture: true })\n }\n}\n"],"mappings":"AAiBA,IAAM,EAAS,0CAQf,SAAgB,EACd,EACA,EACgB,CAChB,IAAM,EAAQ,IAAI,IAElB,SAAS,EAAW,EAAqB,CACvC,IAAM,EAAI,EAAI,MAAM,EAAO,CAC3B,GAAI,CAAC,EAAG,OAAO,EACf,IAAM,EAAQ,EAAE,GACV,EAAe,EAAE,IAAI,MAAM,CAMjC,OALe,iBAAiB,EAAG,CACd,iBAAiB,EAA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