unleash-server 7.6.2 → 7.6.3

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 (35) hide show
  1. package/dist/lib/types/experimental.d.ts +1 -1
  2. package/dist/lib/types/experimental.d.ts.map +1 -1
  3. package/dist/lib/types/experimental.js +1 -0
  4. package/dist/lib/types/experimental.js.map +1 -1
  5. package/frontend/build/index.html +1 -1
  6. package/frontend/build/static/{AdvancedPlayground-BTPrG6RW.js → AdvancedPlayground-D7wyJyhf.js} +1 -1
  7. package/frontend/build/static/{BackendConnections-CRh8Vxoe.js → BackendConnections-B2fwWxNM.js} +1 -1
  8. package/frontend/build/static/{CreateProject-DEMalH1j.js → CreateProject-DCsDw61O.js} +1 -1
  9. package/frontend/build/static/{EnterpriseEdge-Cp-pGMa0.js → EnterpriseEdge-Bzf3ZWSM.js} +1 -1
  10. package/frontend/build/static/{FeatureMetricsChart-DQOE71LA.js → FeatureMetricsChart-CA7ccj4F.js} +1 -1
  11. package/frontend/build/static/{FeatureStaleDialog-B6BfnDiQ.js → FeatureStaleDialog-DFGtgX-I.js} +1 -1
  12. package/frontend/build/static/{FeatureViewLazyExport-BkNTNFqK.js → FeatureViewLazyExport-CVIpdGgg.js} +3 -3
  13. package/frontend/build/static/{FlagMetricsChart-zYDF9bet.js → FlagMetricsChart-Dcc3RwL2.js} +1 -1
  14. package/frontend/build/static/{FrontendNetworkTrafficUsage-CbxdFXH7.js → FrontendNetworkTrafficUsage-C6ZZ-igE.js} +1 -1
  15. package/frontend/build/static/{GridLayoutWrapper-Cq6Bzm36.js → GridLayoutWrapper-mu3C2OC4.js} +1 -1
  16. package/frontend/build/static/{ImpactMetricsPage-CFYXYXPb.js → ImpactMetricsPage-DQ3DugFo.js} +1 -1
  17. package/frontend/build/static/{LazyAdminExport-ByTh4iFa.js → LazyAdminExport-CEik6N0e.js} +3 -3
  18. package/frontend/build/static/{LazyProjectExport-K12Xy3w9.js → LazyProjectExport-C8B0wkkW.js} +2 -2
  19. package/frontend/build/static/{LifecycleChartComponent-DHvlFNd2.js → LifecycleChartComponent-DgMY7X0Z.js} +1 -1
  20. package/frontend/build/static/{LineChartComponent-BlhKm3cw.js → LineChartComponent-FVKRZKUW.js} +1 -1
  21. package/frontend/build/static/{MarkCompletedDialogue-apmlFjVY.js → MarkCompletedDialogue-BFMzJ-VW.js} +1 -1
  22. package/frontend/build/static/{NetworkOverview-BiLOuQ4c.js → NetworkOverview-D8wtNaRF.js} +1 -1
  23. package/frontend/build/static/{NetworkPrometheusAPIWarning-CYo3j2Tj.js → NetworkPrometheusAPIWarning-D5-OGJsP.js} +1 -1
  24. package/frontend/build/static/{NetworkTraffic-DONL5oIx.js → NetworkTraffic-3cnRG5P0.js} +1 -1
  25. package/frontend/build/static/{NetworkTrafficUsage-DjQiYq0S.js → NetworkTrafficUsage-CSiuPn9W.js} +1 -1
  26. package/frontend/build/static/{PercentageDonut-CA9hYg3v.js → PercentageDonut-C51wuJjA.js} +1 -1
  27. package/frontend/build/static/{ReactJSONEditor-9cJL1vJY.js → ReactJSONEditor-BFCTTSFc.js} +1 -1
  28. package/frontend/build/static/{RoleCell-ZzU5Oqy8.js → RoleCell-CIeC6DEg.js} +1 -1
  29. package/frontend/build/static/{Safeguard-DY1N4aPz.js → Safeguard-C9U0j0cL.js} +1 -1
  30. package/frontend/build/static/{aggregateFeatureMetrics-D6bHft_C.js → aggregateFeatureMetrics-B-7cFh4G.js} +1 -1
  31. package/frontend/build/static/{formatTickValue-BcLsqREh.js → formatTickValue-CaA_jBqg.js} +1 -1
  32. package/frontend/build/static/{index-CoLhlfXP.js → index-C0tV9tYB.js} +10 -10
  33. package/frontend/build/static/{networkTrafficUsageHighlightPlugin-CqEM-cK_.js → networkTrafficUsageHighlightPlugin-D5DxaVbe.js} +1 -1
  34. package/frontend/build/static/{useApiTokens-ClWvohC9.js → useApiTokens-DDEZMbRy.js} +1 -1
  35. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { type Variant } from 'unleash-client';
2
2
  import type { MetricFlagContext } from 'unleash-client/lib/impact-metrics/metric-types.js';
3
3
  import type { Context } from '../features/playground/feature-evaluator/index.js';
4
- export type IFlagKey = 'accessLogs' | 'anonymiseEventLog' | 'encryptEmails' | 'enableLicense' | 'responseTimeWithAppNameKillSwitch' | 'maintenanceMode' | 'messageBanner' | 'strictSchemaValidation' | 'personalAccessTokensKillSwitch' | 'migrationLock' | 'demo' | 'interactiveDemoKillSwitch' | 'advancedPlayground' | 'filterInvalidClientMetrics' | 'disableMetrics' | 'signals' | 'automatedActions' | 'celebrateUnleash' | 'feedbackPosting' | 'extendedUsageMetrics' | 'feedbackComments' | 'killScheduledChangeRequestCache' | 'estimateTrafficDataCost' | 'useMemoizedActiveTokens' | 'queryMissingTokens' | 'disableUpdateMaxRevisionId' | 'disablePublishUnannouncedEvents' | 'outdatedSdksBanner' | 'responseTimeMetricsFix' | 'disableShowContextFieldSelectionValues' | 'manyStrategiesPagination' | 'enableLegacyVariants' | 'extendedMetrics' | 'removeUnsafeInlineStyleSrc' | 'projectRoleAssignment' | 'webhookDomainLogging' | 'productivityReportEmail' | 'productivityReportUnsubscribers' | 'showUserDeviceCount' | 'memorizeStats' | 'streaming' | 'denyStreamingForNonEdge' | 'deltaApi' | 'deltaDiff' | 'uniqueSdkTracking' | 'consumptionModel' | 'consumptionModelUI' | 'customMetrics' | 'impactMetrics' | 'registerImpactMetrics' | 'etagByEnv' | 'fetchMode' | 'optimizeLifecycle' | 'milestoneProgression' | 'plausibleMetrics' | 'safeguards' | 'newInUnleash' | 'oidcPkceSupport' | 'gtmReleaseManagement' | 'remoteMcpServer' | 'regexConstraintOperator' | 'signupDialog' | 'enterpriseEdgeTokensList' | 'impactMetricsFlagPage' | 'filterFavorites' | 'userTokenWithClientApiLoggingKillSwitch' | 'onlyFeatureTokensWithFeatureAPIs' | 'pendingUserAccessRequests' | 'onboardingFlagSetup';
4
+ export type IFlagKey = 'accessLogs' | 'anonymiseEventLog' | 'encryptEmails' | 'enableLicense' | 'responseTimeWithAppNameKillSwitch' | 'maintenanceMode' | 'messageBanner' | 'strictSchemaValidation' | 'personalAccessTokensKillSwitch' | 'migrationLock' | 'demo' | 'interactiveDemoKillSwitch' | 'advancedPlayground' | 'filterInvalidClientMetrics' | 'disableMetrics' | 'signals' | 'automatedActions' | 'celebrateUnleash' | 'feedbackPosting' | 'extendedUsageMetrics' | 'feedbackComments' | 'killScheduledChangeRequestCache' | 'estimateTrafficDataCost' | 'useMemoizedActiveTokens' | 'queryMissingTokens' | 'disableUpdateMaxRevisionId' | 'disablePublishUnannouncedEvents' | 'outdatedSdksBanner' | 'responseTimeMetricsFix' | 'disableShowContextFieldSelectionValues' | 'manyStrategiesPagination' | 'enableLegacyVariants' | 'extendedMetrics' | 'removeUnsafeInlineStyleSrc' | 'projectRoleAssignment' | 'webhookDomainLogging' | 'productivityReportEmail' | 'productivityReportUnsubscribers' | 'showUserDeviceCount' | 'memorizeStats' | 'streaming' | 'denyStreamingForNonEdge' | 'deltaApi' | 'deltaDiff' | 'uniqueSdkTracking' | 'consumptionModel' | 'consumptionModelUI' | 'customMetrics' | 'impactMetrics' | 'registerImpactMetrics' | 'etagByEnv' | 'fetchMode' | 'optimizeLifecycle' | 'milestoneProgression' | 'plausibleMetrics' | 'safeguards' | 'newInUnleash' | 'oidcPkceSupport' | 'gtmReleaseManagement' | 'remoteMcpServer' | 'regexConstraintOperator' | 'signupDialog' | 'enterpriseEdgeTokensList' | 'impactMetricsFlagPage' | 'filterFavorites' | 'userTokenWithClientApiLoggingKillSwitch' | 'onlyFeatureTokensWithFeatureAPIs' | 'pendingUserAccessRequests' | 'onboardingFlagSetup' | 'multiMetricChart';
5
5
  export type IFlags = Partial<{
6
6
  [key in IFlagKey]: boolean | Variant;
7
7
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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AAC;IACR,WAAW,CACP,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;IACR,gBAAgB,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;CACX"}
1
+ {"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAM3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAEjF,MAAM,MAAM,QAAQ,GACd,YAAY,GACZ,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,mCAAmC,GACnC,iBAAiB,GACjB,eAAe,GACf,wBAAwB,GACxB,gCAAgC,GAChC,eAAe,GACf,MAAM,GACN,2BAA2B,GAC3B,oBAAoB,GACpB,4BAA4B,GAC5B,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,sBAAsB,GACtB,kBAAkB,GAClB,iCAAiC,GACjC,yBAAyB,GACzB,yBAAyB,GACzB,oBAAoB,GACpB,4BAA4B,GAC5B,iCAAiC,GACjC,oBAAoB,GACpB,wBAAwB,GACxB,wCAAwC,GACxC,0BAA0B,GAC1B,sBAAsB,GACtB,iBAAiB,GACjB,4BAA4B,GAC5B,uBAAuB,GACvB,sBAAsB,GACtB,yBAAyB,GACzB,iCAAiC,GACjC,qBAAqB,GACrB,eAAe,GACf,WAAW,GACX,yBAAyB,GACzB,UAAU,GACV,WAAW,GACX,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,eAAe,GACf,eAAe,GACf,uBAAuB,GACvB,WAAW,GACX,WAAW,GACX,mBAAmB,G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Aa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAE;IAC1C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAE;IACxC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAE;IAChE,gBAAgB,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,EACd,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;IACR,WAAW,CACP,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;IACR,gBAAgB,CACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,iBAAiB,GACvC,IAAI,CAAC;CACX"}
@@ -88,6 +88,7 @@ const flags = {
88
88
  onlyFeatureTokensWithFeatureAPIs: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_ONLY_FEATURE_TOKENS_WITH_FEATURE_APIS, false),
89
89
  pendingUserAccessRequests: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_PENDING_USER_ACCESS_REQUESTS, false),
90
90
  onboardingFlagSetup: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_ONBOARDING_FLAG_SETUP, false),
91
+ multiMetricChart: parseEnvVarBoolean(process.env.UNLEASH_EXPERIMENTAL_MULTI_METRIC_CHART, false),
91
92
  };
92
93
  export const defaultExperimentalOptions = {
93
94
  flags,
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EACH,kBAAkB,E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8C,EAC1D,KAAK,CACR;IACD,YAAY,EAAE,kBAAkB,CAC5B,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAC9C,KAAK,CACR;IACD,wBAAwB,EAAE,kBAAkB,CACxC,OAAO,CAAC,GAAG,CAAC,gDAAgD,EAC5D,KAAK,CACR;IACD,qBAAqB,EAAE,kBAAkB,CACrC,OAAO,CAAC,GAAG,CAAC,6CAA6C,EACzD,KAAK,CACR;IACD,eAAe,EAAE,kBAAkB,CAC/B,OAAO,CAAC,GAAG,CAAC,qCAAqC,EACjD,KAAK,CACR;IACD,uCAAuC,EAAE,kBAAkB,CACvD,OAAO,CAAC,GAAG;SACN,iEAAiE,EACtE,KAAK,CACR;IACD,gCAAgC,EAAE,kBAAkB,CAChD,OAAO,CAAC,GAAG,CAAC,0DAA0D,EACtE,KAAK,CACR;IACD,yBAAyB,EAAE,kBAAkB,CACzC,OAAO,CAAC,GAAG,CAAC,iDAAiD,EAC7D,KAAK,CACR;IACD,mBAAmB,EAAE,kBAAkB,CACnC,OAAO,CAAC,GAAG,CAAC,0CAA0C,EACtD,KAAK,CACR;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAyB;IAC5D,KAAK;IACL,gBAAgB,EAAE;QACd,SAAS,EAAE,GAAY,EAAE,CAAC,KAAK;QAC/B,UAAU,EAAE,GAAG,EAAE,CAAC,cAAc;QAChC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KAC/B;CACJ,CAAC"}
1
+ {"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../src/lib/types/experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EACH,kBAAkB,EAClB,iCAAiC,GACpC,MAAM,kBAAkB,CAAC;AA8E1B,MAAM,KAAK,GAAW;IAClB,iBAAiB,EAAE,KAAK;I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KAAK,CACR;IACD,wBAAwB,EAAE,kBAAkB,CACxC,OAAO,CAAC,GAAG,CAAC,gDAAgD,EAC5D,KAAK,CACR;IACD,qBAAqB,EAAE,kBAAkB,CACrC,OAAO,CAAC,GAAG,CAAC,6CAA6C,EACzD,KAAK,CACR;IACD,eAAe,EAAE,kBAAkB,CAC/B,OAAO,CAAC,GAAG,CAAC,qCAAqC,EACjD,KAAK,CACR;IACD,uCAAuC,EAAE,kBAAkB,CACvD,OAAO,CAAC,GAAG;SACN,iEAAiE,EACtE,KAAK,CACR;IACD,gCAAgC,EAAE,kBAAkB,CAChD,OAAO,CAAC,GAAG,CAAC,0DAA0D,EACtE,KAAK,CACR;IACD,yBAAyB,EAAE,kBAAkB,CACzC,OAAO,CAAC,GAAG,CAAC,iDAAiD,EAC7D,KAAK,CACR;IACD,mBAAmB,EAAE,kBAAkB,CACnC,OAAO,CAAC,GAAG,CAAC,0CAA0C,EACtD,KAAK,CACR;IACD,gBAAgB,EAAE,kBAAkB,CAChC,OAAO,CAAC,GAAG,CAAC,uCAAuC,EACnD,KAAK,CACR;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAyB;IAC5D,KAAK;IACL,gBAAgB,EAAE;QACd,SAAS,EAAE,GAAY,EAAE,CAAC,KAAK;QAC/B,UAAU,EAAE,GAAG,EAAE,CAAC,cAAc;QAChC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;KAC/B;CACJ,CAAC"}
@@ -21,7 +21,7 @@
21
21
  rel="stylesheet"
22
22
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"
23
23
  />
24
- <script type="module" crossorigin src="/static/index-CoLhlfXP.js"></script>
24
+ <script type="module" crossorigin src="/static/index-C0tV9tYB.js"></script>
25
25
  <link rel="stylesheet" crossorigin href="/static/style-BfdqROT6.css">
26
26
  </head>
27
27
  <body>
@@ -1,3 +1,3 @@
1
- import{u as Tt,g as It,r as m,_ as Pt,j as t,a as ve,U as Rt,b as N,B as w,C as F,s as E,d as Ot,c as Lt,e as Bt,f as Ve,h as ee,T as D,G as Ft,i as le,p as Ie,k as Pe,l as ae,A as qe,m as Nt,n as At,o as $t,q as Dt,t as Mt,v as Ht,w as Re,P as Wt,I as Oe,x as q,L as zt,y as Ut,z as _t,D as Gt,E as Ke,F as Je,H as Vt,J as ne,K as Ye,M as ce,N as Ze,O as qt,Q as te,R as be,S as Kt,V as Jt,W as Yt,X as Qe,Y as oe,Z as Zt,$ as Qt,a0 as Xt,a1 as en,a2 as tn,a3 as nn,a4 as rn,a5 as an,a6 as sn,a7 as on,a8 as ln,a9 as O,aa as de,ab as cn,ac as dn,ad as un,ae as hn,af as gn,ag as fn,ah as Le,ai as Xe,aj as je,ak as Ce,al as et,am as Se,an as tt,ao as nt,ap as rt,aq as mn,ar as Be,as as pn,at as xn,au as bn,av as he,aw as at,ax as yn,ay as vn,az as jn,aA as Cn,aB as Sn,aC as kn}from"./index-CoLhlfXP.js";import{c as wn,d as En,s as Tn,h as In,f as Pn,a as Rn,l as On,b as Ln,e as Bn,g as Fn,i as Nn,j as An,k as $n,m as Dn,E as ie,n as Mn,o as ke,p as Hn,q as Wn,r as zn,t as Un,u as _n,v as Gn,w as Vn,x as qn,y as st,z as Kn,A as V,H as ot,B as o,C as Jn,D as Yn,S as Zn,F as Qn,G as Xn}from"./index-B87DWXbl.js";import{u as er}from"./useApiTokens-ClWvohC9.js";const tr=()=>{const{makeRequest:e,createRequest:n,errors:r,loading:a}=Tt({propagateErrors:!0}),s="api/admin/playground";return{evaluateAdvancedPlayground:async i=>{const h=`${s}/advanced`,u=n(h,{method:"POST",body:JSON.stringify(i)});return(await e(u.caller,u.id)).json()},evaluateChangeRequestPlayground:async(i,h)=>{const u=`${s}/change-request/${i}`,c=n(u,{method:"POST",body:JSON.stringify(h)});return(await e(c.caller,c.id)).json()},errors:r,loading:a}};var we={exports:{}};function it(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:a}=typeof r=="boolean"?{immediate:r}:r;let s,l,d,i,h;function u(){const f=s,b=l;return s=void 0,l=void 0,h=e.apply(f,b),h}function c(){const f=Date.now()-i;f<n&&f>=0?d=setTimeout(c,n-f):(d=void 0,a||(h=u()))}const g=function(...f){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,l=f,i=Date.now();const b=a&&!d;return d||(d=setTimeout(c,n)),b&&(h=u()),h};return Object.defineProperty(g,"isPending",{get(){return d!==void 0}}),g.clear=()=>{d&&(clearTimeout(d),d=void 0)},g.flush=()=>{d&&g.trigger()},g.trigger=()=>{h=u(),g.clear()},g}we.exports.debounce=it;we.exports=it;var nr=we.exports;const rr=It(nr);var Fe=function(n){n===void 0&&(n={});var{crosshairCursor:r=!1}=n,a=[];n.closeBracketsKeymap!==!1&&(a=a.concat(wn)),n.defaultKeymap!==!1&&(a=a.concat(En)),n.searchKeymap!==!1&&(a=a.concat(Tn)),n.historyKeymap!==!1&&(a=a.concat(In)),n.foldKeymap!==!1&&(a=a.concat(Pn)),n.completionKeymap!==!1&&(a=a.concat(Rn)),n.lintKeymap!==!1&&(a=a.concat(On));var s=[];return n.lineNumbers!==!1&&s.push(Ln()),n.highlightActiveLineGutter!==!1&&s.push(Bn()),n.highlightSpecialChars!==!1&&s.push(Fn()),n.history!==!1&&s.push(Nn()),n.foldGutter!==!1&&s.push(An()),n.drawSelection!==!1&&s.push($n()),n.dropCursor!==!1&&s.push(Dn()),n.allowMultipleSelections!==!1&&s.push(ie.allowMultipleSelections.of(!0)),n.indentOnInput!==!1&&s.push(Mn()),n.syntaxHighlighting!==!1&&s.push(ke(Kn,{fallback:!0})),n.bracketMatching!==!1&&s.push(Hn()),n.closeBrackets!==!1&&s.push(Wn()),n.autocompletion!==!1&&s.push(zn()),n.rectangularSelection!==!1&&s.push(Un()),r!==!1&&s.push(_n()),n.highlightActiveLine!==!1&&s.push(Gn()),n.highlightSelectionMatches!==!1&&s.push(Vn()),n.tabSize&&typeof n.tabSize=="number"&&s.push(qn.of(" ".repeat(n.tabSize))),s.concat([st.of(a.flat())]).filter(Boolean)};const ar="#e5c07b",Ne="#e06c75",sr="#56b6c2",or="#ffffff",se="#abb2bf",ye="#7d8799",ir="#61afef",lr="#98c379",Ae="#d19a66",cr="#c678dd",dr="#21252b",$e="#2c313a",De="#282c34",ge="#353a42",ur="#3E4451",Me="#528bff",hr=V.theme({"&":{color:se,backgroundColor:De},".cm-content":{caretColor:Me},".cm-cursor, .cm-dropCursor":{borderLeftColor:Me},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ur},".cm-panels":{backgroundColor:dr,color:se},".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:De,color:ye,border:"none"},".cm-activeLineGutter":{backgroundColor:$e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ge},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ge,borderBottomColor:ge},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$e,color:se}}},{dark:!0}),gr=ot.define([{tag:o.keyword,color:cr},{tag:[o.name,o.deleted,o.character,o.propertyName,o.macroName],color:Ne},{tag:[o.function(o.variableName),o.labelName],color:ir},{tag:[o.color,o.constant(o.name),o.standard(o.name)],color:Ae},{tag:[o.definition(o.name),o.separator],color:se},{tag:[o.typeName,o.className,o.number,o.changed,o.annotation,o.modifier,o.self,o.namespace],color:ar},{tag:[o.operator,o.operatorKeyword,o.url,o.escape,o.regexp,o.link,o.special(o.string)],color:sr},{tag:[o.meta,o.comment],color:ye},{tag:o.strong,fontWeight:"bold"},{tag:o.emphasis,fontStyle:"italic"},{tag:o.strikethrough,textDecoration:"line-through"},{tag:o.link,color:ye,textDecoration:"underline"},{tag:o.heading,fontWeight:"bold",color:Ne},{tag:[o.atom,o.bool,o.special(o.variableName)],color:Ae},{tag:[o.processingInstruction,o.string,o.inserted],color:lr},{tag:o.invalid,color:or}]),fr=[hr,ke(gr)];var mr=V.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),pr=function(n){n===void 0&&(n={});var{indentWithTab:r=!0,editable:a=!0,readOnly:s=!1,theme:l="light",placeholder:d="",basicSetup:i=!0}=n,h=[];switch(r&&h.unshift(st.of([Jn])),i&&(typeof i=="boolean"?h.unshift(Fe()):h.unshift(Fe(i))),d&&h.unshift(Yn(d)),l){case"light":h.push(mr);break;case"dark":h.push(fr);break;case"none":break;default:h.push(l);break}return a===!1&&h.push(V.editable.of(!1)),s&&h.push(ie.readOnly.of(!0)),[...h]},xr=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)});class br{constructor(n,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(n)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var n=this.callbacks.slice();this.callbacks.length=0,n.forEach(r=>{try{r()}catch(a){console.error("TimeoutLatch callback error:",a)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class He{constructor(){this.interval=null,this.latches=new Set}add(n){this.latches.add(n),this.start()}remove(n){this.latches.delete(n),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(n=>{n.tick(),n.isDone&&this.remove(n)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var fe=null,yr=()=>typeof window>"u"?new He:(fe||(fe=new He),fe),We=Qn.define(),vr=200,jr=[];function Cr(e){var{value:n,selection:r,onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:d,extensions:i=jr,autoFocus:h,theme:u="light",height:c=null,minHeight:g=null,maxHeight:f=null,width:b=null,minWidth:T=null,maxWidth:I=null,placeholder:S="",editable:P=!0,readOnly:A=!1,indentWithTab:R=!0,basicSetup:p=!0,root:k,initialState:v}=e,[x,j]=m.useState(),[y,L]=m.useState(),[U,_]=m.useState(),B=m.useState(()=>({current:null}))[0],H=m.useState(()=>({current:null}))[0],Z=V.theme({"&":{height:c,minHeight:g,maxHeight:f,width:b,minWidth:T,maxWidth:I},"& .cm-scroller":{height:"100% !important"}}),Q=V.updateListener.of($=>{if($.docChanged&&typeof a=="function"&&!$.transactions.some(X=>X.annotation(We))){B.current?B.current.reset():(B.current=new br(()=>{if(H.current){var X=H.current;H.current=null,X()}B.current=null},vr),yr().add(B.current));var M=$.state.doc,W=M.toString();a(W,$)}s&&s(xr($))}),J=pr({theme:u,editable:P,readOnly:A,placeholder:S,indentWithTab:R,basicSetup:p}),K=[Q,Z,...J];return d&&typeof d=="function"&&K.push(V.updateListener.of(d)),K=K.concat(i),m.useLayoutEffect(()=>{if(x&&!U){var $={doc:n,selection:r,extensions:K},M=v?ie.fromJSON(v.json,$,v.fields):ie.create($);if(_(M),!y){var W=new V({state:M,parent:x,root:k});L(W),l&&l(W,M)}}return()=>{y&&(_(void 0),L(void 0))}},[x,U]),m.useEffect(()=>{e.container&&j(e.container)},[e.container]),m.useEffect(()=>()=>{y&&(y.destroy(),L(void 0)),B.current&&(B.current.cancel(),B.current=null)},[y]),m.useEffect(()=>{h&&y&&y.focus()},[h,y]),m.useEffect(()=>{y&&y.dispatch({effects:Zn.reconfigure.of(K)})},[u,i,c,g,f,b,T,I,S,P,A,R,p,a,d]),m.useEffect(()=>{if(n!==void 0){var $=y?y.state.doc.toString():"";if(y&&n!==$){var M=B.current&&!B.current.isDone,W=()=>{y&&n!==y.state.doc.toString()&&y.dispatch({changes:{from:0,to:y.state.doc.toString().length,insert:n||""},annotations:[We.of(!0)]})};M?H.current=W:W()}}},[n,y]),{state:U,setState:_,view:y,setView:L,container:x,setContainer:j}}var Sr=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],lt=m.forwardRef((e,n)=>{var{className:r,value:a="",selection:s,extensions:l=[],onChange:d,onStatistics:i,onCreateEditor:h,onUpdate:u,autoFocus:c,theme:g="light",height:f,minHeight:b,maxHeight:T,width:I,minWidth:S,maxWidth:P,basicSetup:A,placeholder:R,indentWithTab:p,editable:k,readOnly:v,root:x,initialState:j}=e,y=Pt(e,Sr),L=m.useRef(null),{state:U,view:_,container:B,setContainer:H}=Cr({root:x,value:a,autoFocus:c,theme:g,height:f,minHeight:b,maxHeight:T,width:I,minWidth:S,maxWidth:P,basicSetup:A,placeholder:R,indentWithTab:p,editable:k,readOnly:v,selection:s,onChange:d,onStatistics:i,onCreateEditor:h,onUpdate:u,extensions:l,initialState:j});m.useImperativeHandle(n,()=>({editor:L.current,state:U,view:_}),[L,B,U,_]);var Z=m.useCallback(J=>{L.current=J,H(J)},[H]);if(typeof a!="string")throw new Error("value must be typeof string but got "+typeof a);var Q=typeof g=="string"?"cm-theme-"+g:"cm-theme";return t.jsx("div",ve({ref:Z,className:""+Q+(r?" "+r:"")},y))});lt.displayName="CodeMirror";var ct=e=>{var{theme:n,settings:r={},styles:a=[]}=e,s={".cm-gutters":{}},l={};r.background&&(l.backgroundColor=r.background),r.backgroundImage&&(l.backgroundImage=r.backgroundImage),r.foreground&&(l.color=r.foreground),r.fontSize&&(l.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=l),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var d={};r.gutterActiveForeground&&(d.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},d.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=d,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var i=V.theme(s,{dark:n==="dark"}),h=ot.define(a),u=[i,ke(h)];return u},kr={background:"#faf8f5",foreground:"#b29762",caret:"#93abdc",selection:"#e3dcce",selectionMatch:"#e3dcce",gutterBackground:"#faf8f5",gutterForeground:"#cdc4b1",gutterBorder:"transparent",lineHighlight:"#ddceb154"},wr=[{tag:[o.comment,o.bracket],color:"#b6ad9a"},{tag:[o.atom,o.number,o.keyword,o.link,o.attributeName,o.quote],color:"#063289"},{tag:[o.emphasis,o.heading,o.tagName,o.propertyName,o.variableName],color:"#2d2006"},{tag:[o.typeName,o.url,o.string],color:"#896724"},{tag:[o.operator,o.string],color:"#1659df"},{tag:[o.propertyName],color:"#b29762"},{tag:[o.unit,o.punctuation],color:"#063289"}],Er=e=>{var{theme:n="light",settings:r={},styles:a=[]}={};return ct({theme:n,settings:ve({},kr,r),styles:[...wr,...a]})},Tr=Er(),Ir={background:"#2a2734",foreground:"#6c6783",caret:"#ffad5c",selection:"#91ff6c26",selectionMatch:"#91ff6c26",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},Pr=[{tag:[o.comment,o.bracket],color:"#6c6783"},{tag:[o.atom,o.number,o.keyword,o.link,o.attributeName,o.quote],color:"#ffcc99"},{tag:[o.emphasis,o.heading,o.tagName,o.propertyName,o.className,o.variableName],color:"#eeebff"},{tag:[o.typeName,o.url],color:"#7a63ee"},{tag:o.operator,color:"#ffad5c"},{tag:o.string,color:"#ffb870"},{tag:[o.propertyName],color:"#9a86fd"},{tag:[o.unit,o.punctuation],color:"#e09142"}],Rr=e=>{var{theme:n="dark",settings:r={},styles:a=[]}={};return ct({theme:n,settings:ve({},Ir,r),styles:[...Pr,...a]})},Or=Rr();const Lr=E("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}`})),dt=E("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})),Br=E("div")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.error.dark,marginRight:e.spacing(1)})),Fr=()=>{const e=N();return t.jsx(dt,{style:{backgroundColor:e.palette.success.main},children:t.jsx(Ot,{sx:n=>({width:n.spacing(2),height:n.spacing(2)})})})},Nr=()=>{const e=N();return t.jsx(dt,{style:{backgroundColor:e.palette.error.main},children:t.jsx(Lt,{})})},Ar=({context:e,setContext:n,error:r})=>{const{themeMode:a}=m.useContext(Rt),s=N(),l=m.useCallback(i=>{n(i)},[n]),d=`calc(6 * ${s.typography.body1.fontSize} * ${s.typography.body1.lineHeight}) + 8px`;return t.jsxs(w,{sx:{width:"100%"},children:[t.jsxs(Lr,{children:["JSON",t.jsx(F,{condition:!!r,show:t.jsxs(w,{sx:i=>({display:"flex",alignItems:"center"}),children:[t.jsx(Br,{children:r}),t.jsx(Nr,{})]}),elseShow:t.jsx(Fr,{})})]}),t.jsx(lt,{value:e,minHeight:d,theme:a==="dark"?Or:Tr,extensions:[Xn()],onChange:l,style:{border:`1px solid ${s.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 ut(e){return Array.isArray(e)?e:[e]}const $r=e=>!e||e.length===0||e.length===1&&e[0]==="*"?"*":ut(e),Dr=e=>ut(e),Mr=e=>{const n=Hr(e);return n.length>0?n[0]:""},Hr=e=>e.filter(({enabled:n})=>!!n).sort((n,r)=>n.sortOrder-r.sortOrder).map(({name:n})=>n),Wr=(e,n)=>"100%",zr=e=>typeof e=="string"?!0:Array.isArray(e)?e.every(n=>typeof n=="string"):!1,Ur=e=>{const n=new Set(["appName","environment","userId","sessionId","remoteAddress","currentTime","properties"]),r={...e};let a=!1;for(const s in e)n.has(s)||(r.properties||(r.properties={}),r.properties[s]=e[s],delete r[s],a=!0);return!a&&!e.properties&&delete r.properties,r},_r=e=>{const[n]=e.split("."),[r,a]=n.split(":");if(!r||!a)throw new Error("Invalid token format");if(a==="*")throw new Error("Admin tokens are not supported in the playground")},Gr=e=>{const[n]=e.split(".");return n.split(":")},Vr=e=>Bt({mode:"all"},e),qr=e=>{const n=s=>s.toSorted((l,d)=>l.sortOrder-d.sortOrder).map(l=>({key:l.name,label:l.name})),r=e.reduce(({project:s,global:l},d)=>(d.project?s.push(d):l.push(d),{project:s,global:l}),{project:[],global:[]}),a=[];return r.project.length&&a.push({groupHeader:"Project context fields",options:n(r.project)}),r.global.length&&a.push({groupHeader:"Global context fields",options:n(r.global)}),a},Kr=({context:e,setContext:n})=>{const r=N(),{setToastData:a}=Ve(),{context:s}=Vr(),l=qr(s),[d,i]=m.useState(),[h,u]=m.useState(!1),[c,g]=m.useState(""),[f,b]=m.useState(""),T=m.useMemo(()=>rr(p=>{var k;if(!p)return i(void 0);try{const v=JSON.parse(p);u(v[c]!==void 0||((k=v==null?void 0:v.properties)==null?void 0:k[c])!==void 0)}catch(v){return i(ee(v))}return i(void 0)},250),[i,c,u]);m.useEffect(()=>{T(e)},[T,e]);const I=()=>{try{const p=JSON.parse(e||"{}");n(JSON.stringify(Ur({...p,[c]:f}),null,2));const k=s.find(v=>v.name===c);if(k!=null&&k.legalValues&&k.legalValues.length>0||c==="currentTime")return b("")}catch(p){a({type:"error",text:`Error parsing context: ${ee(p)}`})}},S=(p,k)=>{if(zr(k)){if(Array.isArray(k)){const v=(k||[]).length>1?k.join(","):k[0];return b(v)}b(k)}},P=()=>{if(!f||f==="")return[];const p=s.find(v=>v.name===c),k=((p==null?void 0:p.legalValues)||[]).length>1;return f.includes(",")&&k?f.split(","):[f]},A=()=>{if(c==="currentTime"){const k=Ie(f),x=k?Pe(k.toISOString()):Pe(new Date().toISOString());return t.jsx(ae,{id:"date",label:"Date",size:"small",type:"datetime-local",value:x,sx:{width:200,maxWidth:"100%"},onChange:j=>{const y=Ie(j.target.value),L=y==null?void 0:y.toISOString();L&&b(L)},InputLabelProps:{shrink:!0},required:!0})}const p=s.find(k=>k.name===c);if(p!=null&&p.legalValues&&p.legalValues.length>0){const k=p.legalValues.map(({value:v})=>v);return t.jsx(qe,{disablePortal:!0,limitTags:3,id:"context-legal-values",multiple:!0,options:k,disableCloseOnSelect:!0,size:"small",value:P(),onChange:S,getOptionLabel:v=>v,renderOption:(v,x,{selected:j})=>t.jsxs("li",{...v,children:[t.jsx(Nt,{icon:t.jsx($t,{fontSize:"small"}),checkedIcon:t.jsx(At,{fontSize:"small"}),sx:y=>({marginRight:y.spacing(.5)}),checked:j}),x]}),sx:{width:370,maxWidth:"100%"},renderInput:v=>t.jsx(ae,{...v,label:"Value"})})}return t.jsx(ae,{label:"Value",id:"context-value",sx:{width:370,maxWidth:"100%"},placeholder:"value1,value2,value3",size:"small",value:f,onChange:k=>b(k.target.value||"")})},R=p=>{if(g(p||""),p==="currentTime")return b(new Date().toISOString());b("")};return t.jsxs(w,{children:[t.jsx(w,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(D,{variant:"body2",color:r.palette.text.primary,sx:{ml:1},children:"Unleash context"})}),t.jsxs(w,{sx:{display:"flex",gap:2,flexWrap:"wrap",mb:2},children:[t.jsx(Ft,{label:"Context field",labelId:"context-field-label",id:"context-field",value:c,onChange:R,variant:"outlined",size:"small",sx:{width:200,maxWidth:"100%"},options:l}),A(),t.jsx(le,{variant:"outlined",disabled:!c||!!d,onClick:I,sx:{width:"95px",maxHeight:"40px"},children:`${h?"Replace":"Add"} `})]}),t.jsx(Ar,{context:e,setContext:n,error:d})]})},Jr=({environments:e,setEnvironments:n,availableEnvironments:r,disabled:a})=>{const s=[...r.map(i=>({label:i,id:i}))],l=s.filter(({id:i})=>e.includes(i)),d=(i,h,u)=>{const c=h;return u==="clear"||c===null?n([]):Array.isArray(c)?c.length===0?n([]):n(c.map(({id:g})=>g)):n([c.id])};return t.jsx(qe,{disablePortal:!0,limitTags:3,id:"environment",multiple:!0,options:s,sx:{flex:1},renderInput:i=>t.jsx(ae,{...i,label:"Environments"}),renderOption:Dt,renderTags:(i,h)=>i.map((u,c)=>{const{key:g,...f}=h({index:c});return t.jsx(Mt,{size:"small",...f,label:u.label},g)}),getOptionLabel:({label:i})=>i,disableCloseOnSelect:!1,size:"small",value:l,onChange:d,disabled:a,"data-testid":"PLAYGROUND_ENVIRONMENT_SELECT"})},me={label:"ALL",id:"*"},ze=E(_t)({fontSize:"1.25rem"}),ht=E(Ut)(()=>({width:"100%"})),Yr=E(w)(({theme:e})=>({display:"grid",columnGap:e.spacing(2),rowGap:e.spacing(2),gridTemplateColumns:"1fr",[e.breakpoints.up("md")]:{gridTemplateColumns:"1fr 1fr"}})),Zr=E(ht)(({theme:e})=>({"& label":{WebkitTextFillColor:e.palette.text.secondary},"& input.Mui-disabled":{WebkitTextFillColor:e.palette.text.secondary}})),Qr=({environments:e,projects:n,token:r,setProjects:a,setEnvironments:s,setToken:l,availableEnvironments:d,changeRequest:i,onClearChangeRequest:h})=>{const u=N(),{tokens:c}=er(),[g,f]=m.useState(),{projects:b}=Ht(),T=[me,...b.map(({name:x,id:j})=>({label:x,id:j}))],I=async x=>{const j=x.target.value;if(l==null||l(j),j===""){k();return}try{_r(j),f(void 0),S(j)}catch(y){f(y.message)}},S=x=>{const[j,y]=Gr(x);switch(s([y]),j){case"[]":A(x);break;case"*":R();break;default:p(j)}},P=x=>{!x.projects||x.projects==="*"?a([me.id]):typeof x.projects=="string"?a([x.projects]):Array.isArray(x.projects)&&a(x.projects)},A=x=>{const j=c.find(({secret:y})=>y===x);j?P(j):f("Invalid token. Ensure you use a valid token from this Unleash instance.")},R=()=>{a([me.id])},p=x=>{T.map(j=>j.id).includes(x)?a([x]):f(`Invalid token. Project ${x} does not exist.`)},k=()=>{f(void 0)},v=()=>{l==null||l(""),k()};return t.jsxs(w,{sx:{pb:2},children:[t.jsx(w,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(D,{variant:"body2",color:u.palette.text.primary,sx:{ml:1},children:"Access configuration"})}),t.jsxs(Yr,{children:[t.jsx(w,{children:t.jsx(Re,{arrow:!0,title:r?"Environment is automatically selected because you are using a token":"Select environments to use in the playground",children:t.jsx(w,{children:t.jsx(Jr,{environments:e,setEnvironments:s,availableEnvironments:d,disabled:!!(r||i)})})})}),t.jsx(w,{children:t.jsx(Re,{arrow:!0,title:r?"Project is automatically selected because you are using a token":"Select projects to use in the playground",children:t.jsx(Wt,{selectedProjects:n,onChange:a,dataTestId:"PLAYGROUND_PROJECT_SELECT",disabled:!!(r||i),limitTags:3})})}),t.jsx(w,{children:t.jsx(ht,{label:"API token",value:r||(i?" ":""),onChange:I,type:"text",error:!!g,errorText:g,placeholder:"Enter your API token","data-testid":"PLAYGROUND_TOKEN_INPUT",InputProps:{endAdornment:r?t.jsx(Oe,{position:"end","data-testid":"TOKEN_INPUT_CLEAR_BTN",children:t.jsx(q,{"aria-label":"clear API token",onClick:v,edge:"end",children:t.jsx(ze,{})})}):null},disabled:!!i})}),t.jsx(F,{condition:!!i,show:t.jsxs(w,{sx:{display:"flex",gap:2},children:[t.jsx(w,{sx:{flex:1},children:t.jsx(Zr,{label:"Change request",value:i?`Change request #${i}`:"",onChange:()=>{},type:"text",disabled:!0,InputProps:{endAdornment:t.jsx(Oe,{position:"end",children:t.jsx(q,{"aria-label":"clear Change request results",onClick:h,edge:"end",children:t.jsx(ze,{})})})}})}),t.jsx(le,{variant:"outlined",size:"small",to:`/projects/${n[0]}/change-requests/${i}`,component:zt,children:"View change request"})]})})]})]})},Xr=({availableEnvironments:e,environments:n,onSubmit:r,projects:a,token:s,setToken:l,setProjects:d,setEnvironments:i,context:h,setContext:u,changeRequest:c,onClearChangeRequest:g})=>t.jsxs(w,{component:"form",onSubmit:r,sx:{display:"flex",flexDirection:"column"},children:[t.jsx(Qr,{environments:Array.isArray(n)?n:[n],projects:a,token:s,setToken:l,setEnvironments:i,setProjects:d,availableEnvironments:e.map(({name:f})=>f),changeRequest:c,onClearChangeRequest:g}),t.jsx(Kr,{context:h,setContext:u}),t.jsx(w,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:t.jsx(le,{variant:"contained",size:"large",type:"submit",sx:{marginLeft:"auto"},children:"Try configuration"})})]}),ea=E("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})),ta=({style:e,children:n,type:r})=>{const a=N(),s={backgroundColor:a.palette.background.alternative,color:a.palette.common.white};return r==="secondary"&&(s.backgroundColor=a.palette.background.paper,s.color=a.palette.text.secondary),t.jsx(ea,{style:{...s,...e},children:n})},pe=({headerText:e,bodyText:n,sectionNumber:r})=>t.jsx(w,{sx:{display:"flex",alignItems:"flex-start",mt:2,flexDirection:"column"},children:t.jsxs(w,{sx:{display:"flex"},children:[t.jsx(w,{children:t.jsx(ta,{children:r})}),t.jsxs(w,{sx:{ml:2,display:"flex",flexDirection:"column"},children:[t.jsx(D,{variant:"body1",sx:{fontWeight:"bold"},children:e}),t.jsx(F,{condition:!!n,show:t.jsx(D,{variant:"body1",sx:{mt:1},children:n})})]})]})}),gt=()=>t.jsxs(w,{sx:{ml:4},children:[t.jsx(D,{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(Gt,{sx:{mt:2,mb:2}}),t.jsx(D,{variant:"body1",sx:{mb:1},children:"What you need to do is:"}),t.jsx(pe,{headerText:`Select in which environment you want to test your
1
+ import{u as Tt,g as It,r as m,_ as Pt,j as t,a as ve,U as Rt,b as N,B as w,C as F,s as E,d as Ot,c as Lt,e as Bt,f as Ve,h as ee,T as D,G as Ft,i as le,p as Ie,k as Pe,l as ae,A as qe,m as Nt,n as At,o as $t,q as Dt,t as Mt,v as Ht,w as Re,P as Wt,I as Oe,x as q,L as zt,y as Ut,z as _t,D as Gt,E as Ke,F as Je,H as Vt,J as ne,K as Ye,M as ce,N as Ze,O as qt,Q as te,R as be,S as Kt,V as Jt,W as Yt,X as Qe,Y as oe,Z as Zt,$ as Qt,a0 as Xt,a1 as en,a2 as tn,a3 as nn,a4 as rn,a5 as an,a6 as sn,a7 as on,a8 as ln,a9 as O,aa as de,ab as cn,ac as dn,ad as un,ae as hn,af as gn,ag as fn,ah as Le,ai as Xe,aj as je,ak as Ce,al as et,am as Se,an as tt,ao as nt,ap as rt,aq as mn,ar as Be,as as pn,at as xn,au as bn,av as he,aw as at,ax as yn,ay as vn,az as jn,aA as Cn,aB as Sn,aC as kn}from"./index-C0tV9tYB.js";import{c as wn,d as En,s as Tn,h as In,f as Pn,a as Rn,l as On,b as Ln,e as Bn,g as Fn,i as Nn,j as An,k as $n,m as Dn,E as ie,n as Mn,o as ke,p as Hn,q as Wn,r as zn,t as Un,u as _n,v as Gn,w as Vn,x as qn,y as st,z as Kn,A as V,H as ot,B as o,C as Jn,D as Yn,S as Zn,F as Qn,G as Xn}from"./index-B87DWXbl.js";import{u as er}from"./useApiTokens-DDEZMbRy.js";const tr=()=>{const{makeRequest:e,createRequest:n,errors:r,loading:a}=Tt({propagateErrors:!0}),s="api/admin/playground";return{evaluateAdvancedPlayground:async i=>{const h=`${s}/advanced`,u=n(h,{method:"POST",body:JSON.stringify(i)});return(await e(u.caller,u.id)).json()},evaluateChangeRequestPlayground:async(i,h)=>{const u=`${s}/change-request/${i}`,c=n(u,{method:"POST",body:JSON.stringify(h)});return(await e(c.caller,c.id)).json()},errors:r,loading:a}};var we={exports:{}};function it(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:a}=typeof r=="boolean"?{immediate:r}:r;let s,l,d,i,h;function u(){const f=s,b=l;return s=void 0,l=void 0,h=e.apply(f,b),h}function c(){const f=Date.now()-i;f<n&&f>=0?d=setTimeout(c,n-f):(d=void 0,a||(h=u()))}const g=function(...f){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,l=f,i=Date.now();const b=a&&!d;return d||(d=setTimeout(c,n)),b&&(h=u()),h};return Object.defineProperty(g,"isPending",{get(){return d!==void 0}}),g.clear=()=>{d&&(clearTimeout(d),d=void 0)},g.flush=()=>{d&&g.trigger()},g.trigger=()=>{h=u(),g.clear()},g}we.exports.debounce=it;we.exports=it;var nr=we.exports;const rr=It(nr);var Fe=function(n){n===void 0&&(n={});var{crosshairCursor:r=!1}=n,a=[];n.closeBracketsKeymap!==!1&&(a=a.concat(wn)),n.defaultKeymap!==!1&&(a=a.concat(En)),n.searchKeymap!==!1&&(a=a.concat(Tn)),n.historyKeymap!==!1&&(a=a.concat(In)),n.foldKeymap!==!1&&(a=a.concat(Pn)),n.completionKeymap!==!1&&(a=a.concat(Rn)),n.lintKeymap!==!1&&(a=a.concat(On));var s=[];return n.lineNumbers!==!1&&s.push(Ln()),n.highlightActiveLineGutter!==!1&&s.push(Bn()),n.highlightSpecialChars!==!1&&s.push(Fn()),n.history!==!1&&s.push(Nn()),n.foldGutter!==!1&&s.push(An()),n.drawSelection!==!1&&s.push($n()),n.dropCursor!==!1&&s.push(Dn()),n.allowMultipleSelections!==!1&&s.push(ie.allowMultipleSelections.of(!0)),n.indentOnInput!==!1&&s.push(Mn()),n.syntaxHighlighting!==!1&&s.push(ke(Kn,{fallback:!0})),n.bracketMatching!==!1&&s.push(Hn()),n.closeBrackets!==!1&&s.push(Wn()),n.autocompletion!==!1&&s.push(zn()),n.rectangularSelection!==!1&&s.push(Un()),r!==!1&&s.push(_n()),n.highlightActiveLine!==!1&&s.push(Gn()),n.highlightSelectionMatches!==!1&&s.push(Vn()),n.tabSize&&typeof n.tabSize=="number"&&s.push(qn.of(" ".repeat(n.tabSize))),s.concat([st.of(a.flat())]).filter(Boolean)};const ar="#e5c07b",Ne="#e06c75",sr="#56b6c2",or="#ffffff",se="#abb2bf",ye="#7d8799",ir="#61afef",lr="#98c379",Ae="#d19a66",cr="#c678dd",dr="#21252b",$e="#2c313a",De="#282c34",ge="#353a42",ur="#3E4451",Me="#528bff",hr=V.theme({"&":{color:se,backgroundColor:De},".cm-content":{caretColor:Me},".cm-cursor, .cm-dropCursor":{borderLeftColor:Me},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ur},".cm-panels":{backgroundColor:dr,color:se},".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:De,color:ye,border:"none"},".cm-activeLineGutter":{backgroundColor:$e},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ge},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ge,borderBottomColor:ge},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$e,color:se}}},{dark:!0}),gr=ot.define([{tag:o.keyword,color:cr},{tag:[o.name,o.deleted,o.character,o.propertyName,o.macroName],color:Ne},{tag:[o.function(o.variableName),o.labelName],color:ir},{tag:[o.color,o.constant(o.name),o.standard(o.name)],color:Ae},{tag:[o.definition(o.name),o.separator],color:se},{tag:[o.typeName,o.className,o.number,o.changed,o.annotation,o.modifier,o.self,o.namespace],color:ar},{tag:[o.operator,o.operatorKeyword,o.url,o.escape,o.regexp,o.link,o.special(o.string)],color:sr},{tag:[o.meta,o.comment],color:ye},{tag:o.strong,fontWeight:"bold"},{tag:o.emphasis,fontStyle:"italic"},{tag:o.strikethrough,textDecoration:"line-through"},{tag:o.link,color:ye,textDecoration:"underline"},{tag:o.heading,fontWeight:"bold",color:Ne},{tag:[o.atom,o.bool,o.special(o.variableName)],color:Ae},{tag:[o.processingInstruction,o.string,o.inserted],color:lr},{tag:o.invalid,color:or}]),fr=[hr,ke(gr)];var mr=V.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),pr=function(n){n===void 0&&(n={});var{indentWithTab:r=!0,editable:a=!0,readOnly:s=!1,theme:l="light",placeholder:d="",basicSetup:i=!0}=n,h=[];switch(r&&h.unshift(st.of([Jn])),i&&(typeof i=="boolean"?h.unshift(Fe()):h.unshift(Fe(i))),d&&h.unshift(Yn(d)),l){case"light":h.push(mr);break;case"dark":h.push(fr);break;case"none":break;default:h.push(l);break}return a===!1&&h.push(V.editable.of(!1)),s&&h.push(ie.readOnly.of(!0)),[...h]},xr=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)});class br{constructor(n,r){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=r,this.timeoutMS=r,this.callbacks.push(n)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var n=this.callbacks.slice();this.callbacks.length=0,n.forEach(r=>{try{r()}catch(a){console.error("TimeoutLatch callback error:",a)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class He{constructor(){this.interval=null,this.latches=new Set}add(n){this.latches.add(n),this.start()}remove(n){this.latches.delete(n),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(n=>{n.tick(),n.isDone&&this.remove(n)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var fe=null,yr=()=>typeof window>"u"?new He:(fe||(fe=new He),fe),We=Qn.define(),vr=200,jr=[];function Cr(e){var{value:n,selection:r,onChange:a,onStatistics:s,onCreateEditor:l,onUpdate:d,extensions:i=jr,autoFocus:h,theme:u="light",height:c=null,minHeight:g=null,maxHeight:f=null,width:b=null,minWidth:T=null,maxWidth:I=null,placeholder:S="",editable:P=!0,readOnly:A=!1,indentWithTab:R=!0,basicSetup:p=!0,root:k,initialState:v}=e,[x,j]=m.useState(),[y,L]=m.useState(),[U,_]=m.useState(),B=m.useState(()=>({current:null}))[0],H=m.useState(()=>({current:null}))[0],Z=V.theme({"&":{height:c,minHeight:g,maxHeight:f,width:b,minWidth:T,maxWidth:I},"& .cm-scroller":{height:"100% !important"}}),Q=V.updateListener.of($=>{if($.docChanged&&typeof a=="function"&&!$.transactions.some(X=>X.annotation(We))){B.current?B.current.reset():(B.current=new br(()=>{if(H.current){var X=H.current;H.current=null,X()}B.current=null},vr),yr().add(B.current));var M=$.state.doc,W=M.toString();a(W,$)}s&&s(xr($))}),J=pr({theme:u,editable:P,readOnly:A,placeholder:S,indentWithTab:R,basicSetup:p}),K=[Q,Z,...J];return d&&typeof d=="function"&&K.push(V.updateListener.of(d)),K=K.concat(i),m.useLayoutEffect(()=>{if(x&&!U){var $={doc:n,selection:r,extensions:K},M=v?ie.fromJSON(v.json,$,v.fields):ie.create($);if(_(M),!y){var W=new V({state:M,parent:x,root:k});L(W),l&&l(W,M)}}return()=>{y&&(_(void 0),L(void 0))}},[x,U]),m.useEffect(()=>{e.container&&j(e.container)},[e.container]),m.useEffect(()=>()=>{y&&(y.destroy(),L(void 0)),B.current&&(B.current.cancel(),B.current=null)},[y]),m.useEffect(()=>{h&&y&&y.focus()},[h,y]),m.useEffect(()=>{y&&y.dispatch({effects:Zn.reconfigure.of(K)})},[u,i,c,g,f,b,T,I,S,P,A,R,p,a,d]),m.useEffect(()=>{if(n!==void 0){var $=y?y.state.doc.toString():"";if(y&&n!==$){var M=B.current&&!B.current.isDone,W=()=>{y&&n!==y.state.doc.toString()&&y.dispatch({changes:{from:0,to:y.state.doc.toString().length,insert:n||""},annotations:[We.of(!0)]})};M?H.current=W:W()}}},[n,y]),{state:U,setState:_,view:y,setView:L,container:x,setContainer:j}}var Sr=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],lt=m.forwardRef((e,n)=>{var{className:r,value:a="",selection:s,extensions:l=[],onChange:d,onStatistics:i,onCreateEditor:h,onUpdate:u,autoFocus:c,theme:g="light",height:f,minHeight:b,maxHeight:T,width:I,minWidth:S,maxWidth:P,basicSetup:A,placeholder:R,indentWithTab:p,editable:k,readOnly:v,root:x,initialState:j}=e,y=Pt(e,Sr),L=m.useRef(null),{state:U,view:_,container:B,setContainer:H}=Cr({root:x,value:a,autoFocus:c,theme:g,height:f,minHeight:b,maxHeight:T,width:I,minWidth:S,maxWidth:P,basicSetup:A,placeholder:R,indentWithTab:p,editable:k,readOnly:v,selection:s,onChange:d,onStatistics:i,onCreateEditor:h,onUpdate:u,extensions:l,initialState:j});m.useImperativeHandle(n,()=>({editor:L.current,state:U,view:_}),[L,B,U,_]);var Z=m.useCallback(J=>{L.current=J,H(J)},[H]);if(typeof a!="string")throw new Error("value must be typeof string but got "+typeof a);var Q=typeof g=="string"?"cm-theme-"+g:"cm-theme";return t.jsx("div",ve({ref:Z,className:""+Q+(r?" "+r:"")},y))});lt.displayName="CodeMirror";var ct=e=>{var{theme:n,settings:r={},styles:a=[]}=e,s={".cm-gutters":{}},l={};r.background&&(l.backgroundColor=r.background),r.backgroundImage&&(l.backgroundImage=r.backgroundImage),r.foreground&&(l.color=r.foreground),r.fontSize&&(l.fontSize=r.fontSize),(r.background||r.foreground)&&(s["&"]=l),r.fontFamily&&(s["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(s[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(s[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(s[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(s[".cm-content"]={caretColor:r.caret},s[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var d={};r.gutterActiveForeground&&(d.color=r.gutterActiveForeground),r.lineHighlight&&(s[".cm-activeLine"]={backgroundColor:r.lineHighlight},d.backgroundColor=r.lineHighlight),s[".cm-activeLineGutter"]=d,r.selection&&(s["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(s["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var i=V.theme(s,{dark:n==="dark"}),h=ot.define(a),u=[i,ke(h)];return u},kr={background:"#faf8f5",foreground:"#b29762",caret:"#93abdc",selection:"#e3dcce",selectionMatch:"#e3dcce",gutterBackground:"#faf8f5",gutterForeground:"#cdc4b1",gutterBorder:"transparent",lineHighlight:"#ddceb154"},wr=[{tag:[o.comment,o.bracket],color:"#b6ad9a"},{tag:[o.atom,o.number,o.keyword,o.link,o.attributeName,o.quote],color:"#063289"},{tag:[o.emphasis,o.heading,o.tagName,o.propertyName,o.variableName],color:"#2d2006"},{tag:[o.typeName,o.url,o.string],color:"#896724"},{tag:[o.operator,o.string],color:"#1659df"},{tag:[o.propertyName],color:"#b29762"},{tag:[o.unit,o.punctuation],color:"#063289"}],Er=e=>{var{theme:n="light",settings:r={},styles:a=[]}={};return ct({theme:n,settings:ve({},kr,r),styles:[...wr,...a]})},Tr=Er(),Ir={background:"#2a2734",foreground:"#6c6783",caret:"#ffad5c",selection:"#91ff6c26",selectionMatch:"#91ff6c26",gutterBackground:"#2a2734",gutterForeground:"#545167",lineHighlight:"#36334280"},Pr=[{tag:[o.comment,o.bracket],color:"#6c6783"},{tag:[o.atom,o.number,o.keyword,o.link,o.attributeName,o.quote],color:"#ffcc99"},{tag:[o.emphasis,o.heading,o.tagName,o.propertyName,o.className,o.variableName],color:"#eeebff"},{tag:[o.typeName,o.url],color:"#7a63ee"},{tag:o.operator,color:"#ffad5c"},{tag:o.string,color:"#ffb870"},{tag:[o.propertyName],color:"#9a86fd"},{tag:[o.unit,o.punctuation],color:"#e09142"}],Rr=e=>{var{theme:n="dark",settings:r={},styles:a=[]}={};return ct({theme:n,settings:ve({},Ir,r),styles:[...Pr,...a]})},Or=Rr();const Lr=E("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}`})),dt=E("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})),Br=E("div")(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.error.dark,marginRight:e.spacing(1)})),Fr=()=>{const e=N();return t.jsx(dt,{style:{backgroundColor:e.palette.success.main},children:t.jsx(Ot,{sx:n=>({width:n.spacing(2),height:n.spacing(2)})})})},Nr=()=>{const e=N();return t.jsx(dt,{style:{backgroundColor:e.palette.error.main},children:t.jsx(Lt,{})})},Ar=({context:e,setContext:n,error:r})=>{const{themeMode:a}=m.useContext(Rt),s=N(),l=m.useCallback(i=>{n(i)},[n]),d=`calc(6 * ${s.typography.body1.fontSize} * ${s.typography.body1.lineHeight}) + 8px`;return t.jsxs(w,{sx:{width:"100%"},children:[t.jsxs(Lr,{children:["JSON",t.jsx(F,{condition:!!r,show:t.jsxs(w,{sx:i=>({display:"flex",alignItems:"center"}),children:[t.jsx(Br,{children:r}),t.jsx(Nr,{})]}),elseShow:t.jsx(Fr,{})})]}),t.jsx(lt,{value:e,minHeight:d,theme:a==="dark"?Or:Tr,extensions:[Xn()],onChange:l,style:{border:`1px solid ${s.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 ut(e){return Array.isArray(e)?e:[e]}const $r=e=>!e||e.length===0||e.length===1&&e[0]==="*"?"*":ut(e),Dr=e=>ut(e),Mr=e=>{const n=Hr(e);return n.length>0?n[0]:""},Hr=e=>e.filter(({enabled:n})=>!!n).sort((n,r)=>n.sortOrder-r.sortOrder).map(({name:n})=>n),Wr=(e,n)=>"100%",zr=e=>typeof e=="string"?!0:Array.isArray(e)?e.every(n=>typeof n=="string"):!1,Ur=e=>{const n=new Set(["appName","environment","userId","sessionId","remoteAddress","currentTime","properties"]),r={...e};let a=!1;for(const s in e)n.has(s)||(r.properties||(r.properties={}),r.properties[s]=e[s],delete r[s],a=!0);return!a&&!e.properties&&delete r.properties,r},_r=e=>{const[n]=e.split("."),[r,a]=n.split(":");if(!r||!a)throw new Error("Invalid token format");if(a==="*")throw new Error("Admin tokens are not supported in the playground")},Gr=e=>{const[n]=e.split(".");return n.split(":")},Vr=e=>Bt({mode:"all"},e),qr=e=>{const n=s=>s.toSorted((l,d)=>l.sortOrder-d.sortOrder).map(l=>({key:l.name,label:l.name})),r=e.reduce(({project:s,global:l},d)=>(d.project?s.push(d):l.push(d),{project:s,global:l}),{project:[],global:[]}),a=[];return r.project.length&&a.push({groupHeader:"Project context fields",options:n(r.project)}),r.global.length&&a.push({groupHeader:"Global context fields",options:n(r.global)}),a},Kr=({context:e,setContext:n})=>{const r=N(),{setToastData:a}=Ve(),{context:s}=Vr(),l=qr(s),[d,i]=m.useState(),[h,u]=m.useState(!1),[c,g]=m.useState(""),[f,b]=m.useState(""),T=m.useMemo(()=>rr(p=>{var k;if(!p)return i(void 0);try{const v=JSON.parse(p);u(v[c]!==void 0||((k=v==null?void 0:v.properties)==null?void 0:k[c])!==void 0)}catch(v){return i(ee(v))}return i(void 0)},250),[i,c,u]);m.useEffect(()=>{T(e)},[T,e]);const I=()=>{try{const p=JSON.parse(e||"{}");n(JSON.stringify(Ur({...p,[c]:f}),null,2));const k=s.find(v=>v.name===c);if(k!=null&&k.legalValues&&k.legalValues.length>0||c==="currentTime")return b("")}catch(p){a({type:"error",text:`Error parsing context: ${ee(p)}`})}},S=(p,k)=>{if(zr(k)){if(Array.isArray(k)){const v=(k||[]).length>1?k.join(","):k[0];return b(v)}b(k)}},P=()=>{if(!f||f==="")return[];const p=s.find(v=>v.name===c),k=((p==null?void 0:p.legalValues)||[]).length>1;return f.includes(",")&&k?f.split(","):[f]},A=()=>{if(c==="currentTime"){const k=Ie(f),x=k?Pe(k.toISOString()):Pe(new Date().toISOString());return t.jsx(ae,{id:"date",label:"Date",size:"small",type:"datetime-local",value:x,sx:{width:200,maxWidth:"100%"},onChange:j=>{const y=Ie(j.target.value),L=y==null?void 0:y.toISOString();L&&b(L)},InputLabelProps:{shrink:!0},required:!0})}const p=s.find(k=>k.name===c);if(p!=null&&p.legalValues&&p.legalValues.length>0){const k=p.legalValues.map(({value:v})=>v);return t.jsx(qe,{disablePortal:!0,limitTags:3,id:"context-legal-values",multiple:!0,options:k,disableCloseOnSelect:!0,size:"small",value:P(),onChange:S,getOptionLabel:v=>v,renderOption:(v,x,{selected:j})=>t.jsxs("li",{...v,children:[t.jsx(Nt,{icon:t.jsx($t,{fontSize:"small"}),checkedIcon:t.jsx(At,{fontSize:"small"}),sx:y=>({marginRight:y.spacing(.5)}),checked:j}),x]}),sx:{width:370,maxWidth:"100%"},renderInput:v=>t.jsx(ae,{...v,label:"Value"})})}return t.jsx(ae,{label:"Value",id:"context-value",sx:{width:370,maxWidth:"100%"},placeholder:"value1,value2,value3",size:"small",value:f,onChange:k=>b(k.target.value||"")})},R=p=>{if(g(p||""),p==="currentTime")return b(new Date().toISOString());b("")};return t.jsxs(w,{children:[t.jsx(w,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(D,{variant:"body2",color:r.palette.text.primary,sx:{ml:1},children:"Unleash context"})}),t.jsxs(w,{sx:{display:"flex",gap:2,flexWrap:"wrap",mb:2},children:[t.jsx(Ft,{label:"Context field",labelId:"context-field-label",id:"context-field",value:c,onChange:R,variant:"outlined",size:"small",sx:{width:200,maxWidth:"100%"},options:l}),A(),t.jsx(le,{variant:"outlined",disabled:!c||!!d,onClick:I,sx:{width:"95px",maxHeight:"40px"},children:`${h?"Replace":"Add"} `})]}),t.jsx(Ar,{context:e,setContext:n,error:d})]})},Jr=({environments:e,setEnvironments:n,availableEnvironments:r,disabled:a})=>{const s=[...r.map(i=>({label:i,id:i}))],l=s.filter(({id:i})=>e.includes(i)),d=(i,h,u)=>{const c=h;return u==="clear"||c===null?n([]):Array.isArray(c)?c.length===0?n([]):n(c.map(({id:g})=>g)):n([c.id])};return t.jsx(qe,{disablePortal:!0,limitTags:3,id:"environment",multiple:!0,options:s,sx:{flex:1},renderInput:i=>t.jsx(ae,{...i,label:"Environments"}),renderOption:Dt,renderTags:(i,h)=>i.map((u,c)=>{const{key:g,...f}=h({index:c});return t.jsx(Mt,{size:"small",...f,label:u.label},g)}),getOptionLabel:({label:i})=>i,disableCloseOnSelect:!1,size:"small",value:l,onChange:d,disabled:a,"data-testid":"PLAYGROUND_ENVIRONMENT_SELECT"})},me={label:"ALL",id:"*"},ze=E(_t)({fontSize:"1.25rem"}),ht=E(Ut)(()=>({width:"100%"})),Yr=E(w)(({theme:e})=>({display:"grid",columnGap:e.spacing(2),rowGap:e.spacing(2),gridTemplateColumns:"1fr",[e.breakpoints.up("md")]:{gridTemplateColumns:"1fr 1fr"}})),Zr=E(ht)(({theme:e})=>({"& label":{WebkitTextFillColor:e.palette.text.secondary},"& input.Mui-disabled":{WebkitTextFillColor:e.palette.text.secondary}})),Qr=({environments:e,projects:n,token:r,setProjects:a,setEnvironments:s,setToken:l,availableEnvironments:d,changeRequest:i,onClearChangeRequest:h})=>{const u=N(),{tokens:c}=er(),[g,f]=m.useState(),{projects:b}=Ht(),T=[me,...b.map(({name:x,id:j})=>({label:x,id:j}))],I=async x=>{const j=x.target.value;if(l==null||l(j),j===""){k();return}try{_r(j),f(void 0),S(j)}catch(y){f(y.message)}},S=x=>{const[j,y]=Gr(x);switch(s([y]),j){case"[]":A(x);break;case"*":R();break;default:p(j)}},P=x=>{!x.projects||x.projects==="*"?a([me.id]):typeof x.projects=="string"?a([x.projects]):Array.isArray(x.projects)&&a(x.projects)},A=x=>{const j=c.find(({secret:y})=>y===x);j?P(j):f("Invalid token. Ensure you use a valid token from this Unleash instance.")},R=()=>{a([me.id])},p=x=>{T.map(j=>j.id).includes(x)?a([x]):f(`Invalid token. Project ${x} does not exist.`)},k=()=>{f(void 0)},v=()=>{l==null||l(""),k()};return t.jsxs(w,{sx:{pb:2},children:[t.jsx(w,{sx:{display:"flex",alignItems:"center",mb:2},children:t.jsx(D,{variant:"body2",color:u.palette.text.primary,sx:{ml:1},children:"Access configuration"})}),t.jsxs(Yr,{children:[t.jsx(w,{children:t.jsx(Re,{arrow:!0,title:r?"Environment is automatically selected because you are using a token":"Select environments to use in the playground",children:t.jsx(w,{children:t.jsx(Jr,{environments:e,setEnvironments:s,availableEnvironments:d,disabled:!!(r||i)})})})}),t.jsx(w,{children:t.jsx(Re,{arrow:!0,title:r?"Project is automatically selected because you are using a token":"Select projects to use in the playground",children:t.jsx(Wt,{selectedProjects:n,onChange:a,dataTestId:"PLAYGROUND_PROJECT_SELECT",disabled:!!(r||i),limitTags:3})})}),t.jsx(w,{children:t.jsx(ht,{label:"API token",value:r||(i?" ":""),onChange:I,type:"text",error:!!g,errorText:g,placeholder:"Enter your API token","data-testid":"PLAYGROUND_TOKEN_INPUT",InputProps:{endAdornment:r?t.jsx(Oe,{position:"end","data-testid":"TOKEN_INPUT_CLEAR_BTN",children:t.jsx(q,{"aria-label":"clear API token",onClick:v,edge:"end",children:t.jsx(ze,{})})}):null},disabled:!!i})}),t.jsx(F,{condition:!!i,show:t.jsxs(w,{sx:{display:"flex",gap:2},children:[t.jsx(w,{sx:{flex:1},children:t.jsx(Zr,{label:"Change request",value:i?`Change request #${i}`:"",onChange:()=>{},type:"text",disabled:!0,InputProps:{endAdornment:t.jsx(Oe,{position:"end",children:t.jsx(q,{"aria-label":"clear Change request results",onClick:h,edge:"end",children:t.jsx(ze,{})})})}})}),t.jsx(le,{variant:"outlined",size:"small",to:`/projects/${n[0]}/change-requests/${i}`,component:zt,children:"View change request"})]})})]})]})},Xr=({availableEnvironments:e,environments:n,onSubmit:r,projects:a,token:s,setToken:l,setProjects:d,setEnvironments:i,context:h,setContext:u,changeRequest:c,onClearChangeRequest:g})=>t.jsxs(w,{component:"form",onSubmit:r,sx:{display:"flex",flexDirection:"column"},children:[t.jsx(Qr,{environments:Array.isArray(n)?n:[n],projects:a,token:s,setToken:l,setEnvironments:i,setProjects:d,availableEnvironments:e.map(({name:f})=>f),changeRequest:c,onClearChangeRequest:g}),t.jsx(Kr,{context:h,setContext:u}),t.jsx(w,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:t.jsx(le,{variant:"contained",size:"large",type:"submit",sx:{marginLeft:"auto"},children:"Try configuration"})})]}),ea=E("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})),ta=({style:e,children:n,type:r})=>{const a=N(),s={backgroundColor:a.palette.background.alternative,color:a.palette.common.white};return r==="secondary"&&(s.backgroundColor=a.palette.background.paper,s.color=a.palette.text.secondary),t.jsx(ea,{style:{...s,...e},children:n})},pe=({headerText:e,bodyText:n,sectionNumber:r})=>t.jsx(w,{sx:{display:"flex",alignItems:"flex-start",mt:2,flexDirection:"column"},children:t.jsxs(w,{sx:{display:"flex"},children:[t.jsx(w,{children:t.jsx(ta,{children:r})}),t.jsxs(w,{sx:{ml:2,display:"flex",flexDirection:"column"},children:[t.jsx(D,{variant:"body1",sx:{fontWeight:"bold"},children:e}),t.jsx(F,{condition:!!n,show:t.jsx(D,{variant:"body1",sx:{mt:1},children:n})})]})]})}),gt=()=>t.jsxs(w,{sx:{ml:4},children:[t.jsx(D,{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(Gt,{sx:{mt:2,mb:2}}),t.jsx(D,{variant:"body1",sx:{mb:1},children:"What you need to do is:"}),t.jsx(pe,{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(pe,{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(pe,{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 Ee={},na=Je;Object.defineProperty(Ee,"__esModule",{value:!0});var ft=Ee.default=void 0,ra=na(Ke()),aa=t,sa=(0,ra.default)((0,aa.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");ft=Ee.default=sa;const oa=E(ne)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:e.shape.borderRadiusExtraLarge,border:`1px solid ${e.palette.divider}`,padding:e.spacing(8,4),maxWidth:"500px"}})),ia=()=>{const[e,n]=m.useState(null),r=l=>n(l.currentTarget),a=()=>n(null),s=!!e;return t.jsxs(w,{children:[t.jsx(q,{onClick:r,"aria-label":"Open Playground guidance",children:t.jsx(ft,{})}),t.jsxs(oa,{open:s,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},sx:l=>({zIndex:l.zIndex.tooltip,background:"none"}),children:[t.jsx(q,{onClick:a,sx:{position:"absolute",right:25,top:15},children:t.jsx(Vt,{})}),t.jsx(gt,{})]})]})},la=e=>m.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.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"})),ca=e=>m.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.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"})),da=e=>e==="unknown"||e==="unevaluated"?[ce,"info"]:e===!0?[la,"success"]:[ca,"error"],Y=({enabled:e,label:n,showIcon:r=!0})=>{const[a,s]=da(e);return t.jsx(Ye,{color:s,icon:r?t.jsx(a,{"aria-hidden":!0,color:s,strokeWidth:"0.25"}):void 0,children:n})},ua=E(w)(({theme:e})=>({display:"flex",alignItems:"center",padding:e.spacing(1,0,1,2)})),ha=E(w)(()=>({marginRight:"auto"})),mt=({feature:e})=>{const[n,r]=(()=>{var a;return e!=null&&e.isEnabled?[!0,"True"]:((a=e==null?void 0:e.strategies)==null?void 0:a.result)==="unknown"?["unknown","Unknown"]:[!1,"False"]})();return t.jsx(ua,{children:t.jsx(ha,{"data-loading":!0,children:t.jsx(Y,{enabled:n,label:r,showIcon:n!=="unknown"})})})};function pt(e){return e===void 0?!0:Object.values(e).every(n=>n&&typeof n=="object"?pt(n):n===null)}const Ue=e=>{var n,r;return(r=(n=e.strategies)==null?void 0:n.data)==null?void 0:r.find(a=>!Ze.includes(a.name))},ga=e=>{var n,r,a,s;return((r=(n=e.strategies)==null?void 0:n.data)==null?void 0:r.length)>0&&!((s=(a=e.strategies)==null?void 0:a.data)!=null&&s.find(l=>Ze.includes(l.name)))},fa=E("div")({display:"flex",justifyContent:"space-between",width:"100%"}),ma=E("hgroup")(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(1.5)})),pa=E("h3")(({theme:e})=>({fontWeight:"bold",fontSize:e.typography.subtitle1.fontSize,margin:0})),xa=({feature:e,input:n,onClose:r})=>{var c;const a=N(),[s,l,d]=e.isEnabled?[`This feature flag is True in ${n==null?void 0:n.environment} because `,"at least one strategy is True",a.palette.success.contrastText]: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",a.palette.error.contrastText]:e.isEnabledInCurrentEnvironment?ga(e)?[`This feature flag is Unknown in ${n==null?void 0:n.environment} because `,"no strategies could be fully evaluated",a.palette.warning.contrastText]:Ue(e)?[`This feature flag is Unknown in ${n==null?void 0:n.environment} because `,"not all strategies could be fully evaluated",a.palette.warning.contrastText]:e.hasUnsatisfiedDependency?[`This feature flag is False in ${n==null?void 0:n.environment} because `,"parent dependency is not satisfied",a.palette.error.contrastText]:[`This feature flag is False in ${n==null?void 0:n.environment} because `,"all strategies are either False or could not be fully evaluated",a.palette.error.contrastText]:[`This feature flag is False in ${n==null?void 0:n.environment} because `,"the environment is disabled",a.palette.error.contrastText],i=pt(n==null?void 0:n.context)?"You did not provide a value for your context field in step 2 of the configuration":void 0,h=Ue(e)?"This feature uses custom strategies. Custom strategies can't be evaluated, so they will be marked accordingly.":void 0,u=r&&(g=>{g.stopPropagation(),r()});return t.jsxs(t.Fragment,{children:[t.jsxs(fa,{children:[t.jsxs(ma,{children:[t.jsx(pa,{children:e.name}),t.jsx("p",{children:((c=e==null?void 0:e.strategies)==null?void 0:c.result)!=="unknown"?t.jsx(Y,{enabled:e.isEnabled,label:e.isEnabled?"True":"False"}):t.jsx(Y,{enabled:"unknown",label:"Unknown",showIcon:!1})})]}),t.jsx(q,{"aria-label":"Close",onClick:u,children:t.jsx(qt,{})})]}),t.jsxs("p",{children:[s,t.jsx(D,{color:d,component:"span",children:l}),"."]}),i?t.jsx(te,{color:"info",children:i}):null,h?t.jsx(te,{severity:"warning",color:"info",children:h}):null]})},xt=E("div",{shouldForwardProp:e=>e!=="variant"})(({theme:e,variant:n})=>({"--font-size":e.typography.body2.fontSize,display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(.5,.25),color:n==="ok"?e.palette.success.dark:e.palette.error.dark,fontSize:"var(--font-size)",svg:{fontSize:"calc(var(--font-size) * 1.25)"}})),ba=()=>t.jsxs(xt,{variant:"ok",children:[t.jsx(Jt,{"aria-hidden":"true"}),t.jsx("p",{children:"Constraint met by value in context"})]}),ya=({text:e})=>t.jsxs(xt,{variant:"error",children:[t.jsx(Yt,{"aria-hidden":"true"}),t.jsx("p",{children:e})]}),bt=({constraint:e,input:n})=>{if(!e)return null;const r=()=>{const a=n==null?void 0:n.context[e.contextName];return e.operator==="REGEX"&&a&&e.value?`Constraint not met – the value in the context ${e.contextName}: { ${a} } is not matching ${e.operator} ${e.value}`:a?`Constraint not met – the value in the context: { ${a} } is not ${e.operator} ${e.contextName}`:`Constraint not met – no value was specified for ${e.contextName}`};return t.jsx(be,{children:t.jsxs("div",{children:[t.jsx(Kt,{...e}),e.result?t.jsx(ba,{}):t.jsx(ya,{text:r()})]})})},va=E(w)(({theme:e})=>({width:"auto",height:"auto",padding:e.spacing(2,3),borderRadius:e.shape.borderRadiusMedium,border:`1px solid ${e.palette.divider}`})),ja=({segment:e,input:n})=>{const r=e.constraints.length>0?t.jsx(Qe,{children:e.constraints.map(a=>t.jsx(bt,{constraint:a,input:n},oe(a)))}):void 0;return t.jsx(Zt,{segment:e,constraintList:r,isExpanded:!0})},Ca=({strategyResult:e,input:n})=>{const{name:r,constraints:a,segments:s,parameters:l}=e,d=Qt(e),{strategies:i}=Xt(),{isCustomStrategy:h,customStrategyParameters:u}=en(e,i),c=!!(s&&s.length>0),g=!!(a&&(a==null?void 0:a.length)>0),f=r!=="default"&&Object.keys(tn).includes(r);if(!l)return null;const b=[...c?s.map(S=>t.jsx(ja,{segment:S,input:n},oe(S))):[],...g?a.map(S=>t.jsx(bt,{constraint:S,input:n},oe(S))):[],f&&d.map((S,P)=>t.jsx(be,{children:S},P)),h&&u.map((S,P)=>t.jsx(be,{children:S},P)),r==="default"&&t.jsxs(va,{sx:{width:"100%"},children:["The standard strategy is ",t.jsx(Ye,{color:"success",children:"ON"})," for all users."]},"default-on")].filter(Boolean),{variant:T,variants:I}=e.result;return t.jsxs(t.Fragment,{children:[t.jsx(Qe,{children:b}),I!=null&&I.length?t.jsx(nn,{variants:I,selected:T==null?void 0:T.name}):null]})},Sa=({strategy:e,input:n,className:r})=>{const{result:a}=e,s=a.evaluationStatus==="incomplete"||a.evaluationStatus==="unevaluated"?"Not evaluated":a.enabled?"True":"False";return t.jsx(rn,{strategy:{...e,id:`${oe(e)}`},strategyHeaderLevel:4,className:r,headerItemsLeft:e.disabled?null:t.jsx(Y,{showIcon:!1,enabled:a.enabled,label:s}),children:t.jsx(Ca,{strategyResult:e,input:n})})},ka=E("hgroup")(({theme:e})=>({paddingBottom:e.spacing(2)})),wa=E("h4")(({theme:e})=>({fontWeight:"normal",fontSize:e.typography.body1.fontSize,margin:0})),Ea=E("p")(({theme:e})=>({fontWeight:"bold",fontSize:e.typography.body2.fontSize})),Ta=E(on)(({theme:e})=>({marginInline:"calc(var(--popover-inline-padding) * -1)",borderTop:`1px solid ${e.palette.divider}`,"> li:last-of-type":{paddingBottom:0}})),_e=({strategies:e,input:n,titlePrefix:r,infoText:a})=>e.length===0?null:t.jsxs("div",{children:[t.jsxs(ka,{children:[t.jsx(wa,{children:`${r?r.concat(" strategies"):"Strategies"} (${e==null?void 0:e.length})`}),a?t.jsx(Ea,{children:a}):null]}),t.jsx(Ta,{children:e==null?void 0:e.map((s,l)=>t.jsxs(an,{children:[l>0?t.jsx(sn,{}):"",t.jsx(Sa,{strategy:s,input:n})]},s.id))})]}),Ia=({feature:e})=>{var r,a;if(!((r=e==null?void 0:e.strategies)!=null&&r.data))return null;let n;if(e.hasUnsatisfiedDependency&&!e.isEnabledInCurrentEnvironment)n="If the environment was enabled and parent dependencies were satisfied";else if(e.hasUnsatisfiedDependency)n="If parent dependencies were satisfied";else if(!e.isEnabledInCurrentEnvironment)n="If the environment was enabled";else return;return t.jsxs(te,{severity:"info",color:"info",children:[n,", then this feature flag would be"," ",(a=e.strategies)!=null&&a.result?"TRUE":"FALSE"," with strategies evaluated like this:"]})},Pa=({feature:e,input:n})=>{var l,d,i,h,u;const r=(d=(l=e.strategies)==null?void 0:l.data)==null?void 0:d.filter(c=>!c.disabled),a=(h=(i=e.strategies)==null?void 0:i.data)==null?void 0:h.filter(c=>c.disabled),s=(a==null?void 0:a.length)>0;return(((u=e==null?void 0:e.strategies)==null?void 0:u.data.length)??0)===0?t.jsx(te,{severity:"info",children:"There are no strategies added to this feature flag in the selected environment."}):t.jsxs(t.Fragment,{children:[t.jsx(Ia,{feature:e}),t.jsx(_e,{strategies:r||[],input:n,titlePrefix:s?"Enabled":void 0}),s?t.jsx(_e,{strategies:a,input:n,titlePrefix:"Disabled",infoText:"Disabled strategies are not evaluated for the overall result."}):null]})},Ra=E("div")(({theme:e})=>({alignItems:"flex-end",color:e.palette.divider})),Oa=({feature:e,input:n})=>{const[r,a]=m.useState(!1),s=m.useRef(null),l=()=>{a(!r)};return t.jsxs(Ra,{children:[t.jsx(q,{onClick:l,children:t.jsx(ce,{ref:s})}),t.jsxs(ne,{open:r,onClose:()=>a(!1),anchorEl:s.current,PaperProps:{sx:d=>({"--popover-inline-padding":d.spacing(4),paddingInline:"var(--popover-inline-padding)",paddingBlock:d.spacing(3),display:"flex",flexDirection:"column",width:728,maxWidth:"100%",height:"auto",gap:d.spacing(3),overflowY:"auto",backgroundColor:d.palette.background.elevation1,borderRadius:d.shape.borderRadius})},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:[t.jsx(xa,{feature:e,input:n,onClose:()=>a(!1)}),t.jsx(Pa,{feature:e,input:n})]})]})},yt=e=>e.feature?t.jsx(Oa,{...e}):null;var Te={},La=Je;Object.defineProperty(Te,"__esModule",{value:!0});var vt=Te.default=void 0,Ba=La(Ke()),Fa=t,Na=(0,Ba.default)((0,Fa.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");vt=Te.default=Na;const Aa=E("div")(({theme:e})=>({padding:e.spacing(4),maxWidth:"400px"})),xe=E(D)(({theme:e})=>({marginBottom:e.spacing(2)})),$a=E(vt)(({theme:e})=>({color:e.palette.success.main})),Da=({variants:e,selectedVariant:n})=>{const r=N(),a=m.useMemo(()=>e.map(c=>({name:c.name,weight:`${ln(c.weight)}%`,selected:c.name===n})),[e,n]),s=m.useMemo(()=>({sortBy:[{id:"name",desc:!1}]}),[]),{getTableProps:l,getTableBodyProps:d,headerGroups:i,rows:h,prepareRow:u}=O.useTable({initialState:s,columns:Ma,data:a,sortTypes:de,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},O.useGlobalFilter,O.useSortBy);return t.jsxs(Aa,{children:[t.jsx(xe,{variant:"subtitle2",children:"Variant Information"}),t.jsx(xe,{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(xe,{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(cn,{...l(),rowHeight:"dense",children:[t.jsx(dn,{headerGroups:i}),t.jsx(un,{...d(),children:h.map(c=>{const g={};c.original.selected||(g.color=r.palette.text.secondary),u(c);const{key:f,...b}=c.getRowProps();return t.jsx(hn,{hover:!0,...b,children:c.cells.map(T=>{const{key:I,...S}=T.getCellProps();return t.jsx(gn,{...S,style:g,children:T.render("Cell")},I)})},f)})})]})]})},Ma=[{id:"Icon",Cell:({row:{original:{selected:e}}})=>t.jsx(t.Fragment,{children:t.jsx(F,{condition:e,show:t.jsx(fn,{icon:t.jsx($a,{})})})}),maxWidth:25,disableGlobalFilter:!0},{Header:"Name",accessor:"name",searchable:!0,Cell:({row:{original:{name:e}}})=>t.jsx(Le,{children:e}),maxWidth:175,width:175},{Header:"Weight",accessor:"weight",sortType:"alphanumeric",searchable:!0,maxWidth:75,Cell:({row:{original:{weight:e}}})=>t.jsx(Le,{children:e})}],Ha=E("div")(()=>({maxWidth:"100%",display:"flex",alignItems:"center",wordBreak:"break-all"})),Wa=({variant:e,variants:n,feature:r,isEnabled:a})=>{const s=N(),[l,d]=m.useState(null),i=c=>d(c.currentTarget),h=()=>d(null),u=!!l;return t.jsxs(Ha,{children:[e,t.jsx(F,{condition:!!n&&n.length>0&&a,show:t.jsxs(t.Fragment,{children:[t.jsx(q,{onClick:i,children:t.jsx(ce,{})}),t.jsx(ne,{open:u,id:`${r}-result-variants`,PaperProps:{sx:{borderRadius:`${s.shape.borderRadiusLarge}px`}},onClose:h,anchorEl:l,anchorOrigin:{vertical:"bottom",horizontal:-320},children:t.jsx(Da,{variants:n,selectedVariant:e})})]})})]})},za=({features:e})=>{const n=N(),r=Xe(n.breakpoints.down("sm")),a=Object.keys(e[0].context).map(c=>({Header:Ce(c),accessor:g=>g.context[c],minWidth:160,Cell:je})),s=m.useMemo(()=>[...a,{Header:"Variant",id:"variant",accessor:"variant.name",sortType:"alphanumeric",filterName:"variant",maxWidth:200,Cell:({value:c,row:{original:{variant:g,feature:f,variants:b,isEnabled:T}}})=>t.jsx(Wa,{variant:g!=null&&g.enabled?c:"",variants:b,feature:f,isEnabled:T})},{id:"isEnabled",Header:"isEnabled",filterName:"isEnabled",accessor:c=>{var g;return c!=null&&c.isEnabled?"true":((g=c==null?void 0:c.strategies)==null?void 0:g.result)==="unknown"?"unknown":"false"},Cell:({row:c})=>t.jsx(mt,{feature:c.original}),sortType:"playgroundResultState",maxWidth:120,sortInverted:!0},{Header:"",maxWidth:70,id:"info",Cell:({row:c})=>t.jsx(yt,{feature:c.original,input:{environment:c.original.environment,context:c.original.context}})}],[]),{headerGroups:l,rows:d,prepareRow:i,setHiddenColumns:h}=O.useTable({columns:s,data:e,sortTypes:de,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},O.useGlobalFilter,O.useFlexLayout,O.useSortBy);et([{condition:r,columns:["variant"]}],h,s);const u=m.useRef(null);return t.jsx(w,{ref:u,sx:{overflow:"auto",maxHeight:"800px"},children:t.jsx(Se,{parentRef:u,rows:d,headerGroups:l,prepareRow:i})})},Ua=E("div",{})(({theme:e})=>({flexGrow:0,...tt,justifyContent:"flex-start",margin:e.spacing(0,1.5)})),_a=E(w)(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(1)})),Ga=({value:e})=>{const n=N(),[r,a]=m.useState(null),s=u=>a(u.currentTarget),l=()=>a(null),d=!!r,i=(e||[]).filter(u=>u.isEnabled),h=(e||[]).filter(u=>!u.isEnabled);return t.jsxs(Ua,{children:[t.jsxs(_a,{children:[t.jsx(F,{condition:i.length>0,show:t.jsx(Y,{enabled:!0,label:`${i.length}`,showIcon:!0})}),t.jsx(F,{condition:h.length>0,show:t.jsx(Y,{enabled:!1,label:`${h.length}`,showIcon:!0})})]}),t.jsxs(t.Fragment,{children:[t.jsx(q,{onClick:s,children:t.jsx(ce,{})}),t.jsxs(ne,{open:d,id:`${e}-result-details`,PaperProps:{sx:{borderRadius:`${n.shape.borderRadiusLarge}px`,padding:n.spacing(3)}},onClose:l,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:[t.jsx(D,{variant:"subtitle2",sx:{mb:3},children:e[0].environment}),t.jsx(za,{features:e})]})]})]})},Va=({features:e})=>{const n=Object.keys(e),r=e[n[0]],a=r[0].context,s=m.useMemo(()=>r.map((f,b)=>({...Object.fromEntries(n.map(T=>[T,e[T][b]]))})),[JSON.stringify(e)]),l=Object.keys(a).map(f=>({Header:Ce(f),accessor:b=>b[n[0]].context[f],minWidth:160,Cell:je})),d=n.map(f=>({Header:f,accessor:b=>{var T,I,S;return(T=b[f])!=null&&T.isEnabled?"true":((S=(I=b[f])==null?void 0:I.strategies)==null?void 0:S.result)==="unknown"?"unknown":"false"},Cell:({row:b})=>t.jsxs(w,{sx:{display:"flex"},children:[t.jsx(mt,{feature:b.original[f]}),t.jsx(yt,{feature:b.original[f],input:{environment:b.original[f].environment,context:b.original[f].context}})]}),sortType:"playgroundResultState",maxWidth:140})),i=m.useMemo(()=>[...l,...d],[]),{headerGroups:h,rows:u,prepareRow:c}=O.useTable({columns:i,data:s,sortTypes:de,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0},O.useGlobalFilter,O.useFlexLayout,O.useSortBy),g=m.useRef(null);return t.jsx(w,{ref:g,sx:{overflow:"auto",maxHeight:"800px"},children:t.jsx(Se,{parentRef:g,rows:u,headerGroups:h,prepareRow:c})})},qa=E("div",{})(({theme:e})=>({flexGrow:0,...tt,justifyContent:"flex-start",margin:e.spacing(0,1.5)})),Ka=E(le)(({theme:e})=>({textAlign:"left",textDecorationStyle:"dotted",textDecorationLine:"underline",textUnderlineOffset:e.spacing(.75),color:e.palette.neutral.dark,padding:0,fontWeight:"normal"})),Ja=({value:e})=>{const n=N(),[r,a]=m.useState(null),s=i=>a(i.currentTarget),l=()=>a(null),d=!!r;return t.jsx(qa,{children:t.jsxs(t.Fragment,{children:[t.jsx(Ka,{variant:"text",onClick:s,children:"View diff"}),t.jsxs(ne,{open:d,id:`${e}-result-details`,PaperProps:{sx:{borderRadius:`${n.shape.borderRadiusLarge}px`,padding:n.spacing(3)}},onClose:l,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:[t.jsx(D,{variant:"subtitle2",sx:{mb:3},children:"Environments diff"}),t.jsx(Va,{features:e})]})]})})},Ya=e=>e.reduce((n,r)=>n+Object.values(r.environments).flatMap(a=>Object.keys(a)).length,0),Za=e=>e<0?"invalid bucket":e>=2e4?"20000+":e>=1e4?"10000-20000":e>=1e3?"1000-10000":e>=100?"100-1000":"0-100",Qa={id:"name"},{value:Ge,setValue:Xa}=at("AdvancedPlaygroundResultsTable:v1",Qa),es=({features:e,input:n,loading:r})=>{const{trackEvent:a}=nt();e&&a("playground",{props:{eventType:"number-of-combinations",count:Za(Ya(e))}});const[s,l]=rt(),d=mn(r),[i,h]=m.useState(s.get("search")||""),u=N(),c=Xe(u.breakpoints.down("md")),g=e&&e.length>0?Object.keys(e[0].environments).length:0,f=m.useMemo(()=>{var x;return[{Header:"Name",accessor:"name",searchable:!0,minWidth:160,Cell:({value:j,row:{original:y}})=>t.jsx(Be,{title:j,to:`/projects/${y==null?void 0:y.projectId}/features/${j}`})},{Header:"Project ID",accessor:"projectId",sortType:"alphanumeric",filterName:"projectId",searchable:!0,minWidth:150,Cell:({value:j})=>t.jsx(Be,{title:j,to:`/projects/${j}`})},...((x=n==null?void 0:n.environments)==null?void 0:x.map(j=>({Header:r?()=>"":Ce(j),maxWidth:150,id:`environments.${j}`,align:"flex-start",Cell:({row:y})=>t.jsx(Ga,{value:y.original.environments[j]})})))||[],...g>1?[{Header:"Diff",minWidth:150,id:"diff",align:"left",Cell:({row:j})=>t.jsx(Ja,{value:j.original.environments})}]:[]]},[n]),{data:b,getSearchText:T,getSearchContext:I}=pn(f,i,e||[]),S=m.useMemo(()=>r?Array(5).fill({name:"Feature name",projectId:"Feature Project",environments:{name:"Feature Environments",variants:[]},enabled:!0}):b,[b,r]),[P]=m.useState(()=>({sortBy:[{id:s.get("sort")||Ge.id,desc:s.has("order")?s.get("order")==="desc":Ge.desc}]})),{headerGroups:A,rows:R,state:{sortBy:p},prepareRow:k,setHiddenColumns:v}=O.useTable({initialState:P,columns:f,data:S,sortTypes:de,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:je}},O.useGlobalFilter,O.useFlexLayout,O.useSortBy);return et([{condition:c,columns:["projectId"]}],v,f),m.useEffect(()=>{if(r)return;const x=Object.fromEntries(s);x.sort=p[0].id,p[0].desc?x.order="desc":x.order&&delete x.order,i?x.search=i:delete x.search,l(x,{replace:!0}),Xa({id:p[0].id,desc:p[0].desc||!1})},[r,p,i]),t.jsxs(t.Fragment,{children:[t.jsxs(w,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[t.jsx(D,{variant:"subtitle1",sx:{ml:1},children:e!==void 0&&!r?`Results (${R.length<S.length?`${R.length} of ${S.length}`:S.length})`:"Results"}),t.jsx(xn,{initialValue:i,onChange:h,hasFilters:!0,getSearchContext:I,disabled:r,containerStyles:{marginLeft:"1rem",maxWidth:"400px"}})]}),t.jsx(F,{condition:!r&&!S,show:()=>t.jsx(he,{children:S===void 0?"None of the feature flags were evaluated yet.":"No results found."}),elseShow:()=>t.jsxs(w,{ref:d,sx:{overflow:"auto"},children:[t.jsx(bn,{value:T(i),children:t.jsx(Se,{rows:R,headerGroups:A,prepareRow:k})}),t.jsx(F,{condition:S.length===0&&(i==null?void 0:i.length)>0,show:t.jsxs(he,{children:["No feature flags found matching “",i,"”"]})}),t.jsx(F,{condition:S&&S.length===0&&!i,show:t.jsx(he,{children:"No features flags to display"})})]})})]})},jt=E(te)(({theme:e})=>({marginBottom:e.spacing(3)})),ts=({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 a="Some context properties were not taken into account during evaluation",s=E("details")(({theme:l})=>({"* + *":{marginBlockStart:l.spacing(1)}}));return t.jsx(jt,{severity:"warning",children:t.jsxs(s,{children:[t.jsx("summary",{children:a}),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(l=>t.jsx("li",{"data-testid":"context-warning-list-element",children:t.jsx("code",{children:l})},l))}),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},ss=({FormComponent:e=Xr})=>{const n={projects:[],environments:[]},{value:r,setValue:a}=at("AdvancedPlayground:v1",n),{trackEvent:s}=nt(),{environments:l}=yn(),d=N(),[i,h]=m.useState(),[u,c]=m.useState(r.environments),[g,f]=m.useState(r.projects),[b,T]=m.useState(r.token),[I,S]=m.useState(r.context),[P,A]=m.useState(),{setToastData:R}=Ve(),[p,k]=rt(),[v,x]=m.useState(),{evaluateAdvancedPlayground:j,evaluateChangeRequestPlayground:y,loading:L,errors:U}=tr(),[_,B]=m.useState(!1);m.useEffect(()=>{(u==null?void 0:u.length)===0&&l.length>0&&c([Mr(l)])},[JSON.stringify(u),JSON.stringify(l)]),m.useEffect(()=>{H()},[]);const H=async()=>{try{const C=Z(),z=Q(),re=J();K(),$(),C&&re&&await M(C||[],z||"*",re)}catch(C){R({type:"error",text:`Failed to parse URL parameters: ${ee(C)}`})}},Z=()=>{let C=null;const z=p.get("environments");return z&&(C=z.split(","),c(C)),C},Q=()=>{let C=null;const z=p.get("projects");return z&&(C=z.split(","),f(C)),C},J=()=>{let C=p.get("context");return C&&(C=decodeURI(C),S(C)),C},K=()=>{let C=p.get("token");return C&&(C=decodeURI(C),T(C)),C},$=()=>{const C=p.get("changeRequest");C&&x(C)},M=async(C,z,re,ue)=>{try{h(void 0);const G={appName:"playground",...JSON.parse(re||"{}")},Et=v?await y(v,{context:G}):await j({environments:Dr(C),projects:$r(z),context:G});ue&&typeof ue=="function"&&ue(),A(Et)}catch(G){G instanceof vn?h(G.message):G instanceof SyntaxError?R({type:"error",text:`Error parsing context: ${ee(G)}`}):R({type:"error",text:ee(G)})}},W=()=>{let C="default";b&&b!==""?C="api_token":v&&(C="change_request"),s("playground",{props:{eventType:"try-configuration",mode:C}})},X=async C=>{C.preventDefault(),B(!0),W(),await M(u,g,I,()=>{St(),v||a({environments:u,projects:g,context:I})})},Ct=()=>{x(void 0)},St=()=>{p.set("context",encodeURI(I||"")),Array.isArray(u)&&u.length>0&&!(u.length===1&&u[0]==="*")?p.set("environments",u.join(",")):p.delete("projects"),Array.isArray(g)&&g.length>0&&!(g.length===1&&g[0]==="*")?p.set("projects",g.join(",")):p.delete("projects"),v?p.set("changeRequest",v):p.delete("changeRequest"),k(p)},kt="auto",wt=Wr();return t.jsx(jn,{header:t.jsx(kn,{title:"Unleash playground",actions:t.jsx(ia,{})}),disableLoading:!0,bodyClass:"no-padding",children:t.jsxs(w,{sx:{display:"flex",flexDirection:"column"},children:[t.jsx(w,{sx:{background:d.palette.background.elevation2,borderBottomLeftRadius:d.shape.borderRadiusMedium,isolation:"isolate",zIndex:2},children:t.jsx(Cn,{elevation:0,sx:{px:4,py:3,background:d.palette.background.elevation2,transition:"width 0.4s ease",minWidth:"auto",width:kt,position:"sticky",top:0},children:t.jsx(e,{onSubmit:X,context:I,setContext:S,availableEnvironments:l,projects:g,environments:u,token:b,setToken:T,setProjects:f,setEnvironments:c,changeRequest:v||void 0,onClearChangeRequest:Ct})})}),t.jsxs(w,{sx:C=>({width:wt,transition:"width 0.4s ease",padding:C.spacing(4,4),isolation:"isolate",zIndex:1}),children:[t.jsx(F,{condition:!!i,show:t.jsx(jt,{severity:"warning",children:i})}),t.jsx(F,{condition:L,show:t.jsx(Sn,{}),elseShow:t.jsxs(t.Fragment,{children:[t.jsx(F,{condition:!!P&&Object.values(U).length===0,show:t.jsxs(t.Fragment,{children:[t.jsx(ts,{response:P}),t.jsx(es,{loading:L,features:P==null?void 0:P.features,input:P==null?void 0:P.input})]})}),t.jsx(F,{condition:!P&&!_,show:t.jsx(gt,{})})]})})]})]})})};export{ss as AdvancedPlayground,ss as default};
@@ -1 +1 @@
1
- import{cz as l,b9 as c,j as e,C as d,B as n,Q as a,T as p,w as g,fM as h,l1 as u,s as x,ds as m,dt as j,du as y,l2 as f,l3 as C,l4 as S,l5 as B}from"./index-CoLhlfXP.js";import{u as T,b as w,S as b,T as v,P,n as k,g as D}from"./networkTrafficUsageHighlightPlugin-CqEM-cK_.js";import{a as q}from"./formatTickValue-BcLsqREh.js";import"./LazyAdminExport-ByTh4iFa.js";import"./RoleCell-ZzU5Oqy8.js";import"./useApiTokens-ClWvohC9.js";import"./PercentageDonut-CA9hYg3v.js";const _=x(n)(({theme:s})=>({display:"flex",alignItems:"center",gap:s.spacing(.5)})),F=()=>{l("Network - Backend Connections");const{isOss:s}=c(),{chartDataSelection:t,setChartDataSelection:o,options:i}=T(),{chartData:r}=w(t);return e.jsx(d,{condition:s(),show:e.jsx(a,{severity:"warning",children:"Not enabled."}),elseShow:e.jsx(e.Fragment,{children:e.jsxs(b,{children:[e.jsxs(v,{children:[e.jsx(n,{children:e.jsx(a,{severity:"info",icon:!1,children:e.jsxs(_,{children:[e.jsx(p,{children:"1 connection = 7200 backend SDK requests per day"}),e.jsx(g,{title:"1 connection involves polling every 15 seconds and sending metrics every 60 seconds. This translates to 5 requests per minute, 300 requests per hour, and 7200 requests per day.",children:e.jsx(h,{})})]})})}),e.jsx(P,{selectedPeriod:t,setPeriod:o})]}),e.jsx(u,{data:r,plugins:[k],options:i,"aria-label":D(t)})]})})})};m.register(q,j,y,f,C,S,B);export{F as BackendConnections,F as default};
1
+ import{cz as l,b9 as c,j as e,C as d,B as n,Q as a,T as p,w as g,fM as h,l1 as u,s as x,ds as m,dt as j,du as y,l2 as f,l3 as C,l4 as S,l5 as B}from"./index-C0tV9tYB.js";import{u as T,b as w,S as b,T as v,P,n as k,g as D}from"./networkTrafficUsageHighlightPlugin-D5DxaVbe.js";import{a as q}from"./formatTickValue-CaA_jBqg.js";import"./LazyAdminExport-CEik6N0e.js";import"./RoleCell-CIeC6DEg.js";import"./useApiTokens-DDEZMbRy.js";import"./PercentageDonut-C51wuJjA.js";const _=x(n)(({theme:s})=>({display:"flex",alignItems:"center",gap:s.spacing(.5)})),F=()=>{l("Network - Backend Connections");const{isOss:s}=c(),{chartDataSelection:t,setChartDataSelection:o,options:i}=T(),{chartData:r}=w(t);return e.jsx(d,{condition:s(),show:e.jsx(a,{severity:"warning",children:"Not enabled."}),elseShow:e.jsx(e.Fragment,{children:e.jsxs(b,{children:[e.jsxs(v,{children:[e.jsx(n,{children:e.jsx(a,{severity:"info",icon:!1,children:e.jsxs(_,{children:[e.jsx(p,{children:"1 connection = 7200 backend SDK requests per day"}),e.jsx(g,{title:"1 connection involves polling every 15 seconds and sending metrics every 60 seconds. This translates to 5 requests per minute, 300 requests per hour, and 7200 requests per day.",children:e.jsx(h,{})})]})})}),e.jsx(P,{selectedPeriod:t,setPeriod:o})]}),e.jsx(u,{data:r,plugins:[k],options:i,"aria-label":D(t)})]})})})};m.register(q,j,y,f,C,S,B);export{F as BackendConnections,F as default};
@@ -1 +1 @@
1
- import{j as e,e4 as t}from"./index-CoLhlfXP.js";const a=()=>e.jsx(t,{to:"/projects?create=true",replace:!0});export{a as default};
1
+ import{j as e,e4 as t}from"./index-C0tV9tYB.js";const a=()=>e.jsx(t,{to:"/projects?create=true",replace:!0});export{a as default};
@@ -1,4 +1,4 @@
1
- import{cp as D,b6 as R,r as i,b8 as z,E as U,j as t,F as W,c5 as u,s as d,bp as k,b4 as _,iS as y,w,K as v,cg as P,bm as B,cn as $,cd as F,co as N,b as H,ky as f,lt as V,lu as O,lv as G,T as h,aM as Z,i as q,L as Y,d as J,cz as Q,az as X}from"./index-CoLhlfXP.js";import{u as K}from"./unknownify-B7hmSXnj.js";import{S as ee}from"./LazyAdminExport-ByTh4iFa.js";import"./RoleCell-ZzU5Oqy8.js";import"./useApiTokens-ClWvohC9.js";import"./PercentageDonut-CA9hYg3v.js";const te={connectedEdges:[],revisionIds:[]},ne=e=>{const{data:n,error:r,mutate:o}=D(R("api/admin/metrics/edges"),re,e);return i.useMemo(()=>{const s=!r&&!n;return(n==null?void 0:n.connectedEdges)!==void 0?{edgeObservability:n,loading:s,refetch:()=>o(),error:r}:Array.isArray(n)?{edgeObservability:{connectedEdges:n,revisionIds:[]},loading:s,refetch:()=>o(),error:r}:{edgeObservability:te,loading:s,refetch:()=>o(),error:r}},[n,r,o])},re=e=>fetch(e).then(z("Connected Edges")).then(n=>n.json());var E={},se=W;Object.defineProperty(E,"__esModule",{value:!0});var A=E.default=void 0,oe=se(U()),ie=t,ae=(0,oe.default)((0,ie.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"}),"Circle");A=E.default=ae;const ce=d("table")(({theme:e})=>({width:"100%",borderCollapse:"collapse",fontSize:e.fontSizes.smallerBody,"& > thead":{borderBottom:`1px solid ${e.palette.text.primary}`},"& tr":{textAlign:"right","& > th:first-of-type, td:first-of-type":{textAlign:"left"}}})),S=d("tr")(({theme:e})=>({fontWeight:e.fontWeight.bold,"&&& > td":{paddingTop:e.spacing(1),"& > div":{display:"flex",alignItems:"center"}}})),de=({instance:e})=>t.jsxs(ce,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Latency (ms)"}),t.jsx("th",{children:"Avg"}),t.jsx("th",{children:"p99"})]})}),t.jsxs("tbody",{children:[t.jsx(S,{children:t.jsx("td",{colSpan:3,children:t.jsxs("div",{children:["Upstream"," ",t.jsx(u,{tooltip:"Latency measured for requests sent from this Edge instance to the configured upstream, i.e. Unleash or another Edge instance.",size:"16px"})]})})}),t.jsxs("tr",{children:[t.jsx("td",{children:"Client Features"}),t.jsx("td",{children:e.upstreamFeaturesAverageLatencyMs}),t.jsx("td",{children:e.upstreamFeaturesP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Metrics"}),t.jsx("td",{children:e.upstreamMetricsAverageLatencyMs}),t.jsx("td",{children:e.upstreamMetricsP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Edge"}),t.jsx("td",{children:e.upstreamEdgeAverageLatencyMs}),t.jsx("td",{children:e.upstreamEdgeP99LatencyMs})]}),t.jsx(S,{children:t.jsx("td",{colSpan:3,children:t.jsxs("div",{children:["Downstream"," ",t.jsx(u,{tooltip:"Latency measured when serving requests from clients, i.e. SDKs or other Edge instances.",size:"16px"})]})})}),t.jsxs("tr",{children:[t.jsx("td",{children:"Client Features"}),t.jsx("td",{children:e.clientFeaturesAverageLatencyMs}),t.jsx("td",{children:e.clientFeaturesP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Frontend"}),t.jsx("td",{children:e.frontendApiAverageLatencyMs}),t.jsx("td",{children:e.frontendApiP99LatencyMs})]})]})]}),le=d("table")(({theme:e})=>({width:"100%",borderCollapse:"collapse",fontSize:e.fontSizes.smallerBody,"& > thead":{borderBottom:`1px solid ${e.palette.text.primary}`},"& tr":{textAlign:"right","& > th:first-of-type, td:first-of-type":{textAlign:"left"},paddingTop:e.spacing(1)}})),C=d("td")(({theme:e})=>({paddingTop:e.spacing(1),maxWidth:"80px","& > div":{display:"flex",alignItems:"center",justifyContent:"end"}})),pe=d(v)(({theme:e})=>({padding:e.spacing(0,1)})),he=e=>e.length===1?e[0]:"[]",ge=e=>`${he(e.projects)}:${e.environment}.***`,xe=e=>e.length<=1||e.includes("*")?"":`
1
+ import{cp as D,b6 as R,r as i,b8 as z,E as U,j as t,F as W,c5 as u,s as d,bp as k,b4 as _,iS as y,w,K as v,cg as P,bm as B,cn as $,cd as F,co as N,b as H,ky as f,lt as V,lu as O,lv as G,T as h,aM as Z,i as q,L as Y,d as J,cz as Q,az as X}from"./index-C0tV9tYB.js";import{u as K}from"./unknownify-B7hmSXnj.js";import{S as ee}from"./LazyAdminExport-CEik6N0e.js";import"./RoleCell-CIeC6DEg.js";import"./useApiTokens-DDEZMbRy.js";import"./PercentageDonut-C51wuJjA.js";const te={connectedEdges:[],revisionIds:[]},ne=e=>{const{data:n,error:r,mutate:o}=D(R("api/admin/metrics/edges"),re,e);return i.useMemo(()=>{const s=!r&&!n;return(n==null?void 0:n.connectedEdges)!==void 0?{edgeObservability:n,loading:s,refetch:()=>o(),error:r}:Array.isArray(n)?{edgeObservability:{connectedEdges:n,revisionIds:[]},loading:s,refetch:()=>o(),error:r}:{edgeObservability:te,loading:s,refetch:()=>o(),error:r}},[n,r,o])},re=e=>fetch(e).then(z("Connected Edges")).then(n=>n.json());var E={},se=W;Object.defineProperty(E,"__esModule",{value:!0});var A=E.default=void 0,oe=se(U()),ie=t,ae=(0,oe.default)((0,ie.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2z"}),"Circle");A=E.default=ae;const ce=d("table")(({theme:e})=>({width:"100%",borderCollapse:"collapse",fontSize:e.fontSizes.smallerBody,"& > thead":{borderBottom:`1px solid ${e.palette.text.primary}`},"& tr":{textAlign:"right","& > th:first-of-type, td:first-of-type":{textAlign:"left"}}})),S=d("tr")(({theme:e})=>({fontWeight:e.fontWeight.bold,"&&& > td":{paddingTop:e.spacing(1),"& > div":{display:"flex",alignItems:"center"}}})),de=({instance:e})=>t.jsxs(ce,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Latency (ms)"}),t.jsx("th",{children:"Avg"}),t.jsx("th",{children:"p99"})]})}),t.jsxs("tbody",{children:[t.jsx(S,{children:t.jsx("td",{colSpan:3,children:t.jsxs("div",{children:["Upstream"," ",t.jsx(u,{tooltip:"Latency measured for requests sent from this Edge instance to the configured upstream, i.e. Unleash or another Edge instance.",size:"16px"})]})})}),t.jsxs("tr",{children:[t.jsx("td",{children:"Client Features"}),t.jsx("td",{children:e.upstreamFeaturesAverageLatencyMs}),t.jsx("td",{children:e.upstreamFeaturesP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Metrics"}),t.jsx("td",{children:e.upstreamMetricsAverageLatencyMs}),t.jsx("td",{children:e.upstreamMetricsP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Edge"}),t.jsx("td",{children:e.upstreamEdgeAverageLatencyMs}),t.jsx("td",{children:e.upstreamEdgeP99LatencyMs})]}),t.jsx(S,{children:t.jsx("td",{colSpan:3,children:t.jsxs("div",{children:["Downstream"," ",t.jsx(u,{tooltip:"Latency measured when serving requests from clients, i.e. SDKs or other Edge instances.",size:"16px"})]})})}),t.jsxs("tr",{children:[t.jsx("td",{children:"Client Features"}),t.jsx("td",{children:e.clientFeaturesAverageLatencyMs}),t.jsx("td",{children:e.clientFeaturesP99LatencyMs})]}),t.jsxs("tr",{children:[t.jsx("td",{children:"Frontend"}),t.jsx("td",{children:e.frontendApiAverageLatencyMs}),t.jsx("td",{children:e.frontendApiP99LatencyMs})]})]})]}),le=d("table")(({theme:e})=>({width:"100%",borderCollapse:"collapse",fontSize:e.fontSizes.smallerBody,"& > thead":{borderBottom:`1px solid ${e.palette.text.primary}`},"& tr":{textAlign:"right","& > th:first-of-type, td:first-of-type":{textAlign:"left"},paddingTop:e.spacing(1)}})),C=d("td")(({theme:e})=>({paddingTop:e.spacing(1),maxWidth:"80px","& > div":{display:"flex",alignItems:"center",justifyContent:"end"}})),pe=d(v)(({theme:e})=>({padding:e.spacing(0,1)})),he=e=>e.length===1?e[0]:"[]",ge=e=>`${he(e.projects)}:${e.environment}.***`,xe=e=>e.length<=1||e.includes("*")?"":`
2
2
  Projects: ${e.join(", ")}
3
3
  `,ue=e=>`[${e.projects.join(",")}]:${e.environment}`,me=(e,n)=>{const r=new Set(e||[]),o=new Set(n);if(r.size!==o.size)return!1;for(const s of r)if(!o.has(s))return!1;return!0},je=(e,n)=>(e||[]).every(o=>n.has(o)),fe=e=>{var n;return((n=e.find(r=>!r.projects||r.projects.length===0))==null?void 0:n.revisionId)??0},ye=(e,n)=>{if(e.length===0)return;if(n.projects.includes("*"))return Math.max(...e.map(a=>a.revisionId));const r=e.find(a=>me(a.projects,n.projects));if(r)return r.revisionId;const o=new Set(n.projects),s=e.filter(a=>je(a.projects,o));if(s.length!==0)return Math.max(...s.map(a=>a.revisionId))},ve=(e,n)=>{const r=e.filter(c=>c.environment===n.environment),o=fe(r),s=r.filter(c=>!!(c.projects&&c.projects.length>0)),a=ye(s,n);return Math.max(a??0,o)},Ee=e=>e<=0?"success":e<5?"warning":"error",Se=({edgeRevisionId:e,upstreamRevisionId:n})=>{const r=n-e,s=r<=0?"Edge feature configuration is up to date":`Edge is ${r} revisions behind expected upstream revision for this token`;return t.jsx(w,{title:s,children:t.jsx(pe,{color:Ee(r),children:e})})},Ce=({apiKeys:e,revisionIds:n})=>{const{locationSettings:r}=k();return!e||e.length===0?null:t.jsxs(le,{children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Token"}),t.jsx("th",{children:"Revision"})]})}),t.jsx("tbody",{children:e==null?void 0:e.map(o=>{const s=ge(o);return t.jsxs("tr",{children:[t.jsx(C,{children:t.jsx(_,{title:s,children:s})}),t.jsx(C,{children:t.jsxs("div",{children:[t.jsx(Se,{edgeRevisionId:o.revisionId,upstreamRevisionId:ve(n,o)}),t.jsx(u,{tooltip:`
4
4
  Edge last updated this token: ${y(o.lastUpdated,r.locale)}
@@ -1,2 +1,2 @@
1
- import{bs as f,k$ as c,dc as y,lg as p,b as g,bp as m,r as d,j as u,l1 as C,ds as M,dt as v,du as h,l2 as k,lk as $,l5 as E,l4 as S,l3 as j}from"./index-CoLhlfXP.js";import{d as D}from"./FeatureViewLazyExport-BkNTNFqK.js";import"./MarkCompletedDialogue-apmlFjVY.js";import"./aggregateFeatureMetrics-D6bHft_C.js";import"./FeatureStaleDialog-B6BfnDiQ.js";import"./PercentageDonut-CA9hYg3v.js";import"./GridLayoutWrapper-Cq6Bzm36.js";const T=(e,s,o)=>{const a={label:"Exposed",borderColor:e.palette.charts.flagMetrics.exposed,backgroundColor:e.palette.charts.flagMetrics.exposed,data:x(s,o,r=>r.yes)},t={label:"Not exposed",borderColor:e.palette.charts.flagMetrics.notExposed,backgroundColor:e.palette.charts.flagMetrics.notExposed,data:x(s,o,r=>r.no)};return{datasets:[a,t]}},x=(e,s,o)=>e.map(a=>({x:a.timestamp,y:o(a),variants:a.variants||{}})),_=(e,s)=>{if(s===0)return"";const[o,a]=e,t=Math.floor(Number(a)/s*100);return`${a} (${t}%) - ${o}`},q=(e,s,o,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,position:"nearest",itemSort:(t,r)=>{const l=["Exposed","Not exposed"],n=l.indexOf(t.dataset.label),i=l.indexOf(r.dataset.label);return n-i},callbacks:{beforeBody:t=>`${t.reduce((l,n)=>l+n.parsed.y,0).toLocaleString(a.locale)} - Total requests`,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:l,...n}=r.variants;return Object.entries(n).map(i=>_(i,r.y)).join(`
1
+ import{bs as f,k$ as c,dc as y,lg as p,b as g,bp as m,r as d,j as u,l1 as C,ds as M,dt as v,du as h,l2 as k,lk as $,l5 as E,l4 as S,l3 as j}from"./index-C0tV9tYB.js";import{d as D}from"./FeatureViewLazyExport-CVIpdGgg.js";import"./MarkCompletedDialogue-BFMzJ-VW.js";import"./aggregateFeatureMetrics-B-7cFh4G.js";import"./FeatureStaleDialog-DFGtgX-I.js";import"./PercentageDonut-C51wuJjA.js";import"./GridLayoutWrapper-mu3C2OC4.js";const T=(e,s,o)=>{const a={label:"Exposed",borderColor:e.palette.charts.flagMetrics.exposed,backgroundColor:e.palette.charts.flagMetrics.exposed,data:x(s,o,r=>r.yes)},t={label:"Not exposed",borderColor:e.palette.charts.flagMetrics.notExposed,backgroundColor:e.palette.charts.flagMetrics.notExposed,data:x(s,o,r=>r.no)};return{datasets:[a,t]}},x=(e,s,o)=>e.map(a=>({x:a.timestamp,y:o(a),variants:a.variants||{}})),_=(e,s)=>{if(s===0)return"";const[o,a]=e,t=Math.floor(Number(a)/s*100);return`${a} (${t}%) - ${o}`},q=(e,s,o,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,position:"nearest",itemSort:(t,r)=>{const l=["Exposed","Not exposed"],n=l.indexOf(t.dataset.label),i=l.indexOf(r.dataset.label);return n-i},callbacks:{beforeBody:t=>`${t.reduce((l,n)=>l+n.parsed.y,0).toLocaleString(a.locale)} - Total requests`,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:l,...n}=r.variants;return Object.entries(n).map(i=>_(i,r.y)).join(`
2
2
  `)},title:t=>`Time: ${o>48?y(t[0].parsed.x,a.locale,"UTC"):c(t[0].parsed.x,a.locale)}`}},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:L(o),position:"top",align:"start",display:!0,font:{size:16,weight:"400"},color:e.palette.text.primary}},scales:{y:{type:"linear",stacked:!0,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",stacked:!0,time:{unit:o>48?"day":"hour"},grid:{display:!1},ticks:{callback:(t,r,l)=>o>48?f(l[r].value,a.locale,"UTC"):c(l[r].value,a.locale),color:e.palette.text.secondary}}}}),L=e=>e===1?"Requests in the last hour":`Requests in the last ${D(e)}`;p.font={...p.font,family:"Sen",size:13,weight:"400"};const V=({metrics:e,hoursBack:s,statsSectionId:o})=>{const a=g(),{locationSettings:t}=m(),r=d.useMemo(()=>[...e].sort((i,b)=>i.timestamp.localeCompare(b.timestamp)),[e]),l=d.useMemo(()=>q(a,r,s,t),[a,r,s,t]),n=d.useMemo(()=>T(a,r,t),[a,r,t]);return u.jsx("div",{style:{height:400},children:u.jsx(C,{data:n,options:l,"aria-label":"A stacked bar chart showing feature flag exposure metrics: exposed and not exposed requests.","aria-describedby":o})})};M.register(v,h,k,$,E,S,j);export{V as FeatureMetricsChart,V as default};
@@ -1,4 +1,4 @@
1
- import{E as Z,j as n,F as ee,A as ve,l as Se,C as ne,m as Fe,n as Ne,bf as Le,kp as $e,o as Ye,b as L,T as y,s as h,u as je,b7 as ze,r as x,b6 as te,b8 as ae,ba as Be,c0 as $,aN as _e,by as He,hQ as Ge,bA as qe,f as P,bB as We,b9 as se,bq as Me,ao as Ue,kq as Ve,bG as Je,kr as Qe,b5 as M,ks as Xe,jB as Ze,jr as en,i as E,h as T,kt as nn,cp as Ce,aQ as tn,aR as an,aO as sn,aU as Ae,be as de,bc as ke,ku as on,kv as rn,kw as ln,jp as cn,kx as dn,B as _,an as un,cq as pn,fV as hn,hh as gn,K as Y,ia as mn,cN as Ie,ai as Re,ky as I,kz as fn,kA as bn,kB as xn,kC as yn,kD as vn,kE as Sn,kF as jn,kG as _n,kH as Un,kI as Cn,kJ as An,kK as kn,kL as In,kM as Rn,kN as En,fA as V,cL as J,it as z,cy as Tn,ie as wn,aM as N,d as Pn,x as Dn,hL as On,w as Kn,d3 as Fn,i_ as Q,aB as Nn,c8 as Ln}from"./index-CoLhlfXP.js";var oe={},$n=ee;Object.defineProperty(oe,"__esModule",{value:!0});var Ee=oe.default=void 0,Yn=$n(Z()),zn=n,Bn=(0,Yn.default)((0,zn.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");Ee=oe.default=Bn;const Hn=$e(),ja=({options:e,selectedOptions:t,indeterminateOptions:a,tagType:s,existingTags:o,disabled:r=!1,onChange:l})=>{const i=n.jsx(Ye,{fontSize:"small"}),d=u=>u.inputValue?u.inputValue:u.title,m=({key:u,...g},c,{selected:f})=>{const j=(a==null?void 0:a.some(v=>v.title===c.title))??!1;return n.jsxs("li",{...g,children:[n.jsx(ne,{condition:!!c.inputValue,show:n.jsx(Le,{sx:{mr:v=>v.spacing(.5)}}),elseShow:n.jsx(Fe,{icon:i,checkedIcon:n.jsx(Ne,{fontSize:"small"}),indeterminateIcon:n.jsx(Ee,{fontSize:"small"}),sx:{mr:v=>v.spacing(.5)},checked:f&&!j,indeterminate:j})}),c.title]},u)},b=(u,g)=>{const c=g.inputValue.trim(),f=Hn(u,{...g,inputValue:c}),j=u.some(v=>c===v.title);return c.length>=2&&!j&&f.push({inputValue:c,title:`Create new value "${c}"`}),f};return n.jsx(ve,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:u=>u.spacing(2),width:500},disableCloseOnSelect:!0,options:e,value:t,isOptionEqualToValue:(u,g)=>g.inputValue&&g.inputValue!==""?u.title===g.inputValue:u.title===g.title,getOptionLabel:d,renderOption:m,filterOptions:b,ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:l,renderInput:u=>n.jsx(Se,{...u,label:"Select values",placeholder:"Select values"}),disabled:r})},Gn=h("li")({flexDirection:"column"}),_a=({options:e,value:t,disabled:a=!1,onChange:s})=>{const o=L();return n.jsx(ve,{disablePortal:!0,disabled:a,id:"tag-type-select",sx:{marginTop:r=>r.spacing(2),width:500},options:e,disableClearable:!0,value:t,getOptionLabel:r=>r.name,renderOption:({key:r,...l},i)=>n.jsxs(Gn,{...l,style:{alignItems:"flex-start",gap:o.spacing(.5)},children:[n.jsx(y,{variant:"body1",children:i.name}),n.jsx(y,{variant:"caption",children:i.description})]},r),renderInput:r=>n.jsx(Se,{...r,label:"Tag type",value:t}),onChange:s,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},Ua=()=>{const{makeRequest:e,createRequest:t,errors:a,loading:s}=je({propagateErrors:!0});return{createTag:async l=>{const d=t("api/admin/tags",{method:"POST",body:JSON.stringify(l)});return e(d.caller,d.id)},bulkUpdateTags:async(l,i)=>{const d=`api/admin/projects/${i}/tags`,m=t(d,{method:"PUT",body:JSON.stringify(l)});return e(m.caller,m.id)},errors:a,loading:s}},Ca=(e,t={})=>{const a=async()=>{const m=te(`api/admin/tags/${e}`);return(await fetch(m,{method:"GET"}).then(ae("Tags"))).json()},s=`api/admin/tags/${e}`,{data:o,error:r}=ze(!!e,{tags:[]},s,a,t),[l,i]=x.useState(!r&&!o),d=()=>{Be(s)};return x.useEffect(()=>{i(!r&&!o)},[o,r]),{tags:(o==null?void 0:o.tags)||[],error:r,loading:l,refetch:d}},qn=(e,t)=>{var l,i;const{project:a,refetch:s}=$(e),o={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:a.defaultStickiness||"default",groupId:""}},r=(i=(l=a.environments)==null?void 0:l.find(d=>d.environment===t))==null?void 0:i.defaultStrategy;return{defaultStrategyFallback:o,strategy:r,refetch:s}},Aa=()=>{const e=_e("projectId"),t=He("environmentId"),{refetch:a}=$(e),{defaultStrategyFallback:s,strategy:o,refetch:r}=qn(e,t),[l,i]=x.useState(o||s),{updateDefaultStrategy:d,loading:m}=Ge(),{strategyDefinition:b}=qe(l.name),{setToastData:u,setToastApiError:g}=P(),c=We(),{uiConfig:f}=se(),{unleashUrl:j}=f,v=Me(),{trackEvent:R}=Ue(),k=Ve(l.constraints);if(!b)return null;const C=Wn(l),p=async()=>{const D=`/projects/${e}/settings/default-strategy`;try{await d(e,t,C),R("default_strategy",{props:{action:"edit",hasTitle:!!C.title}}),a(),u({text:"Default Strategy updated",type:"success"}),await r(),v(D)}catch(ce){g(T(ce))}};return n.jsx(Je,{modal:!0,disablePadding:!0,description:Vn,documentationLink:Jn,documentationLinkLabel:Qn,formatApiCode:()=>Mn(e,t,C,b,j),children:n.jsxs(Qe,{strategy:l,setStrategy:i,strategyDefinition:b,errors:c,groupIdTooltip:"Defaults to the feature flag name if not set.",onSubmit:p,children:[n.jsx(M,{permission:[Ze,en],projectId:e,environmentId:t,variant:"contained",color:"primary",type:"submit",disabled:m||!k||c.hasFormErrors(),"data-testid":Xe,children:"Save strategy"}),n.jsx(E,{type:"button",onClick:()=>v(`/projects/${e}/settings/default-strategy`),children:"Cancel"})]})})},Wn=e=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:Object.fromEntries(Object.entries(e.parameters??{}).filter(([,t])=>t!==void 0).map(([t,a])=>[t,String(a)])),variants:e.variants??[],segments:e.segments??[],disabled:e.disabled??!1}),Mn=(e,t,a,s,o)=>{if(!o)return"";const r={...a,parameters:nn(a.parameters??{},s)},l=`${o}/api/admin/projects/${e}/environments/${t}/default-strategy`,i=JSON.stringify(r,void 0,2);return`curl --location --request POST '${l}' \\
1
+ import{E as Z,j as n,F as ee,A as ve,l as Se,C as ne,m as Fe,n as Ne,bf as Le,kp as $e,o as Ye,b as L,T as y,s as h,u as je,b7 as ze,r as x,b6 as te,b8 as ae,ba as Be,c0 as $,aN as _e,by as He,hQ as Ge,bA as qe,f as P,bB as We,b9 as se,bq as Me,ao as Ue,kq as Ve,bG as Je,kr as Qe,b5 as M,ks as Xe,jB as Ze,jr as en,i as E,h as T,kt as nn,cp as Ce,aQ as tn,aR as an,aO as sn,aU as Ae,be as de,bc as ke,ku as on,kv as rn,kw as ln,jp as cn,kx as dn,B as _,an as un,cq as pn,fV as hn,hh as gn,K as Y,ia as mn,cN as Ie,ai as Re,ky as I,kz as fn,kA as bn,kB as xn,kC as yn,kD as vn,kE as Sn,kF as jn,kG as _n,kH as Un,kI as Cn,kJ as An,kK as kn,kL as In,kM as Rn,kN as En,fA as V,cL as J,it as z,cy as Tn,ie as wn,aM as N,d as Pn,x as Dn,hL as On,w as Kn,d3 as Fn,i_ as Q,aB as Nn,c8 as Ln}from"./index-C0tV9tYB.js";var oe={},$n=ee;Object.defineProperty(oe,"__esModule",{value:!0});var Ee=oe.default=void 0,Yn=$n(Z()),zn=n,Bn=(0,Yn.default)((0,zn.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");Ee=oe.default=Bn;const Hn=$e(),ja=({options:e,selectedOptions:t,indeterminateOptions:a,tagType:s,existingTags:o,disabled:r=!1,onChange:l})=>{const i=n.jsx(Ye,{fontSize:"small"}),d=u=>u.inputValue?u.inputValue:u.title,m=({key:u,...g},c,{selected:f})=>{const j=(a==null?void 0:a.some(v=>v.title===c.title))??!1;return n.jsxs("li",{...g,children:[n.jsx(ne,{condition:!!c.inputValue,show:n.jsx(Le,{sx:{mr:v=>v.spacing(.5)}}),elseShow:n.jsx(Fe,{icon:i,checkedIcon:n.jsx(Ne,{fontSize:"small"}),indeterminateIcon:n.jsx(Ee,{fontSize:"small"}),sx:{mr:v=>v.spacing(.5)},checked:f&&!j,indeterminate:j})}),c.title]},u)},b=(u,g)=>{const c=g.inputValue.trim(),f=Hn(u,{...g,inputValue:c}),j=u.some(v=>c===v.title);return c.length>=2&&!j&&f.push({inputValue:c,title:`Create new value "${c}"`}),f};return n.jsx(ve,{multiple:!0,id:"checkboxes-tag",sx:{marginTop:u=>u.spacing(2),width:500},disableCloseOnSelect:!0,options:e,value:t,isOptionEqualToValue:(u,g)=>g.inputValue&&g.inputValue!==""?u.title===g.inputValue:u.title===g.title,getOptionLabel:d,renderOption:m,filterOptions:b,ListboxProps:{style:{maxHeight:200,overflow:"auto"}},onChange:l,renderInput:u=>n.jsx(Se,{...u,label:"Select values",placeholder:"Select values"}),disabled:r})},Gn=h("li")({flexDirection:"column"}),_a=({options:e,value:t,disabled:a=!1,onChange:s})=>{const o=L();return n.jsx(ve,{disablePortal:!0,disabled:a,id:"tag-type-select",sx:{marginTop:r=>r.spacing(2),width:500},options:e,disableClearable:!0,value:t,getOptionLabel:r=>r.name,renderOption:({key:r,...l},i)=>n.jsxs(Gn,{...l,style:{alignItems:"flex-start",gap:o.spacing(.5)},children:[n.jsx(y,{variant:"body1",children:i.name}),n.jsx(y,{variant:"caption",children:i.description})]},r),renderInput:r=>n.jsx(Se,{...r,label:"Tag type",value:t}),onChange:s,ListboxProps:{style:{maxHeight:200,overflow:"auto"}}})},Ua=()=>{const{makeRequest:e,createRequest:t,errors:a,loading:s}=je({propagateErrors:!0});return{createTag:async l=>{const d=t("api/admin/tags",{method:"POST",body:JSON.stringify(l)});return e(d.caller,d.id)},bulkUpdateTags:async(l,i)=>{const d=`api/admin/projects/${i}/tags`,m=t(d,{method:"PUT",body:JSON.stringify(l)});return e(m.caller,m.id)},errors:a,loading:s}},Ca=(e,t={})=>{const a=async()=>{const m=te(`api/admin/tags/${e}`);return(await fetch(m,{method:"GET"}).then(ae("Tags"))).json()},s=`api/admin/tags/${e}`,{data:o,error:r}=ze(!!e,{tags:[]},s,a,t),[l,i]=x.useState(!r&&!o),d=()=>{Be(s)};return x.useEffect(()=>{i(!r&&!o)},[o,r]),{tags:(o==null?void 0:o.tags)||[],error:r,loading:l,refetch:d}},qn=(e,t)=>{var l,i;const{project:a,refetch:s}=$(e),o={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:a.defaultStickiness||"default",groupId:""}},r=(i=(l=a.environments)==null?void 0:l.find(d=>d.environment===t))==null?void 0:i.defaultStrategy;return{defaultStrategyFallback:o,strategy:r,refetch:s}},Aa=()=>{const e=_e("projectId"),t=He("environmentId"),{refetch:a}=$(e),{defaultStrategyFallback:s,strategy:o,refetch:r}=qn(e,t),[l,i]=x.useState(o||s),{updateDefaultStrategy:d,loading:m}=Ge(),{strategyDefinition:b}=qe(l.name),{setToastData:u,setToastApiError:g}=P(),c=We(),{uiConfig:f}=se(),{unleashUrl:j}=f,v=Me(),{trackEvent:R}=Ue(),k=Ve(l.constraints);if(!b)return null;const C=Wn(l),p=async()=>{const D=`/projects/${e}/settings/default-strategy`;try{await d(e,t,C),R("default_strategy",{props:{action:"edit",hasTitle:!!C.title}}),a(),u({text:"Default Strategy updated",type:"success"}),await r(),v(D)}catch(ce){g(T(ce))}};return n.jsx(Je,{modal:!0,disablePadding:!0,description:Vn,documentationLink:Jn,documentationLinkLabel:Qn,formatApiCode:()=>Mn(e,t,C,b,j),children:n.jsxs(Qe,{strategy:l,setStrategy:i,strategyDefinition:b,errors:c,groupIdTooltip:"Defaults to the feature flag name if not set.",onSubmit:p,children:[n.jsx(M,{permission:[Ze,en],projectId:e,environmentId:t,variant:"contained",color:"primary",type:"submit",disabled:m||!k||c.hasFormErrors(),"data-testid":Xe,children:"Save strategy"}),n.jsx(E,{type:"button",onClick:()=>v(`/projects/${e}/settings/default-strategy`),children:"Cancel"})]})})},Wn=e=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:Object.fromEntries(Object.entries(e.parameters??{}).filter(([,t])=>t!==void 0).map(([t,a])=>[t,String(a)])),variants:e.variants??[],segments:e.segments??[],disabled:e.disabled??!1}),Mn=(e,t,a,s,o)=>{if(!o)return"";const r={...a,parameters:nn(a.parameters??{},s)},l=`${o}/api/admin/projects/${e}/environments/${t}/default-strategy`,i=JSON.stringify(r,void 0,2);return`curl --location --request POST '${l}' \\
2
2
  --header 'Authorization: INSERT_API_KEY' \\
3
3
  --header 'Content-Type: application/json' \\
4
4
  --data-raw '${i}'`},Vn=`