unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
1 lines • 781 kB
JavaScript
import{fM as z,fN as c1,fO as Z3,fP as B3,fQ as X3,fR as L1,fS as U6,fT as k3,fU as A2,fV as a4,fW as I2,fX as e2,fY as n4,fZ as D2,f_ as _e,f$ as E3,g0 as c4,g1 as V3,g2 as W6,e9 as E0,ea as H6,g3 as q6,g4 as Y6,g5 as K6,g6 as G6,g7 as R1,g8 as J6,g9 as $2,ga as o1,e6 as Pe,gb as s4,gc as zt,gd as Q6,ge as X6,gf as e8,gg as i4,gh as t8,fm as G3,gi as a8,cu as n8,gj as h0,gk as u0,gl as k2,gm as r4,gn as Ut,go as Wt,gp as Ht,gq as qt,gr as Fe,gs as Yt,gt as s0,e7 as c8,gu as $e,gv as Ve,gw as s8,gx as i8,gy as r8,gz as A0,gA as o8,gB as l8,gC as Me,gD as d8,gE as Kt,gF as p8,gG as h8,gH as u8,gI as m8,gJ as o4,gK as Gt,gL as Le,gM as v8,gN as g8,gO as f8,gP as x8,gQ as Jt,gR as Qt,gS as Xt,gT as ea,gU as ta,gV as aa,gW as na,gX as ca,gY as sa,gZ as ia,g_ as ra,g$ as oa,h0 as la,h1 as da,h2 as pa,h3 as ha,h4 as ua,e8 as ma,h5 as va,h6 as ga,h7 as fa,h8 as xa,h9 as ja,ha as ya,hb as ba,hc as Sa,hd as Ca,he as wa,hf as Za,hg as ka,hh as j8,hi as Ta,hj as Ea,hk as Aa,hl as Ia,hm as Da,hn as Ra,ho as Oa,hp as _a,bt as Pa,hq as Fa,hr as $a,hs as Va,ht as Ma,hu as La,hv as Ba,hw as Na,hx as za,hy as Ua,hz as Wa,hA as Ha,hB as qa,hC as Ya,hD as Ka,hE as Ga,hF as Ja,hG as Qa,hH as Xa,r as d,s as l,hI as en,d6 as m0,E as B1,j as t,F as N1,f as f1,w as O1,x as x1,aV as l4,J as V2,aW as M2,aX as q1,hJ as M3,aY as a3,d as s2,hK as y8,a_ as Y1,T,hL as n3,d9 as I0,L as d1,cw as D0,be as R0,B as S,d2 as b8,de as y3,hM as tn,m as L2,hN as an,hO as nn,aA as b3,ao as u1,i as J,hP as A3,hQ as cn,C as D,h as h1,bb as sn,aU as X1,cK as G1,bc as d4,aQ as B2,aT as N2,aR as O0,G as i2,Q as j1,hR as S8,c9 as t2,fu as rn,an as _0,dl as p4,dm as h4,b6 as I1,hS as C8,cg as r2,bh as w8,hT as on,hU as ln,b as m1,ai as V1,av as H1,hV as Z8,hW as k8,dh as j3,dk as J3,hX as dn,hY as pn,hZ as x5,h_ as T8,h$ as x3,dj as hn,c$ as E8,i0 as A8,i1 as I8,cp as o2,b8 as e3,u as P0,K as l2,i2 as Be,cM as D8,i3 as _3,i4 as un,i5 as mn,i6 as vn,i7 as gn,i8 as fn,i9 as xn,ia as jn,ib as yn,ic as bn,id as Sn,ie as Cn,ig as wn,ih as Zn,ii as kn,ij as Tn,fz as R2,ik as N3,il as En,im as R8,aM as T3,c0 as z1,b9 as r1,io as v0,aB as An,c8 as u4,da as In,ip as Dn,iq as Rn,U as On,aw as m4,bq as U1,cq as O2,ir as _n,is as Pn,it as O8,v as v4,iu as Fn,bG as I3,iv as $n,iw as Vn,ix as _8,bM as P8,iy as j5,iz as Mn,ap as F0,aN as q,iA as Ln,bf as D3,eH as $0,iB as g4,H as V0,c2 as M1,iC as F8,iD as Bn,iE as Nn,a$ as z3,aD as d2,aE as U3,aH as p2,_ as h2,a as E1,aI as u2,aK as m2,aJ as M0,iF as zn,iG as i1,bZ as Un,iH as Wn,iI as Hn,d5 as f4,iJ as qn,l as J1,b5 as W3,iK as Yn,c as g0,cQ as $8,iL as V8,iM as Kn,cD as c3,b_ as Gn,D as v2,cW as a2,iN as Jn,cb as Qn,aq as H3,aC as g1,iO as Xn,at as u3,d3 as e9,iP as t9,eg as M8,iQ as a9,iR as n9,iS as c9,iT as s9,iU as L8,iV as B8,az as w1,iW as i9,au as g2,iX as N8,iY as z8,fC as r9,iZ as i3,cy as t3,i_ as o9,aP as l9,eF as L0,i$ as d9,j0 as p9,b4 as _2,j1 as h9,j2 as U8,j3 as u9,j4 as m9,bp as f2,db as v9,V as W8,W as x4,aZ as x2,j5 as g9,j6 as H8,j7 as z2,j8 as f9,j9 as x9,ja as j9,jb as y9,bg as S3,jc as q8,jd as b9,z as S9,je as C9,jf as j4,jg as w9,cP as Y8,jh as Z9,ji as k9,eC as K8,eE as L3,n as y4,o as b4,jj as T9,jk as E9,jl as A9,jm as G8,ex as S4,ah as S1,ey as f0,jn as C4,dc as P2,jo as I9,eO as x0,aj as B0,jp as D9,jq as R9,as as w4,jr as O9,a9 as D1,aa as U2,al as N0,ac as z0,ad as U0,ae as W0,af as H0,ab as q0,js as J8,e1 as W2,ba as _9,am as Z4,A as Y0,dS as P9,jt as F9,ej as i0,ju as $9,jv as V9,t as Q8,jw as M9,jx as L9,dQ as K1,ar as H2,dM as k4,jy as pe,jz as B9,jA as N9,cB as q3,cC as s1,jB as z9,jC as U9,jD as W9,y as Y3,jE as H9,jF as X8,jG as q9,fL as e7,jH as Ne,jI as y5,jJ as Y9,dP as K9,dR as G9,jK as b5,jL as J9,jM as Q9,jN as X9,jO as ec,jP as tc,jQ as ac,jR as nc,cc,bm as t7,cd as T4,jS as sc,cn as E4,co as A4,c3 as ic,c4 as rc,c5 as q2,jT as oc,jU as lc,bu as dc,bv as pc,I as S5,ft as hc,cO as uc,cG as mc,jV as vc,jW as a7,jX as gc,jY as fc,jZ as xc,b7 as I4,j_ as jc,j$ as yc,b0 as Y2,k0 as ze,k1 as bc,k2 as D4,k3 as K0,k4 as R4,k5 as O4,ck as n7,fE as Sc,k6 as c7,k7 as Cc,e_ as wc,k8 as Zc,k9 as Ue,ka as kc,kb as Tc,d_ as Ec,d$ as Ac,dY as Ic,kc as s7,kd as i7,ke as r7,kf as Dc,kg as o7,kh as Rc,ki as Oc,kj as _c,fD as Pc,kk as Fc,fH as $c,dE as Vc,dH as C5,kl as Mc,km as Lc,kn as Bc,d4 as l7,ko as We,kp as Nc,e3 as d7,kq as zc,kr as Uc,di as w5,ks as Wc,kt as Hc,ku as qc,kv as y2,ce as p7,kw as Yc,kx as Kc,ky as Gc,kz as Jc,kA as Qc,fx as Xc,bz as es,kB as ts,kC as as,kD as ns,kE as cs}from"./index-Cikp5fMR.js";import{F as h7,M as ss}from"./MarkCompletedDialogue-C86IfCH-.js";import{a as is,u as u7,T as rs,b as os,F as ls,h as ds,f as ps,g as hs,e as us,d as ms,E as vs}from"./FeatureStaleDialog-DmUpnOZe.js";import{m as gs,i as Z5,b as fs,c as xs,d as js,e as ys,E as bs,f as Ss,u as Cs,a as ws,R as Zs,A as ks,C as Ts,g as m7,j as Es}from"./RoleCell-4trKLU2Y.js";import"./useApiTokens-BHKIbW5c.js";function v7(e,a){return z(e,a==null?void 0:a.in).getDay()===6}function g7(e,a){return z(e,a==null?void 0:a.in).getDay()===0}function Q3(e,a){const n=z(e,a==null?void 0:a.in).getDay();return n===0||n===6}function f7(e,a,n){const c=z(e,n==null?void 0:n.in),s=Q3(c,n);if(isNaN(a))return c1(n==null?void 0:n.in,NaN);const i=c.getHours(),r=a<0?-1:1,o=Math.trunc(a/5);c.setDate(c.getDate()+o*7);let p=Math.abs(a%5);for(;p>0;)c.setDate(c.getDate()+r),Q3(c,n)||(p-=1);return s&&Q3(c,n)&&a!==0&&(v7(c,n)&&c.setDate(c.getDate()+(r<0?2:-1)),g7(c,n)&&c.setDate(c.getDate()+(r<0?1:-2))),c.setHours(i),c}function x7(e,a,n){let c=z(e,n==null?void 0:n.in);const s=Z3(c,B3(c,n)),i=c1((n==null?void 0:n.in)||e,0);return i.setFullYear(a,0,4),i.setHours(0,0,0,0),c=B3(i),c.setDate(c.getDate()+s),c}function j7(e,a,n){return x7(e,X3(e,n)+a,n)}function As(e,a,n){const[c,s]=[+z(e.start,n==null?void 0:n.in),+z(e.end,n==null?void 0:n.in)].sort((o,p)=>o-p),[i,r]=[+z(a.start,n==null?void 0:n.in),+z(a.end,n==null?void 0:n.in)].sort((o,p)=>o-p);return n!=null&&n.inclusive?c<=r&&i<=s:c<r&&i<s}function y7(e,a){let n,c=a==null?void 0:a.in;return e.forEach(s=>{!c&&typeof s=="object"&&(c=c1.bind(null,s));const i=z(s,c);(!n||n<i||isNaN(+i))&&(n=i)}),c1(c,n||NaN)}function b7(e,a){let n,c=a==null?void 0:a.in;return e.forEach(s=>{!c&&typeof s=="object"&&(c=c1.bind(null,s));const i=z(s,c);(!n||n>i||isNaN(+i))&&(n=i)}),c1(c,n||NaN)}function Is(e,a,n){const[c,s,i]=L1(n==null?void 0:n.in,e,a.start,a.end);return b7([y7([c,s],n),i],n)}function S7(e,a){const n=+z(e);if(isNaN(n))return NaN;let c,s;return a.forEach((i,r)=>{const o=z(i);if(isNaN(+o)){c=NaN,s=NaN;return}const p=Math.abs(n-+o);(c==null||p<s)&&(c=r,s=p)}),c}function Ds(e,a,n){const[c,...s]=L1(n==null?void 0:n.in,e,...a),i=S7(c,s);if(typeof i=="number"&&isNaN(i))return c1(c,NaN);if(i!==void 0)return s[i]}function Rs(e,a){const n=+z(e)-+z(a);return n>0?-1:n<0?1:n}function Os(e){const a=Math.trunc(e/U6);return a===0?0:a}function _s(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a);if(!k3(c)||!k3(s))return NaN;const i=Z3(c,s),r=i<0?-1:1,o=Math.trunc(i/7);let p=o*5,h=A2(s,o*7);for(;!a4(c,h);)p+=Q3(h,n)?0:r,h=A2(h,r);return p===0?0:p}function C7(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a);return X3(c,n)-X3(s,n)}function Ps(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a),i=I2(c),r=I2(s),o=+i-e2(i),p=+r-e2(r);return Math.round((o-p)/n4)}function He(e,a){const n=z(e,a==null?void 0:a.in);return Math.trunc(n.getMonth()/3)+1}function r0(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a),i=c.getFullYear()-s.getFullYear(),r=He(c)-He(s);return i*4+r}function j0(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a),i=D2(c,n),r=D2(s,n),o=+i-e2(i),p=+r-e2(r);return Math.round((o-p)/n4)}function w7(e,a,n){return j7(e,-a,n)}function Fs(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a),i=_e(c,s),r=Math.abs(C7(c,s,n)),o=w7(c,i*r,n),p=+(_e(o,s)===-i),h=i*(r-p);return h===0?0:h}function Z7(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e);let s=+n>+c;const i=s?+n:+c,r=s?c:n;r.setHours(0,0,0,0);let o=(a==null?void 0:a.step)??1;if(!o)return[];o<0&&(o=-o,s=!s);const p=[];for(;+r<=i;)p.push(c1(n,r)),r.setDate(r.getDate()+o),r.setHours(0,0,0,0);return s?p.reverse():p}function $s(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e);let s=+n>+c;const i=s?+n:+c,r=s?c:n;r.setMinutes(0,0,0);let o=(a==null?void 0:a.step)??1;if(!o)return[];o<0&&(o=-o,s=!s);const p=[];for(;+r<=i;)p.push(c1(n,r)),r.setHours(r.getHours()+o);return s?p.reverse():p}function Vs(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e);n.setSeconds(0,0);let s=+n>+c;const i=s?+n:+c;let r=s?c:n,o=(a==null?void 0:a.step)??1;if(!o)return[];o<0&&(o=-o,s=!s);const p=[];for(;+r<=i;)p.push(c1(n,r)),r=c4(r,o);return s?p.reverse():p}function Ms(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e);let s=+n>+c;const i=s?+n:+c,r=s?c:n;r.setHours(0,0,0,0),r.setDate(1);let o=(a==null?void 0:a.step)??1;if(!o)return[];o<0&&(o=-o,s=!s);const p=[];for(;+r<=i;)p.push(c1(n,r)),r.setMonth(r.getMonth()+o);return s?p.reverse():p}function Ls(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e);let s=+n>+c;const i=s?+V3(n):+V3(c);let r=s?V3(c):V3(n),o=(a==null?void 0:a.step)??1;if(!o)return[];o<0&&(o=-o,s=!s);const p=[];for(;+r<=i;)p.push(c1(n,r)),r=W6(r,o);return s?p.reverse():p}function _4(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e),s=Z7({start:n,end:c},a),i=[];let r=0;for(;r<s.length;){const o=s[r++];Q3(o)&&i.push(c1(n,o))}return i}function Bs(e,a){const n=E0(e,a),c=H6(e,a);return _4({start:n,end:c},a)}function Ns(e,a){const n=q6(e,a),c=Y6(e,a);return _4({start:n,end:c},a)}function zs(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e);let s=+n>+c;const i=s?+n:+c,r=s?c:n;r.setHours(0,0,0,0),r.setMonth(0,1);let o=(a==null?void 0:a.step)??1;if(!o)return[];o<0&&(o=-o,s=!s);const p=[];for(;+r<=i;)p.push(c1(n,r)),r.setFullYear(r.getFullYear()+o);return s?p.reverse():p}function Us(e,a){const n=z(e,a==null?void 0:a.in),c=n.getFullYear(),s=9+Math.floor(c/10)*10;return n.setFullYear(s,11,31),n.setHours(23,59,59,999),n}function Ws(e,a){return K6(e,{...a,weekStartsOn:1})}function Hs(e,a){const n=X3(e,a),c=c1((a==null?void 0:a.in)||e,0);c.setFullYear(n+1,0,4),c.setHours(0,0,0,0);const s=I2(c,a);return s.setMilliseconds(s.getMilliseconds()-1),s}function qs(e){return G6(Date.now(),e)}function Ys(e){const a=R1(e==null?void 0:e.in),n=a.getFullYear(),c=a.getMonth(),s=a.getDate(),i=R1(e==null?void 0:e.in);return i.setFullYear(n,c,s+1),i.setHours(23,59,59,999),e!=null&&e.in?e.in(i):i}function Ks(e){const a=R1(e==null?void 0:e.in),n=c1(e==null?void 0:e.in,0);return n.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()-1),n.setHours(23,59,59,999),n}const Gs=["years","months","weeks","days","hours","minutes","seconds"];function Js(e,a){const n=$2(),c=(a==null?void 0:a.locale)??n.locale??J6,s=(a==null?void 0:a.format)??Gs,i=(a==null?void 0:a.zero)??!1,r=(a==null?void 0:a.delimiter)??" ";return c.formatDistance?s.reduce((p,h)=>{const u=`x${h.replace(/(^.)/,m=>m.toUpperCase())}`,v=e[h];return v!==void 0&&(i||e[h])?p.concat(c.formatDistance(u,v)):p},[]).join(r):""}function k7(e,a){const n=z(e,a==null?void 0:a.in);if(isNaN(+n))throw new RangeError("Invalid time value");const c=(a==null?void 0:a.format)??"extended",s=(a==null?void 0:a.representation)??"complete";let i="",r="";const o=c==="extended"?"-":"",p=c==="extended"?":":"";if(s!=="time"){const h=o1(n.getDate(),2),u=o1(n.getMonth()+1,2);i=`${o1(n.getFullYear(),4)}${o}${u}${o}${h}`}if(s!=="date"){const h=n.getTimezoneOffset();if(h!==0){const j=Math.abs(h),b=o1(Math.trunc(j/60),2),x=o1(j%60,2);r=`${h<0?"+":"-"}${b}:${x}`}else r="Z";const u=o1(n.getHours(),2),v=o1(n.getMinutes(),2),m=o1(n.getSeconds(),2),g=i===""?"":"T",f=[u,v,m].join(p);i=`${i}${g}${f}${r}`}return i}function Qs(e,a){const n=z(e,a==null?void 0:a.in);if(!k3(n))throw new RangeError("Invalid time value");const c=(a==null?void 0:a.format)??"extended",s=(a==null?void 0:a.representation)??"complete";let i="";const r=c==="extended"?"-":"",o=c==="extended"?":":"";if(s!=="time"){const p=o1(n.getDate(),2),h=o1(n.getMonth()+1,2);i=`${o1(n.getFullYear(),4)}${r}${h}${r}${p}`}if(s!=="date"){const p=o1(n.getHours(),2),h=o1(n.getMinutes(),2),u=o1(n.getSeconds(),2);i=`${i}${i===""?"":" "}${p}${o}${h}${o}${u}`}return i}function Xs(e){const{years:a=0,months:n=0,days:c=0,hours:s=0,minutes:i=0,seconds:r=0}=e;return`P${a}Y${n}M${c}DT${s}H${i}M${r}S`}function ei(e,a){const n=z(e,a==null?void 0:a.in);if(!k3(n))throw new RangeError("Invalid time value");const c=(a==null?void 0:a.fractionDigits)??0,s=o1(n.getDate(),2),i=o1(n.getMonth()+1,2),r=n.getFullYear(),o=o1(n.getHours(),2),p=o1(n.getMinutes(),2),h=o1(n.getSeconds(),2);let u="";if(c>0){const g=n.getMilliseconds(),f=Math.trunc(g*Math.pow(10,c-3));u="."+o1(f,c)}let v="";const m=n.getTimezoneOffset();if(m!==0){const g=Math.abs(m),f=o1(Math.trunc(g/60),2),j=o1(g%60,2);v=`${m<0?"+":"-"}${f}:${j}`}else v="Z";return`${r}-${i}-${s}T${o}:${p}:${h}${u}${v}`}const ti=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ai=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ni(e){const a=z(e);if(!k3(a))throw new RangeError("Invalid time value");const n=ti[a.getUTCDay()],c=o1(a.getUTCDate(),2),s=ai[a.getUTCMonth()],i=a.getUTCFullYear(),r=o1(a.getUTCHours(),2),o=o1(a.getUTCMinutes(),2),p=o1(a.getUTCSeconds(),2);return`${n}, ${c} ${s} ${i} ${r}:${o}:${p} GMT`}function ci(e,a,n){var v,m,g,f;const[c,s]=L1(n==null?void 0:n.in,e,a),i=$2(),r=(n==null?void 0:n.locale)??i.locale??J6,o=(n==null?void 0:n.weekStartsOn)??((m=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:m.weekStartsOn)??i.weekStartsOn??((f=(g=i.locale)==null?void 0:g.options)==null?void 0:f.weekStartsOn)??0,p=Z3(c,s);if(isNaN(p))throw new RangeError("Invalid time value");let h;p<-6?h="other":p<-1?h="lastWeek":p<0?h="yesterday":p<1?h="today":p<2?h="tomorrow":p<7?h="nextWeek":h="other";const u=r.formatRelative(h,c,s,{locale:r,weekStartsOn:o});return Pe(c,u,{locale:r,weekStartsOn:o})}function G0(e,a){return z(e,a==null?void 0:a.in).getDay()}function T7(e,a){const c=z(e,a==null?void 0:a.in).getFullYear();return c%400===0||c%4===0&&c%100!==0}function si(e,a){const n=z(e,a==null?void 0:a.in);return Number.isNaN(+n)?NaN:T7(n)?366:365}function ii(e,a){const c=z(e,a==null?void 0:a.in).getFullYear();return Math.floor(c/10)*10}function ri(e,a){const n=B3(e,a),s=+B3(s4(n,60))-+n;return Math.round(s/n4)}function oi(e,a){const[n,c]=[+z(e.start),+z(e.end)].sort((v,m)=>v-m),[s,i]=[+z(a.start),+z(a.end)].sort((v,m)=>v-m);if(!(n<i&&s<c))return 0;const o=s<n?n:s,p=o-e2(o),h=i>c?c:i,u=h-e2(h);return Math.ceil((u-p)/zt)}function li(e){return+z(e)}function di(e){return Math.trunc(+z(e)/1e3)}function pi(e,a){var p,h,u,v;const n=$2(),c=(a==null?void 0:a.weekStartsOn)??((h=(p=a==null?void 0:a.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??n.weekStartsOn??((v=(u=n.locale)==null?void 0:u.options)==null?void 0:v.weekStartsOn)??0,s=Q6(z(e,a==null?void 0:a.in));if(isNaN(s))return NaN;const i=G0(E0(e,a));let r=c-i;r<=0&&(r+=7);const o=s-r;return Math.ceil(o/7)+1}function E7(e,a){const n=z(e,a==null?void 0:a.in),c=n.getMonth();return n.setFullYear(n.getFullYear(),c+1,0),n.setHours(0,0,0,0),z(n,a==null?void 0:a.in)}function hi(e,a){const n=z(e,a==null?void 0:a.in);return j0(E7(n,a),E0(n,a),a)+1}function ui(e){return Math.trunc(e*X6)}function mi(e){return Math.trunc(e*e8)}function vi(e){return Math.trunc(e*i4)}function gi(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a);if(isNaN(+c))throw new TypeError("Start date is invalid");if(isNaN(+s))throw new TypeError("End date is invalid");if(n!=null&&n.assertPositive&&+c>+s)throw new TypeError("End date must be after start date");return{start:c,end:s}}function fi(e,a){const{start:n,end:c}=E3(a==null?void 0:a.in,e),s={},i=t8(c,n);i&&(s.years=i);const r=G3(n,{years:s.years}),o=a8(c,r);o&&(s.months=o);const p=G3(r,{months:s.months}),h=n8(c,p);h&&(s.days=h);const u=G3(p,{days:s.days}),v=h0(c,u);v&&(s.hours=v);const m=G3(u,{hours:s.hours}),g=u0(c,m);g&&(s.minutes=g);const f=G3(m,{minutes:s.minutes}),j=k2(c,f);return j&&(s.seconds=j),s}function xi(e,a,n){let c;return ji(a)?c=a:n=a,new Intl.DateTimeFormat(n==null?void 0:n.locale,c).format(z(e))}function ji(e){return e!==void 0&&!("locale"in e)}function yi(e,a,n){let c=0,s;const[i,r]=L1(n==null?void 0:n.in,e,a);if(n!=null&&n.unit)s=n==null?void 0:n.unit,s==="second"?c=k2(i,r):s==="minute"?c=u0(i,r):s==="hour"?c=h0(i,r):s==="day"?c=Z3(i,r):s==="week"?c=j0(i,r):s==="month"?c=Fe(i,r):s==="quarter"?c=r0(i,r):s==="year"&&(c=s0(i,r));else{const p=k2(i,r);Math.abs(p)<r4?(c=k2(i,r),s="second"):Math.abs(p)<i4?(c=u0(i,r),s="minute"):Math.abs(p)<Ut&&Math.abs(Z3(i,r))<1?(c=h0(i,r),s="hour"):Math.abs(p)<Wt&&(c=Z3(i,r))&&Math.abs(c)<7?s="day":Math.abs(p)<Ht?(c=j0(i,r),s="week"):Math.abs(p)<qt?(c=Fe(i,r),s="month"):Math.abs(p)<Yt?r0(i,r)<4?(c=r0(i,r),s="quarter"):(c=s0(i,r),s="year"):(c=s0(i,r),s="year")}return new Intl.RelativeTimeFormat(n==null?void 0:n.locale,{numeric:"auto",...n}).format(c,s)}function bi(e,a,n){const c=new Date(e,a,n);return c.getFullYear()===e&&c.getMonth()===a&&c.getDate()===n}function Si(e,a){return z(e,a==null?void 0:a.in).getDate()===1}function Ci(e,a){return z(e,a==null?void 0:a.in).getDay()===5}function wi(e){return+z(e)>Date.now()}function Zi(e,a,n){return k3(c8(e,a,new Date,n))}function ki(e,a){return z(e,a==null?void 0:a.in).getDay()===1}function P4(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a);return+D2(c,n)==+D2(s,n)}function A7(e,a,n){return P4(e,a,{...n,weekStartsOn:1})}function Ti(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a);return+B3(c)==+B3(s)}function I7(e,a){return+$e(e)==+$e(a)}function D7(e,a,n){const[c,s]=L1(n==null?void 0:n.in,e,a);return+V3(c)==+V3(s)}function R7(e,a){return+Ve(e)==+Ve(a)}function Ei(e,a){return s8(z(e,a==null?void 0:a.in),R1((a==null?void 0:a.in)||e))}function Ai(e,a){return A7(c1((a==null?void 0:a.in)||e,e),R1((a==null?void 0:a.in)||e))}function Ii(e){return I7(e,R1(e))}function Di(e,a){return i8(c1((a==null?void 0:a.in)||e,e),R1((a==null?void 0:a.in)||e))}function Ri(e,a){return D7(c1((a==null?void 0:a.in)||e,e),R1((a==null?void 0:a.in)||e))}function Oi(e){return R7(e,R1(e))}function _i(e,a){return P4(c1((a==null?void 0:a.in)||e,e),R1((a==null?void 0:a.in)||e),a)}function Pi(e,a){return r8(c1((a==null?void 0:a.in)||e,e),R1((a==null?void 0:a.in)||e))}function Fi(e,a){return z(e,a==null?void 0:a.in).getDay()===4}function $i(e,a){return z(e,a==null?void 0:a.in).getDay()===2}function Vi(e,a){return z(e,a==null?void 0:a.in).getDay()===3}function Mi(e,a){return a4(c1((a==null?void 0:a.in)||e,e),A0(R1((a==null?void 0:a.in)||e),1))}function Li(e,a){const n=z(e,a==null?void 0:a.in),c=n.getFullYear(),s=9+Math.floor(c/10)*10;return n.setFullYear(s+1,0,0),n.setHours(0,0,0,0),z(n,a==null?void 0:a.in)}function Bi(e,a){return o8(e,{...a,weekStartsOn:1})}function Ni(e,a){const n=X3(e,a),c=c1((a==null?void 0:a.in)||e,0);c.setFullYear(n+1,0,4),c.setHours(0,0,0,0);const s=I2(c,a);return s.setDate(s.getDate()-1),s}function zi(e,a){const n=z(e,a==null?void 0:a.in),c=n.getMonth(),s=c-c%3+3;return n.setMonth(s,0),n.setHours(0,0,0,0),n}function Ui(e,a){const n=z(e,a==null?void 0:a.in),c=n.getFullYear();return n.setFullYear(c+1,0,0),n.setHours(0,0,0,0),n}const Wi=/(\w)\1*|''|'(''|[^'])+('|$)|./g,Hi=/^'([^]*?)'?$/,qi=/''/g,Yi=/[a-zA-Z]/;function Ki(e,a){const n=z(e);if(!k3(n))throw new RangeError("Invalid time value");const c=a.match(Wi);return c?c.map(i=>{if(i==="''")return"'";const r=i[0];if(r==="'")return Gi(i);const o=l8[r];if(o)return o(n,i);if(r.match(Yi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return i}).join(""):""}function Gi(e){const a=e.match(Hi);return a?a[1].replace(qi,"'"):e}function Ji({years:e,months:a,weeks:n,days:c,hours:s,minutes:i,seconds:r}){let o=0;e&&(o+=e*Me),a&&(o+=a*(Me/12)),n&&(o+=n*7),c&&(o+=c);let p=o*24*60*60;return s&&(p+=s*60*60),i&&(p+=i*60),r&&(p+=r),Math.trunc(p*1e3)}function Qi(e){const a=e/X6;return Math.trunc(a)}function Xi(e){const a=e/d8;return Math.trunc(a)}function er(e){const a=e/Kt;return Math.trunc(a)}function tr(e){const a=e/e8;return Math.trunc(a)}function ar(e){return Math.trunc(e*d8)}function nr(e){return Math.trunc(e*r4)}function cr(e){const a=e/p8;return Math.trunc(a)}function sr(e){const a=e/h8;return Math.trunc(a)}function R3(e,a,n){let c=a-G0(e,n);return c<=0&&(c+=7),A2(e,c,n)}function ir(e,a){return R3(e,5,a)}function rr(e,a){return R3(e,1,a)}function or(e,a){return R3(e,6,a)}function lr(e,a){return R3(e,0,a)}function dr(e,a){return R3(e,4,a)}function pr(e,a){return R3(e,2,a)}function hr(e,a){return R3(e,3,a)}function ur(e,a){const n=e.match(/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/);return n?z(Date.UTC(+n[1],+n[2]-1,+n[3],+n[4]-(+n[9]||0)*(n[8]=="-"?-1:1),+n[5]-(+n[10]||0)*(n[8]=="-"?-1:1),+n[6],+((n[7]||"0")+"00").substring(0,3)),a==null?void 0:a.in):z(NaN,a==null?void 0:a.in)}function O3(e,a,n){let c=G0(e,n)-a;return c<=0&&(c+=7),A0(e,c,n)}function mr(e,a){return O3(e,5,a)}function vr(e,a){return O3(e,1,a)}function gr(e,a){return O3(e,6,a)}function fr(e,a){return O3(e,0,a)}function xr(e,a){return O3(e,4,a)}function jr(e,a){return O3(e,2,a)}function yr(e,a){return O3(e,3,a)}function br(e){return Math.trunc(e*p8)}function Sr(e){const a=e/u8;return Math.trunc(a)}function Cr(e,a){const n=(a==null?void 0:a.nearestTo)??1;if(n<1||n>12)return c1((a==null?void 0:a.in)||e,NaN);const c=z(e,a==null?void 0:a.in),s=c.getMinutes()/60,i=c.getSeconds()/60/60,r=c.getMilliseconds()/1e3/60/60,o=c.getHours()+s+i+r,p=(a==null?void 0:a.roundingMethod)??"round",u=m8(p)(o/n)*n;return c.setHours(u,0,0,0),c}function wr(e,a){const n=(a==null?void 0:a.nearestTo)??1;if(n<1||n>30)return c1(e,NaN);const c=z(e,a==null?void 0:a.in),s=c.getSeconds()/60,i=c.getMilliseconds()/1e3/60,r=c.getMinutes()+s+i,o=(a==null?void 0:a.roundingMethod)??"round",h=m8(o)(r/n)*n;return c.setMinutes(h,0,0),c}function Zr(e){const a=e/i4;return Math.trunc(a)}function kr(e){const a=e/r4;return Math.trunc(a)}function Tr(e,a,n){let c=z(e,n==null?void 0:n.in);return isNaN(+c)?c1((n==null?void 0:n.in)||e,NaN):(a.year!=null&&c.setFullYear(a.year),a.month!=null&&(c=o4(c,a.month)),a.date!=null&&c.setDate(a.date),a.hours!=null&&c.setHours(a.hours),a.minutes!=null&&c.setMinutes(a.minutes),a.seconds!=null&&c.setSeconds(a.seconds),a.milliseconds!=null&&c.setMilliseconds(a.milliseconds),c)}function Er(e,a,n){const c=z(e,n==null?void 0:n.in);return c.setMonth(0),c.setDate(a),c}function Ar(e){const a={},n=$2();for(const c in n)Object.prototype.hasOwnProperty.call(n,c)&&(a[c]=n[c]);for(const c in e)Object.prototype.hasOwnProperty.call(e,c)&&(e[c]===void 0?delete a[c]:a[c]=e[c]);Gt(a)}function Ir(e,a,n){const c=z(e,n==null?void 0:n.in),s=Math.trunc(c.getMonth()/3)+1,i=a-s;return o4(c,c.getMonth()+i*3)}function Dr(e,a,n){var p,h,u,v;const c=$2(),s=(n==null?void 0:n.firstWeekContainsDate)??((h=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??c.firstWeekContainsDate??((v=(u=c.locale)==null?void 0:u.options)==null?void 0:v.firstWeekContainsDate)??1,i=Z3(z(e,n==null?void 0:n.in),Le(e,n),n),r=c1((n==null?void 0:n.in)||e,0);r.setFullYear(a,0,s),r.setHours(0,0,0,0);const o=Le(r,n);return o.setDate(o.getDate()+i),o}function Rr(e,a){const n=z(e,a==null?void 0:a.in),c=n.getFullYear(),s=Math.floor(c/10)*10;return n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}function Or(e){return v8(Date.now(),e)}function _r(e){const a=R1(e==null?void 0:e.in),n=a.getFullYear(),c=a.getMonth(),s=a.getDate(),i=c1(e==null?void 0:e.in,0);return i.setFullYear(n,c,s+1),i.setHours(0,0,0,0),i}function Pr(e){const a=R1(e==null?void 0:e.in),n=a.getFullYear(),c=a.getMonth(),s=a.getDate(),i=R1(e==null?void 0:e.in);return i.setFullYear(n,c,s-1),i.setHours(0,0,0,0),i}function Fr(e,a,n){return f7(e,-a,n)}function $r(e,a,n){return g8(e,-a,n)}function Vr(e,a,n){return f8(e,-a,n)}function Mr(e,a,n){return c4(e,-a,n)}function Lr(e,a,n){return x8(e,-a,n)}function Br(e,a,n){return s4(e,-a,n)}function Nr(e){return Math.trunc(e*U6)}function zr(e){return Math.trunc(e*Me)}function Ur(e){return Math.trunc(e*h8)}function Wr(e){return Math.trunc(e*u8)}const Hr=Object.freeze(Object.defineProperty({__proto__:null,add:G3,addBusinessDays:f7,addDays:A2,addHours:g8,addISOWeekYears:j7,addMilliseconds:f8,addMinutes:c4,addMonths:Jt,addQuarters:W6,addSeconds:x8,addWeeks:s4,addYears:Qt,areIntervalsOverlapping:As,clamp:Is,closestIndexTo:S7,closestTo:Ds,compareAsc:_e,compareDesc:Rs,constructFrom:c1,constructNow:R1,daysToWeeks:Os,differenceInBusinessDays:_s,differenceInCalendarDays:Z3,differenceInCalendarISOWeekYears:C7,differenceInCalendarISOWeeks:Ps,differenceInCalendarMonths:Fe,differenceInCalendarQuarters:r0,differenceInCalendarWeeks:j0,differenceInCalendarYears:s0,differenceInDays:n8,differenceInHours:h0,differenceInISOWeekYears:Fs,differenceInMilliseconds:Xt,differenceInMinutes:u0,differenceInMonths:a8,differenceInQuarters:ea,differenceInSeconds:k2,differenceInWeeks:ta,differenceInYears:t8,eachDayOfInterval:Z7,eachHourOfInterval:$s,eachMinuteOfInterval:Vs,eachMonthOfInterval:Ms,eachQuarterOfInterval:Ls,eachWeekOfInterval:aa,eachWeekendOfInterval:_4,eachWeekendOfMonth:Bs,eachWeekendOfYear:Ns,eachYearOfInterval:zs,endOfDay:G6,endOfDecade:Us,endOfHour:na,endOfISOWeek:Ws,endOfISOWeekYear:Hs,endOfMinute:ca,endOfMonth:H6,endOfQuarter:sa,endOfSecond:ia,endOfToday:qs,endOfTomorrow:Ys,endOfWeek:K6,endOfYear:Y6,endOfYesterday:Ks,format:Pe,formatDate:Pe,formatDistance:ra,formatDistanceStrict:oa,formatDistanceToNow:la,formatDistanceToNowStrict:da,formatDuration:Js,formatISO:k7,formatISO9075:Qs,formatISODuration:Xs,formatRFC3339:ei,formatRFC7231:ni,formatRelative:ci,formatters:pa,fromUnixTime:ha,getDate:Q6,getDay:G0,getDayOfYear:ua,getDaysInMonth:ma,getDaysInYear:si,getDecade:ii,getDefaultOptions:va,getHours:ga,getISODay:fa,getISOWeek:xa,getISOWeekYear:X3,getISOWeeksInYear:ri,getMilliseconds:ja,getMinutes:ya,getMonth:ba,getOverlappingDaysInIntervals:oi,getQuarter:He,getSeconds:Sa,getTime:li,getUnixTime:di,getWeek:Ca,getWeekOfMonth:pi,getWeekYear:wa,getWeeksInMonth:hi,getYear:Za,hoursToMilliseconds:ui,hoursToMinutes:mi,hoursToSeconds:vi,interval:gi,intervalToDuration:fi,intlFormat:xi,intlFormatDistance:yi,isAfter:ka,isBefore:j8,isDate:Ta,isEqual:Ea,isExists:bi,isFirstDayOfMonth:Si,isFriday:Ci,isFuture:wi,isLastDayOfMonth:Aa,isLeapYear:T7,isMatch:Zi,isMonday:ki,isPast:Ia,isSameDay:a4,isSameHour:s8,isSameISOWeek:A7,isSameISOWeekYear:Ti,isSameMinute:I7,isSameMonth:i8,isSameQuarter:D7,isSameSecond:R7,isSameWeek:P4,isSameYear:r8,isSaturday:v7,isSunday:g7,isThisHour:Ei,isThisISOWeek:Ai,isThisMinute:Ii,isThisMonth:Di,isThisQuarter:Ri,isThisSecond:Oi,isThisWeek:_i,isThisYear:Pi,isThursday:Fi,isToday:Da,isTomorrow:Ra,isTuesday:$i,isValid:k3,isWednesday:Vi,isWeekend:Q3,isWithinInterval:Oa,isYesterday:Mi,lastDayOfDecade:Li,lastDayOfISOWeek:Bi,lastDayOfISOWeekYear:Ni,lastDayOfMonth:E7,lastDayOfQuarter:zi,lastDayOfWeek:o8,lastDayOfYear:Ui,lightFormat:Ki,lightFormatters:l8,longFormatters:_a,max:y7,milliseconds:Ji,millisecondsToHours:Qi,millisecondsToMinutes:Xi,millisecondsToSeconds:er,min:b7,minutesToHours:tr,minutesToMilliseconds:ar,minutesToSeconds:nr,monthsToQuarters:cr,monthsToYears:sr,nextDay:R3,nextFriday:ir,nextMonday:rr,nextSaturday:or,nextSunday:lr,nextThursday:dr,nextTuesday:pr,nextWednesday:hr,parse:c8,parseISO:Pa,parseJSON:ur,parsers:Fa,previousDay:O3,previousFriday:mr,previousMonday:vr,previousSaturday:gr,previousSunday:fr,previousThursday:xr,previousTuesday:jr,previousWednesday:yr,quartersToMonths:br,quartersToYears:Sr,roundToNearestHours:Cr,roundToNearestMinutes:wr,secondsToHours:Zr,secondsToMilliseconds:$a,secondsToMinutes:kr,set:Tr,setDate:Va,setDay:Ma,setDayOfYear:Er,setDefaultOptions:Ar,setHours:La,setISODay:Ba,setISOWeek:Na,setISOWeekYear:x7,setMilliseconds:za,setMinutes:Ua,setMonth:o4,setQuarter:Ir,setSeconds:Wa,setWeek:Ha,setWeekYear:Dr,setYear:qa,startOfDay:v8,startOfDecade:Rr,startOfHour:Ya,startOfISOWeek:I2,startOfISOWeekYear:B3,startOfMinute:$e,startOfMonth:E0,startOfQuarter:V3,startOfSecond:Ve,startOfToday:Or,startOfTomorrow:_r,startOfWeek:D2,startOfWeekYear:Le,startOfYear:q6,startOfYesterday:Pr,sub:Ka,subBusinessDays:Fr,subDays:A0,subHours:$r,subISOWeekYears:w7,subMilliseconds:Vr,subMinutes:Mr,subMonths:Ga,subQuarters:Ja,subSeconds:Lr,subWeeks:Br,subYears:Qa,toDate:z,transpose:Xa,weeksToDays:Nr,yearsToDays:zr,yearsToMonths:Ur,yearsToQuarters:Wr},Symbol.toStringTag,{value:"Module"})),O7=e=>d.createElement("svg",{width:20,height:18,viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d.createElement("path",{d:"M14.125 0C15.7917 0 17.1875 0.616667 18.3125 1.85C19.4375 3.08333 20 4.55 20 6.25C20 6.55 19.9833 6.84583 19.95 7.1375C19.9167 7.42917 19.8583 7.71667 19.775 8H13.525L11.825 5.45C11.7417 5.31667 11.625 5.20833 11.475 5.125C11.325 5.04167 11.1667 5 11 5C10.7833 5 10.5875 5.06667 10.4125 5.2C10.2375 5.33333 10.1167 5.5 10.05 5.7L8.7 9.75L7.825 8.45C7.74167 8.31667 7.625 8.20833 7.475 8.125C7.325 8.04167 7.16667 8 7 8H0.225C0.141667 7.71667 0.0833333 7.42917 0.05 7.1375C0.0166667 6.84583 0 6.55833 0 6.275C0 4.55833 0.558333 3.08333 1.675 1.85C2.79167 0.616667 4.18333 0 5.85 0C6.65 0 7.40417 0.158333 8.1125 0.475C8.82083 0.791667 9.45 1.23333 10 1.8C10.5333 1.23333 11.1542 0.791667 11.8625 0.475C12.5708 0.158333 13.325 0 14.125 0ZM10 18C9.7 18 9.4125 17.9458 9.1375 17.8375C8.8625 17.7292 8.61667 17.5667 8.4 17.35L1.7 10.625C1.6 10.525 1.50833 10.425 1.425 10.325C1.34167 10.225 1.25833 10.1167 1.175 10H6.45L8.15 12.55C8.23333 12.6833 8.35 12.7917 8.5 12.875C8.65 12.9583 8.80833 13 8.975 13C9.19167 13 9.39167 12.9333 9.575 12.8C9.75833 12.6667 9.88333 12.5 9.95 12.3L11.3 8.25L12.15 9.55C12.25 9.68333 12.375 9.79167 12.525 9.875C12.675 9.95833 12.8333 10 13 10H18.8L18.55 10.3L18.3 10.6L11.575 17.35C11.3583 17.5667 11.1167 17.7292 10.85 17.8375C10.5833 17.9458 10.3 18 10 18Z"})),k5=l("div")(()=>({display:"flex"})),qr=l("div")(()=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",width:"100%"}));l("div")(()=>({display:"flex",flexDirection:"column"}));const Yr=l("span")(({theme:e})=>({textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"})),Kr=l("span")(({theme:e})=>({fontSize:e.fontSizes.smallBody,fontWeight:"normal"}));l(Kr)(({theme:e})=>({color:e.palette.neutral.dark}));const Gr=l(en)(({theme:e})=>({marginLeft:e.spacing(-1.5)})),Jr=l("div")(({theme:e})=>({backgroundColor:e.palette.background.paper,borderRadius:e.shape.borderRadiusLarge,marginBottom:e.spacing(2)})),Qr=l("div")(({theme:e})=>({padding:e.spacing(2.5,5),display:"flex",flexDirection:"column",alignItems:"start"})),Xr=l("h1")(({theme:e})=>({margin:0,width:"100%",fontSize:e.typography.h1.fontSize,fontWeight:"bold",display:"flex",alignItems:"center",gap:e.spacing(2),overflow:"hidden",lineHeight:1.5})),eo=l("div")(({theme:e})=>({width:"100%",backgroundColor:e.palette.divider,height:"1px"})),to=l("div")(({theme:e})=>({padding:e.spacing(0,4)})),ao=l(m0)(({theme:e})=>({textTransform:"none",flexBasis:0,[e.breakpoints.down("md")]:{paddingLeft:e.spacing(1),paddingRight:e.spacing(1),minWidth:170},[e.breakpoints.up("md")]:{minWidth:170}}));var F4={},no=N1;Object.defineProperty(F4,"__esModule",{value:!0});var _7=F4.default=void 0,co=no(B1()),so=t,io=(0,co.default)((0,so.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9h-4v4h-2v-4H9V9h4V5h2v4h4v2z"}),"LibraryAdd");_7=F4.default=io;var $4={},ro=N1;Object.defineProperty($4,"__esModule",{value:!0});var P7=$4.default=void 0,oo=ro(B1()),lo=t,po=(0,oo.default)((0,lo.jsx)("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5 6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z"}),"Archive");P7=$4.default=po;var V4={},ho=N1;Object.defineProperty(V4,"__esModule",{value:!0});var y0=V4.default=void 0,uo=ho(B1()),mo=t,vo=(0,uo.default)((0,mo.jsx)("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");y0=V4.default=vo;const go=l(S)(({theme:e})=>({display:"flex",justifyContent:"center",paddingRight:e.spacing(2)})),fo=({projectId:e,row:a,onOpenArchiveDialog:n,onOpenStaleDialog:c})=>{const[s,i]=d.useState(null),[r,o]=d.useState(!1),{setToastData:p}=f1(),{original:{name:h,stale:u}}=a,v=!!s,m=x=>{i(x.currentTarget)},g=()=>{i(null)},f=`feature-${h}-actions`,j=`${f}-menu`,b=()=>{try{b8(h),o(!0),setTimeout(()=>{g(),o(!1)},1e3)}catch{p({type:"error",text:"Could not copy feature name"})}};return t.jsxs(go,{children:[t.jsx(O1,{title:"Feature flag actions",arrow:!0,describeChild:!0,children:t.jsx(x1,{id:f,"data-loading":!0,"aria-controls":v?j:void 0,"aria-haspopup":"true","aria-expanded":v?"true":void 0,onClick:m,type:"button",children:t.jsx(l4,{})})}),t.jsx(V2,{id:j,anchorEl:s,open:v,onClose:g,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},disableScrollLock:!0,PaperProps:{sx:x=>({borderRadius:`${x.shape.borderRadius}px`,padding:x.spacing(1,1.5)})},children:t.jsxs(M2,{"aria-labelledby":f,children:[t.jsxs(q1,{sx:M3,onClick:b,children:[t.jsx(a3,{children:r?t.jsx(s2,{}):t.jsx(y8,{})}),t.jsx(Y1,{children:t.jsx(T,{variant:"body2",children:r?"Copied!":"Copy Name"})})]}),t.jsx(n3,{projectId:e,permission:I0,children:({hasAccess:x})=>t.jsxs(q1,{sx:M3,onClick:g,disabled:!x,component:d1,to:`/projects/${e}/features/${h}/copy`,children:[t.jsx(a3,{children:t.jsx(_7,{})}),t.jsx(Y1,{children:t.jsx(T,{variant:"body2",children:"Clone"})})]})}),t.jsx(n3,{projectId:e,permission:D0,children:({hasAccess:x})=>t.jsxs(q1,{sx:M3,onClick:()=>{n(h),g()},disabled:!x,children:[t.jsx(a3,{children:t.jsx(P7,{})}),t.jsx(Y1,{children:t.jsx(T,{variant:"body2",children:"Archive"})})]})}),t.jsx(n3,{projectId:e,permission:R0,children:({hasAccess:x})=>t.jsxs(q1,{sx:M3,onClick:()=>{g(),c({featureId:h,stale:u===!0})},disabled:!x,children:[t.jsx(a3,{children:t.jsx(y0,{})}),t.jsx(Y1,{children:t.jsxs(T,{variant:"body2",children:[u?"Un-mark":"Mark"," as stale"]})})]})})]})})]})},xo=l(S)(({theme:e})=>({display:"flex",justifyContent:"center",marginRight:e.spacing(-2)})),jo=({onChange:e,checked:a,title:n})=>t.jsx(xo,{"data-testid":tn,children:t.jsx(L2,{onChange:e,title:n,checked:a,"data-loading":!0})}),T5=y3.memo(jo),yo=l("div")(({theme:e})=>({position:"sticky",bottom:50,zIndex:e.zIndex.fab,pointerEvents:"none"})),bo=l(S)(({theme:e})=>({display:"flex",justifyContent:"center",width:"100%",flexWrap:"wrap",paddingBottom:e.spacing(2)})),So=l(b3)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",marginTop:e.spacing(2),marginLeft:"auto",marginRight:"auto",padding:e.spacing(2,3),backgroundColor:e.palette.background.paper,border:`1px solid ${e.palette.background.alternative}`,borderRadius:e.shape.borderRadiusLarge,gap:e.spacing(1),flexWrap:"wrap",pointerEvents:"auto"})),Co=l("span")(({theme:e})=>({background:e.palette.background.alternative,color:e.palette.common.white,padding:e.spacing(.5,1),borderRadius:e.shape.borderRadius})),wo=l(T)(({theme:e})=>({paddingRight:e.spacing(2),marginRight:"auto"})),Zo=({count:e,children:a})=>e===0?null:t.jsx(yo,{"data-testid":an,children:t.jsx(bo,{children:t.jsxs(So,{elevation:4,children:[t.jsxs(wo,{children:[t.jsx(Co,{"data-testid":nn,children:e})," selected"]}),a]})})}),ko=e=>{const a=A2(new Date,-7);return!!(e!=null&&e.lastSeenAt&&j8(new Date(e.lastSeenAt),a))},To=({projectId:e,featureIds:a,features:n,onConfirm:c})=>{const[s,i]=d.useState(!1),{trackEvent:r}=u1(),o=d.useMemo(()=>a.filter(h=>{const u=n.find(v=>v.name===h);return ko(u)}),[JSON.stringify(n),a]),p=async()=>{i(!1),c==null||c(),r("batch_operations",{props:{eventType:"features archived"}})};return t.jsxs(t.Fragment,{children:[t.jsx(n3,{projectId:e,permission:D0,children:({hasAccess:h})=>t.jsx("span",{children:t.jsx(J,{disabled:!h||s,variant:"outlined",size:"small",onClick:()=>i(!0),children:"Archive"})})}),t.jsx(h7,{projectId:e,featureIds:a,featuresWithUsage:o,onConfirm:p,isOpen:s,onClose:()=>i(!1)})]})},Q2="selection-actions-menu",Eo=({projectId:e,data:a,onChange:n})=>{const[c,s]=d.useState(null),{staleFeatures:i}=A3(),{setToastData:r,setToastApiError:o}=f1(),{trackEvent:p}=u1(),h=!!c,u=a.map(({name:x})=>x),v=x=>{s(x.currentTarget)},m=()=>{s(null)},g=a.some(({stale:x})=>x===!0),f=a.some(({stale:x})=>x===!1),j=async()=>{try{m(),await i(e,u),n==null||n(),r({text:"Feature flags marked as stale",type:"success"}),p("batch_operations",{props:{eventType:"features staled"}})}catch(x){o(h1(x))}},b=async()=>{try{m(),await i(e,u,!1),n==null||n(),r({text:"Feature flags unmarked as stale",type:"success"}),p("batch_operations",{props:{eventType:"features unstaled"}})}catch(x){o(h1(x))}};return t.jsxs(t.Fragment,{children:[t.jsx(O1,{title:"More bulk actions",arrow:!0,describeChild:!0,children:t.jsx(x1,{id:Q2,"aria-controls":h?Q2:void 0,"aria-haspopup":"true","aria-expanded":h?"true":void 0,onClick:v,type:"button","data-testid":cn,children:t.jsx(l4,{})})}),t.jsx(V2,{id:`${Q2}-menu`,anchorEl:c,open:h,onClose:m,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},disableScrollLock:!0,PaperProps:{sx:x=>({borderRadius:`${x.shape.borderRadius}px`,padding:x.spacing(1,1.5)})},children:t.jsx(M2,{"aria-labelledby":`${Q2}-menu`,children:t.jsx(n3,{projectId:e,permission:R0,children:({hasAccess:x})=>t.jsxs(t.Fragment,{children:[t.jsx(D,{condition:f,show:()=>t.jsxs(q1,{onClick:j,disabled:!x,sx:{borderRadius:C=>`${C.shape.borderRadius}px`},children:[t.jsx(a3,{children:t.jsx(y0,{})}),t.jsx(Y1,{children:t.jsx(T,{variant:"body2",children:"Mark as stale"})})]})}),t.jsx(D,{condition:g,show:()=>t.jsxs(q1,{onClick:b,disabled:!x,sx:{borderRadius:C=>`${C.shape.borderRadius}px`},children:[t.jsx(a3,{children:t.jsx(y0,{})}),t.jsx(Y1,{children:t.jsx(T,{variant:"body2",children:"Un-mark as stale"})})]})})]})})})})]})},Ao=l("section")(({theme:e})=>({"& > *":{margin:e.spacing(1,0)}})),E5="manage-tags-form",A5=(e,a)=>[...e,...e.some(n=>n.value===a.value&&n.type===a.type)?[]:[a]],I5=(e,a)=>e.filter(n=>!(n.value===a.value&&n.type===a.type)),Io=(e,a)=>{switch(a.type){case"add":return{...e,addedTags:A5(e.addedTags,a.payload),removedTags:I5(e.removedTags,a.payload)};case"remove":return{...e,addedTags:I5(e.addedTags,a.payload),removedTags:A5(e.removedTags,a.payload)};case"clear":return{addedTags:[],removedTags:a.payload};case"reset":return{addedTags:[],removedTags:[]};default:return e}},D5={name:"",description:"",icon:""},Do=({open:e,initialValues:a,initialIndeterminateValues:n,onCancel:c,onSubmit:s})=>{const{tagTypes:i,loading:r}=sn(),[o,p]=d.useState(D5),[h,u]=d.useState([]),[v,m]=d.useState([]),{tags:g,refetch:f}=is(o.name),{createTag:j}=u7(),b=g.map(({value:$})=>({title:$})),[x,C]=d.useReducer(Io,{addedTags:[],removedTags:[]}),E=()=>{s(x),C({type:"reset"})},M=($=i.length>0?i[0]:D5)=>{p($);const F=n.filter(({type:R})=>R===$.name);u(a.filter(({type:R})=>R===$.name).filter(({type:R,value:N})=>!F.some(H=>H.value===N&&H.type===R)).map(({value:R})=>({title:R}))),m(F.map(({value:R})=>({title:R}))),C({type:"clear",payload:[]})};d.useEffect(()=>{i.length>0&&M()},[r]);const k=($,F)=>{F!=null&&typeof F!="string"&&($.preventDefault(),M(F))},L=($,F)=>j({value:$,type:F}).then(async()=>{f(),u(R=>[...R,{title:$}]),C({type:"add",payload:{value:$,type:F}})}),Z=($,F,R,N)=>{R==="selectOption"?F.forEach(H=>{typeof H!="string"&&typeof H.inputValue=="string"&&H.inputValue&&H.title.startsWith("Create new value")&&L(H.inputValue,o.name),u(F),m(I=>I.filter(({title:U})=>U!==H.title)),N!=null&&N.option&&C({type:"add",payload:{value:N.option.title,type:o.name}})}):R==="clear"?(u([]),C({type:"clear",payload:a})):R==="removeOption"&&(u(F),N!=null&&N.option&&C({type:"remove",payload:{value:N.option.title,type:o.name}}))},_=()=>{M(),c()};return t.jsxs(X1,{open:e,secondaryButtonText:"Cancel",primaryButtonText:"Save tags",title:"Update feature flag tags",onClick:E,disabledPrimaryButton:x.addedTags.length===0&&x.removedTags.length===0,onClose:_,formId:E5,children:[t.jsx(T,{paragraph:!0,sx:{marginBottom:$=>$.spacing(2.5)},children:"Tags allow you to group features together"}),t.jsx("form",{id:E5,onSubmit:E,children:t.jsxs(Ao,{children:[t.jsx(rs,{options:i,disabled:r||i.length===0,value:o,onChange:k},r?"loading":i.length),t.jsx(D,{condition:!r&&i.length===0,show:t.jsxs(T,{variant:"body1",children:["No"," ",t.jsx(G1,{component:d1,to:"/tag-types",children:"tag types"})," ","available."]}),elseShow:t.jsx(os,{disabled:r,options:b,existingTags:a,indeterminateOptions:v,tagType:o,selectedOptions:h,onChange:Z})})]})})]})},Ro=({projectId:e,data:a,onChange:n})=>{const{bulkUpdateTags:c}=u7(),{setToastData:s,setToastApiError:i}=f1(),{trackEvent:r}=u1(),[o,p]=d.useState(!1),[h,u]=d.useMemo(()=>{const m=a.flatMap(({tags:f})=>f||[]).reduce((f,j)=>[...f,...f.some(b=>b.type===j.type&&b.value===j.value)?[]:[j]],[]),g=m.filter(f=>!a.every(({tags:j})=>j==null?void 0:j.some(b=>b.type===f.type&&b.value===f.value)));return[m,g]},[a]),v=async({addedTags:m,removedTags:g})=>{const j={features:a.map(({name:b})=>b),tags:{addedTags:m,removedTags:g}};try{const b=[m.length>0&&`added ${m.length} tag${m.length>1?"s":""}`,g.length>0&&`removed ${g.length} tag${g.length>1?"s":""}`].filter(Boolean).join(" and ");await c(j,e),s({text:b,type:"success",autoHideDuration:12e3}),r("batch_operations",{props:{eventType:"tags updated"}})}catch(b){i(h1(b))}n==null||n(),p(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(n3,{projectId:e,permission:R0,children:({hasAccess:m})=>t.jsx("span",{children:t.jsx(J,{disabled:!m||o,variant:"outlined",size:"small",onClick:()=>p(!0),children:"Tags"})})}),t.jsx(Do,{open:o,onCancel:()=>p(!1),onSubmit:v,initialValues:h,initialIndeterminateValues:u},a.length)]})},Oo=l(i2)(({theme:e})=>({minWidth:"450px",marginTop:e.spacing(2),marginBottom:e.spacing(1.5)})),R5=l(j1)(({theme:e})=>({marginBottom:e.spacing(1.5)})),_o=({showExportDialog:e,data:a,onClose:n,onConfirm:c,environments:s,projectId:i})=>{const[r,o]=d.useState(s[0]),{bulkToggleFeaturesEnvironmentOff:p}=d4(),{addChange:h}=B2(),{setToastApiError:u,setToastData:v}=f1(),{isChangeRequestConfigured:m}=N2(i),{refetch:g}=O0(i),f=a.filter(C=>{var E,M;return((M=(E=C.environments)==null?void 0:E.find(k=>r===k.name))==null?void 0:M.enabled)===!1}).length,j=()=>s.map(C=>({key:C,label:C})),b=async()=>{try{m(r)?(await h(i,r,a.map(C=>({action:"updateEnabled",feature:C.name,payload:{enabled:!1}}))),g(),v({type:"success",text:"Changes added to draft"})):(await p(i,a.map(C=>C.name),r),v({type:"success",text:"Feature flags disabled"})),n(),c==null||c()}catch(C){u(h1(C))}},x=m(r)?"Add to change request":"Disable flags";return t.jsx(X1,{open:e,title:"Disable feature flags",onClose:n,onClick:b,primaryButtonText:x,secondaryButtonText:"Cancel",children:t.jsxs(S,{children:["You have selected ",t.jsx("b",{children:a.length})," feature flags to disable.",t.jsx("br",{}),t.jsx("br",{}),t.jsx(T,{children:"Select which environment to disable the features for:"}),t.jsx(Oo,{options:j(),value:r,onChange:C=>o(C)}),t.jsx(D,{condition:m(r),show:t.jsx(R5,{severity:"warning",children:"Change requests are enabled for this environment."})}),t.jsx(D,{condition:f>0,show:t.jsxs(R5,{severity:"info",children:[f," feature"," ",f>1?"flags are ":"flag is ","already disabled."]})})]})})},Po=l(i2)(({theme:e})=>({minWidth:"450px",marginTop:e.spacing(2),marginBottom:e.spacing(1.5)})),O5=l(j1)(({theme:e})=>({marginBottom:e.spacing(1.5)})),Fo=({showExportDialog:e,data:a,onClose:n,onConfirm:c,environments:s,projectId:i})=>{const[r,o]=d.useState(s[0]),{bulkToggleFeaturesEnvironmentOn:p}=d4(),{addChange:h}=B2(),{setToastApiError:u,setToastData:v}=f1(),{isChangeRequestConfigured:m}=N2(i),{refetch:g}=O0(i),f=a.filter(C=>{var E,M;return((M=(E=C.environments)==null?void 0:E.find(k=>r===k.name))==null?void 0:M.enabled)===!0}).length,j=()=>s.map(C=>({key:C,label:C})),b=async()=>{try{m(r)?(await h(i,r,a.map(C=>({action:"updateEnabled",feature:C.name,payload:{enabled:!0}}))),g(),v({type:"success",text:"Changes added to draft"})):(await p(i,a.map(C=>C.name),r),v({type:"success",text:"Feature flags enabled"})),n(),c==null||c()}catch(C){u(h1(C))}},x=m(r)?"Add to change request":"Enable flags";return t.jsx(X1,{open:e,title:"Enable feature flags",onClose:n,onClick:b,primaryButtonText:x,secondaryButtonText:"Cancel",children:t.jsxs(S,{children:["You have selected ",t.jsx("b",{children:a.length})," feature flags to enable.",t.jsx("br",{}),t.jsx("br",{}),t.jsx(T,{children:"Select which environment to enable the features for:"}),t.jsx(Po,{options:j(),value:r,onChange:C=>o(C)}),t.jsx(D,{condition:m(r),show:t.jsx(O5,{severity:"warning",children:"Change requests are enabled for this environment."})}),t.jsx(D,{condition:f>0,show:t.jsxs(O5,{severity:"info",children:[f," feature"," ",f>1?"flags are ":"flag is ","already enabled."]})})]})})},$o=({selectedIds:e,data:a,projectId:n,onResetSelection:c,onChange:s})=>{const[i,r]=d.useState(!1),[o,p]=d.useState(!1),[h,u]=d.useState(!1),{trackEvent:v}=u1(),m=d.useMemo(()=>a.filter(C=>e.includes(C.name)),[a,e]),g=d.useMemo(()=>{const C=m.flatMap(E=>E.environments).map(E=>E==null?void 0:E.name).filter(E=>E!==void 0);return Array.from(new Set(C))},[m]),f=()=>{s==null||s(),v("batch_operations",{props:{eventType:"features exported"}})},j=()=>{s==null||s(),v("batch_operations",{props:{eventType:"features enabled"}})},b=()=>{s==null||s(),v("batch_operations",{props:{eventType:"features disabled"}})},x=()=>{s==null||s(),c()};return t.jsxs(t.Fragment,{children:[t.jsx(J,{variant:"outlined",size:"small",onClick:()=>p(!0),children:"Enable"}),t.jsx(J,{variant:"outlined",size:"small",onClick:()=>u(!0),children:"Disable"}),t.jsx(To,{projectId:n,featureIds:e,features:a,onConfirm:x}),t.jsx(J,{variant:"outlined",size:"small",onClick:()=>r(!0),children:"Export"}),t.jsx(Ro,{projectId:n,data:m,onChange:s}),t.jsx(Eo,{projectId:n,data:m,onChange:s}),t.jsx(S8,{showExportDialog:i,data:m,onClose:()=>r(!1),environments:g,onConfirm:f}),t.jsx(Fo,{showExportDialog:o,data:m,onClose:()=>p(!1),environments:g,projectId:n,onConfirm:j}),t.jsx(_o,{showExportDialog:h,data:m,onClose:()=>u(!1),environments:g,projectId:n,onConfirm:b})]})},Vo=l(rn)(({theme:e})=>({color:e.palette.warning.main,fontSize:e.fontSizes.bodySize})),Mo=()=>t.jsx(t2,{arrow:!0,title:t.jsxs(t.Fragment,{children:["This environment has no variants enabled. If you check this feature's variants in this environment, you will get the"," ",t.jsx("a",{href:"https://docs.getunleash.io/concepts/feature-flag-variants#the-disabled-variant",target:"_blank",rel:"noreferrer",children:"disabled variant"}),"."]}),children:t.jsx(Vo,{})}),F7=l("div",{shouldForwardProp:e=>e!=="hasWarning"})(({theme:e,hasWarning:a})=>({flexGrow:0,..._0,justifyContent:"center",...a&&{"::before":{content:'""',display:"block",width:e.spacing(2)}}})),Lo=l("div")(({theme:e})=>({flexGrow:0,..._0,justifyContent:"center"})),Bo=({value:e,featureId:a,projectId:n,environment:c,isChangeRequestEnabled:s,someEnabledEnvironmentHasVariants:i,refetch:r,onFeatureToggleSwitch:o})=>{const p=d.useMemo(()=>i&&(c==null?void 0:c.variantCount)===0&&(c==null?void 0:c.enabled),[i,c]),h=(u,v)=>{var m;o(u,{projectId:n,featureId:a,environmentName:(c==null?void 0:c.name)||"",environmentType:c==null?void 0:c.type,hasStrategies:c==null?void 0:c.hasStrategies,hasReleasePlans:!!((m=c==null?void 0:c.releasePlans)!=null&&m.length),hasEnabledStrategies:c==null?void 0:c.hasEnabledStrategies,isChangeRequestEnabled:s,onRollback:v,onSuccess:r})};return t.jsxs(F7,{hasWarning:p,children:[t.jsx(ls,{projectId:n,value:e,featureId:a,environmentName:(c==null?void 0:c.name)||"",onToggle:h}),t.jsx(D,{condition:p||!1,show:t.jsx(Mo,{})})]})},No=y3.memo(Bo),zo=()=>t.jsx(F7,{children:t.jsx("div",{"data-loading":!0,children:"toggle"})}),Uo=()=>t.jsx(Lo,{"aria-hidden":"true",children:"-"}),Wo=e=>{const a=`api/admin/projects/${e}/flag-creators`,{data:n,refetch:c,error:s}=p4(I1(a),()=>h4(I1(a),"Flag creators"));return{flagCreators:n||[],refetch:c,error:s}},Ho=l(on)({padding:0}),_5=({state:e,onChange:a,project:n})=>{const{tags:c}=C8(),{flagCreators:s}=Wo(n),[i,r]=d.useState([]),o=r2("filterFavorites"),{trackEvent:p}=u1(),h=u=>{u.favorite!==e.favorite&&p("favorite",{props:{action:u.favorite?"filter-enabled":"filter-disabled"}}),a(u)};return d.useEffect(()=>{const u=(c||[]).map(f=>{const j=w8(f);return{label:j,value:j}}),v=s.map(f=>({label:f.name,value:String(f.id)})),g=[{label:"State",icon:"hexagon",options:[{label:"Active",value:"active"},{label:"Stale",value:"stale"},{label:"Potentially stale",value:"potentially-stale"}],filterKey:"state",singularOperators:["IS","IS_NOT"],pluralOperators:["IS_ANY_OF","IS_NONE_OF"]},{label:"Tags",icon:"label",options:u,filterKey:"tag",singularOperators:["INCLUDE","DO_NOT_INCLUDE"],pluralOperators:["INCLUDE_ALL_OF","INCLUDE_ANY_OF","EXCLUDE_IF_ANY_OF","EXCLUDE_ALL"]},{label:"Created date",icon:"today",options:[],filterKey:"createdAt",dateOperators:["IS_ON_OR_AFTER","IS_BEFORE"]},{label:"Last seen",icon:"monitor_heart",options:[],filterKey:"lastSeenAt",dateOperators:["IS_ON_OR_AFTER","IS_BEFORE"]},{label:"Flag type",icon:"flag",options:[{label:"Release",value:"release"},{label:"Experiment",value:"experiment"},{label:"Operational",value:"operational"},{label:"Kill switch",value:"kill-switch"},{label:"Permission",value:"permission"}],filterKey:"type",singularOperators:["IS","IS_NOT"],pluralOperators:["IS_ANY_OF","IS_NONE_OF"]},{label:"Created by",icon:"person",options:v,filterKey:"createdBy",singularOperators:["IS","IS_NOT"],pluralOperators:["IS_ANY_OF","IS_NONE_OF"]},...o?[{label:"Favorite",icon:"star",options:[{label:"True",value:"true"},{label:"False",value:"false"}],filterKey:"favorite",singularOperators:["IS"],pluralOperators:["IS_ANY_OF"]}]:[]];r(g)},[JSON.stringify(c),JSON.stringify(s),o]),t.jsx(Ho,{availableFilters:i,state:e,onChange:h})},qo=e=>`api/admin/projects/${e}/status`,Yo={activityCountByDate:[],r