function Er(a){this.Init(a)}m("AdfDirtyStateService",Er);r.v(Er,r);Er.ga=function(){this.qA="_adfDirtyStateId";this.Mza="_autoGen_"};m("AdfDirtyStateService.InitClass",Er.ga);Er.prototype.Init=function(a){Er.h.Init.call(this);this.Ujb=0;this.jN={};this.fx={};this.Tl={};this.v4=[];this.qN=this.AG=!1;a.addEventListener(ha.Oc,this.cgb,this);a.addEventListener(ha.Nd,this.Jfb,this);a.addEventListener(Fb.ua,this.Vfb,this)};r.a("AdfDirtyStateService.prototype.Init",{Init:Er.prototype.Init});
Er.prototype.IC=function(a){a=a instanceof G?a.g():a;u.J(a);return!0===this.Tl[a]};r.a("AdfDirtyStateService.prototype.isDirty",{IC:Er.prototype.IC});Er.prototype.zra=function(a){var b=[],d=A.c,e=!1;if(null==a)for(var f in this.Tl)a=d.m(f),null==a&&(delete this.Tl[f],e=!0),b.push(a);else{d=a.Cd();f=0;for(var g=d.length;f<g;++f)a=d[f],this.IC(a)&&b.push(a)}e&&OB(this);return b};r.a("AdfDirtyStateService.prototype.getDirtyComponents",{zra:Er.prototype.zra});
Er.prototype.Ara=function(a){if(null==a)return this.zra(null);var b=[],d=this.Tl,e=null,f;for(f in d){var g=page.m(f);g&&(e=g.o())&&e.bind(g);g?g instanceof AdfUIEditableValue&&e instanceof O&&I.hta(g,a)&&e&&!e.r9()&&b.push(g):delete d[f]}g=A.c.es();g instanceof AdfUIEditableValue&&(e=g.o())&&e instanceof O&&(e.bind(g),e.r9()?e.pI(!1):I.hta(g,a)&&!ma.lm(e.ty(g),g.getSubmittedValue())&&b.push(g));OB(this);return b};r.a("AdfDirtyStateService.prototype.getDirtyComponentsForElement",{Ara:Er.prototype.Ara});
Er.prototype.m$=function(a){a+=":";for(var b in this.Tl)if(xa.startsWith(b,a))return!0;for(var d in this.fx)if(xa.startsWith(d,a)&&PB(this,d))return!0;return!1};r.a("AdfDirtyStateService.prototype.isNamingContainerDirty",{m$:Er.prototype.m$});
Er.prototype.QH=function(a){var b=null,b=null==a?A.c.R():a instanceof G?a instanceof AdfRichPopup?xc.lC(a):I.Fb(a):a;u.Hb(b);a=q.b.pj(b);QB(this,a);i=0;for(size=a.length;i<size;++i)if(b=a[i],b instanceof AdfUIEditableValue&&this.IC(b))return!0;i=0;for(size=a.length;i<size;++i)if(b=a[i],b=b.g(),PB(this,b))return!0;return!1};r.a("AdfDirtyStateService.prototype.hasDirtyData",{QH:Er.prototype.QH});Er.prototype.qv=function(a,b){b?(this.AG=!0,this.Tl[a]=!0):(delete this.Tl[a],OB(this))};
r.a("AdfDirtyStateService.prototype.setDirty",{qv:Er.prototype.qv});Er.prototype.Eha=function(a,b){var d=a.g();this.v4[d]=b};r.a("AdfDirtyStateService.prototype.__registerDirtyDataComponent",{Eha:Er.prototype.Eha});Er.prototype.L2=function(){var a=!1,b;for(b in this.v4)if("always"==this.v4[b]){var d=A.c.m(b);null!=d&&(d=d.o(),null!=d&&d.kta()&&(a=!0))}return a};r.a("AdfDirtyStateService.prototype.__alwaysDisplayDirtyDataWarning",{L2:Er.prototype.L2});
Er.prototype.tha=function(a){a=a.getSource();this.AG=this.Tl[a.g()]=!0};r.a("AdfDirtyStateService.prototype.__handleValueChangeEvent",{tha:Er.prototype.tha});Er.prototype.cF=function(){var a=this.Tl,b=A.c;if(this.aF(b))for(var d in a)RB(b,d);this.jN={};this.Tl={};this.fx={};this.qN=this.AG=!1};r.a("AdfDirtyStateService.prototype.__resetState",{cF:Er.prototype.cF});Er.prototype.DT=function(){return this.AG||this.qN};r.a("AdfDirtyStateService.prototype.__isPotentiallyDirty",{DT:Er.prototype.DT});
Er.prototype.P2=function(a,b){if(0!=this.AG||0!=this.qN){if(0==a.length)if(b)a=[""];else{this.cF();return}var d=q.b,e=!1,f=A.c,g=this.aF(f),h={},l;for(l in this.Tl)h[l]=!0;for(l in this.fx)h[l]=!0;for(l in h)if(0==b||this.Yla(l)){for(var h=!1,n=0,t=a.length;n<t;++n){var y=a[n];if(l==y){h=!0;break}if(xa.startsWith(l,y+":")){h=!0;break}}if(!h)for(n=d.getElementById(l);null!=n&&!h;){t=n.id;if(null!=t&&(h=-1<E.indexOf(a,t),!h&&(t=I.Cf(n),t instanceof AdfRichPopup&&xc.lC(t)==n))){n=I.Fb(t);continue}n=
n.parentNode}h&&(e=!0,g&&RB(f,l),delete this.Tl[l],delete this.jN[l],delete this.fx[l])}e&&OB(this)}};r.a("AdfDirtyStateService.prototype.__dataCommitted",{P2:Er.prototype.P2});Er.prototype.xha=function(a,b){var d=!1,e=b.o();e&&e.Y2&&(d=e.Y2(a,b))&&this.qv(b.g(),!0);return d};r.a("AdfDirtyStateService.prototype.__isInputValueDirty",{xha:Er.prototype.xha});function OB(a){a.AG=!1;a.qN=!1;for(var b in a.Tl){a.AG=!0;break}for(b in a.fx){a.qN=!0;break}}
function QB(a,b){for(var d=0,e=b.length;d<e;++d){var f=b[d];if(f instanceof AdfRichPopup){f=f.Cd();QB(a,f);for(var g=0,h=f.length;g<h;++g)b.push(f[g])}}}k=Er.prototype;k.Yla=function(a){a=A.c.m(a);return a instanceof AdfUIEditableValue&&a.getImmediate()};
k.cgb=function(a){var b=a.X(),d=I.Cf(b);if(0==SB(d,b)&&(a=TB(b),null!=a)){var b=C.lf(b),e=UB(this,b),f=d.g(),d=this.jN[f];void 0===d&&(this.jN[f]=d={});f=d[e];null==f&&(d[e]=f={});void 0===f[a]&&(b=C.Nra(b,a),f[a]=b,v.l.fine("Original form value for '",a,"' is '",b,"'"))}};
k.Jfb=function(a){var b=a.X(),d=I.Cf(b);if(0==SB(d,b)&&(a=TB(b),null!=a)){var e=C.lf(b),b=UB(this,e),d=d.g(),f=this.jN[d];null!=f&&(f=f[b],null!=f&&(f=f[a],e=C.Nra(e,a),ma.lm(f,e)||(this.qN=!0,e=this.fx[d],null==e&&(this.fx[d]=e={}),f=e[b],null==f&&(e[b]=f={}),f[a]=!0)))}};k.kka=function(a){var b=q.b.getElementById(a);if(null!=b)return b;if(0==a.indexOf(Er.Mza))for(var b=document.getElementsByTagName("FORM"),d=0,e=b.length;d<e;++d){var f=b[d];if(UB(this,f)==a)return f}return null};
function UB(a,b){var d=q.b,e=d.getAttribute(b,"id");null==e&&(e=d.yh(b,Er.qA,null),null==e&&(e=Er.Mza+a.Ujb++,d.tg(b,Er.qA,e)));return e}k.Vfb=function(a){a=a.pra();v.l.fine("Component removed: ",a);delete this.v4[a];delete this.Tl[a];delete this.jN[a];delete this.fx[a];OB(this)};function TB(a){if(null!=a){var b=q.b.getAttribute(a,"name");if(null!=b)switch(a.tagName){case "TEXTAREA":case "INPUT":case "SELECT":return b}}return null}
function SB(a,b){if(null!=a&&a instanceof AdfUIEditableValue){var d=a.g(),e=q.b.getAttribute(b,"name");if(null!=e&&(e==d||0==e.indexOf(d)))return!0}return!1}function PB(a,b){var d=a.fx[b];if(null!=d)for(var e in d){var f=d[e],g;for(g in f)if(!0===f[g]&&0<document.getElementsByName(g).length)return!0}return!1}k.aF=function(){return!1};r.a("AdfDirtyStateService.prototype.__needsSpuriousDirtyValueTracking",{aF:Er.prototype.aF});function RB(a,b){var d=a.m(b);if(d){var e=d.o();e&&e.Z2&&e.Z2(a,d)}};