unleash-server 6.1.7 → 6.1.9

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.
Files changed (33) hide show
  1. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.d.ts.map +1 -1
  2. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.js +8 -6
  3. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.js.map +1 -1
  4. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.test.d.ts +2 -0
  5. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.test.d.ts.map +1 -0
  6. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.test.js +39 -0
  7. package/dist/lib/features/change-request-access-service/sql-change-request-access-read-model.test.js.map +1 -0
  8. package/dist/lib/features/change-request-segment-usage-service/change-request-segment-usage-read-model.test.js +1 -1
  9. package/dist/lib/services/group-service.d.ts.map +1 -1
  10. package/dist/lib/services/group-service.js +14 -0
  11. package/dist/lib/services/group-service.js.map +1 -1
  12. package/dist/test/e2e/services/group-service.e2e.test.js +75 -0
  13. package/dist/test/e2e/services/group-service.e2e.test.js.map +1 -1
  14. package/frontend/build/index.html +1 -1
  15. package/frontend/build/static/{AdvancedPlayground-BNsMZOoJ.js → AdvancedPlayground-ClY7BR25.js} +1 -1
  16. package/frontend/build/static/{CreateProject-BZw1aC5H.js → CreateProject-CZ_LaLGy.js} +1 -1
  17. package/frontend/build/static/{FeatureMetricsChart-BGQwkqcb.js → FeatureMetricsChart-DdroJnt0.js} +1 -1
  18. package/frontend/build/static/{FeatureStaleDialog-qYvEV6kq.js → FeatureStaleDialog-DX1VXbFp.js} +1 -1
  19. package/frontend/build/static/{FeatureViewLazyExport-gFRVtFYz.js → FeatureViewLazyExport-8MyFhnri.js} +2 -2
  20. package/frontend/build/static/{LazyAdminExport-Kws_yzPG.js → LazyAdminExport-C-1mYRG4.js} +14 -14
  21. package/frontend/build/static/{LazyProjectExport-DuGFNALG.js → LazyProjectExport-C7d5sjgG.js} +2 -2
  22. package/frontend/build/static/{LineChartComponent-z6NSZO5b.js → LineChartComponent-BUWdzHGl.js} +1 -1
  23. package/frontend/build/static/{NetworkOverview-DQ7RgAaY.js → NetworkOverview-B9QJ52e5.js} +1 -1
  24. package/frontend/build/static/{NetworkTraffic-MwH18qhj.js → NetworkTraffic-DAqGFi-j.js} +1 -1
  25. package/frontend/build/static/{NetworkTrafficUsage-DmVUp01_.js → NetworkTrafficUsage-DEsIhvqn.js} +1 -1
  26. package/frontend/build/static/{ReactJSONEditor-p7Rx0akQ.js → ReactJSONEditor-FYoD8Vj7.js} +1 -1
  27. package/frontend/build/static/{RoleCell-CJWxeDmi.js → RoleCell-BTRHs8t5.js} +1 -1
  28. package/frontend/build/static/{StrategyItemContainer-Cx7MmcNg.js → StrategyItemContainer-KT-4tFSj.js} +1 -1
  29. package/frontend/build/static/{index-K5BsxPs3.js → index-BP5MBEg5.js} +1 -1
  30. package/frontend/build/static/{index-Baz2OZE0.js → index-C4rZui9w.js} +8 -8
  31. package/frontend/build/static/{unknownify-D8KH-1Ao.js → unknownify-YGGpZv_A.js} +1 -1
  32. package/frontend/build/static/{useApiTokens-BDk4aavc.js → useApiTokens-Re0ZsUEV.js} +1 -1
  33. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sql-change-request-access-read-model.d.ts","sourceRoot":"","sources":["../../../../src/lib/features/change-request-access-service/sql-change-request-access-read-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,qBAAa,4BACT,YAAW,6BAA6B;IAExC,OAAO,CAAC,EAAE,CAAK;IAEf,OAAO,CAAC,aAAa,CAAgB;gBAEzB,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,aAAa;IAKnC,sBAAsB,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,IAAI,GACZ,OAAO,CAAC,OAAO,CAAC;IAeN,gCAAgC,CACzC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,IAAI,GACZ,OAAO,CAAC,OAAO,CAAC;IAcN,uBAAuB,CAChC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC;IAYN,iCAAiC,CAC1C,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC;CAWtB"}
1
+ {"version":3,"file":"sql-change-request-access-read-model.d.ts","sourceRoot":"","sources":["../../../../src/lib/features/change-request-access-service/sql-change-request-access-read-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAExF,qBAAa,4BACT,YAAW,6BAA6B;IAExC,OAAO,CAAC,EAAE,CAAK;IAEf,OAAO,CAAC,aAAa,CAAgB;gBAEzB,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,aAAa;IAKnC,sBAAsB,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,IAAI,GACZ,OAAO,CAAC,OAAO,CAAC;IAeN,gCAAgC,CACzC,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,IAAI,GACZ,OAAO,CAAC,OAAO,CAAC;IAcN,uBAAuB,CAChC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC;IAYN,iCAAiC,CAC1C,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC;CAiBtB"}
@@ -34,12 +34,14 @@ class ChangeRequestAccessReadModel {
34
34
  return present;
35
35
  }
36
36
  async isChangeRequestsEnabledForProject(project) {
37
- const result = await this.db.raw(`SELECT EXISTS(SELECT 1
38
- FROM change_request_settings
39
- WHERE project = ?
40
- ) AS present`, [project]);
41
- const { present } = result.rows[0];
42
- return present;
37
+ const result = await this.db('change_request_settings')
38
+ .join('project_environments', function () {
39
+ return this.on('change_request_settings.project', 'project_environments.project_id').andOn('change_request_settings.environment', 'project_environments.environment_name');
40
+ })
41
+ .where('change_request_settings.project', project)
42
+ .select('change_request_settings.project')
43
+ .first();
44
+ return Boolean(result);
43
45
  }
44
46
  }
45
47
  exports.ChangeRequestAccessReadModel = ChangeRequestAccessReadModel;
@@ -1 +1 @@
1
- {"version":3,"file":"sql-change-request-access-read-model.js","sourceRoot":"","sources":["../../../../src/lib/features/change-request-access-service/sql-change-request-access-read-model.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAMlD,MAAa,4BAA4B;IAOrC,YAAY,EAAM,EAAE,aAA4B;QAC5C,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,sBAAsB,CAC/B,OAAe,EACf,WAAmB,EACnB,IAAW;QAEX,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACnE,IAAI;gBACA,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAC5B,IAAI,EACJ,2BAAmB,EACnB,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;YAC5B,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC;SACrD,CAAC,CAAC;QACH,OAAO,oBAAoB,IAAI,CAAC,oBAAoB,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,gCAAgC,CACzC,OAAe,EACf,IAAW;QAEX,MAAM,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACnE,IAAI;gBACA,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAC5B,IAAI,EACJ,2BAAmB,EACnB,OAAO,CACV;gBACH,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;YAC5B,IAAI,CAAC,iCAAiC,CAAC,OAAO,CAAC;SAClD,CAAC,CAAC;QACH,OAAO,oBAAoB,IAAI,CAAC,oBAAoB,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAChC,OAAe,EACf,WAAmB;QAEnB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,GAAG,CAC5B;;;yDAG6C,EAC7C,CAAC,WAAW,EAAE,OAAO,CAAC,CACzB,CAAC;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnC,OAAO,OAAO,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,iCAAiC,CAC1C,OAAe;QAEf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,GAAG,CAC5B;;;wCAG4B,EAC5B,CAAC,OAAO,CAAC,CACZ,CAAC;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnC,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AA5ED,oEA4EC"}
1
+ {"version":3,"file":"sql-change-request-access-read-model.js","sourceRoot":"","sources":["../../../../src/lib/features/change-request-access-service/sql-change-request-access-read-model.ts"],"names":[],"mappings":";;;AAAA,uCAAkD;AAMlD,MAAa,4BAA4B;IAOrC,YAAY,EAAM,EAAE,aAA4B;QAC5C,IAAI,CAAC,E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AEM,KAAK,CAAC,iCAAiC,CAC1C,OAAe;QAEf,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,yBAAyB,CAAC;aAClD,IAAI,CAAC,sBAAsB,EAAE;YAC1B,OAAO,IAAI,CAAC,EAAE,CACV,iCAAiC,EACjC,iCAAiC,CACpC,CAAC,KAAK,CACH,qCAAqC,EACrC,uCAAuC,CAC1C,CAAC;QACN,CAAC,CAAC;aACD,KAAK,CAAC,iCAAiC,EAAE,OAAO,CAAC;aACjD,MAAM,CAAC,iCAAiC,CAAC;aACzC,KAAK,EAAE,CAAC;QAEb,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACJ;AAlFD,oEAkFC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sql-change-request-access-read-model.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-change-request-access-read-model.test.d.ts","sourceRoot":"","sources":["../../../../src/lib/features/change-request-access-service/sql-change-request-access-read-model.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const database_init_1 = __importDefault(require("../../../test/e2e/helpers/database-init"));
7
+ const no_logger_1 = __importDefault(require("../../../test/fixtures/no-logger"));
8
+ const createChangeRequestAccessReadModel_1 = require("./createChangeRequestAccessReadModel");
9
+ const test_config_1 = require("../../../test/config/test-config");
10
+ let db;
11
+ let readModel;
12
+ beforeAll(async () => {
13
+ db = await (0, database_init_1.default)('change_request_access_read_model', no_logger_1.default);
14
+ const config = (0, test_config_1.createTestConfig)({
15
+ getLogger: no_logger_1.default,
16
+ });
17
+ readModel = (0, createChangeRequestAccessReadModel_1.createChangeRequestAccessReadModel)(db.rawDatabase, config);
18
+ });
19
+ afterAll(async () => {
20
+ await db.destroy();
21
+ });
22
+ test(`Should indicate change request enabled status`, async () => {
23
+ // no change requests
24
+ const defaultStatus = await readModel.isChangeRequestsEnabledForProject('default');
25
+ expect(defaultStatus).toBe(false);
26
+ // change request enabled in enabled environment
27
+ await db.rawDatabase('change_request_settings').insert({
28
+ project: 'default',
29
+ environment: 'default',
30
+ required_approvals: 1,
31
+ });
32
+ const enabledStatus = await readModel.isChangeRequestsEnabledForProject('default');
33
+ expect(enabledStatus).toBe(true);
34
+ // change request enabled in disabled environment
35
+ await db.stores.projectStore.deleteEnvironmentForProject('default', 'default');
36
+ const disabledStatus = await readModel.isChangeRequestsEnabledForProject('default');
37
+ expect(disabledStatus).toBe(false);
38
+ });
39
+ //# sourceMappingURL=sql-change-request-access-read-model.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-change-request-access-read-model.test.js","sourceRoot":"","sources":["../../../../src/lib/features/change-request-access-service/sql-change-request-access-read-model.test.ts"],"names":[],"mappings":";;;;;AAAA,4FAA+E;AAC/E,iFAAyD;AACzD,6FAA0F;AAC1F,kEAAoE;AAGpE,IAAI,EAAW,CAAC;AAEhB,IAAI,SAAwC,CAAC;AAE7C,SAAS,CAAC,KAAK,IAAI,EAAE;IACjB,EAAE,GAAG,MAAM,IAAA,uBAAM,EAAC,kCAAkC,EAAE,mBAAS,CAAC,CAAC;IAEjE,MAAM,MAAM,GAAG,IAAA,8BAAgB,EAAC;QAC5B,SAAS,EAAT,mBAAS;KACZ,CAAC,CAAC;IAEH,SAAS,GAAG,IAAA,uEAAkC,EAAC,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,KAAK,IAAI,EAAE;IAChB,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;IAC7D,qBAAqB;IACrB,MAAM,aAAa,GACf,MAAM,SAAS,CAAC,iCAAiC,CAAC,SAAS,CAAC,CAAC;IACjE,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAElC,gDAAgD;IAChD,MAAM,EAAE,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC,MAAM,CAAC;QACnD,OAAO,EAAE,SAAS;QAClB,WAAW,EAAE,SAAS;QACtB,kBAAkB,EAAE,CAAC;KACxB,CAAC,CAAC;IACH,MAAM,aAAa,GACf,MAAM,SAAS,CAAC,iCAAiC,CAAC,SAAS,CAAC,CAAC;IACjE,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjC,iDAAiD;IACjD,MAAM,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,2BAA2B,CACpD,SAAS,EACT,SAAS,CACZ,CAAC;IACF,MAAM,cAAc,GAChB,MAAM,SAAS,CAAC,iCAAiC,CAAC,SAAS,CAAC,CAAC;IACjE,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC"}
@@ -15,7 +15,7 @@ const CR_TITLE = 'My change request';
15
15
  const FLAG_NAME = 'crarm-test-flag';
16
16
  let readModel;
17
17
  beforeAll(async () => {
18
- db = await (0, database_init_1.default)('change_request_access_read_model_serial', no_logger_1.default);
18
+ db = await (0, database_init_1.default)('change_request_segment_usage_read_model', no_logger_1.default);
19
19
  user = await db.stores.userStore.insert({
20
20
  username: 'cr-creator',
21
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"group-service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/group-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,0BAA0B,EAC1B,aAAa,EACb,UAAU,EAEb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIH,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,cAAc,EACtB,MAAM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b,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,UAAU,GACtB,OAAO,CAAC,MAAM,CAAC;IAyBZ,WAAW,CACb,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,UAAU,GACtB,OAAO,CAAC,MAAM,CAAC;IAwCZ,gBAAgB,CAClB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAyBlC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB7D,aAAa,CACf,KAAK,EAAE,WAAW,GAAG,iBAAiB,EACtC,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC;IAkCV,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAI5D,kBAAkB,CACpB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EAAE,EACxB,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa;IACjC,eAAe,CAAC,EAAE,MAAM,GACzB,OAAO,CAAC,IAAI,CAAC;IA0ChB,OAAO,CAAC,iBAAiB;IAuBnB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAG5D"}
@@ -9,6 +9,8 @@ const bad_data_error_1 = __importDefault(require("../error/bad-data-error"));
9
9
  const events_1 = require("../types/events");
10
10
  const name_exists_error_1 = __importDefault(require("../error/name-exists-error"));
11
11
  const group_store_1 = require("../db/group-store");
12
+ const setsAreEqual = (firstSet, secondSet) => firstSet.size === secondSet.size &&
13
+ [...firstSet].every((x) => secondSet.has(x));
12
14
  class GroupService {
13
15
  constructor(stores, { getLogger }, eventService) {
14
16
  this.logger = getLogger('service/group-service.js');
@@ -119,6 +121,18 @@ class GroupService {
119
121
  throw new name_exists_error_1.default('Group name already exists');
120
122
  }
121
123
  }
124
+ if (existingGroup && Boolean(existingGroup.scimId)) {
125
+ if (existingGroup.name !== group.name) {
126
+ throw new bad_data_error_1.default('Cannot update the name of a SCIM group');
127
+ }
128
+ const existingUsers = new Set((await this.groupStore.getAllUsersByGroups([
129
+ existingGroup.id,
130
+ ])).map((g) => g.userId));
131
+ const newUsers = new Set(group.users?.map((g) => g.user.id) || []);
132
+ if (!setsAreEqual(existingUsers, newUsers)) {
133
+ throw new bad_data_error_1.default('Cannot update users of a SCIM group');
134
+ }
135
+ }
122
136
  }
123
137
  async getRolesForProject(projectId) {
124
138
  return this.groupStore.getProjectGroupRoles(projectId);
@@ -1 +1 @@
1
- {"version":3,"file":"group-service.js","sourceRoot":"","sources":["../../../src/lib/services/group-service.ts"],"names":[],"mappings":";;;;;;AASA,oCAOkB;AAGlB,6EAAmD;AACnD,4CAKyB;AACzB,mFAAyD;AAIzD,mDAAkD;AAElD,MAAa,YAAY;IASrB,YACI,MAA2D,EAC3D,EAAE,SAAS,EAAqC,EAChD,YAA0B;QAE1B,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,0BAA0B,CAAC,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAM;QACR,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QAC9C,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAC3D,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC1B,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAC9C,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CACrC,CAAC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AC,IAAI,EAAE,EAAE,CAC3C,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CACjC,CAAC;QACF,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC1C,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;YAChE,OAAO;gBACH,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,QAAQ,EAAE,QAAQ;gBAC5B,SAAS,EAAE,QAAQ,EAAE,SAAS;aACjC,CAAC;QACN,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,MAAc;QACjC,OAAO,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;CACJ;AA9SD,oCA8SC"}
@@ -220,4 +220,79 @@ test('adding a nonexistent role to a group should fail', async () => {
220
220
  }, types_1.TEST_AUDIT_USER);
221
221
  }).rejects.toThrow('Request validation failed: your request body or params contain invalid data: Incorrect role id 100');
222
222
  });
223
+ test('trying to modify a SCIM group name should fail', async () => {
224
+ const group = await groupStore.create({
225
+ name: 'scim_group',
226
+ description: 'scim_group',
227
+ });
228
+ await db.rawDatabase('groups').where({ id: group.id }).update({
229
+ scim_id: 'some-faux-uuid',
230
+ scim_external_id: 'external-id',
231
+ });
232
+ await expect(() => {
233
+ return groupService.updateGroup({
234
+ id: group.id,
235
+ name: 'new_name',
236
+ users: [],
237
+ rootRole: 100,
238
+ createdAt: new Date(),
239
+ createdBy: 'test',
240
+ }, types_1.TEST_AUDIT_USER);
241
+ }).rejects.toThrow('Request validation failed: your request body or params contain invalid data: Cannot update the name of a SCIM group');
242
+ });
243
+ test('trying to modify users in a SCIM group should fail', async () => {
244
+ const group = await groupStore.create({
245
+ name: 'another_scim_group',
246
+ description: 'scim_group',
247
+ });
248
+ await db.rawDatabase('groups').where({ id: group.id }).update({
249
+ scim_id: 'some-other-faux-uuid',
250
+ scim_external_id: 'some-external-id',
251
+ });
252
+ await expect(() => {
253
+ return groupService.updateGroup({
254
+ id: group.id,
255
+ name: 'new_name',
256
+ users: [
257
+ {
258
+ user: {
259
+ id: 1,
260
+ isAPI: false,
261
+ permissions: [],
262
+ },
263
+ },
264
+ ],
265
+ rootRole: 100,
266
+ createdAt: new Date(),
267
+ createdBy: 'test',
268
+ }, types_1.TEST_AUDIT_USER);
269
+ }).rejects.toThrow('Request validation failed: your request body or params contain invalid data: Cannot update the name of a SCIM group');
270
+ });
271
+ test('can modify a SCIM group description and root role', async () => {
272
+ const group = await groupStore.create({
273
+ name: 'yet_another_scim_group',
274
+ description: 'scim_group',
275
+ });
276
+ await db.rawDatabase('groups').where({ id: group.id }).update({
277
+ scim_id: 'completely-different-faux-uuid',
278
+ scim_external_id: 'totally-not-the-same-external-id',
279
+ });
280
+ await groupService.updateGroup({
281
+ id: group.id,
282
+ name: 'yet_another_scim_group',
283
+ description: 'new description',
284
+ users: [],
285
+ rootRole: 1,
286
+ createdAt: new Date(),
287
+ createdBy: 'test',
288
+ }, types_1.TEST_AUDIT_USER);
289
+ const updatedGroup = await groupService.getGroup(group.id);
290
+ expect(updatedGroup).toMatchObject({
291
+ description: 'new description',
292
+ id: group.id,
293
+ mappingsSSO: [],
294
+ name: 'yet_another_scim_group',
295
+ rootRole: 1,
296
+ });
297
+ });
223
298
  //# sourceMappingURL=group-service.e2e.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"group-service.e2e.test.js","sourceRoot":"","sources":["../../../../src/test/e2e/services/group-service.e2e.test.ts"],"names":[],"mappings":";;;;;AAAA,6EAAgE;AAChE,yEAAiD;AACjD,0DAA4D;AAC5D,uEAAmE;AACnE,oDAAqD;AACrD,8CAK4B;AAE5B,IA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AAEH,IAAI,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;IAChE,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC;QAClC,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;KAC5B,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,GAAG,EAAE;QACd,OAAO,YAAY,CAAC,WAAW,CAC3B;YACI,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,MAAM;SACpB,EACD,uBAAe,CAClB,CAAC;IACN,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CACd,oGAAoG,CACvG,CAAC;AACN,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"group-service.e2e.test.js","sourceRoot":"","sources":["../../../../src/test/e2e/services/group-service.e2e.test.ts"],"names":[],"mappings":";;;;;AAAA,6EAAgE;AAChE,yEAAiD;AACjD,0DAA4D;AAC5D,uEAAmE;AACnE,oDAAqD;AACrD,8CAK4B;AAE5B,IAAI,MAAsB,CAAC;AAC3B,IAAI,EAAW,CAAC;AAEhB,IAAI,YAA0B,CAAC;AAC/B,IAAI,YAA0B,CAAC;AAC/B,IAAI,UAAuB,CAAC;AAC5B,IAAI,IAAW,CAAC;AAEhB,SAAS,CAAC,KAAK,IAAI,EAAE;IACjB,EAAE,GAAG,MAAM,IAAA,uBAAM,EAAC,sBAAsB,EAAE,mBAAS,CAAC,CAAC;IACrD,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;IACnB,IAAI,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;QACjC,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,oBAAoB;KAC9B,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAA,8BAAgB,EAAC;QAC5B,SAAS,EA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EAAE,KAAK,CAAC,EAAE;QACZ,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,wBAAwB;QAC9B,QAAQ,EAAE,CAAC;KACd,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -20,7 +20,7 @@
20
20
  rel="stylesheet"
21
21
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"
22
22
  />
23
- <script type="module" crossorigin src="/static/index-Baz2OZE0.js"></script>
23
+ <script type="module" crossorigin src="/static/index-C4rZui9w.js"></script>
24
24
  <link rel="stylesheet" crossorigin href="/static/style-DgCLnyQi.css">
25
25
  </head>
26
26
  <body>
@@ -1,3 +1,3 @@
1
- import{u as qt,g as Gt,r as x,_ as Vt,j as t,a as Ee,s as b,U as Kt,b as O,B as C,C as v,d as Jt,c as Yt,e as ot,f as Zt,h as ee,T as I,F as Qt,I as Xt,S as en,M as tn,i as ce,p as Me,k as He,l as se,A as at,m as nn,n as rn,o as sn,q as on,t as an,v as Ue,P as ln,w as ze,x as _,L as cn,D as dn,y as de,z as ue,E as un,G as it,H as hn,J,K as lt,N as gn,O as te,Q as xn,R as q,V as ct,W as Te,X as dt,Y as mn,Z as Ce,$ as oe,a0 as we,a1 as fn,a2 as pn,a3 as bn,a4 as ut,a5 as Re,a6 as he,a7 as jn,a8 as A,a9 as ge,aa as yn,ab as vn,ac as Sn,ad as Cn,ae as wn,af as kn,ag as _e,ah as ht,ai as Pe,aj as Ie,ak as gt,al as Fe,am as xt,an as mt,ao as ft,ap as pt,aq as En,ar as qe,as as Tn,at as Rn,au as pe,av as Pn,aw as In,ax as Fn,ay as Bn,az as On,aA as An}from"./index-Baz2OZE0.js";import{c as Dn,d as Nn,s as $n,h as Ln,f as Wn,a as Mn,l as Hn,b as Un,e as zn,g as _n,i as qn,j as Gn,k as Vn,m as Kn,E as ie,n as Jn,o as Be,p as Yn,q as Zn,r as Qn,t as Xn,u as er,v as tr,w as nr,x as rr,y as sr,z as bt,A as z,H as jt,B as d,C as or,D as ar,S as ir,F as lr,G as cr}from"./index-BEpcKp7m.js";import{u as dr}from"./useApiTokens-BDk4aavc.js";import{S as ur}from"./StrategyItemContainer-Cx7MmcNg.js";const hr=()=>{const{makeRequest:e,createRequest:n,errors:r,loading:s}=qt({propagateErrors:!0}),o="api/admin/playground";return{evaluateAdvancedPlayground:async c=>{const u=`${o}/advanced`,g=n(u,{method:"POST",body:JSON.stringify(c)});return(await e(g.caller,g.id)).json()},evaluateChangeRequestPlayground:async(c,u)=>{const g=`${o}/change-request/${c}`,l=n(g,{method:"POST",body:JSON.stringify(u)});return(await e(l.caller,l.id)).json()},errors:r,loading:s}};var Oe={exports:{}};function yt(e,n=100,r={}){if(typeof e!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(n<0)throw new RangeError("`wait` must not be negative.");const{immediate:s}=typeof r=="boolean"?{immediate:r}:r;let o,i,a,c,u;function g(){const h=o,p=i;return o=void 0,i=void 0,u=e.apply(h,p),u}function l(){const h=Date.now()-c;h<n&&h>=0?a=setTimeout(l,n-h):(a=void 0,s||(u=g()))}const m=function(...h){if(o&&this!==o)throw new Error("Debounced method called with different contexts.");o=this,i=h,c=Date.now();const p=s&&!a;return a||(a=setTimeout(l,n)),p&&(u=g()),u};return m.clear=()=>{a&&(clearTimeout(a),a=void 0)},m.flush=()=>{a&&m.trigger()},m.trigger=()=>{u=g(),m.clear()},m}Oe.exports.debounce=yt;Oe.exports=yt;var gr=Oe.exports;const xr=Gt(gr);var Ge=function(n){n===void 0&&(n={});var{crosshairCursor:r=!1}=n,s=[];n.closeBracketsKeymap!==!1&&(s=s.concat(Dn)),n.defaultKeymap!==!1&&(s=s.concat(Nn)),n.searchKeymap!==!1&&(s=s.concat($n)),n.historyKeymap!==!1&&(s=s.concat(Ln)),n.foldKeymap!==!1&&(s=s.concat(Wn)),n.completionKeymap!==!1&&(s=s.concat(Mn)),n.lintKeymap!==!1&&(s=s.concat(Hn));var o=[];return n.lineNumbers!==!1&&o.push(Un()),n.highlightActiveLineGutter!==!1&&o.push(zn()),n.highlightSpecialChars!==!1&&o.push(_n()),n.history!==!1&&o.push(qn()),n.foldGutter!==!1&&o.push(Gn()),n.drawSelection!==!1&&o.push(Vn()),n.dropCursor!==!1&&o.push(Kn()),n.allowMultipleSelections!==!1&&o.push(ie.allowMultipleSelections.of(!0)),n.indentOnInput!==!1&&o.push(Jn()),n.syntaxHighlighting!==!1&&o.push(Be(Yn,{fallback:!0})),n.bracketMatching!==!1&&o.push(Zn()),n.closeBrackets!==!1&&o.push(Qn()),n.autocompletion!==!1&&o.push(Xn()),n.rectangularSelection!==!1&&o.push(er()),r!==!1&&o.push(tr()),n.highlightActiveLine!==!1&&o.push(nr()),n.highlightSelectionMatches!==!1&&o.push(rr()),n.tabSize&&typeof n.tabSize=="number"&&o.push(sr.of(" ".repeat(n.tabSize))),o.concat([bt.of(s.flat())]).filter(Boolean)};const mr="#e5c07b",Ve="#e06c75",fr="#56b6c2",pr="#ffffff",ae="#abb2bf",ke="#7d8799",br="#61afef",jr="#98c379",Ke="#d19a66",yr="#c678dd",vr="#21252b",Je="#2c313a",Ye="#282c34",be="#353a42",Sr="#3E4451",Ze="#528bff",Cr=z.theme({"&":{color:ae,backgroundColor:Ye},".cm-content":{caretColor:Ze},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ze},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Sr},".cm-panels":{backgroundColor:vr,color:ae},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Ye,color:ke,border:"none"},".cm-activeLineGutter":{backgroundColor:Je},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:be},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:be,borderBottomColor:be},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Je,color:ae}}},{dark:!0}),wr=jt.define([{tag:d.keyword,color:yr},{tag:[d.name,d.deleted,d.character,d.propertyName,d.macroName],color:Ve},{tag:[d.function(d.variableName),d.labelName],color:br},{tag:[d.color,d.constant(d.name),d.standard(d.name)],color:Ke},{tag:[d.definition(d.name),d.separator],color:ae},{tag:[d.typeName,d.className,d.number,d.changed,d.annotation,d.modifier,d.self,d.namespace],color:mr},{tag:[d.operator,d.operatorKeyword,d.url,d.escape,d.regexp,d.link,d.special(d.string)],color:fr},{tag:[d.meta,d.comment],color:ke},{tag:d.strong,fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.link,color:ke,textDecoration:"underline"},{tag:d.heading,fontWeight:"bold",color:Ve},{tag:[d.atom,d.bool,d.special(d.variableName)],color:Ke},{tag:[d.processingInstruction,d.string,d.inserted],color:jr},{tag:d.invalid,color:pr}]),kr=[Cr,Be(wr)];var Er=z.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Tr=function(n){n===void 0&&(n={});var{indentWithTab:r=!0,editable:s=!0,readOnly:o=!1,theme:i="light",placeholder:a="",basicSetup:c=!0}=n,u=[];switch(r&&u.unshift(bt.of([or])),c&&(typeof c=="boolean"?u.unshift(Ge()):u.unshift(Ge(c))),a&&u.unshift(ar(a)),i){case"light":u.push(Er);break;case"dark":u.push(kr);break;case"none":break;default:u.push(i);break}return s===!1&&u.push(z.editable.of(!1)),o&&u.push(ie.readOnly.of(!0)),[...u]},Rr=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(n=>e.state.sliceDoc(n.from,n.to)),selectedText:e.state.selection.ranges.some(n=>!n.empty)}),Qe=lr.define(),Pr=[];function Ir(e){var{value:n,selection:r,onChange:s,onStatistics:o,onCreateEditor:i,onUpdate:a,extensions:c=Pr,autoFocus:u,theme:g="light",height:l=null,minHeight:m=null,maxHeight:h=null,width:p=null,minWidth:P=null,maxWidth:R=null,placeholder:E="",editable:N=!0,readOnly:F=!1,indentWithTab:D=!0,basicSetup:j=!0,root:f,initialState:k}=e,[T,S]=x.useState(),[y,B]=x.useState(),[L,M]=x.useState(),Z=z.theme({"&":{height:l,minHeight:m,maxHeight:h,width:p,minWidth:P,maxWidth:R},"& .cm-scroller":{height:"100% !important"}}),Q=z.updateListener.of($=>{if($.docChanged&&typeof s=="function"&&!$.transactions.some(me=>me.annotation(Qe))){var V=$.state.doc,K=V.toString();s(K,$)}o&&o(Rr($))}),xe=Tr({theme:g,editable:N,readOnly:F,placeholder:E,indentWithTab:D,basicSetup:j}),G=[Q,Z,...xe];return a&&typeof a=="function"&&G.push(z.updateListener.of(a)),G=G.concat(c),x.useEffect(()=>{if(T&&!L){var $={doc:n,selection:r,extensions:G},V=k?ie.fromJSON(k.json,$,k.fields):ie.create($);if(M(V),!y){var K=new z({state:V,parent:T,root:f});B(K),i&&i(K,V)}}return()=>{y&&(M(void 0),B(void 0))}},[T,L]),x.useEffect(()=>S(e.container),[e.container]),x.useEffect(()=>()=>{y&&(y.destroy(),B(void 0))},[y]),x.useEffect(()=>{u&&y&&y.focus()},[u,y]),x.useEffect(()=>{y&&y.dispatch({effects:ir.reconfigure.of(G)})},[g,c,l,m,h,p,P,R,E,N,F,D,j,s,a]),x.useEffect(()=>{if(n!==void 0){var $=y?y.state.doc.toString():"";y&&n!==$&&y.dispatch({changes:{from:0,to:$.length,insert:n||""},annotations:[Qe.of(!0)]})}},[n,y]),{state:L,setState:M,view:y,setView:B,container:T,setContainer:S}}var Fr=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vt=x.forwardRef((e,n)=>{var{className:r,value:s="",selection:o,extensions:i=[],onChange:a,onStatistics:c,onCreateEditor:u,onUpdate:g,autoFocus:l,theme:m="light",height:h,minHeight:p,maxHeight:P,width:R,minWidth:E,maxWidth:N,basicSetup:F,placeholder:D,indentWithTab:j,editable:f,readOnly:k,root:T,initialState:S}=e,y=Vt(e,Fr),B=x.useRef(null),{state:L,view:M,container:Z}=Ir({container:B.current,root:T,value:s,autoFocus:l,theme:m,height:h,minHeight:p,maxHeight:P,width:R,minWidth:E,maxWidth:N,basicSetup:F,placeholder:D,indentWithTab:j,editable:f,readOnly:k,selection:o,onChange:a,onStatistics:c,onCreateEditor:u,onUpdate:g,extensions:i,initialState:S});if(x.useImperativeHandle(n,()=>({editor:B.current,state:L,view:M}),[B,Z,L,M]),typeof s!="string")throw new Error("value must be typeof string but got "+typeof s);var Q=typeof m=="string"?"cm-theme-"+m:"cm-theme";return t.jsx("div",Ee({ref:B,className:""+Q+(r?" "+r:"")},y))});vt.displayName="CodeMirror";var St=e=>{var{theme:n,settings:r={},styles:s=[]}=e,o={".cm-gutters":{}},i={};r.background&&(i.backgroundColor=r.background),r.backgroundImage&&(i.backgroundImage=r.backgroundImage),r.foreground&&(i.color=r.foreground),r.fontSize&&(i.fontSize=r.fontSize),(r.background||r.foreground)&&(o["&"]=i),r.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(o[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(o[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(o[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(o[".cm-content"]={caretColor:r.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var a={};r.gutterActiveForeground&&(a.color=r.gutterActiveForeground),r.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:r.lineHighlight},a.backgroundColor=r.lineHighlight),o[".cm-activeLineGutter"]=a,r.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var c=z.theme(o,{dark:n==="dark"}),u=jt.define(s),g=[c,Be(u)];return g},Br={background:"#faf8f5",foreground:"#b29762",caret:"#93abdc",selection:"#e3dcce",selectionMatch:"#e3dcce",gutterBackground:"#faf8f5",gutterForeground:"#cdc4b1",gutterBorder:"transparent",lineHighlight:"#ddceb154"},Or=[{tag:[d.comment,d.bracket],color:"#b6ad9a"},{tag:[d.atom,d.number,d.keyword,d.link,d.attributeName,d.quote],color:"#063289"},{tag:[d.emphasis,d.heading,d.tagName,d.propertyName,d.variableName],color:"#2d2006"},{tag:[d.typeName,d.url,d.string],color:"#896724"},{tag:[d.operator,d.string],color:"#1659df"},{tag:[d.propertyName],color:"#b29762"},{tag:[d.unit,d.punctuation],color:"#063289"}],Ar=e=>{var{theme:n="light",settings:r={},styles:s=[]}={};return St({theme:n,settings:Ee({},Br,r),styles:[...Or,...s]})},Dr=Ar(),Nr={background:"#2a2734",foreground:"#6c6783",caret:"#ffad5c",selection:"#91ff6c26",selectionMatch:"#91ff6c26",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},$r=[{tag:[d.comment,d.bracket],color:"#6c6783"},{tag:[d.atom,d.number,d.keyword,d.link,d.attributeName,d.quote],color:"#ffcc99"},{tag:[d.emphasis,d.heading,d.tagName,d.propertyName,d.className,d.variableName],color:"#eeebff"},{tag:[d.typeName,d.url],color:"#7a63ee"},{tag:d.operator,color:"#ffad5c"},{tag:d.string,color:"#ffb870"},{tag:[d.propertyName],color:"#9a86fd"},{tag:[d.unit,d.punctuation],color:"#e09142"}],Lr=e=>{var{theme:n="dark",settings:r={},styles:s=[]}={};return St({theme:n,settings:Ee({},Nr,r),styles:[...$r,...s]})},Wr=Lr();const Mr=b("aside")(({theme:e})=>({height:"50px",backgroundColor:e.palette.background.paper,borderTopRightRadius:e.shape.borderRadiusMedium,borderTopLeftRadius:e.shape.borderRadiusMedium,padding:e.spacing(1,2),color:e.palette.text.primary,display:"flex",justifyContent:"space-between",alignItems:"center",border:`1px solid ${e.palette.divider}`})),Ct=b("div")(({theme:e,style:n})=>({width:e.spacing(3),height:e.spacing(3),display:"flex",alignItems:"center",color:e.palette.background.paper,justifyContent:"center",transition:"background-color 0.5s ease-in-out",borderRadius:"50%",...n})),Hr=b("div")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.error.dark,marginRight:e.spacing(1)})),Ur=()=>{const e=O();return t.jsx(Ct,{style:{backgroundColor:e.palette.success.main},children:t.jsx(Jt,{sx:n=>({width:n.spacing(2),height:n.spacing(2)})})})},zr=()=>{const e=O();return t.jsx(Ct,{style:{backgroundColor:e.palette.error.main},children:t.jsx(Yt,{})})},_r=({context:e,setContext:n,error:r})=>{const{themeMode:s}=x.useContext(Kt),o=O(),i=x.useCallback(a=>{n(a)},[n]);return t.jsxs(C,{sx:{width:"100%"},children:[t.jsxs(Mr,{children:["JSON",t.jsx(v,{condition:!!r,show:t.jsxs(C,{sx:a=>({display:"flex",alignItems:"center"}),children:[t.jsx(Hr,{children:r}),t.jsx(zr,{})]}),elseShow:t.jsx(Ur,{})})]}),t.jsx(vt,{value:e,height:"150px",theme:s==="dark"?Wr:Dr,extensions:[cr()],onChange:i,style:{border:`1px solid ${o.palette.divider}`,borderTop:"none"},placeholder:JSON.stringify({currentTime:"2022-07-04T14:13:03.929Z",appName:"playground",userId:"test",remoteAddress:"127.0.0.1"},null,2)})]})};function wt(e){return Array.isArray(e)?e:[e]}const qr=e=>!e||e.length===0||e.length===1&&e[0]==="*"?"*":wt(e),Gr=e=>wt(e),Vr=e=>{const n=Kr(e);return n.length>0?n[0]:""},Kr=e=>e.filter(({enabled:n})=>!!n).sort((n,r)=>n.sortOrder-r.sortOrder).map(({name:n})=>n),Jr=(e,n)=>"100%",Yr=e=>typeof e=="string"?!0:Array.isArray(e)?e.every(n=>typeof n=="string"):!1,Zr=e=>{const n=new Set(["appName","environment","userId","sessionId","remoteAddress","currentTime","properties"]),r={...e};let s=!1;for(const o in e)n.has(o)||(r.properties||(r.properties={}),r.properties[o]=e[o],delete r[o],s=!0);return!s&&!e.properties&&delete r.properties,r},Qr=e=>{const[n]=e.split("."),[r,s]=n.split(":");if(!r||!s)throw new Error("Invalid token format");if(s==="*")throw new Error("Admin tokens are not supported in the playground")},Xr=e=>{const[n]=e.split(".");return n.split(":")},es=({context:e,setContext:n})=>{const r=O(),{setToastData:s}=ot(),{context:o}=Zt(),i=o.sort((j,f)=>j.sortOrder-f.sortOrder).map(({name:j})=>j),[a,c]=x.useState(),[u,g]=x.useState(!1),[l,m]=x.useState(""),[h,p]=x.useState(""),P=x.useMemo(()=>xr(j=>{var f;if(!j)return c(void 0);try{const k=JSON.parse(j);g(k[l]!==void 0||((f=k==null?void 0:k.properties)==null?void 0:f[l])!==void 0)}catch(k){return c(ee(k))}return c(void 0)},250),[c,l,g]);x.useEffect(()=>{P(e)},[P,e]);const R=()=>{try{const j=JSON.parse(e||"{}");n(JSON.stringify(Zr({...j,[l]:h}),null,2));const f=o.find(k=>k.name===l);if(f!=null&&f.legalValues&&f.legalValues.length>0||l==="currentTime")return p("")}catch(j){s({type:"error",title:`Error parsing context: ${ee(j)}`})}},E=(j,f)=>{if(Yr(f)){if(Array.isArray(f)){const k=(f||[]).length>1?f.join(","):f[0];return p(k)}p(f)}},N=()=>{if(!h||h==="")return[];const j=o.find(k=>k.name===l),f=((j==null?void 0:j.legalValues)||[]).length>1;return h.includes(",")&&f?h.split(","):[h]},F=()=>{if(l==="currentTime"){const f=Me(h),T=f?He(f.toISOString()):He(new Date().toISOString());return t.jsx(se,{id:"date",label:"Date",size:"small",type:"datetime-local",value:T,sx:{width:200,maxWidth:"100%"},onChange:S=>{const y=Me(S.target.value),B=y==null?void 0:y.toISOString();B&&p(B)},InputLabelProps:{shrink:!0},required:!0})}const j=o.find(f=>f.name===l);if(j!=null&&j.legalValues&&j.legalValues.length>0){const f=j.legalValues.map(({value:k})=>k);return t.jsx(at,{disablePortal:!0,limitTags:3,id:"context-legal-values",freeSolo:!0,filterSelectedOptions:!0,size:"small",value:N(),onChange:E,options:f,multiple:!0,sx:{width:370,maxWidth:"100%"},renderInput:k=>t.jsx(se,{...k,label:"Value"}),disableCloseOnSelect:!1})}return t.jsx(se,{label:"Value",id:"context-value",sx:{width:370,maxWidth:"100%"},placeholder:"value1,value2,value3",size:"small",value:h,onChange:f=>p(f.target.value||"")})},D=j=>{if(m(j.target.value||""),j.target.value==="currentTime")return p(new Date().toISOString());p("")};return t.jsxs(C,{children:[t.jsx(C,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(I,{variant:"body2",color:r.palette.text.primary,sx:{ml:1},children:"Unleash context"})}),t.jsxs(C,{sx:{display:"flex",gap:2,flexWrap:"wrap",mb:2},children:[t.jsxs(Qt,{children:[t.jsx(Xt,{id:"context-field-label",size:"small",children:"Context field"}),t.jsx(en,{label:"Context field",labelId:"context-field-label",id:"context-field",value:l,onChange:D,variant:"outlined",size:"small",sx:{width:200,maxWidth:"100%"},children:i.map(j=>t.jsx(tn,{value:j,children:j},j))})]}),F(),t.jsx(ce,{variant:"outlined",disabled:!l||!!a,onClick:R,sx:{width:"95px",maxHeight:"40px"},children:`${u?"Replace":"Add"} `})]}),t.jsx(_r,{context:e,setContext:n,error:a})]})},ts=({environments:e,setEnvironments:n,availableEnvironments:r,disabled:s})=>{const o=[...r.map(c=>({label:c,id:c}))],i=o.filter(({id:c})=>e.includes(c)),a=(c,u,g)=>{const l=u;return g==="clear"||l===null?n([]):Array.isArray(l)?l.length===0?n([]):n(l.map(({id:m})=>m)):n([l.id])};return t.jsx(at,{disablePortal:!0,limitTags:3,id:"environment",multiple:!0,options:o,sx:{flex:1},renderInput:c=>t.jsx(se,{...c,label:"Environments"}),renderOption:nn,getOptionLabel:({label:c})=>c,disableCloseOnSelect:!1,size:"small",value:i,onChange:a,disabled:s,"data-testid":"PLAYGROUND_ENVIRONMENT_SELECT"})},je={label:"ALL",id:"*"},Xe=b(rn)({fontSize:"1.25rem"}),kt=b(sn)(()=>({width:"100%"})),ns=b(C)(({theme:e})=>({display:"grid",columnGap:e.spacing(2),rowGap:e.spacing(2),gridTemplateColumns:"1fr",[e.breakpoints.up("md")]:{gridTemplateColumns:"1fr 1fr"}})),rs=b(kt)(({theme:e})=>({"& label":{WebkitTextFillColor:e.palette.text.secondary},"& input.Mui-disabled":{WebkitTextFillColor:e.palette.text.secondary}})),ss=({environments:e,projects:n,token:r,setProjects:s,setEnvironments:o,setToken:i,availableEnvironments:a,changeRequest:c,onClearChangeRequest:u})=>{const g=O(),{tokens:l}=dr(),[m,h]=x.useState(),{projects:p}=on(),P=an("changeRequestPlayground"),R=[je,...p.map(({name:S,id:y})=>({label:S,id:y}))],E=async S=>{const y=S.target.value;if(i==null||i(y),y===""){k();return}try{Qr(y),h(void 0),N(y)}catch(B){h(B.message)}},N=S=>{const[y,B]=Xr(S);switch(o([B]),y){case"[]":D(S);break;case"*":j();break;default:f(y)}},F=S=>{!S.projects||S.projects==="*"?s([je.id]):typeof S.projects=="string"?s([S.projects]):Array.isArray(S.projects)&&s(S.projects)},D=S=>{const y=l.find(({secret:B})=>B===S);y?F(y):h("Invalid token. Ensure you use a valid token from this Unleash instance.")},j=()=>{s([je.id])},f=S=>{R.map(y=>y.id).includes(S)?s([S]):h(`Invalid token. Project ${S} does not exist.`)},k=()=>{h(void 0)},T=()=>{i==null||i(""),k()};return t.jsxs(C,{sx:{pb:2},children:[t.jsx(C,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(I,{variant:"body2",color:g.palette.text.primary,sx:{ml:1},children:"Access configuration"})}),t.jsxs(ns,{children:[t.jsx(C,{children:t.jsx(Ue,{arrow:!0,title:r?"Environment is automatically selected because you are using a token":"Select environments to use in the playground",children:t.jsx(C,{children:t.jsx(ts,{environments:e,setEnvironments:o,availableEnvironments:a,disabled:!!(r||c)})})})}),t.jsx(C,{children:t.jsx(Ue,{arrow:!0,title:r?"Project is automatically selected because you are using a token":"Select projects to use in the playground",children:t.jsx(ln,{selectedProjects:n,onChange:s,dataTestId:"PLAYGROUND_PROJECT_SELECT",disabled:!!(r||c),limitTags:3})})}),t.jsx(C,{children:t.jsx(kt,{label:"API token",value:r||(c?" ":""),onChange:E,type:"text",error:!!m,errorText:m,placeholder:"Enter your API token","data-testid":"PLAYGROUND_TOKEN_INPUT",InputProps:{endAdornment:r?t.jsx(ze,{position:"end","data-testid":"TOKEN_INPUT_CLEAR_BTN",children:t.jsx(_,{"aria-label":"clear API token",onClick:T,edge:"end",children:t.jsx(Xe,{})})}):null},disabled:!!c})}),t.jsx(v,{condition:!!(P&&c),show:t.jsxs(C,{sx:{display:"flex",gap:2},children:[t.jsx(C,{sx:{flex:1},children:t.jsx(rs,{label:"Change request",value:c?`Change request #${c}`:"",onChange:()=>{},type:"text",disabled:!0,InputProps:{endAdornment:t.jsx(ze,{position:"end",children:t.jsx(_,{"aria-label":"clear Change request results",onClick:u,edge:"end",children:t.jsx(Xe,{})})})}})}),t.jsx(ce,{variant:"outlined",size:"small",to:`/projects/${n[0]}/change-requests/${c}`,component:cn,children:"View change request"})]})})]})]})},os=({availableEnvironments:e,environments:n,onSubmit:r,projects:s,token:o,setToken:i,setProjects:a,setEnvironments:c,context:u,setContext:g,changeRequest:l,onClearChangeRequest:m})=>t.jsxs(C,{component:"form",onSubmit:r,sx:{display:"flex",flexDirection:"column"},children:[t.jsx(ss,{environments:Array.isArray(n)?n:[n],projects:s,token:o,setToken:i,setEnvironments:c,setProjects:a,availableEnvironments:e.map(({name:h})=>h),changeRequest:l,onClearChangeRequest:m}),t.jsx(es,{context:u,setContext:g}),t.jsx(C,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:t.jsx(ce,{variant:"contained",size:"large",type:"submit",sx:{marginLeft:"auto"},children:"Try configuration"})})]}),as=b("div")(({style:e,theme:n})=>({width:"25px",height:"25px",borderRadius:"50%",color:n.palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...e})),is=({style:e,children:n,type:r})=>{const s=O(),o={backgroundColor:s.palette.background.alternative,color:s.palette.common.white};return r==="secondary"&&(o.backgroundColor=s.palette.background.paper,o.color=s.palette.text.secondary),t.jsx(as,{style:{...o,...e},children:n})},ye=({headerText:e,bodyText:n,sectionNumber:r})=>t.jsx(C,{sx:{display:"flex",alignItems:"flex-start",mt:2,flexDirection:"column"},children:t.jsxs(C,{sx:{display:"flex"},children:[t.jsx(C,{children:t.jsx(is,{children:r})}),t.jsxs(C,{sx:{ml:2,display:"flex",flexDirection:"column"},children:[t.jsx(I,{variant:"body1",sx:{fontWeight:"bold"},children:e}),t.jsx(v,{condition:!!n,show:t.jsx(I,{variant:"body1",sx:{mt:1},children:n})})]})]})}),Et=()=>t.jsxs(C,{sx:{ml:4},children:[t.jsx(I,{variant:"body1",children:"Unleash playground is for helping you to understand how Unleash works, how feature flags are evaluated and for you to easily debug your feature flags."}),t.jsx(dn,{sx:{mt:2,mb:2}}),t.jsx(I,{variant:"body1",sx:{mb:1},children:"What you need to do is:"}),t.jsx(ye,{headerText:`Select in which environment you want to test your
1
+ import{u as qt,g as Gt,r as x,_ as Vt,j as t,a as Ee,s as b,U as Kt,b as O,B as C,C as v,d as Jt,c as Yt,e as ot,f as Zt,h as ee,T as I,F as Qt,I as Xt,S as en,M as tn,i as ce,p as Me,k as He,l as se,A as at,m as nn,n as rn,o as sn,q as on,t as an,v as Ue,P as ln,w as ze,x as _,L as cn,D as dn,y as de,z as ue,E as un,G as it,H as hn,J,K as lt,N as gn,O as te,Q as xn,R as q,V as ct,W as Te,X as dt,Y as mn,Z as Ce,$ as oe,a0 as we,a1 as fn,a2 as pn,a3 as bn,a4 as ut,a5 as Re,a6 as he,a7 as jn,a8 as A,a9 as ge,aa as yn,ab as vn,ac as Sn,ad as Cn,ae as wn,af as kn,ag as _e,ah as ht,ai as Pe,aj as Ie,ak as gt,al as Fe,am as xt,an as mt,ao as ft,ap as pt,aq as En,ar as qe,as as Tn,at as Rn,au as pe,av as Pn,aw as In,ax as Fn,ay as Bn,az as On,aA as An}from"./index-C4rZui9w.js";import{c as Dn,d as Nn,s as $n,h as Ln,f as Wn,a as Mn,l as Hn,b as Un,e as zn,g as _n,i as qn,j as Gn,k as Vn,m as Kn,E as ie,n as Jn,o as Be,p as Yn,q as Zn,r as Qn,t as Xn,u as er,v as tr,w as nr,x as rr,y as sr,z as bt,A as z,H as jt,B as d,C as or,D as ar,S as ir,F as lr,G as cr}from"./index-BEpcKp7m.js";import{u as dr}from"./useApiTokens-Re0ZsUEV.js";import{S as ur}from"./StrategyItemContainer-KT-4tFSj.js";const hr=()=>{const{makeRequest:e,createRequest:n,errors:r,loading:s}=qt({propagateErrors:!0}),o="api/admin/playground";return{evaluateAdvancedPlayground:async c=>{const u=`${o}/advanced`,g=n(u,{method:"POST",body:JSON.stringify(c)});return(await e(g.caller,g.id)).json()},evaluateChangeRequestPlayground:async(c,u)=>{const g=`${o}/change-request/${c}`,l=n(g,{method:"POST",body:JSON.stringify(u)});return(await e(l.caller,l.id)).json()},errors:r,loading:s}};var Oe={exports:{}};function yt(e,n=100,r={}){if(typeof e!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`);if(n<0)throw new RangeError("`wait` must not be negative.");const{immediate:s}=typeof r=="boolean"?{immediate:r}:r;let o,i,a,c,u;function g(){const h=o,p=i;return o=void 0,i=void 0,u=e.apply(h,p),u}function l(){const h=Date.now()-c;h<n&&h>=0?a=setTimeout(l,n-h):(a=void 0,s||(u=g()))}const m=function(...h){if(o&&this!==o)throw new Error("Debounced method called with different contexts.");o=this,i=h,c=Date.now();const p=s&&!a;return a||(a=setTimeout(l,n)),p&&(u=g()),u};return m.clear=()=>{a&&(clearTimeout(a),a=void 0)},m.flush=()=>{a&&m.trigger()},m.trigger=()=>{u=g(),m.clear()},m}Oe.exports.debounce=yt;Oe.exports=yt;var gr=Oe.exports;const xr=Gt(gr);var Ge=function(n){n===void 0&&(n={});var{crosshairCursor:r=!1}=n,s=[];n.closeBracketsKeymap!==!1&&(s=s.concat(Dn)),n.defaultKeymap!==!1&&(s=s.concat(Nn)),n.searchKeymap!==!1&&(s=s.concat($n)),n.historyKeymap!==!1&&(s=s.concat(Ln)),n.foldKeymap!==!1&&(s=s.concat(Wn)),n.completionKeymap!==!1&&(s=s.concat(Mn)),n.lintKeymap!==!1&&(s=s.concat(Hn));var o=[];return n.lineNumbers!==!1&&o.push(Un()),n.highlightActiveLineGutter!==!1&&o.push(zn()),n.highlightSpecialChars!==!1&&o.push(_n()),n.history!==!1&&o.push(qn()),n.foldGutter!==!1&&o.push(Gn()),n.drawSelection!==!1&&o.push(Vn()),n.dropCursor!==!1&&o.push(Kn()),n.allowMultipleSelections!==!1&&o.push(ie.allowMultipleSelections.of(!0)),n.indentOnInput!==!1&&o.push(Jn()),n.syntaxHighlighting!==!1&&o.push(Be(Yn,{fallback:!0})),n.bracketMatching!==!1&&o.push(Zn()),n.closeBrackets!==!1&&o.push(Qn()),n.autocompletion!==!1&&o.push(Xn()),n.rectangularSelection!==!1&&o.push(er()),r!==!1&&o.push(tr()),n.highlightActiveLine!==!1&&o.push(nr()),n.highlightSelectionMatches!==!1&&o.push(rr()),n.tabSize&&typeof n.tabSize=="number"&&o.push(sr.of(" ".repeat(n.tabSize))),o.concat([bt.of(s.flat())]).filter(Boolean)};const mr="#e5c07b",Ve="#e06c75",fr="#56b6c2",pr="#ffffff",ae="#abb2bf",ke="#7d8799",br="#61afef",jr="#98c379",Ke="#d19a66",yr="#c678dd",vr="#21252b",Je="#2c313a",Ye="#282c34",be="#353a42",Sr="#3E4451",Ze="#528bff",Cr=z.theme({"&":{color:ae,backgroundColor:Ye},".cm-content":{caretColor:Ze},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ze},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Sr},".cm-panels":{backgroundColor:vr,color:ae},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Ye,color:ke,border:"none"},".cm-activeLineGutter":{backgroundColor:Je},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:be},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:be,borderBottomColor:be},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Je,color:ae}}},{dark:!0}),wr=jt.define([{tag:d.keyword,color:yr},{tag:[d.name,d.deleted,d.character,d.propertyName,d.macroName],color:Ve},{tag:[d.function(d.variableName),d.labelName],color:br},{tag:[d.color,d.constant(d.name),d.standard(d.name)],color:Ke},{tag:[d.definition(d.name),d.separator],color:ae},{tag:[d.typeName,d.className,d.number,d.changed,d.annotation,d.modifier,d.self,d.namespace],color:mr},{tag:[d.operator,d.operatorKeyword,d.url,d.escape,d.regexp,d.link,d.special(d.string)],color:fr},{tag:[d.meta,d.comment],color:ke},{tag:d.strong,fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.link,color:ke,textDecoration:"underline"},{tag:d.heading,fontWeight:"bold",color:Ve},{tag:[d.atom,d.bool,d.special(d.variableName)],color:Ke},{tag:[d.processingInstruction,d.string,d.inserted],color:jr},{tag:d.invalid,color:pr}]),kr=[Cr,Be(wr)];var Er=z.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Tr=function(n){n===void 0&&(n={});var{indentWithTab:r=!0,editable:s=!0,readOnly:o=!1,theme:i="light",placeholder:a="",basicSetup:c=!0}=n,u=[];switch(r&&u.unshift(bt.of([or])),c&&(typeof c=="boolean"?u.unshift(Ge()):u.unshift(Ge(c))),a&&u.unshift(ar(a)),i){case"light":u.push(Er);break;case"dark":u.push(kr);break;case"none":break;default:u.push(i);break}return s===!1&&u.push(z.editable.of(!1)),o&&u.push(ie.readOnly.of(!0)),[...u]},Rr=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(n=>e.state.sliceDoc(n.from,n.to)),selectedText:e.state.selection.ranges.some(n=>!n.empty)}),Qe=lr.define(),Pr=[];function Ir(e){var{value:n,selection:r,onChange:s,onStatistics:o,onCreateEditor:i,onUpdate:a,extensions:c=Pr,autoFocus:u,theme:g="light",height:l=null,minHeight:m=null,maxHeight:h=null,width:p=null,minWidth:P=null,maxWidth:R=null,placeholder:E="",editable:N=!0,readOnly:F=!1,indentWithTab:D=!0,basicSetup:j=!0,root:f,initialState:k}=e,[T,S]=x.useState(),[y,B]=x.useState(),[L,M]=x.useState(),Z=z.theme({"&":{height:l,minHeight:m,maxHeight:h,width:p,minWidth:P,maxWidth:R},"& .cm-scroller":{height:"100% !important"}}),Q=z.updateListener.of($=>{if($.docChanged&&typeof s=="function"&&!$.transactions.some(me=>me.annotation(Qe))){var V=$.state.doc,K=V.toString();s(K,$)}o&&o(Rr($))}),xe=Tr({theme:g,editable:N,readOnly:F,placeholder:E,indentWithTab:D,basicSetup:j}),G=[Q,Z,...xe];return a&&typeof a=="function"&&G.push(z.updateListener.of(a)),G=G.concat(c),x.useEffect(()=>{if(T&&!L){var $={doc:n,selection:r,extensions:G},V=k?ie.fromJSON(k.json,$,k.fields):ie.create($);if(M(V),!y){var K=new z({state:V,parent:T,root:f});B(K),i&&i(K,V)}}return()=>{y&&(M(void 0),B(void 0))}},[T,L]),x.useEffect(()=>S(e.container),[e.container]),x.useEffect(()=>()=>{y&&(y.destroy(),B(void 0))},[y]),x.useEffect(()=>{u&&y&&y.focus()},[u,y]),x.useEffect(()=>{y&&y.dispatch({effects:ir.reconfigure.of(G)})},[g,c,l,m,h,p,P,R,E,N,F,D,j,s,a]),x.useEffect(()=>{if(n!==void 0){var $=y?y.state.doc.toString():"";y&&n!==$&&y.dispatch({changes:{from:0,to:$.length,insert:n||""},annotations:[Qe.of(!0)]})}},[n,y]),{state:L,setState:M,view:y,setView:B,container:T,setContainer:S}}var Fr=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],vt=x.forwardRef((e,n)=>{var{className:r,value:s="",selection:o,extensions:i=[],onChange:a,onStatistics:c,onCreateEditor:u,onUpdate:g,autoFocus:l,theme:m="light",height:h,minHeight:p,maxHeight:P,width:R,minWidth:E,maxWidth:N,basicSetup:F,placeholder:D,indentWithTab:j,editable:f,readOnly:k,root:T,initialState:S}=e,y=Vt(e,Fr),B=x.useRef(null),{state:L,view:M,container:Z}=Ir({container:B.current,root:T,value:s,autoFocus:l,theme:m,height:h,minHeight:p,maxHeight:P,width:R,minWidth:E,maxWidth:N,basicSetup:F,placeholder:D,indentWithTab:j,editable:f,readOnly:k,selection:o,onChange:a,onStatistics:c,onCreateEditor:u,onUpdate:g,extensions:i,initialState:S});if(x.useImperativeHandle(n,()=>({editor:B.current,state:L,view:M}),[B,Z,L,M]),typeof s!="string")throw new Error("value must be typeof string but got "+typeof s);var Q=typeof m=="string"?"cm-theme-"+m:"cm-theme";return t.jsx("div",Ee({ref:B,className:""+Q+(r?" "+r:"")},y))});vt.displayName="CodeMirror";var St=e=>{var{theme:n,settings:r={},styles:s=[]}=e,o={".cm-gutters":{}},i={};r.background&&(i.backgroundColor=r.background),r.backgroundImage&&(i.backgroundImage=r.backgroundImage),r.foreground&&(i.color=r.foreground),r.fontSize&&(i.fontSize=r.fontSize),(r.background||r.foreground)&&(o["&"]=i),r.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(o[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(o[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(o[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(o[".cm-content"]={caretColor:r.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var a={};r.gutterActiveForeground&&(a.color=r.gutterActiveForeground),r.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:r.lineHighlight},a.backgroundColor=r.lineHighlight),o[".cm-activeLineGutter"]=a,r.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var c=z.theme(o,{dark:n==="dark"}),u=jt.define(s),g=[c,Be(u)];return g},Br={background:"#faf8f5",foreground:"#b29762",caret:"#93abdc",selection:"#e3dcce",selectionMatch:"#e3dcce",gutterBackground:"#faf8f5",gutterForeground:"#cdc4b1",gutterBorder:"transparent",lineHighlight:"#ddceb154"},Or=[{tag:[d.comment,d.bracket],color:"#b6ad9a"},{tag:[d.atom,d.number,d.keyword,d.link,d.attributeName,d.quote],color:"#063289"},{tag:[d.emphasis,d.heading,d.tagName,d.propertyName,d.variableName],color:"#2d2006"},{tag:[d.typeName,d.url,d.string],color:"#896724"},{tag:[d.operator,d.string],color:"#1659df"},{tag:[d.propertyName],color:"#b29762"},{tag:[d.unit,d.punctuation],color:"#063289"}],Ar=e=>{var{theme:n="light",settings:r={},styles:s=[]}={};return St({theme:n,settings:Ee({},Br,r),styles:[...Or,...s]})},Dr=Ar(),Nr={background:"#2a2734",foreground:"#6c6783",caret:"#ffad5c",selection:"#91ff6c26",selectionMatch:"#91ff6c26",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},$r=[{tag:[d.comment,d.bracket],color:"#6c6783"},{tag:[d.atom,d.number,d.keyword,d.link,d.attributeName,d.quote],color:"#ffcc99"},{tag:[d.emphasis,d.heading,d.tagName,d.propertyName,d.className,d.variableName],color:"#eeebff"},{tag:[d.typeName,d.url],color:"#7a63ee"},{tag:d.operator,color:"#ffad5c"},{tag:d.string,color:"#ffb870"},{tag:[d.propertyName],color:"#9a86fd"},{tag:[d.unit,d.punctuation],color:"#e09142"}],Lr=e=>{var{theme:n="dark",settings:r={},styles:s=[]}={};return St({theme:n,settings:Ee({},Nr,r),styles:[...$r,...s]})},Wr=Lr();const Mr=b("aside")(({theme:e})=>({height:"50px",backgroundColor:e.palette.background.paper,borderTopRightRadius:e.shape.borderRadiusMedium,borderTopLeftRadius:e.shape.borderRadiusMedium,padding:e.spacing(1,2),color:e.palette.text.primary,display:"flex",justifyContent:"space-between",alignItems:"center",border:`1px solid ${e.palette.divider}`})),Ct=b("div")(({theme:e,style:n})=>({width:e.spacing(3),height:e.spacing(3),display:"flex",alignItems:"center",color:e.palette.background.paper,justifyContent:"center",transition:"background-color 0.5s ease-in-out",borderRadius:"50%",...n})),Hr=b("div")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.error.dark,marginRight:e.spacing(1)})),Ur=()=>{const e=O();return t.jsx(Ct,{style:{backgroundColor:e.palette.success.main},children:t.jsx(Jt,{sx:n=>({width:n.spacing(2),height:n.spacing(2)})})})},zr=()=>{const e=O();return t.jsx(Ct,{style:{backgroundColor:e.palette.error.main},children:t.jsx(Yt,{})})},_r=({context:e,setContext:n,error:r})=>{const{themeMode:s}=x.useContext(Kt),o=O(),i=x.useCallback(a=>{n(a)},[n]);return t.jsxs(C,{sx:{width:"100%"},children:[t.jsxs(Mr,{children:["JSON",t.jsx(v,{condition:!!r,show:t.jsxs(C,{sx:a=>({display:"flex",alignItems:"center"}),children:[t.jsx(Hr,{children:r}),t.jsx(zr,{})]}),elseShow:t.jsx(Ur,{})})]}),t.jsx(vt,{value:e,height:"150px",theme:s==="dark"?Wr:Dr,extensions:[cr()],onChange:i,style:{border:`1px solid ${o.palette.divider}`,borderTop:"none"},placeholder:JSON.stringify({currentTime:"2022-07-04T14:13:03.929Z",appName:"playground",userId:"test",remoteAddress:"127.0.0.1"},null,2)})]})};function wt(e){return Array.isArray(e)?e:[e]}const qr=e=>!e||e.length===0||e.length===1&&e[0]==="*"?"*":wt(e),Gr=e=>wt(e),Vr=e=>{const n=Kr(e);return n.length>0?n[0]:""},Kr=e=>e.filter(({enabled:n})=>!!n).sort((n,r)=>n.sortOrder-r.sortOrder).map(({name:n})=>n),Jr=(e,n)=>"100%",Yr=e=>typeof e=="string"?!0:Array.isArray(e)?e.every(n=>typeof n=="string"):!1,Zr=e=>{const n=new Set(["appName","environment","userId","sessionId","remoteAddress","currentTime","properties"]),r={...e};let s=!1;for(const o in e)n.has(o)||(r.properties||(r.properties={}),r.properties[o]=e[o],delete r[o],s=!0);return!s&&!e.properties&&delete r.properties,r},Qr=e=>{const[n]=e.split("."),[r,s]=n.split(":");if(!r||!s)throw new Error("Invalid token format");if(s==="*")throw new Error("Admin tokens are not supported in the playground")},Xr=e=>{const[n]=e.split(".");return n.split(":")},es=({context:e,setContext:n})=>{const r=O(),{setToastData:s}=ot(),{context:o}=Zt(),i=o.sort((j,f)=>j.sortOrder-f.sortOrder).map(({name:j})=>j),[a,c]=x.useState(),[u,g]=x.useState(!1),[l,m]=x.useState(""),[h,p]=x.useState(""),P=x.useMemo(()=>xr(j=>{var f;if(!j)return c(void 0);try{const k=JSON.parse(j);g(k[l]!==void 0||((f=k==null?void 0:k.properties)==null?void 0:f[l])!==void 0)}catch(k){return c(ee(k))}return c(void 0)},250),[c,l,g]);x.useEffect(()=>{P(e)},[P,e]);const R=()=>{try{const j=JSON.parse(e||"{}");n(JSON.stringify(Zr({...j,[l]:h}),null,2));const f=o.find(k=>k.name===l);if(f!=null&&f.legalValues&&f.legalValues.length>0||l==="currentTime")return p("")}catch(j){s({type:"error",title:`Error parsing context: ${ee(j)}`})}},E=(j,f)=>{if(Yr(f)){if(Array.isArray(f)){const k=(f||[]).length>1?f.join(","):f[0];return p(k)}p(f)}},N=()=>{if(!h||h==="")return[];const j=o.find(k=>k.name===l),f=((j==null?void 0:j.legalValues)||[]).length>1;return h.includes(",")&&f?h.split(","):[h]},F=()=>{if(l==="currentTime"){const f=Me(h),T=f?He(f.toISOString()):He(new Date().toISOString());return t.jsx(se,{id:"date",label:"Date",size:"small",type:"datetime-local",value:T,sx:{width:200,maxWidth:"100%"},onChange:S=>{const y=Me(S.target.value),B=y==null?void 0:y.toISOString();B&&p(B)},InputLabelProps:{shrink:!0},required:!0})}const j=o.find(f=>f.name===l);if(j!=null&&j.legalValues&&j.legalValues.length>0){const f=j.legalValues.map(({value:k})=>k);return t.jsx(at,{disablePortal:!0,limitTags:3,id:"context-legal-values",freeSolo:!0,filterSelectedOptions:!0,size:"small",value:N(),onChange:E,options:f,multiple:!0,sx:{width:370,maxWidth:"100%"},renderInput:k=>t.jsx(se,{...k,label:"Value"}),disableCloseOnSelect:!1})}return t.jsx(se,{label:"Value",id:"context-value",sx:{width:370,maxWidth:"100%"},placeholder:"value1,value2,value3",size:"small",value:h,onChange:f=>p(f.target.value||"")})},D=j=>{if(m(j.target.value||""),j.target.value==="currentTime")return p(new Date().toISOString());p("")};return t.jsxs(C,{children:[t.jsx(C,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(I,{variant:"body2",color:r.palette.text.primary,sx:{ml:1},children:"Unleash context"})}),t.jsxs(C,{sx:{display:"flex",gap:2,flexWrap:"wrap",mb:2},children:[t.jsxs(Qt,{children:[t.jsx(Xt,{id:"context-field-label",size:"small",children:"Context field"}),t.jsx(en,{label:"Context field",labelId:"context-field-label",id:"context-field",value:l,onChange:D,variant:"outlined",size:"small",sx:{width:200,maxWidth:"100%"},children:i.map(j=>t.jsx(tn,{value:j,children:j},j))})]}),F(),t.jsx(ce,{variant:"outlined",disabled:!l||!!a,onClick:R,sx:{width:"95px",maxHeight:"40px"},children:`${u?"Replace":"Add"} `})]}),t.jsx(_r,{context:e,setContext:n,error:a})]})},ts=({environments:e,setEnvironments:n,availableEnvironments:r,disabled:s})=>{const o=[...r.map(c=>({label:c,id:c}))],i=o.filter(({id:c})=>e.includes(c)),a=(c,u,g)=>{const l=u;return g==="clear"||l===null?n([]):Array.isArray(l)?l.length===0?n([]):n(l.map(({id:m})=>m)):n([l.id])};return t.jsx(at,{disablePortal:!0,limitTags:3,id:"environment",multiple:!0,options:o,sx:{flex:1},renderInput:c=>t.jsx(se,{...c,label:"Environments"}),renderOption:nn,getOptionLabel:({label:c})=>c,disableCloseOnSelect:!1,size:"small",value:i,onChange:a,disabled:s,"data-testid":"PLAYGROUND_ENVIRONMENT_SELECT"})},je={label:"ALL",id:"*"},Xe=b(rn)({fontSize:"1.25rem"}),kt=b(sn)(()=>({width:"100%"})),ns=b(C)(({theme:e})=>({display:"grid",columnGap:e.spacing(2),rowGap:e.spacing(2),gridTemplateColumns:"1fr",[e.breakpoints.up("md")]:{gridTemplateColumns:"1fr 1fr"}})),rs=b(kt)(({theme:e})=>({"& label":{WebkitTextFillColor:e.palette.text.secondary},"& input.Mui-disabled":{WebkitTextFillColor:e.palette.text.secondary}})),ss=({environments:e,projects:n,token:r,setProjects:s,setEnvironments:o,setToken:i,availableEnvironments:a,changeRequest:c,onClearChangeRequest:u})=>{const g=O(),{tokens:l}=dr(),[m,h]=x.useState(),{projects:p}=on(),P=an("changeRequestPlayground"),R=[je,...p.map(({name:S,id:y})=>({label:S,id:y}))],E=async S=>{const y=S.target.value;if(i==null||i(y),y===""){k();return}try{Qr(y),h(void 0),N(y)}catch(B){h(B.message)}},N=S=>{const[y,B]=Xr(S);switch(o([B]),y){case"[]":D(S);break;case"*":j();break;default:f(y)}},F=S=>{!S.projects||S.projects==="*"?s([je.id]):typeof S.projects=="string"?s([S.projects]):Array.isArray(S.projects)&&s(S.projects)},D=S=>{const y=l.find(({secret:B})=>B===S);y?F(y):h("Invalid token. Ensure you use a valid token from this Unleash instance.")},j=()=>{s([je.id])},f=S=>{R.map(y=>y.id).includes(S)?s([S]):h(`Invalid token. Project ${S} does not exist.`)},k=()=>{h(void 0)},T=()=>{i==null||i(""),k()};return t.jsxs(C,{sx:{pb:2},children:[t.jsx(C,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(I,{variant:"body2",color:g.palette.text.primary,sx:{ml:1},children:"Access configuration"})}),t.jsxs(ns,{children:[t.jsx(C,{children:t.jsx(Ue,{arrow:!0,title:r?"Environment is automatically selected because you are using a token":"Select environments to use in the playground",children:t.jsx(C,{children:t.jsx(ts,{environments:e,setEnvironments:o,availableEnvironments:a,disabled:!!(r||c)})})})}),t.jsx(C,{children:t.jsx(Ue,{arrow:!0,title:r?"Project is automatically selected because you are using a token":"Select projects to use in the playground",children:t.jsx(ln,{selectedProjects:n,onChange:s,dataTestId:"PLAYGROUND_PROJECT_SELECT",disabled:!!(r||c),limitTags:3})})}),t.jsx(C,{children:t.jsx(kt,{label:"API token",value:r||(c?" ":""),onChange:E,type:"text",error:!!m,errorText:m,placeholder:"Enter your API token","data-testid":"PLAYGROUND_TOKEN_INPUT",InputProps:{endAdornment:r?t.jsx(ze,{position:"end","data-testid":"TOKEN_INPUT_CLEAR_BTN",children:t.jsx(_,{"aria-label":"clear API token",onClick:T,edge:"end",children:t.jsx(Xe,{})})}):null},disabled:!!c})}),t.jsx(v,{condition:!!(P&&c),show:t.jsxs(C,{sx:{display:"flex",gap:2},children:[t.jsx(C,{sx:{flex:1},children:t.jsx(rs,{label:"Change request",value:c?`Change request #${c}`:"",onChange:()=>{},type:"text",disabled:!0,InputProps:{endAdornment:t.jsx(ze,{position:"end",children:t.jsx(_,{"aria-label":"clear Change request results",onClick:u,edge:"end",children:t.jsx(Xe,{})})})}})}),t.jsx(ce,{variant:"outlined",size:"small",to:`/projects/${n[0]}/change-requests/${c}`,component:cn,children:"View change request"})]})})]})]})},os=({availableEnvironments:e,environments:n,onSubmit:r,projects:s,token:o,setToken:i,setProjects:a,setEnvironments:c,context:u,setContext:g,changeRequest:l,onClearChangeRequest:m})=>t.jsxs(C,{component:"form",onSubmit:r,sx:{display:"flex",flexDirection:"column"},children:[t.jsx(ss,{environments:Array.isArray(n)?n:[n],projects:s,token:o,setToken:i,setEnvironments:c,setProjects:a,availableEnvironments:e.map(({name:h})=>h),changeRequest:l,onClearChangeRequest:m}),t.jsx(es,{context:u,setContext:g}),t.jsx(C,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:t.jsx(ce,{variant:"contained",size:"large",type:"submit",sx:{marginLeft:"auto"},children:"Try configuration"})})]}),as=b("div")(({style:e,theme:n})=>({width:"25px",height:"25px",borderRadius:"50%",color:n.palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...e})),is=({style:e,children:n,type:r})=>{const s=O(),o={backgroundColor:s.palette.background.alternative,color:s.palette.common.white};return r==="secondary"&&(o.backgroundColor=s.palette.background.paper,o.color=s.palette.text.secondary),t.jsx(as,{style:{...o,...e},children:n})},ye=({headerText:e,bodyText:n,sectionNumber:r})=>t.jsx(C,{sx:{display:"flex",alignItems:"flex-start",mt:2,flexDirection:"column"},children:t.jsxs(C,{sx:{display:"flex"},children:[t.jsx(C,{children:t.jsx(is,{children:r})}),t.jsxs(C,{sx:{ml:2,display:"flex",flexDirection:"column"},children:[t.jsx(I,{variant:"body1",sx:{fontWeight:"bold"},children:e}),t.jsx(v,{condition:!!n,show:t.jsx(I,{variant:"body1",sx:{mt:1},children:n})})]})]})}),Et=()=>t.jsxs(C,{sx:{ml:4},children:[t.jsx(I,{variant:"body1",children:"Unleash playground is for helping you to understand how Unleash works, how feature flags are evaluated and for you to easily debug your feature flags."}),t.jsx(dn,{sx:{mt:2,mb:2}}),t.jsx(I,{variant:"body1",sx:{mb:1},children:"What you need to do is:"}),t.jsx(ye,{headerText:`Select in which environment you want to test your
2
2
  feature flag configuration`,bodyText:`You can also specify specific projects, or check
3
3
  flags in all projects.`,sectionNumber:"1"}),t.jsx(ye,{headerText:"Select a context field that you'd like to check",bodyText:"You can configure as many context fields as you want. You can also leave the context empty to test against an empty context.",sectionNumber:"2"}),t.jsx(ye,{headerText:"Submit the form to try the configuration",bodyText:"The results of evaluating your feature flags will appear after you submit the form. Then view the results.",sectionNumber:"3"})]});var Ae={},ls=ue;Object.defineProperty(Ae,"__esModule",{value:!0});var Tt=Ae.default=void 0,cs=ls(de()),ds=t,us=(0,cs.default)((0,ds.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}),"Help");Tt=Ae.default=us;const hs=()=>{const[e,n]=x.useState(null),r=a=>n(a.currentTarget),s=()=>n(null),o=!!e,i="playground-guidance-popper";return t.jsxs(C,{children:[t.jsx(_,{onClick:r,"aria-describedby":i,children:t.jsx(Tt,{})}),t.jsx(un,{id:i,open:o,anchorEl:e,sx:a=>({zIndex:a.zIndex.tooltip}),children:t.jsxs(it,{sx:a=>({padding:a.spacing(8,4),maxWidth:"500px",borderRadius:`${a.shape.borderRadiusExtraLarge}px`}),children:[t.jsx(_,{onClick:s,sx:{position:"absolute",right:25,top:15},children:t.jsx(hn,{})}),t.jsx(Et,{})]})})]})},gs=e=>x.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84818 0.184159C8.56367 -0.0789547 8.1234 -0.0575747 7.86482 0.231912C7.60623 0.521399 7.62724 0.96937 7.91175 1.23248C9.48292 2.68551 10.6076 4.74934 10.6076 7C10.6076 9.25066 9.48292 11.3145 7.91175 12.7675C7.62724 13.0306 7.60623 13.4786 7.86482 13.7681C8.1234 14.0576 8.56367 14.079 8.84818 13.8158C10.6396 12.1592 11.9998 9.73702 11.9998 7C11.9998 4.26298 10.6396 1.84083 8.84818 0.184159ZM6.04105 2.23302C6.29109 1.93586 6.73054 1.90121 7.02259 2.15563C8.33146 3.29586 9.35426 5.02309 9.35426 6.99995C9.35426 8.97682 8.33145 10.7039 7.02259 11.8441C6.73054 12.0986 6.29109 12.0639 6.04105 11.7668C5.79101 11.4696 5.82506 11.0225 6.11711 10.768C7.19425 9.82969 7.96199 8.46967 7.96199 6.99995C7.96199 5.53021 7.19423 4.17007 6.11711 3.23173C5.82506 2.97731 5.79101 2.53017 6.04105 2.23302ZM6.56908 7.00015C6.56908 8.56492 5.3224 9.83342 3.78454 9.83342C2.24668 9.83342 1 8.56492 1 7.00015C1 5.43539 2.24668 4.16689 3.78454 4.16689C5.3224 4.16689 6.56908 5.43539 6.56908 7.00015Z",fill:"currentColor"})),xs=e=>x.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84835 0.184159C8.56384 -0.0789547 8.12358 -0.0575747 7.86499 0.231912C7.6064 0.521399 7.62741 0.96937 7.91192 1.23248C9.4831 2.68551 10.6078 4.74934 10.6078 7C10.6078 7.40738 10.5709 7.80863 10.5012 8.20125L11.6597 9.35972C11.8783 8.60937 12 7.81877 12 7C12 4.26298 10.6397 1.84083 8.84835 0.184159ZM9.35443 6.99995L9.35418 7.0542L7.63252 5.33255C7.30901 4.52372 6.76993 3.80029 6.11728 3.23173C5.82523 2.97731 5.79118 2.53017 6.04122 2.23302C6.29127 1.93586 6.73072 1.90121 7.02276 2.15563C8.33164 3.29586 9.35443 5.02309 9.35443 6.99995ZM7.57827 8.79752L6.48307 7.70233C6.17606 8.92745 5.08437 9.83342 3.78471 9.83342C2.24685 9.83342 1.00017 8.56492 1.00017 7.00015C1.00017 5.69492 1.8676 4.59583 3.04789 4.26714L0.458225 1.67748C0.172794 1.39205 0.178843 0.923223 0.471736 0.63033C0.764629 0.337437 1.23345 0.331388 1.51889 0.616819L13.2132 12.3111C13.4986 12.5965 13.4926 13.0654 13.1997 13.3583C12.9068 13.6511 12.4379 13.6572 12.1525 13.3718L10.556 11.7753C10.0694 12.539 9.48623 13.2259 8.84835 13.8158C8.56384 14.079 8.12358 14.0576 7.86499 13.7681C7.6064 13.4786 7.62741 13.0306 7.91192 12.7675C8.54021 12.1865 9.0971 11.5078 9.53922 10.7585L8.62356 9.84281C8.20906 10.6195 7.64861 11.2989 7.02276 11.8441C6.73072 12.0986 6.29127 12.0639 6.04122 11.7668C5.79118 11.4696 5.82523 11.0225 6.11728 10.768C6.73471 10.2302 7.25048 9.55374 7.57827 8.79752Z",fill:"currentColor"}));var De={},ms=ue;Object.defineProperty(De,"__esModule",{value:!0});var Rt=De.default=void 0,fs=ms(de()),ps=t,bs=(0,fs.default)((0,ps.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"WarningOutlined");Rt=De.default=bs;const Y=({enabled:e,label:n,showIcon:r=!0})=>{const s=O(),o=t.jsx(v,{condition:e==="unknown"||e==="unevaluated",show:t.jsx(Rt,{color:"warning",fontSize:"inherit"}),elseShow:t.jsx(v,{condition:typeof e=="boolean"&&!!e,show:t.jsx(gs,{color:s.palette.success.main,strokeWidth:"0.25"}),elseShow:t.jsx(xs,{color:s.palette.error.main,strokeWidth:"0.25"})})});return t.jsx(v,{condition:e==="unknown"||e==="unevaluated",show:t.jsx(J,{icon:r?o:void 0,color:"warning",children:n}),elseShow:t.jsx(v,{condition:typeof e=="boolean"&&!!e,show:t.jsx(J,{color:"success",icon:r?o:void 0,children:n}),elseShow:t.jsx(J,{color:"error",icon:r?o:void 0,children:n})})})},js=b(C)(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing(1,0,1,2)})),ys=b(C)(()=>({marginRight:"auto"})),Pt=({feature:e})=>{const[n,r]=(()=>{var s;return e!=null&&e.isEnabled?[!0,"True"]:((s=e==null?void 0:e.strategies)==null?void 0:s.result)==="unknown"?["unknown","Unknown"]:[!1,"False"]})();return t.jsx(js,{children:t.jsx(ys,{"data-loading":!0,children:t.jsx(Y,{enabled:n,label:r,showIcon:n!=="unknown"})})})};function It(e){return e===void 0?!0:Object.values(e).every(n=>n&&typeof n=="object"?It(n):n===null)}const et=e=>{var n,r;return(r=(n=e.strategies)==null?void 0:n.data)==null?void 0:r.find(s=>!lt.includes(s.name))},vs=e=>{var n,r,s,o;return((r=(n=e.strategies)==null?void 0:n.data)==null?void 0:r.length)>0&&!((o=(s=e.strategies)==null?void 0:s.data)!=null&&o.find(i=>lt.includes(i.name)))},Ss=b("div")({display:"flex",justifyContent:"space-between",width:"100%"}),Cs=b("div")(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(1.5),marginTop:e.spacing(1.5)})),tt=b("div")(({theme:e})=>({margin:e.spacing(1,0)})),ws=b("div")(({theme:e})=>({margin:e.spacing(1,.5)})),ks=b(I)(({theme:e})=>({fontWeight:600,padding:e.spacing(.5)})),Es=b(_)({textAlign:"right"}),Ts=({feature:e,input:n,onClose:r})=>{var l;const s=O(),[o,i,a]=e.isEnabled?[`This feature flag is True in ${n==null?void 0:n.environment} because `,"at least one strategy is True",s.palette.success.main]:e.hasUnsatisfiedDependency&&!e.isEnabledInCurrentEnvironment?[`This feature flag is False in ${n==null?void 0:n.environment} because `,"parent dependency is not satisfied and the environment is disabled",s.palette.error.main]:e.isEnabledInCurrentEnvironment?vs(e)?[`This feature flag is Unknown in ${n==null?void 0:n.environment} because `,"no strategies could be fully evaluated",s.palette.warning.main]:et(e)?[`This feature flag is Unknown in ${n==null?void 0:n.environment} because `,"not all strategies could be fully evaluated",s.palette.warning.main]:e.hasUnsatisfiedDependency?[`This feature flag is False in ${n==null?void 0:n.environment} because `,"parent dependency is not satisfied",s.palette.error.main]:[`This feature flag is False in ${n==null?void 0:n.environment} because `,"all strategies are either False or could not be fully evaluated",s.palette.error.main]:[`This feature flag is False in ${n==null?void 0:n.environment} because `,"the environment is disabled",s.palette.error.main],c=It(n==null?void 0:n.context)?"You did not provide a value for your context field in step 2 of the configuration":void 0,u=et(e)?"This feature uses custom strategies. Custom strategies can't be evaluated, so they will be marked accordingly.":void 0,g=r&&(m=>{m.stopPropagation(),r()});return t.jsxs(t.Fragment,{children:[t.jsxs(Ss,{children:[t.jsxs(Cs,{children:[t.jsx(ks,{variant:"subtitle1",children:e.name}),t.jsx(v,{condition:((l=e==null?void 0:e.strategies)==null?void 0:l.result)!=="unknown",show:()=>t.jsx(Y,{enabled:e.isEnabled,label:e.isEnabled?"True":"False"}),elseShow:()=>t.jsx(Y,{enabled:"unknown",label:"Unknown",showIcon:!1})})]}),t.jsx(Es,{onClick:g,children:t.jsx(gn,{})})]}),t.jsxs(ws,{children:[t.jsx(I,{variant:"body1",component:"span",children:o}),t.jsx(I,{variant:"subtitle1",color:a,component:"span",children:i}),t.jsx(I,{variant:"body1",component:"span",children:"."})]}),t.jsx(v,{condition:!!c,show:t.jsx(tt,{children:t.jsx(te,{color:"info",children:c})})}),t.jsx(v,{condition:!!u,show:t.jsx(tt,{children:t.jsx(te,{severity:"warning",color:"info",children:u})})})]})};var Ne={},Rs=ue;Object.defineProperty(Ne,"__esModule",{value:!0});var ne=Ne.default=void 0,Ps=Rs(de()),Is=t,Fs=(0,Ps.default)((0,Is.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");ne=Ne.default=Fs;const Bs=b("div")(({theme:e})=>({display:"flex",alignItems:"center",marginTop:e.spacing(1),color:e.palette.error.main})),Os=({constraint:e,input:n})=>{const r=()=>{const s=n==null?void 0:n.context[e.contextName];return s?`Constraint not met – the value in the context: { ${s} } is not ${e.operator} ${e.contextName}`:`Constraint not met – no value was specified for ${e.contextName}`};return t.jsxs(Bs,{children:[t.jsx(ne,{style:{marginRight:"0.25rem"}}),t.jsx(I,{variant:"body2",children:r()})]})},As=b(xn)(({theme:e})=>({color:e.palette.success.main})),Ds=b("div")(({theme:e})=>({display:"flex",alignItems:"center",marginTop:e.spacing(1),color:e.palette.success.main})),Ns=()=>t.jsxs(Ds,{children:[t.jsx(As,{style:{marginRight:"0.25rem"}}),t.jsx(I,{variant:"body2",children:"Constraint met by value in context"})]}),$s=b("div")(()=>({width:"100%",display:"flex",flexDirection:"column"})),Ft=({constraints:e,input:n})=>e?t.jsx($s,{children:e==null?void 0:e.map((r,s)=>t.jsxs(x.Fragment,{children:[t.jsx(v,{condition:s>0,show:t.jsx(q,{text:"AND"})}),t.jsx(ct,{constraint:r,compact:!0,renderAfter:t.jsx(v,{condition:r.result,show:t.jsx(Ns,{}),elseShow:t.jsx(Os,{input:n,constraint:r})})})]},Te(r)))}):null,Ls=b("div")(({theme:e})=>({color:e.palette.error.main,display:"inline-flex",justifyContent:"center",marginLeft:"auto",gap:e.spacing(1)})),Ws=({segments:e,input:n})=>e?t.jsx(t.Fragment,{children:e.map((r,s)=>t.jsxs(x.Fragment,{children:[t.jsx(dt,{segment:r,constraintList:t.jsx(Ft,{constraints:r.constraints,input:n}),headerContent:t.jsx(v,{condition:!r.result,show:t.jsxs(Ls,{children:[t.jsx(I,{variant:"subtitle2",sx:{pt:.25},children:"segment is false"}),t.jsx("span",{children:t.jsx(ne,{})})]})}),isExpanded:!0}),t.jsx(v,{condition:s>=0&&e.length>1&&s!==e.length-1,show:t.jsx(q,{text:"AND"})})]},r.id))}):null,Ms=b("div",{shouldForwardProp:e=>e!=="showReason"})(({theme:e,showReason:n})=>({width:"100%",padding:e.spacing(2,3),borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.divider}`,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:e.spacing(2),opacity:n?.9:1,backgroundColor:n?e.palette.background.paper:"inherit"})),Hs=b("div")(({theme:e})=>({flexDirection:"column"})),Us=b(mn)(({theme:e})=>({margin:e.spacing(.5)})),zs=b("p",{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:n})=>({display:"inline",margin:e.spacing(.5,0),maxWidth:"95%",textAlign:"center",wordBreak:"break-word",color:n?e.palette.text.secondary:"inherit"})),ve=({value:e,text:n,input:r,showReason:s=!1,disabled:o=!1})=>{const i=O(),a=r==="no value"&&!o?"error":"neutral",c=`value does not match any ${n}`;return t.jsxs(Ms,{showReason:s,children:[t.jsx(I,{variant:"subtitle1",color:i.palette[a].main,children:`${r}`}),t.jsxs(Hs,{children:[t.jsx(v,{condition:!!s,show:t.jsx(I,{variant:"subtitle1",color:o?i.palette.text.secondary:i.palette.error.main,children:c})}),t.jsx(v,{condition:e.length===0,show:t.jsxs("p",{children:["No ",n,"s added yet."]}),elseShow:t.jsxs("div",{children:[t.jsxs(zs,{disabled:o,children:[e.length," ",e.length>1?`${n}s`:n," will get access."]}),e.map(u=>t.jsx(Us,{disabled:o,label:t.jsx(Ce,{maxWidth:"300",text:u.toString(),maxLength:50})},u))]})})]}),t.jsx(v,{condition:!!s,show:t.jsx(ne,{color:o?"disabled":"error"}),elseShow:t.jsx("div",{})})]})},$e=b(C)(({theme:e})=>({width:"auto",height:"auto",padding:e.spacing(2,3),borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.divider}`})),U=e=>{switch(e.toUpperCase()){case"USERIDS":return"userId";case"IPS":return"remoteAddress";default:return e}},_s=({percentage:e,size:n="4rem"})=>{const r=O(),s={display:"block",borderRadius:"100%",transform:"rotate(-90deg)",height:n,width:n,background:r.palette.background.elevation2},o=100/(2*Math.PI),i=2*o;return t.jsxs("svg",{viewBox:`0 0 ${i} ${i}`,style:s,"aria-hidden":!0,children:[t.jsxs("title",{children:["A circle progress bar with ",e,"% completion."]}),t.jsx("circle",{r:o,cx:o,cy:o,fill:"none",stroke:r.palette.neutral.border,strokeWidth:i,strokeDasharray:`${e} 100`})]})},qs=b("div",{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:n})=>({color:n?e.palette.text.secondary:e.palette.neutral.main})),Bt=({parameters:e,constraints:n,input:r,disabled:s=!1})=>{const o=e==null?void 0:e.stickiness,i=typeof o=="string"&&o!=="default";return t.jsx(t.Fragment,{children:Object.keys(e).map(a=>{var c,u,g,l,m,h,p,P;switch(a){case"rollout":case"Rollout":{const R=we(e[a]);return t.jsxs($e,{sx:{display:"flex",alignItems:"center"},children:[t.jsx(C,{sx:E=>({mr:"1rem",color:s?E.palette.neutral.border:E.palette.text.secondary}),children:t.jsx(v,{condition:s,show:t.jsx(_s,{percentage:R,size:"2rem"}),elseShow:t.jsx(fn,{percentage:R,size:"2rem"})})}),t.jsxs(qs,{disabled:s,children:[t.jsxs(J,{color:s?"disabled":"success",children:[R,"%"]})," ","of your base"," ",t.jsxs("span",{children:[i?t.jsxs(t.Fragment,{children:["with"," ",t.jsx("strong",{children:o})]}):""," "]}),n.length>0?"who match constraints":""," ","is included."]})]},a)}case"userIds":case"UserIds":{const R=oe(e[a]);return t.jsx(ve,{value:R,text:"user",input:(c=r==null?void 0:r.context)!=null&&c[U(a)]?(u=r==null?void 0:r.context)==null?void 0:u[U(a)]:"no value",showReason:(g=r==null?void 0:r.context)!=null&&g[U(a)]?!R.includes((l=r==null?void 0:r.context)==null?void 0:l[U(a)]):void 0},a)}case"hostNames":case"HostNames":{const R=oe(e[a]);return t.jsx(ve,{value:R,text:"host",input:"no value",showReason:void 0,disabled:s},a)}case"IPs":{const R=oe(e[a]);return t.jsx(ve,{value:R,text:"IP",disabled:s,input:(m=r==null?void 0:r.context)!=null&&m[U(a)]?(h=r==null?void 0:r.context)==null?void 0:h[U(a)]:"no value",showReason:(p=r==null?void 0:r.context)!=null&&p[U(a)]?!R.includes((P=r==null?void 0:r.context)==null?void 0:P[U(a)]):void 0},a)}case"stickiness":case"groupId":return null;default:return null}})})},Gs=b(C)(({theme:e})=>({width:"100%",padding:e.spacing(2,3),borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.divider}`,display:"flex",flexDirection:"row",alignItems:"center",gap:2})),X=({text:e,input:n=null,isRequired:r=!1})=>{const s=O(),o=n===null?"error":"neutral",i=r&&n===null;return t.jsxs(Gs,{children:[t.jsx(I,{variant:"subtitle1",color:s.palette[o].main,sx:{minWidth:118},children:`${n===null?"no value":n}`}),t.jsx(C,{sx:{flexGrow:1,flexDirection:"column"},children:t.jsx(C,{sx:{flexGrow:1},children:t.jsx(v,{condition:!!i,show:t.jsxs(t.Fragment,{children:[t.jsx(I,{component:"span",color:s.palette.error.main,children:" required parameter "}),t.jsx(Ce,{maxWidth:"300",text:e,maxLength:50}),t.jsx(I,{component:"span",color:s.palette.error.main,children:" is not set "})]}),elseShow:t.jsxs(t.Fragment,{children:[t.jsx(I,{component:"span",color:"text.disabled",children:" set on parameter "}),t.jsx(Ce,{maxWidth:"300",text:e,maxLength:50})]})})})}),t.jsx(v,{condition:!!i,show:t.jsx(ne,{color:"error"}),elseShow:t.jsx("div",{})})]})},Ot=({strategyName:e,parameters:n})=>{const{strategies:r}=pn(),s=r.find(i=>i.name===e);if(!(s!=null&&s.editable))return null;const o=s==null?void 0:s.parameters.map(i=>{const a=n[i.name],c=i.required;switch(i==null?void 0:i.type){case"list":{const u=oe(a);return t.jsx(X,{isRequired:c,text:i.name,input:(u==null?void 0:u.length)>0?u.join(", "):null})}case"percentage":{const u=we(a),g=!(a===void 0||a===""||u<0||u>100);return t.jsx(X,{text:i.name,isRequired:c,input:g?`${u}%`:void 0})}case"boolean":{const u=["true","false"].includes(a)?a:void 0;return t.jsx(X,{isRequired:c,text:i.name,input:a!==void 0?u:void 0})}case"string":{const u=bn(a);return t.jsx(X,{text:i.name,isRequired:c,input:u!==void 0?u:void 0})}case"number":{const u=!(a===void 0||a===""),g=we(a);return t.jsx(X,{text:i.name,isRequired:c,input:u?`${g}`:void 0})}case"default":return null}return null});return t.jsx(t.Fragment,{children:o.map((i,a)=>t.jsxs(x.Fragment,{children:[t.jsx(v,{condition:a>0,show:t.jsx(q,{text:"AND"})}),i]},a))})},Vs=b("div")(({theme:e})=>({padding:e.spacing(0)})),Ks=({strategyResult:e,input:n})=>{const{name:r,constraints:s,segments:o,parameters:i}=e,a=!!(o&&o.length>0),c=!!(s&&(s==null?void 0:s.length)>0),u=r!=="default"&&Object.keys(ut).includes(r),g=Object.keys(i).length>0&&e.result.evaluationStatus==="incomplete";if(!i)return null;const l=[a&&t.jsx(Ws,{segments:o,input:n}),c&&t.jsx(Ft,{constraints:s,input:n}),u&&t.jsx(Bt,{parameters:i,constraints:s,input:n}),g&&t.jsx(Ot,{strategyName:r,parameters:i}),r==="default"&&t.jsxs($e,{sx:{width:"100%"},children:["The standard strategy is ",t.jsx(J,{color:"success",children:"ON"})," for all users."]})].filter(Boolean);return t.jsx(Vs,{children:l.map((m,h)=>t.jsxs(x.Fragment,{children:[t.jsx(v,{condition:h>0&&(e.name==="flexibleRollout"?h<l.length:h<l.length-1),show:t.jsx(q,{text:"AND"})}),m]},h))})},Js=b("div")(()=>({width:"100%",display:"flex",flexDirection:"column"})),At=({constraints:e})=>e?t.jsx(Js,{children:e==null?void 0:e.map((n,r)=>t.jsxs(x.Fragment,{children:[t.jsx(v,{condition:r>0,show:t.jsx(q,{text:"AND"})}),t.jsx(ct,{constraint:n,compact:!0,disabled:!0})]},Te(n)))}):null,Ys=({segments:e})=>e?t.jsx(t.Fragment,{children:e.map((n,r)=>t.jsxs(x.Fragment,{children:[t.jsx(dt,{segment:n,constraintList:t.jsx(At,{constraints:n.constraints}),isExpanded:!0,disabled:!0}),t.jsx(v,{condition:r>=0&&e.length>1&&r!==e.length-1,show:t.jsx(q,{text:"AND"})})]},n.id))}):null,Zs=b("div")(({theme:e})=>({padding:e.spacing(0)})),Qs=({strategyResult:e,input:n,percentageFill:r})=>{const{name:s,constraints:o,segments:i,parameters:a}=e,c=!!(i&&i.length>0),u=!!(o&&(o==null?void 0:o.length)>0),g=s!=="default"&&Object.keys(ut).includes(s),l=Object.keys(a).length>0&&e.result.evaluationStatus==="incomplete";if(!a)return null;const m=[c&&t.jsx(Ys,{segments:i}),u&&t.jsx(At,{constraints:o}),g&&t.jsx(Bt,{parameters:a,constraints:o,input:n,disabled:!0}),l&&t.jsx(Ot,{strategyName:s,parameters:a}),s==="default"&&t.jsxs($e,{sx:h=>({width:"100%",color:h.palette.text.secondary}),children:["The standard strategy is ",t.jsx(J,{color:"disabled",children:"ON"})," ","for all users."]})].filter(Boolean);return t.jsx(Zs,{children:m.map((h,p)=>t.jsxs(x.Fragment,{children:[t.jsx(v,{condition:p>0&&(e.name==="flexibleRollout"?p<m.length:p<m.length-1),show:t.jsx(q,{text:"AND"})}),h]},p))})},Xs=({strategy:e,input:n,index:r})=>{const{result:s}=e,o=O(),i=s.evaluationStatus==="incomplete"||s.evaluationStatus==="unevaluated"?"Unevaluated":s.enabled?"True":"False";return t.jsx(ur,{style:{borderColor:s.enabled&&s.evaluationStatus==="complete"?o.palette.success.main:"none"},strategy:{...e,id:`${Te(e)}`},orderNumber:r+1,actions:t.jsx(Y,{showIcon:!1,enabled:s.enabled,label:i}),children:t.jsx(v,{condition:!!e.disabled,show:t.jsx(Qs,{strategyResult:e,input:n}),elseShow:t.jsx(Ks,{strategyResult:e,input:n,percentageFill:o.palette.background.elevation2})})})},eo=b("div")(({theme:e})=>({display:"flex",padding:"0, 4px",flexDirection:"column",borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.warning.border}`})),nt=b("div")(({theme:e})=>({padding:e.spacing(1,.5)})),to=b(te)(({theme:e})=>({border:"0!important",borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:`1px solid ${e.palette.warning.border}!important`})),rt=b(I)(({theme:e})=>({margin:e.spacing(2,1,2,0),color:"text.secondary"})),le=({strategies:e,input:n,titlePrefix:r,infoText:s})=>t.jsx(v,{condition:e.length>0,show:t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"subtitle1",children:`${r?r.concat(" strategies"):"Strategies"} (${e==null?void 0:e.length})`}),t.jsx(v,{condition:!!s,show:t.jsx(rt,{variant:"subtitle2",children:s})}),t.jsx(C,{sx:{width:"100%"},children:e==null?void 0:e.map((o,i)=>t.jsxs(x.Fragment,{children:[t.jsx(v,{condition:i>0,show:t.jsx(q,{text:"OR"})}),t.jsx(Xs,{strategy:o,index:i,input:n},o.id)]},o.id))})]})}),no=e=>e.hasUnsatisfiedDependency&&!e.isEnabledInCurrentEnvironment?"If environment was enabled and parent dependencies were satisfied":e.hasUnsatisfiedDependency?"If parent dependencies were satisfied":e.isEnabledInCurrentEnvironment?"":"If environment was enabled",ro=({feature:e,input:n})=>{var i,a,c,u,g;const r=(a=(i=e.strategies)==null?void 0:i.data)==null?void 0:a.filter(l=>!l.disabled),s=(u=(c=e.strategies)==null?void 0:c.data)==null?void 0:u.filter(l=>l.disabled),o=(s==null?void 0:s.length)>0;return t.jsxs(eo,{sx:{pb:1,mt:2},children:[t.jsxs(to,{severity:"info",color:"warning",children:[no(e),", then this feature flag would be"," ",(g=e.strategies)!=null&&g.result?"TRUE":"FALSE"," with strategies evaluated like so:"," "]}),t.jsx(nt,{sx:{p:2.5},children:t.jsx(le,{strategies:r||[],input:n,titlePrefix:o?"Enabled":""})}),t.jsx(v,{condition:o,show:t.jsx(nt,{sx:{p:2.5},children:t.jsx(le,{strategies:s,input:n,titlePrefix:"Disabled",infoText:"Disabled strategies are not evaluated for the overall result."})})})]})},so=({feature:e,input:n})=>{var i,a,c,u,g,l,m;const r=(a=(i=e.strategies)==null?void 0:i.data)==null?void 0:a.filter(h=>!h.disabled),s=(u=(c=e.strategies)==null?void 0:c.data)==null?void 0:u.filter(h=>h.disabled),o=(s==null?void 0:s.length)>0;return t.jsxs(t.Fragment,{children:[t.jsx(v,{condition:((l=(g=e==null?void 0:e.strategies)==null?void 0:g.data)==null?void 0:l.length)===0,show:t.jsx(te,{severity:"warning",sx:{mt:2},children:"There are no strategies added to this feature flag in selected environment."})}),t.jsx(v,{condition:(e.hasUnsatisfiedDependency||!e.isEnabledInCurrentEnvironment)&&!!((m=e==null?void 0:e.strategies)!=null&&m.data),show:t.jsx(ro,{feature:e,input:n}),elseShow:t.jsxs(t.Fragment,{children:[t.jsx(le,{strategies:r||[],input:n,titlePrefix:o?"Enabled":""}),t.jsx(v,{condition:o,show:t.jsx(le,{strategies:s,input:n,titlePrefix:"Disabled",infoText:"Disabled strategies are not evaluated for the overall result."})})]})})]})},oo=b("div")(({theme:e})=>({alignItems:"flex-end",color:e.palette.divider})),Dt=({feature:e,input:n})=>{const[r,s]=x.useState(!1),o=x.useRef(null),i=()=>{s(!r)};return e?t.jsxs(oo,{children:[t.jsx(_,{onClick:i,children:t.jsx(Re,{ref:o})}),t.jsxs(he,{open:r,onClose:()=>s(!1),anchorEl:o.current,PaperProps:{sx:a=>({display:"flex",flexDirection:"column",padding:a.spacing(6),width:728,maxWidth:"100%",height:"auto",overflowY:"auto",backgroundColor:a.palette.background.elevation2,borderRadius:a.shape.borderRadius})},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:[t.jsx(Ts,{feature:e,input:n,onClose:()=>s(!1)}),t.jsx(so,{feature:e,input:n})]})]}):null};var Le={},ao=ue;Object.defineProperty(Le,"__esModule",{value:!0});var Nt=Le.default=void 0,io=ao(de()),lo=t,co=(0,io.default)((0,lo.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined");Nt=Le.default=co;const uo=b("div")(({theme:e})=>({padding:e.spacing(4),maxWidth:"400px"})),Se=b(I)(({theme:e})=>({marginBottom:e.spacing(2)})),ho=b(Nt)(({theme:e})=>({color:e.palette.success.main})),go=({variants:e,selectedVariant:n})=>{const r=O(),s=x.useMemo(()=>e.map(l=>({name:l.name,weight:`${jn(l.weight)}%`,selected:l.name===n})),[e,n]),o=x.useMemo(()=>({sortBy:[{id:"name",desc:!1}]}),[]),{getTableProps:i,getTableBodyProps:a,headerGroups:c,rows:u,prepareRow:g}=A.useTable({initialState:o,columns:xo,data:s,sortTypes:ge,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},A.useGlobalFilter,A.useSortBy);return t.jsxs(uo,{children:[t.jsx(Se,{variant:"subtitle2",children:"Variant Information"}),t.jsx(Se,{variant:"body2",children:"The following table shows the variants defined on this feature toggle and the variant result based on your context configuration."}),t.jsx(Se,{variant:"body2",children:'If you include "userId" or "sessionId" in your context, the variant will be the same every time because unleash uses these properties to ensure that the user receives the same experience.'}),t.jsxs(yn,{...i(),rowHeight:"dense",children:[t.jsx(vn,{headerGroups:c}),t.jsx(Sn,{...a(),children:u.map(l=>{const m={};return l.original.selected||(m.color=r.palette.text.secondary),g(l),t.jsx(Cn,{hover:!0,...l.getRowProps(),children:l.cells.map(h=>t.jsx(wn,{...h.getCellProps(),style:m,children:h.render("Cell")}))})})})]})]})},xo=[{id:"Icon",Cell:({row:{original:{selected:e}}})=>t.jsx(t.Fragment,{children:t.jsx(v,{condition:e,show:t.jsx(kn,{icon:t.jsx(ho,{})})})}),maxWidth:25,disableGlobalFilter:!0},{Header:"Name",accessor:"name",searchable:!0,Cell:({row:{original:{name:e}}})=>t.jsx(_e,{children:e}),maxWidth:175,width:175},{Header:"Weight",accessor:"weight",sortType:"alphanumeric",searchable:!0,maxWidth:75,Cell:({row:{original:{weight:e}}})=>t.jsx(_e,{children:e})}],mo=b("div")(()=>({maxWidth:"100%",display:"flex",alignItems:"center",wordBreak:"break-all"})),fo=({variant:e,variants:n,feature:r,isEnabled:s})=>{const o=O(),[i,a]=x.useState(null),c=l=>a(l.currentTarget),u=()=>a(null),g=!!i;return t.jsxs(mo,{children:[e,t.jsx(v,{condition:!!n&&n.length>0&&s,show:t.jsxs(t.Fragment,{children:[t.jsx(_,{onClick:c,children:t.jsx(Re,{})}),t.jsx(he,{open:g,id:`${r}-result-variants`,PaperProps:{sx:{borderRadius:`${o.shape.borderRadiusLarge}px`}},onClose:u,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:-320},children:t.jsx(go,{variants:n,selectedVariant:e})})]})})]})},po=({features:e})=>{const n=O(),r=ht(n.breakpoints.down("sm")),s=Object.keys(e[0].context).map(l=>({Header:Pe(l),accessor:m=>m.context[l],minWidth:160,Cell:Ie})),o=x.useMemo(()=>[...s,{Header:"Variant",id:"variant",accessor:"variant.name",sortType:"alphanumeric",filterName:"variant",maxWidth:200,Cell:({value:l,row:{original:{variant:m,feature:h,variants:p,isEnabled:P}}})=>t.jsx(fo,{variant:m!=null&&m.enabled?l:"",variants:p,feature:h,isEnabled:P})},{id:"isEnabled",Header:"isEnabled",filterName:"isEnabled",accessor:l=>{var m;return l!=null&&l.isEnabled?"true":((m=l==null?void 0:l.strategies)==null?void 0:m.result)==="unknown"?"unknown":"false"},Cell:({row:l})=>t.jsx(Pt,{feature:l.original}),sortType:"playgroundResultState",maxWidth:120,sortInverted:!0},{Header:"",maxWidth:70,id:"info",Cell:({row:l})=>t.jsx(Dt,{feature:l.original,input:{environment:l.original.environment,context:l.original.context}})}],[]),{headerGroups:i,rows:a,prepareRow:c,setHiddenColumns:u}=A.useTable({columns:o,data:e,sortTypes:ge,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},A.useGlobalFilter,A.useFlexLayout,A.useSortBy);gt([{condition:r,columns:["variant"]}],u,o);const g=x.useRef(null);return t.jsx(C,{ref:g,sx:{overflow:"auto",maxHeight:"800px"},children:t.jsx(Fe,{parentRef:g,rows:a,headerGroups:i,prepareRow:c})})},bo=b("div",{})(({theme:e})=>({flexGrow:0,...xt,justifyContent:"flex-start",margin:e.spacing(0,1.5)})),jo=b(C)(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(1)})),yo=({value:e})=>{const n=O(),[r,s]=x.useState(null),o=g=>s(g.currentTarget),i=()=>s(null),a=!!r,c=(e||[]).filter(g=>g.isEnabled),u=(e||[]).filter(g=>!g.isEnabled);return t.jsxs(bo,{children:[t.jsxs(jo,{children:[t.jsx(v,{condition:c.length>0,show:t.jsx(Y,{enabled:!0,label:`${c.length}`,showIcon:!0})}),t.jsx(v,{condition:u.length>0,show:t.jsx(Y,{enabled:!1,label:`${u.length}`,showIcon:!0})})]}),t.jsxs(t.Fragment,{children:[t.jsx(_,{onClick:o,children:t.jsx(Re,{})}),t.jsxs(he,{open:a,id:`${e}-result-details`,PaperProps:{sx:{borderRadius:`${n.shape.borderRadiusLarge}px`,padding:n.spacing(3)}},onClose:i,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:[t.jsx(I,{variant:"subtitle2",sx:{mb:3},children:e[0].environment}),t.jsx(po,{features:e})]})]})]})},vo=({features:e})=>{const n=Object.keys(e),r=e[n[0]],s=r[0].context,o=x.useMemo(()=>r.map((h,p)=>({...Object.fromEntries(n.map(P=>[P,e[P][p]]))})),[JSON.stringify(e)]),i=Object.keys(s).map(h=>({Header:Pe(h),accessor:p=>p[n[0]].context[h],minWidth:160,Cell:Ie})),a=n.map(h=>({Header:h,accessor:p=>{var P,R,E;return(P=p[h])!=null&&P.isEnabled?"true":((E=(R=p[h])==null?void 0:R.strategies)==null?void 0:E.result)==="unknown"?"unknown":"false"},Cell:({row:p})=>t.jsxs(C,{sx:{display:"flex"},children:[t.jsx(Pt,{feature:p.original[h]}),t.jsx(Dt,{feature:p.original[h],input:{environment:p.original[h].environment,context:p.original[h].context}})]}),sortType:"playgroundResultState",maxWidth:140})),c=x.useMemo(()=>[...i,...a],[]),{headerGroups:u,rows:g,prepareRow:l}=A.useTable({columns:c,data:o,sortTypes:ge,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},A.useGlobalFilter,A.useFlexLayout,A.useSortBy),m=x.useRef(null);return t.jsx(C,{ref:m,sx:{overflow:"auto",maxHeight:"800px"},children:t.jsx(Fe,{parentRef:m,rows:g,headerGroups:u,prepareRow:l})})},So=b("div",{})(({theme:e})=>({flexGrow:0,...xt,justifyContent:"flex-start",margin:e.spacing(0,1.5)})),Co=b(ce)(({theme:e})=>({textAlign:"left",textDecorationStyle:"dotted",textDecorationLine:"underline",textUnderlineOffset:e.spacing(.75),color:e.palette.neutral.dark,padding:0,fontWeight:"normal"})),wo=({value:e})=>{const n=O(),[r,s]=x.useState(null),o=c=>s(c.currentTarget),i=()=>s(null),a=!!r;return t.jsx(So,{children:t.jsxs(t.Fragment,{children:[t.jsx(Co,{variant:"text",onClick:o,children:"View diff"}),t.jsxs(he,{open:a,id:`${e}-result-details`,PaperProps:{sx:{borderRadius:`${n.shape.borderRadiusLarge}px`,padding:n.spacing(3)}},onClose:i,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:[t.jsx(I,{variant:"subtitle2",sx:{mb:3},children:"Environments diff"}),t.jsx(vo,{features:e})]})]})})},ko=e=>e.reduce((n,r)=>n+Object.values(r.environments).flatMap(s=>Object.keys(s)).length,0),Eo={id:"name"},{value:st,setValue:To}=mt("AdvancedPlaygroundResultsTable:v1",Eo),Ro=({features:e,input:n,loading:r})=>{const{trackEvent:s}=ft();e&&s("playground",{props:{eventType:"number-of-combinations",count:ko(e)}});const[o,i]=pt(),a=En(r),[c,u]=x.useState(o.get("search")||""),g=O(),l=ht(g.breakpoints.down("md")),m=e&&e.length>0?Object.keys(e[0].environments).length:0,h=x.useMemo(()=>{var T;return[{Header:"Name",accessor:"name",searchable:!0,minWidth:160,Cell:({value:S,row:{original:y}})=>t.jsx(qe,{title:S,to:`/projects/${y==null?void 0:y.projectId}/features/${S}`})},{Header:"Project ID",accessor:"projectId",sortType:"alphanumeric",filterName:"projectId",searchable:!0,minWidth:150,Cell:({value:S})=>t.jsx(qe,{title:S,to:`/projects/${S}`})},...((T=n==null?void 0:n.environments)==null?void 0:T.map(S=>({Header:r?()=>"":Pe(S),maxWidth:140,id:`environments.${S}`,align:"flex-start",Cell:({row:y})=>t.jsx(yo,{value:y.original.environments[S]})})))||[],...m>1?[{Header:"Diff",minWidth:150,id:"diff",align:"left",Cell:({row:S})=>t.jsx(wo,{value:S.original.environments})}]:[]]},[n]),{data:p,getSearchText:P,getSearchContext:R}=Tn(h,c,e||[]),E=x.useMemo(()=>r?Array(5).fill({name:"Feature name",projectId:"Feature Project",environments:{name:"Feature Environments",variants:[]},enabled:!0}):p,[p,r]),[N]=x.useState(()=>({sortBy:[{id:o.get("sort")||st.id,desc:o.has("order")?o.get("order")==="desc":st.desc}]})),{headerGroups:F,rows:D,state:{sortBy:j},prepareRow:f,setHiddenColumns:k}=A.useTable({initialState:N,columns:h,data:E,sortTypes:ge,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:Ie}},A.useGlobalFilter,A.useFlexLayout,A.useSortBy);return gt([{condition:l,columns:["projectId"]}],k,h),x.useEffect(()=>{if(r)return;const T=Object.fromEntries(o);T.sort=j[0].id,j[0].desc?T.order="desc":T.order&&delete T.order,c?T.search=c:delete T.search,i(T,{replace:!0}),To({id:j[0].id,desc:j[0].desc||!1})},[r,j,c]),t.jsxs(t.Fragment,{children:[t.jsxs(C,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[t.jsx(I,{variant:"subtitle1",sx:{ml:1},children:e!==void 0&&!r?`Results (${D.length<E.length?`${D.length} of ${E.length}`:E.length})`:"Results"}),t.jsx(Rn,{initialValue:c,onChange:u,hasFilters:!0,getSearchContext:R,disabled:r,containerStyles:{marginLeft:"1rem",maxWidth:"400px"}})]}),t.jsx(v,{condition:!r&&!E,show:()=>t.jsx(pe,{children:E===void 0?"None of the feature flags were evaluated yet.":"No results found."}),elseShow:()=>t.jsxs(C,{ref:a,sx:{overflow:"auto"},children:[t.jsx(Pn,{value:P(c),children:t.jsx(Fe,{rows:D,headerGroups:F,prepareRow:f})}),t.jsx(v,{condition:E.length===0&&(c==null?void 0:c.length)>0,show:t.jsxs(pe,{children:["No feature flags found matching “",c,"”"]})}),t.jsx(v,{condition:E&&E.length===0&&!c,show:t.jsx(pe,{children:"No features flags to display"})})]})})]})},$t=b(te)(({theme:e})=>({marginBottom:e.spacing(3)})),Po=({response:e})=>{var r;const n=(r=e==null?void 0:e.warnings)==null?void 0:r.invalidContextProperties;if(n&&n.length>0){n.sort();const s="Some context properties were not taken into account during evaluation",o=b("details")(({theme:i})=>({"* + *":{marginBlockStart:i.spacing(1)}}));return t.jsx($t,{severity:"warning",children:t.jsxs(o,{children:[t.jsx("summary",{children:s}),t.jsx("p",{children:"The context you provided for this query contained top-level properties with invalid values. These properties were not taken into consideration when evaluating your query. The properties are:"}),t.jsx("ul",{children:n.map(i=>t.jsx("li",{"data-testid":"context-warning-list-element",children:t.jsx("code",{children:i})},i))}),t.jsxs("p",{children:["Remember that context fields (with the exception of the"," ",t.jsx("code",{children:"properties"})," object) must be strings."]}),t.jsx("p",{children:"Because we didn't take these properties into account during the feature flag evaluation, they will not appear in the results table."})]})})}else return null},Ao=({FormComponent:e=os})=>{const n={projects:[],environments:[]},{value:r,setValue:s}=mt("AdvancedPlayground:v1",n),{trackEvent:o}=ft(),{environments:i}=In(),a=O(),c=!0,[u,g]=x.useState(),[l,m]=x.useState(r.environments),[h,p]=x.useState(r.projects),[P,R]=x.useState(r.token),[E,N]=x.useState(r.context),[F,D]=x.useState(),{setToastData:j}=ot(),[f,k]=pt(),[T,S]=x.useState(),{evaluateAdvancedPlayground:y,evaluateChangeRequestPlayground:B,loading:L,errors:M}=hr(),[Z,Q]=x.useState(!1);x.useEffect(()=>{(l==null?void 0:l.length)===0&&i.length>0&&m([Vr(i)])},[JSON.stringify(l),JSON.stringify(i)]),x.useEffect(()=>{xe()},[]);const xe=async()=>{try{const w=G(),W=$(),re=V();K(),me(),w&&re&&await We(w||[],W||"*",re)}catch(w){j({type:"error",title:`Failed to parse URL parameters: ${ee(w)}`})}},G=()=>{let w=null;const W=f.get("environments");return W&&(w=W.split(","),m(w)),w},$=()=>{let w=null;const W=f.get("projects");return W&&(w=W.split(","),p(w)),w},V=()=>{let w=f.get("context");return w&&(w=decodeURI(w),N(w)),w},K=()=>{let w=f.get("token");return w&&(w=decodeURI(w),R(w)),w},me=()=>{const w=f.get("changeRequest");w&&S(w)},We=async(w,W,re,fe)=>{try{g(void 0);const H={appName:"playground",...JSON.parse(re||"{}")},_t=T?await B(T,{context:H}):await y({environments:Gr(w),projects:qr(W),context:H});fe&&typeof fe=="function"&&fe(),D(_t)}catch(H){H instanceof Fn?g(H.message):H instanceof SyntaxError?j({type:"error",title:`Error parsing context: ${ee(H)}`}):j({type:"error",title:ee(H)})}},Lt=()=>{let w="default";P&&P!==""?w="api_token":T&&(w="change_request"),o("playground",{props:{eventType:"try-configuration",mode:w}})},Wt=async w=>{w.preventDefault(),Q(!0),Lt(),await We(l,h,E,()=>{Ht(),T||s({environments:l,projects:h,context:E})})},Mt=()=>{S(void 0)},Ht=()=>{f.set("context",encodeURI(E||"")),Array.isArray(l)&&l.length>0&&!(l.length===1&&l[0]==="*")?f.set("environments",l.join(",")):f.delete("projects"),Array.isArray(h)&&h.length>0&&!(h.length===1&&h[0]==="*")?f.set("projects",h.join(",")):f.delete("projects"),T?f.set("changeRequest",T):f.delete("changeRequest"),k(f)},Ut=F&&!c?"35%":"auto",zt=Jr();return t.jsx(Bn,{header:t.jsx(On,{title:"Unleash playground",actions:t.jsx(hs,{})}),disableLoading:!0,bodyClass:"no-padding",children:t.jsxs(C,{sx:{display:"flex",flexDirection:"column"},children:[t.jsx(C,{sx:{background:a.palette.background.elevation2,borderBottomLeftRadius:a.shape.borderRadiusMedium,isolation:"isolate",zIndex:2},children:t.jsx(it,{elevation:0,sx:{px:4,py:3,background:a.palette.background.elevation2,transition:"width 0.4s ease",minWidth:"auto",width:Ut,position:"sticky",top:0},children:t.jsx(e,{onSubmit:Wt,context:E,setContext:N,availableEnvironments:i,projects:h,environments:l,token:P,setToken:R,setProjects:p,setEnvironments:m,changeRequest:T||void 0,onClearChangeRequest:Mt})})}),t.jsxs(C,{sx:w=>({width:zt,transition:"width 0.4s ease",padding:w.spacing(4,4),isolation:"isolate",zIndex:1}),children:[t.jsx(v,{condition:!!u,show:t.jsx($t,{severity:"warning",children:u})}),t.jsx(v,{condition:L,show:t.jsx(An,{}),elseShow:t.jsxs(t.Fragment,{children:[t.jsx(v,{condition:!!F&&Object.values(M).length===0,show:t.jsxs(t.Fragment,{children:[t.jsx(Po,{response:F}),t.jsx(Ro,{loading:L,features:F==null?void 0:F.features,input:F==null?void 0:F.input})]})}),t.jsx(v,{condition:!F&&!Z,show:t.jsx(Et,{})})]})})]})]})})};export{Ao as AdvancedPlayground,Ao as default};
@@ -1 +1 @@
1
- import{j as e,e1 as t}from"./index-Baz2OZE0.js";const a=()=>e.jsx(t,{to:"/projects?create=true",replace:!0});export{a as default};
1
+ import{j as e,e1 as t}from"./index-C4rZui9w.js";const a=()=>e.jsx(t,{to:"/projects?create=true",replace:!0});export{a as default};
@@ -1,2 +1,2 @@
1
- import{hZ as c,d2 as m,h_ as u,bg as x,b as g,bc as f,r as d,j as b,hQ as C,hR as h,hS as v,hT as M,hU as S,hV as q,hX as T,hW as $,h$ as D}from"./index-Baz2OZE0.js";import{L as E}from"./index-K5BsxPs3.js";import{d as L}from"./FeatureViewLazyExport-gFRVtFYz.js";import"./FeatureStaleDialog-qYvEV6kq.js";import"./StrategyItemContainer-Cx7MmcNg.js";const j=(e,l,s)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(l,s,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(l,s,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(l,s,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,l,s)=>e.map(a=>({x:a.timestamp,y:s(a),variants:a.variants||{}})),R=(e,l)=>{if(l===0)return"";const[s,a]=e,t=Math.floor(Number(a)/l*100);return`${a} (${t}%) - ${s}`},k=(e,l,s,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],n=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return n-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...n}=r.variants;return Object.entries(n).map(i=>R(i,r.y)).join(`
1
+ import{hZ as c,d2 as m,h_ as u,bg as x,b as g,bc as f,r as d,j as b,hQ as C,hR as h,hS as v,hT as M,hU as S,hV as q,hX as T,hW as $,h$ as D}from"./index-C4rZui9w.js";import{L as E}from"./index-BP5MBEg5.js";import{d as L}from"./FeatureViewLazyExport-8MyFhnri.js";import"./FeatureStaleDialog-DX1VXbFp.js";import"./StrategyItemContainer-KT-4tFSj.js";const j=(e,l,s)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(l,s,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(l,s,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(l,s,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,l,s)=>e.map(a=>({x:a.timestamp,y:s(a),variants:a.variants||{}})),R=(e,l)=>{if(l===0)return"";const[s,a]=e,t=Math.floor(Number(a)/l*100);return`${a} (${t}%) - ${s}`},k=(e,l,s,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],n=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return n-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...n}=r.variants;return Object.entries(n).map(i=>R(i,r.y)).join(`
2
2
  `)},title:t=>`Time: ${s>48?m(t[0].parsed.x,a.locale,"UTC"):u(t[0].parsed.x,a.locale)}`}},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:O(s),position:"top",align:"start",display:!0,font:{size:16,weight:"400"},color:e.palette.text.primary}},scales:{y:{type:"linear",title:{display:!0,text:"Number of requests",color:e.palette.text.secondary},suggestedMin:0,ticks:{precision:0,color:e.palette.text.secondary},grid:{color:e.palette.divider,borderColor:e.palette.divider}},x:{type:"time",time:{unit:s>48?"day":"hour"},grid:{display:!1},ticks:{callback:(t,r,o)=>s>48?x(o[r].value,a.locale,"UTC"):u(o[r].value,a.locale),color:e.palette.text.secondary}}}}),O=e=>e===1?"Requests in the last hour":`Requests in the last ${L(e)}`;c.font={...c.font,family:"Sen",size:13,weight:"400"};const w=({metrics:e,hoursBack:l,statsSectionId:s})=>{const a=g(),{locationSettings:t}=f(),r=d.useMemo(()=>[...e].sort((i,y)=>i.timestamp.localeCompare(y.timestamp)),[e]),o=d.useMemo(()=>k(a,r,l,t),[a,r,l,t]),n=d.useMemo(()=>j(a,r,t),[a,r,t]);return b.jsx("div",{style:{height:400},children:b.jsx(E,{options:o,data:n,"aria-label":"A feature metrics line chart, with three lines: all requests, positive requests, and negative requests.","aria-describedby":s})})};C.register(h,v,M,S,q,T,$,D);export{w as FeatureMetricsChart,w as default};