@uniformdev/context 19.128.0 → 19.128.1-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { av as paths$7, N as ManifestV2 } from '../types-R41eD1zH.mjs';
1
+ import { ay as paths$7, N as ManifestV2 } from '../types-o-_vpf1P.mjs';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
package/dist/api/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { av as paths$7, N as ManifestV2 } from '../types-R41eD1zH.js';
1
+ import { ay as paths$7, N as ManifestV2 } from '../types-o-_vpf1P.js';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-R41eD1zH.mjs';
2
- export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, at as ContextState, au as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, ak as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, aq as EnrichmentData, ar as EventData, H as GroupCriteriaEvaluator, af as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, aa as ModifyScoreCommand, ab as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, a2 as PersonalizeOptions, a6 as PersonalizedResult, a5 as PersonalizedVariant, ao as Quirks, ai as SERVER_STATE_ID, ah as ServerToClientTransitionState, ac as SetConsentCommand, ag as SetControlGroupCommand, ad as SetQuirkCommand, ae as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, ap as Tests, aj as TransitionDataStoreEvents, an as VisitorDataStore, am as VisitorDataStoreEvents, al as VisitorDataStoreOptions, as as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-R41eD1zH.mjs';
1
+ import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-o-_vpf1P.mjs';
2
+ export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, aw as ContextState, ax as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, al as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, ar as EnrichmentData, au as EventData, H as GroupCriteriaEvaluator, af as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, aa as ModifyScoreCommand, ab as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, as as PersonalizeControlVariant, a2 as PersonalizeOptions, at as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ap as Quirks, aj as SERVER_STATE_ID, ai as ServerToClientTransitionState, ac as SetConsentCommand, ag as SetControlGroupCommand, ah as SetPersonalizeVariantControlCommand, ad as SetQuirkCommand, ae as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, aq as Tests, ak as TransitionDataStoreEvents, ao as VisitorDataStore, an as VisitorDataStoreEvents, am as VisitorDataStoreOptions, av as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-o-_vpf1P.mjs';
3
3
  import Cookies from 'js-cookie';
4
4
  import 'mitt';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-R41eD1zH.js';
2
- export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, at as ContextState, au as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, ak as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, aq as EnrichmentData, ar as EventData, H as GroupCriteriaEvaluator, af as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, aa as ModifyScoreCommand, ab as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, a2 as PersonalizeOptions, a6 as PersonalizedResult, a5 as PersonalizedVariant, ao as Quirks, ai as SERVER_STATE_ID, ah as ServerToClientTransitionState, ac as SetConsentCommand, ag as SetControlGroupCommand, ad as SetQuirkCommand, ae as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, ap as Tests, aj as TransitionDataStoreEvents, an as VisitorDataStore, am as VisitorDataStoreEvents, al as VisitorDataStoreOptions, as as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-R41eD1zH.js';
1
+ import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-o-_vpf1P.js';
2
+ export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, aw as ContextState, ax as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, al as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, ar as EnrichmentData, au as EventData, H as GroupCriteriaEvaluator, af as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, aa as ModifyScoreCommand, ab as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, as as PersonalizeControlVariant, a2 as PersonalizeOptions, at as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ap as Quirks, aj as SERVER_STATE_ID, ai as ServerToClientTransitionState, ac as SetConsentCommand, ag as SetControlGroupCommand, ah as SetPersonalizeVariantControlCommand, ad as SetQuirkCommand, ae as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, aq as Tests, ak as TransitionDataStoreEvents, ao as VisitorDataStore, an as VisitorDataStoreEvents, am as VisitorDataStoreOptions, av as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-o-_vpf1P.js';
3
3
  import Cookies from 'js-cookie';
4
4
  import 'mitt';
5
5
 
package/dist/index.esm.js CHANGED
@@ -123,6 +123,15 @@ var SignalInstance = class {
123
123
  _evaluator = new WeakMap();
124
124
  _onLogMessage = new WeakMap();
125
125
 
126
+ // src/manifest/utils/control.ts
127
+ var rollForControlGroup = (value) => {
128
+ let control = value;
129
+ if (control >= 1) {
130
+ control = control / 100;
131
+ }
132
+ return Math.random() < control;
133
+ };
134
+
126
135
  // src/manifest/ManifestInstance.ts
127
136
  var _mf, _signalInstances, _onLogMessage2;
128
137
  var ManifestInstance = class {
@@ -146,12 +155,8 @@ var ManifestInstance = class {
146
155
  __privateSet(this, _onLogMessage2, onLogMessage);
147
156
  }
148
157
  rollForControlGroup() {
149
- var _a, _b;
150
- let control = (_b = (_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.control) != null ? _b : 0;
151
- if (control >= 1) {
152
- control = control / 100;
153
- }
154
- return Math.random() < control;
158
+ var _a;
159
+ return rollForControlGroup(((_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.control) || 0);
155
160
  }
156
161
  getTest(name) {
157
162
  var _a;
@@ -499,7 +504,30 @@ function evaluateDimensionMatch(crit, vec, onLogMessage) {
499
504
  var _a, _b;
500
505
  const { op, l: lhs } = crit;
501
506
  const lhsScore = (_a = vec[lhs]) != null ? _a : 0;
502
- if (op === "+") {
507
+ if (op === "^") {
508
+ const [cat] = lhs.split(ENR_SEPARATOR);
509
+ let topVectorName = void 0;
510
+ let topScore = 0;
511
+ Object.keys(vec).forEach((vectorName) => {
512
+ if (vectorName.startsWith(`${cat}${ENR_SEPARATOR}`)) {
513
+ const score = vec[vectorName];
514
+ if (score > topScore) {
515
+ topVectorName = vectorName;
516
+ topScore = score;
517
+ }
518
+ }
519
+ });
520
+ const result = topVectorName === lhs;
521
+ onLogMessage == null ? void 0 : onLogMessage([
522
+ "info",
523
+ 302,
524
+ {
525
+ matched: result,
526
+ description: `${crit.l} has the highest score in the category`
527
+ }
528
+ ]);
529
+ return result;
530
+ } else if (op === "+") {
503
531
  const result = Math.max(...Object.values(vec)) === lhsScore && lhsScore > 0;
504
532
  onLogMessage == null ? void 0 : onLogMessage([
505
533
  "info",
@@ -586,31 +614,66 @@ function personalizeVariations({
586
614
  take = 1,
587
615
  onLogMessage
588
616
  }) {
589
- var _a, _b, _c;
617
+ var _a, _b, _c, _d;
590
618
  onLogMessage == null ? void 0 : onLogMessage(["info", 300, "GROUP", { name, take }]);
591
619
  try {
592
620
  const control = (_a = context.storage.data.controlGroup) != null ? _a : false;
593
621
  const results = [];
594
622
  let personalized = false;
595
623
  const scores = context.scores;
624
+ let index = 0;
625
+ const defaultVariants = [];
626
+ for (const variant of variations) {
627
+ if (!((_b = variant.pz) == null ? void 0 : _b.crit.length)) {
628
+ defaultVariants.push(variant);
629
+ }
630
+ }
596
631
  for (const variant of variations) {
632
+ const currentIndex = index++;
597
633
  if (results.length === take) {
598
634
  break;
599
635
  }
600
- if (!((_b = variant.pz) == null ? void 0 : _b.crit.length)) {
601
- onLogMessage == null ? void 0 : onLogMessage(["info", 301, "GROUP", { id: variant.id, op: (_c = variant.pz) == null ? void 0 : _c.op }]);
636
+ if (!((_c = variant.pz) == null ? void 0 : _c.crit.length)) {
637
+ onLogMessage == null ? void 0 : onLogMessage(["info", 301, "GROUP", { id: variant.id, op: (_d = variant.pz) == null ? void 0 : _d.op }]);
602
638
  onLogMessage == null ? void 0 : onLogMessage(["info", 302, { matched: true, description: "default variation" }]);
603
639
  onLogMessage == null ? void 0 : onLogMessage(["info", 303, true]);
604
640
  onLogMessage == null ? void 0 : onLogMessage(["info", 301, "ENDGROUP"]);
605
- results.push(variant);
641
+ results.push({
642
+ ...variant,
643
+ control: false
644
+ });
606
645
  continue;
607
646
  }
608
647
  if (control) {
609
648
  continue;
610
649
  }
611
650
  if (evaluateVariantMatch(variant.id, variant.pz, scores, onLogMessage)) {
612
- personalized = true;
613
- results.push(variant);
651
+ let variantToAdd = variant;
652
+ const isControl = false;
653
+ if (take === 1 && defaultVariants.length && typeof variant.pz.control === "number") {
654
+ let isControl2 = context.getPersonalizeVariantControl(name, currentIndex);
655
+ if (typeof isControl2 === "undefined") {
656
+ isControl2 = rollForControlGroup(variant.pz.control);
657
+ context.storage.updateData([
658
+ {
659
+ type: "setpersonalizecontrol",
660
+ data: {
661
+ personlizationName: name,
662
+ index: currentIndex,
663
+ control: isControl2
664
+ }
665
+ }
666
+ ]);
667
+ }
668
+ if (isControl2) {
669
+ variantToAdd = defaultVariants[0];
670
+ }
671
+ }
672
+ personalized = variant.id === variantToAdd.id;
673
+ results.push({
674
+ ...variantToAdd,
675
+ control: isControl
676
+ });
614
677
  }
615
678
  }
616
679
  return {
@@ -857,16 +920,19 @@ function parseScoreCookie(cookieValue) {
857
920
  if (!cookieValue)
858
921
  return;
859
922
  const types = cookieValue.split(TYPE_SEP);
860
- if (types.length > 3)
923
+ if (types.length > 5)
861
924
  return;
862
- const [abTestData, sessionScores, visitorScores] = types;
863
- return {
925
+ const [abTestData, sessionScores, visitorScores, controlGroup, personalizeVariants] = types;
926
+ const data = {
864
927
  // this is true since we're reading a cookie, which wouldn't exist if consent wasn't given
865
928
  consent: true,
866
929
  sessionScores: decodeCookieType(parseCookieType(sessionScores)),
867
930
  scores: decodeCookieType(parseCookieType(visitorScores)),
868
- tests: parseCookieType(abTestData)
931
+ tests: parseCookieType(abTestData),
932
+ controlGroup: controlGroup === "1",
933
+ personalizeVariants: decodePersonalizeVariants(personalizeVariants)
869
934
  };
935
+ return data;
870
936
  }
871
937
  function parseCookieType(type) {
872
938
  if (!type) {
@@ -890,9 +956,48 @@ function serializeCookie(data) {
890
956
  return [
891
957
  serializeCookieType(data.tests),
892
958
  serializeCookieType(encodeCookieType(data.sessionScores)),
893
- serializeCookieType(encodeCookieType(data.scores))
959
+ serializeCookieType(encodeCookieType(data.scores)),
960
+ data.controlGroup ? "1" : "0",
961
+ serializePersonalizeVariants(data)
894
962
  ].join(TYPE_SEP);
895
963
  }
964
+ function serializePersonalizeVariants({
965
+ personalizeVariants
966
+ }) {
967
+ const data = {};
968
+ if (typeof personalizeVariants === "object") {
969
+ Object.keys(personalizeVariants).forEach((personalizationName) => {
970
+ const results = [];
971
+ const variants = personalizeVariants[personalizationName];
972
+ variants.forEach((variant) => {
973
+ results.push(`${variant.index}:${variant.control ? "1" : "0"}`);
974
+ });
975
+ data[personalizationName] = results.join(",");
976
+ });
977
+ }
978
+ const serialized = serializeCookieType(data);
979
+ return serialized;
980
+ }
981
+ function decodePersonalizeVariants(data) {
982
+ const parsed = parseCookieType(data);
983
+ const keys = Object.keys(parsed);
984
+ if (!keys.length) {
985
+ return void 0;
986
+ }
987
+ const results = {};
988
+ Object.keys(parsed).forEach((k) => {
989
+ const variants = parsed[k].split(",");
990
+ const key = decodeURIComponent(k);
991
+ results[key] = variants.map((variant) => {
992
+ const [index, control] = variant.split(":");
993
+ return {
994
+ index: parseInt(index, 10),
995
+ control: control === "1"
996
+ };
997
+ });
998
+ });
999
+ return results;
1000
+ }
896
1001
  function encodeCookieType(type) {
897
1002
  return Object.entries(type).reduce((acc, [key, value]) => {
898
1003
  acc[key] = ntob(value);
@@ -980,7 +1085,8 @@ var emptyVisitorData = () => ({
980
1085
  sessionScores: {},
981
1086
  tests: {},
982
1087
  consent: false,
983
- controlGroup: false
1088
+ controlGroup: false,
1089
+ personalizeVariants: {}
984
1090
  });
985
1091
 
986
1092
  // src/storage/VisitorDataStore.ts
@@ -1029,6 +1135,25 @@ function applyCommandsToData(commands, state, inControlGroup) {
1029
1135
  case "setcontrol":
1030
1136
  newData.controlGroup = command.data;
1031
1137
  break;
1138
+ case "setpersonalizecontrol":
1139
+ if (!newData.personalizeVariants) {
1140
+ newData.personalizeVariants = {};
1141
+ }
1142
+ if (!newData.personalizeVariants[command.data.personlizationName]) {
1143
+ newData.personalizeVariants[command.data.personlizationName] = [];
1144
+ }
1145
+ const existingDef = newData.personalizeVariants[command.data.personlizationName].find(
1146
+ (i) => i.index === command.data.index
1147
+ );
1148
+ if (!existingDef) {
1149
+ newData.personalizeVariants[command.data.personlizationName].push({
1150
+ index: command.data.index,
1151
+ control: command.data.control
1152
+ });
1153
+ } else if (existingDef.control !== command.data.control) {
1154
+ existingDef.control = command.data.control;
1155
+ }
1156
+ break;
1032
1157
  default:
1033
1158
  throw new Error(`Unknown command`);
1034
1159
  }
@@ -1390,7 +1515,7 @@ var Context = class {
1390
1515
  * will NOT result in a recomputation of signal state.
1391
1516
  */
1392
1517
  async update(newData) {
1393
- var _a, _b, _c;
1518
+ var _a, _b, _c, _d;
1394
1519
  const commands = [];
1395
1520
  const newServerSideTests = {};
1396
1521
  if ((_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) {
@@ -1420,6 +1545,17 @@ var Context = class {
1420
1545
  );
1421
1546
  }
1422
1547
  }
1548
+ if ((_c = __privateGet(this, _serverTransitionState)) == null ? void 0 : _c.personalizeVariants) {
1549
+ Object.keys(__privateGet(this, _serverTransitionState).personalizeVariants).forEach((personalizationName) => {
1550
+ const variants = __privateGet(this, _serverTransitionState).personalizeVariants[personalizationName];
1551
+ variants.forEach((e) => {
1552
+ commands.push({
1553
+ type: "setpersonalizecontrol",
1554
+ data: { personlizationName: personalizationName, index: e.index, control: e.control }
1555
+ });
1556
+ });
1557
+ });
1558
+ }
1423
1559
  try {
1424
1560
  __privateGet(this, _mitt3).emit("log", [
1425
1561
  "info",
@@ -1429,7 +1565,7 @@ var Context = class {
1429
1565
  ...newData,
1430
1566
  // need to convert url to string so it can be json serialized
1431
1567
  // to go over postMessage to chrome extension
1432
- url: (_c = newData.url) == null ? void 0 : _c.toString()
1568
+ url: (_d = newData.url) == null ? void 0 : _d.toString()
1433
1569
  }
1434
1570
  ]);
1435
1571
  if (newData.quirks) {
@@ -1511,6 +1647,13 @@ var Context = class {
1511
1647
  }
1512
1648
  ]);
1513
1649
  }
1650
+ getPersonalizeVariantControl(name, index) {
1651
+ var _a, _b, _c;
1652
+ const source = (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.personalizeVariants) != null ? _b : this.storage.data.personalizeVariants;
1653
+ const variants = (_c = source == null ? void 0 : source[name]) != null ? _c : [];
1654
+ const variant = variants.find((v) => v.index === index);
1655
+ return variant == null ? void 0 : variant.control;
1656
+ }
1514
1657
  /**
1515
1658
  * Writes a message to the Context log sink.
1516
1659
  * Used by Uniform internal SDK; not intended for public use.
@@ -1553,10 +1696,10 @@ var Context = class {
1553
1696
  const previousPlacement = __privateGet(this, _pzCache)[options.name];
1554
1697
  const eventData = {
1555
1698
  name: options.name,
1556
- variantIds: value.variations.map((variation) => {
1557
- var _a;
1558
- return (_a = variation.id) != null ? _a : "Unknown";
1559
- }),
1699
+ variantIds: value.variations.map((variation) => ({
1700
+ id: variation.id || "Unknown",
1701
+ control: variation.control
1702
+ })),
1560
1703
  control: this.storage.data.controlGroup,
1561
1704
  changed: true
1562
1705
  };
@@ -1584,7 +1727,8 @@ var Context = class {
1584
1727
  const transitionState = {
1585
1728
  quirks: this.storage.data.quirks,
1586
1729
  ssv: __privateGet(this, _scores),
1587
- tests: {}
1730
+ tests: {},
1731
+ personalizeVariants: this.storage.data.personalizeVariants
1588
1732
  };
1589
1733
  const allTests = this.storage.data.tests;
1590
1734
  Object.entries(allTests).map(([testName, testValue]) => {
package/dist/index.js CHANGED
@@ -193,6 +193,15 @@ var SignalInstance = class {
193
193
  _evaluator = new WeakMap();
194
194
  _onLogMessage = new WeakMap();
195
195
 
196
+ // src/manifest/utils/control.ts
197
+ var rollForControlGroup = (value) => {
198
+ let control = value;
199
+ if (control >= 1) {
200
+ control = control / 100;
201
+ }
202
+ return Math.random() < control;
203
+ };
204
+
196
205
  // src/manifest/ManifestInstance.ts
197
206
  var _mf, _signalInstances, _onLogMessage2;
198
207
  var ManifestInstance = class {
@@ -216,12 +225,8 @@ var ManifestInstance = class {
216
225
  __privateSet(this, _onLogMessage2, onLogMessage);
217
226
  }
218
227
  rollForControlGroup() {
219
- var _a, _b;
220
- let control = (_b = (_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.control) != null ? _b : 0;
221
- if (control >= 1) {
222
- control = control / 100;
223
- }
224
- return Math.random() < control;
228
+ var _a;
229
+ return rollForControlGroup(((_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.control) || 0);
225
230
  }
226
231
  getTest(name) {
227
232
  var _a;
@@ -569,7 +574,30 @@ function evaluateDimensionMatch(crit, vec, onLogMessage) {
569
574
  var _a, _b;
570
575
  const { op, l: lhs } = crit;
571
576
  const lhsScore = (_a = vec[lhs]) != null ? _a : 0;
572
- if (op === "+") {
577
+ if (op === "^") {
578
+ const [cat] = lhs.split(ENR_SEPARATOR);
579
+ let topVectorName = void 0;
580
+ let topScore = 0;
581
+ Object.keys(vec).forEach((vectorName) => {
582
+ if (vectorName.startsWith(`${cat}${ENR_SEPARATOR}`)) {
583
+ const score = vec[vectorName];
584
+ if (score > topScore) {
585
+ topVectorName = vectorName;
586
+ topScore = score;
587
+ }
588
+ }
589
+ });
590
+ const result = topVectorName === lhs;
591
+ onLogMessage == null ? void 0 : onLogMessage([
592
+ "info",
593
+ 302,
594
+ {
595
+ matched: result,
596
+ description: `${crit.l} has the highest score in the category`
597
+ }
598
+ ]);
599
+ return result;
600
+ } else if (op === "+") {
573
601
  const result = Math.max(...Object.values(vec)) === lhsScore && lhsScore > 0;
574
602
  onLogMessage == null ? void 0 : onLogMessage([
575
603
  "info",
@@ -656,31 +684,66 @@ function personalizeVariations({
656
684
  take = 1,
657
685
  onLogMessage
658
686
  }) {
659
- var _a, _b, _c;
687
+ var _a, _b, _c, _d;
660
688
  onLogMessage == null ? void 0 : onLogMessage(["info", 300, "GROUP", { name, take }]);
661
689
  try {
662
690
  const control = (_a = context.storage.data.controlGroup) != null ? _a : false;
663
691
  const results = [];
664
692
  let personalized = false;
665
693
  const scores = context.scores;
694
+ let index = 0;
695
+ const defaultVariants = [];
696
+ for (const variant of variations) {
697
+ if (!((_b = variant.pz) == null ? void 0 : _b.crit.length)) {
698
+ defaultVariants.push(variant);
699
+ }
700
+ }
666
701
  for (const variant of variations) {
702
+ const currentIndex = index++;
667
703
  if (results.length === take) {
668
704
  break;
669
705
  }
670
- if (!((_b = variant.pz) == null ? void 0 : _b.crit.length)) {
671
- onLogMessage == null ? void 0 : onLogMessage(["info", 301, "GROUP", { id: variant.id, op: (_c = variant.pz) == null ? void 0 : _c.op }]);
706
+ if (!((_c = variant.pz) == null ? void 0 : _c.crit.length)) {
707
+ onLogMessage == null ? void 0 : onLogMessage(["info", 301, "GROUP", { id: variant.id, op: (_d = variant.pz) == null ? void 0 : _d.op }]);
672
708
  onLogMessage == null ? void 0 : onLogMessage(["info", 302, { matched: true, description: "default variation" }]);
673
709
  onLogMessage == null ? void 0 : onLogMessage(["info", 303, true]);
674
710
  onLogMessage == null ? void 0 : onLogMessage(["info", 301, "ENDGROUP"]);
675
- results.push(variant);
711
+ results.push({
712
+ ...variant,
713
+ control: false
714
+ });
676
715
  continue;
677
716
  }
678
717
  if (control) {
679
718
  continue;
680
719
  }
681
720
  if (evaluateVariantMatch(variant.id, variant.pz, scores, onLogMessage)) {
682
- personalized = true;
683
- results.push(variant);
721
+ let variantToAdd = variant;
722
+ const isControl = false;
723
+ if (take === 1 && defaultVariants.length && typeof variant.pz.control === "number") {
724
+ let isControl2 = context.getPersonalizeVariantControl(name, currentIndex);
725
+ if (typeof isControl2 === "undefined") {
726
+ isControl2 = rollForControlGroup(variant.pz.control);
727
+ context.storage.updateData([
728
+ {
729
+ type: "setpersonalizecontrol",
730
+ data: {
731
+ personlizationName: name,
732
+ index: currentIndex,
733
+ control: isControl2
734
+ }
735
+ }
736
+ ]);
737
+ }
738
+ if (isControl2) {
739
+ variantToAdd = defaultVariants[0];
740
+ }
741
+ }
742
+ personalized = variant.id === variantToAdd.id;
743
+ results.push({
744
+ ...variantToAdd,
745
+ control: isControl
746
+ });
684
747
  }
685
748
  }
686
749
  return {
@@ -927,16 +990,19 @@ function parseScoreCookie(cookieValue) {
927
990
  if (!cookieValue)
928
991
  return;
929
992
  const types = cookieValue.split(TYPE_SEP);
930
- if (types.length > 3)
993
+ if (types.length > 5)
931
994
  return;
932
- const [abTestData, sessionScores, visitorScores] = types;
933
- return {
995
+ const [abTestData, sessionScores, visitorScores, controlGroup, personalizeVariants] = types;
996
+ const data = {
934
997
  // this is true since we're reading a cookie, which wouldn't exist if consent wasn't given
935
998
  consent: true,
936
999
  sessionScores: decodeCookieType(parseCookieType(sessionScores)),
937
1000
  scores: decodeCookieType(parseCookieType(visitorScores)),
938
- tests: parseCookieType(abTestData)
1001
+ tests: parseCookieType(abTestData),
1002
+ controlGroup: controlGroup === "1",
1003
+ personalizeVariants: decodePersonalizeVariants(personalizeVariants)
939
1004
  };
1005
+ return data;
940
1006
  }
941
1007
  function parseCookieType(type) {
942
1008
  if (!type) {
@@ -960,9 +1026,48 @@ function serializeCookie(data) {
960
1026
  return [
961
1027
  serializeCookieType(data.tests),
962
1028
  serializeCookieType(encodeCookieType(data.sessionScores)),
963
- serializeCookieType(encodeCookieType(data.scores))
1029
+ serializeCookieType(encodeCookieType(data.scores)),
1030
+ data.controlGroup ? "1" : "0",
1031
+ serializePersonalizeVariants(data)
964
1032
  ].join(TYPE_SEP);
965
1033
  }
1034
+ function serializePersonalizeVariants({
1035
+ personalizeVariants
1036
+ }) {
1037
+ const data = {};
1038
+ if (typeof personalizeVariants === "object") {
1039
+ Object.keys(personalizeVariants).forEach((personalizationName) => {
1040
+ const results = [];
1041
+ const variants = personalizeVariants[personalizationName];
1042
+ variants.forEach((variant) => {
1043
+ results.push(`${variant.index}:${variant.control ? "1" : "0"}`);
1044
+ });
1045
+ data[personalizationName] = results.join(",");
1046
+ });
1047
+ }
1048
+ const serialized = serializeCookieType(data);
1049
+ return serialized;
1050
+ }
1051
+ function decodePersonalizeVariants(data) {
1052
+ const parsed = parseCookieType(data);
1053
+ const keys = Object.keys(parsed);
1054
+ if (!keys.length) {
1055
+ return void 0;
1056
+ }
1057
+ const results = {};
1058
+ Object.keys(parsed).forEach((k) => {
1059
+ const variants = parsed[k].split(",");
1060
+ const key = decodeURIComponent(k);
1061
+ results[key] = variants.map((variant) => {
1062
+ const [index, control] = variant.split(":");
1063
+ return {
1064
+ index: parseInt(index, 10),
1065
+ control: control === "1"
1066
+ };
1067
+ });
1068
+ });
1069
+ return results;
1070
+ }
966
1071
  function encodeCookieType(type) {
967
1072
  return Object.entries(type).reduce((acc, [key, value]) => {
968
1073
  acc[key] = ntob(value);
@@ -1050,7 +1155,8 @@ var emptyVisitorData = () => ({
1050
1155
  sessionScores: {},
1051
1156
  tests: {},
1052
1157
  consent: false,
1053
- controlGroup: false
1158
+ controlGroup: false,
1159
+ personalizeVariants: {}
1054
1160
  });
1055
1161
 
1056
1162
  // src/storage/VisitorDataStore.ts
@@ -1099,6 +1205,25 @@ function applyCommandsToData(commands, state, inControlGroup) {
1099
1205
  case "setcontrol":
1100
1206
  newData.controlGroup = command.data;
1101
1207
  break;
1208
+ case "setpersonalizecontrol":
1209
+ if (!newData.personalizeVariants) {
1210
+ newData.personalizeVariants = {};
1211
+ }
1212
+ if (!newData.personalizeVariants[command.data.personlizationName]) {
1213
+ newData.personalizeVariants[command.data.personlizationName] = [];
1214
+ }
1215
+ const existingDef = newData.personalizeVariants[command.data.personlizationName].find(
1216
+ (i) => i.index === command.data.index
1217
+ );
1218
+ if (!existingDef) {
1219
+ newData.personalizeVariants[command.data.personlizationName].push({
1220
+ index: command.data.index,
1221
+ control: command.data.control
1222
+ });
1223
+ } else if (existingDef.control !== command.data.control) {
1224
+ existingDef.control = command.data.control;
1225
+ }
1226
+ break;
1102
1227
  default:
1103
1228
  throw new Error(`Unknown command`);
1104
1229
  }
@@ -1460,7 +1585,7 @@ var Context = class {
1460
1585
  * will NOT result in a recomputation of signal state.
1461
1586
  */
1462
1587
  async update(newData) {
1463
- var _a, _b, _c;
1588
+ var _a, _b, _c, _d;
1464
1589
  const commands = [];
1465
1590
  const newServerSideTests = {};
1466
1591
  if ((_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) {
@@ -1490,6 +1615,17 @@ var Context = class {
1490
1615
  );
1491
1616
  }
1492
1617
  }
1618
+ if ((_c = __privateGet(this, _serverTransitionState)) == null ? void 0 : _c.personalizeVariants) {
1619
+ Object.keys(__privateGet(this, _serverTransitionState).personalizeVariants).forEach((personalizationName) => {
1620
+ const variants = __privateGet(this, _serverTransitionState).personalizeVariants[personalizationName];
1621
+ variants.forEach((e) => {
1622
+ commands.push({
1623
+ type: "setpersonalizecontrol",
1624
+ data: { personlizationName: personalizationName, index: e.index, control: e.control }
1625
+ });
1626
+ });
1627
+ });
1628
+ }
1493
1629
  try {
1494
1630
  __privateGet(this, _mitt3).emit("log", [
1495
1631
  "info",
@@ -1499,7 +1635,7 @@ var Context = class {
1499
1635
  ...newData,
1500
1636
  // need to convert url to string so it can be json serialized
1501
1637
  // to go over postMessage to chrome extension
1502
- url: (_c = newData.url) == null ? void 0 : _c.toString()
1638
+ url: (_d = newData.url) == null ? void 0 : _d.toString()
1503
1639
  }
1504
1640
  ]);
1505
1641
  if (newData.quirks) {
@@ -1581,6 +1717,13 @@ var Context = class {
1581
1717
  }
1582
1718
  ]);
1583
1719
  }
1720
+ getPersonalizeVariantControl(name, index) {
1721
+ var _a, _b, _c;
1722
+ const source = (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.personalizeVariants) != null ? _b : this.storage.data.personalizeVariants;
1723
+ const variants = (_c = source == null ? void 0 : source[name]) != null ? _c : [];
1724
+ const variant = variants.find((v) => v.index === index);
1725
+ return variant == null ? void 0 : variant.control;
1726
+ }
1584
1727
  /**
1585
1728
  * Writes a message to the Context log sink.
1586
1729
  * Used by Uniform internal SDK; not intended for public use.
@@ -1623,10 +1766,10 @@ var Context = class {
1623
1766
  const previousPlacement = __privateGet(this, _pzCache)[options.name];
1624
1767
  const eventData = {
1625
1768
  name: options.name,
1626
- variantIds: value.variations.map((variation) => {
1627
- var _a;
1628
- return (_a = variation.id) != null ? _a : "Unknown";
1629
- }),
1769
+ variantIds: value.variations.map((variation) => ({
1770
+ id: variation.id || "Unknown",
1771
+ control: variation.control
1772
+ })),
1630
1773
  control: this.storage.data.controlGroup,
1631
1774
  changed: true
1632
1775
  };
@@ -1654,7 +1797,8 @@ var Context = class {
1654
1797
  const transitionState = {
1655
1798
  quirks: this.storage.data.quirks,
1656
1799
  ssv: __privateGet(this, _scores),
1657
- tests: {}
1800
+ tests: {},
1801
+ personalizeVariants: this.storage.data.personalizeVariants
1658
1802
  };
1659
1803
  const allTests = this.storage.data.tests;
1660
1804
  Object.entries(allTests).map(([testName, testValue]) => {
package/dist/index.mjs CHANGED
@@ -123,6 +123,15 @@ var SignalInstance = class {
123
123
  _evaluator = new WeakMap();
124
124
  _onLogMessage = new WeakMap();
125
125
 
126
+ // src/manifest/utils/control.ts
127
+ var rollForControlGroup = (value) => {
128
+ let control = value;
129
+ if (control >= 1) {
130
+ control = control / 100;
131
+ }
132
+ return Math.random() < control;
133
+ };
134
+
126
135
  // src/manifest/ManifestInstance.ts
127
136
  var _mf, _signalInstances, _onLogMessage2;
128
137
  var ManifestInstance = class {
@@ -146,12 +155,8 @@ var ManifestInstance = class {
146
155
  __privateSet(this, _onLogMessage2, onLogMessage);
147
156
  }
148
157
  rollForControlGroup() {
149
- var _a, _b;
150
- let control = (_b = (_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.control) != null ? _b : 0;
151
- if (control >= 1) {
152
- control = control / 100;
153
- }
154
- return Math.random() < control;
158
+ var _a;
159
+ return rollForControlGroup(((_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.control) || 0);
155
160
  }
156
161
  getTest(name) {
157
162
  var _a;
@@ -499,7 +504,30 @@ function evaluateDimensionMatch(crit, vec, onLogMessage) {
499
504
  var _a, _b;
500
505
  const { op, l: lhs } = crit;
501
506
  const lhsScore = (_a = vec[lhs]) != null ? _a : 0;
502
- if (op === "+") {
507
+ if (op === "^") {
508
+ const [cat] = lhs.split(ENR_SEPARATOR);
509
+ let topVectorName = void 0;
510
+ let topScore = 0;
511
+ Object.keys(vec).forEach((vectorName) => {
512
+ if (vectorName.startsWith(`${cat}${ENR_SEPARATOR}`)) {
513
+ const score = vec[vectorName];
514
+ if (score > topScore) {
515
+ topVectorName = vectorName;
516
+ topScore = score;
517
+ }
518
+ }
519
+ });
520
+ const result = topVectorName === lhs;
521
+ onLogMessage == null ? void 0 : onLogMessage([
522
+ "info",
523
+ 302,
524
+ {
525
+ matched: result,
526
+ description: `${crit.l} has the highest score in the category`
527
+ }
528
+ ]);
529
+ return result;
530
+ } else if (op === "+") {
503
531
  const result = Math.max(...Object.values(vec)) === lhsScore && lhsScore > 0;
504
532
  onLogMessage == null ? void 0 : onLogMessage([
505
533
  "info",
@@ -586,31 +614,66 @@ function personalizeVariations({
586
614
  take = 1,
587
615
  onLogMessage
588
616
  }) {
589
- var _a, _b, _c;
617
+ var _a, _b, _c, _d;
590
618
  onLogMessage == null ? void 0 : onLogMessage(["info", 300, "GROUP", { name, take }]);
591
619
  try {
592
620
  const control = (_a = context.storage.data.controlGroup) != null ? _a : false;
593
621
  const results = [];
594
622
  let personalized = false;
595
623
  const scores = context.scores;
624
+ let index = 0;
625
+ const defaultVariants = [];
626
+ for (const variant of variations) {
627
+ if (!((_b = variant.pz) == null ? void 0 : _b.crit.length)) {
628
+ defaultVariants.push(variant);
629
+ }
630
+ }
596
631
  for (const variant of variations) {
632
+ const currentIndex = index++;
597
633
  if (results.length === take) {
598
634
  break;
599
635
  }
600
- if (!((_b = variant.pz) == null ? void 0 : _b.crit.length)) {
601
- onLogMessage == null ? void 0 : onLogMessage(["info", 301, "GROUP", { id: variant.id, op: (_c = variant.pz) == null ? void 0 : _c.op }]);
636
+ if (!((_c = variant.pz) == null ? void 0 : _c.crit.length)) {
637
+ onLogMessage == null ? void 0 : onLogMessage(["info", 301, "GROUP", { id: variant.id, op: (_d = variant.pz) == null ? void 0 : _d.op }]);
602
638
  onLogMessage == null ? void 0 : onLogMessage(["info", 302, { matched: true, description: "default variation" }]);
603
639
  onLogMessage == null ? void 0 : onLogMessage(["info", 303, true]);
604
640
  onLogMessage == null ? void 0 : onLogMessage(["info", 301, "ENDGROUP"]);
605
- results.push(variant);
641
+ results.push({
642
+ ...variant,
643
+ control: false
644
+ });
606
645
  continue;
607
646
  }
608
647
  if (control) {
609
648
  continue;
610
649
  }
611
650
  if (evaluateVariantMatch(variant.id, variant.pz, scores, onLogMessage)) {
612
- personalized = true;
613
- results.push(variant);
651
+ let variantToAdd = variant;
652
+ const isControl = false;
653
+ if (take === 1 && defaultVariants.length && typeof variant.pz.control === "number") {
654
+ let isControl2 = context.getPersonalizeVariantControl(name, currentIndex);
655
+ if (typeof isControl2 === "undefined") {
656
+ isControl2 = rollForControlGroup(variant.pz.control);
657
+ context.storage.updateData([
658
+ {
659
+ type: "setpersonalizecontrol",
660
+ data: {
661
+ personlizationName: name,
662
+ index: currentIndex,
663
+ control: isControl2
664
+ }
665
+ }
666
+ ]);
667
+ }
668
+ if (isControl2) {
669
+ variantToAdd = defaultVariants[0];
670
+ }
671
+ }
672
+ personalized = variant.id === variantToAdd.id;
673
+ results.push({
674
+ ...variantToAdd,
675
+ control: isControl
676
+ });
614
677
  }
615
678
  }
616
679
  return {
@@ -857,16 +920,19 @@ function parseScoreCookie(cookieValue) {
857
920
  if (!cookieValue)
858
921
  return;
859
922
  const types = cookieValue.split(TYPE_SEP);
860
- if (types.length > 3)
923
+ if (types.length > 5)
861
924
  return;
862
- const [abTestData, sessionScores, visitorScores] = types;
863
- return {
925
+ const [abTestData, sessionScores, visitorScores, controlGroup, personalizeVariants] = types;
926
+ const data = {
864
927
  // this is true since we're reading a cookie, which wouldn't exist if consent wasn't given
865
928
  consent: true,
866
929
  sessionScores: decodeCookieType(parseCookieType(sessionScores)),
867
930
  scores: decodeCookieType(parseCookieType(visitorScores)),
868
- tests: parseCookieType(abTestData)
931
+ tests: parseCookieType(abTestData),
932
+ controlGroup: controlGroup === "1",
933
+ personalizeVariants: decodePersonalizeVariants(personalizeVariants)
869
934
  };
935
+ return data;
870
936
  }
871
937
  function parseCookieType(type) {
872
938
  if (!type) {
@@ -890,9 +956,48 @@ function serializeCookie(data) {
890
956
  return [
891
957
  serializeCookieType(data.tests),
892
958
  serializeCookieType(encodeCookieType(data.sessionScores)),
893
- serializeCookieType(encodeCookieType(data.scores))
959
+ serializeCookieType(encodeCookieType(data.scores)),
960
+ data.controlGroup ? "1" : "0",
961
+ serializePersonalizeVariants(data)
894
962
  ].join(TYPE_SEP);
895
963
  }
964
+ function serializePersonalizeVariants({
965
+ personalizeVariants
966
+ }) {
967
+ const data = {};
968
+ if (typeof personalizeVariants === "object") {
969
+ Object.keys(personalizeVariants).forEach((personalizationName) => {
970
+ const results = [];
971
+ const variants = personalizeVariants[personalizationName];
972
+ variants.forEach((variant) => {
973
+ results.push(`${variant.index}:${variant.control ? "1" : "0"}`);
974
+ });
975
+ data[personalizationName] = results.join(",");
976
+ });
977
+ }
978
+ const serialized = serializeCookieType(data);
979
+ return serialized;
980
+ }
981
+ function decodePersonalizeVariants(data) {
982
+ const parsed = parseCookieType(data);
983
+ const keys = Object.keys(parsed);
984
+ if (!keys.length) {
985
+ return void 0;
986
+ }
987
+ const results = {};
988
+ Object.keys(parsed).forEach((k) => {
989
+ const variants = parsed[k].split(",");
990
+ const key = decodeURIComponent(k);
991
+ results[key] = variants.map((variant) => {
992
+ const [index, control] = variant.split(":");
993
+ return {
994
+ index: parseInt(index, 10),
995
+ control: control === "1"
996
+ };
997
+ });
998
+ });
999
+ return results;
1000
+ }
896
1001
  function encodeCookieType(type) {
897
1002
  return Object.entries(type).reduce((acc, [key, value]) => {
898
1003
  acc[key] = ntob(value);
@@ -980,7 +1085,8 @@ var emptyVisitorData = () => ({
980
1085
  sessionScores: {},
981
1086
  tests: {},
982
1087
  consent: false,
983
- controlGroup: false
1088
+ controlGroup: false,
1089
+ personalizeVariants: {}
984
1090
  });
985
1091
 
986
1092
  // src/storage/VisitorDataStore.ts
@@ -1029,6 +1135,25 @@ function applyCommandsToData(commands, state, inControlGroup) {
1029
1135
  case "setcontrol":
1030
1136
  newData.controlGroup = command.data;
1031
1137
  break;
1138
+ case "setpersonalizecontrol":
1139
+ if (!newData.personalizeVariants) {
1140
+ newData.personalizeVariants = {};
1141
+ }
1142
+ if (!newData.personalizeVariants[command.data.personlizationName]) {
1143
+ newData.personalizeVariants[command.data.personlizationName] = [];
1144
+ }
1145
+ const existingDef = newData.personalizeVariants[command.data.personlizationName].find(
1146
+ (i) => i.index === command.data.index
1147
+ );
1148
+ if (!existingDef) {
1149
+ newData.personalizeVariants[command.data.personlizationName].push({
1150
+ index: command.data.index,
1151
+ control: command.data.control
1152
+ });
1153
+ } else if (existingDef.control !== command.data.control) {
1154
+ existingDef.control = command.data.control;
1155
+ }
1156
+ break;
1032
1157
  default:
1033
1158
  throw new Error(`Unknown command`);
1034
1159
  }
@@ -1390,7 +1515,7 @@ var Context = class {
1390
1515
  * will NOT result in a recomputation of signal state.
1391
1516
  */
1392
1517
  async update(newData) {
1393
- var _a, _b, _c;
1518
+ var _a, _b, _c, _d;
1394
1519
  const commands = [];
1395
1520
  const newServerSideTests = {};
1396
1521
  if ((_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) {
@@ -1420,6 +1545,17 @@ var Context = class {
1420
1545
  );
1421
1546
  }
1422
1547
  }
1548
+ if ((_c = __privateGet(this, _serverTransitionState)) == null ? void 0 : _c.personalizeVariants) {
1549
+ Object.keys(__privateGet(this, _serverTransitionState).personalizeVariants).forEach((personalizationName) => {
1550
+ const variants = __privateGet(this, _serverTransitionState).personalizeVariants[personalizationName];
1551
+ variants.forEach((e) => {
1552
+ commands.push({
1553
+ type: "setpersonalizecontrol",
1554
+ data: { personlizationName: personalizationName, index: e.index, control: e.control }
1555
+ });
1556
+ });
1557
+ });
1558
+ }
1423
1559
  try {
1424
1560
  __privateGet(this, _mitt3).emit("log", [
1425
1561
  "info",
@@ -1429,7 +1565,7 @@ var Context = class {
1429
1565
  ...newData,
1430
1566
  // need to convert url to string so it can be json serialized
1431
1567
  // to go over postMessage to chrome extension
1432
- url: (_c = newData.url) == null ? void 0 : _c.toString()
1568
+ url: (_d = newData.url) == null ? void 0 : _d.toString()
1433
1569
  }
1434
1570
  ]);
1435
1571
  if (newData.quirks) {
@@ -1511,6 +1647,13 @@ var Context = class {
1511
1647
  }
1512
1648
  ]);
1513
1649
  }
1650
+ getPersonalizeVariantControl(name, index) {
1651
+ var _a, _b, _c;
1652
+ const source = (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.personalizeVariants) != null ? _b : this.storage.data.personalizeVariants;
1653
+ const variants = (_c = source == null ? void 0 : source[name]) != null ? _c : [];
1654
+ const variant = variants.find((v) => v.index === index);
1655
+ return variant == null ? void 0 : variant.control;
1656
+ }
1514
1657
  /**
1515
1658
  * Writes a message to the Context log sink.
1516
1659
  * Used by Uniform internal SDK; not intended for public use.
@@ -1553,10 +1696,10 @@ var Context = class {
1553
1696
  const previousPlacement = __privateGet(this, _pzCache)[options.name];
1554
1697
  const eventData = {
1555
1698
  name: options.name,
1556
- variantIds: value.variations.map((variation) => {
1557
- var _a;
1558
- return (_a = variation.id) != null ? _a : "Unknown";
1559
- }),
1699
+ variantIds: value.variations.map((variation) => ({
1700
+ id: variation.id || "Unknown",
1701
+ control: variation.control
1702
+ })),
1560
1703
  control: this.storage.data.controlGroup,
1561
1704
  changed: true
1562
1705
  };
@@ -1584,7 +1727,8 @@ var Context = class {
1584
1727
  const transitionState = {
1585
1728
  quirks: this.storage.data.quirks,
1586
1729
  ssv: __privateGet(this, _scores),
1587
- tests: {}
1730
+ tests: {},
1731
+ personalizeVariants: this.storage.data.personalizeVariants
1588
1732
  };
1589
1733
  const allTests = this.storage.data.tests;
1590
1734
  Object.entries(allTests).map(([testName, testValue]) => {
@@ -17,6 +17,13 @@ type EnrichmentData = {
17
17
  /** Strength value (amount of score added when viewing content) */
18
18
  str: number;
19
19
  };
20
+ type PersonalizeControlVariant = {
21
+ index: number;
22
+ control: boolean;
23
+ };
24
+ type PersonalizeVariants = {
25
+ [key: string]: PersonalizeControlVariant[];
26
+ };
20
27
  /** An event that has occurred (i.e. an analytics track) which may trigger an Event signal */
21
28
  type EventData = {
22
29
  /** The event name that has been fired */
@@ -55,6 +62,10 @@ type VisitorData = {
55
62
  * based on the control group size.
56
63
  */
57
64
  controlGroup?: boolean;
65
+ /**
66
+ * Records of personalized variants that have been shown to the visitor and their control group status
67
+ */
68
+ personalizeVariants?: PersonalizeVariants;
58
69
  };
59
70
  declare const emptyVisitorData: () => VisitorData;
60
71
  /**
@@ -79,7 +90,7 @@ type StorageCommand<TID extends string = string, TData = unknown> = {
79
90
  data: TData;
80
91
  };
81
92
  /** Commands that can be issued to alter the storage of Uniform Context data */
82
- type StorageCommands = ModifyScoreCommand | ModifySessionScoreCommand | SetConsentCommand | SetQuirkCommand | SetTestCommand | IdentifyCommand | SetControlGroupCommand;
93
+ type StorageCommands = ModifyScoreCommand | ModifySessionScoreCommand | SetConsentCommand | SetQuirkCommand | SetTestCommand | IdentifyCommand | SetControlGroupCommand | SetPersonalizeVariantControlCommand;
83
94
  /**
84
95
  * Changes the visitor's permanent score for a given dimension
85
96
  */
@@ -125,11 +136,16 @@ type IdentifyCommand = StorageCommand<'identify', {
125
136
  * this command is intended mostly for diagnostics and testing purposes.
126
137
  */
127
138
  type SetControlGroupCommand = StorageCommand<'setcontrol', boolean>;
139
+ type SetPersonalizeVariantControlCommand = StorageCommand<'setpersonalizecontrol', {
140
+ personlizationName: string;
141
+ index: number;
142
+ control: boolean;
143
+ }>;
128
144
 
129
145
  type TransitionDataStoreOptions = {
130
146
  initialData?: Partial<VisitorData>;
131
147
  };
132
- type ServerToClientTransitionState = Pick<Partial<VisitorData>, 'quirks' | 'tests'> & {
148
+ type ServerToClientTransitionState = Pick<Partial<VisitorData>, 'quirks' | 'tests' | 'personalizeVariants'> & {
133
149
  /**
134
150
  * Server Score Vector - the resultant scores _on the server side_ after the server/edge render completes
135
151
  * Note that the client side does not trust these scores; they are only used until it's done with initial
@@ -826,6 +842,10 @@ type VariantMatchCriteria = {
826
842
  * Name of the variant for analytics tracking.
827
843
  */
828
844
  name?: string;
845
+ /**
846
+ * Control group percentage for the variant.
847
+ */
848
+ control?: number;
829
849
  };
830
850
  type DimensionMatch = {
831
851
  /**
@@ -836,7 +856,8 @@ type DimensionMatch = {
836
856
  /**
837
857
  * Operator of the match expression
838
858
  * Whole-vector (RHS only) operators - these do not require a `r` or `rDim` set:
839
- * +: `l` is the strongest dimension in the score vector
859
+ * +: `l` is the strongest dimension in the score vector across all categories
860
+ * ^: `l` is the strongest dimension in the specified category
840
861
  * -: `l` is the weakest dimension in the score vector. This does not match if the dimension has no score at all.
841
862
  *
842
863
  * Comparison operators:
@@ -847,7 +868,7 @@ type DimensionMatch = {
847
868
  * =: `l` is equal to the right hand side expression
848
869
  * !=: `l` is not equal to the right hand side expression
849
870
  */
850
- op: '+' | '-' | '>' | '>=' | '<' | '<=' | '=' | '!=';
871
+ op: '+' | '-' | '>' | '>=' | '<' | '<=' | '=' | '!=' | '^';
851
872
  /**
852
873
  * Right hand side of the match expression (not required for op = + or - which have no right side)
853
874
  * This value is treated as a constant value, if it is present. If it's a string, it is parsed to an integer.
@@ -881,7 +902,9 @@ type PersonalizedResult<TVariant> = {
881
902
  /** Whether or not this result contains a personalized result */
882
903
  personalized: boolean;
883
904
  /** Matching variations */
884
- variations: Array<TVariant>;
905
+ variations: Array<TVariant & {
906
+ control: boolean;
907
+ }>;
885
908
  };
886
909
  /** Defines the shape of a A/B test variant */
887
910
  type TestVariant = {
@@ -957,7 +980,10 @@ type PersonalizationEvent = {
957
980
  /** Name of the personalized placement */
958
981
  name: string;
959
982
  /** Selected variant ID(s) */
960
- variantIds: string[];
983
+ variantIds: {
984
+ id: string;
985
+ control: boolean;
986
+ }[];
961
987
  /** Whether the user was part of the control group (and did not receive any personalization) */
962
988
  control: boolean | undefined;
963
989
  /**
@@ -1056,6 +1082,7 @@ declare class Context implements ContextInstance {
1056
1082
  getTestVariantId(testName: string): string | null | undefined;
1057
1083
  /** use test() instead */
1058
1084
  setTestVariantId(testName: string, variantId: string): void;
1085
+ getPersonalizeVariantControl(name: string, index: number): boolean | undefined;
1059
1086
  /**
1060
1087
  * Writes a message to the Context log sink.
1061
1088
  * Used by Uniform internal SDK; not intended for public use.
@@ -1146,4 +1173,4 @@ declare global {
1146
1173
  }
1147
1174
  }
1148
1175
 
1149
- export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type ModifyScoreCommand as aa, type ModifySessionScoreCommand as ab, type SetConsentCommand as ac, type SetQuirkCommand as ad, type SetTestCommand as ae, type IdentifyCommand as af, type SetControlGroupCommand as ag, type ServerToClientTransitionState as ah, SERVER_STATE_ID as ai, type TransitionDataStoreEvents as aj, type DecayOptions as ak, type VisitorDataStoreOptions as al, type VisitorDataStoreEvents as am, VisitorDataStore as an, type Quirks as ao, type Tests as ap, type EnrichmentData as aq, type EventData as ar, emptyVisitorData as as, type ContextState as at, type ContextStateUpdate as au, type paths as av, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type DevToolsEvents as g, CONTEXTUAL_EDITING_TEST_NAME as h, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as i, type ContextOptions as j, type TestEvent as k, type ContextEvents as l, type ContextInstance as m, Context as n, type DevToolsUiVersion as o, type DevToolsState as p, type DevToolsActions as q, type DevToolsEvent as r, type DevToolsLogEvent as s, type DevToolsDataEvent as t, type DevToolsHelloEvent as u, type DevToolsUpdateEvent as v, type DevToolsRawCommandsEvent as w, type DevToolsForgetEvent as x, type LogMessages as y, type Severity as z };
1176
+ export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type ModifyScoreCommand as aa, type ModifySessionScoreCommand as ab, type SetConsentCommand as ac, type SetQuirkCommand as ad, type SetTestCommand as ae, type IdentifyCommand as af, type SetControlGroupCommand as ag, type SetPersonalizeVariantControlCommand as ah, type ServerToClientTransitionState as ai, SERVER_STATE_ID as aj, type TransitionDataStoreEvents as ak, type DecayOptions as al, type VisitorDataStoreOptions as am, type VisitorDataStoreEvents as an, VisitorDataStore as ao, type Quirks as ap, type Tests as aq, type EnrichmentData as ar, type PersonalizeControlVariant as as, type PersonalizeVariants as at, type EventData as au, emptyVisitorData as av, type ContextState as aw, type ContextStateUpdate as ax, type paths as ay, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type DevToolsEvents as g, CONTEXTUAL_EDITING_TEST_NAME as h, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as i, type ContextOptions as j, type TestEvent as k, type ContextEvents as l, type ContextInstance as m, Context as n, type DevToolsUiVersion as o, type DevToolsState as p, type DevToolsActions as q, type DevToolsEvent as r, type DevToolsLogEvent as s, type DevToolsDataEvent as t, type DevToolsHelloEvent as u, type DevToolsUpdateEvent as v, type DevToolsRawCommandsEvent as w, type DevToolsForgetEvent as x, type LogMessages as y, type Severity as z };
@@ -17,6 +17,13 @@ type EnrichmentData = {
17
17
  /** Strength value (amount of score added when viewing content) */
18
18
  str: number;
19
19
  };
20
+ type PersonalizeControlVariant = {
21
+ index: number;
22
+ control: boolean;
23
+ };
24
+ type PersonalizeVariants = {
25
+ [key: string]: PersonalizeControlVariant[];
26
+ };
20
27
  /** An event that has occurred (i.e. an analytics track) which may trigger an Event signal */
21
28
  type EventData = {
22
29
  /** The event name that has been fired */
@@ -55,6 +62,10 @@ type VisitorData = {
55
62
  * based on the control group size.
56
63
  */
57
64
  controlGroup?: boolean;
65
+ /**
66
+ * Records of personalized variants that have been shown to the visitor and their control group status
67
+ */
68
+ personalizeVariants?: PersonalizeVariants;
58
69
  };
59
70
  declare const emptyVisitorData: () => VisitorData;
60
71
  /**
@@ -79,7 +90,7 @@ type StorageCommand<TID extends string = string, TData = unknown> = {
79
90
  data: TData;
80
91
  };
81
92
  /** Commands that can be issued to alter the storage of Uniform Context data */
82
- type StorageCommands = ModifyScoreCommand | ModifySessionScoreCommand | SetConsentCommand | SetQuirkCommand | SetTestCommand | IdentifyCommand | SetControlGroupCommand;
93
+ type StorageCommands = ModifyScoreCommand | ModifySessionScoreCommand | SetConsentCommand | SetQuirkCommand | SetTestCommand | IdentifyCommand | SetControlGroupCommand | SetPersonalizeVariantControlCommand;
83
94
  /**
84
95
  * Changes the visitor's permanent score for a given dimension
85
96
  */
@@ -125,11 +136,16 @@ type IdentifyCommand = StorageCommand<'identify', {
125
136
  * this command is intended mostly for diagnostics and testing purposes.
126
137
  */
127
138
  type SetControlGroupCommand = StorageCommand<'setcontrol', boolean>;
139
+ type SetPersonalizeVariantControlCommand = StorageCommand<'setpersonalizecontrol', {
140
+ personlizationName: string;
141
+ index: number;
142
+ control: boolean;
143
+ }>;
128
144
 
129
145
  type TransitionDataStoreOptions = {
130
146
  initialData?: Partial<VisitorData>;
131
147
  };
132
- type ServerToClientTransitionState = Pick<Partial<VisitorData>, 'quirks' | 'tests'> & {
148
+ type ServerToClientTransitionState = Pick<Partial<VisitorData>, 'quirks' | 'tests' | 'personalizeVariants'> & {
133
149
  /**
134
150
  * Server Score Vector - the resultant scores _on the server side_ after the server/edge render completes
135
151
  * Note that the client side does not trust these scores; they are only used until it's done with initial
@@ -826,6 +842,10 @@ type VariantMatchCriteria = {
826
842
  * Name of the variant for analytics tracking.
827
843
  */
828
844
  name?: string;
845
+ /**
846
+ * Control group percentage for the variant.
847
+ */
848
+ control?: number;
829
849
  };
830
850
  type DimensionMatch = {
831
851
  /**
@@ -836,7 +856,8 @@ type DimensionMatch = {
836
856
  /**
837
857
  * Operator of the match expression
838
858
  * Whole-vector (RHS only) operators - these do not require a `r` or `rDim` set:
839
- * +: `l` is the strongest dimension in the score vector
859
+ * +: `l` is the strongest dimension in the score vector across all categories
860
+ * ^: `l` is the strongest dimension in the specified category
840
861
  * -: `l` is the weakest dimension in the score vector. This does not match if the dimension has no score at all.
841
862
  *
842
863
  * Comparison operators:
@@ -847,7 +868,7 @@ type DimensionMatch = {
847
868
  * =: `l` is equal to the right hand side expression
848
869
  * !=: `l` is not equal to the right hand side expression
849
870
  */
850
- op: '+' | '-' | '>' | '>=' | '<' | '<=' | '=' | '!=';
871
+ op: '+' | '-' | '>' | '>=' | '<' | '<=' | '=' | '!=' | '^';
851
872
  /**
852
873
  * Right hand side of the match expression (not required for op = + or - which have no right side)
853
874
  * This value is treated as a constant value, if it is present. If it's a string, it is parsed to an integer.
@@ -881,7 +902,9 @@ type PersonalizedResult<TVariant> = {
881
902
  /** Whether or not this result contains a personalized result */
882
903
  personalized: boolean;
883
904
  /** Matching variations */
884
- variations: Array<TVariant>;
905
+ variations: Array<TVariant & {
906
+ control: boolean;
907
+ }>;
885
908
  };
886
909
  /** Defines the shape of a A/B test variant */
887
910
  type TestVariant = {
@@ -957,7 +980,10 @@ type PersonalizationEvent = {
957
980
  /** Name of the personalized placement */
958
981
  name: string;
959
982
  /** Selected variant ID(s) */
960
- variantIds: string[];
983
+ variantIds: {
984
+ id: string;
985
+ control: boolean;
986
+ }[];
961
987
  /** Whether the user was part of the control group (and did not receive any personalization) */
962
988
  control: boolean | undefined;
963
989
  /**
@@ -1056,6 +1082,7 @@ declare class Context implements ContextInstance {
1056
1082
  getTestVariantId(testName: string): string | null | undefined;
1057
1083
  /** use test() instead */
1058
1084
  setTestVariantId(testName: string, variantId: string): void;
1085
+ getPersonalizeVariantControl(name: string, index: number): boolean | undefined;
1059
1086
  /**
1060
1087
  * Writes a message to the Context log sink.
1061
1088
  * Used by Uniform internal SDK; not intended for public use.
@@ -1146,4 +1173,4 @@ declare global {
1146
1173
  }
1147
1174
  }
1148
1175
 
1149
- export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type ModifyScoreCommand as aa, type ModifySessionScoreCommand as ab, type SetConsentCommand as ac, type SetQuirkCommand as ad, type SetTestCommand as ae, type IdentifyCommand as af, type SetControlGroupCommand as ag, type ServerToClientTransitionState as ah, SERVER_STATE_ID as ai, type TransitionDataStoreEvents as aj, type DecayOptions as ak, type VisitorDataStoreOptions as al, type VisitorDataStoreEvents as am, VisitorDataStore as an, type Quirks as ao, type Tests as ap, type EnrichmentData as aq, type EventData as ar, emptyVisitorData as as, type ContextState as at, type ContextStateUpdate as au, type paths as av, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type DevToolsEvents as g, CONTEXTUAL_EDITING_TEST_NAME as h, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as i, type ContextOptions as j, type TestEvent as k, type ContextEvents as l, type ContextInstance as m, Context as n, type DevToolsUiVersion as o, type DevToolsState as p, type DevToolsActions as q, type DevToolsEvent as r, type DevToolsLogEvent as s, type DevToolsDataEvent as t, type DevToolsHelloEvent as u, type DevToolsUpdateEvent as v, type DevToolsRawCommandsEvent as w, type DevToolsForgetEvent as x, type LogMessages as y, type Severity as z };
1176
+ export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type ModifyScoreCommand as aa, type ModifySessionScoreCommand as ab, type SetConsentCommand as ac, type SetQuirkCommand as ad, type SetTestCommand as ae, type IdentifyCommand as af, type SetControlGroupCommand as ag, type SetPersonalizeVariantControlCommand as ah, type ServerToClientTransitionState as ai, SERVER_STATE_ID as aj, type TransitionDataStoreEvents as ak, type DecayOptions as al, type VisitorDataStoreOptions as am, type VisitorDataStoreEvents as an, VisitorDataStore as ao, type Quirks as ap, type Tests as aq, type EnrichmentData as ar, type PersonalizeControlVariant as as, type PersonalizeVariants as at, type EventData as au, emptyVisitorData as av, type ContextState as aw, type ContextStateUpdate as ax, type paths as ay, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type DevToolsEvents as g, CONTEXTUAL_EDITING_TEST_NAME as h, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as i, type ContextOptions as j, type TestEvent as k, type ContextEvents as l, type ContextInstance as m, Context as n, type DevToolsUiVersion as o, type DevToolsState as p, type DevToolsActions as q, type DevToolsEvent as r, type DevToolsLogEvent as s, type DevToolsDataEvent as t, type DevToolsHelloEvent as u, type DevToolsUpdateEvent as v, type DevToolsRawCommandsEvent as w, type DevToolsForgetEvent as x, type LogMessages as y, type Severity as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context",
3
- "version": "19.128.0",
3
+ "version": "19.128.1-alpha.12+257ca411a1",
4
4
  "description": "Uniform Context core package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "2bd4fae189da0b4436c1f07abf9fd3ea947303f7"
69
+ "gitHead": "257ca411a1416b6486147689285a1642546967a0"
70
70
  }