(function(){"use strict";u8.Crm.ContactsSynchronization=function(n){$.extend(this,n)};$.extend(u8.Crm.ContactsSynchronization.prototype,{newTask:function(n){u8.request("ContactsSynchronizationChannel.NewTask",{},function(e,t){if(t.error){return}n(t.response)})},getTemplatePreview:function(n,e){var t=this;u8.request("ContactsSynchronizationChannel.GetTemplate",{templateName:n},function(n,a){if(a.error){return}var r=t._createTemplatePreview(a.response);e(r)})},_createTemplatePreview:function(n){var e=new Array;n.infoAreaConfigurations.each(function(n){var t=u8.services.schema.getInfoArea(n.infoArea).label;var a=new Array;n.mappings.forEach(function(n){var e=new u8.Crm.ContactsSynchronizationModel.ExchangeContactFieldDefinition({name:n.exchangeField.name,description:n.exchangeField.extended?$t("TXT_ContactsSynchronization_5"):""});var t=new u8.Crm.ContactsSynchronizationModel.FieldMapping({crmFieldName:n.cRMFieldName,exchangeField:e});a.push(t)});var r=new u8.Crm.ContactsSynchronizationModel.InfoAreaConfiguration({infoAreaId:n.infoArea,infoAreaDescription:t,mappings:a});e.push(r)});var t=new u8.Crm.ContactsSynchronizationModel.TemplatePreview({name:n.name,infoAreaConfigurations:e});return t}});u8.services.add("contactsSynchronization",u8.Crm.ContactsSynchronization)})();