UNPKG

igniteui-react-core

Version:
1,361 lines 101 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends, __values } from "tslib"; import { Base, IEnumerable_$type, fromEnum, typeCast, Date_$type, Boolean_$type, Array_$type, Delegate_$type, runOn, Number_$type, String_$type, EnumUtil, typeGetValue, markType } from "./type"; import { TypeDescriptionContext } from "./TypeDescriptionContext"; import { TypeDescriptionCleanups } from "./TypeDescriptionCleanups"; import { Dictionary$2 } from "./Dictionary$2"; import { List$1 } from "./List$1"; import { ComponentRendererReferenceResolverEventArgs } from "./ComponentRendererReferenceResolverEventArgs"; import { Description } from "./Description"; import { DescriptionTreeNode } from "./DescriptionTreeNode"; import { Queue$1 } from "./Queue$1"; import { DescriptionTreeAction } from "./DescriptionTreeAction"; import { DescriptionRef } from "./DescriptionRef"; import { TypeDescriptionPropretyTransforms } from "./TypeDescriptionPropretyTransforms"; import { DescriptionSerializerBuilder } from "./DescriptionSerializerBuilder"; import { DescriptionSerializer } from "./DescriptionSerializer"; import { DataSourceLocalDataProvider } from "./DataSourceLocalDataProvider"; import { JsonDictionaryParser } from "./JsonDictionaryParser"; import { DescriptionTreeBuilder } from "./DescriptionTreeBuilder"; import { JsonDictionaryObject } from "./JsonDictionaryObject"; import { JsonDictionaryValue } from "./JsonDictionaryValue"; import { JsonDictionaryArray } from "./JsonDictionaryArray"; import { TypeDescriptionMetadata } from "./TypeDescriptionMetadata"; import { DescriptionTreeReconciler } from "./DescriptionTreeReconciler"; import { HashSet$1 } from "./HashSet$1"; import { GlobalAnimationState } from "./GlobalAnimationState"; import { TypeDescriptionWellKnownType_$type } from "./TypeDescriptionWellKnownType"; import { Tuple$2 } from "./Tuple$2"; import { DescriptionRefTargetInfo } from "./DescriptionRefTargetInfo"; import { NotImplementedException } from "./NotImplementedException"; import { truncate } from "./number"; import { ComponentRendererAdapter } from "./ComponentRendererAdapter"; import { stringIsNullOrEmpty, stringStartsWith, stringEndsWith } from "./string"; /** * @hidden */ var ComponentRenderer = /** @class */ /*@__PURE__*/ (function (_super) { __extends(ComponentRenderer, _super); function ComponentRenderer() { var _this = _super.call(this) || this; _this._adapter = null; _this._context = null; _this._isProceedOnErrorEnabled = false; _this.k = null; _this.l = null; _this._preserveKeyOrder = false; _this._allowNullForRemove = false; _this.bf = new List$1(Delegate_$type, 0); _this.bh = new List$1(Delegate_$type, 0); _this.a2 = new Dictionary$2(Base.$, Description.$, 0); _this.a3 = new Dictionary$2(Base.$, Boolean_$type, 0); _this.a4 = new Dictionary$2(Base.$, Boolean_$type, 0); _this.a1 = new Dictionary$2(Base.$, Boolean_$type, 0); _this.az = new Dictionary$2(Base.$, String_$type, 0); _this.a0 = new Dictionary$2(Base.$, Number_$type, 0); _this.ax = new Dictionary$2(Base.$, DescriptionTreeNode.$, 0); _this.a8 = new Dictionary$2(Base.$, ContainerState.$, 0); _this.a5 = new Dictionary$2(Base.$, Queue$1.$.specialize(Queue$1.$.specialize(DescriptionTreeAction.$)), 0); _this.ay = new Dictionary$2(Base.$, List$1.$.specialize(Delegate_$type), 0); _this.aw = new Dictionary$2(Base.$, Boolean_$type, 0); _this.a7 = new Dictionary$2(String_$type, DescriptionRef.$, 0); _this.a9 = new Dictionary$2(String_$type, Base.$, 0); _this.bb = new Dictionary$2(String_$type, Base.$, 0); _this.a6 = new Dictionary$2(Base.$, String_$type, 0); _this.bn = null; _this.bi = new List$1(Delegate_$type, 0); _this.ba = new Dictionary$2(String_$type, List$1.$.specialize(Delegate_$type), 0); _this.be = new List$1(Delegate_$type, 0); _this.bg = new List$1(Delegate_$type, 0); _this.bd = null; _this._shouldNamespaceSystemRefValues = false; var a = _this.j(); _this.adapter = a; var adapter_ = _this.adapter; var b = (adapter_._platform); if (b == "Igc") { ComponentRenderer.platform = 4; } else if (b == "Igr") { ComponentRenderer.platform = 2; } _this.context = new TypeDescriptionContext(_this.adapter, ComponentRenderer.platform); _this.k = new TypeDescriptionPropretyTransforms(); _this.l = new TypeDescriptionCleanups(); return _this; } Object.defineProperty(ComponentRenderer, "defaultInstance", { get: function () { return ComponentRenderer._defaultInstance; }, set: function (a) { ComponentRenderer._defaultInstance = a; }, enumerable: false, configurable: true }); Object.defineProperty(ComponentRenderer.prototype, "adapter", { get: function () { return this._adapter; }, set: function (a) { this._adapter = a; }, enumerable: false, configurable: true }); Object.defineProperty(ComponentRenderer.prototype, "context", { get: function () { return this._context; }, set: function (a) { this._context = a; }, enumerable: false, configurable: true }); Object.defineProperty(ComponentRenderer.prototype, "isProceedOnErrorEnabled", { get: function () { return this._isProceedOnErrorEnabled; }, set: function (a) { this._isProceedOnErrorEnabled = a; }, enumerable: false, configurable: true }); ComponentRenderer.prototype.j = function () { return (new ComponentRendererAdapter()); }; ComponentRenderer.prototype.toJson = function (a) { var e_1, _a, e_2, _b; var b = new DescriptionSerializerBuilder(); var c = new DescriptionSerializer(); b.f("{"); b.i(); b.f("\"descriptions\": {"); b.i(); var d = true; try { for (var _c = __values(fromEnum(this.ax.keys)), _d = _c.next(); !_d.done; _d = _c.next()) { var e = _d.value; if (d) { d = false; } else { b.f(","); } var f = e; var g = this.ax.item(e); var h = "root"; h = a(f); if (stringIsNullOrEmpty(h)) { h = "root"; } b.e("\"" + h + "\""); b.e(": "); c.w(this.context, g, b); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_1) throw e_1.error; } } b.f(""); b.h(); b.e("}"); if (this.bb.count > 0) { b.e(","); } b.f(""); if (this.bb.count > 0) { d = true; b.f("refs: {"); b.i(); try { for (var _e = __values(fromEnum(this.bb.keys)), _f = _e.next(); !_f.done; _f = _e.next()) { var i = _f.value; if (!this.r(i, this.bb.item(i))) { continue; } if (d) { d = false; } else { b.f(","); } this.ek(b, i, this.bb.item(i)); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_f && !_f.done && (_b = _e.return)) _b.call(_e); } finally { if (e_2) throw e_2.error; } } b.f(""); b.h(); b.f("}"); } b.h(); b.f("}"); return b.toString(); }; ComponentRenderer.prototype.ek = function (a, b, c) { a.e("\"" + b + "\": "); this.el(a, c); }; ComponentRenderer.prototype.el = function (a, b) { if (this.aa(b)) { if (typeof b === 'string') { a.e(b == null ? "null" : "\"" + b.toString() + "\""); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeof b === 'number') { a.e(b == null ? "null" : b.toString()); } else if (typeCast(Date_$type, b) !== null) { var v_ = b; a.e("\"" + (v_.toJSON()) + "\""); } else if (typeCast(Boolean_$type, b) !== null) { a.e(b == null ? "null" : b.toString().toLowerCase()); } else { a.e("null"); } } else { if (b == null) { a.e("null"); return; } if (this.x(b)) { a.f("["); a.i(); var c = new DataSourceLocalDataProvider(); c.dataSource = b; for (var d = 0; d < c.actualCount; d++) { if (d > 0) { a.f(","); } this.ej(a, c, d); } a.f(""); a.h(); a.e("]"); } else { var e = [b]; var f = new DataSourceLocalDataProvider(); f.dataSource = e; this.ej(a, f, 0); } } }; ComponentRenderer.prototype.aa = function (a) { if (typeof a === 'string') { return true; } if (typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number' || typeof a === 'number') { return true; } if (typeCast(Date_$type, a) !== null) { return true; } if (typeCast(Boolean_$type, a) !== null) { return true; } return false; }; ComponentRenderer.prototype.x = function (a) { if (typeCast(Array_$type, a) !== null) { return true; } if (typeCast(IEnumerable_$type, a) !== null) { return true; } return false; }; ComponentRenderer.prototype.ej = function (a, b, c) { a.f("{"); a.i(); var d = b.actualSchema; for (var e = 0; e < d.propertyNames.length; e++) { if (e > 0) { a.f(","); } var f = d.propertyNames[e]; if (stringStartsWith(f, "[")) { f = f.substr(1, f.length - 2); } a.e("\"" + f + "\""); a.e(": "); var g = b.getItemValue(b.getItemAtIndex(c), d.propertyNames[e]); switch (d.propertyTypes[e]) { case 0: a.e(g == null ? "null" : "\"" + g.toString() + "\""); break; case 2: a.e(g == null ? "null" : "\"" + g.toString() + "\""); break; case 10: case 6: case 5: case 1: case 3: case 4: case 7: a.e(g == null ? "null" : g.toString()); break; case 8: var v_ = g; a.e("\"" + (v_.toJSON()) + "\""); break; case 11: this.el(a, g); break; } } a.h(); a.f("}"); }; ComponentRenderer.prototype.r = function (a, b) { if (b == null) { return true; } var v_ = b; if ((typeof v_ === 'function')) { return false; } return true; }; ComponentRenderer.prototype.createObjectFromJson = function (a, b) { var c = new JsonDictionaryParser(); var d = c.parse(a); var e = new DescriptionSerializer(); var f = false; var g = e.d(this.context, d, f, null, false); if (g.result == null) { return null; } var h = DescriptionTreeBuilder.createTree(this.context, g.result); var i = this.a8.item(b); if (h.c("Type")) { var j = h.a("Type").b; return this.b8(j, h, b, i, true, -1, null); } else { return this.b7(typeCast(JsonDictionaryObject.$, d)); } }; ComponentRenderer.prototype.loadJson = function (a, b) { this.dq(a, b, null, false, false, false); }; ComponentRenderer.prototype.loadJsonOverlay = function (a, b, c) { this.dq(a, b, c, true, false, true); }; ComponentRenderer.prototype.loadJsonDelta = function (a, b, c) { this.dq(a, b, null, true, c, false); }; Object.defineProperty(ComponentRenderer.prototype, "preserveKeyOrder", { get: function () { return this._preserveKeyOrder; }, set: function (a) { this._preserveKeyOrder = a; }, enumerable: false, configurable: true }); ComponentRenderer.prototype.at = function () { return false; }; ComponentRenderer.prototype.ds = function (a) { }; Object.defineProperty(ComponentRenderer.prototype, "allowNullForRemove", { get: function () { return this._allowNullForRemove; }, set: function (a) { this._allowNullForRemove = a; }, enumerable: false, configurable: true }); ComponentRenderer.prototype.dq = function (a, b, c, d, e, f) { var g = new JsonDictionaryParser(); var h = g.parse(a); var i = new DescriptionSerializer(); i.h = this.isProceedOnErrorEnabled; i.g = this.at(); var j = null; if (typeCast(JsonDictionaryObject.$, h) !== null) { var k = h; if (k.g("skipAlterDataCasing")) { var l = k.item("skipAlterDataCasing"); if (l.value) { this.ds(true); } } else { this.ds(false); } var m = null; if (k.g("animationIdleRef") || k.g("hasAnimations")) { m = "AnimationIdleHandler"; if (k.g("animationIdleRef")) { m = k.item("animationIdleRef").value; } } var n = 0; if (k.g("animationIdleTimeout")) { n = truncate(k.item("animationIdleTimeout").value); } if (k.g("descriptions")) { var o = k.item("descriptions"); if (typeCast(JsonDictionaryObject.$, o) !== null) { var p = o; var q = p.e(); for (var r = 0; r < q.length; r++) { var s = q[r]; var t = p.item(s); var u = b(s); if (u == null) { continue; } j = u; var v = false; var w = this.bl(); if (w != null) { v = true; } var x = null; if (this.isProceedOnErrorEnabled) { try { x = i.d(this.context, t, v, w, false); } catch (y) { return; } } else { x = i.d(this.context, t, v, w, false); } if (x.result == null && !this.allowNullForRemove) { continue; } if (f) { if (!this.bc.containsKey(u)) { var z = null; if (this.isProceedOnErrorEnabled) { try { z = i.d(this.context, t, v, w, true); } catch (aa) { return; } } else { z = i.d(this.context, t, v, w, true); } this.ee(z.result, u, d, true, false, m, n); m = null; var ab = c(s); var ac = this.bc.item(u); this.dj(this.ax.item(u), ab, ac, u); } } this.ee(x.result, u, d, e, false, m, n); m = null; } } } if (k.g("refs") && j != null) { var ad = k.item("refs"); var ae = this.aj(ad); if (!ae && typeCast(JsonDictionaryObject.$, ad) !== null) { var af = ad; var ag = af.e(); for (var ah = 0; ah < ag.length; ah++) { var ai = ag[ah]; var aj = af.item(ai); if (typeCast(JsonDictionaryValue.$, aj) !== null) { var ak = aj; this.provideRefValue(j, ai, ak.value); } else if (typeCast(JsonDictionaryArray.$, aj) !== null) { var al = aj; var am = this.a(al); this.provideRefValue(j, ai, am); } else { var an = this.b7(aj); this.provideRefValue(j, ai, an); } } } } if (k.g("modules") && j != null) { var ao = k.item("modules"); this.ag(ao); } if (k.g("strings") && j != null) { var ap = k.item("strings"); this.an(ap); } if (k.g("onInit") && j != null) { var aq = k.item("onInit"); this.ah(aq); } if (k.g("onViewInit") && j != null) { var ar = k.item("onViewInit"); this.ai(ar); } } }; ComponentRenderer.prototype.provideRefValueFromJson = function (a, b, c) { var d = b; var e = new JsonDictionaryParser(); var f = e.parse(c); if (typeCast(JsonDictionaryValue.$, f) !== null) { var g = f; this.provideRefValue(a, d, g.value); } else if (typeCast(JsonDictionaryArray.$, f) !== null) { var h = f; var i = this.a(h); this.provideRefValue(a, d, i); } else { var j = this.b7(f); this.provideRefValue(a, d, j); } }; ComponentRenderer.prototype.addMemberPathTransformer = function (a) { this.bf.add(a); }; ComponentRenderer.prototype.removeMemberPathTransformer = function (a) { this.bf.remove(a); }; ComponentRenderer.prototype.addReferenceResolver = function (a) { this.bh.add(a); }; ComponentRenderer.prototype.removeReferenceResolver = function (a) { this.bh.remove(a); }; ComponentRenderer.prototype.e = function (a) { if (this.bh.count == 0) { return null; } var b = new ComponentRendererReferenceResolverEventArgs(); for (var c = 0; c < this.bh.count; c++) { this.bh._inner[c](a, b); } return b; }; ComponentRenderer.prototype.bl = function () { var _this = this; if (this.bf.count > 0) { return function (a) { var b = a; for (var c = 0; c < _this.bf.count; c++) { b = _this.bf._inner[c](b); } return b; }; } return null; }; ComponentRenderer.prototype.aj = function (a) { return false; }; ComponentRenderer.prototype.ag = function (a) { return false; }; ComponentRenderer.prototype.an = function (a) { return false; }; ComponentRenderer.prototype.ah = function (a) { return false; }; ComponentRenderer.prototype.ai = function (a) { return false; }; ComponentRenderer.prototype.cy = function (a, b, c) { var d = a; if (c != null) { d = c.k(b); } else { if (TypeDescriptionMetadata.shouldCamelize(b)) { d = TypeDescriptionMetadata.camelize(d); } } if (stringEndsWith(d, "Ref")) { d = d.substr(0, d.length - ("Ref").length); } return d; }; ComponentRenderer.prototype.dj = function (a, b, c, d) { var e_3, _a; if (!c.b(b)) { c.k(d, this.ax.item(d).g, b, this.ax.item(d), runOn(this, this.dx), -1); } try { for (var _b = __values(fromEnum(a.f())), _c = _b.next(); !_c.done; _c = _b.next()) { var e = _c.value; this.dk(this.cy(e.c, ComponentRenderer.platform, e.a), e.b, b, c, d, a.g); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_3) throw e_3.error; } } }; ComponentRenderer.prototype.dk = function (a, b, c, d, e, f) { var e_4, _a; var _this = this; if (typeCast(DescriptionTreeNode.$, b) !== null) { var g = b; var h = this.adapter.getPropertyValue(c, a); if (!d.b(h) && !d.a(g.g)) { d.k(e, g.g, h, g, runOn(this, this.dx), f); } try { for (var _b = __values(fromEnum(g.f())), _c = _b.next(); !_c.done; _c = _b.next()) { var i = _c.value; this.dk(a + "." + this.cy(i.c, ComponentRenderer.platform, i.a), i.b, c, d, e, g.g); } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_4) throw e_4.error; } } } if (typeCast(Array_$type, b) !== null) { var j_1 = new Dictionary$2(Number_$type, DescriptionTreeNode.$, 0); var k_1 = 0; var l = b.length; var o = b; for (var n = 0; n < o.length; n++) { var m = o[n]; if (typeCast(DescriptionTreeNode.$, m) !== null) { var p = m; j_1.item(k_1, p); } k_1++; } var q = this.adapter.getPropertyValue(c, a); k_1 = 0; this.adapter.forPropertyValueItem(c, a, function (r) { var e_5, _a; if (j_1.containsKey(k_1)) { var s = j_1.item(k_1); if (!d.b(r) && !d.a(s.g)) { d.k(e, s.g, r, s, runOn(_this, _this.dx), f); } try { for (var _b = __values(fromEnum(s.f())), _c = _b.next(); !_c.done; _c = _b.next()) { var t = _c.value; _this.dk(a + "." + t.c, t.b, c, d, e, s.g); } } catch (e_5_1) { e_5 = { error: e_5_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_5) throw e_5.error; } } } k_1++; }); if (l > 0 && k_1 == 0) { var r_1 = this.c3(a); this.adapter.forPropertyValueItem(c, r_1, function (s) { var e_6, _a; if (j_1.containsKey(k_1)) { var t = j_1.item(k_1); if (!d.b(s) && !d.a(t.g)) { d.k(e, t.g, s, t, runOn(_this, _this.dx), f); } try { for (var _b = __values(fromEnum(t.f())), _c = _b.next(); !_c.done; _c = _b.next()) { var u = _c.value; _this.dk(r_1 + "." + u.c, u.b, c, d, e, t.g); } } catch (e_6_1) { e_6 = { error: e_6_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_6) throw e_6.error; } } } k_1++; }); } } }; ComponentRenderer.prototype.c3 = function (a) { var b = a.lastIndexOf('.'); var c = null; var d = a; if (b > 0) { c = a.substr(0, b); d = a.substr(b + 1); } d = "actual" + this.c0(d); if (c != null) { return c + "." + d; } return d; }; ComponentRenderer.prototype.c0 = function (a) { return a.substr(0, 1).toUpperCase() + a.substr(1); }; ComponentRenderer.prototype.a = function (a) { var b = new Array(a.items.length); for (var c = 0; c < a.items.length; c++) { var d = this.b7(a.items[c]); b[c] = d; } return b; }; ComponentRenderer.prototype.b7 = function (a) { if (a == null) { return null; } var b = {}; var dict_ = b; var c = a.e(); for (var d = 0; d < c.length; d++) { var key_ = c[d]; if (typeCast(JsonDictionaryObject.$, a.item(key_)) !== null) { var val_ = this.b7(a.item(key_)); dict_[key_] = val_; } else if (typeCast(JsonDictionaryArray.$, a.item(key_)) !== null) { var val_ = this.a(a.item(key_)); dict_[key_] = val_; } else { var val_ = a.item(key_).value; dict_[key_] = val_; } } return dict_; }; Object.defineProperty(ComponentRenderer.prototype, "bc", { get: function () { return this.a8; }, enumerable: false, configurable: true }); ComponentRenderer.prototype.cleanup = function (a, b) { this.bn = a; this.ee(null, a, false, false, b, null, 0); }; ComponentRenderer.prototype.render = function (a, b) { this.ee(a, b, false, false, false, null, 0); }; ComponentRenderer.prototype.ee = function (a, b, c, d, e, f, g) { var _this = this; if (!this.a8.containsKey(b)) { this.a8.item(b, new ContainerState()); this.a8.item(b).i = b; } this.a2.item(b, a); this.a3.item(b, c); this.a4.item(b, d); this.a1.item(b, e); this.az.item(b, f); this.a0.item(b, g); this.dt(b, function () { return _this.ec(b); }); }; ComponentRenderer.prototype.dt = function (a, b) { this.adapter.onUIThread(a, b); }; ComponentRenderer.prototype.ec = function (a) { var e_7, _a, e_8, _b, e_9, _c, e_10, _d; var _this = this; if (this.a2.containsKey(a)) { var b = this.a3.containsKey(a) ? this.a3.item(a) : false; var c = this.a4.containsKey(a) ? this.a4.item(a) : false; var d = this.a2.item(a); var e = this.az.containsKey(a) ? this.az.item(a) : null; var f = this.a0.containsKey(a) ? this.a0.item(a) : 0; this.a2.removeItem(a); var g = DescriptionTreeBuilder.createTreeWithOptions(this.context, d, this.preserveKeyOrder); var h = null; if (this.ax.containsKey(a)) { h = this.ax.item(a); } var i = DescriptionTreeReconciler.c(h, g, b); if (!c && b) { g = h.b(); DescriptionTreeReconciler.a(h, i); var j = h; h = g; g = j; i = DescriptionTreeReconciler.c(h, g, false); } if (c) { var k = DescriptionTreeReconciler.a(h, i); if (!this.a8.containsKey(a)) { this.a8.addItem(a, ((function () { var $ret = new ContainerState(); $ret.i = a; return $ret; })())); } var l_1 = this.a8.item(a); if (k.a.count > 0) { try { for (var _e = __values(fromEnum(k.a)), _f = _e.next(); !_f.done; _f = _e.next()) { var m = _f.value; if (l_1.a(m)) { var n = l_1.j(m); this.dh(a, n, l_1); } } } catch (e_7_1) { e_7 = { error: e_7_1 }; } finally { try { if (_f && !_f.done && (_a = _e.return)) _a.call(_e); } finally { if (e_7) throw e_7.error; } } } if (k.c.count > 0) { try { for (var _g = __values(fromEnum(k.c)), _h = _g.next(); !_h.done; _h = _g.next()) { var o = _h.value; var p = this.ce(a, l_1, o); var q = this.adapter.getPropertyValue(p, o.j); if (q != null) { if (!l_1.b(q)) { var r = o.g; if (typeCast(DescriptionTreeNode.$, r) !== null) { var s = r.g; l_1.k(a, s, q, r, runOn(this, this.dx), o.c.g); } } } } } catch (e_8_1) { e_8 = { error: e_8_1 }; } finally { try { if (_h && !_h.done && (_b = _g.return)) _b.call(_g); } finally { if (e_8) throw e_8.error; } } } if (k.d.count > 0) { try { for (var _j = __values(fromEnum(k.d)), _k = _j.next(); !_k.done; _k = _j.next()) { var t = _k.value; var u = t.g; if (u != null) { if (!l_1.b(u)) { var v = t.g; if (typeCast(DescriptionTreeNode.$, v) !== null) { var w = v.g; this.ax.item(a, v); } } } } } catch (e_9_1) { e_9 = { error: e_9_1 }; } finally { try { if (_k && !_k.done && (_c = _j.return)) _c.call(_j); } finally { if (e_9) throw e_9.error; } } } if (k.b.count > 0) { var _loop_1 = function (x) { var y = x.c.a(x.j).b; if (y == null) { return "continue"; } var z = new Dictionary$2(String_$type, DescriptionTreeNode.$, 0); for (var aa = 0; aa < y.length; aa++) { var ab = y[aa]; if (typeCast(DescriptionTreeNode.$, ab) !== null) { var ac = ab; if (ac.c("Name")) { z.item(ac.a("Name").b, ac); } } } if (z.count == 0) { return "continue"; } var ad = this_1.ce(a, l_1, x); var ae = this_1.adapter.getPropertyValue(ad, x.j); if (ae != null) { var af_1 = 0; this_1.adapter.forPropertyValueItem(ad, x.j, function (ag) { if (z.containsKey(_this.adapter.getPropertyValue(ag, "Name").toString())) { if (!l_1.b(ag)) { var ah = z.item(_this.adapter.getPropertyValue(ag, "Name").toString()); if (typeCast(DescriptionTreeNode.$, ah) !== null) { var ai = ah.g; l_1.k(a, ai, ag, ah, runOn(_this, _this.dx), x.c.g); } } } af_1++; }); } }; var this_1 = this; try { for (var _l = __values(fromEnum(k.b)), _m = _l.next(); !_m.done; _m = _l.next()) { var x = _m.value; _loop_1(x); } } catch (e_10_1) { e_10 = { error: e_10_1 }; } finally { try { if (_m && !_m.done && (_d = _l.return)) _d.call(_l); } finally { if (e_10) throw e_10.error; } } } } else { this.ax.item(a, g); } if (!c) { if (e != null && this.w(e)) { var ag_1 = this.bb.item(e); if (ag_1 != null) { var ah = GlobalAnimationState.d.i(); if (f > 0) { GlobalAnimationState.d.n(function (ai) { return ag_1(ai); }, ah, f); } else { GlobalAnimationState.d.m(function () { return ag_1(false); }, ah); } } } this.ed(a, i); } if (this.a1.item(a)) { this.ea(a); if (this.a8.containsKey(a)) { this.a8.removeItem(a); } } } if (this.bn != null) { if (this.a2.containsKey(this.bn)) { this.a2.removeItem(this.bn); } if (this.a3.containsKey(this.bn)) { this.a3.removeItem(this.bn); } if (this.a4.containsKey(this.bn)) { this.a4.removeItem(this.bn); } if (this.a1.containsKey(this.bn)) { this.a1.removeItem(this.bn); } if (this.ax.containsKey(this.bn)) { this.ax.removeItem(this.bn); } if (this.a5.containsKey(this.bn)) { this.a5.removeItem(this.bn); } if (this.ay.containsKey(this.bn)) { this.ay.removeItem(this.bn); } if (this.aw.containsKey(this.bn)) { this.aw.removeItem(this.bn); } if (this.a0.containsKey(this.bn)) { this.a0.removeItem(this.bn); } if (this.az.containsKey(this.bn)) { this.az.removeItem(this.bn); } this.bn = null; } }; ComponentRenderer.prototype.getTargetValue = function (a, b, c) { var d = this.context.getMetadata(a, this.c0(b)); var e = d.k(ComponentRenderer.platform); return this.adapter.getPropertyValue(c, e); }; ComponentRenderer.prototype.setTargetValue = function (a, b, c, d, e) { var f = this.context.getMetadata(a, this.c0(b)); var g = f.k(ComponentRenderer.platform); this.adapter.setPropertyValue(c, g, f, d, e, null); }; ComponentRenderer.prototype.executeMethod = function (a, b, c) { var _this = this; var d = new JsonDictionaryParser(); var e = d.parse(b); if (!this.a8.containsKey(a)) { this.a8.item(a, new ContainerState()); this.a8.item(a).i = a; } var f = this.a8.item(a); var g = new DescriptionSerializer(); g.h = this.isProceedOnErrorEnabled; g.g = this.at(); var h = this.ax.item(a); var i = null; var j = new List$1(Base.$, 0); var k = new List$1(TypeDescriptionMetadata.$, 0); if (typeCast(JsonDictionaryObject.$, e) !== null) { var l = null; var m = e; if (m.g("targetRef")) { l = this.cw(m, "targetRef"); } var n = null; if (m.g("methodName")) { n = this.cw(m, "methodName"); } if (l != null) { if (this.a9.containsKey(l)) { i = this.a9.item(l); } } else { i = f.j(h.g); } if (m.g("args")) { var o = m.item("args"); for (var p = 0; p < o.items.length; p++) { var q = o.items[p]; var r = this.h(h, q, g); var s = null; if (typeCast(DescriptionTreeNode.$, r.g) !== null && r.g.i == "EmbeddedRef") { s = this.cg(a, r.g); } else { s = this.cb(r, a, f); } if (r.d.knownType == 8 && r.d.specificType == "string") { s = this.bw(r.d.specificExternalType, s, r.d); } j.add1(s); k.add(r.d); } } var t_1 = null; if (m.g("return")) { var u = m.item("return"); var v = this.h(h, u, g); t_1 = v.d; } this.adapter.executeMethod(i, n, j.toArray(), k.toArray(), function (w) { var x = _this.c1(w, t_1); c(x); }); } }; ComponentRenderer.prototype.cg = function (a, b) { if (b.i == "EmbeddedRef") { var c = "uuid"; var d = null; for (var e = 0; e < b.f().count; e++) { if (b.f()._inner[e].c == "RefType") { c = b.f()._inner[e].b; } if (b.f()._inner[e].c == "Value") { d = b.f()._inner[e].b; } } if (d != null) { for (var f = 0; f < this.be.count; f++) { var g = this.be._inner[f](a, c, d); if (g != null) { return g; } } if (c == "name") { var h = d; if (this.a9.containsKey(h)) { return this.a9.item(h); } if (this.bb.containsKey(h)) { return this.bb.item(h); } } return null; } } return null; }; ComponentRenderer.bk = function (a) { if (typeCast(Date_$type, a) !== null) { return a.getTime(); } if (a == null) { return 0; } return a; }; ComponentRenderer.prototype.c1 = function (a, b) { var _this = this; var c = new JsonDictionaryObject(); c.item("knownType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = EnumUtil.getName(TypeDescriptionWellKnownType_$type, b.knownType); return $ret; })())); if (b.specificType != null) { c.item("specificType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = b.specificType; return $ret; })())); } if (b.specificExternalType != null) { c.item("specificExternalType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = b.specificExternalType; return $ret; })())); } if (b.collectionElementType != null) { c.item("collectionElementType", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = b.collectionElementType; return $ret; })())); } switch (b.knownType) { case 0: break; case 1: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 0; $ret.value = ComponentRenderer.bk(a); return $ret; })())); break; case 2: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = a != null ? a.toString() : null; return $ret; })())); break; case 3: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = a != null ? a.toString() : null; return $ret; })())); break; case 4: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.ch(a); return $ret; })())); break; case 5: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.cj(a); return $ret; })())); break; case 6: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.ci(a); return $ret; })())); break; case 7: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 1; $ret.value = a; return $ret; })())); break; case 8: break; case 9: break; case 10: break; case 11: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.cm(a); return $ret; })())); break; case 12: c.item("result", this.co(a)); break; case 13: break; case 14: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.cn(a); return $ret; })())); break; case 15: break; case 16: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.ck(a); return $ret; })())); break; case 17: break; case 18: break; case 19: break; case 20: break; case 21: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.cp(a); return $ret; })())); break; case 22: break; case 23: c.item("result", ((function () { var $ret = new JsonDictionaryValue(); $ret.e = 2; $ret.value = _this.cl(a); return $ret; })())); break; } return c.b(); }; ComponentRenderer.prototype.cl = function (a) { return this.adapter.serializeDoubleCollection(a); }; ComponentRenderer.prototype.cp = function (a) { return this.adapter.serializeTimespan(a); }; ComponentRenderer.prototype.ck = function (a) { return this.adapter.serializeColorCollection(a); }; ComponentRenderer.prototype.cn = function (a) { return this.adapter.ser