net.akehurst.language-agl-processor
Version:
2,111 lines • 58.8 kB
JavaScript
import {
LinkedHashMap1zhqxkxv3xnkl as LinkedHashMap,
Unit_instance1fbcbse1fwigr as Unit_instance,
asJsReadonlyMapView265fi57brx2p5 as asJsReadonlyMapView,
protoOf180f3jzyo7rfj as protoOf,
KtMap140uvy3s5zad8 as KtMap,
initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
VOID3gxj6tk5isa35 as VOID,
HashMap1a0ld5kgwhmhv as HashMap,
Exceptiondt2hlxn7j7vw as Exception,
asJsMapView1l954zxx5dm35 as asJsMapView,
initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
KtMutableMap1kqeifoi36kpz as KtMutableMap,
ensureNotNull1e947j3ixpazm as ensureNotNull,
ArrayList3it5z8td81qkl as ArrayList,
last1vo29oleiqj36 as last,
lastOrNull1aq5oz189qoe1 as lastOrNull,
get_lastIndex1yw0x4k50k51w as get_lastIndex,
KtSetjrjc7fhfd6b9 as KtSet,
KtMutableSetwuwn7k5m570a as KtMutableSet,
toList383f556t1dixk as toList,
toMutableSetjdpdbr9jsqq8 as toMutableSet,
Collection1k04j3hzsbod0 as Collection,
isInterface3d6p8outrmvmk as isInterface,
toMutableList20rdgwi7d3cwi as toMutableList,
addAll1k27qatfgp3k5 as addAll,
createThis2j2avj17cvnv2 as createThis,
LinkedHashSet2tkztfx86kyx2 as LinkedHashSet,
checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
IndexOutOfBoundsException1qfr429iumro0 as IndexOutOfBoundsException,
equals2au1ep9vhcato as equals,
asJsReadonlySetView1283018se66no as asJsReadonlySetView,
asJsSetView3u4hrma1rrcjl as asJsSetView,
THROW_CCE2g6jy02ryeudk as THROW_CCE,
initMetadataForObject1cxne3s9w65el as initMetadataForObject,
NoSuchElementException679xzhnp5bpj as NoSuchElementException,
Iteratorixy1j1asld45 as Iterator,
emptyList1g2z5xcrvp2zy as emptyList,
plus20p0vtfmu0596 as plus,
plus310ted5e4i90h as plus_0,
hashCodeq5arwsb9dgti as hashCode,
get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED,
suspendOrReturn49pspzlx5djv as suspendOrReturn,
getStringHashCode26igk1bx568vk as getStringHashCode,
first28gmhyvs4kf06 as first,
last3s1sh0kl8j0vf as last_0,
mapNotNull3b8ce5hky4k2l as mapNotNull,
toListx6x8nvfmvvht as toList_0,
lazy2hsh8ze7j6ikd as lazy,
KProperty1ca4yb4wlo496 as KProperty1,
getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
getKClass3t8tygqu4lcxf as getKClass,
IllegalArgumentException2asla15b5jaob as IllegalArgumentException,
getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression,
IllegalStateExceptionkoljg5n0nrlr as IllegalStateException,
AbstractMutableCollections0bg6c40ztuj as AbstractMutableCollection,
AbstractMutableSetthfi6jds1k2h as AbstractMutableSet,
KtMutableList1beimitadwkna as KtMutableList,
collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
mapCapacity1h45rc3eh9p2l as mapCapacity,
coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
Paire9pteg33gng7 as Pair,
toMutableMapr5f3w62lv8sk as toMutableMap,
first58ocm7j58k3q as first_0,
toString1pkumu07cwy4m as toString,
toSet2orjxp16sotqu as toSet,
THROW_IAE23kobfj9wdoxr as THROW_IAE,
Enum3alwj03lh1n41 as Enum,
defineProp3ur6h3slcvq4x as defineProp,
toString30pk9tzaqopn as toString_0,
joinToString1cxrrlmo0chqs as joinToString,
} from './kotlin-kotlin-stdlib.mjs';
import { Referencesgt76xd6nukg as Reference } from './net.akehurst.kotlinx-kotlinx-utils.mjs';
//region block: imports
var imul = Math.imul;
//endregion
//region block: pre-declaration
class LazyMap {
constructor(accessor) {
this.accessor = accessor;
var tmp = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp.map = LinkedHashMap.j4();
}
g11() {
return this.accessor;
}
h11() {
return this.map;
}
c3(key) {
var tmp;
if (this.map.a3(key)) {
tmp = this.map.c3(key);
} else {
var v = this.accessor(key);
// Inline function 'kotlin.collections.set' call
this.map.f3(key, v);
tmp = v;
}
return tmp;
}
z1() {
return this.map.z1();
}
d3() {
return this.map.d3();
}
h1() {
return this.map.h1();
}
e3() {
return this.map.e3();
}
a3(key) {
return this.map.a3(key);
}
b3(value) {
return this.map.b3(value);
}
l1() {
return this.map.l1();
}
}
class MapNotNull {}
class MutableMapNotNull {}
class LazyMutableMapNotNull {
constructor(accessor) {
this.i11_1 = accessor;
var tmp = this;
// Inline function 'kotlin.collections.hashMapOf' call
tmp.j11_1 = HashMap.o7();
}
c3(key) {
var tmp;
if (this.j11_1.a3(key)) {
var tmp0_elvis_lhs = this.j11_1.c3(key);
var tmp_0;
if (tmp0_elvis_lhs == null) {
throw Exception.rc('This map should never contain nulls');
} else {
tmp_0 = tmp0_elvis_lhs;
}
tmp = tmp_0;
} else {
var v = this.i11_1(key);
// Inline function 'kotlin.collections.set' call
this.j11_1.f3(key, v);
tmp = v;
}
return tmp;
}
z1() {
return this.j11_1.z1();
}
d3() {
return this.j11_1.d3();
}
h1() {
return this.j11_1.h1();
}
e3() {
return this.j11_1.e3();
}
a3(key) {
return this.j11_1.a3(key);
}
b3(value) {
return this.j11_1.b3(value);
}
l1() {
return this.j11_1.l1();
}
i3() {
this.j11_1.i3();
}
f3(key, value) {
return this.j11_1.f3(key, value);
}
h3(from) {
this.j11_1.h3(from);
}
g3(key) {
return this.j11_1.g3(key);
}
yj(thisRef, property) {
return this;
}
}
class LazyMapNotNull {
constructor(accessor) {
this.k11_1 = accessor;
var tmp = this;
// Inline function 'kotlin.collections.hashMapOf' call
tmp.l11_1 = HashMap.o7();
}
c3(key) {
var tmp;
if (this.l11_1.a3(key)) {
var tmp0_elvis_lhs = this.l11_1.c3(key);
var tmp_0;
if (tmp0_elvis_lhs == null) {
throw Exception.rc('This map should never contain nulls');
} else {
tmp_0 = tmp0_elvis_lhs;
}
tmp = tmp_0;
} else {
var v = this.k11_1(key);
// Inline function 'kotlin.collections.set' call
this.l11_1.f3(key, v);
tmp = v;
}
return tmp;
}
z1() {
return this.l11_1.z1();
}
d3() {
return this.l11_1.d3();
}
h1() {
return this.l11_1.h1();
}
e3() {
return this.l11_1.e3();
}
a3(key) {
return this.l11_1.a3(key);
}
b3(value) {
return this.l11_1.b3(value);
}
l1() {
return this.l11_1.l1();
}
yj(thisRef, property) {
return this;
}
}
class MutableMapNonNullDefault {
constructor(map) {
this.m11_1 = map;
}
c3(key) {
return ensureNotNull(this.m11_1.c3(key));
}
l1() {
return this.m11_1.l1();
}
a3(key) {
return this.m11_1.a3(key);
}
b3(value) {
return this.m11_1.b3(value);
}
asJsReadonlyMapView() {
return this.m11_1.asJsReadonlyMapView();
}
h1() {
return this.m11_1.h1();
}
d3() {
return this.m11_1.d3();
}
e3() {
return this.m11_1.e3();
}
z1() {
return this.m11_1.z1();
}
f3(key, value) {
return this.m11_1.f3(key, value);
}
g3(key) {
return this.m11_1.g3(key);
}
h3(from) {
this.m11_1.h3(from);
}
i3() {
this.m11_1.i3();
}
asJsMapView() {
return this.m11_1.asJsMapView();
}
}
class MutableStack {
constructor() {
var tmp = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp.n11_1 = ArrayList.o1();
}
h1() {
return this.n11_1.h1();
}
p11() {
return this.n11_1.h1() === 0;
}
q11() {
return !(this.n11_1.h1() === 0);
}
r11() {
return this.n11_1;
}
o11(item) {
this.n11_1.v(item);
}
s11() {
return last(this.n11_1);
}
t11() {
return lastOrNull(this.n11_1);
}
u11(n) {
return this.n11_1.z2(this.n11_1.h1() - n | 0, this.n11_1.h1());
}
v11() {
return this.n11_1.o3(get_lastIndex(this.n11_1));
}
w11(n) {
// Inline function 'kotlin.collections.mutableListOf' call
var removed = ArrayList.o1();
var inductionVariable = 0;
if (inductionVariable < n)
do {
var i = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
removed.v(this.n11_1.o3(get_lastIndex(this.n11_1)));
}
while (inductionVariable < n);
return removed;
}
}
class OrderedSet {}
class MutableOrderedSet {}
class OrderedSetImpl {
static new_net_akehurst_kotlinx_collections_OrderedSetImpl(collection) {
var $this = createThis(this);
init_net_akehurst_kotlinx_collections_OrderedSetImpl($this);
$this.x11_1 = LinkedHashSet.m1(collection);
return $this;
}
get(index) {
// Inline function 'kotlin.collections.forEachIndexed' call
var index_0 = 0;
var _iterator__ex2g4s = this.x11_1.g1();
while (_iterator__ex2g4s.f()) {
var item = _iterator__ex2g4s.e();
var _unary__edvuaz = index_0;
index_0 = _unary__edvuaz + 1 | 0;
if (index === checkIndexOverflow(_unary__edvuaz))
return item;
}
throw IndexOutOfBoundsException.x1('' + index);
}
h1() {
return this.x11_1.h1();
}
g1() {
return this.x11_1.g1();
}
l1() {
return this.x11_1.l1();
}
p1(element) {
return this.x11_1.p1(element);
}
w2(elements) {
return this.x11_1.w2(elements);
}
equals(other) {
var tmp;
if (!(!(other == null) ? isInterface(other, OrderedSet) : false)) {
tmp = false;
} else {
if (!(other.h1() === this.h1())) {
tmp = false;
} else {
var inductionVariable = 0;
var last = this.h1();
if (inductionVariable < last)
do {
var i = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
if (!equals(this.get(i), other.get(i)))
return false;
}
while (inductionVariable < last);
tmp = true;
}
}
return tmp;
}
hashCode() {
return this.x11_1.hashCode();
}
toString() {
return this.x11_1.toString();
}
}
class MutableOrderedSetImpl {
static new_net_akehurst_kotlinx_collections_MutableOrderedSetImpl(collection) {
var $this = createThis(this);
init_net_akehurst_kotlinx_collections_MutableOrderedSetImpl($this);
$this.y11_1 = LinkedHashSet.m1(collection);
return $this;
}
get(index) {
// Inline function 'kotlin.collections.forEachIndexed' call
var index_0 = 0;
var _iterator__ex2g4s = this.y11_1.g1();
while (_iterator__ex2g4s.f()) {
var item = _iterator__ex2g4s.e();
var _unary__edvuaz = index_0;
index_0 = _unary__edvuaz + 1 | 0;
if (index === checkIndexOverflow(_unary__edvuaz))
return item;
}
throw IndexOutOfBoundsException.x1('' + index);
}
h1() {
return this.y11_1.h1();
}
g1() {
return this.y11_1.g1();
}
l1() {
return this.y11_1.l1();
}
p1(element) {
return this.y11_1.p1(element);
}
w2(elements) {
return this.y11_1.w2(elements);
}
v(element) {
return this.y11_1.v(element);
}
k1(elements) {
return this.y11_1.k1(elements);
}
j3(element) {
return this.y11_1.j3(element);
}
h2(elements) {
return this.y11_1.h2(elements);
}
k3(elements) {
return this.y11_1.k3(elements);
}
i3() {
this.y11_1.i3();
}
equals(other) {
var tmp;
if (!(!(other == null) ? isInterface(other, OrderedSet) : false)) {
tmp = false;
} else {
if (!(other.h1() === this.h1())) {
tmp = false;
} else {
var inductionVariable = 0;
var last = this.h1();
if (inductionVariable < last)
do {
var i = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
if (!equals(this.get(i), other.get(i)))
return false;
}
while (inductionVariable < last);
tmp = true;
}
}
return tmp;
}
hashCode() {
return this.y11_1.hashCode();
}
toString() {
return this.y11_1.toString();
}
}
class EmptyOrderedSet {
h1() {
return 0;
}
l1() {
return true;
}
vh(element) {
return false;
}
p1(element) {
if (!false)
return false;
var tmp;
if (false) {
tmp = element;
} else {
tmp = THROW_CCE();
}
return this.vh(tmp);
}
wh(elements) {
return elements.l1();
}
w2(elements) {
return this.wh(elements);
}
get(index) {
throw IndexOutOfBoundsException.x1('An empty OrderedSet does not contain element at index ' + index + '.');
}
g1() {
return EmptyIterator_instance;
}
equals(other) {
var tmp;
if (!(other == null) ? isInterface(other, OrderedSet) : false) {
tmp = other.l1();
} else {
tmp = false;
}
return tmp;
}
hashCode() {
return 0;
}
toString() {
return '[]';
}
}
class EmptyIterator {
f() {
return false;
}
g6() {
return false;
}
h6() {
return 0;
}
e() {
throw NoSuchElementException.n1();
}
i6() {
throw NoSuchElementException.n1();
}
}
class PopResult {
constructor(item, stack) {
this.item = item;
this.stack = stack;
}
z11() {
return this.item;
}
a12() {
return this.stack;
}
}
class Stack {
constructor(elements) {
elements = elements === VOID ? emptyList() : elements;
this.elements = elements;
}
r11() {
return this.elements;
}
h1() {
return this.elements.h1();
}
p11() {
return this.elements.h1() === 0;
}
q11() {
return !(this.elements.h1() === 0);
}
push(item) {
return new Stack(plus(this.elements, item));
}
pushAll(items) {
return new Stack(plus_0(this.elements, items));
}
peek() {
return last(this.elements);
}
peekOrNull() {
return lastOrNull(this.elements);
}
pop() {
return new PopResult(this.peek(), new Stack(this.elements.z2(0, this.size - 1 | 0)));
}
clone() {
return new Stack(this.elements);
}
hashCode() {
return hashCode(this.elements);
}
equals(other) {
var tmp;
if (!(other instanceof Stack)) {
tmp = false;
} else {
tmp = equals(this.elements, other.elements);
}
return tmp;
}
get size() {
return this.h1();
}
get isEmpty() {
return this.p11();
}
get isNotEmpty() {
return this.q11();
}
}
class CachedValueSuspend {
constructor(initializer) {
this.initializer = initializer;
var tmp = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp.b12_1 = LinkedHashMap.j4();
}
c12(_set____db54di) {
this.initializer = _set____db54di;
}
m10() {
return this.initializer;
}
containsKey(key) {
return this.b12_1.a3(key);
}
getCachedValueOrNull(key) {
return this.b12_1.c3(key);
}
get(key, $completion) {
return suspendOrReturn(/*#__NOINLINE__*/_generator_get__cbf6n6.bind(VOID, this, key), $completion);
}
set(key, value) {
// Inline function 'kotlin.collections.set' call
this.b12_1.f3(key, value);
}
reset(key) {
this.b12_1.g3(key);
}
resetAll() {
this.b12_1.i3();
}
}
class CachedValue {
constructor(initializer) {
this.initializer = initializer;
var tmp = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp.d12_1 = LinkedHashMap.j4();
}
e12(_set____db54di) {
this.initializer = _set____db54di;
}
m10() {
return this.initializer;
}
containsKey(key) {
return this.d12_1.a3(key);
}
getCachedValueOrNull(key) {
return this.d12_1.c3(key);
}
get(key) {
var tmp;
if (this.d12_1.a3(key)) {
tmp = this.d12_1.c3(key);
} else {
var out = this.initializer(key);
// Inline function 'kotlin.collections.set' call
this.d12_1.f3(key, out);
tmp = out;
}
return tmp;
}
set(key, value) {
// Inline function 'kotlin.collections.set' call
this.d12_1.f3(key, value);
}
reset(key) {
this.d12_1.g3(key);
}
resetAll() {
this.d12_1.i3();
}
}
class GraphNodeId {
constructor(value) {
this.value = value;
}
b2() {
return this.value;
}
ni() {
return this.value;
}
f12(value) {
return new GraphNodeId(value);
}
copy(value, $super) {
value = value === VOID ? this.value : value;
return $super === VOID ? this.f12(value) : $super.f12.call(this, value);
}
toString() {
return 'GraphNodeId(value=' + this.value + ')';
}
hashCode() {
return getStringHashCode(this.value);
}
equals(other) {
if (this === other)
return true;
if (!(other instanceof GraphNodeId))
return false;
if (!(this.value === other.value))
return false;
return true;
}
}
class GraphEdgeId {
constructor(value) {
this.value = value;
}
b2() {
return this.value;
}
ni() {
return this.value;
}
f12(value) {
return new GraphEdgeId(value);
}
copy(value, $super) {
value = value === VOID ? this.value : value;
return $super === VOID ? this.f12(value) : $super.f12.call(this, value);
}
toString() {
return 'GraphEdgeId(value=' + this.value + ')';
}
hashCode() {
return getStringHashCode(this.value);
}
equals(other) {
if (this === other)
return true;
if (!(other instanceof GraphEdgeId))
return false;
if (!(this.value === other.value))
return false;
return true;
}
}
class Graph {}
class GraphNode {}
class GraphEdge {}
function get_source() {
return first(this.ends);
}
function get_target() {
return last_0(this.ends);
}
class GraphFunctions {
constructor(nodeIds, node, incoming, outgoing, edgeIds, edge, ends) {
this.nodeIds = nodeIds;
this.node = node;
this.incoming = incoming;
this.outgoing = outgoing;
this.edgeIds = edgeIds;
this.edge = edge;
this.ends = ends;
}
n12() {
return this.nodeIds;
}
o12() {
return this.node;
}
j12() {
return this.incoming;
}
k12() {
return this.outgoing;
}
p12() {
return this.edgeIds;
}
q12() {
return this.edge;
}
l12() {
return this.ends;
}
}
class GraphFromFunctions$_nodes$2$1 {
constructor($nodeId, this$0) {
this.v12_1 = $nodeId;
var tmp = this;
tmp.w12_1 = lazy(GraphFromFunctions$_nodes$lambda$o$incoming$delegate$lambda(this$0, $nodeId));
var tmp_0 = this;
tmp_0.x12_1 = lazy(GraphFromFunctions$_nodes$lambda$o$outgoing$delegate$lambda(this$0, $nodeId));
}
i12() {
return this.v12_1;
}
j12() {
var tmp0 = this.w12_1;
var tmp = KProperty1;
// Inline function 'kotlin.getValue' call
getPropertyCallableRef('incoming', 1, tmp, GraphFromFunctions$_nodes$lambda$o$_get_incoming_$ref_6efgdx(), null);
return tmp0.b2();
}
k12() {
var tmp0 = this.x12_1;
var tmp = KProperty1;
// Inline function 'kotlin.getValue' call
getPropertyCallableRef('outgoing', 1, tmp, GraphFromFunctions$_nodes$lambda$o$_get_outgoing_$ref_lhd6i7(), null);
return tmp0.b2();
}
get id() {
return this.i12();
}
get incoming() {
return this.j12();
}
get outgoing() {
return this.k12();
}
}
class GraphFromFunctions$_edges$2$1 {
constructor($edgeId, this$0) {
this.y12_1 = $edgeId;
var tmp = this;
tmp.z12_1 = lazy(GraphFromFunctions$_edges$lambda$o$ends$delegate$lambda(this$0, $edgeId));
}
i12() {
return this.y12_1;
}
l12() {
var tmp0 = this.z12_1;
var tmp = KProperty1;
// Inline function 'kotlin.getValue' call
getPropertyCallableRef('ends', 1, tmp, GraphFromFunctions$_edges$lambda$o$_get_ends_$ref_j8w0js(), null);
return tmp0.b2();
}
get id() {
return this.i12();
}
get ends() {
return this.l12();
}
get source() {
return this.tq();
}
get target() {
return this.m12();
}
}
class GraphFromFunctions {
constructor(functions) {
this.functions = functions;
var tmp = this;
tmp.r12_1 = lazyMap(GraphFromFunctions$_nodes$lambda(this));
var tmp_0 = this;
tmp_0.s12_1 = lazyMap(GraphFromFunctions$_edges$lambda(this));
var tmp_1 = this;
tmp_1.t12_1 = lazy(GraphFromFunctions$nodes$delegate$lambda(this));
var tmp_2 = this;
tmp_2.u12_1 = lazy(GraphFromFunctions$edges$delegate$lambda(this));
}
a13() {
return this.functions;
}
g12() {
var tmp0 = this.t12_1;
var tmp = KProperty1;
// Inline function 'kotlin.getValue' call
getPropertyCallableRef('nodes', 1, tmp, GraphFromFunctions$_get_nodes_$ref_71zaia(), null);
return tmp0.b2();
}
h12() {
var tmp0 = this.u12_1;
var tmp = KProperty1;
// Inline function 'kotlin.getValue' call
getPropertyCallableRef('edges', 1, tmp, GraphFromFunctions$_get_edges_$ref_bafqmh(), null);
return tmp0.b2();
}
get nodes() {
return this.g12();
}
get edges() {
return this.h12();
}
}
class GraphSimple {
constructor(graphId) {
this.graphId = graphId;
var tmp = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp.b13_1 = ArrayList.o1();
var tmp_0 = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp_0.c13_1 = ArrayList.o1();
}
d13() {
return this.graphId;
}
g12() {
return this.b13_1;
}
h12() {
return this.c13_1;
}
ni() {
return this.graphId;
}
f12(graphId) {
return new GraphSimple(graphId);
}
copy(graphId, $super) {
graphId = graphId === VOID ? this.graphId : graphId;
return $super === VOID ? this.f12(graphId) : $super.f12.call(this, graphId);
}
toString() {
return 'GraphSimple(graphId=' + this.graphId + ')';
}
hashCode() {
return getStringHashCode(this.graphId);
}
equals(other) {
if (this === other)
return true;
if (!(other instanceof GraphSimple))
return false;
if (!(this.graphId === other.graphId))
return false;
return true;
}
get nodes() {
return this.g12();
}
get edges() {
return this.h12();
}
}
class GraphNodeSimple {
constructor(id) {
this.e13_1 = id;
var tmp = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp.f13_1 = ArrayList.o1();
var tmp_0 = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp_0.g13_1 = ArrayList.o1();
}
i12() {
return this.e13_1;
}
j12() {
return this.f13_1;
}
k12() {
return this.g13_1;
}
ni() {
return this.e13_1;
}
h13(id) {
return new GraphNodeSimple(id);
}
copy(id, $super) {
id = id === VOID ? this.e13_1 : id;
return $super === VOID ? this.h13(id) : $super.h13.call(this, id);
}
toString() {
return 'GraphNodeSimple(id=' + this.e13_1.toString() + ')';
}
hashCode() {
return this.e13_1.hashCode();
}
equals(other) {
if (this === other)
return true;
if (!(other instanceof GraphNodeSimple))
return false;
if (!this.e13_1.equals(other.e13_1))
return false;
return true;
}
get id() {
return this.i12();
}
get incoming() {
return this.j12();
}
get outgoing() {
return this.k12();
}
}
class GraphEdgeSimple {
constructor(id) {
this.i13_1 = id;
var tmp = this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp.j13_1 = ArrayList.o1();
}
i12() {
return this.i13_1;
}
l12() {
return this.j13_1;
}
ni() {
return this.i13_1;
}
k13(id) {
return new GraphEdgeSimple(id);
}
copy(id, $super) {
id = id === VOID ? this.i13_1 : id;
return $super === VOID ? this.k13(id) : $super.k13.call(this, id);
}
toString() {
return 'GraphEdgeSimple(id=' + this.i13_1.toString() + ')';
}
hashCode() {
return this.i13_1.hashCode();
}
equals(other) {
if (this === other)
return true;
if (!(other instanceof GraphEdgeSimple))
return false;
if (!this.i13_1.equals(other.i13_1))
return false;
return true;
}
get id() {
return this.i12();
}
get ends() {
return this.l12();
}
get source() {
return this.tq();
}
get target() {
return this.m12();
}
}
class ManagedCollection extends AbstractMutableCollection {
static x13(name, expectedType, onAdded, onRemoved) {
onAdded = onAdded === VOID ? null : onAdded;
onRemoved = onRemoved === VOID ? null : onRemoved;
var $this = this.s5();
$this.s13_1 = name;
$this.t13_1 = expectedType;
$this.u13_1 = onAdded;
$this.v13_1 = onRemoved;
var tmp = $this;
// Inline function 'kotlin.collections.mutableListOf' call
tmp.w13_1 = ArrayList.o1();
return $this;
}
h1() {
return this.w13_1.h1();
}
z13(element) {
if (!this.t13_1.nd(element)) {
throw IllegalArgumentException.f1("Managed List violation on '" + this.s13_1 + "': Expected '" + this.t13_1.md() + "', but got '" + getKClassFromExpression(element).md() + "'.");
}
}
a14(element) {
this.z13(element);
var res = this.w13_1.v(element);
if (res) {
var tmp0_safe_receiver = this.u13_1;
if (tmp0_safe_receiver == null)
null;
else
tmp0_safe_receiver(element);
}
return res;
}
v(element) {
return this.a14(!(element == null) ? element : THROW_CCE());
}
g1() {
var baseIterator = this.w13_1.g1();
return new ManagedCollection$iterator$1(baseIterator, this);
}
}
class ManagedReferenceCollection extends ManagedCollection {
constructor(name, referenceType, onAdded, onRemoved) {
return new.target.r13(name, referenceType, onAdded, onRemoved);
}
static r13(name, referenceType, onAdded, onRemoved) {
onAdded = onAdded === VOID ? null : onAdded;
onRemoved = onRemoved === VOID ? null : onRemoved;
var $this = this.x13(name, getKClass(Reference), onAdded, onRemoved);
$this.q13_1 = referenceType;
return $this;
}
y13(element) {
var resolvedValue = element.resolved;
if (!(resolvedValue == null) && !this.q13_1.nd(resolvedValue)) {
throw IllegalArgumentException.f1("Managed Reference List violation: Reference payload type mismatch. Expected reference to '" + this.q13_1.md() + "', but got '" + getKClassFromExpression(resolvedValue).md() + "'.");
}
}
z13(element) {
return this.y13(isInterface(element, Reference) ? element : THROW_CCE());
}
}
class ManagedSet extends AbstractMutableSet {
static n14(name, expectedType, onAdded, onRemoved) {
onAdded = onAdded === VOID ? null : onAdded;
onRemoved = onRemoved === VOID ? null : onRemoved;
var $this = this.i7();
$this.i14_1 = name;
$this.j14_1 = expectedType;
$this.k14_1 = onAdded;
$this.l14_1 = onRemoved;
var tmp = $this;
// Inline function 'kotlin.collections.mutableSetOf' call
tmp.m14_1 = LinkedHashSet.j1();
return $this;
}
h1() {
return this.m14_1.h1();
}
z13(element) {
if (!this.j14_1.nd(element)) {
throw IllegalArgumentException.f1("Managed List violation on '" + this.i14_1 + "': Expected '" + this.j14_1.md() + "', but got '" + getKClassFromExpression(element).md() + "'.");
}
}
a14(element) {
this.z13(element);
var res = this.m14_1.v(element);
if (res) {
var tmp0_safe_receiver = this.k14_1;
if (tmp0_safe_receiver == null)
null;
else
tmp0_safe_receiver(element);
}
return res;
}
v(element) {
return this.a14(!(element == null) ? element : THROW_CCE());
}
g1() {
var baseIterator = this.m14_1.g1();
return new ManagedSet$iterator$1(baseIterator, this);
}
}
class ManagedReferenceSet extends ManagedSet {
constructor(name, referenceType, onAdded, onRemoved) {
return new.target.h14(name, referenceType, onAdded, onRemoved);
}
static h14(name, referenceType, onAdded, onRemoved) {
onAdded = onAdded === VOID ? null : onAdded;
onRemoved = onRemoved === VOID ? null : onRemoved;
var $this = this.n14(name, getKClass(Reference), onAdded, onRemoved);
$this.g14_1 = referenceType;
return $this;
}
y13(element) {
var resolvedValue = element.resolved;
if (!(resolvedValue == null) && !this.g14_1.nd(resolvedValue)) {
throw IllegalArgumentException.f1("Managed Reference List violation: Reference payload type mismatch. Expected reference to '" + this.g14_1.md() + "', but got '" + getKClassFromExpression(resolvedValue).md() + "'.");
}
}
z13(element) {
return this.y13(isInterface(element, Reference) ? element : THROW_CCE());
}
}
class ManagedOrderedSet extends AbstractMutableSet {
static a15(name, expectedType, onAdded, onRemoved) {
onAdded = onAdded === VOID ? null : onAdded;
onRemoved = onRemoved === VOID ? null : onRemoved;
var $this = this.i7();
$this.v14_1 = name;
$this.w14_1 = expectedType;
$this.x14_1 = onAdded;
$this.y14_1 = onRemoved;
var tmp = $this;
// Inline function 'kotlin.collections.linkedSetOf' call
tmp.z14_1 = LinkedHashSet.j1();
return $this;
}
h1() {
return this.z14_1.h1();
}
z13(element) {
if (!this.w14_1.nd(element)) {
throw IllegalArgumentException.f1("Managed List violation on '" + this.v14_1 + "': Expected '" + this.w14_1.md() + "', but got '" + getKClassFromExpression(element).md() + "'.");
}
}
a14(element) {
this.z13(element);
var res = this.z14_1.v(element);
if (res) {
var tmp0_safe_receiver = this.x14_1;
if (tmp0_safe_receiver == null)
null;
else
tmp0_safe_receiver(element);
}
return res;
}
v(element) {
return this.a14(!(element == null) ? element : THROW_CCE());
}
g1() {
var baseIterator = this.z14_1.g1();
return new ManagedOrderedSet$iterator$1(baseIterator, this);
}
get(index) {
// Inline function 'kotlin.collections.forEachIndexed' call
var index_0 = 0;
var _iterator__ex2g4s = this.z14_1.g1();
while (_iterator__ex2g4s.f()) {
var item = _iterator__ex2g4s.e();
var _unary__edvuaz = index_0;
index_0 = _unary__edvuaz + 1 | 0;
if (index === checkIndexOverflow(_unary__edvuaz))
return item;
}
throw IndexOutOfBoundsException.x1('' + index);
}
}
class ManagedReferenceOrderedSet extends ManagedOrderedSet {
constructor(name, referenceType, onAdded, onRemoved) {
return new.target.u14(name, referenceType, onAdded, onRemoved);
}
static u14(name, referenceType, onAdded, onRemoved) {
onAdded = onAdded === VOID ? null : onAdded;
onRemoved = onRemoved === VOID ? null : onRemoved;
var $this = this.a15(name, getKClass(Reference), onAdded, onRemoved);
$this.t14_1 = referenceType;
return $this;
}
y13(element) {
var resolvedValue = element.resolved;
if (!(resolvedValue == null) && !this.t14_1.nd(resolvedValue)) {
throw IllegalArgumentException.f1("Managed Reference List violation: Reference payload type mismatch. Expected reference to '" + this.t14_1.md() + "', but got '" + getKClassFromExpression(resolvedValue).md() + "'.");
}
}
z13(element) {
return this.y13(isInterface(element, Reference) ? element : THROW_CCE());
}
}
class ManagedCollection$iterator$1 {
constructor($baseIterator, this$0) {
this.c15_1 = $baseIterator;
this.d15_1 = this$0;
this.b15_1 = null;
}
f() {
return this.c15_1.f();
}
e() {
var nextVal = this.c15_1.e();
this.b15_1 = nextVal;
return nextVal;
}
v5() {
var tmp0_elvis_lhs = this.b15_1;
var tmp;
if (tmp0_elvis_lhs == null) {
throw IllegalStateException.t4('next() must be called before remove()');
} else {
tmp = tmp0_elvis_lhs;
}
var item = tmp;
this.c15_1.v5();
var tmp1_safe_receiver = this.d15_1.v13_1;
if (tmp1_safe_receiver == null)
null;
else
tmp1_safe_receiver(item);
this.b15_1 = null;
}
}
class ManagedSet$iterator$1 {
constructor($baseIterator, this$0) {
this.f15_1 = $baseIterator;
this.g15_1 = this$0;
this.e15_1 = null;
}
f() {
return this.f15_1.f();
}
e() {
var nextVal = this.f15_1.e();
this.e15_1 = nextVal;
return nextVal;
}
v5() {
var tmp0_elvis_lhs = this.e15_1;
var tmp;
if (tmp0_elvis_lhs == null) {
throw IllegalStateException.t4('next() must be called before remove()');
} else {
tmp = tmp0_elvis_lhs;
}
var item = tmp;
this.f15_1.v5();
var tmp1_safe_receiver = this.g15_1.l14_1;
if (tmp1_safe_receiver == null)
null;
else
tmp1_safe_receiver(item);
this.e15_1 = null;
}
}
class ManagedOrderedSet$iterator$1 {
constructor($baseIterator, this$0) {
this.i15_1 = $baseIterator;
this.j15_1 = this$0;
this.h15_1 = null;
}
f() {
return this.i15_1.f();
}
e() {
var nextVal = this.i15_1.e();
this.h15_1 = nextVal;
return nextVal;
}
v5() {
var tmp0_elvis_lhs = this.h15_1;
var tmp;
if (tmp0_elvis_lhs == null) {
throw IllegalStateException.t4('next() must be called before remove()');
} else {
tmp = tmp0_elvis_lhs;
}
var item = tmp;
this.i15_1.v5();
var tmp1_safe_receiver = this.j15_1.y14_1;
if (tmp1_safe_receiver == null)
null;
else
tmp1_safe_receiver(item);
this.h15_1 = null;
}
}
class ListExt_0 {
k15(_this__u8e3s4) {
return isInterface(_this__u8e3s4, KtMutableList) ? _this__u8e3s4 : THROW_CCE();
}
}
class SetExt_0 {
l15(_this__u8e3s4) {
return isInterface(_this__u8e3s4, KtMutableSet) ? _this__u8e3s4 : THROW_CCE();
}
}
class OrderedSetExt_0 {
m15(_this__u8e3s4) {
return isInterface(_this__u8e3s4, MutableOrderedSet) ? _this__u8e3s4 : THROW_CCE();
}
}
class Tree {}
class TreeNode {}
class TreeFunctions {
constructor(label, hasChildren, children) {
this.label = label;
this.hasChildren = hasChildren;
this.children = children;
}
p15() {
return this.label;
}
q15() {
return this.hasChildren;
}
o15() {
return this.children;
}
}
class IssueKind extends Enum {
get name() {
return this.r3();
}
get ordinal() {
return this.s3();
}
}
class Issue {}
class IssueCollection {}
class IssueDefault {
constructor(kind, location, message, data) {
data = data === VOID ? null : data;
this.z15_1 = kind;
this.a16_1 = location;
this.b16_1 = message;
this.c16_1 = data;
}
um() {
return this.z15_1;
}
t15() {
return this.a16_1;
}
l() {
return this.b16_1;
}
u15() {
return this.c16_1;
}
ni() {
return this.z15_1;
}
oi() {
return this.a16_1;
}
mm() {
return this.b16_1;
}
d16() {
return this.c16_1;
}
e16(kind, location, message, data) {
return new IssueDefault(kind, location, message, data);
}
copy(kind, location, message, data, $super) {
kind = kind === VOID ? this.z15_1 : kind;
location = location === VOID ? this.a16_1 : location;
message = message === VOID ? this.b16_1 : message;
data = data === VOID ? this.c16_1 : data;
return $super === VOID ? this.e16(kind, location, message, data) : $super.e16.call(this, kind, location, message, data);
}
toString() {
return 'IssueDefault(kind=' + this.z15_1.toString() + ', location=' + toString_0(this.a16_1) + ', message=' + this.b16_1 + ', data=' + toString_0(this.c16_1) + ')';
}
hashCode() {
var result = this.z15_1.hashCode();
result = imul(result, 31) + (this.a16_1 == null ? 0 : hashCode(this.a16_1)) | 0;
result = imul(result, 31) + getStringHashCode(this.b16_1) | 0;
result = imul(result, 31) + (this.c16_1 == null ? 0 : hashCode(this.c16_1)) | 0;
return result;
}
equals(other) {
if (this === other)
return true;
if (!(other instanceof IssueDefault))
return false;
if (!this.z15_1.equals(other.z15_1))
return false;
if (!equals(this.a16_1, other.a16_1))
return false;
if (!(this.b16_1 === other.b16_1))
return false;
if (!equals(this.c16_1, other.c16_1))
return false;
return true;
}
get kind() {
return this.um();
}
get location() {
return this.t15();
}
get message() {
return this.l();
}
get data() {
return this.u15();
}
}
class IssueHolder {
constructor(issues) {
issues = issues === VOID ? emptyList() : issues;
this.f16_1 = toMutableSet(issues);
}
v15() {
return this.f16_1;
}
w15() {
// Inline function 'kotlin.collections.filter' call
var tmp0 = this.f16_1;
// Inline function 'kotlin.collections.filterTo' call
var destination = ArrayList.o1();
var _iterator__ex2g4s = tmp0.g1();
while (_iterator__ex2g4s.f()) {
var element = _iterator__ex2g4s.e();
if (element.kind.equals(IssueKind_ERROR_getInstance())) {
destination.v(element);
}
}
return destination;
}
x15() {
// Inline function 'kotlin.collections.filter' call
var tmp0 = this.f16_1;
// Inline function 'kotlin.collections.filterTo' call
var destination = ArrayList.o1();
var _iterator__ex2g4s = tmp0.g1();
while (_iterator__ex2g4s.f()) {
var element = _iterator__ex2g4s.e();
if (element.kind.equals(IssueKind_WARNING_getInstance())) {
destination.v(element);
}
}
return destination;
}
y15() {
// Inline function 'kotlin.collections.filter' call
var tmp0 = this.f16_1;
// Inline function 'kotlin.collections.filterTo' call
var destination = ArrayList.o1();
var _iterator__ex2g4s = tmp0.g1();
while (_iterator__ex2g4s.f()) {
var element = _iterator__ex2g4s.e();
if (element.kind.equals(IssueKind_INFORMATION_getInstance())) {
destination.v(element);
}
}
return destination;
}
clear() {
this.f16_1.i3();
}
g16(kind, location, message, data) {
this.f16_1.v(new IssueDefault(kind, location, message, data));
}
raise(kind, location, message, data, $super) {
data = data === VOID ? null : data;
var tmp;
if ($super === VOID) {
this.g16(kind, location, message, data);
tmp = Unit_instance;
} else {
tmp = $super.g16.call(this, kind, location, message, data);
}
return tmp;
}
h16(location, message, data) {
return this.raise(IssueKind_INFORMATION_getInstance(), location, message, data);
}
info(location, message, data, $super) {
data = data === VOID ? null : data;
var tmp;
if ($super === VOID) {
this.h16(location, message, data);
tmp = Unit_instance;
} else {
tmp = $super.h16.call(this, location, message, data);
}
return tmp;
}
i16(location, message, data) {
return this.raise(IssueKind_WARNING_getInstance(), location, message, data);
}
warn(location, message, data, $super) {
data = data === VOID ? null : data;
var tmp;
if ($super === VOID) {
this.i16(location, message, data);
tmp = Unit_instance;
} else {
tmp = $super.i16.call(this, location, message, data);
}
return tmp;
}
j16(location, message, data) {
return this.raise(IssueKind_ERROR_getInstance(), location, message, data);
}
error(location, message, data, $super) {
data = data === VOID ? null : data;
var tmp;
if ($super === VOID) {
this.j16(location, message, data);
tmp = Unit_instance;
} else {
tmp = $super.j16.call(this, location, message, data);
}
return tmp;
}
addAll(issues) {
addAll(this.f16_1, issues);
}
addAllFrom(other) {
this.addAll(other.all);
}
h1() {
return this.f16_1.h1();
}
g1() {
return this.f16_1.g1();
}
l1() {
return this.f16_1.l1();
}
k16(element) {
return this.f16_1.p1(element);
}
p1(element) {
if (!(!(element == null) ? isInterface(element, Issue) : false))
return false;
return this.k16((!(element == null) ? isInterface(element, Issue) : false) ? element : THROW_CCE());
}
l16(elements) {
return this.f16_1.w2(elements);
}
w2(elements) {
return this.l16(elements);
}
toString() {
return joinToString(this.f16_1, '\n', VOID, VOID, VOID, VOID, IssueHolder$toString$lambda);
}
get all() {
return this.v15();
}
get errors() {
return this.w15();
}
get warnings() {
return this.x15();
}
get informations() {
return this.y15();
}
}
//endregion
function lazyMap(accessor) {
return new LazyMap(accessor);
}
function lazyMapNotNull(accessor) {
return new LazyMapNotNull(accessor);
}
function lazyMutableMapNotNull(accessor) {
return new LazyMutableMapNotNull(accessor);
}
function mutableStackOf(elements) {
var stack = new MutableStack();
// Inline function 'kotlin.collections.forEach' call
var inductionVariable = 0;
var last = elements.length;
while (inductionVariable < last) {
var element = elements[inductionVariable];
inductionVariable = inductionVariable + 1 | 0;
stack.o11(element);
}
return stack;
}
function emptyOrderedSet() {
return EmptyOrderedSet_instance;
}
function orderedSetOf(elements) {
return OrderedSetImpl.new_net_akehurst_kotlinx_collections_OrderedSetImpl(toList(elements));
}
function mutableOrderedSetOf(elements) {
return MutableOrderedSetImpl.new_net_akehurst_kotlinx_collections_MutableOrderedSetImpl(toList(elements));
}
function toOrderedSet(_this__u8e3s4) {
var tmp;
if (isInterface(_this__u8e3s4, Collection)) {
tmp = MutableOrderedSetImpl.new_net_akehurst_kotlinx_collections_MutableOrderedSetImpl(_this__u8e3s4);
} else {
tmp = MutableOrderedSetImpl.new_net_akehurst_kotlinx_collections_MutableOrderedSetImpl(toMutableSet(_this__u8e3s4));
}
return tmp;
}
function toMutableOrderedSet(_this__u8e3s4) {
var tmp;
if (isInterface(_this__u8e3s4, Collection)) {
tmp = MutableOrderedSetImpl.new_net_akehurst_kotlinx_collections_MutableOrderedSetImpl(_this__u8e3s4);
} else {
tmp = MutableOrderedSetImpl.new_net_akehurst_kotlinx_collections_MutableOrderedSetImpl(toMutableSet(_this__u8e3s4));
}
return tmp;
}
function plus_1(_this__u8e3s4, element) {
var result = toMutableOrderedSet(_this__u8e3s4);
result.v(element);
return result;
}
function plusAll(_this__u8e3s4, elements) {
var result = toMutableList(_this__u8e3s4);
addAll(result, elements);
return OrderedSetImpl.new_net_akehurst_kotlinx_collections_OrderedSetImpl(result);
}
function plusAssign(_this__u8e3s4, elements) {
addAll(_this__u8e3s4, elements);
}
function init_net_akehurst_kotlinx_collections_OrderedSetImpl(_this__u8e3s4) {
}
function init_net_akehurst_kotlinx_collections_MutableOrderedSetImpl(_this__u8e3s4) {
}
var EmptyOrderedSet_instance;
function EmptyOrderedSet_getInstance() {
return EmptyOrderedSet_instance;
}
var EmptyIterator_instance;
function EmptyIterator_getInstance() {
return EmptyIterator_instance;
}
function cachedByKeySuspend(initializer) {
return new CachedValueSuspend(initializer);
}
function *_generator_get__cbf6n6($this, key, $completion) {
var tmp;
if ($this.b12_1.a3(key)) {
tmp = $this.b12_1.c3(key);
} else {
var tmp_0 = $this.initializer(key, $completion);
if (tmp_0 === get_COROUTINE_SUSPENDED())
tmp_0 = yield tmp_0;
var out = tmp_0;
// Inline function 'kotlin.collections.set' call
$this.b12_1.f3(key, out);
tmp = out;
}
return tmp;
}
function cachedByKey(initializer) {
return new CachedValue(initializer);
}
function GraphFromFunctions$_nodes$lambda$o$incoming$delegate$lambda$lambda(this$0) {
return (it) => this$0.s12_1.c3(it);
}
function GraphFromFunctions$_nodes$lambda$o$incoming$delegate$lambda(this$0, $nodeId) {
return () => {
var edgeIds = this$0.functions.incoming($nodeId);
return toList_0(mapNotNull(edgeIds, GraphFromFunctions$_nodes$lambda$o$incoming$delegate$lambda$lambda(this$0)));
};
}
function GraphFromFunctions$_nodes$lambda$o$_get_incoming_$ref_6efgdx() {
return (p0) => p0.incoming;
}
function GraphFromFunctions$_nodes$lambda$o$outgoing$delegate$lambda$lambda(this$0) {
return (it) => this$0.s12_1.c3(it);
}
function GraphFromFunctions$_nodes$lambda$o$outgoing$delegate$lambda(this$0, $nodeId) {
return () => {
var edgeIds = this$0.functions.outgoing($nodeId);
return toList_0(mapNotNull(edgeIds, GraphFromFunctions$_nodes$lambda$o$outgoing$delegate$lambda$lambda(this$0)));
};
}
function GraphFromFunctions$_nodes$lambda$o$_get_outgoing_$ref_lhd6i7() {
return (p0) => p0.outgoing;
}
function GraphFromFunctions$_edges$lambda$o$ends$delegate$lambda$lambda(this$0) {
return (it) => this$0.r12_1.c3(it);
}
function GraphFromFunctions$_edges$lambda$o$ends$delegate$lambda(this$0, $edgeId) {
return () => {
var nodeIds = this$0.functions.ends($edgeId);
return toList_0(mapNotNull(nodeIds, GraphFromFunctions$_edges$lambda$o$ends$delegate$lambda$lambda(this$0)));
};
}
function GraphFromFunctions$_edges$lambda$o$_get_ends_$ref_j8w0js() {
return (p0) => p0.ends;
}
function GraphFromFunctions$_nodes$lambda(this$0) {
return (nodeId) => new GraphFromFunctions$_nodes$2$1(nodeId, this$0);
}
function GraphFromFunctions$_edges$lambda(this$0) {
return (edgeId) => new GraphFromFunctions$_edges$2$1(edgeId, this$0);
}
function GraphFromFunctions$nodes$delegate$lambda$lambda(this$0) {
return (nodeId) => this$0.r12_1.c3(nodeId);
}
function GraphFromFunctions$nodes$delegate$lambda(this$0) {
return () => {
var ids = this$0.functions.nodeIds();
return toList_0(mapNotNull(ids, GraphFromFunctions$nodes$delegate$lambda$lambda(this$0)));
};
}
function GraphFromFunctions$_get_nodes_$ref_71zaia() {
return (p0) => p0.nodes;
}
function GraphFromFunctions$edges$delegate$lambda$lambda(this$0) {
return (nodeId) => this$0.s12_1.c3(nodeId);
}
function GraphFromFunctions$edges$delegate$lambda(this$0) {
return () => {
var ids = this$0.functions.edgeIds();
return toList_0(mapNotNull(ids, GraphFromFunctions$edges$delegate$lambda$lambda(this$0)));
};
}
function GraphFromFunctions$_get_edges_$ref_bafqmh() {
return (p0) => p0.edges;
}
var ListExt_instance;
function ListExt_getInstance() {
return ListExt_instance;
}
var SetExt_instance;
function SetExt_getInstance() {
return SetExt_instance;
}
var OrderedSetExt_instance;
function OrderedSetExt_getInstance() {
return OrderedSetExt_instance;
}
function topologicalSort(_this__u8e3s4, comparator) {
// Inline function 'kotlin.collections.associate' call
var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(_this__u8e3s4, 10)), 16);
// Inline function 'kotlin.collections.associateTo' call
var destination = LinkedHashMap.gb(capacity);
var _iterator__ex2g4s = _this__u8e3s4.g1();
while (_iterator__ex2g4s.f()) {
var element = _iterator__ex2g4s.e();
// Inline function 'kotlin.collections.filter' call
// Inline function 'kotlin.collections.filterTo' call
var destination_0 = ArrayList.o1();
var _iterator__ex2g4s_0 = _this__u8e3s4.g1();
while (_iterator__ex2g4s_0.f()) {
var element_0 = _iterator__ex2g4s_0.e();
if (!(element_0 === element) && 1 === comparator.compare(element, element_0)) {
destination_0.v(element_0);
}
}
var set = toMutableSet(destination_0);
// Inline function 'kotlin.collections.plusAssign' call
var pair = new Pair(element, set);
destination.f3(pair.hi_1, pair.ii_1);
}
var comparisons = toMutableMap(destination);
// Inline function 'kotlin.collections.mutableSetOf' call
var toRemove = LinkedHashSet.j1();
// Inline function 'kotlin.collections.mutableListOf' call
var sortedElements = ArrayList.o1();
// Inline function 'kotlin.collections.filter' call
// Inline function 'kotlin.collections.filterTo' call
var destination_1 = LinkedHashMap.j4();
// Inline function 'kotlin.collections.iterator' call
var _iterator__ex2g4s_1 = comparisons.z1().g1();
while (_iterator__ex2g4s_1.f()) {
var element_1 = _iterator__ex2g4s_1.e();
if (element_1.b2().l1()) {
destination_1.f3(element_1.a2(), element_1.b2());
}
}
// Inline function 'kotlin.collections.map' call
// Inline function 'kotlin.collections.mapTo' call
var destination_2 = ArrayList.a1(destination_1.h1());
// Inline function 'kotlin.collections.iterator' call
var _iterator__ex2g4s_2 = destination_1.z1().g1();
while (_iterator__ex2g4s_2.f()) {
var item = _iterator__ex2g4s_2.e();
var tmp$ret$14 = item.a2();
destination_2.v(tmp$ret$14);
}
var S = toMutableList(destination_2);
// Inline function 'kotlin.collections.forEach' call
var _iterator__ex2g4s_3 = S.g1();
while (_iterator__ex2g4s_3.f()) {
var element_2 = _iterator__ex2g4s_3.e();
comparisons.g3(element_2);
}
$l$loop: while (true) {
// Inline function 'kotlin.collections.isNotEmpty' call
if (!!S.l1()) {
break $l$loop;
}
var n = first_0(S);
// Inline function 'kotlin.collections.minusAssign' call
S.j3(n);
sortedElements.v(n);
// Inline function 'kotlin.collections.iterator' call
var _iterator__ex2g4s_4 = comparisons.z1().g1();
while (_iterator__ex2g4s_4.f()) {
var comp = _iterator__ex2g4s_4.e();
var set_0 = comp.b2();
if (set_0.p1(n)) {
set_0.j3(n);
if (set_0.l1()) {
// Inline function 'kotlin.collections.plusAssign' call
var element_3 = comp.a2();
S.v(element_3);
toRemove.v(comp.a2());
}
}
}
// Inline function 'kotlin.collections.isNotEmpty' call
if (!toRemove.l1()) {
// Inline function 'kotlin.collections.forEach' call
var _iterator__ex2g4s_5 = toRemove.g1();
while (_iterator__ex2g4s_5.f()) {
var element_4 = _iterator__ex2g4s_5.e();
comparisons.g3(element_4);
}
toRemove.i3();
}
}
if (comparisons.l1()) {
return sortedElements;
} else {
// Inline function 'kotlin.error' call
var message = 'Internal Error: Could not sort elements ';
throw IllegalStateException.t4(toString(message));
}
}
function transitveClosure(_this__u8e3s4, function_0) {
var result = toMutableSet(_this__u8e3s4);
var newThings = toMutableSet(_this__u8e3s4);
var newStuff = true;
while (newStuff) {
var temp = toSet(newThings);
newThings.i3();
var _iterator__ex2g4s = temp.g1();
while (_iterator__ex2g4s.f()) {
var nt = _iterator__ex2g4s.e();
var s = function_0(nt);
newThings.k1(s);
}
newThings.h2(result);
newStuff = result.k1(newThings);
}
return result;
}
var IssueKind_ERROR_instance;
var IssueKind_WARNING_instance;
var IssueKind_INFORMATION_instance;
function values() {
return [IssueKind_ERROR_getInstance(), IssueKind_WARNING_getInstance(), IssueKind_INFORMATION_getInstance()];
}
function valueOf(value) {
switch (value) {
case 'ERROR':
return IssueKind_ERROR_getInstance();
case 'WARNING':
return IssueKind_WARNING_getInstance();
case 'INFORMATION':
return IssueKind_INFORMATION_getInstance();
default:
IssueKind_initEntries();
THROW_IAE('No enum constant net.akehurst.kotlinx.issues.api.IssueKind.' + value);
break;
}
}
var IssueKind_entriesInitialized;
function IssueKind_initEntries() {
if (IssueKind_entriesInitialized)
return Unit_instance;
IssueKind_entriesInitialized = true;
IssueKind_ERROR_instance = new IssueKind('ERROR', 0);
IssueKind_WARNING_instance = new IssueKind('WARNING', 1);
IssueKind_INFORMATION_instance = new IssueKind('INFORMATION', 2);
}
function IssueKind_ERROR_getInstance() {
IssueKind_initEntries();
return IssueKind_ERROR_instance;
}
function IssueKind_WARNING_getInstance() {
IssueKind_initEntries();
return IssueKind_WARNING_instance;
}
function IssueKind_INFORMATION_getInstance() {
IssueKind_initEntries();
return IssueKind_INFORMATION_instance;
}
function plus_2(_this__u8e3s4, other) {
var issues = new IssueHolder();
issues.addAllFrom(_this__u8e3s4);
issues.addAllFrom(other);
return issues;
}
function IssueHolder$toString$lambda(it) {
return toString(it);
}
//region block: post-declaration
protoOf(LazyMap).asJsReadonlyMapView = asJsReadonlyMapView;
initMetadataForClass(LazyMap, 'LazyMap', VOID, VOID, [KtMap]);
initMetadataForInterface(MapNotNull, 'MapNotNull', VOID, VOID, [KtMap]);
initMetadataForInterface(MutableMapNotNull, 'MutableMapNotNull', VOID, VOID, [MapNotNull, KtMutableMap]);
protoOf(LazyMutableMapNotNull).asJsReadonlyMapView = asJsReadonlyMapView;
protoOf(LazyMutableMapNotNull).asJsMapView = asJsMapView;
initMetadataForClass(LazyMutableMapNotNull, 'LazyMutableMapNotNull', VOID, VOID, [MutableMapNotNull]);
protoOf(LazyMapNotNull).asJsReadonlyMapView = asJsReadonlyMapView;
initMetadataForClass(LazyMapNotNull, 'LazyMapNotNull', VOID, VOID, [MapNotNull]);
initMetadataForClass(MutableMapNonNullDefault, 'MutableMapNonNullDefault', VOID, VOID, [MutableMapNotNull, KtMutableMap]);
initMetadataForClass(MutableStack, 'MutableStack', MutableStack);
initMetadataForInterface(OrderedSet, 'OrderedSet', VOID, VOID, [KtSet]);
initMetadataForInterface(MutableOrderedSet, 'MutableOrderedSet', VOID, VOID, [OrderedSet, KtMutableSet]);
protoOf(OrderedSetImpl).asJsReadonlySetView = asJsReadonlySetView;
initMetadataForClass(OrderedSetImpl, 'OrderedSetImpl', VOID, VOID, [OrderedSet]);
protoOf(MutableOrderedSetImpl).asJsReadonlySetView = asJsReadonlySetView;
protoOf(MutableOrderedSetImpl).asJsSetView = asJsSetView;
initMetadataForClass(MutableOrderedSetImpl, 'MutableOrderedSetImpl', VOID, VOID, [MutableOrderedSet]);
protoOf(EmptyOrderedSet).asJsReadonlySetView = asJsReadonlySetView;
initMetadataForObject(EmptyOrderedSet, 'EmptyOrderedSet', VOID, VOID, [OrderedSet]);
initMetadataForObject(EmptyIterator, 'EmptyIterator', VOID, VOID, [Iterator]);
initMetadataForClass(PopResult, 'PopResult');
initMetadataForClass(Stack, 'Stack', Stack);
initMetadataForClass(CachedValueSuspend, 'CachedValueSuspend', VOID, VOID, VOID, [1]);
initMetadataForClass(CachedValue, 'CachedValue');
initMetadataForClass(GraphNodeId, 'GraphNodeId');
initMetadataForClass(GraphEdgeId, 'GraphEdgeId');
initMetadataForInterface(Graph, 'Graph');
initMetadataForInterface(GraphNode, 'GraphNode');
initMetadataForInterface(GraphEdge, 'GraphEdge');
initMetadataForClass(GraphFunctions, 'GraphFunctions');
initMetadataForClass(GraphFromFunctions$_nodes$2$1, VOID, VOID, VOID, [GraphNode]);
protoOf(GraphFromFunctions$_edges$2$1).tq = get_source;
protoOf(GraphFromFunctions$_edges$2$1).m12 = get_target;
initMetadataForClass(GraphFromFunctions$_edges$2$1, VOID, VOID, VOID, [GraphEdge]);
initMetadataForClass(GraphFromFunctions, 'GraphFromFunctions', VOID, VOID, [Graph]);
initMetadataForClass(GraphSimple, 'GraphSimple', VOID, VOID, [Graph]);
initMetadataForClass(GraphNodeSimple, 'GraphNodeSimple', VOID, VOID, [GraphNode]);
protoOf(GraphEdgeSimple).tq = get_source;
protoOf(GraphEdgeSimple).m12 = get_target;
initMetadataForClass(GraphEdgeSimple, 'GraphEdgeSimple', VOID, VOID, [GraphEdge]);
initMetadataForClass(ManagedCollection, 'ManagedCollection');
initMetadataForClass(ManagedReferenceCollection, 'ManagedReferenceCollection');
initMetadataForClass(ManagedSet, 'ManagedSet');
initMetadataForClass(ManagedReferenceSet, 'ManagedReferenceSet');
initMetadataForClass(ManagedOrderedSet, 'ManagedOrderedSet', VOID, VOID, [AbstractMutableSet, MutableOrderedSet]);
initMetadataForClass(ManagedReferenceOrderedSet, 'ManagedReferenceOrderedSet');
initMetadataForClass(ManagedCollection$iterator$1, VOID, VOID, VOID, [Iterator]);
initMetadataForClass(ManagedSet$iterator$1, VOID, VOID, VOID, [Iterator]);
initMetadataForClass(ManagedOrderedSet$iterator$1, VOID, VOID, VOID, [Iterator]);
initMetadataForObject(ListExt_0, 'ListExt');
initMetadataForObject(SetExt_0, 'SetExt');
initMetadataForObject(OrderedSetExt_0, 'OrderedSetExt');
initMetadataForInterface(Tree, 'Tree');
initMetadataForInterface(TreeNode, 'TreeNode');
initMetadataForClass(TreeFunctions, 'TreeFunctions');
initMetadataForClass(IssueKind, 'IssueKind');
initMetadataForInterface(Issue, 'Issue');
initMetadataForInterface(IssueCollection, 'IssueCollection', VOID, VOID, [Collection]);
initMetadataForClass(IssueDefault, 'IssueDefault', VOID, VOID, [Issue]);
initMetadataForClass(IssueHolder, 'IssueHolder', IssueHolder, VOID, [IssueCollection]);
//endregion
//region block: init
EmptyOrderedSet_instance = new EmptyOrderedSet();
EmptyIterator_instance = new EmptyIterator();
ListExt_instance = new ListExt_0();
SetExt_instance = new SetExt_0();
OrderedSetExt_instance = new OrderedSetExt_0();
//endregion
//region block: exports
Stack.PopResult = PopResult;
var ListExt = {getInstance: ListExt_getInstance};
var SetExt = {getInstance: SetExt_getInstance};
var OrderedSetExt = {getInstance: OrderedSetExt_getInstance};
IssueKind.values = values;
IssueKind.valueOf = valueOf;
defineProp(IssueKind, 'ERROR', IssueKind_ERROR_getInstance, VOID, true);
defineProp(IssueKind, 'WARNING', IssueKind_WARNING_getInstance, VOID, true);
defineProp(IssueKind, 'INFORMATION', IssueKind_INFORMATION_getInstance, VOID, true);
export {
lazyMap as lazyMap,
LazyMap as LazyMap,
lazyMapNotNull as lazyMapNotNull,
lazyMutableMapNotNull as lazyMutableMapNotNull,
MutableMapNonNullDefault as MutableMapNonNullDefault,
mutableStackOf as mutableStackOf,
emptyOrderedSet as emptyOrderedSet,
orderedSetOf as orderedSetOf,
mutableOrderedSetOf as mutableOrderedSetOf,
toOrderedSet as toOrderedSet,
toMutableOrderedSet as toMutableOrderedSet,
plus_1 as plus,
plusAll as plusAll,
plusAssign as plusAssign,
OrderedSetImpl as OrderedSetImpl,
MutableOrderedSetImpl as MutableOrderedSetImpl,
Stack as Stack,
cachedByKeySuspend as cachedByKeySuspend,
CachedValueSuspend as CachedValueSuspend,
cachedByKey as cachedByKey,
CachedValue as CachedValue,
GraphNodeId as GraphNodeId,
GraphEdgeId as GraphEdgeId,
GraphFunctions as GraphFunctions,
GraphFromFunctions as GraphFromFunctions,
GraphSimple as GraphSimple,
GraphNodeSimple as GraphNodeSimple,
GraphEdgeSimple as GraphEdgeSimple,
ManagedReferenceCollection as ManagedReferenceCollection,
ManagedReferenceSet as ManagedReferenceSet,
ManagedReferenceOrderedSet as ManagedReferenceOrderedSet,
ListExt as ListExt,
SetExt as SetExt,
OrderedSetExt as OrderedSetExt,
topologicalSort as topologicalSort,
transitveClosure as transitveClosure,
TreeFunctions as TreeFunctions,
IssueKind as IssueKind,
IssueDefault as IssueDefault,
IssueHolder as IssueHolder,
};
export {
OrderedSet as OrderedSet4xxz3zmkqmwh,
lazyMapNotNull as lazyMapNotNull301q5a32qegqb,
lazyMap as lazyMap3l81mrwdtx80l,
lazyMutableMapNotNull as lazyMutableMapNotNullytuj7lulozz7,
mutableStackOf as mutableStackOf1lnre6z49o79y,
orderedSetOf as orderedSetOf1nd7nc4cg10ip,
plusAll as plusAll13gm1ifgmgvu9,
toMutableOrderedSet as toMutableOrderedSet3uhw9cvupb213,
toOrderedSet as toOrderedSetyzxrvrtpmmfo,
topologicalSort as topologicalSort23xfr7thibxsk,
transitveClosure as transitveClosure3hde17zold9uq,
};
//endregion
//# sourceMappingURL=net.akehurst.kotlinx-kotlinx-collections.mjs.map