unleash-server 6.0.0 → 6.0.2
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.
- package/dist/lib/features/feature-lifecycle/feature-lifecycle-service.d.ts.map +1 -1
- package/dist/lib/features/feature-lifecycle/feature-lifecycle-service.js +1 -1
- package/dist/lib/features/feature-lifecycle/feature-lifecycle-service.js.map +1 -1
- package/dist/lib/features/feature-lifecycle/feature-lifecycle-service.test.js +2 -2
- package/dist/lib/features/feature-lifecycle/feature-lifecycle-service.test.js.map +1 -1
- package/dist/lib/features/feature-lifecycle/feature-lifecycle.e2e.test.js +3 -3
- package/dist/lib/features/feature-lifecycle/feature-lifecycle.e2e.test.js.map +1 -1
- package/dist/lib/features/metrics/client-metrics/metrics-service-v2.d.ts +1 -1
- package/dist/lib/features/metrics/client-metrics/metrics-service-v2.d.ts.map +1 -1
- package/dist/lib/features/metrics/client-metrics/metrics-service-v2.js +2 -0
- package/dist/lib/features/metrics/client-metrics/metrics-service-v2.js.map +1 -1
- package/dist/lib/types/events.d.ts +1 -0
- package/dist/lib/types/events.d.ts.map +1 -1
- package/dist/lib/types/events.js +5 -4
- package/dist/lib/types/events.js.map +1 -1
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/{AdvancedPlayground-DIV201O4.js → AdvancedPlayground-p7tDUOqb.js} +1 -1
- package/frontend/build/static/{CheckCircleOutline-DDRfoMo-.js → CheckCircleOutline-CZoWHYza.js} +1 -1
- package/frontend/build/static/{CreateProject-CP51S2Nl.js → CreateProject-DhmoT0x8.js} +1 -1
- package/frontend/build/static/{FeatureMetricsChart-C22E7CHm.js → FeatureMetricsChart-CrJhmvRS.js} +1 -1
- package/frontend/build/static/{FeatureStaleDialog-CYuAeCFM.js → FeatureStaleDialog-z-UTple3.js} +1 -1
- package/frontend/build/static/{FeatureViewLazyExport-Bk1x90Kb.js → FeatureViewLazyExport-BOJHJp48.js} +2 -2
- package/frontend/build/static/{LazyAdminExport-Bq-oujr9.js → LazyAdminExport-BfaFcAaS.js} +2 -2
- package/frontend/build/static/{LazyProjectExport-DkbRhMrD.js → LazyProjectExport-DbkNqnlj.js} +13 -13
- package/frontend/build/static/{LineChartComponent-DvXrMkk5.js → LineChartComponent-CLaoKci9.js} +1 -1
- package/frontend/build/static/{NetworkOverview-D6owvVGW.js → NetworkOverview-Cq83oqfi.js} +1 -1
- package/frontend/build/static/{NetworkTraffic-D1BTTyb9.js → NetworkTraffic-Bt6v3FUz.js} +1 -1
- package/frontend/build/static/{NetworkTrafficUsage-BzhZdcFn.js → NetworkTrafficUsage-Dv8h54l9.js} +1 -1
- package/frontend/build/static/{ProjectForm-DAM_SI2w.js → ProjectForm-CrLtsMQu.js} +1 -1
- package/frontend/build/static/{ReactJSONEditor-DDbLRmis.js → ReactJSONEditor-C-nON7ak.js} +1 -1
- package/frontend/build/static/{RoleCell-C3ZKNTZg.js → RoleCell-6hhnTvjl.js} +1 -1
- package/frontend/build/static/{StrategyItemContainer-HujAs_3i.js → StrategyItemContainer-BDY93O1W.js} +1 -1
- package/frontend/build/static/{index-C5Of-pcr.js → index-DZdOsPxT.js} +1 -1
- package/frontend/build/static/{index-CamDenZi.js → index-lGwH-xa2.js} +6 -6
- package/frontend/build/static/{unknownify-Cate6SHg.js → unknownify-D-iKcXLX.js} +1 -1
- package/frontend/build/static/{useApiTokens-DSkTQEX_.js → useApiTokens-BhaMXLXr.js} +1 -1
- package/package.json +1 -1
package/frontend/build/static/{LineChartComponent-DvXrMkk5.js → LineChartComponent-CLaoKci9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as c,j as a,B as p,z as f,T as y,O as h,a as m,bb as S,r as u,C,hA as j,hB as I,hC as v,hD as L,hE as w,hF as k,hG as z,hH as A,hI as R}from"./index-
|
|
1
|
+
import{s as c,j as a,B as p,z as f,T as y,O as h,a as m,bb as S,r as u,C,hA as j,hB as I,hC as v,hD as L,hE as w,hF as k,hG as z,hH as A,hI as R}from"./index-lGwH-xa2.js";import{L as B}from"./index-DZdOsPxT.js";const E=c("ul")(({theme:e})=>({listStyle:"none",margin:0,padding:0})),P=c("li")(({theme:e})=>({marginBottom:e.spacing(.5),display:"flex",alignItems:"center"})),T=c("span")(({theme:e})=>({display:"inline-block",width:8,height:8,borderRadius:"50%",marginRight:e.spacing(1)})),g=16,D=e=>e==="left"?"flex-start":e==="right"?"flex-end":"center",O=(e=0,t)=>t==="left"?e+g:t==="right"?e-g:e,b=({tooltip:e,children:t})=>a.jsx(p,{sx:n=>({top:((e==null?void 0:e.caretY)||0)+g,left:O(e==null?void 0:e.caretX,e==null?void 0:e.align),width:"1px",position:"absolute",display:e?"flex":"none",pointerEvents:"none",zIndex:n.zIndex.tooltip,flexDirection:"column",alignItems:D(e==null?void 0:e.align)}),children:t}),Y=({tooltip:e})=>a.jsx(b,{tooltip:e,children:a.jsxs(f,{elevation:3,sx:t=>({width:220,padding:t.spacing(1.5,2)}),children:[a.jsx(y,{variant:"body2",sx:t=>({marginBottom:t.spacing(1),color:t.palette.text.secondary}),children:e==null?void 0:e.title}),a.jsx(E,{children:e==null?void 0:e.body.map(t=>a.jsxs(P,{children:[a.jsx(T,{sx:{backgroundColor:t.color},children:" "}),a.jsx(y,{variant:"body2",sx:{display:"inline-block"},children:t.title})]},h(t)))})]})}),_=e=>t=>{var s,r;const n=t.tooltip;if(n.opacity===0){e(null);return}e({caretX:n==null?void 0:n.caretX,caretY:n==null?void 0:n.caretY,title:((s=n==null?void 0:n.title)==null?void 0:s.join(" "))||"",align:n==null?void 0:n.xAlign,body:((r=n==null?void 0:n.body)==null?void 0:r.map((i,o)=>{var l,d,x;return{title:(l=i==null?void 0:i.lines)==null?void 0:l.join(" "),color:(x=(d=n==null?void 0:n.labelColors)==null?void 0:d[o])==null?void 0:x.borderColor,value:""}}))||[],dataPoints:(n==null?void 0:n.dataPoints)||[]})},F={position:"bottom",labels:{boxWidth:12,padding:30,generateLabels:e=>{var o;const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:r,color:i}}=((o=e==null?void 0:e.legend)==null?void 0:o.options)||{labels:{}};return e._getSortedDatasetMetas().map(l=>{const d=l.controller.getStyle(n?0:void 0);return{text:t[l.index].label,fillStyle:d.borderColor,fontColor:i,hidden:!l.visible,lineWidth:0,borderRadius:6,strokeStyle:d.borderColor,pointStyle:s||d.pointStyle,textAlign:r||d.textAlign,datasetIndex:l.index}})}}},G=(e,t,n,s)=>({responsive:!0,...s?{animation:{duration:0}}:{},plugins:{legend:{...F,display:!s},tooltip:{enabled:!1,position:"nearest",interaction:{axis:"xy",mode:"nearest"},external:_(n)}},locale:t.locale,interaction:{intersect:!1,axis:"xy",mode:"nearest"},elements:{point:{radius:0,hitRadius:15}},tension:.1,color:e.palette.text.secondary,scales:{y:{beginAtZero:!0,type:"linear",grid:{color:e.palette.divider,borderColor:e.palette.divider},ticks:{color:e.palette.text.secondary,display:!s,precision:0}},x:{type:"time",time:{unit:"week",tooltipFormat:"PPP"},grid:{color:"transparent",borderColor:"transparent"},ticks:{color:e.palette.text.secondary,display:!s,source:"data",maxRotation:90,minRotation:23.5}}}}),H=c("div")(({theme:e})=>({position:"relative"})),M=c("div")(({theme:e})=>({position:"absolute",inset:0,display:"flex",zIndex:e.zIndex.appBar,"&::before":{zIndex:e.zIndex.fab,content:'""',position:"absolute",inset:0,backgroundColor:e.palette.background.paper,opacity:.8}})),W=c("div")(({theme:e})=>({zIndex:e.zIndex.modal,margin:"auto",color:e.palette.text.secondary,textAlign:"center"})),X={id:"customLine",afterDraw:e=>{var n;if((n=e.tooltip)!=null&&n.opacity&&e.tooltip.x){const s=e.tooltip.caretX,r=e.scales.y,i=e.ctx;i.save();const o=i.createLinearGradient(s,r.top,s,r.bottom);o.addColorStop(0,"rgba(129, 122, 254, 0)"),o.addColorStop(1,"rgba(129, 122, 254, 0.12)"),i.fillStyle=o,i.fillRect(s-26/2,r.top,26,r.bottom-r.top),i.restore()}}},J=({data:e,aspectRatio:t=2.5,cover:n,overrideOptions:s,TooltipComponent:r})=>{const i=m(),{locationSettings:o}=S(),[l,d]=u.useState(null),x=u.useMemo(()=>({...G(i,o,d,!!n),...s}),[i,o,s,n]);return a.jsxs(H,{children:[a.jsx(B,{options:x,data:e,plugins:[X],height:100,width:100*t},n?"cover":"chart"),a.jsx(C,{condition:!n,show:r?a.jsx(b,{tooltip:l,children:a.jsx(r,{tooltip:l})}):a.jsx(Y,{tooltip:l}),elseShow:a.jsx(M,{children:a.jsx(W,{children:n!==!0?n:" "})})})]})};j.register(I,v,L,w,k,z,A,R);export{J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as i,T as d,cI as g,a as x,r as u,j as t,K as y,hM as c,hN as m,hO as f,hP as j}from"./index-
|
|
1
|
+
import{s as i,T as d,cI as g,a as x,r as u,j as t,K as y,hM as c,hN as m,hO as f,hP as j}from"./index-lGwH-xa2.js";import{u as b,a as h}from"./unknownify-D-iKcXLX.js";const v=i("div")(({theme:e})=>({marginBottom:e.spacing(18),display:"flex",justifyContent:"center"})),w=i("div")(({theme:e})=>({display:"flex",justifyContent:"center",gap:e.spacing(4),flexWrap:"wrap"})),p=i("div")(({theme:e})=>({borderRadius:e.shape.borderRadiusMedium,border:"1px solid",borderColor:e.palette.secondary.border,backgroundColor:e.palette.secondary.light,display:"flex",flexDirection:"column",alignItems:"center",padding:e.spacing(1.5),zIndex:1,"& > svg":{width:e.spacing(9),height:e.spacing(9)}})),S=i(d)(({theme:e})=>({fontWeight:e.fontWeight.bold})),k=i(d)(({theme:e})=>({fontSize:e.fontSizes.smallBody,color:e.palette.text.secondary})),A=i(d)(({theme:e})=>({fontSize:e.fontSizes.smallerBody,color:e.palette.text.secondary})),q=e=>e[0]*1e3>new Date().getTime()-6e5,C=e=>{var a,s;const r=(e.values||[]).filter(l=>q(l)),o=r.length?Number.parseFloat(r[r.length-1][1]):0;return{label:e.label,reqs:o,type:h((s=(a=e.metric)==null?void 0:a.endpoint)==null?void 0:s.split("/")[2])}},E=(e,n)=>{var o;const r=n.label+n.type;return e[r]={...n,reqs:n.reqs+(((o=e[r])==null?void 0:o.reqs)??0)},e},T=e=>{var o,a;const r=(((a=(o=e==null?void 0:e.data)==null?void 0:o.result)==null?void 0:a.map(s=>{var l;return{...s,label:h((l=s.metric)==null?void 0:l.appName)}}).filter(s=>s.label!=="unknown"))||[]).map(C).reduce(E,{});return Object.values(r).map(s=>({...s,reqs:s.reqs.toFixed(2)})).filter(s=>s.reqs!=="0.00")??[]},R=()=>{g("Network - Overview");const e=x(),{metrics:n}=b(),r=u.useMemo(()=>T(n),[n]);return r.length===0?t.jsx(y,{severity:"warning",children:"No data available."}):t.jsxs(c.ArcherContainer,{strokeColor:e.palette.text.primary,endShape:{arrow:{arrowLength:4,arrowThickness:4}},children:[t.jsx(v,{children:t.jsx(c.ArcherElement,{id:"unleash",children:t.jsxs(p,{children:[t.jsx(m,{darkmode:t.jsx(f,{}),lightmode:t.jsx(j,{})}),t.jsx(d,{sx:{marginTop:e.spacing(1)},children:"Unleash"})]})})}),t.jsx(w,{children:r.map(({label:o,reqs:a,type:s},l)=>t.jsx(c.ArcherElement,{id:`${l}`,relations:[{targetId:"unleash",targetAnchor:"bottom",sourceAnchor:"top",style:{strokeColor:e.palette.secondary.border}}],children:t.jsxs(p,{children:[t.jsx(S,{children:o}),t.jsxs(k,{children:[a," req/s"]}),t.jsxs(A,{children:[s," app"]})]})}))})]})};export{R as NetworkOverview,R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var C=(t,e,a)=>e in t?f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var s=(t,e,a)=>(C(t,typeof e!="symbol"?e+"":e,a),a);import{bb as k,a as v,r as p,cI as w,j as o,C as P,K as S,cX as j,hA as I,hB as A,hC as L,hD as M,hE as N,hF as R,hH as T,hG as E,hL as q,hK as u}from"./index-
|
|
1
|
+
var f=Object.defineProperty;var C=(t,e,a)=>e in t?f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var s=(t,e,a)=>(C(t,typeof e!="symbol"?e+"":e,a),a);import{bb as k,a as v,r as p,cI as w,j as o,C as P,K as S,cX as j,hA as I,hB as A,hC as L,hD as M,hE as N,hF as R,hH as T,hG as E,hL as q,hK as u}from"./index-lGwH-xa2.js";import{u as D,a as g}from"./unknownify-D-iKcXLX.js";import{L as _}from"./index-DZdOsPxT.js";class H{constructor(e){s(this,"current",0);s(this,"all");this.all=e}next(){const e=this.all[this.current];return this.current=(this.current+1)%this.all.length,e}}const h=["circle","rect","rectRounded","rectRot","triangle"],B=(t,e)=>t.map(a=>({x:a[0],y:e(a[1])})),F=(t,e)=>({locale:e.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},color:t.palette.text.secondary,plugins:{tooltip:{backgroundColor:t.palette.background.paper,bodyColor:t.palette.text.primary,titleColor:t.palette.action.active,borderColor:t.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,callbacks:{title:a=>u(1e3*a[0].parsed.x,e.locale)},itemSort:(a,i)=>i.parsed.y-a.parsed.y},legend:{position:"bottom",align:"start",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0,padding:24}},title:{text:"Top 10 requests per second in the last 6 hours",position:"top",align:"start",display:!0,font:{size:16,weight:"400"},color:t.palette.text.primary,padding:{bottom:32}}},scales:{y:{type:"linear",title:{display:!0,text:"Requests per second",color:t.palette.text.secondary},suggestedMin:0,ticks:{precision:0,color:t.palette.text.secondary},grid:{color:t.palette.divider,borderColor:t.palette.divider}},x:{type:"time",time:{unit:"minute"},grid:{display:!0,color:t.palette.divider,borderColor:t.palette.divider},ticks:{callback:(a,i,r)=>u(r[i].value*1e3,e.locale)}}}});class K{constructor(e){s(this,"items");s(this,"picked",new Map);this.items=new H(e)}pick(e){return this.picked.has(e)||this.picked.set(e,this.items.next()),this.picked.get(e)}}const W=(t,e)=>{var a;if((a=e==null?void 0:e.data)!=null&&a.result){const i=new K([t.palette.success,t.palette.error,t.palette.primary,t.palette.warning]);return e.data.result.map((r,m)=>{var c,d;const n=g((c=r.metric)==null?void 0:c.endpoint),x=g((d=r.metric)==null?void 0:d.appName),l=i.pick(n),y=r.values||[];return{label:`${n}: ${x}`,borderColor:l.main,backgroundColor:l.main,data:B(y,b=>Number.parseFloat(b)),elements:{point:{radius:4,pointStyle:h[m%h.length]},line:{borderDash:[8,4]}}}})}return[]},X=()=>{const{locationSettings:t}=k(),{metrics:e}=D(),a=v(),i=p.useMemo(()=>F(a,t),[a,t]);w("Network - Traffic");const r=p.useMemo(()=>({datasets:W(a,e)}),[a,e,t]);return o.jsx(P,{condition:r.datasets.length===0,show:o.jsx(S,{severity:"warning",children:"No data available."}),elseShow:o.jsx(j,{sx:{display:"grid",gap:4},children:o.jsx("div",{style:{height:400},children:o.jsx(_,{data:r,options:i,"aria-label":"An instance metrics line chart with two lines: requests per second for admin API and requests per second for client API"})})})})};I.register(A,L,M,N,R,T,E,q);export{X as NetworkTraffic,X as default};
|
package/frontend/build/static/{NetworkTrafficUsage-BzhZdcFn.js → NetworkTrafficUsage-Dv8h54l9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as E,cp as R,cX as K,b9 as ct,j as f,G as ye,C as J,cA as me,hJ as Lt,hQ as X,hR as j,hS as M,hT as ce,hU as ke,hV as Wt,hW as x,hA as ie,hX as Q,hY as O,hZ as Yt,h_ as Bt,h$ as F,i0 as De,i1 as de,i2 as Xt,i3 as _t,i4 as $,i5 as re,i6 as Be,i7 as zt,i8 as Xe,i9 as Y,ia as ut,ib as ft,ic as Ht,cI as Nt,a as Ut,b8 as $t,r as P,K as _e,aM as ze,gE as Vt,hB as qt,hC as Gt,id as Jt,hL as Ft,hG as Kt,hH as Qt}from"./index-
|
|
1
|
+
import{s as E,cp as R,cX as K,b9 as ct,j as f,G as ye,C as J,cA as me,hJ as Lt,hQ as X,hR as j,hS as M,hT as ce,hU as ke,hV as Wt,hW as x,hA as ie,hX as Q,hY as O,hZ as Yt,h_ as Bt,h$ as F,i0 as De,i1 as de,i2 as Xt,i3 as _t,i4 as $,i5 as re,i6 as Be,i7 as zt,i8 as Xe,i9 as Y,ia as ut,ib as ft,ic as Ht,cI as Nt,a as Ut,b8 as $t,r as P,K as _e,aM as ze,gE as Vt,hB as qt,hC as Gt,id as Jt,hL as Ft,hG as Kt,hH as Qt}from"./index-lGwH-xa2.js";import{B as Zt}from"./index-DZdOsPxT.js";import{u as en,a as tn}from"./LazyAdminExport-BfaFcAaS.js";import"./RoleCell-6hhnTvjl.js";import"./useApiTokens-BhaMXLXr.js";const nn=E(R)(({theme:t})=>({display:"flex",flexDirection:"row"})),He=E(R)(({theme:t})=>({display:"flex",flexDirection:"row",flex:"1 1"})),Ne=E(R)(({theme:t})=>({display:"flex",flexDirection:"column",flex:"1 1"})),Ue=E("div")(({theme:t})=>({display:"flex",flexDirection:"row",flex:"1 1",padding:t.spacing(3),border:`2px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadiusLarge})),be=E(K)(({theme:t})=>({display:"flex",flexDirection:"column",gap:t.spacing(2.5),color:t.palette.text.secondary,fontSize:t.fontSizes.smallBody,marginTop:t.spacing(2)})),V=E(K)(({theme:t})=>({display:"flex",flexDirection:"row"})),q=E("div")(({theme:t})=>({marginLeft:"auto",display:"flex",textDecoration:"none",color:t.palette.text.primary})),on=({usageTotal:t,includedTraffic:e,overageCost:n,estimatedMonthlyCost:o})=>{const r=t-e,s=ct("estimateTrafficDataCost");return f.jsxs(nn,{container:!0,spacing:4,children:[f.jsx(He,{item:!0,xs:5.5,md:5.5,children:f.jsx(Ue,{children:f.jsxs(Ne,{item:!0,children:[f.jsx(K,{children:f.jsx("b",{children:"Number of requests to Unleash"})}),f.jsx(be,{children:f.jsxs(V,{children:["Incoming requests selected month"," ",f.jsx(q,{children:f.jsxs(ye,{color:e>0?t<=e?"success":"error":"neutral",children:[t.toLocaleString()," requests"]})})]})}),f.jsx(J,{condition:e>0,show:f.jsx(be,{children:f.jsxs(V,{children:["Included in your plan monthly",f.jsxs(q,{children:[e.toLocaleString()," ","requests"]})]})})})]})})}),f.jsx(J,{condition:s&&e>0&&r>0,show:f.jsx(He,{item:!0,xs:5.5,md:5.5,children:f.jsx(Ue,{children:f.jsxs(Ne,{item:!0,children:[f.jsx(K,{children:f.jsx("b",{children:"Accrued traffic charges"})}),f.jsxs(be,{children:[f.jsxs(V,{children:["Requests overages this month (",f.jsx(me,{href:"https://www.getunleash.io/pricing",children:"pricing"}),")",f.jsxs(q,{children:[r.toLocaleString()," requests"]})]}),f.jsxs(V,{children:["Accrued traffic charges",f.jsx(q,{children:f.jsxs(ye,{color:"secondary",children:[n," USD"]})})]}),f.jsx(J,{condition:o>0,show:f.jsxs(V,{children:["Estimated traffic charges based on current usage",f.jsx(q,{children:f.jsxs(ye,{color:"secondary",children:[o," ","USD"]})})]})})]})]})})})})]})};/*!
|
|
2
2
|
* chartjs-plugin-annotation v2.2.1
|
|
3
3
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
4
4
|
* (c) 2023 chartjs-plugin-annotation Contributors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as o,T as g,j as e,cH as j,B as a,gE as O,q as N,k as w,b8 as J,eU as U,C as r,cP as W}from"./index-
|
|
1
|
+
import{s as o,T as g,j as e,cH as j,B as a,gE as O,q as N,k as w,b8 as J,eU as U,C as r,cP as W}from"./index-lGwH-xa2.js";const x=o(g)(({theme:t})=>({fontWeight:t.fontWeight.bold,display:"inline"})),h=o(g)(({theme:t})=>({display:"inline",color:t.palette.text.secondary})),D=()=>e.jsx(j,{htmlTooltip:!0,tooltip:e.jsxs(e.Fragment,{children:[e.jsxs(a,{children:[e.jsx(x,{children:"open: "}),e.jsx(h,{children:"Everyone can submit change requests"})]}),e.jsxs(a,{sx:{mt:2},children:[e.jsx(x,{children:"protected: "}),e.jsx(h,{children:"Only admins and project members can submit change requests"})]}),e.jsxs(a,{sx:{mt:2},children:[e.jsx(x,{children:"private: "}),e.jsx(h,{children:"Only admins, editors and project members can see and access the project and associated feature flags"})]})]})}),q=()=>e.jsx(j,{htmlTooltip:!0,tooltip:e.jsx(a,{children:"Enforce an upper limit of the number of feature flags that may be created for this project. You can create unlimited feature flag if there is no limit set."})}),H="PROJECT_STICKINESS_SELECT",k="PROJECT_ID_INPUT",z="PROJECT_NAME_INPUT",A="PROJECT_DESCRIPTION_INPUT",K=o("form")(({theme:t})=>({height:"100%",paddingBottom:t.spacing(1)})),d=o("p")(({theme:t})=>({marginBottom:t.spacing(1),marginRight:t.spacing(1)})),L=o(O)(({theme:t})=>({marginBottom:t.spacing(2),minWidth:"200px"})),M=o("div")(({theme:t})=>({color:t.palette.text.secondary,fontSize:t.fontSizes.smallerBody,lineHeight:1.25,paddingBottom:t.spacing(1)})),m=o(N)(({theme:t})=>({width:"100%",marginBottom:t.spacing(2),paddingRight:t.spacing(1)})),Y=o(w)(({theme:t})=>({width:"100%",marginBottom:t.spacing(2)})),$=o("div")(()=>({marginTop:"auto",display:"flex",justifyContent:"flex-end"})),G=o("div")(()=>({display:"flex",alignItems:"center"})),V=({children:t,handleSubmit:y,projectId:T,projectName:C,projectDesc:b,projectStickiness:E,featureLimit:i,featureCount:u,projectMode:I,setProjectMode:c,setProjectId:f,setProjectName:v,setProjectDesc:S,setProjectStickiness:l,setFeatureLimit:B,errors:s,mode:p,validateProjectId:_,clearErrors:P})=>{const{isEnterprise:R}=J(),F=[{key:"open",label:"open"},{key:"protected",label:"protected"},{key:"private",label:"private"}];return e.jsxs(K,{onSubmit:n=>{y(n)},children:[e.jsx(d,{children:"What is your project Id?"}),e.jsx(m,{label:"Project Id",value:T,onChange:n=>f(U(n.target.value)),error:!!s.id,errorText:s.id,onFocus:()=>P(),onBlur:_,disabled:p==="Edit","data-testid":k,autoFocus:!0,required:!0}),e.jsx(d,{children:"What is your project name?"}),e.jsx(m,{label:"Project name",value:C,onChange:n=>v(n.target.value),error:!!s.name,errorText:s.name,onFocus:()=>{delete s.name},"data-testid":z,required:!0}),e.jsx(d,{children:"What is your project description?"}),e.jsx(Y,{label:"Project description",variant:"outlined",multiline:!0,maxRows:4,value:b,onChange:n=>S(n.target.value),"data-testid":A}),e.jsx(r,{condition:l!=null,show:e.jsxs(e.Fragment,{children:[e.jsx(d,{children:"What is the default stickiness for the project?"}),e.jsx(W,{label:"Stickiness",value:E,"data-testid":H,onChange:n=>l==null?void 0:l(n.target.value),editable:!0})]})}),e.jsx(r,{condition:p==="Edit",show:()=>e.jsxs(e.Fragment,{children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",marginBottom:1,gap:1},children:[e.jsx("p",{children:"Feature flag limit?"}),e.jsx(q,{})]}),e.jsx(M,{children:"Leave it empty if you don’t want to add a limit"}),e.jsxs(G,{children:[e.jsx(m,{label:"Limit",name:"value",type:"number",value:i==="null"||i===void 0?"":i,onChange:n=>B(n.target.value)}),e.jsx(r,{condition:u!==void 0&&!!i,show:e.jsxs(a,{children:["(",u," of ",i," used)"]})})]})]})}),e.jsx(r,{condition:p==="Create"&&R(),show:e.jsxs(e.Fragment,{children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",marginBottom:1,gap:1},children:[e.jsx("p",{children:"What is your project collaboration mode?"}),e.jsx(D,{})]}),e.jsx(L,{id:"project-mode",value:I,label:"Project collaboration mode",name:"Project collaboration mode",onChange:n=>{c==null||c(n.target.value)},options:F})]})}),e.jsx($,{children:t})]})};export{D as C,V as P};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as g$,hz as y$,d2 as b$,s as j$,r as Ds,U as x$,j as qf}from"./index-
|
|
1
|
+
import{g as g$,hz as y$,d2 as b$,s as j$,r as Ds,U as x$,j as qf}from"./index-lGwH-xa2.js";import{E as jn,F as Pi,c as ma,S as Ri,T as of,C as $$,b as w$,a as Et,I as Ey,g as Oy,f as Gd,i as _l,d as My,A as Qd,j as Sr,m as Na,s as ms,N as Bf,e as Ty,h as ea,D as Py,k as ta,p as tc,u as Mn,ab as S$,x as Yd,ac as Ry,l as Yn,K as C$,t as Xd,V as vs,L as El,W as k$,ad as _$,P as Zd,n as Qr,r as ep,o as Go,q as Mr,w as E$,v as Fi,R as tp,a6 as Ff,ae as Ay,M as O$,z as M$,a7 as T$,a8 as Ms,a0 as Ny,Q as P$,U as R$,X as A$,Y as N$,Z as I$,_ as z$,$ as L$,a1 as D$,a2 as q$,a3 as B$,a4 as F$,a5 as U$,O as V$,aa as H$,af as Ts}from"./index-C2dLqsgz.js";function Cn(t){return Array.isArray(t)}function zn(t){return t!==null&&typeof t=="object"&&(t.constructor===void 0||t.constructor.name==="Object")}function Iy(t){return t&&typeof t=="object"?t.op==="add":!1}function zy(t){return t&&typeof t=="object"?t.op==="remove":!1}function np(t){return t&&typeof t=="object"?t.op==="replace":!1}function Uf(t){return t&&typeof t=="object"?t.op==="copy":!1}function Fa(t){return t&&typeof t=="object"?t.op==="move":!1}function J$(t,e){return JSON.stringify(t)===JSON.stringify(e)}function W$(t,e){return t===e}function Ly(t){return t.slice(0,t.length-1)}function K$(t){return t[t.length-1]}function G$(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:W$;if(t.length<e.length)return!1;for(let r=0;r<e.length;r++)if(!n(t[r],e[r]))return!1;return!0}function Dy(t){return typeof t=="object"&&t!==null}function rp(t){if(Cn(t)){const e=t.slice();return Object.getOwnPropertySymbols(t).forEach(n=>{e[n]=t[n]}),e}else if(zn(t)){const e={...t};return Object.getOwnPropertySymbols(t).forEach(n=>{e[n]=t[n]}),e}else return t}function op(t,e,n){if(t[e]===n)return t;{const r=rp(t);return r[e]=n,r}}function Ge(t,e){let n=t,r=0;for(;r<e.length;)zn(n)?n=n[e[r]]:Cn(n)?n=n[parseInt(e[r])]:n=void 0,r++;return n}function fo(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e.length===0)return n;const o=e[0],i=fo(t?t[o]:void 0,e.slice(1),n,r);if(zn(t)||Cn(t))return op(t,o,i);if(r){const a=Q$.test(o)?[]:{};return a[o]=i,a}else throw new Error("Path does not exist")}const Q$=/^\d+$/;function qy(t,e,n){if(e.length===0)return n(t);if(!Dy(t))throw new Error("Path doesn't exist");const r=e[0],o=qy(t[r],e.slice(1),n);return op(t,r,o)}function ip(t,e){if(e.length===0)return t;if(!Dy(t))throw new Error("Path does not exist");if(e.length===1){const o=e[0];if(o in t){const i=rp(t);return Cn(i)&&i.splice(parseInt(o),1),zn(i)&&delete i[o],i}else return t}const n=e[0],r=ip(t[n],e.slice(1));return op(t,n,r)}function ap(t,e,n){const r=e.slice(0,e.length-1),o=e[e.length-1];return qy(t,r,i=>{if(!Array.isArray(i))throw new TypeError("Array expected at path "+JSON.stringify(r));const a=rp(i);return a.splice(parseInt(o),0,n),a})}function to(t,e){return t===void 0?!1:e.length===0?!0:t===null?!1:to(t[e[0]],e.slice(1))}function xo(t){const e=t.split("/");return e.shift(),e.map(n=>n.replace(/~1/g,"/").replace(/~0/g,"~"))}function Ve(t){return t.map(sp).join("")}function sp(t){return"/"+String(t).replace(/~/g,"~0").replace(/\//g,"~1")}function Qh(t,e){return t+sp(e)}function hu(t,e){return t.startsWith(e)&&(t.length===e.length||t[e.length]==="/")}function vo(t,e,n){let r=t;for(let o=0;o<e.length;o++){ow(e[o]);let i=e[o];if(n&&n.before){const c=n.before(r,i);if(c!==void 0){if(c.document!==void 0&&(r=c.document),c.json!==void 0)throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"');c.operation!==void 0&&(i=c.operation)}}const a=r,s=Ao(r,i.path);if(i.op==="add")r=Z$(r,s,i.value);else if(i.op==="remove")r=X$(r,s);else if(i.op==="replace")r=Y$(r,s,i.value);else if(i.op==="copy")r=ew(r,s,Vf(i.from));else if(i.op==="move")r=tw(r,s,Vf(i.from));else if(i.op==="test")nw(r,s,i.value);else throw new Error("Unknown JSONPatch operation "+JSON.stringify(i));if(n&&n.after){const c=n.after(r,i,a);c!==void 0&&(r=c)}}return r}function Y$(t,e,n){return fo(t,e,n)}function X$(t,e){return ip(t,e)}function Z$(t,e,n){return xc(t,e)?ap(t,e,n):fo(t,e,n)}function ew(t,e,n){const r=Ge(t,n);if(xc(t,e))return ap(t,e,r);{const o=Ge(t,n);return fo(t,e,o)}}function tw(t,e,n){const r=Ge(t,n),o=ip(t,n);return xc(o,e)?ap(o,e,r):fo(o,e,r)}function nw(t,e,n){if(n===void 0)throw new Error(`Test failed: no value provided (path: "${Ve(e)}")`);if(!to(t,e))throw new Error(`Test failed: path not found (path: "${Ve(e)}")`);const r=Ge(t,e);if(!J$(r,n))throw new Error(`Test failed, value differs (path: "${Ve(e)}")`)}function xc(t,e){if(e.length===0)return!1;const n=Ge(t,Ly(e));return Array.isArray(n)}function rw(t,e){if(K$(e)!=="-")return e;const n=Ly(e),r=Ge(t,n);return n.concat(r.length)}function ow(t){if(!["add","remove","replace","copy","move","test"].includes(t.op))throw new Error("Unknown JSONPatch op "+JSON.stringify(t.op));if(typeof t.path!="string")throw new Error('Required property "path" missing or not a string in operation '+JSON.stringify(t));if((t.op==="copy"||t.op==="move")&&typeof t.from!="string")throw new Error('Required property "from" missing or not a string in operation '+JSON.stringify(t))}function Ao(t,e){return rw(t,xo(e))}function Vf(t){return xo(t)}function By(t,e,n){let r=[];return vo(t,e,{before:(i,a)=>{let s;const c=Ao(i,a.path);if(a.op==="add")s=Vy(i,c);else if(a.op==="remove")s=Uy(i,c);else if(a.op==="replace")s=Fy(i,c);else if(a.op==="copy")s=iw(i,c);else if(a.op==="move")s=aw(i,c,Vf(a.from));else if(a.op==="test")s=[];else throw new Error("Unknown JSONPatch operation "+JSON.stringify(a));let l;if(n&&n.before){const u=n.before(i,a,s);if(u&&u.revertOperations&&(s=u.revertOperations),u&&u.document&&(l=u.document),u&&u.json)throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"')}if(r=s.concat(r),l!==void 0)return{document:l}}}),r}function Fy(t,e){return[{op:"replace",path:Ve(e),value:Ge(t,e)}]}function Uy(t,e){return[{op:"add",path:Ve(e),value:Ge(t,e)}]}function Vy(t,e){return xc(t,e)||!to(t,e)?[{op:"remove",path:Ve(e)}]:Fy(t,e)}function iw(t,e){return Vy(t,e)}function aw(t,e,n){if(e.length<n.length&&G$(n,e))return[{op:"replace",path:Ve(e),value:t}];const r={op:"move",from:Ve(e),path:Ve(n)};return!xc(t,e)&&to(t,e)?[r,...Uy(t,e)]:[r]}var Ol={},Yh={b:"\b",f:"\f",n:`
|
|
2
2
|
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},sw=97;Ol.parse=function(t,e,n){var r={},o=0,i=0,a=0,s=n&&n.bigint&&typeof BigInt<"u";return{data:c("",!0),pointers:r};function c(W,U){l();var X;b(W,"value");var B=m();switch(B){case"t":h("rue"),X=!0;break;case"f":h("alse"),X=!1;break;case"n":h("ull"),X=null;break;case'"':X=u();break;case"[":X=d(W);break;case"{":X=p(W);break;default:g(),"-0123456789".indexOf(B)>=0?X=f():P()}return b(W,"valueEnd"),l(),U&&a<t.length&&P(),X}function l(){e:for(;a<t.length;){switch(t[a]){case" ":i++;break;case" ":i+=4;break;case"\r":i=0;break;case`
|
|
3
3
|
`:i=0,o++;break;default:break e}a++}}function u(){for(var W="",U;U=m(),U!='"';)U=="\\"?(U=m(),U in Yh?W+=Yh[U]:U=="u"?W+=v():q()):W+=U;return W}function f(){var W="",U=!0;t[a]=="-"&&(W+=m()),W+=t[a]=="0"?m():y(),t[a]=="."&&(W+=m()+y(),U=!1),(t[a]=="e"||t[a]=="E")&&(W+=m(),(t[a]=="+"||t[a]=="-")&&(W+=m()),W+=y(),U=!1);var X=+W;return s&&U&&(X>Number.MAX_SAFE_INTEGER||X<Number.MIN_SAFE_INTEGER)?BigInt(W):X}function d(W){l();var U=[],X=0;if(m()=="]")return U;for(g();;){var B=W+"/"+X;U.push(c(B)),l();var J=m();if(J=="]")break;J!=","&&q(),l(),X++}return U}function p(W){l();var U={};if(m()=="}")return U;for(g();;){var X=$();m()!='"'&&q();var B=u(),J=W+"/"+Hf(B);S(J,"key",X),b(J,"keyEnd"),l(),m()!=":"&&q(),l(),U[B]=c(J),l();var z=m();if(z=="}")break;z!=","&&q(),l()}return U}function h(W){for(var U=0;U<W.length;U++)m()!==W[U]&&q()}function m(){Y();var W=t[a];return a++,i++,W}function g(){a--,i--}function v(){for(var W=4,U=0;W--;){U<<=4;var X=m().toLowerCase();X>="a"&&X<="f"?U+=X.charCodeAt()-sw+10:X>="0"&&X<="9"?U+=+X:q()}return String.fromCharCode(U)}function y(){for(var W="";t[a]>="0"&&t[a]<="9";)W+=m();if(W.length)return W;Y(),P()}function b(W,U){S(W,U,$())}function S(W,U,X){r[W]=r[W]||{},r[W][U]=X}function $(){return{line:o,column:i,pos:a}}function P(){throw new SyntaxError("Unexpected token "+t[a]+" in JSON at position "+a)}function q(){g(),P()}function Y(){if(a>=t.length)throw new SyntaxError("Unexpected end of JSON input")}};Ol.stringify=function(t,e,n){if(!Bc(t))return;var r=0,o,i,a=typeof n=="object"?n.space:n;switch(typeof a){case"number":var s=a>10?10:a<0?0:Math.floor(a);a=s&&S(s," "),o=s,i=s;break;case"string":a=a.slice(0,10),o=0,i=0;for(var c=0;c<a.length;c++){var l=a[c];switch(l){case" ":i++;break;case" ":i+=4;break;case"\r":i=0;break;case`
|
|
4
4
|
`:i=0,r++;break;default:throw new Error("whitespace characters not allowed in JSON")}o++}break;default:a=void 0}var u="",f={},d=0,p=0,h=0,m=n&&n.es6&&typeof Map=="function";return g(t,0,""),{json:u,pointers:f};function g($,P,q){switch(b(q,"value"),typeof $){case"number":case"bigint":case"boolean":v(""+$);break;case"string":v(Fc($));break;case"object":$===null?v("null"):typeof $.toJSON=="function"?v(Fc($.toJSON())):Array.isArray($)?Y():m?$.constructor.BYTES_PER_ELEMENT?Y():$ instanceof Map?U():$ instanceof Set?U(!0):W():W()}b(q,"valueEnd");function Y(){if($.length){v("[");for(var X=P+1,B=0;B<$.length;B++){B&&v(","),y(X);var J=Bc($[B])?$[B]:null,z=q+"/"+B;g(J,X,z)}y(P),v("]")}else v("[]")}function W(){var X=Object.keys($);if(X.length){v("{");for(var B=P+1,J=0;J<X.length;J++){var z=X[J],ne=$[z];if(Bc(ne)){J&&v(",");var Z=q+"/"+Hf(z);y(B),b(Z,"key"),v(Fc(z)),b(Z,"keyEnd"),v(":"),a&&v(" "),g(ne,B,Z)}}y(P),v("}")}else v("{}")}function U(X){if($.size){v("{");for(var B=P+1,J=!0,z=$.entries(),ne=z.next();!ne.done;){var Z=ne.value,Q=Z[0],E=X?!0:Z[1];if(Bc(E)){J||v(","),J=!1;var A=q+"/"+Hf(Q);y(B),b(A,"key"),v(Fc(Q)),b(A,"keyEnd"),v(":"),a&&v(" "),g(E,B,A)}ne=z.next()}y(P),v("}")}else v("{}")}}function v($){p+=$.length,h+=$.length,u+=$}function y($){if(a){for(u+=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b8 as T,j as e,K as R,ad as te,d1 as ne,ag as oe,C as y,B as C,ar as re,dX as ae,a7 as ie,a8 as le,a9 as ce,aa as de,aq as O,cA as W,ba as ue,e7 as he,cF as pe,hw as me,s as p,aM as G,em as xe,ac as v,en as I,r as d,w as je,x as fe,ab as ge,af as N,dS as be,ef as ye,a4 as w,a5 as Ce,c as $,bd as q,dj as Te,dp as Ae,b0 as ke,aN as z,f as ve,q as Se,aS as Ee,h as Ie,as as J,b9 as Ne,hx as b,dw as we,gy as H,du as De,dv as Re,T as D,dM as Pe,F as _e,eI as Be,dJ as Fe,eJ as Le,gt as Me,bj as Ue,b5 as V,b7 as Q,b6 as Oe,b1 as He,dF as Ke}from"./index-CamDenZi.js";const We=()=>{const{uiConfig:s}=T();return e.jsxs(R,{severity:"info",children:[e.jsxs("p",{children:["Read the"," ",e.jsx("a",{href:"https://docs.getunleash.io/reference/sdks",target:"_blank",rel:"noreferrer",children:"SDK overview"})," ","to connect Unleash to your application. Please note it can take up to ",e.jsx("strong",{children:"1 minute"})," before a new API key is activated."]}),e.jsx("br",{}),e.jsx("strong",{children:"API URL: "})," ",e.jsxs("pre",{style:{display:"inline"},children:[s.unleashUrl,"/api/"]})]})},Ge=["Icon","createdAt"],$e=["Icon","project","seenAt"],xs=({compact:s=!1,setHiddenColumns:t,columns:n,loading:o,rows:r,getTableProps:a,getTableBodyProps:i,headerGroups:m,globalFilter:h,prepareRow:x})=>{const f=te(ne.breakpoints.down("md"));return oe([{condition:f,columns:Ge},{condition:s,columns:$e}],t,n),e.jsxs(e.Fragment,{children:[e.jsx(y,{condition:r.length>0,show:e.jsx(C,{sx:{mb:4},children:e.jsx(We,{})})}),e.jsx(C,{sx:{overflowX:"auto"},children:e.jsx(re,{value:h,children:e.jsxs(ae,{...a(),children:[e.jsx(ie,{headerGroups:m}),e.jsx(le,{...i(),children:r.map(j=>(x(j),e.jsx(ce,{hover:!0,...j.getRowProps(),children:j.cells.map(u=>e.jsx(de,{...u.getCellProps(),children:u.render("Cell")}))})))})]})})}),e.jsx(y,{condition:r.length===0&&!o,show:e.jsx(y,{condition:(h==null?void 0:h.length)>0,show:e.jsxs(O,{children:["No tokens found matching “",h,"”"]}),elseShow:e.jsx(O,{children:e.jsxs("span",{children:["No tokens available. Read ",e.jsx(W,{href:"https://docs.getunleash.io/how-to/api",target:"_blank",rel:"noreferrer",children:"API How-to guides"})," "," to learn more."]})})})})]})},js=({path:s,permission:t,project:n})=>{const o=ue();return e.jsx(he,{Icon:pe,onClick:()=>o(s),"data-testid":me,permission:t,projectId:n,maxWidth:"700px",children:"New API token"})},qe=p(G)(({theme:s})=>({textDecoration:"none",color:s.palette.links,"&:hover, &:focus":{textDecoration:"underline"}})),ze=({projects:s,project:t})=>{const{searchQuery:n}=xe(),o=s&&Array.isArray(s)?s:t?[t]:[];return o.length===0?e.jsx(v,{children:e.jsx(I,{search:n,children:"*"})}):e.jsx(v,{children:o.map((r,a)=>e.jsxs(d.Fragment,{children:[a>0&&", ",!r||r==="*"?e.jsx(I,{search:n,children:"*"}):e.jsx(qe,{to:`/projects/${r}`,children:e.jsx(I,{search:n,children:r})})]},r))})};var P={},Je=fe;Object.defineProperty(P,"__esModule",{value:!0});var X=P.default=void 0,Ve=Je(je()),Qe=e,Xe=(0,Ve.default)((0,Qe.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04L21 10zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}),"Key");X=P.default=Xe;const fs=(s,t)=>{const n=d.useMemo(()=>({sortBy:[{id:"createdAt",desc:!0}]}),[]),o=d.useMemo(()=>[{id:"Icon",width:"1%",Cell:()=>e.jsx(ge,{icon:e.jsx(X,{color:"disabled"})}),disableSortBy:!0,disableGlobalFilter:!0},{Header:"Username",accessor:"username",Cell:N},{Header:"Type",accessor:"type",Cell:({value:u})=>e.jsx(N,{value:K[u.toLowerCase()].label,subtitle:K[u.toLowerCase()].title}),minWidth:280},{Header:"Project",accessor:"project",Cell:u=>e.jsx(ze,{project:u.row.original.project,projects:u.row.original.projects}),minWidth:120},{Header:"Environment",accessor:"environment",Cell:N,minWidth:120},{Header:"Created",accessor:"createdAt",Cell:be,minWidth:150,disableGlobalFilter:!0},{Header:"Last seen",accessor:"seenAt",Cell:ye,minWidth:150,disableGlobalFilter:!0},{Header:"Actions",id:"Actions",align:"center",width:"1%",disableSortBy:!0,disableGlobalFilter:!0,Cell:t}],[]),{getTableProps:r,getTableBodyProps:a,headerGroups:i,rows:m,prepareRow:h,state:x,setGlobalFilter:f,setHiddenColumns:j}=w.useTable({columns:o,data:s,initialState:n,sortTypes:Ce,autoResetHiddenColumns:!1,disableSortRemove:!0},w.useGlobalFilter,w.useSortBy);return{getTableProps:r,getTableBodyProps:a,headerGroups:i,rows:m,prepareRow:h,state:x,setGlobalFilter:f,setHiddenColumns:j,columns:o}},K={client:{label:"CLIENT",title:"Connect server-side SDK or Unleash Proxy/Edge"},frontend:{label:"FRONTEND",title:"Connect web and mobile SDK"},admin:{label:"ADMIN",title:"Full access for managing Unleash"}},gs=({token:s,project:t,permission:n,track:o})=>{const{setToastData:r}=$(),a=i=>{Ae(i)&&(r({type:"success",title:"Token copied to clipboard"}),o&&typeof o=="function"&&o())};return e.jsx(q,{permission:n,projectId:t,tooltipProps:{title:"Copy token",arrow:!0},onClick:()=>a(s.secret),size:"large",children:e.jsx(Te,{})})},Ye=p("ul")({marginBottom:0}),bs=({token:s,permission:t,onRemove:n,project:o})=>{const[r,a]=d.useState(!1),{setToastData:i,setToastApiError:m}=$(),h=async()=>{try{await n(),a(!1),i({type:"success",title:"API token removed"})}catch(x){m(ve(x))}};return e.jsxs(e.Fragment,{children:[e.jsx(q,{permission:t,projectId:o,tooltipProps:{title:"Delete token",arrow:!0},onClick:()=>a(!0),size:"large",children:e.jsx(ke,{})}),e.jsx(z,{open:r,onClick:h,onClose:()=>a(!1),title:"Confirm deletion",children:e.jsxs("div",{children:["Are you sure you want to delete the following API token?",e.jsx("br",{}),e.jsxs(Ye,{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"username"}),":"," ",e.jsx("code",{children:s.username})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"type"}),": ",e.jsx("code",{children:s.type})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"environment"}),":"," ",e.jsx("code",{children:s.environment})]})]})]})})]})},Ze=p("div")(()=>({maxWidth:"400px"})),es=p("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),ss=p(Se)(({theme:s})=>({width:"100%",marginBottom:s.spacing(2)})),ts=p(Ee)(({theme:s})=>({marginBottom:s.spacing(2),minWidth:"400px",[s.breakpoints.down("sm")]:{minWidth:"379px"}})),Y=p("p")(({theme:s})=>({marginBottom:s.spacing(1)})),ns=p("label")(({theme:s})=>({marginBottom:s.spacing(1)})),os=p(Ie)(({theme:s})=>({marginLeft:s.spacing(3)})),rs=p(C)({marginTop:"auto",display:"flex",justifyContent:"flex-end"}),ys=({children:s,actions:t,handleSubmit:n,handleCancel:o})=>{var i;const{uiConfig:r}=T(),a=!!((i=r==null?void 0:r.flags)!=null&&i.UNLEASH_CLOUD);return e.jsxs(es,{onSubmit:n,children:[e.jsx(y,{condition:a,show:e.jsxs(R,{severity:"info",sx:{mb:4},children:["Please be aware of our"," ",e.jsx(W,{href:"https://www.getunleash.io/fair-use-policy",children:"fair use policy"}),"."]})}),s,e.jsxs(rs,{children:[t,e.jsx(os,{onClick:o,children:"Cancel"})]})]})};var c=(s=>(s.ADMIN="ADMIN",s.CLIENT="CLIENT",s.FRONTEND="FRONTEND",s))(c||{});const Cs=s=>{var L,M;const{environments:t}=J(),{uiConfig:n}=T(),o=Ne("adminTokenKillSwitch"),r=(L=t==null?void 0:t.find(l=>l.enabled))==null?void 0:L.name,a=b(we),i=b(H,s),m=[{key:c.CLIENT,label:`Server-side SDK (${c.CLIENT})`,title:"Connect server-side SDK or Unleash Proxy/Edge",enabled:a||i}],h=b(De),x=b(Re),f=b(H,s);!s&&!o&&m.push({key:c.ADMIN,label:c.ADMIN,title:"Full access for managing Unleash",enabled:h}),n.flags.embedProxyFrontend&&m.splice(1,0,{key:c.FRONTEND,label:`Client-side SDK (${c.FRONTEND})`,title:"Connect web and mobile SDK directly to Unleash",enabled:x||f});const j=(M=m.find(l=>l.enabled))==null?void 0:M.key,[u,Z]=d.useState(""),[A,_]=d.useState(j||c.CLIENT),[g,S]=d.useState([s||"*"]),[ee,se]=d.useState(g),[B,k]=d.useState(),[F,E]=d.useState({});return d.useEffect(()=>{k(A==="ADMIN"?"*":r)},[A,r]),{username:u,type:A,apiTokenTypes:m,projects:g,environment:B,setUsername:Z,setTokenType:l=>{l==="ADMIN"?(_(c.ADMIN),se(g),S(["*"]),k("*")):(_(l),S(ee),k(r))},setProjects:S,setEnvironment:k,getApiTokenPayload:()=>({username:u,type:A,environment:B,projects:g}),isValid:()=>{const l={};return u||(l.username="Username is required"),g.length===0&&(l.projects="At least one project is required"),E(l),Object.keys(l).length===0},clearErrors:l=>{if(l){const U={...F};delete U[l],E(U)}else E({})},errors:F}},Ts=({open:s,setOpen:t,closeConfirm:n,token:o,type:r})=>e.jsxs(z,{open:s,setOpen:t,onClick:n,primaryButtonText:"Close",title:"New token created",children:[e.jsx(D,{variant:"body1",children:"Your new token has been created successfully."}),e.jsx(Pe,{token:o}),e.jsx(y,{condition:r===c.FRONTEND,show:e.jsxs(R,{sx:{mt:2},severity:"info",children:["By default, all ",c.FRONTEND," tokens may be used from any CORS origin. If you'd like to configure a strict set of origins, please use the"," ",e.jsx(G,{to:"/admin/cors",target:"_blank",rel:"noreferrer",children:"CORS origins configuration page"}),"."]})})]}),As=({username:s,setUsername:t,errors:n,clearErrors:o})=>e.jsxs(e.Fragment,{children:[e.jsx(Y,{children:"What would you like to call this token?"}),e.jsx(ss,{value:s,name:"username",onChange:r=>t(r.target.value),label:"Token name",error:n.username!==void 0,errorText:n.username,onFocus:()=>o("username"),autoFocus:!0})]}),ks=({type:s,setType:t,apiTokenTypes:n})=>e.jsx(Ze,{children:e.jsxs(_e,{sx:{mb:2,width:"100%"},children:[e.jsx(ns,{id:"token-type",children:"What do you want to connect?"}),e.jsx(Be,{"aria-labelledby":"token-type",defaultValue:"CLIENT",name:"radio-buttons-group",value:s,onChange:(o,r)=>t(r),children:n.map(({key:o,label:r,title:a,enabled:i})=>e.jsx(Fe,{value:o,sx:{mb:1},disabled:!i,control:e.jsx(Le,{sx:{ml:.75,alignSelf:"flex-start"}}),label:e.jsx(C,{children:e.jsxs(C,{children:[e.jsx(D,{children:r}),e.jsx(D,{variant:"body2",color:"text.secondary",children:a})]})})},o))})]})}),vs=({type:s,environment:t,setEnvironment:n})=>{const{environments:o}=J(),r=s===c.ADMIN?[{key:"*",label:"ALL"}]:o.map(a=>({key:a.name,label:`${a.name.concat(a.enabled?"":" - deprecated")}`,title:a.name,disabled:!1}));return e.jsxs(e.Fragment,{children:[e.jsx(Y,{children:"Which environment should the token have access to?"}),e.jsx(ts,{disabled:s===c.ADMIN,options:r,value:t,onChange:n,label:"Environment",id:"api_key_environment",name:"environment",IconComponent:Me,fullWidth:!0})]})},as=s=>s.map(t=>({...t.user,joinedAt:new Date(t.joinedAt),createdBy:t.createdBy})),Ss=s=>{const{data:t,error:n,mutate:o}=Ue(V(`api/admin/groups/${s}`),is);return d.useMemo(()=>({group:t&&{...t,users:as((t==null?void 0:t.users)??[])},loading:!n&&!t,refetchGroup:()=>o(),error:n}),[t,n,o])},is=s=>fetch(s).then(Q("Group")).then(t=>t.json()),Es=()=>{const{isEnterprise:s}=T(),{data:t,error:n,mutate:o}=Oe(s(),{serviceAccounts:[],rootRoles:[]},V("api/admin/service-account"),ls);return d.useMemo(()=>({serviceAccounts:(t==null?void 0:t.serviceAccounts)??[],roles:(t==null?void 0:t.rootRoles)??[],loading:!n&&!t,refetch:()=>o(),error:n}),[t,n,o])},ls=s=>fetch(s).then(Q("Service Accounts")).then(t=>t.json()),cs=p("div")(({theme:s})=>({display:"flex",flexDirection:"column",gap:s.spacing(.5),"& > *:not(:last-child)":{borderBottom:`1px solid ${s.palette.divider}`,paddingBottom:s.spacing(1)}})),Is=({role:s,roles:t,value:n})=>{const{isEnterprise:o}=T();if(o()){const r=t||[s];return e.jsx(v,{children:e.jsx(He,{tooltip:e.jsx(cs,{children:r.map(a=>e.jsx(Ke,{roleId:a,tooltip:!0},a))}),children:n})})}return e.jsx(v,{children:n})};export{xs as A,js as C,vs as E,bs as R,Y as S,c as T,gs as a,Cs as b,ys as c,As as d,ks as e,Ts as f,Es as g,Ss as h,Is as i,X as j,as as m,fs as u};
|
|
1
|
+
import{b8 as T,j as e,K as R,ad as te,d1 as ne,ag as oe,C as y,B as C,ar as re,dX as ae,a7 as ie,a8 as le,a9 as ce,aa as de,aq as O,cA as W,ba as ue,e7 as he,cF as pe,hw as me,s as p,aM as G,em as xe,ac as v,en as I,r as d,w as je,x as fe,ab as ge,af as N,dS as be,ef as ye,a4 as w,a5 as Ce,c as $,bd as q,dj as Te,dp as Ae,b0 as ke,aN as z,f as ve,q as Se,aS as Ee,h as Ie,as as J,b9 as Ne,hx as b,dw as we,gy as H,du as De,dv as Re,T as D,dM as Pe,F as _e,eI as Be,dJ as Fe,eJ as Le,gt as Me,bj as Ue,b5 as V,b7 as Q,b6 as Oe,b1 as He,dF as Ke}from"./index-lGwH-xa2.js";const We=()=>{const{uiConfig:s}=T();return e.jsxs(R,{severity:"info",children:[e.jsxs("p",{children:["Read the"," ",e.jsx("a",{href:"https://docs.getunleash.io/reference/sdks",target:"_blank",rel:"noreferrer",children:"SDK overview"})," ","to connect Unleash to your application. Please note it can take up to ",e.jsx("strong",{children:"1 minute"})," before a new API key is activated."]}),e.jsx("br",{}),e.jsx("strong",{children:"API URL: "})," ",e.jsxs("pre",{style:{display:"inline"},children:[s.unleashUrl,"/api/"]})]})},Ge=["Icon","createdAt"],$e=["Icon","project","seenAt"],xs=({compact:s=!1,setHiddenColumns:t,columns:n,loading:o,rows:r,getTableProps:a,getTableBodyProps:i,headerGroups:m,globalFilter:h,prepareRow:x})=>{const f=te(ne.breakpoints.down("md"));return oe([{condition:f,columns:Ge},{condition:s,columns:$e}],t,n),e.jsxs(e.Fragment,{children:[e.jsx(y,{condition:r.length>0,show:e.jsx(C,{sx:{mb:4},children:e.jsx(We,{})})}),e.jsx(C,{sx:{overflowX:"auto"},children:e.jsx(re,{value:h,children:e.jsxs(ae,{...a(),children:[e.jsx(ie,{headerGroups:m}),e.jsx(le,{...i(),children:r.map(j=>(x(j),e.jsx(ce,{hover:!0,...j.getRowProps(),children:j.cells.map(u=>e.jsx(de,{...u.getCellProps(),children:u.render("Cell")}))})))})]})})}),e.jsx(y,{condition:r.length===0&&!o,show:e.jsx(y,{condition:(h==null?void 0:h.length)>0,show:e.jsxs(O,{children:["No tokens found matching “",h,"”"]}),elseShow:e.jsx(O,{children:e.jsxs("span",{children:["No tokens available. Read ",e.jsx(W,{href:"https://docs.getunleash.io/how-to/api",target:"_blank",rel:"noreferrer",children:"API How-to guides"})," "," to learn more."]})})})})]})},js=({path:s,permission:t,project:n})=>{const o=ue();return e.jsx(he,{Icon:pe,onClick:()=>o(s),"data-testid":me,permission:t,projectId:n,maxWidth:"700px",children:"New API token"})},qe=p(G)(({theme:s})=>({textDecoration:"none",color:s.palette.links,"&:hover, &:focus":{textDecoration:"underline"}})),ze=({projects:s,project:t})=>{const{searchQuery:n}=xe(),o=s&&Array.isArray(s)?s:t?[t]:[];return o.length===0?e.jsx(v,{children:e.jsx(I,{search:n,children:"*"})}):e.jsx(v,{children:o.map((r,a)=>e.jsxs(d.Fragment,{children:[a>0&&", ",!r||r==="*"?e.jsx(I,{search:n,children:"*"}):e.jsx(qe,{to:`/projects/${r}`,children:e.jsx(I,{search:n,children:r})})]},r))})};var P={},Je=fe;Object.defineProperty(P,"__esModule",{value:!0});var X=P.default=void 0,Ve=Je(je()),Qe=e,Xe=(0,Ve.default)((0,Qe.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04L21 10zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}),"Key");X=P.default=Xe;const fs=(s,t)=>{const n=d.useMemo(()=>({sortBy:[{id:"createdAt",desc:!0}]}),[]),o=d.useMemo(()=>[{id:"Icon",width:"1%",Cell:()=>e.jsx(ge,{icon:e.jsx(X,{color:"disabled"})}),disableSortBy:!0,disableGlobalFilter:!0},{Header:"Username",accessor:"username",Cell:N},{Header:"Type",accessor:"type",Cell:({value:u})=>e.jsx(N,{value:K[u.toLowerCase()].label,subtitle:K[u.toLowerCase()].title}),minWidth:280},{Header:"Project",accessor:"project",Cell:u=>e.jsx(ze,{project:u.row.original.project,projects:u.row.original.projects}),minWidth:120},{Header:"Environment",accessor:"environment",Cell:N,minWidth:120},{Header:"Created",accessor:"createdAt",Cell:be,minWidth:150,disableGlobalFilter:!0},{Header:"Last seen",accessor:"seenAt",Cell:ye,minWidth:150,disableGlobalFilter:!0},{Header:"Actions",id:"Actions",align:"center",width:"1%",disableSortBy:!0,disableGlobalFilter:!0,Cell:t}],[]),{getTableProps:r,getTableBodyProps:a,headerGroups:i,rows:m,prepareRow:h,state:x,setGlobalFilter:f,setHiddenColumns:j}=w.useTable({columns:o,data:s,initialState:n,sortTypes:Ce,autoResetHiddenColumns:!1,disableSortRemove:!0},w.useGlobalFilter,w.useSortBy);return{getTableProps:r,getTableBodyProps:a,headerGroups:i,rows:m,prepareRow:h,state:x,setGlobalFilter:f,setHiddenColumns:j,columns:o}},K={client:{label:"CLIENT",title:"Connect server-side SDK or Unleash Proxy/Edge"},frontend:{label:"FRONTEND",title:"Connect web and mobile SDK"},admin:{label:"ADMIN",title:"Full access for managing Unleash"}},gs=({token:s,project:t,permission:n,track:o})=>{const{setToastData:r}=$(),a=i=>{Ae(i)&&(r({type:"success",title:"Token copied to clipboard"}),o&&typeof o=="function"&&o())};return e.jsx(q,{permission:n,projectId:t,tooltipProps:{title:"Copy token",arrow:!0},onClick:()=>a(s.secret),size:"large",children:e.jsx(Te,{})})},Ye=p("ul")({marginBottom:0}),bs=({token:s,permission:t,onRemove:n,project:o})=>{const[r,a]=d.useState(!1),{setToastData:i,setToastApiError:m}=$(),h=async()=>{try{await n(),a(!1),i({type:"success",title:"API token removed"})}catch(x){m(ve(x))}};return e.jsxs(e.Fragment,{children:[e.jsx(q,{permission:t,projectId:o,tooltipProps:{title:"Delete token",arrow:!0},onClick:()=>a(!0),size:"large",children:e.jsx(ke,{})}),e.jsx(z,{open:r,onClick:h,onClose:()=>a(!1),title:"Confirm deletion",children:e.jsxs("div",{children:["Are you sure you want to delete the following API token?",e.jsx("br",{}),e.jsxs(Ye,{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"username"}),":"," ",e.jsx("code",{children:s.username})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"type"}),": ",e.jsx("code",{children:s.type})]}),e.jsxs("li",{children:[e.jsx("strong",{children:"environment"}),":"," ",e.jsx("code",{children:s.environment})]})]})]})})]})},Ze=p("div")(()=>({maxWidth:"400px"})),es=p("form")(()=>({display:"flex",flexDirection:"column",height:"100%"})),ss=p(Se)(({theme:s})=>({width:"100%",marginBottom:s.spacing(2)})),ts=p(Ee)(({theme:s})=>({marginBottom:s.spacing(2),minWidth:"400px",[s.breakpoints.down("sm")]:{minWidth:"379px"}})),Y=p("p")(({theme:s})=>({marginBottom:s.spacing(1)})),ns=p("label")(({theme:s})=>({marginBottom:s.spacing(1)})),os=p(Ie)(({theme:s})=>({marginLeft:s.spacing(3)})),rs=p(C)({marginTop:"auto",display:"flex",justifyContent:"flex-end"}),ys=({children:s,actions:t,handleSubmit:n,handleCancel:o})=>{var i;const{uiConfig:r}=T(),a=!!((i=r==null?void 0:r.flags)!=null&&i.UNLEASH_CLOUD);return e.jsxs(es,{onSubmit:n,children:[e.jsx(y,{condition:a,show:e.jsxs(R,{severity:"info",sx:{mb:4},children:["Please be aware of our"," ",e.jsx(W,{href:"https://www.getunleash.io/fair-use-policy",children:"fair use policy"}),"."]})}),s,e.jsxs(rs,{children:[t,e.jsx(os,{onClick:o,children:"Cancel"})]})]})};var c=(s=>(s.ADMIN="ADMIN",s.CLIENT="CLIENT",s.FRONTEND="FRONTEND",s))(c||{});const Cs=s=>{var L,M;const{environments:t}=J(),{uiConfig:n}=T(),o=Ne("adminTokenKillSwitch"),r=(L=t==null?void 0:t.find(l=>l.enabled))==null?void 0:L.name,a=b(we),i=b(H,s),m=[{key:c.CLIENT,label:`Server-side SDK (${c.CLIENT})`,title:"Connect server-side SDK or Unleash Proxy/Edge",enabled:a||i}],h=b(De),x=b(Re),f=b(H,s);!s&&!o&&m.push({key:c.ADMIN,label:c.ADMIN,title:"Full access for managing Unleash",enabled:h}),n.flags.embedProxyFrontend&&m.splice(1,0,{key:c.FRONTEND,label:`Client-side SDK (${c.FRONTEND})`,title:"Connect web and mobile SDK directly to Unleash",enabled:x||f});const j=(M=m.find(l=>l.enabled))==null?void 0:M.key,[u,Z]=d.useState(""),[A,_]=d.useState(j||c.CLIENT),[g,S]=d.useState([s||"*"]),[ee,se]=d.useState(g),[B,k]=d.useState(),[F,E]=d.useState({});return d.useEffect(()=>{k(A==="ADMIN"?"*":r)},[A,r]),{username:u,type:A,apiTokenTypes:m,projects:g,environment:B,setUsername:Z,setTokenType:l=>{l==="ADMIN"?(_(c.ADMIN),se(g),S(["*"]),k("*")):(_(l),S(ee),k(r))},setProjects:S,setEnvironment:k,getApiTokenPayload:()=>({username:u,type:A,environment:B,projects:g}),isValid:()=>{const l={};return u||(l.username="Username is required"),g.length===0&&(l.projects="At least one project is required"),E(l),Object.keys(l).length===0},clearErrors:l=>{if(l){const U={...F};delete U[l],E(U)}else E({})},errors:F}},Ts=({open:s,setOpen:t,closeConfirm:n,token:o,type:r})=>e.jsxs(z,{open:s,setOpen:t,onClick:n,primaryButtonText:"Close",title:"New token created",children:[e.jsx(D,{variant:"body1",children:"Your new token has been created successfully."}),e.jsx(Pe,{token:o}),e.jsx(y,{condition:r===c.FRONTEND,show:e.jsxs(R,{sx:{mt:2},severity:"info",children:["By default, all ",c.FRONTEND," tokens may be used from any CORS origin. If you'd like to configure a strict set of origins, please use the"," ",e.jsx(G,{to:"/admin/cors",target:"_blank",rel:"noreferrer",children:"CORS origins configuration page"}),"."]})})]}),As=({username:s,setUsername:t,errors:n,clearErrors:o})=>e.jsxs(e.Fragment,{children:[e.jsx(Y,{children:"What would you like to call this token?"}),e.jsx(ss,{value:s,name:"username",onChange:r=>t(r.target.value),label:"Token name",error:n.username!==void 0,errorText:n.username,onFocus:()=>o("username"),autoFocus:!0})]}),ks=({type:s,setType:t,apiTokenTypes:n})=>e.jsx(Ze,{children:e.jsxs(_e,{sx:{mb:2,width:"100%"},children:[e.jsx(ns,{id:"token-type",children:"What do you want to connect?"}),e.jsx(Be,{"aria-labelledby":"token-type",defaultValue:"CLIENT",name:"radio-buttons-group",value:s,onChange:(o,r)=>t(r),children:n.map(({key:o,label:r,title:a,enabled:i})=>e.jsx(Fe,{value:o,sx:{mb:1},disabled:!i,control:e.jsx(Le,{sx:{ml:.75,alignSelf:"flex-start"}}),label:e.jsx(C,{children:e.jsxs(C,{children:[e.jsx(D,{children:r}),e.jsx(D,{variant:"body2",color:"text.secondary",children:a})]})})},o))})]})}),vs=({type:s,environment:t,setEnvironment:n})=>{const{environments:o}=J(),r=s===c.ADMIN?[{key:"*",label:"ALL"}]:o.map(a=>({key:a.name,label:`${a.name.concat(a.enabled?"":" - deprecated")}`,title:a.name,disabled:!1}));return e.jsxs(e.Fragment,{children:[e.jsx(Y,{children:"Which environment should the token have access to?"}),e.jsx(ts,{disabled:s===c.ADMIN,options:r,value:t,onChange:n,label:"Environment",id:"api_key_environment",name:"environment",IconComponent:Me,fullWidth:!0})]})},as=s=>s.map(t=>({...t.user,joinedAt:new Date(t.joinedAt),createdBy:t.createdBy})),Ss=s=>{const{data:t,error:n,mutate:o}=Ue(V(`api/admin/groups/${s}`),is);return d.useMemo(()=>({group:t&&{...t,users:as((t==null?void 0:t.users)??[])},loading:!n&&!t,refetchGroup:()=>o(),error:n}),[t,n,o])},is=s=>fetch(s).then(Q("Group")).then(t=>t.json()),Es=()=>{const{isEnterprise:s}=T(),{data:t,error:n,mutate:o}=Oe(s(),{serviceAccounts:[],rootRoles:[]},V("api/admin/service-account"),ls);return d.useMemo(()=>({serviceAccounts:(t==null?void 0:t.serviceAccounts)??[],roles:(t==null?void 0:t.rootRoles)??[],loading:!n&&!t,refetch:()=>o(),error:n}),[t,n,o])},ls=s=>fetch(s).then(Q("Service Accounts")).then(t=>t.json()),cs=p("div")(({theme:s})=>({display:"flex",flexDirection:"column",gap:s.spacing(.5),"& > *:not(:last-child)":{borderBottom:`1px solid ${s.palette.divider}`,paddingBottom:s.spacing(1)}})),Is=({role:s,roles:t,value:n})=>{const{isEnterprise:o}=T();if(o()){const r=t||[s];return e.jsx(v,{children:e.jsx(He,{tooltip:e.jsx(cs,{children:r.map(a=>e.jsx(Ke,{roleId:a,tooltip:!0},a))}),children:n})})}return e.jsx(v,{children:n})};export{xs as A,js as C,vs as E,bs as R,Y as S,c as T,gs as a,Cs as b,ys as c,As as d,ks as e,Ts as f,Es as g,Ss as h,Is as i,X as j,as as m,fs as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as d,v as j,B as a,cl as f,j as n,C as s,hv as h,V as S,bK as c,G as v,aM as m}from"./index-
|
|
1
|
+
import{s as d,v as j,B as a,cl as f,j as n,C as s,hv as h,V as S,bK as c,G as v,aM as m}from"./index-lGwH-xa2.js";const k=d(j)({padding:0,cursor:"inherit",transition:"color 0.2s ease-in-out"}),y=d("div")(({theme:i})=>({fontSize:i.typography.fontSize,color:i.palette.text.secondary,position:"absolute",display:"none",right:"calc(100% + 6px)",top:i.spacing(2.5),[i.breakpoints.up("md")]:{display:"block"}})),B=d("div")(({theme:i})=>({fontSize:i.typography.fontSize,fontWeight:"normal",color:i.palette.text.secondary,display:"none",top:i.spacing(2.5),[i.breakpoints.up("md")]:{display:"block"}})),I=d("div")(({theme:i})=>({fontWeight:"normal",display:"none",[i.breakpoints.up("md")]:{display:"block"}})),w=d("div")({flexDirection:"column",justifyContent:"center",verticalAlign:"middle"}),C=d(a,{shouldForwardProp:i=>i!=="disabled"})(({theme:i,disabled:o})=>({borderRadius:i.shape.borderRadiusMedium,border:`1px solid ${i.palette.divider}`,"& + &":{marginTop:i.spacing(2)},background:o?i.palette.envAccordion.disabled:i.palette.background.paper})),L=d("div",{shouldForwardProp:i=>i!=="draggable"&&i!=="disabled"})(({theme:i,draggable:o,disabled:l})=>({padding:i.spacing(.5,2),display:"flex",gap:i.spacing(1),alignItems:"center",borderBottom:`1px solid ${i.palette.divider}`,fontWeight:i.typography.fontWeightMedium,paddingLeft:o?i.spacing(1):i.spacing(2),color:l?i.palette.text.secondary:i.palette.text.primary})),F=({strategy:i,onDragStart:o,onDragEnd:l,actions:p,children:x,orderNumber:t,style:b={},description:r})=>{const u=f(i.name),g="links"in i?({children:e})=>n.jsx(m,{to:i.links.edit,children:e}):({children:e})=>n.jsxs(n.Fragment,{children:[" ",e," "]});return n.jsxs(a,{sx:{position:"relative"},children:[n.jsx(s,{condition:t!==void 0,show:n.jsx(y,{children:t})}),n.jsxs(C,{disabled:(i==null?void 0:i.disabled)||!1,style:b,children:[n.jsxs(L,{draggable:!!o,disabled:!!(i!=null&&i.disabled),children:[n.jsx(s,{condition:!!o,show:()=>n.jsx(k,{draggable:!0,disableRipple:!0,size:"small",onDragStart:o,onDragEnd:l,sx:{cursor:"move"},children:n.jsx(h,{titleAccess:"Drag to reorder",cursor:"grab",sx:{color:"action.active"}})})}),n.jsx(u,{sx:{fill:e=>e.palette.action.disabled}}),n.jsxs(w,{children:[n.jsxs(g,{children:[n.jsx(S,{maxWidth:"400",maxLength:15,text:c(String(i.name))}),n.jsx(s,{condition:!!i.title,show:n.jsx(I,{children:c(String(i.title))})})]}),n.jsx(s,{condition:!!r,show:n.jsx(B,{children:r})})]}),n.jsx(s,{condition:!!(i!=null&&i.disabled),show:()=>n.jsx(n.Fragment,{children:n.jsx(v,{color:"disabled",children:"Disabled"})})}),n.jsx(a,{sx:{marginLeft:"auto",display:"flex",minHeight:e=>e.spacing(6),alignItems:"center"},children:p})]}),n.jsx(a,{sx:{p:2,justifyItems:"center"},children:x})]})]})};export{F as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hA as b,r as a,bl as m,ie as I,ig as K}from"./index-
|
|
1
|
+
import{hA as b,r as a,bl as m,ie as I,ig as K}from"./index-lGwH-xa2.js";const y="label";function h(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function L(t,e){Object.assign(t.options,e)}function C(t,e){t.labels=e}function E(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y;const o=[];t.datasets=e.map(n=>{const c=t.datasets.find(f=>f[s]===n[s]);return!c||!n.data||o.includes(c)?{...n}:(o.push(c),Object.assign(c,n),c)})}function v(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:y;const s={labels:[],datasets:[]};return C(s,t.labels),E(s,t.datasets,e),s}function B(t,e){let{height:s=150,width:o=300,redraw:n=!1,datasetIdKey:c,type:f,data:u,options:i,plugins:w=[],fallbackContent:O,updateMode:p,...j}=t;const l=a.useRef(null),r=a.useRef(),d=()=>{l.current&&(r.current=new b(l.current,{type:f,data:v(u,c),options:i&&{...i},plugins:w}),h(e,r.current))},g=()=>{h(e,null),r.current&&(r.current.destroy(),r.current=null)};return a.useEffect(()=>{!n&&r.current&&i&&L(r.current,i)},[n,i]),a.useEffect(()=>{!n&&r.current&&C(r.current.config.data,u.labels)},[n,u.labels]),a.useEffect(()=>{!n&&r.current&&u.datasets&&E(r.current.config.data,u.datasets,c)},[n,u.datasets]),a.useEffect(()=>{r.current&&(n?(g(),setTimeout(d)):r.current.update(p))},[n,i,u.labels,u.datasets,p]),a.useEffect(()=>{r.current&&(g(),setTimeout(d))},[f]),a.useEffect(()=>(d(),()=>g()),[]),m.createElement("canvas",Object.assign({ref:l,role:"img",height:s,width:o},j),O)}const T=a.forwardRef(B);function R(t,e){return b.register(e),a.forwardRef((s,o)=>m.createElement(T,Object.assign({},s,{ref:o,type:t})))}const k=R("line",I),A=R("bar",K);export{A as B,k as L};
|