unleash-server 5.6.2 → 5.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 (24) hide show
  1. package/frontend/build/index.html +1 -1
  2. package/frontend/build/static/{AdvancedPlayground-b7bccfbe.js → AdvancedPlayground-16873e2b.js} +1 -1
  3. package/frontend/build/static/{CreateProject-556f9c57.js → CreateProject-301a70d0.js} +1 -1
  4. package/frontend/build/static/{Error-db0d1d33.js → Error-e318eb3d.js} +1 -1
  5. package/frontend/build/static/{FeatureArchiveDialog-9165a49c.js → FeatureArchiveDialog-37e2bf5f.js} +1 -1
  6. package/frontend/build/static/{FeatureMetricsChart-c575d046.js → FeatureMetricsChart-99739e53.js} +1 -1
  7. package/frontend/build/static/{FeatureViewLazyExport-e2d57dd1.js → FeatureViewLazyExport-b7e0c05f.js} +2 -2
  8. package/frontend/build/static/{LazyAdminExport-d83c093e.js → LazyAdminExport-cefc037c.js} +2 -2
  9. package/frontend/build/static/{LazyProjectExport-9d441d13.js → LazyProjectExport-d124dbbf.js} +1 -1
  10. package/frontend/build/static/{NetworkOverview-0d48bf0d.js → NetworkOverview-9d3e2075.js} +2 -2
  11. package/frontend/build/static/{NetworkTraffic-0aa8a7ac.js → NetworkTraffic-48e5c2df.js} +1 -1
  12. package/frontend/build/static/{ReactJSONEditor-693b261e.js → ReactJSONEditor-8c920758.js} +1 -1
  13. package/frontend/build/static/{RoleCell-900af983.js → RoleCell-8209535b.js} +1 -1
  14. package/frontend/build/static/{StrategyItemContainer-ec516690.js → StrategyItemContainer-bb9f1a81.js} +1 -1
  15. package/frontend/build/static/{chartjs-adapter-date-fns.esm-9887b8bf.js → chartjs-adapter-date-fns.esm-76abe251.js} +1 -1
  16. package/frontend/build/static/{flowchart-elk-definition-170a3958-44f11932.js → flowchart-elk-definition-170a3958-1cbddeed.js} +1 -1
  17. package/frontend/build/static/{index-97019f83.js → index-f848dd08.js} +4 -4
  18. package/frontend/build/static/{is_dark-bae6928c.js → is_dark-d8173a33.js} +1 -1
  19. package/frontend/build/static/{mindmap-definition-44684416-9154286a.js → mindmap-definition-44684416-2e94ada0.js} +1 -1
  20. package/frontend/build/static/{timeline-definition-8e5a9bc6-6cd8c6b1.js → timeline-definition-8e5a9bc6-f407e743.js} +1 -1
  21. package/frontend/build/static/{unknownify-470ee1ff.js → unknownify-5a51f235.js} +1 -1
  22. package/frontend/build/static/{useApiTokens-9215ec27.js → useApiTokens-0654f105.js} +1 -1
  23. package/frontend/build/static/{useProjectForm-5dd2ec50.js → useProjectForm-b9260dd5.js} +1 -1
  24. package/package.json +1 -1
@@ -20,7 +20,7 @@
20
20
  rel="stylesheet"
21
21
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0"
22
22
  />
23
- <script type="module" crossorigin src="/static/index-97019f83.js"></script>
23
+ <script type="module" crossorigin src="/static/index-f848dd08.js"></script>
24
24
  <link rel="stylesheet" href="/static/style-97d3ef98.css">
25
25
  </head>
26
26
  <body>
@@ -1,4 +1,4 @@
1
- import{c as Ki,j as p,u as pf,r as E,_ as mf,a as to,s as H,U as gf,b as me,d as M,B as K,C as V,e as yf,f as Ya,g as bf,h as Oi,T as se,F as xf,I as wf,S as vf,M as kf,i as io,p as jo,k as qo,l as Di,A as or,m as Sf,n as Cf,o as Af,q as Mf,t as no,v as Of,w as Uo,x as Df,y as Tf,z as $t,D as Pf,P as Rf,E as Xa,G as Bf,H as Zt,J as Se,K as Ef,L as Ei,N as Et,O as Za,Q as so,R as eh,V as Lf,W as lr,X as Sn,Y as ar,Z as If,$ as Nf,a0 as Ff,a1 as th,a2 as ro,a3 as fs,a4 as Wf,a5 as Oe,a6 as ds,a7 as Vf,a8 as Hf,a9 as zf,aa as $f,ab as jf,ac as qf,ad as Go,ae as ih,af as oo,ag as lo,ah as nh,ai as ao,aj as sh,ak as rh,al as oh,am as lh,an as Uf,ao as Ko,ap as Gf,aq as Kf,ar as Ps,as as Qf,at as Jf,au as _f,av as Yf,aw as Xf,ax as Zf}from"./index-97019f83.js";import{E as ed}from"./Error-db0d1d33.js";import{u as td}from"./useApiTokens-9215ec27.js";import{S as id}from"./StrategyItemContainer-ec516690.js";const ps=Ki(p("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined"),nd=Ki(p("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"CheckCircleOutline"),sd=Ki(p("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"),rd=Ki(p("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"),od=Ki(p("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"WarningOutlined"),ld=()=>{const{makeRequest:n,createRequest:e,errors:t,loading:i}=pf({propagateErrors:!0}),s="api/admin/playground";return{evaluateAdvancedPlayground:async o=>{const l=`${s}/advanced`,a=e(l,{method:"POST",body:JSON.stringify(o)});return(await n(a.caller,a.id)).json()},errors:t,loading:i}};function hr(n,e,t){var i,s,r,o,l;e==null&&(e=100);function a(){var c=Date.now()-o;c<e&&c>=0?i=setTimeout(a,e-c):(i=null,t||(l=n.apply(r,s),r=s=null))}var h=function(){r=this,s=arguments,o=Date.now();var c=t&&!i;return i||(i=setTimeout(a,e)),c&&(l=n.apply(r,s),r=s=null),l};return h.clear=function(){i&&(clearTimeout(i),i=null)},h.flush=function(){i&&(l=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},h}hr.debounce=hr;var ad=hr;class _{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),tt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),tt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Ti(this),r=new Ti(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Ti(this,e)}iterRange(e,t=this.length){return new ah(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new hh(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?_.empty:e.length<=32?new he(e):tt.from(he.split(e,[]))}}class he extends _{constructor(e,t=hd(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new cd(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new he(Qo(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Cn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new he(l,o.length+r.length));else{let a=l.length>>1;i.push(new he(l.slice(0,a)),new he(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof he))return super.replace(e,t,i);let s=Cn(this.text,Cn(i.text,Qo(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new he(s,r):tt.from(he.split(s,[]),r)}sliceString(e,t=this.length,i=`
1
+ import{c as Ki,j as p,u as pf,r as E,_ as mf,a as to,s as H,U as gf,b as me,d as M,B as K,C as V,e as yf,f as Ya,g as bf,h as Oi,T as se,F as xf,I as wf,S as vf,M as kf,i as io,p as jo,k as qo,l as Di,A as or,m as Sf,n as Cf,o as Af,q as Mf,t as no,v as Of,w as Uo,x as Df,y as Tf,z as $t,D as Pf,P as Rf,E as Xa,G as Bf,H as Zt,J as Se,K as Ef,L as Ei,N as Et,O as Za,Q as so,R as eh,V as Lf,W as lr,X as Sn,Y as ar,Z as If,$ as Nf,a0 as Ff,a1 as th,a2 as ro,a3 as fs,a4 as Wf,a5 as Oe,a6 as ds,a7 as Vf,a8 as Hf,a9 as zf,aa as $f,ab as jf,ac as qf,ad as Go,ae as ih,af as oo,ag as lo,ah as nh,ai as ao,aj as sh,ak as rh,al as oh,am as lh,an as Uf,ao as Ko,ap as Gf,aq as Kf,ar as Ps,as as Qf,at as Jf,au as _f,av as Yf,aw as Xf,ax as Zf}from"./index-f848dd08.js";import{E as ed}from"./Error-e318eb3d.js";import{u as td}from"./useApiTokens-0654f105.js";import{S as id}from"./StrategyItemContainer-bb9f1a81.js";const ps=Ki(p("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined"),nd=Ki(p("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"CheckCircleOutline"),sd=Ki(p("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"),rd=Ki(p("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"),od=Ki(p("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"WarningOutlined"),ld=()=>{const{makeRequest:n,createRequest:e,errors:t,loading:i}=pf({propagateErrors:!0}),s="api/admin/playground";return{evaluateAdvancedPlayground:async o=>{const l=`${s}/advanced`,a=e(l,{method:"POST",body:JSON.stringify(o)});return(await n(a.caller,a.id)).json()},errors:t,loading:i}};function hr(n,e,t){var i,s,r,o,l;e==null&&(e=100);function a(){var c=Date.now()-o;c<e&&c>=0?i=setTimeout(a,e-c):(i=null,t||(l=n.apply(r,s),r=s=null))}var h=function(){r=this,s=arguments,o=Date.now();var c=t&&!i;return i||(i=setTimeout(a,e)),c&&(l=n.apply(r,s),r=s=null),l};return h.clear=function(){i&&(clearTimeout(i),i=null)},h.flush=function(){i&&(l=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},h}hr.debounce=hr;var ad=hr;class _{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),tt.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),tt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Ti(this),r=new Ti(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Ti(this,e)}iterRange(e,t=this.length){return new ah(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new hh(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?_.empty:e.length<=32?new he(e):tt.from(he.split(e,[]))}}class he extends _{constructor(e,t=hd(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new cd(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new he(Qo(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Cn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new he(l,o.length+r.length));else{let a=l.length>>1;i.push(new he(l.slice(0,a)),new he(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof he))return super.replace(e,t,i);let s=Cn(this.text,Cn(i.text,Qo(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new he(s,r):tt.from(he.split(s,[]),r)}sliceString(e,t=this.length,i=`
2
2
  `){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new he(i,s)),i=[],s=-1);return s>-1&&t.push(new he(i,s)),t}}class tt extends _{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new tt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
3
3
  `){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof tt))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let m of e)m.flatten(d);return new he(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function u(d){let m;if(d.lines>r&&d instanceof tt)for(let b of d.children)u(b);else d.lines>o&&(a>o||!a)?(f(),l.push(d)):d instanceof he&&a&&(m=c[c.length-1])instanceof he&&d.lines+m.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new he(m.text.concat(d.text),m.length+1+d.length)):(a+d.lines>s&&f(),a+=d.lines,h+=d.length+1,c.push(d))}function f(){a!=0&&(l.push(c.length==1?c[0]:tt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)u(d);return f(),l.length==1?l[0]:new tt(l,t)}}_.empty=new he([""],0);function hd(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Cn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function Qo(n,e,t){return Cn(n,[""],e,t)}class Ti{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof he?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof he?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
4
4
  `,this;e--}else if(s instanceof he){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof he?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ah{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Ti(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class hh{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(_.prototype[Symbol.iterator]=function(){return this.iter()},Ti.prototype[Symbol.iterator]=ah.prototype[Symbol.iterator]=hh.prototype[Symbol.iterator]=function(){return this});class cd{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let ei="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<ei.length;n++)ei[n]+=ei[n-1];function ud(n){for(let e=1;e<ei.length;e+=2)if(ei[e]>n)return ei[e-1]<=n;return!1}function Jo(n){return n>=127462&&n<=127487}const _o=8205;function De(n,e,t=!0,i=!0){return(t?ch:fd)(n,e,i)}function ch(n,e,t){if(e==n.length)return e;e&&uh(n.charCodeAt(e))&&fh(n.charCodeAt(e-1))&&e--;let i=ye(n,e);for(e+=Fe(i);e<n.length;){let s=ye(n,e);if(i==_o||s==_o||t&&ud(s))e+=Fe(s),i=s;else if(Jo(s)){let r=0,o=e-2;for(;o>=0&&Jo(ye(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function fd(n,e,t){for(;e>0;){let i=ch(n,e-2,t);if(i<e)return i;e--}return 0}function uh(n){return n>=56320&&n<57344}function fh(n){return n>=55296&&n<56320}function ye(n,e){let t=n.charCodeAt(e);if(!fh(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return uh(i)?(t-55296<<10)+(i-56320)+65536:t}function ho(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Fe(n){return n<65536?1:2}const cr=/\r\n?|\n/;var Me=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(Me||(Me={}));class st{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){ur(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new st(e)}composeDesc(e){return this.empty?e:e.empty?this:dh(this,e)}mapDesc(e,t=!1){return e.empty?this:fr(this,e,t)}mapPos(e,t=-1,i=Me.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=Me.Simple&&h>=e&&(i==Me.TrackDel&&s<e&&h>e||i==Me.TrackBefore&&s<e||i==Me.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new st(e)}static create(e){return new st(e)}}class fe extends st{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ur(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return fr(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(_.empty);i.push(o?e.slice(r,r+o):_.empty)}r+=o}return new fe(t,i)}compose(e){return this.empty?e:e.empty?this:dh(this,e,!0)}map(e,t=!1){return e.empty?this:fr(this,e,t,!0)}iterChanges(e,t=!1){ur(this,e,t)}get desc(){return st.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new Li(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let c=Math.min(r.len,a-l);ve(s,c,-1);let u=r.ins==-1?-1:r.off==0?r.ins:0;ve(t,c,u),u>0&&vt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l<h;){if(r.done)break e;let c=Math.min(r.len,h-l);ve(t,c,-1),ve(s,c,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(c),l+=c}}return{changes:new fe(t,i),filtered:st.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;o<t&&ve(s,t-o,-1);let u=new fe(s,r);l=l?l.compose(u.map(l)):u,s=[],r=[],o=0}function h(c){if(Array.isArray(c))for(let u of c)h(u);else if(c instanceof fe){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:u,to:f=u,insert:d}=c;if(u>f||u<0||f>t)throw new RangeError(`Invalid change range ${u} to ${f} (in doc of length ${t})`);let m=d?typeof d=="string"?_.of(d.split(i||cr)):d:_.empty,b=m.length;if(u==f&&b==0)return;u<o&&a(),u>o&&ve(s,u-o,-1),ve(s,f-u,b),vt(r,s,m),o=f}}return h(e),a(!l),l}static empty(e){return new fe(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push(_.empty);i[s]=_.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new fe(t,i)}static createSet(e,t){return new fe(e,t)}}function ve(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function vt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(_.empty);n.push(t)}}function ur(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let h=s,c=r,u=_.empty;for(;h+=l,c+=a,a&&i&&(u=u.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,u),s=h,r=c}}}function fr(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Li(n),l=new Li(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ve(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(ve(s,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(ve(s,0,o.ins),r&&vt(r,s,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let u=Math.min(c,l.len);h+=u,c-=u,l.forward(u)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;ve(s,h,a<o.i?o.ins:0),r&&a<o.i&&vt(r,s,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?fe.createSet(s,r):st.create(s);throw new Error("Mismatched change set lengths")}}function dh(n,e,t=!1){let i=[],s=t?[]:null,r=new Li(n),o=new Li(e);for(let l=!1;;){if(r.done&&o.done)return s?fe.createSet(i,s):st.create(i);if(r.ins==0)ve(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)ve(i,0,o.ins,l),s&&vt(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;ve(i,a,c,l),s&&c&&vt(s,i,o.text)}else o.ins==-1?(ve(i,r.off?0:r.len,a,l),s&&vt(s,i,r.textBit(a))):(ve(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&vt(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Li{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?_.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?_.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Wt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Wt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return k.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return k.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return k.range(e.anchor,e.head)}static create(e,t,i){return new Wt(e,t,i)}}class k{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:k.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new k([this.main],0)}addRange(e,t=!0){return k.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,k.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new k(e.ranges.map(t=>Wt.fromJSON(t)),e.main)}static single(e,t=e){return new k([k.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=i:r.from<i)return k.normalized(e.slice(),t);i=r.to}return new k(e,t)}static cursor(e,t=0,i,s){return Wt.create(e,e,(t==0?0:t<0?4:8)|(i==null?3:Math.min(2,i))|(s??33554431)<<5)}static range(e,t,i,s){let r=(i??33554431)<<5|(s==null?3:Math.min(2,s));return t<e?Wt.create(t,e,24|r):Wt.create(e,t,(t>e?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?k.range(a,l):k.range(l,a))}}return new k(e,t)}}function ph(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let co=0;class L{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=co++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new L(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:uo),!!e.static,e.enables)}of(e){return new An([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new An(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new An(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function uo(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class An{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=co++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let u of this.dependencies)u=="doc"?a=!0:u=="selection"?h=!0:((t=e[u.id])!==null&&t!==void 0?t:1)&1||c.push(e[u.id]);return{create(u){return u.values[o]=i(u),1},update(u,f){if(a&&f.docChanged||h&&(f.docChanged||f.selection)||dr(u,c)){let d=i(u);if(l?!Yo(d,u.values[o],s):!s(d,u.values[o]))return u.values[o]=d,1}return 0},reconfigure:(u,f)=>{let d,m=f.config.address[r];if(m!=null){let b=In(f,m);if(this.dependencies.every(y=>y instanceof L?f.facet(y)===u.facet(y):y instanceof we?f.field(y,!1)==u.field(y,!1):!0)||(l?Yo(d=i(u),b,s):s(d=i(u),b)))return u.values[o]=b,0}else d=i(u);return u.values[o]=d,1}}}}function Yo(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function dr(n,e){let t=!1;for(let i of e)Pi(n,i)&1&&(t=!0);return t}function dd(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let u=In(a,i[c]);if(s[c]==2)for(let f of u)h.push(f);else h.push(u)}return e.combine(h)}return{create(a){for(let h of i)Pi(a,h);return a.values[o]=l(a),1},update(a,h){if(!dr(a,r))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=dr(a,i),u=h.config.facets[e.id],f=h.facet(e);if(u&&!c&&uo(t,u))return a.values[o]=f,0;let d=l(a);return e.compare(d,f)?(a.values[o]=f,0):(a.values[o]=d,1)}}}const Xo=L.define({static:!0});class we{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new we(co++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Xo).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Xo.of({field:this,create:e})]}get extension(){return this}}const Nt={lowest:4,low:3,default:2,high:1,highest:0};function yi(n){return e=>new mh(e,n)}const pi={highest:yi(Nt.highest),high:yi(Nt.high),default:yi(Nt.default),low:yi(Nt.low),lowest:yi(Nt.lowest)};class mh{constructor(e,t){this.inner=e,this.prec=t}}class ms{of(e){return new pr(this,e)}reconfigure(e){return ms.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class pr{constructor(e,t){this.compartment=e,this.inner=t}}class Ln{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let f of pd(e,t,o))f instanceof we?s.push(f):(r[f.facet.id]||(r[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],h=[];for(let f of s)l[f.id]=h.length<<1,h.push(d=>f.slot(d));let c=i==null?void 0:i.config.facets;for(let f in r){let d=r[f],m=d[0].facet,b=c&&c[f]||[];if(d.every(y=>y.type==0))if(l[m.id]=a.length<<1|1,uo(b,d))a.push(i.facet(m));else{let y=m.combine(d.map(x=>x.value));a.push(i&&m.compare(y,i.facet(m))?i.facet(m):y)}else{for(let y of d)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=h.length<<1,h.push(x=>y.dynamicSlot(x)));l[m.id]=h.length<<1,h.push(y=>dd(y,m,d))}}let u=h.map(f=>f(l));return new Ln(e,o,u,l,a,r)}}function pd(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof pr&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof pr){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof mh)r(o.inner,o.prec);else if(o instanceof we)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof An)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Nt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,Nt.default),i.reduce((o,l)=>o.concat(l))}function Pi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function In(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const gh=L.define(),yh=L.define({combine:n=>n.some(e=>e),static:!0}),bh=L.define({combine:n=>n.length?n[0]:void 0,static:!0}),xh=L.define(),wh=L.define(),vh=L.define(),kh=L.define({combine:n=>n.length?n[0]:!1});class dt{constructor(e,t){this.type=e,this.value=t}static define(){return new md}}class md{of(e){return new dt(this,e)}}class gd{constructor(e){this.map=e}of(e){return new z(this,e)}}class z{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new z(this.type,t)}is(e){return this.type==e}static define(e={}){return new gd(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}z.reconfigure=z.define();z.appendConfig=z.define();class de{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ph(i,t.newLength),r.some(l=>l.type==de.time)||(this.annotations=r.concat(de.time.of(Date.now())))}static create(e,t,i,s,r,o){return new de(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(de.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}de.time=dt.define();de.userEvent=dt.define();de.addToHistory=dt.define();de.remote=dt.define();function yd(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Sh(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=fe.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:z.mapEffects(n.effects,s).concat(z.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function mr(n,e,t){let i=e.selection,s=ti(e.annotations);return e.userEvent&&(s=s.concat(de.userEvent.of(e.userEvent))),{changes:e.changes instanceof fe?e.changes:fe.of(e.changes||[],t,n.facet(bh)),selection:i&&(i instanceof k?i:k.single(i.anchor,i.head)),effects:ti(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function Ch(n,e,t){let i=mr(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=Sh(i,mr(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=de.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return xd(t?bd(s):s)}function bd(n){let e=n.startState,t=!0;for(let s of e.facet(xh)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:yd(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=fe.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=de.create(e,s,n.selection&&n.selection.map(r),z.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(wh);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof de?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof de?n=r[0]:n=Ch(e,ti(r),!1)}return n}function xd(n){let e=n.startState,t=e.facet(vh),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Sh(i,mr(e,r,n.changes.newLength),!0))}return i==n?n:de.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const wd=[];function ti(n){return n==null?wd:Array.isArray(n)?n:[n]}var re=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(re||(re={}));const vd=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let gr;try{gr=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function kd(n){if(gr)return gr.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||vd.test(t)))return!0}return!1}function Sd(n){return e=>{if(!/\S/.test(e))return re.Space;if(kd(e))return re.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return re.Word;return re.Other}}class U{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Pi(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Pi(this,i),In(this,i)}update(...e){return Ch(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let o of e.effects)o.is(ms.reconfigure)?(t&&(s=new Map,t.compartments.forEach((l,a)=>s.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(z.reconfigure)?(t=null,i=o.value):o.is(z.appendConfig)&&(t=null,i=ti(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Ln.resolve(i,s,this),r=new U(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new U(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:k.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=ti(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(s);for(let f=0;f<l;f++)r[f]=r[f].map(c);let u=s.mapDesc(h,!0);r.push(a.range.map(u)),s=s.compose(c),o=z.mapEffects(o,c).concat(z.mapEffects(ti(a.effects),u))}return{changes:s,selection:k.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof fe?e:fe.of(e,this.doc.length,this.facet(U.lineSeparator))}toText(e){return _.of(e.split(this.facet(U.lineSeparator)||cr))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Pi(this,t),In(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof we&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return U.create({doc:e.doc,selection:k.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Ln.resolve(e.extensions||[],new Map),i=e.doc instanceof _?e.doc:_.of((e.doc||"").split(t.staticFacet(U.lineSeparator)||cr)),s=e.selection?e.selection instanceof k?e.selection:k.single(e.selection.anchor,e.selection.head):k.single(0);return ph(s,i.length),t.staticFacet(yh)||(s=s.asSingle()),new U(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(U.tabSize)}get lineBreak(){return this.facet(U.lineSeparator)||`
@@ -1,4 +1,4 @@
1
- import{s as I,i as R,f as B,ay as D,az as O,aA as U,al as w,aB as F,j as t,aC as J,d as L,aD as b,aE as x,h as K,aF as $}from"./index-97019f83.js";import{u as z,P as M,D as q}from"./useProjectForm-5dd2ec50.js";const G="CREATE_PROJECT_BTN",Y=I(R)(({theme:e})=>({marginLeft:e.spacing(3)})),Z=()=>{const{setToastData:e,setToastApiError:l}=B(),{refetchUser:p}=D(),{uiConfig:u}=O(),a=U(),{trackEvent:o}=w(),{projectId:s,projectName:j,projectDesc:m,projectMode:r,setProjectMode:C,setProjectId:P,setProjectName:h,setProjectDesc:E,getCreateProjectPayload:c,clearErrors:n,validateProjectId:i,validateName:T,setProjectStickiness:f,projectStickiness:d,errors:g}=z(),{createProject:A,loading:y}=F();return t(J,{loading:y,title:"Create project",description:"Projects allows you to group feature toggles together in the management UI.",documentationLink:"https://docs.getunleash.io/reference/projects",documentationLinkLabel:"Projects documentation",formatApiCode:()=>`curl --location --request POST '${u.unleashUrl}/api/admin/projects' \\
1
+ import{s as I,i as R,f as B,ay as D,az as O,aA as U,al as w,aB as F,j as t,aC as J,d as L,aD as b,aE as x,h as K,aF as $}from"./index-f848dd08.js";import{u as z,P as M,D as q}from"./useProjectForm-b9260dd5.js";const G="CREATE_PROJECT_BTN",Y=I(R)(({theme:e})=>({marginLeft:e.spacing(3)})),Z=()=>{const{setToastData:e,setToastApiError:l}=B(),{refetchUser:p}=D(),{uiConfig:u}=O(),a=U(),{trackEvent:o}=w(),{projectId:s,projectName:j,projectDesc:m,projectMode:r,setProjectMode:C,setProjectId:P,setProjectName:h,setProjectDesc:E,getCreateProjectPayload:c,clearErrors:n,validateProjectId:i,validateName:T,setProjectStickiness:f,projectStickiness:d,errors:g}=z(),{createProject:A,loading:y}=F();return t(J,{loading:y,title:"Create project",description:"Projects allows you to group feature toggles together in the management UI.",documentationLink:"https://docs.getunleash.io/reference/projects",documentationLinkLabel:"Projects documentation",formatApiCode:()=>`curl --location --request POST '${u.unleashUrl}/api/admin/projects' \\
2
2
  --header 'Authorization: INSERT_API_KEY' \\
3
3
  --header 'Content-Type: application/json' \\
4
4
  --data-raw '${JSON.stringify(c(),void 0,2)}'`,children:L(M,{errors:g,handleSubmit:async _=>{_.preventDefault(),n();const N=T(),S=await i();if(N&&S){const k=c();try{await A(k),p(),a(`/projects/${s}`),e({title:"Project created",text:"Now you can add toggles to this project",confetti:!0,type:"success"}),d!==q&&o("project_stickiness_set"),o("project-mode",{props:{mode:r,action:"added"}})}catch(v){l(K(v))}}},projectId:s,setProjectId:P,projectName:j,projectStickiness:d,projectMode:r,setProjectMode:C,setProjectStickiness:f,setProjectName:h,projectDesc:m,setProjectDesc:E,mode:"Create",clearErrors:n,validateProjectId:i,children:[t(b,{name:"project",permission:x,"data-testid":G}),t(Y,{onClick:()=>{a($)},children:"Cancel"})]})})};export{Z as default};
@@ -1 +1 @@
1
- import{c as r,j as o}from"./index-97019f83.js";const a=r(o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");export{a as E};
1
+ import{c as r,j as o}from"./index-f848dd08.js";const a=r(o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");export{a as E};
@@ -1,4 +1,4 @@
1
- import{c as me,j as s,b as ye,aG as j,aY as Q,d as T,b8 as G,C as x,L as H,T as $,ce as De,s as _,f_ as Pe,be as Fe,f$ as oe,aA as X,az as N,g0 as $e,g1 as qe,g2 as Be,g3 as Oe,g4 as _e,bv as K,g5 as Le,i as Ve,g6 as ze,cp as Ue,g7 as ne,r as S,aB as ie,f as U,g8 as be,al as ve,g9 as Se,aC as Ce,aZ as Te,bo as Ye,ga as je,h as O,dn as He,a_ as Ge,aX as ce,aH as se,b0 as Z,gb as Je,gc as Me,gd as We,ge as Ke,gf as Qe,gg as Xe,b1 as we,b9 as Ne,gh as Ze,J as z,aL as de,B as Ie,aj as et,bX as le,gi as tt,eB as at,eW as nt,eX as st,gj as rt,gk as ot,bb as it,bc as ct,bd as lt,A as Ae,l as Ee,b_ as ut,m as dt,o as gt,V as ht,gl as ft,n as pt,u as mt,bO as yt,aS as bt,aQ as vt,aR as St,t as Ct,aM as re,bJ as xe}from"./index-97019f83.js";const Tt=me(s("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"}),"Cloud"),ea=me(s("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4.2 14.2L11 13V7h1.5v5.2l4.5 2.7-.8 1.3z"}),"WatchLater"),ta=({enabled:e,className:a})=>{const t=ye(),n=e?"Environment enabled":"Environment disabled",r={backgroundColor:e?t.palette.primary.light:t.palette.neutral.border,borderRadius:"50%",width:"28px",height:"28px",minWidth:"28px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:t.spacing(1)},o={fill:t.palette.common.white,width:"16px",height:"16px"};return s("div",{style:r,className:a,children:s(Tt,{style:o,titleAccess:n})})},wt=({isOpen:e,onConfirm:a,onClose:t,showBanner:n,environment:r,messageComponent:o})=>{const i=j("projectId"),{data:l}=Q(i),{changeRequestInReviewOrApproved:f,alert:p}=De(l),u=f(r||"");return T(G,{open:e,primaryButtonText:u?"Add to existing change request":"Add suggestion to draft",secondaryButtonText:"Cancel",onClick:a,onClose:t,title:"Request changes",fullWidth:!0,children:[s(x,{condition:u,show:p}),s(x,{condition:!!n,show:T(H,{severity:"info",sx:{mb:2},children:["Change requests feature is enabled for ",r,". Your changes need to be approved before they will be live. All the changes you do now will be added into a draft that you can submit for review."]})}),s($,{variant:"body2",color:"text.secondary",children:"Your suggestion:"}),o]})},At=(e,a)=>{const t={};return a.parameters.forEach(n=>{t[n.name]=Et(e,n)}),{name:a.name,constraints:[],parameters:t}},Et=(e,a)=>a.name==="rollout"||a.name==="percentage"||a.type==="percentage"?"50":a.name==="stickiness"?"":a.name==="groupId"?e:a.type==="boolean"?"false":"",xt=_("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),ge=_("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.background.elevation2})),kt=_("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),Rt=({projectId:e,environmentId:a,permission:t,onSubmit:n,onCancel:r,loading:o,strategy:i,setStrategy:l,segments:f,setSegments:p,errors:u})=>{const m=Pe(i.constraints),c=Fe(t,e,a),{strategyDefinition:d}=oe(i==null?void 0:i.name),C=X(),{uiConfig:h,error:g,loading:A}=N();if(g)throw g;if(A||!d)return null;const q=y=>d.parameters.find(v=>v.name===y),D=(y,v)=>{const P=q(y);if(y!=="groupId"){const R=ze(P,v);return R?(u.setFormError(y,R),!1):(u.removeFormError(y),!0)}return!0},k=()=>d.parameters.map(y=>y.name).map(y=>{var v;return D(y,(v=i.parameters)==null?void 0:v[y])}).every(Boolean),b=()=>{C(`/projects/${e}/settings/default-strategy`)};return T(xt,{onSubmit:async y=>{if(y.preventDefault(),k())n();else return},children:[s($e,{title:i.title||"",setTitle:y=>{l(v=>({...v,title:y}))}}),s(qe,{segments:f,setSegments:p,projectId:e}),s(Be,{projectId:e,environmentId:a,strategy:i,setStrategy:l}),s(ge,{}),s(Oe,{strategy:i,strategyDefinition:d,setStrategy:l,validateParameter:D,errors:u,hasAccess:c}),s(x,{condition:i.parameters!=null&&"stickiness"in i.parameters,show:s(_e,{strategy:i,setStrategy:l,environment:a,projectId:e})}),s(ge,{}),T(kt,{children:[s(K,{permission:t,projectId:e,environmentId:a,variant:"contained",color:"primary",type:"submit",disabled:o||!m||u.hasFormErrors(),"data-testid":Le,children:"Save strategy"}),s(Ve,{type:"button",color:"primary",onClick:r||b,disabled:o,children:"Cancel"})]})]})},ke=(e,a)=>{var i;const{project:t,refetch:n}=Ue(e),r={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:t.defaultStickiness||"default",groupId:""}},o=(i=t.environments.find(l=>l.environment===a))==null?void 0:i.defaultStrategy;return{defaultStrategyFallback:r,strategy:o,refetch:n}},aa=()=>{const e=j("projectId"),a=ne("environmentId"),{defaultStrategyFallback:t,strategy:n,refetch:r}=ke(e,a),[o,i]=S.useState(n||t),[l,f]=S.useState([]),{updateDefaultStrategy:p,loading:u}=ie(),{strategyDefinition:m}=oe(o==null?void 0:o.name),{setToastData:c,setToastApiError:d}=U(),C=be(),{uiConfig:h}=N(),{unleashUrl:g}=h,A=X(),{trackEvent:q}=ve(),{segments:D,refetchSegments:k}=Se();S.useEffect(()=>{if(D&&(n!=null&&n.segments)){const v=[];for(const P of n==null?void 0:n.segments)v.push(...D.filter(R=>R.id===P));f(v)}},[JSON.stringify(D),JSON.stringify(n==null?void 0:n.segments)]);const b=Dt(o,l),L=async v=>{await p(e,a,v),q("default_strategy",{props:{action:"edit",hasTitle:!!v.title}}),await k(),c({title:"Default Strategy updated",type:"success",confetti:!0})},y=async()=>{const v=`/projects/${e}/settings/default-strategy`;try{await L(b),await r(),A(v)}catch(P){d(O(P))}};return!m||!o?null:s(Ce,{modal:!0,title:Te((o==null?void 0:o.name)??""),description:Ft,documentationLink:$t,documentationLinkLabel:qt,formatApiCode:()=>Pt(e,a,b,m,g),children:s(Rt,{projectId:e,strategy:o,setStrategy:i,segments:l,setSegments:f,environmentId:a,onSubmit:y,loading:u,permission:Ye,errors:C,isChangeRequest:!1})})},Dt=(e,a)=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:e.parameters??{},variants:e.variants??[],segments:a.map(t=>t.id),disabled:e.disabled??!1}),Pt=(e,a,t,n,r)=>{if(!r)return"";const o={...t,parameters:je(t.parameters??{},n)},i=`${r}/api/admin/projects/${e}/environments/${a}/default-strategy}`,l=JSON.stringify(o,void 0,2);return`curl --location --request PUT '${i}' \\
1
+ import{c as me,j as s,b as ye,aG as j,aY as Q,d as T,b8 as G,C as x,L as H,T as $,ce as De,s as _,f_ as Pe,be as Fe,f$ as oe,aA as X,az as N,g0 as $e,g1 as qe,g2 as Be,g3 as Oe,g4 as _e,bv as K,g5 as Le,i as Ve,g6 as ze,cp as Ue,g7 as ne,r as S,aB as ie,f as U,g8 as be,al as ve,g9 as Se,aC as Ce,aZ as Te,bo as Ye,ga as je,h as O,dn as He,a_ as Ge,aX as ce,aH as se,b0 as Z,gb as Je,gc as Me,gd as We,ge as Ke,gf as Qe,gg as Xe,b1 as we,b9 as Ne,gh as Ze,J as z,aL as de,B as Ie,aj as et,bX as le,gi as tt,eB as at,eW as nt,eX as st,gj as rt,gk as ot,bb as it,bc as ct,bd as lt,A as Ae,l as Ee,b_ as ut,m as dt,o as gt,V as ht,gl as ft,n as pt,u as mt,bO as yt,aS as bt,aQ as vt,aR as St,t as Ct,aM as re,bJ as xe}from"./index-f848dd08.js";const Tt=me(s("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"}),"Cloud"),ea=me(s("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4.2 14.2L11 13V7h1.5v5.2l4.5 2.7-.8 1.3z"}),"WatchLater"),ta=({enabled:e,className:a})=>{const t=ye(),n=e?"Environment enabled":"Environment disabled",r={backgroundColor:e?t.palette.primary.light:t.palette.neutral.border,borderRadius:"50%",width:"28px",height:"28px",minWidth:"28px",display:"flex",alignItems:"center",justifyContent:"center",marginRight:t.spacing(1)},o={fill:t.palette.common.white,width:"16px",height:"16px"};return s("div",{style:r,className:a,children:s(Tt,{style:o,titleAccess:n})})},wt=({isOpen:e,onConfirm:a,onClose:t,showBanner:n,environment:r,messageComponent:o})=>{const i=j("projectId"),{data:l}=Q(i),{changeRequestInReviewOrApproved:f,alert:p}=De(l),u=f(r||"");return T(G,{open:e,primaryButtonText:u?"Add to existing change request":"Add suggestion to draft",secondaryButtonText:"Cancel",onClick:a,onClose:t,title:"Request changes",fullWidth:!0,children:[s(x,{condition:u,show:p}),s(x,{condition:!!n,show:T(H,{severity:"info",sx:{mb:2},children:["Change requests feature is enabled for ",r,". Your changes need to be approved before they will be live. All the changes you do now will be added into a draft that you can submit for review."]})}),s($,{variant:"body2",color:"text.secondary",children:"Your suggestion:"}),o]})},At=(e,a)=>{const t={};return a.parameters.forEach(n=>{t[n.name]=Et(e,n)}),{name:a.name,constraints:[],parameters:t}},Et=(e,a)=>a.name==="rollout"||a.name==="percentage"||a.type==="percentage"?"50":a.name==="stickiness"?"":a.name==="groupId"?e:a.type==="boolean"?"false":"",xt=_("form")(({theme:e})=>({display:"grid",gap:e.spacing(2)})),ge=_("hr")(({theme:e})=>({width:"100%",height:"1px",margin:e.spacing(2,0),border:"none",background:e.palette.background.elevation2})),kt=_("div")(({theme:e})=>({display:"flex",justifyContent:"end",gap:e.spacing(2),paddingBottom:e.spacing(10)})),Rt=({projectId:e,environmentId:a,permission:t,onSubmit:n,onCancel:r,loading:o,strategy:i,setStrategy:l,segments:f,setSegments:p,errors:u})=>{const m=Pe(i.constraints),c=Fe(t,e,a),{strategyDefinition:d}=oe(i==null?void 0:i.name),C=X(),{uiConfig:h,error:g,loading:A}=N();if(g)throw g;if(A||!d)return null;const q=y=>d.parameters.find(v=>v.name===y),D=(y,v)=>{const P=q(y);if(y!=="groupId"){const R=ze(P,v);return R?(u.setFormError(y,R),!1):(u.removeFormError(y),!0)}return!0},k=()=>d.parameters.map(y=>y.name).map(y=>{var v;return D(y,(v=i.parameters)==null?void 0:v[y])}).every(Boolean),b=()=>{C(`/projects/${e}/settings/default-strategy`)};return T(xt,{onSubmit:async y=>{if(y.preventDefault(),k())n();else return},children:[s($e,{title:i.title||"",setTitle:y=>{l(v=>({...v,title:y}))}}),s(qe,{segments:f,setSegments:p,projectId:e}),s(Be,{projectId:e,environmentId:a,strategy:i,setStrategy:l}),s(ge,{}),s(Oe,{strategy:i,strategyDefinition:d,setStrategy:l,validateParameter:D,errors:u,hasAccess:c}),s(x,{condition:i.parameters!=null&&"stickiness"in i.parameters,show:s(_e,{strategy:i,setStrategy:l,environment:a,projectId:e})}),s(ge,{}),T(kt,{children:[s(K,{permission:t,projectId:e,environmentId:a,variant:"contained",color:"primary",type:"submit",disabled:o||!m||u.hasFormErrors(),"data-testid":Le,children:"Save strategy"}),s(Ve,{type:"button",color:"primary",onClick:r||b,disabled:o,children:"Cancel"})]})]})},ke=(e,a)=>{var i;const{project:t,refetch:n}=Ue(e),r={name:"flexibleRollout",constraints:[],parameters:{rollout:"100",stickiness:t.defaultStickiness||"default",groupId:""}},o=(i=t.environments.find(l=>l.environment===a))==null?void 0:i.defaultStrategy;return{defaultStrategyFallback:r,strategy:o,refetch:n}},aa=()=>{const e=j("projectId"),a=ne("environmentId"),{defaultStrategyFallback:t,strategy:n,refetch:r}=ke(e,a),[o,i]=S.useState(n||t),[l,f]=S.useState([]),{updateDefaultStrategy:p,loading:u}=ie(),{strategyDefinition:m}=oe(o==null?void 0:o.name),{setToastData:c,setToastApiError:d}=U(),C=be(),{uiConfig:h}=N(),{unleashUrl:g}=h,A=X(),{trackEvent:q}=ve(),{segments:D,refetchSegments:k}=Se();S.useEffect(()=>{if(D&&(n!=null&&n.segments)){const v=[];for(const P of n==null?void 0:n.segments)v.push(...D.filter(R=>R.id===P));f(v)}},[JSON.stringify(D),JSON.stringify(n==null?void 0:n.segments)]);const b=Dt(o,l),L=async v=>{await p(e,a,v),q("default_strategy",{props:{action:"edit",hasTitle:!!v.title}}),await k(),c({title:"Default Strategy updated",type:"success",confetti:!0})},y=async()=>{const v=`/projects/${e}/settings/default-strategy`;try{await L(b),await r(),A(v)}catch(P){d(O(P))}};return!m||!o?null:s(Ce,{modal:!0,title:Te((o==null?void 0:o.name)??""),description:Ft,documentationLink:$t,documentationLinkLabel:qt,formatApiCode:()=>Pt(e,a,b,m,g),children:s(Rt,{projectId:e,strategy:o,setStrategy:i,segments:l,setSegments:f,environmentId:a,onSubmit:y,loading:u,permission:Ye,errors:C,isChangeRequest:!1})})},Dt=(e,a)=>({name:e.name,title:e.title,constraints:e.constraints??[],parameters:e.parameters??{},variants:e.variants??[],segments:a.map(t=>t.id),disabled:e.disabled??!1}),Pt=(e,a,t,n,r)=>{if(!r)return"";const o={...t,parameters:je(t.parameters??{},n)},i=`${r}/api/admin/projects/${e}/environments/${a}/default-strategy}`,l=JSON.stringify(o,void 0,2);return`curl --location --request PUT '${i}' \\
2
2
  --header 'Authorization: INSERT_API_KEY' \\
3
3
  --header 'Content-Type: application/json' \\
4
4
  --data-raw '${l}'`},Ft=`
@@ -1,2 +1,2 @@
1
- import{gr as c,b as g,bP as x,r as d,j as u}from"./index-97019f83.js";import{d as b,L as m,C as f,a as C,b as v,P as S,c as h,T as q,p as k,e as M,f as L}from"./chartjs-adapter-date-fns.esm-9887b8bf.js";const P=(e,s,n)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(s,n,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(s,n,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(s,n,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,s,n)=>e.map(a=>({x:a.timestamp,y:n(a),variants:a.variants})),$=(e,s)=>{if(s===0)return"";const[n,a]=e,t=Math.floor(Number(a)/s*100);return`${a} (${t}%) - ${n}`},E=(e,s,n,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],l=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return l-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...l}=r.variants;return Object.entries(l).map(i=>$(i,r.y)).join(`
1
+ import{gr as c,b as g,bP as x,r as d,j as u}from"./index-f848dd08.js";import{d as b,L as m,C as f,a as C,b as v,P as S,c as h,T as q,p as k,e as M,f as L}from"./chartjs-adapter-date-fns.esm-76abe251.js";const P=(e,s,n)=>{const a={label:"Total requests",borderColor:e.palette.primary.main,backgroundColor:e.palette.primary.main,data:p(s,n,o=>o.yes+o.no),elements:{point:{radius:6,pointStyle:"circle"},line:{borderDash:[8,4]}}},t={label:"Exposed",borderColor:e.palette.success.main,backgroundColor:e.palette.success.main,data:p(s,n,o=>o.yes),elements:{point:{radius:6,pointStyle:"triangle"}}},r={label:"Not exposed",borderColor:e.palette.error.main,backgroundColor:e.palette.error.main,data:p(s,n,o=>o.no),elements:{point:{radius:6,pointStyle:"triangle",pointRotation:180}}};return{datasets:[t,r,a]}},p=(e,s,n)=>e.map(a=>({x:a.timestamp,y:n(a),variants:a.variants})),$=(e,s)=>{if(s===0)return"";const[n,a]=e,t=Math.floor(Number(a)/s*100);return`${a} (${t}%) - ${n}`},E=(e,s,n,a)=>({locale:a.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:e.palette.text.secondary,plugins:{tooltip:{backgroundColor:e.palette.background.paper,bodyColor:e.palette.text.primary,titleColor:e.palette.text.secondary,borderColor:e.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,itemSort:(t,r)=>{const o=["Total requests","Exposed","Not exposed"],l=o.indexOf(t.dataset.label),i=o.indexOf(r.dataset.label);return l-i},callbacks:{label:t=>`${t.formattedValue} - ${t.dataset.label}`,afterLabel:t=>{const r=t.dataset.data[t.dataIndex];if(t.dataset.label!=="Exposed"||r.variants===void 0)return"";const{disabled:o,...l}=r.variants;return Object.entries(l).map(i=>$(i,r.y)).join(`
2
2
  `)},title:t=>`Time: ${c(t[0].parsed.x,a.locale)}`}},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:T(n),position:"top",align:"start",display:!0,font:{size:16,weight:"400"},color:e.palette.text.primary}},scales:{y:{type:"linear",title:{display:!0,text:"Number of requests",color:e.palette.text.secondary},suggestedMin:0,ticks:{precision:0,color:e.palette.text.secondary},grid:{color:e.palette.divider,borderColor:e.palette.divider}},x:{type:"time",time:{unit:"hour"},grid:{display:!1},ticks:{callback:(t,r,o)=>c(o[r].value,a.locale),color:e.palette.text.secondary}}}}),T=e=>e===1?"Requests in the last hour":`Requests in the last ${e} hours`;b.font={...b.font,family:"Sen",size:13,weight:"400"};const O=({metrics:e,hoursBack:s,statsSectionId:n})=>{const a=g(),{locationSettings:t}=x(),r=d.useMemo(()=>[...e].sort((i,y)=>i.timestamp.localeCompare(y.timestamp)),[e]),o=d.useMemo(()=>E(a,r,s,t),[a,r,s,t]),l=d.useMemo(()=>P(a,r,t),[a,r,t]);return u("div",{style:{height:400},children:u(m,{options:o,data:l,"aria-label":"A feature metrics line chart, with three lines: all requests, positive requests, and negative requests.","aria-describedby":n})})};f.register(C,v,S,h,q,k,M,L);export{O as FeatureMetricsChart,O as default};