const Cc=Components.classes;const Ci=Components.interfaces;const Cr=Components.results;const Cu=Components.utils;const LP_CLASS_ID=Components.ID("01258260-ceed-11de-8a39-0800200c9a66");const LP_CLASS_NAME="LastPass Autocomplete Search";const LP_CONTRACT_ID="@mozilla.org/autocomplete/search;1?name=lastpass";
function lastpassAutoCompleteResult(B,A,E,D,C){this._searchString=B;this._searchResult=A;this._defaultIndex=E;this._errorDescription=D;this._results=C}lastpassAutoCompleteResult.prototype={_searchString:"",_searchResult:0,_defaultIndex:0,_errorDescription:"",_results:[],get searchStringfunction(){return this._searchString
},get searchResultfunction(){return this._searchResult},get defaultIndexfunction(){return this._defaultIndex},get errorDescriptionfunction(){return this._errorDescription},get matchCountfunction(){return this._results.length},getCommentAt:function(A){if(!this._results||A>=this._results.length){return null
}return this._results[A].comment},getImageAt:function(A){if(!this._results||A>=this._results.length){return null}return this._results[A].image},getStyleAt:function(A){if(!this._results||A>=this._results.length){return null}return this._results[A].style},getValueAt:function(A){if(!this._results||A>=this._results.length){return null
}return this._results[A].value},removeValueAt:function(A,B){},QueryInterface:function(A){if(!A.equals(Ci.nsIAutoCompleteResult)&&!A.equals(Ci.nsISupports)){throw Components.results.NS_ERROR_NO_INTERFACE}return this}};function lastpassAutoCompleteSearch(){}lastpassAutoCompleteSearch.prototype={classDescription:LP_CLASS_NAME,ContractID:LP_CONTRACT_ID,classID:LP_CLASS_ID,_listener:null,_results:null,_searchString:null,startSearch:function lastpass_start_search(B,F,A,D){try{this._searchString=B;
this._listener=D;if(!this._timer){this._timer=Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer)}else{this._timer.cancel()}var C=Components.classes["@lastpass.com/lastpass;1"].getService().wrappedJSObject;this._results=C.autocomplete_search(B);this.processResult()}catch(E){}},processResult:function(){try{this._timer.initWithCallback(this,100,Ci.nsITimer.TYPE_ONE_SHOT)
}catch(A){}},notify:function(B){try{if(this._results.length>0){this._listener.onSearchResult(this,new lastpassAutoCompleteResult(this._searchString,Ci.nsIAutoCompleteResult.RESULT_SUCCESS,0,"",this._results))}else{this._listener.onSearchResult(this,new lastpassAutoCompleteResult(this._searchString,Ci.nsIAutoCompleteResult.RESULT_NOMATCH,0,"",this._results))
}}catch(A){}},stopSearch:function(){},QueryInterface:function(A){if(!A.equals(Ci.nsIAutoCompleteSearch)&&!A.equals(Ci.nsISupports)){throw Components.results.NS_ERROR_NO_INTERFACE}return this}};var lastpassAutoCompleteSearchFactory={singleton:null,createInstance:function(B,A){if(B!=null){throw Components.results.NS_ERROR_NO_AGGREGATION
}if(this.singleton==null){this.singleton=new lastpassAutoCompleteSearch()}return this.singleton.QueryInterface(A)}};var lastpassAutoCompleteSearchModule={registerSelf:function(C,A,D,B){C=C.QueryInterface(Components.interfaces.nsIComponentRegistrar);C.registerFactoryLocation(LP_CLASS_ID,LP_CLASS_NAME,LP_CONTRACT_ID,A,D,B)
},unregisterSelf:function(B,C,A){B=B.QueryInterface(Components.interfaces.nsIComponentRegistrar);B.unregisterFactoryLocation(LP_CLASS_ID,C)},getClassObject:function(B,C,A){if(!A.equals(Components.interfaces.nsIFactory)){throw Components.results.NS_ERROR_NOT_IMPLEMENTED}if(C.equals(LP_CLASS_ID)){return lastpassAutoCompleteSearchFactory
}throw Components.results.NS_ERROR_NO_INTERFACE},canUnload:function(A){return true}};function NSGetModule(B,A){return lastpassAutoCompleteSearchModule};
