function $e(a,b,d,e){this.Init(a,b,d,e)}m("AdfAutoSuggestBehaviorImpl",$e);
$e.ga=function(){this.ad="_afrAutoSuggest";this.MK="data-afr-value";this.ffa="data-afr-label";this.rT="_afrautosuggestpopup";this.x6a="su";this.N5a="sm";this.h4a="_afrautosuggestcontainer";this.US="_afrautosuggestmorelink";this.Oda="_afrautosuggestbusydiv";this.i4a="AFAutoSuggestItemsContainer";this.m6a="AFAutoSuggestItem";this.L2a="AFAutoSuggestMoreLink";this.pza="AFAutoSuggestBusyStyle";m("AdfAutoSuggestBehaviorImpl.SUGGEST_BUSY_STYLE",$e.pza)};m("AdfAutoSuggestBehaviorImpl.InitClass",$e.ga);
r.v($e,Ja);$e.prototype.Init=function(a,b,d,e){$e.h.Init.call(this);this.qib=a;this.gNa=b;this.g6=d;this.J5=e};r.a("AdfAutoSuggestBehaviorImpl.prototype.Init",{Init:$e.prototype.Init});$e.prototype.Qa=function(a){A.c.ta(this,this.mB,a,0)};r.a("AdfAutoSuggestBehaviorImpl.prototype.initialize",{Qa:$e.prototype.Qa});
$e.prototype.mB=function(a){if(!A.c.Zg()){a.addEventListener(D.Ad,this.Adb,this);a.addEventListener(D.Bc,this.zdb,this);a.addEventListener(D.wb,this.xdb,this);a.addEventListener(D.Bd,this.Bdb,this);a.addEventListener(D.Nd,this.wdb,this);a.addEventListener(D.Pc,this.ydb,this);this.qHa=!1;this.jX=0;this.N5={};this.mU=!1;var b=a.g();a=O.da(a);a.setAttribute("role","combobox");a.setAttribute("aria-autocomplete","list");a.setAttribute("aria-owns",I.la(b,$e.rT));a.setAttribute("aria-expanded","false")}};
$e.Za=function(a,b){return b.Za(a,$e.ad)};m("AdfAutoSuggestBehaviorImpl.isPopupVisible",$e.Za);$e.tVa=function(a,b,d,e,f,g,h){var l=A.c.m(a);l&&(e&&1==e?l.t7=d:h==l.jX&&(e=l.GY(Ja))&&(e.N5[b]=d,e.Wn(l,b,a,d,!1,f,g)))};m("AdfAutoSuggestBehaviorImpl.showAutoSuggestPopup",$e.tVa);m("AdfAutoSuggestBehaviorImpl.showAutoSuggestPopup",$e.tVa);$e.prototype.gZ=function(a){var b=O.da(a).value;if(0!=b.trim().length){var d=[];a=af(a.t7,b);$e.vIa(a,d);$e.vIa(this.N5[b],d);return d}};
r.a("AdfAutoSuggestBehaviorImpl.prototype.getSuggestedItems",{gZ:$e.prototype.gZ});$e.EGa=function(a,b,d,e){var f=a.createElement("div");d=I.la(d,$e.Oda);f.setAttribute("id",d);e=e.getStyleClass($e.pza);C.w(f,e);liElement=a.createElement("li");liElement.appendChild(f);q.b.Ia(f);b.appendChild(liElement)};
$e.PGa=function(a,b,d,e,f,g,h){if(!e&&f&&0<=f){$e.RGa(a,b);e=a.createElement("a");e.setAttribute("href","#");var l=A.c.Y();f=q.b;l.Zi&&f instanceof Ge?e.addEventListener("click",function(a){void 0;a.preventDefault()}):e.addEventListener("click",function(a){a.preventDefault()});d=I.la(d,$e.US);e.setAttribute("id",d);e.setAttribute($e.MK,g);e.setAttribute("role","option");g=a.createTextNode(h.Z("AFAutoSuggestMoreLinkLabel"));e.appendChild(g);C.w(e,$e.L2a);liElement=a.createElement("li");liElement.appendChild(e);
f.Ia(e);b.appendChild(liElement)}};$e.TGa=function(a,b,d,e,f,g){var h=A.c.Y(),l=q.b,h=h.Zi&&l instanceof Ge;g=g.getStyleClass($e.m6a);var n=0;d=I.la(d,f?$e.N5a:$e.x6a);for(var t in e){f=a.createElement("li");f.setAttribute("role","option");f.setAttribute("id",d+n++);f.setAttribute($e.MK,e[t]);h&&f.addEventListener("click",function(a){a.preventDefault()});var y=t;f.setAttribute($e.ffa,y);f.appendChild(a.createTextNode(y));C.w(f,g);b.appendChild(f);l.Ia(f)}};
$e.RGa=function(a,b){var d=a.createElement("li");d.appendChild(a.createElement("hr"));b.appendChild(d)};$e.y9a=function(a){var b=q.b.getComputedStyle(a),b=parseInt(b.maxHeight,10),d=a.scrollHeight,e=A.c.Ka().La();a=C.Dc(a);for(var f=0;f<a.length;f++){var g=a[f];d>b?e?g.style.paddingLeft="20px":g.style.paddingRight="20px":e?g.style.paddingLeft="":g.style.paddingRight=""}};$e.vIa=function(a,b){for(var d in a)if(a.hasOwnProperty(d)){var e=new kb(a[d],d);b.push(e)}};
$e.AIa=function(a,b,d,e){var f=I.la(b,$e.rT);b=I.la(b,$e.h4a);a=O.da(a);var g=e.getElementById(b),h=A.c.H().getStyleClass($e.i4a);g?g.innerHTML="":(g=d.createElement("div"),g.setAttribute("id",b),g.style.display="none");d=d.createElement("ul");d.setAttribute("id",f);d.setAttribute("role","listbox");C.w(d,h);g.appendChild(d);a.parentNode.appendChild(g);e.Ia(g);return d};$e.gma=function(a){return"option"==a.getAttribute("role")};$e.OQa=function(a,b){var d=C.w;b||(d=C.O);d(a,I.Sq)};k=$e.prototype;
k.ydb=function(a){a=a.getSource();if(!this.qHa){if(a&&a instanceof AdfUIEditableValue){var b=a.o();b.bind(a);b.E8&&b.E8(a)}this.qHa=!0}this.qib&&!a.t7&&Ib.F(a,"_autoSuggest",{Lwb:!0},!0,!0)};
k.Bdb=function(a){var b=a.getSource(),d=b.o();d.bind(b);if(b&&b instanceof AdfUIEditableValue){var e=a.X(),f=e.getAttribute&&e.getAttribute($e.MK),g=O.da(b),h=b.g(),l=I.la(h,$e.US);if(e.id==l)d.jv(),this.mU=!0;else if(f&&0<f.length)(e=e.getAttribute($e.ffa))&&0<e.length&&b.setProperty("_afrAutoSuggestLabel",e,!1,G.ld),g.value=f,e=b.getValue(),null==e&&(e=bf.ls(g)),d.nd(b,a.X()),f==e&&lc.F(b,e,b.getValue(),b.getAutoSubmit()),this.mU=!0;else for(a=I.la(h,$e.rT),b=I.la(h,$e.Oda);e;){if(e.id==a){this.mU=
!0;q.b.S()==q.ia&&d.jv();break}else if(e==g||e.id==b)break;e=e.parentNode}}};k.wdb=function(a){var b=this.qe;b&&(A.c.ic(b),delete this.qe);a=a.getSource();a.o().bind(a);A.c.ta(this,this.Oab,null,100);cf(this);A.c.Yf().vm()==Te.G0&&(a.jX=this.jX++)};
k.xdb=function(a){var b=a.getSource();if(b&&b instanceof AdfUIEditableValue){var d=b.o();d.bind(b);a=a.X();if($e.Za(b,d)){var e=a.getAttribute($e.MK),f=b.g(),f=I.la(f,$e.US);a.id==f?(e&&0<e.length&&this.J5&&Pb.F(b,!0),b.focus()):e&&0<e.length&&(cf(this),d.Jb(b,$e.ad),b.focus())}}};
k.Adb=function(a){var b=q.b,d=b.na(a.U());if(d!=w.ub&&d!=w.vb){var e=void 0!==this.u7;cf(this);var f=a.getSource();if(f&&f instanceof AdfUIEditableValue){var g=f.o();g.bind(f);var h=O.da(f);if(h){var l=h.value;if(0<l.replace(/\s*/,"").length){if(d==w.uz||void 0!=this.Ex&&l.length!=this.Ex||this.Gi&&this.Gi!=l)l=A.c,this.qe?l.Ds(this.qe,500):this.qe=l.ta(this,this.x$a,f,500,{isSynchronized:!0})}else 0==l.length&&$e.Za(f,g)&&g.Jb(f,$e.ad);delete this.Ex;delete this.Gi;l=f.g();switch(d){case w.jb:if($e.Za(f,
g)){d=I.la(l,$e.US);if((e=df(h))&&e==d)this.J5&&Pb.F(f,!0);else{var n;e&&(n=b.getElementById(e));n&&(b=n.getAttribute($e.ffa))&&0<b.length&&f.setProperty("_afrAutoSuggestLabel",b,!1,G.ld);b=f.getValue();null==b&&(b=bf.ls(h));g.nd(f,a.X());n&&n.getAttribute($e.MK)==b&&lc.F(f,b,f.getValue(),f.getAutoSubmit())}g.Jb(f,$e.ad);a.cancel();a.wc()}break;case w.Ra:case w.ab:$e.Za(f,g)&&(a=I.la(l,$e.rT),a=b.getElementById(a),e&&(f=I.la(l,$e.Oda),f=b.getElementById(f))&&(g=f.parentElement,n=C.lc(g),a.removeChild(g),
b.yc(f),a.removeChild(n)),this.e7(h,a,d==w.Ra))}}}}};k.zdb=function(a){var b=a.getSource();if(b&&b instanceof AdfUIEditableValue){var d=b.o();d.bind(b);var e=O.da(b);q.b.na(a.U())==w.jb&&$e.Za(b,d)&&(b=b.g(),a=df(e),b=I.la(b,$e.US),a&&a==b&&d.jv());this.Ex=e.value.length;this.Gi=e.value}};k.Cdb=function(a){a=O.da(a);a.setAttribute("aria-expanded","false");a.removeAttribute("aria-activedescendant")};k.Ddb=function(a){O.da(a).setAttribute("aria-expanded","true")};
function df(a){return a.getAttribute("aria-activedescendant")}k.x$a=function(a){this.qe=null;var b=a.o();b.bind(a);$e.Za(a,b)&&b.Jb(a,$e.ad);var b=O.da(a),d=b.value,e=this.N5[d];if(e)this.Wn(a,d,a.g(),e,!1,this.g6,this.J5);else if(d){e=!1;if(a.t7){var f=af(a.t7,d);(e=!E.zc(f))&&this.Wn(a,d,a.g(),f,!0,this.g6,this.J5)}d.length<this.gNa||(e?this.u7=A.c.ta(this,this.vOa,[a,d,b,this.g6],2E3,{isSynchronized:!0}):this.vOa([a,d,b,this.g6]))}};function cf(a){var b=a.u7;b&&(A.c.ic(b),delete a.u7)}
k.vOa=function(a){delete this.u7;var b=A.c.H();if(a[1]){var d=a[0],e=d.o();e.bind(d);if(!$e.Za(d,e)){var f=d.g(),g=O.da(d).ownerDocument,h=$e.AIa(d,f,g,q.b);$e.EGa(g,h,f,b);this.JN(d,e,f,h)}e=this.jX++;d.jX=e;Ib.F(a[0],"_autoSuggest",{submittedValue:a[1],emptyText:b.Z("AFAutoSuggestEmptyText"),maxSuggestedItems:a[3],requestId:e},!0,!0)}};function af(a,b){var d={},e;for(e in a)0==e.indexOf(b)&&(d[e]=a[e]);return d}
k.e7=function(a,b,d){var e,f,g=df(a);g?(e=q.b.getElementById(g),f=d?C.x9(e,b,!0,$e.gma):C.ssa(e,b,$e.gma)):d&&(f=C.Pu(b,!0,$e.gma));f&&(e&&$e.OQa(e,!1),$e.OQa(f,!0),a.setAttribute("aria-activedescendant",f.id),f.scrollIntoView(),b=f.getAttribute($e.MK))&&(a.value=b)};
k.Wn=function(a,b,d,e,f,g,h){var l=a.o();l.bind(a);var n=I.la(d,$e.rT),t=O.da(a),y=t.ownerDocument,z=q.b,B=A.c.H(),F=!e.hasOwnProperty(B.Z("AFAutoSuggestEmptyText"));if($e.Za(a,l)){n=z.getElementById(n);if(a=a=n.lastChild)z.yc(a),n.removeChild(a);$e.TGa(y,n,d,e,f,B);F&&h&&$e.PGa(y,n,d,f,g,b,B)}else n=$e.AIa(a,d,y,z),$e.TGa(y,n,d,e,f,B),1==f&&t.value.length>=this.gNa&&($e.RGa(y,n),$e.EGa(y,n,d,B)),F&&h&&$e.PGa(y,n,d,f,g,b,B),this.JN(a,l,d,n);$e.y9a(n)};
k.JN=function(a,b,d,e){r.bb(AdfRichPopup);var f={type:"menu",autodismiss:"autodismissMenu",focus:!1,closeOnEscape:!0};f.closeHandler=this.D(this.Cdb);f.closeHandlerParam=a;f.openedHandler=this.D(this.Ddb);f.openedHandlerParam=a;f[AdfRichPopup.Ed]=AdfRichPopup.qf;f[AdfRichPopup.cg]=d;f[AdfRichPopup.Jf]=I.la(d,"content");b.He(a,e,f,$e.ad)};k.Oab=function(){this.mU||(this.N5={});this.mU=!1};