PageSourceSearch

https://dashboard.mux.com/assets/index.route-BbBoG-gz.js

js mux.com collected 2026-09-24 08:00:54 UTC 10,900 bytes, 2 lines download raw bytes

1import{j as e,a as w,r as x,s as N,b as Z,cV as ee,dd as te,L as P,R as T,t as ne,F as se}from"./react-DwuEVfNv.js";import{bn as q,bx as V,bo as re,bp as oe,bq as ae,br as ie,bs as de,bt as le,bu as ce,c as p,a3 as I,at as ue,Y as H,r as B,s as O,bv as me,dE as he,dF as ge,cL as xe,t as pe,dG as je,dH as be,z as fe,K as ye,j as C,P as R,N as ve,dI as Ce,g as we,dJ as Se,ba as _,bc as K,bd as Y,be as Q,bZ as De,k as A,b_ as Ee,bf as W,bg as G,aa as $,bQ as Ie,bR as z,bS as $e,bT as Ue,bU as L,cT as ke,bW as Te,bX as ze,bb as Le,a8 as Ae,_ as Re,aw as Me,a0 as Fe,a2 as Ne,an as Pe,dK as qe,dL as Ve,bh as He,bi as Be,bj as Oe,bk as _e,bA as Ke,bl as Ye,U as Qe,dM as We,bB as Ge,b5 as Je,b7 as Xe,bC as Ze,bm as et,q as M,o as tt}from"./index-DQzPtNsy.js";import{D as nt}from"./DeleteConfirmDialog-BgG7Wekk.js";import{u as st}from"./useMergeImpersonatedEnvs-BGTnMDoo.js";import{C as rt,a as ot,b as at,c as it}from"./CardGrid-I9t6Vera.js";import{u as dt}from"./useUniqueId-CAPtmc-w.js";import{E as lt}from"./EnvironmentForm-ChE0fjvf.js";import"./d3-q0zOtUjj.js";const ct=w(me)(["border-radius:",";padding:",";& svg{transition:transform 0.2s ease-in-out;}&:hover,&:focus-visible{background-color:",";& svg{transform:scale(1.05);}}"],B[2],O[1],p.background.highlight);function ut({onCopy:t,onEdit:n,onDelete:s,onShowUsers:r,can:o}){const d=[{icon:e.jsx(q,{height:"1.2em"}),text:"Copy env key",action:t,allowed:!0},{icon:e.jsx(V,{height:"1.2em"}),text:"Show users",action:r,allowed:o.showUsers},{icon:e.jsx(re,{height:"1.2em"}),text:"Edit",action:n,allowed:o.edit},{icon:e.jsx(oe,{height:"1.2em"}),text:"Delete",action:s,allowed:o.delete,destructive:!0}];return e.jsxs(ae,{children:[e.jsx(ct,{children:e.jsx(ie,{size:20})}),e.jsx(de,{children:e.jsx(le,{side:"bottom",align:"start",onClick:a=>a.stopPropagation(),children:d.map((a,u)=>{const i=a.allowed===!0,c=e.jsx(ce,{onClick:i?a.action:void 0,disabled:!i,style:{color:a.destructive?p.red60:void 0},children:e.jsxs(I,{gap:1,yAlign:"center",children:[i?a.icon:e.jsx(ue,{height:"1.2em"}),a.text]})},u);return i?c:e.jsx(H,{side:"right",content:a.allowed,isAdmin:!1,children:c},u)})})})]})}const J=60,mt=5*J;function ht(t){return x.useMemo(()=>{const n=Math.round(t.reduce((s,r)=>s+r,0));if(n<1)return"0 mins";if(n>=mt){const s=Math.round(n/J);return`${s} hr${s>1?"s":""}`}return`${n} min${n>1?"s":""}`},[t])}function gt(t){return x.useMemo(()=>{const n=t.reduce((r,o)=>r+o,0);return new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short",maximumFractionDigits:n<10?1:0}).format(n)},[t])}function X(t,n){return x.useMemo(()=>{if(t.length<n){const s=new Array(n).fill(0);for(let r=0;r<n;r++)t[r]=t[r]??s[r];return s}return t},[t,n])}const xt={environmentDataUsage:(t,n,s)=>["environment","usage","data",t,n,s]};function pt(t,n){const s=!!t&&(t.dataIntegrated||t.status==="integrated"),{data:r=[],isLoading:o,error:d}=N({queryKey:xt.environmentDataUsage(t?.organizationId,t?.id,n),enabled:s,queryFn:async()=>t?(await he("viewer_experience_score",{environment:t.id,organization:t.organizationId,params:{timeframe:[`${n}:days`]}})).data.map(i=>i[2]||0):[]});return{data:X(r,n),isLoading:o,isIntegrated:s,error:d}}const jt={environmentVideoUsage:(t,n,s)=>["environment","usage","video",t,n,s]};function bt(t,n){const s=!!t&&!!t.videoIntegrated,{data:r=[],isLoading:o,error:d}=N({queryKey:jt.environmentVideoUsage(t?.organizationId,t?.id,n),enabled:s,queryFn:async()=>t?(await ge({environment:t.id,organization:t.organizationId,params:{granularity:"day",timeframe:[`${n}:days`]}})).data.slice(1).map(i=>i/60):[]});return{data:X(r,n),isLoading:o,isIntegrated:s,error:d}}function ft(t){switch(t){case"qa":return"QA";default:return xe(t)}}const yt=w.div(["font-size:10px;padding:2px 6px;border:1px solid ",";background-color:",";border-radius:9999px;",""],p.border.default,pe(p,{light:"white",dark:"gray90"}),({$loading:t})=>t&&Z(["min-width:11ch;padding:0;height:16px;"])),vt=w(at)(["height:104.4px;"]),F=w.button(["display:flex;align-items:center;padding-block:2px;padding-inline:6px;gap:",";margin:0;border:0;border-radius:",";font-size:",";background-color:transparent;color:",";&:hover{color:",";background-color:",";}&[data-copied='true']{color:",";background-color:",";}&:active{transform:scale(0.98);}"],O[1],B[2],we[1],p.text.deemphasized,p.text.default,p.background.highlight,p.white,p.green50);function Ct({env:t,usageDays:n,isAdmin:s,onCopyKey:r,...o}
1){const d=t?.organizationId,a=pt(t,n),u=gt(a.data),i=bt(t,n),c=ht(i.data),h=x.useRef(null),l=x.useRef(0),[,j]=ee(),[g,y]=x.useState(!1),b=te(h),U=[{isLoading:!t,tooltip:"Number of users in this environment",text:t?.userCount,icon:e.jsx(V,{size:14}),error:!s},{isLoading:!t||i.isLoading,tooltip:`Video encoded in this environment in the last ${n} days`,text:c,icon:e.jsx(je,{size:14}),error:i.error},{isLoading:!t||a.isLoading,tooltip:`Data views in this environment in the last ${n} days`,text:`${u} views`,icon:e.jsx(be,{size:14}),error:a.error}],[S]=fe();return e.jsx(P,{to:d&&t?ye(d,t.id,S):"#",children:e.jsxs(vt,{children:[e.jsxs(I,{gap:1,yAlign:"center",children:[e.jsx(rt,{title:t?.name,$loading:!t,children:t?t.name:e.jsx(C,{height:"1.6em"})}),e.jsx(R,{}),e.jsx(yt,{$loading:!t,children:t?ft(t.type):e.jsx(C,{loading:!0,rounded:!0})}),t?e.jsx(ut,{...o,onCopy:()=>{j(t.key),r?.()},can:{edit:s,delete:s,showUsers:s}}):e.jsx(C,{size:"20px",rounded:!0})]}),e.jsxs(I,{gap:2,yAlign:"center",gutterY:1,children:[U.map(({isLoading:f,text:v,icon:D,error:E,tooltip:m},k)=>E?null:e.jsxs(I,{gap:1,yAlign:"center",title:m,children:[D,e.jsx(ot,{$loading:f,children:f?e.jsx(C,{height:"1.6em"}):v})]},k)),e.jsx(R,{}),t?t.key&&e.jsxs(F,{onClick:f=>{f.preventDefault(),j(t.key),y(!0),window.clearTimeout(l.current),l.current=window.setTimeout(()=>y(!1),1e3),r?.()},ref:h,"data-copied":g,children:[g?e.jsx(ve,{size:14}):b?e.jsx(q,{size:14}):e.jsx(Ce,{size:14}),g?"Copied env key":t.key.slice(0,8)]}):e.jsx(F,{disabled:!0,children:e.jsx(C,{width:"8ch",height:"1.6em"})})]})]})})}const wt=t=>{const[n,s]=T.useState(t),[r,o]=T.useState("asc"),[d,a]=T.useState();return{sortedUsers:n,sortDirection:r,activeColumn:d,handleSort:(i,c)=>{const h=i,l=c==="asc"?"desc":"asc";s(Te(n,g=>h==="admin"?g.organizationAdmin:h==="name"?`${g.firstName} ${g.lastName}`.toLowerCase():g[h].toLowerCase(),l)),o(l),a(h)}}},St=({users:t})=>{const{sortedUsers:n,handleSort:s,activeColumn:r,sortDirection:o}=wt(t);return e.jsxs(Et,{bordered:!0,children:[e.jsxs(Ie,{children:[e.jsx(z,{sortable:!0,columnName:"name",sortDirection:r==="name"?o:void 0,onSort:s,children:"Member"}),e.jsx(z,{sortable:!0,columnName:"email",sortDirection:r==="email"?o:void 0,onSort:s,children:"Email"}),e.jsx(z,{width:100,sortable:!0,columnName:"admin",sortDirection:r==="admin"?o:void 0,onSort:s,children:"Admin"})]}),e.jsx($e,{children:n.map(d=>e.jsxs(Ue,{children:[e.jsxs(L,{children:[d.firstName," ",d.lastName]}),e.jsx(L,{children:d.email}),e.jsx(L,{width:100,children:d.organizationAdmin&&e.jsx(ke,{})})]},d.id))})]})},Dt=({environment:t,open:n,onOpenChange:s})=>{const{id:r,type:o,name:d}=t,{isLoading:a,data:u}=Se(r);return e.jsx(_,{open:n,onOpenChange:s,children:e.jsxs(K,{style:{minWidth:"min(90svw, 600px)"},children:[e.jsxs(Y,{children:[e.jsx(Q,{children:"Environment users"}),e.jsxs(De,{children:["Members below have access to"," ",e.jsxs("strong",{children:['"',d," (",o,')"']})]})]}),e.jsx(A,{gutterY:4,children:a?e.jsx(Ee,{gutterY:8}):e.jsx(St,{users:u?.data.users??[]})}),e.jsx(W,{children:e.jsx(G,{asChild:!0,children:e.jsx($,{variant:"access",children:"Done"})})})]})})};var Et=w(ze)(["max-height:500px;overflow-y:auto;scrollbar-width:thin;"]);function It({children:t,env:n,open:s,onOpenChange:r,isSubmitting:o,onSubmit:d}){const a=dt("edit-env-form"),u=!!n;return e.jsxs(_,{open:s,onOpenChange:r,children:[t&&e.jsx(Le,{asChild:!0,children:t}),e.jsxs(K,{children:[e.jsx(Y,{children:e.jsxs(Q,{children:[u?"Edit":"Create"," environment"]})}),e.jsx(lt,{id:a,env:n,onSubmit:i=>d(i,n)}),e.jsxs(W,{children:[e.jsx(G,{asChild:!0,children:e.jsx($,{variant:"muted",children:"Cancel"})}),e.jsx($,{variant:"access",loading:o,form:a,type:"submit",children:"Save"})]})]})]})}const $t=Array.from({length:24},()=>null);function Ft(){const t=Ae(),n=ne(),[s,r]=x.useState(""),o=Re()??"",d=se(Me),{data:a,isLoading:u}=Fe(o),i=st(a),[c,h]=x.useState(null),[l,j]=x.useState(null),[g,y]=x.useState(null),b=Ne(),U=x.useMemo(()=>i?.filter(m=>m.name?.toLowerCase().includes(s.toLowerCase()))??[],[i,s]),S=Pe("retentionDays",7),f=S===-1?7:S,v=Math.min(f,7),D=qe({onSuccess(){t({type:"Success",id:"edit-env",title:`"${c?.name}" has been updated.`,description:"The environment details have been updated."})},meta:{errorToastContent:{id:"edit-env",title:`"${c?.name}" could not be updated.`,description:"Could not update environment. Please try again later."}},onSettled(){h(null)}},{organization:c?.organizationId,environment:c?.id}),E=Ve({onSuccess(){l&&(t({type:"Success",id:"delete-env",title:"Environment Deleted",description:`Environment ${l.name} was deleted`}),n({type:"PropertyDeleted",payload:{property:l}}))},meta:{errorToastContent:{id:"delete-env",title:`"${l?.name}" could not be deleted.`,description:"Could not delete environment. Please try again later."}},onSettled(){j(null)}},{organization:l?.organizationId,environment:l?.id});return He(`Environments | ${d.name}`),e.jsxs(Be,{children:[e.jsxs(Oe,{children:[e.jsx(_e,{children:"Environments"}),e.jsx(Ke,{children:"An environment can be used to manage your video and data projects. Each environment has its own set of API keys, settings, and resources. They are typically used to separate applications or modes (development, staging, production)."}),e.jsx(Ye,{children:e.jsx(H,{children:e.jsx($,{variant:"access",as:P,to:Qe(o,tt.environments.create),disabled:!b,children:e.jsx(We,{children:"Create environment"})})})})]}),e.jsx(Ge,{children:e.jsx(Je,{search:!0,disabled:!i||i.length===0,children:e.jsx(Xe,{"aria-label":"Search environments",placeholder:"Search environments...",icon:e.jsx(Ze,{}),onChange:m=>r(m.currentTarget.value)})})}),e.jsxs(et,{gutterY:2,children:[!u&&i.length===0?e.jsx(M,{$bold:!0,children:"No environments found."}):e.jsxs(A,{gap:3,children:[e.jsxs(M,{$color:"text.deemphasized",children:["Showing last ",v," ",v===1?"day":"days"," of usage."]}),e.jsx(A,{gap:6,children:e.jsx(it,{children:(i.length>0?U:$t).map((m,k)=>e.jsx(Ct,{env:m,isAdmin:b,usageDays:v,onEdit:()=>h(m),onDelete:()=>j(m),onShowUsers:()=>y(m)},k))})})]}),c&&b&&e.jsx(It,{env:c,open:!0,onOpenChange:()=>h(null),isSubmitting:D.isLoading,onSubmit:m=>D.mutate({id:c.id,changes:m})}),l&&b&&e.jsx(nt,{resource:"environment",name:l.name,showPermanentWarning:!1,open:!0,onOpenChange:()=>j(null),isSubmitting:E.isLoading,onConfirm:()=>E.mutate(l.id)}),g&&b&&e.jsx(Dt,{environment:g,open:!0,onOpenChange:()=>y(null)})]})]})}export{Ft as default};
2//# sourceMappingURL=index.route-BbBoG-gz.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.