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U,yBAAyB,GAAM,GAAS,gKAOvgE8O,GALAA,EADI1I,EAAKzC,WACEmL,iEAA4FL,EAAIQ,KAAK,aAAc7I,EAAK5J,KAAKwD,UAAU,sBAAsB,GAAM,GAAS,iIAAkLyO,EAAIO,OAAO,OAASH,EAAazI,EAAK5J,KAAKwD,UAAU,sBAAwB,GAAK6O,GAAe,eAG/bC,wEAAqGL,EAAIQ,KAAK,aAAc7I,EAAK5J,KAAKwD,UAAU,sBAAsB,GAAM,GAAS,iIAAkLyO,EAAIO,OAAO,OAASH,EAAazI,EAAK5J,KAAKwD,UAAU,sBAAwB,GAAK6O,GAAe,cAExcC,gJAA8NL,EAAIQ,KAAK,aAAc7I,EAAKhG,mBAAmB,GAAM,GAAS,IAAYqO,EAAIO,OAAO,OAASH,EAAazI,EAAKhG,mBAAqB,GAAKyO,GAAxWC,2KAAglBL,EAAIQ,KAAK,aAAc7I,EAAKhG,mBAAmB,GAAM,GAAS,IAAYqO,EAAIO,OAAO,OAASH,EAAazI,EAAKhG,mBAAqB,GAAKyO,GAAe,gCAAwE,EAAEpD,KAAK9S,KAAK,SAAUoW,EAAgBA,EAAgB3I,KAAmB,qBAAPA,KAAmBA,UAAKjN,GAAoB2V,CAAS,C,yBCTn7B,IAAIL,EAAM,EAAQ,QAGlBC,EAAOC,QADP,SAAkBC,GAAS,IAAoCC,EAAhCC,EAAW,GAAqCC,EAAmBH,GAAU,CAAC,EAA8xB,OAA1xB,SAAUxI,GAAO0I,EAAWA,EAAW,2NAAsSL,EAAIO,OAAO,OAASH,EAAazI,EAAK5J,KAAKwD,UAAU,sBAAwB,GAAK6O,GAAe,2HAA2JJ,EAAIO,OAAO,OAASH,EAAazI,EAAKI,mBAAqB,GAAKqI,GAAe,WAA2B,EAAEpD,KAAK9S,KAAK,SAAUoW,EAAgBA,EAAgB3I,KAAmB,qBAAPA,KAAmBA,UAAKjN,GAAoB2V,CAAS,C","sources":["../../../../components/packages/audience-association-repository/src/data-config.js","../../../../components/packages/audience-association-repository/src/data-adapter.js","../../../../components/packages/audience-association-repository/src/repository.js","../../../../components/packages/audience-association-repository/src/util.js","../../../../components/packages/audience-expression-manage/src/metadata/expression-metadata.js","../../../../components/packages/audience-expression-manage/src/cnf-or-dnf/viewmodel.js","../../../../components/packages/audience-expression-manage/src/metadata/condition-metadata.js","../../../../components/packages/audience-expression-manage/src/condition/viewmodel.js","../../../../components/packages/audience-expression-manage/src/condition-builder/viewmodel.js","../../../../components/packages/audience-expression-manage/src/condition-builder/view.js","../../../../components/packages/audience-expression-manage/src/rule-group/viewmodel.js","../../../../components/packages/audience-expression-manage/src/rule-group/view.js","../../../../components/packages/audience-expression-manage/src/cnf-or-dnf/view.js","../../../../components/packages/block-ad-block/src/block-ad-block.js","../../../../components/packages/block-ad-block/src/is-ad-block-on.js","../../../../components/packages/browser/src/index.js","../../../../components/packages/audience-expression-manage/src/cnf-or-dnf/template.pug","../../../../components/packages/audience-expression-manage/src/condition-builder/template.pug","../../../../components/packages/audience-expression-manage/src/rule-group/template.pug"],"sourcesContent":["/* jshint esversion: 6 */\r\nimport _ from 'underscore';\r\n\r\nconst AudiencesPageSize = 10;\r\n\r\nexport class AudienceAssociationDataConfig {\r\n constructor({\r\n campaignType,\r\n permissions,\r\n jsData,\r\n edmCampaign,\r\n campaignTypes,\r\n }) {\r\n this.campaignType = campaignType;\r\n this.permissions = permissions;\r\n this.jsData = jsData;\r\n this.edmCampaign = edmCampaign;\r\n this.campaignTypes = campaignTypes;\r\n this.enabledAudienceTypes = this.getAllEnabledAudienceTypes(permissions);\r\n }\r\n\r\n // audienceTypes should be a string array like ['Remessaging', 'Custom']\r\n // if audienceTypes is null, select all enabledAudienceTypes\r\n // if pageNumber is not null, add paging parameters\r\n getAudiencesQuery(audienceTypes = null, pageNumber = null, pageSize = AudiencesPageSize) {\r\n const types = _.isNull(audienceTypes) ?\r\n this.enabledAudienceTypes :\r\n this.compactArrayWithWhiteList(audienceTypes, this.enabledAudienceTypes);\r\n const query = {\r\n audiencetype: types.join(','),\r\n };\r\n\r\n if (this.permissions.IsAIMCampaignEnabled ||\r\n this.permissions.IsProductAudienceForSearchEnabled) {\r\n switch (this.campaignType) {\r\n case this.campaignTypes.audience:\r\n query.deliverychannel = 'AIM';\r\n break;\r\n case null:\r\n case undefined:\r\n query.deliverychannel = 'BingAds,AIM';\r\n break;\r\n default:\r\n query.deliverychannel = 'BingAds';\r\n }\r\n }\r\n\r\n if (!_.isNull(pageNumber)) {\r\n query.$top = pageSize;\r\n query.$skip = pageNumber * pageSize;\r\n }\r\n\r\n return { query };\r\n }\r\n\r\n // get all supported audience types from permissions\r\n getAllEnabledAudienceTypes(permissions) {\r\n const EnableImpressionBasedList = this.permissions && this.permissions.dynamic && this.permissions.dynamic.EnableImpressionBasedList;\r\n return _.compact([\r\n 'Remessaging',\r\n permissions.IsCustomAudienceAllowed && 'Custom',\r\n permissions.IsInMarketAudienceAllowed && 'InMarket',\r\n (permissions.IsAIMCampaignEnabled || permissions.IsProductAudienceForSearchEnabled) &&\r\n 'Product',\r\n permissions.IsRemarketingSimilarAudienceAllowed && 'RemarketingSimilar',\r\n permissions.IsCustomerListAudienceAllowed && 'CustomerList',\r\n permissions.IsCombinedListAudienceAllowed && 'CombinedList',\r\n EnableImpressionBasedList && 'ImpressionBasedRemarketing',\r\n ]);\r\n }\r\n\r\n // input a string array, compute intersection with white list,\r\n // then remove duplicate, null or empty\r\n compactArrayWithWhiteList(inputArray, whiteList) {\r\n return _.chain(inputArray)\r\n .intersection(whiteList)\r\n .uniq()\r\n .compact()\r\n .value();\r\n }\r\n\r\n getAssociationDataStore() {\r\n return this.jsData.AudienceAssociation;\r\n }\r\n\r\n // get associations from AudienceAssociations if campaign level enabled,\r\n // otherwise fallback to AdGroupAudienceCriterions\r\n getAssociationEntitySet(campaignId = null, adgroupId = null) {\r\n if (!_.isNull(adgroupId) && this.edmCampaign.currentAdGroup) {\r\n return this.edmCampaign.currentAdGroup.AudienceAssociations;\r\n }\r\n\r\n if (!_.isNull(campaignId) && this.edmCampaign.currentCampaign) {\r\n return this.edmCampaign.currentCampaign.AudienceAssociations;\r\n }\r\n\r\n return this.edmCampaign.currentAccount.AudienceAssociations;\r\n }\r\n\r\n // options:\r\n // campaignId\r\n // adgroupId\r\n // isExpandCampaign // for campaign level only\r\n // isExpandAdGroup // for campaign level only\r\n // noExclusion // is targeting\r\n // top // select top n result\r\n getAssociationQuery(options = {}) {\r\n const query = {};\r\n const expands = _.compact([\r\n options.isExpandCampaign && 'CampaignCriterion',\r\n options.isExpandAdGroup && 'AdGroupCriterion',\r\n ]).join(',');\r\n\r\n if (expands) {\r\n query.$expand = expands;\r\n }\r\n\r\n if (options.noExclusion) {\r\n query.$filter = 'Status eq Enum.AdGroupCriterionStatus\\'Active\\'or Status eq Enum.AdGroupCriterionStatus\\'Paused\\'';\r\n }\r\n\r\n if (options.top) {\r\n query.$top = options.top;\r\n }\r\n\r\n if (options.skip) {\r\n query.$skip = options.skip;\r\n }\r\n\r\n return { query };\r\n }\r\n}\r\n","/* jshint esversion: 6 */\r\nimport _ from 'underscore';\r\n\r\nconst audienceTypeStringMapping = {\r\n Remessaging: {\r\n name: 'AudienceAssociation_List_Remessaging_Entity',\r\n desc: 'AudiencesAssociation_AudienceType_Remessaging_Desc',\r\n },\r\n Custom: {\r\n name: 'AudienceAssociation_List_Custom_Entity',\r\n desc: 'AudiencesAssociation_AudienceType_Custom_Desc',\r\n },\r\n InMarket: {\r\n name: 'AudienceAssociation_List_InMarket_Entity',\r\n desc: 'AudiencesAssociation_AudienceType_InMarket_Desc',\r\n },\r\n Product: {\r\n name: 'AudienceAssociation_List_Product_Entity',\r\n desc: 'AudiencesAssociation_AudienceType_Product_Desc',\r\n },\r\n RemarketingSimilar: {\r\n name: 'AudienceAssociation_List_RemarketingSimilar_Entity',\r\n desc: 'AudiencesAssociation_AudienceType_RemarketingSimilar_Desc',\r\n },\r\n CustomerList: {\r\n name: 'AudienceAssociation_List_CustomerList_Entity',\r\n desc: 'AudiencesAssociation_AudienceType_CustomerList_Desc',\r\n },\r\n CombinedList: {\r\n name: 'AudienceAssociation_List_CombinedList_Entity',\r\n desc: 'AudiencesAssociation_AudienceType_CombinedList_Desc',\r\n },\r\n};\r\n\r\nexport class AudienceAssociationDataAdapter {\r\n constructor({\r\n i18n,\r\n }) {\r\n this.i18n = i18n;\r\n }\r\n\r\n /*\r\n Mapping from odata call result json to flat lst with Name, Id and Type\r\n\r\n source data like: {\r\n \"@odata.context\":\"http://apidomain/ODataApi/Advertiser/v2/$metadata#Audiences\",\r\n \"value\":[\r\n { \"Id\":807487056,\"Name\":\"/Apparel & Accessories\",\"Type\":\"InMarket\", ...},\r\n ...\r\n\r\n target data like: [\r\n { Id:807487056, Name: \"/Apparel & Accessories\", Type: \"InMarket\" }, ...\r\n */\r\n mapAudiencesToFlatList(audiencesModel) {\r\n return _.chain(audiencesModel)\r\n .map(item => ({\r\n Name: item.Name,\r\n Id: item.Id,\r\n Type: item.Type,\r\n Owner: item.Owner,\r\n }))\r\n .value();\r\n }\r\n\r\n /*\r\n Mapping from audiences flat list to categorized data for Steven's DoubleListBox datasource\r\n\r\n source data like: [\r\n { Id:807487056, Name: \"/Apparel & Accessories\", Type: \"InMarket\" }, ...\r\n\r\n target data like: {\r\n categories: [{\r\n type: 'InMarket',\r\n name: 'In-market audiences',\r\n data: {\r\n items: [\"/Apparel & Accessories\", ...], ...\r\n */\r\n getCategorizedAudiences(audiencesFlatList) {\r\n const categories = _.chain(audiencesFlatList)\r\n .groupBy('Type')\r\n .map((vals, key) => ({\r\n type: key,\r\n name: this.i18n.get(audienceTypeStringMapping[key].name) || '',\r\n description: this.i18n.get(audienceTypeStringMapping[key].desc) || '',\r\n data: { items: _.pluck(vals, 'Name') },\r\n }))\r\n .value();\r\n\r\n return { categories };\r\n }\r\n\r\n /*\r\n Extract AudienceCriterion from Association result json to a flat list\r\n\r\n source data like: {\r\n \"@odata.context\": \"http://apidomain/ODataApi/Advertiser/v2/$metadata#AudienceAssociations\",\r\n \"value\": [{\r\n \"Id\": 74698071617468,\r\n \"Status\": \"Excluded\",\r\n \"AudienceCriterion\": {\r\n \"AudienceId\": 813801649,\r\n \"AudienceType\": \"Remessaging\",\r\n \"AudienceName\": \"aa\", ... },\r\n\r\n target data like: [{\r\n audienceId: 813801649,\r\n audienceName: \"aa\",\r\n audienceType: \"Remessaging\",\r\n id: 74698071617468,\r\n level: \"AdGroup\",\r\n targetStatus: \"Excluded\", ...\r\n */\r\n mapAudienceAssociationsToFlatList(associationModel) {\r\n return _.chain(associationModel)\r\n .filter(item => (item.AudienceCriterion))\r\n .map(item => ({\r\n Id: item.Id,\r\n TargetStatus: item.Status, // 'Active', 'Paused', 'Deleted', 'InterimDeleted', 'Excluded'\r\n Level: item.Level, // 'AdGroup' or 'Campagin'\r\n BidType: item.BidType,\r\n BidMultiplier: item.AudienceCriterion.BidMultiplier,\r\n AudienceId: item.AudienceCriterion.AudienceId,\r\n AudienceType: item.AudienceCriterion.AudienceType,\r\n AudienceName: item.AudienceCriterion.AudienceName,\r\n }))\r\n .value();\r\n }\r\n\r\n // get categorized audience id and name list from association flat list\r\n getSelectedAudiencesInCategories(associationFlatList, isExclusion = false) {\r\n const targetStatus = isExclusion ? ['Excluded'] : ['Active', 'Paused'];\r\n\r\n const categories = _.chain(associationFlatList)\r\n .filter(item => _.contains(targetStatus, item.TargetStatus))\r\n .map(item => ({\r\n Id: item.AudienceId,\r\n Name: item.AudienceName,\r\n Type: item.AudienceType,\r\n }))\r\n .groupBy('Type')\r\n .map((vals, key) => ({\r\n type: key,\r\n data: { selected: _.pluck(vals, 'Name') },\r\n }))\r\n .value();\r\n\r\n return { categories };\r\n }\r\n}\r\n","/* jshint esversion: 6 */\r\nimport Promise from 'bluebird';\r\nimport { AudienceAssociationDataConfig } from './data-config';\r\nimport { AudienceAssociationDataAdapter } from './data-adapter';\r\n\r\nexport class AudienceAssociationRepository {\r\n constructor({\r\n permissions,\r\n campaignType,\r\n jsData,\r\n edmCampaign,\r\n i18n,\r\n campaignTypes,\r\n }) {\r\n this.permissions = permissions;\r\n this.jsData = jsData;\r\n this.edmCampaign = edmCampaign;\r\n this.i18n = i18n;\r\n this.dataConfig = new AudienceAssociationDataConfig({\r\n campaignType,\r\n permissions,\r\n jsData,\r\n edmCampaign,\r\n i18n,\r\n campaignTypes,\r\n });\r\n this.dataAdapter = new AudienceAssociationDataAdapter({\r\n i18n,\r\n });\r\n this.cachedAudiencesByChannel = {};\r\n }\r\n\r\n getAudiencesByType(audienceTypes, pageNumber, pageSize, forceReload = false) {\r\n const query = this.dataConfig.getAudiencesQuery(audienceTypes, pageNumber, pageSize);\r\n const deliveryChannel = query.query.deliverychannel || 'BingAds';\r\n const getAudiencesPromise = !forceReload && this.cachedAudiencesByChannel[deliveryChannel] ?\r\n Promise.resolve(this.cachedAudiencesByChannel[deliveryChannel]) :\r\n this.jsData.Audience.findAll(query, { entitySet: this.edmCampaign });\r\n\r\n return getAudiencesPromise.then((data) => {\r\n this.cachedAudiencesByChannel[deliveryChannel] = data;\r\n return this.dataAdapter.mapAudiencesToFlatList(data);\r\n });\r\n }\r\n\r\n getAssociations(options = {}) {\r\n const dataStore = this.dataConfig.getAssociationDataStore();\r\n const query = this.dataConfig.getAssociationQuery(options);\r\n\r\n return dataStore.findAll(query)\r\n .then(data => (this.dataAdapter.mapAudienceAssociationsToFlatList(data)));\r\n }\r\n}\r\n","import _ from 'underscore';\r\n\r\nexport class AudienceAssociationUtils {\r\n static filterOutSharedAudiences(audiences, customerId) {\r\n return _.filter(audiences, x => (x.Owner === null) || (x.Owner.Id === customerId));\r\n }\r\n}\r\n","export const expressions = i18n => ([\r\n {\r\n id: 'CNF',\r\n value: i18n.getString('Audiences_Manage_CNFOrDNF_SelectOption_MatchEveryRule'),\r\n descriptionFirstGroup: i18n.getString('Audiences_Manage_CNFOrDNF_Description_MatchEveryRule'),\r\n descriptionOtherGroups: i18n.getString('Audiences_Manage_CNFOrDNF_Description_MatchEveryRule_And'),\r\n groupOperator: i18n.getString('Audiences_Manage_and_conditions_seperator'),\r\n conditionOperator: i18n.getString('Audiences_Manage_or_conditions_seperator'),\r\n },\r\n {\r\n id: 'DNF',\r\n value: i18n.getString('Audiences_Manage_CNFOrDNF_SelectOption_MatchAnyRule'),\r\n descriptionFirstGroup: i18n.getString('Audiences_Manage_CNFOrDNF_Description_MatchAnyRule'),\r\n descriptionOtherGroups: i18n.getString('Audiences_Manage_CNFOrDNF_Description_MatchAnyRule_Or'),\r\n groupOperator: i18n.getString('Audiences_Manage_or_conditions_seperator'),\r\n conditionOperator: i18n.getString('Audiences_Manage_and_conditions_seperator'),\r\n },\r\n]);\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\nimport { expressions } from '../metadata/expression-metadata';\r\n\r\nexport class CNFOrDNFViewModel {\r\n constructor({ i18n, data }) {\r\n this.CNF = null;\r\n this.DNF = null;\r\n\r\n const expressionType = (!(data && data.Constraints) || data.Constraints.ExpressionGroupType === 'None') ?\r\n 'DNF' : data.Constraints.ExpressionGroupType;\r\n this.expressionMode = ko.observable(expressionType);\r\n this.expressionGroupList = ko.observableArray(expressions(i18n));\r\n\r\n this.i18n = i18n;\r\n }\r\n\r\n toJSON(skipEmptyConditions) {\r\n const result = {\r\n ExpressionGroupType: this.expressionMode(),\r\n };\r\n\r\n if (this.expressionMode() === 'CNF') {\r\n _.extend(result, this.CNF.toJSON(skipEmptyConditions));\r\n } else if (this.expressionMode() === 'DNF') {\r\n _.extend(result, this.DNF.toJSON(skipEmptyConditions));\r\n }\r\n\r\n return result;\r\n }\r\n\r\n validate() {\r\n let valid = true;\r\n\r\n // rule group by type\r\n if (this.expressionMode() === 'CNF') {\r\n valid = this.CNF.validate();\r\n } else if (this.expressionMode() === 'DNF') {\r\n valid = this.DNF.validate();\r\n }\r\n\r\n return valid;\r\n }\r\n}\r\n","const operandCategory = {\r\n Expression: 0,\r\n};\r\n\r\nconst operatorType = {\r\n String: 0,\r\n Number: 1,\r\n};\r\n\r\nexport const expressionOperand = i18n =>\r\n ([{\r\n id: 'Url',\r\n value: i18n.getString('Manage_ctrl_builder_operand1'),\r\n category: operandCategory.Expression,\r\n type: operatorType.String,\r\n }, {\r\n id: 'ReferrerUrl',\r\n value: i18n.getString('Manage_ctrl_builder_operand2'),\r\n category: operandCategory.Expression,\r\n type: operatorType.String,\r\n },\r\n // ecomm_prodid\r\n // ecomm_pagetype\r\n // event\r\n // pagetype\r\n // event_name\r\n // ecomm_category\r\n // ecomm_totalvalue\r\n {\r\n id: 'EcommProdId', // 3\r\n value: i18n.getString('Manage_condition_operand3'),\r\n category: operandCategory.Expression,\r\n type: operatorType.String,\r\n }, {\r\n id: 'EcommPageType', // 4\r\n value: i18n.getString('Manage_condition_operand4'),\r\n category: operandCategory.Expression,\r\n type: operatorType.String,\r\n }, {\r\n id: 'EventAction', // 5\r\n value: i18n.getString('Manage_condition_operand5'),\r\n category: operandCategory.Expression,\r\n type: operatorType.String,\r\n }, {\r\n id: 'EcommCategory', // 6\r\n value: i18n.getString('Manage_condition_operand8'),\r\n category: operandCategory.Expression,\r\n type: operatorType.String,\r\n }, {\r\n id: 'EcommTotalValue', // 7\r\n value: i18n.getString('Manage_condition_operand9'),\r\n category: operandCategory.Expression,\r\n type: operatorType.Number,\r\n },\r\n ]);\r\n\r\nexport const expressionOperator = i18n => ([\r\n {\r\n id: 'Equals',\r\n value: i18n.getString('Manage_ctrl_builder_operator1'),\r\n type: operatorType.String,\r\n }, {\r\n id: 'Contains',\r\n value: i18n.getString('Manage_ctrl_builder_operator2'),\r\n type: operatorType.String,\r\n }, {\r\n id: 'StartsWith',\r\n value: i18n.getString('Manage_ctrl_builder_operator3'),\r\n type: operatorType.String,\r\n }, {\r\n id: 'EndsWith',\r\n value: i18n.getString('Manage_ctrl_builder_operator4'),\r\n type: operatorType.String,\r\n }, {\r\n id: 'NotEquals',\r\n value: i18n.getString('Manage_ctrl_builder_operator5'),\r\n type: operatorType.String,\r\n }, {\r\n id: 'DoesNotContain',\r\n value: i18n.getString('Manage_ctrl_builder_operator6'),\r\n type: operatorType.String,\r\n }, {\r\n id: 'DoesNotStartWith',\r\n value: i18n.getString('Manage_ctrl_builder_operator7'),\r\n type: operatorType.String,\r\n }, {\r\n id: 'DoesNotEndWith',\r\n value: i18n.getString('Manage_ctrl_builder_operator8'),\r\n type: operatorType.String,\r\n },\r\n {\r\n id: 'Equals', // 1\r\n value: i18n.getString('Manage_ctrl_builder_equalto'),\r\n type: operatorType.Number,\r\n }, {\r\n id: 'GreaterThan', // 9\r\n value: i18n.getString('Manage_ctrl_builder_greaterthan'),\r\n type: operatorType.Number,\r\n }, {\r\n id: 'LessThan', // 10\r\n value: i18n.getString('Manage_ctrl_builder_lessthan'),\r\n type: operatorType.Number,\r\n }, {\r\n id: 'GreaterThanEqualTo', // 11\r\n value: i18n.getString('Manage_ctrl_builder_greaterthanequalto'),\r\n type: operatorType.Number,\r\n }, {\r\n id: 'LessThanEqualTo', // 12\r\n value: i18n.getString('Manage_ctrl_builder_lessthanequalto'),\r\n type: operatorType.Number,\r\n }, {\r\n id: 'NotEquals', // 13\r\n value: i18n.getString('Manage_ctrl_builder_notequalto'),\r\n type: operatorType.Number,\r\n },\r\n]);\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\nimport { expressionOperand, expressionOperator } from '../metadata/condition-metadata';\r\n\r\nconst operatorType = {\r\n String: 0,\r\n Number: 1,\r\n};\r\n\r\nconst getOperandData = (operand, i18n) =>\r\n _.find(expressionOperand(i18n), item => item.id === operand);\r\n\r\nconst filterOperatorsByType = (operand, i18n) => {\r\n const operandData = getOperandData(operand, i18n);\r\n\r\n return _.filter(expressionOperator(i18n), item => item.type === operandData.type);\r\n};\r\n\r\nconst filterOperandsByCategory = (operand, i18n, isNewParametersAllowed) => {\r\n const operandData = getOperandData(operand, i18n);\r\n const operandsList = _.filter(\r\n expressionOperand(i18n),\r\n item => item.category === operandData.category\r\n );\r\n\r\n return isNewParametersAllowed ? operandsList : operandsList.slice(0, 2);\r\n};\r\n\r\nexport class ConditionViewModel {\r\n constructor({ i18n, data, isNewParametersAllowed }) {\r\n const operandItem = data.Operand;\r\n const qualifiedOperands = filterOperandsByCategory(operandItem, i18n, isNewParametersAllowed);\r\n const qualifiedOperators = filterOperatorsByType(operandItem, i18n, isNewParametersAllowed);\r\n const operandInfo = getOperandData(operandItem, i18n);\r\n this.operatorType = ko.observable(operandInfo.type);\r\n this.predicateList = ko.observableArray(qualifiedOperands);\r\n this.conjunctionList = ko.observableArray(qualifiedOperators);\r\n this.predicateSelectedValue = ko.observable(operandItem);\r\n this.conjunctionSelectedValue = ko.observable(data.Operator);\r\n this.conditionText = ko.observable(data.Value);\r\n this.errorText = ko.observable(i18n.getString('Manage_ctrl_condition_ErrorText'));\r\n this.showTextError = ko.observable(false);\r\n this.predicateSelectedText = ko.observable(operandInfo.value);\r\n this.i18n = i18n;\r\n // Trigger the change of conjuction list\r\n this.predicateSelectedValue.subscribe((newItem) => {\r\n if (newItem) {\r\n const operandData = getOperandData(newItem, i18n);\r\n this.predicateSelectedText(operandData.value);\r\n this.operatorType(operandData.type);\r\n const operators = filterOperatorsByType(newItem, i18n);\r\n\r\n if (operators && operators.length > 0) {\r\n this.conjunctionList(operators);\r\n }\r\n }\r\n });\r\n }\r\n\r\n countDecimals(value) {\r\n if ((value % 1) !== 0) { return value.toString().split('.')[1].length; }\r\n return 0;\r\n }\r\n\r\n validate() {\r\n const conditionText = this.conditionText();\r\n let valid = _.isString(conditionText) && conditionText.trim().length > 0 &&\r\n conditionText.trim().length < 2048; // // max length for urls\r\n\r\n if (!valid) {\r\n this.errorText(this.i18n.getString('Manage_ctrl_condition_ErrorText'));\r\n }\r\n // Check \"(\" and \")\" illegal existence in condition text, both reserved for rule separation\r\n // e.g. (URL contains ABC and URL contains XYZ) or\r\n // (URL contains 124 and Referrer URL equals 456)\r\n if (valid && (conditionText.indexOf('(') >= 0 || conditionText.indexOf(')') >= 0)) {\r\n valid = false;\r\n this.errorText(this.i18n.getString('Validation_String_Invalid_Characters'));\r\n }\r\n\r\n if (valid && this.operatorType() === operatorType.Number) {\r\n const maxSafeInteger = 9007199254740991;\r\n const numberValue = Number(conditionText);\r\n this.errorText(this.i18n.getString('Audiences_Manage_Error_InvalidFloatNumberValue_Number'));\r\n valid = _.isFinite(numberValue) && numberValue >= 0 && numberValue < maxSafeInteger\r\n && (this.countDecimals(numberValue) <= 2);\r\n }\r\n\r\n if (!valid) {\r\n this.showTextError(true);\r\n } else {\r\n this.showTextError(false);\r\n }\r\n\r\n return valid;\r\n }\r\n\r\n toJSON() {\r\n return {\r\n Operand: this.predicateSelectedValue(),\r\n Operator: this.conjunctionSelectedValue(),\r\n Value: this.conditionText(),\r\n };\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\nimport { ConditionViewModel } from '../condition/viewmodel';\r\n\r\n// This limit aligns with RemarketingRuleGroupLimit set in MT which\r\nconst RemarketingRuleItemLimit = 100;\r\n\r\nexport class ConditionBuilderViewModel {\r\n constructor({ i18n, isReadOnly }) {\r\n this.conditions = ko.observableArray([]);\r\n this.conditionCount = ko.computed(() => this.conditions().length);\r\n this.isNewConditionAllowed = ko.computed(() =>\r\n !isReadOnly && this.conditionCount() < RemarketingRuleItemLimit);\r\n this.i18n = i18n;\r\n this.isReadOnly = ko.observable(isReadOnly);\r\n }\r\n\r\n init(data, isNewParametersAllowed) {\r\n if (data.conditions) {\r\n _.each(data.conditions, (condition) => {\r\n this.conditions.push(new ConditionViewModel({\r\n data: condition,\r\n i18n: this.i18n,\r\n isNewParametersAllowed,\r\n }));\r\n });\r\n } else {\r\n // At least create an empty condition\r\n this.conditions.push(new ConditionViewModel({\r\n data: {\r\n Operand: 'Url',\r\n Operator: 'Contains',\r\n Value: '',\r\n },\r\n i18n: this.i18n,\r\n isNewParametersAllowed,\r\n }));\r\n }\r\n }\r\n\r\n toJSON(skipEmptyConditions) {\r\n const result = [];\r\n\r\n _.each(this.conditions(), (condition) => {\r\n if (skipEmptyConditions) {\r\n const expression = condition.toJSON();\r\n if (expression.Value.length > 0) {\r\n result.push(expression);\r\n }\r\n } else {\r\n result.push(condition.toJSON());\r\n }\r\n });\r\n\r\n return result;\r\n }\r\n\r\n validate() {\r\n let valid = true;\r\n const conditions = this.conditions();\r\n\r\n valid = _.every(conditions, condition => condition.validate());\r\n\r\n return valid;\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport { KnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './template.pug';\r\nimport { ConditionViewModel } from '../condition/viewmodel';\r\nimport { ConditionBuilderViewModel } from './viewmodel';\r\n\r\nexport class ConditionBuilderView extends KnockoutView {\r\n initialize({\r\n i18n, data, isReadOnly, isNewParametersAllowed, ...others\r\n }) {\r\n super.initialize({\r\n i18n, isReadOnly, ...others,\r\n });\r\n this.i18n = i18n;\r\n this.conditionTitle = data.conditionTitle;\r\n this.conditionOperator = data.conditionOperator;\r\n this.isReadOnly = isReadOnly;\r\n this.isNewParametersAllowed = isNewParametersAllowed;\r\n this.viewModel.init(data, isNewParametersAllowed);\r\n }\r\n\r\n validate() {\r\n const valid = this.viewModel.validate();\r\n\r\n return valid;\r\n }\r\n\r\n toJSON(skipEmptyConditions) {\r\n const conditions = this.viewModel.toJSON(skipEmptyConditions);\r\n\r\n return {\r\n ExpressionSet: conditions,\r\n };\r\n }\r\n\r\n addCondition(e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n this.viewModel.conditions.push(new ConditionViewModel({\r\n i18n: this.i18n,\r\n data: {\r\n Operand: 'Url',\r\n Operator: 'Contains',\r\n Value: '',\r\n },\r\n isNewParametersAllowed: this.isNewParametersAllowed,\r\n }));\r\n }\r\n\r\n removeCondition(e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n const condition = ko.dataFor(e.target);\r\n this.viewModel.conditions.remove(condition);\r\n\r\n if (this.viewModel.conditionCount() === 0) {\r\n // trigger remove rule group\r\n this.trigger('removeRuleGroup');\r\n }\r\n }\r\n\r\n events() {\r\n return {\r\n 'click .remove-button': 'removeCondition',\r\n 'click .condition-operator-button': 'addCondition',\r\n };\r\n }\r\n\r\n get ViewModel() { return ConditionBuilderViewModel; }\r\n\r\n get template() { return template; }\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\nimport { ConditionBuilderView } from '../condition-builder/view';\r\nimport { expressions } from '../metadata/expression-metadata';\r\n\r\nexport const getExpressionData = (type, i18n) =>\r\n _.find(expressions(i18n), item => item.id === type);\r\n\r\n// This limit aligns with RemarketingRuleGroupLimit set in MT which\r\nconst RemarketingRuleGroupLimit = 100;\r\n\r\nexport class RuleGroupViewModel {\r\n constructor({\r\n i18n, expressionType, isReadOnly, isNewParametersAllowed,\r\n }) {\r\n this.ruleGroups = ko.observableArray([]);\r\n this.expressions = getExpressionData(expressionType, i18n);\r\n this.ruleGroupCount = ko.computed(() => this.ruleGroups().length);\r\n this.isNewRuleGroupAllowed = ko.computed(() =>\r\n !isReadOnly && this.ruleGroupCount() < RemarketingRuleGroupLimit);\r\n this.i18n = i18n;\r\n this.isReadOnly = isReadOnly;\r\n this.isNewParametersAllowed = isNewParametersAllowed;\r\n }\r\n\r\n init(data, removeRuleGroup) {\r\n if (data.ruleGroups) {\r\n _.each(data.ruleGroups, (ruleGroup, index) => {\r\n const conditionBuilder = new ConditionBuilderView({\r\n i18n: this.i18n,\r\n data: {\r\n conditions: ruleGroup.ExpressionSet,\r\n conditionTitle: index === 0 ? this.expressions.descriptionFirstGroup :\r\n this.expressions.descriptionOtherGroups,\r\n conditionOperator: this.expressions.conditionOperator,\r\n },\r\n isReadOnly: this.isReadOnly,\r\n isNewParametersAllowed: this.isNewParametersAllowed,\r\n }).render();\r\n const ruleGroupId = _.uniqueId('ruleGroup-');\r\n\r\n conditionBuilder.on('removeRuleGroup', () => removeRuleGroup({\r\n ruleGroupId,\r\n ruleGroupView: conditionBuilder,\r\n }));\r\n\r\n this.ruleGroups.push({\r\n id: ruleGroupId,\r\n view: conditionBuilder,\r\n });\r\n });\r\n } else {\r\n // At least create an empty ruleGroup\r\n const conditionBuilder = new ConditionBuilderView({\r\n i18n: this.i18n,\r\n data: {\r\n conditionTitle: this.expressions.descriptionFirstGroup,\r\n conditionOperator: this.expressions.conditionOperator,\r\n },\r\n isReadOnly: this.isReadOnly,\r\n isNewParametersAllowed: this.isNewParametersAllowed,\r\n }).render();\r\n const ruleGroupId = _.uniqueId('ruleGroup-');\r\n\r\n conditionBuilder.on('removeRuleGroup', () => removeRuleGroup({\r\n ruleGroupId,\r\n ruleGroupView: conditionBuilder,\r\n }));\r\n\r\n this.ruleGroups.push({\r\n id: ruleGroupId,\r\n view: conditionBuilder,\r\n });\r\n }\r\n }\r\n\r\n toJSON(skipEmptyConditions) {\r\n const result = [];\r\n\r\n _.each(this.ruleGroups(), (ruleGroup) => {\r\n if (skipEmptyConditions) {\r\n const expressionSet = ruleGroup.view.toJSON();\r\n if (expressionSet.ExpressionSet.length > 0) {\r\n result.push(expressionSet);\r\n }\r\n } else {\r\n result.push(ruleGroup.view.toJSON());\r\n }\r\n });\r\n\r\n return result;\r\n }\r\n\r\n validate() {\r\n const ruleGroups = this.ruleGroups();\r\n\r\n const valid = _.every(ruleGroups, ruleGroup => ruleGroup.view.validate());\r\n\r\n return valid;\r\n }\r\n}\r\n","import ko from 'knockout';\r\nimport _ from 'underscore';\r\nimport { KnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './template.pug';\r\nimport { RuleGroupViewModel, getExpressionData } from './viewmodel';\r\nimport { ConditionBuilderView } from '../condition-builder/view';\r\n\r\n// TODO: add readonly logic here\r\nexport class RuleGroupView extends KnockoutView {\r\n initialize({\r\n i18n, data, expressionType, isReadOnly, permissions, ...others\r\n }) {\r\n super.initialize({\r\n i18n,\r\n expressionType,\r\n isReadOnly,\r\n isNewParametersAllowed: permissions &&\r\n permissions.dynamic.EnableRemarketingListBasedParameter,\r\n ...others,\r\n });\r\n this.i18n = i18n;\r\n this.expressions = getExpressionData(expressionType, i18n);\r\n this.ruleGroupOperator = this.expressions.groupOperator;\r\n this.isReadOnly = isReadOnly;\r\n this.isNewParametersAllowed = permissions &&\r\n permissions.dynamic.EnableRemarketingListBasedParameter;\r\n this.viewModel.init(data, this.removeRuleGroup.bind(this));\r\n\r\n // Knockout: Control descendant bindings.\r\n ko.bindingHandlers.stopBinding = {\r\n init: () => ({\r\n controlsDescendantBindings: true,\r\n }),\r\n };\r\n }\r\n\r\n renderTrunk() {\r\n super.renderTrunk();\r\n _.each(this.viewModel.ruleGroups(), (ruleGroup) => {\r\n this.$(`#rule-group-${ruleGroup.id}`).html(ruleGroup.view.$el);\r\n });\r\n }\r\n\r\n remove() {\r\n _.each(this.viewModel.ruleGroups(), (ruleGroup) => {\r\n ruleGroup.view.remove();\r\n });\r\n super.remove();\r\n }\r\n\r\n validate() {\r\n let valid = this.viewModel.ruleGroupCount() > 0;\r\n\r\n if (valid) {\r\n valid = this.viewModel.validate();\r\n } else {\r\n this.showError();\r\n }\r\n\r\n if (valid) {\r\n this.hideError();\r\n }\r\n return valid;\r\n }\r\n\r\n showError() {\r\n this.$el.find('.error').removeClass('hide');\r\n }\r\n\r\n hideError() {\r\n this.$el.find('.error').addClass('hide');\r\n }\r\n\r\n toJSON(skipEmptyConditions) {\r\n const conditions = this.viewModel.toJSON(skipEmptyConditions);\r\n\r\n return {\r\n Conditions: conditions,\r\n };\r\n }\r\n\r\n addRuleGroup(e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n const audienceCount = this.viewModel.ruleGroupCount();\r\n const conditionBuilder = new ConditionBuilderView({\r\n i18n: this.i18n,\r\n data: {\r\n conditionTitle: this.expressions.descriptionOtherGroups,\r\n conditionOperator: this.expressions.conditionOperator,\r\n },\r\n isReadOnly: this.isReadOnly,\r\n isNewParametersAllowed: this.isNewParametersAllowed,\r\n }).render();\r\n const ruleGroupId = _.uniqueId('ruleGroup-');\r\n\r\n this.viewModel.ruleGroups.push({\r\n id: ruleGroupId,\r\n view: conditionBuilder,\r\n });\r\n\r\n conditionBuilder.on('removeRuleGroup', () => this.removeRuleGroup({\r\n ruleGroupId,\r\n ruleGroupView: conditionBuilder,\r\n }));\r\n\r\n this.$(`#rule-group-${ruleGroupId}`).html(conditionBuilder.$el);\r\n\r\n if (audienceCount === 0) {\r\n this.hideError();\r\n }\r\n }\r\n\r\n removeRuleGroup({\r\n ruleGroupId,\r\n ruleGroupView,\r\n }) {\r\n this.$(`#rule-group-${ruleGroupId}`).html();\r\n this.viewModel.ruleGroups.remove(_.findWhere(this.viewModel.ruleGroups(), {\r\n id: ruleGroupId,\r\n }));\r\n ruleGroupView.remove();\r\n }\r\n\r\n events() {\r\n return {\r\n 'click .rule-group-operator-button': 'addRuleGroup',\r\n };\r\n }\r\n\r\n\r\n get ViewModel() { return RuleGroupViewModel; }\r\n\r\n get template() { return template; }\r\n}\r\n","import { KnockoutView } from '@bingads-webui/knockout-view';\r\nimport template from './template.pug';\r\nimport { CNFOrDNFViewModel } from './viewmodel';\r\nimport { RuleGroupView } from '../rule-group/view';\r\n\r\nexport class CNFOrDNFView extends KnockoutView {\r\n initialize({\r\n i18n, data, isReadOnly, permissions,\r\n }) {\r\n super.initialize({ i18n, data });\r\n this.i18n = i18n;\r\n this.isReadOnly = isReadOnly;\r\n this.data = data;\r\n\r\n // region Two children sub-views:\r\n // Mode1: CNF\r\n this.viewModel.CNF = new RuleGroupView({\r\n i18n: this.i18n,\r\n expressionType: 'CNF',\r\n data: this.data && this.data.Constraints && this.data.Constraints.ExpressionGroupType === 'CNF' ? {\r\n ruleGroups: this.data.Constraints.Conditions,\r\n } : {},\r\n isReadOnly: this.isReadOnly,\r\n permissions,\r\n }).render();\r\n\r\n // Mode2: DNF\r\n this.viewModel.DNF = new RuleGroupView({\r\n i18n: this.i18n,\r\n expressionType: 'DNF',\r\n data: this.data && this.data.Constraints && this.data.Constraints.ExpressionGroupType !== 'CNF' ? {\r\n ruleGroups: this.data.Constraints.Conditions,\r\n } : {},\r\n isReadOnly: this.isReadOnly,\r\n permissions,\r\n }).render();\r\n\r\n this.setChild('cnf-picker', this.viewModel.CNF);\r\n this.setChild('dnf-picker', this.viewModel.DNF);\r\n }\r\n\r\n remove() {\r\n this.viewModel.DNF.remove();\r\n this.viewModel.CNF.remove();\r\n super.remove();\r\n }\r\n\r\n validate() {\r\n const valid = this.viewModel.validate();\r\n\r\n return valid;\r\n }\r\n\r\n toJSON(skipEmptyConditions = true) {\r\n return this.viewModel.toJSON(skipEmptyConditions);\r\n }\r\n\r\n get ViewModel() { return CNFOrDNFViewModel; }\r\n\r\n get template() { return template; }\r\n}\r\n","/* eslint-disable func-names, no-underscore-dangle, no-param-reassign, no-unused-expressions */\r\n/*\r\n * BlockAdBlock 3.2.1\r\n * Copyright (c) 2015 Valentin Allaire \r\n * Released under the MIT license\r\n * https://github.com/sitexw/BlockAdBlock\r\n */\r\n/* Modifications made for eslint + some campaign UI fixes */\r\n\r\nimport _ from 'underscore';\r\n\r\nconst BlockAdBlock = function (options) {\r\n this._options = {\r\n checkOnLoad: false,\r\n resetOnEnd: false,\r\n loopCheckTime: 50,\r\n loopMaxNumber: 5,\r\n baitClass: 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links',\r\n baitStyle: 'width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;',\r\n debug: false,\r\n };\r\n this._var = {\r\n version: '3.2.1',\r\n bait: null,\r\n checking: false,\r\n loop: null,\r\n loopNumber: 0,\r\n event: { detected: [], notDetected: [] },\r\n };\r\n if (options !== undefined) {\r\n this.setOption(options);\r\n }\r\n const self = this;\r\n const eventCallback = function () {\r\n setTimeout(() => {\r\n if (self._options.checkOnLoad === true) {\r\n if (self._options.debug === true) {\r\n self._log('onload->eventCallback', 'A check loading is launched');\r\n }\r\n if (self._var.bait === null) {\r\n self._creatBait();\r\n }\r\n }\r\n }, 0);\r\n };\r\n if (window.addEventListener !== undefined) {\r\n window.addEventListener('load', eventCallback, false);\r\n } else {\r\n window.attachEvent('onload', eventCallback);\r\n }\r\n this.adBlockOn = undefined;\r\n};\r\nBlockAdBlock.prototype._options = null;\r\nBlockAdBlock.prototype._var = null;\r\nBlockAdBlock.prototype._bait = null;\r\n\r\n// eslint-disable-next-line no-unused-vars\r\nBlockAdBlock.prototype._log = function (method, message) {\r\n // note: enable following line if you need to debug using console log\r\n // console.log('[BlockAdBlock][' + method + '] ' + message);\r\n};\r\n\r\nBlockAdBlock.prototype.setOption = function (options, value) {\r\n if (value !== undefined) {\r\n const key = options;\r\n options = {};\r\n options[key] = value;\r\n }\r\n\r\n // eslint-disable-next-line\r\n for (const option in options) {\r\n this._options[option] = options[option];\r\n if (this._options.debug === true) {\r\n this._log('setOption', `The option \"${option}\" he was assigned to \"${options[option]}\"`);\r\n }\r\n }\r\n return this;\r\n};\r\n\r\nBlockAdBlock.prototype._creatBait = function () {\r\n const bait = document.createElement('div');\r\n bait.setAttribute('class', this._options.baitClass);\r\n bait.setAttribute('style', this._options.baitStyle);\r\n this._var.bait = window.document.body.appendChild(bait);\r\n\r\n this._var.bait.offsetParent;\r\n this._var.bait.offsetHeight;\r\n this._var.bait.offsetLeft;\r\n this._var.bait.offsetTop;\r\n this._var.bait.offsetWidth;\r\n this._var.bait.clientHeight;\r\n this._var.bait.clientWidth;\r\n\r\n if (this._options.debug === true) {\r\n this._log('_creatBait', 'Bait has been created');\r\n }\r\n};\r\nBlockAdBlock.prototype._destroyBait = function () {\r\n // check before destroy it, to make sure it still attached to the document\r\n if (this._var.bait && this._var.bait.parentElement) {\r\n window.document.body.removeChild(this._var.bait);\r\n }\r\n this._var.bait = null;\r\n\r\n if (this._options.debug === true) {\r\n this._log('_destroyBait', 'Bait has been removed');\r\n }\r\n};\r\n\r\nBlockAdBlock.prototype.check = function (loop) {\r\n if (loop === undefined) {\r\n loop = true;\r\n }\r\n\r\n if (this._options.debug === true) {\r\n this._log('check', `An audit was requested ${loop === true ? 'with a' : 'without'} loop`);\r\n }\r\n\r\n if (this._var.checking === true) {\r\n if (this._options.debug === true) {\r\n this._log('check', 'A check was canceled because there is already an ongoing');\r\n }\r\n return false;\r\n }\r\n this._var.checking = true;\r\n\r\n if (this._var.bait === null) {\r\n this._creatBait();\r\n }\r\n\r\n const self = this;\r\n this._var.loopNumber = 0;\r\n if (loop === true) {\r\n this._var.loop = setInterval(() => {\r\n self._checkBait(loop);\r\n }, this._options.loopCheckTime);\r\n }\r\n setTimeout(() => {\r\n self._checkBait(loop);\r\n }, 0);\r\n if (this._options.debug === true) {\r\n this._log('check', 'A check is in progress ...');\r\n }\r\n\r\n return true;\r\n};\r\nBlockAdBlock.prototype._checkBait = function (loop) {\r\n let detected = false;\r\n\r\n if (this._var.bait === null) {\r\n this._creatBait();\r\n }\r\n\r\n if (window.document.body.getAttribute('abp') !== null\r\n || this._var.bait.offsetParent === null\r\n || this._var.bait.offsetHeight === 0\r\n || this._var.bait.offsetLeft === 0\r\n || this._var.bait.offsetTop === 0\r\n || this._var.bait.offsetWidth === 0\r\n || this._var.bait.clientHeight === 0\r\n || this._var.bait.clientWidth === 0) {\r\n detected = true;\r\n }\r\n if (window.getComputedStyle !== undefined) {\r\n const baitTemp = window.getComputedStyle(this._var.bait, null);\r\n if (baitTemp && (baitTemp.getPropertyValue('display') === 'none' || baitTemp.getPropertyValue('visibility') === 'hidden')) {\r\n detected = true;\r\n }\r\n }\r\n\r\n if (this._options.debug === true) {\r\n this._log(\r\n '_checkBait',\r\n `A check (${this._var.loopNumber + 1}/${this._options.loopMaxNumber} ~${1 + (this._var.loopNumber * this._options.loopCheckTime)}ms) was conducted and detection is ${detected === true ? 'positive' : 'negative'}`\r\n );\r\n }\r\n\r\n if (loop === true) {\r\n this._var.loopNumber = this._var.loopNumber + 1;\r\n if (this._var.loopNumber >= this._options.loopMaxNumber) {\r\n this._stopLoop();\r\n }\r\n }\r\n\r\n if (detected === true) {\r\n this._stopLoop();\r\n this._destroyBait();\r\n this.emitEvent(true);\r\n if (loop === true) {\r\n this._var.checking = false;\r\n }\r\n } else if (this._var.loop === null || loop === false) {\r\n this._destroyBait();\r\n this.emitEvent(false);\r\n if (loop === true) {\r\n this._var.checking = false;\r\n }\r\n }\r\n};\r\nBlockAdBlock.prototype._stopLoop = function () {\r\n clearInterval(this._var.loop);\r\n this._var.loop = null;\r\n this._var.loopNumber = 0;\r\n\r\n if (this._options.debug === true) {\r\n this._log('_stopLoop', 'A loop has been stopped');\r\n }\r\n};\r\n\r\nBlockAdBlock.prototype.emitEvent = function (detected) {\r\n this.adBlockOn = detected;\r\n if (this._options.debug === true) {\r\n this._log('emitEvent', `An event with a ${detected === true ? 'positive' : 'negative'} detection was called`);\r\n }\r\n\r\n const fns = this._var.event[(detected === true ? 'detected' : 'notDetected')];\r\n // eslint-disable-next-line\r\n for (const i in fns) {\r\n if (this._options.debug === true) {\r\n this._log('emitEvent', `Call function ${parseInt(i, 10) + 1}/${fns.length}`);\r\n }\r\n if (Object.prototype.hasOwnProperty.call(fns, i)) {\r\n fns[i]();\r\n }\r\n }\r\n if (this._options.resetOnEnd === true) {\r\n this.clearEvent();\r\n }\r\n return this;\r\n};\r\nBlockAdBlock.prototype.clearEvent = function () {\r\n this._var.event.detected = [];\r\n this._var.event.notDetected = [];\r\n\r\n if (this._options.debug === true) {\r\n this._log('clearEvent', 'The event list has been cleared');\r\n }\r\n};\r\n\r\nBlockAdBlock.prototype.on = function (detected, fn) {\r\n this._var.event[(detected === true ? 'detected' : 'notDetected')].push(fn);\r\n if (this._options.debug === true) {\r\n this._log('on', `A type of event \"${detected === true ? 'detected' : 'notDetected'}\" was added`);\r\n }\r\n\r\n return this;\r\n};\r\nBlockAdBlock.prototype.onDetected = function (fn) {\r\n return this.on(true, fn);\r\n};\r\nBlockAdBlock.prototype.onNotDetected = function (fn) {\r\n return this.on(false, fn);\r\n};\r\n\r\n// new function added by campaign UI\r\nBlockAdBlock.prototype.getAdBlockOn = function (logMessage) {\r\n if (this.adBlockOn === undefined) {\r\n this.check();\r\n this._checkBait(true);\r\n }\r\n if (this.adBlockOn === true && logMessage) {\r\n logMessage('alerts/adblockwarning', '1');\r\n }\r\n return !!this.adBlockOn;\r\n};\r\n\r\nBlockAdBlock.prototype.setAdBlockOn = function (detected) {\r\n this.adBlockOn = !!detected;\r\n};\r\n\r\nwindow.BlockAdBlock = BlockAdBlock;\r\n\r\nif (window.blockAdBlock === undefined) {\r\n window.blockAdBlock = new BlockAdBlock({\r\n checkOnLoad: false,\r\n resetOnEnd: true,\r\n });\r\n}\r\n\r\nfunction adBlockDetected() {\r\n _.isFunction(window.blockAdBlock && window.blockAdBlock.setAdBlockOn) &&\r\n window.blockAdBlock.setAdBlockOn(true);\r\n}\r\n\r\nfunction adBlockNotDetected() {\r\n // some times window.blockAdBlock would be remove by some add-ons.\r\n _.isFunction(window.blockAdBlock && window.blockAdBlock.setAdBlockOn) &&\r\n window.blockAdBlock.setAdBlockOn(false);\r\n}\r\n\r\nif (typeof blockAdBlock === 'undefined') {\r\n window.blockAdBlock.adBlockDetected();\r\n} else {\r\n window.blockAdBlock.setOption({ debug: true });\r\n window.blockAdBlock.onDetected(adBlockDetected).onNotDetected(adBlockNotDetected);\r\n}\r\n","import Promise from 'bluebird';\r\nimport $ from 'jquery';\r\nimport './block-ad-block';\r\n\r\nconst { blockAdBlock } = window;\r\n\r\n// ConnectivityCheck/CanConnect always fails for proxy, so disable check\r\nconst isProxy = window.location.port === '12000';\r\n\r\nexport const isAdBlockOn = ({\r\n CampaignUIAPI = '/Campaign/',\r\n logMessage,\r\n} = {}) => {\r\n // Sometimes window.blockAdBlock will be removed by some adblockers\r\n if (!blockAdBlock || blockAdBlock.getAdBlockOn(logMessage)) {\r\n return Promise.resolve(true);\r\n }\r\n\r\n if (!isProxy) {\r\n return new Promise((resolve, reject) => {\r\n $.ajax({\r\n url: `${CampaignUIAPI}API/ConnectivityCheck/CanConnect?Advertiser=1&Ad=1&BannerAd=1`,\r\n success: data => resolve(data !== 'OK'),\r\n type: 'GET',\r\n error: reject,\r\n });\r\n }).catch(() => {\r\n if (logMessage) {\r\n // found ad blocker\r\n logMessage('blockAdBlock');\r\n }\r\n return true;\r\n });\r\n }\r\n\r\n return Promise.resolve(false);\r\n};\r\n\r\n","import _ from 'underscore';\r\n\r\nconst MinimumCompatibleBrowserVersion = _.constant({\r\n IE: 11.0,\r\n Chrome: -1, // -1 means all versions\r\n Firefox: 38.0,\r\n Safari: 9.0,\r\n Opera: -1,\r\n Edge: -1,\r\n});\r\n\r\nfunction getBrowserInfo() {\r\n const ua = navigator.userAgent;\r\n const matches = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\r\n\r\n let t;\r\n // check for IE\r\n if (/trident/i.test(matches[1])) {\r\n t = /\\brv[ :]+(\\d+)/g.exec(ua) || [];\r\n return { name: 'IE', version: parseFloat(t[1] || '0') };\r\n }\r\n\r\n // Other\r\n const app = matches[2] ? [matches[1], matches[2]] : [navigator.appName, navigator.appVersion, '-?'];\r\n t = ua.match(/version\\/(\\d+)/i);\r\n if (t != null) {\r\n app.splice(1, 1, t[1]);\r\n }\r\n\r\n return { name: app[0], version: parseFloat(app[1]) };\r\n}\r\n\r\nexport function isCompatibleBrowser() {\r\n const { name, version } = getBrowserInfo();\r\n\r\n if (!_.has(MinimumCompatibleBrowserVersion(), name)) {\r\n return false;\r\n }\r\n const minVer = MinimumCompatibleBrowserVersion()[name];\r\n if (minVer > version) {\r\n return false;\r\n }\r\n\r\n\r\n return true;\r\n}\r\n\r\n// Returns the version of Internet Explorer or a -1\r\n// (indicating the use of another browser).\r\nfunction getInternetExplorerVersion() {\r\n const v = getBrowserInfo();\r\n if (v.name === 'IE') {\r\n return v.version;\r\n }\r\n\r\n return -1;\r\n}\r\n\r\n/* !!! CAREFUL !!! */\r\n/* This function won't work for IE10 or above */\r\nfunction isIEXOrLess(v) {\r\n const version = getInternetExplorerVersion();\r\n return version !== -1 && version < v;\r\n}\r\n\r\nexport const isIE8OrLess = isIEXOrLess(9.0);\r\nexport const isIE9OrLess = isIEXOrLess(10.0);\r\nexport const getIEVersion = getInternetExplorerVersion;\r\n","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"cnf-or-dnf-panel col-sm-12\\\"\\u003E\\u003Cdiv class=\\\"form-group\\\"\\u003E\\u003Clabel class=\\\"control-label col-sm-12\\\" id=\\\"CNFOrDNFTitle\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('Audiences_Manage_CNFOrDNF_Title')) ? \"\" : pug_interp)) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"col-sm-12\\\" id=\\\"CNFOrDNFDescription\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('Audiences_Manage_CNFOrDNF_Description')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cselect\" + (\" class=\\\"col-sm-3 form-control\\\"\"+\" id=\\\"ExpressionGroupDropDown\\\" name=\\\"ExpressionGroupDropDown\\\"\"+pug.attr(\"disabled\", view.isReadOnly, true, true)+\" data-bind=\\\"options: expressionGroupList, optionsText:"value", optionsValue: "id", value: expressionMode\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Audiences_Manage_CNFOrDNF_SelectOption'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"cnf-panel-body col-sm-12\\\" data-bind=\\\"visible: expressionMode() == "CNF"\\\"\\u003E\\u003Cdiv class=\\\"cnf-picker section\\\" data-ref=\\\"cnf-picker\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"dnf-panel-body col-sm-12\\\" data-bind=\\\"visible: expressionMode() == "DNF"\\\"\\u003E\\u003Cdiv class=\\\"dnf-picker section\\\" data-ref=\\\"dnf-picker\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"conditionsPanel\\\"\\u003E\\u003Clabel\" + (\" class=\\\"control-label condition-title col-sm-12\\\"\"+pug.attr(\"aria-label\", view.conditionTitle, true, true)) + \"\\u003E\" + (null == (pug_interp = view.conditionTitle) ? \"\" : pug_interp) + \"\\u003C\\u002Flabel\\u003E\\u003Cdiv class=\\\"conditions-array col-sm-12\\\" data-bind=\\\"foreach: conditions\\\"\\u003E\\u003Cdiv class=\\\"form-group row\\\" role=\\\"group\\\"\\u003E\\u003Cdiv class=\\\"col-sm-3\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control predicateDropDown\\\"\"+\" name=\\\"predicateDropDown\\\"\"+pug.attr(\"disabled\", view.isReadOnly, true, true)+\" data-bind=\\\"options: predicateList, optionsText: "value", optionsValue: "id", value: predicateSelectedValue\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Manage_lbl_Predication'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3\\\"\\u003E\\u003Cselect\" + (\" class=\\\"form-control conjunctionDropDown\\\"\"+\" name=\\\"conjunctionDropDown\\\"\"+pug.attr(\"disabled\", view.isReadOnly, true, true)+\" data-bind=\\\"options: conjunctionList, optionsText: "value", optionsValue: "id", value: conjunctionSelectedValue\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Manage_lbl_Conjunction'), true, true)) + \"\\u003E\\u003C\\u002Fselect\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3\\\"\\u003E\\u003Cinput\" + (\" class=\\\"form-control remarketingListName conditionText\\\"\"+\" name=\\\"conditionText\\\" placeholder=\\\"\\\"\"+pug.attr(\"disabled\", view.isReadOnly, true, true)+\" data-maxlength=\\\"2048\\\" maxlength=\\\"2048\\\" data-bind=\\\"attr: {"aria-invalid": showTextError(), "aria-describedby": "RemarketingListConditionTextError" + $index()}, value: conditionText, valueUpdate: "input", css: { error: showTextError() }\\\" aria-required=\\\"true\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Manage_lbl_Condition'), true, true)) + \"\\u003E\\u003Cdiv class=\\\"error RemarketingListConditionTextError\\\" data-bind=\\\"visible: showTextError(), text: errorText()\\\" role=\\\"alert\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"col-sm-3\\\"\\u003E\";\nif (view.isReadOnly) {\npug_html = pug_html + \"\\u003Cdiv\" + (\" class=\\\"remove-button-readonly disabled\\\"\"+\" name=\\\"closeBtn\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Manage_lbl_Remove'), true, true)) + \"\\u003E\\u003Cdiv class=\\\"filter_row_close filtercloseimage spritedimage valign\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"remove-text\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('Manage_lbl_Remove')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\";\n}\nelse {\npug_html = pug_html + \"\\u003Ca\" + (\" class=\\\"remove-button\\\"\"+\" name=\\\"closeBtn\\\" href=\\\"javascript:void(0);\\\"\"+pug.attr(\"aria-label\", view.i18n.getString('Manage_lbl_Remove'), true, true)) + \"\\u003E\\u003Cdiv class=\\\"filter_row_close filtercloseimage spritedimage valign\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"remove-text\\\" href=\\\"javascript:void(0);\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('Manage_lbl_Remove')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fa\\u003E\";\n}\npug_html = pug_html + \"\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003C!-- ko if: isNewConditionAllowed() --\\u003E\\u003Ca\" + (\" class=\\\"operatorButton condition-operator-button\\\"\"+\" href=\\\"javascript:void(0);\\\"\"+pug.attr(\"aria-label\", view.conditionOperator, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = view.conditionOperator) ? \"\" : pug_interp)) + \"\\u003C\\u002Fa\\u003E\\u003C!-- \\u002Fko --\\u003E\\n\\u003C!-- ko if: !isNewConditionAllowed() --\\u003E\\u003Cdiv\" + (\" class=\\\"operatorButton condition-operator-button-readonly disabled\\\"\"+\" href=\\\"javascript:void(0);\\\"\"+pug.attr(\"aria-label\", view.conditionOperator, true, true)) + \"\\u003E\" + (pug.escape(null == (pug_interp = view.conditionOperator) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003C!-- \\u002Fko --\\u003E\\u003C\\u002Fdiv\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;","var pug = require(\"!../../../../../node_modules/.pnpm/pug@2.0.4/node_modules/pug-runtime/index.js\");\n\nfunction template(locals) {var pug_html = \"\", pug_mixins = {}, pug_interp;;var locals_for_with = (locals || {});(function (view) {pug_html = pug_html + \"\\u003Cdiv class=\\\"rule-groups-array\\\" data-bind=\\\"foreach: ruleGroups\\\"\\u003E\\u003Cdiv class=\\\"rule-group section\\\" data-bind=\\\"attr: {id: "rule-group-" + id}, stopBinding: true\\\"\\u003E\\u003C\\u002Fdiv\\u003E\\u003C\\u002Fdiv\\u003E\\u003Cdiv class=\\\"error hide\\\" role=\\\"alert\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.i18n.getString('Manage_error_Rule')) ? \"\" : pug_interp)) + \"\\u003C\\u002Fdiv\\u003E\\u003Cbutton class=\\\"btn btn-default rule-group-operator-button\\\" data-bind=\\\"attr: {disabled: !isNewRuleGroupAllowed()}\\\"\\u003E\" + (pug.escape(null == (pug_interp = view.ruleGroupOperator) ? \"\" : pug_interp)) + \"\\u003C\\u002Fbutton\\u003E\";}.call(this,\"view\" in locals_for_with?locals_for_with.view:typeof view!==\"undefined\"?view:undefined));;return pug_html;};\nmodule.exports = template;"],"names":["AudienceAssociationDataConfig","_createClass","_ref","campaignType","permissions","jsData","edmCampaign","campaignTypes","_classCallCheck","this","enabledAudienceTypes","getAllEnabledAudienceTypes","key","value","audienceTypes","arguments","length","undefined","pageNumber","pageSize","query","audiencetype","_","compactArrayWithWhiteList","join","IsAIMCampaignEnabled","IsProductAudienceForSearchEnabled","audience","deliverychannel","$top","$skip","EnableImpressionBasedList","dynamic","IsCustomAudienceAllowed","IsInMarketAudienceAllowed","IsRemarketingSimilarAudienceAllowed","IsCustomerListAudienceAllowed","IsCombinedListAudienceAllowed","inputArray","whiteList","intersection","uniq","compact","AudienceAssociation","campaignId","adgroupId","currentAdGroup","AudienceAssociations","currentCampaign","currentAccount","options","expands","isExpandCampaign","isExpandAdGroup","$expand","noExclusion","$filter","top","skip","audienceTypeStringMapping","Remessaging","name","desc","Custom","InMarket","Product","RemarketingSimilar","CustomerList","CombinedList","AudienceAssociationDataAdapter","i18n","audiencesModel","map","item","Name","Id","Type","Owner","audiencesFlatList","_this","categories","groupBy","vals","type","get","description","data","items","associationModel","filter","AudienceCriterion","TargetStatus","Status","Level","BidType","BidMultiplier","AudienceId","AudienceType","AudienceName","associationFlatList","targetStatus","selected","AudienceAssociationRepository","dataConfig","dataAdapter","cachedAudiencesByChannel","forceReload","getAudiencesQuery","deliveryChannel","Promise","Audience","findAll","entitySet","then","mapAudiencesToFlatList","_this2","dataStore","getAssociationDataStore","getAssociationQuery","mapAudienceAssociationsToFlatList","AudienceAssociationUtils","audiences","customerId","x","expressions","id","getString","descriptionFirstGroup","descriptionOtherGroups","groupOperator","conditionOperator","CNFOrDNFViewModel","CNF","DNF","expressionType","Constraints","ExpressionGroupType","expressionMode","ko","expressionGroupList","skipEmptyConditions","result","toJSON","valid","validate","operandCategory","operatorType","expressionOperand","category","getOperandData","operand","filterOperatorsByType","operandData","expressionOperator","ConditionViewModel","isNewParametersAllowed","operandItem","Operand","qualifiedOperands","operandsList","slice","filterOperandsByCategory","qualifiedOperators","operandInfo","predicateList","conjunctionList","predicateSelectedValue","conjunctionSelectedValue","Operator","conditionText","Value","errorText","showTextError","predicateSelectedText","subscribe","newItem","operators","toString","split","trim","indexOf","numberValue","Number","countDecimals","ConditionBuilderViewModel","isReadOnly","conditions","conditionCount","isNewConditionAllowed","condition","push","expression","ConditionBuilderView","_KnockoutView","_callSuper","_inherits","others","_objectWithoutProperties","_excluded","_superPropGet","_objectSpread","conditionTitle","viewModel","init","ExpressionSet","e","stopPropagation","preventDefault","target","remove","trigger","template","KnockoutView","getExpressionData","RuleGroupViewModel","ruleGroups","ruleGroupCount","isNewRuleGroupAllowed","removeRuleGroup","ruleGroup","index","conditionBuilder","render","ruleGroupId","on","ruleGroupView","view","expressionSet","RuleGroupView","EnableRemarketingListBasedParameter","ruleGroupOperator","bind","stopBinding","controlsDescendantBindings","$","concat","html","$el","showError","hideError","find","removeClass","addClass","Conditions","audienceCount","_ref2","CNFOrDNFView","setChild","BlockAdBlock","_options","checkOnLoad","resetOnEnd","loopCheckTime","loopMaxNumber","baitClass","baitStyle","debug","_var","version","bait","checking","loop","loopNumber","event","detected","notDetected","setOption","self","eventCallback","setTimeout","_log","_creatBait","window","addEventListener","attachEvent","adBlockOn","prototype","_bait","method","message","option","document","createElement","setAttribute","body","appendChild","offsetParent","offsetHeight","offsetLeft","offsetTop","offsetWidth","clientHeight","clientWidth","_destroyBait","parentElement","removeChild","check","setInterval","_checkBait","getAttribute","getComputedStyle","baitTemp","getPropertyValue","_stopLoop","emitEvent","clearInterval","fns","i","parseInt","Object","hasOwnProperty","call","clearEvent","fn","onDetected","onNotDetected","getAdBlockOn","logMessage","setAdBlockOn","blockAdBlock","adBlockDetected","isProxy","location","port","isAdBlockOn","_ref$CampaignUIAPI","CampaignUIAPI","resolve","reject","url","success","error","catch","MinimumCompatibleBrowserVersion","IE","Chrome","Firefox","Safari","Opera","Edge","getBrowserInfo","t","ua","navigator","userAgent","matches","match","test","exec","parseFloat","app","appName","appVersion","splice","isCompatibleBrowser","_getBrowserInfo","getInternetExplorerVersion","v","isIEXOrLess","pug","module","exports","locals","pug_interp","pug_html","locals_for_with","escape","attr"],"sourceRoot":""}