(function(){"use strict";u8.Crm.QueryDataProvider=function(e){$.extend(this,u8.Crm.QueryDataProvider.defaults,e)};u8.Crm.QueryDataProvider.defaults={_xsiNoSerialize:true};$.extend(u8.Crm.QueryDataProvider.prototype,{load:function(e,t){var r=this;this.query.execute({skipRows:e.from,maxRows:e.to-e.from+1,countRows:e.countRows,outputFields:this.outputFields},function(e,u){var o=u.resultSet;var i={};if(!o){i.error=u.error}else{i.resultSet=o}if(t){t(r,i)}})},countRows:function(e){if(!this.query.canExecute()){return}var t={countRows:true,timeout:u8.Crm.Queries.timeout,abortAfterTimeout:true,maxRows:-1};var r=this;this.query.execute(t,function(t,u){var o={};if(u.error){o.error=u.error}else if(u.resultSet){o.totalNumberOfRows=u.resultSet.totalNumberOfRows}else{o.aborted=true}if(e){e(r,o)}})},dispose:function(){},clone:function(e){return new u8.Crm.QueryDataProvider({query:this.query.clone(),outputFields:e&&e.forPaging?[]:undefined})},"DataProvider.onPreUpload":function(e){e.resultSet.queryStatement=this.query&&this.query.statement&&this.query.statement.toStatementString()}})})();