@awesome-flow/noise 0.1.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.
Files changed (109) hide show
  1. package/dist/abstract/index.cjs +4234 -0
  2. package/dist/abstract/index.cjs.map +1 -0
  3. package/dist/abstract/index.d.cts +137 -0
  4. package/dist/abstract/index.d.ts +137 -0
  5. package/dist/abstract/index.js +4271 -0
  6. package/dist/abstract/index.js.map +1 -0
  7. package/dist/handle-types-D-v5S53h.d.cts +22 -0
  8. package/dist/handle-types-D-v5S53h.d.ts +22 -0
  9. package/dist/layout/index.cjs +164 -0
  10. package/dist/layout/index.cjs.map +1 -0
  11. package/dist/layout/index.d.cts +26 -0
  12. package/dist/layout/index.d.ts +26 -0
  13. package/dist/layout/index.js +136 -0
  14. package/dist/layout/index.js.map +1 -0
  15. package/dist/modules/index.cjs +71 -0
  16. package/dist/modules/index.cjs.map +1 -0
  17. package/dist/modules/index.d.cts +18 -0
  18. package/dist/modules/index.d.ts +18 -0
  19. package/dist/modules/index.js +34 -0
  20. package/dist/modules/index.js.map +1 -0
  21. package/dist/node-props-CeZ8Oshz.d.ts +161 -0
  22. package/dist/node-props-hKW-_KOU.d.cts +161 -0
  23. package/dist/nodes/generators/index.cjs +640 -0
  24. package/dist/nodes/generators/index.cjs.map +1 -0
  25. package/dist/nodes/generators/index.d.cts +38 -0
  26. package/dist/nodes/generators/index.d.ts +38 -0
  27. package/dist/nodes/generators/index.js +592 -0
  28. package/dist/nodes/generators/index.js.map +1 -0
  29. package/dist/nodes/groups/index.cjs +104 -0
  30. package/dist/nodes/groups/index.cjs.map +1 -0
  31. package/dist/nodes/groups/index.d.cts +7 -0
  32. package/dist/nodes/groups/index.d.ts +7 -0
  33. package/dist/nodes/groups/index.js +78 -0
  34. package/dist/nodes/groups/index.js.map +1 -0
  35. package/dist/nodes/index.cjs +2830 -0
  36. package/dist/nodes/index.cjs.map +1 -0
  37. package/dist/nodes/index.d.cts +16 -0
  38. package/dist/nodes/index.d.ts +16 -0
  39. package/dist/nodes/index.js +2840 -0
  40. package/dist/nodes/index.js.map +1 -0
  41. package/dist/nodes/modifiers/index.cjs +1593 -0
  42. package/dist/nodes/modifiers/index.cjs.map +1 -0
  43. package/dist/nodes/modifiers/index.d.cts +32 -0
  44. package/dist/nodes/modifiers/index.d.ts +32 -0
  45. package/dist/nodes/modifiers/index.js +1612 -0
  46. package/dist/nodes/modifiers/index.js.map +1 -0
  47. package/dist/nodes/output/index.cjs +210 -0
  48. package/dist/nodes/output/index.cjs.map +1 -0
  49. package/dist/nodes/output/index.d.cts +13 -0
  50. package/dist/nodes/output/index.d.ts +13 -0
  51. package/dist/nodes/output/index.js +181 -0
  52. package/dist/nodes/output/index.js.map +1 -0
  53. package/dist/nodes/selectors/index.cjs +136 -0
  54. package/dist/nodes/selectors/index.cjs.map +1 -0
  55. package/dist/nodes/selectors/index.d.cts +16 -0
  56. package/dist/nodes/selectors/index.d.ts +16 -0
  57. package/dist/nodes/selectors/index.js +113 -0
  58. package/dist/nodes/selectors/index.js.map +1 -0
  59. package/dist/nodes/transformers/index.cjs +477 -0
  60. package/dist/nodes/transformers/index.cjs.map +1 -0
  61. package/dist/nodes/transformers/index.d.cts +22 -0
  62. package/dist/nodes/transformers/index.d.ts +22 -0
  63. package/dist/nodes/transformers/index.js +459 -0
  64. package/dist/nodes/transformers/index.js.map +1 -0
  65. package/dist/properties-BxwtU6i9.d.cts +9 -0
  66. package/dist/properties-BxwtU6i9.d.ts +9 -0
  67. package/dist/templates/generators/index.cjs +1714 -0
  68. package/dist/templates/generators/index.cjs.map +1 -0
  69. package/dist/templates/generators/index.d.cts +89 -0
  70. package/dist/templates/generators/index.d.ts +89 -0
  71. package/dist/templates/generators/index.js +1723 -0
  72. package/dist/templates/generators/index.js.map +1 -0
  73. package/dist/templates/groups/index.cjs +1690 -0
  74. package/dist/templates/groups/index.cjs.map +1 -0
  75. package/dist/templates/groups/index.d.cts +11 -0
  76. package/dist/templates/groups/index.d.ts +11 -0
  77. package/dist/templates/groups/index.js +1711 -0
  78. package/dist/templates/groups/index.js.map +1 -0
  79. package/dist/templates/index.cjs +1758 -0
  80. package/dist/templates/index.cjs.map +1 -0
  81. package/dist/templates/index.d.cts +15 -0
  82. package/dist/templates/index.d.ts +15 -0
  83. package/dist/templates/index.js +1745 -0
  84. package/dist/templates/index.js.map +1 -0
  85. package/dist/templates/modifiers/index.cjs +1708 -0
  86. package/dist/templates/modifiers/index.cjs.map +1 -0
  87. package/dist/templates/modifiers/index.d.cts +71 -0
  88. package/dist/templates/modifiers/index.d.ts +71 -0
  89. package/dist/templates/modifiers/index.js +1720 -0
  90. package/dist/templates/modifiers/index.js.map +1 -0
  91. package/dist/templates/output/index.cjs +1696 -0
  92. package/dist/templates/output/index.cjs.map +1 -0
  93. package/dist/templates/output/index.d.cts +29 -0
  94. package/dist/templates/output/index.d.ts +29 -0
  95. package/dist/templates/output/index.js +1714 -0
  96. package/dist/templates/output/index.js.map +1 -0
  97. package/dist/templates/selectors/index.cjs +1692 -0
  98. package/dist/templates/selectors/index.cjs.map +1 -0
  99. package/dist/templates/selectors/index.d.cts +22 -0
  100. package/dist/templates/selectors/index.d.ts +22 -0
  101. package/dist/templates/selectors/index.js +1712 -0
  102. package/dist/templates/selectors/index.js.map +1 -0
  103. package/dist/templates/transformers/index.cjs +1698 -0
  104. package/dist/templates/transformers/index.cjs.map +1 -0
  105. package/dist/templates/transformers/index.d.cts +40 -0
  106. package/dist/templates/transformers/index.d.ts +40 -0
  107. package/dist/templates/transformers/index.js +1715 -0
  108. package/dist/templates/transformers/index.js.map +1 -0
  109. package/package.json +111 -0
@@ -0,0 +1,4271 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // ../../node_modules/fast-deep-equal/index.js
28
+ var require_fast_deep_equal = __commonJS({
29
+ "../../node_modules/fast-deep-equal/index.js"(exports, module) {
30
+ "use strict";
31
+ module.exports = function equal(a, b) {
32
+ if (a === b)
33
+ return true;
34
+ if (a && b && typeof a == "object" && typeof b == "object") {
35
+ if (a.constructor !== b.constructor)
36
+ return false;
37
+ var length, i, keys;
38
+ if (Array.isArray(a)) {
39
+ length = a.length;
40
+ if (length != b.length)
41
+ return false;
42
+ for (i = length; i-- !== 0; )
43
+ if (!equal(a[i], b[i]))
44
+ return false;
45
+ return true;
46
+ }
47
+ if (a.constructor === RegExp)
48
+ return a.source === b.source && a.flags === b.flags;
49
+ if (a.valueOf !== Object.prototype.valueOf)
50
+ return a.valueOf() === b.valueOf();
51
+ if (a.toString !== Object.prototype.toString)
52
+ return a.toString() === b.toString();
53
+ keys = Object.keys(a);
54
+ length = keys.length;
55
+ if (length !== Object.keys(b).length)
56
+ return false;
57
+ for (i = length; i-- !== 0; )
58
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i]))
59
+ return false;
60
+ for (i = length; i-- !== 0; ) {
61
+ var key = keys[i];
62
+ if (!equal(a[key], b[key]))
63
+ return false;
64
+ }
65
+ return true;
66
+ }
67
+ return a !== a && b !== b;
68
+ };
69
+ }
70
+ });
71
+
72
+ // src/abstract/handle-types.ts
73
+ var NoiseHandleFlag = /* @__PURE__ */ ((NoiseHandleFlag2) => {
74
+ NoiseHandleFlag2[NoiseHandleFlag2["texture"] = 1] = "texture";
75
+ NoiseHandleFlag2[NoiseHandleFlag2["noise"] = 2] = "noise";
76
+ NoiseHandleFlag2[NoiseHandleFlag2["position"] = 4] = "position";
77
+ NoiseHandleFlag2[NoiseHandleFlag2["module"] = 8] = "module";
78
+ NoiseHandleFlag2[NoiseHandleFlag2["variableProperty"] = 16] = "variableProperty";
79
+ NoiseHandleFlag2[NoiseHandleFlag2["variableValue"] = 32] = "variableValue";
80
+ return NoiseHandleFlag2;
81
+ })(NoiseHandleFlag || {});
82
+ var DisplacementModule = /* @__PURE__ */ ((DisplacementModule2) => {
83
+ DisplacementModule2["sourceModule"] = "source";
84
+ DisplacementModule2["xModule"] = "x-module";
85
+ DisplacementModule2["yModule"] = "y-module";
86
+ DisplacementModule2["zModule"] = "z-module";
87
+ DisplacementModule2["output"] = "output";
88
+ return DisplacementModule2;
89
+ })(DisplacementModule || {});
90
+
91
+ // src/nodes/generators/noise-simplex-node.tsx
92
+ import { NodeContainer } from "@awesome-flow/core/layout";
93
+ import { useEffect, useMemo } from "react";
94
+ import { useUpdateNodeComputedData } from "@awesome-flow/core/hooks";
95
+
96
+ // src/modules/simplex-module.ts
97
+ import Module from "libnoise-ts/module/Module";
98
+ import { createNoise3D } from "simplex-noise";
99
+ var SimplexModule = class extends Module {
100
+ noise;
101
+ constructor(random) {
102
+ super();
103
+ this.noise = createNoise3D(random);
104
+ }
105
+ getValue(x, y, z) {
106
+ return this.noise(x, y, z);
107
+ }
108
+ };
109
+
110
+ // src/nodes/generators/noise-simplex-node.tsx
111
+ import { jsx } from "react/jsx-runtime";
112
+ function NoiseSimplexNode({ id, selected, data, type }) {
113
+ const updateComputedData = useUpdateNodeComputedData();
114
+ const module = useMemo(() => new SimplexModule(), []);
115
+ useEffect(() => {
116
+ updateComputedData(id, { module });
117
+ }, []);
118
+ return /* @__PURE__ */ jsx(NodeContainer, { id, selected, data, type });
119
+ }
120
+ var noise_simplex_node_default = NoiseSimplexNode;
121
+
122
+ // src/nodes/generators/position-const-node.tsx
123
+ import { NodeContainer as NodeContainer2 } from "@awesome-flow/core/layout";
124
+ import { useEffect as useEffect2, useState } from "react";
125
+ import { Group, NumberInput, Stack } from "@mantine/core";
126
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData2, useUpdateNodeData } from "@awesome-flow/core/hooks";
127
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
128
+ function PositionConstNode({ id, selected, data, type }) {
129
+ const position = data.position ?? { x: 0, y: 0, z: 0 };
130
+ const [x, setX] = useState(position.x);
131
+ const [y, setY] = useState(position.y);
132
+ const [z, setZ] = useState(position.z);
133
+ const updateNodeData = useUpdateNodeData();
134
+ const updateComputedData = useUpdateNodeComputedData2();
135
+ useEffect2(() => {
136
+ const position2 = { x, y, z };
137
+ updateNodeData(id, {
138
+ position: position2
139
+ });
140
+ updateComputedData(id, {
141
+ positions: [position2]
142
+ });
143
+ }, [x, y, z]);
144
+ return /* @__PURE__ */ jsx2(NodeContainer2, { id, selected, data, type, children: /* @__PURE__ */ jsxs(Stack, { children: [
145
+ /* @__PURE__ */ jsxs(Group, { children: [
146
+ "x: ",
147
+ /* @__PURE__ */ jsx2(NumberInput, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
148
+ ] }),
149
+ /* @__PURE__ */ jsxs(Group, { children: [
150
+ "y: ",
151
+ /* @__PURE__ */ jsx2(NumberInput, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
152
+ ] }),
153
+ /* @__PURE__ */ jsxs(Group, { children: [
154
+ "z: ",
155
+ /* @__PURE__ */ jsx2(NumberInput, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
156
+ ] })
157
+ ] }) });
158
+ }
159
+ var position_const_node_default = PositionConstNode;
160
+
161
+ // src/nodes/generators/position-grid-node.tsx
162
+ import { NodeContainer as NodeContainer3 } from "@awesome-flow/core/layout";
163
+ import { useEffect as useEffect3, useState as useState2 } from "react";
164
+ import { Group as Group2, NumberInput as NumberInput2, Stack as Stack2 } from "@mantine/core";
165
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData3, useUpdateNodeData as useUpdateNodeData2 } from "@awesome-flow/core/hooks";
166
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
167
+ function PositionGridNode({ id, selected, data, type }) {
168
+ const [x, setX] = useState2(data.center?.x);
169
+ const [y, setY] = useState2(data.center?.y);
170
+ const [z, setZ] = useState2(data.center?.z);
171
+ const [radius, setRadius] = useState2(data.radius);
172
+ const updateNodeData = useUpdateNodeData2();
173
+ const updateComputedData = useUpdateNodeComputedData3();
174
+ useEffect3(() => {
175
+ updateNodeData(id, {
176
+ center: { x, y, z }
177
+ });
178
+ }, [x, y, z]);
179
+ useEffect3(() => {
180
+ updateNodeData(id, {
181
+ radius
182
+ });
183
+ }, [radius]);
184
+ useEffect3(() => {
185
+ const positions = [];
186
+ for (let i = -radius; i < radius; i++) {
187
+ for (let j = -radius; j < radius; j++) {
188
+ positions.push({ x: x + i, y: y + j, z });
189
+ }
190
+ }
191
+ updateComputedData(id, {
192
+ positions
193
+ });
194
+ }, [x, y, z, radius]);
195
+ return /* @__PURE__ */ jsx3(NodeContainer3, { id, selected, data, type, children: /* @__PURE__ */ jsxs2(Stack2, { children: [
196
+ /* @__PURE__ */ jsxs2(Group2, { children: [
197
+ "x: ",
198
+ /* @__PURE__ */ jsx3(NumberInput2, { size: "xs", w: 100, value: x, onChange: (e) => setX(Number(e)) })
199
+ ] }),
200
+ /* @__PURE__ */ jsxs2(Group2, { children: [
201
+ "y: ",
202
+ /* @__PURE__ */ jsx3(NumberInput2, { size: "xs", w: 100, value: y, onChange: (e) => setY(Number(e)) })
203
+ ] }),
204
+ /* @__PURE__ */ jsxs2(Group2, { children: [
205
+ "z: ",
206
+ /* @__PURE__ */ jsx3(NumberInput2, { size: "xs", w: 100, value: z, onChange: (e) => setZ(Number(e)) })
207
+ ] }),
208
+ /* @__PURE__ */ jsxs2(Group2, { children: [
209
+ "r: ",
210
+ /* @__PURE__ */ jsx3(NumberInput2, { size: "xs", w: 100, value: radius, onChange: (e) => setRadius(Number(e)) })
211
+ ] })
212
+ ] }) });
213
+ }
214
+ var position_grid_node_default = PositionGridNode;
215
+
216
+ // src/nodes/modifiers/noise-normalize-node.tsx
217
+ import { NodeContainer as NodeContainer4, NodeTrackConnections } from "@awesome-flow/core/layout";
218
+ import { useEffect as useEffect4, useState as useState3 } from "react";
219
+ import { Group as Group3, NumberInput as NumberInput3, Stack as Stack3 } from "@mantine/core";
220
+ import {
221
+ useIncomingComputedData,
222
+ useUpdateNodeComputedData as useUpdateNodeComputedData4,
223
+ useUpdateNodeData as useUpdateNodeData3
224
+ } from "@awesome-flow/core/hooks";
225
+
226
+ // src/modules/normalize-noise-module.ts
227
+ import ModifierModule from "libnoise-ts/module/modifier";
228
+ var NormalizeNoiseModule = class extends ModifierModule {
229
+ constructor(source, lowerBound, upperBound) {
230
+ super(source);
231
+ this.lowerBound = lowerBound;
232
+ this.upperBound = upperBound;
233
+ }
234
+ getValue(x, y, z) {
235
+ return normalize(this.sourceModule.getValue(x, y, z), this.lowerBound, this.upperBound);
236
+ }
237
+ };
238
+ function normalize(value, min, max) {
239
+ return (value - min) / (max - min);
240
+ }
241
+
242
+ // src/nodes/modifiers/noise-normalize-node.tsx
243
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
244
+ function NoiseNormalizeNode({ id, selected, data, type }) {
245
+ const [intervalStart, setIntervalStart] = useState3(data.intervalStart);
246
+ const [intervalEnd, setIntervalEnd] = useState3(data.intervalEnd);
247
+ const incoming = useIncomingComputedData(id);
248
+ const updateNodeData = useUpdateNodeData3();
249
+ const updateComputedData = useUpdateNodeComputedData4();
250
+ useEffect4(() => {
251
+ if (incoming?.length) {
252
+ const source = incoming[0].module;
253
+ const module = new NormalizeNoiseModule(source, intervalStart, intervalEnd);
254
+ updateComputedData(id, { module });
255
+ }
256
+ updateNodeData(id, { intervalStart, intervalEnd });
257
+ }, [incoming, intervalStart, intervalEnd]);
258
+ return /* @__PURE__ */ jsxs3(NodeContainer4, { id, selected, data, type, children: [
259
+ /* @__PURE__ */ jsx4(Stack3, { children: /* @__PURE__ */ jsxs3(Group3, { children: [
260
+ /* @__PURE__ */ jsx4(
261
+ NumberInput3,
262
+ {
263
+ size: "xs",
264
+ w: 100,
265
+ value: intervalStart,
266
+ onChange: (e) => setIntervalStart(Number(e))
267
+ }
268
+ ),
269
+ /* @__PURE__ */ jsx4(
270
+ NumberInput3,
271
+ {
272
+ size: "xs",
273
+ w: 100,
274
+ value: intervalEnd,
275
+ onChange: (e) => setIntervalEnd(Number(e))
276
+ }
277
+ )
278
+ ] }) }),
279
+ /* @__PURE__ */ jsx4(NodeTrackConnections, { handles: data.handles, nodeId: id, type: "target" })
280
+ ] });
281
+ }
282
+ var noise_normalize_node_default = NoiseNormalizeNode;
283
+
284
+ // src/nodes/generators/noise-const-node.tsx
285
+ import { NodeContainer as NodeContainer5 } from "@awesome-flow/core/layout";
286
+ import { useEffect as useEffect5, useMemo as useMemo2, useState as useState4 } from "react";
287
+ import { Group as Group4, NumberInput as NumberInput4, Stack as Stack4 } from "@mantine/core";
288
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData5, useUpdateNodeData as useUpdateNodeData4 } from "@awesome-flow/core/hooks";
289
+ import { Const } from "libnoise-ts/module/generator";
290
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
291
+ function NoiseConstNode({ id, selected, data, type }) {
292
+ const [min, setMin] = useState4(data.min);
293
+ const [max, setMax] = useState4(data.max);
294
+ const [noise, setNoise] = useState4(data.noise);
295
+ const updateNodeData = useUpdateNodeData4();
296
+ const updateComputedData = useUpdateNodeComputedData5();
297
+ const module = useMemo2(() => new Const(), []);
298
+ useEffect5(() => {
299
+ module.value = noise;
300
+ updateNodeData(id, { noise, min, max });
301
+ updateComputedData(id, { module });
302
+ }, [noise, min, max, module, updateNodeData, id, updateComputedData]);
303
+ return /* @__PURE__ */ jsx5(NodeContainer5, { id, selected, data, type, children: /* @__PURE__ */ jsxs4(Stack4, { children: [
304
+ /* @__PURE__ */ jsxs4(Group4, { children: [
305
+ /* @__PURE__ */ jsx5(NumberInput4, { size: "xs", w: 100, value: min, onChange: (e) => setMin(Number(e)) }),
306
+ /* @__PURE__ */ jsx5(NumberInput4, { size: "xs", w: 100, value: max, onChange: (e) => setMax(Number(e)) })
307
+ ] }),
308
+ /* @__PURE__ */ jsxs4(Group4, { children: [
309
+ "noise:",
310
+ /* @__PURE__ */ jsx5(
311
+ NumberInput4,
312
+ {
313
+ size: "xs",
314
+ value: noise,
315
+ onChange: (e) => setNoise(Number(e)),
316
+ max,
317
+ min,
318
+ step: 0.1
319
+ }
320
+ )
321
+ ] })
322
+ ] }) });
323
+ }
324
+ var noise_const_node_default = NoiseConstNode;
325
+
326
+ // src/nodes/generators/noise-billow-node.tsx
327
+ import { NodeContainer as NodeContainer6, NodeTrackConnections as NodeTrackConnections2 } from "@awesome-flow/core/layout";
328
+ import { useCallback as useCallback2, useMemo as useMemo4 } from "react";
329
+ import { Billow } from "libnoise-ts/module/generator";
330
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData6 } from "@awesome-flow/core/hooks";
331
+ import { nodeDataPropertyExcept as nodeDataPropertyExcept2 } from "@awesome-flow/core/abstract";
332
+
333
+ // src/layout/node-property-variables.tsx
334
+ import { useIncomingNodeData, useUpdateNodeData as useUpdateNodeData5 } from "@awesome-flow/core/hooks";
335
+ import { useCallback, useEffect as useEffect6, useMemo as useMemo3, useState as useState5 } from "react";
336
+ import { Group as Group5, Stack as Stack5 } from "@mantine/core";
337
+ import { getObjectKeys } from "@awesome-flow/core/utils";
338
+ import { nodeDataPropertyExcept } from "@awesome-flow/core/abstract";
339
+
340
+ // src/layout/node-value-input.tsx
341
+ import { Input, NumberInput as NumberInput5, Switch } from "@mantine/core";
342
+ import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
343
+ function NodeValueInput({ value, disabled, step, onChange }) {
344
+ if (value === void 0 || value === null) {
345
+ return /* @__PURE__ */ jsx6(Fragment, {});
346
+ }
347
+ switch (typeof value) {
348
+ case "boolean": {
349
+ return /* @__PURE__ */ jsx6(
350
+ Switch,
351
+ {
352
+ checked: value,
353
+ disabled,
354
+ onChange: (e) => onChange(e.currentTarget.checked)
355
+ }
356
+ );
357
+ }
358
+ case "number": {
359
+ return /* @__PURE__ */ jsx6(NumberInput5, { value, disabled, step, onChange: (e) => onChange(e) });
360
+ }
361
+ case "string": {
362
+ return /* @__PURE__ */ jsx6(
363
+ Input,
364
+ {
365
+ value,
366
+ disabled,
367
+ onChange: (e) => onChange(e.currentTarget.value)
368
+ }
369
+ );
370
+ }
371
+ default:
372
+ throw new Error(`Unknown input node for value of type: ${typeof value} (${value})`);
373
+ }
374
+ }
375
+ var node_value_input_default = NodeValueInput;
376
+
377
+ // src/layout/node-property-input.tsx
378
+ import { Fragment as Fragment2, jsx as jsx7 } from "react/jsx-runtime";
379
+ function NodePropertyInput({ property, onChange }) {
380
+ if (!property) {
381
+ return /* @__PURE__ */ jsx7(Fragment2, {});
382
+ }
383
+ return /* @__PURE__ */ jsx7(
384
+ node_value_input_default,
385
+ {
386
+ value: property.value,
387
+ disabled: property.disabled,
388
+ step: property.step,
389
+ onChange: (value) => onChange(property.name, value)
390
+ }
391
+ );
392
+ }
393
+ var node_property_input_default = NodePropertyInput;
394
+
395
+ // src/layout/node-property-variables.tsx
396
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
397
+ function NodePropertyVariables({
398
+ data,
399
+ nodeId,
400
+ onPropertiesChange,
401
+ except = nodeDataPropertyExcept
402
+ }) {
403
+ const [properties, setProperties] = useState5(() => {
404
+ const keys = getObjectKeys(data, except);
405
+ const dataProps = {};
406
+ for (const key of keys) {
407
+ dataProps[key] = {
408
+ name: key,
409
+ value: data[key]
410
+ };
411
+ }
412
+ return dataProps;
413
+ });
414
+ const updateNodeData = useUpdateNodeData5();
415
+ const incoming = useIncomingNodeData(nodeId);
416
+ const resetAllDisabled = useCallback(() => {
417
+ const keys = Object.keys(properties);
418
+ keys.forEach((k) => {
419
+ properties[k].disabled = false;
420
+ });
421
+ setProperties(properties);
422
+ }, []);
423
+ const updatePropertyValue = useCallback((name, value, disabled) => {
424
+ let property = properties[name];
425
+ if (property) {
426
+ property.value = value;
427
+ } else {
428
+ property = {
429
+ name,
430
+ value
431
+ };
432
+ }
433
+ property.disabled = disabled;
434
+ setProperties({ ...properties, [name]: property });
435
+ updateNodeData(nodeId, { [name]: value });
436
+ }, []);
437
+ useEffect6(() => {
438
+ resetAllDisabled();
439
+ if (incoming?.length) {
440
+ for (const connection of incoming) {
441
+ if (connection.property && properties[connection.property.name] !== void 0) {
442
+ updatePropertyValue(connection.property.name, connection.property.value, true);
443
+ }
444
+ }
445
+ }
446
+ }, [incoming]);
447
+ useEffect6(() => {
448
+ if (onPropertiesChange) {
449
+ onPropertiesChange(properties);
450
+ }
451
+ }, [onPropertiesChange, properties]);
452
+ const nodes = useMemo3(() => {
453
+ return Object.keys(properties).map((key) => {
454
+ const property = properties[key];
455
+ return /* @__PURE__ */ jsxs5(Group5, { children: [
456
+ property.name,
457
+ ":",
458
+ /* @__PURE__ */ jsx8(node_property_input_default, { property, onChange: updatePropertyValue })
459
+ ] }, key);
460
+ });
461
+ }, [properties, updatePropertyValue]);
462
+ return /* @__PURE__ */ jsx8(Stack5, { children: nodes });
463
+ }
464
+ var node_property_variables_default = NodePropertyVariables;
465
+
466
+ // src/nodes/generators/noise-billow-node.tsx
467
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
468
+ function NoiseBillowNode({ id, selected, data, type }) {
469
+ const updateComputedData = useUpdateNodeComputedData6();
470
+ const module = useMemo4(() => new Billow(), []);
471
+ const onPropertiesChange = useCallback2(
472
+ (properties) => {
473
+ Object.keys(properties).forEach((k) => {
474
+ module[k] = properties[k].value;
475
+ });
476
+ updateComputedData(id, { module });
477
+ },
478
+ [id, module, updateComputedData]
479
+ );
480
+ return /* @__PURE__ */ jsxs6(NodeContainer6, { id, selected, data, type, children: [
481
+ /* @__PURE__ */ jsx9(
482
+ node_property_variables_default,
483
+ {
484
+ data,
485
+ except: nodeDataPropertyExcept2,
486
+ nodeId: id,
487
+ onPropertiesChange
488
+ }
489
+ ),
490
+ /* @__PURE__ */ jsx9(NodeTrackConnections2, { handles: data.handles, nodeId: id, type: "target" })
491
+ ] });
492
+ }
493
+ var noise_billow_node_default = NoiseBillowNode;
494
+
495
+ // src/nodes/output/noise-logger-node.tsx
496
+ import { NodeContainer as NodeContainer7, NodeTrackConnections as NodeTrackConnections3 } from "@awesome-flow/core/layout";
497
+ import { useMemo as useMemo5 } from "react";
498
+ import { Divider, Stack as Stack6, Text } from "@mantine/core";
499
+ import { useIncomingComputedData as useIncomingComputedData2 } from "@awesome-flow/core/hooks";
500
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
501
+ function NoiseLoggerNode({ id, selected, data, type }) {
502
+ const incoming = useIncomingComputedData2(id);
503
+ const noise = useMemo5(() => incoming?.map((p) => p.noise).flat(), [incoming]);
504
+ return /* @__PURE__ */ jsxs7(NodeContainer7, { id, selected, data, type, children: [
505
+ /* @__PURE__ */ jsxs7(Text, { children: [
506
+ "Size: ",
507
+ noise?.length || 0
508
+ ] }),
509
+ /* @__PURE__ */ jsx10(Divider, { h: 5 }),
510
+ /* @__PURE__ */ jsx10(Stack6, { children: noise?.map((v, i) => /* @__PURE__ */ jsxs7(Text, { children: [
511
+ v.position?.x,
512
+ ":",
513
+ v.position?.y,
514
+ ":",
515
+ v.position?.z,
516
+ ": ",
517
+ v.value
518
+ ] }, i)) }),
519
+ /* @__PURE__ */ jsx10(NodeTrackConnections3, { handles: data.handles, nodeId: id, type: "target" })
520
+ ] });
521
+ }
522
+ var noise_logger_node_default = NoiseLoggerNode;
523
+
524
+ // src/nodes/output/noise-raw-texture-node.tsx
525
+ import { NodeContainer as NodeContainer8, NodeTrackConnections as NodeTrackConnections4 } from "@awesome-flow/core/layout";
526
+ import { useEffect as useEffect7, useMemo as useMemo6, useState as useState6 } from "react";
527
+ import { useIncomingComputedData as useIncomingComputedData3, useUpdateNodeComputedData as useUpdateNodeComputedData7 } from "@awesome-flow/core/hooks";
528
+ import { Group as Group6, Stack as Stack7 } from "@mantine/core";
529
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
530
+ function NoiseRawTextureNode({ id, selected, data, type }) {
531
+ const updateComputedData = useUpdateNodeComputedData7();
532
+ const [dataLength, setDataLength] = useState6(0);
533
+ const [resolution, setResolution] = useState6(0);
534
+ const incoming = useIncomingComputedData3(id);
535
+ const noise = useMemo6(() => incoming?.map((p) => p.noise).flat(), [incoming]);
536
+ useEffect7(() => {
537
+ if (noise?.length) {
538
+ const size = Math.ceil(Math.sqrt(noise.length));
539
+ const colors = noise.map((n) => [n.value * 255, n.value * 255, n.value * 255, 255]).flat();
540
+ const dataArray = new Uint8Array(size * size * 4);
541
+ dataArray.set(colors);
542
+ setResolution(size);
543
+ setDataLength(dataArray.length);
544
+ updateComputedData(id, { textureData: dataArray, textureResolution: size });
545
+ }
546
+ }, [noise]);
547
+ return /* @__PURE__ */ jsxs8(NodeContainer8, { id, selected, data, type, children: [
548
+ /* @__PURE__ */ jsxs8(Stack7, { children: [
549
+ /* @__PURE__ */ jsxs8(Group6, { children: [
550
+ "Resolution: ",
551
+ resolution,
552
+ "x",
553
+ resolution
554
+ ] }),
555
+ /* @__PURE__ */ jsxs8(Group6, { children: [
556
+ "Input Length: ",
557
+ noise?.length || 0
558
+ ] }),
559
+ /* @__PURE__ */ jsxs8(Group6, { children: [
560
+ "Output Length (",
561
+ resolution,
562
+ "*",
563
+ resolution,
564
+ "*4): ",
565
+ dataLength
566
+ ] })
567
+ ] }),
568
+ /* @__PURE__ */ jsx11(NodeTrackConnections4, { handles: data.handles, nodeId: id, type: "target" })
569
+ ] });
570
+ }
571
+ var noise_raw_texture_node_default = NoiseRawTextureNode;
572
+
573
+ // src/nodes/generators/noise-checkerboard-node.tsx
574
+ import { NodeContainer as NodeContainer9 } from "@awesome-flow/core/layout";
575
+ import { useEffect as useEffect8, useMemo as useMemo7 } from "react";
576
+ import { Checkerboard } from "libnoise-ts/module/generator";
577
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData8 } from "@awesome-flow/core/hooks";
578
+ import { jsx as jsx12 } from "react/jsx-runtime";
579
+ function NoiseCheckerboardNode({ id, selected, data, type }) {
580
+ const updateComputedData = useUpdateNodeComputedData8();
581
+ const module = useMemo7(() => new Checkerboard(), []);
582
+ useEffect8(() => {
583
+ updateComputedData(id, { module });
584
+ }, [id, module, updateComputedData]);
585
+ return /* @__PURE__ */ jsx12(NodeContainer9, { id, selected, data, type });
586
+ }
587
+ var noise_checkerboard_node_default = NoiseCheckerboardNode;
588
+
589
+ // src/nodes/output/positions-logger-node.tsx
590
+ import { NodeContainer as NodeContainer10, NodeTrackConnections as NodeTrackConnections5 } from "@awesome-flow/core/layout";
591
+ import { useMemo as useMemo8 } from "react";
592
+ import { Divider as Divider2, Stack as Stack8, Text as Text2 } from "@mantine/core";
593
+ import { useIncomingComputedData as useIncomingComputedData4 } from "@awesome-flow/core/hooks";
594
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
595
+ function PositionsLoggerNode({ id, selected, data, type }) {
596
+ const incoming = useIncomingComputedData4(id);
597
+ const positions = useMemo8(() => {
598
+ return incoming?.map((p) => p.positions).flat();
599
+ }, [incoming]);
600
+ return /* @__PURE__ */ jsxs9(NodeContainer10, { id, selected, data, type, children: [
601
+ /* @__PURE__ */ jsxs9(Text2, { children: [
602
+ "Size: ",
603
+ positions?.length || 0
604
+ ] }),
605
+ /* @__PURE__ */ jsx13(Divider2, { h: 5 }),
606
+ /* @__PURE__ */ jsx13(Stack8, { children: positions?.map((v, i) => /* @__PURE__ */ jsxs9(Text2, { children: [
607
+ v.x,
608
+ ":",
609
+ v.y,
610
+ ":",
611
+ v.z
612
+ ] }, i)) }),
613
+ /* @__PURE__ */ jsx13(NodeTrackConnections5, { handles: data.handles, nodeId: id, type: "target" })
614
+ ] });
615
+ }
616
+ var positions_logger_node_default = PositionsLoggerNode;
617
+
618
+ // src/nodes/generators/noise-cylinders-node.tsx
619
+ import { NodeContainer as NodeContainer11, NodeTrackConnections as NodeTrackConnections6 } from "@awesome-flow/core/layout";
620
+ import { useCallback as useCallback3, useMemo as useMemo9 } from "react";
621
+ import { Cylinders } from "libnoise-ts/module/generator";
622
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData9 } from "@awesome-flow/core/hooks";
623
+ import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
624
+ function NoiseCylindersNode({ id, selected, data, type }) {
625
+ const updateComputedData = useUpdateNodeComputedData9();
626
+ const module = useMemo9(() => new Cylinders(), []);
627
+ const onPropertiesChange = useCallback3(
628
+ (properties) => {
629
+ Object.keys(properties).forEach((k) => {
630
+ module[k] = properties[k].value;
631
+ });
632
+ updateComputedData(id, { module });
633
+ },
634
+ [id, module, updateComputedData]
635
+ );
636
+ return /* @__PURE__ */ jsxs10(NodeContainer11, { id, selected, data, type, children: [
637
+ /* @__PURE__ */ jsx14(node_property_variables_default, { data, nodeId: id, onPropertiesChange }),
638
+ /* @__PURE__ */ jsx14(NodeTrackConnections6, { handles: data.handles, nodeId: id, type: "target" })
639
+ ] });
640
+ }
641
+ var noise_cylinders_node_default = NoiseCylindersNode;
642
+
643
+ // src/nodes/generators/noise-perlin-node.tsx
644
+ import { NodeContainer as NodeContainer12, NodeTrackConnections as NodeTrackConnections7 } from "@awesome-flow/core/layout";
645
+ import { useCallback as useCallback4, useMemo as useMemo10 } from "react";
646
+ import { Perlin } from "libnoise-ts/module/generator";
647
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData10 } from "@awesome-flow/core/hooks";
648
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
649
+ function NoisePerlinNode({ id, selected, data, type }) {
650
+ const updateComputedData = useUpdateNodeComputedData10();
651
+ const module = useMemo10(() => new Perlin(), []);
652
+ const onPropertiesChange = useCallback4(
653
+ (properties) => {
654
+ Object.keys(properties).forEach((k) => {
655
+ module[k] = properties[k].value;
656
+ });
657
+ updateComputedData(id, { module });
658
+ },
659
+ [id, module, updateComputedData]
660
+ );
661
+ return /* @__PURE__ */ jsxs11(NodeContainer12, { id, selected, data, type, children: [
662
+ /* @__PURE__ */ jsx15(node_property_variables_default, { data, nodeId: id, onPropertiesChange }),
663
+ /* @__PURE__ */ jsx15(NodeTrackConnections7, { handles: data.handles, nodeId: id, type: "target" })
664
+ ] });
665
+ }
666
+ var noise_perlin_node_default = NoisePerlinNode;
667
+
668
+ // src/nodes/generators/noise-ridgedmulti-node.tsx
669
+ import { NodeContainer as NodeContainer13, NodeTrackConnections as NodeTrackConnections8 } from "@awesome-flow/core/layout";
670
+ import { useCallback as useCallback5, useMemo as useMemo11 } from "react";
671
+ import { RidgedMulti } from "libnoise-ts/module/generator";
672
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData11 } from "@awesome-flow/core/hooks";
673
+ import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
674
+ function NoiseRidgedMultiNode({ id, selected, data, type }) {
675
+ const updateComputedData = useUpdateNodeComputedData11();
676
+ const module = useMemo11(() => new RidgedMulti(), []);
677
+ const onPropertiesChange = useCallback5((properties) => {
678
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
679
+ updateComputedData(id, { module });
680
+ }, []);
681
+ return /* @__PURE__ */ jsxs12(NodeContainer13, { id, selected, data, type, children: [
682
+ /* @__PURE__ */ jsx16(node_property_variables_default, { data, nodeId: id, onPropertiesChange }),
683
+ /* @__PURE__ */ jsx16(NodeTrackConnections8, { handles: data.handles, nodeId: id, type: "target" })
684
+ ] });
685
+ }
686
+ var noise_ridgedmulti_node_default = NoiseRidgedMultiNode;
687
+
688
+ // src/nodes/generators/noise-spheres-node.tsx
689
+ import { NodeContainer as NodeContainer14, NodeTrackConnections as NodeTrackConnections9 } from "@awesome-flow/core/layout";
690
+ import { useCallback as useCallback6, useMemo as useMemo12 } from "react";
691
+ import { Spheres } from "libnoise-ts/module/generator";
692
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData12 } from "@awesome-flow/core/hooks";
693
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
694
+ function NoiseSpheresNode({ id, selected, data, type }) {
695
+ const updateComputedData = useUpdateNodeComputedData12();
696
+ const module = useMemo12(() => new Spheres(), []);
697
+ const onPropertiesChange = useCallback6((properties) => {
698
+ Object.keys(properties).forEach((k) => module[k] = properties[k].value);
699
+ updateComputedData(id, { module });
700
+ }, []);
701
+ return /* @__PURE__ */ jsxs13(NodeContainer14, { id, selected, data, type, children: [
702
+ /* @__PURE__ */ jsx17(node_property_variables_default, { data, nodeId: id, onPropertiesChange }),
703
+ /* @__PURE__ */ jsx17(NodeTrackConnections9, { handles: data.handles, nodeId: id, type: "target" })
704
+ ] });
705
+ }
706
+ var noise_spheres_node_default = NoiseSpheresNode;
707
+
708
+ // src/nodes/generators/noise-voronoi-node.tsx
709
+ import { NodeContainer as NodeContainer15, NodeTrackConnections as NodeTrackConnections10 } from "@awesome-flow/core/layout";
710
+ import { useCallback as useCallback7 } from "react";
711
+ import { Voronoi } from "libnoise-ts/module/generator";
712
+ import { useUpdateNodeComputedData as useUpdateNodeComputedData13 } from "@awesome-flow/core/hooks";
713
+ import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
714
+ function NoiseVoronoiNode({ id, selected, data, type }) {
715
+ const updateComputedData = useUpdateNodeComputedData13();
716
+ const onPropertiesChange = useCallback7(
717
+ (properties) => {
718
+ const module = new Voronoi(
719
+ properties.frequency.value,
720
+ properties.displacement.value,
721
+ properties.distance.value,
722
+ properties.seed.value
723
+ );
724
+ updateComputedData(id, { module });
725
+ },
726
+ []
727
+ );
728
+ return /* @__PURE__ */ jsxs14(NodeContainer15, { id, selected, data, type, children: [
729
+ /* @__PURE__ */ jsx18(node_property_variables_default, { data, nodeId: id, onPropertiesChange }),
730
+ /* @__PURE__ */ jsx18(NodeTrackConnections10, { handles: data.handles, nodeId: id, type: "target" })
731
+ ] });
732
+ }
733
+ var noise_voronoi_node_default = NoiseVoronoiNode;
734
+
735
+ // src/nodes/modifiers/noise-combine-node.tsx
736
+ import { NodeCombobox, NodeContainer as NodeContainer16, NodeTrackConnections as NodeTrackConnections11 } from "@awesome-flow/core/layout";
737
+ import { useCallback as useCallback8, useEffect as useEffect9 } from "react";
738
+ import {
739
+ useIncomingComputedData as useIncomingComputedData5,
740
+ useUpdateNodeComputedData as useUpdateNodeComputedData14,
741
+ useUpdateNodeData as useUpdateNodeData6
742
+ } from "@awesome-flow/core/hooks";
743
+ import {
744
+ IconAsterisk,
745
+ IconChevronLeft,
746
+ IconChevronRight,
747
+ IconChevronUp,
748
+ IconPlus
749
+ } from "@tabler/icons-react";
750
+
751
+ // src/abstract/operations.ts
752
+ import { Add, Max, Min, Multiply, Power } from "libnoise-ts/module/combiner";
753
+ var NoiseCombineType = /* @__PURE__ */ ((NoiseCombineType3) => {
754
+ NoiseCombineType3["add"] = "add";
755
+ NoiseCombineType3["max"] = "max";
756
+ NoiseCombineType3["min"] = "min";
757
+ NoiseCombineType3["multiply"] = "multiply";
758
+ NoiseCombineType3["power"] = "power";
759
+ return NoiseCombineType3;
760
+ })(NoiseCombineType || {});
761
+ var VariableCombineType = /* @__PURE__ */ ((VariableCombineType2) => {
762
+ VariableCombineType2["add"] = "add";
763
+ VariableCombineType2["divide"] = "divide";
764
+ VariableCombineType2["max"] = "max";
765
+ VariableCombineType2["min"] = "min";
766
+ VariableCombineType2["multiply"] = "multiply";
767
+ VariableCombineType2["power"] = "power";
768
+ return VariableCombineType2;
769
+ })(VariableCombineType || {});
770
+ var noiseCombineModuleMap = {
771
+ ["add" /* add */]: Add,
772
+ ["max" /* max */]: Max,
773
+ ["min" /* min */]: Min,
774
+ ["multiply" /* multiply */]: Multiply,
775
+ ["power" /* power */]: Power
776
+ };
777
+
778
+ // src/nodes/modifiers/noise-combine-node.tsx
779
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
780
+ var options = {
781
+ add: /* @__PURE__ */ jsx19(IconPlus, {}),
782
+ min: /* @__PURE__ */ jsx19(IconChevronLeft, {}),
783
+ max: /* @__PURE__ */ jsx19(IconChevronRight, {}),
784
+ multiply: /* @__PURE__ */ jsx19(IconAsterisk, {}),
785
+ power: /* @__PURE__ */ jsx19(IconChevronUp, {})
786
+ };
787
+ function NoiseCombineNode({ id, selected, data, type }) {
788
+ const updateNodeData = useUpdateNodeData6();
789
+ const updateComputedData = useUpdateNodeComputedData14();
790
+ const incoming = useIncomingComputedData5(id);
791
+ useEffect9(() => {
792
+ const ModuleFactory = noiseCombineModuleMap[data.operation];
793
+ if (incoming?.length > 1) {
794
+ const module = new ModuleFactory(incoming[0].module, incoming[1].module);
795
+ updateComputedData(id, { module });
796
+ }
797
+ }, [data.operation, incoming]);
798
+ const onChange = useCallback8((operation) => {
799
+ updateNodeData(id, { operation });
800
+ }, []);
801
+ return /* @__PURE__ */ jsxs15(NodeContainer16, { id, selected, data, type, children: [
802
+ /* @__PURE__ */ jsx19(NodeCombobox, { options, selected: data.operation, onChange }),
803
+ /* @__PURE__ */ jsx19(NodeTrackConnections11, { handles: data.handles, nodeId: id, type: "target" })
804
+ ] });
805
+ }
806
+ var noise_combine_node_default = NoiseCombineNode;
807
+
808
+ // src/nodes/modifiers/noise-clamp-node.tsx
809
+ import { NodeContainer as NodeContainer17, NodeTrackConnections as NodeTrackConnections12 } from "@awesome-flow/core/layout";
810
+ import { useEffect as useEffect10, useState as useState7 } from "react";
811
+ import { Group as Group7, NumberInput as NumberInput6, Stack as Stack9 } from "@mantine/core";
812
+ import {
813
+ useIncomingComputedData as useIncomingComputedData6,
814
+ useUpdateNodeComputedData as useUpdateNodeComputedData15,
815
+ useUpdateNodeData as useUpdateNodeData7
816
+ } from "@awesome-flow/core/hooks";
817
+ import { Clamp } from "libnoise-ts/module/modifier";
818
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
819
+ function NoiseClampNode({ id, selected, data, type }) {
820
+ const [lowerBound, setLowerBound] = useState7(data.lowerBound);
821
+ const [upperBound, setUpperBound] = useState7(data.upperBound);
822
+ const incoming = useIncomingComputedData6(id);
823
+ const updateNodeData = useUpdateNodeData7();
824
+ const updateComputedData = useUpdateNodeComputedData15();
825
+ useEffect10(() => {
826
+ if (incoming?.length) {
827
+ const module = new Clamp(incoming[0].module, lowerBound, upperBound);
828
+ updateComputedData(id, { module });
829
+ }
830
+ updateNodeData(id, { lowerBound, upperBound });
831
+ }, [incoming, lowerBound, upperBound]);
832
+ return /* @__PURE__ */ jsxs16(NodeContainer17, { id, selected, data, type, children: [
833
+ /* @__PURE__ */ jsx20(Stack9, { children: /* @__PURE__ */ jsxs16(Group7, { children: [
834
+ /* @__PURE__ */ jsx20(
835
+ NumberInput6,
836
+ {
837
+ size: "xs",
838
+ w: 100,
839
+ value: lowerBound,
840
+ onChange: (e) => setLowerBound(Number(e)),
841
+ step: 0.1
842
+ }
843
+ ),
844
+ /* @__PURE__ */ jsx20(
845
+ NumberInput6,
846
+ {
847
+ size: "xs",
848
+ w: 100,
849
+ value: upperBound,
850
+ onChange: (e) => setUpperBound(Number(e)),
851
+ step: 0.1
852
+ }
853
+ )
854
+ ] }) }),
855
+ /* @__PURE__ */ jsx20(NodeTrackConnections12, { handles: data.handles, nodeId: id, type: "target" })
856
+ ] });
857
+ }
858
+ var noise_clamp_node_default = NoiseClampNode;
859
+
860
+ // src/nodes/modifiers/noise-abs-node.tsx
861
+ import { NodeContainer as NodeContainer18, NodeTrackConnections as NodeTrackConnections13 } from "@awesome-flow/core/layout";
862
+ import { useEffect as useEffect11 } from "react";
863
+ import { useIncomingComputedData as useIncomingComputedData7, useUpdateNodeComputedData as useUpdateNodeComputedData16 } from "@awesome-flow/core/hooks";
864
+ import { Abs } from "libnoise-ts/module/modifier";
865
+ import { jsx as jsx21 } from "react/jsx-runtime";
866
+ function NoiseAbsNode({ id, selected, data, type }) {
867
+ const incoming = useIncomingComputedData7(id);
868
+ const updateComputedData = useUpdateNodeComputedData16();
869
+ useEffect11(() => {
870
+ if (incoming?.length > 0) {
871
+ const module = new Abs(incoming[0].module);
872
+ updateComputedData(id, { module });
873
+ }
874
+ }, [incoming]);
875
+ return /* @__PURE__ */ jsx21(NodeContainer18, { id, selected, data, type, children: /* @__PURE__ */ jsx21(NodeTrackConnections13, { handles: data.handles, nodeId: id, type: "target" }) });
876
+ }
877
+ var noise_abs_node_default = NoiseAbsNode;
878
+
879
+ // src/nodes/output/noise-output-node.tsx
880
+ import { NodeContainer as NodeContainer19, NodeTrackConnections as NodeTrackConnections14 } from "@awesome-flow/core/layout";
881
+ import { useIncomingComputedData as useIncomingComputedData8, useUpdateNodeComputedData as useUpdateNodeComputedData17 } from "@awesome-flow/core/hooks";
882
+ import { Box, Group as Group8, LoadingOverlay, Stack as Stack10 } from "@mantine/core";
883
+ import { useEffect as useEffect12, useState as useState8 } from "react";
884
+ import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
885
+ function NoiseOutputNode({ id, selected, data, type }) {
886
+ const [generating, setGenerating] = useState8(false);
887
+ const updateComputedData = useUpdateNodeComputedData17();
888
+ const incomingModules = useIncomingComputedData8(id, 8 /* module */);
889
+ const incomingPositions = useIncomingComputedData8(
890
+ id,
891
+ 4 /* position */
892
+ );
893
+ useEffect12(() => {
894
+ if (incomingPositions?.length && incomingModules?.length) {
895
+ const { module } = incomingModules[0];
896
+ if (module) {
897
+ setGenerating(true);
898
+ }
899
+ }
900
+ }, [incomingModules, incomingPositions]);
901
+ useEffect12(() => {
902
+ if (incomingPositions?.length && incomingModules?.length) {
903
+ const { module } = incomingModules[0];
904
+ if (module && generating) {
905
+ const noise = [];
906
+ for (const input of incomingPositions) {
907
+ for (const position of input.positions) {
908
+ const value = module.getValue(position.x, position.y, position.z);
909
+ noise.push({
910
+ position,
911
+ value
912
+ });
913
+ }
914
+ }
915
+ console.log("SET COMPUTED DATA");
916
+ updateComputedData(id, { noise, module });
917
+ setGenerating(false);
918
+ }
919
+ }
920
+ }, [generating]);
921
+ return /* @__PURE__ */ jsxs17(NodeContainer19, { id, selected, data, type, children: [
922
+ /* @__PURE__ */ jsxs17(Box, { pos: "relative", children: [
923
+ /* @__PURE__ */ jsx22(
924
+ LoadingOverlay,
925
+ {
926
+ visible: generating,
927
+ zIndex: 1e3,
928
+ overlayProps: { radius: "sm", blur: 2 }
929
+ }
930
+ ),
931
+ /* @__PURE__ */ jsxs17(Stack10, { children: [
932
+ /* @__PURE__ */ jsxs17(Group8, { children: [
933
+ "Position Inputs: ",
934
+ incomingPositions?.length
935
+ ] }),
936
+ /* @__PURE__ */ jsxs17(Group8, { children: [
937
+ "Module Inputs: ",
938
+ incomingModules?.length
939
+ ] })
940
+ ] })
941
+ ] }),
942
+ /* @__PURE__ */ jsx22(NodeTrackConnections14, { handles: data.handles, nodeId: id, type: "target" })
943
+ ] });
944
+ }
945
+ var noise_output_node_default = NoiseOutputNode;
946
+
947
+ // src/nodes/modifiers/noise-curve-node.tsx
948
+ import { NodeContainer as NodeContainer20, NodeTrackConnections as NodeTrackConnections15 } from "@awesome-flow/core/layout";
949
+ import { ActionIcon, Button, Group as Group9, NumberInput as NumberInput7, Space } from "@mantine/core";
950
+ import {
951
+ useIncomingComputedData as useIncomingComputedData9,
952
+ useUpdateNodeComputedData as useUpdateNodeComputedData18,
953
+ useUpdateNodeData as useUpdateNodeData8
954
+ } from "@awesome-flow/core/hooks";
955
+
956
+ // ../../node_modules/@mantine/form/esm/use-form.mjs
957
+ import { useState as useState12, useCallback as useCallback14 } from "react";
958
+
959
+ // ../../node_modules/@mantine/form/esm/actions/actions.mjs
960
+ import { useLayoutEffect, useEffect as useEffect13 } from "react";
961
+ function validateFormName(name) {
962
+ if (!/^[0-9a-zA-Z-]+$/.test(name)) {
963
+ throw new Error(
964
+ `[@mantine/use-form] Form name "${name}" is invalid, it should contain only letters, numbers and dashes`
965
+ );
966
+ }
967
+ }
968
+ var useIsomorphicEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect13;
969
+ function useFormEvent(eventKey, handler) {
970
+ useIsomorphicEffect(() => {
971
+ if (eventKey) {
972
+ window.addEventListener(eventKey, handler);
973
+ return () => window.removeEventListener(eventKey, handler);
974
+ }
975
+ return void 0;
976
+ }, [eventKey]);
977
+ }
978
+ function useFormActions(name, form) {
979
+ if (name) {
980
+ validateFormName(name);
981
+ }
982
+ useFormEvent(
983
+ `mantine-form:${name}:set-field-value`,
984
+ (event) => form.setFieldValue(event.detail.path, event.detail.value)
985
+ );
986
+ useFormEvent(
987
+ `mantine-form:${name}:set-values`,
988
+ (event) => form.setValues(event.detail)
989
+ );
990
+ useFormEvent(
991
+ `mantine-form:${name}:set-initial-values`,
992
+ (event) => form.setInitialValues(event.detail)
993
+ );
994
+ useFormEvent(
995
+ `mantine-form:${name}:set-errors`,
996
+ (event) => form.setErrors(event.detail)
997
+ );
998
+ useFormEvent(
999
+ `mantine-form:${name}:set-field-error`,
1000
+ (event) => form.setFieldError(event.detail.path, event.detail.error)
1001
+ );
1002
+ useFormEvent(
1003
+ `mantine-form:${name}:clear-field-error`,
1004
+ (event) => form.clearFieldError(event.detail)
1005
+ );
1006
+ useFormEvent(`mantine-form:${name}:clear-errors`, form.clearErrors);
1007
+ useFormEvent(`mantine-form:${name}:reset`, form.reset);
1008
+ useFormEvent(`mantine-form:${name}:validate`, form.validate);
1009
+ useFormEvent(
1010
+ `mantine-form:${name}:validate-field`,
1011
+ (event) => form.validateField(event.detail)
1012
+ );
1013
+ useFormEvent(
1014
+ `mantine-form:${name}:reorder-list-item`,
1015
+ (event) => form.reorderListItem(event.detail.path, event.detail.payload)
1016
+ );
1017
+ useFormEvent(
1018
+ `mantine-form:${name}:remove-list-item`,
1019
+ (event) => form.removeListItem(event.detail.path, event.detail.index)
1020
+ );
1021
+ useFormEvent(
1022
+ `mantine-form:${name}:insert-list-item`,
1023
+ (event) => form.insertListItem(event.detail.path, event.detail.item, event.detail.index)
1024
+ );
1025
+ useFormEvent(
1026
+ `mantine-form:${name}:set-dirty`,
1027
+ (event) => form.setDirty(event.detail)
1028
+ );
1029
+ useFormEvent(
1030
+ `mantine-form:${name}:set-touched`,
1031
+ (event) => form.setTouched(event.detail)
1032
+ );
1033
+ useFormEvent(
1034
+ `mantine-form:${name}:reset-dirty`,
1035
+ (event) => form.resetDirty(event.detail)
1036
+ );
1037
+ useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
1038
+ }
1039
+
1040
+ // ../../node_modules/@mantine/form/esm/get-input-on-change/get-input-on-change.mjs
1041
+ function getInputOnChange(setValue) {
1042
+ return (val) => {
1043
+ if (!val) {
1044
+ setValue(val);
1045
+ } else if (typeof val === "function") {
1046
+ setValue(val);
1047
+ } else if (typeof val === "object" && "nativeEvent" in val) {
1048
+ const { currentTarget } = val;
1049
+ if (currentTarget instanceof HTMLInputElement) {
1050
+ if (currentTarget.type === "checkbox") {
1051
+ setValue(currentTarget.checked);
1052
+ } else {
1053
+ setValue(currentTarget.value);
1054
+ }
1055
+ } else if (currentTarget instanceof HTMLTextAreaElement || currentTarget instanceof HTMLSelectElement) {
1056
+ setValue(currentTarget.value);
1057
+ }
1058
+ } else {
1059
+ setValue(val);
1060
+ }
1061
+ };
1062
+ }
1063
+
1064
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
1065
+ import { useState as useState9, useCallback as useCallback9 } from "react";
1066
+
1067
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/filter-errors/filter-errors.mjs
1068
+ function filterErrors(errors) {
1069
+ if (errors === null || typeof errors !== "object") {
1070
+ return {};
1071
+ }
1072
+ return Object.keys(errors).reduce((acc, key) => {
1073
+ const errorValue = errors[key];
1074
+ if (errorValue !== void 0 && errorValue !== null && errorValue !== false) {
1075
+ acc[key] = errorValue;
1076
+ }
1077
+ return acc;
1078
+ }, {});
1079
+ }
1080
+
1081
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-errors/use-form-errors.mjs
1082
+ function useFormErrors(initialErrors) {
1083
+ const [errorsState, setErrorsState] = useState9(filterErrors(initialErrors));
1084
+ const setErrors = useCallback9((errors) => {
1085
+ setErrorsState(
1086
+ (current) => filterErrors(typeof errors === "function" ? errors(current) : errors)
1087
+ );
1088
+ }, []);
1089
+ const clearErrors = useCallback9(() => setErrorsState({}), []);
1090
+ const clearFieldError = useCallback9(
1091
+ (path) => {
1092
+ if (errorsState[path] === void 0) {
1093
+ return;
1094
+ }
1095
+ setErrors((current) => {
1096
+ const errors = { ...current };
1097
+ delete errors[path];
1098
+ return errors;
1099
+ });
1100
+ },
1101
+ [errorsState]
1102
+ );
1103
+ const setFieldError = useCallback9(
1104
+ (path, error) => {
1105
+ if (error == null || error === false) {
1106
+ clearFieldError(path);
1107
+ } else if (errorsState[path] !== error) {
1108
+ setErrors((current) => ({ ...current, [path]: error }));
1109
+ }
1110
+ },
1111
+ [errorsState]
1112
+ );
1113
+ return {
1114
+ errorsState,
1115
+ setErrors,
1116
+ clearErrors,
1117
+ setFieldError,
1118
+ clearFieldError
1119
+ };
1120
+ }
1121
+
1122
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
1123
+ import { useCallback as useCallback10 } from "react";
1124
+
1125
+ // ../../node_modules/@mantine/form/esm/lists/clear-list-state.mjs
1126
+ function clearListState(field, state) {
1127
+ if (state === null || typeof state !== "object") {
1128
+ return {};
1129
+ }
1130
+ const clone = { ...state };
1131
+ Object.keys(state).forEach((errorKey) => {
1132
+ if (errorKey.includes(`${String(field)}.`)) {
1133
+ delete clone[errorKey];
1134
+ }
1135
+ });
1136
+ return clone;
1137
+ }
1138
+
1139
+ // ../../node_modules/@mantine/form/esm/lists/change-error-indices.mjs
1140
+ function getIndexFromKeyAfterPath(key, path) {
1141
+ const split = key.substring(path.length + 1).split(".")[0];
1142
+ return parseInt(split, 10);
1143
+ }
1144
+ function changeErrorIndices(path, index, errors, change) {
1145
+ if (index === void 0) {
1146
+ return errors;
1147
+ }
1148
+ const pathString = `${String(path)}`;
1149
+ let clearedErrors = errors;
1150
+ if (change === -1) {
1151
+ clearedErrors = clearListState(`${pathString}.${index}`, clearedErrors);
1152
+ }
1153
+ const cloned = { ...clearedErrors };
1154
+ const changedKeys = /* @__PURE__ */ new Set();
1155
+ Object.entries(clearedErrors).filter(([key]) => {
1156
+ if (!key.startsWith(`${pathString}.`)) {
1157
+ return false;
1158
+ }
1159
+ const currIndex = getIndexFromKeyAfterPath(key, pathString);
1160
+ if (Number.isNaN(currIndex)) {
1161
+ return false;
1162
+ }
1163
+ return currIndex >= index;
1164
+ }).forEach(([key, value]) => {
1165
+ const currIndex = getIndexFromKeyAfterPath(key, pathString);
1166
+ const newKey = key.replace(
1167
+ `${pathString}.${currIndex}`,
1168
+ `${pathString}.${currIndex + change}`
1169
+ );
1170
+ cloned[newKey] = value;
1171
+ changedKeys.add(newKey);
1172
+ if (!changedKeys.has(key)) {
1173
+ delete cloned[key];
1174
+ }
1175
+ });
1176
+ return cloned;
1177
+ }
1178
+
1179
+ // ../../node_modules/@mantine/form/esm/lists/reorder-errors.mjs
1180
+ function reorderErrors(path, { from, to }, errors) {
1181
+ const oldKeyStart = `${path}.${from}`;
1182
+ const newKeyStart = `${path}.${to}`;
1183
+ const clone = { ...errors };
1184
+ Object.keys(errors).every((key) => {
1185
+ let oldKey;
1186
+ let newKey;
1187
+ if (key.startsWith(oldKeyStart)) {
1188
+ oldKey = key;
1189
+ newKey = key.replace(oldKeyStart, newKeyStart);
1190
+ }
1191
+ if (key.startsWith(newKeyStart)) {
1192
+ oldKey = key.replace(newKeyStart, oldKeyStart);
1193
+ newKey = key;
1194
+ }
1195
+ if (oldKey && newKey) {
1196
+ const value1 = clone[oldKey];
1197
+ const value2 = clone[newKey];
1198
+ value2 === void 0 ? delete clone[oldKey] : clone[oldKey] = value2;
1199
+ value1 === void 0 ? delete clone[newKey] : clone[newKey] = value1;
1200
+ return false;
1201
+ }
1202
+ return true;
1203
+ });
1204
+ return clone;
1205
+ }
1206
+
1207
+ // ../../node_modules/klona/full/index.mjs
1208
+ function set(obj, key, val) {
1209
+ if (typeof val.value === "object")
1210
+ val.value = klona(val.value);
1211
+ if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === "__proto__") {
1212
+ Object.defineProperty(obj, key, val);
1213
+ } else
1214
+ obj[key] = val.value;
1215
+ }
1216
+ function klona(x) {
1217
+ if (typeof x !== "object")
1218
+ return x;
1219
+ var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
1220
+ if (str === "[object Object]") {
1221
+ tmp = Object.create(x.__proto__ || null);
1222
+ } else if (str === "[object Array]") {
1223
+ tmp = Array(x.length);
1224
+ } else if (str === "[object Set]") {
1225
+ tmp = /* @__PURE__ */ new Set();
1226
+ x.forEach(function(val) {
1227
+ tmp.add(klona(val));
1228
+ });
1229
+ } else if (str === "[object Map]") {
1230
+ tmp = /* @__PURE__ */ new Map();
1231
+ x.forEach(function(val, key) {
1232
+ tmp.set(klona(key), klona(val));
1233
+ });
1234
+ } else if (str === "[object Date]") {
1235
+ tmp = /* @__PURE__ */ new Date(+x);
1236
+ } else if (str === "[object RegExp]") {
1237
+ tmp = new RegExp(x.source, x.flags);
1238
+ } else if (str === "[object DataView]") {
1239
+ tmp = new x.constructor(klona(x.buffer));
1240
+ } else if (str === "[object ArrayBuffer]") {
1241
+ tmp = x.slice(0);
1242
+ } else if (str.slice(-6) === "Array]") {
1243
+ tmp = new x.constructor(x);
1244
+ }
1245
+ if (tmp) {
1246
+ for (list = Object.getOwnPropertySymbols(x); i < list.length; i++) {
1247
+ set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
1248
+ }
1249
+ for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
1250
+ if (Object.hasOwnProperty.call(tmp, k = list[i]) && tmp[k] === x[k])
1251
+ continue;
1252
+ set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
1253
+ }
1254
+ }
1255
+ return tmp || x;
1256
+ }
1257
+
1258
+ // ../../node_modules/@mantine/form/esm/paths/get-splitted-path.mjs
1259
+ function getSplittedPath(path) {
1260
+ if (typeof path !== "string") {
1261
+ return [];
1262
+ }
1263
+ return path.split(".");
1264
+ }
1265
+
1266
+ // ../../node_modules/@mantine/form/esm/paths/get-path.mjs
1267
+ function getPath(path, values) {
1268
+ const splittedPath = getSplittedPath(path);
1269
+ if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
1270
+ return void 0;
1271
+ }
1272
+ let value = values[splittedPath[0]];
1273
+ for (let i = 1; i < splittedPath.length; i += 1) {
1274
+ if (value === void 0) {
1275
+ break;
1276
+ }
1277
+ value = value[splittedPath[i]];
1278
+ }
1279
+ return value;
1280
+ }
1281
+
1282
+ // ../../node_modules/@mantine/form/esm/paths/set-path.mjs
1283
+ function setPath(path, value, values) {
1284
+ const splittedPath = getSplittedPath(path);
1285
+ if (splittedPath.length === 0) {
1286
+ return values;
1287
+ }
1288
+ const cloned = klona(values);
1289
+ if (splittedPath.length === 1) {
1290
+ cloned[splittedPath[0]] = value;
1291
+ return cloned;
1292
+ }
1293
+ let val = cloned[splittedPath[0]];
1294
+ for (let i = 1; i < splittedPath.length - 1; i += 1) {
1295
+ if (val === void 0) {
1296
+ return cloned;
1297
+ }
1298
+ val = val[splittedPath[i]];
1299
+ }
1300
+ val[splittedPath[splittedPath.length - 1]] = value;
1301
+ return cloned;
1302
+ }
1303
+
1304
+ // ../../node_modules/@mantine/form/esm/paths/reorder-path.mjs
1305
+ function reorderPath(path, { from, to }, values) {
1306
+ const currentValue = getPath(path, values);
1307
+ if (!Array.isArray(currentValue)) {
1308
+ return values;
1309
+ }
1310
+ const cloned = [...currentValue];
1311
+ const item = currentValue[from];
1312
+ cloned.splice(from, 1);
1313
+ cloned.splice(to, 0, item);
1314
+ return setPath(path, cloned, values);
1315
+ }
1316
+
1317
+ // ../../node_modules/@mantine/form/esm/paths/insert-path.mjs
1318
+ function insertPath(path, value, index, values) {
1319
+ const currentValue = getPath(path, values);
1320
+ if (!Array.isArray(currentValue)) {
1321
+ return values;
1322
+ }
1323
+ const cloned = [...currentValue];
1324
+ cloned.splice(typeof index === "number" ? index : cloned.length, 0, value);
1325
+ return setPath(path, cloned, values);
1326
+ }
1327
+
1328
+ // ../../node_modules/@mantine/form/esm/paths/remove-path.mjs
1329
+ function removePath(path, index, values) {
1330
+ const currentValue = getPath(path, values);
1331
+ if (!Array.isArray(currentValue)) {
1332
+ return values;
1333
+ }
1334
+ return setPath(
1335
+ path,
1336
+ currentValue.filter((_, itemIndex) => itemIndex !== index),
1337
+ values
1338
+ );
1339
+ }
1340
+
1341
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-list/use-form-list.mjs
1342
+ function useFormList({
1343
+ $values,
1344
+ $errors,
1345
+ $status
1346
+ }) {
1347
+ const reorderListItem = useCallback10((path, payload) => {
1348
+ $status.clearFieldDirty(path);
1349
+ $errors.setErrors((errs) => reorderErrors(path, payload, errs));
1350
+ $values.setValues({
1351
+ values: reorderPath(path, payload, $values.refValues.current),
1352
+ updateState: true
1353
+ });
1354
+ }, []);
1355
+ const removeListItem = useCallback10((path, index) => {
1356
+ $status.clearFieldDirty(path);
1357
+ $errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
1358
+ $values.setValues({
1359
+ values: removePath(path, index, $values.refValues.current),
1360
+ updateState: true
1361
+ });
1362
+ }, []);
1363
+ const insertListItem = useCallback10((path, item, index) => {
1364
+ $status.clearFieldDirty(path);
1365
+ $errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
1366
+ $values.setValues({
1367
+ values: insertPath(path, item, index, $values.refValues.current),
1368
+ updateState: true
1369
+ });
1370
+ }, []);
1371
+ return { reorderListItem, removeListItem, insertListItem };
1372
+ }
1373
+
1374
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
1375
+ var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
1376
+ import { useState as useState10, useRef, useCallback as useCallback11 } from "react";
1377
+
1378
+ // ../../node_modules/@mantine/form/esm/get-status/get-status.mjs
1379
+ function getStatus(status, path) {
1380
+ const paths = Object.keys(status);
1381
+ if (typeof path === "string") {
1382
+ const nestedPaths = paths.filter((statusPath) => statusPath.startsWith(`${path}.`));
1383
+ return status[path] || nestedPaths.some((statusPath) => status[statusPath]) || false;
1384
+ }
1385
+ return paths.some((statusPath) => status[statusPath]);
1386
+ }
1387
+
1388
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-status/use-form-status.mjs
1389
+ function useFormStatus({
1390
+ initialDirty,
1391
+ initialTouched,
1392
+ mode,
1393
+ $values
1394
+ }) {
1395
+ const [touchedState, setTouchedState] = useState10(initialTouched);
1396
+ const [dirtyState, setDirtyState] = useState10(initialDirty);
1397
+ const touchedRef = useRef(initialTouched);
1398
+ const dirtyRef = useRef(initialDirty);
1399
+ const setTouched = useCallback11((values) => {
1400
+ const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
1401
+ touchedRef.current = resolvedValues;
1402
+ if (mode === "controlled") {
1403
+ setTouchedState(resolvedValues);
1404
+ }
1405
+ }, []);
1406
+ const setDirty = useCallback11((values) => {
1407
+ const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
1408
+ dirtyRef.current = resolvedValues;
1409
+ if (mode === "controlled") {
1410
+ setDirtyState(resolvedValues);
1411
+ }
1412
+ }, []);
1413
+ const resetTouched = useCallback11(() => setTouched({}), []);
1414
+ const resetDirty = (values) => {
1415
+ const newSnapshot = values ? { ...values, ...$values.refValues.current } : $values.refValues.current;
1416
+ $values.setValuesSnapshot(newSnapshot);
1417
+ setDirty({});
1418
+ };
1419
+ const setFieldTouched = useCallback11((path, touched) => {
1420
+ setTouched((currentTouched) => {
1421
+ if (getStatus(currentTouched, path) === touched) {
1422
+ return currentTouched;
1423
+ }
1424
+ return { ...currentTouched, [path]: touched };
1425
+ });
1426
+ }, []);
1427
+ const setFieldDirty = useCallback11((path, dirty) => {
1428
+ setDirty((currentDirty) => {
1429
+ if (getStatus(currentDirty, path) === dirty) {
1430
+ return currentDirty;
1431
+ }
1432
+ return { ...currentDirty, [path]: dirty };
1433
+ });
1434
+ }, []);
1435
+ const isTouched = useCallback11(
1436
+ (path) => getStatus(touchedRef.current, path),
1437
+ []
1438
+ );
1439
+ const clearFieldDirty = useCallback11(
1440
+ (path) => setDirty((current) => {
1441
+ if (typeof path !== "string") {
1442
+ return current;
1443
+ }
1444
+ const result = clearListState(path, current);
1445
+ delete result[path];
1446
+ if ((0, import_fast_deep_equal.default)(result, current)) {
1447
+ return current;
1448
+ }
1449
+ return result;
1450
+ }),
1451
+ []
1452
+ );
1453
+ const isDirty = useCallback11((path) => {
1454
+ if (path) {
1455
+ const overriddenValue = getPath(path, dirtyRef.current);
1456
+ if (typeof overriddenValue === "boolean") {
1457
+ return overriddenValue;
1458
+ }
1459
+ const sliceOfValues = getPath(path, $values.refValues.current);
1460
+ const sliceOfInitialValues = getPath(path, $values.valuesSnapshot.current);
1461
+ return !(0, import_fast_deep_equal.default)(sliceOfValues, sliceOfInitialValues);
1462
+ }
1463
+ const isOverridden = Object.keys(dirtyRef.current).length > 0;
1464
+ if (isOverridden) {
1465
+ return getStatus(dirtyRef.current);
1466
+ }
1467
+ return !(0, import_fast_deep_equal.default)($values.refValues.current, $values.valuesSnapshot.current);
1468
+ }, []);
1469
+ const getDirty = useCallback11(() => dirtyRef.current, []);
1470
+ const getTouched = useCallback11(() => touchedRef.current, []);
1471
+ return {
1472
+ touchedState,
1473
+ dirtyState,
1474
+ touchedRef,
1475
+ dirtyRef,
1476
+ setTouched,
1477
+ setDirty,
1478
+ resetDirty,
1479
+ resetTouched,
1480
+ isTouched,
1481
+ setFieldTouched,
1482
+ setFieldDirty,
1483
+ setTouchedState,
1484
+ setDirtyState,
1485
+ clearFieldDirty,
1486
+ isDirty,
1487
+ getDirty,
1488
+ getTouched
1489
+ };
1490
+ }
1491
+
1492
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-values/use-form-values.mjs
1493
+ import { useRef as useRef2, useState as useState11, useCallback as useCallback12 } from "react";
1494
+ function useFormValues({
1495
+ initialValues,
1496
+ onValuesChange,
1497
+ mode
1498
+ }) {
1499
+ const initialized = useRef2(false);
1500
+ const [stateValues, setStateValues] = useState11(initialValues || {});
1501
+ const refValues = useRef2(stateValues);
1502
+ const valuesSnapshot = useRef2(stateValues);
1503
+ const setValues = useCallback12(
1504
+ ({
1505
+ values,
1506
+ subscribers,
1507
+ updateState = true,
1508
+ mergeWithPreviousValues = true
1509
+ }) => {
1510
+ const previousValues = refValues.current;
1511
+ const resolvedValues = values instanceof Function ? values(refValues.current) : values;
1512
+ const updatedValues = mergeWithPreviousValues ? { ...previousValues, ...resolvedValues } : resolvedValues;
1513
+ refValues.current = updatedValues;
1514
+ updateState && setStateValues(updatedValues);
1515
+ onValuesChange?.(updatedValues, previousValues);
1516
+ subscribers?.filter(Boolean).forEach((subscriber) => subscriber({ updatedValues, previousValues }));
1517
+ },
1518
+ [onValuesChange]
1519
+ );
1520
+ const setFieldValue = useCallback12((payload) => {
1521
+ const currentValue = getPath(payload.path, refValues.current);
1522
+ const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
1523
+ if (currentValue !== updatedValue) {
1524
+ const previousValues = refValues.current;
1525
+ const updatedValues = setPath(payload.path, updatedValue, refValues.current);
1526
+ setValues({ values: updatedValues, updateState: payload.updateState });
1527
+ payload.subscribers?.filter(Boolean).forEach(
1528
+ (subscriber) => subscriber({ path: payload.path, updatedValues, previousValues })
1529
+ );
1530
+ }
1531
+ }, []);
1532
+ const setValuesSnapshot = useCallback12((payload) => {
1533
+ valuesSnapshot.current = payload;
1534
+ }, []);
1535
+ const initialize = useCallback12((values, onInitialize) => {
1536
+ if (!initialized.current) {
1537
+ initialized.current = true;
1538
+ setValues({ values, updateState: mode === "controlled" });
1539
+ setValuesSnapshot(values);
1540
+ onInitialize();
1541
+ }
1542
+ }, []);
1543
+ const resetValues = useCallback12(() => {
1544
+ setValues({
1545
+ values: valuesSnapshot.current,
1546
+ updateState: true,
1547
+ mergeWithPreviousValues: false
1548
+ });
1549
+ }, []);
1550
+ const getValues = useCallback12(() => refValues.current, []);
1551
+ return {
1552
+ initialized,
1553
+ stateValues,
1554
+ refValues,
1555
+ valuesSnapshot,
1556
+ setValues,
1557
+ setFieldValue,
1558
+ resetValues,
1559
+ setValuesSnapshot,
1560
+ initialize,
1561
+ getValues
1562
+ };
1563
+ }
1564
+
1565
+ // ../../node_modules/@mantine/form/esm/hooks/use-form-watch/use-form-watch.mjs
1566
+ import { useRef as useRef3, useCallback as useCallback13, useEffect as useEffect14 } from "react";
1567
+ function useFormWatch({
1568
+ $status
1569
+ }) {
1570
+ const subscribers = useRef3(
1571
+ {}
1572
+ );
1573
+ const watch = useCallback13((path, callback) => {
1574
+ useEffect14(() => {
1575
+ subscribers.current[path] = subscribers.current[path] || [];
1576
+ subscribers.current[path].push(callback);
1577
+ return () => {
1578
+ subscribers.current[path] = subscribers.current[path].filter((cb) => cb !== callback);
1579
+ };
1580
+ }, [callback]);
1581
+ }, []);
1582
+ const getFieldSubscribers = useCallback13((path) => {
1583
+ if (!subscribers.current[path]) {
1584
+ return [];
1585
+ }
1586
+ return subscribers.current[path].map(
1587
+ (callback) => (input) => callback({
1588
+ previousValue: getPath(path, input.previousValues),
1589
+ value: getPath(path, input.updatedValues),
1590
+ touched: $status.isTouched(path),
1591
+ dirty: $status.isDirty(path)
1592
+ })
1593
+ );
1594
+ }, []);
1595
+ return {
1596
+ subscribers,
1597
+ watch,
1598
+ getFieldSubscribers
1599
+ };
1600
+ }
1601
+
1602
+ // ../../node_modules/@mantine/form/esm/validate/validate-values.mjs
1603
+ function getValidationResults(errors) {
1604
+ const filteredErrors = filterErrors(errors);
1605
+ return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
1606
+ }
1607
+ function validateRulesRecord(rules, values, path = "", errors = {}) {
1608
+ if (typeof rules !== "object" || rules === null) {
1609
+ return errors;
1610
+ }
1611
+ return Object.keys(rules).reduce((acc, ruleKey) => {
1612
+ const rule = rules[ruleKey];
1613
+ const rulePath = `${path === "" ? "" : `${path}.`}${ruleKey}`;
1614
+ const value = getPath(rulePath, values);
1615
+ let arrayValidation = false;
1616
+ if (typeof rule === "function") {
1617
+ acc[rulePath] = rule(value, values, rulePath);
1618
+ }
1619
+ if (typeof rule === "object" && Array.isArray(value)) {
1620
+ arrayValidation = true;
1621
+ value.forEach(
1622
+ (_item, index) => validateRulesRecord(rule, values, `${rulePath}.${index}`, acc)
1623
+ );
1624
+ }
1625
+ if (typeof rule === "object" && typeof value === "object" && value !== null) {
1626
+ if (!arrayValidation) {
1627
+ validateRulesRecord(rule, values, rulePath, acc);
1628
+ }
1629
+ }
1630
+ return acc;
1631
+ }, errors);
1632
+ }
1633
+ function validateValues(validate, values) {
1634
+ if (typeof validate === "function") {
1635
+ return getValidationResults(validate(values));
1636
+ }
1637
+ return getValidationResults(validateRulesRecord(validate, values));
1638
+ }
1639
+
1640
+ // ../../node_modules/@mantine/form/esm/validate/validate-field-value.mjs
1641
+ function validateFieldValue(path, rules, values) {
1642
+ if (typeof path !== "string") {
1643
+ return { hasError: false, error: null };
1644
+ }
1645
+ const results = validateValues(rules, values);
1646
+ const pathInError = Object.keys(results.errors).find(
1647
+ (errorKey) => path.split(".").every((pathPart, i) => pathPart === errorKey.split(".")[i])
1648
+ );
1649
+ return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
1650
+ }
1651
+
1652
+ // ../../node_modules/@mantine/form/esm/form-index.mjs
1653
+ var FORM_INDEX = "__MANTINE_FORM_INDEX__";
1654
+
1655
+ // ../../node_modules/@mantine/form/esm/validate/should-validate-on-change.mjs
1656
+ function shouldValidateOnChange(path, validateInputOnChange) {
1657
+ if (!validateInputOnChange) {
1658
+ return false;
1659
+ }
1660
+ if (typeof validateInputOnChange === "boolean") {
1661
+ return validateInputOnChange;
1662
+ }
1663
+ if (Array.isArray(validateInputOnChange)) {
1664
+ return validateInputOnChange.includes(path.replace(/[.][0-9]/g, `.${FORM_INDEX}`));
1665
+ }
1666
+ return false;
1667
+ }
1668
+
1669
+ // ../../node_modules/@mantine/form/esm/use-form.mjs
1670
+ function useForm({
1671
+ name,
1672
+ mode = "controlled",
1673
+ initialValues,
1674
+ initialErrors = {},
1675
+ initialDirty = {},
1676
+ initialTouched = {},
1677
+ clearInputErrorOnChange = true,
1678
+ validateInputOnChange = false,
1679
+ validateInputOnBlur = false,
1680
+ onValuesChange,
1681
+ transformValues = (values) => values,
1682
+ enhanceGetInputProps,
1683
+ validate: rules
1684
+ } = {}) {
1685
+ const $errors = useFormErrors(initialErrors);
1686
+ const $values = useFormValues({ initialValues, onValuesChange, mode });
1687
+ const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
1688
+ const $list = useFormList({ $values, $errors, $status });
1689
+ const $watch = useFormWatch({ $status });
1690
+ const [formKey, setFormKey] = useState12(0);
1691
+ const [fieldKeys, setFieldKeys] = useState12({});
1692
+ const reset = useCallback14(() => {
1693
+ $values.resetValues();
1694
+ $errors.clearErrors();
1695
+ $status.resetDirty();
1696
+ $status.resetTouched();
1697
+ mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
1698
+ }, []);
1699
+ const initialize = useCallback14((values) => {
1700
+ $values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
1701
+ }, []);
1702
+ const setFieldValue = useCallback14(
1703
+ (path, value, options3) => {
1704
+ const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
1705
+ $status.clearFieldDirty(path);
1706
+ $status.setFieldTouched(path, true);
1707
+ !shouldValidate && clearInputErrorOnChange && $errors.clearFieldError(path);
1708
+ $values.setFieldValue({
1709
+ path,
1710
+ value,
1711
+ updateState: mode === "controlled",
1712
+ subscribers: [
1713
+ ...$watch.getFieldSubscribers(path),
1714
+ shouldValidate ? (payload) => {
1715
+ const validationResults = validateFieldValue(path, rules, payload.updatedValues);
1716
+ validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
1717
+ } : null,
1718
+ options3?.forceUpdate !== false && mode !== "controlled" ? () => setFieldKeys((keys) => ({
1719
+ ...keys,
1720
+ [path]: (keys[path] || 0) + 1
1721
+ })) : null
1722
+ ]
1723
+ });
1724
+ },
1725
+ [onValuesChange, rules]
1726
+ );
1727
+ const setValues = useCallback14(
1728
+ (values) => {
1729
+ const previousValues = $values.refValues.current;
1730
+ $values.setValues({ values, updateState: mode === "controlled" });
1731
+ clearInputErrorOnChange && $errors.clearErrors();
1732
+ mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
1733
+ Object.keys($watch.subscribers.current).forEach((path) => {
1734
+ const value = getPath(path, $values.refValues.current);
1735
+ const previousValue = getPath(path, previousValues);
1736
+ if (value !== previousValue) {
1737
+ $watch.getFieldSubscribers(path).forEach((cb) => cb({ previousValues, updatedValues: $values.refValues.current }));
1738
+ }
1739
+ });
1740
+ },
1741
+ [onValuesChange, clearInputErrorOnChange]
1742
+ );
1743
+ const validate = useCallback14(() => {
1744
+ const results = validateValues(rules, $values.refValues.current);
1745
+ $errors.setErrors(results.errors);
1746
+ return results;
1747
+ }, [rules]);
1748
+ const validateField = useCallback14(
1749
+ (path) => {
1750
+ const results = validateFieldValue(path, rules, $values.refValues.current);
1751
+ results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
1752
+ return results;
1753
+ },
1754
+ [rules]
1755
+ );
1756
+ const getInputProps = (path, { type = "input", withError = true, withFocus = true, ...otherOptions } = {}) => {
1757
+ const onChange = getInputOnChange(
1758
+ (value) => setFieldValue(path, value, { forceUpdate: false })
1759
+ );
1760
+ const payload = { onChange };
1761
+ if (withError) {
1762
+ payload.error = $errors.errorsState[path];
1763
+ }
1764
+ if (type === "checkbox") {
1765
+ payload[mode === "controlled" ? "checked" : "defaultChecked"] = getPath(
1766
+ path,
1767
+ $values.refValues.current
1768
+ );
1769
+ } else {
1770
+ payload[mode === "controlled" ? "value" : "defaultValue"] = getPath(
1771
+ path,
1772
+ $values.refValues.current
1773
+ );
1774
+ }
1775
+ if (withFocus) {
1776
+ payload.onFocus = () => $status.setFieldTouched(path, true);
1777
+ payload.onBlur = () => {
1778
+ if (shouldValidateOnChange(path, validateInputOnBlur)) {
1779
+ const validationResults = validateFieldValue(path, rules, $values.refValues.current);
1780
+ validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
1781
+ }
1782
+ };
1783
+ }
1784
+ return Object.assign(
1785
+ payload,
1786
+ enhanceGetInputProps?.({
1787
+ inputProps: payload,
1788
+ field: path,
1789
+ options: { type, withError, withFocus, ...otherOptions },
1790
+ form
1791
+ })
1792
+ );
1793
+ };
1794
+ const onSubmit = (handleSubmit, handleValidationFailure) => (event) => {
1795
+ event?.preventDefault();
1796
+ const results = validate();
1797
+ if (results.hasErrors) {
1798
+ handleValidationFailure?.(results.errors, $values.refValues.current, event);
1799
+ } else {
1800
+ handleSubmit?.(transformValues($values.refValues.current), event);
1801
+ }
1802
+ };
1803
+ const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
1804
+ const onReset = useCallback14((event) => {
1805
+ event.preventDefault();
1806
+ reset();
1807
+ }, []);
1808
+ const isValid = useCallback14(
1809
+ (path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
1810
+ [rules]
1811
+ );
1812
+ const key = (path) => `${formKey}-${path}-${fieldKeys[path] || 0}`;
1813
+ const form = {
1814
+ watch: $watch.watch,
1815
+ initialized: $values.initialized.current,
1816
+ values: $values.stateValues,
1817
+ getValues: $values.getValues,
1818
+ setInitialValues: $values.setValuesSnapshot,
1819
+ initialize,
1820
+ setValues,
1821
+ setFieldValue,
1822
+ errors: $errors.errorsState,
1823
+ setErrors: $errors.setErrors,
1824
+ setFieldError: $errors.setFieldError,
1825
+ clearFieldError: $errors.clearFieldError,
1826
+ clearErrors: $errors.clearErrors,
1827
+ resetDirty: $status.resetDirty,
1828
+ setTouched: $status.setTouched,
1829
+ setDirty: $status.setDirty,
1830
+ isTouched: $status.isTouched,
1831
+ resetTouched: $status.resetTouched,
1832
+ isDirty: $status.isDirty,
1833
+ getTouched: $status.getTouched,
1834
+ getDirty: $status.getDirty,
1835
+ reorderListItem: $list.reorderListItem,
1836
+ insertListItem: $list.insertListItem,
1837
+ removeListItem: $list.removeListItem,
1838
+ reset,
1839
+ validate,
1840
+ validateField,
1841
+ getInputProps,
1842
+ onSubmit,
1843
+ onReset,
1844
+ isValid,
1845
+ getTransformedValues,
1846
+ key
1847
+ };
1848
+ useFormActions(name, form);
1849
+ return form;
1850
+ }
1851
+
1852
+ // src/nodes/modifiers/noise-curve-node.tsx
1853
+ import { useCallback as useCallback15, useEffect as useEffect15, useState as useState13 } from "react";
1854
+ import { Curve } from "libnoise-ts/module/modifier";
1855
+ import { Tuple } from "libnoise-ts/util";
1856
+ import { IconX } from "@tabler/icons-react";
1857
+ import { randomId } from "@mantine/hooks";
1858
+ import { NodeState } from "@awesome-flow/core/abstract";
1859
+ import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
1860
+ function NoiseCurveNode({ id, selected, data, type }) {
1861
+ const incoming = useIncomingComputedData9(id);
1862
+ const updateNodeData = useUpdateNodeData8();
1863
+ const updateComputedData = useUpdateNodeComputedData18();
1864
+ const [values, setValues] = useState13([]);
1865
+ const form = useForm({
1866
+ mode: "uncontrolled",
1867
+ initialValues: {
1868
+ points: []
1869
+ },
1870
+ validateInputOnChange: [`points.${FORM_INDEX}.input`],
1871
+ clearInputErrorOnChange: true,
1872
+ validate: {
1873
+ points: {
1874
+ input: (value, values2) => {
1875
+ const counts = {};
1876
+ values2.points.forEach((x) => {
1877
+ counts[x.input] = (counts[x.input] || 0) + 1;
1878
+ });
1879
+ return counts[value] > 1;
1880
+ }
1881
+ }
1882
+ },
1883
+ onValuesChange: useCallback15((values2) => {
1884
+ if (form.isValid()) {
1885
+ const points = values2.points.map((v) => ({ input: v.input, output: v.output }));
1886
+ setValues(points);
1887
+ updateNodeData(id, { points });
1888
+ }
1889
+ form.validate();
1890
+ }, [])
1891
+ });
1892
+ useEffect15(() => {
1893
+ const points = data.points?.length ? data.points.map((v) => ({ input: v.input, output: v.output, key: randomId() })) : [1, 2, 3, 4].map(() => ({ input: 0, output: 0, key: randomId() }));
1894
+ form.initialize({ points });
1895
+ }, []);
1896
+ useEffect15(() => {
1897
+ if (incoming?.length && values?.length >= 4) {
1898
+ const module = new Curve(
1899
+ incoming[0].module,
1900
+ values.map((p) => new Tuple(p.input, p.output))
1901
+ );
1902
+ updateComputedData(id, { module });
1903
+ }
1904
+ }, [values, incoming]);
1905
+ const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ jsxs18(Group9, { mt: "xs", children: [
1906
+ /* @__PURE__ */ jsx23(
1907
+ NumberInput7,
1908
+ {
1909
+ size: "xs",
1910
+ w: 100,
1911
+ placeholder: "Input Value",
1912
+ ...form.getInputProps(`points.${index}.input`),
1913
+ step: 0.1
1914
+ },
1915
+ form.key(`points.${index}.input`)
1916
+ ),
1917
+ /* @__PURE__ */ jsx23(
1918
+ NumberInput7,
1919
+ {
1920
+ size: "xs",
1921
+ w: 100,
1922
+ placeholder: "Output Value",
1923
+ ...form.getInputProps(`points.${index}.output`),
1924
+ step: 0.1
1925
+ },
1926
+ form.key(`points.${index}.output`)
1927
+ ),
1928
+ data.state === NodeState.edit && values.length > 4 && /* @__PURE__ */ jsx23(
1929
+ ActionIcon,
1930
+ {
1931
+ color: "red",
1932
+ variant: "outline",
1933
+ size: "sm",
1934
+ onClick: () => form.removeListItem("points", index),
1935
+ children: /* @__PURE__ */ jsx23(IconX, { size: "1rem" })
1936
+ }
1937
+ )
1938
+ ] }, item.key));
1939
+ return /* @__PURE__ */ jsxs18(NodeContainer20, { id, selected, type, data, children: [
1940
+ fields,
1941
+ data.state === NodeState.edit && /* @__PURE__ */ jsxs18(Fragment3, { children: [
1942
+ /* @__PURE__ */ jsx23(Space, { h: 10 }),
1943
+ /* @__PURE__ */ jsx23(
1944
+ Button,
1945
+ {
1946
+ variant: "outline",
1947
+ size: "xs",
1948
+ fullWidth: true,
1949
+ onClick: () => form.insertListItem("points", { input: 0, output: 0, key: randomId() }),
1950
+ children: "Add control point"
1951
+ }
1952
+ )
1953
+ ] }),
1954
+ /* @__PURE__ */ jsx23(NodeTrackConnections15, { handles: data.handles, nodeId: id, type: "target" })
1955
+ ] });
1956
+ }
1957
+ var noise_curve_node_default = NoiseCurveNode;
1958
+
1959
+ // src/nodes/modifiers/noise-exponent-node.tsx
1960
+ import { NodeContainer as NodeContainer21, NodeTrackConnections as NodeTrackConnections16 } from "@awesome-flow/core/layout";
1961
+ import { useEffect as useEffect16, useState as useState14 } from "react";
1962
+ import { Group as Group10, NumberInput as NumberInput8, Stack as Stack11 } from "@mantine/core";
1963
+ import {
1964
+ useIncomingComputedData as useIncomingComputedData10,
1965
+ useUpdateNodeComputedData as useUpdateNodeComputedData19,
1966
+ useUpdateNodeData as useUpdateNodeData9
1967
+ } from "@awesome-flow/core/hooks";
1968
+ import { Exponent } from "libnoise-ts/module/modifier";
1969
+ import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
1970
+ function NoiseExponentNode({ id, selected, data, type }) {
1971
+ const [exponent, setExponent] = useState14(data.exponent);
1972
+ const incoming = useIncomingComputedData10(id);
1973
+ const updateNodeData = useUpdateNodeData9();
1974
+ const updateComputedData = useUpdateNodeComputedData19();
1975
+ useEffect16(() => {
1976
+ if (incoming?.length > 0) {
1977
+ const module = new Exponent(incoming[0].module, exponent);
1978
+ updateComputedData(id, { module });
1979
+ }
1980
+ updateNodeData(id, { exponent });
1981
+ }, [incoming, exponent]);
1982
+ return /* @__PURE__ */ jsxs19(NodeContainer21, { id, selected, data, type, children: [
1983
+ /* @__PURE__ */ jsx24(Stack11, { children: /* @__PURE__ */ jsxs19(Group10, { children: [
1984
+ "Exponent:",
1985
+ /* @__PURE__ */ jsx24(
1986
+ NumberInput8,
1987
+ {
1988
+ size: "xs",
1989
+ value: exponent,
1990
+ onChange: (e) => setExponent(Number(e)),
1991
+ step: 0.1
1992
+ }
1993
+ )
1994
+ ] }) }),
1995
+ /* @__PURE__ */ jsx24(NodeTrackConnections16, { handles: data.handles, nodeId: id, type: "target" })
1996
+ ] });
1997
+ }
1998
+ var noise_exponent_node_default = NoiseExponentNode;
1999
+
2000
+ // src/nodes/modifiers/noise-invert-node.tsx
2001
+ import { NodeContainer as NodeContainer22, NodeTrackConnections as NodeTrackConnections17 } from "@awesome-flow/core/layout";
2002
+ import { useEffect as useEffect17 } from "react";
2003
+ import { useIncomingComputedData as useIncomingComputedData11, useUpdateNodeComputedData as useUpdateNodeComputedData20 } from "@awesome-flow/core/hooks";
2004
+ import { Invert } from "libnoise-ts/module/modifier";
2005
+ import { jsx as jsx25 } from "react/jsx-runtime";
2006
+ function NoiseInvertNode({ id, selected, data, type }) {
2007
+ const incoming = useIncomingComputedData11(id);
2008
+ const updateComputedData = useUpdateNodeComputedData20();
2009
+ useEffect17(() => {
2010
+ if (incoming?.length > 0) {
2011
+ const module = new Invert(incoming[0].module);
2012
+ updateComputedData(id, { module });
2013
+ }
2014
+ }, [incoming]);
2015
+ return /* @__PURE__ */ jsx25(NodeContainer22, { id, selected, data, type, children: /* @__PURE__ */ jsx25(NodeTrackConnections17, { handles: data.handles, nodeId: id, type: "target" }) });
2016
+ }
2017
+ var noise_invert_node_default = NoiseInvertNode;
2018
+
2019
+ // src/nodes/modifiers/noise-scale-bias-node.tsx
2020
+ import { NodeContainer as NodeContainer23, NodeTrackConnections as NodeTrackConnections18 } from "@awesome-flow/core/layout";
2021
+ import { useEffect as useEffect18, useState as useState15 } from "react";
2022
+ import { Group as Group11, NumberInput as NumberInput9, Stack as Stack12 } from "@mantine/core";
2023
+ import {
2024
+ useIncomingComputedData as useIncomingComputedData12,
2025
+ useUpdateNodeComputedData as useUpdateNodeComputedData21,
2026
+ useUpdateNodeData as useUpdateNodeData10
2027
+ } from "@awesome-flow/core/hooks";
2028
+ import { ScaleBias } from "libnoise-ts/module/modifier";
2029
+ import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
2030
+ function NoiseScaleBiasNode({ id, selected, data, type }) {
2031
+ const [scale, setScale] = useState15(data.scale);
2032
+ const [bias, setBias] = useState15(data.bias);
2033
+ const incoming = useIncomingComputedData12(id);
2034
+ const updateNodeData = useUpdateNodeData10();
2035
+ const updateComputedData = useUpdateNodeComputedData21();
2036
+ useEffect18(() => {
2037
+ if (incoming?.length > 0) {
2038
+ const module = new ScaleBias(incoming[0].module, scale, bias);
2039
+ updateComputedData(id, { module });
2040
+ }
2041
+ updateNodeData(id, { scale, bias });
2042
+ }, [incoming, scale, bias]);
2043
+ return /* @__PURE__ */ jsxs20(NodeContainer23, { id, selected, data, type, children: [
2044
+ /* @__PURE__ */ jsxs20(Stack12, { children: [
2045
+ /* @__PURE__ */ jsxs20(Group11, { children: [
2046
+ "Scale:",
2047
+ /* @__PURE__ */ jsx26(
2048
+ NumberInput9,
2049
+ {
2050
+ size: "xs",
2051
+ w: 100,
2052
+ value: scale,
2053
+ onChange: (e) => setScale(Number(e)),
2054
+ step: 0.1
2055
+ }
2056
+ )
2057
+ ] }),
2058
+ /* @__PURE__ */ jsxs20(Group11, { children: [
2059
+ "Bias:",
2060
+ /* @__PURE__ */ jsx26(
2061
+ NumberInput9,
2062
+ {
2063
+ size: "xs",
2064
+ w: 100,
2065
+ value: bias,
2066
+ onChange: (e) => setBias(Number(e)),
2067
+ step: 0.1
2068
+ }
2069
+ )
2070
+ ] })
2071
+ ] }),
2072
+ /* @__PURE__ */ jsx26(NodeTrackConnections18, { handles: data.handles, nodeId: id, type: "target" })
2073
+ ] });
2074
+ }
2075
+ var noise_scale_bias_node_default = NoiseScaleBiasNode;
2076
+
2077
+ // src/nodes/modifiers/noise-terrace-node.tsx
2078
+ import { NodeContainer as NodeContainer24, NodeTrackConnections as NodeTrackConnections19 } from "@awesome-flow/core/layout";
2079
+ import { ActionIcon as ActionIcon2, Button as Button2, Group as Group12, NumberInput as NumberInput10, Space as Space2 } from "@mantine/core";
2080
+ import {
2081
+ useIncomingComputedData as useIncomingComputedData13,
2082
+ useUpdateNodeComputedData as useUpdateNodeComputedData22,
2083
+ useUpdateNodeData as useUpdateNodeData11
2084
+ } from "@awesome-flow/core/hooks";
2085
+ import { useCallback as useCallback16, useEffect as useEffect19, useState as useState16 } from "react";
2086
+ import { Terrace } from "libnoise-ts/module/modifier";
2087
+ import { IconX as IconX2 } from "@tabler/icons-react";
2088
+ import { randomId as randomId2 } from "@mantine/hooks";
2089
+ import { NodeState as NodeState2 } from "@awesome-flow/core/abstract";
2090
+ import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
2091
+ function NoiseTerraceNode({ id, selected, data, type }) {
2092
+ const incoming = useIncomingComputedData13(id);
2093
+ const updateNodeData = useUpdateNodeData11();
2094
+ const updateComputedData = useUpdateNodeComputedData22();
2095
+ const [values, setValues] = useState16([]);
2096
+ const form = useForm({
2097
+ mode: "uncontrolled",
2098
+ initialValues: {
2099
+ points: []
2100
+ },
2101
+ validateInputOnChange: [`points.${FORM_INDEX}.input`],
2102
+ clearInputErrorOnChange: true,
2103
+ onValuesChange: useCallback16((values2) => {
2104
+ if (form.isValid()) {
2105
+ const points = values2.points.map((v) => v.value);
2106
+ setValues(points);
2107
+ updateNodeData(id, { points });
2108
+ }
2109
+ form.validate();
2110
+ }, [])
2111
+ });
2112
+ useEffect19(() => {
2113
+ const points = data.points?.length ? data.points.map((v) => ({ value: v, key: randomId2() })) : [1, 2].map(() => ({ value: 0, key: randomId2() }));
2114
+ form.initialize({ points });
2115
+ }, []);
2116
+ useEffect19(() => {
2117
+ if (incoming?.length && values?.length >= 2) {
2118
+ const module = new Terrace(incoming[0].module, values);
2119
+ updateComputedData(id, { module });
2120
+ }
2121
+ }, [values, incoming]);
2122
+ const fields = form.getValues().points.map((item, index) => /* @__PURE__ */ jsxs21(Group12, { mt: "xs", children: [
2123
+ /* @__PURE__ */ jsx27(
2124
+ NumberInput10,
2125
+ {
2126
+ size: "xs",
2127
+ placeholder: "Input Value",
2128
+ ...form.getInputProps(`points.${index}.value`),
2129
+ step: 0.1
2130
+ },
2131
+ form.key(`points.${index}.value`)
2132
+ ),
2133
+ data.state === NodeState2.edit && values.length > 2 && /* @__PURE__ */ jsx27(
2134
+ ActionIcon2,
2135
+ {
2136
+ color: "red",
2137
+ variant: "outline",
2138
+ size: "sm",
2139
+ onClick: () => form.removeListItem("points", index),
2140
+ children: /* @__PURE__ */ jsx27(IconX2, { size: "1rem" })
2141
+ }
2142
+ )
2143
+ ] }, item.key));
2144
+ return /* @__PURE__ */ jsxs21(NodeContainer24, { id, selected, type, data, children: [
2145
+ fields,
2146
+ data.state === NodeState2.edit && /* @__PURE__ */ jsxs21(Fragment4, { children: [
2147
+ /* @__PURE__ */ jsx27(Space2, { h: 10 }),
2148
+ /* @__PURE__ */ jsx27(
2149
+ Button2,
2150
+ {
2151
+ variant: "outline",
2152
+ size: "xs",
2153
+ fullWidth: true,
2154
+ onClick: () => form.insertListItem("points", { value: 0, key: randomId2() }),
2155
+ children: "Add control point"
2156
+ }
2157
+ )
2158
+ ] }),
2159
+ /* @__PURE__ */ jsx27(NodeTrackConnections19, { handles: data.handles, nodeId: id, type: "target" })
2160
+ ] });
2161
+ }
2162
+ var noise_terrace_node_default = NoiseTerraceNode;
2163
+
2164
+ // src/nodes/selectors/noise-blend-node.tsx
2165
+ import { NodeContainer as NodeContainer25, NodeTrackConnections as NodeTrackConnections20 } from "@awesome-flow/core/layout";
2166
+ import { useEffect as useEffect20 } from "react";
2167
+ import { useIncomingComputedData as useIncomingComputedData14, useUpdateNodeComputedData as useUpdateNodeComputedData23 } from "@awesome-flow/core/hooks";
2168
+ import { Blend } from "libnoise-ts/module/selector";
2169
+ import { Group as Group13 } from "@mantine/core";
2170
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
2171
+ function NoiseBlendNode({ id, selected, data, type }) {
2172
+ const incoming = useIncomingComputedData14(id);
2173
+ const updateComputedData = useUpdateNodeComputedData23();
2174
+ useEffect20(() => {
2175
+ if (incoming?.length > 2) {
2176
+ const module = new Blend(incoming[0].module, incoming[1].module, incoming[2].module);
2177
+ updateComputedData(id, { module });
2178
+ }
2179
+ }, [id, incoming, updateComputedData]);
2180
+ return /* @__PURE__ */ jsxs22(NodeContainer25, { id, selected, data, type, children: [
2181
+ /* @__PURE__ */ jsxs22(Group13, { children: [
2182
+ "Modules: ",
2183
+ incoming?.length
2184
+ ] }),
2185
+ /* @__PURE__ */ jsx28(NodeTrackConnections20, { handles: data.handles, nodeId: id, type: "target" })
2186
+ ] });
2187
+ }
2188
+ var noise_blend_node_default = NoiseBlendNode;
2189
+
2190
+ // src/nodes/selectors/noise-select-node.tsx
2191
+ import { NodeContainer as NodeContainer26, NodeTrackConnections as NodeTrackConnections21 } from "@awesome-flow/core/layout";
2192
+ import { useEffect as useEffect21, useState as useState17 } from "react";
2193
+ import {
2194
+ useIncomingComputedData as useIncomingComputedData15,
2195
+ useUpdateNodeComputedData as useUpdateNodeComputedData24,
2196
+ useUpdateNodeData as useUpdateNodeData12
2197
+ } from "@awesome-flow/core/hooks";
2198
+ import { Select } from "libnoise-ts/module/selector";
2199
+ import { Group as Group14, NumberInput as NumberInput11, Stack as Stack13 } from "@mantine/core";
2200
+ import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
2201
+ function NoiseSelectNode({ id, selected, data, type }) {
2202
+ const [edgeFalloff, setEdgeFalloff] = useState17(data.edgeFalloff);
2203
+ const [lowerBound, setLowerBound] = useState17(data.lowerBound);
2204
+ const [upperBound, setUpperBound] = useState17(data.upperBound);
2205
+ const incoming = useIncomingComputedData15(id);
2206
+ const updateNodeData = useUpdateNodeData12();
2207
+ const updateComputedData = useUpdateNodeComputedData24();
2208
+ useEffect21(() => {
2209
+ if (incoming?.length > 2) {
2210
+ const module = new Select(
2211
+ incoming[0].module,
2212
+ incoming[1].module,
2213
+ incoming[2].module,
2214
+ edgeFalloff,
2215
+ lowerBound,
2216
+ upperBound
2217
+ );
2218
+ updateComputedData(id, { module });
2219
+ }
2220
+ updateNodeData(id, { edgeFalloff, lowerBound, upperBound });
2221
+ }, [incoming, edgeFalloff, lowerBound, upperBound, updateNodeData, id, updateComputedData]);
2222
+ return /* @__PURE__ */ jsxs23(NodeContainer26, { id, selected, data, type, children: [
2223
+ /* @__PURE__ */ jsxs23(Stack13, { children: [
2224
+ /* @__PURE__ */ jsxs23(Group14, { children: [
2225
+ "Edge Falloff:",
2226
+ /* @__PURE__ */ jsx29(
2227
+ NumberInput11,
2228
+ {
2229
+ size: "xs",
2230
+ w: 100,
2231
+ value: edgeFalloff,
2232
+ onChange: (e) => setEdgeFalloff(Number(e)),
2233
+ step: 0.1
2234
+ }
2235
+ )
2236
+ ] }),
2237
+ /* @__PURE__ */ jsxs23(Group14, { children: [
2238
+ "Lower Bound:",
2239
+ /* @__PURE__ */ jsx29(
2240
+ NumberInput11,
2241
+ {
2242
+ size: "xs",
2243
+ w: 100,
2244
+ value: lowerBound,
2245
+ onChange: (e) => setLowerBound(Number(e)),
2246
+ step: 0.1
2247
+ }
2248
+ )
2249
+ ] }),
2250
+ /* @__PURE__ */ jsxs23(Group14, { children: [
2251
+ "Upper Bound:",
2252
+ /* @__PURE__ */ jsx29(
2253
+ NumberInput11,
2254
+ {
2255
+ size: "xs",
2256
+ w: 100,
2257
+ value: upperBound,
2258
+ onChange: (e) => setUpperBound(Number(e)),
2259
+ step: 0.1
2260
+ }
2261
+ )
2262
+ ] }),
2263
+ /* @__PURE__ */ jsxs23(Group14, { children: [
2264
+ "Modules: ",
2265
+ incoming?.length
2266
+ ] })
2267
+ ] }),
2268
+ /* @__PURE__ */ jsx29(NodeTrackConnections21, { handles: data.handles, nodeId: id, type: "target" })
2269
+ ] });
2270
+ }
2271
+ var noise_select_node_default = NoiseSelectNode;
2272
+
2273
+ // src/nodes/transformers/noise-displace-node.tsx
2274
+ import { NodeContainer as NodeContainer27, NodeTrackConnections as NodeTrackConnections22 } from "@awesome-flow/core/layout";
2275
+ import { useEffect as useEffect22, useMemo as useMemo13 } from "react";
2276
+ import { useIncomingHandleData, useUpdateNodeComputedData as useUpdateNodeComputedData25 } from "@awesome-flow/core/hooks";
2277
+ import { Displace } from "libnoise-ts/module/transformer";
2278
+ import { Badge, Stack as Stack14 } from "@mantine/core";
2279
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
2280
+ function NoiseDisplaceNode({ id, selected, data, type }) {
2281
+ const updateComputedData = useUpdateNodeComputedData25();
2282
+ const incomingHandleData = useIncomingHandleData(id, data.handles);
2283
+ const { sourceModule, xModule, yModule, zModule } = useMemo13(() => {
2284
+ return {
2285
+ sourceModule: incomingHandleData["source" /* sourceModule */],
2286
+ xModule: incomingHandleData["x-module" /* xModule */],
2287
+ yModule: incomingHandleData["y-module" /* yModule */],
2288
+ zModule: incomingHandleData["z-module" /* zModule */]
2289
+ };
2290
+ }, [incomingHandleData]);
2291
+ useEffect22(() => {
2292
+ if (sourceModule && xModule && yModule && zModule) {
2293
+ const module = new Displace(
2294
+ sourceModule[0].module,
2295
+ xModule[0].module,
2296
+ yModule[0].module,
2297
+ zModule[0].module
2298
+ );
2299
+ updateComputedData(id, { module });
2300
+ }
2301
+ }, [id, updateComputedData, sourceModule, xModule, yModule, zModule]);
2302
+ const { sourceColor, xColor, yColor, zColor } = useMemo13(() => {
2303
+ return {
2304
+ sourceColor: sourceModule ? "green" : "orange",
2305
+ xColor: xModule ? "green" : "orange",
2306
+ yColor: yModule ? "green" : "orange",
2307
+ zColor: zModule ? "green" : "orange"
2308
+ };
2309
+ }, [sourceModule, xModule, yModule, zModule]);
2310
+ return /* @__PURE__ */ jsxs24(NodeContainer27, { id, selected, data, type, children: [
2311
+ /* @__PURE__ */ jsxs24(Stack14, { align: "center", children: [
2312
+ /* @__PURE__ */ jsx30(Badge, { color: sourceColor, children: "Source Module" }),
2313
+ /* @__PURE__ */ jsx30(Badge, { color: xColor, children: "X Module" }),
2314
+ /* @__PURE__ */ jsx30(Badge, { color: yColor, children: "Y Module" }),
2315
+ /* @__PURE__ */ jsx30(Badge, { color: zColor, children: "Z Module" })
2316
+ ] }),
2317
+ /* @__PURE__ */ jsx30(NodeTrackConnections22, { handles: data.handles, nodeId: id, type: "target" })
2318
+ ] });
2319
+ }
2320
+ var noise_displace_node_default = NoiseDisplaceNode;
2321
+
2322
+ // src/nodes/transformers/noise-rotate-point-node.tsx
2323
+ import { NodeContainer as NodeContainer28, NodeTrackConnections as NodeTrackConnections23 } from "@awesome-flow/core/layout";
2324
+ import { useEffect as useEffect23, useState as useState18 } from "react";
2325
+ import {
2326
+ useIncomingComputedData as useIncomingComputedData16,
2327
+ useUpdateNodeComputedData as useUpdateNodeComputedData26,
2328
+ useUpdateNodeData as useUpdateNodeData13
2329
+ } from "@awesome-flow/core/hooks";
2330
+ import { Group as Group15, NumberInput as NumberInput12, Stack as Stack15 } from "@mantine/core";
2331
+ import { RotatePoint } from "libnoise-ts/module/transformer";
2332
+ import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
2333
+ function NoiseRotatePointNode({
2334
+ id,
2335
+ selected,
2336
+ data,
2337
+ type
2338
+ }) {
2339
+ const [xAngle, setXAngle] = useState18(data.xAngle);
2340
+ const [yAngle, setYAngle] = useState18(data.yAngle);
2341
+ const [zAngle, setZAngle] = useState18(data.zAngle);
2342
+ const incoming = useIncomingComputedData16(id);
2343
+ const updateNodeData = useUpdateNodeData13();
2344
+ const updateComputedData = useUpdateNodeComputedData26();
2345
+ useEffect23(() => {
2346
+ if (incoming?.length) {
2347
+ const module = new RotatePoint(incoming[0].module, xAngle, yAngle, zAngle);
2348
+ updateComputedData(id, { module });
2349
+ }
2350
+ updateNodeData(id, { xAngle, yAngle, zAngle });
2351
+ }, [id, updateComputedData, updateNodeData, incoming, xAngle, yAngle, zAngle]);
2352
+ return /* @__PURE__ */ jsxs25(NodeContainer28, { id, selected, data, type, children: [
2353
+ /* @__PURE__ */ jsxs25(Stack15, { children: [
2354
+ /* @__PURE__ */ jsxs25(Group15, { children: [
2355
+ "X Angle:",
2356
+ /* @__PURE__ */ jsx31(
2357
+ NumberInput12,
2358
+ {
2359
+ size: "xs",
2360
+ w: 100,
2361
+ value: xAngle,
2362
+ onChange: (e) => setXAngle(Number(e)),
2363
+ step: 0.01
2364
+ }
2365
+ )
2366
+ ] }),
2367
+ /* @__PURE__ */ jsxs25(Group15, { children: [
2368
+ "Y Angle:",
2369
+ /* @__PURE__ */ jsx31(
2370
+ NumberInput12,
2371
+ {
2372
+ size: "xs",
2373
+ w: 100,
2374
+ value: yAngle,
2375
+ onChange: (e) => setYAngle(Number(e)),
2376
+ step: 0.01
2377
+ }
2378
+ )
2379
+ ] }),
2380
+ /* @__PURE__ */ jsxs25(Group15, { children: [
2381
+ "Z Angle:",
2382
+ /* @__PURE__ */ jsx31(
2383
+ NumberInput12,
2384
+ {
2385
+ size: "xs",
2386
+ w: 100,
2387
+ value: zAngle,
2388
+ onChange: (e) => setZAngle(Number(e)),
2389
+ step: 0.01
2390
+ }
2391
+ )
2392
+ ] })
2393
+ ] }),
2394
+ /* @__PURE__ */ jsx31(NodeTrackConnections23, { handles: data.handles, nodeId: id, type: "target" })
2395
+ ] });
2396
+ }
2397
+ var noise_rotate_point_node_default = NoiseRotatePointNode;
2398
+
2399
+ // src/nodes/transformers/noise-scale-point-node.tsx
2400
+ import { NodeContainer as NodeContainer29, NodeTrackConnections as NodeTrackConnections24 } from "@awesome-flow/core/layout";
2401
+ import { useEffect as useEffect24, useState as useState19 } from "react";
2402
+ import {
2403
+ useIncomingComputedData as useIncomingComputedData17,
2404
+ useUpdateNodeComputedData as useUpdateNodeComputedData27,
2405
+ useUpdateNodeData as useUpdateNodeData14
2406
+ } from "@awesome-flow/core/hooks";
2407
+ import { Group as Group16, NumberInput as NumberInput13, Stack as Stack16 } from "@mantine/core";
2408
+ import { ScalePoint } from "libnoise-ts/module/transformer";
2409
+ import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
2410
+ function NoiseScalePointNode({
2411
+ id,
2412
+ selected,
2413
+ data,
2414
+ type
2415
+ }) {
2416
+ const [xScale, setXScale] = useState19(data.xScale);
2417
+ const [yScale, setYScale] = useState19(data.yScale);
2418
+ const [zScale, setZScale] = useState19(data.zScale);
2419
+ const incoming = useIncomingComputedData17(id);
2420
+ const updateNodeData = useUpdateNodeData14();
2421
+ const updateComputedData = useUpdateNodeComputedData27();
2422
+ useEffect24(() => {
2423
+ if (incoming?.length) {
2424
+ const module = new ScalePoint(incoming[0].module, xScale, yScale, zScale);
2425
+ updateComputedData(id, { module });
2426
+ }
2427
+ updateNodeData(id, { xScale, yScale, zScale });
2428
+ }, [id, incoming, updateComputedData, updateNodeData, xScale, yScale, zScale]);
2429
+ return /* @__PURE__ */ jsxs26(NodeContainer29, { id, selected, data, type, children: [
2430
+ /* @__PURE__ */ jsxs26(Stack16, { children: [
2431
+ /* @__PURE__ */ jsxs26(Group16, { children: [
2432
+ "X Scale:",
2433
+ /* @__PURE__ */ jsx32(
2434
+ NumberInput13,
2435
+ {
2436
+ size: "xs",
2437
+ w: 100,
2438
+ value: xScale,
2439
+ onChange: (e) => setXScale(Number(e)),
2440
+ step: 0.01
2441
+ }
2442
+ )
2443
+ ] }),
2444
+ /* @__PURE__ */ jsxs26(Group16, { children: [
2445
+ "Y Scale:",
2446
+ /* @__PURE__ */ jsx32(
2447
+ NumberInput13,
2448
+ {
2449
+ size: "xs",
2450
+ w: 100,
2451
+ value: yScale,
2452
+ onChange: (e) => setYScale(Number(e)),
2453
+ step: 0.01
2454
+ }
2455
+ )
2456
+ ] }),
2457
+ /* @__PURE__ */ jsxs26(Group16, { children: [
2458
+ "Z Scale:",
2459
+ /* @__PURE__ */ jsx32(
2460
+ NumberInput13,
2461
+ {
2462
+ size: "xs",
2463
+ w: 100,
2464
+ value: zScale,
2465
+ onChange: (e) => setZScale(Number(e)),
2466
+ step: 0.01
2467
+ }
2468
+ )
2469
+ ] })
2470
+ ] }),
2471
+ /* @__PURE__ */ jsx32(NodeTrackConnections24, { handles: data.handles, nodeId: id, type: "target" })
2472
+ ] });
2473
+ }
2474
+ var noise_scale_point_node_default = NoiseScalePointNode;
2475
+
2476
+ // src/nodes/transformers/noise-translate-point-node.tsx
2477
+ import { NodeContainer as NodeContainer30, NodeTrackConnections as NodeTrackConnections25 } from "@awesome-flow/core/layout";
2478
+ import { useEffect as useEffect25, useState as useState20 } from "react";
2479
+ import {
2480
+ useIncomingComputedData as useIncomingComputedData18,
2481
+ useUpdateNodeComputedData as useUpdateNodeComputedData28,
2482
+ useUpdateNodeData as useUpdateNodeData15
2483
+ } from "@awesome-flow/core/hooks";
2484
+ import { Group as Group17, NumberInput as NumberInput14, Stack as Stack17 } from "@mantine/core";
2485
+ import { TranslatePoint } from "libnoise-ts/module/transformer";
2486
+ import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
2487
+ function NoiseTranslatePointNode({
2488
+ id,
2489
+ selected,
2490
+ data,
2491
+ type
2492
+ }) {
2493
+ const [translateX, setTranslateX] = useState20(data.translateX);
2494
+ const [translateY, setTranslateY] = useState20(data.translateY);
2495
+ const [translateZ, setTranslateZ] = useState20(data.translateZ);
2496
+ const incoming = useIncomingComputedData18(id);
2497
+ const updateNodeData = useUpdateNodeData15();
2498
+ const updateComputedData = useUpdateNodeComputedData28();
2499
+ useEffect25(() => {
2500
+ if (incoming?.length) {
2501
+ const module = new TranslatePoint(incoming[0].module, translateX, translateY, translateZ);
2502
+ updateComputedData(id, { module });
2503
+ }
2504
+ updateNodeData(id, { translateX, translateY, translateZ });
2505
+ }, [id, incoming, translateX, translateY, translateZ, updateComputedData, updateNodeData]);
2506
+ return /* @__PURE__ */ jsxs27(NodeContainer30, { id, selected, data, type, children: [
2507
+ /* @__PURE__ */ jsxs27(Stack17, { children: [
2508
+ /* @__PURE__ */ jsxs27(Group17, { children: [
2509
+ "Translate X:",
2510
+ /* @__PURE__ */ jsx33(
2511
+ NumberInput14,
2512
+ {
2513
+ size: "xs",
2514
+ w: 100,
2515
+ value: translateX,
2516
+ onChange: (e) => setTranslateX(Number(e)),
2517
+ step: 1
2518
+ }
2519
+ )
2520
+ ] }),
2521
+ /* @__PURE__ */ jsxs27(Group17, { children: [
2522
+ "Translate Y:",
2523
+ /* @__PURE__ */ jsx33(
2524
+ NumberInput14,
2525
+ {
2526
+ size: "xs",
2527
+ w: 100,
2528
+ value: translateY,
2529
+ onChange: (e) => setTranslateY(Number(e)),
2530
+ step: 1
2531
+ }
2532
+ )
2533
+ ] }),
2534
+ /* @__PURE__ */ jsxs27(Group17, { children: [
2535
+ "Translate Z:",
2536
+ /* @__PURE__ */ jsx33(
2537
+ NumberInput14,
2538
+ {
2539
+ size: "xs",
2540
+ w: 100,
2541
+ value: translateZ,
2542
+ onChange: (e) => setTranslateZ(Number(e)),
2543
+ step: 1
2544
+ }
2545
+ )
2546
+ ] })
2547
+ ] }),
2548
+ /* @__PURE__ */ jsx33(NodeTrackConnections25, { handles: data.handles, nodeId: id, type: "target" })
2549
+ ] });
2550
+ }
2551
+ var noise_translate_point_node_default = NoiseTranslatePointNode;
2552
+
2553
+ // src/nodes/transformers/noise-turbulence-node .tsx
2554
+ import { NodeContainer as NodeContainer31, NodeTrackConnections as NodeTrackConnections26 } from "@awesome-flow/core/layout";
2555
+ import { useCallback as useCallback17, useEffect as useEffect26, useState as useState21 } from "react";
2556
+ import { useIncomingComputedData as useIncomingComputedData19, useUpdateNodeComputedData as useUpdateNodeComputedData29 } from "@awesome-flow/core/hooks";
2557
+ import { Turbulence } from "libnoise-ts/module/transformer";
2558
+ import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
2559
+ function NoiseTurbulenceNode({
2560
+ id,
2561
+ selected,
2562
+ data,
2563
+ type
2564
+ }) {
2565
+ const [properties, setProperties] = useState21(null);
2566
+ const incoming = useIncomingComputedData19(id);
2567
+ const updateComputedData = useUpdateNodeComputedData29();
2568
+ const onPropertiesChange = useCallback17((props) => {
2569
+ setProperties(props);
2570
+ }, []);
2571
+ useEffect26(() => {
2572
+ if (incoming?.length) {
2573
+ const module = new Turbulence(
2574
+ incoming[0].module,
2575
+ properties.frequency.value,
2576
+ properties.power.value,
2577
+ properties.roughness.value,
2578
+ properties.seed.value
2579
+ );
2580
+ updateComputedData(id, { module });
2581
+ }
2582
+ }, [id, incoming, properties, updateComputedData]);
2583
+ return /* @__PURE__ */ jsxs28(NodeContainer31, { id, selected, data, type, children: [
2584
+ /* @__PURE__ */ jsx34(node_property_variables_default, { data, nodeId: id, onPropertiesChange }),
2585
+ /* @__PURE__ */ jsx34(NodeTrackConnections26, { handles: data.handles, nodeId: id, type: "target" })
2586
+ ] });
2587
+ }
2588
+ var noise_turbulence_node_default = NoiseTurbulenceNode;
2589
+
2590
+ // src/nodes/generators/variable-property-node.tsx
2591
+ import { NodeCombobox as NodeCombobox2, NodeContainer as NodeContainer32, NodeTrackConnections as NodeTrackConnections27 } from "@awesome-flow/core/layout";
2592
+ import { useCallback as useCallback18, useEffect as useEffect27, useState as useState22 } from "react";
2593
+ import { Stack as Stack18 } from "@mantine/core";
2594
+ import { useIncomingNodeData as useIncomingNodeData2, useOutgoingNodes, useUpdateNodeData as useUpdateNodeData16 } from "@awesome-flow/core/hooks";
2595
+ import { getObjectPropertyMap } from "@awesome-flow/core/utils";
2596
+ import { nodeDataPropertyExcept as nodeDataPropertyExcept3 } from "@awesome-flow/core/abstract";
2597
+ import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
2598
+ function VariablePropertyNode({
2599
+ id,
2600
+ selected,
2601
+ data,
2602
+ type
2603
+ }) {
2604
+ const [options3, setOptions] = useState22({});
2605
+ const [selectedProperty, setSelectedProperty] = useState22(data.property);
2606
+ const updateNodeData = useUpdateNodeData16();
2607
+ const outgoing = useOutgoingNodes(id);
2608
+ const incoming = useIncomingNodeData2(id);
2609
+ useEffect27(() => {
2610
+ if (outgoing?.length) {
2611
+ const { data: data2 } = outgoing[0];
2612
+ const properties = getObjectPropertyMap(data2, nodeDataPropertyExcept3);
2613
+ setOptions(properties);
2614
+ if (!selectedProperty) {
2615
+ const keys = Object.keys(properties);
2616
+ if (keys.length) {
2617
+ setSelectedProperty({
2618
+ name: keys[0],
2619
+ value: properties[keys[0]]
2620
+ });
2621
+ }
2622
+ }
2623
+ } else {
2624
+ setSelectedProperty(null);
2625
+ }
2626
+ }, [outgoing]);
2627
+ useEffect27(() => {
2628
+ if (!incoming?.length && selectedProperty?.disabled) {
2629
+ setSelectedProperty({ ...selectedProperty, disabled: false });
2630
+ } else if (incoming?.length && selectedProperty) {
2631
+ const incomingValue = incoming[0].value;
2632
+ if (incomingValue !== void 0 && incomingValue !== null) {
2633
+ setSelectedProperty({
2634
+ name: selectedProperty.name,
2635
+ value: incomingValue,
2636
+ disabled: true
2637
+ });
2638
+ }
2639
+ }
2640
+ }, [incoming]);
2641
+ useEffect27(() => {
2642
+ if (selectedProperty) {
2643
+ updateNodeData(id, { property: selectedProperty });
2644
+ }
2645
+ }, [selectedProperty]);
2646
+ const onPropertyChange = useCallback18(
2647
+ (selected2) => {
2648
+ setSelectedProperty({
2649
+ name: selected2,
2650
+ value: options3[selected2]
2651
+ });
2652
+ },
2653
+ [options3]
2654
+ );
2655
+ const onValueChange = useCallback18((name, value) => {
2656
+ setSelectedProperty({
2657
+ name,
2658
+ value
2659
+ });
2660
+ }, []);
2661
+ return /* @__PURE__ */ jsxs29(NodeContainer32, { id, selected, data, type, children: [
2662
+ /* @__PURE__ */ jsxs29(Stack18, { align: "center", children: [
2663
+ /* @__PURE__ */ jsx35(
2664
+ NodeCombobox2,
2665
+ {
2666
+ options: options3,
2667
+ onChange: onPropertyChange,
2668
+ selected: selectedProperty?.name,
2669
+ hideListValues: true
2670
+ }
2671
+ ),
2672
+ /* @__PURE__ */ jsx35(node_property_input_default, { property: selectedProperty, onChange: onValueChange })
2673
+ ] }),
2674
+ /* @__PURE__ */ jsx35(NodeTrackConnections27, { handles: data.handles, nodeId: id })
2675
+ ] });
2676
+ }
2677
+ var variable_property_node_default = VariablePropertyNode;
2678
+
2679
+ // src/nodes/modifiers/variable-combine-node.tsx
2680
+ import { NodeCombobox as NodeCombobox3, NodeContainer as NodeContainer33, NodeTrackConnections as NodeTrackConnections28 } from "@awesome-flow/core/layout";
2681
+ import { useCallback as useCallback19, useEffect as useEffect28, useState as useState23 } from "react";
2682
+ import { useIncomingNodeData as useIncomingNodeData3, useUpdateNodeData as useUpdateNodeData17 } from "@awesome-flow/core/hooks";
2683
+ import {
2684
+ IconAsterisk as IconAsterisk2,
2685
+ IconChevronLeft as IconChevronLeft2,
2686
+ IconChevronRight as IconChevronRight2,
2687
+ IconChevronUp as IconChevronUp2,
2688
+ IconDivide,
2689
+ IconPlus as IconPlus2
2690
+ } from "@tabler/icons-react";
2691
+ import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
2692
+ var options2 = {
2693
+ add: /* @__PURE__ */ jsx36(IconPlus2, {}),
2694
+ divide: /* @__PURE__ */ jsx36(IconDivide, {}),
2695
+ min: /* @__PURE__ */ jsx36(IconChevronLeft2, {}),
2696
+ max: /* @__PURE__ */ jsx36(IconChevronRight2, {}),
2697
+ multiply: /* @__PURE__ */ jsx36(IconAsterisk2, {}),
2698
+ power: /* @__PURE__ */ jsx36(IconChevronUp2, {})
2699
+ };
2700
+ function VariableCombineNode({
2701
+ id,
2702
+ selected,
2703
+ data,
2704
+ type
2705
+ }) {
2706
+ const [operation, setOperation] = useState23(data.operation);
2707
+ const [value, setValue] = useState23(data.value);
2708
+ const updateNodeData = useUpdateNodeData17();
2709
+ const incoming = useIncomingNodeData3(id);
2710
+ useEffect28(() => {
2711
+ if (incoming?.length > 1) {
2712
+ const result = getOperationResult(operation, incoming[0].value, incoming[1].value);
2713
+ setValue(result);
2714
+ updateNodeData(id, { value: result });
2715
+ }
2716
+ }, [operation, incoming]);
2717
+ const onChange = useCallback19((op) => {
2718
+ updateNodeData(id, { operation: op });
2719
+ setOperation(op);
2720
+ }, []);
2721
+ return /* @__PURE__ */ jsxs30(NodeContainer33, { id, selected, data, type, children: [
2722
+ /* @__PURE__ */ jsx36(NodeCombobox3, { options: options2, selected: operation, onChange }),
2723
+ /* @__PURE__ */ jsx36(node_value_input_default, { value, onChange: () => {
2724
+ }, disabled: true }),
2725
+ /* @__PURE__ */ jsx36(NodeTrackConnections28, { handles: data.handles, nodeId: id, type: "target" })
2726
+ ] });
2727
+ }
2728
+ function getOperationResult(operation, value1, value2) {
2729
+ switch (operation) {
2730
+ case "add" /* add */:
2731
+ return Number(value1) + Number(value2);
2732
+ case "divide" /* divide */:
2733
+ return Number(value1) / (Number(value2) || 1);
2734
+ case "max" /* max */:
2735
+ return Number(value1) > Number(value2) ? value1 : value2;
2736
+ case "min" /* min */:
2737
+ return Number(value1) < Number(value2) ? value1 : value2;
2738
+ case "multiply" /* multiply */:
2739
+ return Number(value1) * Number(value2);
2740
+ case "power" /* power */:
2741
+ return Number(value1) ** Number(value2);
2742
+ }
2743
+ }
2744
+ var variable_combine_node_default = VariableCombineNode;
2745
+
2746
+ // src/nodes/generators/variable-value-node.tsx
2747
+ import { NodeContainer as NodeContainer34, NodeTrackConnections as NodeTrackConnections29 } from "@awesome-flow/core/layout";
2748
+ import { useCallback as useCallback20, useState as useState24 } from "react";
2749
+ import { useUpdateNodeData as useUpdateNodeData18 } from "@awesome-flow/core/hooks";
2750
+ import { jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
2751
+ function VariableValueNode({ id, selected, data, type }) {
2752
+ const [value, setValue] = useState24(data.value || 0);
2753
+ const updateNodeData = useUpdateNodeData18();
2754
+ const onValueChange = useCallback20((newValue) => {
2755
+ updateNodeData(id, { value: newValue });
2756
+ setValue(newValue);
2757
+ }, []);
2758
+ return /* @__PURE__ */ jsxs31(NodeContainer34, { id, selected, data, type, children: [
2759
+ /* @__PURE__ */ jsx37(node_value_input_default, { value, onChange: onValueChange }),
2760
+ /* @__PURE__ */ jsx37(NodeTrackConnections29, { handles: data.handles, nodeId: id, type: "source" })
2761
+ ] });
2762
+ }
2763
+ var variable_value_node_default = VariableValueNode;
2764
+
2765
+ // src/nodes/groups/node-module-group.tsx
2766
+ import { NodeContainer as NodeContainer35, NodeCollapse } from "@awesome-flow/core/layout";
2767
+ import { NodeResizer, useStore, useUpdateNodeInternals } from "@xyflow/react";
2768
+ import { FlowContext } from "@awesome-flow/core/abstract";
2769
+ import { useCallback as useCallback21, useContext, useEffect as useEffect29, useMemo as useMemo14 } from "react";
2770
+ import { shallow } from "zustand/shallow";
2771
+ import { Badge as Badge2, Group as Group18 } from "@mantine/core";
2772
+ import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
2773
+ function ModuleGroupNode({
2774
+ id,
2775
+ selected,
2776
+ data,
2777
+ type,
2778
+ width,
2779
+ height
2780
+ }) {
2781
+ const context = useContext(FlowContext);
2782
+ const updateNodeInternals = useUpdateNodeInternals();
2783
+ const triggerNodeChanges = useStore((s) => s.triggerNodeChanges);
2784
+ const { groupNodes, setGroupCollapsed } = context.useFlowStore(
2785
+ useCallback21(
2786
+ (state) => ({ groupNodes: state.groups[id], setGroupCollapsed: state.setGroupCollapsed }),
2787
+ []
2788
+ )
2789
+ );
2790
+ const intersectingNode = context.useInteractivityStore(
2791
+ useCallback21((state) => state.nodeIntersectionTargets[id], [id]),
2792
+ shallow
2793
+ );
2794
+ useEffect29(() => {
2795
+ updateNodeInternals(id);
2796
+ }, [width, height]);
2797
+ useEffect29(() => {
2798
+ triggerNodeChanges([
2799
+ {
2800
+ id,
2801
+ type: "select",
2802
+ selected: !!intersectingNode
2803
+ }
2804
+ ]);
2805
+ }, [intersectingNode]);
2806
+ const onCollapsed = useCallback21((collapsed) => {
2807
+ setGroupCollapsed(id, collapsed);
2808
+ }, []);
2809
+ const size = useMemo14(() => {
2810
+ return {
2811
+ width: data.initialSize?.width || 100,
2812
+ height: data.initialSize?.height || 50
2813
+ };
2814
+ }, [data.initialSize]);
2815
+ return /* @__PURE__ */ jsx38(
2816
+ NodeContainer35,
2817
+ {
2818
+ id,
2819
+ selected,
2820
+ data,
2821
+ title: /* @__PURE__ */ jsx38(Group18, { justify: "space-between", children: /* @__PURE__ */ jsxs32(Group18, { gap: "xs", children: [
2822
+ /* @__PURE__ */ jsx38(Badge2, { size: "xs", variant: "outline", radius: "xs", color: "gray", children: groupNodes?.length || 0 }),
2823
+ /* @__PURE__ */ jsx38(NodeCollapse, { nodeId: id, isCollapsed: data.isCollapsed, onCollapsed })
2824
+ ] }) }),
2825
+ type,
2826
+ children: /* @__PURE__ */ jsx38(
2827
+ NodeResizer,
2828
+ {
2829
+ nodeId: id,
2830
+ minWidth: size.width,
2831
+ minHeight: size.height,
2832
+ isVisible: selected && !data.isCollapsed
2833
+ }
2834
+ )
2835
+ }
2836
+ );
2837
+ }
2838
+ var node_module_group_default = ModuleGroupNode;
2839
+
2840
+ // src/templates/generators/noise-checkerboard-template.ts
2841
+ import { IDGenerator } from "@awesome-flow/core/utils";
2842
+ import { Position } from "@xyflow/system";
2843
+ var NoiseCheckerboardNodeTemplateFactory = class {
2844
+ create() {
2845
+ return {
2846
+ id: IDGenerator.template(),
2847
+ type: "noise-checkerboard" /* noiseCheckerboard */,
2848
+ removable: false,
2849
+ data: {
2850
+ title: "Checkerboard Noise"
2851
+ },
2852
+ handles: [
2853
+ {
2854
+ position: Position.Right,
2855
+ dataType: 8 /* module */,
2856
+ connection: "source"
2857
+ }
2858
+ ]
2859
+ };
2860
+ }
2861
+ isHandleAllowed(type) {
2862
+ return type === "source";
2863
+ }
2864
+ getHandleAllowedDataType() {
2865
+ return 8 /* module */;
2866
+ }
2867
+ };
2868
+
2869
+ // src/templates/generators/noise-const-template.ts
2870
+ import { IDGenerator as IDGenerator2 } from "@awesome-flow/core/utils";
2871
+ import { Position as Position2 } from "@xyflow/system";
2872
+ var NoiseConstNodeTemplateFactory = class {
2873
+ create() {
2874
+ return {
2875
+ id: IDGenerator2.template(),
2876
+ type: "noise-constant" /* noiseConst */,
2877
+ removable: false,
2878
+ data: {
2879
+ title: "Const Value Noise",
2880
+ noise: 0,
2881
+ min: -1,
2882
+ max: 1
2883
+ },
2884
+ handles: [
2885
+ {
2886
+ position: Position2.Right,
2887
+ dataType: 8 /* module */,
2888
+ connection: "source"
2889
+ }
2890
+ ]
2891
+ };
2892
+ }
2893
+ isHandleAllowed(type) {
2894
+ return type === "source";
2895
+ }
2896
+ getHandleAllowedDataType(type) {
2897
+ return 8 /* module */;
2898
+ }
2899
+ };
2900
+
2901
+ // src/templates/generators/noise-cylinders-template.ts
2902
+ import { IDGenerator as IDGenerator3 } from "@awesome-flow/core/utils";
2903
+ import { Position as Position3 } from "@xyflow/system";
2904
+ var NoiseCylindersNodeTemplateFactory = class {
2905
+ create() {
2906
+ return {
2907
+ id: IDGenerator3.template(),
2908
+ type: "noise-cylinders" /* noiseCylinders */,
2909
+ removable: false,
2910
+ data: {
2911
+ title: "Cylinders Noise",
2912
+ frequency: 0.1
2913
+ },
2914
+ handles: [
2915
+ {
2916
+ position: Position3.Left,
2917
+ dataType: 16 /* variableProperty */,
2918
+ connection: "target"
2919
+ },
2920
+ {
2921
+ position: Position3.Right,
2922
+ dataType: 8 /* module */,
2923
+ connection: "source"
2924
+ }
2925
+ ]
2926
+ };
2927
+ }
2928
+ isHandleAllowed(type) {
2929
+ return type === "source";
2930
+ }
2931
+ getHandleAllowedDataType() {
2932
+ return 8 /* module */;
2933
+ }
2934
+ };
2935
+
2936
+ // src/templates/generators/noise-perlin-template.ts
2937
+ import { IDGenerator as IDGenerator4 } from "@awesome-flow/core/utils";
2938
+ import { Position as Position4 } from "@xyflow/system";
2939
+ var NoisePerlinNodeTemplateFactory = class {
2940
+ create() {
2941
+ return {
2942
+ id: IDGenerator4.template(),
2943
+ type: "noise-perlin" /* noisePerlin */,
2944
+ removable: false,
2945
+ data: {
2946
+ title: "Perlin Noise",
2947
+ frequency: 0.1,
2948
+ lacunarity: 2,
2949
+ octaves: 5,
2950
+ persistence: 0.5,
2951
+ seed: 0
2952
+ },
2953
+ handles: [
2954
+ {
2955
+ position: Position4.Left,
2956
+ dataType: 16 /* variableProperty */,
2957
+ connection: "target"
2958
+ },
2959
+ {
2960
+ position: Position4.Right,
2961
+ dataType: 8 /* module */,
2962
+ connection: "source"
2963
+ }
2964
+ ]
2965
+ };
2966
+ }
2967
+ isHandleAllowed(type) {
2968
+ return type === "source";
2969
+ }
2970
+ getHandleAllowedDataType() {
2971
+ return 8 /* module */;
2972
+ }
2973
+ };
2974
+
2975
+ // src/templates/generators/noise-ridgedmulti-template.ts
2976
+ import { IDGenerator as IDGenerator5 } from "@awesome-flow/core/utils";
2977
+ import { Position as Position5 } from "@xyflow/system";
2978
+ var NoiseRidgedMultiNodeTemplateFactory = class {
2979
+ create() {
2980
+ return {
2981
+ id: IDGenerator5.template(),
2982
+ type: "noise-ridged-multi" /* noiseRidgedMulti */,
2983
+ removable: false,
2984
+ data: {
2985
+ title: "Ridged Multi Noise",
2986
+ frequency: 0.1,
2987
+ lacunarity: 2,
2988
+ octaves: 6,
2989
+ offset: 1,
2990
+ gain: 2,
2991
+ seed: 0
2992
+ },
2993
+ handles: [
2994
+ {
2995
+ position: Position5.Left,
2996
+ dataType: 16 /* variableProperty */,
2997
+ connection: "target"
2998
+ },
2999
+ {
3000
+ position: Position5.Right,
3001
+ dataType: 8 /* module */,
3002
+ connection: "source"
3003
+ }
3004
+ ]
3005
+ };
3006
+ }
3007
+ isHandleAllowed(type) {
3008
+ return type === "source";
3009
+ }
3010
+ getHandleAllowedDataType() {
3011
+ return 8 /* module */;
3012
+ }
3013
+ };
3014
+
3015
+ // src/templates/generators/noise-simplex-template.ts
3016
+ import { IDGenerator as IDGenerator6 } from "@awesome-flow/core/utils";
3017
+ import { Position as Position6 } from "@xyflow/system";
3018
+ var NoiseSimplexNodeTemplateFactory = class {
3019
+ create() {
3020
+ return {
3021
+ id: IDGenerator6.template(),
3022
+ type: "noise-simplex" /* noiseSimplex */,
3023
+ removable: false,
3024
+ data: {
3025
+ title: "Simplex Noise"
3026
+ },
3027
+ handles: [
3028
+ {
3029
+ position: Position6.Left,
3030
+ dataType: 16 /* variableProperty */,
3031
+ connection: "target"
3032
+ },
3033
+ {
3034
+ position: Position6.Right,
3035
+ dataType: 8 /* module */,
3036
+ connection: "source"
3037
+ }
3038
+ ]
3039
+ };
3040
+ }
3041
+ isHandleAllowed(type) {
3042
+ return type === "source";
3043
+ }
3044
+ getHandleAllowedDataType() {
3045
+ return 8 /* module */;
3046
+ }
3047
+ };
3048
+
3049
+ // src/templates/generators/noise-spheres-template.ts
3050
+ import { IDGenerator as IDGenerator7 } from "@awesome-flow/core/utils";
3051
+ import { Position as Position7 } from "@xyflow/system";
3052
+ var NoiseSpheresNodeTemplateFactory = class {
3053
+ create() {
3054
+ return {
3055
+ id: IDGenerator7.template(),
3056
+ type: "noise-spheres" /* noiseSpheres */,
3057
+ removable: false,
3058
+ data: {
3059
+ title: "Spheres Noise",
3060
+ frequency: 0.1
3061
+ },
3062
+ handles: [
3063
+ {
3064
+ position: Position7.Left,
3065
+ dataType: 16 /* variableProperty */,
3066
+ connection: "target"
3067
+ },
3068
+ {
3069
+ position: Position7.Right,
3070
+ dataType: 8 /* module */,
3071
+ connection: "source"
3072
+ }
3073
+ ]
3074
+ };
3075
+ }
3076
+ isHandleAllowed(type) {
3077
+ return type === "source";
3078
+ }
3079
+ getHandleAllowedDataType() {
3080
+ return 8 /* module */;
3081
+ }
3082
+ };
3083
+
3084
+ // src/templates/generators/noise-voronoi-template.ts
3085
+ import { IDGenerator as IDGenerator8 } from "@awesome-flow/core/utils";
3086
+ import { Position as Position8 } from "@xyflow/system";
3087
+ var NoiseVoronoiNodeTemplateFactory = class {
3088
+ create() {
3089
+ return {
3090
+ id: IDGenerator8.template(),
3091
+ type: "noise-voronoi" /* noiseVoronoi */,
3092
+ removable: false,
3093
+ data: {
3094
+ title: "Voronoi Noise",
3095
+ frequency: 0.1,
3096
+ displacement: 1,
3097
+ distance: true,
3098
+ seed: 0
3099
+ },
3100
+ handles: [
3101
+ {
3102
+ position: Position8.Left,
3103
+ dataType: 16 /* variableProperty */,
3104
+ connection: "target"
3105
+ },
3106
+ {
3107
+ position: Position8.Right,
3108
+ dataType: 8 /* module */,
3109
+ connection: "source"
3110
+ }
3111
+ ]
3112
+ };
3113
+ }
3114
+ isHandleAllowed(type) {
3115
+ return type === "source";
3116
+ }
3117
+ getHandleAllowedDataType() {
3118
+ return 8 /* module */;
3119
+ }
3120
+ };
3121
+
3122
+ // src/templates/generators/position-const-template.ts
3123
+ import { IDGenerator as IDGenerator9 } from "@awesome-flow/core/utils";
3124
+ import { Position as Position9 } from "@xyflow/system";
3125
+ var PositionConstNodeTemplateFactory = class {
3126
+ create() {
3127
+ return {
3128
+ id: IDGenerator9.template(),
3129
+ type: "position" /* position */,
3130
+ removable: false,
3131
+ data: {
3132
+ title: "Position Output",
3133
+ position: { x: 0, y: 0, z: 0 }
3134
+ },
3135
+ handles: [
3136
+ {
3137
+ position: Position9.Right,
3138
+ dataType: 4 /* position */,
3139
+ connection: "source"
3140
+ }
3141
+ ]
3142
+ };
3143
+ }
3144
+ isHandleAllowed(type) {
3145
+ return type === "source";
3146
+ }
3147
+ getHandleAllowedDataType(type) {
3148
+ return 4 /* position */;
3149
+ }
3150
+ };
3151
+
3152
+ // src/templates/generators/position-grid-template.ts
3153
+ import { IDGenerator as IDGenerator10 } from "@awesome-flow/core/utils";
3154
+ import { Position as Position10 } from "@xyflow/system";
3155
+ var PositionGridNodeTemplateFactory = class {
3156
+ create() {
3157
+ return {
3158
+ id: IDGenerator10.template(),
3159
+ type: "grid" /* grid */,
3160
+ removable: false,
3161
+ data: {
3162
+ title: "Grid Output",
3163
+ center: { x: 0, y: 0, z: 0 },
3164
+ radius: 1
3165
+ },
3166
+ handles: [
3167
+ {
3168
+ position: Position10.Right,
3169
+ dataType: 4 /* position */,
3170
+ connection: "source"
3171
+ }
3172
+ ]
3173
+ };
3174
+ }
3175
+ isHandleAllowed(type) {
3176
+ return type === "source";
3177
+ }
3178
+ getHandleAllowedDataType(type) {
3179
+ return 4 /* position */;
3180
+ }
3181
+ };
3182
+
3183
+ // src/templates/modifiers/noise-normalize-template.ts
3184
+ import { IDGenerator as IDGenerator11 } from "@awesome-flow/core/utils";
3185
+ import { Position as Position11 } from "@xyflow/system";
3186
+ var NoiseNormalizeNodeTemplateFactory = class {
3187
+ create() {
3188
+ return {
3189
+ id: IDGenerator11.template(),
3190
+ type: "noise-normalize" /* noiseNormalize */,
3191
+ data: {
3192
+ title: "Normalize Noise",
3193
+ intervalStart: -1,
3194
+ intervalEnd: 1
3195
+ },
3196
+ handles: [
3197
+ {
3198
+ position: Position11.Left,
3199
+ dataType: 8 /* module */,
3200
+ connection: "target",
3201
+ maxConnections: 1
3202
+ },
3203
+ {
3204
+ position: Position11.Right,
3205
+ dataType: 8 /* module */,
3206
+ connection: "source"
3207
+ }
3208
+ ]
3209
+ };
3210
+ }
3211
+ isHandleAllowed() {
3212
+ return true;
3213
+ }
3214
+ getHandleAllowedDataType(type) {
3215
+ return 8 /* module */;
3216
+ }
3217
+ };
3218
+
3219
+ // src/templates/output/noise-logger-template.ts
3220
+ import { IDGenerator as IDGenerator12 } from "@awesome-flow/core/utils";
3221
+ import { Position as Position12 } from "@xyflow/system";
3222
+ var NoiseLoggerNodeTemplateFactory = class {
3223
+ create() {
3224
+ return {
3225
+ id: IDGenerator12.template(),
3226
+ type: "noise-logger" /* noiseLogger */,
3227
+ removable: false,
3228
+ data: {
3229
+ title: "Noise Logger"
3230
+ },
3231
+ handles: [
3232
+ {
3233
+ position: Position12.Left,
3234
+ dataType: 2 /* noise */,
3235
+ connection: "target"
3236
+ }
3237
+ ]
3238
+ };
3239
+ }
3240
+ isHandleAllowed(type) {
3241
+ return type === "target";
3242
+ }
3243
+ getHandleAllowedDataType(type) {
3244
+ return 2 /* noise */;
3245
+ }
3246
+ };
3247
+
3248
+ // src/templates/output/noise-raw-texture-template.ts
3249
+ import { IDGenerator as IDGenerator13 } from "@awesome-flow/core/utils";
3250
+ import { Position as Position13 } from "@xyflow/system";
3251
+ var NoiseRawTextureTemplateFactory = class {
3252
+ create() {
3253
+ return {
3254
+ id: IDGenerator13.template(),
3255
+ type: "texture-data" /* textureData */,
3256
+ removable: false,
3257
+ data: {
3258
+ title: "Texture Data"
3259
+ },
3260
+ handles: [
3261
+ {
3262
+ position: Position13.Left,
3263
+ dataType: 2 /* noise */,
3264
+ connection: "target",
3265
+ maxConnections: 1
3266
+ },
3267
+ {
3268
+ position: Position13.Right,
3269
+ dataType: 1 /* texture */,
3270
+ connection: "source"
3271
+ }
3272
+ ]
3273
+ };
3274
+ }
3275
+ isHandleAllowed() {
3276
+ return true;
3277
+ }
3278
+ getHandleAllowedDataType(type) {
3279
+ switch (type) {
3280
+ case "source":
3281
+ return 1 /* texture */;
3282
+ case "target":
3283
+ return 2 /* noise */;
3284
+ }
3285
+ }
3286
+ };
3287
+
3288
+ // src/templates/output/position-logger-template.ts
3289
+ import { IDGenerator as IDGenerator14 } from "@awesome-flow/core/utils";
3290
+ import { Position as Position14 } from "@xyflow/system";
3291
+ var PositionLoggerNodeTemplateFactory = class {
3292
+ create() {
3293
+ return {
3294
+ id: IDGenerator14.template(),
3295
+ type: "position-logger" /* positionLogger */,
3296
+ removable: false,
3297
+ data: {
3298
+ title: "Position Logger"
3299
+ },
3300
+ handles: [
3301
+ {
3302
+ position: Position14.Left,
3303
+ dataType: 4 /* position */,
3304
+ connection: "target"
3305
+ }
3306
+ ]
3307
+ };
3308
+ }
3309
+ isHandleAllowed(type) {
3310
+ return type === "target";
3311
+ }
3312
+ getHandleAllowedDataType(type) {
3313
+ return 4 /* position */;
3314
+ }
3315
+ };
3316
+
3317
+ // src/templates/modifiers/noise-combine-template.ts
3318
+ import { IDGenerator as IDGenerator15 } from "@awesome-flow/core/utils";
3319
+ import { Position as Position15 } from "@xyflow/system";
3320
+ var NoiseCombineNodeTemplateFactory = class {
3321
+ create() {
3322
+ return {
3323
+ id: IDGenerator15.template(),
3324
+ type: "noise-combiner" /* noiseCombine */,
3325
+ removable: false,
3326
+ data: {
3327
+ title: "Combine Noise",
3328
+ operation: "add" /* add */
3329
+ },
3330
+ handles: [
3331
+ {
3332
+ position: Position15.Left,
3333
+ dataType: 8 /* module */,
3334
+ connection: "target",
3335
+ maxConnections: 2
3336
+ },
3337
+ {
3338
+ position: Position15.Right,
3339
+ dataType: 8 /* module */,
3340
+ connection: "source"
3341
+ }
3342
+ ]
3343
+ };
3344
+ }
3345
+ isHandleAllowed() {
3346
+ return true;
3347
+ }
3348
+ getHandleAllowedDataType(type) {
3349
+ return 8 /* module */;
3350
+ }
3351
+ };
3352
+
3353
+ // src/templates/modifiers/noise-clamp-template.ts
3354
+ import { IDGenerator as IDGenerator16 } from "@awesome-flow/core/utils";
3355
+ import { Position as Position16 } from "@xyflow/system";
3356
+ var NoiseClampNodeTemplateFactory = class {
3357
+ create() {
3358
+ return {
3359
+ id: IDGenerator16.template(),
3360
+ type: "noise-clamp" /* noiseClamp */,
3361
+ removable: false,
3362
+ data: {
3363
+ title: "Clamp Noise",
3364
+ lowerBound: -1,
3365
+ upperBound: 1
3366
+ },
3367
+ handles: [
3368
+ {
3369
+ position: Position16.Left,
3370
+ dataType: 8 /* module */,
3371
+ connection: "target",
3372
+ maxConnections: 1
3373
+ },
3374
+ {
3375
+ position: Position16.Right,
3376
+ dataType: 8 /* module */,
3377
+ connection: "source"
3378
+ }
3379
+ ]
3380
+ };
3381
+ }
3382
+ isHandleAllowed() {
3383
+ return true;
3384
+ }
3385
+ getHandleAllowedDataType(type) {
3386
+ return 8 /* module */;
3387
+ }
3388
+ };
3389
+
3390
+ // src/templates/modifiers/noise-abs-template.ts
3391
+ import { IDGenerator as IDGenerator17 } from "@awesome-flow/core/utils";
3392
+ import { Position as Position17 } from "@xyflow/system";
3393
+ var NoiseAbsNodeTemplateFactory = class {
3394
+ create() {
3395
+ return {
3396
+ id: IDGenerator17.template(),
3397
+ type: "noise-abs" /* noiseAbs */,
3398
+ removable: false,
3399
+ data: {
3400
+ title: "Abs Noise"
3401
+ },
3402
+ handles: [
3403
+ {
3404
+ position: Position17.Left,
3405
+ dataType: 8 /* module */,
3406
+ connection: "target",
3407
+ maxConnections: 1
3408
+ },
3409
+ {
3410
+ position: Position17.Right,
3411
+ dataType: 8 /* module */,
3412
+ connection: "source"
3413
+ }
3414
+ ]
3415
+ };
3416
+ }
3417
+ isHandleAllowed() {
3418
+ return true;
3419
+ }
3420
+ getHandleAllowedDataType(type) {
3421
+ return 8 /* module */;
3422
+ }
3423
+ };
3424
+
3425
+ // src/templates/output/noise-output-template.ts
3426
+ import { IDGenerator as IDGenerator18 } from "@awesome-flow/core/utils";
3427
+ import { Position as Position18 } from "@xyflow/system";
3428
+ var NoiseOutputNodeTemplateFactory = class {
3429
+ create() {
3430
+ return {
3431
+ id: IDGenerator18.template(),
3432
+ type: "noise-output" /* noiseOutput */,
3433
+ removable: false,
3434
+ data: {
3435
+ title: "Noise Output"
3436
+ },
3437
+ handles: [
3438
+ {
3439
+ position: Position18.Left,
3440
+ dataType: 4 /* position */,
3441
+ connection: "target"
3442
+ },
3443
+ {
3444
+ position: Position18.Left,
3445
+ dataType: 8 /* module */,
3446
+ connection: "target",
3447
+ maxConnections: 1
3448
+ },
3449
+ {
3450
+ position: Position18.Right,
3451
+ dataType: 2 /* noise */,
3452
+ connection: "source"
3453
+ }
3454
+ ]
3455
+ };
3456
+ }
3457
+ isHandleAllowed() {
3458
+ return true;
3459
+ }
3460
+ getHandleAllowedDataType(type) {
3461
+ switch (type) {
3462
+ case "source":
3463
+ return 2 /* noise */;
3464
+ case "target":
3465
+ return 8 /* module */ & 4 /* position */;
3466
+ }
3467
+ }
3468
+ };
3469
+
3470
+ // src/templates/modifiers/noise-curve-template.ts
3471
+ import { IDGenerator as IDGenerator19 } from "@awesome-flow/core/utils";
3472
+ import { Position as Position19 } from "@xyflow/system";
3473
+ var NoiseCurveNodeTemplateFactory = class {
3474
+ create() {
3475
+ return {
3476
+ id: IDGenerator19.template(),
3477
+ type: "noise-curve" /* noiseCurve */,
3478
+ removable: false,
3479
+ data: {
3480
+ title: "Noise Curve",
3481
+ points: []
3482
+ },
3483
+ handles: [
3484
+ {
3485
+ position: Position19.Left,
3486
+ dataType: 8 /* module */,
3487
+ connection: "target",
3488
+ maxConnections: 1
3489
+ },
3490
+ {
3491
+ position: Position19.Right,
3492
+ dataType: 8 /* module */,
3493
+ connection: "source"
3494
+ }
3495
+ ]
3496
+ };
3497
+ }
3498
+ isHandleAllowed() {
3499
+ return true;
3500
+ }
3501
+ getHandleAllowedDataType(type) {
3502
+ return 8 /* module */;
3503
+ }
3504
+ };
3505
+
3506
+ // src/templates/modifiers/noise-exponent-template.ts
3507
+ import { IDGenerator as IDGenerator20 } from "@awesome-flow/core/utils";
3508
+ import { Position as Position20 } from "@xyflow/system";
3509
+ var NoiseExponentNodeTemplateFactory = class {
3510
+ create() {
3511
+ return {
3512
+ id: IDGenerator20.template(),
3513
+ type: "noise-exponent" /* noiseExponent */,
3514
+ removable: false,
3515
+ data: {
3516
+ title: "Noise Exponent",
3517
+ exponent: 1
3518
+ },
3519
+ handles: [
3520
+ {
3521
+ position: Position20.Left,
3522
+ dataType: 8 /* module */,
3523
+ connection: "target",
3524
+ maxConnections: 1
3525
+ },
3526
+ {
3527
+ position: Position20.Right,
3528
+ dataType: 8 /* module */,
3529
+ connection: "source"
3530
+ }
3531
+ ]
3532
+ };
3533
+ }
3534
+ isHandleAllowed() {
3535
+ return true;
3536
+ }
3537
+ getHandleAllowedDataType(type) {
3538
+ return 8 /* module */;
3539
+ }
3540
+ };
3541
+
3542
+ // src/templates/modifiers/noise-invert-template.ts
3543
+ import { IDGenerator as IDGenerator21 } from "@awesome-flow/core/utils";
3544
+ import { Position as Position21 } from "@xyflow/system";
3545
+ var NoiseInvertNodeTemplateFactory = class {
3546
+ create() {
3547
+ return {
3548
+ id: IDGenerator21.template(),
3549
+ type: "noise-invert" /* noiseInvert */,
3550
+ removable: false,
3551
+ data: {
3552
+ title: "Invert Noise"
3553
+ },
3554
+ handles: [
3555
+ {
3556
+ position: Position21.Left,
3557
+ dataType: 8 /* module */,
3558
+ connection: "target",
3559
+ maxConnections: 1
3560
+ },
3561
+ {
3562
+ position: Position21.Right,
3563
+ dataType: 8 /* module */,
3564
+ connection: "source"
3565
+ }
3566
+ ]
3567
+ };
3568
+ }
3569
+ isHandleAllowed() {
3570
+ return true;
3571
+ }
3572
+ getHandleAllowedDataType(type) {
3573
+ return 8 /* module */;
3574
+ }
3575
+ };
3576
+
3577
+ // src/templates/modifiers/noise-scalebias-template.ts
3578
+ import { IDGenerator as IDGenerator22 } from "@awesome-flow/core/utils";
3579
+ import { Position as Position22 } from "@xyflow/system";
3580
+ var NoiseScaleBiasNodeTemplateFactory = class {
3581
+ create() {
3582
+ return {
3583
+ id: IDGenerator22.template(),
3584
+ type: "noise-scale-bias" /* noiseScaleBias */,
3585
+ removable: false,
3586
+ data: {
3587
+ title: "Scale/Bias Noise",
3588
+ scale: 1,
3589
+ bias: 0
3590
+ },
3591
+ handles: [
3592
+ {
3593
+ position: Position22.Left,
3594
+ dataType: 8 /* module */,
3595
+ connection: "target",
3596
+ maxConnections: 1
3597
+ },
3598
+ {
3599
+ position: Position22.Right,
3600
+ dataType: 8 /* module */,
3601
+ connection: "source"
3602
+ }
3603
+ ]
3604
+ };
3605
+ }
3606
+ isHandleAllowed() {
3607
+ return true;
3608
+ }
3609
+ getHandleAllowedDataType(type) {
3610
+ return 8 /* module */;
3611
+ }
3612
+ };
3613
+
3614
+ // src/templates/modifiers/noise-terrace-template.ts
3615
+ import { IDGenerator as IDGenerator23 } from "@awesome-flow/core/utils";
3616
+ import { Position as Position23 } from "@xyflow/system";
3617
+ var NoiseTerraceNodeTemplateFactory = class {
3618
+ create() {
3619
+ return {
3620
+ id: IDGenerator23.template(),
3621
+ type: "noise-terrace" /* noiseTerrace */,
3622
+ removable: false,
3623
+ data: {
3624
+ title: "Noise Terrace",
3625
+ points: []
3626
+ },
3627
+ handles: [
3628
+ {
3629
+ position: Position23.Left,
3630
+ dataType: 8 /* module */,
3631
+ connection: "target",
3632
+ maxConnections: 1
3633
+ },
3634
+ {
3635
+ position: Position23.Right,
3636
+ dataType: 8 /* module */,
3637
+ connection: "source"
3638
+ }
3639
+ ]
3640
+ };
3641
+ }
3642
+ isHandleAllowed() {
3643
+ return true;
3644
+ }
3645
+ getHandleAllowedDataType(type) {
3646
+ return 8 /* module */;
3647
+ }
3648
+ };
3649
+
3650
+ // src/templates/selectors/noise-blend-template.ts
3651
+ import { IDGenerator as IDGenerator24 } from "@awesome-flow/core/utils";
3652
+ import { Position as Position24 } from "@xyflow/system";
3653
+ var NoiseBlendNodeTemplateFactory = class {
3654
+ create() {
3655
+ return {
3656
+ id: IDGenerator24.template(),
3657
+ type: "noise-blend" /* noiseBlend */,
3658
+ removable: false,
3659
+ data: {
3660
+ title: "Noise Blend"
3661
+ },
3662
+ handles: [
3663
+ {
3664
+ position: Position24.Left,
3665
+ dataType: 8 /* module */,
3666
+ connection: "target",
3667
+ label: "Source Modules",
3668
+ maxConnections: 2
3669
+ },
3670
+ {
3671
+ position: Position24.Left,
3672
+ dataType: 8 /* module */,
3673
+ connection: "target",
3674
+ label: "Control Module",
3675
+ maxConnections: 1
3676
+ },
3677
+ {
3678
+ position: Position24.Right,
3679
+ dataType: 8 /* module */,
3680
+ connection: "source"
3681
+ }
3682
+ ]
3683
+ };
3684
+ }
3685
+ isHandleAllowed() {
3686
+ return true;
3687
+ }
3688
+ getHandleAllowedDataType() {
3689
+ return 8 /* module */;
3690
+ }
3691
+ };
3692
+
3693
+ // src/templates/selectors/noise-select-template.ts
3694
+ import { IDGenerator as IDGenerator25 } from "@awesome-flow/core/utils";
3695
+ import { Position as Position25 } from "@xyflow/system";
3696
+ var NoiseSelectNodeTemplateFactory = class {
3697
+ create() {
3698
+ return {
3699
+ id: IDGenerator25.template(),
3700
+ type: "noise-select" /* noiseSelect */,
3701
+ removable: false,
3702
+ data: {
3703
+ title: "Noise Select",
3704
+ edgeFalloff: 0,
3705
+ lowerBound: -1,
3706
+ upperBound: 1
3707
+ },
3708
+ handles: [
3709
+ {
3710
+ position: Position25.Left,
3711
+ dataType: 8 /* module */,
3712
+ connection: "target",
3713
+ label: "Source Modules",
3714
+ maxConnections: 2
3715
+ },
3716
+ {
3717
+ position: Position25.Left,
3718
+ dataType: 8 /* module */,
3719
+ connection: "target",
3720
+ label: "Control Module",
3721
+ maxConnections: 1
3722
+ },
3723
+ {
3724
+ position: Position25.Right,
3725
+ dataType: 8 /* module */,
3726
+ connection: "source"
3727
+ }
3728
+ ]
3729
+ };
3730
+ }
3731
+ isHandleAllowed() {
3732
+ return true;
3733
+ }
3734
+ getHandleAllowedDataType() {
3735
+ return 8 /* module */;
3736
+ }
3737
+ };
3738
+
3739
+ // src/templates/transformers/noise-displace-template.ts
3740
+ import { IDGenerator as IDGenerator26 } from "@awesome-flow/core/utils";
3741
+ import { Position as Position26 } from "@xyflow/system";
3742
+ var NoiseDisplaceNodeTemplateFactory = class {
3743
+ create() {
3744
+ return {
3745
+ id: IDGenerator26.template(),
3746
+ type: "noise-displace" /* noiseDisplace */,
3747
+ data: {
3748
+ title: "Noise Displace"
3749
+ },
3750
+ handles: [
3751
+ {
3752
+ position: Position26.Left,
3753
+ connection: "target",
3754
+ label: "Source Module",
3755
+ dataType: 8 /* module */,
3756
+ dataId: "source" /* sourceModule */,
3757
+ maxConnections: 1
3758
+ },
3759
+ {
3760
+ position: Position26.Left,
3761
+ connection: "target",
3762
+ label: "X Module",
3763
+ dataType: 8 /* module */,
3764
+ dataId: "x-module" /* xModule */,
3765
+ maxConnections: 1
3766
+ },
3767
+ {
3768
+ position: Position26.Left,
3769
+ connection: "target",
3770
+ label: "Y Module",
3771
+ dataType: 8 /* module */,
3772
+ dataId: "y-module" /* yModule */,
3773
+ maxConnections: 1
3774
+ },
3775
+ {
3776
+ position: Position26.Left,
3777
+ connection: "target",
3778
+ label: "Z Module",
3779
+ dataType: 8 /* module */,
3780
+ dataId: "z-module" /* zModule */,
3781
+ maxConnections: 1
3782
+ },
3783
+ {
3784
+ position: Position26.Right,
3785
+ dataType: 8 /* module */,
3786
+ dataId: "output" /* output */,
3787
+ connection: "source"
3788
+ }
3789
+ ]
3790
+ };
3791
+ }
3792
+ isHandleAllowed() {
3793
+ return true;
3794
+ }
3795
+ getHandleAllowedDataType() {
3796
+ return 8 /* module */;
3797
+ }
3798
+ };
3799
+
3800
+ // src/templates/transformers/noise-rotate-point-template.ts
3801
+ import { IDGenerator as IDGenerator27 } from "@awesome-flow/core/utils";
3802
+ import { Position as Position27 } from "@xyflow/system";
3803
+ var NoiseRotatePointNodeTemplateFactory = class {
3804
+ create() {
3805
+ return {
3806
+ id: IDGenerator27.template(),
3807
+ type: "noise-rotate-point" /* noiseRotatePoint */,
3808
+ removable: false,
3809
+ data: {
3810
+ title: "Noise Rotate Point",
3811
+ xAngle: 0,
3812
+ yAngle: 0,
3813
+ zAngle: 0
3814
+ },
3815
+ handles: [
3816
+ {
3817
+ position: Position27.Left,
3818
+ dataType: 8 /* module */,
3819
+ connection: "target",
3820
+ label: "Source Module",
3821
+ maxConnections: 1
3822
+ },
3823
+ {
3824
+ position: Position27.Right,
3825
+ dataType: 8 /* module */,
3826
+ connection: "source"
3827
+ }
3828
+ ]
3829
+ };
3830
+ }
3831
+ isHandleAllowed() {
3832
+ return true;
3833
+ }
3834
+ getHandleAllowedDataType() {
3835
+ return 8 /* module */;
3836
+ }
3837
+ };
3838
+
3839
+ // src/templates/transformers/noise-scale-point-template.ts
3840
+ import { IDGenerator as IDGenerator28 } from "@awesome-flow/core/utils";
3841
+ import { Position as Position28 } from "@xyflow/system";
3842
+ var NoiseScalePointNodeTemplateFactory = class {
3843
+ create() {
3844
+ return {
3845
+ id: IDGenerator28.template(),
3846
+ type: "noise-scale-point" /* noiseScalePoint */,
3847
+ data: {
3848
+ title: "Noise Scale Point",
3849
+ xScale: 1,
3850
+ yScale: 1,
3851
+ zScale: 1
3852
+ },
3853
+ handles: [
3854
+ {
3855
+ position: Position28.Left,
3856
+ dataType: 8 /* module */,
3857
+ connection: "target",
3858
+ label: "Source Module",
3859
+ maxConnections: 1
3860
+ },
3861
+ {
3862
+ position: Position28.Right,
3863
+ dataType: 8 /* module */,
3864
+ connection: "source"
3865
+ }
3866
+ ]
3867
+ };
3868
+ }
3869
+ isHandleAllowed() {
3870
+ return true;
3871
+ }
3872
+ getHandleAllowedDataType() {
3873
+ return 8 /* module */;
3874
+ }
3875
+ };
3876
+
3877
+ // src/templates/transformers/noise-translate-point-template.ts
3878
+ import { IDGenerator as IDGenerator29 } from "@awesome-flow/core/utils";
3879
+ import { Position as Position29 } from "@xyflow/system";
3880
+ var NoiseTranslatePointNodeTemplateFactory = class {
3881
+ create() {
3882
+ return {
3883
+ id: IDGenerator29.template(),
3884
+ type: "noise-translate-point" /* noiseTranslatePoint */,
3885
+ data: {
3886
+ title: "Noise Translate Point",
3887
+ translateX: 0,
3888
+ translateY: 0,
3889
+ translateZ: 0
3890
+ },
3891
+ handles: [
3892
+ {
3893
+ position: Position29.Left,
3894
+ dataType: 8 /* module */,
3895
+ connection: "target",
3896
+ label: "Source Module",
3897
+ maxConnections: 1
3898
+ },
3899
+ {
3900
+ position: Position29.Right,
3901
+ dataType: 8 /* module */,
3902
+ connection: "source"
3903
+ }
3904
+ ]
3905
+ };
3906
+ }
3907
+ isHandleAllowed() {
3908
+ return true;
3909
+ }
3910
+ getHandleAllowedDataType() {
3911
+ return 8 /* module */;
3912
+ }
3913
+ };
3914
+
3915
+ // src/templates/transformers/noise-turbulence-template.ts
3916
+ import { IDGenerator as IDGenerator30 } from "@awesome-flow/core/utils";
3917
+ import { Position as Position30 } from "@xyflow/system";
3918
+ var NoiseTurbulenceNodeTemplateFactory = class {
3919
+ create() {
3920
+ return {
3921
+ id: IDGenerator30.template(),
3922
+ type: "noise-turbulence" /* noiseTurbulence */,
3923
+ data: {
3924
+ title: "Noise Turbulence",
3925
+ frequency: 1,
3926
+ power: 1,
3927
+ roughness: 1,
3928
+ seed: 0
3929
+ },
3930
+ handles: [
3931
+ {
3932
+ position: Position30.Left,
3933
+ dataType: 8 /* module */,
3934
+ connection: "target",
3935
+ label: "Source Module",
3936
+ maxConnections: 1
3937
+ },
3938
+ {
3939
+ position: Position30.Left,
3940
+ dataType: 16 /* variableProperty */,
3941
+ label: "Variable Properties",
3942
+ connection: "target"
3943
+ },
3944
+ {
3945
+ position: Position30.Right,
3946
+ dataType: 8 /* module */,
3947
+ connection: "source"
3948
+ }
3949
+ ]
3950
+ };
3951
+ }
3952
+ isHandleAllowed() {
3953
+ return true;
3954
+ }
3955
+ getHandleAllowedDataType() {
3956
+ return 8 /* module */;
3957
+ }
3958
+ };
3959
+
3960
+ // src/templates/generators/variable-property-template.ts
3961
+ import { IDGenerator as IDGenerator31 } from "@awesome-flow/core/utils";
3962
+ import { Position as Position31 } from "@xyflow/system";
3963
+ var VariablePropertyNodeTemplateFactory = class {
3964
+ create() {
3965
+ return {
3966
+ id: IDGenerator31.template(),
3967
+ type: "variable-property" /* variableProperty */,
3968
+ data: {
3969
+ title: "Variable Property",
3970
+ property: null
3971
+ },
3972
+ handles: [
3973
+ {
3974
+ position: Position31.Left,
3975
+ dataType: 32 /* variableValue */,
3976
+ connection: "target",
3977
+ maxConnections: 1
3978
+ },
3979
+ {
3980
+ position: Position31.Right,
3981
+ dataType: 16 /* variableProperty */,
3982
+ connection: "source"
3983
+ }
3984
+ ]
3985
+ };
3986
+ }
3987
+ isHandleAllowed(type) {
3988
+ return true;
3989
+ }
3990
+ getHandleAllowedDataType(type) {
3991
+ switch (type) {
3992
+ case "source":
3993
+ return 16 /* variableProperty */;
3994
+ case "target":
3995
+ return 32 /* variableValue */;
3996
+ }
3997
+ }
3998
+ };
3999
+
4000
+ // src/templates/modifiers/variable-combine-template.ts
4001
+ import { IDGenerator as IDGenerator32 } from "@awesome-flow/core/utils";
4002
+ import { Position as Position32 } from "@xyflow/system";
4003
+ var VariableCombineNodeTemplateFactory = class {
4004
+ create() {
4005
+ return {
4006
+ id: IDGenerator32.template(),
4007
+ type: "variable-combine" /* variableCombine */,
4008
+ removable: false,
4009
+ data: {
4010
+ title: "Combine Values",
4011
+ operation: "add" /* add */,
4012
+ value: null
4013
+ },
4014
+ handles: [
4015
+ {
4016
+ position: Position32.Left,
4017
+ dataType: 32 /* variableValue */,
4018
+ connection: "target"
4019
+ },
4020
+ {
4021
+ position: Position32.Right,
4022
+ dataType: 32 /* variableValue */,
4023
+ connection: "source"
4024
+ }
4025
+ ]
4026
+ };
4027
+ }
4028
+ isHandleAllowed() {
4029
+ return true;
4030
+ }
4031
+ getHandleAllowedDataType(type) {
4032
+ return 8 /* module */;
4033
+ }
4034
+ };
4035
+
4036
+ // src/templates/generators/variable-value-template.ts
4037
+ import { IDGenerator as IDGenerator33 } from "@awesome-flow/core/utils";
4038
+ import { Position as Position33 } from "@xyflow/system";
4039
+ var VariableValueNodeTemplateFactory = class {
4040
+ create() {
4041
+ return {
4042
+ id: IDGenerator33.template(),
4043
+ type: "variable-value" /* variableValue */,
4044
+ data: {
4045
+ title: "Variable Value",
4046
+ value: null
4047
+ },
4048
+ handles: [
4049
+ {
4050
+ position: Position33.Right,
4051
+ dataType: 32 /* variableValue */,
4052
+ connection: "source"
4053
+ }
4054
+ ]
4055
+ };
4056
+ }
4057
+ isHandleAllowed(type) {
4058
+ return type === "source";
4059
+ }
4060
+ getHandleAllowedDataType(type) {
4061
+ return 32 /* variableValue */;
4062
+ }
4063
+ };
4064
+
4065
+ // src/templates/groups/module-group-template.ts
4066
+ import { IDGenerator as IDGenerator34 } from "@awesome-flow/core/utils";
4067
+ import { Position as Position34 } from "@xyflow/system";
4068
+ var ModuleGroupNodeTemplateFactory = class {
4069
+ create() {
4070
+ return {
4071
+ id: IDGenerator34.template(),
4072
+ type: "group-module" /* groupModule */,
4073
+ data: {
4074
+ title: "Modules Group",
4075
+ isGroup: true,
4076
+ initialSize: {
4077
+ width: 300,
4078
+ height: 200
4079
+ },
4080
+ collapsedSize: {
4081
+ width: 300,
4082
+ height: 80
4083
+ }
4084
+ },
4085
+ handles: [
4086
+ {
4087
+ position: Position34.Bottom,
4088
+ dataType: 8 /* module */,
4089
+ connection: "target",
4090
+ maxConnections: 1,
4091
+ hideOnCollapse: true
4092
+ },
4093
+ {
4094
+ position: Position34.Right,
4095
+ dataType: 8 /* module */,
4096
+ connection: "source"
4097
+ }
4098
+ ]
4099
+ };
4100
+ }
4101
+ isHandleAllowed(type) {
4102
+ return true;
4103
+ }
4104
+ getHandleAllowedDataType(type) {
4105
+ return 8 /* module */;
4106
+ }
4107
+ };
4108
+
4109
+ // src/templates/generators/noise-billow-template.ts
4110
+ import { IDGenerator as IDGenerator35 } from "@awesome-flow/core/utils";
4111
+ import { Position as Position35 } from "@xyflow/system";
4112
+ var NoiseBillowNodeTemplateFactory = class {
4113
+ create() {
4114
+ return {
4115
+ id: IDGenerator35.template(),
4116
+ type: "noise-billow" /* noiseBillow */,
4117
+ removable: false,
4118
+ data: {
4119
+ title: "Billow Noise",
4120
+ frequency: 0.1,
4121
+ lacunarity: 2,
4122
+ octaves: 5,
4123
+ persistence: 0.5,
4124
+ seed: 0
4125
+ },
4126
+ handles: [
4127
+ {
4128
+ position: Position35.Left,
4129
+ dataType: 16 /* variableProperty */,
4130
+ connection: "target"
4131
+ },
4132
+ {
4133
+ position: Position35.Right,
4134
+ dataType: 8 /* module */,
4135
+ connection: "source"
4136
+ }
4137
+ ]
4138
+ };
4139
+ }
4140
+ isHandleAllowed(type) {
4141
+ return type === "source";
4142
+ }
4143
+ getHandleAllowedDataType() {
4144
+ return 8 /* module */;
4145
+ }
4146
+ };
4147
+
4148
+ // src/abstract/node-types.ts
4149
+ var NoiseNodeType = /* @__PURE__ */ ((NoiseNodeType2) => {
4150
+ NoiseNodeType2["position"] = "position";
4151
+ NoiseNodeType2["grid"] = "grid";
4152
+ NoiseNodeType2["noiseOutput"] = "noise-output";
4153
+ NoiseNodeType2["noiseConst"] = "noise-constant";
4154
+ NoiseNodeType2["noiseSimplex"] = "noise-simplex";
4155
+ NoiseNodeType2["noiseBillow"] = "noise-billow";
4156
+ NoiseNodeType2["noiseCheckerboard"] = "noise-checkerboard";
4157
+ NoiseNodeType2["noiseNormalize"] = "noise-normalize";
4158
+ NoiseNodeType2["noiseCylinders"] = "noise-cylinders";
4159
+ NoiseNodeType2["noisePerlin"] = "noise-perlin";
4160
+ NoiseNodeType2["noiseRidgedMulti"] = "noise-ridged-multi";
4161
+ NoiseNodeType2["noiseSpheres"] = "noise-spheres";
4162
+ NoiseNodeType2["noiseVoronoi"] = "noise-voronoi";
4163
+ NoiseNodeType2["textureData"] = "texture-data";
4164
+ NoiseNodeType2["noiseLogger"] = "noise-logger";
4165
+ NoiseNodeType2["positionLogger"] = "position-logger";
4166
+ NoiseNodeType2["noiseCombine"] = "noise-combiner";
4167
+ NoiseNodeType2["noiseClamp"] = "noise-clamp";
4168
+ NoiseNodeType2["noiseAbs"] = "noise-abs";
4169
+ NoiseNodeType2["noiseCurve"] = "noise-curve";
4170
+ NoiseNodeType2["noiseExponent"] = "noise-exponent";
4171
+ NoiseNodeType2["noiseInvert"] = "noise-invert";
4172
+ NoiseNodeType2["noiseScaleBias"] = "noise-scale-bias";
4173
+ NoiseNodeType2["noiseTerrace"] = "noise-terrace";
4174
+ NoiseNodeType2["noiseBlend"] = "noise-blend";
4175
+ NoiseNodeType2["noiseSelect"] = "noise-select";
4176
+ NoiseNodeType2["noiseDisplace"] = "noise-displace";
4177
+ NoiseNodeType2["noiseRotatePoint"] = "noise-rotate-point";
4178
+ NoiseNodeType2["noiseScalePoint"] = "noise-scale-point";
4179
+ NoiseNodeType2["noiseTranslatePoint"] = "noise-translate-point";
4180
+ NoiseNodeType2["noiseTurbulence"] = "noise-turbulence";
4181
+ NoiseNodeType2["variableProperty"] = "variable-property";
4182
+ NoiseNodeType2["variableValue"] = "variable-value";
4183
+ NoiseNodeType2["variableCombine"] = "variable-combine";
4184
+ NoiseNodeType2["groupModule"] = "group-module";
4185
+ return NoiseNodeType2;
4186
+ })(NoiseNodeType || {});
4187
+ var noiseNodeTypes = {
4188
+ ["variable-value" /* variableValue */]: variable_value_node_default,
4189
+ ["variable-property" /* variableProperty */]: variable_property_node_default,
4190
+ ["variable-combine" /* variableCombine */]: variable_combine_node_default,
4191
+ ["group-module" /* groupModule */]: node_module_group_default,
4192
+ ["position" /* position */]: position_const_node_default,
4193
+ ["grid" /* grid */]: position_grid_node_default,
4194
+ ["noise-output" /* noiseOutput */]: noise_output_node_default,
4195
+ ["texture-data" /* textureData */]: noise_raw_texture_node_default,
4196
+ ["noise-logger" /* noiseLogger */]: noise_logger_node_default,
4197
+ ["position-logger" /* positionLogger */]: positions_logger_node_default,
4198
+ ["noise-constant" /* noiseConst */]: noise_const_node_default,
4199
+ ["noise-billow" /* noiseBillow */]: noise_billow_node_default,
4200
+ ["noise-simplex" /* noiseSimplex */]: noise_simplex_node_default,
4201
+ ["noise-checkerboard" /* noiseCheckerboard */]: noise_checkerboard_node_default,
4202
+ ["noise-cylinders" /* noiseCylinders */]: noise_cylinders_node_default,
4203
+ ["noise-perlin" /* noisePerlin */]: noise_perlin_node_default,
4204
+ ["noise-ridged-multi" /* noiseRidgedMulti */]: noise_ridgedmulti_node_default,
4205
+ ["noise-spheres" /* noiseSpheres */]: noise_spheres_node_default,
4206
+ ["noise-voronoi" /* noiseVoronoi */]: noise_voronoi_node_default,
4207
+ ["noise-combiner" /* noiseCombine */]: noise_combine_node_default,
4208
+ ["noise-clamp" /* noiseClamp */]: noise_clamp_node_default,
4209
+ ["noise-abs" /* noiseAbs */]: noise_abs_node_default,
4210
+ ["noise-normalize" /* noiseNormalize */]: noise_normalize_node_default,
4211
+ ["noise-curve" /* noiseCurve */]: noise_curve_node_default,
4212
+ ["noise-exponent" /* noiseExponent */]: noise_exponent_node_default,
4213
+ ["noise-invert" /* noiseInvert */]: noise_invert_node_default,
4214
+ ["noise-scale-bias" /* noiseScaleBias */]: noise_scale_bias_node_default,
4215
+ ["noise-terrace" /* noiseTerrace */]: noise_terrace_node_default,
4216
+ ["noise-blend" /* noiseBlend */]: noise_blend_node_default,
4217
+ ["noise-select" /* noiseSelect */]: noise_select_node_default,
4218
+ ["noise-displace" /* noiseDisplace */]: noise_displace_node_default,
4219
+ ["noise-rotate-point" /* noiseRotatePoint */]: noise_rotate_point_node_default,
4220
+ ["noise-scale-point" /* noiseScalePoint */]: noise_scale_point_node_default,
4221
+ ["noise-translate-point" /* noiseTranslatePoint */]: noise_translate_point_node_default,
4222
+ ["noise-turbulence" /* noiseTurbulence */]: noise_turbulence_node_default
4223
+ };
4224
+ var noiseNodeTemplates = {
4225
+ ["noise-output" /* noiseOutput */]: new NoiseOutputNodeTemplateFactory(),
4226
+ ["noise-simplex" /* noiseSimplex */]: new NoiseSimplexNodeTemplateFactory(),
4227
+ ["noise-billow" /* noiseBillow */]: new NoiseBillowNodeTemplateFactory(),
4228
+ ["noise-checkerboard" /* noiseCheckerboard */]: new NoiseCheckerboardNodeTemplateFactory(),
4229
+ ["noise-normalize" /* noiseNormalize */]: new NoiseNormalizeNodeTemplateFactory(),
4230
+ ["noise-logger" /* noiseLogger */]: new NoiseLoggerNodeTemplateFactory(),
4231
+ ["noise-constant" /* noiseConst */]: new NoiseConstNodeTemplateFactory(),
4232
+ ["position" /* position */]: new PositionConstNodeTemplateFactory(),
4233
+ ["position-logger" /* positionLogger */]: new PositionLoggerNodeTemplateFactory(),
4234
+ ["grid" /* grid */]: new PositionGridNodeTemplateFactory(),
4235
+ ["texture-data" /* textureData */]: new NoiseRawTextureTemplateFactory(),
4236
+ ["noise-cylinders" /* noiseCylinders */]: new NoiseCylindersNodeTemplateFactory(),
4237
+ ["noise-perlin" /* noisePerlin */]: new NoisePerlinNodeTemplateFactory(),
4238
+ ["noise-ridged-multi" /* noiseRidgedMulti */]: new NoiseRidgedMultiNodeTemplateFactory(),
4239
+ ["noise-spheres" /* noiseSpheres */]: new NoiseSpheresNodeTemplateFactory(),
4240
+ ["noise-voronoi" /* noiseVoronoi */]: new NoiseVoronoiNodeTemplateFactory(),
4241
+ ["noise-combiner" /* noiseCombine */]: new NoiseCombineNodeTemplateFactory(),
4242
+ ["noise-clamp" /* noiseClamp */]: new NoiseClampNodeTemplateFactory(),
4243
+ ["noise-abs" /* noiseAbs */]: new NoiseAbsNodeTemplateFactory(),
4244
+ ["noise-curve" /* noiseCurve */]: new NoiseCurveNodeTemplateFactory(),
4245
+ ["noise-exponent" /* noiseExponent */]: new NoiseExponentNodeTemplateFactory(),
4246
+ ["noise-invert" /* noiseInvert */]: new NoiseInvertNodeTemplateFactory(),
4247
+ ["noise-scale-bias" /* noiseScaleBias */]: new NoiseScaleBiasNodeTemplateFactory(),
4248
+ ["noise-terrace" /* noiseTerrace */]: new NoiseTerraceNodeTemplateFactory(),
4249
+ ["noise-blend" /* noiseBlend */]: new NoiseBlendNodeTemplateFactory(),
4250
+ ["noise-select" /* noiseSelect */]: new NoiseSelectNodeTemplateFactory(),
4251
+ ["noise-displace" /* noiseDisplace */]: new NoiseDisplaceNodeTemplateFactory(),
4252
+ ["noise-rotate-point" /* noiseRotatePoint */]: new NoiseRotatePointNodeTemplateFactory(),
4253
+ ["noise-scale-point" /* noiseScalePoint */]: new NoiseScalePointNodeTemplateFactory(),
4254
+ ["noise-translate-point" /* noiseTranslatePoint */]: new NoiseTranslatePointNodeTemplateFactory(),
4255
+ ["noise-turbulence" /* noiseTurbulence */]: new NoiseTurbulenceNodeTemplateFactory(),
4256
+ ["variable-property" /* variableProperty */]: new VariablePropertyNodeTemplateFactory(),
4257
+ ["variable-combine" /* variableCombine */]: new VariableCombineNodeTemplateFactory(),
4258
+ ["variable-value" /* variableValue */]: new VariableValueNodeTemplateFactory(),
4259
+ ["group-module" /* groupModule */]: new ModuleGroupNodeTemplateFactory()
4260
+ };
4261
+ export {
4262
+ DisplacementModule,
4263
+ NoiseCombineType,
4264
+ NoiseHandleFlag,
4265
+ NoiseNodeType,
4266
+ VariableCombineType,
4267
+ noiseCombineModuleMap,
4268
+ noiseNodeTemplates,
4269
+ noiseNodeTypes
4270
+ };
4271
+ //# sourceMappingURL=index.js.map