@hot-updater/console 1.2.0-rc.24 → 1.2.0-rc.26
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/.output/nitro.json +1 -1
- package/.output/public/assets/{EventDetails-Dcpdu7re.js → EventDetails-DZsRlDHk.js} +1 -1
- package/.output/public/assets/{InsightsPageHeader-CSas9gM0.js → InsightsPageHeader-2bTrjXln.js} +1 -1
- package/.output/public/assets/{RelativeTime-CiZ7yXNJ.js → RelativeTime-TCmpOVPg.js} +1 -1
- package/.output/public/assets/{RolloutPercentageBadge-D-tZKnX7.js → RolloutPercentageBadge-G6qt8rVb.js} +1 -1
- package/.output/public/assets/StoreSubmission-CqSg880n.js +1 -0
- package/.output/public/assets/{TargetDisplay-CoYY8Fs4.js → TargetDisplay-DwOaMOiI.js} +1 -1
- package/.output/public/assets/{api-keys-3IL4dIHe.js → api-keys-uFY8FsN9.js} +1 -1
- package/.output/public/assets/{badge-laIuYW1U.js → badge-D0NFvUY5.js} +1 -1
- package/.output/public/assets/{index-BKB82n6Y.js → index-CJclLsbG.js} +3 -3
- package/.output/public/assets/{insights-_6iMn8GR.js → insights-B75txQ_F.js} +1 -1
- package/.output/public/assets/{insights-DDRfERph.js → insights-C17Z0whn.js} +2 -2
- package/.output/public/assets/{insights_.distribution-BGAqgPi0.js → insights_.distribution-_dZi1_ay.js} +1 -1
- package/.output/public/assets/{insights_.distribution-CjYkDRA4.js → insights_.distribution-gDqNqI5E.js} +2 -2
- package/.output/public/assets/{installations-CSZfo1rG.js → installations-D0g3xvw8.js} +2 -2
- package/.output/public/assets/{installations-CwQYwQ6K.js → installations-Y_7QW_p8.js} +1 -1
- package/.output/public/assets/{native-builds-B4pD_O7E.js → native-builds-Ba6cEZfm.js} +2 -2
- package/.output/public/assets/native-builds-C3_-21we.js +1 -0
- package/.output/public/assets/native-builds_._buildId-BnP31v32.js +1 -0
- package/.output/public/assets/{native-builds_._buildId-D5tnmyu7.js → native-builds_._buildId-Cp9LJiMP.js} +2 -2
- package/.output/public/assets/{remote-config-Dwdc-sij.js → remote-config-BRdy8QFR.js} +1 -1
- package/.output/public/assets/{remote-config-ZJ_IRSKE.js → remote-config-C9p5Pcdj.js} +3 -3
- package/.output/public/assets/{routes-BUWLcUqW.js → routes-BLTF7nwe.js} +1 -1
- package/.output/public/assets/{routes-Rtz-KcQO.js → routes-gQXSzO_n.js} +2 -2
- package/.output/public/assets/styles-BdlrKlVs.css +2 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-CcDHdMzp.mjs → __23tanstack-start-server-fn-resolver-z8rr63xV.mjs} +49 -49
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/_.mjs +1 -1
- package/.output/server/_ssr/{-native-builds-search-Cl8EZ0Ud.mjs → -native-builds-search-M6t7EIt4.mjs} +1 -1
- package/.output/server/_ssr/{BundleIdDisplay-BOFw0I4S.mjs → BundleIdDisplay-DRnAzJse.mjs} +2 -2
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-CLb3FQ37.mjs → ConsoleFeatureUnavailable-BEU7r4aH.mjs} +6 -6
- package/.output/server/_ssr/{EventDetails-DCcm4h8I.mjs → EventDetails-CjT6o2sJ.mjs} +6 -6
- package/.output/server/_ssr/{HashValueDisplay-Bo7HtMVb.mjs → HashValueDisplay-Bkim8r3-.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-D0CFqoqK.mjs → InsightsPageHeader-Ctw4N3SZ.mjs} +6 -6
- package/.output/server/_ssr/{NotFoundPage-CrM2mNho.mjs → NotFoundPage-Bh3gFsR6.mjs} +2 -2
- package/.output/server/_ssr/{PlatformIcon-Cuhy0CIO.mjs → PlatformIcon-CMLs3Wez.mjs} +1 -1
- package/.output/server/_ssr/{RelativeTime-pdNaQt7K.mjs → RelativeTime-DjdCU0J7.mjs} +3 -3
- package/.output/server/_ssr/{RolloutPercentageBadge-D2fgomoj.mjs → RolloutPercentageBadge-BiIHw-V2.mjs} +3 -3
- package/.output/server/_ssr/{StoreSubmission-tbaU5Jxl.mjs → StoreSubmission-Cv59joPo.mjs} +29 -7
- package/.output/server/_ssr/{TargetDisplay-c4AmIqUa.mjs → TargetDisplay-D1PKOupt.mjs} +4 -4
- package/.output/server/_ssr/{alert-dialog-Bl_9bN7q.mjs → alert-dialog-BOKQTpmP.mjs} +1 -1
- package/.output/server/_ssr/{api-bPCSYWmk.mjs → api-CDvGGB1B.mjs} +4 -4
- package/.output/server/_ssr/{api-keys-DCdpQxvq.mjs → api-keys-DvbSgd9L.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-CWc-kMoo.mjs → api-keys-NYJ0VaDB.mjs} +9 -9
- package/.output/server/_ssr/{api-keys-rpc-r2mnoc7r.mjs → api-keys-rpc-B0MrcD15.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc--JDsqZkl.mjs → api-rpc-CIB9gcI7.mjs} +10 -10
- package/.output/server/_ssr/{auth-rpc-c6zZj3k7.mjs → auth-rpc-DsIffEXe.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-D1lLWwx9.mjs → auth.server-Dt9XHLs_.mjs} +42 -15
- package/.output/server/_ssr/{badge-Cf4fbU_q.mjs → badge-KS3YftV5.mjs} +2 -1
- package/.output/server/_ssr/{card-Bx_12-o-.mjs → card-CG5GqIoA.mjs} +1 -1
- package/.output/server/_ssr/{config.server-DBFnQIeD.mjs → config.server-CJs-9Zd_.mjs} +4 -4
- package/.output/server/_ssr/{console-access-Dah0AEYy.mjs → console-access-ClmTMpo_.mjs} +2 -2
- package/.output/server/_ssr/{console-features-CgdQJQlX.mjs → console-features-CRP-pfov.mjs} +1 -1
- package/.output/server/_ssr/{console-features-api-CP8VgLf_.mjs → console-features-api-CpMYF0Pb.mjs} +5 -5
- package/.output/server/_ssr/{console-features-rpc-BWc5qG3c.mjs → console-features-rpc-D-dr-WF8.mjs} +3 -3
- package/.output/server/_ssr/{dialog-B5-o4y_0.mjs → dialog-DvHMJkq7.mjs} +1 -1
- package/.output/server/_ssr/{empty-sGLINpS3.mjs → empty-Bx8DnyWN.mjs} +2 -2
- package/.output/server/_ssr/{field-CYSNwGK0.mjs → field-BVI4lxoz.mjs} +2 -2
- package/.output/server/_ssr/{input-group-LpWc50V4.mjs → input-group-CpJwooTk.mjs} +1 -1
- package/.output/server/_ssr/{insights-CRjccjYz.mjs → insights-B-VtObqr.mjs} +5 -5
- package/.output/server/_ssr/{insights-CjQ9FDjt.mjs → insights-DxlHHXPK.mjs} +21 -21
- package/.output/server/_ssr/{insights-api-ChTevZmg.mjs → insights-api-8PWQ7PiR.mjs} +3 -3
- package/.output/server/_ssr/{insights-C3eT73Ut.mjs → insights-b1hq1O0p.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-rpc-C2SBL0t-.mjs → insights-failures-rpc-pY2KV9HI.mjs} +7 -7
- package/.output/server/_ssr/{insights-recovery-rpc-fBmK_XwY.mjs → insights-recovery-rpc-CejmWL_y.mjs} +4 -4
- package/.output/server/_ssr/{insights-rpc-CoIPmXt3.mjs → insights-rpc-D_7d_AAJ.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-DqI-4UF6.mjs → insights-search-CoMkZvRt.mjs} +2 -2
- package/.output/server/_ssr/{insights-usage-rpc-DpI7VDWn.mjs → insights-usage-rpc-B1XSuara.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-37TTUAr6.mjs → insights-usage-rpc-CrGZDHzO.mjs} +4 -4
- package/.output/server/_ssr/{insights_.distribution-W4fpzgsj.mjs → insights_.distribution-B9sPDvG4.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-RwlJNvF6.mjs → insights_.distribution-CpqnDZNG.mjs} +15 -15
- package/.output/server/_ssr/{insights_.distribution-pdBXAM-9.mjs → insights_.distribution-EOOOOTb6.mjs} +2 -2
- package/.output/server/_ssr/{installations-DKKAVTSE.mjs → installations-BOI_y7Ma.mjs} +11 -11
- package/.output/server/_ssr/{installations-BmIh7M2B.mjs → installations-D0_0hzdi.mjs} +4 -4
- package/.output/server/_ssr/{installations-PHNRkSUb.mjs → installations-dWlOOS7Y.mjs} +2 -2
- package/.output/server/_ssr/{native-builds-CymG4aTV.mjs → native-builds-Bx_az6YZ.mjs} +3 -3
- package/.output/server/_ssr/{native-builds-q-yQUcmQ.mjs → native-builds-C721Rw23.mjs} +25 -21
- package/.output/server/_ssr/{native-builds-CWA9Y__P.mjs → native-builds-OUdRtp6m.mjs} +2 -2
- package/.output/server/_ssr/{native-builds_._buildId-CzJKPxiV.mjs → native-builds_._buildId-YItxv8j9.mjs} +3 -3
- package/.output/server/_ssr/{native-builds_._buildId-bLt4WRQ0.mjs → native-builds_._buildId-ubi48Sfs.mjs} +118 -85
- package/.output/server/_ssr/{nativeBuildDevice-Dn16gNmZ.mjs → nativeBuildDevice-DJUAzAIj.mjs} +26 -46
- package/.output/server/_ssr/{nativeBuildDownloadLink-mzzxooek.mjs → nativeBuildDownloadLink-C0I8eLpS.mjs} +2 -2
- package/.output/server/_ssr/{nativeBuildInstall-C52_rFTA.mjs → nativeBuildInstall-CxG8K8TL.mjs} +5 -6
- package/.output/server/_ssr/{nativeBuilds-D84Qo6jn.mjs → nativeBuilds-CRLmvFaO.mjs} +2 -2
- package/.output/server/_ssr/{native-artifact-H1MDP0Jz.mjs → publicConsoleBase-DvHYxDaG.mjs} +26 -17
- package/.output/server/_ssr/{release-adoption-rpc-CiQeg2XC.mjs → release-adoption-rpc-DcZAYRWJ.mjs} +7 -7
- package/.output/server/_ssr/{releaseAdoption-LLYlRnUB.mjs → releaseAdoption-D6ScSu-W.mjs} +1 -1
- package/.output/server/_ssr/{remote-config-D6_98aiF.mjs → remote-config-BZ_vGV97.mjs} +19 -19
- package/.output/server/_ssr/{remote-config-CHXk0t0Y.mjs → remote-config-DOcSXzxG.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-DFcP3X_W.mjs → remote-config-gKqDKMxk.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-rpc-CmjtaLZo.mjs → remote-config-rpc-CVPd3V69.mjs} +3 -3
- package/.output/server/_ssr/{router-DlRo8qJe.mjs → router-Bcyej4cr.mjs} +60 -75
- package/.output/server/_ssr/{routes-BemtQYlj.mjs → routes-B10xsCh4.mjs} +22 -22
- package/.output/server/_ssr/{routes-DeokFLZU.mjs → routes-ddBRVSju.mjs} +10 -10
- package/.output/server/_ssr/{runtime.server-BsTTLV-B.mjs → runtime.server-wcHT2Cop.mjs} +2 -2
- package/.output/server/_ssr/{schema-migration-rpc-8sXxCyev.mjs → schema-migration-rpc-iWZzLv70.mjs} +3 -3
- package/.output/server/_ssr/{select-C-Xg3M0y.mjs → select-i4WT0c9r.mjs} +1 -1
- package/.output/server/_ssr/{server-BMeXGwaI.mjs → server-CMgMPrDx.mjs} +4 -4
- package/.output/server/_ssr/{sidebar-C-YtAmhJ.mjs → sidebar-mIQgB0iy.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{start-C0XSSCq4.mjs → start-By4wHYjG.mjs} +1 -1
- package/.output/server/_ssr/{switch-Bq_TE-f9.mjs → switch-DR8EAh5C.mjs} +2 -2
- package/.output/server/_ssr/{table-DvW7CEdk.mjs → table-DXmK6G7A.mjs} +1 -1
- package/.output/server/_ssr/{tabs-X3A6lDz5.mjs → tabs-DAfypcYe.mjs} +2 -2
- package/.output/server/_ssr/{updateFailures-DPYzv9bE.mjs → updateFailures-DNiv3S_y.mjs} +1 -1
- package/.output/server/{_tanstack-start-manifest_v-Df6g3sSt.mjs → _tanstack-start-manifest_v-8M7ggCuB.mjs} +36 -38
- package/.output/server/index.mjs +211 -211
- package/package.json +7 -7
- package/src/components/ThemeProvider.tsx +11 -2
- package/src/components/features/native-builds/InstallCard.tsx +20 -21
- package/src/components/features/native-builds/IosInstall.tsx +77 -47
- package/src/components/features/native-builds/NativeBuildsTable.tsx +14 -9
- package/src/components/features/native-builds/SandboxBadge.tsx +8 -2
- package/src/components/features/native-builds/StoreSubmission.tsx +7 -10
- package/src/components/features/native-builds/playTracks.ts +19 -0
- package/src/components/ui/badge.tsx +2 -0
- package/src/lib/server/nativeBuildDevice.ts +22 -43
- package/src/routeTree.gen.ts +0 -44
- package/src/styles.css +8 -0
- package/.output/public/assets/StoreSubmission-CGFw9Mjw.js +0 -1
- package/.output/public/assets/native-builds-CKSg6cCF.js +0 -1
- package/.output/public/assets/native-builds_._buildId-BuVvRbMp.js +0 -1
- package/.output/public/assets/styles-83XEjOMT.css +0 -2
- package/.output/server/_ssr/nativeBuildQr-P9qKcI7l.mjs +0 -115
- package/.output/server/_ssr/publicConsoleBase-3IHSHvqd.mjs +0 -27
- package/.output/server/_ssr/qr-code-pENFuyy9.mjs +0 -22
- package/src/lib/server/nativeBuildQr.ts +0 -163
- package/src/routes/[_]hot-updater/native-builds/preview-qr.ts +0 -14
- package/src/routes/[_]hot-updater/native-builds/qr.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,$n as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,P as h,R as g,U as _,Un as v,Ur as y,Ut as b,Wn as x,Wr as S,Xn as C,Xt as w,Yn as T,Yt as E,Z as ee,Zn as D,_ as te,an as ne,b as re,bn as ie,er as ae,et as oe,g as se,h as O,ii as ce,ir as k,ln as A,lt as le,mn as ue,p as de,qt as fe,rr as pe,ti as j,tn as me,ut as M,v as he,vn as ge,w as N,xn as P,y as F,yn as _e}from"./sidebar-Di9SN47G.js";import{t as I}from"./link-DTEyW70e.js";import{t as L}from"./arrow-right-CNII8TYn.js";import{t as ve}from"./arrow-up-right-DK8Zdg40.js";import{a as ye,i as be,n as R,r as xe,s as Se,t as Ce}from"./routes-Rtz-KcQO.js";import{t as we}from"./check-CXVR3s3X.js";import{a as z,i as B,n as Te,r as Ee}from"./useCompositeListItem-JmyDfo3-.js";import{C as De,S as V,b as Oe,l as ke,r as Ae,y as je}from"./TargetDisplay-CoYY8Fs4.js";import{t as Me}from"./chevron-right-BoUXo82O.js";import{A as Ne,D as Pe,E as Fe,M as Ie,N as Le,T as Re,a as ze,d as Be,f as Ve,h as He,i as H,m as U,n as Ue,o as W,r as G,t as We}from"./select-CBIU0_M1.js";import{t as Ge}from"./circle-off-C7Muo0ss.js";import{r as Ke,t as qe}from"./HashValueDisplay-MoZMmTeP.js";import{i as Je,n as Ye,r as Xe,t as Ze}from"./RolloutPercentageBadge-D-tZKnX7.js";import{t as Qe}from"./list-B6GeoQ_b.js";import{n as $e,t as et}from"./plus-BVhOauU3.js";import{t as tt}from"./package-ytYrywZH.js";import{a as nt,i as rt,n as it,o as at,s as ot,t as st}from"./input-group-D_NfhUbX.js";import{i as ct,n as lt,t as ut}from"./switch-CP6GsHmN.js";import{a as dt,i as ft,n as pt,o as mt,t as K}from"./badge-laIuYW1U.js";import{n as q}from"./dist-Bf1BPKMs.js";import{o as ht}from"./insights-search-CYPrQVUC.js";import{a as gt,n as _t,o as vt,r as yt,t as bt}from"./card-ulgg5xHn.js";import{a as xt,c as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,u as kt}from"./uuidv7-cI6C63Fm.js";import{a as At,i as jt,l as Mt,n as Nt,o as Pt,r as Ft,s as It,t as Lt}from"./alert-dialog-DiRLrFVe.js";import{n as Rt,t as zt}from"./PlatformIcon-CJ69KopR.js";import{a as Bt,i as Vt,n as Ht,o as Ut,r as Wt,s as Gt,t as Kt}from"./dialog-CLIaC82_.js";import{a as qt,c as Jt,i as Yt,n as Xt,r as Zt,t as Qt}from"./field-q4sTYzNU.js";import{S as $t,_ as en,a as tn,b as nn,c as rn,g as an,i as on,n as sn,o as cn,r as ln,s as un,t as dn,v as fn,x as pn,y as mn}from"./api-LQJH44FU.js";import{a as hn,i as J,n as gn,o as _n,r as Y,t as vn}from"./table-TUtVz-2l.js";import{t as yn}from"./BundleIdDisplay-CP6rsdFO.js";import{a as bn,c as xn,d as Sn,f as Cn,i as wn,l as Tn,n as En,o as Dn,r as On,s as kn,t as An,u as jn}from"./RelativeTime-CiZ7yXNJ.js";import{n as Mn,t as Nn}from"./valueToPercent-B6X9rUJM.js";var Pn=k(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Fn=k(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),In=k(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Ln=k(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),Rn=y();function zn(){return v}function Bn(){return!1}function Vn(){return!0}function Hn(){return(0,Rn.useSyncExternalStore)(zn,Bn,Vn)}var X=ce(j(),1),Z=S();function Un({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(we,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(Fn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(pe,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}function Wn({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=O();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(yn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),s?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(yn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(L,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(Xe,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(vn,{className:`min-w-max`,children:[(0,Z.jsx)(hn,{children:(0,Z.jsxs)(_n,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(gn,{children:r.map(e=>(0,Z.jsxs)(_n,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(yn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(L,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(Xe,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function Gn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=lt(a),{data:c=[],isPending:l}=on(),u=cn(),d=un(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?q.success(`Channel ${e.row.name} created`):q.info(`Channel ${e.row.name} already exists`)}catch(e){q.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?q.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?q.error(`Channel ${a.name} is still in use and cannot be deleted`):q.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){q.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Kt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Ht,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsxs)(Ut,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(In,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Wt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:p,children:(0,Z.jsx)(Yt,{className:`gap-2`,children:(0,Z.jsxs)(Qt,{orientation:`horizontal`,children:[(0,Z.jsx)(qt,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ee,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)($e,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(et,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)($e,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:c.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(ct,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(Lt,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsxs)(Mt,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(At,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Nt,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Kn=`[a-zA-Z0-9-]`,qn=String.raw`0|[1-9]\d*`,Jn=String.raw`\d+`,Yn=String.raw`\d*[a-zA-Z-]${Kn}*`,Xn=String.raw`(${qn})\.(${qn})\.(${qn})`,Zn=String.raw`(${Jn})\.(${Jn})\.(${Jn})`,Qn=`(?:${Yn}|${qn})`,$n=`(?:${Yn}|${Jn})`,er=String.raw`(?:-(${Qn}(?:\.${Qn})*))`,tr=String.raw`(?:-?(${$n}(?:\.${$n})*))`,nr=`${Kn}+`,rr=String.raw`(?:\+(${nr}(?:\.${nr})*))`,ir=`v?${Xn}${er}?${rr}?`,ar=String.raw`[v=\s]*${Zn}${tr}?${rr}?`,or=`((?:<|>)?=?)`,sr=String.raw`${qn}|x|X|\*`,cr=String.raw`${Jn}|x|X|\*`,lr=String.raw`[v=\s]*(${sr})(?:\.(${sr})(?:\.(${sr})(?:${er})?${rr}?)?)?`,ur=String.raw`[v=\s]*(${cr})(?:\.(${cr})(?:\.(${cr})(?:${tr})?${rr}?)?)?`,dr=`(?:~>?)`,fr=String.raw`(?:\^)`,pr=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${pr}(?:$|[^\d])`,String.raw`${pr}(?:${er})?(?:${rr})?(?:$|[^\d])`;function mr(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(mr(e),t)}var hr=Q(`^${ir}$`),gr=Q(`^${ar}$`),_r=/^\d+$/;function vr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function yr(e,t={}){if(typeof e!=`string`)return e;if(e.length>256)throw TypeError(`Version exceeds the maximum length of 256 characters`);let n=e.trim().match(t.loose?gr:hr);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(_r.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var br=Q(String.raw`^${or}\s*(${ir})$|^$`),xr=Q(String.raw`^${or}\s*(${ar})$|^$`);function Sr(e){return e.version?`${e.operator}${vr(e.version)}`:``}function Cr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?xr:br);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?yr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${vr(a)}`:``,version:a}}function wr(e){return e.sets.map(e=>e.map(Sr).join(` `)).join(`||`)}var Tr=new RegExp(rr,`g`),Er=Q(rr),Dr=Q(String.raw`^\s*(${lr})\s+-\s+(${lr})\s*$`),Or=Q(String.raw`^\s*(${ur})\s+-\s+(${ur})\s*$`),kr=Q(String.raw`(\s*)${or}\s*(${ar}|${lr})`,`g`),Ar=Q(String.raw`(\s*)${dr}\s+`,`g`),jr=Q(String.raw`(\s*)${fr}\s+`,`g`),Mr=Q(`^${dr}${lr}$`),Nr=Q(`^${dr}${ur}$`),Pr=Q(`^${fr}${lr}$`),Fr=Q(`^${fr}${ur}$`),Ir=Q(String.raw`^${or}\s*${lr}$`),Lr=Q(String.raw`^${or}\s*${ur}$`),Rr=Q(String.raw`(<|>)?=?\s*\*`),zr=/^\s*>=\s*0\.0\.0\s*$/,Br=/^\s*>=\s*0\.0\.0-0\s*$/,Vr=Q(String.raw`^${or}\s*(${ar})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Hr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Ur(e,t){let n=t.loose?Nr:Mr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function Wr(e,t){return e.trim().split(/\s+/).map(e=>Ur(e,t)).join(` `)}function Gr(e,t){let n=t.loose?Fr:Pr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function Kr(e,t){return e.trim().split(/\s+/).map(e=>Gr(e,t)).join(` `)}function qr(e,t){let n=t.loose?Lr:Ir;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Hr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function Jr(e,t){return e.split(/\s+/).map(e=>qr(e,t)).join(` `)}function Yr(e,t){let n=t.loose?Or:Dr;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=$(r)?``:$(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:$(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=$(l)?``:$(u)?`<${Number(l)+1}.0.0-0`:$(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t.includePrerelease?`<${l}.${u}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()})}function Xr(e,t){return Jr(Wr(Kr(e.replace(Er,``),t),t),t).trim().replace(Rr,``)}function Zr(e,t){let n=Yr(e.replace(Tr,``),t).replace(kr,`$1$2$3`).replace(Ar,`$1~`).replace(jr,`$1^`).split(` `).map(e=>Xr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Br:zr,``));t.loose&&(n=n.filter(e=>Vr.test(e)));let r=new Map;for(let e of n.map(e=>Cr(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Qr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Zr(e.trim(),n)).filter(e=>e.length);if(!i.length)throw TypeError(`Range contains no valid comparator sets: ${r}`);if(i.length>1){let e=i[0];if(i=i.filter(e=>e[0]?.value!==`<0.0.0-0`),!i.length)i=[e];else if(i.length>1){let e=i.find(e=>e.length===1&&e[0]?.value===``);e&&(i=[e])}}return{options:n,sets:i}}function $r(e,t={}){try{return Qr(e,t)}catch{return null}}function ei(e,t={}){let n=$r(e,t);return n?wr(n)||`*`:null}function ti({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function ni({bundle:e,release:t}){let{data:n,isFetched:r}=tn(),i=e?Ot(e):null,a=e?Et(e):null,o=e?.gitCommitHash&&r?Ye(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(gt,{className:`p-4 pb-3`,children:(0,Z.jsx)(vt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(_t,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(ti,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(ti,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(qe,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(Je,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(ti,{label:`Manifest hash`,value:(0,Z.jsx)(qe,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(ti,{label:`Base hash`,value:(0,Z.jsx)(qe,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(ti,{label:`Patch hash`,value:(0,Z.jsx)(qe,{maxLength:16,value:i})}):null]})})]}):null}var ri=Array.from({length:Dt},(e,t)=>t+1);function ii({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=kt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===Dt,l=O(),u=c?ri:s?ri.filter(t=>Ct(e,t)<r):[],d=(r/10).toFixed(1),f=c?Dt:u.length,p=Dt-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(bt,{children:(0,Z.jsxs)(gt,{className:`p-4`,children:[(0,Z.jsx)(yt,{children:`Selected cohorts`}),(0,Z.jsx)(vt,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(bt,{children:(0,Z.jsxs)(gt,{className:`p-4`,children:[(0,Z.jsx)(yt,{children:`Excluded cohorts`}),(0,Z.jsx)(vt,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(bt,{children:[(0,Z.jsxs)(gt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(vt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(yt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(_t,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:a.map(e=>(0,Z.jsx)(K,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(gt,{className:`p-4 pb-3`,children:(0,Z.jsx)(vt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(_t,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(K,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Kt,{children:[(0,Z.jsxs)(Gt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Qe,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Ht,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Bt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Ut,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Wt,{children:[d,`% includes `,f,` of`,` `,Dt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(Vt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsx)(Ut,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Wt,{children:[d,`% includes `,f,` of`,` `,Dt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Vt,{showCloseButton:!0})]})})]})}function ai({release:t,channel:n,bundle:r}){let i=t.bundle_id===null?null:{platform:t.platform,channel:n,fingerprintHash:t.fingerprint_hash,targetAppVersion:t.target_app_version},a=i!==null&&Oe(i)!==null,o=mn(a?i:null);if(!a)return null;let s=o.data;return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Native build`}),o.isPending?(0,Z.jsx)(e,{className:`h-4 w-40`}):s?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{className:`inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 text-xs text-foreground underline-offset-4 hover:underline`,params:{buildId:s.id},to:`/native-builds/$buildId`,children:[je(s.platform),` `,ke[s.artifact_kind].label,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono`,translate:`no`,children:s.min_bundle_id}),(0,Z.jsx)(ve,{"aria-hidden":`true`,className:`size-3`})]}),r?(0,Z.jsx)(K,{variant:`secondary`,children:(r.patches??[]).some(({baseBundleId:e})=>e===s.min_bundle_id)?`Patches from it`:`No patch from it`}):null]}):o.isError?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Couldn't load the scope's native build.`,` `,(0,Z.jsx)(`button`,{className:`underline underline-offset-4`,onClick:()=>void o.refetch(),type:`button`,children:`Retry`})]}):(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`None tracked for this scope ·`,` `,(0,Z.jsx)(I,{className:`underline-offset-4 hover:text-foreground hover:underline`,search:{channel:n},to:`/native-builds`,children:`This channel's builds`})]})]})}function oi(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function si(e,t){return e-t}function ci(e,t,n){let r=e.slice();return r[t]=n,r.sort(si)}function li(e,t,n,r,i,a){let o=e;return o=U(o,n,r),i&&(o=ci(a,t,U(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function ui(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var di={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...Ie},fi=X.createContext(void 0);function pi(){let e=X.useContext(fi);if(e===void 0)throw Error(l(62));return e}function mi(e){return`key`in e?A:ne}function hi(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?oi(e,t):!1}var gi=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:h=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:b=`horizontal`,step:x=1,thumbCollisionBehavior:S=`push`,thumbAlignment:T=`center`,value:ee,style:te,...ne}=e,re=M(c),ae=Be(re),oe=D(v),se=D(y),{clearErrors:O}=He(),{state:ce,disabled:k,name:A,setTouched:le,setDirty:ue,validityData:de,shouldValidateOnChange:pe,validation:j}=Ne(),{labelId:me}=Fe(),[he,ge]=X.useState(),P=r??Ve(me,he),F=k||s,I=A??_,[L,ve]=B({controlled:ee,default:o??m,name:`Slider`}),ye=X.useRef(null),be=X.useRef(null),R=X.useRef([]),xe=X.useRef(null),Se=X.useRef(null),Ce=X.useRef(-1),we=X.useRef(null),z=X.useRef(null),Te=X.useRef(`none`),De=fe(l),[V,Oe]=X.useState(-1),[ke,Ae]=X.useState(-1),[je,Me]=X.useState(!1),[Ie,Le]=X.useState(()=>new Map),[Re,ze]=X.useState([void 0,void 0]),H=D(e=>{Oe(e),e!==-1&&Ae(e)});Pe(be,re,L),N(L,()=>{O(I),pe()?j.commit(L):j.commit(L,!0);let e=de.initialValue,t;t=Array.isArray(L)&&Array.isArray(e)?!oi(L,e):L!==e,ue(t)});let Ue=D(e=>{e&&(be.current=e)}),W=Array.isArray(L),G=X.useMemo(()=>W?L.slice().sort(si):[U(L,m,p)],[p,m,W,L]),We=D((e,t)=>{if(Number.isNaN(e)||hi(e,L))return;let n=t??E(`none`,void 0,void 0,{activeThumbIndex:-1});Te.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:I}}),n.event=i,z.current=e,oe(e,n),!n.isCanceled&&ve(e)}),Ge=D((e,t,n)=>{let r=li(e,t,m,p,W,G);if(ui(r,x,h)){let e=mi(n);We(r,E(e,n.nativeEvent,void 0,{activeThumbIndex:t})),le(!0),se(z.current??r,w(e,n.nativeEvent))}});C(()=>{let e=_e(a(ye.current));F&&ie(ye.current,e)&&e.blur()},[F]),F&&V!==-1&&H(-1);let Ke=X.useMemo(()=>({...ce,activeThumbIndex:V,disabled:F,dragging:je,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:G}),[ce,V,F,je,p,m,h,b,x,G]),qe=X.useMemo(()=>({active:V,controlRef:be,disabled:F,dragging:je,validation:j,formatOptionsRef:De,handleInputChange:Ge,indicatorPosition:Re,inset:T!==`center`,labelId:P,rootLabelId:ae,largeStep:u,lastUsedThumbIndex:ke,lastChangedValueRef:z,lastChangeReasonRef:Te,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:I,onValueCommitted:se,orientation:b,pressedInputRef:xe,pressedThumbCenterOffsetRef:Se,pressedThumbIndexRef:Ce,pressedValuesRef:we,registerFieldControlRef:Ue,renderBeforeHydration:T===`edge`,setActive:H,setDragging:Me,setIndicatorPosition:ze,setLabelId:ge,setValue:We,state:Ke,step:x,thumbCollisionBehavior:S,thumbMap:Ie,thumbRefs:R,values:G}),[V,be,P,ae,F,je,j,De,Ge,Re,u,ke,z,Te,g,d,p,m,h,I,se,b,xe,Se,Ce,we,Ue,H,Me,ze,ge,We,Ke,x,S,T,Ie,R,G]),Je=n(`div`,e,{state:Ke,ref:[t,ye],props:[{"aria-labelledby":P,id:re,role:`group`},j.getValidationProps,ne],stateAttributesMapping:di});return(0,Z.jsx)(fi.Provider,{value:qe,children:(0,Z.jsx)(Ee,{elementsRef:R,onMapChange:Le,children:Je})})});function _i(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function vi(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function yi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(vi(t),vi(n))))}function bi({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=U(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=U(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=U(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function xi({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=U(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=bi({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=U(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:bi({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=U(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var Si=2;function Ci(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function wi(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var Ti=X.forwardRef(function(e,r){let{render:i,className:o,style:s,...c}=e,{disabled:l,dragging:f,inset:p,lastChangedValueRef:m,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:C,pressedValuesRef:T,registerFieldControlRef:ee,renderBeforeHydration:te,setActive:ne,setDragging:re,setValue:oe,state:se,step:O,thumbCollisionBehavior:ce,thumbRefs:k,values:A}=pi(),de=le(),pe=A.length>1,j=b===`vertical`,M=X.useRef(null),he=X.useRef(null),ge=D(e=>{e&&he.current==null&&(he.current=t(e).getComputedStyle(e))}),N=X.useRef(null),F=X.useRef(0),I=X.useRef(0),L=fe(A);function ve(e){C.current!==e&&(C.current=e);let t=k.current[e];if(!t){S.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function ye(e){let t=M.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=Ci(he.current,j),c=I.current,l=(j?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=U(((j?i-f-s.end:(de===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=yi(m,O,_),m=U(m,_,g),!pe)return{value:m,thumbIndex:0,didSwap:!1};let h=C.current;if(h<0)return null;let y=xi({behavior:ce,values:A,currentValues:L.current??A,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:O,minStepsBetweenValues:v});return ce===`swap`&&y.didSwap?ve(y.thumbIndex):C.current=y.thumbIndex,y}function be(e){T.current=pe?A.slice():null,L.current=A;let t=C.current,n=t;if(t>-1&&t<A.length){if(A[t]===g){let e=t;for(;e>0&&A[e-1]===g;)--e;n=e}}else{let t=j?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(ae(a)){let o=_i(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&ve(n),p){let e=k.current[n];ae(e)&&(I.current=e.getBoundingClientRect()[j?`height`:`width`]/2)}}function R(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let xe=D(e=>{let t=wi(e,N);if(t==null)return;if(F.current+=1,e.type===`pointermove`&&e.buttons===0){Se(e);return}let n=ye(t);n!=null&&ui(n.value,O,v)&&(!f&&F.current>Si&&re(!0),oe(n.value,E(me,e,void 0,{activeThumbIndex:n.thumbIndex})),L.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&R(n.thumbIndex))});function Se(e){ne(-1),re(!1),x.current=null,S.current=null;let t=wi(e,N),n=t==null?null:ye(t);if(n!=null){let t=h.current;y(m.current??n.value,w(t,e))}`pointerType`in e&&M.current?.hasPointerCapture(e.pointerId)&&M.current?.releasePointerCapture(e.pointerId),C.current=-1,N.current=null,T.current=null,we()}let Ce=D(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(N.current=t.identifier);let n=wi(e,N);if(n!=null){be(n);let t=ye(n);if(t==null)return;R(t.thumbIndex),oe(t.value,E(ue,e,void 0,{activeThumbIndex:t.thumbIndex})),L.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&R(t.thumbIndex)}F.current=0;let r=a(M.current);r.addEventListener(`touchmove`,xe,{passive:!0}),r.addEventListener(`touchend`,Se,{passive:!0})}),we=D(()=>{let e=a(M.current);e.removeEventListener(`pointermove`,xe),e.removeEventListener(`pointerup`,Se),e.removeEventListener(`touchmove`,xe),e.removeEventListener(`touchend`,Se),T.current=null}),z=d();return X.useEffect(()=>{let e=M.current;if(!e)return()=>we();let t=u(e,`touchstart`,Ce,{passive:!0});return()=>{t(),z.cancel(),we()}},[we,Ce,M,z]),X.useEffect(()=>{l&&we()},[l,we]),n(`div`,e,{state:se,ref:[r,ee,M,ge],props:[{"data-base-ui-slider-control":te?``:void 0,onPointerDown(e){let t=M.current,n=P(e.nativeEvent);if(!t||l||e.defaultPrevented||!ae(n)||e.button!==0)return;let r=wi(e,N);if(r!=null){be(r);let n=ye(r);if(n==null)return;ie(k.current[n.thumbIndex],_e(a(t)))?e.preventDefault():z.request(()=>{R(n.thumbIndex)}),re(!0),S.current??(oe(n.value,E(ue,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),L.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&R(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),F.current=0;let i=a(M.current);i.addEventListener(`pointermove`,xe,{passive:!0}),i.addEventListener(`pointerup`,Se,{once:!0})}},c],stateAttributesMapping:di})}),Ei=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=pi();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:di})}),Di=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),Oi=new Set([...f,_,o]);function ki(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${Mn(e[t],r,n)} start range`:`${Mn(e[t],r,n)} end range`:n?Mn(e[t],r,n):void 0}function Ai(e,t,n,r,i){let a=n===1?e+t:e-t;return U(Number(a.toFixed(Math.max(vi(e),vi(t),vi(r)))),r,i)}var ji=X.forwardRef(function(e,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:v=!1,getAriaLabel:y,getAriaValueText:S,id:w,index:E,inputRef:ee,onBlur:te,onFocus:ne,onKeyDown:re,tabIndex:ie,style:ae,...oe}=e,{nonce:se}=Le(),O=M(w),{active:ce,lastUsedThumbIndex:k,controlRef:A,disabled:ue,validation:de,formatOptionsRef:fe,handleInputChange:pe,inset:j,labelId:me,largeStep:he,locale:N,max:P,min:F,minStepsBetweenValues:_e,form:I,name:L,orientation:ve,pressedInputRef:ye,pressedThumbCenterOffsetRef:be,pressedThumbIndexRef:R,renderBeforeHydration:xe,setActive:Se,setIndicatorPosition:Ce,state:we,step:z,values:B}=pi(),Ee=le(),De=v||ue,V=B.length>1,Oe=ve===`vertical`,ke=Ee===`rtl`,{setTouched:Ae,setFocused:je,validationMode:Me}=Ne(),Pe=X.useRef(null),Fe=X.useRef(null),Ie=X.useRef(!1),ze=M(),Be=Re(),Ve=V?ze:Be,{ref:He,index:H}=Te({metadata:X.useMemo(()=>({inputId:Ve}),[Ve])}),U=V?E??H:0,Ue=U===B.length-1,W=B[U],G=Nn(W,F,P),[We,Ge]=X.useState(),Ke=Hn(),qe=k>=0&&k<B.length?k:-1,Je=D(()=>{let e=A.current,t=Pe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Oe?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*G/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ge(s),U===0?Ce(e=>[s,e[1]]):Ue&&Ce(e=>[e[0],s])});C(()=>{j&&queueMicrotask(Je)},[Je,j]),C(()=>{j&&Je()},[Je,j,G]),C(()=>{if(!j)return;let e=A.current,n=Pe.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Je);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[A,Je,j]);let Ye=Oe?`bottom`:`insetInlineStart`,Xe=Oe?`left`:`top`,Ze;V?ce===U?Ze=2:qe===U&&(Ze=1):ce===U&&(Ze=1);let Qe;Qe=j?{"--position":`${We??0}%`,visibility:xe&&Ke||We===void 0?`hidden`:void 0,position:`absolute`,[Ye]:`var(--position)`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:Number.isFinite(G)?{position:`absolute`,[Ye]:`${G}%`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:b;let $e;ve===`vertical`&&($e=ke?`vertical-rl`:`vertical-lr`);let et=typeof y==`function`?y(U):d,tt=T({"aria-label":et,"aria-labelledby":p??(et==null?me:void 0),"aria-describedby":u,"aria-orientation":ve,"aria-valuenow":W,"aria-valuetext":typeof S==`function`?S(Mn(W,N,fe.current??void 0),W,U):ki(B,U,fe.current??void 0,N),disabled:De,form:I,id:Ve,max:P,min:F,name:L,onChange(e){pe(e.currentTarget.valueAsNumber,U,e)},onFocus(e){let t=Ie.current;Ie.current=!1,Se(U),je(!0),t&&e.stopPropagation()},onBlur(e){if(Ie.current){e.stopPropagation();return}Pe.current&&(Se(-1),Ae(!0),je(!1),Me===`onBlur`&&de.commit(li(W,U,F,P,V,B)))},onKeyDown(e){if(!Oi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=yi(W,z,F);switch(e.key){case s:t=Ai(n,e.shiftKey?he:z,1,F,P);break;case r:t=Ai(n,e.shiftKey?he:z,ke?-1:1,F,P);break;case m:t=Ai(n,e.shiftKey?he:z,-1,F,P);break;case h:t=Ai(n,e.shiftKey?he:z,ke?1:-1,F,P);break;case _:t=Ai(n,he,1,F,P);break;case o:t=Ai(n,he,-1,F,P);break;case`End`:t=P,V&&(t=Number.isFinite(B[U+1])?B[U+1]-z*_e:P);break;case g:t=F,V&&(t=Number.isFinite(B[U-1])?B[U-1]+z*_e:F);break;default:break}if(t!==null){let n=e.currentTarget;ge(n)||(Ie.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),pe(t,U,e),e.preventDefault()}},step:z,style:{...b,width:`100%`,height:`100%`,writingMode:$e},tabIndex:ie??void 0,type:`range`,value:W??``},de.getInputValidationProps),nt=x(Fe,de.inputRef,ee);return n(`div`,e,{state:we,ref:[i,He,Pe],props:[{[Di.index]:U,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:nt,...tt,suppressHydrationWarning:!0}),j&&Ke&&xe&&Ue&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:O,onBlur:te,onFocus:ne,onPointerDown(e){if(R.current=U,Pe.current!=null){let t=ve===`horizontal`?`x`:`y`,n=_i(Pe.current);be.current=(ve===`horizontal`?e.clientX:e.clientY)-n[t]}Fe.current!=null&&ye.current!==Fe.current&&(ye.current=Fe.current)},style:Qe,suppressHydrationWarning:xe||void 0},oe],stateAttributesMapping:di})});function Mi(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function Ni(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var Pi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=pi(),h=Hn(),g=d===`vertical`,_=m.length>1,v=c?Mi(g,_,s[0],s[1],f,h):Ni(g,_,Nn(m[0],u,l),Nn(m[m.length-1],u,l));return n(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:di})});function Fi({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(gi,{className:p(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(Ti,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(Ei,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(Pi,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(ji,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ii=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Li=e=>({enabled:e.enabled,message:e.message??``,rolloutCohortCount:e.rollout_cohort_count,shouldForceUpdate:e.should_force_update,targetAppVersion:e.target_app_version??``,targetCohorts:[...e.target_cohorts]}),Ri=(e,t)=>({enabled:t.enabled,message:t.message.trim()||null,rolloutCohortCount:t.rolloutCohortCount,shouldForceUpdate:t.shouldForceUpdate,...e.strategy===`APP_VERSION`?{targetAppVersion:t.targetAppVersion.trim()}:{},targetCohorts:t.targetCohorts}),zi=e=>(e/10).toFixed(1),Bi=e=>{let t=e.replace(`,`,`.`),[n=``,...r]=t.split(`.`),i=n.replace(/\D/g,``).slice(0,3),a=r.join(``).replace(/\D/g,``).slice(0,1);return t.includes(`.`)?`${i}.${a}`:i},Vi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Hi({value:e,onChange:t}){let[n,r]=(0,X.useState)(zi(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(zi(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Fi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(st,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(rt,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Vi(n)??e;a(!1),r(zi(i)),t(i)},onChange:e=>{let n=Bi(e.target.value);r(n);let i=Vi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(it,{align:`inline-end`,children:(0,Z.jsx)(nt,{children:`%`})})]})]})}function Ui({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=nn(o),c=s.data,l=ln(c?.bundle_id??``),u=l.data,d=u?xt(u):null,f=fn(c?.scope_key??``),p=$t(),m=an(),h=rn(),g=en(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(!1),[D,ne]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(``),[O,ce]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?Li(c):null),S(``)},[c]);let k=c?Li(c):null,A=_!==null&&k!==null&&JSON.stringify(_)!==JSON.stringify(k),le=m.isPending||p.isPending||h.isPending||g.isPending,ue=()=>{if(!le){if(A){w(!0);return}n(!1)}},de=()=>{if(!_)return;let e=wt(y);if(!St(e)){S(Tt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},fe=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(wt);if(e.some(e=>!St(e))){S(Tt);return}if(c.strategy===`APP_VERSION`&&!ei(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ri(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),q.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},j=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,me=t.filter(e=>e.id!==c?.channel_id),M=me.map(e=>({label:e.name,value:e.name})),ge=ie.trim(),N=O===`copy`,P=_?ei(_.targetAppVersion.trim()):null,_e=()=>{ae(``),ce(`move`)},I=e=>{!e&&g.isPending||(ne(e),e||_e())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(se,{onOpenChange:e=>e?void 0:ue(),open:a,children:(0,Z.jsxs)(te,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(F,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(re,{children:`Bundle Detail`}),(0,Z.jsx)(he,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(zt,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(yn,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:j})]}),j?(0,Z.jsx)(ai,{bundle:u,channel:j,release:c}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(pt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(ft,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[j?(0,Z.jsx)(ye,{release:{platform:c.platform,channel:j,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Yt,{className:`gap-6`,children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(at,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ee,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),P?(0,Z.jsx)(Xt,{children:P}):null]}):null,(0,Z.jsx)(Qt,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(qt,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(ht,{label:`About Enabled`,children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsx)(ut,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(Qt,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(qt,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(ht,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(ut,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Hi,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(Qt,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(qt,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(ii,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ee,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),de())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:de,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(et,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(K,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(pe,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Xt,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Zt,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!A||le,onClick:fe,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(oe,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(i,{className:`w-full`,disabled:!c.bundle_id||le,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:le,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),q.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Ke,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||le,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(pt,{variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Build details are unavailable`}),(0,Z.jsx)(ft,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(ni,{bundle:u,release:c}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:d})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.scope_key}),r?(0,Z.jsx)(i,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(Lt,{onOpenChange:w,open:C,children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsx)(Mt,{children:`Discard unsaved changes?`}),(0,Z.jsx)(At,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{children:`Keep editing`}),(0,Z.jsx)(Nt,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(Lt,{onOpenChange:E,open:T,children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsxs)(Mt,{children:[`Remove this Bundle from `,j??`the channel`,`?`]}),(0,Z.jsx)(At,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{children:`Cancel`}),(0,Z.jsx)(Nt,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),q.success(`Bundle removed from ${j??`the channel`}`),E(!1),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Kt,{onOpenChange:I,open:D,children:(0,Z.jsxs)(Ht,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsx)(Ut,{children:`Promote to Channel`}),(0,Z.jsx)(Wt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Jt,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(We,{disabled:g.isPending,items:Ii,onValueChange:e=>ce(e),value:O,children:[(0,Z.jsx)(ze,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(W,{placeholder:`Select an action`})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(H,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:N?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Jt,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(We,{disabled:g.isPending,items:M,onValueChange:e=>ae(e??``),value:ie||null,children:[(0,Z.jsx)(ze,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(W,{placeholder:`Select a channel`})}),(0,Z.jsx)(Ue,{className:`max-h-64`,children:(0,Z.jsx)(G,{children:me.map(e=>(0,Z.jsx)(H,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Vt,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>I(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!ge||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:O,expectedRevision:c.revision,releaseId:c.id,targetChannel:ge}),I(!1),q.success(N?`Bundle copied to ${ge}`:`Bundle moved to ${ge}`)}catch(e){q.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?N?`Copying…`:`Moving…`:N?`Copy`:`Move`})]})]})})]})}function Wi({release:e}){return(0,Z.jsxs)(K,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(we,{className:`size-3`}):(0,Z.jsx)(Ge,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}var Gi=20,Ki=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],qi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}];function Ji({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=R(a),s=a.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(de,{className:`-ml-1 size-11 lg:size-7`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(Pn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(We,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(ze,{"aria-label":`Channel`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 sm:w-[140px] sm:data-[size=default]:h-8`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(H,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(We,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(ze,{"aria-label":`Platform`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:data-[size=default]:h-8`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`ios`,children:`iOS`}),(0,Z.jsx)(H,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(We,{disabled:!s&&a.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(ze,{"aria-label":`Status`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:data-[size=default]:h-8`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`all`,children:`Any Status`}),(0,Z.jsx)(H,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(H,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(i,{"aria-label":`Manage channels`,className:`size-11 max-sm:order-1 sm:size-7`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(Ln,{})}),a.bundleId?(0,Z.jsxs)(K,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(pe,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(K,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(pe,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(i,{className:`h-11 px-2 text-xs text-muted-foreground hover:text-foreground max-sm:order-3 sm:ml-auto sm:h-8`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(pe,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Yi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let a=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(i,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-11 shrink-0 touch-manipulation sm:size-8`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(z,{}):(0,Z.jsx)(Me,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-11 shrink-0 sm:size-8`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(yn,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(ot,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(Ge,{className:`size-3.5`}),`Unreachable`]}):null]})}function Xi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=ln(i),o=sn(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(Wn,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function Zi(){let e=Ce.useSearch(),t=Ce.useNavigate(),n=O(),[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),l=pn({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:xe(e),limit:Gi}),u=on().data??[],d=l.data?.data??[],f=dn(Array.from(new Set(d.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},m=l.data?.next,h=l.data?.previous,g=d.flatMap(e=>{let t=u.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),_=Se(),v=10+_.length,y=new Map(u.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!d.some(e=>e.id===o)&&s(void 0)},[o,d]);let b=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),x=t=>b(be(e,t)),S=t=>{let n=d.find(e=>e.bundle_id===t.id);if(s(void 0),n){b({...e,releaseId:n.id},!1);return}x({bundleId:t.id})},C=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,w=h?{...e,afterReleaseId:h,beforeReleaseId:void 0,releaseId:void 0}:null,T=m?{...e,afterReleaseId:void 0,beforeReleaseId:m,releaseId:void 0}:null,E={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0},ee=(0,Z.jsx)(Dn,{icon:tt,title:C?`No more bundles`:R(e)?`No bundles match these filters`:`No bundles yet`,children:C?(0,Z.jsx)(I,{className:c({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:E,to:`/`,children:`Show the newest bundles`}):R(e)?(0,Z.jsx)(i,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>b({}),variant:`outline`,children:`Clear filters`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:`Deploy one from your app's project:`}),(0,Z.jsx)(`div`,{className:`w-full text-left`,children:(0,Z.jsx)(V,{label:`the deploy command`,value:`npx hot-updater deploy`,wrap:!0})})]})});return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(Ji,{channels:u,onChange:x,onClear:()=>b({}),onManageChannels:()=>a(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[l.isError?(0,Z.jsxs)(pt,{variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Bundles could not be loaded`}),(0,Z.jsx)(ft,{children:l.error.message})]}):(0,Z.jsx)(kn,{children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:l.isPending?(0,Z.jsx)(On,{}):d.length?d.map(t=>{let n=y.get(t.channel_id)??t.channel_id,r=t.bundle_id?f[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(En,{"aria-label":`Bundle ${t.id}`,className:p(`gap-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:Cn(()=>b({...e,releaseId:t.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Yi,{expanded:i,onOpen:()=>b({...e,releaseId:t.id},!1),onToggleExpand:()=>s(i?void 0:t.id),release:t}),(0,Z.jsx)(De,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-foreground`,children:[(0,Z.jsx)(zt,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]}),r===void 0||r>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(`span`,{children:r===void 0?`Checking patches`:`${r} ${r===1?`patch`:`patches`}`})]}):null,(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(An,{ms:t.created_at_ms})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-xs`,children:[(0,Z.jsx)(Ze,{percentage:t.rollout_cohort_count/10}),(0,Z.jsx)(Wi,{release:t}),t.should_force_update?(0,Z.jsx)(K,{variant:`secondary`,children:`Force update`}):null,(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:`Target `}),(0,Z.jsx)(Ae,{appVersion:t.target_app_version,fingerprintHash:t.fingerprint_hash})]})]}),_.map(({Cell:e,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`mt-3 text-xs`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:r}),(0,Z.jsx)(e,{releaseId:t.id,releases:g})]},n)),t.message?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.message}):null]}),i&&t.bundle_id?(0,Z.jsx)(Xi,{onDetailClick:S,panelId:a,release:t}):null]},t.id)}):(0,Z.jsx)(wn,{children:ee})}):(0,Z.jsxs)(bn,{header:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),_.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]}),children:[l.isPending?(0,Z.jsx)(Sn,{columns:v}):d.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(jn,{"aria-label":`Open bundle ${t.id}`,className:p(t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onOpen:()=>b({...e,releaseId:t.id},!1),children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Yi,{expanded:n,onOpen:()=>b({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(De,{channel:y.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsx)(Rt,{platform:t.platform})}),(0,Z.jsx)(Y,{children:t.bundle_id&&f[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&f[t.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[f[t.bundle_id],` `,f[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Ae,{appVersion:t.target_app_version,fingerprintHash:t.fingerprint_hash})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Un,{enabled:t.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Un,{enabled:t.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Ze,{percentage:t.rollout_cohort_count/10})}),_.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:g})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(An,{ms:t.created_at_ms})})]}),n&&t.bundle_id?(0,Z.jsx)(_n,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:v,children:(0,Z.jsx)(Xi,{onDetailClick:S,panelId:r,release:t})})}):null]},t.id)}),!l.isPending&&d.length===0?(0,Z.jsx)(xn,{columns:v,children:ee}):null]})}),!l.isError&&!l.isPending?(0,Z.jsx)(Tn,{count:d.length,label:`Bundle pagination`,pending:l.isPlaceholderData,newest:C?{search:E,to:`/`}:void 0,next:T?{search:T,to:`/`}:void 0,previous:w?{search:w,to:`/`}:void 0}):null]}),(0,Z.jsx)(Ui,{channels:u,onOpenChange:t=>!t&&b({...e,releaseId:void 0},!1),onShowScope:e=>x({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(Gn,{onOpenChange:a,open:r})]})}export{Zi as component};
|
|
1
|
+
import{$ as e,$n as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,P as h,R as g,U as _,Un as v,Ur as y,Ut as b,Wn as x,Wr as S,Xn as C,Xt as w,Yn as T,Yt as E,Z as ee,Zn as D,_ as te,an as ne,b as re,bn as ie,er as ae,et as oe,g as se,h as O,ii as ce,ir as k,ln as A,lt as le,mn as ue,p as de,qt as fe,rr as pe,ti as j,tn as me,ut as M,v as he,vn as ge,w as N,xn as P,y as F,yn as _e}from"./sidebar-Di9SN47G.js";import{t as I}from"./link-DTEyW70e.js";import{t as L}from"./arrow-right-CNII8TYn.js";import{t as ve}from"./arrow-up-right-DK8Zdg40.js";import{a as ye,i as be,n as R,r as xe,s as Se,t as Ce}from"./routes-gQXSzO_n.js";import{t as we}from"./check-CXVR3s3X.js";import{a as z,i as B,n as Te,r as Ee}from"./useCompositeListItem-JmyDfo3-.js";import{C as De,S as V,b as Oe,l as ke,r as Ae,y as je}from"./TargetDisplay-DwOaMOiI.js";import{t as Me}from"./chevron-right-BoUXo82O.js";import{A as Ne,D as Pe,E as Fe,M as Ie,N as Le,T as Re,a as ze,d as Be,f as Ve,h as He,i as H,m as U,n as Ue,o as W,r as G,t as We}from"./select-CBIU0_M1.js";import{t as Ge}from"./circle-off-C7Muo0ss.js";import{r as Ke,t as qe}from"./HashValueDisplay-MoZMmTeP.js";import{i as Je,n as Ye,r as Xe,t as Ze}from"./RolloutPercentageBadge-G6qt8rVb.js";import{t as Qe}from"./list-B6GeoQ_b.js";import{n as $e,t as et}from"./plus-BVhOauU3.js";import{t as tt}from"./package-ytYrywZH.js";import{a as nt,i as rt,n as it,o as at,s as ot,t as st}from"./input-group-D_NfhUbX.js";import{i as ct,n as lt,t as ut}from"./switch-CP6GsHmN.js";import{a as dt,i as ft,n as pt,o as mt,t as K}from"./badge-D0NFvUY5.js";import{n as q}from"./dist-Bf1BPKMs.js";import{o as ht}from"./insights-search-CYPrQVUC.js";import{a as gt,n as _t,o as vt,r as yt,t as bt}from"./card-ulgg5xHn.js";import{a as xt,c as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,u as kt}from"./uuidv7-cI6C63Fm.js";import{a as At,i as jt,l as Mt,n as Nt,o as Pt,r as Ft,s as It,t as Lt}from"./alert-dialog-DiRLrFVe.js";import{n as Rt,t as zt}from"./PlatformIcon-CJ69KopR.js";import{a as Bt,i as Vt,n as Ht,o as Ut,r as Wt,s as Gt,t as Kt}from"./dialog-CLIaC82_.js";import{a as qt,c as Jt,i as Yt,n as Xt,r as Zt,t as Qt}from"./field-q4sTYzNU.js";import{S as $t,_ as en,a as tn,b as nn,c as rn,g as an,i as on,n as sn,o as cn,r as ln,s as un,t as dn,v as fn,x as pn,y as mn}from"./api-LQJH44FU.js";import{a as hn,i as J,n as gn,o as _n,r as Y,t as vn}from"./table-TUtVz-2l.js";import{t as yn}from"./BundleIdDisplay-CP6rsdFO.js";import{a as bn,c as xn,d as Sn,f as Cn,i as wn,l as Tn,n as En,o as Dn,r as On,s as kn,t as An,u as jn}from"./RelativeTime-TCmpOVPg.js";import{n as Mn,t as Nn}from"./valueToPercent-B6X9rUJM.js";var Pn=k(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Fn=k(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),In=k(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Ln=k(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),Rn=y();function zn(){return v}function Bn(){return!1}function Vn(){return!0}function Hn(){return(0,Rn.useSyncExternalStore)(zn,Bn,Vn)}var X=ce(j(),1),Z=S();function Un({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(we,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(Fn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(pe,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}function Wn({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=O();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(yn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),s?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(yn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(L,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(Xe,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(vn,{className:`min-w-max`,children:[(0,Z.jsx)(hn,{children:(0,Z.jsxs)(_n,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(gn,{children:r.map(e=>(0,Z.jsxs)(_n,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(yn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(L,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(yn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(Xe,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>o(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function Gn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=lt(a),{data:c=[],isPending:l}=on(),u=cn(),d=un(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?q.success(`Channel ${e.row.name} created`):q.info(`Channel ${e.row.name} already exists`)}catch(e){q.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?q.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?q.error(`Channel ${a.name} is still in use and cannot be deleted`):q.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){q.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Kt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Ht,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsxs)(Ut,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(In,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Wt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:p,children:(0,Z.jsx)(Yt,{className:`gap-2`,children:(0,Z.jsxs)(Qt,{orientation:`horizontal`,children:[(0,Z.jsx)(qt,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ee,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)($e,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(et,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)($e,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:c.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(ct,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(Lt,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsxs)(Mt,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(At,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Nt,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Kn=`[a-zA-Z0-9-]`,qn=String.raw`0|[1-9]\d*`,Jn=String.raw`\d+`,Yn=String.raw`\d*[a-zA-Z-]${Kn}*`,Xn=String.raw`(${qn})\.(${qn})\.(${qn})`,Zn=String.raw`(${Jn})\.(${Jn})\.(${Jn})`,Qn=`(?:${Yn}|${qn})`,$n=`(?:${Yn}|${Jn})`,er=String.raw`(?:-(${Qn}(?:\.${Qn})*))`,tr=String.raw`(?:-?(${$n}(?:\.${$n})*))`,nr=`${Kn}+`,rr=String.raw`(?:\+(${nr}(?:\.${nr})*))`,ir=`v?${Xn}${er}?${rr}?`,ar=String.raw`[v=\s]*${Zn}${tr}?${rr}?`,or=`((?:<|>)?=?)`,sr=String.raw`${qn}|x|X|\*`,cr=String.raw`${Jn}|x|X|\*`,lr=String.raw`[v=\s]*(${sr})(?:\.(${sr})(?:\.(${sr})(?:${er})?${rr}?)?)?`,ur=String.raw`[v=\s]*(${cr})(?:\.(${cr})(?:\.(${cr})(?:${tr})?${rr}?)?)?`,dr=`(?:~>?)`,fr=String.raw`(?:\^)`,pr=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${pr}(?:$|[^\d])`,String.raw`${pr}(?:${er})?(?:${rr})?(?:$|[^\d])`;function mr(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(mr(e),t)}var hr=Q(`^${ir}$`),gr=Q(`^${ar}$`),_r=/^\d+$/;function vr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function yr(e,t={}){if(typeof e!=`string`)return e;if(e.length>256)throw TypeError(`Version exceeds the maximum length of 256 characters`);let n=e.trim().match(t.loose?gr:hr);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(_r.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var br=Q(String.raw`^${or}\s*(${ir})$|^$`),xr=Q(String.raw`^${or}\s*(${ar})$|^$`);function Sr(e){return e.version?`${e.operator}${vr(e.version)}`:``}function Cr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?xr:br);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?yr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${vr(a)}`:``,version:a}}function wr(e){return e.sets.map(e=>e.map(Sr).join(` `)).join(`||`)}var Tr=new RegExp(rr,`g`),Er=Q(rr),Dr=Q(String.raw`^\s*(${lr})\s+-\s+(${lr})\s*$`),Or=Q(String.raw`^\s*(${ur})\s+-\s+(${ur})\s*$`),kr=Q(String.raw`(\s*)${or}\s*(${ar}|${lr})`,`g`),Ar=Q(String.raw`(\s*)${dr}\s+`,`g`),jr=Q(String.raw`(\s*)${fr}\s+`,`g`),Mr=Q(`^${dr}${lr}$`),Nr=Q(`^${dr}${ur}$`),Pr=Q(`^${fr}${lr}$`),Fr=Q(`^${fr}${ur}$`),Ir=Q(String.raw`^${or}\s*${lr}$`),Lr=Q(String.raw`^${or}\s*${ur}$`),Rr=Q(String.raw`(<|>)?=?\s*\*`),zr=/^\s*>=\s*0\.0\.0\s*$/,Br=/^\s*>=\s*0\.0\.0-0\s*$/,Vr=Q(String.raw`^${or}\s*(${ar})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Hr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Ur(e,t){let n=t.loose?Nr:Mr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function Wr(e,t){return e.trim().split(/\s+/).map(e=>Ur(e,t)).join(` `)}function Gr(e,t){let n=t.loose?Fr:Pr,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function Kr(e,t){return e.trim().split(/\s+/).map(e=>Gr(e,t)).join(` `)}function qr(e,t){let n=t.loose?Lr:Ir;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Hr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function Jr(e,t){return e.split(/\s+/).map(e=>qr(e,t)).join(` `)}function Yr(e,t){let n=t.loose?Or:Dr;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=$(r)?``:$(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:$(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=$(l)?``:$(u)?`<${Number(l)+1}.0.0-0`:$(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:t.includePrerelease?`<${l}.${u}.${Number(d)+1}-0`:`<=${m}`,`${p} ${m}`.trim()})}function Xr(e,t){return Jr(Wr(Kr(e.replace(Er,``),t),t),t).trim().replace(Rr,``)}function Zr(e,t){let n=Yr(e.replace(Tr,``),t).replace(kr,`$1$2$3`).replace(Ar,`$1~`).replace(jr,`$1^`).split(` `).map(e=>Xr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Br:zr,``));t.loose&&(n=n.filter(e=>Vr.test(e)));let r=new Map;for(let e of n.map(e=>Cr(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Qr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Zr(e.trim(),n)).filter(e=>e.length);if(!i.length)throw TypeError(`Range contains no valid comparator sets: ${r}`);if(i.length>1){let e=i[0];if(i=i.filter(e=>e[0]?.value!==`<0.0.0-0`),!i.length)i=[e];else if(i.length>1){let e=i.find(e=>e.length===1&&e[0]?.value===``);e&&(i=[e])}}return{options:n,sets:i}}function $r(e,t={}){try{return Qr(e,t)}catch{return null}}function ei(e,t={}){let n=$r(e,t);return n?wr(n)||`*`:null}function ti({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function ni({bundle:e,release:t}){let{data:n,isFetched:r}=tn(),i=e?Ot(e):null,a=e?Et(e):null,o=e?.gitCommitHash&&r?Ye(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(gt,{className:`p-4 pb-3`,children:(0,Z.jsx)(vt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(_t,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(ti,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(ti,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(qe,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(Je,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(ti,{label:`Manifest hash`,value:(0,Z.jsx)(qe,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(ti,{label:`Base hash`,value:(0,Z.jsx)(qe,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(ti,{label:`Patch hash`,value:(0,Z.jsx)(qe,{maxLength:16,value:i})}):null]})})]}):null}var ri=Array.from({length:Dt},(e,t)=>t+1);function ii({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=kt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===Dt,l=O(),u=c?ri:s?ri.filter(t=>Ct(e,t)<r):[],d=(r/10).toFixed(1),f=c?Dt:u.length,p=Dt-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(bt,{children:(0,Z.jsxs)(gt,{className:`p-4`,children:[(0,Z.jsx)(yt,{children:`Selected cohorts`}),(0,Z.jsx)(vt,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(bt,{children:(0,Z.jsxs)(gt,{className:`p-4`,children:[(0,Z.jsx)(yt,{children:`Excluded cohorts`}),(0,Z.jsx)(vt,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(bt,{children:[(0,Z.jsxs)(gt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(vt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(yt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(_t,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:a.map(e=>(0,Z.jsx)(K,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(gt,{className:`p-4 pb-3`,children:(0,Z.jsx)(vt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(_t,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(K,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Kt,{children:[(0,Z.jsxs)(Gt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Qe,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Ht,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Bt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Ut,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Wt,{children:[d,`% includes `,f,` of`,` `,Dt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(Vt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsx)(Ut,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Wt,{children:[d,`% includes `,f,` of`,` `,Dt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Vt,{showCloseButton:!0})]})})]})}function ai({release:t,channel:n,bundle:r}){let i=t.bundle_id===null?null:{platform:t.platform,channel:n,fingerprintHash:t.fingerprint_hash,targetAppVersion:t.target_app_version},a=i!==null&&Oe(i)!==null,o=mn(a?i:null);if(!a)return null;let s=o.data;return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Native build`}),o.isPending?(0,Z.jsx)(e,{className:`h-4 w-40`}):s?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(I,{className:`inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 text-xs text-foreground underline-offset-4 hover:underline`,params:{buildId:s.id},to:`/native-builds/$buildId`,children:[je(s.platform),` `,ke[s.artifact_kind].label,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono`,translate:`no`,children:s.min_bundle_id}),(0,Z.jsx)(ve,{"aria-hidden":`true`,className:`size-3`})]}),r?(0,Z.jsx)(K,{variant:`secondary`,children:(r.patches??[]).some(({baseBundleId:e})=>e===s.min_bundle_id)?`Patches from it`:`No patch from it`}):null]}):o.isError?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Couldn't load the scope's native build.`,` `,(0,Z.jsx)(`button`,{className:`underline underline-offset-4`,onClick:()=>void o.refetch(),type:`button`,children:`Retry`})]}):(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`None tracked for this scope ·`,` `,(0,Z.jsx)(I,{className:`underline-offset-4 hover:text-foreground hover:underline`,search:{channel:n},to:`/native-builds`,children:`This channel's builds`})]})]})}function oi(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function si(e,t){return e-t}function ci(e,t,n){let r=e.slice();return r[t]=n,r.sort(si)}function li(e,t,n,r,i,a){let o=e;return o=U(o,n,r),i&&(o=ci(a,t,U(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function ui(e,t,n){if(!Array.isArray(e))return!0;let r=e.reduce((e,t,n,r)=>(n===r.length-1||e.push(Math.abs(t-r[n+1])),e),[]);return Math.min(...r)>=t*n}var di={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...Ie},fi=X.createContext(void 0);function pi(){let e=X.useContext(fi);if(e===void 0)throw Error(l(62));return e}function mi(e){return`key`in e?A:ne}function hi(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?oi(e,t):!1}var gi=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:h=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:b=`horizontal`,step:x=1,thumbCollisionBehavior:S=`push`,thumbAlignment:T=`center`,value:ee,style:te,...ne}=e,re=M(c),ae=Be(re),oe=D(v),se=D(y),{clearErrors:O}=He(),{state:ce,disabled:k,name:A,setTouched:le,setDirty:ue,validityData:de,shouldValidateOnChange:pe,validation:j}=Ne(),{labelId:me}=Fe(),[he,ge]=X.useState(),P=r??Ve(me,he),F=k||s,I=A??_,[L,ve]=B({controlled:ee,default:o??m,name:`Slider`}),ye=X.useRef(null),be=X.useRef(null),R=X.useRef([]),xe=X.useRef(null),Se=X.useRef(null),Ce=X.useRef(-1),we=X.useRef(null),z=X.useRef(null),Te=X.useRef(`none`),De=fe(l),[V,Oe]=X.useState(-1),[ke,Ae]=X.useState(-1),[je,Me]=X.useState(!1),[Ie,Le]=X.useState(()=>new Map),[Re,ze]=X.useState([void 0,void 0]),H=D(e=>{Oe(e),e!==-1&&Ae(e)});Pe(be,re,L),N(L,()=>{O(I),pe()?j.commit(L):j.commit(L,!0);let e=de.initialValue,t;t=Array.isArray(L)&&Array.isArray(e)?!oi(L,e):L!==e,ue(t)});let Ue=D(e=>{e&&(be.current=e)}),W=Array.isArray(L),G=X.useMemo(()=>W?L.slice().sort(si):[U(L,m,p)],[p,m,W,L]),We=D((e,t)=>{if(Number.isNaN(e)||hi(e,L))return;let n=t??E(`none`,void 0,void 0,{activeThumbIndex:-1});Te.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:I}}),n.event=i,z.current=e,oe(e,n),!n.isCanceled&&ve(e)}),Ge=D((e,t,n)=>{let r=li(e,t,m,p,W,G);if(ui(r,x,h)){let e=mi(n);We(r,E(e,n.nativeEvent,void 0,{activeThumbIndex:t})),le(!0),se(z.current??r,w(e,n.nativeEvent))}});C(()=>{let e=_e(a(ye.current));F&&ie(ye.current,e)&&e.blur()},[F]),F&&V!==-1&&H(-1);let Ke=X.useMemo(()=>({...ce,activeThumbIndex:V,disabled:F,dragging:je,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:G}),[ce,V,F,je,p,m,h,b,x,G]),qe=X.useMemo(()=>({active:V,controlRef:be,disabled:F,dragging:je,validation:j,formatOptionsRef:De,handleInputChange:Ge,indicatorPosition:Re,inset:T!==`center`,labelId:P,rootLabelId:ae,largeStep:u,lastUsedThumbIndex:ke,lastChangedValueRef:z,lastChangeReasonRef:Te,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:I,onValueCommitted:se,orientation:b,pressedInputRef:xe,pressedThumbCenterOffsetRef:Se,pressedThumbIndexRef:Ce,pressedValuesRef:we,registerFieldControlRef:Ue,renderBeforeHydration:T===`edge`,setActive:H,setDragging:Me,setIndicatorPosition:ze,setLabelId:ge,setValue:We,state:Ke,step:x,thumbCollisionBehavior:S,thumbMap:Ie,thumbRefs:R,values:G}),[V,be,P,ae,F,je,j,De,Ge,Re,u,ke,z,Te,g,d,p,m,h,I,se,b,xe,Se,Ce,we,Ue,H,Me,ze,ge,We,Ke,x,S,T,Ie,R,G]),Je=n(`div`,e,{state:Ke,ref:[t,ye],props:[{"aria-labelledby":P,id:re,role:`group`},j.getValidationProps,ne],stateAttributesMapping:di});return(0,Z.jsx)(fi.Provider,{value:qe,children:(0,Z.jsx)(Ee,{elementsRef:R,onMapChange:Le,children:Je})})});function _i(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function vi(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function yi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(vi(t),vi(n))))}function bi({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=U(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=U(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=U(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function xi({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=U(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=bi({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=U(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:bi({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=U(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var Si=2;function Ci(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function wi(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var Ti=X.forwardRef(function(e,r){let{render:i,className:o,style:s,...c}=e,{disabled:l,dragging:f,inset:p,lastChangedValueRef:m,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:C,pressedValuesRef:T,registerFieldControlRef:ee,renderBeforeHydration:te,setActive:ne,setDragging:re,setValue:oe,state:se,step:O,thumbCollisionBehavior:ce,thumbRefs:k,values:A}=pi(),de=le(),pe=A.length>1,j=b===`vertical`,M=X.useRef(null),he=X.useRef(null),ge=D(e=>{e&&he.current==null&&(he.current=t(e).getComputedStyle(e))}),N=X.useRef(null),F=X.useRef(0),I=X.useRef(0),L=fe(A);function ve(e){C.current!==e&&(C.current=e);let t=k.current[e];if(!t){S.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function ye(e){let t=M.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=Ci(he.current,j),c=I.current,l=(j?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=U(((j?i-f-s.end:(de===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=yi(m,O,_),m=U(m,_,g),!pe)return{value:m,thumbIndex:0,didSwap:!1};let h=C.current;if(h<0)return null;let y=xi({behavior:ce,values:A,currentValues:L.current??A,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:O,minStepsBetweenValues:v});return ce===`swap`&&y.didSwap?ve(y.thumbIndex):C.current=y.thumbIndex,y}function be(e){T.current=pe?A.slice():null,L.current=A;let t=C.current,n=t;if(t>-1&&t<A.length){if(A[t]===g){let e=t;for(;e>0&&A[e-1]===g;)--e;n=e}}else{let t=j?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(ae(a)){let o=_i(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&ve(n),p){let e=k.current[n];ae(e)&&(I.current=e.getBoundingClientRect()[j?`height`:`width`]/2)}}function R(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let xe=D(e=>{let t=wi(e,N);if(t==null)return;if(F.current+=1,e.type===`pointermove`&&e.buttons===0){Se(e);return}let n=ye(t);n!=null&&ui(n.value,O,v)&&(!f&&F.current>Si&&re(!0),oe(n.value,E(me,e,void 0,{activeThumbIndex:n.thumbIndex})),L.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&R(n.thumbIndex))});function Se(e){ne(-1),re(!1),x.current=null,S.current=null;let t=wi(e,N),n=t==null?null:ye(t);if(n!=null){let t=h.current;y(m.current??n.value,w(t,e))}`pointerType`in e&&M.current?.hasPointerCapture(e.pointerId)&&M.current?.releasePointerCapture(e.pointerId),C.current=-1,N.current=null,T.current=null,we()}let Ce=D(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(N.current=t.identifier);let n=wi(e,N);if(n!=null){be(n);let t=ye(n);if(t==null)return;R(t.thumbIndex),oe(t.value,E(ue,e,void 0,{activeThumbIndex:t.thumbIndex})),L.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&R(t.thumbIndex)}F.current=0;let r=a(M.current);r.addEventListener(`touchmove`,xe,{passive:!0}),r.addEventListener(`touchend`,Se,{passive:!0})}),we=D(()=>{let e=a(M.current);e.removeEventListener(`pointermove`,xe),e.removeEventListener(`pointerup`,Se),e.removeEventListener(`touchmove`,xe),e.removeEventListener(`touchend`,Se),T.current=null}),z=d();return X.useEffect(()=>{let e=M.current;if(!e)return()=>we();let t=u(e,`touchstart`,Ce,{passive:!0});return()=>{t(),z.cancel(),we()}},[we,Ce,M,z]),X.useEffect(()=>{l&&we()},[l,we]),n(`div`,e,{state:se,ref:[r,ee,M,ge],props:[{"data-base-ui-slider-control":te?``:void 0,onPointerDown(e){let t=M.current,n=P(e.nativeEvent);if(!t||l||e.defaultPrevented||!ae(n)||e.button!==0)return;let r=wi(e,N);if(r!=null){be(r);let n=ye(r);if(n==null)return;ie(k.current[n.thumbIndex],_e(a(t)))?e.preventDefault():z.request(()=>{R(n.thumbIndex)}),re(!0),S.current??(oe(n.value,E(ue,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),L.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&R(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),F.current=0;let i=a(M.current);i.addEventListener(`pointermove`,xe,{passive:!0}),i.addEventListener(`pointerup`,Se,{once:!0})}},c],stateAttributesMapping:di})}),Ei=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=pi();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:di})}),Di=function(e){return e.index=`data-index`,e.dragging=`data-dragging`,e.orientation=`data-orientation`,e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.focused=`data-focused`,e}({}),Oi=new Set([...f,_,o]);function ki(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${Mn(e[t],r,n)} start range`:`${Mn(e[t],r,n)} end range`:n?Mn(e[t],r,n):void 0}function Ai(e,t,n,r,i){let a=n===1?e+t:e-t;return U(Number(a.toFixed(Math.max(vi(e),vi(t),vi(r)))),r,i)}var ji=X.forwardRef(function(e,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:v=!1,getAriaLabel:y,getAriaValueText:S,id:w,index:E,inputRef:ee,onBlur:te,onFocus:ne,onKeyDown:re,tabIndex:ie,style:ae,...oe}=e,{nonce:se}=Le(),O=M(w),{active:ce,lastUsedThumbIndex:k,controlRef:A,disabled:ue,validation:de,formatOptionsRef:fe,handleInputChange:pe,inset:j,labelId:me,largeStep:he,locale:N,max:P,min:F,minStepsBetweenValues:_e,form:I,name:L,orientation:ve,pressedInputRef:ye,pressedThumbCenterOffsetRef:be,pressedThumbIndexRef:R,renderBeforeHydration:xe,setActive:Se,setIndicatorPosition:Ce,state:we,step:z,values:B}=pi(),Ee=le(),De=v||ue,V=B.length>1,Oe=ve===`vertical`,ke=Ee===`rtl`,{setTouched:Ae,setFocused:je,validationMode:Me}=Ne(),Pe=X.useRef(null),Fe=X.useRef(null),Ie=X.useRef(!1),ze=M(),Be=Re(),Ve=V?ze:Be,{ref:He,index:H}=Te({metadata:X.useMemo(()=>({inputId:Ve}),[Ve])}),U=V?E??H:0,Ue=U===B.length-1,W=B[U],G=Nn(W,F,P),[We,Ge]=X.useState(),Ke=Hn(),qe=k>=0&&k<B.length?k:-1,Je=D(()=>{let e=A.current,t=Pe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Oe?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*G/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ge(s),U===0?Ce(e=>[s,e[1]]):Ue&&Ce(e=>[e[0],s])});C(()=>{j&&queueMicrotask(Je)},[Je,j]),C(()=>{j&&Je()},[Je,j,G]),C(()=>{if(!j)return;let e=A.current,n=Pe.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Je);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[A,Je,j]);let Ye=Oe?`bottom`:`insetInlineStart`,Xe=Oe?`left`:`top`,Ze;V?ce===U?Ze=2:qe===U&&(Ze=1):ce===U&&(Ze=1);let Qe;Qe=j?{"--position":`${We??0}%`,visibility:xe&&Ke||We===void 0?`hidden`:void 0,position:`absolute`,[Ye]:`var(--position)`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:Number.isFinite(G)?{position:`absolute`,[Ye]:`${G}%`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:b;let $e;ve===`vertical`&&($e=ke?`vertical-rl`:`vertical-lr`);let et=typeof y==`function`?y(U):d,tt=T({"aria-label":et,"aria-labelledby":p??(et==null?me:void 0),"aria-describedby":u,"aria-orientation":ve,"aria-valuenow":W,"aria-valuetext":typeof S==`function`?S(Mn(W,N,fe.current??void 0),W,U):ki(B,U,fe.current??void 0,N),disabled:De,form:I,id:Ve,max:P,min:F,name:L,onChange(e){pe(e.currentTarget.valueAsNumber,U,e)},onFocus(e){let t=Ie.current;Ie.current=!1,Se(U),je(!0),t&&e.stopPropagation()},onBlur(e){if(Ie.current){e.stopPropagation();return}Pe.current&&(Se(-1),Ae(!0),je(!1),Me===`onBlur`&&de.commit(li(W,U,F,P,V,B)))},onKeyDown(e){if(!Oi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=yi(W,z,F);switch(e.key){case s:t=Ai(n,e.shiftKey?he:z,1,F,P);break;case r:t=Ai(n,e.shiftKey?he:z,ke?-1:1,F,P);break;case m:t=Ai(n,e.shiftKey?he:z,-1,F,P);break;case h:t=Ai(n,e.shiftKey?he:z,ke?1:-1,F,P);break;case _:t=Ai(n,he,1,F,P);break;case o:t=Ai(n,he,-1,F,P);break;case`End`:t=P,V&&(t=Number.isFinite(B[U+1])?B[U+1]-z*_e:P);break;case g:t=F,V&&(t=Number.isFinite(B[U-1])?B[U-1]+z*_e:F);break;default:break}if(t!==null){let n=e.currentTarget;ge(n)||(Ie.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),pe(t,U,e),e.preventDefault()}},step:z,style:{...b,width:`100%`,height:`100%`,writingMode:$e},tabIndex:ie??void 0,type:`range`,value:W??``},de.getInputValidationProps),nt=x(Fe,de.inputRef,ee);return n(`div`,e,{state:we,ref:[i,He,Pe],props:[{[Di.index]:U,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:nt,...tt,suppressHydrationWarning:!0}),j&&Ke&&xe&&Ue&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:O,onBlur:te,onFocus:ne,onPointerDown(e){if(R.current=U,Pe.current!=null){let t=ve===`horizontal`?`x`:`y`,n=_i(Pe.current);be.current=(ve===`horizontal`?e.clientX:e.clientY)-n[t]}Fe.current!=null&&ye.current!==Fe.current&&(ye.current=Fe.current)},style:Qe,suppressHydrationWarning:xe||void 0},oe],stateAttributesMapping:di})});function Mi(e,t,n,r,i,a){let o=n===void 0||t&&r===void 0?`hidden`:void 0,s=e?`bottom`:`insetInlineStart`,c=e?`height`:`width`,l={visibility:i&&a?`hidden`:o,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};return l[`--start-position`]=`${n??0}%`,t?(l[`--relative-size`]=`${(r??0)-(n??0)}%`,l[s]=`var(--start-position)`,l[c]=`var(--relative-size)`,l):(l[s]=0,l[c]=`var(--start-position)`,l)}function Ni(e,t,n,r){let i=e?`bottom`:`insetInlineStart`,a=e?`height`:`width`,o={position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`};if(!t)return o[i]=0,o[a]=`${n}%`,o;let s=r-n;return o[i]=`${n}%`,o[a]=`${s}%`,o}var Pi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=pi(),h=Hn(),g=d===`vertical`,_=m.length>1,v=c?Mi(g,_,s[0],s[1],f,h):Ni(g,_,Nn(m[0],u,l),Nn(m[m.length-1],u,l));return n(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:di})});function Fi({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(gi,{className:p(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(Ti,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(Ei,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(Pi,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(ji,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ii=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Li=e=>({enabled:e.enabled,message:e.message??``,rolloutCohortCount:e.rollout_cohort_count,shouldForceUpdate:e.should_force_update,targetAppVersion:e.target_app_version??``,targetCohorts:[...e.target_cohorts]}),Ri=(e,t)=>({enabled:t.enabled,message:t.message.trim()||null,rolloutCohortCount:t.rolloutCohortCount,shouldForceUpdate:t.shouldForceUpdate,...e.strategy===`APP_VERSION`?{targetAppVersion:t.targetAppVersion.trim()}:{},targetCohorts:t.targetCohorts}),zi=e=>(e/10).toFixed(1),Bi=e=>{let t=e.replace(`,`,`.`),[n=``,...r]=t.split(`.`),i=n.replace(/\D/g,``).slice(0,3),a=r.join(``).replace(/\D/g,``).slice(0,1);return t.includes(`.`)?`${i}.${a}`:i},Vi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Hi({value:e,onChange:t}){let[n,r]=(0,X.useState)(zi(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(zi(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Fi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(st,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(rt,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Vi(n)??e;a(!1),r(zi(i)),t(i)},onChange:e=>{let n=Bi(e.target.value);r(n);let i=Vi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(it,{align:`inline-end`,children:(0,Z.jsx)(nt,{children:`%`})})]})]})}function Ui({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=nn(o),c=s.data,l=ln(c?.bundle_id??``),u=l.data,d=u?xt(u):null,f=fn(c?.scope_key??``),p=$t(),m=an(),h=rn(),g=en(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[T,E]=(0,X.useState)(!1),[D,ne]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(``),[O,ce]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?Li(c):null),S(``)},[c]);let k=c?Li(c):null,A=_!==null&&k!==null&&JSON.stringify(_)!==JSON.stringify(k),le=m.isPending||p.isPending||h.isPending||g.isPending,ue=()=>{if(!le){if(A){w(!0);return}n(!1)}},de=()=>{if(!_)return;let e=wt(y);if(!St(e)){S(Tt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},fe=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(wt);if(e.some(e=>!St(e))){S(Tt);return}if(c.strategy===`APP_VERSION`&&!ei(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ri(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),q.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},j=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,me=t.filter(e=>e.id!==c?.channel_id),M=me.map(e=>({label:e.name,value:e.name})),ge=ie.trim(),N=O===`copy`,P=_?ei(_.targetAppVersion.trim()):null,_e=()=>{ae(``),ce(`move`)},I=e=>{!e&&g.isPending||(ne(e),e||_e())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(se,{onOpenChange:e=>e?void 0:ue(),open:a,children:(0,Z.jsxs)(te,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(F,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(re,{children:`Bundle Detail`}),(0,Z.jsx)(he,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(zt,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(yn,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:j})]}),j?(0,Z.jsx)(ai,{bundle:u,channel:j,release:c}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(pt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(ft,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[j?(0,Z.jsx)(ye,{release:{platform:c.platform,channel:j,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Yt,{className:`gap-6`,children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(at,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ee,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),P?(0,Z.jsx)(Xt,{children:P}):null]}):null,(0,Z.jsx)(Qt,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(qt,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(ht,{label:`About Enabled`,children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsx)(ut,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(Qt,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(qt,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(ht,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(ut,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Hi,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(Qt,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(qt,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(ii,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ee,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),de())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:de,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(et,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(K,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(pe,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Xt,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Zt,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!A||le,onClick:fe,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(oe,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(i,{className:`w-full`,disabled:!c.bundle_id||le,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:le,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),q.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Ke,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||le,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(pt,{variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Build details are unavailable`}),(0,Z.jsx)(ft,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(ni,{bundle:u,release:c}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:d})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.scope_key}),r?(0,Z.jsx)(i,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(Lt,{onOpenChange:w,open:C,children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsx)(Mt,{children:`Discard unsaved changes?`}),(0,Z.jsx)(At,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{children:`Keep editing`}),(0,Z.jsx)(Nt,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(Lt,{onOpenChange:E,open:T,children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsxs)(Mt,{children:[`Remove this Bundle from `,j??`the channel`,`?`]}),(0,Z.jsx)(At,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{children:`Cancel`}),(0,Z.jsx)(Nt,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),q.success(`Bundle removed from ${j??`the channel`}`),E(!1),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Kt,{onOpenChange:I,open:D,children:(0,Z.jsxs)(Ht,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsx)(Ut,{children:`Promote to Channel`}),(0,Z.jsx)(Wt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Jt,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(We,{disabled:g.isPending,items:Ii,onValueChange:e=>ce(e),value:O,children:[(0,Z.jsx)(ze,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(W,{placeholder:`Select an action`})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(H,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:N?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Jt,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(We,{disabled:g.isPending,items:M,onValueChange:e=>ae(e??``),value:ie||null,children:[(0,Z.jsx)(ze,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(W,{placeholder:`Select a channel`})}),(0,Z.jsx)(Ue,{className:`max-h-64`,children:(0,Z.jsx)(G,{children:me.map(e=>(0,Z.jsx)(H,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Vt,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>I(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!ge||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:O,expectedRevision:c.revision,releaseId:c.id,targetChannel:ge}),I(!1),q.success(N?`Bundle copied to ${ge}`:`Bundle moved to ${ge}`)}catch(e){q.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?N?`Copying…`:`Moving…`:N?`Copy`:`Move`})]})]})})]})}function Wi({release:e}){return(0,Z.jsxs)(K,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(we,{className:`size-3`}):(0,Z.jsx)(Ge,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}var Gi=20,Ki=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],qi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}];function Ji({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=R(a),s=a.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(de,{className:`-ml-1 size-11 lg:size-7`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(Pn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(We,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(ze,{"aria-label":`Channel`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 sm:w-[140px] sm:data-[size=default]:h-8`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(H,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(We,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(ze,{"aria-label":`Platform`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:data-[size=default]:h-8`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`ios`,children:`iOS`}),(0,Z.jsx)(H,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(We,{disabled:!s&&a.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(ze,{"aria-label":`Status`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:data-[size=default]:h-8`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ue,{children:(0,Z.jsxs)(G,{children:[(0,Z.jsx)(H,{value:`all`,children:`Any Status`}),(0,Z.jsx)(H,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(H,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(i,{"aria-label":`Manage channels`,className:`size-11 max-sm:order-1 sm:size-7`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(Ln,{})}),a.bundleId?(0,Z.jsxs)(K,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(pe,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(K,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(pe,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(i,{className:`h-11 px-2 text-xs text-muted-foreground hover:text-foreground max-sm:order-3 sm:ml-auto sm:h-8`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(pe,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Yi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let a=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(i,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-11 shrink-0 touch-manipulation sm:size-8`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(z,{}):(0,Z.jsx)(Me,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-11 shrink-0 sm:size-8`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(yn,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(ot,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(Ge,{className:`size-3.5`}),`Unreachable`]}):null]})}function Xi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=ln(i),o=sn(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(Wn,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function Zi(){let e=Ce.useSearch(),t=Ce.useNavigate(),n=O(),[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),l=pn({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:xe(e),limit:Gi}),u=on().data??[],d=l.data?.data??[],f=dn(Array.from(new Set(d.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},m=l.data?.next,h=l.data?.previous,g=d.flatMap(e=>{let t=u.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),_=Se(),v=10+_.length,y=new Map(u.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!d.some(e=>e.id===o)&&s(void 0)},[o,d]);let b=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),x=t=>b(be(e,t)),S=t=>{let n=d.find(e=>e.bundle_id===t.id);if(s(void 0),n){b({...e,releaseId:n.id},!1);return}x({bundleId:t.id})},C=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,w=h?{...e,afterReleaseId:h,beforeReleaseId:void 0,releaseId:void 0}:null,T=m?{...e,afterReleaseId:void 0,beforeReleaseId:m,releaseId:void 0}:null,E={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0},ee=(0,Z.jsx)(Dn,{icon:tt,title:C?`No more bundles`:R(e)?`No bundles match these filters`:`No bundles yet`,children:C?(0,Z.jsx)(I,{className:c({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:E,to:`/`,children:`Show the newest bundles`}):R(e)?(0,Z.jsx)(i,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>b({}),variant:`outline`,children:`Clear filters`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:`Deploy one from your app's project:`}),(0,Z.jsx)(`div`,{className:`w-full text-left`,children:(0,Z.jsx)(V,{label:`the deploy command`,value:`npx hot-updater deploy`,wrap:!0})})]})});return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(Ji,{channels:u,onChange:x,onClear:()=>b({}),onManageChannels:()=>a(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[l.isError?(0,Z.jsxs)(pt,{variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Bundles could not be loaded`}),(0,Z.jsx)(ft,{children:l.error.message})]}):(0,Z.jsx)(kn,{children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:l.isPending?(0,Z.jsx)(On,{}):d.length?d.map(t=>{let n=y.get(t.channel_id)??t.channel_id,r=t.bundle_id?f[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(En,{"aria-label":`Bundle ${t.id}`,className:p(`gap-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:Cn(()=>b({...e,releaseId:t.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Yi,{expanded:i,onOpen:()=>b({...e,releaseId:t.id},!1),onToggleExpand:()=>s(i?void 0:t.id),release:t}),(0,Z.jsx)(De,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-foreground`,children:[(0,Z.jsx)(zt,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]}),r===void 0||r>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(`span`,{children:r===void 0?`Checking patches`:`${r} ${r===1?`patch`:`patches`}`})]}):null,(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(An,{ms:t.created_at_ms})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-xs`,children:[(0,Z.jsx)(Ze,{percentage:t.rollout_cohort_count/10}),(0,Z.jsx)(Wi,{release:t}),t.should_force_update?(0,Z.jsx)(K,{variant:`secondary`,children:`Force update`}):null,(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:`Target `}),(0,Z.jsx)(Ae,{appVersion:t.target_app_version,fingerprintHash:t.fingerprint_hash})]})]}),_.map(({Cell:e,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`mt-3 text-xs`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:r}),(0,Z.jsx)(e,{releaseId:t.id,releases:g})]},n)),t.message?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.message}):null]}),i&&t.bundle_id?(0,Z.jsx)(Xi,{onDetailClick:S,panelId:a,release:t}):null]},t.id)}):(0,Z.jsx)(wn,{children:ee})}):(0,Z.jsxs)(bn,{header:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),_.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]}),children:[l.isPending?(0,Z.jsx)(Sn,{columns:v}):d.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(jn,{"aria-label":`Open bundle ${t.id}`,className:p(t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onOpen:()=>b({...e,releaseId:t.id},!1),children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Yi,{expanded:n,onOpen:()=>b({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(De,{channel:y.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsx)(Rt,{platform:t.platform})}),(0,Z.jsx)(Y,{children:t.bundle_id&&f[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&f[t.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[f[t.bundle_id],` `,f[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Ae,{appVersion:t.target_app_version,fingerprintHash:t.fingerprint_hash})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Un,{enabled:t.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Un,{enabled:t.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Ze,{percentage:t.rollout_cohort_count/10})}),_.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:g})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(An,{ms:t.created_at_ms})})]}),n&&t.bundle_id?(0,Z.jsx)(_n,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:v,children:(0,Z.jsx)(Xi,{onDetailClick:S,panelId:r,release:t})})}):null]},t.id)}),!l.isPending&&d.length===0?(0,Z.jsx)(xn,{columns:v,children:ee}):null]})}),!l.isError&&!l.isPending?(0,Z.jsx)(Tn,{count:d.length,label:`Bundle pagination`,pending:l.isPlaceholderData,newest:C?{search:E,to:`/`}:void 0,next:T?{search:T,to:`/`}:void 0,previous:w?{search:w,to:`/`}:void 0}):null]}),(0,Z.jsx)(Ui,{channels:u,onOpenChange:t=>!t&&b({...e,releaseId:void 0},!1),onShowScope:e=>x({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(Gn,{onOpenChange:a,open:r})]})}export{Zi as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-
|
|
2
|
-
import{$ as e,Gr as t,In as n,Ln as r,Vr as i,Wr as a,ar as o,et as s,ir as c,nr as l}from"./sidebar-Di9SN47G.js";import{t as u}from"./link-DTEyW70e.js";import{n as d,r as f,t as p}from"./preload-helper-B44EvKhG.js";import{a as m,i as h,o as g}from"./console-features-api-DEXSwFtc.js";import{_,m as v,s as ee,x as y}from"./insights-api-BVCXJsoV.js";import{t as b}from"./key-round-DzBe6DHr.js";import{a as x}from"./switch-CP6GsHmN.js";import{n as S,o as C}from"./insights-search-CYPrQVUC.js";import{a as w,i as T,n as E,o as D,t as O}from"./card-ulgg5xHn.js";var k=c(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),A=a(),j={apiKeys:{navigation:{icon:(0,A.jsx)(b,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(u,{to:`/api-keys`,onClick:e})}}},M=i({method:`GET`}).middleware([l]).handler(t(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return o({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(C,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:n=!1,input:i,variant:a=`inline`}){if(!t)return n?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:I(t),c=(0,A.jsx)(`dl`,{className:r(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:n,color:i})=>(0,A.jsxs)(`div`,{className:r(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsxs)(`dd`,{className:r(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[n]>0&&!(n===`downloads`&&o)?i:`text-muted-foreground`),children:[n===`downloads`&&o?(0,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):t[n].toLocaleString(),n===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},n))});return(0,A.jsxs)(`div`,{className:r(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,A.jsx)(u,{className:`relative min-w-0 rounded-sm after:absolute after:inset-x-0 after:-inset-y-3 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,to:`/insights`,search:{platform:i.platform,channel:i.channel,releaseId:i.releaseId,bundleWindow:S(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let n=ee({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),i=n.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:r(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,_(v(i)),`)`]})]})]})}):n.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(C,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let t=N([e]);return(0,A.jsxs)(O,{children:[(0,A.jsxs)(w,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(D,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(E,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:e,loading:t.isFetching,report:t.data?.[e.releaseId]}),(0,A.jsx)(s,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(T,{className:`px-4 pb-4`,children:(0,A.jsxs)(u,{className:n({variant:`outline`,size:`sm`}),to:`/insights`,search:{platform:e.platform,channel:e.channel,releaseId:e.releaseId,bundleWindow:S(e.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return h(`insightsAnalytics`)?null:(0,A.jsxs)(O,{children:[(0,A.jsx)(w,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(D,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(E,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(u,{to:`/insights`,onClick:t}):(0,A.jsx)(u,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(x,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(u,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(g),J=()=>{let e=m().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:g[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:Z(e.releaseId),scopeKey:a}}function $(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function te(e){return $(e).kind!==`all`}function ne(e,t){let n={...e,...t};return t.bundleId?Q({bundleId:n.bundleId}):t.scopeKey?Q({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Q({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Q({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var re=f(`/`)({component:d(()=>p(()=>import(`./routes-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-BLTF7nwe.js","assets/sidebar-Di9SN47G.js","assets/alert-dialog-DiRLrFVe.js","assets/select-CBIU0_M1.js","assets/useCompositeListItem-JmyDfo3-.js","assets/check-CXVR3s3X.js","assets/switch-CP6GsHmN.js","assets/valueToPercent-B6X9rUJM.js","assets/link-DTEyW70e.js","assets/arrow-right-CNII8TYn.js","assets/arrow-up-right-DK8Zdg40.js","assets/TargetDisplay-DwOaMOiI.js","assets/copy-DsuLj3oj.js","assets/HashValueDisplay-MoZMmTeP.js","assets/dist-Bf1BPKMs.js","assets/key-round-DzBe6DHr.js","assets/package-ytYrywZH.js","assets/badge-D0NFvUY5.js","assets/uuidv7-cI6C63Fm.js","assets/chevron-right-BoUXo82O.js","assets/circle-off-C7Muo0ss.js","assets/RolloutPercentageBadge-G6qt8rVb.js","assets/relativeTime-DvyxGIsm.js","assets/list-B6GeoQ_b.js","assets/plus-BVhOauU3.js","assets/input-group-D_NfhUbX.js","assets/BundleIdDisplay-CP6rsdFO.js","assets/RelativeTime-TCmpOVPg.js","assets/table-TUtVz-2l.js","assets/insights-search-CYPrQVUC.js","assets/insights-api-BVCXJsoV.js","assets/useInfiniteQuery-DX4WpBRG.js","assets/PlatformIcon-CJ69KopR.js","assets/card-ulgg5xHn.js","assets/dialog-CLIaC82_.js","assets/field-q4sTYzNU.js","assets/api-LQJH44FU.js","assets/useMutation-DbYw7boA.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,Gr as t,In as n,Ln as r,Vr as i,Wr as a,ar as o,et as s,ir as c,nr as l}from"./sidebar-Di9SN47G.js";import{t as u}from"./link-DTEyW70e.js";import{n as d,r as f,t as p}from"./preload-helper-B44EvKhG.js";import{a as m,i as h,o as g}from"./console-features-api-DEXSwFtc.js";import{_,m as v,s as ee,x as y}from"./insights-api-BVCXJsoV.js";import{t as b}from"./key-round-DzBe6DHr.js";import{a as x}from"./switch-CP6GsHmN.js";import{n as S,o as C}from"./insights-search-CYPrQVUC.js";import{a as w,i as T,n as E,o as D,t as O}from"./card-ulgg5xHn.js";var k=c(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),A=a(),j={apiKeys:{navigation:{icon:(0,A.jsx)(b,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(u,{to:`/api-keys`,onClick:e})}}},M=i({method:`GET`}).middleware([l]).handler(t(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return o({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(C,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:n=!1,input:i,variant:a=`inline`}){if(!t)return n?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:I(t),c=(0,A.jsx)(`dl`,{className:r(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:n,color:i})=>(0,A.jsxs)(`div`,{className:r(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsxs)(`dd`,{className:r(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[n]>0&&!(n===`downloads`&&o)?i:`text-muted-foreground`),children:[n===`downloads`&&o?(0,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):t[n].toLocaleString(),n===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},n))});return(0,A.jsxs)(`div`,{className:r(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,A.jsx)(u,{className:`relative min-w-0 rounded-sm after:absolute after:inset-x-0 after:-inset-y-3 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,to:`/insights`,search:{platform:i.platform,channel:i.channel,releaseId:i.releaseId,bundleWindow:S(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let n=ee({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),i=n.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:r(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,_(v(i)),`)`]})]})]})}):n.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(C,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let t=N([e]);return(0,A.jsxs)(O,{children:[(0,A.jsxs)(w,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(D,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(E,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:e,loading:t.isFetching,report:t.data?.[e.releaseId]}),(0,A.jsx)(s,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(T,{className:`px-4 pb-4`,children:(0,A.jsxs)(u,{className:n({variant:`outline`,size:`sm`}),to:`/insights`,search:{platform:e.platform,channel:e.channel,releaseId:e.releaseId,bundleWindow:S(e.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return h(`insightsAnalytics`)?null:(0,A.jsxs)(O,{children:[(0,A.jsx)(w,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(D,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(E,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(u,{to:`/insights`,onClick:t}):(0,A.jsx)(u,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(x,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(u,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(g),J=()=>{let e=m().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:g[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:Z(e.releaseId),scopeKey:a}}function $(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function te(e){return $(e).kind!==`all`}function ne(e,t){let n={...e,...t};return t.bundleId?Q({bundleId:n.bundleId}):t.scopeKey?Q({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Q({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Q({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var re=f(`/`)({component:d(()=>p(()=>import(`./routes-BLTF7nwe.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])),`component`),validateSearch:Q});export{X as a,ne as i,te as n,J as o,$ as r,Y as s,re as t};
|