@likec4/core 1.32.2 → 1.33.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 (96) hide show
  1. package/dist/builder/index.d.mts +6 -4
  2. package/dist/builder/index.mjs +45 -13
  3. package/dist/compute-view/index.d.mts +6 -4
  4. package/dist/compute-view/index.mjs +33 -10
  5. package/dist/compute-view/relationships-view/index.d.mts +6 -4
  6. package/dist/compute-view/relationships-view/index.mjs +6 -3
  7. package/dist/index.d.mts +9 -138
  8. package/dist/index.mjs +31 -3712
  9. package/dist/model/connection/deployment/index.d.mts +10 -0
  10. package/dist/model/connection/deployment/index.mjs +18 -0
  11. package/dist/model/connection/index.d.mts +70 -0
  12. package/dist/model/connection/index.mjs +23 -0
  13. package/dist/model/connection/model/index.d.mts +10 -0
  14. package/dist/model/connection/model/index.mjs +11 -0
  15. package/dist/model/index.d.mts +14 -256
  16. package/dist/model/index.mjs +27 -5
  17. package/dist/shared/{core.Bdz6fBF1.d.mts → core.1pNeDdRk.d.mts} +92 -81
  18. package/dist/shared/{core.BuO4ncfY.d.mts → core.668kXpZq.d.mts} +42 -52
  19. package/dist/shared/core.8KM0D6va.mjs +33 -0
  20. package/dist/shared/core.B0oEIXqd.mjs +47 -0
  21. package/dist/shared/core.BH9nN-_I.mjs +22 -0
  22. package/dist/shared/core.BMCb0wJI.mjs +177 -0
  23. package/dist/shared/core.BTnf14gD.mjs +331 -0
  24. package/dist/shared/core.BgvIuGGU.mjs +3 -0
  25. package/dist/shared/core.BoyJPEen.mjs +21 -0
  26. package/dist/shared/{core.CUYDgv2-.mjs → core.Br7Fab9l.mjs} +12 -15
  27. package/dist/shared/{core.BrCnZFTn.mjs → core.Btl47GOn.mjs} +3 -3
  28. package/dist/shared/core.ByrmCl9I.mjs +5 -0
  29. package/dist/shared/core.C80Z37Eu.mjs +29 -0
  30. package/dist/shared/{core.Pf5I9o0e.d.mts → core.CF82MWyh.d.mts} +1 -1
  31. package/dist/shared/{core.rmvsy0n3.mjs → core.C_C-3c1S.mjs} +5 -198
  32. package/dist/shared/core.CeQbbp7K.d.mts +41 -0
  33. package/dist/shared/{core.DoK86JEe.mjs → core.CpwrZi3D.mjs} +2 -73
  34. package/dist/shared/{core.CpXlRyE5.mjs → core.CtKXPqN_.mjs} +5 -36
  35. package/dist/shared/core.CxGKeL-L.mjs +144 -0
  36. package/dist/shared/core.CzdwsPmY.d.mts +69 -0
  37. package/dist/shared/{core.Cy9smucx.mjs → core.D4npX2q8.mjs} +1 -3
  38. package/dist/shared/core.D56nCp7e.mjs +168 -0
  39. package/dist/shared/core.D5qVzkws.mjs +724 -0
  40. package/dist/shared/core.DDAPzd3T.d.mts +87 -0
  41. package/dist/shared/{core.CBpKAlhj.mjs → core.DDynPqbh.mjs} +96 -56
  42. package/dist/shared/{core.Bk7wEZFG.mjs → core.DXRAwwDB.mjs} +3 -2
  43. package/dist/shared/core.DcS-0zys.mjs +10 -0
  44. package/dist/shared/{core.CBxTtXMi.d.mts → core.De___iBS.d.mts} +3 -2
  45. package/dist/shared/core.DsMrjY2q.mjs +34 -0
  46. package/dist/shared/core.DuSLYTG6.d.mts +57 -0
  47. package/dist/shared/core.Dy-F3xRP.d.mts +83 -0
  48. package/dist/shared/{core.DaAyklhe.d.mts → core.OLInHaJx.d.mts} +30 -22
  49. package/dist/shared/core.XptQjhMA.mjs +1295 -0
  50. package/dist/shared/{core.cbA9VZ02.mjs → core.hoq9W4rW.mjs} +28 -1073
  51. package/dist/shared/core.zLlww-07.mjs +3 -0
  52. package/dist/theme/index.d.mts +134 -0
  53. package/dist/theme/index.mjs +3709 -0
  54. package/dist/types/aux.d.mts +3 -2
  55. package/dist/types/index.d.mts +9 -5
  56. package/dist/types/index.mjs +17 -146
  57. package/dist/utils/index.d.mts +15 -100
  58. package/dist/utils/index.mjs +25 -1315
  59. package/dist/utils/iterable/index.d.mts +100 -0
  60. package/dist/utils/iterable/index.mjs +24 -0
  61. package/package.json +23 -7
  62. package/src/builder/Builder.ts +13 -4
  63. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -13
  64. package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +2 -6
  65. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -7
  66. package/src/compute-view/deployment-view/__test__/fixture.ts +15 -5
  67. package/src/compute-view/deployment-view/utils.ts +13 -13
  68. package/src/compute-view/dynamic-view/compute.ts +2 -1
  69. package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +2 -2
  70. package/src/compute-view/relationships-view/layout.ts +1 -1
  71. package/src/compute-view/utils/applyCustomElementProperties.ts +8 -0
  72. package/src/compute-view/utils/applyCustomRelationProperties.ts +2 -0
  73. package/src/compute-view/utils/buildComputedNodes.ts +4 -3
  74. package/src/compute-view/utils/merge-props-from-relationships.ts +6 -5
  75. package/src/compute-view/utils/view-hash.ts +24 -3
  76. package/src/model/DeploymentElementModel.ts +20 -16
  77. package/src/model/ElementModel.ts +9 -3
  78. package/src/model/RelationModel.ts +19 -16
  79. package/src/model/index.ts +2 -0
  80. package/src/model/types.ts +1 -0
  81. package/src/model/view/EdgeModel.ts +4 -3
  82. package/src/model/view/LikeC4ViewModel.ts +5 -0
  83. package/src/model/view/NodeModel.ts +4 -2
  84. package/src/theme/index.ts +12 -5
  85. package/src/types/RichText.ts +200 -0
  86. package/src/types/index.ts +2 -0
  87. package/src/types/model-deployment.ts +4 -3
  88. package/src/types/model-logical.ts +3 -3
  89. package/src/types/scalar.ts +47 -2
  90. package/src/types/view-common.ts +1 -1
  91. package/src/types/view-computed.ts +2 -4
  92. package/src/types/view-layouted.ts +9 -0
  93. package/src/utils/index.ts +4 -9
  94. package/src/utils/markdown/index.ts +2 -0
  95. package/src/utils/markdown/to-html.ts +32 -0
  96. package/src/utils/markdown/to-text.ts +14 -0
@@ -1,1316 +1,26 @@
1
- import { i as invariant } from '../shared/core.Cy9smucx.mjs';
2
- export { n as nonNullable, a as nonexhaustive } from '../shared/core.Cy9smucx.mjs';
3
- import { r as requireForeach, a as requireIterator, n } from '../shared/core.CpXlRyE5.mjs';
4
- export { S as Stack, c as commonHead, e as iflat, i as isIterable, b as iunique, o as objectHash } from '../shared/core.CpXlRyE5.mjs';
5
- import { g as getDefaultExportFromCjs, t, k as commonAncestor, q as compareFqnHierarchically } from '../shared/core.rmvsy0n3.mjs';
6
- export { D as DefaultMap, l as ancestorsFqn, h as compareByFqnHierarchically, m as compareNatural, o as compareNaturalHierarchically, r as hierarchyDistance, u as hierarchyLevel, b as ifilter, a as isAncestor, i as isDescendantOf, c as isNonEmptyArray, d as isSameHierarchy, w as isString, n as nameFromFqn, p as parentFqn, j as sortByFqnHierarchically, v as sortNaturalByFqn, s as sortParentsFirst } from '../shared/core.rmvsy0n3.mjs';
7
- export { d as difference, j as equalsSet, g as getOrCreate, i as hasAtLeast, c as ifind, e as ihead, a as intersection, b as isome, f as memoizeProp, k as stringHash, s as symmetricDifference, u as union } from '../shared/core.DoK86JEe.mjs';
8
- export { i as imap, a as toArray, t as toSet } from '../shared/core.BrCnZFTn.mjs';
1
+ export { i as invariant, a as nonNullable, n as nonexhaustive } from '../shared/core.D4npX2q8.mjs';
2
+ export { S as Stack, c as commonHead, o as objectHash } from '../shared/core.CtKXPqN_.mjs';
3
+ export { b as ancestorsFqn, d as commonAncestor, e as compareByFqnHierarchically, f as compareFqnHierarchically, c as compareNatural, a as compareNaturalHierarchically, h as hierarchyDistance, g as hierarchyLevel, i as isAncestor, j as isDescendantOf, o as isNonEmptyArray, k as isSameHierarchy, q as isString, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, l as sortNaturalByFqn, m as sortParentsFirst } from '../shared/core.C_C-3c1S.mjs';
4
+ export { g as getOrCreate } from '../shared/core.DcS-0zys.mjs';
5
+ export { a as markdownToHtml, b as markdownToText, m as memoizeProp } from '../shared/core.B0oEIXqd.mjs';
6
+ export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue, c as compareRelations, a as delay, p as promiseNextTick } from '../shared/core.XptQjhMA.mjs';
7
+ export { d as difference, e as equalsSet, i as hasAtLeast, a as intersection, b as stringHash, s as symmetricDifference, u as union } from '../shared/core.CpwrZi3D.mjs';
8
+ export { D as DefaultMap } from '../shared/core.BMCb0wJI.mjs';
9
+ export { i as ifilter } from '../shared/core.BH9nN-_I.mjs';
10
+ export { i as ifind, a as ihead } from '../shared/core.DsMrjY2q.mjs';
11
+ export { i as iflat, a as isIterable, b as iunique } from '../shared/core.8KM0D6va.mjs';
12
+ export { i as imap, t as toArray, a as toSet } from '../shared/core.Btl47GOn.mjs';
13
+ export { ireduce } from './iterable/index.mjs';
14
+ export { i as isome } from '../shared/core.BoyJPEen.mjs';
9
15
  import '../shared/core.DbRvwARP.mjs';
10
-
11
- function o(r,n){let e=Math.ceil(r),t=Math.floor(n);if(t<e)throw new RangeError(`randomInteger: The range [${r.toString()},${n.toString()}] contains no integer`);return Math.floor(Math.random()*(t-e+1)+e)}
12
-
13
- /**
14
- * Mnemonist BiMap
15
- * ================
16
- *
17
- * JavaScript implementation of a BiMap.
18
- */
19
-
20
- var biMap$1;
21
- var hasRequiredBiMap;
22
-
23
- function requireBiMap () {
24
- if (hasRequiredBiMap) return biMap$1;
25
- hasRequiredBiMap = 1;
26
- var forEach = requireForeach();
27
-
28
- /**
29
- * Inverse Map.
30
- *
31
- * @constructor
32
- */
33
- function InverseMap(original) {
34
-
35
- this.size = 0;
36
- this.items = new Map();
37
- this.inverse = original;
38
- }
39
-
40
- /**
41
- * BiMap.
42
- *
43
- * @constructor
44
- */
45
- function BiMap() {
46
-
47
- this.size = 0;
48
- this.items = new Map();
49
- this.inverse = new InverseMap(this);
50
- }
51
-
52
- /**
53
- * Method used to clear the map.
54
- *
55
- * @return {undefined}
56
- */
57
- function clear() {
58
- this.size = 0;
59
- this.items.clear();
60
- this.inverse.items.clear();
61
- }
62
-
63
- BiMap.prototype.clear = clear;
64
- InverseMap.prototype.clear = clear;
65
-
66
- /**
67
- * Method used to set a relation.
68
- *
69
- * @param {any} key - Key.
70
- * @param {any} value - Value.
71
- * @return {BiMap|InverseMap}
72
- */
73
- function set(key, value) {
74
-
75
- // First we need to attempt to see if the relation is not flawed
76
- if (this.items.has(key)) {
77
- var currentValue = this.items.get(key);
78
-
79
- // The relation already exists, we do nothing
80
- if (currentValue === value)
81
- return this;
82
- else
83
- this.inverse.items.delete(currentValue);
84
- }
85
-
86
- if (this.inverse.items.has(value)) {
87
- var currentKey = this.inverse.items.get(value);
88
-
89
- if (currentKey === key)
90
- return this;
91
- else
92
- this.items.delete(currentKey);
93
- }
94
-
95
- // Here we actually add the relation
96
- this.items.set(key, value);
97
- this.inverse.items.set(value, key);
98
-
99
- // Size
100
- this.size = this.items.size;
101
- this.inverse.size = this.inverse.items.size;
102
-
103
- return this;
104
- }
105
-
106
- BiMap.prototype.set = set;
107
- InverseMap.prototype.set = set;
108
-
109
- /**
110
- * Method used to delete a relation.
111
- *
112
- * @param {any} key - Key.
113
- * @return {boolean}
114
- */
115
- function del(key) {
116
- if (this.items.has(key)) {
117
- var currentValue = this.items.get(key);
118
-
119
- this.items.delete(key);
120
- this.inverse.items.delete(currentValue);
121
-
122
- // Size
123
- this.size = this.items.size;
124
- this.inverse.size = this.inverse.items.size;
125
-
126
- return true;
127
- }
128
-
129
- return false;
130
- }
131
-
132
- BiMap.prototype.delete = del;
133
- InverseMap.prototype.delete = del;
134
-
135
- /**
136
- * Mapping some Map prototype function unto our two classes.
137
- */
138
- var METHODS = ['has', 'get', 'forEach', 'keys', 'values', 'entries'];
139
-
140
- METHODS.forEach(function(name) {
141
- BiMap.prototype[name] = InverseMap.prototype[name] = function() {
142
- return Map.prototype[name].apply(this.items, arguments);
143
- };
144
- });
145
-
146
- /**
147
- * Attaching the #.values method to Symbol.iterator if possible.
148
- */
149
- if (typeof Symbol !== 'undefined') {
150
- BiMap.prototype[Symbol.iterator] = BiMap.prototype.entries;
151
- InverseMap.prototype[Symbol.iterator] = InverseMap.prototype.entries;
152
- }
153
-
154
- /**
155
- * Convenience known methods.
156
- */
157
- BiMap.prototype.inspect = function() {
158
- var dummy = {
159
- left: this.items,
160
- right: this.inverse.items
161
- };
162
-
163
- // Trick so that node displays the name of the constructor
164
- Object.defineProperty(dummy, 'constructor', {
165
- value: BiMap,
166
- enumerable: false
167
- });
168
-
169
- return dummy;
170
- };
171
-
172
- if (typeof Symbol !== 'undefined')
173
- BiMap.prototype[Symbol.for('nodejs.util.inspect.custom')] = BiMap.prototype.inspect;
174
-
175
- InverseMap.prototype.inspect = function() {
176
- var dummy = {
177
- left: this.inverse.items,
178
- right: this.items
179
- };
180
-
181
- // Trick so that node displays the name of the constructor
182
- Object.defineProperty(dummy, 'constructor', {
183
- value: InverseMap,
184
- enumerable: false
185
- });
186
-
187
- return dummy;
188
- };
189
-
190
- if (typeof Symbol !== 'undefined')
191
- InverseMap.prototype[Symbol.for('nodejs.util.inspect.custom')] = InverseMap.prototype.inspect;
192
-
193
-
194
- /**
195
- * Static @.from function taking an arbitrary iterable & converting it into
196
- * a bimap.
197
- *
198
- * @param {Iterable} iterable - Target iterable.
199
- * @return {BiMap}
200
- */
201
- BiMap.from = function(iterable) {
202
- var bimap = new BiMap();
203
-
204
- forEach(iterable, function(value, key) {
205
- bimap.set(key, value);
206
- });
207
-
208
- return bimap;
209
- };
210
-
211
- /**
212
- * Exporting.
213
- */
214
- biMap$1 = BiMap;
215
- return biMap$1;
216
- }
217
-
218
- var biMapExports = /*@__PURE__*/ requireBiMap();
219
- const biMap = /*@__PURE__*/getDefaultExportFromCjs(biMapExports);
220
-
221
- /**
222
- * Mnemonist DefaultWeakMap
223
- * =========================
224
- *
225
- * JavaScript implementation of a default weak map that will return a constructed
226
- * value any time one tries to access an non-existing key. It is similar to
227
- * DefaultMap but uses ES6 WeakMap that only holds weak reference to keys.
228
- */
229
-
230
- var defaultWeakMap$1;
231
- var hasRequiredDefaultWeakMap;
232
-
233
- function requireDefaultWeakMap () {
234
- if (hasRequiredDefaultWeakMap) return defaultWeakMap$1;
235
- hasRequiredDefaultWeakMap = 1;
236
- /**
237
- * DefaultWeakMap.
238
- *
239
- * @constructor
240
- */
241
- function DefaultWeakMap(factory) {
242
- if (typeof factory !== 'function')
243
- throw new Error('mnemonist/DefaultWeakMap.constructor: expecting a function.');
244
-
245
- this.items = new WeakMap();
246
- this.factory = factory;
247
- }
248
-
249
- /**
250
- * Method used to clear the structure.
251
- *
252
- * @return {undefined}
253
- */
254
- DefaultWeakMap.prototype.clear = function() {
255
-
256
- // Properties
257
- this.items = new WeakMap();
258
- };
259
-
260
- /**
261
- * Method used to get the value set for given key. If the key does not exist,
262
- * the value will be created using the provided factory.
263
- *
264
- * @param {any} key - Target key.
265
- * @return {any}
266
- */
267
- DefaultWeakMap.prototype.get = function(key) {
268
- var value = this.items.get(key);
269
-
270
- if (typeof value === 'undefined') {
271
- value = this.factory(key);
272
- this.items.set(key, value);
273
- }
274
-
275
- return value;
276
- };
277
-
278
- /**
279
- * Method used to get the value set for given key. If the key does not exist,
280
- * a value won't be created.
281
- *
282
- * @param {any} key - Target key.
283
- * @return {any}
284
- */
285
- DefaultWeakMap.prototype.peek = function(key) {
286
- return this.items.get(key);
287
- };
288
-
289
- /**
290
- * Method used to set a value for given key.
291
- *
292
- * @param {any} key - Target key.
293
- * @param {any} value - Value.
294
- * @return {DefaultMap}
295
- */
296
- DefaultWeakMap.prototype.set = function(key, value) {
297
- this.items.set(key, value);
298
- return this;
299
- };
300
-
301
- /**
302
- * Method used to test the existence of a key in the map.
303
- *
304
- * @param {any} key - Target key.
305
- * @return {boolean}
306
- */
307
- DefaultWeakMap.prototype.has = function(key) {
308
- return this.items.has(key);
309
- };
310
-
311
- /**
312
- * Method used to delete target key.
313
- *
314
- * @param {any} key - Target key.
315
- * @return {boolean}
316
- */
317
- DefaultWeakMap.prototype.delete = function(key) {
318
- return this.items.delete(key);
319
- };
320
-
321
- /**
322
- * Convenience known methods.
323
- */
324
- DefaultWeakMap.prototype.inspect = function() {
325
- return this.items;
326
- };
327
-
328
- if (typeof Symbol !== 'undefined')
329
- DefaultWeakMap.prototype[Symbol.for('nodejs.util.inspect.custom')] = DefaultWeakMap.prototype.inspect;
330
-
331
- /**
332
- * Exporting.
333
- */
334
- defaultWeakMap$1 = DefaultWeakMap;
335
- return defaultWeakMap$1;
336
- }
337
-
338
- var defaultWeakMapExports = /*@__PURE__*/ requireDefaultWeakMap();
339
- const defaultWeakMap = /*@__PURE__*/getDefaultExportFromCjs(defaultWeakMapExports);
340
-
341
- /**
342
- * Mnemonist Linked List
343
- * ======================
344
- *
345
- * Singly linked list implementation. Uses raw JavaScript objects as nodes
346
- * as benchmarks proved it was the fastest thing to do.
347
- */
348
-
349
- var linkedList$1;
350
- var hasRequiredLinkedList;
351
-
352
- function requireLinkedList () {
353
- if (hasRequiredLinkedList) return linkedList$1;
354
- hasRequiredLinkedList = 1;
355
- var Iterator = requireIterator(),
356
- forEach = requireForeach();
357
-
358
- /**
359
- * Linked List.
360
- *
361
- * @constructor
362
- */
363
- function LinkedList() {
364
- this.clear();
365
- }
366
-
367
- /**
368
- * Method used to clear the list.
369
- *
370
- * @return {undefined}
371
- */
372
- LinkedList.prototype.clear = function() {
373
-
374
- // Properties
375
- this.head = null;
376
- this.tail = null;
377
- this.size = 0;
378
- };
379
-
380
- /**
381
- * Method used to get the first item of the list.
382
- *
383
- * @return {any}
384
- */
385
- LinkedList.prototype.first = function() {
386
- return this.head ? this.head.item : undefined;
387
- };
388
- LinkedList.prototype.peek = LinkedList.prototype.first;
389
-
390
- /**
391
- * Method used to get the last item of the list.
392
- *
393
- * @return {any}
394
- */
395
- LinkedList.prototype.last = function() {
396
- return this.tail ? this.tail.item : undefined;
397
- };
398
-
399
- /**
400
- * Method used to add an item at the end of the list.
401
- *
402
- * @param {any} item - The item to add.
403
- * @return {number}
404
- */
405
- LinkedList.prototype.push = function(item) {
406
- var node = {item: item, next: null};
407
-
408
- if (!this.head) {
409
- this.head = node;
410
- this.tail = node;
411
- }
412
- else {
413
- this.tail.next = node;
414
- this.tail = node;
415
- }
416
-
417
- this.size++;
418
-
419
- return this.size;
420
- };
421
-
422
- /**
423
- * Method used to add an item at the beginning of the list.
424
- *
425
- * @param {any} item - The item to add.
426
- * @return {number}
427
- */
428
- LinkedList.prototype.unshift = function(item) {
429
- var node = {item: item, next: null};
430
-
431
- if (!this.head) {
432
- this.head = node;
433
- this.tail = node;
434
- }
435
- else {
436
- if (!this.head.next)
437
- this.tail = this.head;
438
- node.next = this.head;
439
- this.head = node;
440
- }
441
-
442
- this.size++;
443
-
444
- return this.size;
445
- };
446
-
447
- /**
448
- * Method used to retrieve & remove the first item of the list.
449
- *
450
- * @return {any}
451
- */
452
- LinkedList.prototype.shift = function() {
453
- if (!this.size)
454
- return undefined;
455
-
456
- var node = this.head;
457
-
458
- this.head = node.next;
459
- this.size--;
460
-
461
- return node.item;
462
- };
463
-
464
- /**
465
- * Method used to iterate over the list.
466
- *
467
- * @param {function} callback - Function to call for each item.
468
- * @param {object} scope - Optional scope.
469
- * @return {undefined}
470
- */
471
- LinkedList.prototype.forEach = function(callback, scope) {
472
- if (!this.size)
473
- return;
474
-
475
- scope = arguments.length > 1 ? scope : this;
476
-
477
- var n = this.head,
478
- i = 0;
479
-
480
- while (n) {
481
- callback.call(scope, n.item, i, this);
482
- n = n.next;
483
- i++;
484
- }
485
- };
486
-
487
- /**
488
- * Method used to convert the list into an array.
489
- *
490
- * @return {array}
491
- */
492
- LinkedList.prototype.toArray = function() {
493
- if (!this.size)
494
- return [];
495
-
496
- var array = new Array(this.size);
497
-
498
- for (var i = 0, l = this.size, n = this.head; i < l; i++) {
499
- array[i] = n.item;
500
- n = n.next;
501
- }
502
-
503
- return array;
504
- };
505
-
506
- /**
507
- * Method used to create an iterator over a list's values.
508
- *
509
- * @return {Iterator}
510
- */
511
- LinkedList.prototype.values = function() {
512
- var n = this.head;
513
-
514
- return new Iterator(function() {
515
- if (!n)
516
- return {
517
- done: true
518
- };
519
-
520
- var value = n.item;
521
- n = n.next;
522
-
523
- return {
524
- value: value,
525
- done: false
526
- };
527
- });
528
- };
529
-
530
- /**
531
- * Method used to create an iterator over a list's entries.
532
- *
533
- * @return {Iterator}
534
- */
535
- LinkedList.prototype.entries = function() {
536
- var n = this.head,
537
- i = 0;
538
-
539
- return new Iterator(function() {
540
- if (!n)
541
- return {
542
- done: true
543
- };
544
-
545
- var value = n.item;
546
- n = n.next;
547
- i++;
548
-
549
- return {
550
- value: [i - 1, value],
551
- done: false
552
- };
553
- });
554
- };
555
-
556
- /**
557
- * Attaching the #.values method to Symbol.iterator if possible.
558
- */
559
- if (typeof Symbol !== 'undefined')
560
- LinkedList.prototype[Symbol.iterator] = LinkedList.prototype.values;
561
-
562
- /**
563
- * Convenience known methods.
564
- */
565
- LinkedList.prototype.toString = function() {
566
- return this.toArray().join(',');
567
- };
568
-
569
- LinkedList.prototype.toJSON = function() {
570
- return this.toArray();
571
- };
572
-
573
- LinkedList.prototype.inspect = function() {
574
- var array = this.toArray();
575
-
576
- // Trick so that node displays the name of the constructor
577
- Object.defineProperty(array, 'constructor', {
578
- value: LinkedList,
579
- enumerable: false
580
- });
581
-
582
- return array;
583
- };
584
-
585
- if (typeof Symbol !== 'undefined')
586
- LinkedList.prototype[Symbol.for('nodejs.util.inspect.custom')] = LinkedList.prototype.inspect;
587
-
588
- /**
589
- * Static @.from function taking an arbitrary iterable & converting it into
590
- * a list.
591
- *
592
- * @param {Iterable} iterable - Target iterable.
593
- * @return {LinkedList}
594
- */
595
- LinkedList.from = function(iterable) {
596
- var list = new LinkedList();
597
-
598
- forEach(iterable, function(value) {
599
- list.push(value);
600
- });
601
-
602
- return list;
603
- };
604
-
605
- /**
606
- * Exporting.
607
- */
608
- linkedList$1 = LinkedList;
609
- return linkedList$1;
610
- }
611
-
612
- var linkedListExports = /*@__PURE__*/ requireLinkedList();
613
- const linkedList = /*@__PURE__*/getDefaultExportFromCjs(linkedListExports);
614
-
615
- /**
616
- * Mnemonist MultiMap
617
- * ===================
618
- *
619
- * Implementation of a MultiMap with custom container.
620
- */
621
-
622
- var multiMap$1;
623
- var hasRequiredMultiMap;
624
-
625
- function requireMultiMap () {
626
- if (hasRequiredMultiMap) return multiMap$1;
627
- hasRequiredMultiMap = 1;
628
- var Iterator = requireIterator(),
629
- forEach = requireForeach();
630
-
631
- /**
632
- * MultiMap.
633
- *
634
- * @constructor
635
- */
636
- function MultiMap(Container) {
637
-
638
- this.Container = Container || Array;
639
- this.items = new Map();
640
- this.clear();
641
-
642
- Object.defineProperty(this.items, 'constructor', {
643
- value: MultiMap,
644
- enumerable: false
645
- });
646
- }
647
-
648
- /**
649
- * Method used to clear the structure.
650
- *
651
- * @return {undefined}
652
- */
653
- MultiMap.prototype.clear = function() {
654
-
655
- // Properties
656
- this.size = 0;
657
- this.dimension = 0;
658
- this.items.clear();
659
- };
660
-
661
- /**
662
- * Method used to set a value.
663
- *
664
- * @param {any} key - Key.
665
- * @param {any} value - Value to add.
666
- * @return {MultiMap}
667
- */
668
- MultiMap.prototype.set = function(key, value) {
669
- var container = this.items.get(key),
670
- sizeBefore;
671
-
672
- if (!container) {
673
- this.dimension++;
674
- container = new this.Container();
675
- this.items.set(key, container);
676
- }
677
-
678
- if (this.Container === Set) {
679
- sizeBefore = container.size;
680
- container.add(value);
681
-
682
- if (sizeBefore < container.size)
683
- this.size++;
684
- }
685
- else {
686
- container.push(value);
687
- this.size++;
688
- }
689
-
690
- return this;
691
- };
692
-
693
- /**
694
- * Method used to delete the given key.
695
- *
696
- * @param {any} key - Key to delete.
697
- * @return {boolean}
698
- */
699
- MultiMap.prototype.delete = function(key) {
700
- var container = this.items.get(key);
701
-
702
- if (!container)
703
- return false;
704
-
705
- this.size -= (this.Container === Set ? container.size : container.length);
706
- this.dimension--;
707
- this.items.delete(key);
708
-
709
- return true;
710
- };
711
-
712
- /**
713
- * Method used to delete the remove an item in the container stored at the
714
- * given key.
715
- *
716
- * @param {any} key - Key to delete.
717
- * @return {boolean}
718
- */
719
- MultiMap.prototype.remove = function(key, value) {
720
- var container = this.items.get(key),
721
- wasDeleted,
722
- index;
723
-
724
- if (!container)
725
- return false;
726
-
727
- if (this.Container === Set) {
728
- wasDeleted = container.delete(value);
729
-
730
- if (wasDeleted)
731
- this.size--;
732
-
733
- if (container.size === 0) {
734
- this.items.delete(key);
735
- this.dimension--;
736
- }
737
-
738
- return wasDeleted;
739
- }
740
- else {
741
- index = container.indexOf(value);
742
-
743
- if (index === -1)
744
- return false;
745
-
746
- this.size--;
747
-
748
- if (container.length === 1) {
749
- this.items.delete(key);
750
- this.dimension--;
751
-
752
- return true;
753
- }
754
-
755
- container.splice(index, 1);
756
-
757
- return true;
758
- }
759
- };
760
-
761
- /**
762
- * Method used to return whether the given keys exists in the map.
763
- *
764
- * @param {any} key - Key to check.
765
- * @return {boolean}
766
- */
767
- MultiMap.prototype.has = function(key) {
768
- return this.items.has(key);
769
- };
770
-
771
- /**
772
- * Method used to return the container stored at the given key or `undefined`.
773
- *
774
- * @param {any} key - Key to get.
775
- * @return {boolean}
776
- */
777
- MultiMap.prototype.get = function(key) {
778
- return this.items.get(key);
779
- };
780
-
781
- /**
782
- * Method used to return the multiplicity of the given key, meaning the number
783
- * of times it is set, or, more trivially, the size of the attached container.
784
- *
785
- * @param {any} key - Key to check.
786
- * @return {number}
787
- */
788
- MultiMap.prototype.multiplicity = function(key) {
789
- var container = this.items.get(key);
790
-
791
- if (typeof container === 'undefined')
792
- return 0;
793
-
794
- return this.Container === Set ? container.size : container.length;
795
- };
796
- MultiMap.prototype.count = MultiMap.prototype.multiplicity;
797
-
798
- /**
799
- * Method used to iterate over each of the key/value pairs.
800
- *
801
- * @param {function} callback - Function to call for each item.
802
- * @param {object} scope - Optional scope.
803
- * @return {undefined}
804
- */
805
- MultiMap.prototype.forEach = function(callback, scope) {
806
- scope = arguments.length > 1 ? scope : this;
807
-
808
- // Inner iteration function is created here to avoid creating it in the loop
809
- var key;
810
- function inner(value) {
811
- callback.call(scope, value, key);
812
- }
813
-
814
- this.items.forEach(function(container, k) {
815
- key = k;
816
- container.forEach(inner);
817
- });
818
- };
819
-
820
- /**
821
- * Method used to iterate over each of the associations.
822
- *
823
- * @param {function} callback - Function to call for each item.
824
- * @param {object} scope - Optional scope.
825
- * @return {undefined}
826
- */
827
- MultiMap.prototype.forEachAssociation = function(callback, scope) {
828
- scope = arguments.length > 1 ? scope : this;
829
-
830
- this.items.forEach(callback, scope);
831
- };
832
-
833
- /**
834
- * Method returning an iterator over the map's keys.
835
- *
836
- * @return {Iterator}
837
- */
838
- MultiMap.prototype.keys = function() {
839
- return this.items.keys();
840
- };
841
-
842
- /**
843
- * Method returning an iterator over the map's keys.
844
- *
845
- * @return {Iterator}
846
- */
847
- MultiMap.prototype.values = function() {
848
- var iterator = this.items.values(),
849
- inContainer = false,
850
- countainer,
851
- step,
852
- i,
853
- l;
854
-
855
- if (this.Container === Set)
856
- return new Iterator(function next() {
857
- if (!inContainer) {
858
- step = iterator.next();
859
-
860
- if (step.done)
861
- return {done: true};
862
-
863
- inContainer = true;
864
- countainer = step.value.values();
865
- }
866
-
867
- step = countainer.next();
868
-
869
- if (step.done) {
870
- inContainer = false;
871
- return next();
872
- }
873
-
874
- return {
875
- done: false,
876
- value: step.value
877
- };
878
- });
879
-
880
- return new Iterator(function next() {
881
- if (!inContainer) {
882
- step = iterator.next();
883
-
884
- if (step.done)
885
- return {done: true};
886
-
887
- inContainer = true;
888
- countainer = step.value;
889
- i = 0;
890
- l = countainer.length;
891
- }
892
-
893
- if (i >= l) {
894
- inContainer = false;
895
- return next();
896
- }
897
-
898
- return {
899
- done: false,
900
- value: countainer[i++]
901
- };
902
- });
903
- };
904
-
905
- /**
906
- * Method returning an iterator over the map's entries.
907
- *
908
- * @return {Iterator}
909
- */
910
- MultiMap.prototype.entries = function() {
911
- var iterator = this.items.entries(),
912
- inContainer = false,
913
- countainer,
914
- step,
915
- key,
916
- i,
917
- l;
918
-
919
- if (this.Container === Set)
920
- return new Iterator(function next() {
921
- if (!inContainer) {
922
- step = iterator.next();
923
-
924
- if (step.done)
925
- return {done: true};
926
-
927
- inContainer = true;
928
- key = step.value[0];
929
- countainer = step.value[1].values();
930
- }
931
-
932
- step = countainer.next();
933
-
934
- if (step.done) {
935
- inContainer = false;
936
- return next();
937
- }
938
-
939
- return {
940
- done: false,
941
- value: [key, step.value]
942
- };
943
- });
944
-
945
- return new Iterator(function next() {
946
- if (!inContainer) {
947
- step = iterator.next();
948
-
949
- if (step.done)
950
- return {done: true};
951
-
952
- inContainer = true;
953
- key = step.value[0];
954
- countainer = step.value[1];
955
- i = 0;
956
- l = countainer.length;
957
- }
958
-
959
- if (i >= l) {
960
- inContainer = false;
961
- return next();
962
- }
963
-
964
- return {
965
- done: false,
966
- value: [key, countainer[i++]]
967
- };
968
- });
969
- };
970
-
971
- /**
972
- * Method returning an iterator over the map's containers.
973
- *
974
- * @return {Iterator}
975
- */
976
- MultiMap.prototype.containers = function() {
977
- return this.items.values();
978
- };
979
-
980
- /**
981
- * Method returning an iterator over the map's associations.
982
- *
983
- * @return {Iterator}
984
- */
985
- MultiMap.prototype.associations = function() {
986
- return this.items.entries();
987
- };
988
-
989
- /**
990
- * Attaching the #.entries method to Symbol.iterator if possible.
991
- */
992
- if (typeof Symbol !== 'undefined')
993
- MultiMap.prototype[Symbol.iterator] = MultiMap.prototype.entries;
994
-
995
- /**
996
- * Convenience known methods.
997
- */
998
- MultiMap.prototype.inspect = function() {
999
- return this.items;
1000
- };
1001
-
1002
- if (typeof Symbol !== 'undefined')
1003
- MultiMap.prototype[Symbol.for('nodejs.util.inspect.custom')] = MultiMap.prototype.inspect;
1004
- MultiMap.prototype.toJSON = function() {
1005
- return this.items;
1006
- };
1007
-
1008
- /**
1009
- * Static @.from function taking an arbitrary iterable & converting it into
1010
- * a structure.
1011
- *
1012
- * @param {Iterable} iterable - Target iterable.
1013
- * @param {Class} Container - Container.
1014
- * @return {MultiMap}
1015
- */
1016
- MultiMap.from = function(iterable, Container) {
1017
- var map = new MultiMap(Container);
1018
-
1019
- forEach(iterable, function(value, key) {
1020
- map.set(key, value);
1021
- });
1022
-
1023
- return map;
1024
- };
1025
-
1026
- /**
1027
- * Exporting.
1028
- */
1029
- multiMap$1 = MultiMap;
1030
- return multiMap$1;
1031
- }
1032
-
1033
- var multiMapExports = /*@__PURE__*/ requireMultiMap();
1034
- const multiMap = /*@__PURE__*/getDefaultExportFromCjs(multiMapExports);
1035
-
1036
- /**
1037
- * Mnemonist Queue
1038
- * ================
1039
- *
1040
- * Queue implementation based on the ideas of Queue.js that seems to beat
1041
- * a LinkedList one in performance.
1042
- */
1043
-
1044
- var queue$1;
1045
- var hasRequiredQueue;
1046
-
1047
- function requireQueue () {
1048
- if (hasRequiredQueue) return queue$1;
1049
- hasRequiredQueue = 1;
1050
- var Iterator = requireIterator(),
1051
- forEach = requireForeach();
1052
-
1053
- /**
1054
- * Queue
1055
- *
1056
- * @constructor
1057
- */
1058
- function Queue() {
1059
- this.clear();
1060
- }
1061
-
1062
- /**
1063
- * Method used to clear the queue.
1064
- *
1065
- * @return {undefined}
1066
- */
1067
- Queue.prototype.clear = function() {
1068
-
1069
- // Properties
1070
- this.items = [];
1071
- this.offset = 0;
1072
- this.size = 0;
1073
- };
1074
-
1075
- /**
1076
- * Method used to add an item to the queue.
1077
- *
1078
- * @param {any} item - Item to enqueue.
1079
- * @return {number}
1080
- */
1081
- Queue.prototype.enqueue = function(item) {
1082
-
1083
- this.items.push(item);
1084
- return ++this.size;
1085
- };
1086
-
1087
- /**
1088
- * Method used to retrieve & remove the first item of the queue.
1089
- *
1090
- * @return {any}
1091
- */
1092
- Queue.prototype.dequeue = function() {
1093
- if (!this.size)
1094
- return;
1095
-
1096
- var item = this.items[this.offset];
1097
-
1098
- if (++this.offset * 2 >= this.items.length) {
1099
- this.items = this.items.slice(this.offset);
1100
- this.offset = 0;
1101
- }
1102
-
1103
- this.size--;
1104
-
1105
- return item;
1106
- };
1107
-
1108
- /**
1109
- * Method used to retrieve the first item of the queue.
1110
- *
1111
- * @return {any}
1112
- */
1113
- Queue.prototype.peek = function() {
1114
- if (!this.size)
1115
- return;
1116
-
1117
- return this.items[this.offset];
1118
- };
1119
-
1120
- /**
1121
- * Method used to iterate over the queue.
1122
- *
1123
- * @param {function} callback - Function to call for each item.
1124
- * @param {object} scope - Optional scope.
1125
- * @return {undefined}
1126
- */
1127
- Queue.prototype.forEach = function(callback, scope) {
1128
- scope = arguments.length > 1 ? scope : this;
1129
-
1130
- for (var i = this.offset, j = 0, l = this.items.length; i < l; i++, j++)
1131
- callback.call(scope, this.items[i], j, this);
1132
- };
1133
-
1134
- /*
1135
- * Method used to convert the queue to a JavaScript array.
1136
- *
1137
- * @return {array}
1138
- */
1139
- Queue.prototype.toArray = function() {
1140
- return this.items.slice(this.offset);
1141
- };
1142
-
1143
- /**
1144
- * Method used to create an iterator over a queue's values.
1145
- *
1146
- * @return {Iterator}
1147
- */
1148
- Queue.prototype.values = function() {
1149
- var items = this.items,
1150
- i = this.offset;
1151
-
1152
- return new Iterator(function() {
1153
- if (i >= items.length)
1154
- return {
1155
- done: true
1156
- };
1157
-
1158
- var value = items[i];
1159
- i++;
1160
-
1161
- return {
1162
- value: value,
1163
- done: false
1164
- };
1165
- });
1166
- };
1167
-
1168
- /**
1169
- * Method used to create an iterator over a queue's entries.
1170
- *
1171
- * @return {Iterator}
1172
- */
1173
- Queue.prototype.entries = function() {
1174
- var items = this.items,
1175
- i = this.offset,
1176
- j = 0;
1177
-
1178
- return new Iterator(function() {
1179
- if (i >= items.length)
1180
- return {
1181
- done: true
1182
- };
1183
-
1184
- var value = items[i];
1185
- i++;
1186
-
1187
- return {
1188
- value: [j++, value],
1189
- done: false
1190
- };
1191
- });
1192
- };
1193
-
1194
- /**
1195
- * Attaching the #.values method to Symbol.iterator if possible.
1196
- */
1197
- if (typeof Symbol !== 'undefined')
1198
- Queue.prototype[Symbol.iterator] = Queue.prototype.values;
1199
-
1200
- /**
1201
- * Convenience known methods.
1202
- */
1203
- Queue.prototype.toString = function() {
1204
- return this.toArray().join(',');
1205
- };
1206
-
1207
- Queue.prototype.toJSON = function() {
1208
- return this.toArray();
1209
- };
1210
-
1211
- Queue.prototype.inspect = function() {
1212
- var array = this.toArray();
1213
-
1214
- // Trick so that node displays the name of the constructor
1215
- Object.defineProperty(array, 'constructor', {
1216
- value: Queue,
1217
- enumerable: false
1218
- });
1219
-
1220
- return array;
1221
- };
1222
-
1223
- if (typeof Symbol !== 'undefined')
1224
- Queue.prototype[Symbol.for('nodejs.util.inspect.custom')] = Queue.prototype.inspect;
1225
-
1226
- /**
1227
- * Static @.from function taking an arbitrary iterable & converting it into
1228
- * a queue.
1229
- *
1230
- * @param {Iterable} iterable - Target iterable.
1231
- * @return {Queue}
1232
- */
1233
- Queue.from = function(iterable) {
1234
- var queue = new Queue();
1235
-
1236
- forEach(iterable, function(value) {
1237
- queue.enqueue(value);
1238
- });
1239
-
1240
- return queue;
1241
- };
1242
-
1243
- /**
1244
- * Static @.of function taking an arbitrary number of arguments & converting it
1245
- * into a queue.
1246
- *
1247
- * @param {...any} args
1248
- * @return {Queue}
1249
- */
1250
- Queue.of = function() {
1251
- return Queue.from(arguments);
1252
- };
1253
-
1254
- /**
1255
- * Exporting.
1256
- */
1257
- queue$1 = Queue;
1258
- return queue$1;
1259
- }
1260
-
1261
- var queueExports = /*@__PURE__*/ requireQueue();
1262
- const queue = /*@__PURE__*/getDefaultExportFromCjs(queueExports);
1263
-
1264
- function ireduce(arg1, arg2, arg3) {
1265
- const reducer = n(arg3) ? arg2 : arg1;
1266
- const initialValue = arg3 ?? arg2;
1267
- invariant(t(reducer));
1268
- function _reduce(iter) {
1269
- let acc = initialValue;
1270
- for (const value of iter) {
1271
- acc = reducer(acc, value);
1272
- }
1273
- return acc;
1274
- }
1275
- return n(arg3) ? _reduce(arg1) : _reduce;
1276
- }
1277
-
1278
- const DELAY = "LIKEC4_DELAY";
1279
- function delay(...args) {
1280
- let ms = 100;
1281
- if (args.length === 2) {
1282
- ms = o(args[0], args[1]);
1283
- } else if (args.length === 1) {
1284
- ms = args[0];
1285
- }
1286
- return new Promise((resolve) => {
1287
- setTimeout(() => {
1288
- resolve(DELAY);
1289
- }, ms ?? 100);
1290
- });
1291
- }
1292
- function promiseNextTick() {
1293
- return Promise.resolve().then(() => void 0);
1294
- }
1295
-
1296
- const compareRelations = (a, b) => {
1297
- const parentA = commonAncestor(a.source.model, a.target.model);
1298
- const parentB = commonAncestor(b.source.model, b.target.model);
1299
- if (parentA && !parentB) {
1300
- return 1;
1301
- }
1302
- if (!parentA && parentB) {
1303
- return -1;
1304
- }
1305
- const compareParents = parentA && parentB ? compareFqnHierarchically(parentA, parentB) : 0;
1306
- if (compareParents !== 0) {
1307
- return compareParents;
1308
- }
1309
- const compareSource = compareFqnHierarchically(a.source.model, b.source.model);
1310
- if (compareSource !== 0) {
1311
- return compareSource;
1312
- }
1313
- return compareFqnHierarchically(a.target.model, b.target.model);
1314
- };
1315
-
1316
- export { biMap as BiMap, defaultWeakMap as DefaultWeakMap, linkedList as LinkedList, multiMap as MultiMap, queue as Queue, commonAncestor, compareFqnHierarchically, compareRelations, delay, invariant, ireduce, promiseNextTick };
16
+ import '../shared/core.ByrmCl9I.mjs';
17
+ import '../shared/core.zLlww-07.mjs';
18
+ import 'rehype-raw';
19
+ import 'rehype-sanitize';
20
+ import 'rehype-stringify';
21
+ import 'remark-gfm';
22
+ import 'remark-parse';
23
+ import 'remark-rehype';
24
+ import 'unified';
25
+ import 'mdast-util-from-markdown';
26
+ import 'mdast-util-to-string';