(function(){"use strict";var e;var r;var a;page.using={types:["QueryResultSnapshots"]};page.onLoad=function(){var a=page.url;var s={results:{maxRows:a.getInt(["maxRows","maxResults"],50),parent:page,autoExecute:false,snapshot:{uid:a.getUid()},grid:{}},header:{headerGroupName:a.get("headerName","Special"),headerName:a.get("headerType","QueryResultSet")}};if(a.has("ResultHeaderType")&&a.has("ResultHeaderName")){s.results.grid.header={headerName:a.get("ResultHeaderType"),headerGroupName:a.get("ResultHeaderName")}}if(u8.services.searchOptionProvider.obtainListParams({url:true},{},a).showPaging){s.results.grid.header=$.extend(true,s.results.grid.header,{view:{showPaging:true}})}var i={parent:page,headerName:s.header.headerName,headerGroupName:s.header.headerGroupName,isDefault:true,onCollapsedChange:u,view:{showCollapse:true},parameters:{1:""}};r=new u8.Base.Widgets.Header($(".header"),i);e=new u8.Crm.Widgets.QueryResultSnapshotPresenter($(".list")[0],s.results);e.setHeader(r);e.create(t)};function t(){a=new u8.Crm.Widgets.SearchForm($(".form"),{parent:page,fieldGroupName:"Q3",showFilters:false,useAutoSearch:true,onExecute:s})}function s(r,a){var t={from:0,to:a.pageSize-1,pageSize:a.pageSize,filter:null};if(a.filters){var s=new u8.Crm.Filter;for(var u=0;u<a.filters.length;u++){var i=a.filters[u],d=u8.services.schema.getField(i.infoAreaId,i.fieldId),l=u8.Crm.Filter.formatValue(d,i.value);var o=u8.Crm.Filter.createNode(i.fieldId,i.compareOperator||"=",l);s.addChild(o)}t.filter=s.toStatementString()}e.update(t)}function u(e){$("#QuerySearch").toggle(!e.getCollapsed())}})();