function Gr(a){this.Init(a)}m("AdfDirtyStateService",Gr);r.v(Gr,r);Gr.ga=function(){this.qA="_adfDirtyStateId";this.Qza="_autoGen_"};m("AdfDirtyStateService.InitClass",Gr.ga);Gr.prototype.Init=function(a){Gr.h.Init.call(this);this.Vjb=0;this.jN={};this.gx={};this.Tl={};this.v4=[];this.qN=this.AG=!1;a.addEventListener(ha.Pc,this.dgb,this);a.addEventListener(ha.Nd,this.Kfb,this);a.addEventListener(Fb.ua,this.Wfb,this)};r.a("AdfDirtyStateService.prototype.Init",{Init:Gr.prototype.Init});
Gr.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:Gr.prototype.IC});Gr.prototype.Dra=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&&QB(this);return b};r.a("AdfDirtyStateService.prototype.getDirtyComponents",{Dra:Gr.prototype.Dra});
Gr.prototype.Era=function(a){if(null==a)return this.Dra(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.kta(g,a)&&e&&!e.r9()&&b.push(g):delete d[f]}g=A.c.fs();g instanceof AdfUIEditableValue&&(e=g.o())&&e instanceof O&&(e.bind(g),e.r9()?e.pI(!1):I.kta(g,a)&&!ma.lm(e.uy(g),g.getSubmittedValue())&&b.push(g));QB(this);return b};r.a("AdfDirtyStateService.prototype.getDirtyComponentsForElement",{Era:Gr.prototype.Era});
Gr.prototype.n$=function(a){a+=":";for(var b in this.Tl)if(xa.startsWith(b,a))return!0;for(var d in this.gx)if(xa.startsWith(d,a)&&RB(this,d))return!0;return!1};r.a("AdfDirtyStateService.prototype.isNamingContainerDirty",{n$:Gr.prototype.n$});
Gr.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.qj(b);SB(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(),RB(this,b))return!0;return!1};r.a("AdfDirtyStateService.prototype.hasDirtyData",{QH:Gr.prototype.QH});Gr.prototype.sv=function(a,b){b?(this.AG=!0,this.Tl[a]=!0):(delete this.Tl[a],QB(this))};
r.a("AdfDirtyStateService.prototype.setDirty",{sv:Gr.prototype.sv});Gr.prototype.Gha=function(a,b){var d=a.g();this.v4[d]=b};r.a("AdfDirtyStateService.prototype.__registerDirtyDataComponent",{Gha:Gr.prototype.Gha});Gr.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.nta()&&(a=!0))}return a};r.a("AdfDirtyStateService.prototype.__alwaysDisplayDirtyDataWarning",{L2:Gr.prototype.L2});
Gr.prototype.vha=function(a){a=a.getSource();this.AG=this.Tl[a.g()]=!0};r.a("AdfDirtyStateService.prototype.__handleValueChangeEvent",{vha:Gr.prototype.vha});Gr.prototype.cF=function(){var a=this.Tl,b=A.c;if(this.aF(b))for(var d in a)TB(b,d);this.jN={};this.Tl={};this.gx={};this.qN=this.AG=!1};r.a("AdfDirtyStateService.prototype.__resetState",{cF:Gr.prototype.cF});Gr.prototype.DT=function(){return this.AG||this.qN};r.a("AdfDirtyStateService.prototype.__isPotentiallyDirty",{DT:Gr.prototype.DT});
Gr.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.gx)h[l]=!0;for(l in h)if(0==b||this.ama(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&&TB(f,l),delete this.Tl[l],delete this.jN[l],delete this.gx[l])}e&&QB(this)}};r.a("AdfDirtyStateService.prototype.__dataCommitted",{P2:Gr.prototype.P2});Gr.prototype.zha=function(a,b){var d=!1,e=b.o();e&&e.Y2&&(d=e.Y2(a,b))&&this.sv(b.g(),!0);return d};r.a("AdfDirtyStateService.prototype.__isInputValueDirty",{zha:Gr.prototype.zha});function QB(a){a.AG=!1;a.qN=!1;for(var b in a.Tl){a.AG=!0;break}for(b in a.gx){a.qN=!0;break}}
function SB(a,b){for(var d=0,e=b.length;d<e;++d){var f=b[d];if(f instanceof AdfRichPopup){f=f.Cd();SB(a,f);for(var g=0,h=f.length;g<h;++g)b.push(f[g])}}}k=Gr.prototype;k.ama=function(a){a=A.c.m(a);return a instanceof AdfUIEditableValue&&a.getImmediate()};
k.dgb=function(a){var b=a.X(),d=I.Cf(b);if(0==UB(d,b)&&(a=VB(b),null!=a)){var b=C.lf(b),e=WB(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.Rra(b,a),f[a]=b,v.l.fine("Original form value for '",a,"' is '",b,"'"))}};
k.Kfb=function(a){var b=a.X(),d=I.Cf(b);if(0==UB(d,b)&&(a=VB(b),null!=a)){var e=C.lf(b),b=WB(this,e),d=d.g(),f=this.jN[d];null!=f&&(f=f[b],null!=f&&(f=f[a],e=C.Rra(e,a),ma.lm(f,e)||(this.qN=!0,e=this.gx[d],null==e&&(this.gx[d]=e={}),f=e[b],null==f&&(e[b]=f={}),f[a]=!0)))}};k.nka=function(a){var b=q.b.getElementById(a);if(null!=b)return b;if(0==a.indexOf(Gr.Qza))for(var b=document.getElementsByTagName("FORM"),d=0,e=b.length;d<e;++d){var f=b[d];if(WB(this,f)==a)return f}return null};
function WB(a,b){var d=q.b,e=d.getAttribute(b,"id");null==e&&(e=d.zh(b,Gr.qA,null),null==e&&(e=Gr.Qza+a.Vjb++,d.tg(b,Gr.qA,e)));return e}k.Wfb=function(a){a=a.tra();v.l.fine("Component removed: ",a);delete this.v4[a];delete this.Tl[a];delete this.jN[a];delete this.gx[a];QB(this)};function VB(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 UB(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 RB(a,b){var d=a.gx[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:Gr.prototype.aF});function TB(a,b){var d=a.m(b);if(d){var e=d.o();e&&e.Z2&&e.Z2(a,d)}};