@bldrs-ai/conway 1.377.1188 → 1.378.1185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/examples/browser-bundled.cjs +401 -633
- package/compiled/examples/cli-bundled.cjs +3940 -4457
- package/compiled/examples/cli-step-bundled.cjs +16691 -16944
- package/compiled/examples/validator-bundled.cjs +401 -633
- package/compiled/src/AP214E3_2010/ap214_step_parser.d.ts +2 -16
- package/compiled/src/AP214E3_2010/ap214_step_parser.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_step_parser.js +2 -16
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +0 -41
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.js +1 -60
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts +0 -13
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_model_passthrough_factory.js +0 -30
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts +1 -68
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ifc.js +49 -185
- package/compiled/src/compat/web-ifc/index.d.ts +0 -1
- package/compiled/src/compat/web-ifc/index.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_command_line_main.js +5 -46
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts +1 -40
- package/compiled/src/ifc/ifc_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_geometry_extraction.js +1 -84
- package/compiled/src/ifc/ifc_step_parser.d.ts +2 -16
- package/compiled/src/ifc/ifc_step_parser.d.ts.map +1 -1
- package/compiled/src/ifc/ifc_step_parser.js +2 -16
- package/compiled/src/index.d.ts +1 -3
- package/compiled/src/index.d.ts.map +1 -1
- package/compiled/src/index.js +1 -2
- package/compiled/src/indexing/multi_index_set.d.ts +0 -13
- package/compiled/src/indexing/multi_index_set.d.ts.map +1 -1
- package/compiled/src/indexing/multi_index_set.js +0 -44
- package/compiled/src/loaders/conway_model_loader.d.ts +1 -21
- package/compiled/src/loaders/conway_model_loader.d.ts.map +1 -1
- package/compiled/src/loaders/conway_model_loader.js +12 -46
- package/compiled/src/logging/logger.d.ts +5 -74
- package/compiled/src/logging/logger.d.ts.map +1 -1
- package/compiled/src/logging/logger.js +3 -116
- package/compiled/src/memory/memory.d.ts +0 -8
- package/compiled/src/memory/memory.d.ts.map +1 -1
- package/compiled/src/memory/memory.js +0 -23
- package/compiled/src/statistics/statistics.d.ts +0 -7
- package/compiled/src/statistics/statistics.d.ts.map +1 -1
- package/compiled/src/statistics/statistics.js +2 -11
- package/compiled/src/step/parsing/step_parser.d.ts +2 -38
- package/compiled/src/step/parsing/step_parser.d.ts.map +1 -1
- package/compiled/src/step/parsing/step_parser.js +2 -67
- package/compiled/src/step/step_model_base.d.ts +0 -11
- package/compiled/src/step/step_model_base.d.ts.map +1 -1
- package/compiled/src/step/step_model_base.js +0 -15
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/compiled/src/cli/cli_progress_renderer.d.ts +0 -43
- package/compiled/src/cli/cli_progress_renderer.d.ts.map +0 -1
- package/compiled/src/cli/cli_progress_renderer.js +0 -90
- package/compiled/src/core/progress.d.ts +0 -113
- package/compiled/src/core/progress.d.ts.map +0 -1
- package/compiled/src/core/progress.js +0 -111
- package/compiled/src/core/progress.test.d.ts +0 -2
- package/compiled/src/core/progress.test.d.ts.map +0 -1
- package/compiled/src/core/progress.test.js +0 -65
- package/compiled/src/ifc/ifc_geometry_extraction_progress.test.d.ts +0 -2
- package/compiled/src/ifc/ifc_geometry_extraction_progress.test.d.ts.map +0 -1
- package/compiled/src/ifc/ifc_geometry_extraction_progress.test.js +0 -55
- package/compiled/src/logging/logger.test.d.ts +0 -2
- package/compiled/src/logging/logger.test.d.ts.map +0 -1
- package/compiled/src/logging/logger.test.js +0 -62
- package/compiled/src/step/parsing/step_parser_progress.test.d.ts +0 -2
- package/compiled/src/step/parsing/step_parser_progress.test.d.ts.map +0 -1
- package/compiled/src/step/parsing/step_parser_progress.test.js +0 -70
|
@@ -29,517 +29,6 @@ var import_process = require("process");
|
|
|
29
29
|
var import_node_process = require("node:process");
|
|
30
30
|
var readline = __toESM(require("node:readline"), 1);
|
|
31
31
|
|
|
32
|
-
// compiled/src/version/version.js
|
|
33
|
-
var versionString = "Conway Web-Ifc Shim v1.377.1188";
|
|
34
|
-
|
|
35
|
-
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
36
|
-
var wasmType = "";
|
|
37
|
-
var dynamicImport = new Function("module", "return import(module)");
|
|
38
|
-
|
|
39
|
-
// compiled/dependencies/conway-geom/interface/material_object.js
|
|
40
|
-
var BlendMode;
|
|
41
|
-
(function(BlendMode2) {
|
|
42
|
-
BlendMode2[BlendMode2["OPAQUE"] = 0] = "OPAQUE";
|
|
43
|
-
BlendMode2[BlendMode2["BLEND"] = 1] = "BLEND";
|
|
44
|
-
BlendMode2[BlendMode2["MASK"] = 2] = "MASK";
|
|
45
|
-
})(BlendMode || (BlendMode = {}));
|
|
46
|
-
|
|
47
|
-
// compiled/src/statistics/statistics.js
|
|
48
|
-
var Statistics = class {
|
|
49
|
-
// Getters and setters
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @return {string | undefined} - load status or undefined
|
|
53
|
-
*/
|
|
54
|
-
getLoadStatus() {
|
|
55
|
-
return this.loadStatus;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* @param value - load status
|
|
60
|
-
*/
|
|
61
|
-
setLoadStatus(value) {
|
|
62
|
-
this.loadStatus = value;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
* @return {string | undefined} - project name or undefined
|
|
67
|
-
*/
|
|
68
|
-
getProjectName() {
|
|
69
|
-
return this.projectName;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @param value - project name
|
|
74
|
-
*/
|
|
75
|
-
setProjectName(value) {
|
|
76
|
-
this.projectName = value;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* @return {string | undefined} - version or undefined
|
|
81
|
-
*/
|
|
82
|
-
getVersion() {
|
|
83
|
-
return this.version;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
* @param value - version
|
|
88
|
-
*/
|
|
89
|
-
setVersion(value) {
|
|
90
|
-
this.version = value;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
94
|
-
* @return {number | undefined} - parse time or undefined
|
|
95
|
-
*/
|
|
96
|
-
getParseTime() {
|
|
97
|
-
return this.parseTime;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
*
|
|
101
|
-
* @param value - parse time
|
|
102
|
-
*/
|
|
103
|
-
setParseTime(value) {
|
|
104
|
-
this.parseTime = value;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
* @return {number | undefined} - geometry parse time or undefined
|
|
109
|
-
*/
|
|
110
|
-
getGeometryTime() {
|
|
111
|
-
return this.geometryTime;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
* @param value - geometry parse time
|
|
116
|
-
*/
|
|
117
|
-
setGeometryTime(value) {
|
|
118
|
-
this.geometryTime = value;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
*
|
|
122
|
-
* @return {number | undefined} - total execution time or undefined
|
|
123
|
-
*/
|
|
124
|
-
getTotalTime() {
|
|
125
|
-
return this.totalTime;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* @param value - total execution time
|
|
130
|
-
*/
|
|
131
|
-
setTotalTime(value) {
|
|
132
|
-
this.totalTime = value;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
*
|
|
136
|
-
* @return {number | undefined} - geometry memory or undefined
|
|
137
|
-
*/
|
|
138
|
-
getGeometryMemory() {
|
|
139
|
-
return this.geometryMemory;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
143
|
-
* @param value - geometry memory
|
|
144
|
-
*/
|
|
145
|
-
setGeometryMemory(value) {
|
|
146
|
-
this.geometryMemory = value;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
*
|
|
150
|
-
* @return {string | undefined} - preprocessor version or undefined
|
|
151
|
-
*/
|
|
152
|
-
getPreprocessorVersion() {
|
|
153
|
-
return this.preprocessorVersion;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
*
|
|
157
|
-
* @param value - preprocessor version
|
|
158
|
-
*/
|
|
159
|
-
setPreprocessorVersion(value) {
|
|
160
|
-
this.preprocessorVersion = value;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
*
|
|
164
|
-
* @return {string | undefined} - originating system or undefined
|
|
165
|
-
*/
|
|
166
|
-
getOriginatingSystem() {
|
|
167
|
-
return this.originatingSystem;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
*
|
|
171
|
-
* @param value - originating system
|
|
172
|
-
*/
|
|
173
|
-
setOriginatingSystem(value) {
|
|
174
|
-
this.originatingSystem = value;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
*
|
|
178
|
-
* @return {string | undefined} - memory statistics or undefined
|
|
179
|
-
*/
|
|
180
|
-
getMemoryStatistics() {
|
|
181
|
-
return this.memoryStatistics;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
*
|
|
185
|
-
* @param value - memory statistics
|
|
186
|
-
*/
|
|
187
|
-
setMemoryStatistics(value) {
|
|
188
|
-
this.memoryStatistics = value;
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* prints statistics
|
|
192
|
-
*/
|
|
193
|
-
printStatistics() {
|
|
194
|
-
console.log(this.format());
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Format the load-summary line (Logger routes this through its sink so
|
|
198
|
-
* the CLI can keep stdout clean — issue #301).
|
|
199
|
-
*
|
|
200
|
-
* @return {string} the single-line load summary
|
|
201
|
-
*/
|
|
202
|
-
format() {
|
|
203
|
-
const date = /* @__PURE__ */ new Date();
|
|
204
|
-
const options = {
|
|
205
|
-
year: "numeric",
|
|
206
|
-
month: "short",
|
|
207
|
-
day: "numeric",
|
|
208
|
-
hour: "2-digit",
|
|
209
|
-
minute: "2-digit",
|
|
210
|
-
second: "2-digit",
|
|
211
|
-
timeZone: "UTC"
|
|
212
|
-
};
|
|
213
|
-
const dateString = date.toLocaleDateString("en-US", options).replace(/,/g, "");
|
|
214
|
-
const versionMatch = versionString.match(/v(\d+\.\d+\.\d+)/);
|
|
215
|
-
let conwayVersionNumber;
|
|
216
|
-
if (versionMatch !== null) {
|
|
217
|
-
conwayVersionNumber = versionMatch[1];
|
|
218
|
-
} else {
|
|
219
|
-
conwayVersionNumber = "Version Not Found";
|
|
220
|
-
}
|
|
221
|
-
let versionStr;
|
|
222
|
-
if (this.version !== void 0) {
|
|
223
|
-
const match = this.version.match(/'([^']+)'/);
|
|
224
|
-
if (match) {
|
|
225
|
-
versionStr = match[1];
|
|
226
|
-
} else {
|
|
227
|
-
versionStr = "No match found";
|
|
228
|
-
}
|
|
229
|
-
} else {
|
|
230
|
-
versionStr = "Version not defined";
|
|
231
|
-
}
|
|
232
|
-
return `[${dateString}]: Load Status: ${this.loadStatus}, Project Name: ${this.projectName}, Version: ${versionStr}, Conway Version: ${conwayVersionNumber}-${wasmType}, Parse Time: ${this.parseTime} ms, Geometry Time: ${this.geometryTime} ms, Total Time: ${this.totalTime} ms, Geometry Memory: ${this.geometryMemory?.toFixed(3)} MB, Memory Statistics: ${this.memoryStatistics}, Preprocessor Version: ${this.preprocessorVersion}, Originating System: ${this.originatingSystem}`;
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
// compiled/src/logging/logger.js
|
|
237
|
-
var LogLevel;
|
|
238
|
-
(function(LogLevel2) {
|
|
239
|
-
LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
|
|
240
|
-
LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
|
|
241
|
-
LogLevel2[LogLevel2["WARNING"] = 2] = "WARNING";
|
|
242
|
-
LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
|
|
243
|
-
LogLevel2[LogLevel2["OFF"] = 4] = "OFF";
|
|
244
|
-
})(LogLevel || (LogLevel = {}));
|
|
245
|
-
var LOG_LEVEL_BY_NAME = {
|
|
246
|
-
"debug": LogLevel.DEBUG,
|
|
247
|
-
"info": LogLevel.INFO,
|
|
248
|
-
"warning": LogLevel.WARNING,
|
|
249
|
-
"error": LogLevel.ERROR
|
|
250
|
-
};
|
|
251
|
-
var defaultSink = (level, message) => {
|
|
252
|
-
switch (level) {
|
|
253
|
-
case "error":
|
|
254
|
-
console.error(message);
|
|
255
|
-
break;
|
|
256
|
-
case "warning":
|
|
257
|
-
console.warn(message);
|
|
258
|
-
break;
|
|
259
|
-
default:
|
|
260
|
-
console.log(message);
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
var Logger = class _Logger {
|
|
264
|
-
/**
|
|
265
|
-
* Detects environment and initializes wasm callbacks
|
|
266
|
-
*/
|
|
267
|
-
static initializeWasmCallbacks() {
|
|
268
|
-
const environment = environment_default.environmentType;
|
|
269
|
-
if (environment === EnvironmentType.BROWSER) {
|
|
270
|
-
const globalScope = window;
|
|
271
|
-
globalScope.logInfo = _Logger.info;
|
|
272
|
-
globalScope.logWarning = _Logger.warning;
|
|
273
|
-
globalScope.logError = _Logger.error;
|
|
274
|
-
} else if (environment === EnvironmentType.NODE || environment === EnvironmentType.BOTH_FEATURES) {
|
|
275
|
-
const globalScope = global;
|
|
276
|
-
globalScope.logInfo = _Logger.info;
|
|
277
|
-
globalScope.logWarning = _Logger.warning;
|
|
278
|
-
globalScope.logError = _Logger.error;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Set the console-echo threshold. Embedders (e.g. Share) call this to
|
|
283
|
-
* quiet or expand conway's console output; the CLI maps -q/-v/-vv here.
|
|
284
|
-
*
|
|
285
|
-
* @param level - new threshold
|
|
286
|
-
*/
|
|
287
|
-
static setLogLevel(level) {
|
|
288
|
-
_Logger.threshold = level;
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
*
|
|
292
|
-
* @return {LogLevel} the current console-echo threshold
|
|
293
|
-
*/
|
|
294
|
-
static getLogLevel() {
|
|
295
|
-
return _Logger.threshold;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Is a given level at or above the current threshold?
|
|
299
|
-
*
|
|
300
|
-
* @param level - level to test
|
|
301
|
-
* @return {boolean} true when messages at this level echo to the console
|
|
302
|
-
*/
|
|
303
|
-
static isLevelEnabled(level) {
|
|
304
|
-
return level >= _Logger.threshold && _Logger.threshold !== LogLevel.OFF;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Replace the console sink (e.g. the CLI routes all echoes to stderr so
|
|
308
|
-
* stdout stays parseable). Pass undefined to restore the default.
|
|
309
|
-
*
|
|
310
|
-
* @param sink - replacement sink or undefined
|
|
311
|
-
*/
|
|
312
|
-
static setSink(sink) {
|
|
313
|
-
_Logger.sink = sink ?? defaultSink;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
*
|
|
317
|
-
* @param message - log message
|
|
318
|
-
* @param level - log level
|
|
319
|
-
* @return {number} log index
|
|
320
|
-
*/
|
|
321
|
-
static findLogIndex(message, level) {
|
|
322
|
-
return _Logger.logs.findIndex((log) => log.message === message && log.level === level);
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
*
|
|
326
|
-
* @param level - log level
|
|
327
|
-
* @param message - log message
|
|
328
|
-
*/
|
|
329
|
-
static log(level, message) {
|
|
330
|
-
const baseMessage = message.split(" expressID: ")[0];
|
|
331
|
-
const data = message.split(" expressID: ")[1];
|
|
332
|
-
const index = _Logger.findLogIndex(baseMessage, level);
|
|
333
|
-
let logEntry;
|
|
334
|
-
let firstOccurrence = false;
|
|
335
|
-
if (index >= 0) {
|
|
336
|
-
_Logger.logs[index].count += 1;
|
|
337
|
-
if (data !== void 0) {
|
|
338
|
-
_Logger.logs[index].expressIDs = _Logger.logs[index].expressIDs || /* @__PURE__ */ new Set();
|
|
339
|
-
_Logger.logs[index].expressIDs.add(data);
|
|
340
|
-
}
|
|
341
|
-
logEntry = _Logger.logs[index];
|
|
342
|
-
} else {
|
|
343
|
-
firstOccurrence = true;
|
|
344
|
-
logEntry = {
|
|
345
|
-
level,
|
|
346
|
-
message: baseMessage,
|
|
347
|
-
count: 1,
|
|
348
|
-
expressIDs: data ? /* @__PURE__ */ new Set([data]) : /* @__PURE__ */ new Set()
|
|
349
|
-
};
|
|
350
|
-
_Logger.logs.push(logEntry);
|
|
351
|
-
}
|
|
352
|
-
if (firstOccurrence && _Logger.isLevelEnabled(LOG_LEVEL_BY_NAME[level])) {
|
|
353
|
-
_Logger.sink(level, baseMessage);
|
|
354
|
-
}
|
|
355
|
-
_Logger.proxies.forEach((proxy) => proxy.log(logEntry));
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Compresses similar logs to a single line
|
|
359
|
-
*/
|
|
360
|
-
static compressLogs() {
|
|
361
|
-
const compressedLogs = [];
|
|
362
|
-
_Logger.logs.forEach((log) => {
|
|
363
|
-
const existingLog = compressedLogs.find((l) => l.message === log.message && l.level === log.level);
|
|
364
|
-
if (existingLog !== void 0) {
|
|
365
|
-
existingLog.count += log.count;
|
|
366
|
-
if (log.expressIDs !== void 0) {
|
|
367
|
-
log.expressIDs.forEach((d) => existingLog.expressIDs?.add(d));
|
|
368
|
-
}
|
|
369
|
-
} else {
|
|
370
|
-
compressedLogs.push({
|
|
371
|
-
...log,
|
|
372
|
-
expressIDs: log.expressIDs ? new Set(log.expressIDs) : /* @__PURE__ */ new Set()
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
_Logger.logs = compressedLogs;
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
*
|
|
380
|
-
* @param proxy - a log proxy
|
|
381
|
-
*/
|
|
382
|
-
static addProxy(proxy) {
|
|
383
|
-
_Logger.proxies.push(proxy);
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Remove a previously added proxy (no-op if absent).
|
|
387
|
-
*
|
|
388
|
-
* @param proxy - the proxy to remove
|
|
389
|
-
*/
|
|
390
|
-
static removeProxy(proxy) {
|
|
391
|
-
const index = _Logger.proxies.indexOf(proxy);
|
|
392
|
-
if (index >= 0) {
|
|
393
|
-
_Logger.proxies.splice(index, 1);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
*
|
|
398
|
-
* @param message - log message
|
|
399
|
-
*/
|
|
400
|
-
static debug(message) {
|
|
401
|
-
_Logger.log("debug", message);
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
*
|
|
405
|
-
* @param message - log message
|
|
406
|
-
*/
|
|
407
|
-
static info(message) {
|
|
408
|
-
_Logger.log("info", message);
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
*
|
|
412
|
-
* @param modelID
|
|
413
|
-
* @return {Statistics | undefined}
|
|
414
|
-
*/
|
|
415
|
-
static getStatistics(modelID) {
|
|
416
|
-
return this.statistics.get(modelID);
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Create the statistics for a model ID.
|
|
420
|
-
*
|
|
421
|
-
* @param modelID The model ID to create statistics for
|
|
422
|
-
*
|
|
423
|
-
* @return {Statistics} The created statistics object.
|
|
424
|
-
*/
|
|
425
|
-
static createStatistics(modelID) {
|
|
426
|
-
const statistics = new Statistics();
|
|
427
|
-
this.statistics.set(modelID, statistics);
|
|
428
|
-
return statistics;
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
*
|
|
432
|
-
* @param modelID
|
|
433
|
-
*/
|
|
434
|
-
static printStatistics(modelID) {
|
|
435
|
-
if (!_Logger.isLevelEnabled(LogLevel.INFO)) {
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
const statistics_ = this.statistics.get(modelID);
|
|
439
|
-
if (statistics_ !== void 0) {
|
|
440
|
-
_Logger.sink("info", statistics_.format());
|
|
441
|
-
} else {
|
|
442
|
-
_Logger.error(`No statistics for modelID: ${modelID}`);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Compresses the logs if they haven't been compressed,
|
|
447
|
-
* then returns a list of just the errors.
|
|
448
|
-
*
|
|
449
|
-
* @return {LogEntry[]} The errors.
|
|
450
|
-
*/
|
|
451
|
-
static getErrors() {
|
|
452
|
-
_Logger.compressLogs();
|
|
453
|
-
return this.logs.filter((where) => where.level === "error");
|
|
454
|
-
}
|
|
455
|
-
/**
|
|
456
|
-
*
|
|
457
|
-
* @param message - log message
|
|
458
|
-
*/
|
|
459
|
-
static warning(message) {
|
|
460
|
-
_Logger.log("warning", message);
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
*
|
|
464
|
-
* @param message - log message
|
|
465
|
-
*/
|
|
466
|
-
static error(message) {
|
|
467
|
-
_Logger.log("error", message);
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
*
|
|
471
|
-
* @return {LogEntry[]} - list of logs
|
|
472
|
-
*/
|
|
473
|
-
static getLogs() {
|
|
474
|
-
return _Logger.logs;
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* Display the deduplicated log buffer in a table.
|
|
478
|
-
*
|
|
479
|
-
* Gated behind the DEBUG threshold by default — a clean load should leave
|
|
480
|
-
* a quiet console (issue #301); pass force for explicit dumps (CLI -v).
|
|
481
|
-
*
|
|
482
|
-
* @param force - dump regardless of the current threshold
|
|
483
|
-
*/
|
|
484
|
-
static displayLogs(force = false) {
|
|
485
|
-
if (!force && !_Logger.isLevelEnabled(LogLevel.DEBUG)) {
|
|
486
|
-
return;
|
|
487
|
-
}
|
|
488
|
-
_Logger.compressLogs();
|
|
489
|
-
console.table(_Logger.logs);
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* clear logs
|
|
493
|
-
*/
|
|
494
|
-
static clearLogs() {
|
|
495
|
-
_Logger.logs = [];
|
|
496
|
-
}
|
|
497
|
-
};
|
|
498
|
-
Logger.logs = [];
|
|
499
|
-
Logger.proxies = [];
|
|
500
|
-
Logger.statistics = /* @__PURE__ */ new Map();
|
|
501
|
-
Logger.threshold = LogLevel.INFO;
|
|
502
|
-
Logger.sink = defaultSink;
|
|
503
|
-
var logger_default = Logger;
|
|
504
|
-
|
|
505
|
-
// compiled/src/utilities/environment.js
|
|
506
|
-
var EnvironmentType;
|
|
507
|
-
(function(EnvironmentType2) {
|
|
508
|
-
EnvironmentType2[EnvironmentType2["BROWSER"] = 0] = "BROWSER";
|
|
509
|
-
EnvironmentType2[EnvironmentType2["NODE"] = 1] = "NODE";
|
|
510
|
-
EnvironmentType2[EnvironmentType2["BOTH_FEATURES"] = 2] = "BOTH_FEATURES";
|
|
511
|
-
EnvironmentType2[EnvironmentType2["UNKNOWN"] = 3] = "UNKNOWN";
|
|
512
|
-
})(EnvironmentType || (EnvironmentType = {}));
|
|
513
|
-
var Environment = class {
|
|
514
|
-
/**
|
|
515
|
-
* determines the runtime environment
|
|
516
|
-
*/
|
|
517
|
-
static checkEnvironment() {
|
|
518
|
-
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
519
|
-
const isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && global.process.versions && global.process.versions.node;
|
|
520
|
-
if (isBrowser && isNode) {
|
|
521
|
-
logger_default.info("This environment has features of both Node.js and a web browser.");
|
|
522
|
-
this.environmentType = EnvironmentType.BOTH_FEATURES;
|
|
523
|
-
} else if (isNode) {
|
|
524
|
-
this.environmentType = EnvironmentType.NODE;
|
|
525
|
-
} else if (isBrowser) {
|
|
526
|
-
this.environmentType = EnvironmentType.BROWSER;
|
|
527
|
-
} else {
|
|
528
|
-
logger_default.info("ENVIRONMENT === unknown");
|
|
529
|
-
this.environmentType = EnvironmentType.UNKNOWN;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
Environment.environmentType = EnvironmentType.UNKNOWN;
|
|
534
|
-
var environment_default = Environment;
|
|
535
|
-
|
|
536
|
-
// compiled/src/core/progress.js
|
|
537
|
-
function yieldToEventLoop() {
|
|
538
|
-
return new Promise((resolve) => {
|
|
539
|
-
setTimeout(resolve, 0);
|
|
540
|
-
});
|
|
541
|
-
}
|
|
542
|
-
|
|
543
32
|
// compiled/src/parsing/token_parsing.js
|
|
544
33
|
var encoder = new TextEncoder();
|
|
545
34
|
function encodeToken(from) {
|
|
@@ -2245,8 +1734,6 @@ var binaryParser = hex_parser_default.Instance.step;
|
|
|
2245
1734
|
var attributeMap = step_attribute_map_default.Instance.get;
|
|
2246
1735
|
var commentParser2 = step_comment_parser_default.Instance.match;
|
|
2247
1736
|
var stringParser2 = step_string_parser_default.Instance.match;
|
|
2248
|
-
var PARSE_PROGRESS_ELEMENT_MASK = 4095;
|
|
2249
|
-
var DEFAULT_PARSE_YIELD_INTERVAL_MS = 50;
|
|
2250
1737
|
var StepHeaderParser = class _StepHeaderParser {
|
|
2251
1738
|
/**
|
|
2252
1739
|
* Get the singleton static instance of this.
|
|
@@ -2469,64 +1956,12 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2469
1956
|
return vtableBuilder.complete(cursor);
|
|
2470
1957
|
}
|
|
2471
1958
|
/**
|
|
2472
|
-
* Parse the data block of a step file, indexing it
|
|
2473
|
-
*
|
|
2474
|
-
* Synchronous driver over parseDataBlockIncremental — see
|
|
2475
|
-
* parseDataBlockAsync for the cooperative (repaint-friendly) variant.
|
|
2476
|
-
*
|
|
2477
|
-
* @param input The input parsing buffer, in the data section.
|
|
2478
|
-
* @param onProgress Optional byte-cursor progress callback, invoked
|
|
2479
|
-
* roughly every PARSE_PROGRESS_ELEMENT_MASK + 1 elements.
|
|
2480
|
-
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
2481
|
-
*/
|
|
2482
|
-
parseDataBlock(input2, onProgress) {
|
|
2483
|
-
const parser211 = this.parseDataBlockIncremental(input2);
|
|
2484
|
-
while (true) {
|
|
2485
|
-
const next = parser211.next();
|
|
2486
|
-
if (next.done === true) {
|
|
2487
|
-
return next.value;
|
|
2488
|
-
}
|
|
2489
|
-
onProgress?.(next.value);
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
/**
|
|
2493
|
-
* Cooperative variant of parseDataBlock: identical parse (same generator
|
|
2494
|
-
* body), but periodically awaits a macrotask so the event loop can run —
|
|
2495
|
-
* browsers repaint progress UI, watchdog timers fire, and the tab is not
|
|
2496
|
-
* flagged as stalled during a large parse. Issue #301 §2.
|
|
1959
|
+
* Parse the data block of a step file, indexing it.,
|
|
2497
1960
|
*
|
|
2498
1961
|
* @param input The input parsing buffer, in the data section.
|
|
2499
|
-
* @param onProgress Optional byte-cursor progress callback.
|
|
2500
|
-
* @param yieldIntervalMs Minimum ms between event-loop yields.
|
|
2501
|
-
* @return {Promise<BlockParseResult>} The parsing result, including the
|
|
2502
|
-
* index and result enum.
|
|
2503
|
-
*/
|
|
2504
|
-
async parseDataBlockAsync(input2, onProgress, yieldIntervalMs = DEFAULT_PARSE_YIELD_INTERVAL_MS) {
|
|
2505
|
-
const parser211 = this.parseDataBlockIncremental(input2);
|
|
2506
|
-
let lastYield = Date.now();
|
|
2507
|
-
while (true) {
|
|
2508
|
-
const next = parser211.next();
|
|
2509
|
-
if (next.done === true) {
|
|
2510
|
-
return next.value;
|
|
2511
|
-
}
|
|
2512
|
-
onProgress?.(next.value);
|
|
2513
|
-
if (Date.now() - lastYield >= yieldIntervalMs) {
|
|
2514
|
-
await yieldToEventLoop();
|
|
2515
|
-
lastYield = Date.now();
|
|
2516
|
-
}
|
|
2517
|
-
}
|
|
2518
|
-
}
|
|
2519
|
-
/**
|
|
2520
|
-
* Parse the data block of a step file, indexing it, suspending with the
|
|
2521
|
-
* current byte cursor every PARSE_PROGRESS_ELEMENT_MASK + 1 elements so
|
|
2522
|
-
* drivers can report progress (and optionally yield to the event loop)
|
|
2523
|
-
* without the loop body diverging between sync and async paths.
|
|
2524
|
-
*
|
|
2525
|
-
* @param input The input parsing buffer, in the data section.
|
|
2526
|
-
* @yields {number} The current byte cursor within the input buffer.
|
|
2527
1962
|
* @return {BlockParseResult} The parsing result, including the index and result enum.
|
|
2528
1963
|
*/
|
|
2529
|
-
|
|
1964
|
+
parseDataBlock(input2) {
|
|
2530
1965
|
const indexResult = { elements: [] };
|
|
2531
1966
|
const match = input2.match;
|
|
2532
1967
|
const comment = () => match(commentParser2);
|
|
@@ -2662,11 +2097,7 @@ var StepParser = class extends StepHeaderParser {
|
|
|
2662
2097
|
});
|
|
2663
2098
|
}
|
|
2664
2099
|
};
|
|
2665
|
-
let parsedElementCount = 0;
|
|
2666
2100
|
while (input2.unfinished) {
|
|
2667
|
-
if ((++parsedElementCount & PARSE_PROGRESS_ELEMENT_MASK) === 0) {
|
|
2668
|
-
yield input2.cursor;
|
|
2669
|
-
}
|
|
2670
2101
|
if (!charws(HASH2)) {
|
|
2671
2102
|
if (tokenws(END_SECTION)) {
|
|
2672
2103
|
return parseResult2(ParseResult.COMPLETE);
|
|
@@ -5389,20 +4820,6 @@ var StepModelBase = class {
|
|
|
5389
4820
|
const distinctTypes = types.length === 1 ? types[0].query : new Set(types.flatMap((type) => type.query));
|
|
5390
4821
|
return this.from(this.typeIndex.cursor(...distinctTypes), true);
|
|
5391
4822
|
}
|
|
5392
|
-
/**
|
|
5393
|
-
* Count entities of a set of types (including sub-types) without iterating
|
|
5394
|
-
* or materializing them — reads the type index's prefix sums, so it's cheap
|
|
5395
|
-
* enough to call up front for progress totals (see core/progress.ts).
|
|
5396
|
-
* Multi-mapped elements can be counted once per matching mapping, so treat
|
|
5397
|
-
* this as an upper bound; see MultiIndexSet.count.
|
|
5398
|
-
*
|
|
5399
|
-
* @param types The list of types to count.
|
|
5400
|
-
* @return {number} The number of matching entities.
|
|
5401
|
-
*/
|
|
5402
|
-
typeCount(...types) {
|
|
5403
|
-
const distinctTypes = types.length === 1 ? types[0].query : new Set(types.flatMap((type) => type.query));
|
|
5404
|
-
return this.typeIndex.count(...distinctTypes);
|
|
5405
|
-
}
|
|
5406
4823
|
/**
|
|
5407
4824
|
* Get the non empty type IDs for this.
|
|
5408
4825
|
*
|
|
@@ -69852,12 +69269,6 @@ var SingleIndexSetCursor = class _SingleIndexSetCursor {
|
|
|
69852
69269
|
};
|
|
69853
69270
|
|
|
69854
69271
|
// compiled/src/indexing/multi_index_set.js
|
|
69855
|
-
function popCount32(value) {
|
|
69856
|
-
let result = value - (value >> 1 & 1431655765);
|
|
69857
|
-
result = (result & 858993459) + (result >> 2 & 858993459);
|
|
69858
|
-
result = result + (result >> 4) & 252645135;
|
|
69859
|
-
return result * 16843009 >> 24;
|
|
69860
|
-
}
|
|
69861
69272
|
var MultiIndexSet = class {
|
|
69862
69273
|
/**
|
|
69863
69274
|
* Construct this with a prefix sum table and matching elements table.
|
|
@@ -69903,34 +69314,6 @@ var MultiIndexSet = class {
|
|
|
69903
69314
|
const indexEnd = prefixSum[indexType + 1] * 2;
|
|
69904
69315
|
return indexSetPointQuery32(localID, this.elements_, indexOffset, indexEnd);
|
|
69905
69316
|
}
|
|
69906
|
-
/**
|
|
69907
|
-
* Count of items for a set of types without materializing entities —
|
|
69908
|
-
* popcounts the packed one-hot blocks per type (the prefix sums index
|
|
69909
|
-
* 32-element blocks, not items), so it's O(blocks), thousands of times
|
|
69910
|
-
* cheaper than iterating a cursor. Per-type ranges are disjoint, but an
|
|
69911
|
-
* element multi-mapped under several of the queried types counts once per
|
|
69912
|
-
* mapping (matching what a cursor union would visit), so treat multi-type
|
|
69913
|
-
* counts as an upper bound (fine for progress totals, its motivating use).
|
|
69914
|
-
*
|
|
69915
|
-
* @param indexTypes The list of types to count.
|
|
69916
|
-
* @return {number} The summed count for the given types.
|
|
69917
|
-
*/
|
|
69918
|
-
count(...indexTypes) {
|
|
69919
|
-
const prefixSum = this.prefixSumTable_;
|
|
69920
|
-
const elements = this.elements_;
|
|
69921
|
-
let result = 0;
|
|
69922
|
-
for (const indexType of indexTypes) {
|
|
69923
|
-
if (indexType >= prefixSum.length - 1) {
|
|
69924
|
-
continue;
|
|
69925
|
-
}
|
|
69926
|
-
const blockStart = prefixSum[indexType] * 2;
|
|
69927
|
-
const blockEnd = prefixSum[indexType + 1] * 2;
|
|
69928
|
-
for (let where = blockStart; where < blockEnd; where += 2) {
|
|
69929
|
-
result += popCount32(elements[where + 1]);
|
|
69930
|
-
}
|
|
69931
|
-
}
|
|
69932
|
-
return result;
|
|
69933
|
-
}
|
|
69934
69317
|
/**
|
|
69935
69318
|
* Get a cursor that lets you iterate over the union of the sets of multiple indices.
|
|
69936
69319
|
*
|
|
@@ -70028,6 +69411,18 @@ var CanonicalMeshType;
|
|
|
70028
69411
|
CanonicalMeshType2[CanonicalMeshType2["BUFFER_GEOMETRY"] = 0] = "BUFFER_GEOMETRY";
|
|
70029
69412
|
})(CanonicalMeshType || (CanonicalMeshType = {}));
|
|
70030
69413
|
|
|
69414
|
+
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
69415
|
+
var wasmType = "";
|
|
69416
|
+
var dynamicImport = new Function("module", "return import(module)");
|
|
69417
|
+
|
|
69418
|
+
// compiled/dependencies/conway-geom/interface/material_object.js
|
|
69419
|
+
var BlendMode;
|
|
69420
|
+
(function(BlendMode2) {
|
|
69421
|
+
BlendMode2[BlendMode2["OPAQUE"] = 0] = "OPAQUE";
|
|
69422
|
+
BlendMode2[BlendMode2["BLEND"] = 1] = "BLEND";
|
|
69423
|
+
BlendMode2[BlendMode2["MASK"] = 2] = "MASK";
|
|
69424
|
+
})(BlendMode || (BlendMode = {}));
|
|
69425
|
+
|
|
70031
69426
|
// compiled/src/core/canonical_material.js
|
|
70032
69427
|
var ROUGNESS_CONVERSION_FACTOR = 2;
|
|
70033
69428
|
function roughnessToExponent(roughness) {
|
|
@@ -70640,30 +70035,403 @@ var IfcStepParser = class extends StepParser {
|
|
|
70640
70035
|
* Parse data to the model
|
|
70641
70036
|
*
|
|
70642
70037
|
* @param input The parsing buffer, set to user data, to read.
|
|
70643
|
-
* @param onProgress Optional byte-cursor progress callback for the data parse.
|
|
70644
70038
|
* @return {[ParseResult, IfcStepModel | undefined]} The parse result as well as the model,
|
|
70645
70039
|
* if it can be extracted.
|
|
70646
70040
|
*/
|
|
70647
|
-
parseDataToModel(input2
|
|
70648
|
-
const [itemIndex, parseResult2] = this.parseDataBlock(input2
|
|
70041
|
+
parseDataToModel(input2) {
|
|
70042
|
+
const [itemIndex, parseResult2] = this.parseDataBlock(input2);
|
|
70649
70043
|
return [parseResult2, new IfcStepModel(input2.buffer, itemIndex.elements)];
|
|
70650
70044
|
}
|
|
70045
|
+
};
|
|
70046
|
+
IfcStepParser.Instance = new IfcStepParser();
|
|
70047
|
+
var ifc_step_parser_default = IfcStepParser;
|
|
70048
|
+
|
|
70049
|
+
// compiled/src/version/version.js
|
|
70050
|
+
var versionString = "Conway Web-Ifc Shim v1.378.1185";
|
|
70051
|
+
|
|
70052
|
+
// compiled/src/statistics/statistics.js
|
|
70053
|
+
var Statistics = class {
|
|
70054
|
+
// Getters and setters
|
|
70651
70055
|
/**
|
|
70652
|
-
* Cooperative variant of parseDataToModel — periodically yields to the
|
|
70653
|
-
* event loop mid-parse (see StepParser.parseDataBlockAsync, issue #301 §2).
|
|
70654
70056
|
*
|
|
70655
|
-
* @
|
|
70656
|
-
* @param onProgress Optional byte-cursor progress callback for the data parse.
|
|
70657
|
-
* @return {Promise<[ParseResult, IfcStepModel | undefined]>} The parse result as well
|
|
70658
|
-
* as the model, if it can be extracted.
|
|
70057
|
+
* @return {string | undefined} - load status or undefined
|
|
70659
70058
|
*/
|
|
70660
|
-
|
|
70661
|
-
|
|
70662
|
-
|
|
70059
|
+
getLoadStatus() {
|
|
70060
|
+
return this.loadStatus;
|
|
70061
|
+
}
|
|
70062
|
+
/**
|
|
70063
|
+
*
|
|
70064
|
+
* @param value - load status
|
|
70065
|
+
*/
|
|
70066
|
+
setLoadStatus(value) {
|
|
70067
|
+
this.loadStatus = value;
|
|
70068
|
+
}
|
|
70069
|
+
/**
|
|
70070
|
+
*
|
|
70071
|
+
* @return {string | undefined} - project name or undefined
|
|
70072
|
+
*/
|
|
70073
|
+
getProjectName() {
|
|
70074
|
+
return this.projectName;
|
|
70075
|
+
}
|
|
70076
|
+
/**
|
|
70077
|
+
*
|
|
70078
|
+
* @param value - project name
|
|
70079
|
+
*/
|
|
70080
|
+
setProjectName(value) {
|
|
70081
|
+
this.projectName = value;
|
|
70082
|
+
}
|
|
70083
|
+
/**
|
|
70084
|
+
*
|
|
70085
|
+
* @return {string | undefined} - version or undefined
|
|
70086
|
+
*/
|
|
70087
|
+
getVersion() {
|
|
70088
|
+
return this.version;
|
|
70089
|
+
}
|
|
70090
|
+
/**
|
|
70091
|
+
*
|
|
70092
|
+
* @param value - version
|
|
70093
|
+
*/
|
|
70094
|
+
setVersion(value) {
|
|
70095
|
+
this.version = value;
|
|
70096
|
+
}
|
|
70097
|
+
/**
|
|
70098
|
+
*
|
|
70099
|
+
* @return {number | undefined} - parse time or undefined
|
|
70100
|
+
*/
|
|
70101
|
+
getParseTime() {
|
|
70102
|
+
return this.parseTime;
|
|
70103
|
+
}
|
|
70104
|
+
/**
|
|
70105
|
+
*
|
|
70106
|
+
* @param value - parse time
|
|
70107
|
+
*/
|
|
70108
|
+
setParseTime(value) {
|
|
70109
|
+
this.parseTime = value;
|
|
70110
|
+
}
|
|
70111
|
+
/**
|
|
70112
|
+
*
|
|
70113
|
+
* @return {number | undefined} - geometry parse time or undefined
|
|
70114
|
+
*/
|
|
70115
|
+
getGeometryTime() {
|
|
70116
|
+
return this.geometryTime;
|
|
70117
|
+
}
|
|
70118
|
+
/**
|
|
70119
|
+
*
|
|
70120
|
+
* @param value - geometry parse time
|
|
70121
|
+
*/
|
|
70122
|
+
setGeometryTime(value) {
|
|
70123
|
+
this.geometryTime = value;
|
|
70124
|
+
}
|
|
70125
|
+
/**
|
|
70126
|
+
*
|
|
70127
|
+
* @return {number | undefined} - total execution time or undefined
|
|
70128
|
+
*/
|
|
70129
|
+
getTotalTime() {
|
|
70130
|
+
return this.totalTime;
|
|
70131
|
+
}
|
|
70132
|
+
/**
|
|
70133
|
+
*
|
|
70134
|
+
* @param value - total execution time
|
|
70135
|
+
*/
|
|
70136
|
+
setTotalTime(value) {
|
|
70137
|
+
this.totalTime = value;
|
|
70138
|
+
}
|
|
70139
|
+
/**
|
|
70140
|
+
*
|
|
70141
|
+
* @return {number | undefined} - geometry memory or undefined
|
|
70142
|
+
*/
|
|
70143
|
+
getGeometryMemory() {
|
|
70144
|
+
return this.geometryMemory;
|
|
70145
|
+
}
|
|
70146
|
+
/**
|
|
70147
|
+
*
|
|
70148
|
+
* @param value - geometry memory
|
|
70149
|
+
*/
|
|
70150
|
+
setGeometryMemory(value) {
|
|
70151
|
+
this.geometryMemory = value;
|
|
70152
|
+
}
|
|
70153
|
+
/**
|
|
70154
|
+
*
|
|
70155
|
+
* @return {string | undefined} - preprocessor version or undefined
|
|
70156
|
+
*/
|
|
70157
|
+
getPreprocessorVersion() {
|
|
70158
|
+
return this.preprocessorVersion;
|
|
70159
|
+
}
|
|
70160
|
+
/**
|
|
70161
|
+
*
|
|
70162
|
+
* @param value - preprocessor version
|
|
70163
|
+
*/
|
|
70164
|
+
setPreprocessorVersion(value) {
|
|
70165
|
+
this.preprocessorVersion = value;
|
|
70166
|
+
}
|
|
70167
|
+
/**
|
|
70168
|
+
*
|
|
70169
|
+
* @return {string | undefined} - originating system or undefined
|
|
70170
|
+
*/
|
|
70171
|
+
getOriginatingSystem() {
|
|
70172
|
+
return this.originatingSystem;
|
|
70173
|
+
}
|
|
70174
|
+
/**
|
|
70175
|
+
*
|
|
70176
|
+
* @param value - originating system
|
|
70177
|
+
*/
|
|
70178
|
+
setOriginatingSystem(value) {
|
|
70179
|
+
this.originatingSystem = value;
|
|
70180
|
+
}
|
|
70181
|
+
/**
|
|
70182
|
+
*
|
|
70183
|
+
* @return {string | undefined} - memory statistics or undefined
|
|
70184
|
+
*/
|
|
70185
|
+
getMemoryStatistics() {
|
|
70186
|
+
return this.memoryStatistics;
|
|
70187
|
+
}
|
|
70188
|
+
/**
|
|
70189
|
+
*
|
|
70190
|
+
* @param value - memory statistics
|
|
70191
|
+
*/
|
|
70192
|
+
setMemoryStatistics(value) {
|
|
70193
|
+
this.memoryStatistics = value;
|
|
70194
|
+
}
|
|
70195
|
+
/**
|
|
70196
|
+
* prints statistics
|
|
70197
|
+
*/
|
|
70198
|
+
printStatistics() {
|
|
70199
|
+
const date = /* @__PURE__ */ new Date();
|
|
70200
|
+
const options = {
|
|
70201
|
+
year: "numeric",
|
|
70202
|
+
month: "short",
|
|
70203
|
+
day: "numeric",
|
|
70204
|
+
hour: "2-digit",
|
|
70205
|
+
minute: "2-digit",
|
|
70206
|
+
second: "2-digit",
|
|
70207
|
+
timeZone: "UTC"
|
|
70208
|
+
};
|
|
70209
|
+
const dateString = date.toLocaleDateString("en-US", options).replace(/,/g, "");
|
|
70210
|
+
const versionMatch = versionString.match(/v(\d+\.\d+\.\d+)/);
|
|
70211
|
+
let conwayVersionNumber;
|
|
70212
|
+
if (versionMatch !== null) {
|
|
70213
|
+
conwayVersionNumber = versionMatch[1];
|
|
70214
|
+
} else {
|
|
70215
|
+
conwayVersionNumber = "Version Not Found";
|
|
70216
|
+
}
|
|
70217
|
+
let versionStr;
|
|
70218
|
+
if (this.version !== void 0) {
|
|
70219
|
+
const match = this.version.match(/'([^']+)'/);
|
|
70220
|
+
if (match) {
|
|
70221
|
+
versionStr = match[1];
|
|
70222
|
+
} else {
|
|
70223
|
+
versionStr = "No match found";
|
|
70224
|
+
}
|
|
70225
|
+
} else {
|
|
70226
|
+
versionStr = "Version not defined";
|
|
70227
|
+
}
|
|
70228
|
+
console.log(`[${dateString}]: Load Status: ${this.loadStatus}, Project Name: ${this.projectName}, Version: ${versionStr}, Conway Version: ${conwayVersionNumber}-${wasmType}, Parse Time: ${this.parseTime} ms, Geometry Time: ${this.geometryTime} ms, Total Time: ${this.totalTime} ms, Geometry Memory: ${this.geometryMemory?.toFixed(3)} MB, Memory Statistics: ${this.memoryStatistics}, Preprocessor Version: ${this.preprocessorVersion}, Originating System: ${this.originatingSystem}`);
|
|
70663
70229
|
}
|
|
70664
70230
|
};
|
|
70665
|
-
|
|
70666
|
-
|
|
70231
|
+
|
|
70232
|
+
// compiled/src/utilities/environment.js
|
|
70233
|
+
var EnvironmentType;
|
|
70234
|
+
(function(EnvironmentType2) {
|
|
70235
|
+
EnvironmentType2[EnvironmentType2["BROWSER"] = 0] = "BROWSER";
|
|
70236
|
+
EnvironmentType2[EnvironmentType2["NODE"] = 1] = "NODE";
|
|
70237
|
+
EnvironmentType2[EnvironmentType2["BOTH_FEATURES"] = 2] = "BOTH_FEATURES";
|
|
70238
|
+
EnvironmentType2[EnvironmentType2["UNKNOWN"] = 3] = "UNKNOWN";
|
|
70239
|
+
})(EnvironmentType || (EnvironmentType = {}));
|
|
70240
|
+
var Environment = class {
|
|
70241
|
+
/**
|
|
70242
|
+
* determines the runtime environment
|
|
70243
|
+
*/
|
|
70244
|
+
static checkEnvironment() {
|
|
70245
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
70246
|
+
const isNode = typeof global !== "undefined" && typeof global.process !== "undefined" && global.process.versions && global.process.versions.node;
|
|
70247
|
+
if (isBrowser && isNode) {
|
|
70248
|
+
logger_default.info("This environment has features of both Node.js and a web browser.");
|
|
70249
|
+
this.environmentType = EnvironmentType.BOTH_FEATURES;
|
|
70250
|
+
} else if (isNode) {
|
|
70251
|
+
this.environmentType = EnvironmentType.NODE;
|
|
70252
|
+
} else if (isBrowser) {
|
|
70253
|
+
this.environmentType = EnvironmentType.BROWSER;
|
|
70254
|
+
} else {
|
|
70255
|
+
logger_default.info("ENVIRONMENT === unknown");
|
|
70256
|
+
this.environmentType = EnvironmentType.UNKNOWN;
|
|
70257
|
+
}
|
|
70258
|
+
}
|
|
70259
|
+
};
|
|
70260
|
+
Environment.environmentType = EnvironmentType.UNKNOWN;
|
|
70261
|
+
var environment_default = Environment;
|
|
70262
|
+
|
|
70263
|
+
// compiled/src/logging/logger.js
|
|
70264
|
+
var Logger = class _Logger {
|
|
70265
|
+
/**
|
|
70266
|
+
* Detects environment and initializes wasm callbacks
|
|
70267
|
+
*/
|
|
70268
|
+
static initializeWasmCallbacks() {
|
|
70269
|
+
const environment = environment_default.environmentType;
|
|
70270
|
+
if (environment === EnvironmentType.BROWSER) {
|
|
70271
|
+
const globalScope = window;
|
|
70272
|
+
globalScope.logInfo = _Logger.info;
|
|
70273
|
+
globalScope.logWarning = _Logger.warning;
|
|
70274
|
+
globalScope.logError = _Logger.error;
|
|
70275
|
+
} else if (environment === EnvironmentType.NODE || environment === EnvironmentType.BOTH_FEATURES) {
|
|
70276
|
+
const globalScope = global;
|
|
70277
|
+
globalScope.logInfo = _Logger.info;
|
|
70278
|
+
globalScope.logWarning = _Logger.warning;
|
|
70279
|
+
globalScope.logError = _Logger.error;
|
|
70280
|
+
}
|
|
70281
|
+
}
|
|
70282
|
+
/**
|
|
70283
|
+
*
|
|
70284
|
+
* @param message - log message
|
|
70285
|
+
* @param level - log level
|
|
70286
|
+
* @return {number} log index
|
|
70287
|
+
*/
|
|
70288
|
+
static findLogIndex(message, level) {
|
|
70289
|
+
return _Logger.logs.findIndex((log) => log.message === message && log.level === level);
|
|
70290
|
+
}
|
|
70291
|
+
/**
|
|
70292
|
+
*
|
|
70293
|
+
* @param level - log level
|
|
70294
|
+
* @param message - log message
|
|
70295
|
+
*/
|
|
70296
|
+
static log(level, message) {
|
|
70297
|
+
const baseMessage = message.split(" expressID: ")[0];
|
|
70298
|
+
const data = message.split(" expressID: ")[1];
|
|
70299
|
+
const index = _Logger.findLogIndex(baseMessage, level);
|
|
70300
|
+
let logEntry;
|
|
70301
|
+
if (index >= 0) {
|
|
70302
|
+
_Logger.logs[index].count += 1;
|
|
70303
|
+
if (data !== void 0) {
|
|
70304
|
+
_Logger.logs[index].expressIDs = _Logger.logs[index].expressIDs || /* @__PURE__ */ new Set();
|
|
70305
|
+
_Logger.logs[index].expressIDs.add(data);
|
|
70306
|
+
}
|
|
70307
|
+
logEntry = _Logger.logs[index];
|
|
70308
|
+
} else {
|
|
70309
|
+
logEntry = {
|
|
70310
|
+
level,
|
|
70311
|
+
message: baseMessage,
|
|
70312
|
+
count: 1,
|
|
70313
|
+
expressIDs: data ? /* @__PURE__ */ new Set([data]) : /* @__PURE__ */ new Set()
|
|
70314
|
+
};
|
|
70315
|
+
_Logger.logs.push(logEntry);
|
|
70316
|
+
}
|
|
70317
|
+
_Logger.proxies.forEach((proxy) => proxy.log(logEntry));
|
|
70318
|
+
}
|
|
70319
|
+
/**
|
|
70320
|
+
* Compresses similar logs to a single line
|
|
70321
|
+
*/
|
|
70322
|
+
static compressLogs() {
|
|
70323
|
+
const compressedLogs = [];
|
|
70324
|
+
_Logger.logs.forEach((log) => {
|
|
70325
|
+
const existingLog = compressedLogs.find((l) => l.message === log.message && l.level === log.level);
|
|
70326
|
+
if (existingLog !== void 0) {
|
|
70327
|
+
existingLog.count += log.count;
|
|
70328
|
+
if (log.expressIDs !== void 0) {
|
|
70329
|
+
log.expressIDs.forEach((d) => existingLog.expressIDs?.add(d));
|
|
70330
|
+
}
|
|
70331
|
+
} else {
|
|
70332
|
+
compressedLogs.push({
|
|
70333
|
+
...log,
|
|
70334
|
+
expressIDs: log.expressIDs ? new Set(log.expressIDs) : /* @__PURE__ */ new Set()
|
|
70335
|
+
});
|
|
70336
|
+
}
|
|
70337
|
+
});
|
|
70338
|
+
_Logger.logs = compressedLogs;
|
|
70339
|
+
}
|
|
70340
|
+
/**
|
|
70341
|
+
*
|
|
70342
|
+
* @param proxy - a log proxy
|
|
70343
|
+
*/
|
|
70344
|
+
static addProxy(proxy) {
|
|
70345
|
+
_Logger.proxies.push(proxy);
|
|
70346
|
+
}
|
|
70347
|
+
/**
|
|
70348
|
+
*
|
|
70349
|
+
* @param message - log message
|
|
70350
|
+
*/
|
|
70351
|
+
static info(message) {
|
|
70352
|
+
_Logger.log("info", message);
|
|
70353
|
+
}
|
|
70354
|
+
/**
|
|
70355
|
+
*
|
|
70356
|
+
* @param modelID
|
|
70357
|
+
* @return {Statistics | undefined}
|
|
70358
|
+
*/
|
|
70359
|
+
static getStatistics(modelID) {
|
|
70360
|
+
return this.statistics.get(modelID);
|
|
70361
|
+
}
|
|
70362
|
+
/**
|
|
70363
|
+
* Create the statistics for a model ID.
|
|
70364
|
+
*
|
|
70365
|
+
* @param modelID The model ID to create statistics for
|
|
70366
|
+
*
|
|
70367
|
+
* @return {Statistics} The created statistics object.
|
|
70368
|
+
*/
|
|
70369
|
+
static createStatistics(modelID) {
|
|
70370
|
+
const statistics = new Statistics();
|
|
70371
|
+
this.statistics.set(modelID, statistics);
|
|
70372
|
+
return statistics;
|
|
70373
|
+
}
|
|
70374
|
+
/**
|
|
70375
|
+
*
|
|
70376
|
+
* @param modelID
|
|
70377
|
+
*/
|
|
70378
|
+
static printStatistics(modelID) {
|
|
70379
|
+
const statistics_ = this.statistics.get(modelID);
|
|
70380
|
+
if (statistics_ !== void 0) {
|
|
70381
|
+
statistics_.printStatistics();
|
|
70382
|
+
} else {
|
|
70383
|
+
_Logger.error(`No statistics for modelID: ${modelID}`);
|
|
70384
|
+
}
|
|
70385
|
+
}
|
|
70386
|
+
/**
|
|
70387
|
+
* Compresses the logs if they haven't been compressed,
|
|
70388
|
+
* then returns a list of just the errors.
|
|
70389
|
+
*
|
|
70390
|
+
* @return {LogEntry[]} The errors.
|
|
70391
|
+
*/
|
|
70392
|
+
static getErrors() {
|
|
70393
|
+
_Logger.compressLogs();
|
|
70394
|
+
return this.logs.filter((where) => where.level === "error");
|
|
70395
|
+
}
|
|
70396
|
+
/**
|
|
70397
|
+
*
|
|
70398
|
+
* @param message - log message
|
|
70399
|
+
*/
|
|
70400
|
+
static warning(message) {
|
|
70401
|
+
_Logger.log("warning", message);
|
|
70402
|
+
}
|
|
70403
|
+
/**
|
|
70404
|
+
*
|
|
70405
|
+
* @param message - log message
|
|
70406
|
+
*/
|
|
70407
|
+
static error(message) {
|
|
70408
|
+
_Logger.log("error", message);
|
|
70409
|
+
}
|
|
70410
|
+
/**
|
|
70411
|
+
*
|
|
70412
|
+
* @return {LogEntry[]} - list of logs
|
|
70413
|
+
*/
|
|
70414
|
+
static getLogs() {
|
|
70415
|
+
return _Logger.logs;
|
|
70416
|
+
}
|
|
70417
|
+
/**
|
|
70418
|
+
* display logs in a table
|
|
70419
|
+
*/
|
|
70420
|
+
static displayLogs() {
|
|
70421
|
+
_Logger.compressLogs();
|
|
70422
|
+
console.table(_Logger.logs);
|
|
70423
|
+
}
|
|
70424
|
+
/**
|
|
70425
|
+
* clear logs
|
|
70426
|
+
*/
|
|
70427
|
+
static clearLogs() {
|
|
70428
|
+
_Logger.logs = [];
|
|
70429
|
+
}
|
|
70430
|
+
};
|
|
70431
|
+
Logger.logs = [];
|
|
70432
|
+
Logger.proxies = [];
|
|
70433
|
+
Logger.statistics = /* @__PURE__ */ new Map();
|
|
70434
|
+
var logger_default = Logger;
|
|
70667
70435
|
|
|
70668
70436
|
// compiled/examples/browser.js
|
|
70669
70437
|
environment_default.checkEnvironment();
|