(function (root, factory) {
if (typeof define === 'function' && define.amd)
define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './korlibs-kds.js', './korlibs-kmem.js'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./korlibs-kds.js'), require('./korlibs-kmem.js'));
else {
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
throw new Error("Error loading module 'korlibs-korma'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'korlibs-korma'.");
}
if (typeof this['korlibs-kds'] === 'undefined') {
throw new Error("Error loading module 'korlibs-korma'. Its dependency 'korlibs-kds' was not found. Please, check whether 'korlibs-kds' is loaded prior to 'korlibs-korma'.");
}
if (typeof this['korlibs-kmem'] === 'undefined') {
throw new Error("Error loading module 'korlibs-korma'. Its dependency 'korlibs-kmem' was not found. Please, check whether 'korlibs-kmem' is loaded prior to 'korlibs-korma'.");
}
root['korlibs-korma'] = factory(typeof this['korlibs-korma'] === 'undefined' ? {} : this['korlibs-korma'], this['kotlin-kotlin-stdlib-js-ir'], this['korlibs-kds'], this['korlibs-kmem']);
}
}(this, function (_, kotlin_kotlin, kotlin_com_soywiz_korlibs_kds_kds, kotlin_com_soywiz_korlibs_kmem_kmem) {
'use strict';
//region block: imports
var imul = Math.imul;
var hypot = Math.hypot;
var objectMeta = kotlin_kotlin.$_$.wd;
var THROW_CCE = kotlin_kotlin.$_$.di;
var getNumberHashCode = kotlin_kotlin.$_$.uc;
var equals = kotlin_kotlin.$_$.rc;
var classMeta = kotlin_kotlin.$_$.pc;
var Unit_getInstance = kotlin_kotlin.$_$.k5;
var Comparable = kotlin_kotlin.$_$.oh;
var ConcurrentPool_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.i2;
var interfaceMeta = kotlin_kotlin.$_$.yc;
var KMutableProperty0 = kotlin_kotlin.$_$.af;
var getPropertyCallableRef = kotlin_kotlin.$_$.vc;
var KMutableProperty1 = kotlin_kotlin.$_$.bf;
var Enum = kotlin_kotlin.$_$.sh;
var get_PI = kotlin_kotlin.$_$.be;
var DoubleCompanionObject_getInstance = kotlin_kotlin.$_$.u4;
var contentEquals = kotlin_kotlin.$_$.w6;
var contentHashCode = kotlin_kotlin.$_$.c7;
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.h2;
var numberToInt = kotlin_kotlin.$_$.ud;
var compareTo = kotlin_kotlin.$_$.qc;
var isInterface = kotlin_kotlin.$_$.id;
var Extra = kotlin_com_soywiz_korlibs_kds_kds.$_$.g;
var Mixin_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.k2;
var DoubleArrayList = kotlin_com_soywiz_korlibs_kds_kds.$_$.d;
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.p3;
var round = kotlin_kotlin.$_$.fe;
var IntArrayList = kotlin_com_soywiz_korlibs_kds_kds.$_$.p;
var FastArrayList_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.d2;
var numberToDouble = kotlin_kotlin.$_$.td;
var toString = kotlin_kotlin.$_$.ae;
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.x2;
var primitiveArrayConcat = kotlin_kotlin.$_$.e;
var NotImplementedError = kotlin_kotlin.$_$.zh;
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m1;
var sort$default = kotlin_com_soywiz_korlibs_kds_kds.$_$.b2;
var lazy = kotlin_kotlin.$_$.yi;
var contentEquals_0 = kotlin_kotlin.$_$.x6;
var contentHashCode_0 = kotlin_kotlin.$_$.b7;
var contentToString = kotlin_kotlin.$_$.e7;
var emptyList = kotlin_kotlin.$_$.w7;
var hashCode = kotlin_kotlin.$_$.xc;
var until = kotlin_kotlin.$_$.ye;
var collectionSizeOrDefault = kotlin_kotlin.$_$.p6;
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.l1;
var listOf = kotlin_kotlin.$_$.d9;
var toDoubleArray = kotlin_kotlin.$_$.ga;
var KProperty1 = kotlin_kotlin.$_$.ef;
var binarySearch$default = kotlin_com_soywiz_korlibs_kds_kds.$_$.z1;
var _BSearchResult___get_index__impl__b5kraz = kotlin_com_soywiz_korlibs_kds_kds.$_$.x2;
var _BSearchResult___get_found__impl__om04iz = kotlin_com_soywiz_korlibs_kds_kds.$_$.w2;
var _BSearchResult___get_nearIndex__impl__s8nq43 = kotlin_com_soywiz_korlibs_kds_kds.$_$.y2;
var joinToString$default = kotlin_kotlin.$_$.m;
var checkIndexOverflow = kotlin_kotlin.$_$.n6;
var binarySearch$default_0 = kotlin_kotlin.$_$.i;
var first = kotlin_kotlin.$_$.g8;
var last = kotlin_kotlin.$_$.a9;
var getOrNull = kotlin_kotlin.$_$.k8;
var listOf_0 = kotlin_kotlin.$_$.c9;
var NotImplementedError_init_$Create$ = kotlin_kotlin.$_$.k1;
var getExtraTyped = kotlin_com_soywiz_korlibs_kds_kds.$_$.j1;
var setExtra = kotlin_com_soywiz_korlibs_kds_kds.$_$.q1;
var PropertyThis = kotlin_com_soywiz_korlibs_kds_kds.$_$.e;
var getCyclic = kotlin_com_soywiz_korlibs_kds_kds.$_$.h1;
var addAll = kotlin_kotlin.$_$.j6;
var noWhenBranchMatchedException = kotlin_kotlin.$_$.zi;
var clamp = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.e1;
var ensureNotNull = kotlin_kotlin.$_$.ri;
var getCyclic_0 = kotlin_com_soywiz_korlibs_kds_kds.$_$.i1;
var extendThrowable = kotlin_kotlin.$_$.sc;
var captureStack = kotlin_kotlin.$_$.jc;
var fastArrayListOf = kotlin_com_soywiz_korlibs_kds_kds.$_$.b1;
var SortOps = kotlin_com_soywiz_korlibs_kds_kds.$_$.u;
var genericSort = kotlin_com_soywiz_korlibs_kds_kds.$_$.e1;
var toIntRound = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.d3;
var _BSearchResult___init__impl__em6zam = kotlin_com_soywiz_korlibs_kds_kds.$_$.v2;
var IntCompanionObject_getInstance = kotlin_kotlin.$_$.w4;
var plus = kotlin_kotlin.$_$.m9;
var distinct = kotlin_kotlin.$_$.t7;
var toIntArray = kotlin_kotlin.$_$.ia;
var sortedArray = kotlin_kotlin.$_$.w9;
var fillArrayVal = kotlin_kotlin.$_$.tc;
var toList = kotlin_kotlin.$_$.oa;
var Pair = kotlin_kotlin.$_$.ai;
var get_sign = kotlin_kotlin.$_$.ge;
var step = kotlin_kotlin.$_$.we;
var coerceIn = kotlin_kotlin.$_$.qe;
var FastIntMap = kotlin_com_soywiz_korlibs_kds_kds.$_$.j;
var get_size = kotlin_com_soywiz_korlibs_kds_kds.$_$.s1;
var Pool_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.t2;
var Pool_init_$Create$_0 = kotlin_com_soywiz_korlibs_kds_kds.$_$.s2;
var throwUninitializedPropertyAccessException = kotlin_kotlin.$_$.ej;
var clamp_0 = kotlin_com_soywiz_korlibs_kmem_kmem.$_$.d1;
var hasExtra = kotlin_com_soywiz_korlibs_kds_kds.$_$.m1;
var IntArrayList_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.p2;
var DoubleArrayList_init_$Create$ = kotlin_com_soywiz_korlibs_kds_kds.$_$.j2;
var IntArrayList_init_$Create$_0 = kotlin_com_soywiz_korlibs_kds_kds.$_$.e2;
var DoubleArrayList_init_$Create$_0 = kotlin_com_soywiz_korlibs_kds_kds.$_$.c2;
var isCharSequence = kotlin_kotlin.$_$.dd;
var trimEnd = kotlin_kotlin.$_$.eh;
var lastOrNull = kotlin_kotlin.$_$.y8;
var Property = kotlin_com_soywiz_korlibs_kds_kds.$_$.f;
var numberToLong = kotlin_kotlin.$_$.vd;
var mapCapacity = kotlin_kotlin.$_$.e9;
var coerceAtLeast = kotlin_kotlin.$_$.me;
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.u1;
var LazyThreadSafetyMode_PUBLICATION_getInstance = kotlin_kotlin.$_$.g;
var lazy_0 = kotlin_kotlin.$_$.xi;
var replace$default = kotlin_kotlin.$_$.a1;
//endregion
//region block: pre-declaration
Type.prototype = Object.create(Enum.prototype);
Type.prototype.constructor = Type;
MajorOrder.prototype = Object.create(Enum.prototype);
MajorOrder.prototype.constructor = MajorOrder;
function get_dimensions() {
return 2;
}
function get(index, dim) {
return dim === 0 ? this.p71(index) : this.q71(index);
}
function getBounds$default(target, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
target = Companion_getInstance_12().zp();
return $handler == null ? this.a72(target) : $handler(target);
}
function normal$default(t, target, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
target = Companion_getInstance_8().zp();
return $handler == null ? this.p7h(t, target) : $handler(t, target);
}
function tangent$default(t, target, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
target = Companion_getInstance_8().zp();
return $handler == null ? this.r7h(t, target) : $handler(t, target);
}
function calc$default(t, target, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
target = Companion_getInstance_8().zp();
return $handler == null ? this.q7g(t, target) : $handler(t, target);
}
function get_0(t, out) {
return this.r7g(t, out);
}
function get$default(t, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
out = Companion_getInstance_8().zp();
return $handler == null ? this.e7i(t, out) : $handler(t, out);
}
function getLUT$default(steps, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
steps = 100;
if (!(($mask0 & 2) === 0))
out = CurveLUT_init_$Create$(this, steps + 1 | 0);
return $handler == null ? this.k7h(steps, out) : $handler(steps, out);
}
function derivative$default(t, normalize, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
normalize = false;
if (!(($mask0 & 4) === 0))
out = Companion_getInstance_8().zp();
return $handler == null ? this.n7h(t, normalize, out) : $handler(t, normalize, out);
}
function hullOrNull$default(t, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0)) {
out = PointArrayList_init_$Create$(0, 1, null);
}
return $handler == null ? this.t7h(t, out) : $handler(t, out);
}
function toLine$default(out, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
out = Line_init_$Create$();
return $handler == null ? this.c7i(out) : $handler(out);
}
StrokePointsMode.prototype = Object.create(Enum.prototype);
StrokePointsMode.prototype.constructor = StrokePointsMode;
ImageDoNotFitException.prototype = Object.create(Error.prototype);
ImageDoNotFitException.prototype.constructor = ImageDoNotFitException;
HitTestDirection.prototype = Object.create(Enum.prototype);
HitTestDirection.prototype.constructor = HitTestDirection;
SortOps_0.prototype = Object.create(SortOps.prototype);
SortOps_0.prototype.constructor = SortOps_0;
LineCap.prototype = Object.create(Enum.prototype);
LineCap.prototype.constructor = LineCap;
LineJoin.prototype = Object.create(Enum.prototype);
LineJoin.prototype.constructor = LineJoin;
LineScaleMode.prototype = Object.create(Enum.prototype);
LineScaleMode.prototype.constructor = LineScaleMode;
IntArrayListSort.prototype = Object.create(SortOps.prototype);
IntArrayListSort.prototype.constructor = IntArrayListSort;
PolygonScanline.prototype = Object.create(RastScale.prototype);
PolygonScanline.prototype.constructor = PolygonScanline;
EdgePoint.prototype = Object.create(Enum.prototype);
EdgePoint.prototype.constructor = EdgePoint;
function quadTo(cx, cy, ax, ay) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadToCubic' call
var tmp0_quadToCubic = Companion_getInstance_18();
var tmp1_quadToCubic = this.s7e();
var tmp2_quadToCubic = this.t7e();
// Inline function 'kotlin.contracts.contract' call
var tmp3__anonymous__ufb84q = tmp0_quadToCubic.l7g(tmp1_quadToCubic, cx);
var tmp4__anonymous__pkmkx7 = tmp0_quadToCubic.l7g(tmp2_quadToCubic, cy);
var tmp5__anonymous__kpxxpo = tmp0_quadToCubic.m7g(cx, ax);
var tmp6__anonymous__fv9ai5 = tmp0_quadToCubic.m7g(cy, ay);
this.x7e(tmp3__anonymous__ufb84q, tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, tmp6__anonymous__fv9ai5, ax, ay);
tmp$ret$0 = Unit_getInstance();
}
function close() {
return Unit_getInstance();
}
function moveTo(x, y) {
return Unit_getInstance();
}
function lineTo(x, y) {
return Unit_getInstance();
}
function quadTo_0(cx, cy, ax, ay) {
return Unit_getInstance();
}
function cubicTo(cx1, cy1, cx2, cy2, ax, ay) {
return Unit_getInstance();
}
Winding.prototype = Object.create(Enum.prototype);
Winding.prototype.constructor = Winding;
Easings.prototype = Object.create(Enum.prototype);
Easings.prototype.constructor = Easings;
Easings$SMOOTH.prototype = Object.create(Easings.prototype);
Easings$SMOOTH.prototype.constructor = Easings$SMOOTH;
Easings$EASE_IN_ELASTIC.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_ELASTIC.prototype.constructor = Easings$EASE_IN_ELASTIC;
Easings$EASE_OUT_ELASTIC.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_ELASTIC.prototype.constructor = Easings$EASE_OUT_ELASTIC;
Easings$EASE_OUT_BOUNCE.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_BOUNCE.prototype.constructor = Easings$EASE_OUT_BOUNCE;
Easings$LINEAR.prototype = Object.create(Easings.prototype);
Easings$LINEAR.prototype.constructor = Easings$LINEAR;
Easings$EASE.prototype = Object.create(Easings.prototype);
Easings$EASE.prototype.constructor = Easings$EASE;
Easings$EASE_IN.prototype = Object.create(Easings.prototype);
Easings$EASE_IN.prototype.constructor = Easings$EASE_IN;
Easings$EASE_OUT.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT.prototype.constructor = Easings$EASE_OUT;
Easings$EASE_IN_OUT.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_OUT.prototype.constructor = Easings$EASE_IN_OUT;
Easings$EASE_IN_OLD.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_OLD.prototype.constructor = Easings$EASE_IN_OLD;
Easings$EASE_OUT_OLD.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_OLD.prototype.constructor = Easings$EASE_OUT_OLD;
Easings$EASE_IN_OUT_OLD.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_OUT_OLD.prototype.constructor = Easings$EASE_IN_OUT_OLD;
Easings$EASE_OUT_IN_OLD.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_IN_OLD.prototype.constructor = Easings$EASE_OUT_IN_OLD;
Easings$EASE_IN_BACK.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_BACK.prototype.constructor = Easings$EASE_IN_BACK;
Easings$EASE_OUT_BACK.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_BACK.prototype.constructor = Easings$EASE_OUT_BACK;
Easings$EASE_IN_OUT_BACK.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_OUT_BACK.prototype.constructor = Easings$EASE_IN_OUT_BACK;
Easings$EASE_OUT_IN_BACK.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_IN_BACK.prototype.constructor = Easings$EASE_OUT_IN_BACK;
Easings$EASE_IN_OUT_ELASTIC.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_OUT_ELASTIC.prototype.constructor = Easings$EASE_IN_OUT_ELASTIC;
Easings$EASE_OUT_IN_ELASTIC.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_IN_ELASTIC.prototype.constructor = Easings$EASE_OUT_IN_ELASTIC;
Easings$EASE_IN_BOUNCE.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_BOUNCE.prototype.constructor = Easings$EASE_IN_BOUNCE;
Easings$EASE_IN_OUT_BOUNCE.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_OUT_BOUNCE.prototype.constructor = Easings$EASE_IN_OUT_BOUNCE;
Easings$EASE_OUT_IN_BOUNCE.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_IN_BOUNCE.prototype.constructor = Easings$EASE_OUT_IN_BOUNCE;
Easings$EASE_IN_QUAD.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_QUAD.prototype.constructor = Easings$EASE_IN_QUAD;
Easings$EASE_OUT_QUAD.prototype = Object.create(Easings.prototype);
Easings$EASE_OUT_QUAD.prototype.constructor = Easings$EASE_OUT_QUAD;
Easings$EASE_IN_OUT_QUAD.prototype = Object.create(Easings.prototype);
Easings$EASE_IN_OUT_QUAD.prototype.constructor = Easings$EASE_IN_OUT_QUAD;
Easings$EASE_SINE.prototype = Object.create(Easings.prototype);
Easings$EASE_SINE.prototype.constructor = Easings$EASE_SINE;
Easings$EASE_CLAMP_START.prototype = Object.create(Easings.prototype);
Easings$EASE_CLAMP_START.prototype.constructor = Easings$EASE_CLAMP_START;
Easings$EASE_CLAMP_END.prototype = Object.create(Easings.prototype);
Easings$EASE_CLAMP_END.prototype.constructor = Easings$EASE_CLAMP_END;
Easings$EASE_CLAMP_MIDDLE.prototype = Object.create(Easings.prototype);
Easings$EASE_CLAMP_MIDDLE.prototype.constructor = Easings$EASE_CLAMP_MIDDLE;
//endregion
function Companion() {
Companion_instance = this;
this.r6z_1 = new Anchor(0.0, 0.0);
this.s6z_1 = new Anchor(0.5, 0.0);
this.t6z_1 = new Anchor(1.0, 0.0);
this.u6z_1 = new Anchor(0.0, 0.5);
this.v6z_1 = new Anchor(0.5, 0.5);
this.w6z_1 = new Anchor(1.0, 0.5);
this.x6z_1 = new Anchor(0.0, 1.0);
this.y6z_1 = new Anchor(0.5, 1.0);
this.z6z_1 = new Anchor(1.0, 1.0);
}
Companion.$metadata$ = objectMeta('Companion');
var Companion_instance;
function Companion_getInstance() {
if (Companion_instance == null)
new Companion();
return Companion_instance;
}
function Anchor(sx, sy) {
Companion_getInstance();
this.a70_1 = sx;
this.b70_1 = sy;
}
Anchor.prototype.c70 = function (ratio, other) {
return new Anchor(interpolate_0(ratio, this.a70_1, other.a70_1), interpolate_0(ratio, this.b70_1, other.b70_1));
};
Anchor.prototype.d70 = function (ratio, other) {
return this.c70(ratio, other instanceof Anchor ? other : THROW_CCE());
};
Anchor.prototype.toString = function () {
return 'Anchor(sx=' + this.a70_1 + ', sy=' + this.b70_1 + ')';
};
Anchor.prototype.hashCode = function () {
var result = getNumberHashCode(this.a70_1);
result = imul(result, 31) + getNumberHashCode(this.b70_1) | 0;
return result;
};
Anchor.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Anchor))
return false;
var tmp0_other_with_cast = other instanceof Anchor ? other : THROW_CCE();
if (!equals(this.a70_1, tmp0_other_with_cast.a70_1))
return false;
if (!equals(this.b70_1, tmp0_other_with_cast.b70_1))
return false;
return true;
};
Anchor.$metadata$ = classMeta('Anchor', [Interpolable]);
function _Angle___init__impl__g23q1m(ratio) {
return ratio;
}
function _Angle___get_ratio__impl__ap3on4($this) {
return $this;
}
function _Angle___get_radians__impl__n00yt5($this) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.ratioToRadians' call
var tmp0_ratioToRadians = Companion_getInstance_0();
var tmp1_ratioToRadians = _Angle___get_ratio__impl__ap3on4($this);
tmp$ret$0 = tmp1_ratioToRadians * 6.283185307179586;
return tmp$ret$0;
}
function _Angle___get_degrees__impl__qg56vw($this) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.ratioToDegrees' call
var tmp0_ratioToDegrees = Companion_getInstance_0();
var tmp1_ratioToDegrees = _Angle___get_ratio__impl__ap3on4($this);
tmp$ret$0 = tmp1_ratioToDegrees * 360.0;
return tmp$ret$0;
}
function Angle__toString_impl_786qky($this) {
return get_niceStr(roundDecimalPlaces(_Angle___get_degrees__impl__qg56vw($this), 2)) + '.degrees';
}
function Companion_0() {
Companion_instance_0 = this;
}
Companion_0.prototype.e70 = function () {
return this.f70(1.0E-5);
};
Companion_0.prototype.g70 = function () {
return this.f70(0.0);
};
Companion_0.prototype.h70 = function () {
return this.f70(0.25);
};
Companion_0.prototype.i70 = function () {
return this.f70(0.5);
};
Companion_0.prototype.j70 = function () {
return this.f70(1.0);
};
Companion_0.prototype.f70 = function (ratio) {
return _Angle___init__impl__g23q1m(ratio);
};
Companion_0.prototype.k70 = function (radians) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$0 = radians / 6.283185307179586;
return this.f70(tmp$ret$0);
};
Companion_0.prototype.l70 = function (degrees) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.degreesToRatio' call
tmp$ret$0 = degrees / 360.0;
return this.f70(tmp$ret$0);
};
Companion_0.prototype.m70 = function (radians) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp0_fromRadians = radians;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$0 = tmp0_fromRadians / 6.283185307179586;
tmp$ret$1 = this.f70(tmp$ret$0);
return tmp$ret$1;
};
Companion_0.prototype.n70 = function (degrees) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.fromDegrees' call
var tmp0_fromDegrees = degrees;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.degreesToRatio' call
tmp$ret$0 = tmp0_fromDegrees / 360.0;
tmp$ret$1 = this.f70(tmp$ret$0);
return tmp$ret$1;
};
Companion_0.prototype.o70 = function (x, y) {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp$ret$0;
// Inline function 'kotlin.math.atan2' call
tmp$ret$0 = Math.atan2(x, y);
var tmp0_fromRadians = tmp$ret$0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$1 = tmp0_fromRadians / 6.283185307179586;
tmp$ret$2 = this.f70(tmp$ret$1);
return tmp$ret$2;
};
Companion_0.prototype.p70 = function (p) {
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.Companion.atan2' call
var tmp0_atan2 = p.d1n();
var tmp1_atan2 = p.e1n();
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp$ret$0;
// Inline function 'kotlin.math.atan2' call
tmp$ret$0 = Math.atan2(tmp0_atan2, tmp1_atan2);
var tmp0_fromRadians = tmp$ret$0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$1 = tmp0_fromRadians / 6.283185307179586;
tmp$ret$2 = this.f70(tmp$ret$1);
tmp$ret$3 = tmp$ret$2;
return tmp$ret$3;
};
Companion_0.prototype.q70 = function (ratio) {
return ratio * 360.0;
};
Companion_0.prototype.r70 = function (ratio) {
return ratio * 6.283185307179586;
};
Companion_0.prototype.s70 = function (degrees) {
return degrees / 360.0;
};
Companion_0.prototype.t70 = function (radians) {
return radians / 6.283185307179586;
};
Companion_0.prototype.u70 = function (x0, y0, x1, y1) {
return Angle_between(x0, y0, x1, y1);
};
Companion_0.prototype.v70 = function (x0, y0, x1, y1) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between = x0;
var tmp1_between = y0;
var tmp2_between = x1;
var tmp3_between = y1;
tmp$ret$0 = Angle_between(tmp0_between, tmp1_between, tmp2_between, tmp3_between);
return tmp$ret$0;
};
Companion_0.prototype.w70 = function (p0, p1) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between = p0.d1n();
var tmp1_between = p0.e1n();
var tmp2_between = p1.d1n();
var tmp3_between = p1.e1n();
tmp$ret$0 = Angle_between(tmp0_between, tmp1_between, tmp2_between, tmp3_between);
return tmp$ret$0;
};
Companion_0.$metadata$ = objectMeta('Companion');
var Companion_instance_0;
function Companion_getInstance_0() {
if (Companion_instance_0 == null)
new Companion_0();
return Companion_instance_0;
}
function Angle__compareTo_impl_a0hfds($this, other) {
var left = _Angle___get_ratio__impl__ap3on4($this);
var right = _Angle___get_ratio__impl__ap3on4(other);
if (left < right)
return -1;
if (left > right)
return 1;
return 0;
}
function Angle__compareTo_impl_a0hfds_0($this, other) {
var tmp = $this.x70_1;
return Angle__compareTo_impl_a0hfds(tmp, other instanceof Angle ? other.x70_1 : THROW_CCE());
}
function Angle__hashCode_impl_szcndt($this) {
return getNumberHashCode($this);
}
function Angle__equals_impl_zcf5mt($this, other) {
if (!(other instanceof Angle))
return false;
var tmp0_other_with_cast = other instanceof Angle ? other.x70_1 : THROW_CCE();
if (!equals($this, tmp0_other_with_cast))
return false;
return true;
}
function Angle(ratio) {
Companion_getInstance_0();
this.x70_1 = ratio;
}
Angle.prototype.toString = function () {
return Angle__toString_impl_786qky(this.x70_1);
};
Angle.prototype.y70 = function (other) {
return Angle__compareTo_impl_a0hfds(this.x70_1, other);
};
Angle.prototype.kc = function (other) {
return Angle__compareTo_impl_a0hfds_0(this, other);
};
Angle.prototype.hashCode = function () {
return Angle__hashCode_impl_szcndt(this.x70_1);
};
Angle.prototype.equals = function (other) {
return Angle__equals_impl_zcf5mt(this.x70_1, other);
};
Angle.$metadata$ = classMeta('Angle', [Comparable]);
function cos(angle) {
var tmp$ret$0;
// Inline function 'kotlin.math.cos' call
var tmp0_cos = _Angle___get_radians__impl__n00yt5(angle);
tmp$ret$0 = Math.cos(tmp0_cos);
return tmp$ret$0;
}
function sin(angle) {
var tmp$ret$0;
// Inline function 'kotlin.math.sin' call
var tmp0_sin = _Angle___get_radians__impl__n00yt5(angle);
tmp$ret$0 = Math.sin(tmp0_sin);
return tmp$ret$0;
}
function get_radians(_this__u8e3s4) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp0_fromRadians = Companion_getInstance_0();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$0 = _this__u8e3s4 / 6.283185307179586;
tmp$ret$1 = tmp0_fromRadians.f70(tmp$ret$0);
return tmp$ret$1;
}
function get_PI2() {
return PI2;
}
var PI2;
function plus_0(_this__u8e3s4, other) {
return Companion_getInstance_0().f70(_Angle___get_ratio__impl__ap3on4(_this__u8e3s4) + _Angle___get_ratio__impl__ap3on4(other));
}
function Angle_between(x0, y0, x1, y1) {
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.Companion.atan2' call
var tmp0_atan2 = Companion_getInstance_0();
var tmp1_atan2 = y1 - y0;
var tmp2_atan2 = x1 - x0;
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp$ret$0;
// Inline function 'kotlin.math.atan2' call
tmp$ret$0 = Math.atan2(tmp1_atan2, tmp2_atan2);
var tmp0_fromRadians = tmp$ret$0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$1 = tmp0_fromRadians / 6.283185307179586;
tmp$ret$2 = tmp0_atan2.f70(tmp$ret$1);
tmp$ret$3 = tmp$ret$2;
var angle = tmp$ret$3;
var tmp;
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp3__get_ZERO__ehl96u = Companion_getInstance_0();
tmp$ret$4 = tmp3__get_ZERO__ehl96u.f70(0.0);
if (Angle__compareTo_impl_a0hfds(angle, tmp$ret$4) < 0) {
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.Companion.FULL' call
var tmp4__get_FULL__gbq5ge = Companion_getInstance_0();
tmp$ret$5 = tmp4__get_FULL__gbq5ge.f70(1.0);
tmp = plus_0(angle, tmp$ret$5);
} else {
tmp = angle;
}
return tmp;
}
function unaryMinus(_this__u8e3s4) {
return Companion_getInstance_0().f70(-_Angle___get_ratio__impl__ap3on4(_this__u8e3s4));
}
function get_degrees(_this__u8e3s4) {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromDegrees' call
var tmp0_fromDegrees = Companion_getInstance_0();
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.fromDegrees' call
var tmp0_fromDegrees_0 = _this__u8e3s4;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.degreesToRatio' call
tmp$ret$0 = tmp0_fromDegrees_0 / 360.0;
tmp$ret$1 = tmp0_fromDegrees.f70(tmp$ret$0);
tmp$ret$2 = tmp$ret$1;
return tmp$ret$2;
}
function times(_this__u8e3s4, scale) {
return Companion_getInstance_0().f70(_Angle___get_ratio__impl__ap3on4(_this__u8e3s4) * scale);
}
function get_cosine(_this__u8e3s4) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.cos' call
var tmp$ret$0;
// Inline function 'kotlin.math.cos' call
var tmp0_cos = _Angle___get_radians__impl__n00yt5(_this__u8e3s4);
tmp$ret$0 = Math.cos(tmp0_cos);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
}
function get_sine(_this__u8e3s4) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.sin' call
var tmp$ret$0;
// Inline function 'kotlin.math.sin' call
var tmp0_sin = _Angle___get_radians__impl__n00yt5(_this__u8e3s4);
tmp$ret$0 = Math.sin(tmp0_sin);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
}
function minus(_this__u8e3s4, other) {
return Companion_getInstance_0().f70(_Angle___get_ratio__impl__ap3on4(_this__u8e3s4) - _Angle___get_ratio__impl__ap3on4(other));
}
function get_radians_0(_this__u8e3s4) {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp0_fromRadians = Companion_getInstance_0();
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp0_fromRadians_0 = _this__u8e3s4;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$0 = tmp0_fromRadians_0 / 6.283185307179586;
tmp$ret$1 = tmp0_fromRadians.f70(tmp$ret$0);
tmp$ret$2 = tmp$ret$1;
return tmp$ret$2;
}
function interpolate(_this__u8e3s4, l, r) {
return interpolateAngleDenormalized(_this__u8e3s4, l, r);
}
function interpolateAngleDenormalized(_this__u8e3s4, l, r) {
return interpolateAngle(_this__u8e3s4, l, r, false);
}
function interpolateAngle(_this__u8e3s4, l, r, minimizeAngle) {
return _interpolateAngleAny(_this__u8e3s4, l, r, minimizeAngle);
}
function _interpolateAngleAny(ratio, l, r, minimizeAngle) {
if (!minimizeAngle)
return Companion_getInstance_0().f70(interpolate_0(ratio, _Angle___get_ratio__impl__ap3on4(l), _Angle___get_ratio__impl__ap3on4(r)));
var ln = get_normalized(l);
var rn = get_normalized(r);
var tmp;
if (Angle__compareTo_impl_a0hfds(get_absoluteValue(minus(rn, ln)), get_degrees(180)) <= 0) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp0_fromRadians = Companion_getInstance_0();
var tmp1_fromRadians = interpolate_0(ratio, _Angle___get_radians__impl__n00yt5(ln), _Angle___get_radians__impl__n00yt5(rn));
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$0 = tmp1_fromRadians / 6.283185307179586;
tmp$ret$1 = tmp0_fromRadians.f70(tmp$ret$0);
tmp = tmp$ret$1;
} else if (Angle__compareTo_impl_a0hfds(ln, rn) < 0) {
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp2_fromRadians = Companion_getInstance_0();
var tmp3_fromRadians = interpolate_0(ratio, _Angle___get_radians__impl__n00yt5(plus_0(ln, get_degrees(360))), _Angle___get_radians__impl__n00yt5(rn));
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$2 = tmp3_fromRadians / 6.283185307179586;
tmp$ret$3 = tmp2_fromRadians.f70(tmp$ret$2);
tmp = get_normalized(tmp$ret$3);
} else {
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp4_fromRadians = Companion_getInstance_0();
var tmp5_fromRadians = interpolate_0(ratio, _Angle___get_radians__impl__n00yt5(ln), _Angle___get_radians__impl__n00yt5(plus_0(rn, get_degrees(360))));
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$4 = tmp5_fromRadians / 6.283185307179586;
tmp$ret$5 = tmp4_fromRadians.f70(tmp$ret$4);
tmp = get_normalized(tmp$ret$5);
}
return tmp;
}
function get_normalized(_this__u8e3s4) {
return Companion_getInstance_0().f70(umod_0(_Angle___get_ratio__impl__ap3on4(_this__u8e3s4), 1.0));
}
function get_absoluteValue(_this__u8e3s4) {
var tmp = Companion_getInstance_0();
var tmp$ret$0;
// Inline function 'kotlin.math.absoluteValue' call
var tmp0__get_absoluteValue__nukmtt = _Angle___get_ratio__impl__ap3on4(_this__u8e3s4);
tmp$ret$0 = Math.abs(tmp0__get_absoluteValue__nukmtt);
return tmp.f70(tmp$ret$0);
}
function div(_this__u8e3s4, other) {
return _Angle___get_ratio__impl__ap3on4(_this__u8e3s4) / _Angle___get_ratio__impl__ap3on4(other);
}
function unaryPlus(_this__u8e3s4) {
return Companion_getInstance_0().f70(+_Angle___get_ratio__impl__ap3on4(_this__u8e3s4));
}
function umod(_this__u8e3s4, angle) {
return Companion_getInstance_0().f70(umod_0(_Angle___get_ratio__impl__ap3on4(_this__u8e3s4), _Angle___get_ratio__impl__ap3on4(angle)));
}
function min(a, b) {
var tmp = Companion_getInstance_0();
var tmp$ret$0;
// Inline function 'kotlin.math.min' call
var tmp0_min = _Angle___get_ratio__impl__ap3on4(a);
var tmp1_min = _Angle___get_ratio__impl__ap3on4(b);
tmp$ret$0 = Math.min(tmp0_min, tmp1_min);
return tmp.f70(tmp$ret$0);
}
function abs(angle) {
var tmp = Companion_getInstance_0();
var tmp$ret$0;
// Inline function 'kotlin.math.absoluteValue' call
var tmp0__get_absoluteValue__nukmtt = _Angle___get_ratio__impl__ap3on4(angle);
tmp$ret$0 = Math.abs(tmp0__get_absoluteValue__nukmtt);
return tmp.f70(tmp$ret$0);
}
function times_0(_this__u8e3s4, scale) {
return times(_this__u8e3s4, scale);
}
function div_0(_this__u8e3s4, scale) {
return Companion_getInstance_0().f70(_Angle___get_ratio__impl__ap3on4(_this__u8e3s4) / scale);
}
function get_tangent(_this__u8e3s4) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.tan' call
var tmp$ret$0;
// Inline function 'kotlin.math.tan' call
var tmp0_tan = _Angle___get_radians__impl__n00yt5(_this__u8e3s4);
tmp$ret$0 = Math.tan(tmp0_tan);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
}
function tan(angle) {
var tmp$ret$0;
// Inline function 'kotlin.math.tan' call
var tmp0_tan = _Angle___get_radians__impl__n00yt5(angle);
tmp$ret$0 = Math.tan(tmp0_tan);
return tmp$ret$0;
}
function BoundsBuilder$Companion$POOL$lambda(it) {
it.d2p();
return Unit_getInstance();
}
function BoundsBuilder$Companion$POOL$lambda_0(it) {
return new BoundsBuilder();
}
function Companion_1() {
Companion_instance_1 = this;
var tmp = this;
var tmp_0 = BoundsBuilder$Companion$POOL$lambda;
tmp.f71_1 = ConcurrentPool_init_$Create$(tmp_0, 0, BoundsBuilder$Companion$POOL$lambda_0, 2, null);
this.g71_1 = -Infinity;
this.h71_1 = Infinity;
}
Companion_1.$metadata$ = objectMeta('Companion');
var Companion_instance_1;
function Companion_getInstance_1() {
if (Companion_instance_1 == null)
new Companion_1();
return Companion_instance_1;
}
function BoundsBuilder() {
Companion_getInstance_1();
this.z70_1 = Companion_getInstance_12().zp();
this.a71_1 = 0;
this.b71_1 = Companion_getInstance_1().h71_1;
this.c71_1 = Companion_getInstance_1().g71_1;
this.d71_1 = Companion_getInstance_1().h71_1;
this.e71_1 = Companion_getInstance_1().g71_1;
}
BoundsBuilder.prototype.j71 = function () {
return this.z70_1;
};
BoundsBuilder.prototype.k71 = function () {
return this.a71_1 > 0;
};
BoundsBuilder.prototype.l71 = function (default_0) {
return this.k71() ? this.b71_1 : default_0;
};
BoundsBuilder.prototype.d2p = function () {
this.b71_1 = Companion_getInstance_1().h71_1;
this.c71_1 = Companion_getInstance_1().g71_1;
this.d71_1 = Companion_getInstance_1().h71_1;
this.e71_1 = Companion_getInstance_1().g71_1;
this.a71_1 = 0;
};
BoundsBuilder.prototype.m71 = function (x, y) {
if (x < this.b71_1)
this.b71_1 = x;
if (x > this.c71_1)
this.c71_1 = x;
if (y < this.d71_1)
this.d71_1 = y;
if (y > this.e71_1)
this.e71_1 = y;
var tmp0_this = this;
var tmp1 = tmp0_this.a71_1;
tmp0_this.a71_1 = tmp1 + 1 | 0;
return this;
};
BoundsBuilder.prototype.n71 = function (x, y) {
return this.m71(x, y);
};
BoundsBuilder.prototype.o71 = function (ps) {
var inductionVariable = 0;
var last = ps.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
this.m71(ps.p71(n), ps.q71(n));
}
while (inductionVariable < last);
return this;
};
BoundsBuilder.prototype.r71 = function (rect) {
var tmp0_safe_receiver = rect;
if (tmp0_safe_receiver == null)
null;
else {
var tmp$ret$1;
// Inline function 'kotlin.let' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.BoundsBuilder.add.<anonymous>' call
tmp$ret$0 = this.s71(rect);
tmp$ret$1 = tmp$ret$0;
}
return this;
};
BoundsBuilder.prototype.s71 = function (rect) {
if (get_isNotEmpty(rect)) {
this.t71(rect);
}
return this;
};
BoundsBuilder.prototype.t71 = function (rect) {
if (rect == null)
return this;
this.m71(get_left(rect), get_top(rect));
this.m71(get_right(rect), get_bottom(rect));
return this;
};
BoundsBuilder.prototype.u71 = function (out) {
return this.a71_1 === 0 ? null : out.z71(this.b71_1, this.d71_1, this.c71_1, this.e71_1);
};
BoundsBuilder.prototype.a72 = function (out) {
if (this.u71(out) == null) {
out.b72(0, 0, 0, 0);
}
return out;
};
BoundsBuilder.prototype.c72 = function (out, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
out = Companion_getInstance_12().zp();
return this.a72(out);
};
BoundsBuilder.$metadata$ = classMeta('BoundsBuilder');
function IRectangle() {
}
IRectangle.$metadata$ = interfaceMeta('IRectangle');
function get_right(_this__u8e3s4) {
return _this__u8e3s4.d1n() + _this__u8e3s4.d72();
}
function get_left(_this__u8e3s4) {
return _this__u8e3s4.d1n();
}
function get_bottom(_this__u8e3s4) {
return _this__u8e3s4.e1n() + _this__u8e3s4.e72();
}
function get_top(_this__u8e3s4) {
return _this__u8e3s4.e1n();
}
function get_isNotEmpty(_this__u8e3s4) {
return !(_this__u8e3s4.d72() === 0.0) ? true : !(_this__u8e3s4.e72() === 0.0);
}
function contains(_this__u8e3s4, x, y) {
return (x >= get_left(_this__u8e3s4) ? x < get_right(_this__u8e3s4) : false) ? y >= get_top(_this__u8e3s4) ? y < get_bottom(_this__u8e3s4) : false : false;
}
function get_topLeft(_this__u8e3s4) {
return new Point(get_left(_this__u8e3s4), get_top(_this__u8e3s4));
}
function get_topRight(_this__u8e3s4) {
return new Point(get_right(_this__u8e3s4), get_top(_this__u8e3s4));
}
function get_bottomRight(_this__u8e3s4) {
return new Point(get_right(_this__u8e3s4), get_bottom(_this__u8e3s4));
}
function get_bottomLeft(_this__u8e3s4) {
return new Point(get_left(_this__u8e3s4), get_bottom(_this__u8e3s4));
}
function Line_init_$Init$($this) {
Line.call($this, Companion_getInstance_8().zp(), Companion_getInstance_8().zp());
return $this;
}
function Line_init_$Create$() {
return Line_init_$Init$(Object.create(Line.prototype));
}
function Line_init_$Init$_0(x0, y0, x1, y1, $this) {
Line.call($this, new Point(x0, y0), new Point(x1, y1));
return $this;
}
function Line_init_$Create$_0(x0, y0, x1, y1) {
return Line_init_$Init$_0(x0, y0, x1, y1, Object.create(Line.prototype));
}
function Line_init_$Init$_1(x0, y0, x1, y1, $this) {
Line.call($this, Point_init_$Create$(x0, y0), Point_init_$Create$(x1, y1));
return $this;
}
function Line_init_$Create$_1(x0, y0, x1, y1) {
return Line_init_$Init$_1(x0, y0, x1, y1, Object.create(Line.prototype));
}
function Companion_2() {
Companion_instance_2 = this;
}
Companion_2.prototype.m72 = function (point, direction, scale, out) {
return out.u72(point.d1n(), point.e1n(), point.d1n() + direction.d1n() * scale, point.e1n() + direction.e1n() * scale);
};
Companion_2.prototype.v72 = function (point, direction, scale, out, $mask0, $handler) {
if (!(($mask0 & 4) === 0))
scale = 1.0;
if (!(($mask0 & 8) === 0))
out = Line_init_$Create$();
return this.m72(point, direction, scale, out);
};
Companion_2.prototype.w72 = function (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy, out) {
var a1 = By - Ay;
var b1 = Ax - Bx;
var c1 = a1 * Ax + b1 * Ay;
var a2 = Dy - Cy;
var b2 = Cx - Dx;
var c2 = a2 * Cx + b2 * Cy;
var determinant = a1 * b2 - a2 * b1;
if (isAlmostZero(determinant))
return false;
var x = (b2 * c1 - b1 * c2) / determinant;
var y = (a1 * c2 - a2 * c1) / determinant;
out(x, y);
return true;
};
Companion_2.prototype.x72 = function (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy, out) {
var tmp;
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.geom.Companion.getIntersectXY' call
var a1 = By - Ay;
var b1 = Ax - Bx;
var c1 = a1 * Ax + b1 * Ay;
var a2 = Dy - Cy;
var b2 = Cx - Dx;
var c2 = a2 * Cx + b2 * Cy;
var determinant = a1 * b2 - a2 * b1;
if (isAlmostZero(determinant)) {
tmp$ret$0 = false;
break $l$block;
}
var x = (b2 * c1 - b1 * c2) / determinant;
var y = (a1 * c2 - a2 * c1) / determinant;
// Inline function 'com.soywiz.korma.geom.Companion.getIntersectXY.<anonymous>' call
out.a73(x, y);
tmp$ret$0 = true;
}
if (tmp$ret$0) {
tmp = out;
} else {
tmp = null;
}
return tmp;
};
Companion_2.$metadata$ = objectMeta('Companion');
var Companion_instance_2;
function Companion_getInstance_2() {
if (Companion_instance_2 == null)
new Companion_2();
return Companion_instance_2;
}
function Line(a, b) {
Companion_getInstance_2();
this.n72_1 = a;
this.o72_1 = b;
this.p72_1 = Companion_getInstance_8().zp();
this.q72_1 = x$factory(this.n72_1);
this.r72_1 = y$factory(this.n72_1);
this.s72_1 = x$factory_0(this.o72_1);
this.t72_1 = y$factory_0(this.o72_1);
}
Line.prototype.b73 = function () {
return this.n72_1;
};
Line.prototype.c73 = function () {
return this.o72_1;
};
Line.prototype.z4n = function () {
return new Line(this.n72_1.d73(), this.o72_1.d73());
};
Line.prototype.e73 = function () {
return new Line(this.o72_1.d73(), this.n72_1.d73());
};
Line.prototype.u72 = function (x0, y0, x1, y1) {
this.n72_1.a73(x0, y0);
this.o72_1.a73(x1, y1);
return this;
};
Line.prototype.f73 = function (scale) {
var dx = this.g73();
var dy = this.h73();
var tmp0_this = this;
tmp0_this.j73(tmp0_this.i73() - dx * scale);
var tmp1_this = this;
tmp1_this.l73(tmp1_this.k73() - dy * scale);
var tmp2_this = this;
tmp2_this.n73(tmp2_this.m73() + dx * scale);
var tmp3_this = this;
tmp3_this.p73(tmp3_this.o73() + dy * scale);
return this;
};
Line.prototype.j73 = function (_set____db54di) {
var tmp0_setValue = x0$factory();
return this.q72_1.set(_set____db54di);
};
Line.prototype.i73 = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = x0$factory_0();
tmp$ret$0 = this.q72_1.get();
return tmp$ret$0;
};
Line.prototype.l73 = function (_set____db54di) {
var tmp0_setValue = y0$factory();
return this.r72_1.set(_set____db54di);
};
Line.prototype.k73 = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = y0$factory_0();
tmp$ret$0 = this.r72_1.get();
return tmp$ret$0;
};
Line.prototype.n73 = function (_set____db54di) {
var tmp0_setValue = x1$factory();
return this.s72_1.set(_set____db54di);
};
Line.prototype.m73 = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = x1$factory_0();
tmp$ret$0 = this.s72_1.get();
return tmp$ret$0;
};
Line.prototype.p73 = function (_set____db54di) {
var tmp0_setValue = y1$factory();
return this.t72_1.set(_set____db54di);
};
Line.prototype.o73 = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = y1$factory_0();
tmp$ret$0 = this.t72_1.get();
return tmp$ret$0;
};
Line.prototype.g73 = function () {
return this.m73() - this.i73();
};
Line.prototype.h73 = function () {
return this.o73() - this.k73();
};
Line.prototype.toString = function () {
return 'Line(' + this.n72_1 + ', ' + this.o72_1 + ')';
};
Line.prototype.q73 = function (line, out) {
return Companion_getInstance_2().x72(this.i73(), this.k73(), this.m73(), this.o73(), line.i73(), line.k73(), line.m73(), line.o73(), out);
};
Line.prototype.hashCode = function () {
var result = this.n72_1.hashCode();
result = imul(result, 31) + this.o72_1.hashCode() | 0;
return result;
};
Line.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Line))
return false;
var tmp0_other_with_cast = other instanceof Line ? other : THROW_CCE();
if (!this.n72_1.equals(tmp0_other_with_cast.n72_1))
return false;
if (!this.o72_1.equals(tmp0_other_with_cast.o72_1))
return false;
return true;
};
Line.$metadata$ = classMeta('Line', [ILine]);
function ILine() {
}
ILine.$metadata$ = interfaceMeta('ILine');
function lineIntersectionPoint(_this__u8e3s4, l1, l2, out) {
return l1.q73(l2, out);
}
function lineIntersectionPoint$default(_this__u8e3s4, l1, l2, out, $mask0, $handler) {
if (!(($mask0 & 4) === 0))
out = Companion_getInstance_8().zp();
return lineIntersectionPoint(_this__u8e3s4, l1, l2, out);
}
function projectedPoint(_this__u8e3s4, point, out) {
return projectedPoint_0(Companion_getInstance_2(), _this__u8e3s4.b73(), _this__u8e3s4.c73(), point, out);
}
function projectedPoint$default(_this__u8e3s4, point, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
out = Companion_getInstance_8().zp();
return projectedPoint(_this__u8e3s4, point, out);
}
function projectedPoint_0(_this__u8e3s4, v1, v2, point, out) {
return projectedPoint_1(_this__u8e3s4, v1.d1n(), v1.e1n(), v2.d1n(), v2.e1n(), point.d1n(), point.e1n(), out);
}
function projectedPoint_1(_this__u8e3s4, v1x, v1y, v2x, v2y, px, py, out) {
var e1x = v2x - v1x;
var e1y = v2y - v1y;
var e2x = px - v1x;
var e2y = py - v1y;
var valDp = Companion_getInstance_8().r73(e1x, e1y, e2x, e2y);
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
tmp$ret$0 = hypot(e1x, e1y);
var lenLineE1 = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.hypot' call
tmp$ret$1 = hypot(e2x, e2y);
var lenLineE2 = tmp$ret$1;
if (lenLineE1 === 0.0 ? true : lenLineE2 === 0.0) {
return out.a73(px, py);
}
var cos = valDp / (lenLineE1 * lenLineE2);
var projLenOfLine = cos * lenLineE2;
return out.a73(v1x + projLenOfLine * e1x / lenLineE1, v1y + projLenOfLine * e1y / lenLineE1);
}
function x$factory($b0) {
return getPropertyCallableRef('x', 0, KMutableProperty0, function () {
return $b0.y72_1;
}, function (value) {
$b0.y72_1 = value;
return Unit_getInstance();
});
}
function y$factory($b0) {
return getPropertyCallableRef('y', 0, KMutableProperty0, function () {
return $b0.z72_1;
}, function (value) {
$b0.z72_1 = value;
return Unit_getInstance();
});
}
function x$factory_0($b0) {
return getPropertyCallableRef('x', 0, KMutableProperty0, function () {
return $b0.y72_1;
}, function (value) {
$b0.y72_1 = value;
return Unit_getInstance();
});
}
function y$factory_0($b0) {
return getPropertyCallableRef('y', 0, KMutableProperty0, function () {
return $b0.z72_1;
}, function (value) {
$b0.z72_1 = value;
return Unit_getInstance();
});
}
function x0$factory() {
return getPropertyCallableRef('x0', 1, KMutableProperty1, function (receiver) {
return receiver.i73();
}, function (receiver, value) {
return receiver.j73(value);
});
}
function x0$factory_0() {
return getPropertyCallableRef('x0', 1, KMutableProperty1, function (receiver) {
return receiver.i73();
}, function (receiver, value) {
return receiver.j73(value);
});
}
function y0$factory() {
return getPropertyCallableRef('y0', 1, KMutableProperty1, function (receiver) {
return receiver.k73();
}, function (receiver, value) {
return receiver.l73(value);
});
}
function y0$factory_0() {
return getPropertyCallableRef('y0', 1, KMutableProperty1, function (receiver) {
return receiver.k73();
}, function (receiver, value) {
return receiver.l73(value);
});
}
function x1$factory() {
return getPropertyCallableRef('x1', 1, KMutableProperty1, function (receiver) {
return receiver.m73();
}, function (receiver, value) {
return receiver.n73(value);
});
}
function x1$factory_0() {
return getPropertyCallableRef('x1', 1, KMutableProperty1, function (receiver) {
return receiver.m73();
}, function (receiver, value) {
return receiver.n73(value);
});
}
function y1$factory() {
return getPropertyCallableRef('y1', 1, KMutableProperty1, function (receiver) {
return receiver.o73();
}, function (receiver, value) {
return receiver.p73(value);
});
}
function y1$factory_0() {
return getPropertyCallableRef('y1', 1, KMutableProperty1, function (receiver) {
return receiver.o73();
}, function (receiver, value) {
return receiver.p73(value);
});
}
function MutableMarginInt$Companion$POOL$lambda(it) {
it.w73(0);
return Unit_getInstance();
}
function MutableMarginInt$Companion$POOL$lambda_0(it) {
return MutableMarginInt_init_$Create$(0, 0, 0, 0, 15, null);
}
function MutableMarginInt_init_$Init$(top, right, bottom, left, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
top = 0;
if (!(($mask0 & 2) === 0))
right = 0;
if (!(($mask0 & 4) === 0))
bottom = 0;
if (!(($mask0 & 8) === 0))
left = 0;
MutableMarginInt.call($this, top, right, bottom, left);
return $this;
}
function MutableMarginInt_init_$Create$(top, right, bottom, left, $mask0, $marker) {
return MutableMarginInt_init_$Init$(top, right, bottom, left, $mask0, $marker, Object.create(MutableMarginInt.prototype));
}
function Companion_3() {
Companion_instance_3 = this;
var tmp = this;
var tmp_0 = MutableMarginInt$Companion$POOL$lambda;
tmp.x73_1 = ConcurrentPool_init_$Create$(tmp_0, 0, MutableMarginInt$Companion$POOL$lambda_0, 2, null);
}
Companion_3.$metadata$ = objectMeta('Companion');
var Companion_instance_3;
function Companion_getInstance_3() {
if (Companion_instance_3 == null)
new Companion_3();
return Companion_instance_3;
}
function MutableMarginInt(top, right, bottom, left) {
Companion_getInstance_3();
this.s73_1 = top;
this.t73_1 = right;
this.u73_1 = bottom;
this.v73_1 = left;
}
MutableMarginInt.prototype.y73 = function () {
return this.s73_1;
};
MutableMarginInt.prototype.z73 = function () {
return this.t73_1;
};
MutableMarginInt.prototype.a74 = function () {
return this.u73_1;
};
MutableMarginInt.prototype.b74 = function () {
return this.v73_1;
};
MutableMarginInt.prototype.w73 = function (margin) {
return this.c74(margin, margin, margin, margin);
};
MutableMarginInt.prototype.c74 = function (top, right, bottom, left) {
this.s73_1 = top;
this.t73_1 = right;
this.v73_1 = left;
this.u73_1 = bottom;
};
MutableMarginInt.prototype.toString = function () {
return 'MutableMarginInt(top=' + this.s73_1 + ', right=' + this.t73_1 + ', bottom=' + this.u73_1 + ', left=' + this.v73_1 + ')';
};
MutableMarginInt.prototype.hashCode = function () {
var result = this.s73_1;
result = imul(result, 31) + this.t73_1 | 0;
result = imul(result, 31) + this.u73_1 | 0;
result = imul(result, 31) + this.v73_1 | 0;
return result;
};
MutableMarginInt.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof MutableMarginInt))
return false;
var tmp0_other_with_cast = other instanceof MutableMarginInt ? other : THROW_CCE();
if (!(this.s73_1 === tmp0_other_with_cast.s73_1))
return false;
if (!(this.t73_1 === tmp0_other_with_cast.t73_1))
return false;
if (!(this.u73_1 === tmp0_other_with_cast.u73_1))
return false;
if (!(this.v73_1 === tmp0_other_with_cast.v73_1))
return false;
return true;
};
MutableMarginInt.$metadata$ = classMeta('MutableMarginInt', [MarginInt]);
function MarginInt() {
}
MarginInt.$metadata$ = interfaceMeta('MarginInt');
function Companion_4() {
Companion_instance_4 = this;
}
Companion_4.prototype.d74 = function (top, right, bottom, left) {
return new MutableMargin(top, right, bottom, left);
};
Companion_4.$metadata$ = objectMeta('Companion');
var Companion_instance_4;
function Companion_getInstance_4() {
if (Companion_instance_4 == null)
new Companion_4();
return Companion_instance_4;
}
function Margin() {
}
Margin.$metadata$ = interfaceMeta('Margin');
function MutableMargin(top, right, bottom, left) {
this.e74_1 = top;
this.f74_1 = right;
this.g74_1 = bottom;
this.h74_1 = left;
}
MutableMargin.prototype.y73 = function () {
return this.e74_1;
};
MutableMargin.prototype.z73 = function () {
return this.f74_1;
};
MutableMargin.prototype.a74 = function () {
return this.g74_1;
};
MutableMargin.prototype.b74 = function () {
return this.h74_1;
};
MutableMargin.prototype.toString = function () {
return 'MutableMargin(top=' + this.e74_1 + ', right=' + this.f74_1 + ', bottom=' + this.g74_1 + ', left=' + this.h74_1 + ')';
};
MutableMargin.prototype.hashCode = function () {
var result = getNumberHashCode(this.e74_1);
result = imul(result, 31) + getNumberHashCode(this.f74_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.g74_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.h74_1) | 0;
return result;
};
MutableMargin.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof MutableMargin))
return false;
var tmp0_other_with_cast = other instanceof MutableMargin ? other : THROW_CCE();
if (!equals(this.e74_1, tmp0_other_with_cast.e74_1))
return false;
if (!equals(this.f74_1, tmp0_other_with_cast.f74_1))
return false;
if (!equals(this.g74_1, tmp0_other_with_cast.g74_1))
return false;
if (!equals(this.h74_1, tmp0_other_with_cast.h74_1))
return false;
return true;
};
MutableMargin.$metadata$ = classMeta('MutableMargin', [Margin]);
function Matrix$Companion$POOL$lambda(it) {
it.o74();
return Unit_getInstance();
}
function Matrix$Companion$POOL$lambda_0(it) {
return Matrix_init_$Create$(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 63, null);
}
var Type_IDENTITY_instance;
var Type_TRANSLATE_instance;
var Type_SCALE_instance;
var Type_SCALE_TRANSLATE_instance;
var Type_COMPLEX_instance;
var Type_entriesInitialized;
function Type_initEntries() {
if (Type_entriesInitialized)
return Unit_getInstance();
Type_entriesInitialized = true;
Type_IDENTITY_instance = new Type('IDENTITY', 0, 1, false, false, false);
Type_TRANSLATE_instance = new Type('TRANSLATE', 1, 2, false, false, true);
Type_SCALE_instance = new Type('SCALE', 2, 3, false, true, false);
Type_SCALE_TRANSLATE_instance = new Type('SCALE_TRANSLATE', 3, 4, false, true, true);
Type_COMPLEX_instance = new Type('COMPLEX', 4, 5, true, true, true);
}
function Transform_init_$Init$(x, y, scaleX, scaleY, skewX, skewY, rotation, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
x = 0.0;
if (!(($mask0 & 2) === 0))
y = 0.0;
if (!(($mask0 & 4) === 0))
scaleX = 1.0;
if (!(($mask0 & 8) === 0))
scaleY = 1.0;
if (!(($mask0 & 16) === 0))
skewX = get_radians_0(0);
if (!(($mask0 & 32) === 0))
skewY = get_radians_0(0);
if (!(($mask0 & 64) === 0))
rotation = get_radians_0(0);
Transform.call($this, x, y, scaleX, scaleY, skewX, skewY, rotation);
return $this;
}
function Transform_init_$Create$(x, y, scaleX, scaleY, skewX, skewY, rotation, $mask0, $marker) {
return Transform_init_$Init$(x, y, scaleX, scaleY, skewX, skewY, rotation, $mask0, $marker, Object.create(Transform.prototype));
}
function Matrix_init_$Init$(a, b, c, d, tx, ty, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
a = 1.0;
if (!(($mask0 & 2) === 0))
b = 0.0;
if (!(($mask0 & 4) === 0))
c = 0.0;
if (!(($mask0 & 8) === 0))
d = 1.0;
if (!(($mask0 & 16) === 0))
tx = 0.0;
if (!(($mask0 & 32) === 0))
ty = 0.0;
Matrix.call($this, a, b, c, d, tx, ty);
return $this;
}
function Matrix_init_$Create$(a, b, c, d, tx, ty, $mask0, $marker) {
return Matrix_init_$Init$(a, b, c, d, tx, ty, $mask0, $marker, Object.create(Matrix.prototype));
}
function Companion_5() {
Companion_instance_5 = this;
var tmp = this;
var tmp_0 = Matrix$Companion$POOL$lambda;
tmp.p74_1 = ConcurrentPool_init_$Create$(tmp_0, 0, Matrix$Companion$POOL$lambda_0, 2, null);
}
Companion_5.prototype.q74 = function (a, b, c, d, tx, ty, px, py) {
return a * px + c * py + tx;
};
Companion_5.prototype.r74 = function (a, b, c, d, tx, ty, px, py) {
return d * py + b * px + ty;
};
Companion_5.$metadata$ = objectMeta('Companion');
var Companion_instance_5;
function Companion_getInstance_5() {
if (Companion_instance_5 == null)
new Companion_5();
return Companion_instance_5;
}
function Type(name, ordinal, id, hasRotation, hasScale, hasTranslation) {
Enum.call(this, name, ordinal);
this.u74_1 = id;
this.v74_1 = hasRotation;
this.w74_1 = hasScale;
this.x74_1 = hasTranslation;
}
Type.$metadata$ = classMeta('Type', undefined, undefined, undefined, undefined, Enum.prototype);
function Transform(x, y, scaleX, scaleY, skewX, skewY, rotation) {
this.y74_1 = x;
this.z74_1 = y;
this.a75_1 = scaleX;
this.b75_1 = scaleY;
this.c75_1 = skewX;
this.d75_1 = skewY;
this.e75_1 = rotation;
}
Transform.prototype.d1n = function () {
return this.y74_1;
};
Transform.prototype.e1n = function () {
return this.z74_1;
};
Transform.prototype.f75 = function () {
return (this.a75_1 + this.b75_1) * 0.5;
};
Transform.prototype.g75 = function (ratio, other) {
return Transform_init_$Create$(0.0, 0.0, 0.0, 0.0, null, null, null, 127, null).h75(ratio, this, other);
};
Transform.prototype.d70 = function (ratio, other) {
return this.g75(ratio, other instanceof Transform ? other : THROW_CCE());
};
Transform.prototype.h75 = function (ratio, l, r) {
return this.i75(interpolate_0(ratio, l.y74_1, r.y74_1), interpolate_0(ratio, l.z74_1, r.z74_1), interpolate_0(ratio, l.a75_1, r.a75_1), interpolate_0(ratio, l.b75_1, r.b75_1), interpolate(ratio, l.e75_1, r.e75_1), interpolate(ratio, l.c75_1, r.c75_1), interpolate(ratio, l.d75_1, r.d75_1));
};
Transform.prototype.j75 = function (matrix, pivotX, pivotY) {
var a = matrix.i74_1;
var b = matrix.j74_1;
var c = matrix.k74_1;
var d = matrix.l74_1;
var tmp$ret$0;
// Inline function 'kotlin.math.atan2' call
var tmp0_atan2 = -c;
tmp$ret$0 = Math.atan2(tmp0_atan2, d);
var skewX = -tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.atan2' call
tmp$ret$1 = Math.atan2(b, a);
var skewY = tmp$ret$1;
var tmp$ret$2;
// Inline function 'kotlin.math.abs' call
var tmp1_abs = skewX + skewY;
tmp$ret$2 = Math.abs(tmp1_abs);
var delta = tmp$ret$2;
var tmp;
if (delta < 1.0E-5) {
tmp = true;
} else {
var tmp$ret$3;
// Inline function 'kotlin.math.abs' call
var tmp2_abs = get_PI() * 2 - delta;
tmp$ret$3 = Math.abs(tmp2_abs);
tmp = tmp$ret$3 < 1.0E-5;
}
if (tmp) {
this.e75_1 = get_radians(skewY);
this.c75_1 = get_radians(0.0);
this.d75_1 = get_radians(0.0);
} else {
this.e75_1 = get_radians_0(0);
this.c75_1 = get_radians(skewX);
this.d75_1 = get_radians(skewY);
}
var tmp_0 = this;
var tmp$ret$4;
// Inline function 'kotlin.math.hypot' call
tmp$ret$4 = hypot(a, b);
tmp_0.a75_1 = tmp$ret$4;
var tmp_1 = this;
var tmp$ret$5;
// Inline function 'kotlin.math.hypot' call
tmp$ret$5 = hypot(c, d);
tmp_1.b75_1 = tmp$ret$5;
if (pivotX === 0.0 ? pivotY === 0.0 : false) {
this.y74_1 = matrix.m74_1;
this.z74_1 = matrix.n74_1;
} else {
this.y74_1 = matrix.m74_1 + (pivotX * a + pivotY * c);
this.z74_1 = matrix.n74_1 + (pivotX * b + pivotY * d);
}
};
Transform.prototype.k75 = function (matrix, pivotX, pivotY, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
pivotX = 0.0;
if (!(($mask0 & 4) === 0))
pivotY = 0.0;
return this.j75(matrix, pivotX, pivotY);
};
Transform.prototype.l75 = function (matrix, pivotX, pivotY) {
this.j75(matrix, pivotX, pivotY);
return this;
};
Transform.prototype.m75 = function (matrix, pivotX, pivotY, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
pivotX = 0.0;
if (!(($mask0 & 4) === 0))
pivotY = 0.0;
return this.l75(matrix, pivotX, pivotY);
};
Transform.prototype.i75 = function (x, y, scaleX, scaleY, rotation, skewX, skewY) {
this.y74_1 = x;
this.z74_1 = y;
this.a75_1 = scaleX;
this.b75_1 = scaleY;
this.e75_1 = rotation;
this.c75_1 = skewX;
this.d75_1 = skewY;
return this;
};
Transform.prototype.toString = function () {
return 'Transform(x=' + this.y74_1 + ', y=' + this.z74_1 + ', scaleX=' + this.a75_1 + ', scaleY=' + this.b75_1 + ', skewX=' + new Angle(this.c75_1) + ', skewY=' + new Angle(this.d75_1) + ', rotation=' + new Angle(this.e75_1) + ')';
};
Transform.prototype.hashCode = function () {
var result = getNumberHashCode(this.y74_1);
result = imul(result, 31) + getNumberHashCode(this.z74_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.a75_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.b75_1) | 0;
result = imul(result, 31) + Angle__hashCode_impl_szcndt(this.c75_1) | 0;
result = imul(result, 31) + Angle__hashCode_impl_szcndt(this.d75_1) | 0;
result = imul(result, 31) + Angle__hashCode_impl_szcndt(this.e75_1) | 0;
return result;
};
Transform.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Transform))
return false;
var tmp0_other_with_cast = other instanceof Transform ? other : THROW_CCE();
if (!equals(this.y74_1, tmp0_other_with_cast.y74_1))
return false;
if (!equals(this.z74_1, tmp0_other_with_cast.z74_1))
return false;
if (!equals(this.a75_1, tmp0_other_with_cast.a75_1))
return false;
if (!equals(this.b75_1, tmp0_other_with_cast.b75_1))
return false;
if (!equals(this.c75_1, tmp0_other_with_cast.c75_1))
return false;
if (!equals(this.d75_1, tmp0_other_with_cast.d75_1))
return false;
if (!equals(this.e75_1, tmp0_other_with_cast.e75_1))
return false;
return true;
};
Transform.$metadata$ = classMeta('Transform', [MutableInterpolable, Interpolable, XY, XYf]);
function Type_IDENTITY_getInstance() {
Type_initEntries();
return Type_IDENTITY_instance;
}
function Type_TRANSLATE_getInstance() {
Type_initEntries();
return Type_TRANSLATE_instance;
}
function Type_SCALE_getInstance() {
Type_initEntries();
return Type_SCALE_instance;
}
function Type_SCALE_TRANSLATE_getInstance() {
Type_initEntries();
return Type_SCALE_TRANSLATE_instance;
}
function Type_COMPLEX_getInstance() {
Type_initEntries();
return Type_COMPLEX_instance;
}
function Matrix(a, b, c, d, tx, ty) {
Companion_getInstance_5();
this.i74_1 = a;
this.j74_1 = b;
this.k74_1 = c;
this.l74_1 = d;
this.m74_1 = tx;
this.n74_1 = ty;
}
Matrix.prototype.n75 = function (_set____db54di) {
this.i74_1 = _set____db54di;
};
Matrix.prototype.b73 = function () {
return this.i74_1;
};
Matrix.prototype.o75 = function (_set____db54di) {
this.j74_1 = _set____db54di;
};
Matrix.prototype.c73 = function () {
return this.j74_1;
};
Matrix.prototype.p75 = function (_set____db54di) {
this.k74_1 = _set____db54di;
};
Matrix.prototype.q75 = function () {
return this.k74_1;
};
Matrix.prototype.r75 = function (_set____db54di) {
this.l74_1 = _set____db54di;
};
Matrix.prototype.s75 = function () {
return this.l74_1;
};
Matrix.prototype.t75 = function (_set____db54di) {
this.m74_1 = _set____db54di;
};
Matrix.prototype.u75 = function () {
return this.m74_1;
};
Matrix.prototype.v75 = function (_set____db54di) {
this.n74_1 = _set____db54di;
};
Matrix.prototype.w75 = function () {
return this.n74_1;
};
Matrix.prototype.x75 = function () {
return this.i74_1;
};
Matrix.prototype.y75 = function () {
return this.j74_1;
};
Matrix.prototype.z75 = function () {
return this.k74_1;
};
Matrix.prototype.a76 = function () {
return this.l74_1;
};
Matrix.prototype.b76 = function () {
return this.m74_1;
};
Matrix.prototype.c76 = function () {
return this.n74_1;
};
Matrix.prototype.d76 = function () {
var hasRotation = !(this.j74_1 === 0.0) ? true : !(this.k74_1 === 0.0);
var hasScale = !(this.i74_1 === 1.0) ? true : !(this.l74_1 === 1.0);
var hasTranslation = !(this.m74_1 === 0.0) ? true : !(this.n74_1 === 0.0);
return hasRotation ? Type_COMPLEX_getInstance() : (hasScale ? hasTranslation : false) ? Type_SCALE_TRANSLATE_getInstance() : hasScale ? Type_SCALE_getInstance() : hasTranslation ? Type_TRANSLATE_getInstance() : Type_IDENTITY_getInstance();
};
Matrix.prototype.e76 = function (a, b, c, d, tx, ty) {
this.i74_1 = a;
this.j74_1 = b;
this.k74_1 = c;
this.l74_1 = d;
this.m74_1 = tx;
this.n74_1 = ty;
return this;
};
Matrix.prototype.f76 = function (that) {
if (!(that == null)) {
this.e76(that.i74_1, that.j74_1, that.k74_1, that.l74_1, that.m74_1, that.n74_1);
} else {
this.o74();
}
return this;
};
Matrix.prototype.g76 = function (angle) {
var tmp$ret$2;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.Matrix.rotate.<anonymous>' call
var theta = _Angle___get_radians__impl__n00yt5(angle);
var tmp$ret$0;
// Inline function 'kotlin.math.cos' call
tmp$ret$0 = Math.cos(theta);
var cos = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.sin' call
tmp$ret$1 = Math.sin(theta);
var sin = tmp$ret$1;
var a1 = this.i74_1 * cos - this.j74_1 * sin;
this.j74_1 = this.i74_1 * sin + this.j74_1 * cos;
this.i74_1 = a1;
var c1 = this.k74_1 * cos - this.l74_1 * sin;
this.l74_1 = this.k74_1 * sin + this.l74_1 * cos;
this.k74_1 = c1;
var tx1 = this.m74_1 * cos - this.n74_1 * sin;
this.n74_1 = this.m74_1 * sin + this.n74_1 * cos;
this.m74_1 = tx1;
tmp$ret$2 = this;
return tmp$ret$2;
};
Matrix.prototype.h76 = function (sx, sy) {
return this.e76(this.i74_1 * sx, this.j74_1 * sx, this.k74_1 * sy, this.l74_1 * sy, this.m74_1 * sx, this.n74_1 * sy);
};
Matrix.prototype.i76 = function (sx, sy, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
sy = sx;
return this.h76(sx, sy);
};
Matrix.prototype.j76 = function (sx, sy) {
return this.h76(sx, sy);
};
Matrix.prototype.k76 = function (sx, sy) {
return this.e76(this.i74_1 * sx, this.j74_1 * sx, this.k74_1 * sy, this.l74_1 * sy, this.m74_1, this.n74_1);
};
Matrix.prototype.l76 = function (sx, sy, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
sy = sx;
return this.k76(sx, sy);
};
Matrix.prototype.m76 = function (dx, dy) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.Matrix.translate.<anonymous>' call
var tmp0_this = this;
tmp0_this.m74_1 = tmp0_this.m74_1 + dx;
var tmp1_this = this;
tmp1_this.n74_1 = tmp1_this.n74_1 + dy;
tmp$ret$0 = this;
return tmp$ret$0;
};
Matrix.prototype.n76 = function (dx, dy) {
return this.m76(dx, dy);
};
Matrix.prototype.o76 = function (dx, dy) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.Matrix.pretranslate.<anonymous>' call
var tmp0_this = this;
tmp0_this.m74_1 = tmp0_this.m74_1 + (this.i74_1 * dx + this.k74_1 * dy);
var tmp1_this = this;
tmp1_this.n74_1 = tmp1_this.n74_1 + (this.j74_1 * dx + this.l74_1 * dy);
tmp$ret$0 = this;
return tmp$ret$0;
};
Matrix.prototype.p76 = function (angle) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.Matrix.prerotate.<anonymous>' call
var m = Matrix_init_$Create$(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 63, null);
m.g76(angle);
this.q76(m);
tmp$ret$0 = this;
return tmp$ret$0;
};
Matrix.prototype.q76 = function (m) {
return this.r76(m.i74_1, m.j74_1, m.k74_1, m.l74_1, m.m74_1, m.n74_1);
};
Matrix.prototype.r76 = function (la, lb, lc, ld, ltx, lty) {
return this.e76(la * this.i74_1 + lb * this.k74_1, la * this.j74_1 + lb * this.l74_1, lc * this.i74_1 + ld * this.k74_1, lc * this.j74_1 + ld * this.l74_1, ltx * this.i74_1 + lty * this.k74_1 + this.m74_1, ltx * this.j74_1 + lty * this.l74_1 + this.n74_1);
};
Matrix.prototype.s76 = function (l, r) {
return this.e76(l.i74_1 * r.i74_1 + l.j74_1 * r.k74_1, l.i74_1 * r.j74_1 + l.j74_1 * r.l74_1, l.k74_1 * r.i74_1 + l.l74_1 * r.k74_1, l.k74_1 * r.j74_1 + l.l74_1 * r.l74_1, l.m74_1 * r.i74_1 + l.n74_1 * r.k74_1 + r.m74_1, l.m74_1 * r.j74_1 + l.n74_1 * r.l74_1 + r.n74_1);
};
Matrix.prototype.o74 = function () {
return this.e76(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
};
Matrix.prototype.t76 = function () {
DoubleCompanionObject_getInstance();
DoubleCompanionObject_getInstance();
DoubleCompanionObject_getInstance();
DoubleCompanionObject_getInstance();
DoubleCompanionObject_getInstance();
DoubleCompanionObject_getInstance();
return this.e76(NaN, NaN, NaN, NaN, NaN, NaN);
};
Matrix.prototype.u76 = function () {
return this.d76().equals(Type_IDENTITY_getInstance());
};
Matrix.prototype.v76 = function (matrixToInvert) {
var src = matrixToInvert;
var dst = this;
var norm = src.i74_1 * src.l74_1 - src.j74_1 * src.k74_1;
if (norm === 0.0) {
dst.e76(0.0, 0.0, 0.0, 0.0, -src.m74_1, -src.n74_1);
} else {
var inorm = 1.0 / norm;
var d = src.i74_1 * inorm;
var a = src.l74_1 * inorm;
var b = src.j74_1 * -inorm;
var c = src.k74_1 * -inorm;
dst.e76(a, b, c, d, -a * src.m74_1 - c * src.n74_1, -b * src.m74_1 - d * src.n74_1);
}
return this;
};
Matrix.prototype.w76 = function (matrixToInvert, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
matrixToInvert = this;
return this.v76(matrixToInvert);
};
Matrix.prototype.x76 = function (value) {
return this.s76(this, value);
};
Matrix.prototype.y76 = function (out) {
return out.v76(this);
};
Matrix.prototype.z76 = function (out, $mask0, $handler) {
if (!(($mask0 & 1) === 0)) {
out = Matrix_init_$Create$(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 63, null);
}
return this.y76(out);
};
Matrix.prototype.a77 = function (x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) {
var tmp = this;
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.cos' call
var tmp0_cos = plus_0(rotation, skewY);
var tmp$ret$3;
// Inline function 'kotlin.math.cos' call
var tmp0_cos_0 = _Angle___get_radians__impl__n00yt5(tmp0_cos);
tmp$ret$3 = Math.cos(tmp0_cos_0);
tmp$ret$4 = tmp$ret$3;
tmp.i74_1 = tmp$ret$4 * scaleX + 0.0;
var tmp_0 = this;
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.sin' call
var tmp1_sin = plus_0(rotation, skewY);
var tmp$ret$5;
// Inline function 'kotlin.math.sin' call
var tmp0_sin = _Angle___get_radians__impl__n00yt5(tmp1_sin);
tmp$ret$5 = Math.sin(tmp0_sin);
tmp$ret$6 = tmp$ret$5;
tmp_0.j74_1 = tmp$ret$6 * scaleX + 0.0;
var tmp_1 = this;
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.sin' call
var tmp2_sin = minus(rotation, skewX);
var tmp$ret$7;
// Inline function 'kotlin.math.sin' call
var tmp0_sin_0 = _Angle___get_radians__impl__n00yt5(tmp2_sin);
tmp$ret$7 = Math.sin(tmp0_sin_0);
tmp$ret$8 = tmp$ret$7;
tmp_1.k74_1 = -tmp$ret$8 * scaleY + 0.0;
var tmp_2 = this;
var tmp$ret$10;
// Inline function 'com.soywiz.korma.geom.cos' call
var tmp3_cos = minus(rotation, skewX);
var tmp$ret$9;
// Inline function 'kotlin.math.cos' call
var tmp0_cos_1 = _Angle___get_radians__impl__n00yt5(tmp3_cos);
tmp$ret$9 = Math.cos(tmp0_cos_1);
tmp$ret$10 = tmp$ret$9;
tmp_2.l74_1 = tmp$ret$10 * scaleY + 0.0;
if (pivotX === 0.0 ? pivotY === 0.0 : false) {
this.m74_1 = x;
this.n74_1 = y;
} else {
this.m74_1 = x - (pivotX * this.i74_1 + pivotY * this.k74_1);
this.n74_1 = y - (pivotX * this.j74_1 + pivotY * this.l74_1);
}
return this;
};
Matrix.prototype.b77 = function (x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
x = 0.0;
if (!(($mask0 & 2) === 0))
y = 0.0;
if (!(($mask0 & 4) === 0))
scaleX = 1.0;
if (!(($mask0 & 8) === 0))
scaleY = 1.0;
if (!(($mask0 & 16) === 0)) {
var tmp$ret$0;
var tmp$ret$0_0;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp0__get_ZERO__8316ll = Companion_getInstance_0();
tmp$ret$0 = tmp0__get_ZERO__8316ll.f70(0.0);
tmp$ret$0_0 = Unit_getInstance();
rotation = tmp$ret$0;
}
if (!(($mask0 & 32) === 0)) {
var tmp$ret$0_1;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp0__get_ZERO__8316ll_0 = Companion_getInstance_0();
tmp$ret$0_1 = tmp0__get_ZERO__8316ll_0.f70(0.0);
tmp$ret$1 = Unit_getInstance();
skewX = tmp$ret$0_1;
}
if (!(($mask0 & 64) === 0)) {
var tmp$ret$0_2;
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp0__get_ZERO__8316ll_1 = Companion_getInstance_0();
tmp$ret$0_2 = tmp0__get_ZERO__8316ll_1.f70(0.0);
tmp$ret$2 = Unit_getInstance();
skewY = tmp$ret$0_2;
}
if (!(($mask0 & 128) === 0))
pivotX = 0.0;
if (!(($mask0 & 256) === 0))
pivotY = 0.0;
return this.a77(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY);
};
Matrix.prototype.z4n = function () {
return new Matrix(this.i74_1, this.j74_1, this.k74_1, this.l74_1, this.m74_1, this.n74_1);
};
Matrix.prototype.c77 = function (that) {
return Matrix_init_$Create$(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 63, null).s76(this, that);
};
Matrix.prototype.d77 = function (out) {
out.k75(this, 0.0, 0.0, 6, null);
return out;
};
Matrix.prototype.e77 = function (out, $mask0, $handler) {
if (!(($mask0 & 1) === 0)) {
out = Transform_init_$Create$(0.0, 0.0, 0.0, 0.0, null, null, null, 127, null);
}
return this.d77(out);
};
Matrix.prototype.f77 = function (p, out) {
return this.g77(p.d1n(), p.e1n(), out);
};
Matrix.prototype.g77 = function (px, py, out) {
return out.a73(this.h77(px, py), this.i77(px, py));
};
Matrix.prototype.j77 = function (px, py, out, $mask0, $handler) {
if (!(($mask0 & 4) === 0))
out = Companion_getInstance_8().zp();
return this.g77(px, py, out);
};
Matrix.prototype.k77 = function (p) {
return this.h77(p.d1n(), p.e1n());
};
Matrix.prototype.h77 = function (px, py) {
return this.i74_1 * px + this.k74_1 * py + this.m74_1;
};
Matrix.prototype.l77 = function (p) {
return this.i77(p.d1n(), p.e1n());
};
Matrix.prototype.i77 = function (px, py) {
return this.l74_1 * py + this.j74_1 * px + this.n74_1;
};
Matrix.prototype.m77 = function (px, py) {
return this.h77(px, py);
};
Matrix.prototype.n77 = function (px, py) {
return this.i77(px, py);
};
Matrix.prototype.o77 = function (out) {
return out.m75(this, 0.0, 0.0, 6, null);
};
Matrix.prototype.p77 = function (ratio, l, r) {
return this.e76(interpolate_0(ratio, l.i74_1, r.i74_1), interpolate_0(ratio, l.j74_1, r.j74_1), interpolate_0(ratio, l.k74_1, r.k74_1), interpolate_0(ratio, l.l74_1, r.l74_1), interpolate_0(ratio, l.m74_1, r.m74_1), interpolate_0(ratio, l.n74_1, r.n74_1));
};
Matrix.prototype.q77 = function (ratio, other) {
return Matrix_init_$Create$(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 63, null).p77(ratio, this, other);
};
Matrix.prototype.d70 = function (ratio, other) {
return this.q77(ratio, other instanceof Matrix ? other : THROW_CCE());
};
Matrix.prototype.r77 = function (callback) {
var a = this.i74_1;
var b = this.j74_1;
var c = this.k74_1;
var d = this.l74_1;
var tx = this.m74_1;
var ty = this.n74_1;
try {
return callback(this);
}finally {
this.i74_1 = a;
this.j74_1 = b;
this.k74_1 = c;
this.l74_1 = d;
this.m74_1 = tx;
this.n74_1 = ty;
}
};
Matrix.prototype.toString = function () {
return 'Matrix(a=' + this.i74_1 + ', b=' + this.j74_1 + ', c=' + this.k74_1 + ', d=' + this.l74_1 + ', tx=' + this.m74_1 + ', ty=' + this.n74_1 + ')';
};
Matrix.prototype.hashCode = function () {
var result = getNumberHashCode(this.i74_1);
result = imul(result, 31) + getNumberHashCode(this.j74_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.k74_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.l74_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.m74_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.n74_1) | 0;
return result;
};
Matrix.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Matrix))
return false;
var tmp0_other_with_cast = other instanceof Matrix ? other : THROW_CCE();
if (!equals(this.i74_1, tmp0_other_with_cast.i74_1))
return false;
if (!equals(this.j74_1, tmp0_other_with_cast.j74_1))
return false;
if (!equals(this.k74_1, tmp0_other_with_cast.k74_1))
return false;
if (!equals(this.l74_1, tmp0_other_with_cast.l74_1))
return false;
if (!equals(this.m74_1, tmp0_other_with_cast.m74_1))
return false;
if (!equals(this.n74_1, tmp0_other_with_cast.n74_1))
return false;
return true;
};
Matrix.$metadata$ = classMeta('Matrix', [MutableInterpolable, Interpolable]);
var tempMat3D;
var tempVec1;
var tempVec2;
var tempVec3;
var tempMat1;
function Companion_6() {
Companion_instance_6 = this;
this.s77_1 = 0;
this.t77_1 = 1;
this.u77_1 = 2;
this.v77_1 = 3;
this.w77_1 = 4;
this.x77_1 = 5;
this.y77_1 = 6;
this.z77_1 = 7;
this.a78_1 = 8;
this.b78_1 = 9;
this.c78_1 = 10;
this.d78_1 = 11;
this.e78_1 = 12;
this.f78_1 = 13;
this.g78_1 = 14;
this.h78_1 = 15;
}
Companion_6.prototype.i78 = function (row, column) {
return imul(row, 4) + column | 0;
};
Companion_6.prototype.j78 = function (row, column) {
return imul(column, 4) + row | 0;
};
Companion_6.$metadata$ = objectMeta('Companion');
var Companion_instance_6;
function Companion_getInstance_6() {
if (Companion_instance_6 == null)
new Companion_6();
return Companion_instance_6;
}
function Matrix3D() {
Companion_getInstance_6();
var tmp = this;
var tmp$ret$0;
// Inline function 'kotlin.floatArrayOf' call
tmp$ret$0 = new Float32Array([1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]);
tmp.k78_1 = tmp$ret$0;
}
Matrix3D.prototype.l78 = function (row, column) {
return this.k78_1[Companion_getInstance_6().j78(row, column)];
};
Matrix3D.prototype.m78 = function (v) {
Companion_getInstance_6();
this.k78_1[0] = v;
};
Matrix3D.prototype.n78 = function () {
Companion_getInstance_6();
return this.k78_1[0];
};
Matrix3D.prototype.o78 = function (v) {
Companion_getInstance_6();
this.k78_1[4] = v;
};
Matrix3D.prototype.p78 = function () {
Companion_getInstance_6();
return this.k78_1[4];
};
Matrix3D.prototype.q78 = function (v) {
Companion_getInstance_6();
this.k78_1[8] = v;
};
Matrix3D.prototype.r78 = function () {
Companion_getInstance_6();
return this.k78_1[8];
};
Matrix3D.prototype.s78 = function (v) {
Companion_getInstance_6();
this.k78_1[12] = v;
};
Matrix3D.prototype.t78 = function () {
Companion_getInstance_6();
return this.k78_1[12];
};
Matrix3D.prototype.u78 = function (v) {
Companion_getInstance_6();
this.k78_1[1] = v;
};
Matrix3D.prototype.v78 = function () {
Companion_getInstance_6();
return this.k78_1[1];
};
Matrix3D.prototype.w78 = function (v) {
Companion_getInstance_6();
this.k78_1[5] = v;
};
Matrix3D.prototype.x78 = function () {
Companion_getInstance_6();
return this.k78_1[5];
};
Matrix3D.prototype.y78 = function (v) {
Companion_getInstance_6();
this.k78_1[9] = v;
};
Matrix3D.prototype.z78 = function () {
Companion_getInstance_6();
return this.k78_1[9];
};
Matrix3D.prototype.a79 = function (v) {
Companion_getInstance_6();
this.k78_1[13] = v;
};
Matrix3D.prototype.b79 = function () {
Companion_getInstance_6();
return this.k78_1[13];
};
Matrix3D.prototype.c79 = function (v) {
Companion_getInstance_6();
this.k78_1[2] = v;
};
Matrix3D.prototype.d79 = function () {
Companion_getInstance_6();
return this.k78_1[2];
};
Matrix3D.prototype.e79 = function (v) {
Companion_getInstance_6();
this.k78_1[6] = v;
};
Matrix3D.prototype.f79 = function () {
Companion_getInstance_6();
return this.k78_1[6];
};
Matrix3D.prototype.g79 = function (v) {
Companion_getInstance_6();
this.k78_1[10] = v;
};
Matrix3D.prototype.h79 = function () {
Companion_getInstance_6();
return this.k78_1[10];
};
Matrix3D.prototype.i79 = function (v) {
Companion_getInstance_6();
this.k78_1[14] = v;
};
Matrix3D.prototype.j79 = function () {
Companion_getInstance_6();
return this.k78_1[14];
};
Matrix3D.prototype.k79 = function (v) {
Companion_getInstance_6();
this.k78_1[3] = v;
};
Matrix3D.prototype.l79 = function () {
Companion_getInstance_6();
return this.k78_1[3];
};
Matrix3D.prototype.m79 = function (v) {
Companion_getInstance_6();
this.k78_1[7] = v;
};
Matrix3D.prototype.n79 = function () {
Companion_getInstance_6();
return this.k78_1[7];
};
Matrix3D.prototype.o79 = function (v) {
Companion_getInstance_6();
this.k78_1[11] = v;
};
Matrix3D.prototype.p79 = function () {
Companion_getInstance_6();
return this.k78_1[11];
};
Matrix3D.prototype.q79 = function (v) {
Companion_getInstance_6();
this.k78_1[15] = v;
};
Matrix3D.prototype.r79 = function () {
Companion_getInstance_6();
return this.k78_1[15];
};
Matrix3D.prototype.s79 = function (a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.Matrix3D.setRows.<anonymous>' call
this.m78(a00);
this.o78(a01);
this.q78(a02);
this.s78(a03);
this.u78(a10);
this.w78(a11);
this.y78(a12);
this.a79(a13);
this.c79(a20);
this.e79(a21);
this.g79(a22);
this.i79(a23);
this.k79(a30);
this.m79(a31);
this.o79(a32);
this.q79(a33);
tmp$ret$0 = this;
return tmp$ret$0;
};
Matrix3D.prototype.t79 = function (a00, a10, a20, a30, a01, a11, a21, a31, a02, a12, a22, a32, a03, a13, a23, a33) {
this.m78(a00);
this.o78(a01);
this.q78(a02);
this.s78(a03);
this.u78(a10);
this.w78(a11);
this.y78(a12);
this.a79(a13);
this.c79(a20);
this.e79(a21);
this.g79(a22);
this.i79(a23);
this.k79(a30);
this.m79(a31);
this.o79(a32);
this.q79(a33);
return this;
};
Matrix3D.prototype.o74 = function () {
return this.t79(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
};
Matrix3D.prototype.u79 = function (l, r) {
return this.s79(l.n78() * r.n78() + l.p78() * r.v78() + l.r78() * r.d79() + l.t78() * r.l79(), l.n78() * r.p78() + l.p78() * r.x78() + l.r78() * r.f79() + l.t78() * r.n79(), l.n78() * r.r78() + l.p78() * r.z78() + l.r78() * r.h79() + l.t78() * r.p79(), l.n78() * r.t78() + l.p78() * r.b79() + l.r78() * r.j79() + l.t78() * r.r79(), l.v78() * r.n78() + l.x78() * r.v78() + l.z78() * r.d79() + l.b79() * r.l79(), l.v78() * r.p78() + l.x78() * r.x78() + l.z78() * r.f79() + l.b79() * r.n79(), l.v78() * r.r78() + l.x78() * r.z78() + l.z78() * r.h79() + l.b79() * r.p79(), l.v78() * r.t78() + l.x78() * r.b79() + l.z78() * r.j79() + l.b79() * r.r79(), l.d79() * r.n78() + l.f79() * r.v78() + l.h79() * r.d79() + l.j79() * r.l79(), l.d79() * r.p78() + l.f79() * r.x78() + l.h79() * r.f79() + l.j79() * r.n79(), l.d79() * r.r78() + l.f79() * r.z78() + l.h79() * r.h79() + l.j79() * r.p79(), l.d79() * r.t78() + l.f79() * r.b79() + l.h79() * r.j79() + l.j79() * r.r79(), l.l79() * r.n78() + l.n79() * r.v78() + l.p79() * r.d79() + l.r79() * r.l79(), l.l79() * r.p78() + l.n79() * r.x78() + l.p79() * r.f79() + l.r79() * r.n79(), l.l79() * r.r78() + l.n79() * r.z78() + l.p79() * r.h79() + l.r79() * r.p79(), l.l79() * r.t78() + l.n79() * r.b79() + l.p79() * r.j79() + l.r79() * r.r79());
};
Matrix3D.prototype.v79 = function (that) {
var inductionVariable = 0;
if (inductionVariable < 16)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
this.k78_1[n] = that.k78_1[n];
}
while (inductionVariable < 16);
return this;
};
Matrix3D.prototype.w79 = function (left, right, bottom, top, near, far) {
var sx = 2.0 / (right - left);
var sy = 2.0 / (top - bottom);
var sz = -2.0 / (far - near);
var tx = -(right + left) / (right - left);
var ty = -(top + bottom) / (top - bottom);
var tz = -(far + near) / (far - near);
return this.s79(sx, 0.0, 0.0, tx, 0.0, sy, 0.0, ty, 0.0, 0.0, sz, tz, 0.0, 0.0, 0.0, 1.0);
};
Matrix3D.prototype.x79 = function (rect, near, far) {
return this.y79(rect.b74(), rect.z73(), rect.a74(), rect.y73(), near, far);
};
Matrix3D.prototype.y79 = function (left, right, bottom, top, near, far) {
return this.w79(left, right, bottom, top, near, far);
};
Matrix3D.prototype.equals = function (other) {
var tmp;
if (other instanceof Matrix3D) {
tmp = contentEquals(this.k78_1, other.k78_1);
} else {
tmp = false;
}
return tmp;
};
Matrix3D.prototype.hashCode = function () {
return contentHashCode(this.k78_1);
};
Matrix3D.prototype.toString = function () {
var tmp$ret$2;
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$1;
// Inline function 'kotlin.apply' call
var tmp0_apply = StringBuilder_init_$Create$();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.Matrix3D.toString.<anonymous>' call
tmp0_apply.gc('Matrix3D(\n');
var inductionVariable = 0;
if (inductionVariable < 4)
do {
var row = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
tmp0_apply.gc(' [ ');
var inductionVariable_0 = 0;
if (inductionVariable_0 < 4)
do {
var col = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
if (!(col === 0)) {
tmp0_apply.gc(', ');
}
var v = this.l78(row, col);
var tmp$ret$0;
// Inline function 'kotlin.math.floor' call
tmp$ret$0 = Math.floor(v);
if (tmp$ret$0 === v) {
tmp0_apply.fc(numberToInt(v));
} else {
tmp0_apply.fc(v);
}
}
while (inductionVariable_0 < 4);
tmp0_apply.gc(' ],\n');
}
while (inductionVariable < 4);
tmp0_apply.gc(')');
tmp$ret$1 = tmp0_apply;
tmp$ret$2 = tmp$ret$1.toString();
return tmp$ret$2;
};
Matrix3D.$metadata$ = classMeta('Matrix3D');
var MajorOrder_ROW_instance;
var MajorOrder_COLUMN_instance;
var MajorOrder_entriesInitialized;
function MajorOrder_initEntries() {
if (MajorOrder_entriesInitialized)
return Unit_getInstance();
MajorOrder_entriesInitialized = true;
MajorOrder_ROW_instance = new MajorOrder('ROW', 0);
MajorOrder_COLUMN_instance = new MajorOrder('COLUMN', 1);
}
function MajorOrder(name, ordinal) {
Enum.call(this, name, ordinal);
}
MajorOrder.$metadata$ = classMeta('MajorOrder', undefined, undefined, undefined, undefined, Enum.prototype);
function setRows(_this__u8e3s4, a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33) {
init_properties_Matrix3D_kt_5y1riw();
return _this__u8e3s4.s79(a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33);
}
function copyToFloatWxH(_this__u8e3s4, out, rows, columns, order, offset) {
init_properties_Matrix3D_kt_5y1riw();
var n = offset;
if (order.equals(MajorOrder_ROW_getInstance())) {
var inductionVariable = 0;
if (inductionVariable < columns)
do {
var column = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var inductionVariable_0 = 0;
if (inductionVariable_0 < rows)
do {
var row = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var tmp2 = n;
n = tmp2 + 1 | 0;
out[tmp2] = _this__u8e3s4.k78_1[Companion_getInstance_6().i78(row, column)];
}
while (inductionVariable_0 < rows);
}
while (inductionVariable < columns);
} else {
var inductionVariable_1 = 0;
if (inductionVariable_1 < columns)
do {
var column_0 = inductionVariable_1;
inductionVariable_1 = inductionVariable_1 + 1 | 0;
var inductionVariable_2 = 0;
if (inductionVariable_2 < rows)
do {
var row_0 = inductionVariable_2;
inductionVariable_2 = inductionVariable_2 + 1 | 0;
var tmp5 = n;
n = tmp5 + 1 | 0;
out[tmp5] = _this__u8e3s4.k78_1[Companion_getInstance_6().j78(row_0, column_0)];
}
while (inductionVariable_2 < rows);
}
while (inductionVariable_1 < columns);
}
}
function MajorOrder_ROW_getInstance() {
MajorOrder_initEntries();
return MajorOrder_ROW_instance;
}
function MajorOrder_COLUMN_getInstance() {
MajorOrder_initEntries();
return MajorOrder_COLUMN_instance;
}
var properties_initialized_Matrix3D_kt_tjzp0;
function init_properties_Matrix3D_kt_5y1riw() {
if (properties_initialized_Matrix3D_kt_tjzp0) {
} else {
properties_initialized_Matrix3D_kt_tjzp0 = true;
tempMat3D = new Matrix3D();
tempVec1 = new Vector3D();
tempVec2 = new Vector3D();
tempVec3 = new Vector3D();
tempMat1 = new Matrix3D();
}
}
function toMatrix3D(_this__u8e3s4, out) {
return setRows(out, _this__u8e3s4.i74_1, _this__u8e3s4.k74_1, 0.0, _this__u8e3s4.m74_1, _this__u8e3s4.j74_1, _this__u8e3s4.l74_1, 0.0, _this__u8e3s4.n74_1, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
}
function toMatrix3D$default(_this__u8e3s4, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
out = new Matrix3D();
return toMatrix3D(_this__u8e3s4, out);
}
function copyFrom(_this__u8e3s4, that) {
return toMatrix3D(that, _this__u8e3s4);
}
function Companion_7() {
Companion_instance_7 = this;
}
Companion_7.prototype.z79 = function (x, y) {
return new Point(x, y);
};
Companion_7.$metadata$ = objectMeta('Companion');
var Companion_instance_7;
function Companion_getInstance_7() {
if (Companion_instance_7 == null)
new Companion_7();
return Companion_instance_7;
}
function IPoint() {
}
IPoint.$metadata$ = interfaceMeta('IPoint');
function Point$Companion$POOL$lambda(it) {
it.a73(0.0, 0.0);
return Unit_getInstance();
}
function Point$Companion$POOL$lambda_0(it) {
return Companion_getInstance_8().zp();
}
function Point_init_$Init$(x, y, $this) {
Point.call($this, x, y);
return $this;
}
function Point_init_$Create$(x, y) {
return Point_init_$Init$(x, y, Object.create(Point.prototype));
}
function Companion_8() {
Companion_instance_8 = this;
var tmp = this;
var tmp_0 = Point$Companion$POOL$lambda;
tmp.f72_1 = ConcurrentPool_init_$Create$(tmp_0, 0, Point$Companion$POOL$lambda_0, 2, null);
this.g72_1 = Companion_getInstance_7().z79(0.0, 0.0);
this.h72_1 = Companion_getInstance_7().z79(1.0, 1.0);
this.i72_1 = Companion_getInstance_7().z79(0.0, -1.0);
this.j72_1 = Companion_getInstance_7().z79(0.0, 1.0);
this.k72_1 = Companion_getInstance_7().z79(-1.0, 0.0);
this.l72_1 = Companion_getInstance_7().z79(1.0, 0.0);
}
Companion_8.prototype.zp = function () {
return new Point(0.0, 0.0);
};
Companion_8.prototype.a7a = function (x, y, angle, length, out) {
return out.a73(x + get_cosine(angle) * length, y + get_sine(angle) * length);
};
Companion_8.prototype.b7a = function (angle, length, out) {
return this.a7a(0.0, 0.0, angle, length, out);
};
Companion_8.prototype.c7a = function (angle, length, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
length = 1.0;
if (!(($mask0 & 4) === 0))
out = Companion_getInstance_8().zp();
return this.b7a(angle, length, out);
};
Companion_8.prototype.d7a = function (a, b, out) {
return out.a73((a.d1n() + b.d1n()) * 0.5, (a.e1n() + b.e1n()) * 0.5);
};
Companion_8.prototype.e7a = function (a, b, out, $mask0, $handler) {
if (!(($mask0 & 4) === 0))
out = Companion_getInstance_8().zp();
return this.d7a(a, b, out);
};
Companion_8.prototype.f7a = function (a, b) {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp1_fromRadians = Companion_getInstance_0();
var tmp$ret$0;
// Inline function 'kotlin.math.acos' call
var tmp0_acos = dot(a, b) / (get_length(a) * get_length(b));
tmp$ret$0 = Math.acos(tmp0_acos);
var tmp2_fromRadians = tmp$ret$0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$1 = tmp2_fromRadians / get_PI2();
tmp$ret$2 = tmp1_fromRadians.f70(tmp$ret$1);
return tmp$ret$2;
};
Companion_8.prototype.g7a = function (ax, ay, bx, by) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between = Companion_getInstance_0();
tmp$ret$0 = Angle_between(ax, ay, bx, by);
return tmp$ret$0;
};
Companion_8.prototype.h7a = function (lx, ly, rx, ry) {
var ret = compareTo(ly, ry);
return ret === 0 ? compareTo(lx, rx) : ret;
};
Companion_8.prototype.i7a = function (x1, y1, x2, y2) {
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
var tmp0_hypot = x1 - x2;
var tmp1_hypot = y1 - y2;
tmp$ret$0 = hypot(tmp0_hypot, tmp1_hypot);
return tmp$ret$0;
};
Companion_8.prototype.j7a = function (x1, y1, x2, y2) {
return this.i7a(x1, y1, x2, y2);
};
Companion_8.prototype.k7a = function (x1, y1, x2, y2) {
return this.i7a(x1, y1, x2, y2);
};
Companion_8.prototype.l7a = function (a, b) {
return this.i7a(a.d1n(), a.e1n(), b.d1n(), b.e1n());
};
Companion_8.prototype.r73 = function (aX, aY, bX, bY) {
return aX * bX + aY * bY;
};
Companion_8.prototype.m7a = function (ax, ay, bx, by) {
return ax * by - bx * ay;
};
Companion_8.prototype.n7a = function (p1, p2) {
return this.m7a(p1.d1n(), p1.e1n(), p2.d1n(), p2.e1n());
};
Companion_8.$metadata$ = objectMeta('Companion');
var Companion_instance_8;
function Companion_getInstance_8() {
if (Companion_instance_8 == null)
new Companion_8();
return Companion_instance_8;
}
function Point(x, y) {
Companion_getInstance_8();
this.y72_1 = x;
this.z72_1 = y;
}
Point.prototype.d1n = function () {
return this.y72_1;
};
Point.prototype.e1n = function () {
return this.z72_1;
};
Point.prototype.o7a = function () {
return this.y72_1;
};
Point.prototype.p7a = function () {
return this.z72_1;
};
Point.prototype.q7a = function (other) {
return Companion_getInstance_8().h7a(this.y72_1, this.z72_1, other.d1n(), other.e1n());
};
Point.prototype.kc = function (other) {
return this.q7a((!(other == null) ? isInterface(other, IPoint) : false) ? other : THROW_CCE());
};
Point.prototype.r7a = function (x, y) {
return this.a73(x, y);
};
Point.prototype.a73 = function (x, y) {
this.y72_1 = x;
this.z72_1 = y;
return this;
};
Point.prototype.s7a = function () {
return this.a73(-this.z72_1, this.y72_1);
};
Point.prototype.t7a = function () {
return this.a73(-this.y72_1, -this.z72_1);
};
Point.prototype.u7a = function (that) {
return this.a73(that.d1n(), that.e1n());
};
Point.prototype.v7a = function (that) {
return new Point(this.y72_1 + that.d1n(), this.z72_1 + that.e1n());
};
Point.prototype.w7a = function (that) {
return new Point(this.y72_1 - that.d1n(), this.z72_1 - that.e1n());
};
Point.prototype.x7a = function (scale) {
return new Point(this.y72_1 * scale, this.z72_1 * scale);
};
Point.prototype.y7a = function (x, y) {
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
var tmp0_hypot = x - this.y72_1;
var tmp1_hypot = y - this.z72_1;
tmp$ret$0 = hypot(tmp0_hypot, tmp1_hypot);
return tmp$ret$0;
};
Point.prototype.z7a = function (that) {
return this.y7a(that.y72_1, that.z72_1);
};
Point.prototype.d73 = function () {
return new Point(this.y72_1, this.z72_1);
};
Point.prototype.a7b = function () {
return this.y72_1 * this.y72_1 + this.z72_1 * this.z72_1;
};
Point.prototype.ze = function () {
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
var tmp0_hypot = this.y72_1;
var tmp1_hypot = this.z72_1;
tmp$ret$0 = hypot(tmp0_hypot, tmp1_hypot);
return tmp$ret$0;
};
Point.prototype.b7b = function () {
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
var tmp0_hypot = this.y72_1;
var tmp1_hypot = this.z72_1;
tmp$ret$0 = hypot(tmp0_hypot, tmp1_hypot);
return tmp$ret$0;
};
Point.prototype.c7b = function () {
var imag = 1.0 / this.b7b();
return new Point(this.y72_1 * imag, this.z72_1 * imag);
};
Point.prototype.d7b = function () {
var len = this.ze();
if (isAlmostZero(len)) {
this.r7a(0, 0);
} else {
this.a73(this.y72_1 / len, this.z72_1 / len);
}
};
Point.prototype.e7b = function (ratio, other) {
return Companion_getInstance_8().zp().f7b(ratio, this, other);
};
Point.prototype.d70 = function (ratio, other) {
return this.e7b(ratio, other instanceof Point ? other : THROW_CCE());
};
Point.prototype.f7b = function (ratio, l, r) {
return this.g7b(ratio, l.y72_1, l.z72_1, r.y72_1, r.z72_1);
};
Point.prototype.g7b = function (ratio, lx, ly, rx, ry) {
return this.a73(interpolate_0(ratio, lx, rx), interpolate_0(ratio, ly, ry));
};
Point.prototype.toString = function () {
return '(' + get_niceStr(this.y72_1) + ', ' + get_niceStr(this.z72_1) + ')';
};
Point.prototype.n4 = function () {
return this.y72_1;
};
Point.prototype.o4 = function () {
return this.z72_1;
};
Point.prototype.hashCode = function () {
var result = getNumberHashCode(this.y72_1);
result = imul(result, 31) + getNumberHashCode(this.z72_1) | 0;
return result;
};
Point.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Point))
return false;
var tmp0_other_with_cast = other instanceof Point ? other : THROW_CCE();
if (!equals(this.y72_1, tmp0_other_with_cast.y72_1))
return false;
if (!equals(this.z72_1, tmp0_other_with_cast.z72_1))
return false;
return true;
};
Point.$metadata$ = classMeta('Point', [MutableInterpolable, Interpolable, Comparable, IPoint, XY, XYf]);
function XY() {
}
XY.$metadata$ = interfaceMeta('XY', [IPoint]);
function XYf() {
}
XYf.$metadata$ = interfaceMeta('XYf');
function get_length(_this__u8e3s4) {
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
var tmp0_hypot = _this__u8e3s4.d1n();
var tmp1_hypot = _this__u8e3s4.e1n();
tmp$ret$0 = hypot(tmp0_hypot, tmp1_hypot);
return tmp$ret$0;
}
function dot(_this__u8e3s4, that) {
return _this__u8e3s4.d1n() * that.d1n() + _this__u8e3s4.e1n() * that.e1n();
}
function IPointInt() {
}
IPointInt.$metadata$ = interfaceMeta('IPointInt');
function _PointInt___init__impl__bsppa6(p) {
return p;
}
function _PointInt___get_p__impl__q7vq95($this) {
return $this;
}
function PointInt__compareTo_impl_2z9cr0($this, other) {
return Companion_getInstance_9().h7b(_PointInt___get_x__impl__8q83ox($this), _PointInt___get_y__impl__k3edda($this), other.d1n(), other.e1n());
}
function PointInt__compareTo_impl_2z9cr0_0($this, other) {
var tmp = $this.i7b_1;
return PointInt__compareTo_impl_2z9cr0(tmp, (!(other == null) ? isInterface(other, IPointInt) : false) ? other : THROW_CCE());
}
function Companion_9() {
Companion_instance_9 = this;
}
Companion_9.prototype.j7b = function () {
return Companion_getInstance_9().k7b(0, 0);
};
Companion_9.prototype.k7b = function (x, y) {
return _PointInt___init__impl__bsppa6(Point_init_$Create$(x, y));
};
Companion_9.prototype.h7b = function (lx, ly, rx, ry) {
var ret = compareTo(ly, ry);
return ret === 0 ? compareTo(lx, rx) : ret;
};
Companion_9.$metadata$ = objectMeta('Companion');
var Companion_instance_9;
function Companion_getInstance_9() {
if (Companion_instance_9 == null)
new Companion_9();
return Companion_instance_9;
}
function _PointInt___set_x__impl__gw06o3($this, value) {
_PointInt___get_p__impl__q7vq95($this).y72_1 = value;
}
function _PointInt___get_x__impl__8q83ox($this) {
return numberToInt(_PointInt___get_p__impl__q7vq95($this).y72_1);
}
function _PointInt___set_y__impl__pbhe8u($this, value) {
_PointInt___get_p__impl__q7vq95($this).z72_1 = value;
}
function _PointInt___get_y__impl__k3edda($this) {
return numberToInt(_PointInt___get_p__impl__q7vq95($this).z72_1);
}
function PointInt__toString_impl_55v96m($this) {
return '(' + _PointInt___get_x__impl__8q83ox($this) + ', ' + _PointInt___get_y__impl__k3edda($this) + ')';
}
function PointInt__hashCode_impl_qx15zh($this) {
return $this.hashCode();
}
function PointInt__equals_impl_cel7yn($this, other) {
if (!(other instanceof PointInt))
return false;
var tmp0_other_with_cast = other instanceof PointInt ? other.i7b_1 : THROW_CCE();
if (!$this.equals(tmp0_other_with_cast))
return false;
return true;
}
function PointInt(p) {
Companion_getInstance_9();
this.i7b_1 = p;
}
PointInt.prototype.l7b = function (other) {
return PointInt__compareTo_impl_2z9cr0(this.i7b_1, other);
};
PointInt.prototype.kc = function (other) {
return PointInt__compareTo_impl_2z9cr0_0(this, other);
};
PointInt.prototype.d1n = function () {
return _PointInt___get_x__impl__8q83ox(this.i7b_1);
};
PointInt.prototype.e1n = function () {
return _PointInt___get_y__impl__k3edda(this.i7b_1);
};
PointInt.prototype.toString = function () {
return PointInt__toString_impl_55v96m(this.i7b_1);
};
PointInt.prototype.hashCode = function () {
return PointInt__hashCode_impl_qx15zh(this.i7b_1);
};
PointInt.prototype.equals = function (other) {
return PointInt__equals_impl_cel7yn(this.i7b_1, other);
};
PointInt.$metadata$ = classMeta('PointInt', [IPointInt, Comparable]);
function transformX(_this__u8e3s4, m) {
var tmp0_safe_receiver = m;
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.k77(_this__u8e3s4);
return tmp1_elvis_lhs == null ? _this__u8e3s4.d1n() : tmp1_elvis_lhs;
}
function transformY(_this__u8e3s4, m) {
var tmp0_safe_receiver = m;
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.l77(_this__u8e3s4);
return tmp1_elvis_lhs == null ? _this__u8e3s4.e1n() : tmp1_elvis_lhs;
}
function get_mutable(_this__u8e3s4) {
return new Point(_this__u8e3s4.d1n(), _this__u8e3s4.e1n());
}
function minus_0(_this__u8e3s4, that) {
return Companion_getInstance_7().z79(_this__u8e3s4.d1n() - that.d1n(), _this__u8e3s4.e1n() - that.e1n());
}
function get_normalized_0(_this__u8e3s4) {
var imag = 1.0 / get_magnitude(_this__u8e3s4);
return Companion_getInstance_7().z79(_this__u8e3s4.d1n() * imag, _this__u8e3s4.e1n() * imag);
}
function plus_1(_this__u8e3s4, that) {
return Companion_getInstance_7().z79(_this__u8e3s4.d1n() + that.d1n(), _this__u8e3s4.e1n() + that.e1n());
}
function times_1(_this__u8e3s4, scale) {
return Companion_getInstance_7().z79(_this__u8e3s4.d1n() * scale, _this__u8e3s4.e1n() * scale);
}
function get_unit(_this__u8e3s4) {
return div_1(_this__u8e3s4, get_length(_this__u8e3s4));
}
function div_1(_this__u8e3s4, scale) {
return Companion_getInstance_7().z79(_this__u8e3s4.d1n() / scale, _this__u8e3s4.e1n() / scale);
}
function get_magnitude(_this__u8e3s4) {
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
var tmp0_hypot = _this__u8e3s4.d1n();
var tmp1_hypot = _this__u8e3s4.e1n();
tmp$ret$0 = hypot(tmp0_hypot, tmp1_hypot);
return tmp$ret$0;
}
function IPointArrayList() {
}
IPointArrayList.$metadata$ = interfaceMeta('IPointArrayList', [IVectorArrayList, Extra]);
function PointArrayList$Companion$invoke$lambda($points) {
return function ($this$invoke) {
var inductionVariable = 0;
var last = $points.length - 1 | 0;
var tmp;
if (inductionVariable <= last) {
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
$this$invoke.m71($points[n].d1n(), $points[n].e1n());
}
while (inductionVariable <= last);
tmp = Unit_getInstance();
}
return Unit_getInstance();
};
}
function PointArrayList_init_$Init$(capacity, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
capacity = 7;
PointArrayList.call($this, capacity);
return $this;
}
function PointArrayList_init_$Create$(capacity, $mask0, $marker) {
return PointArrayList_init_$Init$(capacity, $mask0, $marker, Object.create(PointArrayList.prototype));
}
function Companion_10() {
Companion_instance_10 = this;
}
Companion_10.prototype.q7b = function (values) {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromGen' call
var tmp0_fromGen = values.length;
var size = tmp0_fromGen / 2 | 0;
var out = new PointArrayList(size);
var inductionVariable = 0;
if (inductionVariable < size)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.invoke.<anonymous>' call
var tmp1__anonymous__uwfjfc = imul(n, 2) + 0 | 0;
tmp$ret$0 = values[tmp1__anonymous__uwfjfc];
var tmp = tmp$ret$0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.invoke.<anonymous>' call
var tmp2__anonymous__z9zvc9 = imul(n, 2) + 1 | 0;
tmp$ret$1 = values[tmp2__anonymous__z9zvc9];
out.m71(tmp, tmp$ret$1);
}
while (inductionVariable < size);
tmp$ret$2 = out;
return tmp$ret$2;
};
Companion_10.prototype.r7b = function (count, gen) {
var size = count / 2 | 0;
var out = new PointArrayList(size);
var inductionVariable = 0;
if (inductionVariable < size)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
out.m71(gen(imul(n, 2) + 0 | 0), gen(imul(n, 2) + 1 | 0));
}
while (inductionVariable < size);
return out;
};
Companion_10.prototype.s7b = function (capacity, callback) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
var tmp0_apply = new PointArrayList(capacity);
// Inline function 'kotlin.contracts.contract' call
callback(tmp0_apply);
tmp$ret$0 = tmp0_apply;
return tmp$ret$0;
};
Companion_10.prototype.t7b = function (points) {
var tmp = Companion_getInstance_10();
var tmp_0 = points.length;
return tmp.s7b(tmp_0, PointArrayList$Companion$invoke$lambda(points));
};
Companion_10.$metadata$ = objectMeta('Companion');
var Companion_instance_10;
function Companion_getInstance_10() {
if (Companion_instance_10 == null)
new Companion_10();
return Companion_instance_10;
}
function index($this, index, offset) {
return imul(index, 2) + offset | 0;
}
function PointArrayList(capacity) {
Companion_getInstance_10();
var tmp = this;
tmp.n7b_1 = Mixin_init_$Create$(null, 1, null);
this.o7b_1 = false;
this.p7b_1 = new DoubleArrayList(imul(capacity, 2));
}
PointArrayList.prototype.e4v = function (_set____db54di) {
this.n7b_1.e4v(_set____db54di);
};
PointArrayList.prototype.f4v = function () {
return this.n7b_1.f4v();
};
PointArrayList.prototype.i = function () {
return this.p7b_1.i() / 2 | 0;
};
PointArrayList.prototype.p = function () {
return this.i() === 0;
};
PointArrayList.prototype.t4o = function () {
return !(this.i() === 0);
};
PointArrayList.prototype.zl = function () {
this.p7b_1.x7();
return this;
};
PointArrayList.prototype.m71 = function (x, y) {
this.p7b_1.n4n(x, y);
return this;
};
PointArrayList.prototype.u7b = function (p) {
return this.m71(p.y72_1, p.z72_1);
};
PointArrayList.prototype.v7b = function (p) {
return this.m71(p.d1n(), p.e1n());
};
PointArrayList.prototype.o71 = function (p) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.PointArrayList.add.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.fastForEach' call
var inductionVariable = 0;
var last = p.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.PointArrayList.add.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t = p.p71(n);
var tmp1__anonymous__uwfjfc = p.q71(n);
this.m71(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc);
}
while (inductionVariable < last);
tmp$ret$0 = this;
return tmp$ret$0;
};
PointArrayList.prototype.w7b = function (p, index) {
this.m71(p.p71(index), p.q71(index));
};
PointArrayList.prototype.x7b = function (other) {
this.zl();
this.o71(other);
return this;
};
PointArrayList.prototype.p71 = function (index_0) {
return this.p7b_1.t4n(index(this, index_0, 0));
};
PointArrayList.prototype.q71 = function (index_0) {
return this.p7b_1.t4n(index(this, index_0, 1));
};
PointArrayList.prototype.x4n = function (index_0, count) {
this.p7b_1.x4n(index(this, index_0, 0), imul(count, 2));
return this;
};
PointArrayList.prototype.y7b = function (index, count, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
count = 1;
return this.x4n(index, count);
};
PointArrayList.prototype.equals = function (other) {
var tmp;
if (other instanceof PointArrayList) {
tmp = this.p7b_1.equals(other.p7b_1);
} else {
tmp = false;
}
return tmp;
};
PointArrayList.prototype.hashCode = function () {
return this.p7b_1.hashCode();
};
PointArrayList.prototype.toString = function () {
var sb = StringBuilder_init_$Create$();
sb.g2(_Char___init__impl__6a9atx(91));
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var x = this.p71(n);
var y = this.q71(n);
if (!(n === 0)) {
sb.gc(', ');
}
sb.g2(_Char___init__impl__6a9atx(40));
if (x === round(x)) {
sb.fc(numberToInt(x));
} else {
sb.fc(x);
}
sb.gc(', ');
if (y === round(y)) {
sb.fc(numberToInt(y));
} else {
sb.fc(y);
}
sb.g2(_Char___init__impl__6a9atx(41));
}
while (inductionVariable < last);
sb.g2(_Char___init__impl__6a9atx(93));
return sb.toString();
};
PointArrayList.$metadata$ = classMeta('PointArrayList', [IPointArrayList, Extra]);
function get_firstX(_this__u8e3s4) {
return _this__u8e3s4.p71(0);
}
function get_lastX(_this__u8e3s4) {
return _this__u8e3s4.p71(_this__u8e3s4.i() - 1 | 0);
}
function get_firstY(_this__u8e3s4) {
return _this__u8e3s4.q71(0);
}
function get_lastY(_this__u8e3s4) {
return _this__u8e3s4.q71(_this__u8e3s4.i() - 1 | 0);
}
function fastForEach(_this__u8e3s4, block) {
var inductionVariable = 0;
var last = _this__u8e3s4.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
block(_this__u8e3s4.p71(n), _this__u8e3s4.q71(n));
}
while (inductionVariable < last);
}
function getComponentList(_this__u8e3s4, component, out) {
var inductionVariable = 0;
var last = _this__u8e3s4.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
out[n] = _this__u8e3s4.l78(n, component);
}
while (inductionVariable < last);
return out;
}
function getComponentList$default(_this__u8e3s4, component, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
out = new Float64Array(_this__u8e3s4.i());
return getComponentList(_this__u8e3s4, component, out);
}
function getPoint(_this__u8e3s4, index, out) {
return out.a73(_this__u8e3s4.p71(index), _this__u8e3s4.q71(index));
}
function getPoint$default(_this__u8e3s4, index, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
out = Companion_getInstance_8().zp();
return getPoint(_this__u8e3s4, index, out);
}
function firstPoint(_this__u8e3s4, out) {
return out.a73(get_firstX(_this__u8e3s4), get_firstY(_this__u8e3s4));
}
function firstPoint$default(_this__u8e3s4, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
out = Companion_getInstance_8().zp();
return firstPoint(_this__u8e3s4, out);
}
function lastPoint(_this__u8e3s4, out) {
return out.a73(get_lastX(_this__u8e3s4), get_lastY(_this__u8e3s4));
}
function lastPoint$default(_this__u8e3s4, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
out = Companion_getInstance_8().zp();
return lastPoint(_this__u8e3s4, out);
}
function Companion_11() {
Companion_instance_11 = this;
}
Companion_11.$metadata$ = objectMeta('Companion');
var Companion_instance_11;
function Companion_getInstance_11() {
if (Companion_instance_11 == null)
new Companion_11();
return Companion_instance_11;
}
function PointIntArrayList(capacity) {
Companion_getInstance_11();
var tmp = this;
tmp.z7b_1 = Mixin_init_$Create$(null, 1, null);
this.a7c_1 = false;
this.b7c_1 = new IntArrayList(capacity);
this.c7c_1 = new IntArrayList(capacity);
}
PointIntArrayList.prototype.e4v = function (_set____db54di) {
this.z7b_1.e4v(_set____db54di);
};
PointIntArrayList.prototype.f4v = function () {
return this.z7b_1.f4v();
};
PointIntArrayList.prototype.i = function () {
return this.b7c_1.i();
};
PointIntArrayList.prototype.p = function () {
return this.i() === 0;
};
PointIntArrayList.prototype.x7 = function () {
this.b7c_1.x7();
this.c7c_1.x7();
};
PointIntArrayList.prototype.d7c = function (x, y) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.PointIntArrayList.add.<anonymous>' call
var tmp0_this = this;
tmp0_this.b7c_1.r1t(x);
var tmp1_this = this;
tmp1_this.c7c_1.r1t(y);
tmp$ret$0 = this;
return tmp$ret$0;
};
PointIntArrayList.prototype.p71 = function (index) {
return this.b7c_1.t4n(index);
};
PointIntArrayList.prototype.q71 = function (index) {
return this.c7c_1.t4n(index);
};
PointIntArrayList.prototype.toString = function () {
var sb = StringBuilder_init_$Create$();
sb.g2(_Char___init__impl__6a9atx(91));
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var x = this.p71(n);
var y = this.q71(n);
if (!(n === 0)) {
sb.gc(', ');
}
sb.g2(_Char___init__impl__6a9atx(40));
sb.fc(x);
sb.gc(', ');
sb.fc(y);
sb.g2(_Char___init__impl__6a9atx(41));
}
while (inductionVariable < last);
sb.g2(_Char___init__impl__6a9atx(93));
return sb.toString();
};
PointIntArrayList.$metadata$ = classMeta('PointIntArrayList', [IPointIntArrayList, Extra]);
function IPointIntArrayList() {
}
IPointIntArrayList.$metadata$ = interfaceMeta('IPointIntArrayList');
function PointPool_init_$Init$(capacity, preallocate, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
capacity = 16;
if (!(($mask0 & 2) === 0))
preallocate = false;
PointPool.call($this, capacity, preallocate);
return $this;
}
function PointPool_init_$Create$(capacity, preallocate, $mask0, $marker) {
return PointPool_init_$Init$(capacity, preallocate, $mask0, $marker, Object.create(PointPool.prototype));
}
function PointPool(capacity, preallocate) {
this.e7c_1 = capacity;
this.f7c_1 = 0;
this.g7c_1 = FastArrayList_init_$Create$();
if (preallocate) {
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.geom.PointPool.invoke' call
var oldOffset = this.f7c_1;
try {
var tmp0_repeat = this.e7c_1;
// Inline function 'kotlin.contracts.contract' call
var inductionVariable = 0;
var tmp;
if (inductionVariable < tmp0_repeat) {
do {
var index = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.PointPool.<anonymous>.<anonymous>' call
this.t4t();
}
while (inductionVariable < tmp0_repeat);
tmp = Unit_getInstance();
}
tmp$ret$0 = tmp;
break $l$block;
}finally {
this.f7c_1 = oldOffset;
}
}
}
}
PointPool.prototype.h7c = function () {
return this.g7c_1;
};
PointPool.prototype.t4t = function () {
var tmp;
if (this.f7c_1 < this.g7c_1.i()) {
var tmp0_this = this;
var tmp1 = tmp0_this.f7c_1;
tmp0_this.f7c_1 = tmp1 + 1 | 0;
tmp = this.g7c_1.m(tmp1);
} else {
var tmp2_this = this;
var tmp3 = tmp2_this.f7c_1;
tmp2_this.f7c_1 = tmp3 + 1 | 0;
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also = Companion_getInstance_8().zp();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.PointPool.alloc.<anonymous>' call
this.g7c_1.c(tmp0_also);
tmp$ret$0 = tmp0_also;
tmp = tmp$ret$0;
}
return tmp;
};
PointPool.prototype.i7c = function (callback) {
var oldOffset = this.f7c_1;
try {
return callback(this);
}finally {
this.f7c_1 = oldOffset;
}
};
PointPool.$metadata$ = classMeta('PointPool');
function Rectangle$Companion$POOL$lambda(it) {
it.zl();
return Unit_getInstance();
}
function Rectangle$Companion$POOL$lambda_0(it) {
return Companion_getInstance_12().zp();
}
function Companion_12() {
Companion_instance_12 = this;
var tmp = this;
var tmp_0 = Rectangle$Companion$POOL$lambda;
tmp.i71_1 = ConcurrentPool_init_$Create$(tmp_0, 0, Rectangle$Companion$POOL$lambda_0, 2, null);
}
Companion_12.prototype.j7c = function () {
return this.i71_1;
};
Companion_12.prototype.zp = function () {
return new Rectangle(0.0, 0.0, 0.0, 0.0);
};
Companion_12.prototype.k7c = function (x, y, width, height) {
return new Rectangle(x, y, width, height);
};
Companion_12.prototype.l7c = function (left, top, right, bottom) {
return Companion_getInstance_12().zp().z71(left, top, right, bottom);
};
Companion_12.prototype.m7c = function (left, top, right, bottom) {
return Companion_getInstance_12().zp().b72(left, top, right, bottom);
};
Companion_12.prototype.n7c = function (a, b) {
return ((a.v71_1 >= b.v71_1 ? a.w71_1 >= b.w71_1 : false) ? a.v71_1 + a.x71_1 <= b.v71_1 + b.x71_1 : false) ? a.w71_1 + a.y71_1 <= b.w71_1 + b.y71_1 : false;
};
Companion_12.$metadata$ = objectMeta('Companion');
var Companion_instance_12;
function Companion_getInstance_12() {
if (Companion_instance_12 == null)
new Companion_12();
return Companion_instance_12;
}
function Rectangle(x, y, width, height) {
Companion_getInstance_12();
this.v71_1 = x;
this.w71_1 = y;
this.x71_1 = width;
this.y71_1 = height;
}
Rectangle.prototype.d1n = function () {
return this.v71_1;
};
Rectangle.prototype.o7c = function (_set____db54di) {
this.w71_1 = _set____db54di;
};
Rectangle.prototype.e1n = function () {
return this.w71_1;
};
Rectangle.prototype.d72 = function () {
return this.x71_1;
};
Rectangle.prototype.p7c = function (_set____db54di) {
this.y71_1 = _set____db54di;
};
Rectangle.prototype.e72 = function () {
return this.y71_1;
};
Rectangle.prototype.q7c = function (value) {
this.v71_1 = value;
};
Rectangle.prototype.b74 = function () {
return this.v71_1;
};
Rectangle.prototype.r7c = function (value) {
this.w71_1 = value;
};
Rectangle.prototype.y73 = function () {
return this.w71_1;
};
Rectangle.prototype.z73 = function () {
return this.v71_1 + this.x71_1;
};
Rectangle.prototype.a74 = function () {
return this.w71_1 + this.y71_1;
};
Rectangle.prototype.s7c = function (left, top, right, bottom) {
return this.u72(left, top, right - left, bottom - top);
};
Rectangle.prototype.u72 = function (x, y, width, height) {
this.v71_1 = x;
this.w71_1 = y;
this.x71_1 = width;
this.y71_1 = height;
return this;
};
Rectangle.prototype.t7c = function (x, y, width, height) {
return this.u72(x, y, width, height);
};
Rectangle.prototype.u7c = function (that) {
return this.u72(that.d1n(), that.e1n(), that.d72(), that.e72());
};
Rectangle.prototype.z71 = function (left, top, right, bottom) {
return this.u72(left, top, right - left, bottom - top);
};
Rectangle.prototype.b72 = function (left, top, right, bottom) {
return this.z71(left, top, right, bottom);
};
Rectangle.prototype.v7c = function (that) {
return this.x7c(that) ? this.w7c(that) : false;
};
Rectangle.prototype.x7c = function (that) {
return that.b74() <= this.z73() ? that.z73() >= this.b74() : false;
};
Rectangle.prototype.w7c = function (that) {
return that.y73() <= this.a74() ? that.a74() >= this.y73() : false;
};
Rectangle.prototype.y7c = function (a, b) {
return !(a.z7c(b, this) == null) ? this : null;
};
Rectangle.prototype.a7d = function (a, b) {
var tmp$ret$0;
// Inline function 'kotlin.math.min' call
var tmp0_min = a.b74();
var tmp1_min = b.b74();
tmp$ret$0 = Math.min(tmp0_min, tmp1_min);
var tmp = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.min' call
var tmp2_min = a.y73();
var tmp3_min = b.y73();
tmp$ret$1 = Math.min(tmp2_min, tmp3_min);
var tmp_0 = tmp$ret$1;
var tmp$ret$2;
// Inline function 'kotlin.math.max' call
var tmp4_max = a.z73();
var tmp5_max = b.z73();
tmp$ret$2 = Math.max(tmp4_max, tmp5_max);
var tmp_1 = tmp$ret$2;
var tmp$ret$3;
// Inline function 'kotlin.math.max' call
var tmp6_max = a.a74();
var tmp7_max = b.a74();
tmp$ret$3 = Math.max(tmp6_max, tmp7_max);
return this.s7c(tmp, tmp_0, tmp_1, tmp$ret$3);
};
Rectangle.prototype.z7c = function (that, target) {
var tmp;
if (this.v7c(that)) {
var tmp$ret$0;
// Inline function 'kotlin.math.max' call
var tmp0_max = this.b74();
var tmp1_max = that.b74();
tmp$ret$0 = Math.max(tmp0_max, tmp1_max);
var tmp_0 = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
var tmp2_max = this.y73();
var tmp3_max = that.y73();
tmp$ret$1 = Math.max(tmp2_max, tmp3_max);
var tmp_1 = tmp$ret$1;
var tmp$ret$2;
// Inline function 'kotlin.math.min' call
var tmp4_min = this.z73();
var tmp5_min = that.z73();
tmp$ret$2 = Math.min(tmp4_min, tmp5_min);
var tmp_2 = tmp$ret$2;
var tmp$ret$3;
// Inline function 'kotlin.math.min' call
var tmp6_min = this.a74();
var tmp7_min = that.a74();
tmp$ret$3 = Math.min(tmp6_min, tmp7_min);
tmp = target.z71(tmp_0, tmp_1, tmp_2, tmp$ret$3);
} else {
tmp = null;
}
return tmp;
};
Rectangle.prototype.b7d = function (left, top, right, bottom) {
return this.z71(this.b74() - left, this.y73() - top, this.z73() + right, this.a74() + bottom);
};
Rectangle.prototype.c7d = function (left, top, right, bottom, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
top = left;
if (!(($mask0 & 4) === 0))
right = left;
if (!(($mask0 & 8) === 0))
bottom = top;
return this.b7d(left, top, right, bottom);
};
Rectangle.prototype.zl = function () {
return this.u72(0.0, 0.0, 0.0, 0.0);
};
Rectangle.prototype.z4n = function () {
return new Rectangle(this.v71_1, this.w71_1, this.x71_1, this.y71_1);
};
Rectangle.prototype.toString = function () {
return 'Rectangle(x=' + get_niceStr(this.v71_1) + ', y=' + get_niceStr(this.w71_1) + ', width=' + get_niceStr(this.x71_1) + ', height=' + get_niceStr(this.y71_1) + ')';
};
Rectangle.prototype.equals = function (other) {
var tmp;
var tmp_0;
var tmp_1;
var tmp_2;
if (other instanceof Rectangle) {
var tmp_3 = this.v71_1;
var tmp_4 = other.v71_1;
tmp_2 = isAlmostEquals$default(tmp_3, tmp_4, 0.0, 2, null);
} else {
tmp_2 = false;
}
if (tmp_2) {
var tmp_5 = this.w71_1;
var tmp_6 = other.w71_1;
tmp_1 = isAlmostEquals$default(tmp_5, tmp_6, 0.0, 2, null);
} else {
tmp_1 = false;
}
if (tmp_1) {
var tmp_7 = this.x71_1;
var tmp_8 = other.x71_1;
tmp_0 = isAlmostEquals$default(tmp_7, tmp_8, 0.0, 2, null);
} else {
tmp_0 = false;
}
if (tmp_0) {
var tmp_9 = this.y71_1;
var tmp_10 = other.y71_1;
tmp = isAlmostEquals$default(tmp_9, tmp_10, 0.0, 2, null);
} else {
tmp = false;
}
return tmp;
};
Rectangle.prototype.d7d = function (ratio, other) {
return Companion_getInstance_12().zp().e7d(ratio, this, other);
};
Rectangle.prototype.d70 = function (ratio, other) {
return this.d7d(ratio, other instanceof Rectangle ? other : THROW_CCE());
};
Rectangle.prototype.e7d = function (ratio, l, r) {
return this.u72(interpolate_0(ratio, l.v71_1, r.v71_1), interpolate_0(ratio, l.w71_1, r.w71_1), interpolate_0(ratio, l.x71_1, r.x71_1), interpolate_0(ratio, l.y71_1, r.y71_1));
};
Rectangle.prototype.f7d = function () {
return Companion_getInstance_13().g7d(numberToInt(this.v71_1), numberToInt(this.w71_1), numberToInt(this.x71_1), numberToInt(this.y71_1));
};
Rectangle.prototype.d7b = function () {
if (this.x71_1 < 0.0) {
var tmp0_this = this;
tmp0_this.v71_1 = tmp0_this.v71_1 + this.x71_1;
this.x71_1 = -this.x71_1;
}
if (this.y71_1 < 0.0) {
var tmp1_this = this;
tmp1_this.w71_1 = tmp1_this.w71_1 + this.y71_1;
this.y71_1 = -this.y71_1;
}
};
Rectangle.prototype.hashCode = function () {
var result = getNumberHashCode(this.v71_1);
result = imul(result, 31) + getNumberHashCode(this.w71_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.x71_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.y71_1) | 0;
return result;
};
Rectangle.$metadata$ = classMeta('Rectangle', [MutableInterpolable, Interpolable, IRectangle, Sizeable]);
function _RectangleInt___init__impl__1g5gox(rect) {
return rect;
}
function _RectangleInt___get_rect__impl__gu7bbg($this) {
return $this;
}
function _RectangleInt___set_x__impl__wfudb6($this, value) {
_RectangleInt___get_rect__impl__gu7bbg($this).v71_1 = value;
}
function _RectangleInt___get_x__impl__6tm2y6($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).v71_1);
}
function _RectangleInt___set_y__impl__9rn7lr($this, value) {
_RectangleInt___get_rect__impl__gu7bbg($this).w71_1 = value;
}
function _RectangleInt___get_y__impl__zdvhyr($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).w71_1);
}
function _RectangleInt___set_width__impl__dh3830($this, value) {
_RectangleInt___get_rect__impl__gu7bbg($this).x71_1 = value;
}
function _RectangleInt___get_width__impl__gtay8w($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).x71_1);
}
function _RectangleInt___set_height__impl__vwuxnn($this, value) {
_RectangleInt___get_rect__impl__gu7bbg($this).y71_1 = value;
}
function _RectangleInt___get_height__impl__gd473j($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).y71_1);
}
function _RectangleInt___get_left__impl__rhzld($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).b74());
}
function _RectangleInt___get_top__impl__ie2ifj($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).y73());
}
function _RectangleInt___get_right__impl__9c8zzq($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).z73());
}
function _RectangleInt___get_bottom__impl__za67bh($this) {
return numberToInt(_RectangleInt___get_rect__impl__gu7bbg($this).a74());
}
function Companion_13() {
Companion_instance_13 = this;
}
Companion_13.prototype.h7d = function () {
return _RectangleInt___init__impl__1g5gox(Companion_getInstance_12().zp());
};
Companion_13.prototype.g7d = function (x, y, width, height) {
return _RectangleInt___init__impl__1g5gox(Companion_getInstance_12().k7c(x, y, width, height));
};
Companion_13.prototype.i7d = function (left, top, right, bottom) {
return Companion_getInstance_13().g7d(left, top, right - left | 0, bottom - top | 0);
};
Companion_13.$metadata$ = objectMeta('Companion');
var Companion_instance_13;
function Companion_getInstance_13() {
if (Companion_instance_13 == null)
new Companion_13();
return Companion_instance_13;
}
function RectangleInt__toString_impl_gf76e7($this) {
return 'Rectangle(x=' + _RectangleInt___get_x__impl__6tm2y6($this) + ', y=' + _RectangleInt___get_y__impl__zdvhyr($this) + ', width=' + _RectangleInt___get_width__impl__gtay8w($this) + ', height=' + _RectangleInt___get_height__impl__gd473j($this) + ')';
}
function RectangleInt__hashCode_impl_wuqys2($this) {
return $this.hashCode();
}
function RectangleInt__equals_impl_os9b4i($this, other) {
if (!(other instanceof RectangleInt))
return false;
var tmp0_other_with_cast = other instanceof RectangleInt ? other.j7d_1 : THROW_CCE();
if (!$this.equals(tmp0_other_with_cast))
return false;
return true;
}
function RectangleInt(rect) {
Companion_getInstance_13();
this.j7d_1 = rect;
}
RectangleInt.prototype.d1n = function () {
return _RectangleInt___get_x__impl__6tm2y6(this.j7d_1);
};
RectangleInt.prototype.e1n = function () {
return _RectangleInt___get_y__impl__zdvhyr(this.j7d_1);
};
RectangleInt.prototype.d72 = function () {
return _RectangleInt___get_width__impl__gtay8w(this.j7d_1);
};
RectangleInt.prototype.e72 = function () {
return _RectangleInt___get_height__impl__gd473j(this.j7d_1);
};
RectangleInt.prototype.toString = function () {
return RectangleInt__toString_impl_gf76e7(this.j7d_1);
};
RectangleInt.prototype.hashCode = function () {
return RectangleInt__hashCode_impl_wuqys2(this.j7d_1);
};
RectangleInt.prototype.equals = function (other) {
return RectangleInt__equals_impl_os9b4i(this.j7d_1, other);
};
RectangleInt.$metadata$ = classMeta('RectangleInt', [IRectangleInt]);
function IRectangleInt() {
}
IRectangleInt.$metadata$ = interfaceMeta('IRectangleInt');
function setTo(_this__u8e3s4, x, y, width, height) {
_RectangleInt___set_x__impl__wfudb6(_this__u8e3s4, x);
_RectangleInt___set_y__impl__9rn7lr(_this__u8e3s4, y);
_RectangleInt___set_width__impl__dh3830(_this__u8e3s4, width);
_RectangleInt___set_height__impl__vwuxnn(_this__u8e3s4, height);
return _this__u8e3s4;
}
function bounds(_this__u8e3s4, target) {
var first = true;
var left = 0.0;
var right = 0.0;
var top = 0.0;
var bottom = 0.0;
var tmp0_iterator = _this__u8e3s4.j();
while (tmp0_iterator.k()) {
var r = tmp0_iterator.l();
if (first) {
left = get_left(r);
right = get_right(r);
top = get_top(r);
bottom = get_bottom(r);
first = false;
} else {
var tmp$ret$0;
// Inline function 'kotlin.math.min' call
var tmp0_min = left;
var tmp1_min = get_left(r);
tmp$ret$0 = Math.min(tmp0_min, tmp1_min);
left = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
var tmp2_max = right;
var tmp3_max = get_right(r);
tmp$ret$1 = Math.max(tmp2_max, tmp3_max);
right = tmp$ret$1;
var tmp$ret$2;
// Inline function 'kotlin.math.min' call
var tmp4_min = top;
var tmp5_min = get_top(r);
tmp$ret$2 = Math.min(tmp4_min, tmp5_min);
top = tmp$ret$2;
var tmp$ret$3;
// Inline function 'kotlin.math.max' call
var tmp6_max = bottom;
var tmp7_max = get_bottom(r);
tmp$ret$3 = Math.max(tmp6_max, tmp7_max);
bottom = tmp$ret$3;
}
}
return target.z71(left, top, right, bottom);
}
function get_float(_this__u8e3s4) {
return Companion_getInstance_12().k7c(_this__u8e3s4.d1n(), _this__u8e3s4.e1n(), _this__u8e3s4.d72(), _this__u8e3s4.e72());
}
function get_size_0(_this__u8e3s4) {
return getSize$default(_this__u8e3s4, null, 1, null);
}
function setTo_0(_this__u8e3s4, x, y, width, height) {
return _this__u8e3s4.u72(numberToDouble(x), numberToDouble(y), numberToDouble(width), numberToDouble(height));
}
function applyTransform(_this__u8e3s4, m) {
var tmp = _this__u8e3s4.b74();
var tmp_0 = _this__u8e3s4.y73();
var tl = m.j77(tmp, tmp_0, null, 4, null);
var tmp_1 = _this__u8e3s4.z73();
var tmp_2 = _this__u8e3s4.y73();
var tr = m.j77(tmp_1, tmp_2, null, 4, null);
var tmp_3 = _this__u8e3s4.b74();
var tmp_4 = _this__u8e3s4.a74();
var bl = m.j77(tmp_3, tmp_4, null, 4, null);
var tmp_5 = _this__u8e3s4.z73();
var tmp_6 = _this__u8e3s4.a74();
var br = m.j77(tmp_5, tmp_6, null, 4, null);
var minX = min_0(tl.y72_1, tr.y72_1, bl.y72_1, br.y72_1);
var minY = min_0(tl.z72_1, tr.z72_1, bl.z72_1, br.z72_1);
var maxX = max(tl.y72_1, tr.y72_1, bl.y72_1, br.y72_1);
var maxY = max(tl.z72_1, tr.z72_1, bl.z72_1, br.z72_1);
return _this__u8e3s4.z71(minX, minY, maxX, maxY);
}
function expand(_this__u8e3s4, margin) {
return expand_0(_this__u8e3s4, margin.b74(), margin.y73(), margin.z73(), margin.a74());
}
function expand_0(_this__u8e3s4, left, top, right, bottom) {
return expand_1(_this__u8e3s4, left, top, right, bottom);
}
function without(_this__u8e3s4, padding) {
return Companion_getInstance_12().l7c(_this__u8e3s4.b74() + padding.b74(), _this__u8e3s4.y73() + padding.y73(), _this__u8e3s4.z73() - padding.z73(), _this__u8e3s4.a74() - padding.a74());
}
function getSize(_this__u8e3s4, out) {
return setTo_1(out, _RectangleInt___get_width__impl__gtay8w(_this__u8e3s4), _RectangleInt___get_height__impl__gd473j(_this__u8e3s4));
}
function getSize$default(_this__u8e3s4, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
out = Companion_getInstance_16().k7d();
return getSize(_this__u8e3s4, out);
}
function expand_1(_this__u8e3s4, left, top, right, bottom) {
var tmp0_this = _this__u8e3s4;
tmp0_this.q7c(tmp0_this.b74() - left);
var tmp1_this = _this__u8e3s4;
tmp1_this.r7c(tmp1_this.y73() - top);
var tmp2_this = _this__u8e3s4;
tmp2_this.x71_1 = tmp2_this.x71_1 + (left + right);
var tmp3_this = _this__u8e3s4;
tmp3_this.y71_1 = tmp3_this.y71_1 + (top + bottom);
return _this__u8e3s4;
}
function get_left_0(_this__u8e3s4) {
return _this__u8e3s4.d1n();
}
function get_top_0(_this__u8e3s4) {
return _this__u8e3s4.e1n();
}
function get_right_0(_this__u8e3s4) {
return _this__u8e3s4.d1n() + _this__u8e3s4.d72() | 0;
}
function get_bottom_0(_this__u8e3s4) {
return _this__u8e3s4.e1n() + _this__u8e3s4.e72() | 0;
}
function ScaleMode$Companion$COVER$lambda(c, iw, ih, cw, ch) {
var s0 = cw / iw;
var s1 = ch / ih;
var tmp$ret$0;
// Inline function 'kotlin.math.max' call
tmp$ret$0 = Math.max(s0, s1);
var s = tmp$ret$0;
return c === 0 ? iw * s : ih * s;
}
function ScaleMode$Companion$SHOW_ALL$lambda(c, iw, ih, cw, ch) {
var s0 = cw / iw;
var s1 = ch / ih;
var tmp$ret$0;
// Inline function 'kotlin.math.min' call
tmp$ret$0 = Math.min(s0, s1);
var s = tmp$ret$0;
return c === 0 ? iw * s : ih * s;
}
function ScaleMode$Companion$EXACT$lambda(c, iw, ih, cw, ch) {
return c === 0 ? cw : ch;
}
function ScaleMode$Companion$NO_SCALE$lambda(c, iw, ih, cw, ch) {
return c === 0 ? iw : ih;
}
function Companion_14() {
Companion_instance_14 = this;
var tmp = this;
tmp.l7d_1 = new ScaleMode(ScaleMode$Companion$COVER$lambda);
var tmp_0 = this;
tmp_0.m7d_1 = new ScaleMode(ScaleMode$Companion$SHOW_ALL$lambda);
var tmp_1 = this;
tmp_1.n7d_1 = new ScaleMode(ScaleMode$Companion$EXACT$lambda);
var tmp_2 = this;
tmp_2.o7d_1 = new ScaleMode(ScaleMode$Companion$NO_SCALE$lambda);
}
Companion_14.prototype.p7d = function () {
return this.m7d_1;
};
Companion_14.$metadata$ = objectMeta('Companion');
var Companion_instance_14;
function Companion_getInstance_14() {
if (Companion_instance_14 == null)
new Companion_14();
return Companion_instance_14;
}
function ScaleMode(transform) {
Companion_getInstance_14();
this.q7d_1 = transform;
}
ScaleMode.prototype.r7d = function (iw, ih, cw, ch) {
return this.q7d_1(0, iw, ih, cw, ch);
};
ScaleMode.prototype.s7d = function (iw, ih, cw, ch) {
return this.q7d_1(1, iw, ih, cw, ch);
};
ScaleMode.prototype.t7d = function (item, container, target) {
return setTo_1(target, numberToInt(this.r7d(item.d72(), item.e72(), container.d72(), container.e72())), numberToInt(this.s7d(item.d72(), item.e72(), container.d72(), container.e72())));
};
ScaleMode.$metadata$ = classMeta('ScaleMode');
function Sizeable() {
}
Sizeable.$metadata$ = interfaceMeta('Sizeable');
function ISize() {
}
ISize.$metadata$ = interfaceMeta('ISize');
function _Size___init__impl__aywn0g(p) {
return p;
}
function _Size___get_p__impl__j57dcl($this) {
return $this;
}
function Companion_15() {
Companion_instance_15 = this;
}
Companion_15.prototype.u7d = function (width, height) {
return _Size___init__impl__aywn0g(new Point(width, height));
};
Companion_15.prototype.v7d = function (width, height) {
return _Size___init__impl__aywn0g(Point_init_$Create$(width, height));
};
Companion_15.$metadata$ = objectMeta('Companion');
var Companion_instance_15;
function Companion_getInstance_15() {
if (Companion_instance_15 == null)
new Companion_15();
return Companion_instance_15;
}
function _Size___set_width__impl__zhrohf($this, value) {
_Size___get_p__impl__j57dcl($this).y72_1 = value;
}
function _Size___get_width__impl__58y75t($this) {
return _Size___get_p__impl__j57dcl($this).y72_1;
}
function _Size___set_height__impl__5jm1k2($this, value) {
_Size___get_p__impl__j57dcl($this).z72_1 = value;
}
function _Size___get_height__impl__a04p02($this) {
return _Size___get_p__impl__j57dcl($this).z72_1;
}
function Size__setTo_impl_hsh4oh($this, width, height) {
_Size___set_width__impl__zhrohf($this, width);
_Size___set_height__impl__5jm1k2($this, height);
return $this;
}
function Size__clone_impl_mab6dt($this) {
return Companion_getInstance_15().u7d(_Size___get_width__impl__58y75t($this), _Size___get_height__impl__a04p02($this));
}
function Size__interpolateWith_impl_e4rw8p($this, ratio, other) {
return Size__setToInterpolated_impl_yxmur2(Companion_getInstance_15().v7d(0, 0), ratio, $this, other);
}
function Size__interpolateWith_impl_e4rw8p_0($this, ratio, other) {
var tmp = $this.w7d_1;
return new Size(Size__interpolateWith_impl_e4rw8p(tmp, ratio, other instanceof Size ? other.w7d_1 : THROW_CCE()));
}
function Size__setToInterpolated_impl_yxmur2($this, ratio, l, r) {
return Size__setTo_impl_hsh4oh($this, interpolate_0(ratio, _Size___get_width__impl__58y75t(l), _Size___get_width__impl__58y75t(r)), interpolate_0(ratio, _Size___get_height__impl__a04p02(l), _Size___get_height__impl__a04p02(r)));
}
function Size__toString_impl_o87ni8($this) {
return 'Size(width=' + get_niceStr(_Size___get_width__impl__58y75t($this)) + ', height=' + get_niceStr(_Size___get_height__impl__a04p02($this)) + ')';
}
function Size__hashCode_impl_2h1qpd($this) {
return $this.hashCode();
}
function Size__equals_impl_gzcc1f($this, other) {
if (!(other instanceof Size))
return false;
var tmp0_other_with_cast = other instanceof Size ? other.w7d_1 : THROW_CCE();
if (!$this.equals(tmp0_other_with_cast))
return false;
return true;
}
function Size(p) {
Companion_getInstance_15();
this.w7d_1 = p;
}
Size.prototype.x7d = function (ratio, other) {
return Size__interpolateWith_impl_e4rw8p(this.w7d_1, ratio, other);
};
Size.prototype.d70 = function (ratio, other) {
return Size__interpolateWith_impl_e4rw8p_0(this, ratio, other);
};
Size.prototype.toString = function () {
return Size__toString_impl_o87ni8(this.w7d_1);
};
Size.prototype.hashCode = function () {
return Size__hashCode_impl_2h1qpd(this.w7d_1);
};
Size.prototype.equals = function (other) {
return Size__equals_impl_gzcc1f(this.w7d_1, other);
};
Size.$metadata$ = classMeta('Size', [MutableInterpolable, Interpolable, ISize, Sizeable]);
function _SizeInt___init__impl__vivn9(size) {
new Size(size);
return size;
}
function _SizeInt___get_size__impl__lherf7($this) {
return $this;
}
function Companion_16() {
Companion_instance_16 = this;
}
Companion_16.prototype.k7d = function () {
return _SizeInt___init__impl__vivn9(Companion_getInstance_15().v7d(0, 0));
};
Companion_16.prototype.y7d = function (x, y) {
return _SizeInt___init__impl__vivn9(Companion_getInstance_15().v7d(x, y));
};
Companion_16.$metadata$ = objectMeta('Companion');
var Companion_instance_16;
function Companion_getInstance_16() {
if (Companion_instance_16 == null)
new Companion_16();
return Companion_instance_16;
}
function SizeInt__clone_impl_5edshq($this) {
return _SizeInt___init__impl__vivn9(Size__clone_impl_mab6dt(_SizeInt___get_size__impl__lherf7($this)));
}
function _SizeInt___set_width__impl__bu2272($this, value) {
_Size___set_width__impl__zhrohf(_SizeInt___get_size__impl__lherf7($this), value);
}
function _SizeInt___get_width__impl__swntg6($this) {
return numberToInt(_Size___get_width__impl__58y75t(_SizeInt___get_size__impl__lherf7($this)));
}
function _SizeInt___set_height__impl__snjoq5($this, value) {
_Size___set_height__impl__5jm1k2(_SizeInt___get_size__impl__lherf7($this), value);
}
function _SizeInt___get_height__impl__d3sy61($this) {
return numberToInt(_Size___get_height__impl__a04p02(_SizeInt___get_size__impl__lherf7($this)));
}
function SizeInt__toString_impl_bou47h($this) {
return 'SizeInt(width=' + _SizeInt___get_width__impl__swntg6($this) + ', height=' + _SizeInt___get_height__impl__d3sy61($this) + ')';
}
function SizeInt__hashCode_impl_xg010c($this) {
return Size__hashCode_impl_2h1qpd($this);
}
function SizeInt__equals_impl_rrt54w($this, other) {
if (!(other instanceof SizeInt))
return false;
var tmp0_other_with_cast = other instanceof SizeInt ? other.z7d_1 : THROW_CCE();
if (!equals($this, tmp0_other_with_cast))
return false;
return true;
}
function SizeInt(size) {
Companion_getInstance_16();
this.z7d_1 = size;
}
SizeInt.prototype.d72 = function () {
return _SizeInt___get_width__impl__swntg6(this.z7d_1);
};
SizeInt.prototype.e72 = function () {
return _SizeInt___get_height__impl__d3sy61(this.z7d_1);
};
SizeInt.prototype.toString = function () {
return SizeInt__toString_impl_bou47h(this.z7d_1);
};
SizeInt.prototype.hashCode = function () {
return SizeInt__hashCode_impl_xg010c(this.z7d_1);
};
SizeInt.prototype.equals = function (other) {
return SizeInt__equals_impl_rrt54w(this.z7d_1, other);
};
SizeInt.$metadata$ = classMeta('SizeInt', [ISizeInt]);
function ISizeInt() {
}
ISizeInt.$metadata$ = interfaceMeta('ISizeInt');
function setTo_1(_this__u8e3s4, width, height) {
_SizeInt___set_width__impl__bu2272(_this__u8e3s4, width);
_SizeInt___set_height__impl__snjoq5(_this__u8e3s4, height);
return _this__u8e3s4;
}
function IVector3() {
}
IVector3.$metadata$ = interfaceMeta('IVector3');
function MVector3() {
}
MVector3.$metadata$ = interfaceMeta('MVector3', [IVector3]);
function Companion_17() {
Companion_instance_17 = this;
}
Companion_17.prototype.a7e = function (x, y, z, w) {
return (new Vector3D()).c7e(x, y, z, w);
};
Companion_17.prototype.d7e = function (x, y, z, w, $mask0, $handler) {
if (!(($mask0 & 8) === 0))
w = 1.0;
return this.a7e(x, y, z, w);
};
Companion_17.$metadata$ = objectMeta('Companion');
var Companion_instance_17;
function Companion_getInstance_17() {
if (Companion_instance_17 == null)
new Companion_17();
return Companion_instance_17;
}
function Vector3D() {
Companion_getInstance_17();
var tmp = this;
var tmp$ret$0;
// Inline function 'kotlin.floatArrayOf' call
tmp$ret$0 = new Float32Array([0.0, 0.0, 0.0, 1.0]);
tmp.b7e_1 = tmp$ret$0;
}
Vector3D.prototype.e7e = function (value) {
this.b7e_1[0] = value;
};
Vector3D.prototype.d1n = function () {
return this.b7e_1[0];
};
Vector3D.prototype.f7e = function (value) {
this.b7e_1[1] = value;
};
Vector3D.prototype.e1n = function () {
return this.b7e_1[1];
};
Vector3D.prototype.g7e = function (value) {
this.b7e_1[2] = value;
};
Vector3D.prototype.h7e = function () {
return this.b7e_1[2];
};
Vector3D.prototype.i7e = function (value) {
this.b7e_1[3] = value;
};
Vector3D.prototype.j7e = function () {
return this.b7e_1[3];
};
Vector3D.prototype.c7e = function (x, y, z, w) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.Vector3D.setTo.<anonymous>' call
this.e7e(x);
this.f7e(y);
this.g7e(z);
this.i7e(w);
tmp$ret$0 = this;
return tmp$ret$0;
};
Vector3D.prototype.equals = function (other) {
var tmp;
var tmp_0;
var tmp_1;
var tmp_2;
if (other instanceof Vector3D) {
tmp_2 = almostEquals(this.d1n(), other.d1n());
} else {
tmp_2 = false;
}
if (tmp_2) {
tmp_1 = almostEquals(this.e1n(), other.e1n());
} else {
tmp_1 = false;
}
if (tmp_1) {
tmp_0 = almostEquals(this.h7e(), other.h7e());
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp = almostEquals(this.j7e(), other.j7e());
} else {
tmp = false;
}
return tmp;
};
Vector3D.prototype.hashCode = function () {
return contentHashCode(this.b7e_1);
};
Vector3D.prototype.toString = function () {
return this.j7e() === 1.0 ? '(' + get_niceStr_0(this.d1n()) + ', ' + get_niceStr_0(this.e1n()) + ', ' + get_niceStr_0(this.h7e()) + ')' : '(' + get_niceStr_0(this.d1n()) + ', ' + get_niceStr_0(this.e1n()) + ', ' + get_niceStr_0(this.h7e()) + ', ' + get_niceStr_0(this.j7e()) + ')';
};
Vector3D.$metadata$ = classMeta('Vector3D', [MVector3]);
function IVectorArrayList() {
}
IVectorArrayList.$metadata$ = interfaceMeta('IVectorArrayList', [Extra]);
function appendGenericArray(_this__u8e3s4, size, appendElement) {
_this__u8e3s4.gc('[');
var inductionVariable = 0;
if (inductionVariable < size)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
if (!(n === 0)) {
_this__u8e3s4.gc(', ');
}
appendElement(_this__u8e3s4, n);
}
while (inductionVariable < size);
_this__u8e3s4.gc(']');
}
function VectorArrayList_init_$Init$(dimensions, capacity, $mask0, $marker, $this) {
if (!(($mask0 & 2) === 0))
capacity = 7;
VectorArrayList.call($this, dimensions, capacity);
return $this;
}
function VectorArrayList_init_$Create$(dimensions, capacity, $mask0, $marker) {
return VectorArrayList_init_$Init$(dimensions, capacity, $mask0, $marker, Object.create(VectorArrayList.prototype));
}
function checkDimensions($this, dim) {
if (!(dim === $this.k7e_1)) {
// Inline function 'kotlin.error' call
var tmp0_error = 'Invalid dimensions ' + dim + ' != ' + $this.k7e_1;
throw IllegalStateException_init_$Create$(toString(tmp0_error));
}
}
function VectorArrayList$vectorToStringBuilder$lambda(this$0, $index) {
return function ($this$appendGenericArray, it) {
appendNice($this$appendGenericArray, this$0.l78($index, it));
return Unit_getInstance();
};
}
function VectorArrayList(dimensions, capacity) {
this.k7e_1 = dimensions;
var tmp = this;
tmp.l7e_1 = Mixin_init_$Create$(null, 1, null);
this.m7e_1 = new DoubleArrayList(imul(capacity, this.k7e_1));
this.n7e_1 = false;
}
VectorArrayList.prototype.m7b = function () {
return this.k7e_1;
};
VectorArrayList.prototype.e4v = function (_set____db54di) {
this.l7e_1.e4v(_set____db54di);
};
VectorArrayList.prototype.f4v = function () {
return this.l7e_1.f4v();
};
VectorArrayList.prototype.s3l = function () {
return this.m7e_1;
};
VectorArrayList.prototype.i = function () {
return this.m7e_1.i() / this.k7e_1 | 0;
};
VectorArrayList.prototype.l78 = function (index, dim) {
return this.m7e_1.m(imul(index, this.k7e_1) + dim | 0);
};
VectorArrayList.prototype.n4n = function (v0, v1) {
var tmp$ret$0;
// Inline function 'kotlin.also' call
checkDimensions(this, 2);
var tmp0_also = Unit_getInstance();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.VectorArrayList.add.<anonymous>' call
this.m7e_1.n4n(v0, v1);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
};
VectorArrayList.prototype.p4n = function (v0, v1, v2, v3, v4, v5) {
var tmp$ret$0;
// Inline function 'kotlin.also' call
checkDimensions(this, 6);
var tmp0_also = Unit_getInstance();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.VectorArrayList.add.<anonymous>' call
this.m7e_1.p4n(v0, v1, v2, v3, v4, v5);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
};
VectorArrayList.prototype.o7e = function (index, out) {
appendGenericArray(out, this.k7e_1, VectorArrayList$vectorToStringBuilder$lambda(this, index));
};
VectorArrayList.prototype.equals = function (other) {
var tmp;
var tmp_0;
if (other instanceof VectorArrayList) {
tmp_0 = this.k7e_1 === other.k7e_1;
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp = this.m7e_1.equals(other.m7e_1);
} else {
tmp = false;
}
return tmp;
};
VectorArrayList.prototype.hashCode = function () {
return this.m7e_1.hashCode();
};
VectorArrayList.prototype.toString = function () {
var tmp$ret$1;
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'kotlin.apply' call
var tmp0_apply = StringBuilder_init_$Create$();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.VectorArrayList.toString.<anonymous>' call
tmp0_apply.gc('VectorArrayList[' + this.i() + '](\n');
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
if (!(n === 0)) {
tmp0_apply.gc(', \n');
}
tmp0_apply.gc(' ');
this.o7e(n, tmp0_apply);
}
while (inductionVariable < last);
tmp0_apply.gc('\n)');
tmp$ret$0 = tmp0_apply;
tmp$ret$1 = tmp$ret$0.toString();
return tmp$ret$1;
};
VectorArrayList.$metadata$ = classMeta('VectorArrayList', [IVectorArrayList, Extra]);
function fastForEachGeneric(_this__u8e3s4, block) {
var inductionVariable = 0;
var last = _this__u8e3s4.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
block(_this__u8e3s4, n);
}
while (inductionVariable < last);
}
function Arc() {
Arc_instance = this;
this.p7e_1 = 0.5522847498307933;
}
Arc.prototype.q7e = function (out, ax, ay, cx, cy, r) {
if (isEmpty(out)) {
out.r7e(ax, ay);
}
var bx = out.s7e();
var by = out.t7e();
var b = Companion_getInstance_7().z79(bx, by);
var a = Companion_getInstance_7().z79(ax, ay);
var c = Companion_getInstance_7().z79(cx, cy);
var AB = minus_0(b, a);
var AC = minus_0(c, a);
var angle = _Angle___get_radians__impl__n00yt5(Companion_getInstance_8().f7a(AB, AC)) * 0.5;
var tmp$ret$0;
// Inline function 'kotlin.math.sin' call
var tmp0_sin = get_PI() / 2.0 - angle;
tmp$ret$0 = Math.sin(tmp0_sin);
var tmp = r * tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.sin' call
tmp$ret$1 = Math.sin(angle);
var x = tmp / tmp$ret$1;
var A = plus_1(a, times_1(get_unit(AB), x));
var B = plus_1(a, times_1(get_unit(AC), x));
out.u7e(A.d1n(), A.e1n());
out.v7e(a.d1n(), a.e1n(), B.d1n(), B.e1n());
};
Arc.prototype.w7e = function (out, x, y, r, start, end, counterclockwise) {
var startAngle = get_normalized(start);
var endAngle1 = get_normalized(end);
var tmp;
if (Angle__compareTo_impl_a0hfds(endAngle1, startAngle) < 0) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.FULL' call
var tmp0__get_FULL__7sbe02 = Companion_getInstance_0();
tmp$ret$0 = tmp0__get_FULL__7sbe02.f70(1.0);
tmp = plus_0(endAngle1, tmp$ret$0);
} else {
tmp = endAngle1;
}
var endAngle = tmp;
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.min' call
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.FULL' call
var tmp1__get_FULL__9x62v5 = Companion_getInstance_0();
tmp$ret$1 = tmp1__get_FULL__9x62v5.f70(1.0);
var tmp3_min = tmp$ret$1;
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.abs' call
var tmp2_abs = minus(endAngle, startAngle);
var tmp_0 = Companion_getInstance_0();
var tmp$ret$2;
// Inline function 'kotlin.math.absoluteValue' call
var tmp0__get_absoluteValue__nukmtt = _Angle___get_ratio__impl__ap3on4(tmp2_abs);
tmp$ret$2 = Math.abs(tmp0__get_absoluteValue__nukmtt);
tmp$ret$3 = tmp_0.f70(tmp$ret$2);
var tmp4_min = tmp$ret$3;
var tmp_1 = Companion_getInstance_0();
var tmp$ret$4;
// Inline function 'kotlin.math.min' call
var tmp0_min = _Angle___get_ratio__impl__ap3on4(tmp3_min);
var tmp1_min = _Angle___get_ratio__impl__ap3on4(tmp4_min);
tmp$ret$4 = Math.min(tmp0_min, tmp1_min);
tmp$ret$5 = tmp_1.f70(tmp$ret$4);
var remainingAngle = tmp$ret$5;
var tmp_2;
var tmp_3 = get_absoluteValue(remainingAngle);
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.Companion.EPSILON' call
var tmp5__get_EPSILON__8cxhty = Companion_getInstance_0();
tmp$ret$6 = tmp5__get_EPSILON__8cxhty.f70(1.0E-5);
if (Angle__compareTo_impl_a0hfds(tmp_3, tmp$ret$6) < 0) {
tmp_2 = !equals(start, end);
} else {
tmp_2 = false;
}
if (tmp_2) {
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.Companion.FULL' call
var tmp6__get_FULL__klfj6k = Companion_getInstance_0();
tmp$ret$7 = tmp6__get_FULL__klfj6k.f70(1.0);
remainingAngle = tmp$ret$7;
}
var sgn1 = Angle__compareTo_impl_a0hfds(startAngle, endAngle) < 0 ? 1 : -1;
var sgn = counterclockwise ? -sgn1 | 0 : sgn1;
if (counterclockwise) {
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.Companion.FULL' call
var tmp7__get_FULL__mqa81n = Companion_getInstance_0();
tmp$ret$8 = tmp7__get_FULL__mqa81n.f70(1.0);
remainingAngle = minus(tmp$ret$8, remainingAngle);
var tmp_4;
var tmp_5 = get_absoluteValue(remainingAngle);
var tmp$ret$9;
// Inline function 'com.soywiz.korma.geom.Companion.EPSILON' call
var tmp8__get_EPSILON__c4hn49 = Companion_getInstance_0();
tmp$ret$9 = tmp8__get_EPSILON__c4hn49.f70(1.0E-5);
if (Angle__compareTo_impl_a0hfds(tmp_5, tmp$ret$9) < 0) {
tmp_4 = !equals(start, end);
} else {
tmp_4 = false;
}
if (tmp_4) {
var tmp$ret$10;
// Inline function 'com.soywiz.korma.geom.Companion.FULL' call
var tmp9__get_FULL__qzzlrt = Companion_getInstance_0();
tmp$ret$10 = tmp9__get_FULL__qzzlrt.f70(1.0);
remainingAngle = tmp$ret$10;
}
}
var a1 = startAngle;
var index = 0;
$l$loop: while (true) {
var tmp_6 = remainingAngle;
var tmp$ret$11;
// Inline function 'com.soywiz.korma.geom.Companion.EPSILON' call
var tmp10__get_EPSILON__rfdn9e = Companion_getInstance_0();
tmp$ret$11 = tmp10__get_EPSILON__rfdn9e.f70(1.0E-5);
if (!(Angle__compareTo_impl_a0hfds(tmp_6, tmp$ret$11) > 0)) {
break $l$loop;
}
var tmp_7 = a1;
var tmp$ret$14;
// Inline function 'com.soywiz.korma.geom.min' call
var tmp12_min = remainingAngle;
var tmp$ret$12;
// Inline function 'com.soywiz.korma.geom.Companion.QUARTER' call
var tmp11__get_QUARTER__hsqy0z = Companion_getInstance_0();
tmp$ret$12 = tmp11__get_QUARTER__hsqy0z.f70(0.25);
var tmp13_min = tmp$ret$12;
var tmp_8 = Companion_getInstance_0();
var tmp$ret$13;
// Inline function 'kotlin.math.min' call
var tmp0_min_0 = _Angle___get_ratio__impl__ap3on4(tmp12_min);
var tmp1_min_0 = _Angle___get_ratio__impl__ap3on4(tmp13_min);
tmp$ret$13 = Math.min(tmp0_min_0, tmp1_min_0);
tmp$ret$14 = tmp_8.f70(tmp$ret$13);
var a2 = plus_0(tmp_7, times_0(tmp$ret$14, sgn));
var a = div_0(minus(a2, a1), 2.0);
var x4 = r * get_cosine(a);
var y4 = r * get_sine(a);
var x1 = x4;
var y1 = -y4;
var f = 0.5522847498307933 * get_tangent(a);
var x2 = x1 + f * y4;
var y2 = y1 + f * x4;
var x3 = x2;
var y3 = -y2;
var ar = plus_0(a, a1);
var cos_ar = get_cosine(ar);
var sin_ar = get_sine(ar);
if (index === 0) {
out.r7e(x + r * get_cosine(a1), y + r * get_sine(a1));
}
out.x7e(x + x2 * cos_ar - y2 * sin_ar, y + x2 * sin_ar + y2 * cos_ar, x + x3 * cos_ar - y3 * sin_ar, y + x3 * sin_ar + y3 * cos_ar, x + r * get_cosine(a2), y + r * get_sine(a2));
var tmp0 = index;
index = tmp0 + 1 | 0;
var tmp_9 = remainingAngle;
var tmp$ret$16;
// Inline function 'com.soywiz.korma.geom.abs' call
var tmp14_abs = minus(a2, a1);
var tmp_10 = Companion_getInstance_0();
var tmp$ret$15;
// Inline function 'kotlin.math.absoluteValue' call
var tmp0__get_absoluteValue__nukmtt_0 = _Angle___get_ratio__impl__ap3on4(tmp14_abs);
tmp$ret$15 = Math.abs(tmp0__get_absoluteValue__nukmtt_0);
tmp$ret$16 = tmp_10.f70(tmp$ret$15);
remainingAngle = minus(tmp_9, tmp$ret$16);
a1 = a2;
}
if (equals(startAngle, endAngle) ? !(index === 0) : false) {
out.x2c();
}
};
Arc.$metadata$ = objectMeta('Arc');
var Arc_instance;
function Arc_getInstance() {
if (Arc_instance == null)
new Arc();
return Arc_instance;
}
function Bezier$Extrema$allt$delegate$lambda(this$0) {
return function () {
return combineSmallDistinctSorted(Companion_getInstance_18(), this$0.y7e_1, this$0.z7e_1);
};
}
function Bezier$Extrema$xt01$delegate$lambda(this$0) {
return function () {
var tmp$ret$0;
// Inline function 'kotlin.doubleArrayOf' call
var tmp0_doubleArrayOf = primitiveArrayConcat([new Float64Array([0.0]), this$0.y7e_1, new Float64Array([1.0])]);
tmp$ret$0 = tmp0_doubleArrayOf;
return tmp$ret$0;
};
}
function Bezier$Extrema$yt01$delegate$lambda(this$0) {
return function () {
var tmp$ret$0;
// Inline function 'kotlin.doubleArrayOf' call
var tmp0_doubleArrayOf = primitiveArrayConcat([new Float64Array([0.0]), this$0.z7e_1, new Float64Array([1.0])]);
tmp$ret$0 = tmp0_doubleArrayOf;
return tmp$ret$0;
};
}
function map($this, v, ds, de, ts, te) {
return convertRange(v, ds, de, ts, te);
}
function compute($this, t, points, out) {
var p = points;
var order = p.i() - 1 | 0;
if (t === 0.0)
return getPoint(p, 0, out);
if (t === 1.0)
return getPoint(p, order, out);
if (order === 0)
return getPoint(p, 0, out);
var mt = 1 - t;
var mt2 = mt * mt;
var t2 = t * t;
var tmp0_subject = order;
var tmp;
switch (tmp0_subject) {
case 1:
tmp = out.a73(mt * p.p71(0) + t * p.p71(1), mt * p.q71(0) + t * p.q71(1));
break;
case 2:
var a = mt2;
var b = mt * t * 2;
var c = t2;
tmp = out.a73(a * p.p71(0) + b * p.p71(1) + c * p.p71(2), a * p.q71(0) + b * p.q71(1) + c * p.q71(2));
break;
case 3:
var a_0 = mt2 * mt;
var b_0 = mt2 * t * 3;
var c_0 = mt * t2 * 3;
var d = t * t2;
tmp = out.a73(a_0 * p.p71(0) + b_0 * p.p71(1) + c_0 * p.p71(2) + d * p.p71(3), a_0 * p.q71(0) + b_0 * p.q71(1) + c_0 * p.q71(2) + d * p.q71(3));
break;
default:
throw new NotImplementedError('An operation is not implemented: higher order curves');
}
return tmp;
}
function derive($this, points) {
var tmp$ret$0;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$0 = ArrayList_init_$Create$();
var out = tmp$ret$0;
var current = points;
while (current.i() >= 2) {
var new_0 = new PointArrayList(current.i() - 1 | 0);
var c = current.i() - 1 | 0;
var inductionVariable = 0;
var last = current.i() - 1 | 0;
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
new_0.m71(c * (current.p71(n + 1 | 0) - current.p71(n)), c * (current.q71(n + 1 | 0) - current.q71(n)));
}
while (inductionVariable < last);
out.c(new_0);
current = new_0;
}
return out;
}
function align($this, points, line, out) {
var p1 = line.n72_1;
var p2 = line.o72_1;
var tx = p1.y72_1;
var ty = p1.z72_1;
var tmp$ret$0;
// Inline function 'kotlin.math.atan2' call
var tmp0_atan2 = p2.z72_1 - ty;
var tmp1_atan2 = p2.y72_1 - tx;
tmp$ret$0 = Math.atan2(tmp0_atan2, tmp1_atan2);
var a = -tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.fastForEach' call
var inductionVariable = 0;
var last = points.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.align.<anonymous>' call
var tmp2__anonymous__z9zvc9 = points.p71(n);
var tmp3__anonymous__ufb84q = points.q71(n);
var tmp = tmp2__anonymous__z9zvc9 - tx;
var tmp$ret$1;
// Inline function 'kotlin.math.cos' call
tmp$ret$1 = Math.cos(a);
var tmp_0 = tmp * tmp$ret$1;
var tmp_1 = tmp3__anonymous__ufb84q - ty;
var tmp$ret$2;
// Inline function 'kotlin.math.sin' call
tmp$ret$2 = Math.sin(a);
var tmp_2 = tmp_0 - tmp_1 * tmp$ret$2;
var tmp_3 = tmp2__anonymous__z9zvc9 - tx;
var tmp$ret$3;
// Inline function 'kotlin.math.sin' call
tmp$ret$3 = Math.sin(a);
var tmp_4 = tmp_3 * tmp$ret$3;
var tmp_5 = tmp3__anonymous__ufb84q - ty;
var tmp$ret$4;
// Inline function 'kotlin.math.cos' call
tmp$ret$4 = Math.cos(a);
out.m71(tmp_2, tmp_4 + tmp_5 * tmp$ret$4);
}
while (inductionVariable < last);
return out;
}
function droots($this, p) {
var tmp0_subject = p.length;
switch (tmp0_subject) {
case 3:
var a = p[0];
var b = p[1];
var c = p[2];
var d = a - 2 * b + c;
if (!(d === 0.0)) {
var tmp$ret$0;
// Inline function 'kotlin.math.sqrt' call
var tmp0_sqrt = b * b - a * c;
tmp$ret$0 = Math.sqrt(tmp0_sqrt);
var m1 = -tmp$ret$0;
var m2 = -a + b;
var v1 = -(m1 + m2) / d;
var v2 = -(-m1 + m2) / d;
return doubleArrayOfValid01$default($this, v1, v2, 0.0, 8, null);
} else if (!(b === c) ? d === 0.0 : false) {
var tmp = (2.0 * b - c) / (2.0 * (b - c));
return doubleArrayOfValid01$default($this, tmp, 0.0, 0.0, 12, null);
}
break;
case 2:
var a_0 = p[0];
var b_0 = p[1];
if (!(a_0 === b_0)) {
var tmp_0 = a_0 / (a_0 - b_0);
return doubleArrayOfValid01$default($this, tmp_0, 0.0, 0.0, 12, null);
}
break;
default:
break;
}
return doubleArrayOfValid01$default($this, 0.0, 0.0, 0.0, 14, null);
}
function doubleArrayOfValid01($this, v1, v2, v3) {
var v1Valid = 0.0 <= v1 ? v1 <= 1.0 : false;
var v2Valid = 0.0 <= v2 ? v2 <= 1.0 : false;
var v3Valid = 0.0 <= v3 ? v3 <= 1.0 : false;
var validCount = 0;
if (v1Valid) {
var tmp0 = validCount;
validCount = tmp0 + 1 | 0;
}
if (v2Valid) {
var tmp1 = validCount;
validCount = tmp1 + 1 | 0;
}
if (v3Valid) {
var tmp2 = validCount;
validCount = tmp2 + 1 | 0;
}
if (validCount === 0)
return $this.h7f_1;
var index = 0;
var out = new Float64Array(validCount);
if (v1Valid) {
var tmp3 = index;
index = tmp3 + 1 | 0;
out[tmp3] = normalizeZero(v1);
}
if (v2Valid) {
var tmp4 = index;
index = tmp4 + 1 | 0;
out[tmp4] = normalizeZero(v2);
}
if (v3Valid) {
var tmp5 = index;
index = tmp5 + 1 | 0;
out[tmp5] = normalizeZero(v3);
}
return out;
}
function doubleArrayOfValid01$default($this, v1, v2, v3, $mask0, $handler) {
if (!(($mask0 & 2) === 0)) {
DoubleCompanionObject_getInstance();
v1 = NaN;
}
if (!(($mask0 & 4) === 0)) {
DoubleCompanionObject_getInstance();
v2 = NaN;
}
if (!(($mask0 & 8) === 0)) {
DoubleCompanionObject_getInstance();
v3 = NaN;
}
return doubleArrayOfValid01($this, v1, v2, v3);
}
function combineSmallDistinctSorted($this, a, b) {
var out = new DoubleArrayList(a.length + b.length | 0);
out.k4n(a, 0, 0, 6, null);
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var n = 0;
while (n < b.length) {
// Inline function 'com.soywiz.korma.geom.bezier.Companion.combineSmallDistinctSorted.<anonymous>' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0__anonymous__q1qw7t = b[tmp0];
if (!out.jb(tmp0__anonymous__q1qw7t)) {
out.m4n(tmp0__anonymous__q1qw7t);
}
}
sort$default(out, 0, 0, false, 7, null);
return out.y4n();
}
function Bezier_init_$Init$(points, $this) {
Bezier.call($this, Companion_getInstance_10().t7b(points.slice()));
return $this;
}
function Bezier_init_$Create$(points) {
return Bezier_init_$Init$(points, Object.create(Bezier.prototype));
}
function Bezier_init_$Init$_0(points, $this) {
Bezier.call($this, Companion_getInstance_10().q7b(points.slice()));
return $this;
}
function Bezier_init_$Create$_0(points) {
return Bezier_init_$Init$_0(points, Object.create(Bezier.prototype));
}
function _get_aligned__7fjidv($this) {
if ($this.p7f_1)
return $this.s7f_1;
$this.p7f_1 = true;
$this.s7f_1.zl();
align(Companion_getInstance_18(), $this.h7c(), Line_init_$Create$_0(get_firstX($this.h7c()), get_firstY($this.h7c()), get_lastX($this.h7c()), get_lastY($this.h7c())), $this.s7f_1);
return $this.s7f_1;
}
function _getBoundingBox($this, out, m) {
var xmin = 0.0;
var ymin = 0.0;
var xmax = 0.0;
var ymax = 0.0;
var inductionVariable = 0;
if (inductionVariable <= 1)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ext = $this.c7g().d7g(n);
DoubleCompanionObject_getInstance();
var min = Infinity;
DoubleCompanionObject_getInstance();
var max = -Infinity;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var n_0 = 0;
while (n_0 < ext.length) {
// Inline function 'com.soywiz.korma.geom.bezier.Bezier._getBoundingBox.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp0__anonymous__q1qw7t = ext[tmp0];
var p = $this.e7g(tmp0__anonymous__q1qw7t, null, 2, null);
var tmp0_subject = n;
var value = tmp0_subject === 0 ? transformX(p, m) : transformY(p, m);
var tmp$ret$0;
// Inline function 'kotlin.math.min' call
var tmp0_min = min;
tmp$ret$0 = Math.min(tmp0_min, value);
min = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
var tmp1_max = max;
tmp$ret$1 = Math.max(tmp1_max, value);
max = tmp$ret$1;
}
if (n === 0) {
xmin = min;
xmax = max;
} else {
ymin = min;
ymax = max;
}
}
while (inductionVariable <= 1);
out.z71(xmin, ymin, xmax, ymax);
return out;
}
function _get__lut__d2qf0f($this) {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = _lut$factory();
tmp$ret$0 = $this.z7f_1.l1();
return tmp$ret$0;
}
function Extrema(xt, yt) {
this.y7e_1 = xt;
this.z7e_1 = yt;
var tmp = this;
tmp.a7f_1 = lazy(Bezier$Extrema$allt$delegate$lambda(this));
var tmp_0 = this;
tmp_0.b7f_1 = lazy(Bezier$Extrema$xt01$delegate$lambda(this));
var tmp_1 = this;
tmp_1.c7f_1 = lazy(Bezier$Extrema$yt01$delegate$lambda(this));
}
Extrema.prototype.f7g = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = xt01$factory();
tmp$ret$0 = this.b7f_1.l1();
return tmp$ret$0;
};
Extrema.prototype.g7g = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = yt01$factory();
tmp$ret$0 = this.c7f_1.l1();
return tmp$ret$0;
};
Extrema.prototype.d7g = function (index) {
return index === 0 ? this.f7g() : this.g7g();
};
Extrema.prototype.equals = function (other) {
var tmp;
var tmp_0;
if (other instanceof Extrema) {
tmp_0 = contentEquals_0(this.y7e_1, other.y7e_1);
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp = contentEquals_0(this.z7e_1, other.z7e_1);
} else {
tmp = false;
}
return tmp;
};
Extrema.prototype.hashCode = function () {
return contentHashCode_0(this.y7e_1) + imul(contentHashCode_0(this.z7e_1), 7) | 0;
};
Extrema.prototype.toString = function () {
return 'Extrema(x=' + contentToString(this.y7e_1) + ', y=' + contentToString(this.z7e_1) + ')';
};
Extrema.$metadata$ = classMeta('Extrema');
function Companion_18() {
Companion_instance_18 = this;
var tmp = this;
var tmp$ret$0;
// Inline function 'kotlin.doubleArrayOf' call
tmp$ret$0 = new Float64Array([-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]);
tmp.d7f_1 = tmp$ret$0;
var tmp_0 = this;
var tmp$ret$1;
// Inline function 'kotlin.doubleArrayOf' call
tmp$ret$1 = new Float64Array([0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]);
tmp_0.e7f_1 = tmp$ret$1;
this.f7f_1 = 6.283185307179586;
this.g7f_1 = Line_init_$Create$_1(0, 0, 1, 0);
this.h7f_1 = new Float64Array(0);
}
Companion_18.prototype.h7g = function (x0, y0, xc, yc, x1, y1, t, emit) {
// Inline function 'kotlin.contracts.contract' call
var t1 = 1 - t;
var a = t1 * t1;
var c = t * t;
var b = 2 * t1 * t;
return emit(a * x0 + b * xc + c * x1, a * y0 + b * yc + c * y1);
};
Companion_18.prototype.i7g = function (x0, y0, x1, y1, x2, y2, x3, y3, t, emit) {
// Inline function 'kotlin.contracts.contract' call
var cx = 3.0 * (x1 - x0);
var bx = 3.0 * (x2 - x1) - cx;
var ax = x3 - x0 - cx - bx;
var cy = 3.0 * (y1 - y0);
var by = 3.0 * (y2 - y1) - cy;
var ay = y3 - y0 - cy - by;
var tSquared = t * t;
var tCubed = tSquared * t;
return emit(ax * tCubed + bx * tSquared + cx * t + x0, ay * tCubed + by * tSquared + cy * t + y0);
};
Companion_18.prototype.j7g = function (x0, y0, x1, y1, x2, y2, x3, y3, t, target) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
// Inline function 'kotlin.contracts.contract' call
var cx = 3.0 * (x1 - x0);
var bx = 3.0 * (x2 - x1) - cx;
var ax = x3 - x0 - cx - bx;
var cy = 3.0 * (y1 - y0);
var by = 3.0 * (y2 - y1) - cy;
var ay = y3 - y0 - cy - by;
var tSquared = t * t;
var tCubed = tSquared * t;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc.<anonymous>' call
var tmp0__anonymous__q1qw7t = ax * tCubed + bx * tSquared + cx * t + x0;
var tmp1__anonymous__uwfjfc = ay * tCubed + by * tSquared + cy * t + y0;
tmp$ret$0 = target.a73(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Companion_18.prototype.k7g = function (x0, y0, xc, yc, x1, y1, t, target) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
// Inline function 'kotlin.contracts.contract' call
var t1 = 1 - t;
var a = t1 * t1;
var c = t * t;
var b = 2 * t1 * t;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc.<anonymous>' call
var tmp0__anonymous__q1qw7t = a * x0 + b * xc + c * x1;
var tmp1__anonymous__uwfjfc = a * y0 + b * yc + c * y1;
tmp$ret$0 = target.a73(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Companion_18.prototype.l7g = function (v0, v1) {
return v0 + (v1 - v0) * 0.6666666666666666;
};
Companion_18.prototype.m7g = function (v1, v2) {
return v2 + (v1 - v2) * 0.6666666666666666;
};
Companion_18.prototype.n7g = function (x0, y0, xc, yc, x1, y1, bezier) {
// Inline function 'kotlin.contracts.contract' call
return bezier(x0, y0, this.l7g(x0, xc), this.l7g(y0, yc), this.m7g(xc, x1), this.m7g(yc, y1), x1, y1);
};
Companion_18.$metadata$ = objectMeta('Companion');
var Companion_instance_18;
function Companion_getInstance_18() {
if (Companion_instance_18 == null)
new Companion_18();
return Companion_instance_18;
}
function Bezier$_lut$delegate$lambda(this$0) {
return function () {
return CurveLUT_init_$Create$(this$0, 101);
};
}
function Bezier(points) {
Companion_getInstance_18();
this.i7f_1 = (new PointArrayList(points.i())).x7b(points);
if (points.i() > 4) {
// Inline function 'kotlin.error' call
throw IllegalStateException_init_$Create$('Only supports quad and cubic beziers');
}
this.j7f_1 = false;
this.k7f_1 = false;
this.l7f_1 = false;
this.m7f_1 = false;
this.n7f_1 = false;
this.o7f_1 = false;
this.p7f_1 = false;
this.q7f_1 = false;
this.r7f_1 = false;
this.s7f_1 = new PointArrayList(points.i());
this.t7f_1 = emptyList();
var tmp = this;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp0__get_ZERO__8316ll = Companion_getInstance_0();
tmp$ret$0 = tmp0__get_ZERO__8316ll.f70(0.0);
tmp.u7f_1 = tmp$ret$0;
this.v7f_1 = new Extrema(Companion_getInstance_18().h7f_1, Companion_getInstance_18().h7f_1);
this.w7f_1 = Companion_getInstance_12().zp();
this.x7f_1 = Companion_getInstance_8().zp();
var tmp_0 = this;
DoubleCompanionObject_getInstance();
tmp_0.y7f_1 = NaN;
var tmp_1 = this;
tmp_1.z7f_1 = lazy(Bezier$_lut$delegate$lambda(this));
this.a7g_1 = false;
this.b7g_1 = false;
}
Bezier.prototype.h7c = function () {
return this.i7f_1;
};
Bezier.prototype.a72 = function (target) {
return target.u7c(this.o7g());
};
Bezier.prototype.p7g = function (target, m) {
return _getBoundingBox(this, target, m);
};
Bezier.prototype.q7g = function (t, target) {
this.r7g(t, target);
return target;
};
Bezier.prototype.equals = function (other) {
var tmp;
if (other instanceof Bezier) {
tmp = equals(this.h7c(), other.h7c());
} else {
tmp = false;
}
return tmp;
};
Bezier.prototype.hashCode = function () {
return hashCode(this.h7c());
};
Bezier.prototype.toString = function () {
return 'Bezier(' + this.h7c() + ')';
};
Bezier.prototype.t7g = function () {
return 2;
};
Bezier.prototype.u7g = function () {
return this.h7c().i() - 1 | 0;
};
Bezier.prototype.v7g = function () {
if (this.q7f_1)
return this.t7f_1;
this.q7f_1 = true;
this.t7f_1 = derive(Companion_getInstance_18(), this.h7c());
return this.t7f_1;
};
Bezier.prototype.c7g = function () {
if (this.r7f_1)
return this.v7f_1;
this.r7f_1 = true;
var tmp$ret$2;
// Inline function 'kotlin.collections.map' call
var tmp0_map = until(0, this.t7g());
var tmp$ret$1;
// Inline function 'kotlin.collections.mapTo' call
var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
var inductionVariable = tmp0_map.r1_1;
var last = tmp0_map.s1_1;
if (inductionVariable <= last)
do {
var item = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Bezier.<get-extrema>.<anonymous>' call
var tmp = Companion_getInstance_18();
var tmp_0 = this.v7g().m(0);
var out = droots(tmp, getComponentList$default(tmp_0, item, null, 2, null));
if (this.u7g() === 3) {
var tmp_1 = Companion_getInstance_18();
var tmp_2 = out;
var tmp_3 = Companion_getInstance_18();
var tmp_4 = this.v7g().m(1);
out = combineSmallDistinctSorted(tmp_1, tmp_2, droots(tmp_3, getComponentList$default(tmp_4, item, null, 2, null)));
}
tmp$ret$0 = out;
tmp0_mapTo.c(tmp$ret$0);
}
while (!(item === last));
tmp$ret$1 = tmp0_mapTo;
tmp$ret$2 = tmp$ret$1;
var out_0 = tmp$ret$2;
this.v7f_1 = new Extrema(out_0.m(0), out_0.m(1));
return this.v7f_1;
};
Bezier.prototype.o7g = function () {
if (this.j7f_1)
return this.w7f_1;
this.j7f_1 = true;
_getBoundingBox(this, this.w7f_1, null);
return this.w7f_1;
};
Bezier.prototype.ze = function () {
if (this.l7f_1)
return this.y7f_1;
this.l7f_1 = true;
var z = 0.5;
var sum = 0.0;
var inductionVariable = 0;
var last = Companion_getInstance_18().d7f_1.length - 1 | 0;
if (inductionVariable <= last)
do {
var i = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var t = z * Companion_getInstance_18().d7f_1[i] + z;
this.w7g(t, false, this.x7f_1, 2, null);
sum = sum + Companion_getInstance_18().e7f_1[i] * this.x7f_1.ze();
}
while (inductionVariable <= last);
this.y7f_1 = z * sum;
return this.y7f_1;
};
Bezier.prototype.x7g = function () {
if (this.m7f_1)
return _get__lut__d2qf0f(this);
this.m7f_1 = true;
this.y7g(0, _get__lut__d2qf0f(this), 1, null);
return _get__lut__d2qf0f(this);
};
Bezier.prototype.z7g = function (length) {
var tmp = this.x7g();
return tmp.j7h(length, null, 2, null).b7h_1;
};
Bezier.prototype.k7h = function (steps, out) {
out.x7();
var inductionVariable = 0;
if (inductionVariable <= steps)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var t = n / steps;
this.r7g(t, out.h7h_1);
out.l7h(t, out.h7h_1);
}
while (!(n === steps));
return out;
};
Bezier.prototype.m7h = function () {
if (this.h7c().i() < 4) {
var tmp$ret$0;
// Inline function 'kotlin.doubleArrayOf' call
tmp$ret$0 = new Float64Array([]);
return tmp$ret$0;
}
var p = _get_aligned__7fjidv(this);
var a = p.p71(2) * p.q71(1);
var b = p.p71(3) * p.q71(1);
var c = p.p71(1) * p.q71(2);
var d = p.p71(3) * p.q71(2);
var v1 = 18.0 * (-3.0 * a + 2.0 * b + 3.0 * c - d);
var v2 = 18.0 * (3.0 * a - b - 3.0 * c);
var v3 = 18.0 * (c - a);
if (isAlmostEquals$default(v1, 0.0, 0.0, 2, null)) {
if (!isAlmostEquals$default(v2, 0.0, 0.0, 2, null)) {
var t = -v3 / v2;
if (0.0 <= t ? t <= 1.0 : false) {
var tmp$ret$1;
// Inline function 'kotlin.doubleArrayOf' call
tmp$ret$1 = new Float64Array([t]);
return tmp$ret$1;
}
}
var tmp$ret$2;
// Inline function 'kotlin.doubleArrayOf' call
tmp$ret$2 = new Float64Array([]);
return tmp$ret$2;
}
var d2 = 2.0 * v1;
if (isAlmostEquals$default(d2, 0.0, 0.0, 2, null)) {
var tmp$ret$3;
// Inline function 'kotlin.doubleArrayOf' call
tmp$ret$3 = new Float64Array([]);
return tmp$ret$3;
}
var trm = v2 * v2 - 4.0 * v1 * v3;
if (trm < 0.0) {
var tmp$ret$4;
// Inline function 'kotlin.doubleArrayOf' call
tmp$ret$4 = new Float64Array([]);
return tmp$ret$4;
}
var tmp$ret$5;
// Inline function 'kotlin.math.sqrt' call
tmp$ret$5 = Math.sqrt(trm);
var sq = tmp$ret$5;
var tmp$ret$8;
// Inline function 'kotlin.collections.filter' call
var tmp0_filter = listOf([(sq - v2) / d2, -(v2 + sq) / d2]);
var tmp$ret$7;
// Inline function 'kotlin.collections.filterTo' call
var tmp0_filterTo = ArrayList_init_$Create$();
var tmp0_iterator = tmp0_filter.j();
while (tmp0_iterator.k()) {
var element = tmp0_iterator.l();
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.bezier.Bezier.inflections.<anonymous>' call
tmp$ret$6 = 0.0 <= element ? element <= 1.0 : false;
if (tmp$ret$6) {
tmp0_filterTo.c(element);
}
}
tmp$ret$7 = tmp0_filterTo;
tmp$ret$8 = tmp$ret$7;
return toDoubleArray(tmp$ret$8);
};
Bezier.prototype.r7g = function (t, out) {
return compute(Companion_getInstance_18(), t, this.h7c(), out);
};
Bezier.prototype.n7h = function (t, normalize, out) {
compute(Companion_getInstance_18(), t, this.v7g().m(0), out);
if ((t === 0.0 ? true : t === 1.0) ? isAlmostZero(out.a7b()) : false) {
var inductionVariable = 0;
if (inductionVariable < 10)
$l$loop: do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var tmp$ret$0;
// Inline function 'kotlin.math.pow' call
var tmp0_pow = -(10 - n | 0) | 0;
tmp$ret$0 = Math.pow(10.0, tmp0_pow);
var newT = tmp$ret$0;
var nt = t === 1.0 ? 1.0 - newT : newT;
compute(Companion_getInstance_18(), nt, this.v7g().m(0), out);
if (!isAlmostZero(out.a7b()))
break $l$loop;
}
while (inductionVariable < 10);
}
if (normalize) {
out.d7b();
}
return out;
};
Bezier.prototype.o7h = function (t, normalize, out) {
this.n7h(t, normalize, out);
return out.s7a();
};
Bezier.prototype.p7h = function (t, target) {
this.o7h(t, true, target);
return target;
};
Bezier.prototype.r7h = function (t, target) {
this.n7h(t, true, target);
return target;
};
Bezier.prototype.t7h = function (t, out) {
if (this.u7g() < 2)
return null;
var p = this.h7c();
out.w7b(p, 0);
out.w7b(p, 1);
out.w7b(p, 2);
if (this.u7g() === 3) {
out.w7b(p, 3);
}
while (p.i() > 1) {
var next = PointArrayList_init_$Create$(0, 1, null);
var inductionVariable = 0;
var last = p.i() - 1 | 0;
if (inductionVariable < last)
do {
var i = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var px = interpolate_0(t, p.p71(i), p.p71(i + 1 | 0));
var py = interpolate_0(t, p.q71(i), p.q71(i + 1 | 0));
out.m71(px, py);
next.m71(px, py);
}
while (inductionVariable < last);
p = next;
}
return out;
};
Bezier.prototype.v7h = function (t0, t1) {
return new SubBezier(this.a7i(t0).b7i(map(Companion_getInstance_18(), t1, t0, 1.0, 0.0, 1.0)).w7h_1, t0, t1, this);
};
Bezier.prototype.b7i = function (t) {
return SubBezier_init_$Create$(this).b7i(t);
};
Bezier.prototype.a7i = function (t) {
return SubBezier_init_$Create$(this).a7i(t);
};
Bezier.prototype.c7i = function (out) {
var x0 = this.h7c().p71(0);
var y0 = this.h7c().q71(0);
var x1 = this.h7c().p71(this.u7g());
var y1 = this.h7c().q71(this.u7g());
return out.u72(x0, y0, x1, y1);
};
Bezier.$metadata$ = classMeta('Bezier', [IBezier]);
function IBezier() {
}
IBezier.$metadata$ = interfaceMeta('IBezier', [Curve]);
function toBezier(_this__u8e3s4) {
return Bezier_init_$Create$_0(new Float64Array([_this__u8e3s4.i73(), _this__u8e3s4.k73(), _this__u8e3s4.m73(), _this__u8e3s4.o73()]));
}
function _lut$factory() {
return getPropertyCallableRef('_lut', 1, KProperty1, function (receiver) {
return _get__lut__d2qf0f(receiver);
}, null);
}
function xt01$factory() {
return getPropertyCallableRef('xt01', 1, KProperty1, function (receiver) {
return receiver.f7g();
}, null);
}
function yt01$factory() {
return getPropertyCallableRef('yt01', 1, KProperty1, function (receiver) {
return receiver.g7g();
}, null);
}
function Curve() {
}
Curve.$metadata$ = interfaceMeta('Curve');
function Estimation_init_$Init$(point, ratio, length, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
point = Companion_getInstance_8().zp();
if (!(($mask0 & 2) === 0))
ratio = 0.0;
if (!(($mask0 & 4) === 0))
length = 0.0;
Estimation.call($this, point, ratio, length);
return $this;
}
function Estimation_init_$Create$(point, ratio, length, $mask0, $marker) {
return Estimation_init_$Init$(point, ratio, length, $mask0, $marker, Object.create(Estimation.prototype));
}
function CurveLUT_init_$Init$(curve, capacity, $this) {
CurveLUT.call($this, curve, new PointArrayList(capacity), new DoubleArrayList(capacity), new DoubleArrayList(capacity));
return $this;
}
function CurveLUT_init_$Create$(curve, capacity) {
return CurveLUT_init_$Init$(curve, capacity, Object.create(CurveLUT.prototype));
}
function Estimation(point, ratio, length) {
this.a7h_1 = point;
this.b7h_1 = ratio;
this.c7h_1 = length;
}
Estimation.prototype.toString = function () {
return 'Estimation(point=' + this.a7h_1 + ', ratio=' + this.b7h_1 + ', length=' + this.c7h_1 + ')';
};
Estimation.prototype.hashCode = function () {
var result = this.a7h_1.hashCode();
result = imul(result, 31) + getNumberHashCode(this.b7h_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.c7h_1) | 0;
return result;
};
Estimation.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Estimation))
return false;
var tmp0_other_with_cast = other instanceof Estimation ? other : THROW_CCE();
if (!this.a7h_1.equals(tmp0_other_with_cast.a7h_1))
return false;
if (!equals(this.b7h_1, tmp0_other_with_cast.b7h_1))
return false;
if (!equals(this.c7h_1, tmp0_other_with_cast.c7h_1))
return false;
return true;
};
Estimation.$metadata$ = classMeta('Estimation');
function estimateAt($this, values, value, out) {
var result = binarySearch$default(values, value, 0, 0, 6, null);
if (_BSearchResult___get_found__impl__om04iz(result))
return $this.f7i(out, _BSearchResult___get_index__impl__b5kraz(result), 0.0);
var index = _BSearchResult___get_nearIndex__impl__s8nq43(result);
if (value <= 0.0)
return $this.f7i(out, 0, 0.0);
if (index >= (values.i() - 1 | 0))
return $this.f7i(out, $this.e7h_1.i() - 1 | 0, 0.0);
var ratio0 = values.m(index);
var ratio1 = values.m(index + 1 | 0);
var ratio = convertRange(value, ratio0, ratio1, 0.0, 1.0);
return $this.f7i(out, index, ratio);
}
function CurveLUT$toString$lambda(this$0) {
return function (it) {
var tmp = this$0.f7h_1.m(it);
var tmp_0 = this$0.g7h_1.m(it);
return '' + tmp + ',len=' + tmp_0 + ': ' + getPoint$default(this$0.e7h_1, it, null, 2, null);
};
}
function CurveLUT(curve, points, ts, estimatedLengths) {
this.d7h_1 = curve;
this.e7h_1 = points;
this.f7h_1 = ts;
this.g7h_1 = estimatedLengths;
this.h7h_1 = Companion_getInstance_8().zp();
this.i7h_1 = 0.0;
}
CurveLUT.prototype.i = function () {
return this.e7h_1.i();
};
CurveLUT.prototype.x7 = function () {
this.e7h_1.zl();
this.f7h_1.x7();
this.g7h_1.x7();
this.i7h_1 = 0.0;
};
CurveLUT.prototype.l7h = function (t, p) {
var tmp0_this = this;
var tmp = tmp0_this;
var tmp_0 = tmp0_this.i7h_1;
var tmp_1;
if (this.e7h_1.t4o()) {
var tmp$ret$0;
// Inline function 'kotlin.math.hypot' call
var tmp0_hypot = p.d1n() - get_lastX(this.e7h_1);
var tmp1_hypot = p.e1n() - get_lastY(this.e7h_1);
tmp$ret$0 = hypot(tmp0_hypot, tmp1_hypot);
tmp_1 = tmp$ret$0;
} else {
tmp_1 = 0.0;
}
tmp.i7h_1 = tmp_0 + tmp_1;
this.g7h_1.m4n(this.i7h_1);
this.e7h_1.v7b(p);
this.f7h_1.m4n(t);
};
CurveLUT.prototype.f7i = function (_this__u8e3s4, index, ratio) {
var ratio0 = this.f7h_1.m(index);
var length0 = this.g7h_1.m(index);
var pointX0 = this.e7h_1.p71(index);
var pointY0 = this.e7h_1.q71(index);
if (ratio === 0.0) {
_this__u8e3s4.b7h_1 = ratio0;
_this__u8e3s4.c7h_1 = length0;
_this__u8e3s4.a7h_1.a73(pointX0, pointY0);
} else {
var ratio1 = this.f7h_1.m(index + 1 | 0);
var length1 = this.g7h_1.m(index + 1 | 0);
var pointX1 = this.e7h_1.p71(index + 1 | 0);
var pointY1 = this.e7h_1.q71(index + 1 | 0);
_this__u8e3s4.b7h_1 = interpolate_0(ratio, ratio0, ratio1);
_this__u8e3s4.c7h_1 = interpolate_0(ratio, length0, length1);
_this__u8e3s4.a7h_1.g7b(ratio, pointX0, pointY0, pointX1, pointY1);
}
return _this__u8e3s4;
};
CurveLUT.prototype.g7i = function (length, out) {
return estimateAt(this, this.g7h_1, length, out);
};
CurveLUT.prototype.j7h = function (length, out, $mask0, $handler) {
if (!(($mask0 & 2) === 0)) {
out = Estimation_init_$Create$(null, 0.0, 0.0, 7, null);
}
return this.g7i(length, out);
};
CurveLUT.prototype.toString = function () {
var tmp = until(0, this.i());
return 'CurveLUT[' + this.d7h_1 + '](' + joinToString$default(tmp, ', ', null, null, 0, null, CurveLUT$toString$lambda(this), 30, null) + ')';
};
CurveLUT.prototype.hashCode = function () {
var result = hashCode(this.d7h_1);
result = imul(result, 31) + this.e7h_1.hashCode() | 0;
result = imul(result, 31) + this.f7h_1.hashCode() | 0;
result = imul(result, 31) + this.g7h_1.hashCode() | 0;
return result;
};
CurveLUT.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof CurveLUT))
return false;
var tmp0_other_with_cast = other instanceof CurveLUT ? other : THROW_CCE();
if (!equals(this.d7h_1, tmp0_other_with_cast.d7h_1))
return false;
if (!this.e7h_1.equals(tmp0_other_with_cast.e7h_1))
return false;
if (!this.f7h_1.equals(tmp0_other_with_cast.f7h_1))
return false;
if (!this.g7h_1.equals(tmp0_other_with_cast.g7h_1))
return false;
return true;
};
CurveLUT.$metadata$ = classMeta('CurveLUT');
function CurveInfo(index, curve, startLength, endLength, bounds) {
this.h7i_1 = index;
this.i7i_1 = curve;
this.j7i_1 = startLength;
this.k7i_1 = endLength;
this.l7i_1 = bounds;
}
CurveInfo.prototype.m4 = function () {
return this.h7i_1;
};
CurveInfo.prototype.m7i = function () {
return this.i7i_1;
};
CurveInfo.prototype.n7i = function () {
return this.j7i_1;
};
CurveInfo.prototype.o7i = function () {
return this.l7i_1;
};
CurveInfo.prototype.jb = function (length) {
var containsLower = this.j7i_1;
return length <= this.k7i_1 ? containsLower <= length : false;
};
CurveInfo.prototype.ze = function () {
return this.k7i_1 - this.j7i_1;
};
CurveInfo.prototype.toString = function () {
return 'CurveInfo(index=' + this.h7i_1 + ', curve=' + this.i7i_1 + ', startLength=' + this.j7i_1 + ', endLength=' + this.k7i_1 + ', bounds=' + this.l7i_1 + ')';
};
CurveInfo.prototype.hashCode = function () {
var result = this.h7i_1;
result = imul(result, 31) + this.i7i_1.hashCode() | 0;
result = imul(result, 31) + getNumberHashCode(this.j7i_1) | 0;
result = imul(result, 31) + getNumberHashCode(this.k7i_1) | 0;
result = imul(result, 31) + this.l7i_1.hashCode() | 0;
return result;
};
CurveInfo.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof CurveInfo))
return false;
var tmp0_other_with_cast = other instanceof CurveInfo ? other : THROW_CCE();
if (!(this.h7i_1 === tmp0_other_with_cast.h7i_1))
return false;
if (!this.i7i_1.equals(tmp0_other_with_cast.i7i_1))
return false;
if (!equals(this.j7i_1, tmp0_other_with_cast.j7i_1))
return false;
if (!equals(this.k7i_1, tmp0_other_with_cast.k7i_1))
return false;
if (!this.l7i_1.equals(tmp0_other_with_cast.l7i_1))
return false;
return true;
};
CurveInfo.$metadata$ = classMeta('CurveInfo');
function Curves$contiguous$delegate$lambda(this$0) {
return function () {
var inductionVariable = 1;
var last = this$0.p7i_1.i();
var tmp;
if (inductionVariable < last) {
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var curr = this$0.p7i_1.m(n - 1 | 0);
var next = this$0.p7i_1.m(n);
var tmp_0 = get_lastX(curr.h7c());
var tmp_1 = get_firstX(next.h7c());
if (!isAlmostEquals$default(tmp_0, tmp_1, 0.0, 2, null))
return false;
var tmp_2 = get_lastY(curr.h7c());
var tmp_3 = get_firstY(next.h7c());
if (!isAlmostEquals$default(tmp_2, tmp_3, 0.0, 2, null))
return false;
}
while (inductionVariable < last);
tmp = Unit_getInstance();
}
return true;
};
}
function Curves$infos$delegate$lambda(this$0) {
return function () {
var pos = 0.0;
var tmp$ret$2;
// Inline function 'kotlin.collections.mapIndexed' call
var tmp0_mapIndexed = this$0.p7i_1;
var tmp$ret$1;
// Inline function 'kotlin.collections.mapIndexedTo' call
var tmp0_mapIndexedTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapIndexed, 10));
var index = 0;
var tmp0_iterator = tmp0_mapIndexed.j();
while (tmp0_iterator.k()) {
var item = tmp0_iterator.l();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.infos$delegate.<anonymous>.<anonymous>' call
var tmp1 = index;
index = tmp1 + 1 | 0;
var tmp1__anonymous__uwfjfc = checkIndexOverflow(tmp1);
var start = pos;
pos = pos + item.ze();
var tmp = pos;
tmp$ret$0 = new CurveInfo(tmp1__anonymous__uwfjfc, item, start, tmp, item.c72(null, 1, null));
tmp0_mapIndexedTo.c(tmp$ret$0);
}
tmp$ret$1 = tmp0_mapIndexedTo;
tmp$ret$2 = tmp$ret$1;
return tmp$ret$2;
};
}
function Curves$length$delegate$lambda(this$0) {
return function () {
var tmp$ret$1;
// Inline function 'kotlin.collections.sumOf' call
var tmp0_sumOf = this$0.x7i();
var sum = 0.0;
var tmp0_iterator = tmp0_sumOf.j();
while (tmp0_iterator.k()) {
var element = tmp0_iterator.l();
var tmp = sum;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.length$delegate.<anonymous>.<anonymous>' call
tmp$ret$0 = element.ze();
sum = tmp + tmp$ret$0;
}
tmp$ret$1 = sum;
return tmp$ret$1;
};
}
function Curves$findInfo$lambda($pos) {
return function (it) {
return it.jb($pos) ? 0 : it.k7i_1 < $pos ? -1 : 1;
};
}
function Curves$ratioFromLength$lambda($length) {
return function (it) {
return it.k7i_1 < $length ? -1 : it.j7i_1 > $length ? 1 : 0;
};
}
function Curves(beziers, closed) {
this.p7i_1 = beziers;
this.q7i_1 = closed;
var tmp = this;
tmp.r7i_1 = Mixin_init_$Create$(null, 1, null);
this.s7i_1 = false;
var tmp_0 = this;
tmp_0.t7i_1 = lazy(Curves$contiguous$delegate$lambda(this));
var tmp_1 = this;
tmp_1.u7i_1 = lazy(Curves$infos$delegate$lambda(this));
var tmp_2 = this;
tmp_2.v7i_1 = lazy(Curves$length$delegate$lambda(this));
this.w7i_1 = new BoundsBuilder();
}
Curves.prototype.y7i = function () {
return this.p7i_1;
};
Curves.prototype.l2g = function () {
return this.q7i_1;
};
Curves.prototype.e4v = function (_set____db54di) {
this.r7i_1.e4v(_set____db54di);
};
Curves.prototype.f4v = function () {
return this.r7i_1.f4v();
};
Curves.prototype.z7i = function (_set____db54di) {
this.s7i_1 = _set____db54di;
};
Curves.prototype.x7i = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = infos$factory();
tmp$ret$0 = this.u7i_1.l1();
return tmp$ret$0;
};
Curves.prototype.ze = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = length$factory();
tmp$ret$0 = this.v7i_1.l1();
return tmp$ret$0;
};
Curves.prototype.a7j = function (_this__u8e3s4) {
return _this__u8e3s4.j7i_1 / this.ze();
};
Curves.prototype.b7j = function (_this__u8e3s4) {
return _this__u8e3s4.k7i_1 / this.ze();
};
Curves.prototype.a72 = function (target) {
this.w7i_1.d2p();
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = this.x7i();
var n = 0;
while (n < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.bezier.Curves.getBounds.<anonymous>' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.m(tmp0);
this.w7i_1.t71(tmp1__anonymous__uwfjfc.l7i_1);
}
return this.w7i_1.a72(target);
};
Curves.prototype.c7j = function (t) {
var pos = t * this.ze();
var tmp = this.x7i();
var index = binarySearch$default_0(tmp, 0, 0, Curves$findInfo$lambda(pos), 3, null);
if (t < 0.0)
return first(this.x7i());
if (t > 1.0)
return last(this.x7i());
var tmp0_elvis_lhs = getOrNull(this.x7i(), index);
var tmp_0;
if (tmp0_elvis_lhs == null) {
throw IllegalStateException_init_$Create$('OUTSIDE');
} else {
tmp_0 = tmp0_elvis_lhs;
}
return tmp_0;
};
Curves.prototype.d7j = function (t, block) {
var pos = t * this.ze();
var info = this.c7j(t);
var posInCurve = pos - info.j7i_1;
var ratioInCurve = posInCurve / info.ze();
return block(info, ratioInCurve);
};
Curves.prototype.q7g = function (t, target) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.findTInCurve' call
var pos = t * this.ze();
var info = this.c7j(t);
var posInCurve = pos - info.j7i_1;
var ratioInCurve = posInCurve / info.ze();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.calc.<anonymous>' call
tmp$ret$0 = info.i7i_1.q7g(ratioInCurve, target);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Curves.prototype.p7h = function (t, target) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.findTInCurve' call
var pos = t * this.ze();
var info = this.c7j(t);
var posInCurve = pos - info.j7i_1;
var ratioInCurve = posInCurve / info.ze();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.normal.<anonymous>' call
tmp$ret$0 = info.i7i_1.p7h(ratioInCurve, target);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Curves.prototype.r7h = function (t, target) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.findTInCurve' call
var pos = t * this.ze();
var info = this.c7j(t);
var posInCurve = pos - info.j7i_1;
var ratioInCurve = posInCurve / info.ze();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.tangent.<anonymous>' call
tmp$ret$0 = info.i7i_1.r7h(ratioInCurve, target);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Curves.prototype.z7g = function (length) {
if (length <= 0.0)
return 0.0;
if (length >= this.ze())
return 1.0;
var tmp = this.x7i();
var curveIndex = binarySearch$default_0(tmp, 0, 0, Curves$ratioFromLength$lambda(length), 3, null);
var index = curveIndex < 0 ? (-curveIndex | 0) + 1 | 0 : curveIndex;
if (curveIndex < 0) {
DoubleCompanionObject_getInstance();
return NaN;
}
var info = this.x7i().m(index);
var lengthInCurve = length - info.j7i_1;
var ratioInCurve = info.i7i_1.z7g(lengthInCurve);
return convertRange(ratioInCurve, 0.0, 1.0, this.a7j(info), this.b7j(info));
};
Curves.prototype.e7j = function (len0, len1) {
return this.v7h(this.z7g(len0), this.z7g(len1));
};
Curves.prototype.v7h = function (t0, t1) {
if (t0 > t1)
return this.v7h(t1, t0);
// Inline function 'kotlin.check' call
var tmp0_check = t0 <= t1;
// Inline function 'kotlin.contracts.contract' call
// Inline function 'kotlin.check' call
// Inline function 'kotlin.contracts.contract' call
if (!tmp0_check) {
var tmp$ret$0;
// Inline function 'kotlin.check.<anonymous>' call
tmp$ret$0 = 'Check failed.';
var message = tmp$ret$0;
throw IllegalStateException_init_$Create$(toString(message));
}
if (t0 === t1)
return new Curves(emptyList(), false);
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.findTInCurve' call
var pos = t0 * this.ze();
var info = this.c7j(t0);
var posInCurve = pos - info.j7i_1;
var ratioInCurve = posInCurve / info.ze();
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.split.<anonymous>' call
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.findTInCurve' call
var pos_0 = t1 * this.ze();
var info_0 = this.c7j(t1);
var posInCurve_0 = pos_0 - info_0.j7i_1;
var ratioInCurve_0 = posInCurve_0 / info_0.ze();
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.bezier.Curves.split.<anonymous>.<anonymous>' call
var tmp;
if (info.h7i_1 === info_0.h7i_1) {
var tmp_0 = info.i7i_1;
tmp = listOf_0((tmp_0 instanceof Bezier ? tmp_0 : THROW_CCE()).v7h(ratioInCurve, ratioInCurve_0).w7h_1);
} else {
var tmp$ret$3;
// Inline function 'kotlin.collections.buildList' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$2;
// Inline function 'kotlin.collections.buildListInternal' call
var tmp$ret$1;
// Inline function 'kotlin.apply' call
var tmp0_apply = ArrayList_init_$Create$();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.bezier.Curves.split.<anonymous>.<anonymous>.<anonymous>' call
if (!(ratioInCurve === 1.0)) {
var tmp_1 = info.i7i_1;
tmp0_apply.c((tmp_1 instanceof Bezier ? tmp_1 : THROW_CCE()).a7i(ratioInCurve).w7h_1);
}
var inductionVariable = info.h7i_1 + 1 | 0;
var last = info_0.h7i_1;
if (inductionVariable < last)
do {
var index = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
tmp0_apply.c(this.x7i().m(index).i7i_1);
}
while (inductionVariable < last);
if (!(ratioInCurve_0 === 0.0)) {
var tmp_2 = info_0.i7i_1;
tmp0_apply.c((tmp_2 instanceof Bezier ? tmp_2 : THROW_CCE()).b7i(ratioInCurve_0).w7h_1);
}
tmp$ret$1 = tmp0_apply;
tmp$ret$2 = tmp$ret$1.c4();
tmp$ret$3 = tmp$ret$2;
tmp = tmp$ret$3;
}
tmp$ret$4 = tmp;
tmp$ret$5 = tmp$ret$4;
tmp$ret$6 = tmp$ret$5;
tmp$ret$7 = tmp$ret$6;
return new Curves(tmp$ret$7, false);
};
Curves.prototype.toString = function () {
return 'Curves(beziers=' + this.p7i_1 + ', closed=' + this.q7i_1 + ')';
};
Curves.prototype.hashCode = function () {
var result = hashCode(this.p7i_1);
result = imul(result, 31) + (this.q7i_1 | 0) | 0;
return result;
};
Curves.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof Curves))
return false;
var tmp0_other_with_cast = other instanceof Curves ? other : THROW_CCE();
if (!equals(this.p7i_1, tmp0_other_with_cast.p7i_1))
return false;
if (!(this.q7i_1 === tmp0_other_with_cast.q7i_1))
return false;
return true;
};
Curves.$metadata$ = classMeta('Curves', [Curve, Extra]);
function toNonCurveSimplePointList(_this__u8e3s4, out) {
var curves = _this__u8e3s4;
var beziers = curves.p7i_1;
var epsilon = 1.0E-5;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var n = 0;
while (n < beziers.i()) {
// Inline function 'com.soywiz.korma.geom.bezier.toNonCurveSimplePointList.<anonymous>' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0__anonymous__q1qw7t = beziers.m(tmp0);
var tmp$ret$1;
// Inline function 'kotlin.collections.isNotEmpty' call
var tmp0_isNotEmpty = tmp0__anonymous__q1qw7t.m7h();
var tmp$ret$0;
// Inline function 'kotlin.collections.isEmpty' call
tmp$ret$0 = tmp0_isNotEmpty.length === 0;
tmp$ret$1 = !tmp$ret$0;
if (tmp$ret$1)
return null;
var points = tmp0__anonymous__q1qw7t.h7c();
// Inline function 'com.soywiz.korma.geom.fastForEach' call
var inductionVariable = 0;
var last = points.i();
if (inductionVariable < last)
do {
var n_0 = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.bezier.toNonCurveSimplePointList.<anonymous>.<anonymous>' call
var tmp1__anonymous__uwfjfc = points.p71(n_0);
var tmp2__anonymous__z9zvc9 = points.q71(n_0);
if (out.p() ? true : !isAlmostEquals(get_lastX(out), tmp1__anonymous__uwfjfc, epsilon) ? true : !isAlmostEquals(get_lastY(out), tmp2__anonymous__z9zvc9, epsilon)) {
out.m71(tmp1__anonymous__uwfjfc, tmp2__anonymous__z9zvc9);
}
}
while (inductionVariable < last);
}
if (isAlmostEquals(get_lastX(out), get_firstX(out), epsilon) ? isAlmostEquals(get_lastX(out), get_firstX(out), epsilon) : false) {
var tmp = out.i() - 1 | 0;
out.y7b(tmp, 0, 2, null);
}
return out;
}
function toNonCurveSimplePointList$default(_this__u8e3s4, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0)) {
out = PointArrayList_init_$Create$(0, 1, null);
}
return toNonCurveSimplePointList(_this__u8e3s4, out);
}
function toCurves(_this__u8e3s4, closed) {
return new Curves(_this__u8e3s4, closed);
}
function toVectorPath(_this__u8e3s4, out) {
return toVectorPath_0(listOf_0(_this__u8e3s4), out);
}
function toVectorPath$default(_this__u8e3s4, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0)) {
out = VectorPath_init_$Create$(null, null, null, false, 15, null);
}
return toVectorPath(_this__u8e3s4, out);
}
function toVectorPath_0(_this__u8e3s4, out) {
var first = {_v: true};
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var n = 0;
while (n < _this__u8e3s4.i()) {
// Inline function 'com.soywiz.korma.geom.bezier.toVectorPath.<anonymous>' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0__anonymous__q1qw7t = _this__u8e3s4.m(tmp0);
var tmp0_subject = tmp0__anonymous__q1qw7t;
if (tmp0_subject instanceof Curves) {
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = tmp0__anonymous__q1qw7t.p7i_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.bezier.toVectorPath.<anonymous>.<anonymous>' call
var tmp0_0 = n_0;
n_0 = tmp0_0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.m(tmp0_0);
toVectorPath$bezier(first, out, tmp1__anonymous__uwfjfc);
}
if (tmp0__anonymous__q1qw7t.q7i_1) {
out.x2c();
}
} else {
if (tmp0_subject instanceof Bezier) {
toVectorPath$bezier(first, out, tmp0__anonymous__q1qw7t);
} else {
throw NotImplementedError_init_$Create$(null, 1, null);
}
}
}
return out;
}
function toVectorPath$bezier(first, $out, bezier) {
var points = bezier.h7c();
if (first._v) {
$out.r7e(get_firstX(points), get_firstY(points));
first._v = false;
}
var tmp0_subject = bezier.u7g();
switch (tmp0_subject) {
case 1:
$out.u7e(points.p71(1), points.q71(1));
;
break;
case 2:
$out.v7e(points.p71(1), points.q71(1), points.p71(2), points.q71(2));
;
break;
case 3:
$out.x7e(points.p71(1), points.q71(1), points.p71(2), points.q71(2), points.p71(3), points.q71(3));
;
break;
default:
// Inline function 'kotlin.TODO' call
throw NotImplementedError_init_$Create$(null, 1, null);
}
}
function infos$factory() {
return getPropertyCallableRef('infos', 1, KProperty1, function (receiver) {
return receiver.x7i();
}, null);
}
function length$factory() {
return getPropertyCallableRef('length', 1, KProperty1, function (receiver) {
return receiver.ze();
}, null);
}
function get_isConvex(_this__u8e3s4) {
init_properties_CurvesConvex_kt_aqp5pt();
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.kds.PropertyThis.getValue' call
var tmp0_getValue = isConvex$factory();
var tmp0_elvis_lhs = isConvex$delegate.k4v_1;
var res = getExtraTyped(_this__u8e3s4, tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs);
if (res == null) {
var r = isConvex$delegate.l4v_1(_this__u8e3s4);
// Inline function 'com.soywiz.kds.PropertyThis.setValueUntransformed' call
var tmp0_elvis_lhs_0 = isConvex$delegate.k4v_1;
setExtra(_this__u8e3s4, tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0, r);
tmp$ret$0 = r;
break $l$block;
}
tmp$ret$0 = res;
}
return tmp$ret$0;
}
var isConvex$delegate;
function isConvex$delegate$lambda($this$extraPropertyThis) {
init_properties_CurvesConvex_kt_aqp5pt();
return $this$extraPropertyThis.s7i_1 ? true : Convex_getInstance().r7j($this$extraPropertyThis);
}
function isConvex$delegate$lambda_0($this$null, it) {
init_properties_CurvesConvex_kt_aqp5pt();
return it;
}
function isConvex$factory() {
return getPropertyCallableRef('isConvex', 1, KProperty1, function (receiver) {
return get_isConvex(receiver);
}, null);
}
var properties_initialized_CurvesConvex_kt_cc36yb;
function init_properties_CurvesConvex_kt_aqp5pt() {
if (properties_initialized_CurvesConvex_kt_cc36yb) {
} else {
properties_initialized_CurvesConvex_kt_cc36yb = true;
var tmp$ret$1;
// Inline function 'com.soywiz.kds.extraPropertyThis' call
var tmp0_extraPropertyThis = isConvex$delegate$lambda;
var tmp1_extraPropertyThis = isConvex$delegate$lambda_0;
var tmp$ret$0;
// Inline function 'com.soywiz.kds.PropertyThis.withTransform' call
var tmp0_withTransform = new PropertyThis(null, tmp0_extraPropertyThis);
tmp0_withTransform.m4v_1 = tmp1_extraPropertyThis;
tmp$ret$0 = tmp0_withTransform;
tmp$ret$1 = tmp$ret$0;
isConvex$delegate = tmp$ret$1;
}
}
function toDashes(_this__u8e3s4, pattern, offset) {
if (pattern == null)
return listOf_0(_this__u8e3s4);
// Inline function 'kotlin.check' call
var tmp$ret$1;
$l$block: {
// Inline function 'kotlin.collections.all' call
var indexedObject = pattern;
var inductionVariable = 0;
var last = indexedObject.length;
while (inductionVariable < last) {
var element = indexedObject[inductionVariable];
inductionVariable = inductionVariable + 1 | 0;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.toDashes.<anonymous>' call
tmp$ret$0 = element <= 0.0;
if (!tmp$ret$0) {
tmp$ret$1 = false;
break $l$block;
}
}
tmp$ret$1 = true;
}
var tmp0_check = !tmp$ret$1;
// Inline function 'kotlin.contracts.contract' call
// Inline function 'kotlin.check' call
// Inline function 'kotlin.contracts.contract' call
if (!tmp0_check) {
var tmp$ret$2;
// Inline function 'kotlin.check.<anonymous>' call
tmp$ret$2 = 'Check failed.';
var message = tmp$ret$2;
throw IllegalStateException_init_$Create$(toString(message));
}
var length = _this__u8e3s4.ze();
var current = offset;
var dashNow = true;
var index = 0;
var tmp$ret$3;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$3 = ArrayList_init_$Create$();
var out = tmp$ret$3;
while (current < length) {
var tmp0 = index;
index = tmp0 + 1 | 0;
var len = getCyclic(pattern, tmp0);
if (dashNow) {
// Inline function 'kotlin.collections.plusAssign' call
var tmp1_plusAssign = _this__u8e3s4.e7j(current, current + len);
out.c(tmp1_plusAssign);
}
current = current + len;
dashNow = !dashNow;
}
return out;
}
function StrokePoints() {
}
StrokePoints.$metadata$ = interfaceMeta('StrokePoints');
function toStrokePointsList(_this__u8e3s4, info, mode, generateDebug, forceClosed) {
return toStrokePointsList_0(_this__u8e3s4, info.t7j_1, info.y7j_1, info.w7j_1, info.x7j_1, info.z7j_1, mode, info.a7k_1, info.b7k_1, generateDebug, forceClosed);
}
function toStrokePointsList$default(_this__u8e3s4, info, mode, generateDebug, forceClosed, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
mode = StrokePointsMode_NON_SCALABLE_POS_getInstance();
if (!(($mask0 & 4) === 0))
generateDebug = false;
if (!(($mask0 & 8) === 0))
forceClosed = null;
return toStrokePointsList(_this__u8e3s4, info, mode, generateDebug, forceClosed);
}
var StrokePointsMode_SCALABLE_POS_NORMAL_WIDTH_instance;
var StrokePointsMode_NON_SCALABLE_POS_instance;
var StrokePointsMode_entriesInitialized;
function StrokePointsMode_initEntries() {
if (StrokePointsMode_entriesInitialized)
return Unit_getInstance();
StrokePointsMode_entriesInitialized = true;
StrokePointsMode_SCALABLE_POS_NORMAL_WIDTH_instance = new StrokePointsMode('SCALABLE_POS_NORMAL_WIDTH', 0);
StrokePointsMode_NON_SCALABLE_POS_instance = new StrokePointsMode('NON_SCALABLE_POS', 1);
}
function StrokePointsMode(name, ordinal) {
Enum.call(this, name, ordinal);
}
StrokePointsMode.$metadata$ = classMeta('StrokePointsMode', undefined, undefined, undefined, undefined, Enum.prototype);
function toStrokePointsList_0(_this__u8e3s4, width, join, startCap, endCap, miterLimit, mode, lineDash, lineDashOffset, generateDebug, forceClosed) {
var tmp;
if (!(lineDash == null)) {
var tmp$ret$2;
// Inline function 'kotlin.collections.flatMap' call
var tmp$ret$1;
// Inline function 'kotlin.collections.flatMapTo' call
var tmp0_flatMapTo = ArrayList_init_$Create$();
var tmp0_iterator = _this__u8e3s4.j();
while (tmp0_iterator.k()) {
var element = tmp0_iterator.l();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.bezier.toStrokePointsList.<anonymous>' call
tmp$ret$0 = toDashes(element, lineDash.y4n(), lineDashOffset);
var list = tmp$ret$0;
addAll(tmp0_flatMapTo, list);
}
tmp$ret$1 = tmp0_flatMapTo;
tmp$ret$2 = tmp$ret$1;
tmp = tmp$ret$2;
} else {
tmp = _this__u8e3s4;
}
var curvesList = tmp;
var tmp$ret$6;
// Inline function 'kotlin.collections.map' call
var tmp$ret$5;
// Inline function 'kotlin.collections.mapTo' call
var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(curvesList, 10));
var tmp0_iterator_0 = curvesList.j();
while (tmp0_iterator_0.k()) {
var item = tmp0_iterator_0.l();
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.bezier.toStrokePointsList.<anonymous>' call
var tmp$ret$3;
// Inline function 'kotlin.also' call
var tmp0_also = new StrokePointsBuilder(width / 2.0, mode, generateDebug);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.bezier.toStrokePointsList.<anonymous>.<anonymous>' call
tmp0_also.j7k(item, join, startCap, endCap, miterLimit, forceClosed);
tmp$ret$3 = tmp0_also;
tmp$ret$4 = tmp$ret$3;
tmp0_mapTo.c(tmp$ret$4);
}
tmp$ret$5 = tmp0_mapTo;
tmp$ret$6 = tmp$ret$5;
return tmp$ret$6;
}
function StrokePointsBuilder(width, mode, generateDebug) {
this.c7k_1 = width;
this.d7k_1 = mode;
this.e7k_1 = generateDebug;
this.f7k_1 = 20;
var tmp = this;
var tmp0_subject = this.d7k_1;
var tmp0 = tmp0_subject.q2_1;
var tmp_0;
switch (tmp0) {
case 0:
tmp_0 = 6;
break;
case 1:
tmp_0 = 2;
break;
default:
noWhenBranchMatchedException();
break;
}
var tmp_1 = tmp_0;
tmp.g7k_1 = VectorArrayList_init_$Create$(tmp_1, 0, 2, null);
var tmp_2 = this;
tmp_2.h7k_1 = PointArrayList_init_$Create$(0, 1, null);
var tmp_3 = this;
var tmp$ret$0;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$0 = ArrayList_init_$Create$();
tmp_3.i7k_1 = tmp$ret$0;
}
StrokePointsBuilder.prototype.d72 = function () {
return this.c7k_1;
};
StrokePointsBuilder.prototype.s7j = function () {
return this.g7k_1;
};
StrokePointsBuilder.prototype.toString = function () {
return 'StrokePointsBuilder(' + this.c7k_1 + ', ' + this.g7k_1 + ')';
};
StrokePointsBuilder.prototype.k7k = function (pos, normal, width, maxWidth) {
var tmp0_subject = this.d7k_1;
var tmp0 = tmp0_subject.q2_1;
if (tmp0 === 0) {
var tmp = pos.d1n();
var tmp_0 = pos.e1n();
var tmp_1 = normal.d1n();
var tmp_2 = normal.e1n();
var tmp$ret$0;
// Inline function 'kotlin.math.absoluteValue' call
tmp$ret$0 = Math.abs(maxWidth);
this.g7k_1.p4n(tmp, tmp_0, tmp_1, tmp_2, width, tmp$ret$0);
} else if (tmp0 === 1) {
this.g7k_1.n4n(pos.d1n() + normal.d1n() * width, pos.e1n() + normal.e1n() * width);
}
};
StrokePointsBuilder.prototype.l7k = function (pos, normal, width, maxWidth, $mask0, $handler) {
if (!(($mask0 & 8) === 0))
maxWidth = width;
return this.k7k(pos, normal, width, maxWidth);
};
StrokePointsBuilder.prototype.m7k = function (center, pos, sign) {
var dist = minus_0(pos, center);
var normal = sign < 0.0 ? get_mutable(dist).t7a() : dist;
var tmp = get_normalized_0(normal);
var tmp_0 = get_length(dist) * sign;
this.l7k(center, tmp, tmp_0, 0.0, 8, null);
};
StrokePointsBuilder.prototype.n7k = function (center, pos, sign, $mask0, $handler) {
if (!(($mask0 & 4) === 0))
sign = 1.0;
return this.m7k(center, pos, sign);
};
StrokePointsBuilder.prototype.o7k = function (pos, normal, width) {
this.l7k(pos, normal, width, 0.0, 8, null);
var tmp = -width;
this.l7k(pos, normal, tmp, 0.0, 8, null);
};
StrokePointsBuilder.prototype.p7k = function (curr, next, kind, miterLimitRatio) {
var commonPoint = curr.s7g(1.0, null, 2, null);
var currTangent = curr.s7h(1.0, null, 2, null);
var currNormal = curr.q7h(1.0, null, 2, null);
var nextTangent = next.s7h(0.0, null, 2, null);
var nextNormal = next.q7h(0.0, null, 2, null);
var tmp = Companion_getInstance_2();
var tmp_0 = commonPoint.v7a(currNormal.x7a(this.c7k_1));
var currLine0 = tmp.v72(tmp_0, currTangent, 0.0, null, 12, null);
var tmp_1 = Companion_getInstance_2();
var tmp_2 = commonPoint.v7a(currNormal.x7a(-this.c7k_1));
var currLine1 = tmp_1.v72(tmp_2, currTangent, 0.0, null, 12, null);
var tmp_3 = Companion_getInstance_2();
var tmp_4 = commonPoint.v7a(nextNormal.x7a(this.c7k_1));
var nextLine0 = tmp_3.v72(tmp_4, nextTangent, 0.0, null, 12, null);
var tmp_5 = Companion_getInstance_2();
var tmp_6 = commonPoint.v7a(nextNormal.x7a(-this.c7k_1));
var nextLine1 = tmp_5.v72(tmp_6, nextTangent, 0.0, null, 12, null);
var tmp_7 = Companion_getInstance_2();
var intersection0 = lineIntersectionPoint$default(tmp_7, currLine0, nextLine0, null, 4, null);
var tmp_8 = Companion_getInstance_2();
var intersection1 = lineIntersectionPoint$default(tmp_8, currLine1, nextLine1, null, 4, null);
if (intersection0 == null ? true : intersection1 == null) {
this.o7k(commonPoint, currNormal, this.c7k_1);
return Unit_getInstance();
}
var direction = Companion_getInstance_8().n7a(currTangent, nextTangent);
var miterLength = Companion_getInstance_8().l7a(intersection0, intersection1);
var miterLimit = miterLimitRatio * this.c7k_1;
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.Companion.atan2' call
var tmp0_atan2 = Companion_getInstance_0();
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.Companion.atan2' call
var tmp0_atan2_0 = nextTangent.d1n();
var tmp1_atan2 = nextTangent.e1n();
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp$ret$0;
// Inline function 'kotlin.math.atan2' call
tmp$ret$0 = Math.atan2(tmp0_atan2_0, tmp1_atan2);
var tmp0_fromRadians = tmp$ret$0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$1 = tmp0_fromRadians / get_PI2();
tmp$ret$2 = tmp0_atan2.f70(tmp$ret$1);
tmp$ret$3 = tmp$ret$2;
tmp$ret$4 = tmp$ret$3;
var tmp_9 = tmp$ret$4;
var tmp$ret$9;
// Inline function 'com.soywiz.korma.geom.Companion.atan2' call
var tmp1_atan2_0 = Companion_getInstance_0();
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.Companion.atan2' call
var tmp0_atan2_1 = currTangent.d1n();
var tmp1_atan2_1 = currTangent.e1n();
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp$ret$5;
// Inline function 'kotlin.math.atan2' call
tmp$ret$5 = Math.atan2(tmp0_atan2_1, tmp1_atan2_1);
var tmp0_fromRadians_0 = tmp$ret$5;
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$6 = tmp0_fromRadians_0 / get_PI2();
tmp$ret$7 = tmp1_atan2_0.f70(tmp$ret$6);
tmp$ret$8 = tmp$ret$7;
tmp$ret$9 = tmp$ret$8;
var angle = minus(tmp_9, tmp$ret$9);
if (!kind.equals(LineJoin_MITER_getInstance()) ? true : miterLength > miterLimit) {
var tmp_10;
if (direction <= 0.0) {
tmp_10 = projectedPoint$default(currLine0, commonPoint, null, 2, null);
} else {
tmp_10 = projectedPoint$default(nextLine1, commonPoint, null, 2, null);
}
var p1 = tmp_10;
var tmp_11;
if (direction <= 0.0) {
tmp_11 = projectedPoint$default(nextLine0, commonPoint, null, 2, null);
} else {
tmp_11 = projectedPoint$default(currLine1, commonPoint, null, 2, null);
}
var p2 = tmp_11;
var tmp_12;
if (direction <= 0.0) {
var tmp_13 = Companion_getInstance_2();
tmp_12 = lineIntersectionPoint$default(tmp_13, currLine1, nextLine1, null, 4, null);
} else {
var tmp_14 = Companion_getInstance_2();
tmp_12 = lineIntersectionPoint$default(tmp_14, currLine0, nextLine0, null, 4, null);
}
var p3 = tmp_12;
var p4Line = direction < 0.0 ? nextLine1 : nextLine0;
var p4 = projectedPoint$default(p4Line, commonPoint, null, 2, null);
if (p3 == null) {
p3 = p4;
}
var angleB = get_absoluteValue(plus_0(angle, get_degrees(180)));
var angle2 = get_absoluteValue(umod(angle, get_degrees(180)));
var angle3 = Angle__compareTo_impl_a0hfds(angle2, get_degrees(90)) >= 0 ? minus(get_degrees(180), angle2) : angle2;
var tmp$ret$10;
// Inline function 'kotlin.math.absoluteValue' call
var tmp2__get_absoluteValue__uu8ln7 = _Angle___get_ratio__impl__ap3on4(angle3);
tmp$ret$10 = Math.abs(tmp2__get_absoluteValue__uu8ln7);
var ratio = clamp(tmp$ret$10 * 4, 0.0, 1.0);
var p5 = interpolate_2(ratio, p4, get_mutable(ensureNotNull(p3)));
if (this.e7k_1) {
this.i7k_1.c(nextLine1.f73(1000.0).z4n());
this.i7k_1.c(currLine1.f73(1000.0).z4n());
this.i7k_1.c(nextLine0.f73(1000.0).z4n());
this.i7k_1.c(currLine0.f73(1000.0).z4n());
var tmp_15 = Companion_getInstance_2();
this.i7k_1.c(tmp_15.v72(commonPoint, currTangent, 0.0, null, 12, null).f73(1000.0).z4n());
var tmp_16 = Companion_getInstance_2();
this.i7k_1.c(tmp_16.v72(commonPoint, nextTangent, 0.0, null, 12, null).f73(1000.0).z4n());
this.h7k_1.v7b(p3);
this.h7k_1.u7b(p4);
this.h7k_1.u7b(p5);
}
var p6 = p5;
if (direction < 0.0) {
this.n7k(commonPoint, p1, 0.0, 4, null);
this.m7k(commonPoint, p6, -1.0);
this.n7k(commonPoint, p2, 0.0, 4, null);
this.m7k(commonPoint, p6, -1.0);
} else {
this.n7k(commonPoint, p6, 0.0, 4, null);
this.m7k(commonPoint, p2, -1.0);
this.n7k(commonPoint, p6, 0.0, 4, null);
this.m7k(commonPoint, p1, -1.0);
}
return Unit_getInstance();
}
var d0 = intersection0.w7a(commonPoint);
var d1 = commonPoint.w7a(intersection1);
var tmp_17 = d0.c7b();
var tmp_18 = d0.ze();
var tmp$ret$11;
// Inline function 'kotlin.math.absoluteValue' call
var tmp3__get_absoluteValue__yc2l1w = d0.ze();
tmp$ret$11 = Math.abs(tmp3__get_absoluteValue__yc2l1w);
this.k7k(commonPoint, tmp_17, tmp_18, tmp$ret$11);
var tmp_19 = d1.c7b();
var tmp_20 = -d1.ze();
var tmp$ret$12;
// Inline function 'kotlin.math.absoluteValue' call
var tmp4__get_absoluteValue__x77hij = d1.ze();
tmp$ret$12 = Math.abs(tmp4__get_absoluteValue__x77hij);
this.k7k(commonPoint, tmp_19, tmp_20, tmp$ret$12);
};
StrokePointsBuilder.prototype.q7k = function (curr, ratio, kind) {
var tmp0_subject = kind;
var tmp0 = tmp0_subject.q2_1;
switch (tmp0) {
case 1:
case 2:
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also = curr.q7h(ratio, null, 2, null).s7a();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.bezier.StrokePointsBuilder.addCap.<anonymous>' call
if (ratio === 1.0) {
tmp0_also.t7a();
}
tmp$ret$0 = tmp0_also;
var derivate = tmp$ret$0;
var tmp1_subject = kind;
var tmp0_0 = tmp1_subject.q2_1;
switch (tmp0_0) {
case 1:
var tmp = curr.s7g(ratio, null, 2, null).v7a(derivate.x7a(this.c7k_1));
this.o7k(tmp, curr.q7h(ratio, null, 2, null), this.c7k_1);
;
break;
case 2:
var mid = curr.s7g(ratio, null, 2, null);
var normal = curr.q7h(ratio, null, 2, null);
var p0 = mid.v7a(normal.x7a(this.c7k_1));
var p3 = mid.v7a(normal.x7a(-this.c7k_1));
var a = ratio === 0.0 ? p0 : p3;
var b = ratio === 0.0 ? p3 : p0;
this.r7k(a, b, ratio, mid, 0, 16, null);
;
break;
default:
// Inline function 'kotlin.error' call
throw IllegalStateException_init_$Create$("Can't happen");
}
break;
case 0:
var tmp_0 = curr.s7g(ratio, null, 2, null);
this.o7k(tmp_0, curr.q7h(ratio, null, 2, null), this.c7k_1);
;
break;
}
};
StrokePointsBuilder.prototype.s7k = function (p0, p3, ratio, mid, nsteps) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between = Companion_getInstance_0();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between_0 = mid.d1n();
var tmp1_between = mid.e1n();
var tmp2_between = p0.d1n();
var tmp3_between = p0.e1n();
tmp$ret$0 = Angle_between(tmp0_between_0, tmp1_between, tmp2_between, tmp3_between);
tmp$ret$1 = tmp$ret$0;
var angleStart = tmp$ret$1;
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp1_between_0 = Companion_getInstance_0();
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between_1 = mid.d1n();
var tmp1_between_1 = mid.e1n();
var tmp2_between_0 = p3.d1n();
var tmp3_between_0 = p3.e1n();
tmp$ret$2 = Angle_between(tmp0_between_1, tmp1_between_1, tmp2_between_0, tmp3_between_0);
tmp$ret$3 = tmp$ret$2;
var angleEnd = tmp$ret$3;
if (ratio === 1.0) {
var tmp = Companion_getInstance_8();
this.o7k(mid, tmp.c7a(angleEnd, 0.0, null, 6, null), this.c7k_1);
}
var tmp_0;
if (Companion_getInstance_8().n7a(p0, p3) <= 0.0) {
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp2__get_ZERO__ccqkbr = Companion_getInstance_0();
tmp$ret$4 = tmp2__get_ZERO__ccqkbr.f70(0.0);
tmp_0 = tmp$ret$4;
} else {
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.Companion.HALF' call
var tmp3__get_HALF__e7m9wb = Companion_getInstance_0();
tmp$ret$5 = tmp3__get_HALF__e7m9wb.f70(0.5);
tmp_0 = tmp$ret$5;
}
var addAngle = tmp_0;
// Inline function 'com.soywiz.kds.forEachRatio01' call
var NS = nsteps - 1 | 0;
var start = 0;
var end = NS;
var inductionVariable = start;
if (inductionVariable <= end)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio_0 = n / NS;
// Inline function 'com.soywiz.korma.geom.bezier.StrokePointsBuilder.addCurvePointsCap.<anonymous>' call
var angle = interpolate(ratio_0, angleStart, angleEnd);
var tmp_1 = Companion_getInstance_8();
var tmp_2 = plus_0(angle, addAngle);
var dir = tmp_1.c7a(tmp_2, 0.0, null, 6, null);
this.k7k(mid, dir, 0.0, this.c7k_1);
this.k7k(mid, dir, this.c7k_1, this.c7k_1);
}
while (!(n === end));
if (ratio === 0.0) {
var tmp_3 = Companion_getInstance_8();
this.o7k(mid, tmp_3.c7a(angleStart, 0.0, null, 6, null), this.c7k_1);
}
};
StrokePointsBuilder.prototype.r7k = function (p0, p3, ratio, mid, nsteps, $mask0, $handler) {
if (!(($mask0 & 8) === 0)) {
var tmp = Companion_getInstance_8();
mid = tmp.e7a(p0, p3, null, 4, null);
}
if (!(($mask0 & 16) === 0))
nsteps = this.f7k_1;
return this.s7k(p0, p3, ratio, mid, nsteps);
};
StrokePointsBuilder.prototype.t7k = function (curr, nsteps) {
// Inline function 'com.soywiz.kds.forEachRatio01' call
var NS = nsteps - 1 | 0;
var start = false ? 0 : 1;
var end = false ? NS : NS - 1 | 0;
var inductionVariable = start;
if (inductionVariable <= end)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n / NS;
// Inline function 'com.soywiz.korma.geom.bezier.StrokePointsBuilder.addCurvePoints.<anonymous>' call
var tmp = curr.s7g(ratio, null, 2, null);
this.o7k(tmp, curr.q7h(ratio, null, 2, null), this.c7k_1);
}
while (!(n === end));
};
StrokePointsBuilder.prototype.u7k = function (curr, nsteps, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
nsteps = numberToInt(clamp(curr.ze() / 10.0, 10.0, 100.0));
return this.t7k(curr, nsteps);
};
StrokePointsBuilder.prototype.j7k = function (curves, join, startCap, endCap, miterLimit, forceClosed) {
var tmp0_elvis_lhs = forceClosed;
var closed = tmp0_elvis_lhs == null ? curves.q7i_1 : tmp0_elvis_lhs;
var curves_0 = curves.p7i_1;
var inductionVariable = 0;
var last = curves_0.i() - 1 | 0;
if (inductionVariable <= last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var curr = getCyclic_0(curves_0, n + 0 | 0);
var next = getCyclic_0(curves_0, n + 1 | 0);
if (n === 0) {
if (closed) {
this.p7k(getCyclic_0(curves_0, n - 1 | 0), curr, join, miterLimit);
} else {
this.q7k(curr, 0.0, startCap);
}
}
if (!(curr.u7g() === 1)) {
this.u7k(curr, 0, 2, null);
}
if (n < (curves_0.i() - 1 | 0)) {
this.p7k(curr, next, join, miterLimit);
} else {
if (closed) {
this.p7k(curr, next, join, miterLimit);
} else {
this.q7k(curr, 1.0, endCap);
}
}
}
while (inductionVariable <= last);
};
StrokePointsBuilder.$metadata$ = classMeta('StrokePointsBuilder', [StrokePoints]);
function StrokePointsMode_SCALABLE_POS_NORMAL_WIDTH_getInstance() {
StrokePointsMode_initEntries();
return StrokePointsMode_SCALABLE_POS_NORMAL_WIDTH_instance;
}
function StrokePointsMode_NON_SCALABLE_POS_getInstance() {
StrokePointsMode_initEntries();
return StrokePointsMode_NON_SCALABLE_POS_instance;
}
function BezierCurveFromIndices($this, indices, points) {
var p = new PointArrayList(indices.length);
var indexedObject = indices;
var inductionVariable = 0;
var last = indexedObject.length;
while (inductionVariable < last) {
var index = indexedObject[inductionVariable];
inductionVariable = inductionVariable + 1 | 0;
p.w7b(points, index);
}
return new Bezier(p);
}
function SubBezier_init_$Init$(curve, $this) {
SubBezier.call($this, curve, 0.0, 1.0, null);
return $this;
}
function SubBezier_init_$Create$(curve) {
return SubBezier_init_$Init$(curve, Object.create(SubBezier.prototype));
}
function Companion_19() {
Companion_instance_19 = this;
var tmp = this;
var tmp$ret$0;
// Inline function 'kotlin.intArrayOf' call
tmp$ret$0 = new Int32Array([0, 3, 5]);
var tmp_0 = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.intArrayOf' call
tmp$ret$1 = new Int32Array([0, 4, 7, 9]);
tmp.v7k_1 = listOf([null, null, tmp_0, tmp$ret$1]);
var tmp_1 = this;
var tmp$ret$2;
// Inline function 'kotlin.intArrayOf' call
tmp$ret$2 = new Int32Array([5, 4, 2]);
var tmp_2 = tmp$ret$2;
var tmp$ret$3;
// Inline function 'kotlin.intArrayOf' call
tmp$ret$3 = new Int32Array([9, 8, 6, 3]);
tmp_1.w7k_1 = listOf([null, null, tmp_2, tmp$ret$3]);
}
Companion_19.$metadata$ = objectMeta('Companion');
var Companion_instance_19;
function Companion_getInstance_19() {
if (Companion_instance_19 == null)
new Companion_19();
return Companion_instance_19;
}
function _split($this, t, hull, left) {
var rt = convertRange(t, 0.0, 1.0, $this.x7h_1, $this.y7h_1);
var rt1 = left ? $this.x7h_1 : rt;
var rt2 = left ? rt : $this.y7h_1;
var tmp;
if ($this.w7h_1.u7g() < 2) {
var p1 = $this.s7g(rt1, null, 2, null);
var p2 = $this.s7g(rt2, null, 2, null);
tmp = Bezier_init_$Create$([p1, p2]);
} else {
var indices = left ? Companion_getInstance_19().v7k_1 : Companion_getInstance_19().w7k_1;
tmp = BezierCurveFromIndices(Companion_getInstance_19(), ensureNotNull(indices.m($this.w7h_1.u7g())), ensureNotNull(hull));
}
var curve = tmp;
return new SubBezier(curve, rt1, rt2, $this.z7h_1);
}
function _splitLeft($this, t, hull) {
return _split($this, t, hull, true);
}
function _splitLeft$default($this, t, hull, $mask0, $handler) {
if (!(($mask0 & 4) === 0)) {
hull = $this.w7h_1.u7h(t, null, 2, null);
}
return _splitLeft($this, t, hull);
}
function _splitRight($this, t, hull) {
return _split($this, t, hull, false);
}
function _splitRight$default($this, t, hull, $mask0, $handler) {
if (!(($mask0 & 4) === 0)) {
hull = $this.w7h_1.u7h(t, null, 2, null);
}
return _splitRight($this, t, hull);
}
function SubBezier(curve, t1, t2, parent) {
Companion_getInstance_19();
this.w7h_1 = curve;
this.x7h_1 = t1;
this.y7h_1 = t2;
this.z7h_1 = parent;
}
SubBezier.prototype.m7i = function () {
return this.w7h_1;
};
SubBezier.prototype.q7g = function (t, target) {
return this.w7h_1.q7g(convertRange(t, this.x7h_1, this.y7h_1, 0.0, 1.0), target);
};
SubBezier.prototype.s7g = function (t, target, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
target = Companion_getInstance_8().zp();
return this.q7g(t, target);
};
SubBezier.prototype.b7i = function (t) {
return _splitLeft$default(this, t, null, 4, null);
};
SubBezier.prototype.a7i = function (t) {
return _splitRight$default(this, t, null, 4, null);
};
SubBezier.prototype.toString = function () {
return 'SubBezier[' + get_niceStr(this.x7h_1) + '..' + get_niceStr(this.y7h_1) + '](' + this.w7h_1 + ')';
};
SubBezier.$metadata$ = classMeta('SubBezier');
function Algo() {
}
Algo.$metadata$ = interfaceMeta('Algo');
function Companion_20() {
Companion_instance_20 = this;
}
Companion_20.prototype.x7k = function (width, height, algo) {
return new BinPacker(width, height, algo);
};
Companion_20.prototype.y7k = function (width, height, algo, $mask0, $handler) {
if (!(($mask0 & 4) === 0))
algo = new MaxRects(width, height);
return this.x7k(width, height, algo);
};
Companion_20.$metadata$ = objectMeta('Companion');
var Companion_instance_20;
function Companion_getInstance_20() {
if (Companion_instance_20 == null)
new Companion_20();
return Companion_instance_20;
}
function ImageDoNotFitException(width, height, packer) {
extendThrowable(this, "Size '" + width + 'x' + height + "' doesn't fit in '" + packer.z7k_1 + 'x' + packer.a7l_1 + "'", void 1);
this.d7l_1 = width;
this.e7l_1 = height;
this.f7l_1 = packer;
captureStack(this, ImageDoNotFitException);
}
ImageDoNotFitException.$metadata$ = classMeta('ImageDoNotFitException', undefined, undefined, undefined, undefined, Error.prototype);
function BinPacker(width, height, algo) {
Companion_getInstance_20();
this.z7k_1 = width;
this.a7l_1 = height;
this.b7l_1 = algo;
this.c7l_1 = FastArrayList_init_$Create$();
}
BinPacker.prototype.m71 = function (width, height) {
var tmp0_elvis_lhs = this.g7l(width, height);
var tmp;
if (tmp0_elvis_lhs == null) {
throw new ImageDoNotFitException(width, height, this);
} else {
tmp = tmp0_elvis_lhs;
}
return tmp;
};
BinPacker.prototype.g7l = function (width, height) {
var tmp0_elvis_lhs = this.b7l_1.m71(width, height);
var tmp;
if (tmp0_elvis_lhs == null) {
return null;
} else {
tmp = tmp0_elvis_lhs;
}
var rect = tmp;
var tmp1_this = this;
// Inline function 'kotlin.collections.plusAssign' call
var tmp0_plusAssign = tmp1_this.c7l_1;
tmp0_plusAssign.c(rect);
return rect;
};
BinPacker.$metadata$ = classMeta('BinPacker');
function quickFindPositionForNewNodeBestAreaFit($this, width, height) {
DoubleCompanionObject_getInstance();
var score = 1.7976931348623157E308;
var areaFit;
var bestNode = Companion_getInstance_12().zp();
var tmp0_iterator = $this.h7l_1.j();
while (tmp0_iterator.k()) {
var r = tmp0_iterator.l();
if (r.x71_1 >= width ? r.y71_1 >= height : false) {
areaFit = r.x71_1 * r.y71_1 - width * height;
if (areaFit < score) {
bestNode.v71_1 = r.v71_1;
bestNode.w71_1 = r.w71_1;
bestNode.x71_1 = width;
bestNode.y71_1 = height;
score = areaFit;
}
}
}
return bestNode;
}
function splitFreeNode($this, freeNode, usedNode) {
var newNode;
if (((usedNode.b74() >= freeNode.z73() ? true : usedNode.z73() <= freeNode.v71_1) ? true : usedNode.y73() >= freeNode.a74()) ? true : usedNode.a74() <= freeNode.y73()) {
return false;
}
if (usedNode.v71_1 < freeNode.z73() ? usedNode.z73() > freeNode.v71_1 : false) {
if (usedNode.w71_1 > freeNode.w71_1 ? usedNode.w71_1 < freeNode.a74() : false) {
newNode = freeNode.z4n();
newNode.y71_1 = usedNode.w71_1 - newNode.w71_1;
$this.h7l_1.c(newNode);
}
if (usedNode.a74() < freeNode.a74()) {
newNode = freeNode.z4n();
newNode.r7c(usedNode.a74());
newNode.y71_1 = freeNode.a74() - usedNode.a74();
$this.h7l_1.c(newNode);
}
}
if (usedNode.w71_1 < freeNode.a74() ? usedNode.a74() > freeNode.w71_1 : false) {
if (usedNode.v71_1 > freeNode.v71_1 ? usedNode.v71_1 < freeNode.z73() : false) {
newNode = freeNode.z4n();
newNode.x71_1 = usedNode.v71_1 - newNode.v71_1;
$this.h7l_1.c(newNode);
}
if (usedNode.z73() < freeNode.z73()) {
newNode = freeNode.z4n();
newNode.v71_1 = usedNode.z73();
newNode.x71_1 = freeNode.z73() - usedNode.z73();
$this.h7l_1.c(newNode);
}
}
return true;
}
function pruneFreeList($this) {
var len = $this.h7l_1.i();
var i = 0;
while (i < len) {
var j = i + 1 | 0;
var tmpRect = $this.h7l_1.m(i);
$l$loop: while (j < len) {
var tmpRect2 = $this.h7l_1.m(j);
if (Companion_getInstance_12().n7c(tmpRect, tmpRect2)) {
$this.h7l_1.z4(i);
i = i - 1 | 0;
len = len - 1 | 0;
break $l$loop;
}
if (Companion_getInstance_12().n7c(tmpRect2, tmpRect)) {
$this.h7l_1.z4(j);
len = len - 1 | 0;
j = j - 1 | 0;
}
var tmp0 = j;
j = tmp0 + 1 | 0;
}
var tmp1 = i;
i = tmp1 + 1 | 0;
}
}
function MaxRects(maxWidth, maxHeight) {
this.h7l_1 = fastArrayListOf([new Rectangle(0.0, 0.0, maxWidth, maxHeight)]);
}
MaxRects.prototype.m71 = function (width, height) {
return this.i7l(width, height);
};
MaxRects.prototype.i7l = function (width, height) {
if (width <= 0.0 ? height <= 0.0 : false)
return Companion_getInstance_12().k7c(0, 0, 0, 0);
var newNode = quickFindPositionForNewNodeBestAreaFit(this, width, height);
if (newNode.y71_1 === 0.0)
return null;
var numRectanglesToProcess = this.h7l_1.i();
var i = 0;
while (i < numRectanglesToProcess) {
if (splitFreeNode(this, this.h7l_1.m(i), newNode)) {
this.h7l_1.z4(i);
numRectanglesToProcess = numRectanglesToProcess - 1 | 0;
i = i - 1 | 0;
}
var tmp0 = i;
i = tmp0 + 1 | 0;
}
pruneFreeList(this);
return newNode;
};
MaxRects.$metadata$ = classMeta('MaxRects', [Algo]);
function HitTestable() {
}
HitTestable.$metadata$ = interfaceMeta('HitTestable');
var HitTestDirection_ANY_instance;
var HitTestDirection_UP_instance;
var HitTestDirection_RIGHT_instance;
var HitTestDirection_DOWN_instance;
var HitTestDirection_LEFT_instance;
function Companion_21() {
Companion_instance_21 = this;
}
Companion_21.$metadata$ = objectMeta('Companion');
var Companion_instance_21;
function Companion_getInstance_21() {
HitTestDirection_initEntries();
if (Companion_instance_21 == null)
new Companion_21();
return Companion_instance_21;
}
var HitTestDirection_entriesInitialized;
function HitTestDirection_initEntries() {
if (HitTestDirection_entriesInitialized)
return Unit_getInstance();
HitTestDirection_entriesInitialized = true;
HitTestDirection_ANY_instance = new HitTestDirection('ANY', 0);
HitTestDirection_UP_instance = new HitTestDirection('UP', 1);
HitTestDirection_RIGHT_instance = new HitTestDirection('RIGHT', 2);
HitTestDirection_DOWN_instance = new HitTestDirection('DOWN', 3);
HitTestDirection_LEFT_instance = new HitTestDirection('LEFT', 4);
Companion_getInstance_21();
}
function HitTestDirection(name, ordinal) {
Enum.call(this, name, ordinal);
}
HitTestDirection.$metadata$ = classMeta('HitTestDirection', undefined, undefined, undefined, undefined, Enum.prototype);
function HitTestDirection_ANY_getInstance() {
HitTestDirection_initEntries();
return HitTestDirection_ANY_instance;
}
function Convex() {
Convex_instance = this;
}
Convex.prototype.r7j = function (curves) {
var tmp0_elvis_lhs = toNonCurveSimplePointList$default(curves, null, 1, null);
var tmp;
if (tmp0_elvis_lhs == null) {
return false;
} else {
tmp = tmp0_elvis_lhs;
}
var points = tmp;
return this.j7l(points);
};
Convex.prototype.j7l = function (vertices) {
var base = 0;
var n = vertices.i();
var TWO_PI = get_PI2();
if (n <= 3)
return true;
if (vertices.p71(base) === vertices.p71(n - 1 | 0) ? vertices.q71(base) === vertices.q71(n - 1 | 0) : false) {
var tmp0 = n;
n = tmp0 - 1 | 0;
}
var old_x = vertices.p71(n - 2 | 0);
var old_y = vertices.q71(n - 2 | 0);
var new_x = vertices.p71(n - 1 | 0);
var new_y = vertices.q71(n - 1 | 0);
var tmp$ret$0;
// Inline function 'kotlin.math.atan2' call
var tmp0_atan2 = new_y - old_y;
var tmp1_atan2 = new_x - old_x;
tmp$ret$0 = Math.atan2(tmp0_atan2, tmp1_atan2);
var new_direction = tmp$ret$0;
var old_direction;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp2__get_ZERO__ccqkbr = Companion_getInstance_0();
tmp$ret$1 = tmp2__get_ZERO__ccqkbr.f70(0.0);
var angle_sum = tmp$ret$1;
var orientation = 0.0;
var inductionVariable = 0;
var last = n;
if (inductionVariable < last)
do {
var i = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
old_x = new_x;
old_y = new_y;
old_direction = new_direction;
var tmp2 = base;
base = tmp2 + 1 | 0;
var p = tmp2;
new_x = vertices.p71(p);
new_y = vertices.q71(p);
var tmp$ret$2;
// Inline function 'kotlin.math.atan2' call
var tmp3_atan2 = new_y - old_y;
var tmp4_atan2 = new_x - old_x;
tmp$ret$2 = Math.atan2(tmp3_atan2, tmp4_atan2);
new_direction = tmp$ret$2;
if (old_x === new_x ? old_y === new_y : false) {
return false;
}
var angle = new_direction - old_direction;
if (angle <= -get_PI())
angle = angle + TWO_PI;
else if (angle > get_PI())
angle = angle - TWO_PI;
if (i === 0) {
if (angle === 0.0) {
return false;
}
orientation = angle > 0.0 ? 1.0 : -1.0;
} else if (orientation * angle < 0.0) {
return false;
}
var tmp = angle_sum;
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.Companion.fromRadians' call
var tmp5_fromRadians = Companion_getInstance_0();
var tmp6_fromRadians = angle;
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.Companion.radiansToRatio' call
tmp$ret$3 = tmp6_fromRadians / get_PI2();
tmp$ret$4 = tmp5_fromRadians.f70(tmp$ret$3);
angle_sum = plus_0(tmp, tmp$ret$4);
}
while (inductionVariable < last);
var tmp$ret$5;
// Inline function 'kotlin.math.absoluteValue' call
var tmp7__get_absoluteValue__mppjag = _Angle___get_ratio__impl__ap3on4(angle_sum);
tmp$ret$5 = Math.abs(tmp7__get_absoluteValue__mppjag);
var tmp_0 = tmp$ret$5;
return isAlmostEquals$default(1.0, tmp_0, 0.0, 2, null);
};
Convex.$metadata$ = objectMeta('Convex');
var Convex_instance;
function Convex_getInstance() {
if (Convex_instance == null)
new Convex();
return Convex_instance;
}
function emitPoints2(_this__u8e3s4, flush, joint, emit) {
var ix = 0.0;
var iy = 0.0;
var lx = {_v: 0.0};
var ly = {_v: 0.0};
flush(false);
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = _this__u8e3s4.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp2__anonymous__z9zvc9 = _this__u8e3s4.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp3__anonymous__ufb84q = _this__u8e3s4.g7j_1.m(tmp2);
ix = tmp2__anonymous__z9zvc9;
iy = tmp3__anonymous__ufb84q;
emit(tmp2__anonymous__z9zvc9, tmp3__anonymous__ufb84q, true);
lx._v = tmp2__anonymous__z9zvc9;
ly._v = tmp3__anonymous__ufb84q;
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp4__anonymous__pkmkx7 = _this__u8e3s4.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp5__anonymous__kpxxpo = _this__u8e3s4.g7j_1.m(tmp4);
emit(tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, false);
lx._v = tmp4__anonymous__pkmkx7;
ly._v = tmp5__anonymous__kpxxpo;
joint(false);
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp6__anonymous__fv9ai5 = _this__u8e3s4.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp7__anonymous__b0knam = _this__u8e3s4.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp8__anonymous__65w033 = _this__u8e3s4.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp9__anonymous__1b7cvk = _this__u8e3s4.g7j_1.m(tmp8);
var sum = Companion_getInstance_8().i7a(lx._v, ly._v, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam) + Companion_getInstance_8().i7a(tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve = numberToInt(sum);
var tmp$ret$0;
// Inline function 'kotlin.math.max' call
tmp$ret$0 = Math.max(tmp0_approximateCurve, 20);
var rcurveSteps = tmp$ret$0;
var dt = 1.0 / rcurveSteps;
var lastX = {_v: 0.0};
var lastY = {_v: 0.0};
var prevX = {_v: 0.0};
var prevY = {_v: 0.0};
var emittedCount = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc = Companion_getInstance_18();
var tmp1_quadCalc = lx._v;
var tmp2_quadCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1 = 1.0;
var a = t1 * t1;
var c = 0.0;
var b = 2 * t1 * 0.0;
var tmp3__anonymous__ufb84q_0 = a * tmp1_quadCalc + b * tmp6__anonymous__fv9ai5 + c * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_0 = a * tmp2_quadCalc + b * tmp7__anonymous__b0knam + c * tmp9__anonymous__1b7cvk;
lastX._v = tmp3__anonymous__ufb84q_0;
lastY._v = tmp4__anonymous__pkmkx7_0;
tmp$ret$1 = Unit_getInstance();
var nStart = false ? 0 : 1;
var nEnd = rcurveSteps;
var inductionVariable = nStart;
if (inductionVariable <= nEnd)
do {
var n_1 = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n_1 * dt;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc_0 = Companion_getInstance_18();
var tmp1_quadCalc_0 = lx._v;
var tmp2_quadCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1_0 = 1 - ratio;
var a_0 = t1_0 * t1_0;
var c_0 = ratio * ratio;
var b_0 = 2 * t1_0 * ratio;
var tmp3__anonymous__ufb84q_1 = a_0 * tmp1_quadCalc_0 + b_0 * tmp6__anonymous__fv9ai5 + c_0 * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_1 = a_0 * tmp2_quadCalc_0 + b_0 * tmp7__anonymous__b0knam + c_0 * tmp9__anonymous__1b7cvk;
var tmp$ret$2;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
emit(tmp3__anonymous__ufb84q_1, tmp4__anonymous__pkmkx7_1, false);
var tmp0_0 = emittedCount._v;
emittedCount._v = tmp0_0 + 1 | 0;
lastX._v = prevX._v;
lastY._v = prevY._v;
tmp$ret$2 = Unit_getInstance();
prevX._v = tmp3__anonymous__ufb84q_1;
prevY._v = tmp4__anonymous__pkmkx7_1;
tmp$ret$3 = Unit_getInstance();
}
while (!(n_1 === nEnd));
lx._v = tmp8__anonymous__65w033;
ly._v = tmp9__anonymous__1b7cvk;
joint(false);
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp10__anonymous__yfiz50 = _this__u8e3s4.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp11__anonymous__tkubxh = _this__u8e3s4.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp12__anonymous__oq5opy = _this__u8e3s4.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp13__anonymous__jvh1if = _this__u8e3s4.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp14__anonymous__f0seaw = _this__u8e3s4.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp15__anonymous__a63r3d = _this__u8e3s4.g7j_1.m(tmp14);
var sum_0 = Companion_getInstance_8().i7a(lx._v, ly._v, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh) + Companion_getInstance_8().i7a(tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if) + Companion_getInstance_8().i7a(tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if, tmp14__anonymous__f0seaw, tmp15__anonymous__a63r3d);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve_0 = numberToInt(sum_0);
var tmp$ret$4;
// Inline function 'kotlin.math.max' call
tmp$ret$4 = Math.max(tmp0_approximateCurve_0, 20);
var rcurveSteps_0 = tmp$ret$4;
var dt_0 = 1.0 / rcurveSteps_0;
var lastX_0 = {_v: 0.0};
var lastY_0 = {_v: 0.0};
var prevX_0 = {_v: 0.0};
var prevY_0 = {_v: 0.0};
var emittedCount_0 = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc = Companion_getInstance_18();
var tmp1_cubicCalc = lx._v;
var tmp2_cubicCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc);
var bx = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx;
var ax = tmp14__anonymous__f0seaw - tmp1_cubicCalc - cx - bx;
var cy = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc);
var by = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy;
var ay = tmp15__anonymous__a63r3d - tmp2_cubicCalc - cy - by;
var tSquared = 0.0;
var tCubed = tSquared * 0.0;
var tmp3__anonymous__ufb84q_2 = ax * tCubed + bx * tSquared + cx * 0.0 + tmp1_cubicCalc;
var tmp4__anonymous__pkmkx7_2 = ay * tCubed + by * tSquared + cy * 0.0 + tmp2_cubicCalc;
lastX_0._v = tmp3__anonymous__ufb84q_2;
lastY_0._v = tmp4__anonymous__pkmkx7_2;
tmp$ret$5 = Unit_getInstance();
var nStart_0 = false ? 0 : 1;
var nEnd_0 = rcurveSteps_0;
var inductionVariable_0 = nStart_0;
if (inductionVariable_0 <= nEnd_0)
do {
var n_2 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var ratio_0 = n_2 * dt_0;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc_0 = Companion_getInstance_18();
var tmp1_cubicCalc_0 = lx._v;
var tmp2_cubicCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx_0 = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc_0);
var bx_0 = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx_0;
var ax_0 = tmp14__anonymous__f0seaw - tmp1_cubicCalc_0 - cx_0 - bx_0;
var cy_0 = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc_0);
var by_0 = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy_0;
var ay_0 = tmp15__anonymous__a63r3d - tmp2_cubicCalc_0 - cy_0 - by_0;
var tSquared_0 = ratio_0 * ratio_0;
var tCubed_0 = tSquared_0 * ratio_0;
var tmp3__anonymous__ufb84q_3 = ax_0 * tCubed_0 + bx_0 * tSquared_0 + cx_0 * ratio_0 + tmp1_cubicCalc_0;
var tmp4__anonymous__pkmkx7_3 = ay_0 * tCubed_0 + by_0 * tSquared_0 + cy_0 * ratio_0 + tmp2_cubicCalc_0;
var tmp$ret$6;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
emit(tmp3__anonymous__ufb84q_3, tmp4__anonymous__pkmkx7_3, false);
var tmp0_1 = emittedCount_0._v;
emittedCount_0._v = tmp0_1 + 1 | 0;
lastX_0._v = prevX_0._v;
lastY_0._v = prevY_0._v;
tmp$ret$6 = Unit_getInstance();
prevX_0._v = tmp3__anonymous__ufb84q_3;
prevY_0._v = tmp4__anonymous__pkmkx7_3;
tmp$ret$7 = Unit_getInstance();
}
while (!(n_2 === nEnd_0));
lx._v = tmp14__anonymous__f0seaw;
ly._v = tmp15__anonymous__a63r3d;
joint(false);
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
emit(ix, iy, false);
joint(true);
flush(true);
}
}
}
}
}
}
flush(false);
}
function approximateCurve(curveSteps, compute, emit, includeStart, includeEnd) {
var tmp$ret$0;
// Inline function 'kotlin.math.max' call
tmp$ret$0 = Math.max(curveSteps, 20);
var rcurveSteps = tmp$ret$0;
var dt = 1.0 / rcurveSteps;
var lastX = {_v: 0.0};
var lastY = {_v: 0.0};
var prevX = {_v: 0.0};
var prevY = {_v: 0.0};
var emittedCount = {_v: 0};
compute(0.0, approximateCurve$lambda(lastX, lastY));
var nStart = includeStart ? 0 : 1;
var nEnd = includeEnd ? rcurveSteps : rcurveSteps - 1 | 0;
var inductionVariable = nStart;
if (inductionVariable <= nEnd)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n * dt;
compute(ratio, approximateCurve$lambda_0(emit, emittedCount, lastX, prevX, lastY, prevY));
}
while (!(n === nEnd));
}
function buildVectorPath(out, block) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
block(out);
tmp$ret$0 = out;
return tmp$ret$0;
}
function getPoints2(_this__u8e3s4, out) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2' call
var ix = 0.0;
var iy = 0.0;
var lx = {_v: 0.0};
var ly = {_v: 0.0};
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$0 = Unit_getInstance();
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = _this__u8e3s4.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp2__anonymous__z9zvc9 = _this__u8e3s4.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp3__anonymous__ufb84q = _this__u8e3s4.g7j_1.m(tmp2);
ix = tmp2__anonymous__z9zvc9;
iy = tmp3__anonymous__ufb84q;
// Inline function 'com.soywiz.korma.geom.shape.getPoints2.<anonymous>' call
out.m71(tmp2__anonymous__z9zvc9, tmp3__anonymous__ufb84q);
lx._v = tmp2__anonymous__z9zvc9;
ly._v = tmp3__anonymous__ufb84q;
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp4__anonymous__pkmkx7 = _this__u8e3s4.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp5__anonymous__kpxxpo = _this__u8e3s4.g7j_1.m(tmp4);
// Inline function 'com.soywiz.korma.geom.shape.getPoints2.<anonymous>' call
out.m71(tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo);
lx._v = tmp4__anonymous__pkmkx7;
ly._v = tmp5__anonymous__kpxxpo;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$1 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp6__anonymous__fv9ai5 = _this__u8e3s4.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp7__anonymous__b0knam = _this__u8e3s4.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp8__anonymous__65w033 = _this__u8e3s4.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp9__anonymous__1b7cvk = _this__u8e3s4.g7j_1.m(tmp8);
var sum = Companion_getInstance_8().i7a(lx._v, ly._v, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam) + Companion_getInstance_8().i7a(tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve = numberToInt(sum);
var tmp$ret$2;
// Inline function 'kotlin.math.max' call
tmp$ret$2 = Math.max(tmp0_approximateCurve, 20);
var rcurveSteps = tmp$ret$2;
var dt = 1.0 / rcurveSteps;
var lastX = {_v: 0.0};
var lastY = {_v: 0.0};
var prevX = {_v: 0.0};
var prevY = {_v: 0.0};
var emittedCount = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc = Companion_getInstance_18();
var tmp1_quadCalc = lx._v;
var tmp2_quadCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1 = 1.0;
var a = t1 * t1;
var c = 0.0;
var b = 2 * t1 * 0.0;
var tmp3__anonymous__ufb84q_0 = a * tmp1_quadCalc + b * tmp6__anonymous__fv9ai5 + c * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_0 = a * tmp2_quadCalc + b * tmp7__anonymous__b0knam + c * tmp9__anonymous__1b7cvk;
lastX._v = tmp3__anonymous__ufb84q_0;
lastY._v = tmp4__anonymous__pkmkx7_0;
tmp$ret$3 = Unit_getInstance();
var nStart = false ? 0 : 1;
var nEnd = rcurveSteps;
var inductionVariable = nStart;
if (inductionVariable <= nEnd)
do {
var n_1 = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n_1 * dt;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc_0 = Companion_getInstance_18();
var tmp1_quadCalc_0 = lx._v;
var tmp2_quadCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1_0 = 1 - ratio;
var a_0 = t1_0 * t1_0;
var c_0 = ratio * ratio;
var b_0 = 2 * t1_0 * ratio;
var tmp3__anonymous__ufb84q_1 = a_0 * tmp1_quadCalc_0 + b_0 * tmp6__anonymous__fv9ai5 + c_0 * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_1 = a_0 * tmp2_quadCalc_0 + b_0 * tmp7__anonymous__b0knam + c_0 * tmp9__anonymous__1b7cvk;
var tmp$ret$4;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.shape.getPoints2.<anonymous>' call
out.m71(tmp3__anonymous__ufb84q_1, tmp4__anonymous__pkmkx7_1);
var tmp0_0 = emittedCount._v;
emittedCount._v = tmp0_0 + 1 | 0;
lastX._v = prevX._v;
lastY._v = prevY._v;
tmp$ret$4 = Unit_getInstance();
prevX._v = tmp3__anonymous__ufb84q_1;
prevY._v = tmp4__anonymous__pkmkx7_1;
tmp$ret$5 = Unit_getInstance();
}
while (!(n_1 === nEnd));
lx._v = tmp8__anonymous__65w033;
ly._v = tmp9__anonymous__1b7cvk;
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$6 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp10__anonymous__yfiz50 = _this__u8e3s4.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp11__anonymous__tkubxh = _this__u8e3s4.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp12__anonymous__oq5opy = _this__u8e3s4.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp13__anonymous__jvh1if = _this__u8e3s4.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp14__anonymous__f0seaw = _this__u8e3s4.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp15__anonymous__a63r3d = _this__u8e3s4.g7j_1.m(tmp14);
var sum_0 = Companion_getInstance_8().i7a(lx._v, ly._v, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh) + Companion_getInstance_8().i7a(tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if) + Companion_getInstance_8().i7a(tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if, tmp14__anonymous__f0seaw, tmp15__anonymous__a63r3d);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve_0 = numberToInt(sum_0);
var tmp$ret$7;
// Inline function 'kotlin.math.max' call
tmp$ret$7 = Math.max(tmp0_approximateCurve_0, 20);
var rcurveSteps_0 = tmp$ret$7;
var dt_0 = 1.0 / rcurveSteps_0;
var lastX_0 = {_v: 0.0};
var lastY_0 = {_v: 0.0};
var prevX_0 = {_v: 0.0};
var prevY_0 = {_v: 0.0};
var emittedCount_0 = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc = Companion_getInstance_18();
var tmp1_cubicCalc = lx._v;
var tmp2_cubicCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc);
var bx = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx;
var ax = tmp14__anonymous__f0seaw - tmp1_cubicCalc - cx - bx;
var cy = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc);
var by = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy;
var ay = tmp15__anonymous__a63r3d - tmp2_cubicCalc - cy - by;
var tSquared = 0.0;
var tCubed = tSquared * 0.0;
var tmp3__anonymous__ufb84q_2 = ax * tCubed + bx * tSquared + cx * 0.0 + tmp1_cubicCalc;
var tmp4__anonymous__pkmkx7_2 = ay * tCubed + by * tSquared + cy * 0.0 + tmp2_cubicCalc;
lastX_0._v = tmp3__anonymous__ufb84q_2;
lastY_0._v = tmp4__anonymous__pkmkx7_2;
tmp$ret$8 = Unit_getInstance();
var nStart_0 = false ? 0 : 1;
var nEnd_0 = rcurveSteps_0;
var inductionVariable_0 = nStart_0;
if (inductionVariable_0 <= nEnd_0)
do {
var n_2 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var ratio_0 = n_2 * dt_0;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$10;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc_0 = Companion_getInstance_18();
var tmp1_cubicCalc_0 = lx._v;
var tmp2_cubicCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx_0 = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc_0);
var bx_0 = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx_0;
var ax_0 = tmp14__anonymous__f0seaw - tmp1_cubicCalc_0 - cx_0 - bx_0;
var cy_0 = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc_0);
var by_0 = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy_0;
var ay_0 = tmp15__anonymous__a63r3d - tmp2_cubicCalc_0 - cy_0 - by_0;
var tSquared_0 = ratio_0 * ratio_0;
var tCubed_0 = tSquared_0 * ratio_0;
var tmp3__anonymous__ufb84q_3 = ax_0 * tCubed_0 + bx_0 * tSquared_0 + cx_0 * ratio_0 + tmp1_cubicCalc_0;
var tmp4__anonymous__pkmkx7_3 = ay_0 * tCubed_0 + by_0 * tSquared_0 + cy_0 * ratio_0 + tmp2_cubicCalc_0;
var tmp$ret$9;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.shape.getPoints2.<anonymous>' call
out.m71(tmp3__anonymous__ufb84q_3, tmp4__anonymous__pkmkx7_3);
var tmp0_1 = emittedCount_0._v;
emittedCount_0._v = tmp0_1 + 1 | 0;
lastX_0._v = prevX_0._v;
lastY_0._v = prevY_0._v;
tmp$ret$9 = Unit_getInstance();
prevX_0._v = tmp3__anonymous__ufb84q_3;
prevY_0._v = tmp4__anonymous__pkmkx7_3;
tmp$ret$10 = Unit_getInstance();
}
while (!(n_2 === nEnd_0));
lx._v = tmp14__anonymous__f0seaw;
ly._v = tmp15__anonymous__a63r3d;
var tmp$ret$11;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$11 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.shape.getPoints2.<anonymous>' call
var tmp0__anonymous__q1qw7t = ix;
var tmp1__anonymous__uwfjfc_0 = iy;
out.m71(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc_0);
var tmp$ret$12;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$12 = Unit_getInstance();
var tmp$ret$13;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$13 = Unit_getInstance();
}
}
}
}
}
}
var tmp$ret$14;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$14 = Unit_getInstance();
return out;
}
function getPoints2$default(_this__u8e3s4, out, $mask0, $handler) {
if (!(($mask0 & 1) === 0)) {
out = PointArrayList_init_$Create$(0, 1, null);
}
return getPoints2(_this__u8e3s4, out);
}
function WithHitShape2d() {
}
WithHitShape2d.$metadata$ = interfaceMeta('WithHitShape2d');
function getPoints2List(_this__u8e3s4) {
var tmp$ret$0;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$0 = ArrayList_init_$Create$();
var out = tmp$ret$0;
var current = {_v: PointArrayList_init_$Create$(0, 1, null)};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2' call
var ix = 0.0;
var iy = 0.0;
var lx = {_v: 0.0};
var ly = {_v: 0.0};
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$1 = Unit_getInstance();
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = _this__u8e3s4.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp2__anonymous__z9zvc9 = _this__u8e3s4.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp3__anonymous__ufb84q = _this__u8e3s4.g7j_1.m(tmp2);
ix = tmp2__anonymous__z9zvc9;
iy = tmp3__anonymous__ufb84q;
// Inline function 'com.soywiz.korma.geom.shape.getPoints2List.<anonymous>' call
{
getPoints2List$flush(current, out);
}
current._v.m71(tmp2__anonymous__z9zvc9, tmp3__anonymous__ufb84q);
lx._v = tmp2__anonymous__z9zvc9;
ly._v = tmp3__anonymous__ufb84q;
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp4__anonymous__pkmkx7 = _this__u8e3s4.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp5__anonymous__kpxxpo = _this__u8e3s4.g7j_1.m(tmp4);
// Inline function 'com.soywiz.korma.geom.shape.getPoints2List.<anonymous>' call
if (false) {
getPoints2List$flush(current, out);
}
current._v.m71(tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo);
lx._v = tmp4__anonymous__pkmkx7;
ly._v = tmp5__anonymous__kpxxpo;
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$2 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp6__anonymous__fv9ai5 = _this__u8e3s4.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp7__anonymous__b0knam = _this__u8e3s4.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp8__anonymous__65w033 = _this__u8e3s4.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp9__anonymous__1b7cvk = _this__u8e3s4.g7j_1.m(tmp8);
var sum = Companion_getInstance_8().i7a(lx._v, ly._v, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam) + Companion_getInstance_8().i7a(tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve = numberToInt(sum);
var tmp$ret$3;
// Inline function 'kotlin.math.max' call
tmp$ret$3 = Math.max(tmp0_approximateCurve, 20);
var rcurveSteps = tmp$ret$3;
var dt = 1.0 / rcurveSteps;
var lastX = {_v: 0.0};
var lastY = {_v: 0.0};
var prevX = {_v: 0.0};
var prevY = {_v: 0.0};
var emittedCount = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc = Companion_getInstance_18();
var tmp1_quadCalc = lx._v;
var tmp2_quadCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1 = 1.0;
var a = t1 * t1;
var c = 0.0;
var b = 2 * t1 * 0.0;
var tmp3__anonymous__ufb84q_0 = a * tmp1_quadCalc + b * tmp6__anonymous__fv9ai5 + c * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_0 = a * tmp2_quadCalc + b * tmp7__anonymous__b0knam + c * tmp9__anonymous__1b7cvk;
lastX._v = tmp3__anonymous__ufb84q_0;
lastY._v = tmp4__anonymous__pkmkx7_0;
tmp$ret$4 = Unit_getInstance();
var nStart = false ? 0 : 1;
var nEnd = rcurveSteps;
var inductionVariable = nStart;
if (inductionVariable <= nEnd)
do {
var n_1 = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n_1 * dt;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc_0 = Companion_getInstance_18();
var tmp1_quadCalc_0 = lx._v;
var tmp2_quadCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1_0 = 1 - ratio;
var a_0 = t1_0 * t1_0;
var c_0 = ratio * ratio;
var b_0 = 2 * t1_0 * ratio;
var tmp3__anonymous__ufb84q_1 = a_0 * tmp1_quadCalc_0 + b_0 * tmp6__anonymous__fv9ai5 + c_0 * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_1 = a_0 * tmp2_quadCalc_0 + b_0 * tmp7__anonymous__b0knam + c_0 * tmp9__anonymous__1b7cvk;
var tmp$ret$5;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.shape.getPoints2List.<anonymous>' call
if (false) {
getPoints2List$flush(current, out);
}
current._v.m71(tmp3__anonymous__ufb84q_1, tmp4__anonymous__pkmkx7_1);
var tmp0_0 = emittedCount._v;
emittedCount._v = tmp0_0 + 1 | 0;
lastX._v = prevX._v;
lastY._v = prevY._v;
tmp$ret$5 = Unit_getInstance();
prevX._v = tmp3__anonymous__ufb84q_1;
prevY._v = tmp4__anonymous__pkmkx7_1;
tmp$ret$6 = Unit_getInstance();
}
while (!(n_1 === nEnd));
lx._v = tmp8__anonymous__65w033;
ly._v = tmp9__anonymous__1b7cvk;
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$7 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp10__anonymous__yfiz50 = _this__u8e3s4.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp11__anonymous__tkubxh = _this__u8e3s4.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp12__anonymous__oq5opy = _this__u8e3s4.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp13__anonymous__jvh1if = _this__u8e3s4.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp14__anonymous__f0seaw = _this__u8e3s4.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp15__anonymous__a63r3d = _this__u8e3s4.g7j_1.m(tmp14);
var sum_0 = Companion_getInstance_8().i7a(lx._v, ly._v, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh) + Companion_getInstance_8().i7a(tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if) + Companion_getInstance_8().i7a(tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if, tmp14__anonymous__f0seaw, tmp15__anonymous__a63r3d);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve_0 = numberToInt(sum_0);
var tmp$ret$8;
// Inline function 'kotlin.math.max' call
tmp$ret$8 = Math.max(tmp0_approximateCurve_0, 20);
var rcurveSteps_0 = tmp$ret$8;
var dt_0 = 1.0 / rcurveSteps_0;
var lastX_0 = {_v: 0.0};
var lastY_0 = {_v: 0.0};
var prevX_0 = {_v: 0.0};
var prevY_0 = {_v: 0.0};
var emittedCount_0 = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$9;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc = Companion_getInstance_18();
var tmp1_cubicCalc = lx._v;
var tmp2_cubicCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc);
var bx = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx;
var ax = tmp14__anonymous__f0seaw - tmp1_cubicCalc - cx - bx;
var cy = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc);
var by = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy;
var ay = tmp15__anonymous__a63r3d - tmp2_cubicCalc - cy - by;
var tSquared = 0.0;
var tCubed = tSquared * 0.0;
var tmp3__anonymous__ufb84q_2 = ax * tCubed + bx * tSquared + cx * 0.0 + tmp1_cubicCalc;
var tmp4__anonymous__pkmkx7_2 = ay * tCubed + by * tSquared + cy * 0.0 + tmp2_cubicCalc;
lastX_0._v = tmp3__anonymous__ufb84q_2;
lastY_0._v = tmp4__anonymous__pkmkx7_2;
tmp$ret$9 = Unit_getInstance();
var nStart_0 = false ? 0 : 1;
var nEnd_0 = rcurveSteps_0;
var inductionVariable_0 = nStart_0;
if (inductionVariable_0 <= nEnd_0)
do {
var n_2 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var ratio_0 = n_2 * dt_0;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$11;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc_0 = Companion_getInstance_18();
var tmp1_cubicCalc_0 = lx._v;
var tmp2_cubicCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx_0 = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc_0);
var bx_0 = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx_0;
var ax_0 = tmp14__anonymous__f0seaw - tmp1_cubicCalc_0 - cx_0 - bx_0;
var cy_0 = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc_0);
var by_0 = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy_0;
var ay_0 = tmp15__anonymous__a63r3d - tmp2_cubicCalc_0 - cy_0 - by_0;
var tSquared_0 = ratio_0 * ratio_0;
var tCubed_0 = tSquared_0 * ratio_0;
var tmp3__anonymous__ufb84q_3 = ax_0 * tCubed_0 + bx_0 * tSquared_0 + cx_0 * ratio_0 + tmp1_cubicCalc_0;
var tmp4__anonymous__pkmkx7_3 = ay_0 * tCubed_0 + by_0 * tSquared_0 + cy_0 * ratio_0 + tmp2_cubicCalc_0;
var tmp$ret$10;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.shape.getPoints2List.<anonymous>' call
if (false) {
getPoints2List$flush(current, out);
}
current._v.m71(tmp3__anonymous__ufb84q_3, tmp4__anonymous__pkmkx7_3);
var tmp0_1 = emittedCount_0._v;
emittedCount_0._v = tmp0_1 + 1 | 0;
lastX_0._v = prevX_0._v;
lastY_0._v = prevY_0._v;
tmp$ret$10 = Unit_getInstance();
prevX_0._v = tmp3__anonymous__ufb84q_3;
prevY_0._v = tmp4__anonymous__pkmkx7_3;
tmp$ret$11 = Unit_getInstance();
}
while (!(n_2 === nEnd_0));
lx._v = tmp14__anonymous__f0seaw;
ly._v = tmp15__anonymous__a63r3d;
var tmp$ret$12;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$12 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.shape.getPoints2List.<anonymous>' call
var tmp0__anonymous__q1qw7t = ix;
var tmp1__anonymous__uwfjfc_0 = iy;
if (false) {
getPoints2List$flush(current, out);
}
current._v.m71(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc_0);
var tmp$ret$13;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$13 = Unit_getInstance();
var tmp$ret$14;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$14 = Unit_getInstance();
}
}
}
}
}
}
var tmp$ret$15;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$15 = Unit_getInstance();
getPoints2List$flush(current, out);
return out;
}
function getPoints2List$flush(current, out) {
if (!current._v.t4o())
return Unit_getInstance();
out.c(current._v);
current._v = PointArrayList_init_$Create$(0, 1, null);
}
function approximateCurve$lambda($lastX, $lastY) {
return function (x, y) {
$lastX._v = x;
$lastY._v = y;
return Unit_getInstance();
};
}
function approximateCurve$lambda_0($emit, $emittedCount, $lastX, $prevX, $lastY, $prevY) {
return function (x, y) {
var tmp$ret$0;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
$emit(x, y);
var tmp0 = $emittedCount._v;
$emittedCount._v = tmp0 + 1 | 0;
$lastX._v = $prevX._v;
$lastY._v = $prevY._v;
tmp$ret$0 = Unit_getInstance();
$prevX._v = x;
$prevY._v = y;
return Unit_getInstance();
};
}
function _Item___init__impl__hhk1le(index) {
return index;
}
function _Item___get_index__impl__lpanhd($this) {
return $this;
}
function Item__use_impl_ynrnd3($this, segments, block) {
return block(segments, new Item($this));
}
function Item__toString_impl_d711m6($this) {
return 'Item(index=' + $this + ')';
}
function Item__hashCode_impl_8k4v6p($this) {
return $this;
}
function Item__equals_impl_qczid($this, other) {
if (!(other instanceof Item))
return false;
var tmp0_other_with_cast = other instanceof Item ? other.k7l_1 : THROW_CCE();
if (!($this === tmp0_other_with_cast))
return false;
return true;
}
function FSegmentsInt_init_$Init$(capacity, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
capacity = 5;
FSegmentsInt.call($this, capacity);
return $this;
}
function FSegmentsInt_init_$Create$(capacity, $mask0, $marker) {
return FSegmentsInt_init_$Init$(capacity, $mask0, $marker, Object.create(FSegmentsInt.prototype));
}
function Companion_22() {
Companion_instance_22 = this;
}
Companion_22.$metadata$ = objectMeta('Companion');
var Companion_instance_22;
function Companion_getInstance_22() {
if (Companion_instance_22 == null)
new Companion_22();
return Companion_instance_22;
}
function SortOps_0(gen) {
SortOps.call(this);
this.l7l_1 = gen;
}
SortOps_0.prototype.m7l = function (subject, l, r) {
var tmp$ret$0;
// Inline function 'kotlin.compareTo' call
var tmp0_compareTo = this.l7l_1(subject, new Item(_Item___init__impl__hhk1le(l)));
var tmp1_compareTo = this.l7l_1(subject, new Item(_Item___init__impl__hhk1le(r)));
tmp$ret$0 = compareTo(tmp0_compareTo, tmp1_compareTo);
return tmp$ret$0;
};
SortOps_0.prototype.a4p = function (subject, l, r) {
return this.m7l(subject instanceof FSegmentsInt ? subject : THROW_CCE(), l, r);
};
SortOps_0.prototype.n7l = function (subject, indexL, indexR) {
return subject.p7l(_Item___init__impl__hhk1le(indexL), _Item___init__impl__hhk1le(indexR));
};
SortOps_0.prototype.c4p = function (subject, indexL, indexR) {
return this.n7l(subject instanceof FSegmentsInt ? subject : THROW_CCE(), indexL, indexR);
};
SortOps_0.$metadata$ = classMeta('SortOps', undefined, undefined, undefined, undefined, SortOps.prototype);
function Item(index) {
this.k7l_1 = index;
}
Item.prototype.toString = function () {
return Item__toString_impl_d711m6(this.k7l_1);
};
Item.prototype.hashCode = function () {
return Item__hashCode_impl_8k4v6p(this.k7l_1);
};
Item.prototype.equals = function (other) {
return Item__equals_impl_qczid(this.k7l_1, other);
};
Item.$metadata$ = classMeta('Item');
function FSegmentsInt(capacity) {
Companion_getInstance_22();
this.o7l_1 = new IntArrayList(imul(capacity, 4));
}
FSegmentsInt.prototype.q7l = function (block) {
var tmp$ret$0;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
tmp$ret$0 = block(this);
return tmp$ret$0;
};
FSegmentsInt.prototype.i = function () {
return this.o7l_1.i() / 4 | 0;
};
FSegmentsInt.prototype.z4n = function () {
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also = new FSegmentsInt(this.i());
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.clone.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.clone.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t = this.r7l(n);
tmp0_also.w7l(this.s7l(tmp0__anonymous__q1qw7t), this.t7l(tmp0__anonymous__q1qw7t), this.u7l(tmp0__anonymous__q1qw7t), this.v7l(tmp0__anonymous__q1qw7t));
}
while (inductionVariable < last);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
};
FSegmentsInt.prototype.x7l = function (gen) {
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also = this.z4n();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.sortedBy.<anonymous>' call
tmp0_also.y7l(gen);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
};
FSegmentsInt.prototype.y7l = function (gen) {
genericSort(this, 0, this.i() - 1 | 0, new SortOps_0(gen));
};
FSegmentsInt.prototype.p7l = function (a, b) {
var ax0 = this.s7l(a);
var ay0 = this.t7l(a);
var ax1 = this.u7l(a);
var ay1 = this.v7l(a);
this.z7l(a, this.s7l(b), this.t7l(b), this.u7l(b), this.v7l(b));
this.z7l(b, ax0, ay0, ax1, ay1);
};
FSegmentsInt.prototype.r7l = function (index) {
return _Item___init__impl__hhk1le(index);
};
FSegmentsInt.prototype.a7m = function (index) {
return (0 <= index ? index < this.i() : false) ? this.r7l(index) : null;
};
FSegmentsInt.prototype.b7m = function (block) {
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
block(this, new Item(this.r7l(n)));
}
while (inductionVariable < last);
};
FSegmentsInt.prototype.c7m = function (block) {
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also = fastArrayListOf([]);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t = this.r7l(n);
tmp0_also.c(block(this, new Item(tmp0__anonymous__q1qw7t)));
}
while (inductionVariable < last);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
};
FSegmentsInt.prototype.d7m = function (block) {
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also = FSegmentsInt_init_$Create$(0, 1, null);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.filter.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.filter.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t = this.r7l(n);
if (block(this, new Item(tmp0__anonymous__q1qw7t))) {
tmp0_also.e7m(tmp0__anonymous__q1qw7t, this);
}
}
while (inductionVariable < last);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
};
FSegmentsInt.prototype.f7m = function (_this__u8e3s4, value) {
this.o7l_1.r4o(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 0 | 0, value);
};
FSegmentsInt.prototype.s7l = function (_this__u8e3s4) {
return this.o7l_1.m(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 0 | 0);
};
FSegmentsInt.prototype.g7m = function (_this__u8e3s4, value) {
this.o7l_1.r4o(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 1 | 0, value);
};
FSegmentsInt.prototype.t7l = function (_this__u8e3s4) {
return this.o7l_1.m(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 1 | 0);
};
FSegmentsInt.prototype.h7m = function (_this__u8e3s4, value) {
this.o7l_1.r4o(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 2 | 0, value);
};
FSegmentsInt.prototype.u7l = function (_this__u8e3s4) {
return this.o7l_1.m(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 2 | 0);
};
FSegmentsInt.prototype.i7m = function (_this__u8e3s4, value) {
this.o7l_1.r4o(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 3 | 0, value);
};
FSegmentsInt.prototype.v7l = function (_this__u8e3s4) {
return this.o7l_1.m(imul(_Item___get_index__impl__lpanhd(_this__u8e3s4), 4) + 3 | 0);
};
FSegmentsInt.prototype.z7l = function (_this__u8e3s4, x0, y0, x1, y1) {
this.f7m(_this__u8e3s4, x0);
this.g7m(_this__u8e3s4, y0);
this.h7m(_this__u8e3s4, x1);
this.i7m(_this__u8e3s4, y1);
};
FSegmentsInt.prototype.j7m = function (_this__u8e3s4) {
return this.u7l(_this__u8e3s4) - this.s7l(_this__u8e3s4) | 0;
};
FSegmentsInt.prototype.k7m = function (_this__u8e3s4) {
return this.v7l(_this__u8e3s4) - this.t7l(_this__u8e3s4) | 0;
};
FSegmentsInt.prototype.l7m = function (_this__u8e3s4) {
return this.j7m(_this__u8e3s4) / this.k7m(_this__u8e3s4);
};
FSegmentsInt.prototype.m7m = function (_this__u8e3s4) {
var tmp$ret$0;
// Inline function 'kotlin.comparisons.minOf' call
var tmp0_minOf = this.s7l(_this__u8e3s4);
var tmp1_minOf = this.u7l(_this__u8e3s4);
tmp$ret$0 = Math.min(tmp0_minOf, tmp1_minOf);
return tmp$ret$0;
};
FSegmentsInt.prototype.n7m = function (_this__u8e3s4) {
var tmp$ret$0;
// Inline function 'kotlin.comparisons.minOf' call
var tmp0_minOf = this.t7l(_this__u8e3s4);
var tmp1_minOf = this.v7l(_this__u8e3s4);
tmp$ret$0 = Math.min(tmp0_minOf, tmp1_minOf);
return tmp$ret$0;
};
FSegmentsInt.prototype.o7m = function (_this__u8e3s4) {
var tmp$ret$0;
// Inline function 'kotlin.comparisons.maxOf' call
var tmp0_maxOf = this.t7l(_this__u8e3s4);
var tmp1_maxOf = this.v7l(_this__u8e3s4);
tmp$ret$0 = Math.max(tmp0_maxOf, tmp1_maxOf);
return tmp$ret$0;
};
FSegmentsInt.prototype.p7m = function (_this__u8e3s4, y) {
return this.s7l(_this__u8e3s4) + toIntRound((y - this.t7l(_this__u8e3s4) | 0) * this.l7m(_this__u8e3s4)) | 0;
};
FSegmentsInt.prototype.q7m = function (_this__u8e3s4, y) {
var containsLower = this.n7m(_this__u8e3s4);
return y <= this.o7m(_this__u8e3s4) ? containsLower <= y : false;
};
FSegmentsInt.prototype.r7m = function (_this__u8e3s4, other) {
return Companion_getInstance_24().s7m(this.s7l(_this__u8e3s4), this.t7l(_this__u8e3s4), this.u7l(_this__u8e3s4), this.v7l(_this__u8e3s4), this.s7l(other), this.t7l(other), this.u7l(other), this.v7l(other));
};
FSegmentsInt.prototype.w7l = function (x0, y0, x1, y1) {
var index = this.i();
this.o7l_1.n4o(x0, y0, x1, y1);
return _Item___init__impl__hhk1le(index);
};
FSegmentsInt.prototype.e7m = function (v, segments) {
var tmp$ret$1;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.add.<anonymous>' call
tmp$ret$0 = this.w7l(segments.s7l(v), segments.t7l(v), segments.u7l(v), segments.v7l(v));
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
FSegmentsInt.$metadata$ = classMeta('FSegmentsInt');
function _Item___init__impl__hhk1le_0(index) {
return index;
}
function _Item___get_index__impl__lpanhd_0($this) {
return $this;
}
function Item__toString_impl_d711m6_0($this) {
return 'Item(index=' + $this + ')';
}
function Item__hashCode_impl_8k4v6p_0($this) {
return $this;
}
function Item__equals_impl_qczid_0($this, other) {
if (!(other instanceof Item_0))
return false;
var tmp0_other_with_cast = other instanceof Item_0 ? other.t7m_1 : THROW_CCE();
if (!($this === tmp0_other_with_cast))
return false;
return true;
}
function FTrapezoidsInt_init_$Init$(capacity, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
capacity = 5;
FTrapezoidsInt.call($this, capacity);
return $this;
}
function FTrapezoidsInt_init_$Create$(capacity, $mask0, $marker) {
return FTrapezoidsInt_init_$Init$(capacity, $mask0, $marker, Object.create(FTrapezoidsInt.prototype));
}
function Companion_23() {
Companion_instance_23 = this;
}
Companion_23.$metadata$ = objectMeta('Companion');
var Companion_instance_23;
function Companion_getInstance_23() {
if (Companion_instance_23 == null)
new Companion_23();
return Companion_instance_23;
}
function Item_0(index) {
this.t7m_1 = index;
}
Item_0.prototype.toString = function () {
return Item__toString_impl_d711m6_0(this.t7m_1);
};
Item_0.prototype.hashCode = function () {
return Item__hashCode_impl_8k4v6p_0(this.t7m_1);
};
Item_0.prototype.equals = function (other) {
return Item__equals_impl_qczid_0(this.t7m_1, other);
};
Item_0.$metadata$ = classMeta('Item');
function FTrapezoidsInt(capacity) {
Companion_getInstance_23();
this.u7m_1 = false;
this.v7m_1 = new IntArrayList(imul(capacity, 7));
}
FTrapezoidsInt.prototype.i = function () {
return this.v7m_1.i() / 6 | 0;
};
FTrapezoidsInt.prototype.r7l = function (index) {
return _Item___init__impl__hhk1le_0(index);
};
FTrapezoidsInt.prototype.toString = function () {
return 'FTrapezoidsInt[' + this.i() + ']';
};
FTrapezoidsInt.prototype.w7m = function (x, y, assumeSorted) {
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.trapezoid.FTrapezoidsInt.pointInside' call
var iterations = 0;
var iterations2 = 0;
var found = false;
if (assumeSorted) {
var size = this.i();
var tmp$ret$3;
// Inline function 'com.soywiz.kds.genericBinarySearchResult' call
var tmp0_genericBinarySearchResult = size - 1 | 0;
var tmp$ret$1;
$l$block: {
// Inline function 'com.soywiz.kds.genericBinarySearch' call
var low = 0;
var high = tmp0_genericBinarySearchResult - 1 | 0;
while (low <= high) {
var mid = (low + high | 0) / 2 | 0;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FTrapezoidsInt.pointInside.<anonymous>' call
var tmp0 = iterations2;
iterations2 = tmp0 + 1 | 0;
tmp$ret$0 = compareTo(this.t7l(_Item___init__impl__hhk1le_0(mid)), y);
var mval = tmp$ret$0;
if (mval < 0)
low = mid + 1 | 0;
else if (mval > 0)
high = mid - 1 | 0;
else {
tmp$ret$1 = mid;
break $l$block;
}
}
var tmp$ret$2;
// Inline function 'com.soywiz.kds.genericBinarySearchResult.<anonymous>' call
var tmp0__anonymous__q1qw7t = low;
var tmp1__anonymous__uwfjfc = high;
tmp$ret$2 = (-tmp0__anonymous__q1qw7t | 0) - 1 | 0;
tmp$ret$1 = tmp$ret$2;
}
tmp$ret$3 = _BSearchResult___init__impl__em6zam(tmp$ret$1);
var result = tmp$ret$3;
var index = _BSearchResult___get_nearIndex__impl__s8nq43(result);
$l$loop: while (0 <= index ? index < size : false) {
var item = _Item___init__impl__hhk1le_0(index);
if (y > this.v7l(item))
break $l$loop;
var tmp0_0 = iterations;
iterations = tmp0_0 + 1 | 0;
var tmp1 = index;
index = tmp1 - 1 | 0;
}
var tmp2 = index;
index = tmp2 + 1 | 0;
var inductionVariable = index;
if (inductionVariable < size)
$l$loop_1: do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var tmp4 = iterations;
iterations = tmp4 + 1 | 0;
var item_0 = _Item___init__impl__hhk1le_0(n);
var inside = this.x7m(item_0, x, y);
if (inside) {
found = true;
break $l$loop_1;
}
if (this.t7l(item_0) > y)
break $l$loop_1;
}
while (inductionVariable < size);
} else {
var inductionVariable_0 = 0;
var last = this.i();
if (inductionVariable_0 < last)
$l$loop_2: do {
var n_0 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var tmp6 = iterations;
iterations = tmp6 + 1 | 0;
var it = this.r7l(n_0);
if (this.x7m(it, x, y)) {
found = true;
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.trapezoid.FTrapezoidsInt.pointInside.<anonymous>' call
tmp$ret$4 = Unit_getInstance();
break $l$loop_2;
}
}
while (inductionVariable_0 < last);
}
if (!(null == null)) {
null.z7m_1 = iterations;
null.a7n_1 = iterations2;
null.b7n_1 = this.i();
null.y7m_1 = found;
}
tmp$ret$5 = found;
return tmp$ret$5;
};
FTrapezoidsInt.prototype.c7n = function (x, y, assumeSorted, $mask0, $handler) {
if (!(($mask0 & 4) === 0))
assumeSorted = this.u7m_1;
return this.w7m(x, y, assumeSorted);
};
FTrapezoidsInt.prototype.d7n = function (x, y, assumeSorted, out, stats) {
var iterations = 0;
var iterations2 = 0;
var found = false;
if (assumeSorted) {
var size = this.i();
var tmp$ret$3;
// Inline function 'com.soywiz.kds.genericBinarySearchResult' call
var tmp0_genericBinarySearchResult = size - 1 | 0;
var tmp$ret$1;
$l$block: {
// Inline function 'com.soywiz.kds.genericBinarySearch' call
var low = 0;
var high = tmp0_genericBinarySearchResult - 1 | 0;
while (low <= high) {
var mid = (low + high | 0) / 2 | 0;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FTrapezoidsInt.pointInside.<anonymous>' call
var tmp0 = iterations2;
iterations2 = tmp0 + 1 | 0;
tmp$ret$0 = compareTo(this.t7l(_Item___init__impl__hhk1le_0(mid)), y);
var mval = tmp$ret$0;
if (mval < 0)
low = mid + 1 | 0;
else if (mval > 0)
high = mid - 1 | 0;
else {
tmp$ret$1 = mid;
break $l$block;
}
}
var tmp$ret$2;
// Inline function 'com.soywiz.kds.genericBinarySearchResult.<anonymous>' call
var tmp0__anonymous__q1qw7t = low;
var tmp1__anonymous__uwfjfc = high;
tmp$ret$2 = (-tmp0__anonymous__q1qw7t | 0) - 1 | 0;
tmp$ret$1 = tmp$ret$2;
}
tmp$ret$3 = _BSearchResult___init__impl__em6zam(tmp$ret$1);
var result = tmp$ret$3;
var index = _BSearchResult___get_nearIndex__impl__s8nq43(result);
$l$loop: while (0 <= index ? index < size : false) {
var item = _Item___init__impl__hhk1le_0(index);
if (y > this.v7l(item))
break $l$loop;
var tmp0_0 = iterations;
iterations = tmp0_0 + 1 | 0;
var tmp1 = index;
index = tmp1 - 1 | 0;
}
var tmp2 = index;
index = tmp2 + 1 | 0;
var inductionVariable = index;
if (inductionVariable < size)
$l$loop_1: do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var tmp4 = iterations;
iterations = tmp4 + 1 | 0;
var item_0 = _Item___init__impl__hhk1le_0(n);
var inside = this.x7m(item_0, x, y);
if (inside) {
found = true;
break $l$loop_1;
}
if (this.t7l(item_0) > y)
break $l$loop_1;
}
while (inductionVariable < size);
} else {
var inductionVariable_0 = 0;
var last = this.i();
if (inductionVariable_0 < last)
$l$loop_2: do {
var n_0 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var tmp6 = iterations;
iterations = tmp6 + 1 | 0;
var it = this.r7l(n_0);
if (this.x7m(it, x, y)) {
found = true;
out(this, new Item_0(it));
break $l$loop_2;
}
}
while (inductionVariable_0 < last);
}
if (!(stats == null)) {
stats.z7m_1 = iterations;
stats.a7n_1 = iterations2;
stats.b7n_1 = this.i();
stats.y7m_1 = found;
}
return found;
};
FTrapezoidsInt.prototype.e7n = function (_this__u8e3s4) {
return this.v7m_1.m(imul(_Item___get_index__impl__lpanhd_0(_this__u8e3s4), 6) + 0 | 0);
};
FTrapezoidsInt.prototype.f7n = function (_this__u8e3s4) {
return this.v7m_1.m(imul(_Item___get_index__impl__lpanhd_0(_this__u8e3s4), 6) + 1 | 0);
};
FTrapezoidsInt.prototype.t7l = function (_this__u8e3s4) {
return this.v7m_1.m(imul(_Item___get_index__impl__lpanhd_0(_this__u8e3s4), 6) + 2 | 0);
};
FTrapezoidsInt.prototype.g7n = function (_this__u8e3s4) {
return this.v7m_1.m(imul(_Item___get_index__impl__lpanhd_0(_this__u8e3s4), 6) + 3 | 0);
};
FTrapezoidsInt.prototype.h7n = function (_this__u8e3s4) {
return this.v7m_1.m(imul(_Item___get_index__impl__lpanhd_0(_this__u8e3s4), 6) + 4 | 0);
};
FTrapezoidsInt.prototype.v7l = function (_this__u8e3s4) {
return this.v7m_1.m(imul(_Item___get_index__impl__lpanhd_0(_this__u8e3s4), 6) + 5 | 0);
};
FTrapezoidsInt.prototype.x7m = function (_this__u8e3s4, x, y) {
return Companion_getInstance_25().i7n(this.e7n(_this__u8e3s4), this.f7n(_this__u8e3s4), this.t7l(_this__u8e3s4), this.g7n(_this__u8e3s4), this.h7n(_this__u8e3s4), this.v7l(_this__u8e3s4), x, y);
};
FTrapezoidsInt.prototype.j7n = function (x0a, x0b, y0, x1a, x1b, y1) {
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also = _Item___init__impl__hhk1le_0(this.i());
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FTrapezoidsInt.add.<anonymous>' call
this.v7m_1.o4o(x0a, x0b, y0, x1a, x1b, y1);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
};
FTrapezoidsInt.$metadata$ = classMeta('FTrapezoidsInt');
function Companion_24() {
Companion_instance_24 = this;
}
Companion_24.prototype.k7n = function (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy, out) {
var a1 = By - Ay | 0;
var b1 = Ax - Bx | 0;
var c1 = imul(a1, Ax) + imul(b1, Ay) | 0;
var a2 = Dy - Cy | 0;
var b2 = Cx - Dx | 0;
var c2 = imul(a2, Cx) + imul(b2, Cy) | 0;
var determinant = imul(a1, b2) - imul(a2, b1) | 0;
if (determinant === 0)
return false;
var x = (imul(b2, c1) - imul(b1, c2) | 0) / determinant | 0;
var y = (imul(a1, c2) - imul(a2, c1) | 0) / determinant | 0;
out(x, y);
return true;
};
Companion_24.prototype.s7m = function (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy) {
var outY = IntCompanionObject_getInstance().n1_1;
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.geom.trapezoid.Companion.getIntersectXY' call
var a1 = By - Ay | 0;
var b1 = Ax - Bx | 0;
var c1 = imul(a1, Ax) + imul(b1, Ay) | 0;
var a2 = Dy - Cy | 0;
var b2 = Cx - Dx | 0;
var c2 = imul(a2, Cx) + imul(b2, Cy) | 0;
var determinant = imul(a1, b2) - imul(a2, b1) | 0;
if (determinant === 0) {
tmp$ret$0 = false;
break $l$block;
}
var x = (imul(b2, c1) - imul(b1, c2) | 0) / determinant | 0;
var y = (imul(a1, c2) - imul(a2, c1) | 0) / determinant | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.Companion.getIntersectY.<anonymous>' call
outY = y;
tmp$ret$0 = true;
}
return outY;
};
Companion_24.$metadata$ = objectMeta('Companion');
var Companion_instance_24;
function Companion_getInstance_24() {
if (Companion_instance_24 == null)
new Companion_24();
return Companion_instance_24;
}
function toSegments(_this__u8e3s4, scale) {
var segments = FSegmentsInt_init_$Create$(0, 1, null);
var p = Companion_getInstance_8().zp();
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges' call
var mx = 0.0;
var my = 0.0;
var lx = 0.0;
var ly = 0.0;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = _this__u8e3s4.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp2__anonymous__z9zvc9 = _this__u8e3s4.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp3__anonymous__ufb84q = _this__u8e3s4.g7j_1.m(tmp2);
mx = tmp2__anonymous__z9zvc9;
my = tmp3__anonymous__ufb84q;
lx = tmp2__anonymous__z9zvc9;
ly = tmp3__anonymous__ufb84q;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
tmp$ret$0 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp4__anonymous__pkmkx7 = _this__u8e3s4.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp5__anonymous__kpxxpo = _this__u8e3s4.g7j_1.m(tmp4);
// Inline function 'com.soywiz.korma.geom.trapezoid.toSegments.<anonymous>' call
var tmp16__anonymous__5bf3vu = lx;
var tmp17__anonymous__gqgob = ly;
toSegments$emit(segments, scale, tmp16__anonymous__5bf3vu, tmp17__anonymous__gqgob, tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo);
lx = tmp4__anonymous__pkmkx7;
ly = tmp5__anonymous__kpxxpo;
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp6__anonymous__fv9ai5 = _this__u8e3s4.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp7__anonymous__b0knam = _this__u8e3s4.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp8__anonymous__65w033 = _this__u8e3s4.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp9__anonymous__1b7cvk = _this__u8e3s4.g7j_1.m(tmp8);
// Inline function 'com.soywiz.korma.geom.trapezoid.toSegments.<anonymous>' call
var tmp18__anonymous__4dy6j8 = lx;
var tmp19__anonymous__98mtqr = ly;
toSegments$emit_0(p, segments, scale, Bezier_init_$Create$_0(new Float64Array([tmp18__anonymous__4dy6j8, tmp19__anonymous__98mtqr, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk])));
lx = tmp8__anonymous__65w033;
ly = tmp9__anonymous__1b7cvk;
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp10__anonymous__yfiz50 = _this__u8e3s4.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp11__anonymous__tkubxh = _this__u8e3s4.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp12__anonymous__oq5opy = _this__u8e3s4.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp13__anonymous__jvh1if = _this__u8e3s4.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp14__anonymous__f0seaw = _this__u8e3s4.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp15__anonymous__a63r3d = _this__u8e3s4.g7j_1.m(tmp14);
// Inline function 'com.soywiz.korma.geom.trapezoid.toSegments.<anonymous>' call
var tmp20__anonymous__q2j3lv = lx;
var tmp21__anonymous__l7ugec = ly;
toSegments$emit_0(p, segments, scale, Bezier_init_$Create$_0(new Float64Array([tmp20__anonymous__q2j3lv, tmp21__anonymous__l7ugec, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if, tmp14__anonymous__f0seaw, tmp15__anonymous__a63r3d])));
lx = tmp14__anonymous__f0seaw;
ly = tmp15__anonymous__a63r3d;
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp;
if (false) {
var tmp_0;
var tmp_1 = lx;
var tmp_2 = mx;
if (isAlmostEquals$default(tmp_1, tmp_2, 0.0, 2, null)) {
var tmp_3 = ly;
var tmp_4 = my;
tmp_0 = isAlmostEquals$default(tmp_3, tmp_4, 0.0, 2, null);
} else {
tmp_0 = false;
}
tmp = tmp_0;
} else {
tmp = lx === mx ? ly === my : false;
}
var equal = tmp;
if (!equal) {
// Inline function 'com.soywiz.korma.geom.trapezoid.toSegments.<anonymous>' call
var tmp22__anonymous__gd5t6t = lx;
var tmp23__anonymous__bih5za = ly;
var tmp24__anonymous__6nsirr = mx;
var tmp25__anonymous__1t3vk8 = my;
toSegments$emit(segments, scale, tmp22__anonymous__gd5t6t, tmp23__anonymous__bih5za, tmp24__anonymous__6nsirr, tmp25__anonymous__1t3vk8);
}
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
tmp$ret$1 = Unit_getInstance();
}
}
}
}
}
}
return segments;
}
function segmentLookups($this, segments) {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.filter' call
var tmp0_filter = segments.x7l(SegmentIntToTrapezoidIntList$segmentLookups$lambda);
var tmp$ret$1;
// Inline function 'kotlin.also' call
var tmp0_also = FSegmentsInt_init_$Create$(0, 1, null);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.filter.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var inductionVariable = 0;
var last = tmp0_filter.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.filter.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t = tmp0_filter.r7l(n);
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
tmp$ret$0 = !(tmp0_filter.k7m(tmp0__anonymous__q1qw7t) === 0);
if (tmp$ret$0) {
tmp0_also.e7m(tmp0__anonymous__q1qw7t, tmp0_filter);
}
}
while (inductionVariable < last);
tmp$ret$1 = tmp0_also;
tmp$ret$2 = tmp$ret$1;
var list = tmp$ret$2;
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map' call
var tmp$ret$4;
// Inline function 'kotlin.also' call
var tmp0_also_0 = fastArrayListOf([]);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var inductionVariable_0 = 0;
var last_0 = list.i();
if (inductionVariable_0 < last_0)
do {
var n_0 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t_0 = list.r7l(n_0);
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
tmp$ret$3 = list.n7m(tmp0__anonymous__q1qw7t_0);
tmp0_also_0.c(tmp$ret$3);
}
while (inductionVariable_0 < last_0);
tmp$ret$4 = tmp0_also_0;
tmp$ret$5 = tmp$ret$4;
var tmp = tmp$ret$5;
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map' call
var tmp$ret$7;
// Inline function 'kotlin.also' call
var tmp0_also_1 = fastArrayListOf([]);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var inductionVariable_1 = 0;
var last_1 = list.i();
if (inductionVariable_1 < last_1)
do {
var n_1 = inductionVariable_1;
inductionVariable_1 = inductionVariable_1 + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.map.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t_1 = list.r7l(n_1);
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
tmp$ret$6 = list.o7m(tmp0__anonymous__q1qw7t_1);
tmp0_also_1.c(tmp$ret$6);
}
while (inductionVariable_1 < last_1);
tmp$ret$7 = tmp0_also_1;
tmp$ret$8 = tmp$ret$7;
var allY = sortedArray(toIntArray(distinct(plus(tmp, tmp$ret$8))));
var tmp_0 = 0;
var tmp_1 = allY.length;
var tmp$ret$9;
// Inline function 'kotlin.arrayOfNulls' call
tmp$ret$9 = fillArrayVal(Array(tmp_1), null);
var tmp_2 = tmp$ret$9;
while (tmp_0 < tmp_1) {
var tmp_3 = tmp_0;
var tmp$ret$10;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
tmp$ret$10 = FSegmentsInt_init_$Create$(0, 1, null);
tmp_2[tmp_3] = tmp$ret$10;
tmp_0 = tmp_0 + 1 | 0;
}
var initialSegmentsInY = toList(tmp_2);
var tmp_4 = 0;
var tmp_5 = allY.length;
var tmp$ret$11;
// Inline function 'kotlin.arrayOfNulls' call
tmp$ret$11 = fillArrayVal(Array(tmp_5), null);
var tmp_6 = tmp$ret$11;
while (tmp_4 < tmp_5) {
var tmp_7 = tmp_4;
var tmp$ret$12;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
tmp$ret$12 = FSegmentsInt_init_$Create$(0, 1, null);
tmp_6[tmp_7] = tmp$ret$12;
tmp_4 = tmp_4 + 1 | 0;
}
var allSegmentsInY = toList(tmp_6);
var listPivot = 0;
var yPivot = 0;
while (yPivot < allY.length ? listPivot < list.i() : false) {
var currentY = allY[yPivot];
var currentItem = list.r7l(listPivot);
var tmp$ret$14;
// Inline function 'com.soywiz.korma.geom.trapezoid.Item.use' call
var tmp$ret$13;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
tmp$ret$13 = list.n7m(currentItem);
tmp$ret$14 = tmp$ret$13;
if (tmp$ret$14 === currentY) {
initialSegmentsInY.m(yPivot).e7m(currentItem, list);
var tmp0 = listPivot;
listPivot = tmp0 + 1 | 0;
} else {
var tmp1 = yPivot;
yPivot = tmp1 + 1 | 0;
}
}
var inductionVariable_2 = 0;
var last_2 = allY.length - 1 | 0;
if (inductionVariable_2 <= last_2)
do {
var n_2 = inductionVariable_2;
inductionVariable_2 = inductionVariable_2 + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var tmp1_fastForEach = initialSegmentsInY.m(n_2);
var inductionVariable_3 = 0;
var last_3 = tmp1_fastForEach.i();
if (inductionVariable_3 < last_3)
do {
var n_3 = inductionVariable_3;
inductionVariable_3 = inductionVariable_3 + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
var tmp2__anonymous__z9zvc9 = tmp1_fastForEach.r7l(n_3);
var inductionVariable_4 = n_2;
var last_4 = allY.length;
if (inductionVariable_4 < last_4)
$l$loop: do {
var m = inductionVariable_4;
inductionVariable_4 = inductionVariable_4 + 1 | 0;
var y = allY[m];
if (!tmp1_fastForEach.q7m(tmp2__anonymous__z9zvc9, y) ? true : tmp1_fastForEach.o7m(tmp2__anonymous__z9zvc9) === y)
break $l$loop;
allSegmentsInY.m(m).e7m(tmp2__anonymous__z9zvc9, tmp1_fastForEach);
}
while (inductionVariable_4 < last_4);
}
while (inductionVariable_3 < last_3);
}
while (inductionVariable_2 <= last_2);
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var n_4 = 0;
while (n_4 < allSegmentsInY.i()) {
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
var tmp0_0 = n_4;
n_4 = tmp0_0 + 1 | 0;
var tmp3__anonymous__ufb84q = allSegmentsInY.m(tmp0_0);
tmp3__anonymous__ufb84q.y7l(SegmentIntToTrapezoidIntList$segmentLookups$lambda_0);
}
var inductionVariable_5 = 0;
var last_5 = allY.length - 1 | 0;
if (inductionVariable_5 <= last_5)
do {
var n_5 = inductionVariable_5;
inductionVariable_5 = inductionVariable_5 + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.fastForEach' call
var tmp4_fastForEach = allSegmentsInY.m(n_5);
var inductionVariable_6 = 0;
var last_6 = tmp4_fastForEach.i();
if (inductionVariable_6 < last_6)
do {
var n_6 = inductionVariable_6;
inductionVariable_6 = inductionVariable_6 + 1 | 0;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.segmentLookups.<anonymous>' call
var tmp5__anonymous__kpxxpo = tmp4_fastForEach.r7l(n_6);
// Inline function 'kotlin.check' call
var tmp0_check = tmp4_fastForEach.q7m(tmp5__anonymous__kpxxpo, allY[n_5]);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'kotlin.check' call
// Inline function 'kotlin.contracts.contract' call
if (!tmp0_check) {
var tmp$ret$15;
// Inline function 'kotlin.check.<anonymous>' call
tmp$ret$15 = 'Check failed.';
var message = tmp$ret$15;
throw IllegalStateException_init_$Create$(toString(message));
}
}
while (inductionVariable_6 < last_6);
}
while (inductionVariable_5 <= last_5);
return new Pair(allY, allSegmentsInY);
}
function SegmentIntToTrapezoidIntList$segmentLookups$lambda($this$sortedBy, it) {
return $this$sortedBy.n7m(it.k7l_1);
}
function SegmentIntToTrapezoidIntList$segmentLookups$lambda_0($this$sortBy, it) {
return $this$sortBy.m7m(it.k7l_1);
}
function SegmentIntToTrapezoidIntList() {
SegmentIntToTrapezoidIntList_instance = this;
}
SegmentIntToTrapezoidIntList.prototype.l7n = function (segments, winding, trapezoids) {
var tmp0_container = segmentLookups(this, segments);
var allY = tmp0_container.n4();
var allSegmentsInY = tmp0_container.o4();
var inductionVariable = 0;
var last = allY.length - 1 | 0;
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var y0 = allY[n];
var y1 = allY[n + 1 | 0];
var segs = allSegmentsInY.m(n);
var tmp$ret$0;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$0 = ArrayList_init_$Create$();
var chunks = tmp$ret$0;
var tmp2_subject = winding;
var tmp0 = tmp2_subject.q2_1;
if (tmp0 === 0) {
var progression = step(until(0, segs.i()), 2);
var inductionVariable_0 = progression.r1_1;
var last_0 = progression.s1_1;
var step_0 = progression.t1_1;
if ((step_0 > 0 ? inductionVariable_0 <= last_0 : false) ? true : step_0 < 0 ? last_0 <= inductionVariable_0 : false)
$l$loop_1: do {
var m = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + step_0 | 0;
var tmp4_elvis_lhs = segs.a7m(m + 0 | 0);
var tmp;
var tmp_0 = tmp4_elvis_lhs;
if ((tmp_0 == null ? null : new Item(tmp_0)) == null) {
continue $l$loop_1;
} else {
tmp = tmp4_elvis_lhs;
}
var s0 = tmp;
var tmp5_elvis_lhs = segs.a7m(m + 1 | 0);
var tmp_1;
var tmp_2 = tmp5_elvis_lhs;
if ((tmp_2 == null ? null : new Item(tmp_2)) == null) {
continue $l$loop_1;
} else {
tmp_1 = tmp5_elvis_lhs;
}
var s1 = tmp_1;
var tmp_3;
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.invoke' call
var tmp$ret$2;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.convert.<anonymous>' call
tmp$ret$1 = segs.q7m(s0, y1);
tmp$ret$2 = tmp$ret$1;
tmp$ret$3 = tmp$ret$2;
if (!tmp$ret$3) {
tmp_3 = true;
} else {
var tmp$ret$6;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.invoke' call
var tmp$ret$5;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.convert.<anonymous>' call
tmp$ret$4 = !segs.q7m(s1, y1);
tmp$ret$5 = tmp$ret$4;
tmp$ret$6 = tmp$ret$5;
tmp_3 = tmp$ret$6;
}
if (tmp_3)
continue $l$loop_1;
// Inline function 'kotlin.collections.plusAssign' call
var tmp0_plusAssign = new Pair(new Item(s0), new Item(s1));
chunks.c(tmp0_plusAssign);
}
while (!(m === last_0));
} else if (tmp0 === 1) {
var sign = 0;
var inductionVariable_1 = 0;
var last_1 = segs.i();
if (inductionVariable_1 < last_1)
$l$loop_2: do {
var m_0 = inductionVariable_1;
inductionVariable_1 = inductionVariable_1 + 1 | 0;
var seg = segs.r7l(m_0);
if (!(sign === 0) ? m_0 > 0 : false) {
var s0_0 = segs.r7l(m_0 - 1 | 0);
var s1_0 = seg;
var tmp_4;
var tmp$ret$9;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.invoke' call
var tmp$ret$8;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.convert.<anonymous>' call
tmp$ret$7 = segs.q7m(s0_0, y1);
tmp$ret$8 = tmp$ret$7;
tmp$ret$9 = tmp$ret$8;
if (!tmp$ret$9) {
tmp_4 = true;
} else {
var tmp$ret$12;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.invoke' call
var tmp$ret$11;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$10;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.convert.<anonymous>' call
tmp$ret$10 = !segs.q7m(s1_0, y1);
tmp$ret$11 = tmp$ret$10;
tmp$ret$12 = tmp$ret$11;
tmp_4 = tmp$ret$12;
}
if (tmp_4)
continue $l$loop_2;
// Inline function 'kotlin.collections.plusAssign' call
var tmp1_plusAssign = new Pair(new Item(s0_0), new Item(s1_0));
chunks.c(tmp1_plusAssign);
}
var tmp_5 = sign;
var tmp$ret$15;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.invoke' call
var tmp$ret$14;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$13;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.convert.<anonymous>' call
tmp$ret$13 = get_sign(segs.k7m(seg));
tmp$ret$14 = tmp$ret$13;
tmp$ret$15 = tmp$ret$14;
sign = tmp_5 + tmp$ret$15 | 0;
}
while (inductionVariable_1 < last_1);
}
var tmp7_iterator = chunks.j();
while (tmp7_iterator.k()) {
var tmp8_loop_parameter = tmp7_iterator.l();
var s0_1 = tmp8_loop_parameter.n4().k7l_1;
var s1_1 = tmp8_loop_parameter.o4().k7l_1;
var tmp$ret$18;
// Inline function 'com.soywiz.korma.geom.trapezoid.FSegmentsInt.invoke' call
var tmp$ret$17;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$16;
// Inline function 'com.soywiz.korma.geom.trapezoid.SegmentIntToTrapezoidIntList.convert.<anonymous>' call
var x0a = segs.p7m(s0_1, y0);
var x0b = segs.p7m(s1_1, y0);
var x1a = segs.p7m(s0_1, y1);
var x1b = segs.p7m(s1_1, y1);
var tmp_6;
if (x1b < x1a) {
var intersectY = segs.r7m(s0_1, s1_1);
var intersectX = segs.p7m(s0_1, intersectY);
trapezoids.j7n(x0a, x0b, y0, intersectX, intersectX, intersectY);
tmp_6 = trapezoids.j7n(intersectX, intersectX, intersectY, x1a, x1b, y1);
} else {
tmp_6 = trapezoids.j7n(x0a, x0b, y0, x1a, x1b, y1);
}
tmp$ret$16 = tmp_6;
tmp$ret$17 = tmp$ret$16;
tmp$ret$18 = tmp$ret$17;
}
}
while (inductionVariable < last);
return trapezoids;
};
SegmentIntToTrapezoidIntList.prototype.m7n = function (segments, winding, trapezoids, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
winding = Winding_EVEN_ODD_getInstance();
if (!(($mask0 & 4) === 0)) {
trapezoids = FTrapezoidsInt_init_$Create$(0, 1, null);
}
return this.l7n(segments, winding, trapezoids);
};
SegmentIntToTrapezoidIntList.$metadata$ = objectMeta('SegmentIntToTrapezoidIntList');
var SegmentIntToTrapezoidIntList_instance;
function SegmentIntToTrapezoidIntList_getInstance() {
if (SegmentIntToTrapezoidIntList_instance == null)
new SegmentIntToTrapezoidIntList();
return SegmentIntToTrapezoidIntList_instance;
}
function toSegments$emit(segments, $scale, x0, y0, x1, y1) {
segments.w7l(toIntRound(x0 * $scale), toIntRound(y0 * $scale), toIntRound(x1 * $scale), toIntRound(y1 * $scale));
}
function toSegments$emit_0(p, segments, $scale, bezier) {
var len = coerceIn(toIntRound(bezier.ze()), 2, 20);
var oldX = 0.0;
var oldY = 0.0;
var inductionVariable = 0;
if (inductionVariable <= len)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n / len;
bezier.q7g(ratio, p);
if (n > 0) {
toSegments$emit(segments, $scale, oldX, oldY, p.y72_1, p.z72_1);
}
oldX = p.y72_1;
oldY = p.z72_1;
}
while (!(n === len));
}
function det($this, x0, y0, x1, y1) {
return imul(x0, y1) - imul(x1, y0) | 0;
}
function Companion_25() {
Companion_instance_25 = this;
}
Companion_25.prototype.i7n = function (x0a, x0b, y0, x1a, x1b, y1, x, y) {
if (y < y0 ? true : y > y1)
return false;
if ((x < x0a ? x < x1a : false) ? true : x > x0b ? x > x1b : false)
return false;
var sign1 = get_sign(det(this, x1a - x | 0, y1 - y | 0, x0a - x | 0, y0 - y | 0));
var sign2 = get_sign(det(this, x1b - x | 0, y1 - y | 0, x0b - x | 0, y0 - y | 0));
return !(sign1 === sign2);
};
Companion_25.$metadata$ = objectMeta('Companion');
var Companion_instance_25;
function Companion_getInstance_25() {
if (Companion_instance_25 == null)
new Companion_25();
return Companion_instance_25;
}
function Companion_26() {
Companion_instance_26 = this;
}
Companion_26.prototype.n7n = function (a, b, out) {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.vector.Companion.getIntersectXY' call
var Ax = a.o7n_1;
var Ay = a.p7n_1;
var Bx = a.q7n_1;
var By = a.r7n_1;
var Cx = b.o7n_1;
var Cy = b.p7n_1;
var Dx = b.q7n_1;
var Dy = b.r7n_1;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.Companion.getIntersectXY' call
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.geom.Companion.getIntersectXY' call
var tmp0_getIntersectXY = Companion_getInstance_2();
var a1 = By - Ay;
var b1 = Ax - Bx;
var c1 = a1 * Ax + b1 * Ay;
var a2 = Dy - Cy;
var b2 = Cx - Dx;
var c2 = a2 * Cx + b2 * Cy;
var determinant = a1 * b2 - a2 * b1;
if (isAlmostZero(determinant)) {
tmp$ret$0 = false;
break $l$block;
}
var x = (b2 * c1 - b1 * c2) / determinant;
var y = (a1 * c2 - a2 * c1) / determinant;
// Inline function 'com.soywiz.korma.geom.vector.Companion.getIntersectXY.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.Companion.getIntersectXY.<anonymous>' call
var tmp1__anonymous__uwfjfc = floorCeil(x);
var tmp2__anonymous__z9zvc9 = floorCeil(y);
return out.a73(tmp1__anonymous__uwfjfc, tmp2__anonymous__z9zvc9);
tmp$ret$0 = true;
}
tmp$ret$1 = tmp$ret$0;
tmp$ret$2 = tmp$ret$1;
return null;
};
Companion_26.prototype.y7n = function (a, b) {
return minus(b.z7n(), a.z7n());
};
Companion_26.prototype.a7o = function (a, b, out) {
var Ax = a.o7n_1;
var Ay = a.p7n_1;
var Bx = a.q7n_1;
var By = a.r7n_1;
var Cx = b.o7n_1;
var Cy = b.p7n_1;
var Dx = b.q7n_1;
var Dy = b.r7n_1;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.Companion.getIntersectXY' call
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.geom.Companion.getIntersectXY' call
var tmp0_getIntersectXY = Companion_getInstance_2();
var a1 = By - Ay;
var b1 = Ax - Bx;
var c1 = a1 * Ax + b1 * Ay;
var a2 = Dy - Cy;
var b2 = Cx - Dx;
var c2 = a2 * Cx + b2 * Cy;
var determinant = a1 * b2 - a2 * b1;
if (isAlmostZero(determinant)) {
tmp$ret$0 = false;
break $l$block;
}
var x = (b2 * c1 - b1 * c2) / determinant;
var y = (a1 * c2 - a2 * c1) / determinant;
// Inline function 'com.soywiz.korma.geom.vector.Companion.getIntersectXY.<anonymous>' call
out(floorCeil(x), floorCeil(y));
tmp$ret$0 = true;
}
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Companion_26.prototype.w72 = function (Ax, Ay, Bx, By, Cx, Cy, Dx, Dy, out) {
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.geom.Companion.getIntersectXY' call
var tmp0_getIntersectXY = Companion_getInstance_2();
var a1 = By - Ay;
var b1 = Ax - Bx;
var c1 = a1 * Ax + b1 * Ay;
var a2 = Dy - Cy;
var b2 = Cx - Dx;
var c2 = a2 * Cx + b2 * Cy;
var determinant = a1 * b2 - a2 * b1;
if (isAlmostZero(determinant)) {
tmp$ret$0 = false;
break $l$block;
}
var x = (b2 * c1 - b1 * c2) / determinant;
var y = (a1 * c2 - a2 * c1) / determinant;
out(x, y);
tmp$ret$0 = true;
}
return tmp$ret$0;
};
Companion_26.$metadata$ = objectMeta('Companion');
var Companion_instance_26;
function Companion_getInstance_26() {
if (Companion_instance_26 == null)
new Companion_26();
return Companion_instance_26;
}
function Edge() {
Companion_getInstance_26();
this.o7n_1 = 0;
this.p7n_1 = 0;
this.q7n_1 = 0;
this.r7n_1 = 0;
this.s7n_1 = 0;
this.t7n_1 = 0;
this.u7n_1 = 0;
this.v7n_1 = false;
this.w7n_1 = false;
this.x7n_1 = 0;
}
Edge.prototype.p71 = function (n) {
return n === 0 ? this.o7n_1 : this.q7n_1;
};
Edge.prototype.q71 = function (n) {
return n === 0 ? this.p7n_1 : this.r7n_1;
};
Edge.prototype.b7o = function () {
return this.o7n_1;
};
Edge.prototype.c7o = function () {
return this.p7n_1;
};
Edge.prototype.d7o = function () {
return this.q7n_1;
};
Edge.prototype.e7o = function () {
return this.r7n_1;
};
Edge.prototype.f7o = function () {
return this.s7n_1;
};
Edge.prototype.h73 = function () {
return this.t7n_1;
};
Edge.prototype.g73 = function () {
return this.u7n_1;
};
Edge.prototype.g7o = function () {
return this.v7n_1;
};
Edge.prototype.h7o = function () {
return this.w7n_1;
};
Edge.prototype.i7o = function (other) {
return this.j7o(other.o7n_1, other.p7n_1, other.q7n_1, other.r7n_1, other.s7n_1);
};
Edge.prototype.j7o = function (ax, ay, bx, by, wind) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.vector.Edge.setTo.<anonymous>' call
this.o7n_1 = ax;
this.p7n_1 = ay;
this.q7n_1 = bx;
this.r7n_1 = by;
this.u7n_1 = bx - ax | 0;
this.t7n_1 = by - ay | 0;
this.v7n_1 = ay === by;
this.w7n_1 = ax === bx;
this.s7n_1 = wind;
this.x7n_1 = this.w7n_1 ? 0 : ay - (imul(ax, this.t7n_1) / this.u7n_1 | 0) | 0;
tmp$ret$0 = this;
return tmp$ret$0;
};
Edge.prototype.k7o = function () {
var tmp$ret$0;
// Inline function 'kotlin.math.min' call
var tmp0_min = this.p7n_1;
var tmp1_min = this.r7n_1;
tmp$ret$0 = Math.min(tmp0_min, tmp1_min);
return tmp$ret$0;
};
Edge.prototype.l7o = function () {
var tmp$ret$0;
// Inline function 'kotlin.math.max' call
var tmp0_max = this.p7n_1;
var tmp1_max = this.r7n_1;
tmp$ret$0 = Math.max(tmp0_max, tmp1_max);
return tmp$ret$0;
};
Edge.prototype.m7o = function (y) {
return y >= this.p7n_1 ? y < this.r7n_1 : false;
};
Edge.prototype.n7o = function (y) {
return (this.w7n_1 ? true : this.t7n_1 === 0) ? this.o7n_1 : imul(y - this.x7n_1 | 0, this.u7n_1) / this.t7n_1 | 0;
};
Edge.prototype.z7n = function () {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between = Companion_getInstance_0();
var tmp1_between = this.o7n_1;
var tmp2_between = this.p7n_1;
var tmp3_between = this.q7n_1;
var tmp4_between = this.r7n_1;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.between' call
var tmp0_between_0 = tmp1_between;
var tmp1_between_0 = tmp2_between;
var tmp2_between_0 = tmp3_between;
var tmp3_between_0 = tmp4_between;
tmp$ret$0 = Angle_between(tmp0_between_0, tmp1_between_0, tmp2_between_0, tmp3_between_0);
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Edge.prototype.toString = function () {
return 'Edge([' + this.o7n_1 + ',' + this.p7n_1 + ']-[' + this.q7n_1 + ',' + this.r7n_1 + '])';
};
Edge.$metadata$ = classMeta('Edge');
var LineCap_BUTT_instance;
var LineCap_SQUARE_instance;
var LineCap_ROUND_instance;
function Companion_27() {
Companion_instance_27 = this;
}
Companion_27.$metadata$ = objectMeta('Companion');
var Companion_instance_27;
function Companion_getInstance_27() {
LineCap_initEntries();
if (Companion_instance_27 == null)
new Companion_27();
return Companion_instance_27;
}
var LineCap_entriesInitialized;
function LineCap_initEntries() {
if (LineCap_entriesInitialized)
return Unit_getInstance();
LineCap_entriesInitialized = true;
LineCap_BUTT_instance = new LineCap('BUTT', 0);
LineCap_SQUARE_instance = new LineCap('SQUARE', 1);
LineCap_ROUND_instance = new LineCap('ROUND', 2);
Companion_getInstance_27();
}
function LineCap(name, ordinal) {
Enum.call(this, name, ordinal);
}
LineCap.$metadata$ = classMeta('LineCap', undefined, undefined, undefined, undefined, Enum.prototype);
function LineCap_BUTT_getInstance() {
LineCap_initEntries();
return LineCap_BUTT_instance;
}
function LineCap_SQUARE_getInstance() {
LineCap_initEntries();
return LineCap_SQUARE_instance;
}
var LineJoin_BEVEL_instance;
var LineJoin_ROUND_instance;
var LineJoin_MITER_instance;
function Companion_28() {
Companion_instance_28 = this;
}
Companion_28.$metadata$ = objectMeta('Companion');
var Companion_instance_28;
function Companion_getInstance_28() {
LineJoin_initEntries();
if (Companion_instance_28 == null)
new Companion_28();
return Companion_instance_28;
}
var LineJoin_entriesInitialized;
function LineJoin_initEntries() {
if (LineJoin_entriesInitialized)
return Unit_getInstance();
LineJoin_entriesInitialized = true;
LineJoin_BEVEL_instance = new LineJoin('BEVEL', 0);
LineJoin_ROUND_instance = new LineJoin('ROUND', 1);
LineJoin_MITER_instance = new LineJoin('MITER', 2);
Companion_getInstance_28();
}
function LineJoin(name, ordinal) {
Enum.call(this, name, ordinal);
}
LineJoin.$metadata$ = classMeta('LineJoin', undefined, undefined, undefined, undefined, Enum.prototype);
function LineJoin_BEVEL_getInstance() {
LineJoin_initEntries();
return LineJoin_BEVEL_instance;
}
function LineJoin_MITER_getInstance() {
LineJoin_initEntries();
return LineJoin_MITER_instance;
}
var LineScaleMode_NONE_instance;
var LineScaleMode_HORIZONTAL_instance;
var LineScaleMode_VERTICAL_instance;
var LineScaleMode_NORMAL_instance;
var LineScaleMode_entriesInitialized;
function LineScaleMode_initEntries() {
if (LineScaleMode_entriesInitialized)
return Unit_getInstance();
LineScaleMode_entriesInitialized = true;
LineScaleMode_NONE_instance = new LineScaleMode('NONE', 0, false, false);
LineScaleMode_HORIZONTAL_instance = new LineScaleMode('HORIZONTAL', 1, true, false);
LineScaleMode_VERTICAL_instance = new LineScaleMode('VERTICAL', 2, false, true);
LineScaleMode_NORMAL_instance = new LineScaleMode('NORMAL', 3, true, true);
}
function LineScaleMode(name, ordinal, hScale, vScale) {
Enum.call(this, name, ordinal);
this.q7o_1 = hScale;
this.r7o_1 = vScale;
this.s7o_1 = this.q7o_1 ? true : this.r7o_1;
this.t7o_1 = this.q7o_1 ? this.r7o_1 : false;
}
LineScaleMode.$metadata$ = classMeta('LineScaleMode', undefined, undefined, undefined, undefined, Enum.prototype);
function LineScaleMode_NONE_getInstance() {
LineScaleMode_initEntries();
return LineScaleMode_NONE_instance;
}
function LineScaleMode_NORMAL_getInstance() {
LineScaleMode_initEntries();
return LineScaleMode_NORMAL_instance;
}
function PolygonScanline$AllBuckets$pool$lambda(it) {
it.zl();
return Unit_getInstance();
}
function PolygonScanline$AllBuckets$pool$lambda_0(it) {
return new Bucket();
}
function Bucket() {
this.u7o_1 = FastArrayList_init_$Create$();
}
Bucket.prototype.v7o = function () {
return this.u7o_1;
};
Bucket.prototype.zl = function () {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.vector.Bucket.clear.<anonymous>' call
this.u7o_1.x7();
tmp$ret$0 = this;
return tmp$ret$0;
};
Bucket.prototype.w7o = function (block) {
var tmp0_fastForEach = this.u7o_1;
var array = tmp0_fastForEach.b4r_1;
var n = 0;
while (n < array.length) {
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0_unsafeCast = array[tmp0];
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_unsafeCast;
tmp$ret$1 = tmp$ret$0;
block(tmp$ret$1);
}
return Unit_getInstance();
};
Bucket.$metadata$ = classMeta('Bucket');
function Buckets(pool, ySize) {
this.x7o_1 = pool;
this.y7o_1 = ySize;
this.z7o_1 = FastIntMap();
}
Buckets.prototype.i = function () {
return get_size(this.z7o_1);
};
Buckets.prototype.a7p = function (y) {
return y / this.y7o_1 | 0;
};
Buckets.prototype.b7p = function (index) {
var tmp$ret$2;
$l$block: {
// Inline function 'com.soywiz.kds.getOrPut' call
var tmp0_getOrPut = this.z7o_1;
var tmp$ret$1;
// Inline function 'com.soywiz.kds.get' call
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_getOrPut;
tmp$ret$1 = tmp$ret$0.get(index);
var res = tmp$ret$1;
if (!(res == null)) {
tmp$ret$2 = res;
break $l$block;
}
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.vector.Buckets.getForIndex.<anonymous>' call
tmp$ret$3 = this.x7o_1.t4t();
var out = tmp$ret$3;
// Inline function 'com.soywiz.kds.set' call
var tmp$ret$4;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$4 = tmp0_getOrPut;
tmp$ret$4.set(index, out);
tmp$ret$2 = out;
}
return tmp$ret$2;
};
Buckets.prototype.c7p = function (y) {
var tmp$ret$1;
// Inline function 'com.soywiz.kds.get' call
var tmp0_get = this.z7o_1;
var tmp1_get = this.a7p(y);
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_get;
tmp$ret$1 = tmp$ret$0.get(tmp1_get);
return tmp$ret$1;
};
Buckets.prototype.d7p = function (y, block) {
if (this.i() > 0) {
var tmp0_safe_receiver = this.c7p(y);
if (tmp0_safe_receiver == null)
null;
else {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach = tmp0_safe_receiver.u7o_1;
var array = tmp0_fastForEach.b4r_1;
var n = 0;
while (n < array.length) {
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0_unsafeCast = array[tmp0];
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_unsafeCast;
tmp$ret$1 = tmp$ret$0;
block(tmp$ret$1);
}
tmp$ret$2 = Unit_getInstance();
}
}
};
Buckets.prototype.x7 = function () {
// Inline function 'com.soywiz.kds.fastForEach' call
var tmp0_fastForEach = this.z7o_1;
// Inline function 'com.soywiz.kds.fastKeyForEach' call
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_fastForEach;
var mapIterator = tmp$ret$0.keys();
$l$loop: while (true) {
var v = mapIterator.next();
if (v.done)
break $l$loop;
// Inline function 'com.soywiz.kds.fastForEach.<anonymous>' call
var tmp0__anonymous__q1qw7t = v.value;
// Inline function 'com.soywiz.korma.geom.vector.Buckets.clear.<anonymous>' call
var tmp$ret$2;
// Inline function 'com.soywiz.kds.get' call
var tmp$ret$1;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$1 = tmp0_fastForEach;
tmp$ret$2 = tmp$ret$1.get(tmp0__anonymous__q1qw7t);
var tmp1__anonymous__uwfjfc = ensureNotNull(tmp$ret$2);
this.x7o_1.u4t(tmp1__anonymous__uwfjfc.zl());
}
// Inline function 'com.soywiz.kds.clear' call
var tmp2_clear = this.z7o_1;
var tmp$ret$3;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$3 = tmp2_clear;
tmp$ret$3.clear();
};
Buckets.prototype.e7p = function (edge, threshold) {
var min = this.a7p(edge.k7o());
var max = this.a7p(edge.l7o());
if ((max - min | 0) < threshold) {
var inductionVariable = min;
if (inductionVariable <= max)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
this.b7p(n).u7o_1.c(edge);
}
while (!(n === max));
return true;
}
return false;
};
Buckets.prototype.f7p = function (edge, threshold, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
threshold = IntCompanionObject_getInstance().o1_1;
return this.e7p(edge, threshold);
};
Buckets.$metadata$ = classMeta('Buckets');
function AllBuckets() {
var tmp = this;
var tmp_0 = PolygonScanline$AllBuckets$pool$lambda;
tmp.g7p_1 = Pool_init_$Create$(tmp_0, 0, PolygonScanline$AllBuckets$pool$lambda_0, 2, null);
var tmp_1 = this;
Companion_getInstance_29();
tmp_1.h7p_1 = new Buckets(this.g7p_1, 80);
var tmp_2 = this;
Companion_getInstance_29();
tmp_2.i7p_1 = new Buckets(this.g7p_1, 320);
var tmp_3 = this;
Companion_getInstance_29();
tmp_3.j7p_1 = new Buckets(this.g7p_1, 1280);
}
AllBuckets.prototype.k7p = function (edge) {
if (this.h7p_1.e7p(edge, 4))
return Unit_getInstance();
if (this.i7p_1.e7p(edge, 4))
return Unit_getInstance();
this.j7p_1.f7p(edge, 0, 2, null);
};
AllBuckets.prototype.d7p = function (y, block) {
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp0_fastForEachY = this.h7p_1;
if (tmp0_fastForEachY.i() > 0) {
var tmp0_safe_receiver = tmp0_fastForEachY.c7p(y);
if (tmp0_safe_receiver == null)
null;
else {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach = tmp0_safe_receiver.u7o_1;
var array = tmp0_fastForEach.b4r_1;
var n = 0;
while (n < array.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0_unsafeCast = array[tmp0];
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_unsafeCast;
tmp$ret$1 = tmp$ret$0;
var tmp1__anonymous__uwfjfc = tmp$ret$1;
block(tmp1__anonymous__uwfjfc);
}
tmp$ret$2 = Unit_getInstance();
}
}
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp2_fastForEachY = this.i7p_1;
if (tmp2_fastForEachY.i() > 0) {
var tmp0_safe_receiver_0 = tmp2_fastForEachY.c7p(y);
if (tmp0_safe_receiver_0 == null)
null;
else {
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach_0 = tmp0_safe_receiver_0.u7o_1;
var array_0 = tmp0_fastForEach_0.b4r_1;
var n_0 = 0;
while (n_0 < array_0.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$4;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0_0 = n_0;
n_0 = tmp0_0 + 1 | 0;
var tmp0_unsafeCast_0 = array_0[tmp0_0];
var tmp$ret$3;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$3 = tmp0_unsafeCast_0;
tmp$ret$4 = tmp$ret$3;
var tmp3__anonymous__ufb84q = tmp$ret$4;
block(tmp3__anonymous__ufb84q);
}
tmp$ret$5 = Unit_getInstance();
}
}
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp4_fastForEachY = this.j7p_1;
if (tmp4_fastForEachY.i() > 0) {
var tmp0_safe_receiver_1 = tmp4_fastForEachY.c7p(y);
if (tmp0_safe_receiver_1 == null)
null;
else {
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach_1 = tmp0_safe_receiver_1.u7o_1;
var array_1 = tmp0_fastForEach_1.b4r_1;
var n_1 = 0;
while (n_1 < array_1.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$7;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0_1 = n_1;
n_1 = tmp0_1 + 1 | 0;
var tmp0_unsafeCast_1 = array_1[tmp0_1];
var tmp$ret$6;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$6 = tmp0_unsafeCast_1;
tmp$ret$7 = tmp$ret$6;
var tmp5__anonymous__kpxxpo = tmp$ret$7;
block(tmp5__anonymous__kpxxpo);
}
tmp$ret$8 = Unit_getInstance();
}
}
};
AllBuckets.prototype.x7 = function () {
this.h7p_1.x7();
this.i7p_1.x7();
this.j7p_1.x7();
};
AllBuckets.$metadata$ = classMeta('AllBuckets');
function addPoint($this, x, y) {
$this.u7p_1.m71(x, y);
}
function addEdge($this, ax, ay, bx, by) {
if (ax === bx ? ay === by : false)
return Unit_getInstance();
var isHorizontal = ay === by;
var iax = $this.d7q(ax);
var ibx = $this.d7q(bx);
var iay = $this.d7q(ay);
var iby = $this.d7q(by);
var edge = ay < by ? $this.o7p_1.t4t().j7o(iax, iay, ibx, iby, 1) : $this.o7p_1.t4t().j7o(ibx, iby, iax, iay, -1);
$this.r7p_1.c(edge);
if (isHorizontal) {
$this.q7p_1.c(edge);
} else {
$this.p7p_1.c(edge);
$this.s7p_1.k7p(edge);
}
$this.n7p_1.m71(ax, ay);
$this.n7p_1.m71(bx, by);
}
function XWithWind() {
this.e7q_1 = new IntArrayList(1024);
this.f7q_1 = new IntArrayList(1024);
}
XWithWind.prototype.i = function () {
return this.e7q_1.i();
};
XWithWind.prototype.g7q = function (x, wind) {
this.e7q_1.m4o(x);
this.f7q_1.m4o(wind);
};
XWithWind.prototype.x7 = function () {
this.e7q_1.x7();
this.f7q_1.x7();
};
XWithWind.prototype.toString = function () {
return 'XWithWind(' + this.e7q_1 + ', ' + this.f7q_1 + ')';
};
XWithWind.$metadata$ = classMeta('XWithWind');
function IntArrayListSort() {
IntArrayListSort_instance = this;
SortOps.call(this);
}
IntArrayListSort.prototype.h7q = function (subject, l, r) {
return compareTo(subject.e7q_1.t4n(l), subject.e7q_1.t4n(r));
};
IntArrayListSort.prototype.a4p = function (subject, l, r) {
return this.h7q(subject instanceof XWithWind ? subject : THROW_CCE(), l, r);
};
IntArrayListSort.prototype.i7q = function (subject, indexL, indexR) {
subject.e7q_1.w4n(indexL, indexR);
subject.f7q_1.w4n(indexL, indexR);
};
IntArrayListSort.prototype.c4p = function (subject, indexL, indexR) {
return this.i7q(subject instanceof XWithWind ? subject : THROW_CCE(), indexL, indexR);
};
IntArrayListSort.$metadata$ = objectMeta('IntArrayListSort', undefined, undefined, undefined, undefined, SortOps.prototype);
var IntArrayListSort_instance;
function IntArrayListSort_getInstance() {
if (IntArrayListSort_instance == null)
new IntArrayListSort();
return IntArrayListSort_instance;
}
function PolygonScanline$edgesPool$lambda(it) {
return new Edge();
}
function PolygonScanline() {
RastScale.call(this);
this.l7p_1 = -1;
this.m7p_1 = Winding_NON_ZERO_getInstance();
this.n7p_1 = new BoundsBuilder();
var tmp = this;
tmp.o7p_1 = Pool_init_$Create$_0(0, PolygonScanline$edgesPool$lambda, 1, null);
this.p7p_1 = FastArrayList_init_$Create$();
this.q7p_1 = FastArrayList_init_$Create$();
this.r7p_1 = FastArrayList_init_$Create$();
this.s7p_1 = new AllBuckets();
this.t7p_1 = true;
var tmp_0 = this;
tmp_0.u7p_1 = PointArrayList_init_$Create$(0, 1, null);
this.v7p_1 = 0.0;
this.w7p_1 = 0.0;
this.x7p_1 = 0.0;
this.y7p_1 = 0.0;
this.z7p_1 = false;
this.a7q_1 = new XWithWind();
this.b7q_1 = 0;
this.c7q_1 = new IntSegmentSet();
}
PolygonScanline.prototype.j7q = function () {
return this.m7p_1;
};
PolygonScanline.prototype.a72 = function (out) {
return this.n7p_1.a72(out);
};
PolygonScanline.prototype.d2p = function () {
this.t7p_1 = true;
this.n7p_1.d2p();
// Inline function 'com.soywiz.kds.FastArrayList.fastForEach' call
var tmp0_fastForEach = this.p7p_1;
var array = tmp0_fastForEach.b4r_1;
var n = 0;
while (n < array.length) {
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.reset.<anonymous>' call
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0_unsafeCast = array[tmp0];
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_unsafeCast;
tmp$ret$1 = tmp$ret$0;
var tmp1__anonymous__uwfjfc = tmp$ret$1;
this.o7p_1.u4t(tmp1__anonymous__uwfjfc);
}
// Inline function 'com.soywiz.kds.FastArrayList.fastForEach' call
var tmp2_fastForEach = this.q7p_1;
var array_0 = tmp2_fastForEach.b4r_1;
var n_0 = 0;
while (n_0 < array_0.length) {
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.reset.<anonymous>' call
var tmp$ret$3;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0_0 = n_0;
n_0 = tmp0_0 + 1 | 0;
var tmp0_unsafeCast_0 = array_0[tmp0_0];
var tmp$ret$2;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$2 = tmp0_unsafeCast_0;
tmp$ret$3 = tmp$ret$2;
var tmp3__anonymous__ufb84q = tmp$ret$3;
this.o7p_1.u4t(tmp3__anonymous__ufb84q);
}
this.p7p_1.x7();
this.q7p_1.x7();
this.r7p_1.x7();
this.u7p_1.zl();
this.s7p_1.x7();
this.v7p_1 = 0.0;
this.w7p_1 = 0.0;
this.x7p_1 = 0.0;
this.y7p_1 = 0.0;
this.z7p_1 = false;
};
PolygonScanline.prototype.k7q = function () {
return this.p7p_1.i();
};
PolygonScanline.prototype.t4o = function () {
return this.k7q() > 0;
};
PolygonScanline.prototype.r7e = function (x, y) {
this.x7p_1 = x;
this.y7p_1 = y;
this.v7p_1 = x;
this.w7p_1 = y;
this.z7p_1 = true;
};
PolygonScanline.prototype.u7e = function (x, y) {
if (this.z7p_1) {
addPoint(this, this.x7p_1, this.y7p_1);
}
addEdge(this, this.x7p_1, this.y7p_1, x, y);
addPoint(this, x, y);
this.x7p_1 = x;
this.y7p_1 = y;
this.z7p_1 = false;
};
PolygonScanline.prototype.l7q = function (path) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2' call
var ix = 0.0;
var iy = 0.0;
var lx = {_v: 0.0};
var ly = {_v: 0.0};
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
if (false) {
this.x2c();
}
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = path.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp2__anonymous__z9zvc9 = path.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp3__anonymous__ufb84q = path.g7j_1.m(tmp2);
ix = tmp2__anonymous__z9zvc9;
iy = tmp3__anonymous__ufb84q;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
this.m7q(tmp2__anonymous__z9zvc9, tmp3__anonymous__ufb84q, true);
lx._v = tmp2__anonymous__z9zvc9;
ly._v = tmp3__anonymous__ufb84q;
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp4__anonymous__pkmkx7 = path.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp5__anonymous__kpxxpo = path.g7j_1.m(tmp4);
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
this.m7q(tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, false);
lx._v = tmp4__anonymous__pkmkx7;
ly._v = tmp5__anonymous__kpxxpo;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$0 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp6__anonymous__fv9ai5 = path.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp7__anonymous__b0knam = path.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp8__anonymous__65w033 = path.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp9__anonymous__1b7cvk = path.g7j_1.m(tmp8);
var sum = Companion_getInstance_8().i7a(lx._v, ly._v, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam) + Companion_getInstance_8().i7a(tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve = numberToInt(sum);
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
tmp$ret$1 = Math.max(tmp0_approximateCurve, 20);
var rcurveSteps = tmp$ret$1;
var dt = 1.0 / rcurveSteps;
var lastX = {_v: 0.0};
var lastY = {_v: 0.0};
var prevX = {_v: 0.0};
var prevY = {_v: 0.0};
var emittedCount = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc = Companion_getInstance_18();
var tmp1_quadCalc = lx._v;
var tmp2_quadCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1 = 1.0;
var a = t1 * t1;
var c = 0.0;
var b = 2 * t1 * 0.0;
var tmp3__anonymous__ufb84q_0 = a * tmp1_quadCalc + b * tmp6__anonymous__fv9ai5 + c * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_0 = a * tmp2_quadCalc + b * tmp7__anonymous__b0knam + c * tmp9__anonymous__1b7cvk;
lastX._v = tmp3__anonymous__ufb84q_0;
lastY._v = tmp4__anonymous__pkmkx7_0;
tmp$ret$2 = Unit_getInstance();
var nStart = false ? 0 : 1;
var nEnd = rcurveSteps;
var inductionVariable = nStart;
if (inductionVariable <= nEnd)
do {
var n_1 = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n_1 * dt;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc_0 = Companion_getInstance_18();
var tmp1_quadCalc_0 = lx._v;
var tmp2_quadCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1_0 = 1 - ratio;
var a_0 = t1_0 * t1_0;
var c_0 = ratio * ratio;
var b_0 = 2 * t1_0 * ratio;
var tmp3__anonymous__ufb84q_1 = a_0 * tmp1_quadCalc_0 + b_0 * tmp6__anonymous__fv9ai5 + c_0 * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_1 = a_0 * tmp2_quadCalc_0 + b_0 * tmp7__anonymous__b0knam + c_0 * tmp9__anonymous__1b7cvk;
var tmp$ret$3;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
this.m7q(tmp3__anonymous__ufb84q_1, tmp4__anonymous__pkmkx7_1, false);
var tmp0_0 = emittedCount._v;
emittedCount._v = tmp0_0 + 1 | 0;
lastX._v = prevX._v;
lastY._v = prevY._v;
tmp$ret$3 = Unit_getInstance();
prevX._v = tmp3__anonymous__ufb84q_1;
prevY._v = tmp4__anonymous__pkmkx7_1;
tmp$ret$4 = Unit_getInstance();
}
while (!(n_1 === nEnd));
lx._v = tmp8__anonymous__65w033;
ly._v = tmp9__anonymous__1b7cvk;
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$5 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp10__anonymous__yfiz50 = path.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp11__anonymous__tkubxh = path.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp12__anonymous__oq5opy = path.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp13__anonymous__jvh1if = path.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp14__anonymous__f0seaw = path.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp15__anonymous__a63r3d = path.g7j_1.m(tmp14);
var sum_0 = Companion_getInstance_8().i7a(lx._v, ly._v, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh) + Companion_getInstance_8().i7a(tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if) + Companion_getInstance_8().i7a(tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if, tmp14__anonymous__f0seaw, tmp15__anonymous__a63r3d);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve_0 = numberToInt(sum_0);
var tmp$ret$6;
// Inline function 'kotlin.math.max' call
tmp$ret$6 = Math.max(tmp0_approximateCurve_0, 20);
var rcurveSteps_0 = tmp$ret$6;
var dt_0 = 1.0 / rcurveSteps_0;
var lastX_0 = {_v: 0.0};
var lastY_0 = {_v: 0.0};
var prevX_0 = {_v: 0.0};
var prevY_0 = {_v: 0.0};
var emittedCount_0 = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc = Companion_getInstance_18();
var tmp1_cubicCalc = lx._v;
var tmp2_cubicCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc);
var bx = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx;
var ax = tmp14__anonymous__f0seaw - tmp1_cubicCalc - cx - bx;
var cy = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc);
var by = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy;
var ay = tmp15__anonymous__a63r3d - tmp2_cubicCalc - cy - by;
var tSquared = 0.0;
var tCubed = tSquared * 0.0;
var tmp3__anonymous__ufb84q_2 = ax * tCubed + bx * tSquared + cx * 0.0 + tmp1_cubicCalc;
var tmp4__anonymous__pkmkx7_2 = ay * tCubed + by * tSquared + cy * 0.0 + tmp2_cubicCalc;
lastX_0._v = tmp3__anonymous__ufb84q_2;
lastY_0._v = tmp4__anonymous__pkmkx7_2;
tmp$ret$7 = Unit_getInstance();
var nStart_0 = false ? 0 : 1;
var nEnd_0 = rcurveSteps_0;
var inductionVariable_0 = nStart_0;
if (inductionVariable_0 <= nEnd_0)
do {
var n_2 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var ratio_0 = n_2 * dt_0;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$9;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc_0 = Companion_getInstance_18();
var tmp1_cubicCalc_0 = lx._v;
var tmp2_cubicCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx_0 = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc_0);
var bx_0 = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx_0;
var ax_0 = tmp14__anonymous__f0seaw - tmp1_cubicCalc_0 - cx_0 - bx_0;
var cy_0 = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc_0);
var by_0 = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy_0;
var ay_0 = tmp15__anonymous__a63r3d - tmp2_cubicCalc_0 - cy_0 - by_0;
var tSquared_0 = ratio_0 * ratio_0;
var tCubed_0 = tSquared_0 * ratio_0;
var tmp3__anonymous__ufb84q_3 = ax_0 * tCubed_0 + bx_0 * tSquared_0 + cx_0 * ratio_0 + tmp1_cubicCalc_0;
var tmp4__anonymous__pkmkx7_3 = ay_0 * tCubed_0 + by_0 * tSquared_0 + cy_0 * ratio_0 + tmp2_cubicCalc_0;
var tmp$ret$8;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
this.m7q(tmp3__anonymous__ufb84q_3, tmp4__anonymous__pkmkx7_3, false);
var tmp0_1 = emittedCount_0._v;
emittedCount_0._v = tmp0_1 + 1 | 0;
lastX_0._v = prevX_0._v;
lastY_0._v = prevY_0._v;
tmp$ret$8 = Unit_getInstance();
prevX_0._v = tmp3__anonymous__ufb84q_3;
prevY_0._v = tmp4__anonymous__pkmkx7_3;
tmp$ret$9 = Unit_getInstance();
}
while (!(n_2 === nEnd_0));
lx._v = tmp14__anonymous__f0seaw;
ly._v = tmp15__anonymous__a63r3d;
var tmp$ret$10;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$10 = Unit_getInstance();
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
var tmp0__anonymous__q1qw7t = ix;
var tmp1__anonymous__uwfjfc_0 = iy;
this.m7q(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc_0, false);
var tmp$ret$11;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
tmp$ret$11 = Unit_getInstance();
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
{
this.x2c();
}
}
}
}
}
}
}
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.add.<anonymous>' call
if (false) {
this.x2c();
}
};
PolygonScanline.prototype.m7q = function (x, y, move) {
var tmp;
if (move) {
this.r7e(x, y);
tmp = Unit_getInstance();
} else {
this.u7e(x, y);
tmp = Unit_getInstance();
}
return tmp;
};
PolygonScanline.prototype.n7q = function (y, block) {
var edgesChecked = 0;
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY' call
var tmp0_fastForEachY = this.s7p_1;
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp0_fastForEachY_0 = tmp0_fastForEachY.h7p_1;
if (tmp0_fastForEachY_0.i() > 0) {
var tmp0_safe_receiver = tmp0_fastForEachY_0.c7p(y);
if (tmp0_safe_receiver == null)
null;
else {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach = tmp0_safe_receiver.u7o_1;
var array = tmp0_fastForEach.b4r_1;
var n = 0;
while (n < array.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0_unsafeCast = array[tmp0];
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_unsafeCast;
tmp$ret$1 = tmp$ret$0;
var tmp1__anonymous__uwfjfc = tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.forEachActiveEdgeAtY.<anonymous>' call
var tmp0_0 = edgesChecked;
edgesChecked = tmp0_0 + 1 | 0;
if (tmp1__anonymous__uwfjfc.m7o(y))
block(tmp1__anonymous__uwfjfc);
}
tmp$ret$2 = Unit_getInstance();
}
}
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp2_fastForEachY = tmp0_fastForEachY.i7p_1;
if (tmp2_fastForEachY.i() > 0) {
var tmp0_safe_receiver_0 = tmp2_fastForEachY.c7p(y);
if (tmp0_safe_receiver_0 == null)
null;
else {
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach_0 = tmp0_safe_receiver_0.u7o_1;
var array_0 = tmp0_fastForEach_0.b4r_1;
var n_0 = 0;
while (n_0 < array_0.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$4;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0_1 = n_0;
n_0 = tmp0_1 + 1 | 0;
var tmp0_unsafeCast_0 = array_0[tmp0_1];
var tmp$ret$3;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$3 = tmp0_unsafeCast_0;
tmp$ret$4 = tmp$ret$3;
var tmp3__anonymous__ufb84q = tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.forEachActiveEdgeAtY.<anonymous>' call
var tmp0_2 = edgesChecked;
edgesChecked = tmp0_2 + 1 | 0;
if (tmp3__anonymous__ufb84q.m7o(y))
block(tmp3__anonymous__ufb84q);
}
tmp$ret$5 = Unit_getInstance();
}
}
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp4_fastForEachY = tmp0_fastForEachY.j7p_1;
if (tmp4_fastForEachY.i() > 0) {
var tmp0_safe_receiver_1 = tmp4_fastForEachY.c7p(y);
if (tmp0_safe_receiver_1 == null)
null;
else {
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach_1 = tmp0_safe_receiver_1.u7o_1;
var array_1 = tmp0_fastForEach_1.b4r_1;
var n_1 = 0;
while (n_1 < array_1.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$7;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0_3 = n_1;
n_1 = tmp0_3 + 1 | 0;
var tmp0_unsafeCast_1 = array_1[tmp0_3];
var tmp$ret$6;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$6 = tmp0_unsafeCast_1;
tmp$ret$7 = tmp$ret$6;
var tmp5__anonymous__kpxxpo = tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.forEachActiveEdgeAtY.<anonymous>' call
var tmp0_4 = edgesChecked;
edgesChecked = tmp0_4 + 1 | 0;
if (tmp5__anonymous__kpxxpo.m7o(y))
block(tmp5__anonymous__kpxxpo);
}
tmp$ret$8 = Unit_getInstance();
}
}
return edgesChecked;
};
PolygonScanline.prototype.x2c = function () {
this.u7e(this.v7p_1, this.w7p_1);
};
PolygonScanline.prototype.o7q = function () {
return this.b7q_1;
};
PolygonScanline.prototype.p7q = function (y, winding, out) {
this.b7q_1 = 0;
this.a7q_1.x7();
out.zl();
var tmp0_this = this;
var tmp = tmp0_this;
var tmp_0 = tmp0_this.b7q_1;
var tmp$ret$9;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.forEachActiveEdgeAtY' call
var edgesChecked = 0;
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY' call
var tmp0_fastForEachY = this.s7p_1;
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp0_fastForEachY_0 = tmp0_fastForEachY.h7p_1;
if (tmp0_fastForEachY_0.i() > 0) {
var tmp0_safe_receiver = tmp0_fastForEachY_0.c7p(y);
if (tmp0_safe_receiver == null)
null;
else {
var tmp$ret$2;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach = tmp0_safe_receiver.u7o_1;
var array = tmp0_fastForEach.b4r_1;
var n = 0;
while (n < array.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0_unsafeCast = array[tmp0];
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_unsafeCast;
tmp$ret$1 = tmp$ret$0;
var tmp1__anonymous__uwfjfc = tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.forEachActiveEdgeAtY.<anonymous>' call
var tmp0_0 = edgesChecked;
edgesChecked = tmp0_0 + 1 | 0;
if (tmp1__anonymous__uwfjfc.m7o(y)) {
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.scanline.<anonymous>' call
if (!tmp1__anonymous__uwfjfc.v7n_1) {
this.a7q_1.g7q(tmp1__anonymous__uwfjfc.n7o(y), tmp1__anonymous__uwfjfc.s7n_1);
}
}
}
tmp$ret$2 = Unit_getInstance();
}
}
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp2_fastForEachY = tmp0_fastForEachY.i7p_1;
if (tmp2_fastForEachY.i() > 0) {
var tmp0_safe_receiver_0 = tmp2_fastForEachY.c7p(y);
if (tmp0_safe_receiver_0 == null)
null;
else {
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach_0 = tmp0_safe_receiver_0.u7o_1;
var array_0 = tmp0_fastForEach_0.b4r_1;
var n_0 = 0;
while (n_0 < array_0.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$4;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0_1 = n_0;
n_0 = tmp0_1 + 1 | 0;
var tmp0_unsafeCast_0 = array_0[tmp0_1];
var tmp$ret$3;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$3 = tmp0_unsafeCast_0;
tmp$ret$4 = tmp$ret$3;
var tmp3__anonymous__ufb84q = tmp$ret$4;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.forEachActiveEdgeAtY.<anonymous>' call
var tmp0_2 = edgesChecked;
edgesChecked = tmp0_2 + 1 | 0;
if (tmp3__anonymous__ufb84q.m7o(y)) {
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.scanline.<anonymous>' call
if (!tmp3__anonymous__ufb84q.v7n_1) {
this.a7q_1.g7q(tmp3__anonymous__ufb84q.n7o(y), tmp3__anonymous__ufb84q.s7n_1);
}
}
}
tmp$ret$5 = Unit_getInstance();
}
}
// Inline function 'com.soywiz.korma.geom.vector.Buckets.fastForEachY' call
var tmp4_fastForEachY = tmp0_fastForEachY.j7p_1;
if (tmp4_fastForEachY.i() > 0) {
var tmp0_safe_receiver_1 = tmp4_fastForEachY.c7p(y);
if (tmp0_safe_receiver_1 == null)
null;
else {
var tmp$ret$8;
// Inline function 'com.soywiz.korma.geom.vector.Bucket.fastForEach' call
var tmp0_fastForEach_1 = tmp0_safe_receiver_1.u7o_1;
var array_1 = tmp0_fastForEach_1.b4r_1;
var n_1 = 0;
while (n_1 < array_1.length) {
// Inline function 'com.soywiz.korma.geom.vector.AllBuckets.fastForEachY.<anonymous>' call
var tmp$ret$7;
// Inline function 'kotlin.js.unsafeCast' call
var tmp0_3 = n_1;
n_1 = tmp0_3 + 1 | 0;
var tmp0_unsafeCast_1 = array_1[tmp0_3];
var tmp$ret$6;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$6 = tmp0_unsafeCast_1;
tmp$ret$7 = tmp$ret$6;
var tmp5__anonymous__kpxxpo = tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.forEachActiveEdgeAtY.<anonymous>' call
var tmp0_4 = edgesChecked;
edgesChecked = tmp0_4 + 1 | 0;
if (tmp5__anonymous__kpxxpo.m7o(y)) {
// Inline function 'com.soywiz.korma.geom.vector.PolygonScanline.scanline.<anonymous>' call
if (!tmp5__anonymous__kpxxpo.v7n_1) {
this.a7q_1.g7q(tmp5__anonymous__kpxxpo.n7o(y), tmp5__anonymous__kpxxpo.s7n_1);
}
}
}
tmp$ret$8 = Unit_getInstance();
}
}
tmp$ret$9 = edgesChecked;
tmp.b7q_1 = tmp_0 + tmp$ret$9 | 0;
genericSort(this.a7q_1, 0, this.a7q_1.i() - 1 | 0, IntArrayListSort_getInstance());
var tempX = this.a7q_1.e7q_1;
var tempW = this.a7q_1.f7q_1;
if (this.a7q_1.i() >= 2) {
var tmp1_subject = winding;
var tmp0_5 = tmp1_subject.q2_1;
if (tmp0_5 === 0) {
var progression = step(until(0, tempX.i() - 1 | 0), 2);
var inductionVariable = progression.r1_1;
var last = progression.s1_1;
var step_0 = progression.t1_1;
if ((step_0 > 0 ? inductionVariable <= last : false) ? true : step_0 < 0 ? last <= inductionVariable : false)
do {
var i = inductionVariable;
inductionVariable = inductionVariable + step_0 | 0;
var a = tempX.t4n(i);
var b = tempX.t4n(i + 1 | 0);
out.d7c(a, b);
}
while (!(i === last));
} else if (tmp0_5 === 1) {
var count = 0;
var startX = 0;
var endX = 0;
var pending = false;
var inductionVariable_0 = 0;
var last_0 = tempX.i() - 1 | 0;
if (inductionVariable_0 < last_0)
do {
var i_0 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var a_0 = tempX.t4n(i_0);
count = count + tempW.t4n(i_0) | 0;
var b_0 = tempX.t4n(i_0 + 1 | 0);
if (!(count === 0)) {
if (pending ? !(a_0 === endX) : false) {
out.d7c(startX, endX);
startX = a_0;
endX = b_0;
} else {
if (!pending) {
startX = a_0;
}
endX = b_0;
}
pending = true;
}
}
while (inductionVariable_0 < last_0);
if (pending) {
out.d7c(startX, endX);
}
}
}
return out;
};
PolygonScanline.$metadata$ = classMeta('PolygonScanline', undefined, undefined, undefined, undefined, RastScale.prototype);
function Companion_29() {
Companion_instance_29 = this;
this.u7q_1 = 20;
this.v7q_1 = 0;
this.w7q_1 = 80;
this.x7q_1 = 320;
this.y7q_1 = 1280;
}
Companion_29.$metadata$ = objectMeta('Companion');
var Companion_instance_29;
function Companion_getInstance_29() {
if (Companion_instance_29 == null)
new Companion_29();
return Companion_instance_29;
}
function RastScale() {
Companion_getInstance_29();
}
RastScale.prototype.s7q = function () {
Companion_getInstance_29();
return 20;
};
RastScale.prototype.t7q = function () {
Companion_getInstance_29();
return 0;
};
RastScale.prototype.d7q = function (_this__u8e3s4) {
return numberToInt(_this__u8e3s4 * this.s7q()) + this.t7q() | 0;
};
RastScale.$metadata$ = classMeta('RastScale');
function StrokeInfo_init_$Init$(thickness, pixelHinting, scaleMode, startCap, endCap, join, miterLimit, dash, dashOffset, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0))
thickness = 1.0;
if (!(($mask0 & 2) === 0))
pixelHinting = false;
if (!(($mask0 & 4) === 0))
scaleMode = LineScaleMode_NORMAL_getInstance();
if (!(($mask0 & 8) === 0))
startCap = LineCap_BUTT_getInstance();
if (!(($mask0 & 16) === 0))
endCap = LineCap_BUTT_getInstance();
if (!(($mask0 & 32) === 0))
join = LineJoin_MITER_getInstance();
if (!(($mask0 & 64) === 0))
miterLimit = 20.0;
if (!(($mask0 & 128) === 0))
dash = null;
if (!(($mask0 & 256) === 0))
dashOffset = 0.0;
StrokeInfo.call($this, thickness, pixelHinting, scaleMode, startCap, endCap, join, miterLimit, dash, dashOffset);
return $this;
}
function StrokeInfo_init_$Create$(thickness, pixelHinting, scaleMode, startCap, endCap, join, miterLimit, dash, dashOffset, $mask0, $marker) {
return StrokeInfo_init_$Init$(thickness, pixelHinting, scaleMode, startCap, endCap, join, miterLimit, dash, dashOffset, $mask0, $marker, Object.create(StrokeInfo.prototype));
}
function StrokeInfo(thickness, pixelHinting, scaleMode, startCap, endCap, join, miterLimit, dash, dashOffset) {
this.t7j_1 = thickness;
this.u7j_1 = pixelHinting;
this.v7j_1 = scaleMode;
this.w7j_1 = startCap;
this.x7j_1 = endCap;
this.y7j_1 = join;
this.z7j_1 = miterLimit;
this.a7k_1 = dash;
this.b7k_1 = dashOffset;
}
StrokeInfo.prototype.z7q = function () {
return this.t7j_1;
};
StrokeInfo.prototype.toString = function () {
return 'StrokeInfo(thickness=' + this.t7j_1 + ', pixelHinting=' + this.u7j_1 + ', scaleMode=' + this.v7j_1 + ', startCap=' + this.w7j_1 + ', endCap=' + this.x7j_1 + ', join=' + this.y7j_1 + ', miterLimit=' + this.z7j_1 + ', dash=' + this.a7k_1 + ', dashOffset=' + this.b7k_1 + ')';
};
StrokeInfo.prototype.hashCode = function () {
var result = getNumberHashCode(this.t7j_1);
result = imul(result, 31) + (this.u7j_1 | 0) | 0;
result = imul(result, 31) + this.v7j_1.hashCode() | 0;
result = imul(result, 31) + this.w7j_1.hashCode() | 0;
result = imul(result, 31) + this.x7j_1.hashCode() | 0;
result = imul(result, 31) + this.y7j_1.hashCode() | 0;
result = imul(result, 31) + getNumberHashCode(this.z7j_1) | 0;
result = imul(result, 31) + (this.a7k_1 == null ? 0 : hashCode(this.a7k_1)) | 0;
result = imul(result, 31) + getNumberHashCode(this.b7k_1) | 0;
return result;
};
StrokeInfo.prototype.equals = function (other) {
if (this === other)
return true;
if (!(other instanceof StrokeInfo))
return false;
var tmp0_other_with_cast = other instanceof StrokeInfo ? other : THROW_CCE();
if (!equals(this.t7j_1, tmp0_other_with_cast.t7j_1))
return false;
if (!(this.u7j_1 === tmp0_other_with_cast.u7j_1))
return false;
if (!this.v7j_1.equals(tmp0_other_with_cast.v7j_1))
return false;
if (!this.w7j_1.equals(tmp0_other_with_cast.w7j_1))
return false;
if (!this.x7j_1.equals(tmp0_other_with_cast.x7j_1))
return false;
if (!this.y7j_1.equals(tmp0_other_with_cast.y7j_1))
return false;
if (!equals(this.z7j_1, tmp0_other_with_cast.z7j_1))
return false;
if (!equals(this.a7k_1, tmp0_other_with_cast.a7k_1))
return false;
if (!equals(this.b7k_1, tmp0_other_with_cast.b7k_1))
return false;
return true;
};
StrokeInfo.$metadata$ = classMeta('StrokeInfo');
function strokeToFill(_this__u8e3s4, info, temp, outFill) {
return strokeToFill_0(_this__u8e3s4, info.t7j_1, info.y7j_1, info.w7j_1, info.x7j_1, info.z7j_1, info.a7k_1, info.b7k_1, temp, outFill);
}
function strokeToFill$default(_this__u8e3s4, info, temp, outFill, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
temp = new StrokeToFill();
if (!(($mask0 & 4) === 0)) {
var tmp = Winding_NON_ZERO_getInstance();
outFill = VectorPath_init_$Create$(null, null, tmp, false, 11, null);
}
return strokeToFill(_this__u8e3s4, info, temp, outFill);
}
var EdgePoint_A_instance;
var EdgePoint_B_instance;
var EdgePoint_entriesInitialized;
function EdgePoint_initEntries() {
if (EdgePoint_entriesInitialized)
return Unit_getInstance();
EdgePoint_entriesInitialized = true;
EdgePoint_A_instance = new EdgePoint('A', 0, 0);
EdgePoint_B_instance = new EdgePoint('B', 1, 1);
}
function _get_outFill__zcv64g($this) {
var tmp = $this.b7r_1;
if (!(tmp == null))
return tmp;
else {
throwUninitializedPropertyAccessException('outFill');
}
}
function EdgePoint(name, ordinal, n) {
Enum.call(this, name, ordinal);
this.w7r_1 = n;
}
EdgePoint.$metadata$ = classMeta('EdgePoint', undefined, undefined, undefined, undefined, Enum.prototype);
function EdgePoint_A_getInstance() {
EdgePoint_initEntries();
return EdgePoint_A_instance;
}
function EdgePoint_B_getInstance() {
EdgePoint_initEntries();
return EdgePoint_B_instance;
}
function StrokeToFill() {
this.a7r_1 = 1;
this.c7r_1 = LineCap_BUTT_getInstance();
this.d7r_1 = LineCap_BUTT_getInstance();
this.e7r_1 = LineJoin_BEVEL_getInstance();
this.f7r_1 = 4.0;
this.g7r_1 = new PointIntArrayList(1024);
this.h7r_1 = new IntArrayList(1024);
var tmp = this;
var tmp_0 = 0;
var tmp_1 = 2;
var tmp$ret$0;
// Inline function 'kotlin.arrayOfNulls' call
tmp$ret$0 = fillArrayVal(Array(tmp_1), null);
var tmp_2 = tmp$ret$0;
while (tmp_0 < tmp_1) {
var tmp_3 = tmp_0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.fillPoints.<anonymous>' call
tmp$ret$1 = new PointIntArrayList(1024);
tmp_2[tmp_3] = tmp$ret$1;
tmp_0 = tmp_0 + 1 | 0;
}
tmp.i7r_1 = tmp_2;
this.j7r_1 = this.i7r_1[0];
this.k7r_1 = this.i7r_1[1];
this.l7r_1 = new Edge();
this.m7r_1 = new Edge();
this.n7r_1 = new Edge();
this.o7r_1 = new Edge();
this.p7r_1 = new Edge();
this.q7r_1 = new Edge();
this.r7r_1 = Companion_getInstance_8().zp();
this.s7r_1 = Companion_getInstance_8().zp();
this.t7r_1 = Companion_getInstance_8().zp();
}
StrokeToFill.prototype.x7r = function () {
return this.g7r_1;
};
StrokeToFill.prototype.y7r = function () {
return this.h7r_1;
};
StrokeToFill.prototype.z7r = function (_this__u8e3s4, edge, width, angle) {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.setEdgeDisplaced.<anonymous>' call
var ldx = width * get_cosine(angle);
var ldy = width * get_sine(angle);
_this__u8e3s4.j7o(numberToInt(edge.o7n_1 + ldx), numberToInt(edge.p7n_1 + ldy), numberToInt(edge.q7n_1 + ldx), numberToInt(edge.r7n_1 + ldy), edge.s7n_1);
tmp$ret$0 = _this__u8e3s4;
return tmp$ret$0;
};
StrokeToFill.prototype.a7s = function (_this__u8e3s4, e) {
return _this__u8e3s4.d7c(e.o7n_1, e.p7n_1);
};
StrokeToFill.prototype.b7s = function (_this__u8e3s4, e) {
return _this__u8e3s4.d7c(e.q7n_1, e.r7n_1);
};
StrokeToFill.prototype.c7s = function (_this__u8e3s4, e) {
if (!(e == null)) {
_this__u8e3s4.d7c(numberToInt(e.y72_1), numberToInt(e.z72_1));
}
};
StrokeToFill.prototype.d7s = function (out, mainPrev, mainCurr, prev, curr, join, miterLimit, scale, forcedMiter) {
var rjoin = forcedMiter ? LineJoin_MITER_getInstance() : join;
var tmp0_subject = rjoin;
var tmp0 = tmp0_subject.q2_1;
switch (tmp0) {
case 2:
var intersection2 = this.r7r_1.r7a(mainPrev.q7n_1, mainPrev.r7n_1);
var intersection = Companion_getInstance_26().n7n(prev, curr, this.t7r_1);
if (!(intersection == null)) {
var dist = Companion_getInstance_8().l7a(intersection, intersection2);
if (forcedMiter ? true : dist <= miterLimit) {
this.c7s(out, intersection);
} else {
this.b7s(out, prev);
this.a7s(out, curr);
}
}
break;
case 0:
this.b7s(out, prev);
;
this.a7s(out, curr);
;
break;
case 1:
var i = Companion_getInstance_26().n7n(prev, curr, this.t7r_1);
if (!(i == null)) {
var count = clamp_0(numberToInt(Companion_getInstance_8().k7a(prev.q7n_1, prev.r7n_1, curr.o7n_1, curr.p7n_1) * scale), 4, 64);
var inductionVariable = 0;
if (inductionVariable <= count)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
this.c7s(out, Companion_getInstance_18().k7g(prev.q7n_1, prev.r7n_1, i.y72_1, i.z72_1, curr.o7n_1, curr.p7n_1, n / count, this.s7r_1));
}
while (!(n === count));
} else {
this.b7s(out, prev);
this.a7s(out, curr);
}
break;
}
};
StrokeToFill.prototype.e7s = function (l, r, left, right, epoint, cap, scale) {
var angle = epoint.equals(EdgePoint_A_getInstance()) ? unaryMinus(left.z7n()) : unaryPlus(left.z7n());
var lx = left.p71(epoint.w7r_1);
var ly = left.q71(epoint.w7r_1);
var rx = right.p71(epoint.w7r_1);
var ry = right.q71(epoint.w7r_1);
var tmp0_subject = cap;
var tmp0 = tmp0_subject.q2_1;
switch (tmp0) {
case 0:
l.d7c(lx, ly);
;
r.d7c(rx, ry);
;
break;
case 2:
case 1:
var ax = numberToInt(get_cosine(angle) * this.a7r_1 / 2);
var ay = numberToInt(get_sine(angle) * this.a7r_1 / 2);
var lx2 = lx + ax | 0;
var ly2 = ly + ay | 0;
var rx2 = rx + ax | 0;
var ry2 = ry + ay | 0;
if (cap.equals(LineCap_SQUARE_getInstance())) {
l.d7c(lx2, ly2);
r.d7c(rx2, ry2);
} else {
var count = clamp_0(numberToInt(Companion_getInstance_8().k7a(lx, ly, rx, ry) * scale), 4, 64);
l.d7c(lx, ly);
var inductionVariable = 0;
if (inductionVariable <= count)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var m = epoint.equals(EdgePoint_A_getInstance()) ? n : count - n | 0;
var ratio = m / count;
this.c7s(r, Companion_getInstance_18().j7g(lx, ly, lx2, ly2, rx2, ry2, rx, ry, ratio, this.s7r_1));
}
while (!(n === count));
}
break;
}
};
StrokeToFill.prototype.f7s = function (scale, closed) {
if (this.g7r_1.p())
return Unit_getInstance();
var weightD2 = this.a7r_1 / 2 | 0;
this.j7r_1.x7();
this.k7r_1.x7();
var sp = this.g7r_1;
var nstrokePoints = sp.i();
var inductionVariable = 0;
if (inductionVariable < nstrokePoints)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var isFirst = n === 0;
var isLast = n === (nstrokePoints - 1 | 0);
var isMiddle = !isFirst ? !isLast ? true : closed : false;
var n1 = isLast ? closed ? 1 : n : n + 1 | 0;
this.l7r_1.i7o(this.o7r_1);
this.m7r_1.i7o(this.p7r_1);
this.n7r_1.i7o(this.q7r_1);
var doJoin = !(this.h7r_1.t4n(n) === 0);
this.o7r_1.j7o(sp.p71(n), sp.q71(n), sp.p71(n1), sp.q71(n1), 1);
this.z7r(this.p7r_1, this.o7r_1, weightD2, minus(this.o7r_1.z7n(), get_degrees(90)));
this.z7r(this.q7r_1, this.o7r_1, weightD2, plus_0(this.o7r_1.z7n(), get_degrees(90)));
if (isFirst) {
this.e7s(this.j7r_1, this.k7r_1, this.p7r_1, this.q7r_1, EdgePoint_A_getInstance(), closed ? LineCap_BUTT_getInstance() : this.c7r_1, scale);
} else if (isMiddle) {
var angle = Companion_getInstance_26().y7n(this.l7r_1, this.o7r_1);
var leftAngle = Angle__compareTo_impl_a0hfds(angle, get_degrees(0)) > 0;
if (doJoin) {
this.d7s(this.j7r_1, this.l7r_1, this.o7r_1, this.m7r_1, this.p7r_1, this.e7r_1, this.f7r_1, scale, leftAngle);
this.d7s(this.k7r_1, this.l7r_1, this.o7r_1, this.n7r_1, this.q7r_1, this.e7r_1, this.f7r_1, scale, !leftAngle);
} else {
this.a7s(this.j7r_1, this.p7r_1);
this.a7s(this.k7r_1, this.q7r_1);
}
} else if (isLast) {
if (closed) {
this.e7s(this.j7r_1, this.k7r_1, this.p7r_1, this.q7r_1, EdgePoint_B_getInstance(), LineCap_BUTT_getInstance(), scale);
} else {
this.e7s(this.j7r_1, this.k7r_1, this.m7r_1, this.n7r_1, EdgePoint_B_getInstance(), this.d7r_1, scale);
}
}
}
while (inductionVariable < nstrokePoints);
var inductionVariable_0 = 0;
var last = this.j7r_1.i();
if (inductionVariable_0 < last)
do {
var n_0 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var x = this.j7r_1.p71(n_0);
var y = this.j7r_1.q71(n_0);
if (n_0 === 0) {
_get_outFill__zcv64g(this).r7e(x * scale, y * scale);
} else {
_get_outFill__zcv64g(this).u7e(x * scale, y * scale);
}
}
while (inductionVariable_0 < last);
var inductionVariable_1 = 0;
var last_0 = this.k7r_1.i();
if (inductionVariable_1 < last_0)
do {
var n_1 = inductionVariable_1;
inductionVariable_1 = inductionVariable_1 + 1 | 0;
var m = (this.k7r_1.i() - n_1 | 0) - 1 | 0;
_get_outFill__zcv64g(this).u7e(this.k7r_1.p71(m) * scale, this.k7r_1.q71(m) * scale);
}
while (inductionVariable_1 < last_0);
_get_outFill__zcv64g(this).x2c();
_get_outFill__zcv64g(this).h7j_1 = Winding_NON_ZERO_getInstance();
this.g7r_1.x7();
this.h7r_1.x7();
};
StrokeToFill.prototype.g7s = function (outFill, weight, startCap, endCap, joins, miterLimit) {
this.b7r_1 = outFill;
this.a7r_1 = weight;
this.c7r_1 = startCap;
this.d7r_1 = endCap;
this.e7r_1 = joins;
this.f7r_1 = miterLimit * weight;
};
StrokeToFill.prototype.h7s = function (stroke, lineWidth, joins, startCap, endCap, miterLimit, outFill) {
Companion_getInstance_29();
var scale = 20;
Companion_getInstance_29();
var iscale = 1.0 / 20;
this.g7s(outFill, numberToInt(lineWidth * scale), startCap, endCap, joins, miterLimit);
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2' call
var ix = 0.0;
var iy = 0.0;
var lx = {_v: 0.0};
var ly = {_v: 0.0};
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
if (false) {
this.f7s(iscale, true);
}
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = stroke.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp2__anonymous__z9zvc9 = stroke.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp3__anonymous__ufb84q = stroke.g7j_1.m(tmp2);
ix = tmp2__anonymous__z9zvc9;
iy = tmp3__anonymous__ufb84q;
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
{
this.f7s(iscale, false);
}
this.g7r_1.d7c(numberToInt(tmp2__anonymous__z9zvc9 * scale), numberToInt(tmp3__anonymous__ufb84q * scale));
this.h7r_1.m4o(0);
lx._v = tmp2__anonymous__z9zvc9;
ly._v = tmp3__anonymous__ufb84q;
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp4__anonymous__pkmkx7 = stroke.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp5__anonymous__kpxxpo = stroke.g7j_1.m(tmp4);
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
if (false) {
this.f7s(iscale, false);
}
this.g7r_1.d7c(numberToInt(tmp4__anonymous__pkmkx7 * scale), numberToInt(tmp5__anonymous__kpxxpo * scale));
this.h7r_1.m4o(0);
lx._v = tmp4__anonymous__pkmkx7;
ly._v = tmp5__anonymous__kpxxpo;
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
this.h7r_1.r4o(this.h7r_1.i() - 1 | 0, 1);
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp6__anonymous__fv9ai5 = stroke.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp7__anonymous__b0knam = stroke.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp8__anonymous__65w033 = stroke.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp9__anonymous__1b7cvk = stroke.g7j_1.m(tmp8);
var sum = Companion_getInstance_8().i7a(lx._v, ly._v, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam) + Companion_getInstance_8().i7a(tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve = numberToInt(sum);
var tmp$ret$0;
// Inline function 'kotlin.math.max' call
tmp$ret$0 = Math.max(tmp0_approximateCurve, 20);
var rcurveSteps = tmp$ret$0;
var dt = 1.0 / rcurveSteps;
var lastX = {_v: 0.0};
var lastY = {_v: 0.0};
var prevX = {_v: 0.0};
var prevY = {_v: 0.0};
var emittedCount = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc = Companion_getInstance_18();
var tmp1_quadCalc = lx._v;
var tmp2_quadCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1 = 1.0;
var a = t1 * t1;
var c = 0.0;
var b = 2 * t1 * 0.0;
var tmp3__anonymous__ufb84q_0 = a * tmp1_quadCalc + b * tmp6__anonymous__fv9ai5 + c * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_0 = a * tmp2_quadCalc + b * tmp7__anonymous__b0knam + c * tmp9__anonymous__1b7cvk;
lastX._v = tmp3__anonymous__ufb84q_0;
lastY._v = tmp4__anonymous__pkmkx7_0;
tmp$ret$1 = Unit_getInstance();
var nStart = false ? 0 : 1;
var nEnd = rcurveSteps;
var inductionVariable = nStart;
if (inductionVariable <= nEnd)
do {
var n_1 = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ratio = n_1 * dt;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.quadCalc' call
var tmp0_quadCalc_0 = Companion_getInstance_18();
var tmp1_quadCalc_0 = lx._v;
var tmp2_quadCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var t1_0 = 1 - ratio;
var a_0 = t1_0 * t1_0;
var c_0 = ratio * ratio;
var b_0 = 2 * t1_0 * ratio;
var tmp3__anonymous__ufb84q_1 = a_0 * tmp1_quadCalc_0 + b_0 * tmp6__anonymous__fv9ai5 + c_0 * tmp8__anonymous__65w033;
var tmp4__anonymous__pkmkx7_1 = a_0 * tmp2_quadCalc_0 + b_0 * tmp7__anonymous__b0knam + c_0 * tmp9__anonymous__1b7cvk;
var tmp$ret$2;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
if (false) {
this.f7s(iscale, false);
}
this.g7r_1.d7c(numberToInt(tmp3__anonymous__ufb84q_1 * scale), numberToInt(tmp4__anonymous__pkmkx7_1 * scale));
this.h7r_1.m4o(0);
var tmp0_0 = emittedCount._v;
emittedCount._v = tmp0_0 + 1 | 0;
lastX._v = prevX._v;
lastY._v = prevY._v;
tmp$ret$2 = Unit_getInstance();
prevX._v = tmp3__anonymous__ufb84q_1;
prevY._v = tmp4__anonymous__pkmkx7_1;
tmp$ret$3 = Unit_getInstance();
}
while (!(n_1 === nEnd));
lx._v = tmp8__anonymous__65w033;
ly._v = tmp9__anonymous__1b7cvk;
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
this.h7r_1.r4o(this.h7r_1.i() - 1 | 0, 1);
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp10__anonymous__yfiz50 = stroke.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp11__anonymous__tkubxh = stroke.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp12__anonymous__oq5opy = stroke.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp13__anonymous__jvh1if = stroke.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp14__anonymous__f0seaw = stroke.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp15__anonymous__a63r3d = stroke.g7j_1.m(tmp14);
var sum_0 = Companion_getInstance_8().i7a(lx._v, ly._v, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh) + Companion_getInstance_8().i7a(tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if) + Companion_getInstance_8().i7a(tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if, tmp14__anonymous__f0seaw, tmp15__anonymous__a63r3d);
// Inline function 'com.soywiz.korma.geom.shape.approximateCurve' call
var tmp0_approximateCurve_0 = numberToInt(sum_0);
var tmp$ret$4;
// Inline function 'kotlin.math.max' call
tmp$ret$4 = Math.max(tmp0_approximateCurve_0, 20);
var rcurveSteps_0 = tmp$ret$4;
var dt_0 = 1.0 / rcurveSteps_0;
var lastX_0 = {_v: 0.0};
var lastY_0 = {_v: 0.0};
var prevX_0 = {_v: 0.0};
var prevY_0 = {_v: 0.0};
var emittedCount_0 = {_v: 0};
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$5;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc = Companion_getInstance_18();
var tmp1_cubicCalc = lx._v;
var tmp2_cubicCalc = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc);
var bx = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx;
var ax = tmp14__anonymous__f0seaw - tmp1_cubicCalc - cx - bx;
var cy = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc);
var by = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy;
var ay = tmp15__anonymous__a63r3d - tmp2_cubicCalc - cy - by;
var tSquared = 0.0;
var tCubed = tSquared * 0.0;
var tmp3__anonymous__ufb84q_2 = ax * tCubed + bx * tSquared + cx * 0.0 + tmp1_cubicCalc;
var tmp4__anonymous__pkmkx7_2 = ay * tCubed + by * tSquared + cy * 0.0 + tmp2_cubicCalc;
lastX_0._v = tmp3__anonymous__ufb84q_2;
lastY_0._v = tmp4__anonymous__pkmkx7_2;
tmp$ret$5 = Unit_getInstance();
var nStart_0 = false ? 0 : 1;
var nEnd_0 = rcurveSteps_0;
var inductionVariable_0 = nStart_0;
if (inductionVariable_0 <= nEnd_0)
do {
var n_2 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var ratio_0 = n_2 * dt_0;
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
var tmp$ret$7;
// Inline function 'com.soywiz.korma.geom.bezier.Companion.cubicCalc' call
var tmp0_cubicCalc_0 = Companion_getInstance_18();
var tmp1_cubicCalc_0 = lx._v;
var tmp2_cubicCalc_0 = ly._v;
// Inline function 'kotlin.contracts.contract' call
var cx_0 = 3.0 * (tmp10__anonymous__yfiz50 - tmp1_cubicCalc_0);
var bx_0 = 3.0 * (tmp12__anonymous__oq5opy - tmp10__anonymous__yfiz50) - cx_0;
var ax_0 = tmp14__anonymous__f0seaw - tmp1_cubicCalc_0 - cx_0 - bx_0;
var cy_0 = 3.0 * (tmp11__anonymous__tkubxh - tmp2_cubicCalc_0);
var by_0 = 3.0 * (tmp13__anonymous__jvh1if - tmp11__anonymous__tkubxh) - cy_0;
var ay_0 = tmp15__anonymous__a63r3d - tmp2_cubicCalc_0 - cy_0 - by_0;
var tSquared_0 = ratio_0 * ratio_0;
var tCubed_0 = tSquared_0 * ratio_0;
var tmp3__anonymous__ufb84q_3 = ax_0 * tCubed_0 + bx_0 * tSquared_0 + cx_0 * ratio_0 + tmp1_cubicCalc_0;
var tmp4__anonymous__pkmkx7_3 = ay_0 * tCubed_0 + by_0 * tSquared_0 + cy_0 * ratio_0 + tmp2_cubicCalc_0;
var tmp$ret$6;
// Inline function 'kotlin.run' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
if (false) {
this.f7s(iscale, false);
}
this.g7r_1.d7c(numberToInt(tmp3__anonymous__ufb84q_3 * scale), numberToInt(tmp4__anonymous__pkmkx7_3 * scale));
this.h7r_1.m4o(0);
var tmp0_1 = emittedCount_0._v;
emittedCount_0._v = tmp0_1 + 1 | 0;
lastX_0._v = prevX_0._v;
lastY_0._v = prevY_0._v;
tmp$ret$6 = Unit_getInstance();
prevX_0._v = tmp3__anonymous__ufb84q_3;
prevY_0._v = tmp4__anonymous__pkmkx7_3;
tmp$ret$7 = Unit_getInstance();
}
while (!(n_2 === nEnd_0));
lx._v = tmp14__anonymous__f0seaw;
ly._v = tmp15__anonymous__a63r3d;
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
this.h7r_1.r4o(this.h7r_1.i() - 1 | 0, 1);
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.shape.emitPoints2.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
var tmp0__anonymous__q1qw7t = ix;
var tmp1__anonymous__uwfjfc_0 = iy;
if (false) {
this.f7s(iscale, false);
}
this.g7r_1.d7c(numberToInt(tmp0__anonymous__q1qw7t * scale), numberToInt(tmp1__anonymous__uwfjfc_0 * scale));
this.h7r_1.m4o(0);
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
this.h7r_1.r4o(this.h7r_1.i() - 1 | 0, 1);
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
{
this.f7s(iscale, true);
}
}
}
}
}
}
}
// Inline function 'com.soywiz.korma.geom.vector.StrokeToFill.strokeFill.<anonymous>' call
if (false) {
this.f7s(iscale, true);
}
this.f7s(iscale, false);
};
StrokeToFill.$metadata$ = classMeta('StrokeToFill');
function strokeToFill_0(_this__u8e3s4, lineWidth, joins, startCap, endCap, miterLimit, lineDash, lineDashOffset, temp, outFill) {
var tmp;
if (!(lineDash == null)) {
var tmp$ret$5;
// Inline function 'kotlin.collections.map' call
var tmp$ret$2;
// Inline function 'kotlin.collections.flatMap' call
var tmp0_flatMap = toCurvesList(_this__u8e3s4);
var tmp$ret$1;
// Inline function 'kotlin.collections.flatMapTo' call
var tmp0_flatMapTo = ArrayList_init_$Create$();
var tmp0_iterator = tmp0_flatMap.j();
while (tmp0_iterator.k()) {
var element = tmp0_iterator.l();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.vector.strokeToFill.<anonymous>' call
tmp$ret$0 = toDashes(element, lineDash.y4n(), lineDashOffset);
var list = tmp$ret$0;
addAll(tmp0_flatMapTo, list);
}
tmp$ret$1 = tmp0_flatMapTo;
tmp$ret$2 = tmp$ret$1;
var tmp1_map = tmp$ret$2;
var tmp$ret$4;
// Inline function 'kotlin.collections.mapTo' call
var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
var tmp0_iterator_0 = tmp1_map.j();
while (tmp0_iterator_0.k()) {
var item = tmp0_iterator_0.l();
var tmp$ret$3;
// Inline function 'com.soywiz.korma.geom.vector.strokeToFill.<anonymous>' call
tmp$ret$3 = toVectorPath$default(item, null, 1, null);
tmp0_mapTo.c(tmp$ret$3);
}
tmp$ret$4 = tmp0_mapTo;
tmp$ret$5 = tmp$ret$4;
tmp = tmp$ret$5;
} else {
tmp = listOf_0(_this__u8e3s4);
}
var strokePaths = tmp;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var n = 0;
while (n < strokePaths.i()) {
// Inline function 'com.soywiz.korma.geom.vector.strokeToFill.<anonymous>' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp2__anonymous__z9zvc9 = strokePaths.m(tmp0);
temp.h7s(tmp2__anonymous__z9zvc9, lineWidth, joins, startCap, endCap, miterLimit, outFill);
}
return outFill;
}
function isNotEmpty(_this__u8e3s4) {
return !(_this__u8e3s4.i7s() === 0);
}
function VectorBuilder() {
}
VectorBuilder.$metadata$ = interfaceMeta('VectorBuilder');
function moveTo_0(_this__u8e3s4, x, y) {
return _this__u8e3s4.r7e(x, y);
}
function lineTo_0(_this__u8e3s4, x, y) {
return _this__u8e3s4.u7e(x, y);
}
function quadTo_1(_this__u8e3s4, controlX, controlY, anchorX, anchorY) {
return _this__u8e3s4.v7e(controlX, controlY, anchorX, anchorY);
}
function roundRect(_this__u8e3s4, x, y, w, h, rx, ry) {
if (rx === 0.0 ? ry === 0.0 : false) {
rect(_this__u8e3s4, x, y, w, h);
} else {
var r = w < 2 * rx ? w / 2.0 : h < 2 * rx ? h / 2.0 : rx;
_this__u8e3s4.r7e(x + r, y);
arcTo(_this__u8e3s4, x + w, y, x + w, y + h, r);
arcTo(_this__u8e3s4, x + w, y + h, x, y + h, r);
arcTo(_this__u8e3s4, x, y + h, x, y, r);
arcTo(_this__u8e3s4, x, y, x + w, y, r);
_this__u8e3s4.x2c();
}
}
function isEmpty(_this__u8e3s4) {
return _this__u8e3s4.i7s() === 0;
}
function rect(_this__u8e3s4, x, y, width, height) {
_this__u8e3s4.r7e(x, y);
_this__u8e3s4.u7e(x + width, y);
_this__u8e3s4.u7e(x + width, y + height);
_this__u8e3s4.u7e(x, y + height);
_this__u8e3s4.x2c();
}
function transformed(_this__u8e3s4, m, block) {
return block(transformed_0(_this__u8e3s4, m));
}
function rect_0(_this__u8e3s4, rect_0) {
return rect(_this__u8e3s4, rect_0.d1n(), rect_0.e1n(), rect_0.d72(), rect_0.e72());
}
function rMoveTo(_this__u8e3s4, x, y) {
return _this__u8e3s4.r7e(_this__u8e3s4.s7e() + x, _this__u8e3s4.t7e() + y);
}
function rLineTo(_this__u8e3s4, x, y) {
return _this__u8e3s4.u7e(_this__u8e3s4.s7e() + x, _this__u8e3s4.t7e() + y);
}
function circle(_this__u8e3s4, x, y, radius) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.Companion.ZERO' call
var tmp0__get_ZERO__8316ll = Companion_getInstance_0();
tmp$ret$0 = tmp0__get_ZERO__8316ll.f70(0.0);
var tmp = tmp$ret$0;
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.Companion.FULL' call
var tmp1__get_FULL__9x62v5 = Companion_getInstance_0();
tmp$ret$1 = tmp1__get_FULL__9x62v5.f70(1.0);
var tmp_0 = tmp$ret$1;
return arc$default(_this__u8e3s4, x, y, radius, tmp, tmp_0, false, 32, null);
}
function roundRect_0(_this__u8e3s4, x, y, w, h, rx, ry) {
return roundRect(_this__u8e3s4, x, y, w, h, rx, ry);
}
function line(_this__u8e3s4, x0, y0, x1, y1) {
return line_0(_this__u8e3s4, x0, y0, x1, y1);
}
function moveTo_1(_this__u8e3s4, p) {
return _this__u8e3s4.r7e(p.d1n(), p.e1n());
}
function lineTo_1(_this__u8e3s4, p) {
return _this__u8e3s4.u7e(p.d1n(), p.e1n());
}
function circle_0(_this__u8e3s4, point, radius) {
return circle(_this__u8e3s4, point.d1n(), point.e1n(), radius);
}
function line_0(_this__u8e3s4, x0, y0, x1, y1) {
var tmp$ret$0;
// Inline function 'kotlin.also' call
_this__u8e3s4.r7e(x0, y0);
var tmp0_also = Unit_getInstance();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.vector.line.<anonymous>' call
_this__u8e3s4.u7e(x1, y1);
tmp$ret$0 = tmp0_also;
return tmp$ret$0;
}
function arcTo(_this__u8e3s4, ax, ay, cx, cy, r) {
Arc_getInstance().q7e(_this__u8e3s4, ax, ay, cx, cy, r);
}
function transformed_0(_this__u8e3s4, m) {
var im = m.z76(null, 1, null);
var parent = _this__u8e3s4;
return new transformed$1(parent, im, m);
}
function arc(_this__u8e3s4, x, y, r, start, end, counterclockwise) {
Arc_getInstance().w7e(_this__u8e3s4, x, y, r, start, end, counterclockwise);
}
function arc$default(_this__u8e3s4, x, y, r, start, end, counterclockwise, $mask0, $handler) {
if (!(($mask0 & 32) === 0))
counterclockwise = false;
return arc(_this__u8e3s4, x, y, r, start, end, counterclockwise);
}
function transformed$1($parent, $im, $m) {
this.k7s_1 = $parent;
this.l7s_1 = $im;
this.m7s_1 = $m;
this.j7s_1 = $parent.i7s();
}
transformed$1.prototype.s7e = function () {
return this.l7s_1.h77(this.k7s_1.s7e(), this.k7s_1.t7e());
};
transformed$1.prototype.t7e = function () {
return this.l7s_1.i77(this.k7s_1.s7e(), this.k7s_1.t7e());
};
transformed$1.prototype.i7s = function () {
return this.j7s_1;
};
transformed$1.prototype.n7s = function (x, y) {
return this.m7s_1.h77(x, y);
};
transformed$1.prototype.o7s = function (x, y) {
return this.m7s_1.i77(x, y);
};
transformed$1.prototype.x2c = function () {
return this.k7s_1.x2c();
};
transformed$1.prototype.u7e = function (x, y) {
return this.k7s_1.u7e(this.n7s(x, y), this.o7s(x, y));
};
transformed$1.prototype.r7e = function (x, y) {
return this.k7s_1.u7e(this.n7s(x, y), this.o7s(x, y));
};
transformed$1.prototype.v7e = function (cx, cy, ax, ay) {
return this.k7s_1.v7e(this.n7s(cx, cy), this.o7s(cx, cy), this.n7s(ax, ay), this.o7s(ax, ay));
};
transformed$1.prototype.x7e = function (cx1, cy1, cx2, cy2, ax, ay) {
return this.k7s_1.x7e(this.n7s(cx1, cy1), this.o7s(cx1, cy1), this.n7s(cx2, cy2), this.o7s(cx2, cy2), this.n7s(ax, ay), this.o7s(ax, ay));
};
transformed$1.$metadata$ = classMeta(undefined, [VectorBuilder]);
var tempMatrix;
function set__curvesCacheVersion(_this__u8e3s4, _set____db54di) {
init_properties_VectorPath_kt_n2r9aq();
var tmp0_setValue = _curvesCacheVersion$factory();
var tmp0_elvis_lhs = _curvesCacheVersion$delegate.g4v_1;
var tmp = tmp0_elvis_lhs == null ? tmp0_setValue.callableName : tmp0_elvis_lhs;
var tmp$ret$2;
// Inline function 'com.soywiz.kds.fastCastTo' call
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = _set____db54di;
tmp$ret$1 = tmp$ret$0;
tmp$ret$2 = tmp$ret$1;
return setExtra(_this__u8e3s4, tmp, tmp$ret$2);
}
function get__curvesCacheVersion(_this__u8e3s4) {
init_properties_VectorPath_kt_n2r9aq();
var tmp$ret$8;
$l$block: {
// Inline function 'com.soywiz.kds.Property.getValue' call
var tmp0_getValue = _curvesCacheVersion$factory_0();
var tmp$ret$4;
// Inline function 'com.soywiz.kds.fastCastTo' call
var tmp1_safe_receiver = _this__u8e3s4.f4v();
var tmp;
if (tmp1_safe_receiver == null) {
tmp = null;
} else {
var tmp$ret$1;
// Inline function 'com.soywiz.kds.get' call
var tmp0_elvis_lhs = _curvesCacheVersion$delegate.g4v_1;
var tmp0_get = tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs;
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp1_safe_receiver;
tmp$ret$1 = tmp$ret$0.get(tmp0_get);
tmp = tmp$ret$1;
}
var tmp1_fastCastTo = tmp;
var tmp$ret$3;
// Inline function 'kotlin.js.unsafeCast' call
var tmp$ret$2;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$2 = tmp1_fastCastTo;
tmp$ret$3 = tmp$ret$2;
tmp$ret$4 = tmp$ret$3;
var res = tmp$ret$4;
if (res == null) {
var r = _curvesCacheVersion$delegate.h4v_1();
var tmp_0;
if (!(r == null)) {
tmp_0 = true;
} else {
var tmp2_elvis_lhs = _curvesCacheVersion$delegate.g4v_1;
tmp_0 = hasExtra(_this__u8e3s4, tmp2_elvis_lhs == null ? tmp0_getValue.callableName : tmp2_elvis_lhs);
}
if (tmp_0) {
// Inline function 'com.soywiz.kds.Property.setValue' call
var tmp0_elvis_lhs_0 = _curvesCacheVersion$delegate.g4v_1;
var tmp_1 = tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0;
var tmp$ret$7;
// Inline function 'com.soywiz.kds.fastCastTo' call
var tmp$ret$6;
// Inline function 'kotlin.js.unsafeCast' call
var tmp$ret$5;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$5 = r;
tmp$ret$6 = tmp$ret$5;
tmp$ret$7 = tmp$ret$6;
setExtra(_this__u8e3s4, tmp_1, tmp$ret$7);
}
tmp$ret$8 = r;
break $l$block;
}
tmp$ret$8 = res;
}
return tmp$ret$8;
}
var _curvesCacheVersion$delegate;
function set__curvesCache(_this__u8e3s4, _set____db54di) {
init_properties_VectorPath_kt_n2r9aq();
var tmp0_setValue = _curvesCache$factory();
var tmp0_elvis_lhs = _curvesCache$delegate.g4v_1;
var tmp = tmp0_elvis_lhs == null ? tmp0_setValue.callableName : tmp0_elvis_lhs;
var tmp$ret$2;
// Inline function 'com.soywiz.kds.fastCastTo' call
var tmp$ret$1;
// Inline function 'kotlin.js.unsafeCast' call
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = _set____db54di;
tmp$ret$1 = tmp$ret$0;
tmp$ret$2 = tmp$ret$1;
return setExtra(_this__u8e3s4, tmp, tmp$ret$2);
}
function get__curvesCache(_this__u8e3s4) {
init_properties_VectorPath_kt_n2r9aq();
var tmp$ret$8;
$l$block: {
// Inline function 'com.soywiz.kds.Property.getValue' call
var tmp0_getValue = _curvesCache$factory_0();
var tmp$ret$4;
// Inline function 'com.soywiz.kds.fastCastTo' call
var tmp1_safe_receiver = _this__u8e3s4.f4v();
var tmp;
if (tmp1_safe_receiver == null) {
tmp = null;
} else {
var tmp$ret$1;
// Inline function 'com.soywiz.kds.get' call
var tmp0_elvis_lhs = _curvesCache$delegate.g4v_1;
var tmp0_get = tmp0_elvis_lhs == null ? tmp0_getValue.callableName : tmp0_elvis_lhs;
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp1_safe_receiver;
tmp$ret$1 = tmp$ret$0.get(tmp0_get);
tmp = tmp$ret$1;
}
var tmp1_fastCastTo = tmp;
var tmp$ret$3;
// Inline function 'kotlin.js.unsafeCast' call
var tmp$ret$2;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$2 = tmp1_fastCastTo;
tmp$ret$3 = tmp$ret$2;
tmp$ret$4 = tmp$ret$3;
var res = tmp$ret$4;
if (res == null) {
var r = _curvesCache$delegate.h4v_1();
var tmp_0;
if (!(r == null)) {
tmp_0 = true;
} else {
var tmp2_elvis_lhs = _curvesCache$delegate.g4v_1;
tmp_0 = hasExtra(_this__u8e3s4, tmp2_elvis_lhs == null ? tmp0_getValue.callableName : tmp2_elvis_lhs);
}
if (tmp_0) {
// Inline function 'com.soywiz.kds.Property.setValue' call
var tmp0_elvis_lhs_0 = _curvesCache$delegate.g4v_1;
var tmp_1 = tmp0_elvis_lhs_0 == null ? tmp0_getValue.callableName : tmp0_elvis_lhs_0;
var tmp$ret$7;
// Inline function 'com.soywiz.kds.fastCastTo' call
var tmp$ret$6;
// Inline function 'kotlin.js.unsafeCast' call
var tmp$ret$5;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$5 = r;
tmp$ret$6 = tmp$ret$5;
tmp$ret$7 = tmp$ret$6;
setExtra(_this__u8e3s4, tmp_1, tmp$ret$7);
}
tmp$ret$8 = r;
break $l$block;
}
tmp$ret$8 = res;
}
return tmp$ret$8;
}
var _curvesCache$delegate;
function VectorPath_init_$Init$(commands, data, winding, optimize, $mask0, $marker, $this) {
if (!(($mask0 & 1) === 0)) {
commands = IntArrayList_init_$Create$(0, 1, null);
}
if (!(($mask0 & 2) === 0)) {
data = DoubleArrayList_init_$Create$(0, 1, null);
}
if (!(($mask0 & 4) === 0))
winding = Companion_getInstance_31().p7s();
if (!(($mask0 & 8) === 0))
optimize = true;
VectorPath.call($this, commands, data, winding, optimize);
return $this;
}
function VectorPath_init_$Create$(commands, data, winding, optimize, $mask0, $marker) {
return VectorPath_init_$Init$(commands, data, winding, optimize, $mask0, $marker, Object.create(VectorPath.prototype));
}
function Companion_30() {
Companion_instance_30 = this;
var tmp = this;
tmp.q7s_1 = Matrix_init_$Create$(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 63, null);
}
Companion_30.$metadata$ = objectMeta('Companion');
var Companion_instance_30;
function Companion_getInstance_30() {
if (Companion_instance_30 == null)
new Companion_30();
return Companion_instance_30;
}
function Visitor() {
}
Visitor.$metadata$ = interfaceMeta('Visitor');
function ensureMoveTo($this, x, y) {
if (isNotEmpty($this))
return false;
$this.r7e(x, y);
return true;
}
function Command() {
Command_instance = this;
this.r7s_1 = 0;
this.s7s_1 = 1;
this.t7s_1 = 2;
this.u7s_1 = 3;
this.v7s_1 = 4;
}
Command.prototype.w7s = function () {
return this.r7s_1;
};
Command.prototype.x7s = function () {
return this.s7s_1;
};
Command.prototype.y7s = function () {
return this.t7s_1;
};
Command.prototype.z7s = function () {
return this.u7s_1;
};
Command.prototype.a7t = function () {
return this.v7s_1;
};
Command.$metadata$ = objectMeta('Command');
var Command_instance;
function Command_getInstance() {
if (Command_instance == null)
new Command();
return Command_instance;
}
function VectorPath(commands, data, winding, optimize) {
Companion_getInstance_30();
this.f7j_1 = commands;
this.g7j_1 = data;
this.h7j_1 = winding;
this.i7j_1 = optimize;
var tmp = this;
tmp.j7j_1 = Mixin_init_$Create$(null, 1, null);
this.k7j_1 = false;
this.l7j_1 = 0;
this.m7j_1 = 0.0;
this.n7j_1 = 0.0;
this.o7j_1 = null;
this.p7j_1 = null;
this.q7j_1 = Companion_getInstance_8().zp();
}
VectorPath.prototype.b7t = function () {
return this.f7j_1;
};
VectorPath.prototype.s3l = function () {
return this.g7j_1;
};
VectorPath.prototype.c7t = function (_set____db54di) {
this.h7j_1 = _set____db54di;
};
VectorPath.prototype.j7q = function () {
return this.h7j_1;
};
VectorPath.prototype.d7t = function (_set____db54di) {
this.i7j_1 = _set____db54di;
};
VectorPath.prototype.e4v = function (_set____db54di) {
this.j7j_1.e4v(_set____db54di);
};
VectorPath.prototype.f4v = function () {
return this.j7j_1.f4v();
};
VectorPath.prototype.z7i = function (_set____db54di) {
this.k7j_1 = _set____db54di;
};
VectorPath.prototype.e7t = function () {
return this.k7j_1;
};
VectorPath.prototype.z4n = function () {
var tmp = IntArrayList_init_$Create$_0(this.f7j_1);
var tmp_0 = DoubleArrayList_init_$Create$_0(this.g7j_1);
var tmp_1 = this.h7j_1;
return VectorPath_init_$Create$(tmp, tmp_0, tmp_1, false, 8, null);
};
VectorPath.prototype.equals = function (other) {
if (this === other)
return true;
var tmp;
var tmp_0;
var tmp_1;
if (other instanceof VectorPath) {
tmp_1 = this.f7j_1.equals(other.f7j_1);
} else {
tmp_1 = false;
}
if (tmp_1) {
tmp_0 = this.g7j_1.equals(other.g7j_1);
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp = this.h7j_1.equals(other.h7j_1);
} else {
tmp = false;
}
return tmp;
};
VectorPath.prototype.hashCode = function () {
return (this.f7j_1.hashCode() + imul(this.g7j_1.hashCode(), 13) | 0) + imul(this.h7j_1.q2_1, 111) | 0;
};
VectorPath.prototype.f7t = function (moveTo, lineTo, quadTo, cubicTo, close) {
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = this.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp = this.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
moveTo(tmp, this.g7j_1.m(tmp2));
} else {
Command_getInstance();
if (tmp0_subject === 1) {
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp_0 = this.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
lineTo(tmp_0, this.g7j_1.m(tmp4));
} else {
Command_getInstance();
if (tmp0_subject === 2) {
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp_1 = this.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp_2 = this.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp_3 = this.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
quadTo(tmp_1, tmp_2, tmp_3, this.g7j_1.m(tmp8));
} else {
Command_getInstance();
if (tmp0_subject === 3) {
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp_4 = this.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp_5 = this.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp_6 = this.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp_7 = this.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp_8 = this.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
cubicTo(tmp_4, tmp_5, tmp_6, tmp_7, tmp_8, this.g7j_1.m(tmp14));
} else {
Command_getInstance();
if (tmp0_subject === 4)
close();
}
}
}
}
}
};
VectorPath.prototype.g7t = function (line, quad, cubic, close, move, dummy, optimizeClose) {
var mx = 0.0;
var my = 0.0;
var lx = 0.0;
var ly = 0.0;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = this.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp0__anonymous__q1qw7t = this.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp1__anonymous__uwfjfc_0 = this.g7j_1.m(tmp2);
mx = tmp0__anonymous__q1qw7t;
my = tmp1__anonymous__uwfjfc_0;
lx = tmp0__anonymous__q1qw7t;
ly = tmp1__anonymous__uwfjfc_0;
move(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc_0);
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp2__anonymous__z9zvc9 = this.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp3__anonymous__ufb84q = this.g7j_1.m(tmp4);
line(lx, ly, tmp2__anonymous__z9zvc9, tmp3__anonymous__ufb84q);
lx = tmp2__anonymous__z9zvc9;
ly = tmp3__anonymous__ufb84q;
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp4__anonymous__pkmkx7 = this.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp5__anonymous__kpxxpo = this.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp6__anonymous__fv9ai5 = this.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp7__anonymous__b0knam = this.g7j_1.m(tmp8);
quad(lx, ly, tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam);
lx = tmp6__anonymous__fv9ai5;
ly = tmp7__anonymous__b0knam;
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp8__anonymous__65w033 = this.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp9__anonymous__1b7cvk = this.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp10__anonymous__yfiz50 = this.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp11__anonymous__tkubxh = this.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp12__anonymous__oq5opy = this.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp13__anonymous__jvh1if = this.g7j_1.m(tmp14);
cubic(lx, ly, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if);
lx = tmp12__anonymous__oq5opy;
ly = tmp13__anonymous__jvh1if;
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp;
if (optimizeClose) {
var tmp_0;
var tmp_1 = lx;
var tmp_2 = mx;
if (isAlmostEquals$default(tmp_1, tmp_2, 0.0, 2, null)) {
var tmp_3 = ly;
var tmp_4 = my;
tmp_0 = isAlmostEquals$default(tmp_3, tmp_4, 0.0, 2, null);
} else {
tmp_0 = false;
}
tmp = tmp_0;
} else {
tmp = lx === mx ? ly === my : false;
}
var equal = tmp;
if (!equal) {
line(lx, ly, mx, my);
}
close();
}
}
}
}
}
}
};
VectorPath.prototype.h7t = function (visitor) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = this.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp = this.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
visitor.r7e(tmp, this.g7j_1.m(tmp2));
} else {
Command_getInstance();
if (tmp0_subject === 1) {
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp_0 = this.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
visitor.u7e(tmp_0, this.g7j_1.m(tmp4));
} else {
Command_getInstance();
if (tmp0_subject === 2) {
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp_1 = this.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp_2 = this.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp_3 = this.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
visitor.v7e(tmp_1, tmp_2, tmp_3, this.g7j_1.m(tmp8));
} else {
Command_getInstance();
if (tmp0_subject === 3) {
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp_4 = this.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp_5 = this.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp_6 = this.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp_7 = this.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp_8 = this.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
visitor.x7e(tmp_4, tmp_5, tmp_6, tmp_7, tmp_8, this.g7j_1.m(tmp14));
} else {
Command_getInstance();
if (tmp0_subject === 4) {
visitor.x2c();
}
}
}
}
}
}
};
VectorPath.prototype.x7 = function () {
this.f7j_1.x7();
this.g7j_1.x7();
this.i7t(0.0, 0.0);
this.l7j_1 = 0;
this.j7t().l7p_1 = this.l7j_1 - 1 | 0;
};
VectorPath.prototype.s7e = function () {
return this.m7j_1;
};
VectorPath.prototype.t7e = function () {
return this.n7j_1;
};
VectorPath.prototype.i7t = function (x, y) {
this.m7j_1 = x;
this.n7j_1 = y;
};
VectorPath.prototype.r7e = function (x, y) {
var tmp;
if (this.f7j_1.t4o()) {
var tmp_0 = this.f7j_1.v4o();
Command_getInstance();
tmp = tmp_0 === 0;
} else {
tmp = false;
}
if (tmp) {
if (this.m7j_1 === x ? this.n7j_1 === y : false)
return Unit_getInstance();
}
Command_getInstance();
this.f7j_1.m4o(0);
this.g7j_1.n4n(x, y);
this.i7t(x, y);
var tmp0_this = this;
var tmp1 = tmp0_this.l7j_1;
tmp0_this.l7j_1 = tmp1 + 1 | 0;
};
VectorPath.prototype.u7e = function (x, y) {
if (ensureMoveTo(this, x, y) ? this.i7j_1 : false)
return Unit_getInstance();
if ((x === this.m7j_1 ? y === this.n7j_1 : false) ? this.i7j_1 : false)
return Unit_getInstance();
Command_getInstance();
this.f7j_1.m4o(1);
this.g7j_1.n4n(x, y);
this.i7t(x, y);
var tmp0_this = this;
var tmp1 = tmp0_this.l7j_1;
tmp0_this.l7j_1 = tmp1 + 1 | 0;
};
VectorPath.prototype.v7e = function (cx, cy, ax, ay) {
ensureMoveTo(this, cx, cy);
Command_getInstance();
this.f7j_1.m4o(2);
this.g7j_1.o4n(cx, cy, ax, ay);
this.i7t(ax, ay);
var tmp0_this = this;
var tmp1 = tmp0_this.l7j_1;
tmp0_this.l7j_1 = tmp1 + 1 | 0;
};
VectorPath.prototype.x7e = function (cx1, cy1, cx2, cy2, ax, ay) {
ensureMoveTo(this, cx1, cy1);
Command_getInstance();
this.f7j_1.m4o(3);
this.g7j_1.p4n(cx1, cy1, cx2, cy2, ax, ay);
this.i7t(ax, ay);
var tmp0_this = this;
var tmp1 = tmp0_this.l7j_1;
tmp0_this.l7j_1 = tmp1 + 1 | 0;
};
VectorPath.prototype.x2c = function () {
Command_getInstance();
this.f7j_1.m4o(4);
var tmp0_this = this;
var tmp1 = tmp0_this.l7j_1;
tmp0_this.l7j_1 = tmp1 + 1 | 0;
};
VectorPath.prototype.i7s = function () {
return this.g7j_1.i() / 2 | 0;
};
VectorPath.prototype.k7t = function (x, y) {
return this.l7t().s7t(x, y, this.h7j_1);
};
VectorPath.prototype.l7t = function () {
if (this.o7j_1 == null ? true : !(ensureNotNull(this.o7j_1).m7t_1 === this.l7j_1)) {
var tmp = this;
var tmp_0 = this.l7j_1;
tmp.o7j_1 = VectorPathTrapezoids_init_$Create$(tmp_0, this, 0, 4, null);
}
return ensureNotNull(this.o7j_1);
};
VectorPath.prototype.j7t = function () {
if (this.p7j_1 == null)
this.p7j_1 = new PolygonScanline();
var scanline = ensureNotNull(this.p7j_1);
if (!(scanline.l7p_1 === this.l7j_1)) {
scanline.d2p();
scanline.l7q(this);
scanline.l7p_1 = this.l7j_1;
}
return ensureNotNull(this.p7j_1);
};
VectorPath.prototype.t7t = function (path, transform) {
var tmp0_this = this;
tmp0_this.f7j_1.p4o(path.f7j_1);
if (transform.u76()) {
var tmp1_this = this;
tmp1_this.g7j_1.r4n(path.g7j_1);
this.i7t(path.m7j_1, path.n7j_1);
} else {
var progression = step(until(0, path.g7j_1.i()), 2);
var inductionVariable = progression.r1_1;
var last = progression.s1_1;
var step_0 = progression.t1_1;
if ((step_0 > 0 ? inductionVariable <= last : false) ? true : step_0 < 0 ? last <= inductionVariable : false)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + step_0 | 0;
var x = path.g7j_1.m(n + 0 | 0);
var y = path.g7j_1.m(n + 1 | 0);
var tmp3_this = this;
tmp3_this.g7j_1.q4n(transform.h77(x, y));
var tmp4_this = this;
tmp4_this.g7j_1.q4n(transform.i77(x, y));
}
while (!(n === last));
this.i7t(transform.h77(path.m7j_1, path.n7j_1), transform.i77(path.m7j_1, path.n7j_1));
}
var tmp5_this = this;
var tmp6 = tmp5_this.l7j_1;
tmp5_this.l7j_1 = tmp6 + 1 | 0;
};
VectorPath.prototype.u7t = function (path, transform, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
transform = Companion_getInstance_30().q7s_1;
return this.t7t(path, transform);
};
VectorPath.prototype.v7t = function () {
var tmp$ret$2;
// Inline function 'kotlin.text.trimEnd' call
var tmp$ret$1;
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'kotlin.apply' call
var tmp0_apply = StringBuilder_init_$Create$();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.toSvgString.<anonymous>' call
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = this.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.toSvgString.<anonymous>.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp0__anonymous__q1qw7t = this.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp1__anonymous__uwfjfc_0 = this.g7j_1.m(tmp2);
tmp0_apply.gc('M' + get_niceStr(tmp0__anonymous__q1qw7t) + ',' + get_niceStr(tmp1__anonymous__uwfjfc_0) + ' ');
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.toSvgString.<anonymous>.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp2__anonymous__z9zvc9 = this.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp3__anonymous__ufb84q = this.g7j_1.m(tmp4);
tmp0_apply.gc('L' + get_niceStr(tmp2__anonymous__z9zvc9) + ',' + get_niceStr(tmp3__anonymous__ufb84q) + ' ');
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.toSvgString.<anonymous>.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp4__anonymous__pkmkx7 = this.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp5__anonymous__kpxxpo = this.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp6__anonymous__fv9ai5 = this.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp7__anonymous__b0knam = this.g7j_1.m(tmp8);
tmp0_apply.gc('Q' + get_niceStr(tmp4__anonymous__pkmkx7) + ',' + get_niceStr(tmp5__anonymous__kpxxpo) + ',' + get_niceStr(tmp6__anonymous__fv9ai5) + ',' + get_niceStr(tmp7__anonymous__b0knam) + ' ');
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.toSvgString.<anonymous>.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp8__anonymous__65w033 = this.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp9__anonymous__1b7cvk = this.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp10__anonymous__yfiz50 = this.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp11__anonymous__tkubxh = this.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp12__anonymous__oq5opy = this.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp13__anonymous__jvh1if = this.g7j_1.m(tmp14);
tmp0_apply.gc('C' + get_niceStr(tmp8__anonymous__65w033) + ',' + get_niceStr(tmp9__anonymous__1b7cvk) + ',' + get_niceStr(tmp10__anonymous__yfiz50) + ',' + get_niceStr(tmp11__anonymous__tkubxh) + ',' + get_niceStr(tmp12__anonymous__oq5opy) + ',' + get_niceStr(tmp13__anonymous__jvh1if) + ' ');
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.toSvgString.<anonymous>.<anonymous>' call
tmp0_apply.gc('Z ');
}
}
}
}
}
}
tmp$ret$0 = tmp0_apply;
tmp$ret$1 = tmp$ret$0.toString();
var tmp0_trimEnd = tmp$ret$1;
tmp$ret$2 = toString(trimEnd(isCharSequence(tmp0_trimEnd) ? tmp0_trimEnd : THROW_CCE()));
return tmp$ret$2;
};
VectorPath.prototype.toString = function () {
return 'VectorPath(' + this.v7t() + ')';
};
VectorPath.prototype.w7t = function (transform) {
var point = this.q7j_1;
var progression = step(until(0, this.g7j_1.i()), 2);
var inductionVariable = progression.r1_1;
var last = progression.s1_1;
var step_0 = progression.t1_1;
if ((step_0 > 0 ? inductionVariable <= last : false) ? true : step_0 < 0 ? last <= inductionVariable : false)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + step_0 | 0;
point.a73(this.g7j_1.m(n + 0 | 0), this.g7j_1.m(n + 1 | 0));
var p = transform(point);
this.g7j_1.u4n(n + 0 | 0, p.d1n());
this.g7j_1.u4n(n + 1 | 0, p.e1n());
}
while (!(n === last));
var tmp1_this = this;
var tmp2 = tmp1_this.l7j_1;
tmp1_this.l7j_1 = tmp2 + 1 | 0;
return this;
};
VectorPath.prototype.h76 = function (sx, sy) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.transformPoints' call
var point = this.q7j_1;
var progression = step(until(0, this.g7j_1.i()), 2);
var inductionVariable = progression.r1_1;
var last = progression.s1_1;
var step_0 = progression.t1_1;
if ((step_0 > 0 ? inductionVariable <= last : false) ? true : step_0 < 0 ? last <= inductionVariable : false)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + step_0 | 0;
point.a73(this.g7j_1.m(n + 0 | 0), this.g7j_1.m(n + 1 | 0));
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.scale.<anonymous>' call
tmp$ret$0 = point.a73(point.y72_1 * sx, point.z72_1 * sy);
var p = tmp$ret$0;
this.g7j_1.u4n(n + 0 | 0, p.d1n());
this.g7j_1.u4n(n + 1 | 0, p.e1n());
}
while (!(n === last));
var tmp1_this = this;
var tmp2 = tmp1_this.l7j_1;
tmp1_this.l7j_1 = tmp2 + 1 | 0;
tmp$ret$1 = this;
return tmp$ret$1;
};
VectorPath.$metadata$ = classMeta('VectorPath', [IVectorPath, Extra]);
function getCurvesList(_this__u8e3s4) {
init_properties_VectorPath_kt_n2r9aq();
if (!(get__curvesCacheVersion(_this__u8e3s4) === _this__u8e3s4.l7j_1)) {
set__curvesCacheVersion(_this__u8e3s4, _this__u8e3s4.l7j_1);
var tmp$ret$2;
// Inline function 'kotlin.also' call
var tmp$ret$0;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$0 = ArrayList_init_$Create$();
var tmp0_also = tmp$ret$0;
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>' call
var currentClosed = {_v: false};
var tmp$ret$1;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$1 = ArrayList_init_$Create$();
var current = {_v: tmp$ret$1};
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges' call
var mx = 0.0;
var my = 0.0;
var lx = 0.0;
var ly = 0.0;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds' call
var n = 0;
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = _this__u8e3s4.f7j_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitCmds.<anonymous>' call
var tmp0 = n_0;
n_0 = tmp0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.t4n(tmp0);
var tmp0_subject = tmp1__anonymous__uwfjfc;
Command_getInstance();
if (tmp0_subject === 0) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp1 = n;
n = tmp1 + 1 | 0;
var tmp0__anonymous__q1qw7t = _this__u8e3s4.g7j_1.m(tmp1);
var tmp2 = n;
n = tmp2 + 1 | 0;
var tmp1__anonymous__uwfjfc_0 = _this__u8e3s4.g7j_1.m(tmp2);
mx = tmp0__anonymous__q1qw7t;
my = tmp1__anonymous__uwfjfc_0;
lx = tmp0__anonymous__q1qw7t;
ly = tmp1__anonymous__uwfjfc_0;
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>.<anonymous>' call
getCurvesList$flush(current, tmp0_also, currentClosed, _this__u8e3s4);
} else {
Command_getInstance();
if (tmp0_subject === 1) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp3 = n;
n = tmp3 + 1 | 0;
var tmp2__anonymous__z9zvc9 = _this__u8e3s4.g7j_1.m(tmp3);
var tmp4 = n;
n = tmp4 + 1 | 0;
var tmp3__anonymous__ufb84q = _this__u8e3s4.g7j_1.m(tmp4);
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t_0 = lx;
var tmp1__anonymous__uwfjfc_1 = ly;
// Inline function 'kotlin.collections.plusAssign' call
var tmp0_plusAssign = current._v;
var tmp1_plusAssign = Bezier_init_$Create$_0(new Float64Array([tmp0__anonymous__q1qw7t_0, tmp1__anonymous__uwfjfc_1, tmp2__anonymous__z9zvc9, tmp3__anonymous__ufb84q]));
tmp0_plusAssign.c(tmp1_plusAssign);
lx = tmp2__anonymous__z9zvc9;
ly = tmp3__anonymous__ufb84q;
} else {
Command_getInstance();
if (tmp0_subject === 2) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp5 = n;
n = tmp5 + 1 | 0;
var tmp4__anonymous__pkmkx7 = _this__u8e3s4.g7j_1.m(tmp5);
var tmp6 = n;
n = tmp6 + 1 | 0;
var tmp5__anonymous__kpxxpo = _this__u8e3s4.g7j_1.m(tmp6);
var tmp7 = n;
n = tmp7 + 1 | 0;
var tmp6__anonymous__fv9ai5 = _this__u8e3s4.g7j_1.m(tmp7);
var tmp8 = n;
n = tmp8 + 1 | 0;
var tmp7__anonymous__b0knam = _this__u8e3s4.g7j_1.m(tmp8);
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>.<anonymous>' call
var tmp2__anonymous__z9zvc9_0 = lx;
var tmp3__anonymous__ufb84q_0 = ly;
// Inline function 'kotlin.collections.plusAssign' call
var tmp0_plusAssign_0 = current._v;
var tmp1_plusAssign_0 = Bezier_init_$Create$_0(new Float64Array([tmp2__anonymous__z9zvc9_0, tmp3__anonymous__ufb84q_0, tmp4__anonymous__pkmkx7, tmp5__anonymous__kpxxpo, tmp6__anonymous__fv9ai5, tmp7__anonymous__b0knam]));
tmp0_plusAssign_0.c(tmp1_plusAssign_0);
lx = tmp6__anonymous__fv9ai5;
ly = tmp7__anonymous__b0knam;
} else {
Command_getInstance();
if (tmp0_subject === 3) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp9 = n;
n = tmp9 + 1 | 0;
var tmp8__anonymous__65w033 = _this__u8e3s4.g7j_1.m(tmp9);
var tmp10 = n;
n = tmp10 + 1 | 0;
var tmp9__anonymous__1b7cvk = _this__u8e3s4.g7j_1.m(tmp10);
var tmp11 = n;
n = tmp11 + 1 | 0;
var tmp10__anonymous__yfiz50 = _this__u8e3s4.g7j_1.m(tmp11);
var tmp12 = n;
n = tmp12 + 1 | 0;
var tmp11__anonymous__tkubxh = _this__u8e3s4.g7j_1.m(tmp12);
var tmp13 = n;
n = tmp13 + 1 | 0;
var tmp12__anonymous__oq5opy = _this__u8e3s4.g7j_1.m(tmp13);
var tmp14 = n;
n = tmp14 + 1 | 0;
var tmp13__anonymous__jvh1if = _this__u8e3s4.g7j_1.m(tmp14);
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>.<anonymous>' call
var tmp4__anonymous__pkmkx7_0 = lx;
var tmp5__anonymous__kpxxpo_0 = ly;
// Inline function 'kotlin.collections.plusAssign' call
var tmp0_plusAssign_1 = current._v;
var tmp1_plusAssign_1 = Bezier_init_$Create$_0(new Float64Array([tmp4__anonymous__pkmkx7_0, tmp5__anonymous__kpxxpo_0, tmp8__anonymous__65w033, tmp9__anonymous__1b7cvk, tmp10__anonymous__yfiz50, tmp11__anonymous__tkubxh, tmp12__anonymous__oq5opy, tmp13__anonymous__jvh1if]));
tmp0_plusAssign_1.c(tmp1_plusAssign_1);
lx = tmp12__anonymous__oq5opy;
ly = tmp13__anonymous__jvh1if;
} else {
Command_getInstance();
if (tmp0_subject === 4) {
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.visitEdges.<anonymous>' call
var tmp;
{
var tmp_0;
var tmp_1 = lx;
var tmp_2 = mx;
if (isAlmostEquals$default(tmp_1, tmp_2, 0.0, 2, null)) {
var tmp_3 = ly;
var tmp_4 = my;
tmp_0 = isAlmostEquals$default(tmp_3, tmp_4, 0.0, 2, null);
} else {
tmp_0 = false;
}
tmp = tmp_0;
}
var equal = tmp;
if (!equal) {
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>.<anonymous>' call
var tmp6__anonymous__fv9ai5_0 = lx;
var tmp7__anonymous__b0knam_0 = ly;
var tmp8__anonymous__65w033_0 = mx;
var tmp9__anonymous__1b7cvk_0 = my;
// Inline function 'kotlin.collections.plusAssign' call
var tmp0_plusAssign_2 = current._v;
var tmp1_plusAssign_2 = Bezier_init_$Create$_0(new Float64Array([tmp6__anonymous__fv9ai5_0, tmp7__anonymous__b0knam_0, tmp8__anonymous__65w033_0, tmp9__anonymous__1b7cvk_0]));
tmp0_plusAssign_2.c(tmp1_plusAssign_2);
}
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>.<anonymous>' call
currentClosed._v = true;
getCurvesList$flush(current, tmp0_also, currentClosed, _this__u8e3s4);
}
}
}
}
}
}
getCurvesList$flush(current, tmp0_also, currentClosed, _this__u8e3s4);
tmp$ret$2 = tmp0_also;
set__curvesCache(_this__u8e3s4, tmp$ret$2);
}
return ensureNotNull(get__curvesCache(_this__u8e3s4));
}
function IVectorPath() {
}
IVectorPath.$metadata$ = interfaceMeta('IVectorPath', [VectorBuilder]);
function add(_this__u8e3s4, path, transform) {
init_properties_VectorPath_kt_n2r9aq();
var curvesList = getCurvesList(path);
if (curvesList.p() ? isNotEmpty(path) : false) {
path.h7t(new add$1(_this__u8e3s4));
}
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var n = 0;
while (n < curvesList.i()) {
// Inline function 'com.soywiz.korma.geom.vector.add.<anonymous>' call
var tmp0 = n;
n = tmp0 + 1 | 0;
var tmp0__anonymous__q1qw7t = curvesList.m(tmp0);
// Inline function 'com.soywiz.kds.iterators.fastForEach' call
var tmp0_fastForEach = tmp0__anonymous__q1qw7t.p7i_1;
var n_0 = 0;
while (n_0 < tmp0_fastForEach.i()) {
// Inline function 'com.soywiz.korma.geom.vector.add.<anonymous>.<anonymous>' call
var tmp0_0 = n_0;
n_0 = tmp0_0 + 1 | 0;
var tmp1__anonymous__uwfjfc = tmp0_fastForEach.m(tmp0_0);
_this__u8e3s4.t71(tmp1__anonymous__uwfjfc.p7g(_this__u8e3s4.z70_1, transform));
}
}
}
function add$default(_this__u8e3s4, path, transform, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
transform = null;
return add(_this__u8e3s4, path, transform);
}
function VectorPathTrapezoids_init_$Init$(version, path, scale, $mask0, $marker, $this) {
if (!(($mask0 & 4) === 0))
scale = 100;
VectorPathTrapezoids.call($this, version, path, scale);
return $this;
}
function VectorPathTrapezoids_init_$Create$(version, path, scale, $mask0, $marker) {
return VectorPathTrapezoids_init_$Init$(version, path, scale, $mask0, $marker, Object.create(VectorPathTrapezoids.prototype));
}
function VectorPathTrapezoids$trapezoidsEvenOdd$delegate$lambda(this$0) {
return function () {
var tmp = SegmentIntToTrapezoidIntList_getInstance();
var tmp_0 = Winding_EVEN_ODD_getInstance();
return tmp.m7n(this$0.p7t_1, tmp_0, null, 4, null);
};
}
function VectorPathTrapezoids$trapezoidsNonZero$delegate$lambda(this$0) {
return function () {
var tmp = SegmentIntToTrapezoidIntList_getInstance();
var tmp_0 = Winding_NON_ZERO_getInstance();
return tmp.m7n(this$0.p7t_1, tmp_0, null, 4, null);
};
}
function VectorPathTrapezoids(version, path, scale) {
this.m7t_1 = version;
this.n7t_1 = path;
this.o7t_1 = scale;
this.p7t_1 = toSegments(this.n7t_1, this.o7t_1);
var tmp = this;
tmp.q7t_1 = lazy(VectorPathTrapezoids$trapezoidsEvenOdd$delegate$lambda(this));
var tmp_0 = this;
tmp_0.r7t_1 = lazy(VectorPathTrapezoids$trapezoidsNonZero$delegate$lambda(this));
}
VectorPathTrapezoids.prototype.x7t = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = trapezoidsEvenOdd$factory();
tmp$ret$0 = this.q7t_1.l1();
return tmp$ret$0;
};
VectorPathTrapezoids.prototype.y7t = function () {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = trapezoidsNonZero$factory();
tmp$ret$0 = this.r7t_1.l1();
return tmp$ret$0;
};
VectorPathTrapezoids.prototype.z7t = function (winding) {
var tmp0_subject = winding;
var tmp0 = tmp0_subject.q2_1;
var tmp;
switch (tmp0) {
case 0:
tmp = this.x7t();
break;
case 1:
tmp = this.y7t();
break;
default:
noWhenBranchMatchedException();
break;
}
return tmp;
};
VectorPathTrapezoids.prototype.s7t = function (x, y, winding) {
var tmp = this.z7t(winding);
var tmp_0 = toIntRound(x * this.o7t_1);
var tmp_1 = toIntRound(y * this.o7t_1);
return tmp.c7n(tmp_0, tmp_1, false, 4, null);
};
VectorPathTrapezoids.$metadata$ = classMeta('VectorPathTrapezoids');
function toCurvesList(_this__u8e3s4) {
init_properties_VectorPath_kt_n2r9aq();
return getCurvesList(_this__u8e3s4);
}
function applyTransform_0(_this__u8e3s4, m) {
init_properties_VectorPath_kt_n2r9aq();
var tmp;
if (!(m == null)) {
var tmp$ret$1;
// Inline function 'com.soywiz.korma.geom.vector.VectorPath.transformPoints' call
var point = _this__u8e3s4.q7j_1;
var progression = step(until(0, _this__u8e3s4.g7j_1.i()), 2);
var inductionVariable = progression.r1_1;
var last = progression.s1_1;
var step_0 = progression.t1_1;
if ((step_0 > 0 ? inductionVariable <= last : false) ? true : step_0 < 0 ? last <= inductionVariable : false)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + step_0 | 0;
point.a73(_this__u8e3s4.g7j_1.m(n + 0 | 0), _this__u8e3s4.g7j_1.m(n + 1 | 0));
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.vector.applyTransform.<anonymous>' call
tmp$ret$0 = m.f77(point, point);
var p = tmp$ret$0;
_this__u8e3s4.g7j_1.u4n(n + 0 | 0, p.d1n());
_this__u8e3s4.g7j_1.u4n(n + 1 | 0, p.e1n());
}
while (!(n === last));
var tmp1_this = _this__u8e3s4;
var tmp2 = tmp1_this.l7j_1;
tmp1_this.l7j_1 = tmp2 + 1 | 0;
tmp$ret$1 = _this__u8e3s4;
tmp = tmp$ret$1;
} else {
tmp = _this__u8e3s4;
}
return tmp;
}
function getCurves(_this__u8e3s4) {
init_properties_VectorPath_kt_n2r9aq();
var curvesList = getCurvesList(_this__u8e3s4);
var tmp$ret$2;
// Inline function 'kotlin.collections.flatMap' call
var tmp$ret$1;
// Inline function 'kotlin.collections.flatMapTo' call
var tmp0_flatMapTo = ArrayList_init_$Create$();
var tmp0_iterator = curvesList.j();
while (tmp0_iterator.k()) {
var element = tmp0_iterator.l();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.geom.vector.getCurves.<anonymous>' call
tmp$ret$0 = element.p7i_1;
var list = tmp$ret$0;
addAll(tmp0_flatMapTo, list);
}
tmp$ret$1 = tmp0_flatMapTo;
tmp$ret$2 = tmp$ret$1;
var tmp = tmp$ret$2;
var tmp0_safe_receiver = lastOrNull(curvesList);
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.q7i_1;
return toCurves(tmp, tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs);
}
function getCurvesList$flush(current, tmp0_also, currentClosed, $this_getCurvesList) {
if (current._v.p())
return Unit_getInstance();
var tmp$ret$0;
// Inline function 'kotlin.also' call
var tmp0_also_0 = new Curves(current._v, currentClosed._v);
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.geom.vector.getCurvesList.<anonymous>.flush.<anonymous>' call
tmp0_also_0.s7i_1 = $this_getCurvesList.k7j_1;
tmp$ret$0 = tmp0_also_0;
tmp0_also.c(tmp$ret$0);
currentClosed._v = false;
var tmp$ret$1;
// Inline function 'kotlin.collections.arrayListOf' call
tmp$ret$1 = ArrayList_init_$Create$();
current._v = tmp$ret$1;
}
function _curvesCacheVersion$delegate$lambda() {
init_properties_VectorPath_kt_n2r9aq();
return -1;
}
function _curvesCache$delegate$lambda() {
init_properties_VectorPath_kt_n2r9aq();
return null;
}
function add$1($this_add) {
this.a7u_1 = $this_add;
}
add$1.prototype.r7e = function (x, y) {
this.a7u_1.m71(x, y);
};
add$1.$metadata$ = classMeta(undefined, [Visitor]);
function _curvesCacheVersion$factory() {
return getPropertyCallableRef('_curvesCacheVersion', 1, KMutableProperty1, function (receiver) {
return get__curvesCacheVersion(receiver);
}, function (receiver, value) {
return set__curvesCacheVersion(receiver, value);
});
}
function _curvesCacheVersion$factory_0() {
return getPropertyCallableRef('_curvesCacheVersion', 1, KMutableProperty1, function (receiver) {
return get__curvesCacheVersion(receiver);
}, function (receiver, value) {
return set__curvesCacheVersion(receiver, value);
});
}
function _curvesCache$factory() {
return getPropertyCallableRef('_curvesCache', 1, KMutableProperty1, function (receiver) {
return get__curvesCache(receiver);
}, function (receiver, value) {
return set__curvesCache(receiver, value);
});
}
function _curvesCache$factory_0() {
return getPropertyCallableRef('_curvesCache', 1, KMutableProperty1, function (receiver) {
return get__curvesCache(receiver);
}, function (receiver, value) {
return set__curvesCache(receiver, value);
});
}
function trapezoidsEvenOdd$factory() {
return getPropertyCallableRef('trapezoidsEvenOdd', 1, KProperty1, function (receiver) {
return receiver.x7t();
}, null);
}
function trapezoidsNonZero$factory() {
return getPropertyCallableRef('trapezoidsNonZero', 1, KProperty1, function (receiver) {
return receiver.y7t();
}, null);
}
var properties_initialized_VectorPath_kt_o4oo3u;
function init_properties_VectorPath_kt_n2r9aq() {
if (properties_initialized_VectorPath_kt_o4oo3u) {
} else {
properties_initialized_VectorPath_kt_o4oo3u = true;
tempMatrix = Matrix_init_$Create$(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 63, null);
var tmp$ret$0;
// Inline function 'com.soywiz.kds.extraProperty' call
var tmp0_extraProperty = _curvesCacheVersion$delegate$lambda;
tmp$ret$0 = new Property(null, tmp0_extraProperty);
_curvesCacheVersion$delegate = tmp$ret$0;
var tmp$ret$0_0;
// Inline function 'com.soywiz.kds.extraProperty' call
var tmp0_extraProperty_0 = _curvesCache$delegate$lambda;
tmp$ret$0_0 = new Property(null, tmp0_extraProperty_0);
_curvesCache$delegate = tmp$ret$0_0;
}
}
var Winding_EVEN_ODD_instance;
var Winding_NON_ZERO_instance;
function Companion_31() {
Companion_instance_31 = this;
}
Companion_31.prototype.p7s = function () {
return Winding_NON_ZERO_getInstance();
};
Companion_31.$metadata$ = objectMeta('Companion');
var Companion_instance_31;
function Companion_getInstance_31() {
Winding_initEntries();
if (Companion_instance_31 == null)
new Companion_31();
return Companion_instance_31;
}
var Winding_entriesInitialized;
function Winding_initEntries() {
if (Winding_entriesInitialized)
return Unit_getInstance();
Winding_entriesInitialized = true;
Winding_EVEN_ODD_instance = new Winding('EVEN_ODD', 0, 'evenOdd');
Winding_NON_ZERO_instance = new Winding('NON_ZERO', 1, 'nonZero');
Companion_getInstance_31();
}
function Winding(name, ordinal, str) {
Enum.call(this, name, ordinal);
this.d7u_1 = str;
}
Winding.$metadata$ = classMeta('Winding', undefined, undefined, undefined, undefined, Enum.prototype);
function Winding_EVEN_ODD_getInstance() {
Winding_initEntries();
return Winding_EVEN_ODD_instance;
}
function Winding_NON_ZERO_getInstance() {
Winding_initEntries();
return Winding_NON_ZERO_instance;
}
function get_niceStr(_this__u8e3s4) {
var tmp$ret$1;
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'kotlin.apply' call
var tmp0_apply = StringBuilder_init_$Create$();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.internal.<get-niceStr>.<anonymous>' call
appendNice(tmp0_apply, _this__u8e3s4);
tmp$ret$0 = tmp0_apply;
tmp$ret$1 = tmp$ret$0.toString();
return tmp$ret$1;
}
function get_niceStr_0(_this__u8e3s4) {
var tmp$ret$1;
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'kotlin.apply' call
var tmp0_apply = StringBuilder_init_$Create$();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.internal.<get-niceStr>.<anonymous>' call
appendNice_0(tmp0_apply, _this__u8e3s4);
tmp$ret$0 = tmp0_apply;
tmp$ret$1 = tmp$ret$0.toString();
return tmp$ret$1;
}
function appendNice(_this__u8e3s4, value) {
var tmp = round(value);
if (isAlmostEquals$default(tmp, value, 0.0, 2, null))
if (value >= IntCompanionObject_getInstance().n1_1 ? value <= IntCompanionObject_getInstance().o1_1 : false) {
_this__u8e3s4.fc(numberToInt(value));
} else {
_this__u8e3s4.fc(numberToLong(value));
}
else {
_this__u8e3s4.fc(value);
}
}
function appendNice_0(_this__u8e3s4, value) {
var tmp$ret$0;
// Inline function 'kotlin.math.round' call
tmp$ret$0 = round(value);
var tmp = tmp$ret$0;
if (isAlmostEquals$default_0(tmp, value, 0.0, 2, null))
if (value >= IntCompanionObject_getInstance().n1_1 ? value <= IntCompanionObject_getInstance().o1_1 : false) {
_this__u8e3s4.fc(numberToInt(value));
} else {
_this__u8e3s4.fc(numberToLong(value));
}
else {
_this__u8e3s4.fc(value);
}
}
function umod_0(_this__u8e3s4, other) {
var remainder = _this__u8e3s4 % other;
return remainder < 0.0 ? remainder + other : remainder;
}
function floorCeil(v) {
var tmp;
if (v < 0.0) {
var tmp$ret$0;
// Inline function 'kotlin.math.ceil' call
tmp$ret$0 = Math.ceil(v);
tmp = tmp$ret$0;
} else {
var tmp$ret$1;
// Inline function 'kotlin.math.floor' call
tmp$ret$1 = Math.floor(v);
tmp = tmp$ret$1;
}
return tmp;
}
function _get__ALL_LIST__dej8hi($this) {
var tmp$ret$0;
// Inline function 'kotlin.getValue' call
var tmp0_getValue = _ALL_LIST$factory();
tmp$ret$0 = $this.e7u_1.l1();
return tmp$ret$0;
}
function Easing$Companion$_ALL_LIST$delegate$lambda() {
return toList(values());
}
function Easing$Companion$ALL$delegate$lambda() {
var tmp$ret$2;
// Inline function 'kotlin.collections.associateBy' call
var tmp0_associateBy = _get__ALL_LIST__dej8hi(Companion_getInstance_32());
var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(tmp0_associateBy, 10)), 16);
var tmp$ret$1;
// Inline function 'kotlin.collections.associateByTo' call
var tmp0_associateByTo = LinkedHashMap_init_$Create$(capacity);
var tmp0_iterator = tmp0_associateBy.j();
while (tmp0_iterator.k()) {
var element = tmp0_iterator.l();
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.Companion.ALL$delegate.<anonymous>.<anonymous>' call
tmp$ret$0 = element.p2_1;
tmp0_associateByTo.a(tmp$ret$0, element);
}
tmp$ret$1 = tmp0_associateByTo;
tmp$ret$2 = tmp$ret$1;
return tmp$ret$2;
}
function Companion_32() {
Companion_instance_32 = this;
var tmp = this;
var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
tmp.e7u_1 = lazy_0(tmp_0, Easing$Companion$_ALL_LIST$delegate$lambda);
var tmp_1 = this;
var tmp_2 = LazyThreadSafetyMode_PUBLICATION_getInstance();
tmp_1.f7u_1 = lazy_0(tmp_2, Easing$Companion$ALL$delegate$lambda);
}
Companion_32.prototype.g7u = function () {
return Easings_EASE_IN_getInstance();
};
Companion_32.prototype.h7u = function () {
return Easings_EASE_OUT_getInstance();
};
Companion_32.prototype.i7u = function () {
return Easings_EASE_IN_OUT_getInstance();
};
Companion_32.prototype.j7u = function () {
return Easings_EASE_IN_OUT_QUAD_getInstance();
};
Companion_32.$metadata$ = objectMeta('Companion');
var Companion_instance_32;
function Companion_getInstance_32() {
if (Companion_instance_32 == null)
new Companion_32();
return Companion_instance_32;
}
function Easing() {
}
Easing.$metadata$ = interfaceMeta('Easing');
function EasingCubic(x1, y1, x2, y2, name) {
this.l7u_1 = x1;
this.m7u_1 = y1;
this.n7u_1 = x2;
this.o7u_1 = y2;
this.p7u_1 = name;
this.q7u_1 = Bezier_init_$Create$_0(new Float64Array([0.0, 0.0, clamp(this.l7u_1, 0.0, 1.0), this.m7u_1, clamp(this.n7u_1, 0.0, 1.0), this.o7u_1, 1.0, 1.0]));
}
EasingCubic.prototype.toString = function () {
var tmp0_elvis_lhs = this.p7u_1;
return tmp0_elvis_lhs == null ? 'cubic-bezier(' + this.l7u_1 + ', ' + this.m7u_1 + ', ' + this.n7u_1 + ', ' + this.o7u_1 + ')' : tmp0_elvis_lhs;
};
EasingCubic.prototype.k7u = function (it) {
var pivotLeft = it < 0.0 ? it * 10.0 : 0.0;
var pivotRight = it > 1.0 ? it * 10.0 : 1.0;
var pivot = it;
var lastX = 0.0;
var lastY = 0.0;
var steps = 0;
var inductionVariable = 0;
if (inductionVariable < 50)
$l$loop_0: do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var tmp1 = steps;
steps = tmp1 + 1 | 0;
var tmp = pivot;
var res = this.q7u_1.s7g(tmp, null, 2, null);
lastX = res.y72_1;
lastY = res.z72_1;
var tmp$ret$0;
// Inline function 'kotlin.math.absoluteValue' call
var tmp0__get_absoluteValue__nukmtt = lastX - it;
tmp$ret$0 = Math.abs(tmp0__get_absoluteValue__nukmtt);
if (tmp$ret$0 < 0.001)
break $l$loop_0;
if (it < lastX) {
pivotRight = pivot;
pivot = (pivotLeft + pivot) * 0.5;
} else if (it > lastX) {
pivotLeft = pivot;
pivot = (pivotRight + pivot) * 0.5;
} else {
break $l$loop_0;
}
}
while (inductionVariable < 50);
return lastY;
};
EasingCubic.$metadata$ = classMeta('EasingCubic', [Easing]);
function combine(it, start, end) {
return it < 0.5 ? 0.5 * start.k7u(it * 2.0) : 0.5 * end.k7u((it - 0.5) * 2.0) + 0.5;
}
function Easings$SMOOTH() {
Easings.call(this, 'SMOOTH', 0);
Easings_SMOOTH_instance = this;
}
Easings$SMOOTH.prototype.k7u = function (it) {
return it * it * (3 - 2 * it);
};
Easings$SMOOTH.$metadata$ = classMeta('SMOOTH', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_SMOOTH_instance;
function Easings$EASE_IN_ELASTIC() {
Easings.call(this, 'EASE_IN_ELASTIC', 1);
Easings_EASE_IN_ELASTIC_instance = this;
}
Easings$EASE_IN_ELASTIC.prototype.k7u = function (it) {
var tmp;
switch (it) {
case 0.0:
case 1.0:
tmp = it;
break;
default:
var p = 0.3;
var s = p / 4.0;
var inv = it - 1;
var tmp$ret$0;
// Inline function 'kotlin.math.pow' call
var tmp0_pow = 10.0 * inv;
tmp$ret$0 = Math.pow(2.0, tmp0_pow);
var tmp_0 = -1.0 * tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.sin' call
var tmp1_sin = (inv - s) * (2.0 * get_PI()) / p;
tmp$ret$1 = Math.sin(tmp1_sin);
tmp = tmp_0 * tmp$ret$1;
break;
}
return tmp;
};
Easings$EASE_IN_ELASTIC.$metadata$ = classMeta('EASE_IN_ELASTIC', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_ELASTIC_instance;
function Easings$EASE_OUT_ELASTIC() {
Easings.call(this, 'EASE_OUT_ELASTIC', 2);
Easings_EASE_OUT_ELASTIC_instance = this;
}
Easings$EASE_OUT_ELASTIC.prototype.k7u = function (it) {
var tmp;
switch (it) {
case 0.0:
case 1.0:
tmp = it;
break;
default:
var p = 0.3;
var s = p / 4.0;
var tmp$ret$0;
// Inline function 'kotlin.math.pow' call
var tmp0_pow = -10.0 * it;
tmp$ret$0 = Math.pow(2.0, tmp0_pow);
var tmp_0 = tmp$ret$0;
var tmp$ret$1;
// Inline function 'kotlin.math.sin' call
var tmp1_sin = (it - s) * (2.0 * get_PI()) / p;
tmp$ret$1 = Math.sin(tmp1_sin);
tmp = tmp_0 * tmp$ret$1 + 1;
break;
}
return tmp;
};
Easings$EASE_OUT_ELASTIC.$metadata$ = classMeta('EASE_OUT_ELASTIC', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_ELASTIC_instance;
function Easings$EASE_OUT_BOUNCE() {
Easings.call(this, 'EASE_OUT_BOUNCE', 3);
Easings_EASE_OUT_BOUNCE_instance = this;
}
Easings$EASE_OUT_BOUNCE.prototype.k7u = function (it) {
var s = 7.5625;
var p = 2.75;
var tmp;
if (it < 1.0 / p) {
var tmp$ret$0;
// Inline function 'kotlin.math.pow' call
tmp$ret$0 = Math.pow(it, 2.0);
tmp = s * tmp$ret$0;
} else if (it < 2.0 / p) {
var tmp$ret$1;
// Inline function 'kotlin.math.pow' call
var tmp0_pow = it - 1.5 / p;
tmp$ret$1 = Math.pow(tmp0_pow, 2.0);
tmp = s * tmp$ret$1 + 0.75;
} else if (it < 2.5 / p) {
var tmp$ret$2;
// Inline function 'kotlin.math.pow' call
var tmp1_pow = it - 2.25 / p;
tmp$ret$2 = Math.pow(tmp1_pow, 2.0);
tmp = s * tmp$ret$2 + 0.9375;
} else {
var tmp$ret$3;
// Inline function 'kotlin.math.pow' call
var tmp2_pow = it - 2.625 / p;
tmp$ret$3 = Math.pow(tmp2_pow, 2.0);
tmp = s * tmp$ret$3 + 0.984375;
}
return tmp;
};
Easings$EASE_OUT_BOUNCE.$metadata$ = classMeta('EASE_OUT_BOUNCE', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_BOUNCE_instance;
function Easings$LINEAR() {
Easings.call(this, 'LINEAR', 4);
Easings_LINEAR_instance = this;
}
Easings$LINEAR.prototype.k7u = function (it) {
return it;
};
Easings$LINEAR.$metadata$ = classMeta('LINEAR', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_LINEAR_instance;
function Easings$EASE() {
Easings.call(this, 'EASE', 5);
Easings_EASE_instance = this;
this.d7v_1 = new EasingCubic(0.25, 0.1, 0.25, 1.0, 'ease');
}
Easings$EASE.prototype.k7u = function (it) {
return this.d7v_1.k7u(it);
};
Easings$EASE.$metadata$ = classMeta('EASE', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_instance;
function Easings$EASE_IN() {
Easings.call(this, 'EASE_IN', 6);
Easings_EASE_IN_instance = this;
this.g7v_1 = new EasingCubic(0.42, 0.0, 1.0, 1.0, 'ease-in');
}
Easings$EASE_IN.prototype.k7u = function (it) {
return this.g7v_1.k7u(it);
};
Easings$EASE_IN.$metadata$ = classMeta('EASE_IN', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_instance;
function Easings$EASE_OUT() {
Easings.call(this, 'EASE_OUT', 7);
Easings_EASE_OUT_instance = this;
this.j7v_1 = new EasingCubic(0.0, 0.0, 0.58, 1.0, 'ease-out');
}
Easings$EASE_OUT.prototype.k7u = function (it) {
return this.j7v_1.k7u(it);
};
Easings$EASE_OUT.$metadata$ = classMeta('EASE_OUT', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_instance;
function Easings$EASE_IN_OUT() {
Easings.call(this, 'EASE_IN_OUT', 8);
Easings_EASE_IN_OUT_instance = this;
this.m7v_1 = new EasingCubic(0.42, 0.0, 0.58, 1.0, 'ease-in-out');
}
Easings$EASE_IN_OUT.prototype.k7u = function (it) {
return this.m7v_1.k7u(it);
};
Easings$EASE_IN_OUT.$metadata$ = classMeta('EASE_IN_OUT', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_OUT_instance;
function Easings$EASE_IN_OLD() {
Easings.call(this, 'EASE_IN_OLD', 9);
Easings_EASE_IN_OLD_instance = this;
}
Easings$EASE_IN_OLD.prototype.k7u = function (it) {
return it * it * it;
};
Easings$EASE_IN_OLD.$metadata$ = classMeta('EASE_IN_OLD', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_OLD_instance;
function Easings$EASE_OUT_OLD() {
Easings.call(this, 'EASE_OUT_OLD', 10);
Easings_EASE_OUT_OLD_instance = this;
}
Easings$EASE_OUT_OLD.prototype.k7u = function (it) {
var tmp$ret$1;
// Inline function 'kotlin.let' call
var tmp0_let = it - 1.0;
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.EASE_OUT_OLD.invoke.<anonymous>' call
tmp$ret$0 = tmp0_let * tmp0_let * tmp0_let + 1;
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Easings$EASE_OUT_OLD.$metadata$ = classMeta('EASE_OUT_OLD', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_OLD_instance;
function Easings$EASE_IN_OUT_OLD() {
Easings.call(this, 'EASE_IN_OUT_OLD', 11);
Easings_EASE_IN_OUT_OLD_instance = this;
}
Easings$EASE_IN_OUT_OLD.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_IN_OLD_getInstance();
var tmp1_combine = Easings_EASE_OUT_OLD_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_IN_OUT_OLD.$metadata$ = classMeta('EASE_IN_OUT_OLD', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_OUT_OLD_instance;
function Easings$EASE_OUT_IN_OLD() {
Easings.call(this, 'EASE_OUT_IN_OLD', 12);
Easings_EASE_OUT_IN_OLD_instance = this;
}
Easings$EASE_OUT_IN_OLD.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_OUT_OLD_getInstance();
var tmp1_combine = Easings_EASE_IN_OLD_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_OUT_IN_OLD.$metadata$ = classMeta('EASE_OUT_IN_OLD', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_IN_OLD_instance;
function Easings$EASE_IN_BACK() {
Easings.call(this, 'EASE_IN_BACK', 13);
Easings_EASE_IN_BACK_instance = this;
}
Easings$EASE_IN_BACK.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'kotlin.math.pow' call
tmp$ret$0 = Math.pow(it, 2.0);
return tmp$ret$0 * (2.70158 * it - 1.70158);
};
Easings$EASE_IN_BACK.$metadata$ = classMeta('EASE_IN_BACK', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_BACK_instance;
function Easings$EASE_OUT_BACK() {
Easings.call(this, 'EASE_OUT_BACK', 14);
Easings_EASE_OUT_BACK_instance = this;
}
Easings$EASE_OUT_BACK.prototype.k7u = function (it) {
var tmp$ret$2;
// Inline function 'kotlin.let' call
var tmp0_let = it - 1.0;
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$1;
// Inline function 'com.soywiz.korma.interpolation.EASE_OUT_BACK.invoke.<anonymous>' call
var tmp$ret$0;
// Inline function 'kotlin.math.pow' call
tmp$ret$0 = Math.pow(tmp0_let, 2.0);
tmp$ret$1 = tmp$ret$0 * (2.70158 * tmp0_let + 1.70158) + 1.0;
tmp$ret$2 = tmp$ret$1;
return tmp$ret$2;
};
Easings$EASE_OUT_BACK.$metadata$ = classMeta('EASE_OUT_BACK', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_BACK_instance;
function Easings$EASE_IN_OUT_BACK() {
Easings.call(this, 'EASE_IN_OUT_BACK', 15);
Easings_EASE_IN_OUT_BACK_instance = this;
}
Easings$EASE_IN_OUT_BACK.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_IN_BACK_getInstance();
var tmp1_combine = Easings_EASE_OUT_BACK_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_IN_OUT_BACK.$metadata$ = classMeta('EASE_IN_OUT_BACK', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_OUT_BACK_instance;
function Easings$EASE_OUT_IN_BACK() {
Easings.call(this, 'EASE_OUT_IN_BACK', 16);
Easings_EASE_OUT_IN_BACK_instance = this;
}
Easings$EASE_OUT_IN_BACK.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_OUT_BACK_getInstance();
var tmp1_combine = Easings_EASE_IN_BACK_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_OUT_IN_BACK.$metadata$ = classMeta('EASE_OUT_IN_BACK', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_IN_BACK_instance;
function Easings$EASE_IN_OUT_ELASTIC() {
Easings.call(this, 'EASE_IN_OUT_ELASTIC', 17);
Easings_EASE_IN_OUT_ELASTIC_instance = this;
}
Easings$EASE_IN_OUT_ELASTIC.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_IN_ELASTIC_getInstance();
var tmp1_combine = Easings_EASE_OUT_ELASTIC_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_IN_OUT_ELASTIC.$metadata$ = classMeta('EASE_IN_OUT_ELASTIC', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_OUT_ELASTIC_instance;
function Easings$EASE_OUT_IN_ELASTIC() {
Easings.call(this, 'EASE_OUT_IN_ELASTIC', 18);
Easings_EASE_OUT_IN_ELASTIC_instance = this;
}
Easings$EASE_OUT_IN_ELASTIC.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_OUT_ELASTIC_getInstance();
var tmp1_combine = Easings_EASE_IN_ELASTIC_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_OUT_IN_ELASTIC.$metadata$ = classMeta('EASE_OUT_IN_ELASTIC', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_IN_ELASTIC_instance;
function Easings$EASE_IN_BOUNCE() {
Easings.call(this, 'EASE_IN_BOUNCE', 19);
Easings_EASE_IN_BOUNCE_instance = this;
}
Easings$EASE_IN_BOUNCE.prototype.k7u = function (it) {
return 1.0 - Easings_EASE_OUT_BOUNCE_getInstance().k7u(1.0 - it);
};
Easings$EASE_IN_BOUNCE.$metadata$ = classMeta('EASE_IN_BOUNCE', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_BOUNCE_instance;
function Easings$EASE_IN_OUT_BOUNCE() {
Easings.call(this, 'EASE_IN_OUT_BOUNCE', 20);
Easings_EASE_IN_OUT_BOUNCE_instance = this;
}
Easings$EASE_IN_OUT_BOUNCE.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_IN_BOUNCE_getInstance();
var tmp1_combine = Easings_EASE_OUT_BOUNCE_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_IN_OUT_BOUNCE.$metadata$ = classMeta('EASE_IN_OUT_BOUNCE', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_OUT_BOUNCE_instance;
function Easings$EASE_OUT_IN_BOUNCE() {
Easings.call(this, 'EASE_OUT_IN_BOUNCE', 21);
Easings_EASE_OUT_IN_BOUNCE_instance = this;
}
Easings$EASE_OUT_IN_BOUNCE.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.combine' call
var tmp0_combine = Easings_EASE_OUT_BOUNCE_getInstance();
var tmp1_combine = Easings_EASE_IN_BOUNCE_getInstance();
tmp$ret$0 = it < 0.5 ? 0.5 * tmp0_combine.k7u(it * 2.0) : 0.5 * tmp1_combine.k7u((it - 0.5) * 2.0) + 0.5;
return tmp$ret$0;
};
Easings$EASE_OUT_IN_BOUNCE.$metadata$ = classMeta('EASE_OUT_IN_BOUNCE', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_IN_BOUNCE_instance;
function Easings$EASE_IN_QUAD() {
Easings.call(this, 'EASE_IN_QUAD', 22);
Easings_EASE_IN_QUAD_instance = this;
}
Easings$EASE_IN_QUAD.prototype.k7u = function (it) {
return 1.0 * it * it;
};
Easings$EASE_IN_QUAD.$metadata$ = classMeta('EASE_IN_QUAD', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_QUAD_instance;
function Easings$EASE_OUT_QUAD() {
Easings.call(this, 'EASE_OUT_QUAD', 23);
Easings_EASE_OUT_QUAD_instance = this;
}
Easings$EASE_OUT_QUAD.prototype.k7u = function (it) {
return -1.0 * it * (it - 2);
};
Easings$EASE_OUT_QUAD.$metadata$ = classMeta('EASE_OUT_QUAD', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_OUT_QUAD_instance;
function Easings$EASE_IN_OUT_QUAD() {
Easings.call(this, 'EASE_IN_OUT_QUAD', 24);
Easings_EASE_IN_OUT_QUAD_instance = this;
}
Easings$EASE_IN_OUT_QUAD.prototype.k7u = function (it) {
var tmp$ret$1;
// Inline function 'kotlin.let' call
var tmp0_let = it * 2.0;
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'com.soywiz.korma.interpolation.EASE_IN_OUT_QUAD.invoke.<anonymous>' call
var tmp;
if (tmp0_let < 1.0) {
tmp = 0.5 * tmp0_let * tmp0_let;
} else {
tmp = -0.5 * ((tmp0_let - 1) * (tmp0_let - 1 - 2) - 1);
}
tmp$ret$0 = tmp;
tmp$ret$1 = tmp$ret$0;
return tmp$ret$1;
};
Easings$EASE_IN_OUT_QUAD.$metadata$ = classMeta('EASE_IN_OUT_QUAD', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_IN_OUT_QUAD_instance;
function Easings$EASE_SINE() {
Easings.call(this, 'EASE_SINE', 25);
Easings_EASE_SINE_instance = this;
}
Easings$EASE_SINE.prototype.k7u = function (it) {
var tmp$ret$0;
// Inline function 'kotlin.math.sin' call
var tmp0_sin = it * 1.5707963267948966;
tmp$ret$0 = Math.sin(tmp0_sin);
return tmp$ret$0;
};
Easings$EASE_SINE.$metadata$ = classMeta('EASE_SINE', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_SINE_instance;
function Easings$EASE_CLAMP_START() {
Easings.call(this, 'EASE_CLAMP_START', 26);
Easings_EASE_CLAMP_START_instance = this;
}
Easings$EASE_CLAMP_START.prototype.k7u = function (it) {
return it <= 0.0 ? 0.0 : 1.0;
};
Easings$EASE_CLAMP_START.$metadata$ = classMeta('EASE_CLAMP_START', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_CLAMP_START_instance;
function Easings$EASE_CLAMP_END() {
Easings.call(this, 'EASE_CLAMP_END', 27);
Easings_EASE_CLAMP_END_instance = this;
}
Easings$EASE_CLAMP_END.prototype.k7u = function (it) {
return it < 1.0 ? 0.0 : 1.0;
};
Easings$EASE_CLAMP_END.$metadata$ = classMeta('EASE_CLAMP_END', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_CLAMP_END_instance;
function Easings$EASE_CLAMP_MIDDLE() {
Easings.call(this, 'EASE_CLAMP_MIDDLE', 28);
Easings_EASE_CLAMP_MIDDLE_instance = this;
}
Easings$EASE_CLAMP_MIDDLE.prototype.k7u = function (it) {
return it < 0.5 ? 0.0 : 1.0;
};
Easings$EASE_CLAMP_MIDDLE.$metadata$ = classMeta('EASE_CLAMP_MIDDLE', undefined, undefined, undefined, undefined, Easings.prototype);
var Easings_EASE_CLAMP_MIDDLE_instance;
function values() {
return [Easings_SMOOTH_getInstance(), Easings_EASE_IN_ELASTIC_getInstance(), Easings_EASE_OUT_ELASTIC_getInstance(), Easings_EASE_OUT_BOUNCE_getInstance(), Easings_LINEAR_getInstance(), Easings_EASE_getInstance(), Easings_EASE_IN_getInstance(), Easings_EASE_OUT_getInstance(), Easings_EASE_IN_OUT_getInstance(), Easings_EASE_IN_OLD_getInstance(), Easings_EASE_OUT_OLD_getInstance(), Easings_EASE_IN_OUT_OLD_getInstance(), Easings_EASE_OUT_IN_OLD_getInstance(), Easings_EASE_IN_BACK_getInstance(), Easings_EASE_OUT_BACK_getInstance(), Easings_EASE_IN_OUT_BACK_getInstance(), Easings_EASE_OUT_IN_BACK_getInstance(), Easings_EASE_IN_OUT_ELASTIC_getInstance(), Easings_EASE_OUT_IN_ELASTIC_getInstance(), Easings_EASE_IN_BOUNCE_getInstance(), Easings_EASE_IN_OUT_BOUNCE_getInstance(), Easings_EASE_OUT_IN_BOUNCE_getInstance(), Easings_EASE_IN_QUAD_getInstance(), Easings_EASE_OUT_QUAD_getInstance(), Easings_EASE_IN_OUT_QUAD_getInstance(), Easings_EASE_SINE_getInstance(), Easings_EASE_CLAMP_START_getInstance(), Easings_EASE_CLAMP_END_getInstance(), Easings_EASE_CLAMP_MIDDLE_getInstance()];
}
var Easings_entriesInitialized;
function Easings_initEntries() {
if (Easings_entriesInitialized)
return Unit_getInstance();
Easings_entriesInitialized = true;
Easings_SMOOTH_instance = new Easings$SMOOTH();
Easings_EASE_IN_ELASTIC_instance = new Easings$EASE_IN_ELASTIC();
Easings_EASE_OUT_ELASTIC_instance = new Easings$EASE_OUT_ELASTIC();
Easings_EASE_OUT_BOUNCE_instance = new Easings$EASE_OUT_BOUNCE();
Easings_LINEAR_instance = new Easings$LINEAR();
Easings_EASE_instance = new Easings$EASE();
Easings_EASE_IN_instance = new Easings$EASE_IN();
Easings_EASE_OUT_instance = new Easings$EASE_OUT();
Easings_EASE_IN_OUT_instance = new Easings$EASE_IN_OUT();
Easings_EASE_IN_OLD_instance = new Easings$EASE_IN_OLD();
Easings_EASE_OUT_OLD_instance = new Easings$EASE_OUT_OLD();
Easings_EASE_IN_OUT_OLD_instance = new Easings$EASE_IN_OUT_OLD();
Easings_EASE_OUT_IN_OLD_instance = new Easings$EASE_OUT_IN_OLD();
Easings_EASE_IN_BACK_instance = new Easings$EASE_IN_BACK();
Easings_EASE_OUT_BACK_instance = new Easings$EASE_OUT_BACK();
Easings_EASE_IN_OUT_BACK_instance = new Easings$EASE_IN_OUT_BACK();
Easings_EASE_OUT_IN_BACK_instance = new Easings$EASE_OUT_IN_BACK();
Easings_EASE_IN_OUT_ELASTIC_instance = new Easings$EASE_IN_OUT_ELASTIC();
Easings_EASE_OUT_IN_ELASTIC_instance = new Easings$EASE_OUT_IN_ELASTIC();
Easings_EASE_IN_BOUNCE_instance = new Easings$EASE_IN_BOUNCE();
Easings_EASE_IN_OUT_BOUNCE_instance = new Easings$EASE_IN_OUT_BOUNCE();
Easings_EASE_OUT_IN_BOUNCE_instance = new Easings$EASE_OUT_IN_BOUNCE();
Easings_EASE_IN_QUAD_instance = new Easings$EASE_IN_QUAD();
Easings_EASE_OUT_QUAD_instance = new Easings$EASE_OUT_QUAD();
Easings_EASE_IN_OUT_QUAD_instance = new Easings$EASE_IN_OUT_QUAD();
Easings_EASE_SINE_instance = new Easings$EASE_SINE();
Easings_EASE_CLAMP_START_instance = new Easings$EASE_CLAMP_START();
Easings_EASE_CLAMP_END_instance = new Easings$EASE_CLAMP_END();
Easings_EASE_CLAMP_MIDDLE_instance = new Easings$EASE_CLAMP_MIDDLE();
}
function Easings(name, ordinal) {
Enum.call(this, name, ordinal);
}
Easings.prototype.toString = function () {
var tmp$ret$1;
// Inline function 'kotlin.text.lowercase' call
var tmp = Enum.prototype.toString.call(this);
var tmp_0 = _Char___init__impl__6a9atx(95);
var tmp_1 = _Char___init__impl__6a9atx(45);
var tmp0_lowercase = replace$default(tmp, tmp_0, tmp_1, false, 4, null);
var tmp$ret$0;
// Inline function 'kotlin.js.asDynamic' call
tmp$ret$0 = tmp0_lowercase;
tmp$ret$1 = tmp$ret$0.toLowerCase();
return tmp$ret$1;
};
Easings.$metadata$ = classMeta('Easings', [Easing], undefined, undefined, undefined, Enum.prototype);
function get_BOUNCE_FACTOR() {
return BOUNCE_FACTOR;
}
var BOUNCE_FACTOR;
function Easings_SMOOTH_getInstance() {
Easings_initEntries();
return Easings_SMOOTH_instance;
}
function Easings_EASE_IN_ELASTIC_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_ELASTIC_instance;
}
function Easings_EASE_OUT_ELASTIC_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_ELASTIC_instance;
}
function Easings_EASE_OUT_BOUNCE_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_BOUNCE_instance;
}
function Easings_LINEAR_getInstance() {
Easings_initEntries();
return Easings_LINEAR_instance;
}
function Easings_EASE_getInstance() {
Easings_initEntries();
return Easings_EASE_instance;
}
function Easings_EASE_IN_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_instance;
}
function Easings_EASE_OUT_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_instance;
}
function Easings_EASE_IN_OUT_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_OUT_instance;
}
function Easings_EASE_IN_OLD_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_OLD_instance;
}
function Easings_EASE_OUT_OLD_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_OLD_instance;
}
function Easings_EASE_IN_OUT_OLD_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_OUT_OLD_instance;
}
function Easings_EASE_OUT_IN_OLD_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_IN_OLD_instance;
}
function Easings_EASE_IN_BACK_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_BACK_instance;
}
function Easings_EASE_OUT_BACK_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_BACK_instance;
}
function Easings_EASE_IN_OUT_BACK_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_OUT_BACK_instance;
}
function Easings_EASE_OUT_IN_BACK_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_IN_BACK_instance;
}
function Easings_EASE_IN_OUT_ELASTIC_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_OUT_ELASTIC_instance;
}
function Easings_EASE_OUT_IN_ELASTIC_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_IN_ELASTIC_instance;
}
function Easings_EASE_IN_BOUNCE_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_BOUNCE_instance;
}
function Easings_EASE_IN_OUT_BOUNCE_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_OUT_BOUNCE_instance;
}
function Easings_EASE_OUT_IN_BOUNCE_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_IN_BOUNCE_instance;
}
function Easings_EASE_IN_QUAD_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_QUAD_instance;
}
function Easings_EASE_OUT_QUAD_getInstance() {
Easings_initEntries();
return Easings_EASE_OUT_QUAD_instance;
}
function Easings_EASE_IN_OUT_QUAD_getInstance() {
Easings_initEntries();
return Easings_EASE_IN_OUT_QUAD_instance;
}
function Easings_EASE_SINE_getInstance() {
Easings_initEntries();
return Easings_EASE_SINE_instance;
}
function Easings_EASE_CLAMP_START_getInstance() {
Easings_initEntries();
return Easings_EASE_CLAMP_START_instance;
}
function Easings_EASE_CLAMP_END_getInstance() {
Easings_initEntries();
return Easings_EASE_CLAMP_END_instance;
}
function Easings_EASE_CLAMP_MIDDLE_getInstance() {
Easings_initEntries();
return Easings_EASE_CLAMP_MIDDLE_instance;
}
function _ALL_LIST$factory() {
return getPropertyCallableRef('_ALL_LIST', 1, KProperty1, function (receiver) {
return _get__ALL_LIST__dej8hi(receiver);
}, null);
}
function MutableInterpolable() {
}
MutableInterpolable.$metadata$ = interfaceMeta('MutableInterpolable');
function Interpolable() {
}
Interpolable.$metadata$ = interfaceMeta('Interpolable');
function interpolate_0(_this__u8e3s4, l, r) {
return l + (r - l) * _this__u8e3s4;
}
function interpolate_1(_this__u8e3s4, l, r) {
return numberToInt(l + (r - l | 0) * _this__u8e3s4);
}
function interpolate_2(_this__u8e3s4, l, r) {
return l.d70(_this__u8e3s4, r);
}
function isAlmostEquals(_this__u8e3s4, other, epsilon) {
var tmp$ret$0;
// Inline function 'kotlin.math.absoluteValue' call
var tmp0__get_absoluteValue__nukmtt = _this__u8e3s4 - other;
tmp$ret$0 = Math.abs(tmp0__get_absoluteValue__nukmtt);
return tmp$ret$0 < epsilon;
}
function isAlmostEquals$default(_this__u8e3s4, other, epsilon, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
epsilon = 1.0E-6;
return isAlmostEquals(_this__u8e3s4, other, epsilon);
}
function roundDecimalPlaces(_this__u8e3s4, places) {
if (places < 0)
return _this__u8e3s4;
var tmp$ret$0;
// Inline function 'kotlin.math.pow' call
var tmp0_pow = places;
tmp$ret$0 = Math.pow(10.0, tmp0_pow);
var placesFactor = tmp$ret$0;
return round(_this__u8e3s4 * placesFactor) / placesFactor;
}
function almostEquals(a, b) {
return almostZero(a - b);
}
function isAlmostEquals_0(_this__u8e3s4, other, epsilon) {
var tmp$ret$0;
// Inline function 'kotlin.math.absoluteValue' call
var tmp0__get_absoluteValue__nukmtt = _this__u8e3s4 - other;
tmp$ret$0 = Math.abs(tmp0__get_absoluteValue__nukmtt);
return tmp$ret$0 < epsilon;
}
function isAlmostEquals$default_0(_this__u8e3s4, other, epsilon, $mask0, $handler) {
if (!(($mask0 & 2) === 0))
epsilon = 1.0E-6;
return isAlmostEquals_0(_this__u8e3s4, other, epsilon);
}
function almostZero(a) {
var tmp$ret$0;
// Inline function 'kotlin.math.abs' call
tmp$ret$0 = Math.abs(a);
return tmp$ret$0 <= 1.0E-7;
}
function isAlmostZero(_this__u8e3s4) {
var tmp$ret$0;
// Inline function 'kotlin.math.abs' call
tmp$ret$0 = Math.abs(_this__u8e3s4);
return tmp$ret$0 <= 1.0E-19;
}
function convertRange(_this__u8e3s4, minSrc, maxSrc, minDst, maxDst) {
return (_this__u8e3s4 - minSrc) / (maxSrc - minSrc) * (maxDst - minDst) + minDst;
}
function normalizeZero(_this__u8e3s4) {
return _this__u8e3s4 === -0.0 ? 0.0 : _this__u8e3s4;
}
function min_0(a, b, c, d) {
var tmp$ret$2;
// Inline function 'kotlin.math.min' call
var tmp$ret$1;
// Inline function 'kotlin.math.min' call
var tmp$ret$0;
// Inline function 'kotlin.math.min' call
tmp$ret$0 = Math.min(a, b);
var tmp0_min = tmp$ret$0;
tmp$ret$1 = Math.min(tmp0_min, c);
var tmp1_min = tmp$ret$1;
tmp$ret$2 = Math.min(tmp1_min, d);
return tmp$ret$2;
}
function max(a, b, c, d) {
var tmp$ret$2;
// Inline function 'kotlin.math.max' call
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
var tmp$ret$0;
// Inline function 'kotlin.math.max' call
tmp$ret$0 = Math.max(a, b);
var tmp0_max = tmp$ret$0;
tmp$ret$1 = Math.max(tmp0_max, c);
var tmp1_max = tmp$ret$1;
tmp$ret$2 = Math.max(tmp1_max, d);
return tmp$ret$2;
}
function nextMultipleOf(_this__u8e3s4, multiple) {
return isMultipleOf(_this__u8e3s4, multiple) ? _this__u8e3s4 : imul((_this__u8e3s4 / multiple | 0) + 1 | 0, multiple);
}
function isMultipleOf(_this__u8e3s4, multiple) {
return multiple === 0 ? true : (_this__u8e3s4 % multiple | 0) === 0;
}
function insertAt($this, n, min, max) {
$this.q7q_1.w4o(n, min);
$this.r7q_1.w4o(n, max);
}
function removeAt($this, n, count) {
$this.q7q_1.x4n(n, count);
$this.r7q_1.x4n(n, count);
}
function IntSegmentSet() {
this.q7q_1 = new IntArrayList(16);
this.r7q_1 = new IntArrayList(16);
}
IntSegmentSet.prototype.b7x = function () {
return this.q7q_1;
};
IntSegmentSet.prototype.c7x = function () {
return this.r7q_1;
};
IntSegmentSet.prototype.i = function () {
return this.q7q_1.i();
};
IntSegmentSet.prototype.p = function () {
return this.i() === 0;
};
IntSegmentSet.prototype.t4o = function () {
return this.i() > 0;
};
IntSegmentSet.prototype.zl = function () {
var tmp$ret$0;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.clear.<anonymous>' call
this.q7q_1.x7();
this.r7q_1.x7();
tmp$ret$0 = this;
return tmp$ret$0;
};
IntSegmentSet.prototype.d7x = function () {
return this.t4o() ? this.q7q_1.t4n(0) : 0;
};
IntSegmentSet.prototype.e7x = function () {
return this.t4o() ? this.r7q_1.t4n(this.r7q_1.i() - 1 | 0) : 0;
};
IntSegmentSet.prototype.f7x = function (block) {
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
block(n, this.q7q_1.t4n(n), this.r7q_1.t4n(n));
}
while (inductionVariable < last);
};
IntSegmentSet.prototype.g7x = function (x) {
var tmp$ret$4;
// Inline function 'com.soywiz.korma.segment.genericBinarySearchLeft' call
var tmp2_genericBinarySearchLeft = this.i();
var tmp$ret$1;
$l$block: {
// Inline function 'com.soywiz.kds.genericBinarySearch' call
var low = 0;
var high = tmp2_genericBinarySearchLeft - 1 | 0;
while (low <= high) {
var mid = (low + high | 0) / 2 | 0;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.findLeftBound.<anonymous>' call
tmp$ret$0 = compareTo(this.q7q_1.t4n(mid), x);
var mval = tmp$ret$0;
if (mval < 0)
low = mid + 1 | 0;
else if (mval > 0)
high = mid - 1 | 0;
else {
tmp$ret$1 = mid;
break $l$block;
}
}
var tmp$ret$3;
// Inline function 'com.soywiz.korma.segment.genericBinarySearchLeft.<anonymous>' call
var tmp0__anonymous__q1qw7t = low;
var tmp1__anonymous__uwfjfc = high;
var tmp$ret$2;
// Inline function 'kotlin.math.min' call
tmp$ret$2 = Math.min(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc);
tmp$ret$3 = coerceIn(tmp$ret$2, 0, tmp2_genericBinarySearchLeft - 1 | 0);
tmp$ret$1 = tmp$ret$3;
}
tmp$ret$4 = tmp$ret$1;
return coerceIn(tmp$ret$4, 0, this.i() - 1 | 0);
};
IntSegmentSet.prototype.h7x = function (x) {
var tmp$ret$4;
// Inline function 'com.soywiz.korma.segment.genericBinarySearchRight' call
var tmp2_genericBinarySearchRight = this.i();
var tmp$ret$1;
$l$block: {
// Inline function 'com.soywiz.kds.genericBinarySearch' call
var low = 0;
var high = tmp2_genericBinarySearchRight - 1 | 0;
while (low <= high) {
var mid = (low + high | 0) / 2 | 0;
var tmp$ret$0;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.findRightBound.<anonymous>' call
tmp$ret$0 = compareTo(this.r7q_1.t4n(mid), x);
var mval = tmp$ret$0;
if (mval < 0)
low = mid + 1 | 0;
else if (mval > 0)
high = mid - 1 | 0;
else {
tmp$ret$1 = mid;
break $l$block;
}
}
var tmp$ret$3;
// Inline function 'com.soywiz.korma.segment.genericBinarySearchRight.<anonymous>' call
var tmp0__anonymous__q1qw7t = low;
var tmp1__anonymous__uwfjfc = high;
var tmp$ret$2;
// Inline function 'kotlin.math.max' call
tmp$ret$2 = Math.max(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc);
tmp$ret$3 = coerceIn(tmp$ret$2, 0, tmp2_genericBinarySearchRight - 1 | 0);
tmp$ret$1 = tmp$ret$3;
}
tmp$ret$4 = tmp$ret$1;
return coerceIn(tmp$ret$4, 0, this.i() - 1 | 0);
};
IntSegmentSet.prototype.i7x = function (min, max, block) {
if (this.p())
return Unit_getInstance();
var nmin = this.g7x(min);
var nmax = this.h7x(max);
var inductionVariable = nmin;
if (inductionVariable <= nmax)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
block(n, this.q7q_1.t4n(n), this.r7q_1.t4n(n));
}
while (!(n === nmax));
};
IntSegmentSet.prototype.d7c = function (min, max) {
var tmp$ret$7;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$6;
$l$block_0: {
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.add.<anonymous>' call
// Inline function 'kotlin.check' call
var tmp0_check = min <= max;
// Inline function 'kotlin.contracts.contract' call
// Inline function 'kotlin.check' call
// Inline function 'kotlin.contracts.contract' call
if (!tmp0_check) {
var tmp$ret$0;
// Inline function 'kotlin.check.<anonymous>' call
tmp$ret$0 = 'Check failed.';
var message = tmp$ret$0;
throw IllegalStateException_init_$Create$(toString(message));
}
if (this.p()) {
insertAt(this, this.i(), min, max);
} else if (min === this.e7x()) {
this.r7q_1.r4o(this.r7q_1.i() - 1 | 0, max);
} else if (max === this.d7x()) {
this.q7q_1.r4o(0, min);
} else {
var removeStart = -1;
var removeCount = -1;
var tmp$ret$1;
$l$block: {
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.fastForEachInterestingRange' call
if (this.p()) {
tmp$ret$1 = Unit_getInstance();
break $l$block;
}
var nmin = this.g7x(min);
var nmax = this.h7x(max);
var inductionVariable = nmin;
if (inductionVariable <= nmax)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.add.<anonymous>.<anonymous>' call
var tmp1__anonymous__uwfjfc = this.q7q_1.t4n(n);
var tmp2__anonymous__z9zvc9 = this.r7q_1.t4n(n);
if (this.j7x(tmp1__anonymous__uwfjfc, tmp2__anonymous__z9zvc9, min, max)) {
if (removeStart === -1)
removeStart = n;
var tmp = removeStart;
var tmp$ret$3;
// Inline function 'kotlin.math.min' call
var tmp0_min = this.q7q_1.t4n(removeStart);
var tmp$ret$2;
// Inline function 'kotlin.math.min' call
tmp$ret$2 = Math.min(tmp1__anonymous__uwfjfc, min);
var tmp1_min = tmp$ret$2;
tmp$ret$3 = Math.min(tmp0_min, tmp1_min);
this.q7q_1.r4o(tmp, tmp$ret$3);
var tmp_0 = removeStart;
var tmp$ret$5;
// Inline function 'kotlin.math.max' call
var tmp2_max = this.r7q_1.t4n(removeStart);
var tmp$ret$4;
// Inline function 'kotlin.math.max' call
tmp$ret$4 = Math.max(tmp2__anonymous__z9zvc9, max);
var tmp3_max = tmp$ret$4;
tmp$ret$5 = Math.max(tmp2_max, tmp3_max);
this.r7q_1.r4o(tmp_0, tmp$ret$5);
var tmp0 = removeCount;
removeCount = tmp0 + 1 | 0;
}
}
while (!(n === nmax));
}
if (removeCount === 0)
;
else if (removeCount > 0) {
removeAt(this, removeStart + 1 | 0, removeCount);
} else if (max < this.d7x()) {
insertAt(this, 0, min, max);
} else if (min > this.e7x()) {
insertAt(this, this.i(), min, max);
} else {
var inductionVariable_0 = coerceAtLeast(this.g7x(min), 1);
var last = this.h7x(max);
if (inductionVariable_0 <= last)
do {
var m = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
var prevMax = this.r7q_1.t4n(m - 1 | 0);
var currMin = this.q7q_1.t4n(m);
if (min > prevMax ? max < currMin : false) {
insertAt(this, m, min, max);
tmp$ret$6 = Unit_getInstance();
break $l$block_0;
}
}
while (!(m === last));
// Inline function 'kotlin.error' call
throw IllegalStateException_init_$Create$('Unexpected');
}
}
}
tmp$ret$7 = this;
return tmp$ret$7;
};
IntSegmentSet.prototype.k7x = function (min, max, out) {
var count = 0;
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.fastForEachInterestingRange' call
if (this.p()) {
tmp$ret$0 = Unit_getInstance();
break $l$block;
}
var nmin = this.g7x(min);
var nmax = this.h7x(max);
var inductionVariable = nmin;
if (inductionVariable <= nmax)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.intersection.<anonymous>' call
var tmp0__anonymous__q1qw7t = this.q7q_1.t4n(n);
var tmp1__anonymous__uwfjfc = this.r7q_1.t4n(n);
if (this.j7x(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc, min, max)) {
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
tmp$ret$1 = Math.max(tmp0__anonymous__q1qw7t, min);
var tmp = tmp$ret$1;
var tmp$ret$2;
// Inline function 'kotlin.math.min' call
tmp$ret$2 = Math.min(tmp1__anonymous__uwfjfc, max);
out(tmp, tmp$ret$2);
var tmp0 = count;
count = tmp0 + 1 | 0;
}
}
while (!(n === nmax));
}
return count > 0;
};
IntSegmentSet.prototype.l7x = function (a, b) {
var tmp$ret$5;
// Inline function 'kotlin.apply' call
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.setToIntersect.<anonymous>' call
var aSmaller = a.i() < b.i();
var av = aSmaller ? a : b;
var bv = aSmaller ? b : a;
var tmp$ret$4;
// Inline function 'kotlin.also' call
var tmp0_also = this.zl();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.setToIntersect.<anonymous>.<anonymous>' call
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.fastForEach' call
var inductionVariable = 0;
var last = av.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.setToIntersect.<anonymous>.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t = av.q7q_1.t4n(n);
var tmp1__anonymous__uwfjfc = av.r7q_1.t4n(n);
var tmp$ret$3;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.intersection' call
var count = 0;
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.fastForEachInterestingRange' call
if (bv.p()) {
tmp$ret$0 = Unit_getInstance();
break $l$block;
}
var nmin = bv.g7x(tmp0__anonymous__q1qw7t);
var nmax = bv.h7x(tmp1__anonymous__uwfjfc);
var inductionVariable_0 = nmin;
if (inductionVariable_0 <= nmax)
do {
var n_0 = inductionVariable_0;
inductionVariable_0 = inductionVariable_0 + 1 | 0;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.intersection.<anonymous>' call
var tmp0__anonymous__q1qw7t_0 = bv.q7q_1.t4n(n_0);
var tmp1__anonymous__uwfjfc_0 = bv.r7q_1.t4n(n_0);
if (bv.j7x(tmp0__anonymous__q1qw7t_0, tmp1__anonymous__uwfjfc_0, tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc)) {
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.setToIntersect.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
tmp$ret$1 = Math.max(tmp0__anonymous__q1qw7t_0, tmp0__anonymous__q1qw7t);
var tmp0__anonymous__q1qw7t_1 = tmp$ret$1;
var tmp$ret$2;
// Inline function 'kotlin.math.min' call
tmp$ret$2 = Math.min(tmp1__anonymous__uwfjfc_0, tmp1__anonymous__uwfjfc);
var tmp1__anonymous__uwfjfc_1 = tmp$ret$2;
this.d7c(tmp0__anonymous__q1qw7t_1, tmp1__anonymous__uwfjfc_1);
var tmp0 = count;
count = tmp0 + 1 | 0;
}
}
while (!(n_0 === nmax));
}
tmp$ret$3 = count > 0;
}
while (inductionVariable < last);
tmp$ret$4 = tmp0_also;
tmp$ret$5 = this;
return tmp$ret$5;
};
IntSegmentSet.prototype.j7x = function (x1, x2, y1, y2) {
return x2 >= y1 ? y2 >= x1 : false;
};
IntSegmentSet.prototype.toString = function () {
var tmp$ret$1;
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.contracts.contract' call
var tmp$ret$0;
// Inline function 'kotlin.apply' call
var tmp0_apply = StringBuilder_init_$Create$();
// Inline function 'kotlin.contracts.contract' call
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.toString.<anonymous>' call
tmp0_apply.gc('[');
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.fastForEach' call
var inductionVariable = 0;
var last = this.i();
if (inductionVariable < last)
do {
var n = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
// Inline function 'com.soywiz.korma.segment.IntSegmentSet.toString.<anonymous>.<anonymous>' call
var tmp0__anonymous__q1qw7t = this.q7q_1.t4n(n);
var tmp1__anonymous__uwfjfc = this.r7q_1.t4n(n);
var first = n === 0;
if (!first) {
tmp0_apply.gc(', ');
}
tmp0_apply.gc('' + tmp0__anonymous__q1qw7t + '-' + tmp1__anonymous__uwfjfc);
}
while (inductionVariable < last);
tmp0_apply.gc(']');
tmp$ret$0 = tmp0_apply;
tmp$ret$1 = tmp$ret$0.toString();
return tmp$ret$1;
};
IntSegmentSet.$metadata$ = classMeta('IntSegmentSet');
function genericBinarySearchLeft(fromIndex, toIndex, check) {
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.kds.genericBinarySearch' call
var low = fromIndex;
var high = toIndex - 1 | 0;
while (low <= high) {
var mid = (low + high | 0) / 2 | 0;
var mval = check(mid);
if (mval < 0)
low = mid + 1 | 0;
else if (mval > 0)
high = mid - 1 | 0;
else {
tmp$ret$0 = mid;
break $l$block;
}
}
var tmp$ret$2;
// Inline function 'com.soywiz.korma.segment.genericBinarySearchLeft.<anonymous>' call
var tmp0__anonymous__q1qw7t = low;
var tmp1__anonymous__uwfjfc = high;
var tmp$ret$1;
// Inline function 'kotlin.math.min' call
tmp$ret$1 = Math.min(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc);
tmp$ret$2 = coerceIn(tmp$ret$1, fromIndex, toIndex - 1 | 0);
tmp$ret$0 = tmp$ret$2;
}
return tmp$ret$0;
}
function genericBinarySearchRight(fromIndex, toIndex, check) {
var tmp$ret$0;
$l$block: {
// Inline function 'com.soywiz.kds.genericBinarySearch' call
var low = fromIndex;
var high = toIndex - 1 | 0;
while (low <= high) {
var mid = (low + high | 0) / 2 | 0;
var mval = check(mid);
if (mval < 0)
low = mid + 1 | 0;
else if (mval > 0)
high = mid - 1 | 0;
else {
tmp$ret$0 = mid;
break $l$block;
}
}
var tmp$ret$2;
// Inline function 'com.soywiz.korma.segment.genericBinarySearchRight.<anonymous>' call
var tmp0__anonymous__q1qw7t = low;
var tmp1__anonymous__uwfjfc = high;
var tmp$ret$1;
// Inline function 'kotlin.math.max' call
tmp$ret$1 = Math.max(tmp0__anonymous__q1qw7t, tmp1__anonymous__uwfjfc);
tmp$ret$2 = coerceIn(tmp$ret$1, fromIndex, toIndex - 1 | 0);
tmp$ret$0 = tmp$ret$2;
}
return tmp$ret$0;
}
//region block: post-declaration
PointArrayList.prototype.m7b = get_dimensions;
PointArrayList.prototype.l78 = get;
Bezier.prototype.c72 = getBounds$default;
Bezier.prototype.s7g = calc$default;
Bezier.prototype.y7g = getLUT$default;
Bezier.prototype.w7g = derivative$default;
Bezier.prototype.q7h = normal$default;
Bezier.prototype.s7h = tangent$default;
Bezier.prototype.u7h = hullOrNull$default;
Bezier.prototype.d7i = toLine$default;
Bezier.prototype.e7i = get_0;
Bezier.prototype.e7g = get$default;
Curves.prototype.c72 = getBounds$default;
Curves.prototype.s7g = calc$default;
Curves.prototype.q7h = normal$default;
Curves.prototype.s7h = tangent$default;
add$1.prototype.x2c = close;
add$1.prototype.u7e = lineTo;
add$1.prototype.v7e = quadTo_0;
add$1.prototype.x7e = cubicTo;
//endregion
//region block: init
PI2 = 6.283185307179586;
BOUNCE_FACTOR = 1.70158;
//endregion
//region block: exports
_.$_$ = _.$_$ || {};
_.$_$.a = get_isConvex;
_.$_$.b = toBezier;
_.$_$.c = HitTestable;
_.$_$.d = WithHitShape2d;
_.$_$.e = getPoints2List;
_.$_$.f = IVectorPath;
_.$_$.g = PolygonScanline;
_.$_$.h = RastScale;
_.$_$.i = StrokeInfo;
_.$_$.j = StrokeToFill;
_.$_$.k = VectorBuilder;
_.$_$.l = applyTransform_0;
_.$_$.m = circle_0;
_.$_$.n = circle;
_.$_$.o = getCurves;
_.$_$.p = isEmpty;
_.$_$.q = isNotEmpty;
_.$_$.r = lineTo_1;
_.$_$.s = lineTo_0;
_.$_$.t = line_0;
_.$_$.u = line;
_.$_$.v = moveTo_1;
_.$_$.w = moveTo_0;
_.$_$.x = quadTo_1;
_.$_$.y = rLineTo;
_.$_$.z = rMoveTo;
_.$_$.a1 = rect;
_.$_$.b1 = rect_0;
_.$_$.c1 = roundRect_0;
_.$_$.d1 = roundRect;
_.$_$.e1 = strokeToFill_0;
_.$_$.f1 = toCurvesList;
_.$_$.g1 = transformed;
_.$_$.h1 = Anchor;
_.$_$.i1 = Angle_between;
_.$_$.j1 = Angle;
_.$_$.k1 = BoundsBuilder;
_.$_$.l1 = ISizeInt;
_.$_$.m1 = Matrix3D;
_.$_$.n1 = PointArrayList;
_.$_$.o1 = PointInt;
_.$_$.p1 = Point;
_.$_$.q1 = RectangleInt;
_.$_$.r1 = Rectangle;
_.$_$.s1 = SizeInt;
_.$_$.t1 = Sizeable;
_.$_$.u1 = Vector3D;
_.$_$.v1 = XY;
_.$_$.w1 = get_absoluteValue;
_.$_$.x1 = applyTransform;
_.$_$.y1 = get_bottom_0;
_.$_$.z1 = get_bottomLeft;
_.$_$.a2 = get_bottomRight;
_.$_$.b2 = bounds;
_.$_$.c2 = contains;
_.$_$.d2 = copyFrom;
_.$_$.e2 = copyToFloatWxH;
_.$_$.f2 = get_degrees;
_.$_$.g2 = div;
_.$_$.h2 = expand_0;
_.$_$.i2 = expand;
_.$_$.j2 = get_float;
_.$_$.k2 = get_left_0;
_.$_$.l2 = get_radians_0;
_.$_$.m2 = get_radians;
_.$_$.n2 = get_right_0;
_.$_$.o2 = setTo_1;
_.$_$.p2 = setTo;
_.$_$.q2 = get_size_0;
_.$_$.r2 = times_0;
_.$_$.s2 = toMatrix3D;
_.$_$.t2 = get_top_0;
_.$_$.u2 = get_topLeft;
_.$_$.v2 = get_topRight;
_.$_$.w2 = unaryMinus;
_.$_$.x2 = without;
_.$_$.y2 = Easing;
_.$_$.z2 = Interpolable;
_.$_$.a3 = MutableInterpolable;
_.$_$.b3 = interpolate_0;
_.$_$.c3 = interpolate_1;
_.$_$.d3 = nextMultipleOf;
_.$_$.e3 = roundDecimalPlaces;
_.$_$.f3 = IntSegmentSet;
_.$_$.g3 = StrokePointsMode_SCALABLE_POS_NORMAL_WIDTH_getInstance;
_.$_$.h3 = HitTestDirection_ANY_getInstance;
_.$_$.i3 = LineCap_BUTT_getInstance;
_.$_$.j3 = LineCap_SQUARE_getInstance;
_.$_$.k3 = LineJoin_MITER_getInstance;
_.$_$.l3 = LineScaleMode_NONE_getInstance;
_.$_$.m3 = LineScaleMode_NORMAL_getInstance;
_.$_$.n3 = Winding_EVEN_ODD_getInstance;
_.$_$.o3 = Winding_NON_ZERO_getInstance;
_.$_$.p3 = MajorOrder_COLUMN_getInstance;
_.$_$.q3 = Type_IDENTITY_getInstance;
_.$_$.r3 = toStrokePointsList$default;
_.$_$.s3 = getPoints2$default;
_.$_$.t3 = add$default;
_.$_$.u3 = strokeToFill$default;
_.$_$.v3 = firstPoint$default;
_.$_$.w3 = lastPoint$default;
_.$_$.x3 = toMatrix3D$default;
_.$_$.y3 = Bezier_init_$Create$;
_.$_$.z3 = Point_init_$Create$;
_.$_$.a4 = StrokeInfo_init_$Create$;
_.$_$.b4 = VectorPath_init_$Create$;
_.$_$.c4 = Matrix_init_$Create$;
_.$_$.d4 = Transform_init_$Create$;
_.$_$.e4 = MutableMarginInt_init_$Create$;
_.$_$.f4 = PointPool_init_$Create$;
_.$_$.g4 = _Angle___get_degrees__impl__qg56vw;
_.$_$.h4 = Angle__hashCode_impl_szcndt;
_.$_$.i4 = _Angle___get_radians__impl__n00yt5;
_.$_$.j4 = _PointInt___get_x__impl__8q83ox;
_.$_$.k4 = _PointInt___set_x__impl__gw06o3;
_.$_$.l4 = _PointInt___get_y__impl__k3edda;
_.$_$.m4 = _PointInt___set_y__impl__pbhe8u;
_.$_$.n4 = _RectangleInt___get_bottom__impl__za67bh;
_.$_$.o4 = RectangleInt__hashCode_impl_wuqys2;
_.$_$.p4 = _RectangleInt___get_height__impl__gd473j;
_.$_$.q4 = _RectangleInt___set_height__impl__vwuxnn;
_.$_$.r4 = _RectangleInt___get_left__impl__rhzld;
_.$_$.s4 = _RectangleInt___get_rect__impl__gu7bbg;
_.$_$.t4 = _RectangleInt___get_right__impl__9c8zzq;
_.$_$.u4 = _RectangleInt___get_top__impl__ie2ifj;
_.$_$.v4 = _RectangleInt___get_width__impl__gtay8w;
_.$_$.w4 = _RectangleInt___set_width__impl__dh3830;
_.$_$.x4 = _RectangleInt___get_x__impl__6tm2y6;
_.$_$.y4 = _RectangleInt___set_x__impl__wfudb6;
_.$_$.z4 = _RectangleInt___get_y__impl__zdvhyr;
_.$_$.a5 = _RectangleInt___set_y__impl__9rn7lr;
_.$_$.b5 = SizeInt__clone_impl_5edshq;
_.$_$.c5 = _SizeInt___get_height__impl__d3sy61;
_.$_$.d5 = _SizeInt___get_width__impl__swntg6;
_.$_$.e5 = Companion_getInstance_18;
_.$_$.f5 = Companion_getInstance_20;
_.$_$.g5 = Companion_getInstance_29;
_.$_$.h5 = Command_getInstance;
_.$_$.i5 = Companion_getInstance;
_.$_$.j5 = Companion_getInstance_0;
_.$_$.k5 = Companion_getInstance_1;
_.$_$.l5 = Companion_getInstance_4;
_.$_$.m5 = Companion_getInstance_5;
_.$_$.n5 = Companion_getInstance_3;
_.$_$.o5 = Companion_getInstance_8;
_.$_$.p5 = Companion_getInstance_9;
_.$_$.q5 = Companion_getInstance_12;
_.$_$.r5 = Companion_getInstance_13;
_.$_$.s5 = Companion_getInstance_14;
_.$_$.t5 = Companion_getInstance_15;
_.$_$.u5 = Companion_getInstance_16;
_.$_$.v5 = Companion_getInstance_17;
_.$_$.w5 = Companion_getInstance_32;
//endregion
return _;
}));
//# sourceMappingURL=korlibs-korma.js.map