@accordproject/concerto-cto 4.2.0 → 5.0.0-beta.1

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 (66) hide show
  1. package/dist/esm/chunk-ADZEFNZ5.mjs +46 -0
  2. package/dist/esm/chunk-ADZEFNZ5.mjs.map +7 -0
  3. package/dist/esm/chunk-JIDG6RUM.mjs +11851 -0
  4. package/dist/esm/chunk-JIDG6RUM.mjs.map +7 -0
  5. package/dist/esm/chunk-KXXMUWWS.mjs +370 -0
  6. package/dist/esm/chunk-KXXMUWWS.mjs.map +7 -0
  7. package/dist/esm/chunk-N5WVDVIT.mjs +831 -0
  8. package/dist/esm/chunk-N5WVDVIT.mjs.map +7 -0
  9. package/dist/esm/chunk-TXONDDFZ.mjs +53 -0
  10. package/dist/esm/chunk-TXONDDFZ.mjs.map +7 -0
  11. package/dist/esm/chunk-WNU2QZFD.mjs +40 -0
  12. package/dist/esm/chunk-WNU2QZFD.mjs.map +7 -0
  13. package/dist/esm/external.mjs +15 -0
  14. package/dist/esm/external.mjs.map +7 -0
  15. package/dist/esm/index.mjs +23 -0
  16. package/dist/esm/index.mjs.map +7 -0
  17. package/dist/esm/parseexception.mjs +12 -0
  18. package/dist/esm/parseexception.mjs.map +7 -0
  19. package/dist/esm/parserMain.mjs +16 -0
  20. package/dist/esm/parserMain.mjs.map +7 -0
  21. package/dist/esm/printer.mjs +12 -0
  22. package/dist/esm/printer.mjs.map +7 -0
  23. package/dist/esm-browser/chunk-ABBFUZVB.mjs +374 -0
  24. package/dist/esm-browser/chunk-ABBFUZVB.mjs.map +7 -0
  25. package/dist/esm-browser/chunk-E5UYTZNO.mjs +1696 -0
  26. package/dist/esm-browser/chunk-E5UYTZNO.mjs.map +7 -0
  27. package/dist/esm-browser/chunk-MSZDQHW6.mjs +66 -0
  28. package/dist/esm-browser/chunk-MSZDQHW6.mjs.map +7 -0
  29. package/dist/esm-browser/chunk-OMK4IF4X.mjs +48 -0
  30. package/dist/esm-browser/chunk-OMK4IF4X.mjs.map +7 -0
  31. package/dist/esm-browser/chunk-SEXNR5Y5.mjs +11851 -0
  32. package/dist/esm-browser/chunk-SEXNR5Y5.mjs.map +7 -0
  33. package/dist/esm-browser/chunk-VCWYA55K.mjs +933 -0
  34. package/dist/esm-browser/chunk-VCWYA55K.mjs.map +7 -0
  35. package/dist/esm-browser/chunk-YAX4W2RL.mjs +56 -0
  36. package/dist/esm-browser/chunk-YAX4W2RL.mjs.map +7 -0
  37. package/dist/esm-browser/external.mjs +14 -0
  38. package/dist/esm-browser/external.mjs.map +7 -0
  39. package/dist/esm-browser/index.mjs +27 -0
  40. package/dist/esm-browser/index.mjs.map +7 -0
  41. package/dist/esm-browser/parseexception.mjs +10 -0
  42. package/dist/esm-browser/parseexception.mjs.map +7 -0
  43. package/dist/esm-browser/parserMain.mjs +15 -0
  44. package/dist/esm-browser/parserMain.mjs.map +7 -0
  45. package/dist/esm-browser/printer.mjs +11 -0
  46. package/dist/esm-browser/printer.mjs.map +7 -0
  47. package/dist/external.d.ts +11 -5
  48. package/dist/external.js +6 -2
  49. package/dist/external.js.map +1 -1
  50. package/dist/index.d.ts +4 -4
  51. package/dist/index.js +11 -8
  52. package/dist/index.js.map +1 -1
  53. package/dist/parseexception.d.ts +2 -1
  54. package/dist/parseexception.js +6 -4
  55. package/dist/parseexception.js.map +1 -1
  56. package/dist/parser.js +374 -171
  57. package/dist/parser.js.map +1 -1
  58. package/dist/parserMain.d.ts +5 -5
  59. package/dist/parserMain.js +47 -6
  60. package/dist/parserMain.js.map +1 -1
  61. package/dist/printer.d.ts +3 -3
  62. package/dist/printer.js +4 -1
  63. package/dist/printer.js.map +1 -1
  64. package/package.json +19 -11
  65. package/dist/concerto-cto.js +0 -2
  66. package/dist/concerto-cto.js.LICENSE.txt +0 -12
@@ -0,0 +1,831 @@
1
+ import { createRequire as __createRequire } from "module";
2
+ const require = __createRequire(import.meta.url);
3
+ import {
4
+ require_parser
5
+ } from "./chunk-JIDG6RUM.mjs";
6
+ import {
7
+ __commonJS,
8
+ __require,
9
+ __toESM
10
+ } from "./chunk-WNU2QZFD.mjs";
11
+
12
+ // node_modules/ms/index.js
13
+ var require_ms = __commonJS({
14
+ "node_modules/ms/index.js"(exports, module) {
15
+ var s = 1e3;
16
+ var m = s * 60;
17
+ var h = m * 60;
18
+ var d = h * 24;
19
+ var w = d * 7;
20
+ var y = d * 365.25;
21
+ module.exports = function(val, options) {
22
+ options = options || {};
23
+ var type = typeof val;
24
+ if (type === "string" && val.length > 0) {
25
+ return parse2(val);
26
+ } else if (type === "number" && isFinite(val)) {
27
+ return options.long ? fmtLong(val) : fmtShort(val);
28
+ }
29
+ throw new Error(
30
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
31
+ );
32
+ };
33
+ function parse2(str) {
34
+ str = String(str);
35
+ if (str.length > 100) {
36
+ return;
37
+ }
38
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
39
+ str
40
+ );
41
+ if (!match) {
42
+ return;
43
+ }
44
+ var n = parseFloat(match[1]);
45
+ var type = (match[2] || "ms").toLowerCase();
46
+ switch (type) {
47
+ case "years":
48
+ case "year":
49
+ case "yrs":
50
+ case "yr":
51
+ case "y":
52
+ return n * y;
53
+ case "weeks":
54
+ case "week":
55
+ case "w":
56
+ return n * w;
57
+ case "days":
58
+ case "day":
59
+ case "d":
60
+ return n * d;
61
+ case "hours":
62
+ case "hour":
63
+ case "hrs":
64
+ case "hr":
65
+ case "h":
66
+ return n * h;
67
+ case "minutes":
68
+ case "minute":
69
+ case "mins":
70
+ case "min":
71
+ case "m":
72
+ return n * m;
73
+ case "seconds":
74
+ case "second":
75
+ case "secs":
76
+ case "sec":
77
+ case "s":
78
+ return n * s;
79
+ case "milliseconds":
80
+ case "millisecond":
81
+ case "msecs":
82
+ case "msec":
83
+ case "ms":
84
+ return n;
85
+ default:
86
+ return void 0;
87
+ }
88
+ }
89
+ function fmtShort(ms) {
90
+ var msAbs = Math.abs(ms);
91
+ if (msAbs >= d) {
92
+ return Math.round(ms / d) + "d";
93
+ }
94
+ if (msAbs >= h) {
95
+ return Math.round(ms / h) + "h";
96
+ }
97
+ if (msAbs >= m) {
98
+ return Math.round(ms / m) + "m";
99
+ }
100
+ if (msAbs >= s) {
101
+ return Math.round(ms / s) + "s";
102
+ }
103
+ return ms + "ms";
104
+ }
105
+ function fmtLong(ms) {
106
+ var msAbs = Math.abs(ms);
107
+ if (msAbs >= d) {
108
+ return plural(ms, msAbs, d, "day");
109
+ }
110
+ if (msAbs >= h) {
111
+ return plural(ms, msAbs, h, "hour");
112
+ }
113
+ if (msAbs >= m) {
114
+ return plural(ms, msAbs, m, "minute");
115
+ }
116
+ if (msAbs >= s) {
117
+ return plural(ms, msAbs, s, "second");
118
+ }
119
+ return ms + " ms";
120
+ }
121
+ function plural(ms, msAbs, n, name) {
122
+ var isPlural = msAbs >= n * 1.5;
123
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
124
+ }
125
+ }
126
+ });
127
+
128
+ // node_modules/debug/src/common.js
129
+ var require_common = __commonJS({
130
+ "node_modules/debug/src/common.js"(exports, module) {
131
+ function setup(env) {
132
+ createDebug.debug = createDebug;
133
+ createDebug.default = createDebug;
134
+ createDebug.coerce = coerce;
135
+ createDebug.disable = disable;
136
+ createDebug.enable = enable;
137
+ createDebug.enabled = enabled;
138
+ createDebug.humanize = require_ms();
139
+ createDebug.destroy = destroy;
140
+ Object.keys(env).forEach((key) => {
141
+ createDebug[key] = env[key];
142
+ });
143
+ createDebug.names = [];
144
+ createDebug.skips = [];
145
+ createDebug.formatters = {};
146
+ function selectColor(namespace) {
147
+ let hash = 0;
148
+ for (let i = 0; i < namespace.length; i++) {
149
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
150
+ hash |= 0;
151
+ }
152
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
153
+ }
154
+ createDebug.selectColor = selectColor;
155
+ function createDebug(namespace) {
156
+ let prevTime;
157
+ let enableOverride = null;
158
+ let namespacesCache;
159
+ let enabledCache;
160
+ function debug2(...args) {
161
+ if (!debug2.enabled) {
162
+ return;
163
+ }
164
+ const self = debug2;
165
+ const curr = Number(/* @__PURE__ */ new Date());
166
+ const ms = curr - (prevTime || curr);
167
+ self.diff = ms;
168
+ self.prev = prevTime;
169
+ self.curr = curr;
170
+ prevTime = curr;
171
+ args[0] = createDebug.coerce(args[0]);
172
+ if (typeof args[0] !== "string") {
173
+ args.unshift("%O");
174
+ }
175
+ let index = 0;
176
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
177
+ if (match === "%%") {
178
+ return "%";
179
+ }
180
+ index++;
181
+ const formatter = createDebug.formatters[format];
182
+ if (typeof formatter === "function") {
183
+ const val = args[index];
184
+ match = formatter.call(self, val);
185
+ args.splice(index, 1);
186
+ index--;
187
+ }
188
+ return match;
189
+ });
190
+ createDebug.formatArgs.call(self, args);
191
+ const logFn = self.log || createDebug.log;
192
+ logFn.apply(self, args);
193
+ }
194
+ debug2.namespace = namespace;
195
+ debug2.useColors = createDebug.useColors();
196
+ debug2.color = createDebug.selectColor(namespace);
197
+ debug2.extend = extend;
198
+ debug2.destroy = createDebug.destroy;
199
+ Object.defineProperty(debug2, "enabled", {
200
+ enumerable: true,
201
+ configurable: false,
202
+ get: () => {
203
+ if (enableOverride !== null) {
204
+ return enableOverride;
205
+ }
206
+ if (namespacesCache !== createDebug.namespaces) {
207
+ namespacesCache = createDebug.namespaces;
208
+ enabledCache = createDebug.enabled(namespace);
209
+ }
210
+ return enabledCache;
211
+ },
212
+ set: (v) => {
213
+ enableOverride = v;
214
+ }
215
+ });
216
+ if (typeof createDebug.init === "function") {
217
+ createDebug.init(debug2);
218
+ }
219
+ return debug2;
220
+ }
221
+ function extend(namespace, delimiter) {
222
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
223
+ newDebug.log = this.log;
224
+ return newDebug;
225
+ }
226
+ function enable(namespaces) {
227
+ createDebug.save(namespaces);
228
+ createDebug.namespaces = namespaces;
229
+ createDebug.names = [];
230
+ createDebug.skips = [];
231
+ let i;
232
+ const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
233
+ const len = split.length;
234
+ for (i = 0; i < len; i++) {
235
+ if (!split[i]) {
236
+ continue;
237
+ }
238
+ namespaces = split[i].replace(/\*/g, ".*?");
239
+ if (namespaces[0] === "-") {
240
+ createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
241
+ } else {
242
+ createDebug.names.push(new RegExp("^" + namespaces + "$"));
243
+ }
244
+ }
245
+ }
246
+ function disable() {
247
+ const namespaces = [
248
+ ...createDebug.names.map(toNamespace),
249
+ ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
250
+ ].join(",");
251
+ createDebug.enable("");
252
+ return namespaces;
253
+ }
254
+ function enabled(name) {
255
+ if (name[name.length - 1] === "*") {
256
+ return true;
257
+ }
258
+ let i;
259
+ let len;
260
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
261
+ if (createDebug.skips[i].test(name)) {
262
+ return false;
263
+ }
264
+ }
265
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
266
+ if (createDebug.names[i].test(name)) {
267
+ return true;
268
+ }
269
+ }
270
+ return false;
271
+ }
272
+ function toNamespace(regexp) {
273
+ return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
274
+ }
275
+ function coerce(val) {
276
+ if (val instanceof Error) {
277
+ return val.stack || val.message;
278
+ }
279
+ return val;
280
+ }
281
+ function destroy() {
282
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
283
+ }
284
+ createDebug.enable(createDebug.load());
285
+ return createDebug;
286
+ }
287
+ module.exports = setup;
288
+ }
289
+ });
290
+
291
+ // node_modules/debug/src/browser.js
292
+ var require_browser = __commonJS({
293
+ "node_modules/debug/src/browser.js"(exports, module) {
294
+ exports.formatArgs = formatArgs;
295
+ exports.save = save;
296
+ exports.load = load;
297
+ exports.useColors = useColors;
298
+ exports.storage = localstorage();
299
+ exports.destroy = /* @__PURE__ */ (() => {
300
+ let warned = false;
301
+ return () => {
302
+ if (!warned) {
303
+ warned = true;
304
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
305
+ }
306
+ };
307
+ })();
308
+ exports.colors = [
309
+ "#0000CC",
310
+ "#0000FF",
311
+ "#0033CC",
312
+ "#0033FF",
313
+ "#0066CC",
314
+ "#0066FF",
315
+ "#0099CC",
316
+ "#0099FF",
317
+ "#00CC00",
318
+ "#00CC33",
319
+ "#00CC66",
320
+ "#00CC99",
321
+ "#00CCCC",
322
+ "#00CCFF",
323
+ "#3300CC",
324
+ "#3300FF",
325
+ "#3333CC",
326
+ "#3333FF",
327
+ "#3366CC",
328
+ "#3366FF",
329
+ "#3399CC",
330
+ "#3399FF",
331
+ "#33CC00",
332
+ "#33CC33",
333
+ "#33CC66",
334
+ "#33CC99",
335
+ "#33CCCC",
336
+ "#33CCFF",
337
+ "#6600CC",
338
+ "#6600FF",
339
+ "#6633CC",
340
+ "#6633FF",
341
+ "#66CC00",
342
+ "#66CC33",
343
+ "#9900CC",
344
+ "#9900FF",
345
+ "#9933CC",
346
+ "#9933FF",
347
+ "#99CC00",
348
+ "#99CC33",
349
+ "#CC0000",
350
+ "#CC0033",
351
+ "#CC0066",
352
+ "#CC0099",
353
+ "#CC00CC",
354
+ "#CC00FF",
355
+ "#CC3300",
356
+ "#CC3333",
357
+ "#CC3366",
358
+ "#CC3399",
359
+ "#CC33CC",
360
+ "#CC33FF",
361
+ "#CC6600",
362
+ "#CC6633",
363
+ "#CC9900",
364
+ "#CC9933",
365
+ "#CCCC00",
366
+ "#CCCC33",
367
+ "#FF0000",
368
+ "#FF0033",
369
+ "#FF0066",
370
+ "#FF0099",
371
+ "#FF00CC",
372
+ "#FF00FF",
373
+ "#FF3300",
374
+ "#FF3333",
375
+ "#FF3366",
376
+ "#FF3399",
377
+ "#FF33CC",
378
+ "#FF33FF",
379
+ "#FF6600",
380
+ "#FF6633",
381
+ "#FF9900",
382
+ "#FF9933",
383
+ "#FFCC00",
384
+ "#FFCC33"
385
+ ];
386
+ function useColors() {
387
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
388
+ return true;
389
+ }
390
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
391
+ return false;
392
+ }
393
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
394
+ typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
395
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
396
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
397
+ typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
398
+ }
399
+ function formatArgs(args) {
400
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
401
+ if (!this.useColors) {
402
+ return;
403
+ }
404
+ const c = "color: " + this.color;
405
+ args.splice(1, 0, c, "color: inherit");
406
+ let index = 0;
407
+ let lastC = 0;
408
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
409
+ if (match === "%%") {
410
+ return;
411
+ }
412
+ index++;
413
+ if (match === "%c") {
414
+ lastC = index;
415
+ }
416
+ });
417
+ args.splice(lastC, 0, c);
418
+ }
419
+ exports.log = console.debug || console.log || (() => {
420
+ });
421
+ function save(namespaces) {
422
+ try {
423
+ if (namespaces) {
424
+ exports.storage.setItem("debug", namespaces);
425
+ } else {
426
+ exports.storage.removeItem("debug");
427
+ }
428
+ } catch (error) {
429
+ }
430
+ }
431
+ function load() {
432
+ let r;
433
+ try {
434
+ r = exports.storage.getItem("debug");
435
+ } catch (error) {
436
+ }
437
+ if (!r && typeof process !== "undefined" && "env" in process) {
438
+ r = process.env.DEBUG;
439
+ }
440
+ return r;
441
+ }
442
+ function localstorage() {
443
+ try {
444
+ return localStorage;
445
+ } catch (error) {
446
+ }
447
+ }
448
+ module.exports = require_common()(exports);
449
+ var { formatters } = module.exports;
450
+ formatters.j = function(v) {
451
+ try {
452
+ return JSON.stringify(v);
453
+ } catch (error) {
454
+ return "[UnexpectedJSONParseError]: " + error.message;
455
+ }
456
+ };
457
+ }
458
+ });
459
+
460
+ // ../../node_modules/has-flag/index.js
461
+ var require_has_flag = __commonJS({
462
+ "../../node_modules/has-flag/index.js"(exports, module) {
463
+ "use strict";
464
+ module.exports = (flag, argv = process.argv) => {
465
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
466
+ const position = argv.indexOf(prefix + flag);
467
+ const terminatorPosition = argv.indexOf("--");
468
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
469
+ };
470
+ }
471
+ });
472
+
473
+ // node_modules/supports-color/index.js
474
+ var require_supports_color = __commonJS({
475
+ "node_modules/supports-color/index.js"(exports, module) {
476
+ "use strict";
477
+ var os = __require("os");
478
+ var tty = __require("tty");
479
+ var hasFlag = require_has_flag();
480
+ var { env } = process;
481
+ var flagForceColor;
482
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
483
+ flagForceColor = 0;
484
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
485
+ flagForceColor = 1;
486
+ }
487
+ function envForceColor() {
488
+ if ("FORCE_COLOR" in env) {
489
+ if (env.FORCE_COLOR === "true") {
490
+ return 1;
491
+ }
492
+ if (env.FORCE_COLOR === "false") {
493
+ return 0;
494
+ }
495
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
496
+ }
497
+ }
498
+ function translateLevel(level) {
499
+ if (level === 0) {
500
+ return false;
501
+ }
502
+ return {
503
+ level,
504
+ hasBasic: true,
505
+ has256: level >= 2,
506
+ has16m: level >= 3
507
+ };
508
+ }
509
+ function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
510
+ const noFlagForceColor = envForceColor();
511
+ if (noFlagForceColor !== void 0) {
512
+ flagForceColor = noFlagForceColor;
513
+ }
514
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
515
+ if (forceColor === 0) {
516
+ return 0;
517
+ }
518
+ if (sniffFlags) {
519
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
520
+ return 3;
521
+ }
522
+ if (hasFlag("color=256")) {
523
+ return 2;
524
+ }
525
+ }
526
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
527
+ return 0;
528
+ }
529
+ const min = forceColor || 0;
530
+ if (env.TERM === "dumb") {
531
+ return min;
532
+ }
533
+ if (process.platform === "win32") {
534
+ const osRelease = os.release().split(".");
535
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
536
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
537
+ }
538
+ return 1;
539
+ }
540
+ if ("CI" in env) {
541
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
542
+ return 1;
543
+ }
544
+ return min;
545
+ }
546
+ if ("TEAMCITY_VERSION" in env) {
547
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
548
+ }
549
+ if (env.COLORTERM === "truecolor") {
550
+ return 3;
551
+ }
552
+ if ("TERM_PROGRAM" in env) {
553
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
554
+ switch (env.TERM_PROGRAM) {
555
+ case "iTerm.app":
556
+ return version >= 3 ? 3 : 2;
557
+ case "Apple_Terminal":
558
+ return 2;
559
+ }
560
+ }
561
+ if (/-256(color)?$/i.test(env.TERM)) {
562
+ return 2;
563
+ }
564
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
565
+ return 1;
566
+ }
567
+ if ("COLORTERM" in env) {
568
+ return 1;
569
+ }
570
+ return min;
571
+ }
572
+ function getSupportLevel(stream, options = {}) {
573
+ const level = supportsColor(stream, {
574
+ streamIsTTY: stream && stream.isTTY,
575
+ ...options
576
+ });
577
+ return translateLevel(level);
578
+ }
579
+ module.exports = {
580
+ supportsColor: getSupportLevel,
581
+ stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
582
+ stderr: getSupportLevel({ isTTY: tty.isatty(2) })
583
+ };
584
+ }
585
+ });
586
+
587
+ // node_modules/debug/src/node.js
588
+ var require_node = __commonJS({
589
+ "node_modules/debug/src/node.js"(exports, module) {
590
+ var tty = __require("tty");
591
+ var util = __require("util");
592
+ exports.init = init;
593
+ exports.log = log;
594
+ exports.formatArgs = formatArgs;
595
+ exports.save = save;
596
+ exports.load = load;
597
+ exports.useColors = useColors;
598
+ exports.destroy = util.deprecate(
599
+ () => {
600
+ },
601
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
602
+ );
603
+ exports.colors = [6, 2, 3, 4, 5, 1];
604
+ try {
605
+ const supportsColor = require_supports_color();
606
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
607
+ exports.colors = [
608
+ 20,
609
+ 21,
610
+ 26,
611
+ 27,
612
+ 32,
613
+ 33,
614
+ 38,
615
+ 39,
616
+ 40,
617
+ 41,
618
+ 42,
619
+ 43,
620
+ 44,
621
+ 45,
622
+ 56,
623
+ 57,
624
+ 62,
625
+ 63,
626
+ 68,
627
+ 69,
628
+ 74,
629
+ 75,
630
+ 76,
631
+ 77,
632
+ 78,
633
+ 79,
634
+ 80,
635
+ 81,
636
+ 92,
637
+ 93,
638
+ 98,
639
+ 99,
640
+ 112,
641
+ 113,
642
+ 128,
643
+ 129,
644
+ 134,
645
+ 135,
646
+ 148,
647
+ 149,
648
+ 160,
649
+ 161,
650
+ 162,
651
+ 163,
652
+ 164,
653
+ 165,
654
+ 166,
655
+ 167,
656
+ 168,
657
+ 169,
658
+ 170,
659
+ 171,
660
+ 172,
661
+ 173,
662
+ 178,
663
+ 179,
664
+ 184,
665
+ 185,
666
+ 196,
667
+ 197,
668
+ 198,
669
+ 199,
670
+ 200,
671
+ 201,
672
+ 202,
673
+ 203,
674
+ 204,
675
+ 205,
676
+ 206,
677
+ 207,
678
+ 208,
679
+ 209,
680
+ 214,
681
+ 215,
682
+ 220,
683
+ 221
684
+ ];
685
+ }
686
+ } catch (error) {
687
+ }
688
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
689
+ return /^debug_/i.test(key);
690
+ }).reduce((obj, key) => {
691
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
692
+ return k.toUpperCase();
693
+ });
694
+ let val = process.env[key];
695
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
696
+ val = true;
697
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
698
+ val = false;
699
+ } else if (val === "null") {
700
+ val = null;
701
+ } else {
702
+ val = Number(val);
703
+ }
704
+ obj[prop] = val;
705
+ return obj;
706
+ }, {});
707
+ function useColors() {
708
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
709
+ }
710
+ function formatArgs(args) {
711
+ const { namespace: name, useColors: useColors2 } = this;
712
+ if (useColors2) {
713
+ const c = this.color;
714
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
715
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
716
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
717
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
718
+ } else {
719
+ args[0] = getDate() + name + " " + args[0];
720
+ }
721
+ }
722
+ function getDate() {
723
+ if (exports.inspectOpts.hideDate) {
724
+ return "";
725
+ }
726
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
727
+ }
728
+ function log(...args) {
729
+ return process.stderr.write(util.format(...args) + "\n");
730
+ }
731
+ function save(namespaces) {
732
+ if (namespaces) {
733
+ process.env.DEBUG = namespaces;
734
+ } else {
735
+ delete process.env.DEBUG;
736
+ }
737
+ }
738
+ function load() {
739
+ return process.env.DEBUG;
740
+ }
741
+ function init(debug2) {
742
+ debug2.inspectOpts = {};
743
+ const keys = Object.keys(exports.inspectOpts);
744
+ for (let i = 0; i < keys.length; i++) {
745
+ debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
746
+ }
747
+ }
748
+ module.exports = require_common()(exports);
749
+ var { formatters } = module.exports;
750
+ formatters.o = function(v) {
751
+ this.inspectOpts.colors = this.useColors;
752
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
753
+ };
754
+ formatters.O = function(v) {
755
+ this.inspectOpts.colors = this.useColors;
756
+ return util.inspect(v, this.inspectOpts);
757
+ };
758
+ }
759
+ });
760
+
761
+ // node_modules/debug/src/index.js
762
+ var require_src = __commonJS({
763
+ "node_modules/debug/src/index.js"(exports, module) {
764
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
765
+ module.exports = require_browser();
766
+ } else {
767
+ module.exports = require_node();
768
+ }
769
+ }
770
+ });
771
+
772
+ // src/external.ts
773
+ var import_debug = __toESM(require_src());
774
+ var Parser = __toESM(require_parser());
775
+ import * as pathBrowserify from "path-browserify";
776
+ import { DefaultFileLoader, FileDownloader } from "@accordproject/concerto-util";
777
+ import { MetaModelUtil, MetaModelNamespace } from "@accordproject/concerto-metamodel";
778
+ var debugLog = (0, import_debug.default)("concerto:ModelManager");
779
+ function updateModels(models, newModel) {
780
+ const result = {
781
+ $class: `${MetaModelNamespace}.Models`,
782
+ models: []
783
+ };
784
+ const newNamespace = newModel.namespace;
785
+ const priors = models.models;
786
+ let found = false;
787
+ priors.forEach((priorModel) => {
788
+ if (priorModel.namespace === newNamespace) {
789
+ result.models.push(newModel);
790
+ found = true;
791
+ } else {
792
+ result.models.push(priorModel);
793
+ }
794
+ });
795
+ if (!found) {
796
+ result.models.push(newModel);
797
+ }
798
+ return result;
799
+ }
800
+ async function resolveExternal(models, options, fileDownloader) {
801
+ const NAME = "updateExternalModels";
802
+ debugLog(NAME, "updateExternalModels", options);
803
+ const downloader = fileDownloader || createDefaultFileDownloader();
804
+ const externalModelFiles = await downloader.downloadExternalDependencies(models.models, options);
805
+ let result = models;
806
+ externalModelFiles.forEach((mf) => {
807
+ result = updateModels(result, mf);
808
+ });
809
+ return result;
810
+ }
811
+ function createDefaultFileDownloader() {
812
+ const processFile = (name, data) => {
813
+ if (pathBrowserify.extname(name) === ".cto") {
814
+ return Parser.parse(data);
815
+ }
816
+ throw new Error("External model file references are expected to have a .cto extension");
817
+ };
818
+ return new FileDownloader(new DefaultFileLoader(processFile), (file) => MetaModelUtil.getExternalImports(file));
819
+ }
820
+ var External = {
821
+ resolveExternal,
822
+ createDefaultFileDownloader
823
+ };
824
+ var external_default = External;
825
+
826
+ export {
827
+ resolveExternal,
828
+ createDefaultFileDownloader,
829
+ external_default
830
+ };
831
+ //# sourceMappingURL=chunk-N5WVDVIT.mjs.map