igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
1,359 lines (1,358 loc) • 67.1 kB
JavaScript
/*
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 { Base, IEnumerable_$type, fromEnum, typeCast, Date_$type, Boolean_$type, Array_$type, runOn, Number_$type, Delegate_$type, String_$type, markType } from "./type";
import { TypeDescriptionContext } from "./TypeDescriptionContext";
import { TypeDescriptionCleanups } from "./TypeDescriptionCleanups";
import { Dictionary$2 } from "./Dictionary$2";
import { Description } from "./Description";
import { DescriptionTreeNode } from "./DescriptionTreeNode";
import { Queue$1 } from "./Queue$1";
import { DescriptionTreeAction } from "./DescriptionTreeAction";
import { List$1 } from "./List$1";
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 { Tuple$2 } from "./Tuple$2";
import { DescriptionRefTargetInfo } from "./DescriptionRefTargetInfo";
import { NotImplementedException } from "./NotImplementedException";
import { ComponentRendererAdapter } from "./ComponentRendererAdapter";
import { stringIsNullOrEmpty, stringStartsWith, stringEndsWith } from "./string";
/**
* @hidden
*/
export let ComponentRenderer = /*@__PURE__*/ (() => {
class ComponentRenderer extends Base {
constructor() {
super();
this._adapter = null;
this._context = null;
this._isProceedOnErrorEnabled = false;
this.i = null;
this.j = null;
this.aw = new Dictionary$2(Base.$, Description.$, 0);
this.ax = new Dictionary$2(Base.$, Boolean_$type, 0);
this.ay = new Dictionary$2(Base.$, Boolean_$type, 0);
this.av = new Dictionary$2(Base.$, Boolean_$type, 0);
this.at = new Dictionary$2(Base.$, DescriptionTreeNode.$, 0);
this.a1 = new Dictionary$2(Base.$, ContainerState.$, 0);
this.az = new Dictionary$2(Base.$, Queue$1.$.specialize(Queue$1.$.specialize(DescriptionTreeAction.$)), 0);
this.au = new Dictionary$2(Base.$, List$1.$.specialize(Delegate_$type), 0);
this.as = new Dictionary$2(Base.$, Boolean_$type, 0);
this.a0 = new Dictionary$2(String_$type, DescriptionRef.$, 0);
this.a2 = new Dictionary$2(String_$type, Base.$, 0);
this.a4 = new Dictionary$2(String_$type, Base.$, 0);
this.a8 = new List$1(Delegate_$type, 0);
this.a3 = new Dictionary$2(String_$type, List$1.$.specialize(Delegate_$type), 0);
this.a6 = new List$1(Delegate_$type, 0);
this.a7 = new List$1(Delegate_$type, 0);
this._shouldNamespaceSystemRefValues = false;
let a = this.h();
this.adapter = a;
let adapter_ = this.adapter;
let 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.i = new TypeDescriptionPropretyTransforms();
this.j = new TypeDescriptionCleanups();
}
static get defaultInstance() {
return ComponentRenderer._defaultInstance;
}
static set defaultInstance(a) {
ComponentRenderer._defaultInstance = a;
}
get adapter() {
return this._adapter;
}
set adapter(a) {
this._adapter = a;
}
get context() {
return this._context;
}
set context(a) {
this._context = a;
}
get isProceedOnErrorEnabled() {
return this._isProceedOnErrorEnabled;
}
set isProceedOnErrorEnabled(a) {
this._isProceedOnErrorEnabled = a;
}
h() {
return (new ComponentRendererAdapter());
}
toJson(a) {
let b = new DescriptionSerializerBuilder();
let c = new DescriptionSerializer();
b.f("{");
b.i();
b.f("\"descriptions\": {");
b.i();
let d = true;
for (let e of fromEnum(this.at.keys)) {
if (d) {
d = false;
}
else {
b.f(",");
}
let f = e;
let g = this.at.item(e);
let h = "root";
h = a(f);
if (stringIsNullOrEmpty(h)) {
h = "root";
}
b.e("\"" + h + "\"");
b.e(": ");
c.t(this.context, g, b);
}
b.f("");
b.h();
b.e("}");
if (this.a4.count > 0) {
b.e(",");
}
b.f("");
if (this.a4.count > 0) {
d = true;
b.f("refs: {");
b.i();
for (let i of fromEnum(this.a4.keys)) {
if (!this.o(i, this.a4.item(i))) {
continue;
}
if (d) {
d = false;
}
else {
b.f(",");
}
this.dh(b, i, this.a4.item(i));
}
b.f("");
b.h();
b.f("}");
}
b.h();
b.f("}");
return b.toString();
}
dh(a, b, c) {
a.e("\"" + b + "\": ");
this.di(a, c);
}
di(a, b) {
if (this.x(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) {
let 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.u(b)) {
a.f("[");
a.i();
let c = new DataSourceLocalDataProvider();
c.dataSource = b;
for (let d = 0; d < c.actualCount; d++) {
if (d > 0) {
a.f(",");
}
this.dg(a, c, d);
}
a.f("");
a.h();
a.e("]");
}
else {
let e = [b];
let f = new DataSourceLocalDataProvider();
f.dataSource = e;
this.dg(a, f, 0);
}
}
}
x(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;
}
u(a) {
if (typeCast(Array_$type, a) !== null) {
return true;
}
if (typeCast(IEnumerable_$type, a) !== null) {
return true;
}
return false;
}
dg(a, b, c) {
a.f("{");
a.i();
let d = b.actualSchema;
for (let e = 0; e < d.propertyNames.length; e++) {
if (e > 0) {
a.f(",");
}
let f = d.propertyNames[e];
if (stringStartsWith(f, "[")) {
f = f.substr(1, f.length - 2);
}
a.e("\"" + f + "\"");
a.e(": ");
let 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:
let v_ = g;
a.e("\"" + (v_.toJSON()) + "\"");
break;
case 11:
this.di(a, g);
break;
}
}
a.h();
a.f("}");
}
o(a, b) {
if (b == null) {
return true;
}
let v_ = b;
if ((typeof v_ === 'function')) {
return false;
}
return true;
}
createObjectFromJson(a, b) {
let c = new JsonDictionaryParser();
let d = c.parse(a);
let e = new DescriptionSerializer();
let f = false;
let g = e.d(this.context, d, f, null, false);
if (g.result == null) {
return null;
}
let h = DescriptionTreeBuilder.createTree(this.context, g.result);
let i = this.a1.item(b);
if (h.c("Type")) {
let j = h.a("Type").b;
return this.bu(j, h, b, i, true, -1, null);
}
else {
return this.bt(typeCast(JsonDictionaryObject.$, d));
}
}
loadJson(a, b) {
this.cs(a, b, null, false, false, false);
}
loadJsonOverlay(a, b, c) {
this.cs(a, b, c, true, false, true);
}
loadJsonDelta(a, b, c) {
this.cs(a, b, null, true, c, false);
}
ap() {
return false;
}
cu(a) {
}
cs(a, b, c, d, e, f) {
let g = new JsonDictionaryParser();
let h = g.parse(a);
let i = new DescriptionSerializer();
i.h = this.isProceedOnErrorEnabled;
i.g = this.ap();
let j = null;
if (typeCast(JsonDictionaryObject.$, h) !== null) {
let k = h;
if (k.g("skipAlterDataCasing")) {
let l = k.item("skipAlterDataCasing");
if (l.value) {
this.cu(true);
}
}
else {
this.cu(false);
}
if (k.g("descriptions")) {
let m = k.item("descriptions");
if (typeCast(JsonDictionaryObject.$, m) !== null) {
let n = m;
let o = n.e();
for (let p = 0; p < o.length; p++) {
let q = o[p];
let r = n.item(q);
let s = b(q);
if (s == null) {
continue;
}
j = s;
let t = false;
let u = this.ba();
if (u != null) {
t = true;
}
let v = null;
if (this.isProceedOnErrorEnabled) {
try {
v = i.d(this.context, r, t, u, false);
}
catch (w) {
return;
}
}
else {
v = i.d(this.context, r, t, u, false);
}
if (v.result == null) {
continue;
}
if (f) {
if (!this.a5.containsKey(s)) {
let x = null;
if (this.isProceedOnErrorEnabled) {
try {
x = i.d(this.context, r, t, u, true);
}
catch (y) {
return;
}
}
else {
x = i.d(this.context, r, t, u, true);
}
this.dd(x.result, s, d, true, false);
let z = c(q);
let aa = this.a5.item(s);
this.co(this.at.item(s), z, aa, s);
}
}
this.dd(v.result, s, d, e, false);
}
}
}
if (k.g("refs") && j != null) {
let ab = k.item("refs");
let ac = this.af(ab);
if (!ac && typeCast(JsonDictionaryObject.$, ab) !== null) {
let ad = ab;
let ae = ad.e();
for (let af = 0; af < ae.length; af++) {
let ag = ae[af];
let ah = ad.item(ag);
if (typeCast(JsonDictionaryValue.$, ah) !== null) {
let ai = ah;
this.provideRefValue(j, ag, ai.value);
}
else if (typeCast(JsonDictionaryArray.$, ah) !== null) {
let aj = ah;
let ak = this.a(aj);
this.provideRefValue(j, ag, ak);
}
else {
let al = this.bt(ah);
this.provideRefValue(j, ag, al);
}
}
}
}
if (k.g("modules") && j != null) {
let am = k.item("modules");
this.ac(am);
}
if (k.g("strings") && j != null) {
let an = k.item("strings");
this.aj(an);
}
if (k.g("onInit") && j != null) {
let ao = k.item("onInit");
this.ad(ao);
}
if (k.g("onViewInit") && j != null) {
let ap = k.item("onViewInit");
this.ae(ap);
}
}
}
provideRefValueFromJson(a, b, c) {
let d = b;
let e = new JsonDictionaryParser();
let f = e.parse(c);
if (typeCast(JsonDictionaryValue.$, f) !== null) {
let g = f;
this.provideRefValue(a, d, g.value);
}
else if (typeCast(JsonDictionaryArray.$, f) !== null) {
let h = f;
let i = this.a(h);
this.provideRefValue(a, d, i);
}
else {
let j = this.bt(f);
this.provideRefValue(a, d, j);
}
}
ba() {
return null;
}
af(a) {
return false;
}
ac(a) {
return false;
}
aj(a) {
return false;
}
ad(a) {
return false;
}
ae(a) {
return false;
}
b7(a, b, c) {
let d = a;
if (c != null) {
d = c.j(b);
}
else {
if (TypeDescriptionMetadata.shouldCamelize(b)) {
d = TypeDescriptionMetadata.camelize(d);
}
}
if (stringEndsWith(d, "Ref")) {
d = d.substr(0, d.length - ("Ref").length);
}
return d;
}
co(a, b, c, d) {
if (!c.b(b)) {
c.k(d, this.at.item(d).g, b, this.at.item(d), runOn(this, this.cz), -1);
}
for (let e of fromEnum(a.f())) {
this.cp(this.b7(e.c, ComponentRenderer.platform, e.a), e.b, b, c, d, a.g);
}
}
cp(a, b, c, d, e, f) {
if (typeCast(DescriptionTreeNode.$, b) !== null) {
let g = b;
let h = this.adapter.getPropertyValue(c, a);
if (!d.b(h) && !d.a(g.g)) {
d.k(e, g.g, h, g, runOn(this, this.cz), f);
}
for (let i of fromEnum(g.f())) {
this.cp(a + "." + this.b7(i.c, ComponentRenderer.platform, i.a), i.b, c, d, e, g.g);
}
}
if (typeCast(Array_$type, b) !== null) {
let j = new Dictionary$2(Number_$type, DescriptionTreeNode.$, 0);
let k = 0;
let l = b.length;
let o = b;
for (let n = 0; n < o.length; n++) {
let m = o[n];
if (typeCast(DescriptionTreeNode.$, m) !== null) {
let p = m;
j.item(k, p);
}
k++;
}
let q = this.adapter.getPropertyValue(c, a);
k = 0;
this.adapter.forPropertyValueItem(c, a, (r) => {
if (j.containsKey(k)) {
let s = j.item(k);
if (!d.b(r) && !d.a(s.g)) {
d.k(e, s.g, r, s, runOn(this, this.cz), f);
}
for (let t of fromEnum(s.f())) {
this.cp(a + "." + t.c, t.b, c, d, e, s.g);
}
}
k++;
});
if (l > 0 && k == 0) {
let r = this.cb(a);
this.adapter.forPropertyValueItem(c, r, (s) => {
if (j.containsKey(k)) {
let t = j.item(k);
if (!d.b(s) && !d.a(t.g)) {
d.k(e, t.g, s, t, runOn(this, this.cz), f);
}
for (let u of fromEnum(t.f())) {
this.cp(r + "." + u.c, u.b, c, d, e, t.g);
}
}
k++;
});
}
}
}
cb(a) {
let b = a.lastIndexOf('.');
let c = null;
let d = a;
if (b > 0) {
c = a.substr(0, b);
d = a.substr(b + 1);
}
d = "actual" + this.b9(d);
if (c != null) {
return c + "." + d;
}
return d;
}
b9(a) {
return a.substr(0, 1).toUpperCase() + a.substr(1);
}
a(a) {
let b = new Array(a.items.length);
for (let c = 0; c < a.items.length; c++) {
let d = this.bt(a.items[c]);
b[c] = d;
}
return b;
}
bt(a) {
if (a == null) {
return null;
}
let b = {};
let dict_ = b;
let c = a.e();
for (let d = 0; d < c.length; d++) {
let key_ = c[d];
if (typeCast(JsonDictionaryObject.$, a.item(key_)) !== null) {
let val_ = this.bt(a.item(key_));
dict_[key_] = val_;
}
else if (typeCast(JsonDictionaryArray.$, a.item(key_)) !== null) {
let val_ = this.a(a.item(key_));
dict_[key_] = val_;
}
else {
let val_ = a.item(key_).value;
dict_[key_] = val_;
}
}
return dict_;
}
get a5() {
return this.a1;
}
cleanup(a, b) {
this.dd(null, a, false, false, b);
}
render(a, b) {
this.dd(a, b, false, false, false);
}
dd(a, b, c, d, e) {
if (!this.a1.containsKey(b)) {
this.a1.item(b, new ContainerState());
this.a1.item(b).i = b;
}
this.aw.item(b, a);
this.ax.item(b, c);
this.ay.item(b, d);
this.av.item(b, e);
this.cv(b, () => this.db(b));
}
cv(a, b) {
this.adapter.onUIThread(a, b);
}
db(a) {
if (this.aw.containsKey(a)) {
let b = this.ax.containsKey(a) ? this.ax.item(a) : false;
let c = this.ay.containsKey(a) ? this.ay.item(a) : false;
let d = this.aw.item(a);
this.aw.removeItem(a);
let e = DescriptionTreeBuilder.createTree(this.context, d);
let f = null;
if (this.at.containsKey(a)) {
f = this.at.item(a);
}
let g = DescriptionTreeReconciler.c(f, e, b);
if (!c && b) {
e = f.b();
DescriptionTreeReconciler.a(f, g);
let h = f;
f = e;
e = h;
g = DescriptionTreeReconciler.c(f, e, false);
}
if (c) {
let i = DescriptionTreeReconciler.a(f, g);
if (!this.a1.containsKey(a)) {
this.a1.addItem(a, ((() => {
let $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
let j = this.a1.item(a);
if (i.a.count > 0) {
for (let k of fromEnum(i.a)) {
if (j.a(k)) {
let l = j.j(k);
this.cm(a, l, j);
}
}
}
if (i.c.count > 0) {
for (let m of fromEnum(i.c)) {
let n = this.bz(a, j, m);
let o = this.adapter.getPropertyValue(n, m.j);
if (o != null) {
if (!j.b(o)) {
let p = m.g;
if (typeCast(DescriptionTreeNode.$, p) !== null) {
let q = p.g;
j.k(a, q, o, p, runOn(this, this.cz), m.c.g);
}
}
}
}
}
if (i.d.count > 0) {
for (let r of fromEnum(i.d)) {
let s = r.g;
if (s != null) {
if (!j.b(s)) {
let t = r.g;
if (typeCast(DescriptionTreeNode.$, t) !== null) {
let u = t.g;
this.at.item(a, t);
}
}
}
}
}
if (i.b.count > 0) {
for (let v of fromEnum(i.b)) {
let w = v.c.a(v.j).b;
if (w == null) {
continue;
}
let x = new Dictionary$2(String_$type, DescriptionTreeNode.$, 0);
for (let y = 0; y < w.length; y++) {
let z = w[y];
if (typeCast(DescriptionTreeNode.$, z) !== null) {
let aa = z;
if (aa.c("Name")) {
x.item(aa.a("Name").b, aa);
}
}
}
if (x.count == 0) {
continue;
}
let ab = this.bz(a, j, v);
let ac = this.adapter.getPropertyValue(ab, v.j);
if (ac != null) {
let ad = 0;
this.adapter.forPropertyValueItem(ab, v.j, (ae) => {
if (x.containsKey(this.adapter.getPropertyValue(ae, "Name").toString())) {
if (!j.b(ae)) {
let af = x.item(this.adapter.getPropertyValue(ae, "Name").toString());
if (typeCast(DescriptionTreeNode.$, af) !== null) {
let ag = af.g;
j.k(a, ag, ae, af, runOn(this, this.cz), v.c.g);
}
}
}
ad++;
});
}
}
}
}
else {
this.at.item(a, e);
}
if (!c) {
this.dc(a, g);
}
if (this.av.item(a)) {
this.c9(a);
if (this.a1.containsKey(a)) {
this.a1.removeItem(a);
}
}
}
}
provideRefValue(a, b, c) {
this.cv(a, () => {
if (!this.a1.containsKey(a)) {
this.a1.addItem(a, ((() => {
let $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
let d = this.a1.item(a);
this.cz(a, b, c, true);
});
}
removeRefValue(a, b) {
this.cv(a, () => {
if (!this.a1.containsKey(a)) {
this.a1.addItem(a, ((() => {
let $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
let c = this.a1.item(a);
this.removeRefValueCore(a, b, true);
});
}
c9(a) {
let b = this.a1.item(a);
let c = new List$1(String_$type, 0);
for (let d of fromEnum(this.a0.keys)) {
if (this.a0.item(d).c == 0) {
c.add(d);
}
}
for (let e = 0; e < c.count; e++) {
let f = this.shouldNamespaceSystemRefValues;
this.shouldNamespaceSystemRefValues = false;
this.removeRefValueCore(a, c._inner[e], this.a4.containsKey(c._inner[e]));
this.shouldNamespaceSystemRefValues = f;
}
}
clearRefValues(a) {
this.cv(a, () => {
if (!this.a1.containsKey(a)) {
this.a1.addItem(a, ((() => {
let $ret = new ContainerState();
$ret.i = a;
return $ret;
})()));
}
let b = this.a1.item(a);
this.clearUserRefValues();
});
}
v(a) {
if (this.as.containsKey(a) && this.as.item(a)) {
return false;
}
if (this.az.containsKey(a) && this.az.item(a).count > 0) {
return false;
}
return true;
}
queueForIdle(a, b) {
this.cv(a, () => {
if (this.v(a)) {
b();
}
else {
if (!this.au.containsKey(a)) {
this.au.item(a, new List$1(Delegate_$type, 0));
}
this.au.item(a).add(b);
}
});
}
tryFlushIdleActions(a) {
if (this.v(a)) {
if (this.au.containsKey(a)) {
let b = new List$1(Delegate_$type, 1, this.au.item(a));
this.au.item(a).clear();
for (let c = 0; c < b.count; c++) {
b._inner[c]();
}
}
}
}
dc(a, b) {
let c = this.a1.item(a);
this.cw(a, c, b);
}
df(a, b) {
if (this.isProceedOnErrorEnabled) {
try {
this.cn(a, b, true);
}
catch (c) {
this.as.item(a, false);
}
}
else {
this.cn(a, b, true);
}
}
dl(a, b) {
if (this.isProceedOnErrorEnabled) {
try {
this.cn(a, b, false);
}
catch (c) {
this.as.item(a, false);
}
}
else {
this.cn(a, b, false);
}
}
cn(a, b, c) {
if (!c) {
if (this.as.containsKey(a) && this.as.item(a)) {
return;
}
}
this.as.item(a, true);
let d = true;
while (d && this.az.item(a).count > 0) {
while (this.az.item(a).count > 0 && this.az.item(a).c().count < 1) {
this.az.item(a).b();
}
if (this.az.item(a).count < 1) {
break;
}
let e = this.az.item(a).c();
while (e.count > 0) {
let f = e.b();
d = this.z(a, b, f);
if (!d) {
break;
}
}
}
if (d) {
this.as.item(a, false);
}
if (this.v(a)) {
this.tryFlushIdleActions(a);
}
}
cw(a, b, c) {
let d = new Queue$1(DescriptionTreeAction.$);
for (let e = 0; e < c.count; e++) {
d.g(c._inner[e]);
}
if (!this.az.containsKey(a)) {
this.az.addItem(a, new Queue$1(Queue$1.$.specialize(DescriptionTreeAction.$)));
}
this.az.item(a).g(d);
this.dl(a, b);
}
cx(a, b, c) {
for (let d = 0; d < c.count; d++) {
this.z(a, b, c._inner[d]);
}
}
z(a, b, c) {
switch (c.a) {
case 5: return this.aa(a, b, c);
case 2: return this.ab(a, b, c);
case 4: return this.ag(a, b, c);
case 3: return this.ah(a, b, c);
case 1: return this.ai(a, b, c);
case 0: return this.ak(a, b, c);
}
return true;
}
ak(a, b, c) {
let d = this.bz(a, b, c);
this.ar(a, b, c, d);
return true;
}
ar(a, b, c, d) {
let e = this.bw(c, a, b);
e = this.i.transform(ComponentRenderer.platform, e, c);
let f = false;
if (this.a8 != null && this.a8.count > 0) {
for (let g = 0; g < this.a8.count; g++) {
let h = this.a8._inner[g];
let i = this.b8(a, c);
if (h(i, d, e)) {
f = true;
}
}
}
if (c.j == "Type" || c.j == "type") {
f = true;
}
if (f) {
return true;
}
if (c.d != null && c.d.knownType == 9) {
this.ao(a, b, c.i(ComponentRenderer.platform), c.d, e, d);
}
else {
this.dj(a, b, c.i(ComponentRenderer.platform), c.d, e, c.h, d);
}
return true;
}
b8(a, b) {
let c = b.c;
let d = "";
if (c != this.at.item(a)) {
let e = this.b6(a, c);
d = e;
}
if (d.length > 0) {
d += ".";
}
d += b.j;
return d;
}
b6(a, b) {
if (b == null) {
return "";
}
let c = this.cc("", this.at.item(a), b);
if (c.c) {
return c.d;
}
return "";
}
cc(a, b, c) {
if (b == c) {
return new Tuple$2(Boolean_$type, String_$type, true, a);
}
if (a.length > 0) {
a += ".";
}
let d = b.f();
for (let e = 0; e < d.count; e++) {
let f = d._inner[e];
if (typeCast(DescriptionTreeNode.$, f.b) !== null) {
if (f.b.g == c.g) {
a += f.c;
return new Tuple$2(Boolean_$type, String_$type, true, a);
}
else {
let g = a + f.c;
let h = this.cc(g, f.b, c);
if (h.c) {
return h;
}
}
}
if (f.a != null && f.a.knownType == 9) {
let i = f.b;
for (let j = 0; j < i.length; j++) {
if (typeCast(DescriptionTreeNode.$, i[j]) !== null) {
let k = i[j];
if (k.g == c.g) {
a += f.c + "[" + j + "]";
return new Tuple$2(Boolean_$type, String_$type, true, a);
}
else {
let l = a + f.c + "[" + j + "]";
let m = this.cc(l, k, c);
if (m.c) {
return m;
}
}
}
}
}
}
return new Tuple$2(Boolean_$type, String_$type, false, a);
}
ao(a, b, c, d, e, f) {
if (this.a3.containsKey(c)) {
for (let g of fromEnum(this.a3.item(c))) {
g(c, f, e);
}
}
this.adapter.setOrUpdateCollectionOnTarget(a, c, d, this.context, f, e);
return true;
}
bw(a, b, c) {
if (a.d == null) {
return a.g;
}
switch (a.d.knownType) {
case 10: return this.bc(a, b, c);
case 7: return this.bd(a);
case 4: return this.be(a);
case 6: return this.bf(a);
case 9: return this.bc(a, b, c);
case 5: return this.bg(a);
case 16: return this.bh(a);
case 20: return this.b0(a, c);
case 22: return this.b3(a, c);
case 15: return null;
case 3: return this.bi(a);
case 19: return this.b1(a, c);
case 8: return this.bk(a, b, c);
case 13: return null;
case 18: return this.b2(a, c);
case 1: return this.bl(a);
case 11: return this.bm(a);
case 14: return this.bn(a);
case 12: return this.bo(a);
case 2: return this.bp(a);
case 21: return this.bq(a);
case 17: return this.br(a, b, c);
case 0: return null;
}
return null;
}
br(a, b, c) {
let d = this.bs(a.g, a, b, c);
return d;
}
bs(a, b, c, d) {
if (typeof a === 'string') {
if (stringStartsWith(a, "@d:")) {
let v_ = a.substr(3);
a = new Date(v_);
}
}
if (typeCast(Array_$type, a) !== null) {
let e = a;
let f = new Array(e.length);
for (let g = 0; g < e.length; g++) {
let h = this.bs(e[g], b, c, d);
f[g] = h;
}
a = f;
}
if (typeCast(DescriptionTreeNode.$, a) !== null) {
let i = a;
if (i.i == "EmbeddedRef") {
return this.bu(i.i, a, c, d, false, b.c.g, b.d);
}
}
return a;
}
bq(a) {
return a.g;
}
bp(a) {
return a.g != null ? a.g.toString() : null;
}
bo(a) {
let b = a.g;
let width_ = b.width;
let height_ = b.height;
let c = { width: width_, height: height_ };
return c;
}
bn(a) {
let b = a.g;
let top_ = b.top;
let left_ = b.left;
let width_ = b.width;
let height_ = b.height;
let c = { left: left_, top: top_, width: width_, height: height_ };
return c;
}
bm(a) {
let b = a.g;
let x_ = b.x;
let y_ = b.y;
let c = { x: x_, y: y_ };
return c;
}
bl(a) {
if (a.g == null) {
if (a.d != null && (a.d.specificType == "double" || a.d.specificType == "float")) {
return NaN;
}
return 0;
}
return a.g;
}
e(a, b) {
if (this.a0.containsKey(a)) {
let c = this.a0.item(a);
return c;
}
let d = new DescriptionRef(a);
this.a0.addItem(a, d);
return d;
}
b2(a, b) {
return a.g == null ? null : this.e(a.g, b);
}
bk(a, b, c) {
let d = a.d.specificType;
if (d == null) {
d = a.d.specificExternalType;
}
if (typeCast(DescriptionTreeNode.$, a.g) !== null) {
let e = a.g;
if (e.c("Type")) {
d = e.a("Type").b;
}
}
let f = this.bu(d, a.g, b, c, false, a.c.g, a.d);
return f;
}
b1(a, b) {
return a.g == null ? null : this.e(a.g, b);
}
bi(a) {
if (typeof a.g === 'string') {
let v_ = a.g;
a.g = new Date(v_);
}
return a.g;
}
b0(a, b) {
return a.g == null ? null : this.e(a.g, b);
}
b3(a, b) {
return a.g == null ? null : this.e(a.g, b);
}
b5(a) {
return a;
}
bh(a) {
let b = a.g;
if (b == null) {
return null;
}
let c = new Array(b.length);
for (let d = 0; d < b.length; d++) {
c[d] = this.b5(b[d]);
}
return c;
}
bg(a) {
return this.b5(a.g);
}
bf(a) {
let b = a.g;
if (b == null) {
return null;
}
let c = new Array(b.length);
for (let d = 0; d < b.length; d++) {
c[d] = this.b4(b[d]);
}
return c;
}
b4(a) {
return a;
}
be(a) {
return this.b4(a.g);
}
bd(a) {
return a.g;
}
addTargetPropertyUpdatingListener(a) {
this.a8.add(a);
}
removeTargetPropertyUpdatingListener(a) {
this.a8.remove(a);
}
addPropertyUpdatingListener(a, b) {
if (!this.a3.containsKey(a)) {
this.a3.addItem(a, new List$1(Delegate_$type, 0));
}
this.a3.item(a).add(b);
}
addReferenceLookupListener(a) {
this.a6.add(a);
}
removeReferenceLookupListener(a) {
this.a6.remove(a);
}
removePropertyUpdatingListener(a, b) {
if (this.a3.containsKey(a)) {
this.a3.item(a).remove(b);
if (this.a3.item(a).count == 0) {
this.a3.removeItem(a);
}
}
}
addNamespaceLookupListener(a) {
this.a7.add(a);
}
removeNamespaceLookupListener(a) {
this.a7.remove(a);
}
bc(a, b, c) {
if (a.g == null) {
return null;
}
let d = a.g;
let e = new List$1(Base.$, 0);
let f = a.d.specificType;
if (f == null) {
f = a.d.specificExternalType;
}
if (a.d.knownType == 9) {
f = a.d.collectionElementType;
if (f == null) {
f = a.d.specificExternalType;
}
}
for (let g = 0; g < d.length; g++) {
let h = f;
if (typeCast(DescriptionTreeNode.$, d[g]) !== null) {
let i = d[g];
if (i.c("Type")) {
h = i.a("Type").b;
}
}
let j = this.bu(h, d[g], b, c, false, a.c.g, a.d);
e.add1(j);
}
return e.toArray();
}
dj(a, b, c, d, e, f, g) {
if (typeCast(DescriptionRef.$, e) !== null) {
let h = e;
let i = false;
if (f != null && typeof f === 'string') {
if (this.r(f)) {
let j = this.f(f);
if (Base.equalsStatic(j, e)) {
i = true;
}
else {
j.j(a, g, c);
}
}
}
if (this.s(e)) {
let k = e;
if (k.e != null && k.e.length > 0 && this.a2.containsKey(k.e)) {
k.a = true;
}
e = this.by(e);
this.dk(g, c, d, e, f, k);
}
else {
this.adapter.onPendingRef(g, c, d, e);
}
let l = null;
l = (m, n) => {
let o = m;
if (o.e != null && o.e.length > 0 && this.a2.containsKey(o.e)) {
o.a = true;
}
let p = this.by(m);
this.dk(g, c, d, p, f, o);
};
if (!i) {
h.g(a, g, c, l);
}
return;
}
this.dk(g, c, d, e, f, null);
}
hasUserRef(a) {
return this.a4.containsKey(a);
}
get shouldNamespaceSystemRefValues() {
return this._shouldNamespaceSystemRefValues;
}
set shouldNamespaceSystemRefValues(a) {
this._shouldNamespaceSystemRefValues = a;
}
cz(a, b, c, d) {
let e = null;
if (d) {
if (this.a4.containsKey(b)) {
e = this.a4.item(b);
}
this.a4.item(b, c);
}
else {
if (this.shouldNamespaceSystemRefValues) {
let f = "";
if (this.a7 != null && this.a7.count > 0) {
for (let g = 0; g < this.a7.count; g++) {
f = this.a7._inner[g](a);
}
}
if (!stringIsNullOrEmpty(f)) {
b = f + "/" + b;
}
}
if (this.a2.containsKey(b)) {
e = this.a2.item(b);
}