unleash-server 4.22.2 → 4.22.5
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/db/feature-toggle-store.d.ts +2 -2
- package/dist/lib/db/feature-toggle-store.js +4 -4
- package/dist/lib/db/feature-toggle-store.js.map +1 -1
- package/dist/lib/db/project-stats-store.d.ts +2 -1
- package/dist/lib/db/project-stats-store.js +22 -0
- package/dist/lib/db/project-stats-store.js.map +1 -1
- package/dist/lib/db/project-store.js +2 -1
- package/dist/lib/db/project-store.js.map +1 -1
- package/dist/lib/features/feature-toggle/time-to-production/time-to-production.d.ts +2 -0
- package/dist/lib/features/feature-toggle/time-to-production/time-to-production.js +15 -0
- package/dist/lib/features/feature-toggle/time-to-production/time-to-production.js.map +1 -0
- package/dist/lib/features/feature-toggle/time-to-production/time-to-production.test.js +27 -0
- package/dist/lib/features/feature-toggle/time-to-production/time-to-production.test.js.map +1 -0
- package/dist/lib/services/project-service.js +16 -46
- package/dist/lib/services/project-service.js.map +1 -1
- package/dist/lib/types/experimental.d.ts +1 -0
- package/dist/lib/types/experimental.js +1 -0
- package/dist/lib/types/experimental.js.map +1 -1
- package/dist/lib/types/model.d.ts +1 -1
- package/dist/lib/types/stores/feature-toggle-store.d.ts +2 -2
- package/dist/lib/types/stores/project-stats-store-type.d.ts +5 -0
- package/dist/test/e2e/api/admin/project/features.e2e.test.js +6 -1
- package/dist/test/e2e/api/admin/project/features.e2e.test.js.map +1 -1
- package/dist/test/e2e/api/proxy/proxy.e2e.test.js +1 -1
- package/dist/test/e2e/api/proxy/proxy.e2e.test.js.map +1 -1
- package/dist/test/e2e/services/api-token-service.e2e.test.js +1 -0
- package/dist/test/e2e/services/api-token-service.e2e.test.js.map +1 -1
- package/dist/test/e2e/services/project-service.e2e.test.js +98 -0
- package/dist/test/e2e/services/project-service.e2e.test.js.map +1 -1
- package/dist/test/fixtures/fake-feature-toggle-store.d.ts +2 -2
- package/dist/test/fixtures/fake-feature-toggle-store.js +2 -2
- package/dist/test/fixtures/fake-feature-toggle-store.js.map +1 -1
- package/dist/test/fixtures/fake-project-stats-store.d.ts +2 -1
- package/dist/test/fixtures/fake-project-stats-store.js +3 -0
- package/dist/test/fixtures/fake-project-stats-store.js.map +1 -1
- package/dist/test/fixtures/fake-project-store.js +1 -0
- package/dist/test/fixtures/fake-project-store.js.map +1 -1
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/{CreateProject-51932050.js → CreateProject-a2c9a780.js} +1 -1
- package/frontend/build/static/{Error-e6e1194a.js → Error-38b8cdc0.js} +1 -1
- package/frontend/build/static/{ExpandMore-d71bbced.js → ExpandMore-ee840700.js} +1 -1
- package/frontend/build/static/{FeatureArchiveDialog-fd71aac2.js → FeatureArchiveDialog-0d7ae6c3.js} +1 -1
- package/frontend/build/static/{FeatureMetricsChart-66e2ebdf.js → FeatureMetricsChart-ed667dfd.js} +1 -1
- package/frontend/build/static/FeatureViewLazyExport-1b33033a.js +7 -0
- package/frontend/build/static/{LazyAdminExport-17ef1739.js → LazyAdminExport-f1db04ed.js} +2 -2
- package/frontend/build/static/{LazyProjectExport-96365c31.js → LazyProjectExport-984413bf.js} +1 -1
- package/frontend/build/static/{NetworkOverview-02d7cec9.js → NetworkOverview-c9972cf4.js} +1 -1
- package/frontend/build/static/{NetworkTraffic-ea8ea762.js → NetworkTraffic-b4d65658.js} +1 -1
- package/frontend/build/static/{Playground-1b14c01c.js → Playground-82d86aa7.js} +1 -1
- package/frontend/build/static/{StrategyItemContainer-7ce39bda.js → StrategyItemContainer-72e360fd.js} +1 -1
- package/frontend/build/static/{chartjs-adapter-date-fns.esm-8ccfeb24.js → chartjs-adapter-date-fns.esm-00d0c032.js} +1 -1
- package/frontend/build/static/{index-17782336.js → index-78310b22.js} +1 -1
- package/frontend/build/static/{index-1d165488.js → index-99d4171f.js} +61 -61
- package/frontend/build/static/{index-96dcc77e.js → index-c65a88d1.js} +1 -1
- package/frontend/build/static/{unknownify-132fbce3.js → unknownify-9d8df72f.js} +1 -1
- package/frontend/build/static/{useProjectRole-f048973d.js → useProjectRole-dba93dda.js} +1 -1
- package/package.json +1 -1
- package/dist/lib/read-models/time-to-production/time-to-production.d.ts +0 -20
- package/dist/lib/read-models/time-to-production/time-to-production.js +0 -75
- package/dist/lib/read-models/time-to-production/time-to-production.js.map +0 -1
- package/dist/lib/read-models/time-to-production/time-to-production.test.js +0 -182
- package/dist/lib/read-models/time-to-production/time-to-production.test.js.map +0 -1
- package/frontend/build/static/FeatureViewLazyExport-3403c2b4.js +0 -7
- /package/dist/lib/{read-models → features/feature-toggle}/time-to-production/time-to-production.test.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Hi,j as m,r as I,u as ke,C as j,B as wi,s as $,a as K,T as se,b as Kf,d as Bt,e as Na,f as B,g as Gf,S as Qf,h as Jf,i as Yf,k as _f,F as je,I as Xf,l as Bo,m as Mi,n as Fa,P as Wa,o as Zf,A as On,p as zi,q as eu,t as Va,v as tu,w as iu,x as er,y as gn,z as tr,D as nu,E as su,G as ru,H as ou,J as lu,K as au,L as Ha,M as hu,N as ir,O as Lo,Q as cu,R as fu,U as uu,V as du,W as Cs,X as pu,Y as mu,Z as gu,_ as yu,$ as _r,a0 as bu,a1 as xu,a2 as za,a3 as wu,a4 as Dn,a5 as vu,a6 as ku,a7 as Su,a8 as Cu,a9 as $a,aa as Eo,ab as Io,ac as vi,ad as nr,ae as Au,af as sr,ag as Mu,ah as qa,ai as Ou,aj as Du,ak as Tu,al as Pu,am as Ru}from"./index-1d165488.js";import{S as Bu}from"./StrategyItemContainer-7ce39bda.js";import{E as Lu}from"./Error-e6e1194a.js";const ls=Hi(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"),Eu=Hi(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"),Iu=Hi(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"),Nu=Hi(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"),Fu=Hi(m("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"WarningOutlined"),Wu=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"})),Vu=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"})),Tn=({enabled:n,label:e,showIcon:t=!0})=>{const i=ke(),s=m(j,{condition:n==="unknown"||n==="unevaluated",show:m(Fu,{color:"warning",fontSize:"inherit"}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(Wu,{color:i.palette.success.main,strokeWidth:"0.25"}),elseShow:m(Vu,{color:i.palette.error.main,strokeWidth:"0.25"})})});return m(j,{condition:n==="unknown"||n==="unevaluated",show:m(wi,{icon:t?s:void 0,color:"warning",children:e}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(wi,{color:"success",icon:t?s:void 0,children:e}),elseShow:m(wi,{color:"error",icon:t?s:void 0,children:e})})})},Hu=$(K)(({theme:n})=>({display:"flex",alignItems:"center",padding:n.spacing(1,2)})),zu=$(K)(()=>({marginRight:"auto"})),$u=({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(Hu,{children:m(zu,{"data-loading":!0,children:m(Tn,{enabled:e,label:t,showIcon:e!=="unknown"})})})},qu=$("div")(({theme:n})=>({padding:n.spacing(4),maxWidth:"400px"})),As=$(se)(({theme:n})=>({marginBottom:n.spacing(2)})),ju=$(Iu)(({theme:n})=>({color:n.palette.success.main})),Uu=({variants:n,selectedVariant:e})=>{const t=ke(),i=I.useMemo(()=>n.map(c=>({name:c.name,weight:`${Kf(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:Ku,data:i,sortTypes:Na,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},Bt.useGlobalFilter,Bt.useSortBy);return B(qu,{children:[m(As,{variant:"subtitle2",children:"Variant Information"}),m(As,{variant:"body2",children:"The following table shows the variants defined on this feature toggle and the variant result based on your context configuration."}),m(As,{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(Gf,{...r(),rowHeight:"dense",children:[m(Qf,{headerGroups:l}),m(Jf,{...o(),children:a.map(c=>{let f={};return c.original.selected||(f.color=t.palette.text.secondary),h(c),m(Yf,{hover:!0,...c.getRowProps(),children:c.cells.map(u=>m(_f,{...u.getCellProps(),style:f,children:u.render("Cell")}))})})})]})]})},Ku=[{id:"Icon",Cell:({row:{original:{selected:n}}})=>m(je,{children:m(j,{condition:n,show:m(Xf,{icon:m(ju,{})})})}),maxWidth:25,disableGlobalFilter:!0},{Header:"Name",accessor:"name",searchable:!0,Cell:({row:{original:{name:n}}})=>m(Bo,{children:n}),maxWidth:175,width:175},{Header:"Weight",accessor:"weight",sortType:"alphanumeric",searchable:!0,maxWidth:75,Cell:({row:{original:{weight:n}}})=>m(Bo,{children:n})}],Gu=$("div")(()=>({maxWidth:"100%",display:"flex",alignItems:"center",wordBreak:"break-all"})),Qu=({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(Gu,{children:[n,m(j,{condition:Boolean(e)&&e.length>0&&i,show:B(je,{children:[m(Mi,{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(Uu,{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 No=n=>{var e,t;return(t=(e=n.strategies)==null?void 0:e.data)==null?void 0:t.find(i=>!ja.includes(i.name))},Ju=n=>{var e,t;return!((t=(e=n.strategies)==null?void 0:e.data)!=null&&t.find(i=>ja.includes(i.name)))},Yu=$("div")({display:"flex",justifyContent:"space-between",width:"100%"}),_u=$("div")(({theme:n})=>({display:"inline-flex",alignItems:"center",gap:n.spacing(1.5),marginTop:n.spacing(1.5)})),Fo=$("div")(({theme:n})=>({margin:n.spacing(1,0)})),Xu=$("div")(({theme:n})=>({margin:n.spacing(1,.5)})),Zu=$(se)(({theme:n})=>({fontWeight:600,padding:n.spacing(.5)})),ed=$(Mi)({textAlign:"right"}),td=({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?Ju(n)?[`This feature toggle is Unknown in ${e==null?void 0:e.environment} because `,"no strategies could be fully evaluated",i.palette.warning.main]:No(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=No(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(je,{children:[B(Yu,{children:[B(_u,{children:[m(Zu,{variant:"subtitle1",children:n.name}),m(j,{condition:((c=n==null?void 0:n.strategies)==null?void 0:c.result)!=="unknown",show:()=>m(Tn,{enabled:n.isEnabled,label:n.isEnabled?"True":"False"}),elseShow:()=>m(Tn,{enabled:"unknown",label:"Unknown",showIcon:!1})})]}),m(ed,{onClick:h,children:m(Zf,{})})]}),B(Xu,{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(Fo,{children:m(On,{color:"info",children:l})})}),m(j,{condition:Boolean(a),show:m(Fo,{children:m(On,{severity:"warning",color:"info",children:a})})})]})},id=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.error.main})),nd=({constraint:n,input:e})=>B(id,{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}`})()})]}),sd=$(Eu)(({theme:n})=>({color:n.palette.success.main})),rd=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.success.main})),od=()=>B(rd,{children:[m(sd,{style:{marginRight:"0.25rem"}}),m(se,{variant:"body2",children:"Constraint met by value in context"})]}),ld=$("div")(()=>({width:"100%",display:"flex",flexDirection:"column"})),Ka=({constraints:n,input:e})=>n?m(ld,{children:n==null?void 0:n.map((t,i)=>B(I.Fragment,{children:[m(j,{condition:i>0,show:m(zi,{text:"AND"})}),m(eu,{constraint:t,compact:!0,renderAfter:m(j,{condition:t.result,show:m(od,{}),elseShow:m(nd,{input:e,constraint:t})})})]},Va(t)))}):null,ad=$("div")(({theme:n})=>({color:n.palette.error.main,display:"inline-flex",justifyContent:"center",marginLeft:"auto",gap:n.spacing(1)})),hd=({segments:n,input:e})=>n?m(je,{children:n.map((t,i)=>B(I.Fragment,{children:[m(tu,{segment:t,constraintList:m(Ka,{constraints:t.constraints,input:e}),headerContent:m(j,{condition:!Boolean(t.result),show:B(ad,{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(zi,{text:"AND"})})]},t.id))}):null,cd=$("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.divider}`,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.spacing(2),opacity:e?.9:1,backgroundColor:e?n.palette.background.paper:"inherit"})),fd=$("div")(({theme:n})=>({flexDirection:"column"})),ud=$(iu)(({theme:n})=>({margin:n.spacing(.5)})),dd=$("p")(({theme:n})=>({display:"inline",margin:n.spacing(.5,0),maxWidth:"95%",textAlign:"center",wordBreak:"break-word"})),Ms=({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(cd,{showReason:i,children:[m(se,{variant:"subtitle1",color:s.palette[r].main,children:`${t}`}),B(fd,{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(dd,{children:[n.length," ",n.length>1?`${e}s`:e," will get access."]}),n.map(l=>m(ud,{label:m(er,{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.divider}`})),ct=n=>{switch(n.toUpperCase()){case"USERIDS":return"userId";case"IPS":return"remoteAddress";default:return n}},pd=({parameters:n,constraints:e,input:t})=>m(je,{children:Object.keys(n).map(i=>{var s,r,o,l,a,h,c,f;switch(i){case"rollout":case"Rollout":const u=tr(n[i]);return B(Ga,{sx:{display:"flex",alignItems:"center"},children:[m(K,{sx:{mr:"1rem"},children:m(nu,{percentage:u,size:"2rem"})}),B("div",{children:[B(wi,{color:"success",children:[u,"%"]})," ","of your base"," ",e.length>0?"who match constraints":""," ","is included."]})]},i);case"userIds":case"UserIds":const d=gn(n[i]);return m(Ms,{value:d,text:"user",input:Boolean((s=t==null?void 0:t.context)==null?void 0:s[ct(i)])?(r=t==null?void 0:t.context)==null?void 0:r[ct(i)]:"no value",showReason:Boolean((o=t==null?void 0:t.context)==null?void 0:o[ct(i)])?!d.includes((l=t==null?void 0:t.context)==null?void 0:l[ct(i)]):void 0},i);case"hostNames":case"HostNames":const p=gn(n[i]);return m(Ms,{value:p,text:"host",input:"no value",showReason:void 0},i);case"IPs":const y=gn(n[i]);return m(Ms,{value:y,text:"IP",input:Boolean((a=t==null?void 0:t.context)==null?void 0:a[ct(i)])?(h=t==null?void 0:t.context)==null?void 0:h[ct(i)]:"no value",showReason:Boolean((c=t==null?void 0:t.context)==null?void 0:c[ct(i)])?!y.includes((f=t==null?void 0:t.context)==null?void 0:f[ct(i)]):void 0},i);case"stickiness":case"groupId":return null;default:return null}})}),md=$(K)(({theme:n})=>({width:"100%",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.divider}`,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(md,{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(je,{children:[m(se,{component:"span",color:i.palette.error.main,children:" required parameter "}),m(er,{maxWidth:"300",text:n,maxLength:50}),m(se,{component:"span",color:i.palette.error.main,children:" is not set "})]}),elseShow:B(je,{children:[m(se,{component:"span",color:"text.disabled",children:" set on parameter "}),m(er,{maxWidth:"300",text:n,maxLength:50})]})})})}),m(j,{condition:Boolean(r),show:m(ls,{color:"error"}),elseShow:m("div",{})})]})},gd=({strategyName:n,parameters:e})=>{const{strategies:t}=su(),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=gn(o);return m(ci,{isRequired:l,text:r.name,input:(a==null?void 0:a.length)>0?a.join(", "):null});case"percentage":const h=tr(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=ru(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=tr(o);return m(ci,{text:r.name,isRequired:l,input:d?`${p}`:void 0});case"default":return null}return null});return m(je,{children:s.map((r,o)=>B(I.Fragment,{children:[m(j,{condition:o>0,show:m(zi,{text:"AND"})}),r]},o))})},yd=$("div")(({theme:n})=>({padding:n.spacing(0)})),bd=({strategyResult:n,input:e})=>{const{name:t,constraints:i,segments:s,parameters:r}=n,{uiConfig:o}=ou(),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(lu).includes(t),c=Object.keys(r).length>0&&n.result.evaluationStatus==="incomplete";if(!r)return null;const f=[l&&m(hd,{segments:s,input:e}),a&&m(Ka,{constraints:i,input:e}),h&&m(pd,{parameters:r,constraints:i,input:e}),c&&m(gd,{strategyName:t,parameters:r}),t==="default"&&B(Ga,{sx:{width:"100%"},children:["The standard strategy is ",m(wi,{color:"success",children:"ON"})," for all users."]})].filter(Boolean);return m(yd,{children:f.map((u,d)=>B(I.Fragment,{children:[m(j,{condition:d>0,show:m(zi,{text:"AND"})}),u]},d))})},xd=({strategy:n,input:e,index:t})=>{const{result:i}=n,s=ke(),r=i.evaluationStatus==="incomplete"?"Unevaluated":i.enabled?"True":"False";return m(Bu,{style:{borderColor:i.enabled?s.palette.success.main:"none"},strategy:{...n,id:`${Va(n)}`},orderNumber:t+1,actions:m(Tn,{showIcon:!1,enabled:i.enabled,label:r}),children:m(bd,{strategyResult:n,input:e,percentageFill:s.palette.background.elevation2})})},wd=$("div")(({theme:n})=>({display:"flex",padding:"0, 4px",flexDirection:"column",borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.warning.border}`})),vd=$("div")(({theme:n})=>({padding:n.spacing(1,.5)})),kd=$(On)(({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(je,{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(zi,{text:"OR"})}),m(xd,{strategy:t,index:i,input:e},t.id)]},t.id))})]})}),Sd=({strategies:n,input:e})=>B(wd,{sx:{pb:1,mt:2},children:[B(kd,{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(vd,{sx:{p:2.5},children:m(Qa,{strategies:(n==null?void 0:n.data)||[],input:e})})]}),Cd=({feature:n,input:e})=>{var t,i,s,r;return B(je,{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(On,{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(Sd,{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})})]})},Ad=$("div")(({theme:n})=>({alignItems:"flex-end",color:n.palette.divider})),Md=({feature:n,input:e})=>{const[t,i]=I.useState(!1),s=I.useRef(null),r=()=>{i(!t)};return n?B(Ad,{children:[m(Mi,{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.background.elevation2,borderRadius:o.shape.borderRadius})},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:[m(td,{feature:n,input:e,onClose:()=>i(!1)}),m(Cd,{feature:n,input:e})]})]}):null},Od={id:"name"},{value:Wo,setValue:Dd}=au("PlaygroundResultsTable:v1",Od),Td=({features:n,input:e,loading:t})=>{const[i,s]=Ha(),r=hu(t),[o,l]=I.useState(i.get("search")||""),a=ke(),h=ir(a.breakpoints.down("sm")),c=ir(a.breakpoints.down("md")),f=I.useMemo(()=>[{Header:"Name",accessor:"name",searchable:!0,minWidth:160,Cell:({value:v,row:{original:O}})=>m(Lo,{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(Lo,{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(Qu,{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($u,{feature:v.original}),sortType:"playgroundResultState",maxWidth:120,sortInverted:!0},{Header:"",maxWidth:70,id:"info",Cell:({row:v})=>m(Md,{feature:v.original,input:e})}],[e]),{data:u,getSearchText:d,getSearchContext:p}=cu(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")||Wo.id,desc:i.has("order")?i.get("order")==="desc":Wo.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:fu}},Bt.useGlobalFilter,Bt.useFlexLayout,Bt.useSortBy);return uu([{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}),Dd({id:M[0].id,desc:M[0].desc||!1})},[t,M,o]),B(je,{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(du,{initialValue:o,onChange:l,hasFilters:!0,getSearchContext:p,disabled:t,containerStyles:{marginLeft:"1rem",maxWidth:"400px"}})]}),m(j,{condition:!t&&!y,show:()=>m(Cs,{children:y===void 0?"None of the feature toggles were evaluated yet.":"No results found."}),elseShow:()=>B(K,{ref:r,children:[m(pu,{value:d(o),children:m(mu,{rows:k,headerGroups:x,prepareRow:C})}),m(j,{condition:y.length===0&&(o==null?void 0:o.length)>0,show:B(Cs,{children:["No feature toggles found matching “",o,"”"]})}),m(j,{condition:y&&y.length===0&&!o,show:m(Cs,{children:"No features toggles to display"})})]})})]})},Pd=()=>{const{makeRequest:n,createRequest:e,errors:t,loading:i}=gu({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}},Rd=$("div")(({style:n,theme:e})=>({width:"25px",height:"25px",borderRadius:"50%",color:e.palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...n})),as=({style:n,children:e,type:t})=>{const i=ke(),s={backgroundColor:i.palette.background.alternative,color:i.palette.common.white};return t==="secondary"&&(s.backgroundColor=i.palette.background.paper,s.color=i.palette.text.secondary),m(Rd,{style:{...s,...n},children:e})},Bd=n=>!n||n.length===0||n.length===1&&n[0]==="*"?"*":Array.isArray(n)?n:[n],Ld=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),Ed=(n,e)=>n?"100%":e&&!n?"65%":"50%";function rr(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}rr.debounce=rr;var Id=rr;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 ki(this),r=new ki(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 ki(this,e)}iterRange(e,t=this.length){return new Ya(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 _a(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=Nd(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 Fd(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new re(Vo(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=yn(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=yn(this.text,yn(i.text,Vo(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 Hi,j as m,r as I,u as ke,C as j,B as wi,s as $,a as K,T as se,b as Kf,d as Bt,e as Na,f as B,g as Gf,S as Qf,h as Jf,i as Yf,k as _f,F as je,I as Xf,l as Bo,m as Mi,n as Fa,P as Wa,o as Zf,A as On,p as zi,q as eu,t as Va,v as tu,w as iu,x as er,y as gn,z as tr,D as nu,E as su,G as ru,H as ou,J as lu,K as au,L as Ha,M as hu,N as ir,O as Lo,Q as cu,R as fu,U as uu,V as du,W as Cs,X as pu,Y as mu,Z as gu,_ as yu,$ as _r,a0 as bu,a1 as xu,a2 as za,a3 as wu,a4 as Dn,a5 as vu,a6 as ku,a7 as Su,a8 as Cu,a9 as $a,aa as Eo,ab as Io,ac as vi,ad as nr,ae as Au,af as sr,ag as Mu,ah as qa,ai as Ou,aj as Du,ak as Tu,al as Pu,am as Ru}from"./index-99d4171f.js";import{S as Bu}from"./StrategyItemContainer-72e360fd.js";import{E as Lu}from"./Error-38b8cdc0.js";const ls=Hi(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"),Eu=Hi(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"),Iu=Hi(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"),Nu=Hi(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"),Fu=Hi(m("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"WarningOutlined"),Wu=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"})),Vu=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"})),Tn=({enabled:n,label:e,showIcon:t=!0})=>{const i=ke(),s=m(j,{condition:n==="unknown"||n==="unevaluated",show:m(Fu,{color:"warning",fontSize:"inherit"}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(Wu,{color:i.palette.success.main,strokeWidth:"0.25"}),elseShow:m(Vu,{color:i.palette.error.main,strokeWidth:"0.25"})})});return m(j,{condition:n==="unknown"||n==="unevaluated",show:m(wi,{icon:t?s:void 0,color:"warning",children:e}),elseShow:m(j,{condition:typeof n=="boolean"&&Boolean(n),show:m(wi,{color:"success",icon:t?s:void 0,children:e}),elseShow:m(wi,{color:"error",icon:t?s:void 0,children:e})})})},Hu=$(K)(({theme:n})=>({display:"flex",alignItems:"center",padding:n.spacing(1,2)})),zu=$(K)(()=>({marginRight:"auto"})),$u=({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(Hu,{children:m(zu,{"data-loading":!0,children:m(Tn,{enabled:e,label:t,showIcon:e!=="unknown"})})})},qu=$("div")(({theme:n})=>({padding:n.spacing(4),maxWidth:"400px"})),As=$(se)(({theme:n})=>({marginBottom:n.spacing(2)})),ju=$(Iu)(({theme:n})=>({color:n.palette.success.main})),Uu=({variants:n,selectedVariant:e})=>{const t=ke(),i=I.useMemo(()=>n.map(c=>({name:c.name,weight:`${Kf(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:Ku,data:i,sortTypes:Na,autoResetGlobalFilter:!1,autoResetSortBy:!1,disableSortRemove:!0},Bt.useGlobalFilter,Bt.useSortBy);return B(qu,{children:[m(As,{variant:"subtitle2",children:"Variant Information"}),m(As,{variant:"body2",children:"The following table shows the variants defined on this feature toggle and the variant result based on your context configuration."}),m(As,{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(Gf,{...r(),rowHeight:"dense",children:[m(Qf,{headerGroups:l}),m(Jf,{...o(),children:a.map(c=>{let f={};return c.original.selected||(f.color=t.palette.text.secondary),h(c),m(Yf,{hover:!0,...c.getRowProps(),children:c.cells.map(u=>m(_f,{...u.getCellProps(),style:f,children:u.render("Cell")}))})})})]})]})},Ku=[{id:"Icon",Cell:({row:{original:{selected:n}}})=>m(je,{children:m(j,{condition:n,show:m(Xf,{icon:m(ju,{})})})}),maxWidth:25,disableGlobalFilter:!0},{Header:"Name",accessor:"name",searchable:!0,Cell:({row:{original:{name:n}}})=>m(Bo,{children:n}),maxWidth:175,width:175},{Header:"Weight",accessor:"weight",sortType:"alphanumeric",searchable:!0,maxWidth:75,Cell:({row:{original:{weight:n}}})=>m(Bo,{children:n})}],Gu=$("div")(()=>({maxWidth:"100%",display:"flex",alignItems:"center",wordBreak:"break-all"})),Qu=({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(Gu,{children:[n,m(j,{condition:Boolean(e)&&e.length>0&&i,show:B(je,{children:[m(Mi,{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(Uu,{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 No=n=>{var e,t;return(t=(e=n.strategies)==null?void 0:e.data)==null?void 0:t.find(i=>!ja.includes(i.name))},Ju=n=>{var e,t;return!((t=(e=n.strategies)==null?void 0:e.data)!=null&&t.find(i=>ja.includes(i.name)))},Yu=$("div")({display:"flex",justifyContent:"space-between",width:"100%"}),_u=$("div")(({theme:n})=>({display:"inline-flex",alignItems:"center",gap:n.spacing(1.5),marginTop:n.spacing(1.5)})),Fo=$("div")(({theme:n})=>({margin:n.spacing(1,0)})),Xu=$("div")(({theme:n})=>({margin:n.spacing(1,.5)})),Zu=$(se)(({theme:n})=>({fontWeight:600,padding:n.spacing(.5)})),ed=$(Mi)({textAlign:"right"}),td=({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?Ju(n)?[`This feature toggle is Unknown in ${e==null?void 0:e.environment} because `,"no strategies could be fully evaluated",i.palette.warning.main]:No(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=No(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(je,{children:[B(Yu,{children:[B(_u,{children:[m(Zu,{variant:"subtitle1",children:n.name}),m(j,{condition:((c=n==null?void 0:n.strategies)==null?void 0:c.result)!=="unknown",show:()=>m(Tn,{enabled:n.isEnabled,label:n.isEnabled?"True":"False"}),elseShow:()=>m(Tn,{enabled:"unknown",label:"Unknown",showIcon:!1})})]}),m(ed,{onClick:h,children:m(Zf,{})})]}),B(Xu,{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(Fo,{children:m(On,{color:"info",children:l})})}),m(j,{condition:Boolean(a),show:m(Fo,{children:m(On,{severity:"warning",color:"info",children:a})})})]})},id=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.error.main})),nd=({constraint:n,input:e})=>B(id,{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}`})()})]}),sd=$(Eu)(({theme:n})=>({color:n.palette.success.main})),rd=$("div")(({theme:n})=>({display:"flex",alignItems:"center",marginTop:n.spacing(1),color:n.palette.success.main})),od=()=>B(rd,{children:[m(sd,{style:{marginRight:"0.25rem"}}),m(se,{variant:"body2",children:"Constraint met by value in context"})]}),ld=$("div")(()=>({width:"100%",display:"flex",flexDirection:"column"})),Ka=({constraints:n,input:e})=>n?m(ld,{children:n==null?void 0:n.map((t,i)=>B(I.Fragment,{children:[m(j,{condition:i>0,show:m(zi,{text:"AND"})}),m(eu,{constraint:t,compact:!0,renderAfter:m(j,{condition:t.result,show:m(od,{}),elseShow:m(nd,{input:e,constraint:t})})})]},Va(t)))}):null,ad=$("div")(({theme:n})=>({color:n.palette.error.main,display:"inline-flex",justifyContent:"center",marginLeft:"auto",gap:n.spacing(1)})),hd=({segments:n,input:e})=>n?m(je,{children:n.map((t,i)=>B(I.Fragment,{children:[m(tu,{segment:t,constraintList:m(Ka,{constraints:t.constraints,input:e}),headerContent:m(j,{condition:!Boolean(t.result),show:B(ad,{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(zi,{text:"AND"})})]},t.id))}):null,cd=$("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.divider}`,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.spacing(2),opacity:e?.9:1,backgroundColor:e?n.palette.background.paper:"inherit"})),fd=$("div")(({theme:n})=>({flexDirection:"column"})),ud=$(iu)(({theme:n})=>({margin:n.spacing(.5)})),dd=$("p")(({theme:n})=>({display:"inline",margin:n.spacing(.5,0),maxWidth:"95%",textAlign:"center",wordBreak:"break-word"})),Ms=({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(cd,{showReason:i,children:[m(se,{variant:"subtitle1",color:s.palette[r].main,children:`${t}`}),B(fd,{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(dd,{children:[n.length," ",n.length>1?`${e}s`:e," will get access."]}),n.map(l=>m(ud,{label:m(er,{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.divider}`})),ct=n=>{switch(n.toUpperCase()){case"USERIDS":return"userId";case"IPS":return"remoteAddress";default:return n}},pd=({parameters:n,constraints:e,input:t})=>m(je,{children:Object.keys(n).map(i=>{var s,r,o,l,a,h,c,f;switch(i){case"rollout":case"Rollout":const u=tr(n[i]);return B(Ga,{sx:{display:"flex",alignItems:"center"},children:[m(K,{sx:{mr:"1rem"},children:m(nu,{percentage:u,size:"2rem"})}),B("div",{children:[B(wi,{color:"success",children:[u,"%"]})," ","of your base"," ",e.length>0?"who match constraints":""," ","is included."]})]},i);case"userIds":case"UserIds":const d=gn(n[i]);return m(Ms,{value:d,text:"user",input:Boolean((s=t==null?void 0:t.context)==null?void 0:s[ct(i)])?(r=t==null?void 0:t.context)==null?void 0:r[ct(i)]:"no value",showReason:Boolean((o=t==null?void 0:t.context)==null?void 0:o[ct(i)])?!d.includes((l=t==null?void 0:t.context)==null?void 0:l[ct(i)]):void 0},i);case"hostNames":case"HostNames":const p=gn(n[i]);return m(Ms,{value:p,text:"host",input:"no value",showReason:void 0},i);case"IPs":const y=gn(n[i]);return m(Ms,{value:y,text:"IP",input:Boolean((a=t==null?void 0:t.context)==null?void 0:a[ct(i)])?(h=t==null?void 0:t.context)==null?void 0:h[ct(i)]:"no value",showReason:Boolean((c=t==null?void 0:t.context)==null?void 0:c[ct(i)])?!y.includes((f=t==null?void 0:t.context)==null?void 0:f[ct(i)]):void 0},i);case"stickiness":case"groupId":return null;default:return null}})}),md=$(K)(({theme:n})=>({width:"100%",padding:n.spacing(2,3),borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.divider}`,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(md,{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(je,{children:[m(se,{component:"span",color:i.palette.error.main,children:" required parameter "}),m(er,{maxWidth:"300",text:n,maxLength:50}),m(se,{component:"span",color:i.palette.error.main,children:" is not set "})]}),elseShow:B(je,{children:[m(se,{component:"span",color:"text.disabled",children:" set on parameter "}),m(er,{maxWidth:"300",text:n,maxLength:50})]})})})}),m(j,{condition:Boolean(r),show:m(ls,{color:"error"}),elseShow:m("div",{})})]})},gd=({strategyName:n,parameters:e})=>{const{strategies:t}=su(),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=gn(o);return m(ci,{isRequired:l,text:r.name,input:(a==null?void 0:a.length)>0?a.join(", "):null});case"percentage":const h=tr(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=ru(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=tr(o);return m(ci,{text:r.name,isRequired:l,input:d?`${p}`:void 0});case"default":return null}return null});return m(je,{children:s.map((r,o)=>B(I.Fragment,{children:[m(j,{condition:o>0,show:m(zi,{text:"AND"})}),r]},o))})},yd=$("div")(({theme:n})=>({padding:n.spacing(0)})),bd=({strategyResult:n,input:e})=>{const{name:t,constraints:i,segments:s,parameters:r}=n,{uiConfig:o}=ou(),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(lu).includes(t),c=Object.keys(r).length>0&&n.result.evaluationStatus==="incomplete";if(!r)return null;const f=[l&&m(hd,{segments:s,input:e}),a&&m(Ka,{constraints:i,input:e}),h&&m(pd,{parameters:r,constraints:i,input:e}),c&&m(gd,{strategyName:t,parameters:r}),t==="default"&&B(Ga,{sx:{width:"100%"},children:["The standard strategy is ",m(wi,{color:"success",children:"ON"})," for all users."]})].filter(Boolean);return m(yd,{children:f.map((u,d)=>B(I.Fragment,{children:[m(j,{condition:d>0,show:m(zi,{text:"AND"})}),u]},d))})},xd=({strategy:n,input:e,index:t})=>{const{result:i}=n,s=ke(),r=i.evaluationStatus==="incomplete"?"Unevaluated":i.enabled?"True":"False";return m(Bu,{style:{borderColor:i.enabled?s.palette.success.main:"none"},strategy:{...n,id:`${Va(n)}`},orderNumber:t+1,actions:m(Tn,{showIcon:!1,enabled:i.enabled,label:r}),children:m(bd,{strategyResult:n,input:e,percentageFill:s.palette.background.elevation2})})},wd=$("div")(({theme:n})=>({display:"flex",padding:"0, 4px",flexDirection:"column",borderRadius:n.shape.borderRadiusMedium,border:`1px solid ${n.palette.warning.border}`})),vd=$("div")(({theme:n})=>({padding:n.spacing(1,.5)})),kd=$(On)(({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(je,{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(zi,{text:"OR"})}),m(xd,{strategy:t,index:i,input:e},t.id)]},t.id))})]})}),Sd=({strategies:n,input:e})=>B(wd,{sx:{pb:1,mt:2},children:[B(kd,{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(vd,{sx:{p:2.5},children:m(Qa,{strategies:(n==null?void 0:n.data)||[],input:e})})]}),Cd=({feature:n,input:e})=>{var t,i,s,r;return B(je,{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(On,{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(Sd,{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})})]})},Ad=$("div")(({theme:n})=>({alignItems:"flex-end",color:n.palette.divider})),Md=({feature:n,input:e})=>{const[t,i]=I.useState(!1),s=I.useRef(null),r=()=>{i(!t)};return n?B(Ad,{children:[m(Mi,{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.background.elevation2,borderRadius:o.shape.borderRadius})},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:[m(td,{feature:n,input:e,onClose:()=>i(!1)}),m(Cd,{feature:n,input:e})]})]}):null},Od={id:"name"},{value:Wo,setValue:Dd}=au("PlaygroundResultsTable:v1",Od),Td=({features:n,input:e,loading:t})=>{const[i,s]=Ha(),r=hu(t),[o,l]=I.useState(i.get("search")||""),a=ke(),h=ir(a.breakpoints.down("sm")),c=ir(a.breakpoints.down("md")),f=I.useMemo(()=>[{Header:"Name",accessor:"name",searchable:!0,minWidth:160,Cell:({value:v,row:{original:O}})=>m(Lo,{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(Lo,{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(Qu,{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($u,{feature:v.original}),sortType:"playgroundResultState",maxWidth:120,sortInverted:!0},{Header:"",maxWidth:70,id:"info",Cell:({row:v})=>m(Md,{feature:v.original,input:e})}],[e]),{data:u,getSearchText:d,getSearchContext:p}=cu(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")||Wo.id,desc:i.has("order")?i.get("order")==="desc":Wo.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:fu}},Bt.useGlobalFilter,Bt.useFlexLayout,Bt.useSortBy);return uu([{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}),Dd({id:M[0].id,desc:M[0].desc||!1})},[t,M,o]),B(je,{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(du,{initialValue:o,onChange:l,hasFilters:!0,getSearchContext:p,disabled:t,containerStyles:{marginLeft:"1rem",maxWidth:"400px"}})]}),m(j,{condition:!t&&!y,show:()=>m(Cs,{children:y===void 0?"None of the feature toggles were evaluated yet.":"No results found."}),elseShow:()=>B(K,{ref:r,children:[m(pu,{value:d(o),children:m(mu,{rows:k,headerGroups:x,prepareRow:C})}),m(j,{condition:y.length===0&&(o==null?void 0:o.length)>0,show:B(Cs,{children:["No feature toggles found matching “",o,"”"]})}),m(j,{condition:y&&y.length===0&&!o,show:m(Cs,{children:"No features toggles to display"})})]})})]})},Pd=()=>{const{makeRequest:n,createRequest:e,errors:t,loading:i}=gu({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}},Rd=$("div")(({style:n,theme:e})=>({width:"25px",height:"25px",borderRadius:"50%",color:e.palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",...n})),as=({style:n,children:e,type:t})=>{const i=ke(),s={backgroundColor:i.palette.background.alternative,color:i.palette.common.white};return t==="secondary"&&(s.backgroundColor=i.palette.background.paper,s.color=i.palette.text.secondary),m(Rd,{style:{...s,...n},children:e})},Bd=n=>!n||n.length===0||n.length===1&&n[0]==="*"?"*":Array.isArray(n)?n:[n],Ld=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),Ed=(n,e)=>n?"100%":e&&!n?"65%":"50%";function rr(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}rr.debounce=rr;var Id=rr;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 ki(this),r=new ki(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 ki(this,e)}iterRange(e,t=this.length){return new Ya(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 _a(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=Nd(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 Fd(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new re(Vo(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=yn(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=yn(this.text,yn(i.text,Vo(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 Nd(n){let e=-1;for(let t of n)e+=t.length+1;return e}function yn(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 Vo(n,e,t){return yn(n,[""],e,t)}class ki{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 Ya{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ki(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 _a{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()},ki.prototype[Symbol.iterator]=Ya.prototype[Symbol.iterator]=_a.prototype[Symbol.iterator]=function(){return this});class Fd{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 Wd(n){for(let e=1;e<Qt.length;e+=2)if(Qt[e]>n)return Qt[e-1]<=n;return!1}function Ho(n){return n>=127462&&n<=127487}const zo=8205;function Ae(n,e,t=!0,i=!0){return(t?Xa:Vd)(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==zo||s==zo||t&&Wd(s))e+=Le(s),i=s;else if(Ho(s)){let r=0,o=e-2;for(;o>=0&&Ho(me(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Vd(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 Xr(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 or=/\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 et{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){lr(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 et(e)}composeDesc(e){return this.empty?e:e.empty?this:th(this,e)}mapDesc(e,t=!1){return e.empty?this:ar(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 et(e)}static create(e){return new et(e)}}class ce extends et{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 lr(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return ar(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:ar(this,e,t,!0)}iterChanges(e,t=!1){lr(this,e,t)}get desc(){return et.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new Oi(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&&mt(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:et.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||or)):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),mt(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 mt(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 lr(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 ar(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Oi(n),l=new Oi(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&&mt(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&&mt(r,s,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?ce.createSet(s,r):et.create(s);throw new Error("Mismatched change set lengths")}}function th(n,e,t=!1){let i=[],s=t?[]:null,r=new Oi(n),o=new Oi(e);for(let l=!1;;){if(r.done&&o.done)return s?ce.createSet(i,s):et.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&&mt(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&&mt(s,i,o.text)}else o.ins==-1?(xe(i,r.off?0:r.len,a,l),s&&mt(s,i,r.textBit(a))):(xe(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&mt(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 Oi{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 Zr=0;class R{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Zr++,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:eo),!!e.static,e.enables)}of(e){return new bn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new bn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new bn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function eo(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class bn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Zr++}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)||hr(f,c)){let d=i(f);if(l?!$o(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=Rn(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?$o(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 $o(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 hr(n,e){let t=!1;for(let i of e)Si(n,i)&1&&(t=!0);return t}function Hd(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=Rn(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)Si(a,h);return a.values[o]=l(a),1},update(a,h){if(!hr(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=hr(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&eo(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 qo=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(Zr++,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(qo).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,qo.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 cr(this,e)}reconfigure(e){return hs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class cr{constructor(e,t){this.compartment=e,this.inner=t}}class Pn{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 zd(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,eo(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=>Hd(b,p,d))}}let f=h.map(u=>u(l));return new Pn(e,o,f,l,a,r)}}function zd(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 cr&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof cr){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 bn)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 Si(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 Rn(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 at{constructor(e,t){this.type=e,this.value=t}static define(){return new $d}}class $d{of(e){return new at(this,e)}}class qd{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 qd(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=at.define();fe.userEvent=at.define();fe.addToHistory=at.define();fe.remote=at.define();function jd(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 fr(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=fr(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,fr(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 Kd(t?Ud(s):s)}function Ud(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:jd(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 Kd(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,fr(e,r,n.changes.newLength),!0))}return i==n?n:fe.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const Gd=[];function Jt(n){return n==null?Gd: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 Qd=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ur;try{ur=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Jd(n){if(ur)return ur.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Qd.test(t)))return!0}return!1}function Yd(n){return e=>{if(!/\S/.test(e))return Z.Space;if(Jd(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++)Si(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 Si(this,i),Rn(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=Pn.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)||or))}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:(Si(this,t),Rn(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=Pn.resolve(e.extensions||[],new Map),i=e.doc instanceof q?e.doc:q.of((e.doc||"").split(t.staticFacet(V.lineSeparator)||or)),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 n,m as x,a as e,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 n,m as x,a as e,an as y,f as r,j as o,C as d,ao as b,x as f,ap as m}from"./index-99d4171f.js";const I=n(x)(({theme:a})=>({padding:0,cursor:"inherit",transition:"color 0.2s ease-in-out"})),h=n("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"}})),S=n(e)(({theme:a})=>({borderRadius:a.shape.borderRadiusMedium,border:`1px solid ${a.palette.divider}`,"& + &":{marginTop:a.spacing(2)},background:a.palette.background.paper})),v=n("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(e,{sx:{position:"relative"},children:[o(d,{condition:s!==void 0,show:o(h,{children:s})}),r(S,{style:g,children:[r(v,{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.action.disabled}}),o(f,{maxWidth:"150",maxLength:15,text:m(a.name)}),o(e,{sx:{marginLeft:"auto",display:"flex",minHeight:t=>t.spacing(6),alignItems:"center"},children:c})]}),o(e,{sx:{p:2,justifyItems:"center"},children:p})]})]})};export{j as S};
|