function Ip(a){this.Init(a)}v("AdfDirtyStateService",Ip);z.l(Ip,z);Ip.da=function(){this.ww="_adfDirtyStateId";this.Qma="_autoGen_"};v("AdfDirtyStateService.InitClass",Ip.da);Ip.prototype.Init=function(a){Ip.f.Init.call(this);this.DZa=0;this.pH={};this.Mt={};this.uk={};this.OW=[];this.vH=this.FB=p;a.addEventListener(ia.tc,this.AWa,this);a.addEventListener(ia.Dd,this.gWa,this);a.addEventListener(zb.ga,this.sWa,this)};z.a("AdfDirtyStateService.prototype.Init",{Init:Ip.prototype.Init});
Ip.prototype.Cy=function(a){a=a instanceof J?a.e():a;B.s(a);return this.uk[a]===l};z.a("AdfDirtyStateService.prototype.isDirty",{Cy:Ip.prototype.Cy});Ip.prototype.Ofa=function(a){var b=[],d=F.c,e=p;if(a==n)for(var f in this.uk)a=d.j(f),a==n&&(delete this.uk[f],e=l),b.push(a);else{d=a.ce();f=0;for(var g=d.length;f<g;++f)a=d[f],this.Cy(a)&&b.push(a)}e&&Mz(this);return b};z.a("AdfDirtyStateService.prototype.getDirtyComponents",{Ofa:Ip.prototype.Ofa});
Ip.prototype.Pfa=function(a){if(a==n)return this.Ofa(n);var b=[],d=this.uk,e;for(e in d){var f=page.j(e);f?M.dha(f,a)&&b.push(f):delete d[e]}f=F.c.Vr();M.dha(f,a)&&b.push(f);Mz(this);return b};z.a("AdfDirtyStateService.prototype.getDirtyComponentsForElement",{Pfa:Ip.prototype.Pfa});Ip.prototype.T0=function(a){a+=":";for(var b in this.uk)if(xa.qS(b,a))return l;for(var d in this.Mt)if(xa.qS(d,a)&&Nz(this,d))return l;return p};z.a("AdfDirtyStateService.prototype.isNamingContainerDirty",{T0:Ip.prototype.T0});
Ip.prototype.SC=function(a){var b=n,b=a==n?F.c.w():a instanceof J?a instanceof AdfRichPopup?rc.Hu(a):M.Ib(a):a;B.ub(b);a=w.b.Yi(b);Oz(this,a);i=0;for(size=a.length;i<size;++i)if(b=a[i],b instanceof AdfUIEditableValue&&this.Cy(b))return l;i=0;for(size=a.length;i<size;++i)if(b=a[i],b=b.e(),Nz(this,b))return l;return p};z.a("AdfDirtyStateService.prototype.hasDirtyData",{SC:Ip.prototype.SC});Ip.prototype.us=function(a,b){b?(this.FB=l,this.uk[a]=l):(delete this.uk[a],Mz(this))};
z.a("AdfDirtyStateService.prototype.setDirty",{us:Ip.prototype.us});Ip.prototype.r8=function(a,b){var d=a.e();this.OW[d]=b};z.a("AdfDirtyStateService.prototype.__registerDirtyDataComponent",{r8:Ip.prototype.r8});Ip.prototype.uV=function(){var a=p,b;for(b in this.OW)if("always"==this.OW[b]){var d=F.c.j(b);d!=n&&(d=d.k(),d!=n&&d.gha()&&(a=l))}return a};z.a("AdfDirtyStateService.prototype.__alwaysDisplayDirtyDataWarning",{uV:Ip.prototype.uV});
Ip.prototype.i8=function(a){a=a.getSource();B.J(a,AdfUIEditableValue,"Expected an editable value component to be the source of a value change event");this.FB=this.uk[a.e()]=l};z.a("AdfDirtyStateService.prototype.__handleValueChangeEvent",{i8:Ip.prototype.i8});Ip.prototype.BA=function(){var a=this.uk;if(this.pP(F.c))for(var b in a)Pz(b);this.pH={};this.uk={};this.Mt={};this.vH=this.FB=p};z.a("AdfDirtyStateService.prototype.__resetState",{BA:Ip.prototype.BA});
Ip.prototype.IM=function(){return this.FB||this.vH};z.a("AdfDirtyStateService.prototype.__isPotentiallyDirty",{IM:Ip.prototype.IM});
Ip.prototype.W7=function(a,b){if(!(this.FB==p&&this.vH==p)){if(0==a.length)if(b)a=[""];else{this.BA();return}var d=w.b,e=p,f=this.pP(F.c),g={},h;for(h in this.uk)g[h]=l;for(h in this.Mt)g[h]=l;for(h in g)if(b==p||Lq(h)){for(var g=p,m=0,q=a.length;m<q;++m){var s=a[m];if(h==s){g=l;break}if(xa.qS(h,s+":")){g=l;break}}if(!g)for(m=d.getElementById(h);m!=n&&!g;){q=m.id;if(q!=n&&(g=-1<ya.indexOf(a,q),!g&&(q=M.Lf(m),q instanceof AdfRichPopup&&rc.Hu(q)==m))){m=M.Ib(q);continue}m=m.parentNode}g&&(e=l,f&&Pz(h),
delete this.uk[h],delete this.pH[h],delete this.Mt[h])}e&&Mz(this)}};z.a("AdfDirtyStateService.prototype.__dataCommitted",{W7:Ip.prototype.W7});Ip.prototype.l8=function(a,b){if(!this.pP(a))return p;var d=p,e=b.k();e&&e.CV&&(d=e.CV(b))&&this.us(b.e(),l);return d};z.a("AdfDirtyStateService.prototype.__isInputValueDirty",{l8:Ip.prototype.l8});function Mz(a){a.FB=p;a.vH=p;for(var b in a.uk){a.FB=l;break}for(b in a.Mt){a.vH=l;break}}
function Oz(a,b){for(var d=0,e=b.length;d<e;++d){var f=b[d];if(f instanceof AdfRichPopup){f=f.ce();Oz(a,f);for(var g=0,h=f.length;g<h;++g)b.push(f[g])}}}function Lq(a){a=F.c.j(a);return a instanceof AdfUIEditableValue&&a.getImmediate()}u=Ip.prototype;
u.AWa=function(a){var b=a.Q(),d=M.Lf(b);if(Qz(d,b)==p&&(a=Rz(b),a!=n)){var b=H.Se(b),e=Sz(this,b),f=d.e(),d=this.pH[f];d===k&&(this.pH[f]=d={});f=d[e];f==n&&(d[e]=f={});f[a]===k&&(b=H.$fa(b,a),f[a]=b,D.i.fine("Original form value for '",a,"' is '",b,"'"))}};
u.gWa=function(a){var b=a.Q(),d=M.Lf(b);if(Qz(d,b)==p&&(a=Rz(b),a!=n)){var e=H.Se(b),b=Sz(this,e),d=d.e(),f=this.pH[d];f!=n&&(f=f[b],f!=n&&(f=f[a],e=H.$fa(e,a),na.uC(f,e)||(this.vH=l,e=this.Mt[d],e==n&&(this.Mt[d]=e={}),f=e[b],f==n&&(e[b]=f={}),f[a]=l)))}};u.L$=function(a){var b=w.b.getElementById(a);if(b!=n)return b;if(0==a.indexOf(Ip.Qma))for(var b=document.getElementsByTagName("FORM"),d=0,e=b.length;d<e;++d){var f=b[d];if(Sz(this,f)==a)return f}return n};
function Sz(a,b){var d=w.b,e=d.getAttribute(b,"id");e==n&&(e=d.Vh(b,Ip.ww,n),e==n&&(e=Ip.Qma+a.DZa++,d.Gg(b,Ip.ww,e)));return e}u.sWa=function(a){a=a.Ffa();D.i.fine("Component removed: ",a);delete this.OW[a];delete this.uk[a];delete this.pH[a];delete this.Mt[a];Mz(this)};function Rz(a){if(a!=n){var b=w.b.getAttribute(a,"name");if(b!=n)switch(a.tagName){case "TEXTAREA":case "INPUT":case "SELECT":return b}}return n}
function Qz(a,b){if(a!=n&&a instanceof AdfUIEditableValue){var d=a.e(),e=w.b.getAttribute(b,"name");if(e!=n&&(e==d||0==e.indexOf(d)))return l}return p}function Nz(a,b){var d=a.Mt[b];if(d!=n)for(var e in d){var f=d[e],g;for(g in f)if(f[g]===l&&0<document.getElementsByName(g).length)return l}return p}u.pP=function(a){return a.rZ&&a.PW};function Pz(a){if(a=F.c.j(a)){var b=a.k();b&&b.DV&&b.DV(a)}};