module.exports = "(function(i,e,n){var t=n(5894),r=n(7358),a=n(6487),o=n(843),d=n(4451).b,s=n(1571),c=n(4810),u=n(4457);e.isValidExperiment=function(i,e){var n,r=t.partial(t.includes,i);return c.groupCollapsed(\"Decision / Evaluating audiences for experiment:\",e,i),n=!e.audienceIds||o.evaluate(e.audienceIds,r),c.groupEnd(),c.debug(\"Decision / Experiment\",e,\"is valid?\",n),n},e.selectVariation=function(i,e,n,o,f){if(c.debug(\"Decision / Selecting variation for experiment:\",i.id),!i.variations||0===i.variations.length)throw new d('No variations in selected experiment \"'+i.id+'\"');if(!i.weightDistributions&&i.variations.length>1)throw new d('On selected experiment \"'+i.id+'\", weightDistributions must be defined if # variations > 1');var g;if(i.bucketingStrategy&&\"impression\"===i.bucketingStrategy)if(1===i.variations.length)g=i.variations[0].id;else{var p=o;g=a.chooseWeightedCandidate(n+p,i.id,i.weightDistributions)}else if(g=1===i.variations.length?i.variations[0].id:a.chooseWeightedCandidate(n,i.id,i.weightDistributions),f&&f[i.id]){c.debug(\"Decision / Using preferredVariationMap to select variation for experiment:\",i.id);var v=f[i.id];if(!t.find(i.variations,{id:v}))return s.dispatch(r.RECORD_STICKY_BUCKETING_FEATURE,{feature:\"stoppedVariation\",id:i.id}),c.debug(\"Decision / Preferred variation:\",v,\"not found on experiment:\",i.id,\". Visitor not bucketed.\"),null;v!==g&&(s.dispatch(r.RECORD_STICKY_BUCKETING_FEATURE,{feature:\"preferredVariation\",id:i.id}),g=v)}var l=u.processCmabExperiment(i,g);l&&(g=l);var h=t.find(i.variations,{id:g});if(h)return c.debug(\"Decision / Selected variation:\",h),h;throw new d('Unable to find selected variation: \"'+g+'\".')},e.getExperimentById=function(i,e){var n=t.find(i.experiments,{id:e});if(n)return n;throw new d(\"Unable to find selected experiment.\")},e.hasVariationActionsOnView=function(i,e){return c.debug(\"Decision / Checking variation:\",i,\"for actions on pageId:\",e),!!t.find(i.actions,(function(i){return i.pageId===e&&!t.isEmpty(i.changes)}))}})";