import{j as e}from"./jsx-runtime-C_974cfT.js";import{R as u,T as p,V as m,I as h,P as x,C as f,S as j,a as g,G as y,L as b,b as w,c as N,d as S,e as v}from"./index-DMcb79-w.js";import{I as l,a as i}from"./misc-BOyXKFuR.js";import{c}from"./chunk-UIGDSWPH-fNK8sKgt.js";import{s as P}from"./progress-bar-OaAGU-bF.js";import{S as I}from"./tooltip-Dl4Bqfpf.js";import{u as T}from"./pe-D3b-z7vI.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"3ea6c863933c57219be78eb06addfb47859d8df2"}}catch{}})();function C({appName:s,reset:a=!1,tooltipText:n,...t}){const r=c(),d=T(),o=e.jsx("button",{type:"submit",...t,className:i(t.className,r.state!=="idle"?"cursor-progress":null,r.data?.status==="error"?"cursor-not-allowed":null)});return e.jsxs(r.Form,{action:"/set-playground",method:"POST",className:"inline-flex items-center justify-center",children:[d,e.jsx("input",{type:"hidden",name:"appName",value:s}),a?e.jsx("input",{type:"hidden",name:"reset",value:"true"}):null,P,n?e.jsx(I,{content:n,children:o}):o]})}function A({playgroundAppName:s,allApps:a}){const n=c();return e.jsxs(u,{name:"appName",value:s,onValueChange:t=>{n.submit({appName:t},{method:"POST",action:"/set-playground"})},children:[e.jsxs(p,{"aria-label":"Select app for playground",className:i("radix-placeholder:text-gray-500 flex h-full w-full items-center justify-between text-left focus-visible:outline-none",n.state!=="idle"?"cursor-progress":null,n.data?.status==="error"?"cursor-not-allowed":null),children:[e.jsx("span",{className:"scrollbar-thin scrollbar-thumb-scrollbar w-80 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:e.jsx(m,{placeholder:"Select current app",className:"inline-block w-40 text-ellipsis"})}),e.jsx(h,{children:e.jsx(l,{name:"TriangleDownSmall"})})]}),e.jsx(x,{children:e.jsxs(f,{position:"popper",align:"start",className:"z-20 max-h-[50vh] bg-black text-white lg:max-h-[70vh]",children:[e.jsx(j,{className:"flex h-5 cursor-default items-center justify-center",children:e.jsx(l,{name:"ChevronUp"})}),e.jsx(g,{className:"p-3",children:e.jsxs(y,{children:[e.jsx(b,{className:"px-5 pb-3 font-mono uppercase",children:"App"}),a.filter(t=>t.name!=="playground").map(t=>e.jsx(E,{value:t.name,children:t.displayName},t.name))]})}),e.jsx(w,{className:"flex h-5 cursor-default items-center justify-center",children:e.jsx(l,{name:"ChevronDown"})})]})})]})}function E({value:s,children:a}){return e.jsxs(N,{value:s,className:"radix-disabled:text-red-500 radix-highlighted:opacity-100 radix-highlighted:outline-none radix-state-checked:opacity-100 relative flex cursor-pointer items-center rounded px-10 py-2 leading-none opacity-80 select-none",children:[e.jsx(S,{children:a}),e.jsx(v,{className:"absolute left-0 inline-flex w-[25px] items-center justify-center",children:e.jsx(l,{name:"CheckSmall"})})]})}function F({appName:s,isOutdated:a,hideTextOnNarrow:n}){return ENV.EPICSHOP_DEPLOYED?null:e.jsx(C,{appName:s,tooltipText:a?"The app the playground was set to has been updated. Click to update to the latest version.":"Playground is not set to the right app. Click to set Playground.",children:e.jsxs("span",{className:"text-foreground-destructive flex items-center justify-center gap-1 hover:underline",children:[e.jsx(l,{name:"Unlinked",className:"animate-ping"})," ",e.jsx("span",{className:n?"hidden @min-[600px]:inline uppercase":"uppercase",children:a?"Playground Outdated":"Set to Playground"})]})})}export{A as P,F as S,C as a};
//# sourceMappingURL=set-playground-BL9zN3oj.js.map
