(function(){var e=['<div style="margin:auto" class="u8-padding">','{{Button({ command: "CreateTargetGroup", textId: "TXT_Campaign_Designer_104" })}}',"</div>"].join("");page.using={types:["Campaign_Designer"]};page.commandBindings={CreateTargetGroup:a};page.onLoad=function(){page.process.set("stage","createTargetGroup").update("phases");var a=page.url.getUid();u8.request("CampaignManagementChannel.GetCreateTargetGroupPreconditionsInfo",{activityUid:a},function(e,a){if(a.error){return}var n=a.response;t(n.activityFormatExists,"TXT_Campaign_Designer_110");t(n.dateIsBetweenStartAndDatesOfCampaign,"TXT_Campaign_Designer_111");t(n.queryExists,"TXT_Campaign_Designer_112");t(n.hasNotBeenCreatedBefore,"TXT_Campaign_Designer_113");t(n.executionTypeIsCompatible,"TXT_Campaign_Designer_199",{executionType:n.executionType});t(n.editTargetGroupUntilDateHasBeenDefined,"TXT_Campaign_Designer_120");if(!n.activityFormatExists||!n.dateIsBetweenStartAndDatesOfCampaign||!n.queryExists||!n.hasNotBeenCreatedBefore||!n.executionTypeIsCompatible||!n.editTargetGroupUntilDateHasBeenDefined){$("#helpText").text($t("TXT_Campaign_Designer_114"));$("#reasons").show()}else{$("#helpText").text($t("TXT_Campaign_Designer_132"))}});$("#buttons").utml({template:e,itemOptions:{parent:page}})};function t(e,t,a){if(!e){var n=a?$t(t)?$t(t).format(a):"":$t(t);$("#reasonsList").append($("<li/>").text(n))}}function a(){var e=page.url.getUid();u8.services.campaignDesigner.createTargetGroup(e,function(e){if(e.assigned){page.process.proceed()}})}})();