function dg(a){this.Init(a)}m("AdfInputSearchMruCache",dg);r.v(dg);dg.ga=function(){this.lga=0;this.WR=1;m("AdfInputSearchMruCache.SUGGESTIONS",dg.WR);this.j0=2;m("AdfInputSearchMruCache.IS_COMPREHENSIVE",dg.j0);this.S5a=new RegExp(/\s\s*/)};m("AdfInputSearchMruCache.InitClass",dg.ga);dg.prototype.Init=function(a){dg.h.Init.call(this);this.Pr=a;this.Of=Array(a);this.NW=0;this.bla=!0};r.a("AdfInputSearchMruCache.prototype.Init",{Init:dg.prototype.Init});
dg.prototype.get=function(a){if(void 0===a)return this.Of[eg(this)];a=dg.e3(a);a=fg(this,a);if(void 0!==a){var b=this.Of[a];gg(this,a);return b}};r.a("AdfInputSearchMruCache.prototype.get",{get:dg.prototype.get});dg.prototype.lra=function(a){a=dg.e3(a);for(var b=0,d=0,e=-1,f=eg(this),g=0,h=this.Pr;g<h;g++,f=kg(this,f)){var l=this.Of[f];if(!l)break;l=dg.AKa(l[dg.lga],a);b==l.count?d<l.Gta&&(e=f,d=l.Gta):b<l.count&&(b=l.count,e=f,d=l.Gta)}if(1<=b)return a=this.Of[e],gg(this,e),a};
r.a("AdfInputSearchMruCache.prototype.getBestMatch",{lra:dg.prototype.lra});dg.prototype.put=function(a,b,d){a=dg.e3(a);var e=fg(this,a);if(void 0===e){a:{if(this.bla){for(e=0;e<this.Pr;e++)if(!this.Of[e]){this.Of[e]=Array(3);break a}this.bla=!1}e=this.NW;this.NW=(this.NW+1)%this.Pr}this.Of[e][dg.lga]=a;this.Of[e][dg.WR]=b;this.Of[e][dg.j0]=d}else this.Of[e][dg.WR]=b,this.Of[e][dg.j0]=d,gg(this,e)};r.a("AdfInputSearchMruCache.prototype.put",{put:dg.prototype.put});
dg.e3=function(a){return Array.isArray(a)?a:a.trim().split(dg.S5a).sort()};dg.AKa=function(a,b){var d=a.length,e=b.length;if(e<d)return 0;for(var f=0,g=0,h=0,l=0;g<d;g++)for(var n=f;n<e;n++)if(0===b[n].indexOf(a[g])){f=n+1;l+=a[g].length;h++;break}d={};d.count=h;d.Gta=l;return d};dg.Uhb=function(a,b){var d=a.length;if(d!=b.length)return!1;for(var e=0;e<d;e++)if(a[e]!=b[e])return!1;return!0};dg.qib=function(a,b){return a.length==dg.AKa(a,b).count};function kg(a,b){--b;return-1==b?a.Pr-1:b}
function eg(a){if(a.bla){for(var b=0;b<a.Pr&&a.Of[b];b++);return 0==b?0:b-1}return kg(a,a.NW)}function fg(a,b){for(var d=0;d<a.Pr;d++){var e=a.Of[d];if(!e)break;var f=e[dg.lga];if(e[dg.j0]){if(dg.qib(f,b))return d}else if(dg.Uhb(f,b))return d}}function gg(a,b){for(var d=a.Of[b],e=kg(a,a.NW),f=b,g=(b+1)%a.Pr;f!=e;g=(g+1)%a.Pr){if(!a.Of[g]){e=f;break}a.Of[f]=a.Of[g];f=g}a.Of[e]=d};