unleash-server 4.20.2 → 4.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/middleware/response-time-metrics.js +1 -1
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/{CreateProject-97475ef8.js → CreateProject-f5c561c6.js} +1 -1
- package/frontend/build/static/{Error-47bbc1e3.js → Error-cf50f470.js} +1 -1
- package/frontend/build/static/{ExpandMore-d5c393f9.js → ExpandMore-fa515e9b.js} +1 -1
- package/frontend/build/static/{FeatureArchiveDialog-0efb69f6.js → FeatureArchiveDialog-9726aebb.js} +1 -1
- package/frontend/build/static/{FeatureMetricsChart-f577e092.js → FeatureMetricsChart-2099cc8f.js} +1 -1
- package/frontend/build/static/{FeatureViewLazyExport-d023143d.js → FeatureViewLazyExport-251c75f0.js} +2 -2
- package/frontend/build/static/{LazyAdminExport-2cab3449.js → LazyAdminExport-110237f4.js} +2 -2
- package/frontend/build/static/{LazyProjectExport-62a8eb83.js → LazyProjectExport-22be702f.js} +1 -1
- package/frontend/build/static/{NetworkOverview-09807f41.js → NetworkOverview-fa11486d.js} +63 -63
- package/frontend/build/static/{NetworkTraffic-c7c90326.js → NetworkTraffic-e401fa21.js} +1 -1
- package/frontend/build/static/{Playground-8cd49115.js → Playground-d443ad89.js} +1 -1
- package/frontend/build/static/{StrategyItemContainer-6aa38dcf.js → StrategyItemContainer-6834f121.js} +1 -1
- package/frontend/build/static/{chartjs-adapter-date-fns.esm-e4be009e.js → chartjs-adapter-date-fns.esm-25ba860d.js} +1 -1
- package/frontend/build/static/{index-923b0cb2.js → index-3efe35ce.js} +1 -1
- package/frontend/build/static/{index-fc944eb5.js → index-a09b079f.js} +9 -9
- package/frontend/build/static/{index-c8689262.js → index-ad851f89.js} +1 -1
- package/frontend/build/static/{unknownify-541cfbe3.js → unknownify-a62439db.js} +1 -1
- package/frontend/build/static/{useProjectRole-ea388364.js → useProjectRole-6f60c011.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var b=Object.defineProperty;var f=(t,e,a)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var s=(t,e,a)=>(f(t,typeof e!="symbol"?e+"":e,a),a);import{bF as x,r as d,bP as k,j as n,C,A as w,c0 as r,eT as u}from"./index-
|
|
1
|
+
var b=Object.defineProperty;var f=(t,e,a)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var s=(t,e,a)=>(f(t,typeof e!="symbol"?e+"":e,a),a);import{bF as x,r as d,bP as k,j as n,C,A as w,c0 as r,eT as u}from"./index-a09b079f.js";import{u as P,a as m}from"./unknownify-a62439db.js";import{L as S,C as v,a as T,b as A,P as I,c as M,T as L,p as N,e as q,f as _}from"./chartjs-adapter-date-fns.esm-25ba860d.js";import{B as D}from"./useProjectRole-6f60c011.js";import"./index-3efe35ce.js";import"./index-ad851f89.js";class E{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 R=(t,e)=>t.map(a=>({x:a[0],y:e(a[1])})),j=t=>({locale:t.locale,responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{tooltip:{backgroundColor:r.palette.background.paper,bodyColor:r.palette.text.primary,titleColor:r.palette.grey[700],borderColor:r.palette.primary.main,borderWidth:1,padding:10,boxPadding:5,usePointStyle:!0,callbacks:{title:e=>u(1e3*e[0].parsed.x,t.locale)},itemSort:(e,a)=>a.parsed.y-e.parsed.y},legend:{position:"top",align:"end",labels:{boxWidth:10,boxHeight:10,usePointStyle:!0}},title:{text:"Top 10 requests per second in the last 6 hours",position:"top",align:"start",display:!0,font:{size:16,weight:"400"}}},scales:{y:{type:"linear",title:{display:!0,text:"Requests per second"},suggestedMin:0,ticks:{precision:0}},x:{type:"time",time:{unit:"minute"},grid:{display:!1},ticks:{callback:(e,a,i)=>u(i[a].value,t.locale)}}}});class B{constructor(e){s(this,"items");s(this,"picked",new Map);this.items=new E(e)}pick(e){return this.picked.has(e)||this.picked.set(e,this.items.next()),this.picked.get(e)}}const F=t=>{var e;if((e=t==null?void 0:t.data)!=null&&e.result){const a=new B([r.palette.success,r.palette.error,r.palette.primary,r.palette.warning]);return t.data.result.map(i=>{var c,p;const o=m((c=i.metric)==null?void 0:c.endpoint),h=m((p=i.metric)==null?void 0:p.appName),l=a.pick(o),g=i.values||[];return{label:`${o}: ${h}`,borderColor:l.main,backgroundColor:l.main,data:R(g,y=>parseFloat(y)),elements:{point:{radius:4,pointStyle:"circle"},line:{borderDash:[8,4]}}}})}return[]},K=()=>{const{locationSettings:t}=x(),{metrics:e}=P(),a=d.useMemo(()=>j(t),[t]);k("Network - Traffic");const i=d.useMemo(()=>({datasets:F(e)}),[e,t]);return n(C,{condition:i.datasets.length===0,show:n(w,{severity:"warning",children:"No data available."}),elseShow:n(D,{sx:{display:"grid",gap:4},children:n("div",{style:{height:400},children:n(S,{data:i,options:a,"aria-label":"An instance metrics line chart with two lines: requests per second for admin API and requests per second for client API"})})})})};v.register(T,A,I,M,L,N,q,_);export{K as NetworkTraffic,K as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Vi,j as m,r as I,u as ke,C as j,B as Cs,s as $,a as K,T as se,b as Uf,d as Bt,e as Na,f as B,g as Kf,S as Gf,h as Qf,i as Jf,k as _f,F as qe,I as Yf,l as Lo,m as Ai,n as Fa,P as Wa,o as Xf,A as Mn,p as Hi,q as Zf,t as Va,v as eu,w as Yr,x as tr,y as mn,z as ir,D as tu,E as iu,G as nu,H as su,J as ru,K as ou,L as Ha,M as lu,N as nr,O as Eo,Q as au,R as hu,U as cu,V as fu,W as As,X as uu,Y as du,Z as pu,_ as mu,$ as Xr,a0 as gu,a1 as yu,a2 as za,a3 as bu,a4 as On,a5 as xu,a6 as wu,a7 as vu,a8 as ku,a9 as $a,aa as Io,ab as No,ac as wi,ad as sr,ae as Su,af as rr,ag as Cu,ah as qa,ai as Au,aj as Mu,ak as Ou,al as Du,am as Tu}from"./index-fc944eb5.js";import{S as Pu}from"./StrategyItemContainer-6aa38dcf.js";import{E as Ru}from"./Error-47bbc1e3.js";const ls=Vi(m("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined"),Bu=Vi(m("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"CheckCircleOutline"),Lu=Vi(m("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined"),Eu=Vi(m("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}),"Help"),Iu=Vi(m("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"WarningOutlined"),Nu=n=>I.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},I.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84818 0.184159C8.56367 -0.0789547 8.1234 -0.0575747 7.86482 0.231912C7.60623 0.521399 7.62724 0.96937 7.91175 1.23248C9.48292 2.68551 10.6076 4.74934 10.6076 7C10.6076 9.25066 9.48292 11.3145 7.91175 12.7675C7.62724 13.0306 7.60623 13.4786 7.86482 13.7681C8.1234 14.0576 8.56367 14.079 8.84818 13.8158C10.6396 12.1592 11.9998 9.73702 11.9998 7C11.9998 4.26298 10.6396 1.84083 8.84818 0.184159ZM6.04105 2.23302C6.29109 1.93586 6.73054 1.90121 7.02259 2.15563C8.33146 3.29586 9.35426 5.02309 9.35426 6.99995C9.35426 8.97682 8.33145 10.7039 7.02259 11.8441C6.73054 12.0986 6.29109 12.0639 6.04105 11.7668C5.79101 11.4696 5.82506 11.0225 6.11711 10.768C7.19425 9.82969 7.96199 8.46967 7.96199 6.99995C7.96199 5.53021 7.19423 4.17007 6.11711 3.23173C5.82506 2.97731 5.79101 2.53017 6.04105 2.23302ZM6.56908 7.00015C6.56908 8.56492 5.3224 9.83342 3.78454 9.83342C2.24668 9.83342 1 8.56492 1 7.00015C1 5.43539 2.24668 4.16689 3.78454 4.16689C5.3224 4.16689 6.56908 5.43539 6.56908 7.00015Z",fill:"currentColor"})),Fu=n=>I.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},I.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84835 0.184159C8.56384 -0.0789547 8.12358 -0.0575747 7.86499 0.231912C7.6064 0.521399 7.62741 0.96937 7.91192 1.23248C9.4831 2.68551 10.6078 4.74934 10.6078 7C10.6078 7.40738 10.5709 7.80863 10.5012 8.20125L11.6597 9.35972C11.8783 8.60937 12 7.81877 12 7C12 4.26298 10.6397 1.84083 8.84835 0.184159ZM9.35443 6.99995L9.35418 7.0542L7.63252 5.33255C7.30901 4.52372 6.76993 3.80029 6.11728 3.23173C5.82523 2.97731 5.79118 2.53017 6.04122 2.23302C6.29127 1.93586 6.73072 1.90121 7.02276 2.15563C8.33164 3.29586 9.35443 5.02309 9.35443 6.99995ZM7.57827 8.79752L6.48307 7.70233C6.17606 8.92745 5.08437 9.83342 3.78471 9.83342C2.24685 9.83342 1.00017 8.56492 1.00017 7.00015C1.00017 5.69492 1.8676 4.59583 3.04789 4.26714L0.458225 1.67748C0.172794 1.39205 0.178843 0.923223 0.471736 0.63033C0.764629 0.337437 1.23345 0.331388 1.51889 0.616819L13.2132 12.3111C13.4986 12.5965 13.4926 13.0654 13.1997 13.3583C12.9068 13.6511 12.4379 13.6572 12.1525 13.3718L10.556 11.7753C10.0694 12.539 9.48623 13.2259 8.84835 13.8158C8.56384 14.079 8.12358 14.0576 7.86499 13.7681C7.6064 13.4786 7.62741 13.0306 7.91192 12.7675C8.54021 12.1865 9.0971 11.5078 9.53922 10.7585L8.62356 9.84281C8.20906 10.6195 7.64861 11.2989 7.02276 11.8441C6.73072 12.0986 6.29127 12.0639 6.04122 11.7668C5.79118 11.4696 5.82523 11.0225 6.11728 10.768C6.73471 10.2302 7.25048 9.55374 7.57827 8.79752Z",fill:"currentColor"})),Dn=({enabled:n,label:e,showIcon:t=!0})=>{const i=ke(),s=m(j,{condition:n==="unknown"||n==="unevaluated",show:m(Iu,{color:"warning",fontSize:"inherit"}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(Nu,{color:i.palette.success.main,strokeWidth:"0.25"}),elseShow:m(Fu,{color:i.palette.error.main,strokeWidth:"0.25"})})});return m(j,{condition:n==="unknown"||n==="unevaluated",show:m(Cs,{icon:t?s:void 0,color:"warning",children:e}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(Cs,{color:"success",icon:t?s:void 0,children:e}),elseShow:m(Cs,{color:"error",icon:t?s:void 0,children:e})})})},Wu=$(K)(({theme:n})=>({display:"flex",alignItems:"center",padding:n.spacing(1,2)})),Vu=$(K)(()=>({marginRight:"auto"})),Hu=({feature:n})=>{const[e,t]=(()=>{var i;return n!=null&&n.isEnabled?[!0,"True"]:((i=n==null?void 0:n.strategies)==null?void 0:i.result)==="unknown"?["unknown","Unknown"]:[!1,"False"]})();return m(Wu,{children:m(Vu,{"data-loading":!0,children:m(Dn,{enabled:e,label:t,showIcon:e!=="unknown"})})})},zu=$("div")(({theme:n})=>({padding:n.spacing(4),maxWidth:"400px"})),Ms=$(se)(({theme:n})=>({marginBottom:n.spacing(2)})),$u=$(Lu)(({theme:n})=>({color:n.palette.success.main})),qu=({variants:n,selectedVariant:e})=>{const t=ke(),i=I.useMemo(()=>n.map(c=>({name:c.name,weight:`${Uf(c.weight)}%`,selected:c.name===e})),[n,e]),s=I.useMemo(()=>({sortBy:[{id:"name",desc:!1}]}),[]),{getTableProps:r,getTableBodyProps:o,headerGroups:l,rows:a,prepareRow:h}=Bt.useTable({initialState:s,columns:ju,data:i,sortTypes:Na,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},Bt.useGlobalFilter,Bt.useSortBy);return B(zu,{children:[m(Ms,{variant:"subtitle2",children:"Variant Information"}),m(Ms,{variant:"body2",children:"The following table shows the variants defined on this feature toggle and the variant result based on your context configuration."}),m(Ms,{variant:"body2",children:'If you include "userId" or "sessionId" in your context, the variant will be the same every time because unleash uses these properties to ensure that the user receives the same experience.'}),B(Kf,{...r(),rowHeight:"dense",children:[m(Gf,{headerGroups:l}),m(Qf,{...o(),children:a.map(c=>{let f={};return c.original.selected||(f.color=t.palette.text.secondary),h(c),m(Jf,{hover:!0,...c.getRowProps(),children:c.cells.map(u=>m(_f,{...u.getCellProps(),style:f,children:u.render("Cell")}))})})})]})]})},ju=[{id:"Icon",Cell:({row:{original:{selected:n}}})=>m(qe,{children:m(j,{condition:n,show:m(Yf,{icon:m($u,{})})})}),maxWidth:25,disableGlobalFilter:!0},{Header:"Name",accessor:"name",searchable:!0,Cell:({row:{original:{name:n}}})=>m(Lo,{children:n}),maxWidth:175,width:175},{Header:"Weight",accessor:"weight",sortType:"alphanumeric",searchable:!0,maxWidth:75,Cell:({row:{original:{weight:n}}})=>m(Lo,{children:n})}],Uu=$("div")(()=>({maxWidth:"100%",display:"flex",alignItems:"center",wordBreak:"break-all"})),Ku=({variant:n,variants:e,feature:t,isEnabled:i})=>{const s=ke(),[r,o]=I.useState(null),l=c=>o(c.currentTarget),a=()=>o(null),h=Boolean(r);return B(Uu,{children:[n,m(j,{condition:Boolean(e)&&e.length>0&&i,show:B(qe,{children:[m(Ai,{onClick:l,children:m(Fa,{})}),m(Wa,{open:h,id:`${t}-result-variants`,PaperProps:{sx:{borderRadius:`${s.shape.borderRadiusLarge}px`}},onClose:a,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:m(qu,{variants:e,selectedVariant:n})})]})})]})},ja=["default","applicationHostname","flexibleRollout","gradualRolloutRandom","gradualRolloutSessionId","gradualRolloutUserId","remoteAddress","userWithId"];function Ua(n){return n===void 0?!0:Object.values(n).every(e=>e&&typeof e=="object"?Ua(e):e===null)}const Fo=n=>{var e,t;return(t=(e=n.strategies)==null?void 0:e.data)==null?void 0:t.find(i=>!ja.includes(i.name))},Gu=n=>{var e,t;return!((t=(e=n.strategies)==null?void 0:e.data)!=null&&t.find(i=>ja.includes(i.name)))},Qu=$("div")({display:"flex",justifyContent:"space-between",width:"100%"}),Ju=$("div")(({theme:n})=>({display:"inline-flex",alignItems:"center",gap:n.spacing(1.5),marginTop:n.spacing(1.5)})),Wo=$("div")(({theme:n})=>({margin:n.spacing(1,0)})),_u=$("div")(({theme:n})=>({margin:n.spacing(1,.5)})),Yu=$(se)(({theme:n})=>({fontWeight:600,padding:n.spacing(.5)})),Xu=$(Ai)({textAlign:"right"}),Zu=({feature:n,input:e,onClose:t})=>{var c;const i=ke(),[s,r,o]=(()=>n.isEnabled?[`This feature toggle is True in ${e==null?void 0:e.environment} because `,"at least one strategy is True",i.palette.success.main]:n.isEnabledInCurrentEnvironment?Gu(n)?[`This feature toggle is Unknown in ${e==null?void 0:e.environment} because `,"no strategies could be fully evaluated",i.palette.warning.main]:Fo(n)?[`This feature toggle is Unknown in ${e==null?void 0:e.environment} because `,"not all strategies could be fully evaluated",i.palette.warning.main]:[`This feature toggle is False in ${e==null?void 0:e.environment} because `,"all strategies are either False or could not be fully evaluated",i.palette.error.main]:[`This feature toggle is False in ${e==null?void 0:e.environment} because `,"the environment is disabled",i.palette.error.main])(),l=Ua(e==null?void 0:e.context)?"You did not provide a value for your context field in step 2 of the configuration":void 0,a=Fo(n)?"This feature uses custom strategies. Custom strategies can't be evaluated, so they will be marked accordingly.":void 0,h=t&&(f=>{f.stopPropagation(),t()});return B(qe,{children:[B(Qu,{children:[B(Ju,{children:[m(Yu,{variant:"subtitle1",children:n.name}),m(j,{condition:((c=n==null?void 0:n.strategies)==null?void 0:c.result)!=="unknown",show:()=>m(Dn,{enabled:n.isEnabled,label:n.isEnabled?"True":"False"}),elseShow:()=>m(Dn,{enabled:"unknown",label:"Unknown",showIcon:!1})})]}),m(Xu,{onClick:h,children:m(Xf,{})})]}),B(_u,{children:[m(se,{variant:"body1",component:"span",children:s}),m(se,{variant:"subtitle1",color:o,component:"span",children:r}),m(se,{variant:"body1",component:"span",children:"."})]}),m(j,{condition:Boolean(l),show:m(Wo,{children:m(Mn,{color:"info",children:l})})}),m(j,{condition:Boolean(a),show:m(Wo,{children:m(Mn,{severity:"warning",color:"info",children:a})})})]})},ed=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.error.main})),td=({constraint:n,input:e})=>B(ed,{children:[m(ls,{style:{marginRight:"0.25rem"}}),m(se,{variant:"body2",children:(()=>{const i=e==null?void 0:e.context[n.contextName];return i?`Constraint not met – the value in the context: { ${i} } is not ${n.operator} ${n.contextName}`:`Constraint not met – no value was specified for ${n.contextName}`})()})]}),id=$(Bu)(({theme:n})=>({color:n.palette.success.main})),nd=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.success.main})),sd=()=>B(nd,{children:[m(id,{style:{marginRight:"0.25rem"}}),m(se,{variant:"body2",children:"Constraint met by value in context"})]}),rd=$("div")(()=>({width:"100%",display:"flex",flexDirection:"column"})),Ka=({constraints:n,input:e})=>n?m(rd,{children:n==null?void 0:n.map((t,i)=>B(I.Fragment,{children:[m(j,{condition:i>0,show:m(Hi,{text:"AND"})}),m(Zf,{constraint:t,compact:!0,renderAfter:m(j,{condition:t.result,show:m(sd,{}),elseShow:m(td,{input:e,constraint:t})})})]},Va(t)))}):null,od=$("div")(({theme:n})=>({color:n.palette.error.main,display:"inline-flex",justifyContent:"center",marginLeft:"auto",gap:n.spacing(1)})),ld=({segments:n,input:e})=>n?m(qe,{children:n.map((t,i)=>B(I.Fragment,{children:[m(eu,{segment:t,constraintList:m(Ka,{constraints:t.constraints,input:e}),headerContent:m(j,{condition:!Boolean(t.result),show:B(od,{children:[m(se,{variant:"subtitle2",sx:{pt:.25},children:"segment is false"}),m("span",{children:m(ls,{})})]})}),isExpanded:!0}),m(j,{condition:i>=0&&n.length>1&&i!==n.length-1,show:m(Hi,{text:"AND"})})]},t.id))}):null,ad=$("div",{shouldForwardProp:n=>n!=="showReason"})(({theme:n,showReason:e})=>({width:"100%",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.dividerAlternative}`,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.spacing(2),opacity:e?.9:1,backgroundColor:e?n.palette.background.paper:"inherit"})),hd=$("div")(({theme:n})=>({flexDirection:"column"})),cd=$(Yr)(({theme:n})=>({margin:n.spacing(.5)})),fd=$("p")(({theme:n})=>({display:"inline",margin:n.spacing(.5,0),maxWidth:"95%",textAlign:"center",wordBreak:"break-word"})),Os=({value:n,text:e,input:t,showReason:i=!1})=>{const s=ke(),r=t==="no value"?"error":"neutral",o=`value does not match any ${e}`;return B(ad,{showReason:i,children:[m(se,{variant:"subtitle1",color:s.palette[r].main,children:`${t}`}),B(hd,{children:[m(j,{condition:Boolean(i),show:m(se,{variant:"subtitle1",color:s.palette.error.main,children:o})}),m(j,{condition:n.length===0,show:B("p",{children:["No ",e,"s added yet."]}),elseShow:B("div",{children:[B(fd,{children:[n.length," ",n.length>1?`${e}s`:e," will get access."]}),n.map(l=>m(cd,{label:m(tr,{maxWidth:"300",text:l.toString(),maxLength:50})},l))]})})]}),m(j,{condition:Boolean(i),show:m(ls,{color:"error"}),elseShow:m("div",{})})]})},Ga=$(K)(({theme:n})=>({width:"auto",height:"auto",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.dividerAlternative}`})),ht=n=>{switch(n.toUpperCase()){case"USERIDS":return"userId";case"IPS":return"remoteAddress";default:return n}},ud=({parameters:n,constraints:e,input:t})=>m(qe,{children:Object.keys(n).map(i=>{var s,r,o,l,a,h,c,f;switch(i){case"rollout":case"Rollout":const u=ir(n[i]);return B(Ga,{sx:{display:"flex",alignItems:"center"},children:[m(K,{sx:{mr:"1rem"},children:m(tu,{percentage:u,size:"2rem"})}),B("div",{children:[m(Yr,{color:"success",variant:"outlined",size:"small",label:`${u}%`})," ","of your base"," ",e.length>0?"who match constraints":""," ","is included."]})]},i);case"userIds":case"UserIds":const d=mn(n[i]);return m(Os,{value:d,text:"user",input:Boolean((s=t==null?void 0:t.context)==null?void 0:s[ht(i)])?(r=t==null?void 0:t.context)==null?void 0:r[ht(i)]:"no value",showReason:Boolean((o=t==null?void 0:t.context)==null?void 0:o[ht(i)])?!d.includes((l=t==null?void 0:t.context)==null?void 0:l[ht(i)]):void 0},i);case"hostNames":case"HostNames":const p=mn(n[i]);return m(Os,{value:p,text:"host",input:"no value",showReason:void 0},i);case"IPs":const y=mn(n[i]);return m(Os,{value:y,text:"IP",input:Boolean((a=t==null?void 0:t.context)==null?void 0:a[ht(i)])?(h=t==null?void 0:t.context)==null?void 0:h[ht(i)]:"no value",showReason:Boolean((c=t==null?void 0:t.context)==null?void 0:c[ht(i)])?!y.includes((f=t==null?void 0:t.context)==null?void 0:f[ht(i)]):void 0},i);case"stickiness":case"groupId":return null;default:return null}})}),dd=$(K)(({theme:n})=>({width:"100%",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.dividerAlternative}`,display:"flex",flexDirection:"row",alignItems:"center",gap:2})),ci=({text:n,input:e=null,isRequired:t=!1})=>{const i=ke(),s=e===null?"error":"neutral",r=t&&e===null;return B(dd,{children:[m(se,{variant:"subtitle1",color:i.palette[s].main,sx:{minWidth:118},children:`${e===null?"no value":e}`}),m(K,{sx:{flexGrow:1,flexDirection:"column"},children:m(K,{sx:{flexGrow:1},children:m(j,{condition:Boolean(r),show:B(qe,{children:[m(se,{component:"span",color:i.palette.error.main,children:" required parameter "}),m(tr,{maxWidth:"300",text:n,maxLength:50}),m(se,{component:"span",color:i.palette.error.main,children:" is not set "})]}),elseShow:B(qe,{children:[m(se,{component:"span",color:"text.disabled",children:" set on parameter "}),m(tr,{maxWidth:"300",text:n,maxLength:50})]})})})}),m(j,{condition:Boolean(r),show:m(ls,{color:"error"}),elseShow:m("div",{})})]})},pd=({strategyName:n,parameters:e})=>{const{strategies:t}=iu(),i=t.find(r=>r.name===n);if(!(i!=null&&i.editable))return null;const s=i==null?void 0:i.parameters.map(r=>{const o=e[r.name],l=r.required;switch(r==null?void 0:r.type){case"list":const a=mn(o);return m(ci,{isRequired:l,text:r.name,input:(a==null?void 0:a.length)>0?a.join(", "):null});case"percentage":const h=ir(o),c=!(o===void 0||o===""||h<0||h>100);return m(ci,{text:r.name,isRequired:l,input:c?`${h}%`:void 0});case"boolean":const f=["true","false"].includes(o)?o:void 0;return m(ci,{isRequired:l,text:r.name,input:o!==void 0?f:void 0});case"string":const u=nu(o);return m(ci,{text:r.name,isRequired:l,input:u!==void 0?u:void 0});case"number":const d=!(o===void 0||o===""),p=ir(o);return m(ci,{text:r.name,isRequired:l,input:d?`${p}`:void 0});case"default":return null}return null});return m(qe,{children:s.map((r,o)=>B(I.Fragment,{children:[m(j,{condition:o>0,show:m(Hi,{text:"AND"})}),r]},o))})},md=$("div")(({theme:n})=>({padding:n.spacing(0)})),gd=({strategyResult:n,input:e})=>{const{name:t,constraints:i,segments:s,parameters:r}=n,{uiConfig:o}=su(),l=Boolean(o.flags.SE)&&Boolean(s&&s.length>0),a=Boolean(i&&(i==null?void 0:i.length)>0),h=t!=="default"&&Object.keys(ru).includes(t),c=Object.keys(r).length>0&&n.result.evaluationStatus==="incomplete";if(!r)return null;const f=[l&&m(ld,{segments:s,input:e}),a&&m(Ka,{constraints:i,input:e}),h&&m(ud,{parameters:r,constraints:i,input:e}),c&&m(pd,{strategyName:t,parameters:r}),t==="default"&&B(Ga,{sx:{width:"100%"},children:["The standard strategy is"," ",m(Yr,{variant:"outlined",size:"small",color:"success",label:"ON"})," ","for all users."]})].filter(Boolean);return m(md,{children:f.map((u,d)=>B(I.Fragment,{children:[m(j,{condition:d>0,show:m(Hi,{text:"AND"})}),u]},d))})},yd=({strategy:n,input:e,index:t})=>{const{result:i}=n,s=ke(),r=i.evaluationStatus==="incomplete"?"Unevaluated":i.enabled?"True":"False";return m(Pu,{style:{borderColor:i.enabled?s.palette.success.main:"none"},strategy:{...n,id:`${Va(n)}`},orderNumber:t+1,actions:m(Dn,{showIcon:!1,enabled:i.enabled,label:r}),children:m(gd,{strategyResult:n,input:e,percentageFill:s.palette.tertiary.light})})},bd=$("div")(({theme:n})=>({display:"flex",padding:"0, 4px",flexDirection:"column",borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.warning.border}`})),xd=$("div")(({theme:n})=>({padding:n.spacing(1,.5)})),wd=$(Mn)(({theme:n})=>({border:"0!important",borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:`1px solid ${n.palette.warning.border}!important`})),Qa=({strategies:n,input:e})=>m(j,{condition:n.length>0,show:B(qe,{children:[m(se,{variant:"subtitle1",sx:{mt:2,ml:1,mb:2,color:"text.secondary"},children:`Strategies (${n==null?void 0:n.length})`}),m(K,{sx:{width:"100%"},children:n==null?void 0:n.map((t,i)=>B(I.Fragment,{children:[m(j,{condition:i>0,show:m(Hi,{text:"OR"})}),m(yd,{strategy:t,index:i,input:e},t.id)]},t.id))})]})}),vd=({strategies:n,input:e})=>B(bd,{sx:{pb:1,mt:2},children:[B(wd,{severity:"info",color:"warning",children:["If environment was enabled, then this feature toggle would be"," ",n!=null&&n.result?"TRUE":"FALSE"," with strategies evaluated like so:"," "]}),m(xd,{sx:{p:2.5},children:m(Qa,{strategies:(n==null?void 0:n.data)||[],input:e})})]}),kd=({feature:n,input:e})=>{var t,i,s,r;return B(qe,{children:[m(j,{condition:((i=(t=n==null?void 0:n.strategies)==null?void 0:t.data)==null?void 0:i.length)===0,show:m(Mn,{severity:"warning",sx:{mt:2},children:"There are no strategies added to this feature toggle in selected environment."})}),m(j,{condition:!n.isEnabledInCurrentEnvironment&&Boolean((s=n==null?void 0:n.strategies)==null?void 0:s.data),show:m(vd,{strategies:n==null?void 0:n.strategies,input:e}),elseShow:m(Qa,{strategies:((r=n==null?void 0:n.strategies)==null?void 0:r.data)||[],input:e})})]})},Sd=$("div")(({theme:n})=>({alignItems:"flex-end",color:n.palette.tertiary.main})),Cd=({feature:n,input:e})=>{const[t,i]=I.useState(!1),s=I.useRef(null),r=()=>{i(!t)};return n?B(Sd,{children:[m(Ai,{onClick:r,children:m(Fa,{ref:s})}),B(Wa,{open:t,onClose:()=>i(!1),anchorEl:s.current,PaperProps:{sx:o=>({display:"flex",flexDirection:"column",padding:o.spacing(6),width:728,maxWidth:"100%",height:"auto",overflowY:"auto",backgroundColor:o.palette.tertiary.light,borderRadius:o.shape.borderRadius})},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:[m(Zu,{feature:n,input:e,onClose:()=>i(!1)}),m(kd,{feature:n,input:e})]})]}):null},Ad={id:"name"},{value:Vo,setValue:Md}=ou("PlaygroundResultsTable:v1",Ad),Od=({features:n,input:e,loading:t})=>{const[i,s]=Ha(),r=lu(t),[o,l]=I.useState(i.get("search")||""),a=ke(),h=nr(a.breakpoints.down("sm")),c=nr(a.breakpoints.down("md")),f=I.useMemo(()=>[{Header:"Name",accessor:"name",searchable:!0,minWidth:160,Cell:({value:v,row:{original:O}})=>m(Eo,{title:v,to:`/projects/${O==null?void 0:O.projectId}/features/${v}`})},{Header:"Project ID",accessor:"projectId",sortType:"alphanumeric",filterName:"projectId",searchable:!0,maxWidth:170,Cell:({value:v})=>m(Eo,{title:v,to:`/projects/${v}`})},{Header:"Variant",id:"variant",accessor:"variant.name",sortType:"alphanumeric",filterName:"variant",searchable:!0,maxWidth:200,Cell:({value:v,row:{original:{variant:O,feature:N,variants:P,isEnabled:E}}})=>m(Ku,{variant:O!=null&&O.enabled?v:"",variants:P,feature:N,isEnabled:E})},{id:"isEnabled",Header:"isEnabled",filterName:"isEnabled",accessor:v=>{var O;return v!=null&&v.isEnabled?"true":((O=v==null?void 0:v.strategies)==null?void 0:O.result)==="unknown"?"unknown":"false"},Cell:({row:v})=>m(Hu,{feature:v.original}),sortType:"playgroundResultState",maxWidth:120,sortInverted:!0},{Header:"",maxWidth:70,id:"info",Cell:({row:v})=>m(Cd,{feature:v.original,input:e})}],[e]),{data:u,getSearchText:d,getSearchContext:p}=au(f,o,n||[]),y=I.useMemo(()=>t?Array(5).fill({name:"Feature name",projectId:"FeatureProject",variant:{name:"FeatureVariant",variants:[]},enabled:!0}):u,[u,t]),[b]=I.useState(()=>({sortBy:[{id:i.get("sort")||Vo.id,desc:i.has("order")?i.get("order")==="desc":Vo.desc}]})),{headerGroups:x,rows:k,state:{sortBy:M},prepareRow:C,setHiddenColumns:S}=Bt.useTable({initialState:b,columns:f,data:y,sortTypes:Na,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:hu}},Bt.useGlobalFilter,Bt.useFlexLayout,Bt.useSortBy);return cu([{condition:h,columns:["variant"]},{condition:c,columns:["projectId"]}],S,f),I.useEffect(()=>{if(t)return;const v=Object.fromEntries(i);v.sort=M[0].id,M[0].desc?v.order="desc":v.order&&delete v.order,o?v.search=o:delete v.search,s(v,{replace:!0}),Md({id:M[0].id,desc:M[0].desc||!1})},[t,M,o]),B(qe,{children:[B(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[m(se,{variant:"subtitle1",sx:{ml:1},children:n!==void 0&&!t?`Results (${k.length<y.length?`${k.length} of ${y.length}`:y.length})`:"Results"}),m(fu,{initialValue:o,onChange:l,hasFilters:!0,getSearchContext:p,disabled:t,containerStyles:{marginLeft:"1rem",maxWidth:"400px"}})]}),m(j,{condition:!t&&!y,show:()=>m(As,{children:y===void 0?"None of the feature toggles were evaluated yet.":"No results found."}),elseShow:()=>B(K,{ref:r,children:[m(uu,{value:d(o),children:m(du,{rows:k,headerGroups:x,prepareRow:C})}),m(j,{condition:y.length===0&&(o==null?void 0:o.length)>0,show:B(As,{children:["No feature toggles found matching “",o,"”"]})}),m(j,{condition:y&&y.length===0&&!o,show:m(As,{children:"No features toggles to display"})})]})})]})},Dd=()=>{const{makeRequest:n,createRequest:e,errors:t,loading:i}=pu({propagateErrors:!0}),s="api/admin/playground";return{evaluatePlayground:async o=>{const a=e(s,{method:"POST",body:JSON.stringify(o)});try{return(await n(a.caller,a.id)).json()}catch(h){throw h}},errors:t,loading:i}},Td=$("div")(({style:n,theme:e})=>({width:"25px",height:"25px",borderRadius:"50%",color:e.palette.text.tertiaryContrast,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...n})),as=({style:n,children:e,type:t})=>{const i=ke(),s={backgroundColor:i.palette.primary.main};return t==="secondary"&&(s.backgroundColor=i.palette.tertiary.dark),m(Td,{style:{...s,...n},children:e})},Pd=n=>!n||n.length===0||n.length===1&&n[0]==="*"?"*":Array.isArray(n)?n:[n],Rd=n=>{const e=Ja(n);return e.length>0?e[0]:""},Ja=n=>n.filter(({enabled:e})=>Boolean(e)).sort((e,t)=>e.sortOrder-t.sortOrder).map(({name:e})=>e),Bd=(n,e)=>n?"100%":e&&!n?"65%":"50%";function or(n,e,t){var i,s,r,o,l;e==null&&(e=100);function a(){var c=Date.now()-o;c<e&&c>=0?i=setTimeout(a,e-c):(i=null,t||(l=n.apply(r,s),r=s=null))}var h=function(){r=this,s=arguments,o=Date.now();var c=t&&!i;return i||(i=setTimeout(a,e)),c&&(l=n.apply(r,s),r=s=null),l};return h.clear=function(){i&&(clearTimeout(i),i=null)},h.flush=function(){i&&(l=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},h}or.debounce=or;var Ld=or;class q{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),_e.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),_e.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new vi(this),r=new vi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new vi(this,e)}iterRange(e,t=this.length){return new _a(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ya(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?q.empty:e.length<=32?new re(e):_e.from(re.split(e,[]))}}class re extends q{constructor(e,t=Ed(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Id(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new re(Ho(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=gn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new re(l,o.length+r.length));else{let a=l.length>>1;i.push(new re(l.slice(0,a)),new re(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof re))return super.replace(e,t,i);let s=gn(this.text,gn(i.text,Ho(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new re(s,r):_e.from(re.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
|
1
|
+
import{c as Vi,j as m,r as I,u as ke,C as j,B as Cs,s as $,a as K,T as se,b as Uf,d as Bt,e as Na,f as B,g as Kf,S as Gf,h as Qf,i as Jf,k as _f,F as qe,I as Yf,l as Lo,m as Ai,n as Fa,P as Wa,o as Xf,A as Mn,p as Hi,q as Zf,t as Va,v as eu,w as Yr,x as tr,y as mn,z as ir,D as tu,E as iu,G as nu,H as su,J as ru,K as ou,L as Ha,M as lu,N as nr,O as Eo,Q as au,R as hu,U as cu,V as fu,W as As,X as uu,Y as du,Z as pu,_ as mu,$ as Xr,a0 as gu,a1 as yu,a2 as za,a3 as bu,a4 as On,a5 as xu,a6 as wu,a7 as vu,a8 as ku,a9 as $a,aa as Io,ab as No,ac as wi,ad as sr,ae as Su,af as rr,ag as Cu,ah as qa,ai as Au,aj as Mu,ak as Ou,al as Du,am as Tu}from"./index-a09b079f.js";import{S as Pu}from"./StrategyItemContainer-6834f121.js";import{E as Ru}from"./Error-cf50f470.js";const ls=Vi(m("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined"),Bu=Vi(m("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"CheckCircleOutline"),Lu=Vi(m("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined"),Eu=Vi(m("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}),"Help"),Iu=Vi(m("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"WarningOutlined"),Nu=n=>I.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},I.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84818 0.184159C8.56367 -0.0789547 8.1234 -0.0575747 7.86482 0.231912C7.60623 0.521399 7.62724 0.96937 7.91175 1.23248C9.48292 2.68551 10.6076 4.74934 10.6076 7C10.6076 9.25066 9.48292 11.3145 7.91175 12.7675C7.62724 13.0306 7.60623 13.4786 7.86482 13.7681C8.1234 14.0576 8.56367 14.079 8.84818 13.8158C10.6396 12.1592 11.9998 9.73702 11.9998 7C11.9998 4.26298 10.6396 1.84083 8.84818 0.184159ZM6.04105 2.23302C6.29109 1.93586 6.73054 1.90121 7.02259 2.15563C8.33146 3.29586 9.35426 5.02309 9.35426 6.99995C9.35426 8.97682 8.33145 10.7039 7.02259 11.8441C6.73054 12.0986 6.29109 12.0639 6.04105 11.7668C5.79101 11.4696 5.82506 11.0225 6.11711 10.768C7.19425 9.82969 7.96199 8.46967 7.96199 6.99995C7.96199 5.53021 7.19423 4.17007 6.11711 3.23173C5.82506 2.97731 5.79101 2.53017 6.04105 2.23302ZM6.56908 7.00015C6.56908 8.56492 5.3224 9.83342 3.78454 9.83342C2.24668 9.83342 1 8.56492 1 7.00015C1 5.43539 2.24668 4.16689 3.78454 4.16689C5.3224 4.16689 6.56908 5.43539 6.56908 7.00015Z",fill:"currentColor"})),Fu=n=>I.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},I.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.84835 0.184159C8.56384 -0.0789547 8.12358 -0.0575747 7.86499 0.231912C7.6064 0.521399 7.62741 0.96937 7.91192 1.23248C9.4831 2.68551 10.6078 4.74934 10.6078 7C10.6078 7.40738 10.5709 7.80863 10.5012 8.20125L11.6597 9.35972C11.8783 8.60937 12 7.81877 12 7C12 4.26298 10.6397 1.84083 8.84835 0.184159ZM9.35443 6.99995L9.35418 7.0542L7.63252 5.33255C7.30901 4.52372 6.76993 3.80029 6.11728 3.23173C5.82523 2.97731 5.79118 2.53017 6.04122 2.23302C6.29127 1.93586 6.73072 1.90121 7.02276 2.15563C8.33164 3.29586 9.35443 5.02309 9.35443 6.99995ZM7.57827 8.79752L6.48307 7.70233C6.17606 8.92745 5.08437 9.83342 3.78471 9.83342C2.24685 9.83342 1.00017 8.56492 1.00017 7.00015C1.00017 5.69492 1.8676 4.59583 3.04789 4.26714L0.458225 1.67748C0.172794 1.39205 0.178843 0.923223 0.471736 0.63033C0.764629 0.337437 1.23345 0.331388 1.51889 0.616819L13.2132 12.3111C13.4986 12.5965 13.4926 13.0654 13.1997 13.3583C12.9068 13.6511 12.4379 13.6572 12.1525 13.3718L10.556 11.7753C10.0694 12.539 9.48623 13.2259 8.84835 13.8158C8.56384 14.079 8.12358 14.0576 7.86499 13.7681C7.6064 13.4786 7.62741 13.0306 7.91192 12.7675C8.54021 12.1865 9.0971 11.5078 9.53922 10.7585L8.62356 9.84281C8.20906 10.6195 7.64861 11.2989 7.02276 11.8441C6.73072 12.0986 6.29127 12.0639 6.04122 11.7668C5.79118 11.4696 5.82523 11.0225 6.11728 10.768C6.73471 10.2302 7.25048 9.55374 7.57827 8.79752Z",fill:"currentColor"})),Dn=({enabled:n,label:e,showIcon:t=!0})=>{const i=ke(),s=m(j,{condition:n==="unknown"||n==="unevaluated",show:m(Iu,{color:"warning",fontSize:"inherit"}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(Nu,{color:i.palette.success.main,strokeWidth:"0.25"}),elseShow:m(Fu,{color:i.palette.error.main,strokeWidth:"0.25"})})});return m(j,{condition:n==="unknown"||n==="unevaluated",show:m(Cs,{icon:t?s:void 0,color:"warning",children:e}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(Cs,{color:"success",icon:t?s:void 0,children:e}),elseShow:m(Cs,{color:"error",icon:t?s:void 0,children:e})})})},Wu=$(K)(({theme:n})=>({display:"flex",alignItems:"center",padding:n.spacing(1,2)})),Vu=$(K)(()=>({marginRight:"auto"})),Hu=({feature:n})=>{const[e,t]=(()=>{var i;return n!=null&&n.isEnabled?[!0,"True"]:((i=n==null?void 0:n.strategies)==null?void 0:i.result)==="unknown"?["unknown","Unknown"]:[!1,"False"]})();return m(Wu,{children:m(Vu,{"data-loading":!0,children:m(Dn,{enabled:e,label:t,showIcon:e!=="unknown"})})})},zu=$("div")(({theme:n})=>({padding:n.spacing(4),maxWidth:"400px"})),Ms=$(se)(({theme:n})=>({marginBottom:n.spacing(2)})),$u=$(Lu)(({theme:n})=>({color:n.palette.success.main})),qu=({variants:n,selectedVariant:e})=>{const t=ke(),i=I.useMemo(()=>n.map(c=>({name:c.name,weight:`${Uf(c.weight)}%`,selected:c.name===e})),[n,e]),s=I.useMemo(()=>({sortBy:[{id:"name",desc:!1}]}),[]),{getTableProps:r,getTableBodyProps:o,headerGroups:l,rows:a,prepareRow:h}=Bt.useTable({initialState:s,columns:ju,data:i,sortTypes:Na,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},Bt.useGlobalFilter,Bt.useSortBy);return B(zu,{children:[m(Ms,{variant:"subtitle2",children:"Variant Information"}),m(Ms,{variant:"body2",children:"The following table shows the variants defined on this feature toggle and the variant result based on your context configuration."}),m(Ms,{variant:"body2",children:'If you include "userId" or "sessionId" in your context, the variant will be the same every time because unleash uses these properties to ensure that the user receives the same experience.'}),B(Kf,{...r(),rowHeight:"dense",children:[m(Gf,{headerGroups:l}),m(Qf,{...o(),children:a.map(c=>{let f={};return c.original.selected||(f.color=t.palette.text.secondary),h(c),m(Jf,{hover:!0,...c.getRowProps(),children:c.cells.map(u=>m(_f,{...u.getCellProps(),style:f,children:u.render("Cell")}))})})})]})]})},ju=[{id:"Icon",Cell:({row:{original:{selected:n}}})=>m(qe,{children:m(j,{condition:n,show:m(Yf,{icon:m($u,{})})})}),maxWidth:25,disableGlobalFilter:!0},{Header:"Name",accessor:"name",searchable:!0,Cell:({row:{original:{name:n}}})=>m(Lo,{children:n}),maxWidth:175,width:175},{Header:"Weight",accessor:"weight",sortType:"alphanumeric",searchable:!0,maxWidth:75,Cell:({row:{original:{weight:n}}})=>m(Lo,{children:n})}],Uu=$("div")(()=>({maxWidth:"100%",display:"flex",alignItems:"center",wordBreak:"break-all"})),Ku=({variant:n,variants:e,feature:t,isEnabled:i})=>{const s=ke(),[r,o]=I.useState(null),l=c=>o(c.currentTarget),a=()=>o(null),h=Boolean(r);return B(Uu,{children:[n,m(j,{condition:Boolean(e)&&e.length>0&&i,show:B(qe,{children:[m(Ai,{onClick:l,children:m(Fa,{})}),m(Wa,{open:h,id:`${t}-result-variants`,PaperProps:{sx:{borderRadius:`${s.shape.borderRadiusLarge}px`}},onClose:a,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:-320},children:m(qu,{variants:e,selectedVariant:n})})]})})]})},ja=["default","applicationHostname","flexibleRollout","gradualRolloutRandom","gradualRolloutSessionId","gradualRolloutUserId","remoteAddress","userWithId"];function Ua(n){return n===void 0?!0:Object.values(n).every(e=>e&&typeof e=="object"?Ua(e):e===null)}const Fo=n=>{var e,t;return(t=(e=n.strategies)==null?void 0:e.data)==null?void 0:t.find(i=>!ja.includes(i.name))},Gu=n=>{var e,t;return!((t=(e=n.strategies)==null?void 0:e.data)!=null&&t.find(i=>ja.includes(i.name)))},Qu=$("div")({display:"flex",justifyContent:"space-between",width:"100%"}),Ju=$("div")(({theme:n})=>({display:"inline-flex",alignItems:"center",gap:n.spacing(1.5),marginTop:n.spacing(1.5)})),Wo=$("div")(({theme:n})=>({margin:n.spacing(1,0)})),_u=$("div")(({theme:n})=>({margin:n.spacing(1,.5)})),Yu=$(se)(({theme:n})=>({fontWeight:600,padding:n.spacing(.5)})),Xu=$(Ai)({textAlign:"right"}),Zu=({feature:n,input:e,onClose:t})=>{var c;const i=ke(),[s,r,o]=(()=>n.isEnabled?[`This feature toggle is True in ${e==null?void 0:e.environment} because `,"at least one strategy is True",i.palette.success.main]:n.isEnabledInCurrentEnvironment?Gu(n)?[`This feature toggle is Unknown in ${e==null?void 0:e.environment} because `,"no strategies could be fully evaluated",i.palette.warning.main]:Fo(n)?[`This feature toggle is Unknown in ${e==null?void 0:e.environment} because `,"not all strategies could be fully evaluated",i.palette.warning.main]:[`This feature toggle is False in ${e==null?void 0:e.environment} because `,"all strategies are either False or could not be fully evaluated",i.palette.error.main]:[`This feature toggle is False in ${e==null?void 0:e.environment} because `,"the environment is disabled",i.palette.error.main])(),l=Ua(e==null?void 0:e.context)?"You did not provide a value for your context field in step 2 of the configuration":void 0,a=Fo(n)?"This feature uses custom strategies. Custom strategies can't be evaluated, so they will be marked accordingly.":void 0,h=t&&(f=>{f.stopPropagation(),t()});return B(qe,{children:[B(Qu,{children:[B(Ju,{children:[m(Yu,{variant:"subtitle1",children:n.name}),m(j,{condition:((c=n==null?void 0:n.strategies)==null?void 0:c.result)!=="unknown",show:()=>m(Dn,{enabled:n.isEnabled,label:n.isEnabled?"True":"False"}),elseShow:()=>m(Dn,{enabled:"unknown",label:"Unknown",showIcon:!1})})]}),m(Xu,{onClick:h,children:m(Xf,{})})]}),B(_u,{children:[m(se,{variant:"body1",component:"span",children:s}),m(se,{variant:"subtitle1",color:o,component:"span",children:r}),m(se,{variant:"body1",component:"span",children:"."})]}),m(j,{condition:Boolean(l),show:m(Wo,{children:m(Mn,{color:"info",children:l})})}),m(j,{condition:Boolean(a),show:m(Wo,{children:m(Mn,{severity:"warning",color:"info",children:a})})})]})},ed=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.error.main})),td=({constraint:n,input:e})=>B(ed,{children:[m(ls,{style:{marginRight:"0.25rem"}}),m(se,{variant:"body2",children:(()=>{const i=e==null?void 0:e.context[n.contextName];return i?`Constraint not met – the value in the context: { ${i} } is not ${n.operator} ${n.contextName}`:`Constraint not met – no value was specified for ${n.contextName}`})()})]}),id=$(Bu)(({theme:n})=>({color:n.palette.success.main})),nd=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.success.main})),sd=()=>B(nd,{children:[m(id,{style:{marginRight:"0.25rem"}}),m(se,{variant:"body2",children:"Constraint met by value in context"})]}),rd=$("div")(()=>({width:"100%",display:"flex",flexDirection:"column"})),Ka=({constraints:n,input:e})=>n?m(rd,{children:n==null?void 0:n.map((t,i)=>B(I.Fragment,{children:[m(j,{condition:i>0,show:m(Hi,{text:"AND"})}),m(Zf,{constraint:t,compact:!0,renderAfter:m(j,{condition:t.result,show:m(sd,{}),elseShow:m(td,{input:e,constraint:t})})})]},Va(t)))}):null,od=$("div")(({theme:n})=>({color:n.palette.error.main,display:"inline-flex",justifyContent:"center",marginLeft:"auto",gap:n.spacing(1)})),ld=({segments:n,input:e})=>n?m(qe,{children:n.map((t,i)=>B(I.Fragment,{children:[m(eu,{segment:t,constraintList:m(Ka,{constraints:t.constraints,input:e}),headerContent:m(j,{condition:!Boolean(t.result),show:B(od,{children:[m(se,{variant:"subtitle2",sx:{pt:.25},children:"segment is false"}),m("span",{children:m(ls,{})})]})}),isExpanded:!0}),m(j,{condition:i>=0&&n.length>1&&i!==n.length-1,show:m(Hi,{text:"AND"})})]},t.id))}):null,ad=$("div",{shouldForwardProp:n=>n!=="showReason"})(({theme:n,showReason:e})=>({width:"100%",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.dividerAlternative}`,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.spacing(2),opacity:e?.9:1,backgroundColor:e?n.palette.background.paper:"inherit"})),hd=$("div")(({theme:n})=>({flexDirection:"column"})),cd=$(Yr)(({theme:n})=>({margin:n.spacing(.5)})),fd=$("p")(({theme:n})=>({display:"inline",margin:n.spacing(.5,0),maxWidth:"95%",textAlign:"center",wordBreak:"break-word"})),Os=({value:n,text:e,input:t,showReason:i=!1})=>{const s=ke(),r=t==="no value"?"error":"neutral",o=`value does not match any ${e}`;return B(ad,{showReason:i,children:[m(se,{variant:"subtitle1",color:s.palette[r].main,children:`${t}`}),B(hd,{children:[m(j,{condition:Boolean(i),show:m(se,{variant:"subtitle1",color:s.palette.error.main,children:o})}),m(j,{condition:n.length===0,show:B("p",{children:["No ",e,"s added yet."]}),elseShow:B("div",{children:[B(fd,{children:[n.length," ",n.length>1?`${e}s`:e," will get access."]}),n.map(l=>m(cd,{label:m(tr,{maxWidth:"300",text:l.toString(),maxLength:50})},l))]})})]}),m(j,{condition:Boolean(i),show:m(ls,{color:"error"}),elseShow:m("div",{})})]})},Ga=$(K)(({theme:n})=>({width:"auto",height:"auto",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.dividerAlternative}`})),ht=n=>{switch(n.toUpperCase()){case"USERIDS":return"userId";case"IPS":return"remoteAddress";default:return n}},ud=({parameters:n,constraints:e,input:t})=>m(qe,{children:Object.keys(n).map(i=>{var s,r,o,l,a,h,c,f;switch(i){case"rollout":case"Rollout":const u=ir(n[i]);return B(Ga,{sx:{display:"flex",alignItems:"center"},children:[m(K,{sx:{mr:"1rem"},children:m(tu,{percentage:u,size:"2rem"})}),B("div",{children:[m(Yr,{color:"success",variant:"outlined",size:"small",label:`${u}%`})," ","of your base"," ",e.length>0?"who match constraints":""," ","is included."]})]},i);case"userIds":case"UserIds":const d=mn(n[i]);return m(Os,{value:d,text:"user",input:Boolean((s=t==null?void 0:t.context)==null?void 0:s[ht(i)])?(r=t==null?void 0:t.context)==null?void 0:r[ht(i)]:"no value",showReason:Boolean((o=t==null?void 0:t.context)==null?void 0:o[ht(i)])?!d.includes((l=t==null?void 0:t.context)==null?void 0:l[ht(i)]):void 0},i);case"hostNames":case"HostNames":const p=mn(n[i]);return m(Os,{value:p,text:"host",input:"no value",showReason:void 0},i);case"IPs":const y=mn(n[i]);return m(Os,{value:y,text:"IP",input:Boolean((a=t==null?void 0:t.context)==null?void 0:a[ht(i)])?(h=t==null?void 0:t.context)==null?void 0:h[ht(i)]:"no value",showReason:Boolean((c=t==null?void 0:t.context)==null?void 0:c[ht(i)])?!y.includes((f=t==null?void 0:t.context)==null?void 0:f[ht(i)]):void 0},i);case"stickiness":case"groupId":return null;default:return null}})}),dd=$(K)(({theme:n})=>({width:"100%",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.dividerAlternative}`,display:"flex",flexDirection:"row",alignItems:"center",gap:2})),ci=({text:n,input:e=null,isRequired:t=!1})=>{const i=ke(),s=e===null?"error":"neutral",r=t&&e===null;return B(dd,{children:[m(se,{variant:"subtitle1",color:i.palette[s].main,sx:{minWidth:118},children:`${e===null?"no value":e}`}),m(K,{sx:{flexGrow:1,flexDirection:"column"},children:m(K,{sx:{flexGrow:1},children:m(j,{condition:Boolean(r),show:B(qe,{children:[m(se,{component:"span",color:i.palette.error.main,children:" required parameter "}),m(tr,{maxWidth:"300",text:n,maxLength:50}),m(se,{component:"span",color:i.palette.error.main,children:" is not set "})]}),elseShow:B(qe,{children:[m(se,{component:"span",color:"text.disabled",children:" set on parameter "}),m(tr,{maxWidth:"300",text:n,maxLength:50})]})})})}),m(j,{condition:Boolean(r),show:m(ls,{color:"error"}),elseShow:m("div",{})})]})},pd=({strategyName:n,parameters:e})=>{const{strategies:t}=iu(),i=t.find(r=>r.name===n);if(!(i!=null&&i.editable))return null;const s=i==null?void 0:i.parameters.map(r=>{const o=e[r.name],l=r.required;switch(r==null?void 0:r.type){case"list":const a=mn(o);return m(ci,{isRequired:l,text:r.name,input:(a==null?void 0:a.length)>0?a.join(", "):null});case"percentage":const h=ir(o),c=!(o===void 0||o===""||h<0||h>100);return m(ci,{text:r.name,isRequired:l,input:c?`${h}%`:void 0});case"boolean":const f=["true","false"].includes(o)?o:void 0;return m(ci,{isRequired:l,text:r.name,input:o!==void 0?f:void 0});case"string":const u=nu(o);return m(ci,{text:r.name,isRequired:l,input:u!==void 0?u:void 0});case"number":const d=!(o===void 0||o===""),p=ir(o);return m(ci,{text:r.name,isRequired:l,input:d?`${p}`:void 0});case"default":return null}return null});return m(qe,{children:s.map((r,o)=>B(I.Fragment,{children:[m(j,{condition:o>0,show:m(Hi,{text:"AND"})}),r]},o))})},md=$("div")(({theme:n})=>({padding:n.spacing(0)})),gd=({strategyResult:n,input:e})=>{const{name:t,constraints:i,segments:s,parameters:r}=n,{uiConfig:o}=su(),l=Boolean(o.flags.SE)&&Boolean(s&&s.length>0),a=Boolean(i&&(i==null?void 0:i.length)>0),h=t!=="default"&&Object.keys(ru).includes(t),c=Object.keys(r).length>0&&n.result.evaluationStatus==="incomplete";if(!r)return null;const f=[l&&m(ld,{segments:s,input:e}),a&&m(Ka,{constraints:i,input:e}),h&&m(ud,{parameters:r,constraints:i,input:e}),c&&m(pd,{strategyName:t,parameters:r}),t==="default"&&B(Ga,{sx:{width:"100%"},children:["The standard strategy is"," ",m(Yr,{variant:"outlined",size:"small",color:"success",label:"ON"})," ","for all users."]})].filter(Boolean);return m(md,{children:f.map((u,d)=>B(I.Fragment,{children:[m(j,{condition:d>0,show:m(Hi,{text:"AND"})}),u]},d))})},yd=({strategy:n,input:e,index:t})=>{const{result:i}=n,s=ke(),r=i.evaluationStatus==="incomplete"?"Unevaluated":i.enabled?"True":"False";return m(Pu,{style:{borderColor:i.enabled?s.palette.success.main:"none"},strategy:{...n,id:`${Va(n)}`},orderNumber:t+1,actions:m(Dn,{showIcon:!1,enabled:i.enabled,label:r}),children:m(gd,{strategyResult:n,input:e,percentageFill:s.palette.tertiary.light})})},bd=$("div")(({theme:n})=>({display:"flex",padding:"0, 4px",flexDirection:"column",borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.warning.border}`})),xd=$("div")(({theme:n})=>({padding:n.spacing(1,.5)})),wd=$(Mn)(({theme:n})=>({border:"0!important",borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:`1px solid ${n.palette.warning.border}!important`})),Qa=({strategies:n,input:e})=>m(j,{condition:n.length>0,show:B(qe,{children:[m(se,{variant:"subtitle1",sx:{mt:2,ml:1,mb:2,color:"text.secondary"},children:`Strategies (${n==null?void 0:n.length})`}),m(K,{sx:{width:"100%"},children:n==null?void 0:n.map((t,i)=>B(I.Fragment,{children:[m(j,{condition:i>0,show:m(Hi,{text:"OR"})}),m(yd,{strategy:t,index:i,input:e},t.id)]},t.id))})]})}),vd=({strategies:n,input:e})=>B(bd,{sx:{pb:1,mt:2},children:[B(wd,{severity:"info",color:"warning",children:["If environment was enabled, then this feature toggle would be"," ",n!=null&&n.result?"TRUE":"FALSE"," with strategies evaluated like so:"," "]}),m(xd,{sx:{p:2.5},children:m(Qa,{strategies:(n==null?void 0:n.data)||[],input:e})})]}),kd=({feature:n,input:e})=>{var t,i,s,r;return B(qe,{children:[m(j,{condition:((i=(t=n==null?void 0:n.strategies)==null?void 0:t.data)==null?void 0:i.length)===0,show:m(Mn,{severity:"warning",sx:{mt:2},children:"There are no strategies added to this feature toggle in selected environment."})}),m(j,{condition:!n.isEnabledInCurrentEnvironment&&Boolean((s=n==null?void 0:n.strategies)==null?void 0:s.data),show:m(vd,{strategies:n==null?void 0:n.strategies,input:e}),elseShow:m(Qa,{strategies:((r=n==null?void 0:n.strategies)==null?void 0:r.data)||[],input:e})})]})},Sd=$("div")(({theme:n})=>({alignItems:"flex-end",color:n.palette.tertiary.main})),Cd=({feature:n,input:e})=>{const[t,i]=I.useState(!1),s=I.useRef(null),r=()=>{i(!t)};return n?B(Sd,{children:[m(Ai,{onClick:r,children:m(Fa,{ref:s})}),B(Wa,{open:t,onClose:()=>i(!1),anchorEl:s.current,PaperProps:{sx:o=>({display:"flex",flexDirection:"column",padding:o.spacing(6),width:728,maxWidth:"100%",height:"auto",overflowY:"auto",backgroundColor:o.palette.tertiary.light,borderRadius:o.shape.borderRadius})},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:[m(Zu,{feature:n,input:e,onClose:()=>i(!1)}),m(kd,{feature:n,input:e})]})]}):null},Ad={id:"name"},{value:Vo,setValue:Md}=ou("PlaygroundResultsTable:v1",Ad),Od=({features:n,input:e,loading:t})=>{const[i,s]=Ha(),r=lu(t),[o,l]=I.useState(i.get("search")||""),a=ke(),h=nr(a.breakpoints.down("sm")),c=nr(a.breakpoints.down("md")),f=I.useMemo(()=>[{Header:"Name",accessor:"name",searchable:!0,minWidth:160,Cell:({value:v,row:{original:O}})=>m(Eo,{title:v,to:`/projects/${O==null?void 0:O.projectId}/features/${v}`})},{Header:"Project ID",accessor:"projectId",sortType:"alphanumeric",filterName:"projectId",searchable:!0,maxWidth:170,Cell:({value:v})=>m(Eo,{title:v,to:`/projects/${v}`})},{Header:"Variant",id:"variant",accessor:"variant.name",sortType:"alphanumeric",filterName:"variant",searchable:!0,maxWidth:200,Cell:({value:v,row:{original:{variant:O,feature:N,variants:P,isEnabled:E}}})=>m(Ku,{variant:O!=null&&O.enabled?v:"",variants:P,feature:N,isEnabled:E})},{id:"isEnabled",Header:"isEnabled",filterName:"isEnabled",accessor:v=>{var O;return v!=null&&v.isEnabled?"true":((O=v==null?void 0:v.strategies)==null?void 0:O.result)==="unknown"?"unknown":"false"},Cell:({row:v})=>m(Hu,{feature:v.original}),sortType:"playgroundResultState",maxWidth:120,sortInverted:!0},{Header:"",maxWidth:70,id:"info",Cell:({row:v})=>m(Cd,{feature:v.original,input:e})}],[e]),{data:u,getSearchText:d,getSearchContext:p}=au(f,o,n||[]),y=I.useMemo(()=>t?Array(5).fill({name:"Feature name",projectId:"FeatureProject",variant:{name:"FeatureVariant",variants:[]},enabled:!0}):u,[u,t]),[b]=I.useState(()=>({sortBy:[{id:i.get("sort")||Vo.id,desc:i.has("order")?i.get("order")==="desc":Vo.desc}]})),{headerGroups:x,rows:k,state:{sortBy:M},prepareRow:C,setHiddenColumns:S}=Bt.useTable({initialState:b,columns:f,data:y,sortTypes:Na,autoResetGlobalFilter:!1,autoResetHiddenColumns:!1,autoResetSortBy:!1,disableSortRemove:!0,disableMultiSort:!0,defaultColumn:{Cell:hu}},Bt.useGlobalFilter,Bt.useFlexLayout,Bt.useSortBy);return cu([{condition:h,columns:["variant"]},{condition:c,columns:["projectId"]}],S,f),I.useEffect(()=>{if(t)return;const v=Object.fromEntries(i);v.sort=M[0].id,M[0].desc?v.order="desc":v.order&&delete v.order,o?v.search=o:delete v.search,s(v,{replace:!0}),Md({id:M[0].id,desc:M[0].desc||!1})},[t,M,o]),B(qe,{children:[B(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[m(se,{variant:"subtitle1",sx:{ml:1},children:n!==void 0&&!t?`Results (${k.length<y.length?`${k.length} of ${y.length}`:y.length})`:"Results"}),m(fu,{initialValue:o,onChange:l,hasFilters:!0,getSearchContext:p,disabled:t,containerStyles:{marginLeft:"1rem",maxWidth:"400px"}})]}),m(j,{condition:!t&&!y,show:()=>m(As,{children:y===void 0?"None of the feature toggles were evaluated yet.":"No results found."}),elseShow:()=>B(K,{ref:r,children:[m(uu,{value:d(o),children:m(du,{rows:k,headerGroups:x,prepareRow:C})}),m(j,{condition:y.length===0&&(o==null?void 0:o.length)>0,show:B(As,{children:["No feature toggles found matching “",o,"”"]})}),m(j,{condition:y&&y.length===0&&!o,show:m(As,{children:"No features toggles to display"})})]})})]})},Dd=()=>{const{makeRequest:n,createRequest:e,errors:t,loading:i}=pu({propagateErrors:!0}),s="api/admin/playground";return{evaluatePlayground:async o=>{const a=e(s,{method:"POST",body:JSON.stringify(o)});try{return(await n(a.caller,a.id)).json()}catch(h){throw h}},errors:t,loading:i}},Td=$("div")(({style:n,theme:e})=>({width:"25px",height:"25px",borderRadius:"50%",color:e.palette.text.tertiaryContrast,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...n})),as=({style:n,children:e,type:t})=>{const i=ke(),s={backgroundColor:i.palette.primary.main};return t==="secondary"&&(s.backgroundColor=i.palette.tertiary.dark),m(Td,{style:{...s,...n},children:e})},Pd=n=>!n||n.length===0||n.length===1&&n[0]==="*"?"*":Array.isArray(n)?n:[n],Rd=n=>{const e=Ja(n);return e.length>0?e[0]:""},Ja=n=>n.filter(({enabled:e})=>Boolean(e)).sort((e,t)=>e.sortOrder-t.sortOrder).map(({name:e})=>e),Bd=(n,e)=>n?"100%":e&&!n?"65%":"50%";function or(n,e,t){var i,s,r,o,l;e==null&&(e=100);function a(){var c=Date.now()-o;c<e&&c>=0?i=setTimeout(a,e-c):(i=null,t||(l=n.apply(r,s),r=s=null))}var h=function(){r=this,s=arguments,o=Date.now();var c=t&&!i;return i||(i=setTimeout(a,e)),c&&(l=n.apply(r,s),r=s=null),l};return h.clear=function(){i&&(clearTimeout(i),i=null)},h.flush=function(){i&&(l=n.apply(r,s),r=s=null,clearTimeout(i),i=null)},h}or.debounce=or;var Ld=or;class q{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),_e.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),_e.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new vi(this),r=new vi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new vi(this,e)}iterRange(e,t=this.length){return new _a(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ya(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?q.empty:e.length<=32?new re(e):_e.from(re.split(e,[]))}}class re extends q{constructor(e,t=Ed(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Id(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new re(Ho(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=gn(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new re(l,o.length+r.length));else{let a=l.length>>1;i.push(new re(l.slice(0,a)),new re(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof re))return super.replace(e,t,i);let s=gn(this.text,gn(i.text,Ho(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new re(s,r):_e.from(re.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
|
2
2
|
`){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new re(i,s)),i=[],s=-1);return s>-1&&t.push(new re(i,s)),t}}class _e extends q{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new _e(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
3
3
|
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof _e))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new re(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof _e)for(let y of d.children)f(y);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof re&&a&&(p=c[c.length-1])instanceof re&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new re(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:_e.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new _e(l,t)}}q.empty=new re([""],0);function Ed(n){let e=-1;for(let t of n)e+=t.length+1;return e}function gn(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function Ho(n,e,t){return gn(n,[""],e,t)}class vi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof re?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof re?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
4
|
`,this;e--}else if(s instanceof re){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof re?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class _a{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new vi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ya{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(q.prototype[Symbol.iterator]=function(){return this.iter()},vi.prototype[Symbol.iterator]=_a.prototype[Symbol.iterator]=Ya.prototype[Symbol.iterator]=function(){return this});class Id{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Qt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<Qt.length;n++)Qt[n]+=Qt[n-1];function Nd(n){for(let e=1;e<Qt.length;e+=2)if(Qt[e]>n)return Qt[e-1]<=n;return!1}function zo(n){return n>=127462&&n<=127487}const $o=8205;function Ae(n,e,t=!0,i=!0){return(t?Xa:Fd)(n,e,i)}function Xa(n,e,t){if(e==n.length)return e;e&&Za(n.charCodeAt(e))&&eh(n.charCodeAt(e-1))&&e--;let i=me(n,e);for(e+=Le(i);e<n.length;){let s=me(n,e);if(i==$o||s==$o||t&&Nd(s))e+=Le(s),i=s;else if(zo(s)){let r=0,o=e-2;for(;o>=0&&zo(me(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Fd(n,e,t){for(;e>0;){let i=Xa(n,e-2,t);if(i<e)return i;e--}return 0}function Za(n){return n>=56320&&n<57344}function eh(n){return n>=55296&&n<56320}function me(n,e){let t=n.charCodeAt(e);if(!eh(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Za(i)?(t-55296<<10)+(i-56320)+65536:t}function Zr(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Le(n){return n<65536?1:2}const lr=/\r\n?|\n/;var Ce=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(Ce||(Ce={}));class Ze{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){ar(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new Ze(e)}composeDesc(e){return this.empty?e:e.empty?this:th(this,e)}mapDesc(e,t=!1){return e.empty?this:hr(this,e,t)}mapPos(e,t=-1,i=Ce.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(i!=Ce.Simple&&h>=e&&(i==Ce.TrackDel&&s<e&&h>e||i==Ce.TrackBefore&&s<e||i==Ce.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ze(e)}static create(e){return new Ze(e)}}class ce extends Ze{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return ar(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return hr(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(q.empty);i.push(o?e.slice(r,r+o):q.empty)}r+=o}return new ce(t,i)}compose(e){return this.empty?e:e.empty?this:th(this,e,!0)}map(e,t=!1){return e.empty?this:hr(this,e,t,!0)}iterChanges(e,t=!1){ar(this,e,t)}get desc(){return Ze.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new Mi(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let c=Math.min(r.len,a-l);xe(s,c,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;xe(t,c,f),f>0&&pt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l<h;){if(r.done)break e;let c=Math.min(r.len,h-l);xe(t,c,-1),xe(s,c,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(c),l+=c}}return{changes:new ce(t,i),filtered:Ze.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;o<t&&xe(s,t-o,-1);let f=new ce(s,r);l=l?l.compose(f.map(l)):f,s=[],r=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof ce){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?q.of(d.split(i||lr)):d:q.empty,y=p.length;if(f==u&&y==0)return;f<o&&a(),f>o&&xe(s,f-o,-1),xe(s,u-f,y),pt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push(q.empty);i[s]=q.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new ce(t,i)}static createSet(e,t){return new ce(e,t)}}function xe(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function pt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(q.empty);n.push(t)}}function ar(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let h=s,c=r,f=q.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function hr(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Mi(n),l=new Mi(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);xe(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let h=l.len;for(xe(s,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(xe(s,0,o.ins),r&&pt(r,s,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;xe(s,h,a<o.i?o.ins:0),r&&a<o.i&&pt(r,s,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?ce.createSet(s,r):Ze.create(s);throw new Error("Mismatched change set lengths")}}function th(n,e,t=!1){let i=[],s=t?[]:null,r=new Mi(n),o=new Mi(e);for(let l=!1;;){if(r.done&&o.done)return s?ce.createSet(i,s):Ze.create(i);if(r.ins==0)xe(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)xe(i,0,o.ins,l),s&&pt(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;xe(i,a,c,l),s&&c&&pt(s,i,o.text)}else o.ins==-1?(xe(i,r.off?0:r.len,a,l),s&&pt(s,i,r.textBit(a))):(xe(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&pt(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Mi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?q.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?q.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Lt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new Lt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return w.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return w.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return w.range(e.anchor,e.head)}static create(e,t,i){return new Lt(e,t,i)}}class w{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:w.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new w([this.main],0)}addRange(e,t=!0){return w.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,w.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new w(e.ranges.map(t=>Lt.fromJSON(t)),e.main)}static single(e,t=e){return new w([w.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=i:r.from<i)return w.normalized(e.slice(),t);i=r.to}return new w(e,t)}static cursor(e,t=0,i,s){return Lt.create(e,e,(t==0?0:t<0?4:8)|(i==null?3:Math.min(2,i))|(s??33554431)<<5)}static range(e,t,i,s){let r=(i??33554431)<<5|(s==null?3:Math.min(2,s));return t<e?Lt.create(t,e,24|r):Lt.create(e,t,(t>e?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?w.range(a,l):w.range(l,a))}}return new w(e,t)}}function ih(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let eo=0;class R{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=eo++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new R(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:to),!!e.static,e.enables)}of(e){return new yn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new yn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new yn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function to(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class yn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=eo++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||cr(f,c)){let d=i(f);if(l?!qo(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let y=Pn(u,p);if(this.dependencies.every(b=>b instanceof R?u.facet(b)===f.facet(b):b instanceof be?u.field(b,!1)==f.field(b,!1):!0)||(l?qo(d=i(f),y,s):s(d=i(f),y)))return f.values[o]=y,0}else d=i(f);return f.values[o]=d,1}}}}function qo(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function cr(n,e){let t=!1;for(let i of e)ki(n,i)&1&&(t=!0);return t}function Wd(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=Pn(a,i[c]);if(s[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)ki(a,h);return a.values[o]=l(a),1},update(a,h){if(!cr(a,r))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=cr(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&to(t,f))return a.values[o]=u,0;let d=l(a);return e.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const jo=R.define({static:!0});class be{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new be(eo++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(jo).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,jo.of({field:this,create:e})]}get extension(){return this}}const Pt={lowest:4,low:3,default:2,high:1,highest:0};function fi(n){return e=>new nh(e,n)}const li={highest:fi(Pt.highest),high:fi(Pt.high),default:fi(Pt.default),low:fi(Pt.low),lowest:fi(Pt.lowest)};class nh{constructor(e,t){this.inner=e,this.prec=t}}class hs{of(e){return new fr(this,e)}reconfigure(e){return hs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class fr{constructor(e,t){this.compartment=e,this.inner=t}}class Tn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Vd(e,t,o))u instanceof be?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,y=c&&c[u]||[];if(d.every(b=>b.type==0))if(l[p.id]=a.length<<1|1,to(y,d))a.push(i.facet(p));else{let b=p.combine(d.map(x=>x.value));a.push(i&&p.compare(b,i.facet(p))?i.facet(p):b)}else{for(let b of d)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=h.length<<1,h.push(x=>b.dynamicSlot(x)));l[p.id]=h.length<<1,h.push(b=>Wd(b,p,d))}}let f=h.map(u=>u(l));return new Tn(e,o,f,l,a,r)}}function Vd(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof fr&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof fr){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof nh)r(o.inner,o.prec);else if(o instanceof be)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof yn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Pt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,Pt.default),i.reduce((o,l)=>o.concat(l))}function ki(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Pn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const sh=R.define(),rh=R.define({combine:n=>n.some(e=>e),static:!0}),oh=R.define({combine:n=>n.length?n[0]:void 0,static:!0}),lh=R.define(),ah=R.define(),hh=R.define(),ch=R.define({combine:n=>n.length?n[0]:!1});class Mt{constructor(e,t){this.type=e,this.value=t}static define(){return new Hd}}class Hd{of(e){return new Mt(this,e)}}class zd{constructor(e){this.map=e}of(e){return new F(this,e)}}class F{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new F(this.type,t)}is(e){return this.type==e}static define(e={}){return new zd(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}F.reconfigure=F.define();F.appendConfig=F.define();class fe{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ih(i,t.newLength),r.some(l=>l.type==fe.time)||(this.annotations=r.concat(fe.time.of(Date.now())))}static create(e,t,i,s,r,o){return new fe(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(fe.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}fe.time=Mt.define();fe.userEvent=Mt.define();fe.addToHistory=Mt.define();fe.remote=Mt.define();function $d(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function fh(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=ce.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:F.mapEffects(n.effects,s).concat(F.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ur(n,e,t){let i=e.selection,s=Jt(e.annotations);return e.userEvent&&(s=s.concat(fe.userEvent.of(e.userEvent))),{changes:e.changes instanceof ce?e.changes:ce.of(e.changes||[],t,n.facet(oh)),selection:i&&(i instanceof w?i:w.single(i.anchor,i.head)),effects:Jt(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function uh(n,e,t){let i=ur(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=fh(i,ur(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=fe.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return jd(t?qd(s):s)}function qd(n){let e=n.startState,t=!0;for(let s of e.facet(lh)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:$d(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=ce.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=fe.create(e,s,n.selection&&n.selection.map(r),F.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(ah);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof fe?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof fe?n=r[0]:n=uh(e,Jt(r),!1)}return n}function jd(n){let e=n.startState,t=e.facet(hh),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=fh(i,ur(e,r,n.changes.newLength),!0))}return i==n?n:fe.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const Ud=[];function Jt(n){return n==null?Ud:Array.isArray(n)?n:[n]}var Z=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(Z||(Z={}));const Kd=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let dr;try{dr=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Gd(n){if(dr)return dr.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Kd.test(t)))return!0}return!1}function Qd(n){return e=>{if(!/\S/.test(e))return Z.Space;if(Gd(e))return Z.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Z.Word;return Z.Other}}class V{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)ki(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return ki(this,i),Pn(this,i)}update(...e){return uh(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let o of e.effects)o.is(hs.reconfigure)?(t&&(s=new Map,t.compartments.forEach((l,a)=>s.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(F.reconfigure)?(t=null,i=o.value):o.is(F.appendConfig)&&(t=null,i=Jt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Tn.resolve(i,s,this),r=new V(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new V(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:w.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Jt(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),h=this.changes(a.changes),c=h.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(c);let f=s.mapDesc(h,!0);r.push(a.range.map(f)),s=s.compose(c),o=F.mapEffects(o,c).concat(F.mapEffects(Jt(a.effects),f))}return{changes:s,selection:w.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof ce?e:ce.of(e,this.doc.length,this.facet(V.lineSeparator))}toText(e){return q.of(e.split(this.facet(V.lineSeparator)||lr))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(ki(this,t),Pn(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof be&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return V.create({doc:e.doc,selection:w.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Tn.resolve(e.extensions||[],new Map),i=e.doc instanceof q?e.doc:q.of((e.doc||"").split(t.staticFacet(V.lineSeparator)||lr)),s=e.selection?e.selection instanceof w?e.selection:w.single(e.selection.anchor,e.selection.head):w.single(0);return ih(s,i.length),t.staticFacet(rh)||(s=s.asSingle()),new V(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(V.tabSize)}get lineBreak(){return this.facet(V.lineSeparator)||`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,m as x,a as n,an as y,f as r,j as o,C as d,ao as b,x as f,ap as m}from"./index-
|
|
1
|
+
import{s as e,m as x,a as n,an as y,f as r,j as o,C as d,ao as b,x as f,ap as m}from"./index-a09b079f.js";const I=e(x)(({theme:a})=>({padding:0,cursor:"inherit",transition:"color 0.2s ease-in-out"})),h=e("div")(({theme:a})=>({fontSize:a.typography.fontSize,color:a.palette.text.secondary,position:"absolute",display:"none",right:"calc(100% + 6px)",top:a.spacing(2.5),[a.breakpoints.up("md")]:{display:"block"}})),v=e(n)(({theme:a})=>({borderRadius:a.shape.borderRadiusMedium,border:`1px solid ${a.palette.divider}`,"& + &":{marginTop:a.spacing(2)},background:a.palette.background.paper})),S=e("div",{shouldForwardProp:a=>a!=="draggable"})(({theme:a,draggable:i})=>({padding:a.spacing(.5,2),display:"flex",gap:a.spacing(1),alignItems:"center",borderBottom:`1px solid ${a.palette.divider}`,fontWeight:a.typography.fontWeightMedium,paddingLeft:i?a.spacing(1):a.spacing(2)})),j=({strategy:a,onDragStart:i,onDragEnd:l,actions:c,children:p,orderNumber:s,style:g={}})=>{const u=y(a.name);return r(n,{sx:{position:"relative"},children:[o(d,{condition:s!==void 0,show:o(h,{children:s})}),r(v,{style:g,children:[r(S,{draggable:Boolean(i),children:[o(d,{condition:Boolean(i),show:()=>o(I,{draggable:!0,disableRipple:!0,size:"small",onDragStart:i,onDragEnd:l,sx:{cursor:"move"},children:o(b,{titleAccess:"Drag to reorder",cursor:"grab",sx:{color:"neutral.main"}})})}),o(u,{sx:{fill:t=>t.palette.inactiveIcon}}),o(f,{maxWidth:"150",maxLength:15,text:m(a.name)}),o(n,{sx:{marginLeft:"auto",display:"flex",minHeight:t=>t.spacing(6),alignItems:"center"},children:c})]}),o(n,{sx:{p:2,justifyItems:"center"},children:p})]})]})};export{j as S};
|