module.exports = "(function(e,i,r){var n=r(5894),t=r(7358),a=r(343),o=r(345),d=r(6487),c=r(2165),s=r(4451).b,l=r(4527),u=r(4438),p=r(1571),g=r(2062),I=r(7760),y=r(4810),f=r(3316),m=l.get(\"stores/plugins\"),b=l.get(\"stores/global\"),v=l.get(\"stores/layer_data\");function h(e){var i=m.getPlugin(u.PluginTypes.deciders,e);if(n.isEmpty(i))throw new Error(\"No deciders found for policy: \"+e);return i}i.isPageIdRelevant=function(e){if(!e)return!1;var i=h(e.policy);return n.isFunction(i.includePageIdInDecisionTicket)?i.includePageIdInDecisionTicket(e):!0===i.includePageIdInDecisionTicket},i.createTicket=function(e){var i,t,a,d=n.pick(e,[\"bucketingId\",\"globalHoldback\",\"preferredVariationMap\",\"pageId\"]);return n.extend(d,{audienceIds:(i=e.visitorProfile,t=e.audiences,a=m.getAllPlugins(u.PluginTypes.audienceMatchers),n.reduce(t,(function(e,r){return o.isInAudience(i,r,a)&&e.push(r.id),e}),[])),activationId:b.getActivationId()}),(__PROFILE__||__RUM_VERBOSE__)&&r(9256).timeEnd(\"getDecisionTicket\"),d},i.decideGlobal=function(e){return{isGlobalHoldback:d.isHoldback(e.bucketingId,{id:null,holdback:e.globalHoldback})}},__GROUPS__&&(i.decideGroup=function(e,i){y.debug(\"Decision / Deciding layer for group: \",g.description(e));var r,a,o=i.preferredLayerId,c=!!o;try{(r=d.chooseWeightedCandidate(i.bucketingId,e.id,e.weightDistributions))&&\"None\"!==r||(a='Group traffic allocation. Visitor maps to a \"hole\" in the bucket space left by an experiment or campaign that\\'s since been removed from the group')}catch(e){a=\"Group traffic allocation. Visitor maps to a point in the bucket space which has never been covered by any experiment or campaign.\"}if(c&&(y.debug(\"Decision / Using preferredLayerMap to select layer for group:\",g.description(e)),o!==r&&(p.dispatch(t.RECORD_STICKY_BUCKETING_FEATURE,{feature:\"preferredLayer\",id:e.id}),r=o)),a)return{layerId:null,reason:a};if(!n.find(e.weightDistributions,{entityId:r})){var l=\"Visitor was\"+(c?\" sticky-\":\" non-sticky \")+\"bucketed into a campaign (\"+r+\") which is not in the group\";if(!c)throw new s(l);return{layerId:null,reason:l}}return{layerId:r}}),i.decideLayer=function(e,i){var t,o;y.debug(\"Deciding: \",e,i);var l,u,p=h(e.policy),g={layerId:e.id,experimentId:null,variationId:null,isLayerHoldback:d.isHoldback(i.bucketingId,e)};if(n.isEmpty(e.experiments))throw new s(\"No experiments in layer.\");try{if(p.decideLayer){y.debug(\"Decision / Using decider's custom decideLayer.\");var I=p.decideLayer(e,i);t=I.experiment,o=I.variation}else y.debug(\"Decision / Using default decideLayer behavior.\"),t=p.selectExperiment(e,i.audienceIds,i.bucketingId),o=c.selectVariation(t,i.audienceIds,i.bucketingId,i.activationId,i.preferredVariationMap)}catch(e){l=e,(null!=(u=s)&&\"undefined\"!=typeof Symbol&&u[Symbol.hasInstance]?u[Symbol.hasInstance](l):l instanceof u)?g.reason=e.message:g.error=e}return g.experimentId=t?t.id:null,g.variationId=o?o.id:null,g.error&&(g.error.name=\"DecisionEngineError\",a.emitError(g.error)),__INVARIANT__&&r(2048).isType(\"Decision\",g),g},i.getDummyLayerDecision=function(e,i){var n,t=function(e,i){for(var r=0;r<e.experiments.length;r++)for(var n=0;n<e.experiments[r].variations.length;n++)if(i.indexOf(e.experiments[r].variations[n].id)>-1)return{experimentId:e.experiments[r].id,variationId:e.experiments[r].variations[n].id};return null}(e,i);return t?(y.log(\"Decision / Applying force variation:\",t.variationId,\"to Campaign\",I.description(e)),n={layerId:e.id,variationId:t.variationId,experimentId:t.experimentId,isLayerHoldback:!1,reason:\"force\"}):(y.log(\"No variation matches ids:\",i,\"in Campaign\",I.description(e)),n={layerId:e.id,variationId:null,experimentId:null,isLayerHoldback:!1,reason:\"force\"}),__INVARIANT__&&r(2048).isType(\"Decision\",n),n},i.isInCohort=function(e){if(!e.experimentId||!e.variationId)return!1;var i=v.get(e.layerId);return!(f.isSingleExperimentPolicy(i.policy)&&e.isLayerHoldback)}})";