@hot-updater/console 1.2.0-rc.50 → 1.2.0-rc.52

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.
Files changed (130) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/BundleIdDisplay-CtbmyR7f.js +1 -0
  3. package/.output/public/assets/{FoldedRows-1NvB9gAS.js → FoldedRows-ClHLI-NM.js} +1 -1
  4. package/.output/public/assets/{IosInstall-BRuSakxm.js → IosInstall-1a_GRSNg.js} +1 -1
  5. package/.output/public/assets/{RelativeTime-m-FKh1Jb.js → RelativeTime-BQErgQRj.js} +1 -1
  6. package/.output/public/assets/{TargetDisplay-Ctuz3qIp.js → TargetDisplay-D0dVdFCk.js} +1 -1
  7. package/.output/public/assets/{index-oTXLdUR-.js → index-B8BpJ73Y.js} +2 -2
  8. package/.output/public/assets/{insights-BL6Z8zFv.js → insights-BrdBpqda.js} +2 -2
  9. package/.output/public/assets/{insights-BMjBMtJU.js → insights-DsmTCDix.js} +2 -2
  10. package/.output/public/assets/{insights_.distribution-C4E-JuVI.js → insights_.distribution-BHmK7ufZ.js} +1 -1
  11. package/.output/public/assets/{insights_.distribution-Br_CW9s9.js → insights_.distribution-BNNw0whH.js} +2 -2
  12. package/.output/public/assets/native-builds-B6t0ZxKP.js +1 -0
  13. package/.output/public/assets/{native-builds-BC0sjxPC.js → native-builds-CgPSpNsA.js} +2 -2
  14. package/.output/public/assets/native-builds-TF9BhYrQ.js +1 -0
  15. package/.output/public/assets/{native-builds_._buildId-GPlkI_2m.js → native-builds_._buildId-2rPrtz9-.js} +2 -2
  16. package/.output/public/assets/native-builds_._buildId-BqUOY1Az.js +1 -0
  17. package/.output/public/assets/{native-builds_.devices-Cox001IR.js → native-builds_.devices-B9kLHngv.js} +2 -2
  18. package/.output/public/assets/{native-builds_.devices-DAW19hcQ.js → native-builds_.devices-COFYZcaA.js} +1 -1
  19. package/.output/public/assets/{routes-C7Pv3Cfg.js → routes-DMooqgLf.js} +1 -1
  20. package/.output/public/assets/{routes-JJGRGqsf.js → routes-Z2IGj8MK.js} +2 -2
  21. package/.output/server/{__23tanstack-start-server-fn-resolver-DY-niJR4.mjs → __23tanstack-start-server-fn-resolver-5-sH58Zz.mjs} +58 -58
  22. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
  23. package/.output/server/_libs/_.mjs +1 -1
  24. package/.output/server/_ssr/BundleIdDisplay-BckrkdA8.mjs +26 -0
  25. package/.output/server/_ssr/{ChannelPicker-J5HfKxSS.mjs → ChannelPicker-D6t_05Qj.mjs} +4 -4
  26. package/.output/server/_ssr/{ConsoleFeatureUnavailable-C52o4oew.mjs → ConsoleFeatureUnavailable-DO9N_oMb.mjs} +6 -6
  27. package/.output/server/_ssr/{EventDetails-CDLSkVNA.mjs → EventDetails-eHJBruoj.mjs} +6 -6
  28. package/.output/server/_ssr/{FoldedRows-CrRYEVkd.mjs → FoldedRows-CVbAvnm9.mjs} +4 -4
  29. package/.output/server/_ssr/{HashValueDisplay-BrT2wgxk.mjs → HashValueDisplay-B8AYphB-.mjs} +2 -2
  30. package/.output/server/_ssr/{InsightsPageHeader-DVrudLMJ.mjs → InsightsPageHeader-BFzDTBgX.mjs} +6 -6
  31. package/.output/server/_ssr/{IosInstall-DcKlZU_q.mjs → IosInstall-BlvkrktH.mjs} +8 -8
  32. package/.output/server/_ssr/{NativeBuildsNav-BC1WIQ1W.mjs → NativeBuildsNav-AfTTpjkh.mjs} +3 -3
  33. package/.output/server/_ssr/{NotFoundPage-CEhZtcst.mjs → NotFoundPage-r-7WnJzQ.mjs} +2 -2
  34. package/.output/server/_ssr/{QrCode-Dj9BKV3l.mjs → QrCode-DEZJJw2v.mjs} +2 -2
  35. package/.output/server/_ssr/{RelativeTime-Dgbh4UPb.mjs → RelativeTime-D31YzeJa.mjs} +3 -3
  36. package/.output/server/_ssr/{RolloutPercentageBadge-BYEDUW1d.mjs → RolloutPercentageBadge-DGQCzLwL.mjs} +3 -3
  37. package/.output/server/_ssr/{RowReason-BweNBWkA.mjs → RowReason-XXsqcV8M.mjs} +3 -3
  38. package/.output/server/_ssr/{SandboxBadge-O8-kbXAw.mjs → SandboxBadge-Dsbfs84l.mjs} +2 -2
  39. package/.output/server/_ssr/{TargetDisplay-D3JAXwcF.mjs → TargetDisplay-Cnnda7gi.mjs} +3 -3
  40. package/.output/server/_ssr/{alert-dialog-CxEcyUb6.mjs → alert-dialog-CeW-6rPj.mjs} +1 -1
  41. package/.output/server/_ssr/{api-IIqxWeDx.mjs → api-BCfNV622.mjs} +4 -4
  42. package/.output/server/_ssr/{api-keys-wFak2vKN.mjs → api-keys-D41INr2x.mjs} +9 -9
  43. package/.output/server/_ssr/{api-keys-CYefExfc.mjs → api-keys-Pl9fE3ov.mjs} +2 -2
  44. package/.output/server/_ssr/{api-keys-rpc-qkGQ3Sp3.mjs → api-keys-rpc-Dc63Z5sL.mjs} +3 -3
  45. package/.output/server/_ssr/{api-rpc-3NKc545A.mjs → api-rpc-CBxVNmSb.mjs} +16 -16
  46. package/.output/server/_ssr/{auth-rpc-PCSJzNJf.mjs → auth-rpc-DUiSq0md.mjs} +4 -4
  47. package/.output/server/_ssr/{auth.server-NGj7G3bq.mjs → auth.server-COR78Byc.mjs} +532 -31
  48. package/.output/server/_ssr/{badge-CxSJ-pjU.mjs → badge-jJUdKmgf.mjs} +1 -1
  49. package/.output/server/_ssr/{card-BDXDcrk_.mjs → card-lbRho9mB.mjs} +1 -1
  50. package/.output/server/_ssr/{config.server-CwUGPk-F.mjs → config.server-C72Rcb2P.mjs} +3 -3
  51. package/.output/server/_ssr/{console-access-BOt-Xxd7.mjs → console-access-B6GCF0Pq.mjs} +2 -2
  52. package/.output/server/_ssr/{console-features-api-Dw_Tktev.mjs → console-features-api-GXe67Tju.mjs} +5 -5
  53. package/.output/server/_ssr/{console-features-rpc-D8VFHwYj.mjs → console-features-rpc-BB8bGBmb.mjs} +3 -3
  54. package/.output/server/_ssr/{databaseRows-BZMFl5QV.mjs → databaseRows-D6bc51Xq.mjs} +3 -2
  55. package/.output/server/_ssr/{dialog-CJ4zMagm.mjs → dialog-DLiITzNb.mjs} +1 -1
  56. package/.output/server/_ssr/{empty-DYy36pwa.mjs → empty-CRonI6yG.mjs} +2 -2
  57. package/.output/server/_ssr/{field-MI8oNc5n.mjs → field-CPlXgkpQ.mjs} +2 -2
  58. package/.output/server/_ssr/{getBundleChildren-CnOf4Frp.mjs → getBundleChildren-DDqsd1pL.mjs} +2 -2
  59. package/.output/server/_ssr/{input-group-Bf7wHa21.mjs → input-group-B0s6OlWV.mjs} +1 -1
  60. package/.output/server/_ssr/{insights-b3XeQlzF.mjs → insights-Bukk9Qg8.mjs} +52 -33
  61. package/.output/server/_ssr/{insights-CbGG5htV.mjs → insights-CVUqkV9I.mjs} +2 -2
  62. package/.output/server/_ssr/{insights-CKTR62Ox.mjs → insights-ToswhUey.mjs} +5 -5
  63. package/.output/server/_ssr/{insights-api-CqjIxe1A.mjs → insights-api-CA17vWZa.mjs} +3 -3
  64. package/.output/server/_ssr/{insights-failures-rpc-fmWHkLhL.mjs → insights-failures-rpc-DQ15P_rm.mjs} +4 -4
  65. package/.output/server/_ssr/{insights-recovery-rpc-BpwoS9XL.mjs → insights-recovery-rpc-CW4mfXig.mjs} +3 -3
  66. package/.output/server/_ssr/{insights-rpc-qwXzuBUQ.mjs → insights-rpc-C4Xpuj96.mjs} +3 -3
  67. package/.output/server/_ssr/{insights-search-B_8PizlM.mjs → insights-search-BULxEDkP.mjs} +2 -2
  68. package/.output/server/_ssr/{insights-usage-rpc-D8lgk1Sk.mjs → insights-usage-rpc-BJXlIwCd.mjs} +3 -3
  69. package/.output/server/_ssr/{insights-usage-rpc-Cbg82l2g.mjs → insights-usage-rpc-BO2bIBYf.mjs} +3 -3
  70. package/.output/server/_ssr/{insights_.distribution-Ed2vqrwP.mjs → insights_.distribution-DRI0VBdO.mjs} +5 -5
  71. package/.output/server/_ssr/{insights_.distribution--XTBM-oT.mjs → insights_.distribution-PeRcluc-.mjs} +14 -14
  72. package/.output/server/_ssr/{insights_.distribution-DTaKryjw.mjs → insights_.distribution-SGWggxSh.mjs} +2 -2
  73. package/.output/server/_ssr/{installations-Ce_9dNq0.mjs → installations-B2QcWG6B.mjs} +2 -2
  74. package/.output/server/_ssr/{installations-W8W7AYwn.mjs → installations-C692ehbS.mjs} +4 -4
  75. package/.output/server/_ssr/{installations-DyfuFp3L.mjs → installations-CJjMPoSX.mjs} +11 -11
  76. package/.output/server/_ssr/{ios-devices-rpc-5kZM1bgU.mjs → ios-devices-rpc-C0ksMG0_.mjs} +7 -7
  77. package/.output/server/_ssr/{iosDeviceCookie-BTfPOUhS.mjs → iosDeviceCookie-D32VPfkD.mjs} +3 -3
  78. package/.output/server/_ssr/{iosDeviceProfile-BAoo32s_.mjs → iosDeviceProfile-Ci_-qRZG.mjs} +3 -3
  79. package/.output/server/_ssr/{iosDevices-DuNmS3td.mjs → iosDevices-Bk-459x2.mjs} +3 -3
  80. package/.output/server/_ssr/{native-builds-1s5DIHa2.mjs → native-builds-2zov7e9h.mjs} +2 -2
  81. package/.output/server/_ssr/{native-builds-lEyKQemV.mjs → native-builds-C2xGyB-t.mjs} +19 -8
  82. package/.output/server/_ssr/{native-builds-DEyFHKDa.mjs → native-builds-D8wSoxxF.mjs} +21 -19
  83. package/.output/server/_ssr/{native-builds_._buildId-mJ8i0pL8.mjs → native-builds_._buildId-B3rk9gG4.mjs} +2 -2
  84. package/.output/server/_ssr/{native-builds_._buildId-ElCXKaXI.mjs → native-builds_._buildId-Do6W7jm2.mjs} +50 -40
  85. package/.output/server/_ssr/{native-builds_.devices-Dz8b48Fo.mjs → native-builds_.devices-KlAzG0Zy.mjs} +2 -2
  86. package/.output/server/_ssr/{native-builds_.devices-DNWZLCra.mjs → native-builds_.devices-lv3e5WXD.mjs} +17 -17
  87. package/.output/server/_ssr/{nativeBuildDownloadLink-D8Se_CCi.mjs → nativeBuildDownloadLink-C9WaekZx.mjs} +2 -2
  88. package/.output/server/_ssr/{nativeBuildInstall-DemC_4Zc.mjs → nativeBuildInstall-SCpQShAb.mjs} +5 -5
  89. package/.output/server/_ssr/{nativeBuilds-BFSeuC75.mjs → nativeBuilds-yTOa0vdF.mjs} +5 -5
  90. package/.output/server/_ssr/{release-adoption-rpc-1mKibOdV.mjs → release-adoption-rpc-CC35TIiN.mjs} +6 -6
  91. package/.output/server/_ssr/{releaseAdoption-DfEYq7I4.mjs → releaseAdoption-BNp2LKR5.mjs} +2 -1
  92. package/.output/server/_ssr/{releaseCatalogCompiler-CuL3ptgg.mjs → releaseCatalogCompiler-B7k_Eask.mjs} +90 -9
  93. package/.output/server/_ssr/{remote-config-q9fegj-G.mjs → remote-config-B3udiYoT.mjs} +2 -2
  94. package/.output/server/_ssr/{remote-config-D2Cohnwn.mjs → remote-config-Erbkr_jI.mjs} +2 -2
  95. package/.output/server/_ssr/{remote-config-rpc-6hfHFrO6.mjs → remote-config-rpc-BNwGDXiU.mjs} +3 -3
  96. package/.output/server/_ssr/{remote-config-C_HNYPZ_.mjs → remote-config-u5wKgmdI.mjs} +18 -18
  97. package/.output/server/_ssr/{router-DODxASKG.mjs → router-BdIR78Dg.mjs} +35 -35
  98. package/.output/server/_ssr/{routes-C-nYThl0.mjs → routes-DiZ2ak9R.mjs} +10 -10
  99. package/.output/server/_ssr/{routes-BJjTUNSe.mjs → routes-DsdrQwy2.mjs} +31 -27
  100. package/.output/server/_ssr/{schema-migration-rpc-C31JquTn.mjs → schema-migration-rpc-C1KyK4Vo.mjs} +3 -3
  101. package/.output/server/_ssr/{select-CjACvu9s.mjs → select-E27bwyIg.mjs} +1 -1
  102. package/.output/server/_ssr/{server-Dyw2qgSR.mjs → server-3Oa4eaU_.mjs} +3 -3
  103. package/.output/server/_ssr/{sidebar-DQkRAO_e.mjs → sidebar-Di_cdJt9.mjs} +2 -2
  104. package/.output/server/_ssr/ssr.mjs +1 -1
  105. package/.output/server/_ssr/{switch-DZJSRVl3.mjs → switch-BYzRl3rt.mjs} +2 -2
  106. package/.output/server/_ssr/{table-BA-6GQFs.mjs → table-BbpblfLX.mjs} +1 -1
  107. package/.output/server/_ssr/{tabs-CtB3PIts.mjs → tabs-CUBGKQ4v.mjs} +2 -2
  108. package/.output/server/{_tanstack-start-manifest_v-Bfv6fYk6.mjs → _tanstack-start-manifest_v-MJAIGQWT.mjs} +30 -30
  109. package/.output/server/index.mjs +177 -177
  110. package/package.json +7 -7
  111. package/src/components/BundleIdDisplay.tsx +30 -3
  112. package/src/components/features/insights/ComparedBundlesChart.tsx +1 -0
  113. package/src/components/features/insights/InsightsControls.tsx +28 -4
  114. package/src/components/features/insights/InsightsOverview.tsx +3 -1
  115. package/src/components/features/insights/ReleaseCombobox.tsx +7 -2
  116. package/src/components/features/insights/RollbackButton.tsx +1 -1
  117. package/src/components/features/native-builds/BuiltInBundleCard.tsx +3 -2
  118. package/src/components/features/native-builds/NativeBuildDetailPage.tsx +9 -0
  119. package/src/components/features/native-builds/NativeBuildsTable.tsx +7 -4
  120. package/src/components/features/native-builds/ServedNowCard.tsx +6 -3
  121. package/src/components/features/releases/ReleaseEditorSheet.tsx +6 -3
  122. package/src/lib/native-builds.ts +28 -20
  123. package/src/lib/release-adoption.ts +2 -0
  124. package/src/lib/server/releaseAdoption.ts +1 -0
  125. package/src/routes/index.tsx +5 -1
  126. package/.output/public/assets/BundleIdDisplay-C0X-k49t.js +0 -1
  127. package/.output/public/assets/native-builds-B0zJ4wjg.js +0 -1
  128. package/.output/public/assets/native-builds-B_pQ4D5H.js +0 -1
  129. package/.output/public/assets/native-builds_._buildId-CSyC7YAA.js +0 -1
  130. package/.output/server/_ssr/BundleIdDisplay-CGdSiouM.mjs +0 -13
@@ -1 +1 @@
1
- import{$ as e,$n as t,Ar as n,Br as r,Cn as i,Di as a,Ei as o,F as s,Fr as c,H as l,I as u,Ir as d,L as f,Ln as p,M as m,Mr as h,Nn as g,On as _,P as v,Q as y,Qn as b,R as ee,Ri as x,Sn as S,Tr as C,U as w,Un as te,Vi as T,Vr as E,Xn as ne,Zn as re,_ as ie,_r as ae,b as oe,bn as se,dt as ce,et as le,ft as ue,g as de,gn as fe,gr as D,h as O,jr as pe,kr as me,p as he,v as k,vn as A,vr as j,w as ge,wr as M,xn as N,xr as _e,y as P,yn as F}from"./sidebar-BmzmPGuv.js";import{t as I}from"./link-CRMwpc7-.js";import{i as ve,n as L,r as ye}from"./useCompositeListItem-BEDqZ9Ni.js";import{t as be}from"./arrow-right-DjRwIoF1.js";import{t as xe}from"./arrow-up-right-C_1ALUCD.js";import{a as Se,i as R,l as Ce,n as z,o as we,r as B,s as V,t as Te}from"./routes-JJGRGqsf.js";import{t as Ee}from"./check-C3VCvMOV.js";import{t as H}from"./chevron-down-BkoJHAll.js";import{i as De,r as Oe}from"./TargetDisplay-Ctuz3qIp.js";import{t as ke}from"./chevron-right-RAuPv9r1.js";import{a as Ae,d as je,i as U,n as Me,o as Ne,r as Pe,t as Fe,u as W}from"./select-iSWTEY9t.js";import{t as Ie}from"./circle-off-DvYMC5yF.js";import{t as Le}from"./download-CgpaZb23.js";import{t as Re}from"./list-DQ9YBIDW.js";import{t as G}from"./loader-circle-8lunBReu.js";import{C as ze,O as Be,T as Ve,h as He}from"./native-builds-B_pQ4D5H.js";import{t as Ue}from"./plus-DztQIXYL.js";import{n as K,r as We}from"./dist-BEmib-ZM.js";import{t as Ge}from"./rotate-ccw-tITIe0Bd.js";import{n as Ke,t as qe}from"./switch-ByNYRVTN.js";import{t as Je}from"./trash-2-DI0biNI-.js";import{a as Ye,i as Xe,n as Ze,o as Qe,r as $e,t as q}from"./badge-zMibJGR5.js";import{S as et,_ as tt,a as nt,i as rt,r as it,v as at,w as ot,y as st}from"./useAnchoredPopupScrollLock-Cvx6CdPD.js";import{a as ct}from"./insights-search-B4NkHGeC.js";import{a as lt,n as ut,o as dt,r as ft,t as pt}from"./card-BAs80yql.js";import{a as mt,c as ht,d as gt,f as _t,l as vt,n as yt,o as bt,p as xt,s as St,u as Ct}from"./constants-yj-e3ahf.js";import{a as wt,c as Tt,i as Et,n as Dt,r as Ot,t as kt}from"./field-DInLQ5oV.js";import{C as At,S as jt,_ as Mt,a as Nt,b as Pt,c as Ft,i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt,v as Ht,w as Ut,x as Wt,y as Gt}from"./api-znPyglTl.js";import{a as Kt,i as qt,l as Jt,n as Yt,o as Xt,r as Zt,s as Qt,t as $t}from"./alert-dialog-DGPqJBCk.js";import{n as en,t as tn}from"./PlatformIcon-D4KPXCHL.js";import{a as nn,i as rn,n as an,o as on,r as sn,s as cn,t as ln}from"./dialog-BvZDZzdQ.js";import{a as un,i as dn,n as fn,o as pn,t as mn}from"./input-group-CIjTdxCW.js";import{a as hn,i as J,n as gn,o as _n,r as Y,t as vn}from"./table-DbZPkzdz.js";import{t as yn}from"./BundleIdDisplay-C0X-k49t.js";import{n as bn,t as xn}from"./RowReason-BvIxbpPP.js";import{t as Sn}from"./ChannelPicker-DPR-7lqV.js";import{n as Cn,t as wn}from"./valueToPercent-Db73Kirz.js";import{a as Tn,c as En,d as Dn,f as On,i as kn,l as An,n as jn,o as Mn,p as Nn,r as Pn,s as Fn,t as In,u as Ln}from"./RelativeTime-m-FKh1Jb.js";import{n as Rn,r as zn,t as Bn}from"./RolloutPercentageBadge-DF4EeZIJ.js";import{t as Vn}from"./HashValueDisplay-DTSMSH9O.js";import{a as Hn,c as Un,i as Wn,n as Gn,o as Kn,r as qn,s as Jn,t as Yn}from"./FoldedRows-1NvB9gAS.js";var Xn=E(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Zn=E(`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`}]]),Qn=E(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),$n=E(`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`}]]),er=E(`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`}]]),tr=o();function nr(){return M}function rr(){return!1}function ir(){return!0}function ar(){return(0,tr.useSyncExternalStore)(nr,rr,ir)}function or(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function sr(e,t){return e-t}function cr(e,t,n){let r=e.slice();return r[t]=n,r.sort(sr)}function lr(e,t,n,r,i,a){let o=e;return o=W(o,n,r),i&&(o=cr(a,t,W(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function ur(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 dr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},X=T(x()),fr=X.createContext(void 0);function pr(){let e=X.useContext(fr);if(e===void 0)throw Error(me(62));return e}var Z=a();function mr(e){return`key`in e?p:g}function hr(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?or(e,t):!1}var gr=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:a,disabled:o=!1,id:s,format:c,largeStep:l=10,locale:u,render:d,max:f=100,min:p=0,minStepsBetweenValues:m=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:ee=`horizontal`,step:x=1,thumbCollisionBehavior:C=`push`,thumbAlignment:w=`center`,value:te,style:T,...E}=e,ne=ue(s),ie=it(ne),ae=h(v),oe=h(y),{clearErrors:ce}=nt(),{state:le,disabled:de,name:fe,setTouched:D,setDirty:O,validityData:me,shouldValidateOnChange:he,validation:k}=et(),{labelId:j}=at(),[M,N]=X.useState(),P=n??rt(j,M),F=de||o,I=fe??_,[L,be]=ve({controlled:te,default:a??p,name:`Slider`}),xe=X.useRef(null),Se=X.useRef(null),R=X.useRef([]),Ce=X.useRef(null),z=X.useRef(null),we=X.useRef(-1),B=X.useRef(null),V=X.useRef(null),Te=X.useRef(`none`),Ee=se(c),[H,De]=X.useState(-1),[Oe,ke]=X.useState(-1),[Ae,je]=X.useState(!1),[U,Me]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=h(e=>{De(e),e!==-1&&ke(e)});st(Se,ne,L),ge(L,()=>{ce(I),he()?k.commit(L):k.commit(L,!0);let e=me.initialValue,t;t=Array.isArray(L)&&Array.isArray(e)?!or(L,e):L!==e,O(t)});let Ie=h(e=>{e&&(Se.current=e)}),Le=Array.isArray(L),Re=X.useMemo(()=>Le?L.slice().sort(sr):[W(L,p,f)],[f,p,Le,L]),G=h((e,t)=>{if(Number.isNaN(e)||hr(e,L))return;let n=t??S(`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,V.current=e,ae(e,n),!n.isCanceled&&be(e)}),ze=h((e,t,n)=>{let r=lr(e,t,p,f,Le,Re);if(ur(r,x,m)){let e=mr(n);G(r,S(e,n.nativeEvent,void 0,{activeThumbIndex:t})),D(!0),oe(V.current??r,i(e,n.nativeEvent))}});pe(()=>{let e=re(A(xe.current));F&&b(xe.current,e)&&e.blur()},[F]),F&&H!==-1&&Fe(-1);let Be=X.useMemo(()=>({...le,activeThumbIndex:H,disabled:F,dragging:Ae,orientation:ee,max:f,min:p,minStepsBetweenValues:m,step:x,values:Re}),[le,H,F,Ae,f,p,m,ee,x,Re]),Ve=X.useMemo(()=>({active:H,controlRef:Se,disabled:F,dragging:Ae,validation:k,formatOptionsRef:Ee,handleInputChange:ze,indicatorPosition:Ne,inset:w!==`center`,labelId:P,rootLabelId:ie,largeStep:l,lastUsedThumbIndex:Oe,lastChangedValueRef:V,lastChangeReasonRef:Te,form:g,locale:u,max:f,min:p,minStepsBetweenValues:m,name:I,onValueCommitted:oe,orientation:ee,pressedInputRef:Ce,pressedThumbCenterOffsetRef:z,pressedThumbIndexRef:we,pressedValuesRef:B,registerFieldControlRef:Ie,renderBeforeHydration:w===`edge`,setActive:Fe,setDragging:je,setIndicatorPosition:Pe,setLabelId:N,setValue:G,state:Be,step:x,thumbCollisionBehavior:C,thumbMap:U,thumbRefs:R,values:Re}),[H,Se,P,ie,F,Ae,k,Ee,ze,Ne,l,Oe,V,Te,g,u,f,p,m,I,oe,ee,Ce,z,we,B,Ie,Fe,je,Pe,N,G,Be,x,C,w,U,R,Re]),He=_e(`div`,e,{state:Be,ref:[t,xe],props:[{"aria-labelledby":P,id:ne,role:`group`},k.getValidationProps,E],stateAttributesMapping:dr});return(0,Z.jsx)(fr.Provider,{value:Ve,children:(0,Z.jsx)(ye,{elementsRef:R,onMapChange:Me,children:He})})});function _r(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function vr(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 yr(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(vr(t),vr(n))))}function br({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]=W(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]=W(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]=W(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function xr({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=W(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,ee=n.map((e,t)=>t===i?h:d[t]??u[t]),x=a;x=v?Math.max(a,n[b]):Math.min(a,n[b]);let S=br({values:n,index:b,nextValue:x,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:ee}),C=v?b-1:b+1;if(C>=0&&C<S.length){let e=S[C-1],t=S[C+1],n=e==null?o:e+f;n=Math.max(n,o+C*f);let r=t==null?s:t-f;r=Math.min(r,s-(S.length-1-C)*f);let i=W(h,n,r);S[C]=Number(i.toFixed(12))}return{value:S,thumbIndex:b,didSwap:!0}}case`push`:return{value:br({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=W(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 Sr=2;function Cr(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 wr(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 Tr=X.forwardRef(function(e,n){let{render:r,className:a,style:o,...s}=e,{disabled:l,dragging:u,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:g,min:v,minStepsBetweenValues:y,onValueCommitted:ee,orientation:x,pressedInputRef:C,pressedThumbCenterOffsetRef:w,pressedThumbIndexRef:T,pressedValuesRef:E,registerFieldControlRef:ne,renderBeforeHydration:ie,setActive:ae,setDragging:oe,setValue:le,state:ue,step:de,thumbCollisionBehavior:fe,thumbRefs:D,values:O}=pr(),pe=ce(),me=O.length>1,he=x===`vertical`,k=X.useRef(null),j=X.useRef(null),ge=h(e=>{e&&j.current==null&&(j.current=c(e).getComputedStyle(e))}),M=X.useRef(null),P=X.useRef(0),I=X.useRef(0),ve=se(O);function L(e){T.current!==e&&(T.current=e);let t=D.current[e];if(!t){w.current=null,C.current=null;return}C.current=t.querySelector(`input[type="range"]`)}function ye(e){let t=k.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=Cr(j.current,he),c=I.current,l=(he?r:n)-s.start-s.end-c*2,u=w.current??0,d=e.x-u,f=e.y-u,p=W(((he?i-f-s.end:(pe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-v)*p+v;if(m=yr(m,de,v),m=W(m,v,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=T.current;if(h<0)return null;let _=xr({behavior:fe,values:O,currentValues:ve.current??O,initialValues:E.current,pressedIndex:h,nextValue:m,min:v,max:g,step:de,minStepsBetweenValues:y});return fe===`swap`&&_.didSwap?L(_.thumbIndex):T.current=_.thumbIndex,_}function be(e){E.current=me?O.slice():null,ve.current=O;let t=T.current,n=t;if(t>-1&&t<O.length){if(O[t]===g){let e=t;for(;e>0&&O[e-1]===g;)--e;n=e}}else{let t=he?`y`:`x`,r;n=-1;for(let i=0;i<D.current.length;i+=1){let a=D.current[i];if(d(a)){let o=_r(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&L(n),f){let e=D.current[n];d(e)&&(I.current=e.getBoundingClientRect()[he?`height`:`width`]/2)}}function xe(e){let t=D.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let Se=h(e=>{let t=wr(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){R(e);return}let n=ye(t);n!=null&&ur(n.value,de,y)&&(!u&&P.current>Sr&&oe(!0),le(n.value,S(_,e,void 0,{activeThumbIndex:n.thumbIndex})),ve.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&xe(n.thumbIndex))});function R(e){ae(-1),oe(!1),C.current=null,w.current=null;let t=wr(e,M),n=t==null?null:ye(t);if(n!=null){let t=m.current;ee(p.current??n.value,i(t,e))}`pointerType`in e&&k.current?.hasPointerCapture(e.pointerId)&&k.current?.releasePointerCapture(e.pointerId),T.current=-1,M.current=null,E.current=null,z()}let Ce=h(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=wr(e,M);if(n!=null){be(n);let t=ye(n);if(t==null)return;xe(t.thumbIndex),le(t.value,S(te,e,void 0,{activeThumbIndex:t.thumbIndex})),ve.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&xe(t.thumbIndex)}P.current=0;let r=A(k.current);r.addEventListener(`touchmove`,Se,{passive:!0}),r.addEventListener(`touchend`,R,{passive:!0})}),z=h(()=>{let e=A(k.current);e.removeEventListener(`pointermove`,Se),e.removeEventListener(`pointerup`,R),e.removeEventListener(`touchmove`,Se),e.removeEventListener(`touchend`,R),E.current=null}),we=F();return X.useEffect(()=>{let e=k.current;if(!e)return()=>z();let t=N(e,`touchstart`,Ce,{passive:!0});return()=>{t(),we.cancel(),z()}},[z,Ce,k,we]),X.useEffect(()=>{l&&z()},[l,z]),_e(`div`,e,{state:ue,ref:[n,ne,k,ge],props:[{"data-base-ui-slider-control":ie?``:void 0,onPointerDown(e){let n=k.current,r=t(e.nativeEvent);if(!n||l||e.defaultPrevented||!d(r)||e.button!==0)return;let i=wr(e,M);if(i!=null){be(i);let t=ye(i);if(t==null)return;b(D.current[t.thumbIndex],re(A(n)))?e.preventDefault():we.request(()=>{xe(t.thumbIndex)}),oe(!0),w.current??(le(t.value,S(te,e.nativeEvent,void 0,{activeThumbIndex:t.thumbIndex})),ve.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&xe(t.thumbIndex))}e.nativeEvent.pointerId&&n.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let a=A(k.current);a.addEventListener(`pointermove`,Se,{passive:!0}),a.addEventListener(`pointerup`,R,{once:!0})}},s],stateAttributesMapping:dr})}),Er=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=pr();return _e(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:dr})}),Dr=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}({}),Or=new Set([...f,w,l]);function kr(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${Cn(e[t],r,n)} start range`:`${Cn(e[t],r,n)} end range`:n?Cn(e[t],r,n):void 0}function Ar(e,t,n,r,i){let a=n===1?e+t:e-t;return W(Number(a.toFixed(Math.max(vr(e),vr(t),vr(r)))),r,i)}var jr=X.forwardRef(function(e,t){let{render:r,children:i,className:a,"aria-describedby":o,"aria-label":d,"aria-labelledby":p,disabled:g=!1,getAriaLabel:_,getAriaValueText:y,id:b,index:x,inputRef:S,onBlur:te,onFocus:T,onKeyDown:E,tabIndex:re,style:ie,...ae}=e,{nonce:oe}=je(),se=ue(b),{active:le,lastUsedThumbIndex:de,controlRef:D,disabled:O,validation:me,formatOptionsRef:he,handleInputChange:k,inset:A,labelId:j,largeStep:ge,locale:M,max:N,min:P,minStepsBetweenValues:F,form:I,name:ve,orientation:ye,pressedInputRef:be,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:Se,renderBeforeHydration:R,setActive:Ce,setIndicatorPosition:z,state:we,step:B,values:V}=pr(),Te=ce(),Ee=g||O,H=V.length>1,De=ye===`vertical`,Oe=Te===`rtl`,{setTouched:ke,setFocused:Ae,validationMode:U}=et(),Me=X.useRef(null),Ne=X.useRef(null),Pe=X.useRef(!1),Fe=ue(),W=tt(),Ie=H?Fe:W,{ref:Le,index:Re}=L({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),G=H?x??Re:0,ze=G===V.length-1,Be=V[G],Ve=wn(Be,P,N),[He,Ue]=X.useState(),K=ar(),We=de>=0&&de<V.length?de:-1,Ge=h(()=>{let e=D.current,t=Me.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=De?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Ve/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ue(s),G===0?z(e=>[s,e[1]]):ze&&z(e=>[e[0],s])});pe(()=>{A&&queueMicrotask(Ge)},[Ge,A]),pe(()=>{A&&Ge()},[Ge,A,Ve]),pe(()=>{if(!A)return;let e=D.current,t=Me.current;if(!e||!t)return;let n=c(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Ge);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[D,Ge,A]);let Ke=De?`bottom`:`insetInlineStart`,qe=De?`left`:`top`,Je;H?le===G?Je=2:We===G&&(Je=1):le===G&&(Je=1);let Ye;Ye=A?{"--position":`${He??0}%`,visibility:R&&K||He===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Ve)?{position:`absolute`,[Ke]:`${Ve}%`,[qe]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Je}:fe;let Xe;ye===`vertical`&&(Xe=Oe?`vertical-rl`:`vertical-lr`);let Ze=typeof _==`function`?_(G):d,Qe=n({"aria-label":Ze,"aria-labelledby":p??(Ze==null?j:void 0),"aria-describedby":o,"aria-orientation":ye,"aria-valuenow":Be,"aria-valuetext":typeof y==`function`?y(Cn(Be,M,he.current??void 0),Be,G):kr(V,G,he.current??void 0,M),disabled:Ee,form:I,id:Ie,max:N,min:P,name:ve,onChange(e){k(e.currentTarget.valueAsNumber,G,e)},onFocus(e){let t=Pe.current;Pe.current=!1,Ce(G),Ae(!0),t&&e.stopPropagation()},onBlur(e){if(Pe.current){e.stopPropagation();return}Me.current&&(Ce(-1),ke(!0),Ae(!1),U===`onBlur`&&me.commit(lr(Be,G,P,N,H,V)))},onKeyDown(e){if(!Or.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=yr(Be,B,P);switch(e.key){case u:t=Ar(n,e.shiftKey?ge:B,1,P,N);break;case s:t=Ar(n,e.shiftKey?ge:B,Oe?-1:1,P,N);break;case m:t=Ar(n,e.shiftKey?ge:B,-1,P,N);break;case v:t=Ar(n,e.shiftKey?ge:B,Oe?1:-1,P,N);break;case w:t=Ar(n,ge,1,P,N);break;case l:t=Ar(n,ge,-1,P,N);break;case`End`:t=N,H&&(t=Number.isFinite(V[G+1])?V[G+1]-B*F:N);break;case ee:t=P,H&&(t=Number.isFinite(V[G-1])?V[G-1]+B*F:P);break;default:break}if(t!==null){let n=e.currentTarget;ne(n)||(Pe.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),k(t,G,e),e.preventDefault()}},step:B,style:{...fe,width:`100%`,height:`100%`,writingMode:Xe},tabIndex:re??void 0,type:`range`,value:Be??``},me.getInputValidationProps),$e=C(Ne,me.inputRef,S);return _e(`div`,e,{state:we,ref:[t,Le,Me],props:[{[Dr.index]:G,children:(0,Z.jsxs)(X.Fragment,{children:[i,(0,Z.jsx)(`input`,{ref:$e,...Qe,suppressHydrationWarning:!0}),A&&K&&R&&ze&&(0,Z.jsx)(`script`,{nonce:oe,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:se,onBlur:te,onFocus:T,onPointerDown(e){if(Se.current=G,Me.current!=null){let t=ye===`horizontal`?`x`:`y`,n=_r(Me.current);xe.current=(ye===`horizontal`?e.clientX:e.clientY)-n[t]}Ne.current!=null&&be.current!==Ne.current&&(be.current=Ne.current)},style:Ye,suppressHydrationWarning:R||void 0},ae],stateAttributesMapping:dr})});function Mr(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 Nr(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 Pr=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{indicatorPosition:o,inset:s,max:c,min:l,orientation:u,renderBeforeHydration:d,state:f,values:p}=pr(),m=ar(),h=u===`vertical`,g=p.length>1,_=s?Mr(h,g,o[0],o[1],d,m):Nr(h,g,wn(p[0],l,c),wn(p[p.length-1],l,c));return _e(`div`,e,{state:f,ref:t,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:_,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:dr})});function Fr({enabled:e,className:t,falseIcon:n=`x`,colorMode:i=`semantic`}){let a=i===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(Ee,{className:j(`h-4 w-4`,a??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(Qn,{className:j(`h-4 w-4`,a??`text-muted-foreground`,t)}):(0,Z.jsx)(r,{className:j(`h-4 w-4`,a??`text-red-600 dark:text-red-400`,t)})}function Ir({panelId:t,bundle:n,bundles:r,loading:i,onDetailClick:a}){let o=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)(q,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),i?(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`}),o?(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)(be,{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)(q,{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)(zn,{uuid:e.id})})]})]}),(0,Z.jsx)(D,{className:`w-full`,onClick:()=>a(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)(be,{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)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(zn,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(D,{onClick:()=>a(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 Lr({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(null),o=Ke(i),{data:s=[],isPending:c}=It(),l=Rt(),u=Bt(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?K.success(`Channel ${e.row.name} created`):K.info(`Channel ${e.row.name} already exists`)}catch(e){K.error(`Failed to create channel`),console.error(e)}},p=async()=>{if(!(!i||u.isPending))try{let e=await u.mutateAsync({id:i.id});e.deleted?K.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?K.error(`Channel ${i.name} is still in use and cannot be deleted`):K.error(`Channel ${i.name} no longer exists`),a(null)}catch(e){K.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ln,{open:e,onOpenChange:t,children:(0,Z.jsxs)(an,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(nn,{children:[(0,Z.jsxs)(on,{className:`flex items-center gap-2`,children:[(0,Z.jsx)($n,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(sn,{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:f,children:(0,Z.jsx)(Et,{className:`gap-2`,children:(0,Z.jsxs)(kt,{orientation:`horizontal`,children:[(0,Z.jsx)(wt,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(y,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(D,{className:`max-md:h-11`,type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(G,{"data-icon":`inline-start`,className:`animate-spin motion-reduce:animate-none`}):(0,Z.jsx)(Ue,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:c?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(G,{className:`mr-2 size-3.5 animate-spin motion-reduce:animate-none`}),`Loading channels`]}):s.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:s.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`,title:e.name,children:e.name}),(0,Z.jsx)(D,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>a(e),className:`text-muted-foreground hover:text-destructive max-md:size-11`,children:(0,Z.jsx)(Je,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)($t,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&a(null)},children:(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsxs)(Jt,{children:[`Delete `,o?.name,`?`]}),(0,Z.jsx)(Kt,{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)(Xt,{children:[(0,Z.jsx)(Zt,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(Yt,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Rr=`[a-zA-Z0-9-]`,zr=String.raw`0|[1-9]\d*`,Br=String.raw`\d+`,Vr=String.raw`\d*[a-zA-Z-]${Rr}*`,Hr=String.raw`(${zr})\.(${zr})\.(${zr})`,Ur=String.raw`(${Br})\.(${Br})\.(${Br})`,Wr=`(?:${Vr}|${zr})`,Gr=`(?:${Vr}|${Br})`,Kr=String.raw`(?:-(${Wr}(?:\.${Wr})*))`,qr=String.raw`(?:-?(${Gr}(?:\.${Gr})*))`,Jr=`${Rr}+`,Yr=String.raw`(?:\+(${Jr}(?:\.${Jr})*))`,Xr=`v?${Hr}${Kr}?${Yr}?`,Zr=String.raw`[v=\s]*${Ur}${qr}?${Yr}?`,Qr=`((?:<|>)?=?)`,$r=String.raw`${zr}|x|X|\*`,ei=String.raw`${Br}|x|X|\*`,ti=String.raw`[v=\s]*(${$r})(?:\.(${$r})(?:\.(${$r})(?:${Kr})?${Yr}?)?)?`,ni=String.raw`[v=\s]*(${ei})(?:\.(${ei})(?:\.(${ei})(?:${qr})?${Yr}?)?)?`,ri=`(?:~>?)`,ii=String.raw`(?:\^)`,ai=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${ai}(?:$|[^\d])`,String.raw`${ai}(?:${Kr})?(?:${Yr})?(?:$|[^\d])`;function oi(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Rr,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(oi(e),t)}var si=Q(`^${Xr}$`),ci=Q(`^${Zr}$`),li=/^\d+$/;function ui(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function di(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?ci:si);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(li.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 fi=Q(String.raw`^${Qr}\s*(${Xr})$|^$`),pi=Q(String.raw`^${Qr}\s*(${Zr})$|^$`);function mi(e){return e.version?`${e.operator}${ui(e.version)}`:``}function hi(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?pi:fi);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?di(r[2],t):null;return{operator:i,options:t,value:a?`${i}${ui(a)}`:``,version:a}}function gi(e){return e.sets.map(e=>e.map(mi).join(` `)).join(`||`)}var _i=new RegExp(Yr,`g`),vi=Q(Yr),yi=Q(String.raw`^\s*(${ti})\s+-\s+(${ti})\s*$`),bi=Q(String.raw`^\s*(${ni})\s+-\s+(${ni})\s*$`),xi=Q(String.raw`(\s*)${Qr}\s*(${Zr}|${ti})`,`g`),Si=Q(String.raw`(\s*)${ri}\s+`,`g`),Ci=Q(String.raw`(\s*)${ii}\s+`,`g`),wi=Q(`^${ri}${ti}$`),Ti=Q(`^${ri}${ni}$`),Ei=Q(`^${ii}${ti}$`),Di=Q(`^${ii}${ni}$`),Oi=Q(String.raw`^${Qr}\s*${ti}$`),ki=Q(String.raw`^${Qr}\s*${ni}$`),Ai=Q(String.raw`(<|>)?=?\s*\*`),ji=/^\s*>=\s*0\.0\.0\s*$/,Mi=/^\s*>=\s*0\.0\.0-0\s*$/,Ni=Q(String.raw`^${Qr}\s*(${Zr})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Pi(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Fi(e,t){let n=t.loose?Ti:wi,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 Ii(e,t){return e.trim().split(/\s+/).map(e=>Fi(e,t)).join(` `)}function Li(e,t){let n=t.loose?Di:Ei,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 Ri(e,t){return e.trim().split(/\s+/).map(e=>Li(e,t)).join(` `)}function zi(e,t){let n=t.loose?ki:Oi;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Pi(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 Bi(e,t){return e.split(/\s+/).map(e=>zi(e,t)).join(` `)}function Vi(e,t){let n=t.loose?bi:yi;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 Hi(e,t){return Bi(Ii(Ri(e.replace(vi,``),t),t),t).trim().replace(Ai,``)}function Ui(e,t){let n=Vi(e.replace(_i,``),t).replace(xi,`$1$2$3`).replace(Si,`$1~`).replace(Ci,`$1^`).split(` `).map(e=>Hi(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Mi:ji,``));t.loose&&(n=n.filter(e=>Ni.test(e)));let r=new Map;for(let e of n.map(e=>hi(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 Wi(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Ui(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 Gi(e,t={}){try{return Wi(e,t)}catch{return null}}function Ki(e,t={}){let n=Gi(e,t);return n?gi(n)||`*`:null}function qi({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 Ji({bundle:e,release:t}){let{data:n,isFetched:r}=Nt(),i=e?Ct(e):null,a=e?vt(e):null,o=e?.gitCommitHash&&r?Rn(n?.console.gitUrl,e.gitCommitHash):null,s=r&&!!e?.gitCommitHash&&!n?.console.gitUrl?.trim(),c=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return c||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(lt,{className:`p-4 pb-3`,children:(0,Z.jsx)(dt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(qi,{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:c??`—`})}),e?.gitCommitHash?(0,Z.jsx)(qi,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(Vn,{className:o?`text-primary`:void 0,hint:s?(0,Z.jsxs)(Z.Fragment,{children:[`Set `,(0,Z.jsx)(`code`,{className:`font-mono`,children:`console.gitUrl`}),` `,`in your config to open commits in your repository.`,` `,(0,Z.jsx)(`a`,{className:`font-medium underline underline-offset-2`,href:yt,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more`})]}):void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`relative shrink-0 text-primary after:absolute after:-inset-2.5 hover:underline md:after:hidden`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(Xn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(qi,{label:`Manifest hash`,value:(0,Z.jsx)(Vn,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(qi,{label:`Base hash`,value:(0,Z.jsx)(Vn,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(qi,{label:`Patch hash`,value:(0,Z.jsx)(Vn,{maxLength:16,value:i})}):null]})})]}):null}var Yi=Array.from({length:bt},(e,t)=>t+1);function Xi({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=xt(t),i=n??[],a=i.length>0,o=r>0&&r<1e3,s=r===bt,c=O(),l=s?Yi:o?Yi.filter(t=>St(e,t)<r):[],u=(r/10).toFixed(1),d=s?bt:l.length,f=bt-d,p=(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)(pt,{children:(0,Z.jsxs)(lt,{className:`p-4`,children:[(0,Z.jsx)(ft,{children:`Selected cohorts`}),(0,Z.jsx)(dt,{className:`font-mono text-2xl tabular-nums`,children:d})]})}),(0,Z.jsx)(pt,{children:(0,Z.jsxs)(lt,{className:`p-4`,children:[(0,Z.jsx)(ft,{children:`Excluded cohorts`}),(0,Z.jsx)(dt,{className:`font-mono text-2xl tabular-nums`,children:f})]})})]}),a?(0,Z.jsxs)(pt,{children:[(0,Z.jsxs)(lt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(dt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(ft,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(ut,{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:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(lt,{className:`p-4 pb-3`,children:(0,Z.jsx)(dt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(ut,{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:l.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:l.map(e=>(0,Z.jsx)(q,{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)(ln,{children:[(0,Z.jsxs)(cn,{render:(0,Z.jsx)(D,{className:`max-md:h-11`,size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Re,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(an,{className:c?`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:c?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(nn,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(on,{children:`Rolled out cohorts`}),(0,Z.jsxs)(sn,{children:[u,`% includes `,d,` of`,` `,bt,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:p}),(0,Z.jsx)(rn,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(nn,{children:[(0,Z.jsx)(on,{children:`Rolled out cohorts`}),(0,Z.jsxs)(sn,{children:[u,`% includes `,d,` of`,` `,bt,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),p,(0,Z.jsx)(rn,{showCloseButton:!0})]})})]})}function Zi({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&&Ve(i)!==null,o=Wt(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:[ze(s.platform),` `,He[s.artifact_kind].label,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono`,translate:`no`,children:s.min_bundle_id}),(0,Z.jsx)(xe,{"aria-hidden":`true`,className:`size-3`})]}),r?(0,Z.jsx)(q,{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:`relative underline-offset-4 after:absolute after:-inset-x-2 after:-inset-y-4 hover:text-foreground hover:underline md:after:hidden`,search:{channel:n},to:`/native-builds`,children:`This channel's builds`})]})]})}function Qi({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)(gr,{className:j(`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)(Tr,{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)(Er,{"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)(Pr,{"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)(jr,{"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 max-md:after:-inset-3.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var $i=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],ea=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]}),ta=(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}),na=e=>(e/10).toFixed(1),ra=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},ia=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function aa({value:e,onChange:t}){let[n,r]=(0,X.useState)(na(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(na(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Qi,{"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)(mn,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(dn,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=ia(n)??e;a(!1),r(na(i)),t(i)},onChange:e=>{let n=ra(e.target.value);r(n);let i=ia(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(fn,{align:`inline-end`,children:(0,Z.jsx)(un,{children:`%`})})]})]})}function oa({channels:t,onOpenChange:n,onShowScope:i,open:a,releaseId:o}){let s=jt(o),c=s.data,l=zt(c?.bundle_id??``),u=l.data,d=u?ht(u):null,f=Gt(c?.scope_key??``),p=Ut(),m=Mt(),h=Ft(),g=Ht(),[_,v]=(0,X.useState)(null),[b,ee]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[te,T]=(0,X.useState)(!1),[E,ne]=(0,X.useState)(!1),[re,ae]=(0,X.useState)(``),[se,ce]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?ea(c):null),S(``)},[c]);let ue=c?ea(c):null,fe=_!==null&&ue!==null&&JSON.stringify(_)!==JSON.stringify(ue),O=m.isPending||p.isPending||h.isPending||g.isPending,pe=()=>{if(!O){if(fe){w(!0);return}n(!1)}},me=()=>{if(!_)return;let e=_t(b);if(!gt(e)){S(mt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),ee(``),S(``)},he=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(_t);if(e.some(e=>!gt(e))){S(mt);return}if(c.strategy===`APP_VERSION`&&!Ki(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:ta(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),K.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,j=t.filter(e=>e.id!==c?.channel_id),ge=j.map(e=>({label:e.name,value:e.name})),M=re.trim(),N=se===`copy`,_e=_?Ki(_.targetAppVersion.trim()):null,F=()=>{ae(``),ce(`move`)},I=e=>{!e&&g.isPending||(ne(e),e||F())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(de,{onOpenChange:e=>e?void 0:pe(),open:a,children:(0,Z.jsxs)(ie,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(P,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(oe,{children:`Bundle Detail`}),(0,Z.jsx)(k,{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)(tn,{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:A})]}),A?(0,Z.jsx)(Zi,{bundle:u,channel:A,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)(Ze,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Xe,{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:[A?(0,Z.jsx)(V,{release:{platform:c.platform,channel:A,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)(Et,{className:`gap-6`,children:[(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(wt,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(pn,{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)(kt,{children:[(0,Z.jsx)(wt,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(y,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),_e?(0,Z.jsx)(Dt,{children:_e}):null]}):null,(0,Z.jsx)(kt,{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)(wt,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(ct,{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)(qe,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(kt,{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)(wt,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(ct,{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)(qe,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(wt,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(aa,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(kt,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(wt,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Xi,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(y,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>ee(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),me())},placeholder:`e.g. qa-team…`,value:b}),(0,Z.jsx)(D,{"aria-label":`Add cohort`,className:`max-md:size-11`,disabled:!b.trim(),onClick:me,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ue,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(q,{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)(r,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Dt,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Ot,{children:x}):null,(0,Z.jsx)(D,{className:`w-full max-md:h-11`,disabled:!fe||O,onClick:he,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(le,{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)(D,{className:`w-full max-md:h-11`,disabled:!c.bundle_id||O,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(D,{className:`w-full max-md:h-11`,disabled:O,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),K.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Le,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(D,{className:`w-full max-md:h-11`,disabled:c.enabled||O,onClick:()=>T(!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)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Build details are unavailable`}),(0,Z.jsx)(Xe,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(Ji,{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}),i?(0,Z.jsx)(D,{className:`mt-1 h-auto px-0 text-xs max-md:min-h-11`,onClick:()=>i(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)($t,{onOpenChange:w,open:C,children:(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(Jt,{children:`Discard unsaved changes?`}),(0,Z.jsx)(Kt,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(Xt,{children:[(0,Z.jsx)(Zt,{children:`Keep editing`}),(0,Z.jsx)(Yt,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)($t,{onOpenChange:T,open:te,children:(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsxs)(Jt,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(Kt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(Xt,{children:[(0,Z.jsx)(Zt,{children:`Cancel`}),(0,Z.jsx)(Yt,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),K.success(`Bundle removed from ${A??`the channel`}`),T(!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)(ln,{onOpenChange:I,open:E,children:(0,Z.jsxs)(an,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(nn,{children:[(0,Z.jsx)(on,{children:`Promote to Channel`}),(0,Z.jsx)(sn,{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)(Tt,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(Fe,{disabled:g.isPending,items:$i,onValueChange:e=>ce(e),value:se,children:[(0,Z.jsx)(Ae,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(Ne,{placeholder:`Select an action`})}),(0,Z.jsx)(Me,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(U,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(U,{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)(Tt,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(Fe,{disabled:g.isPending,items:ge,onValueChange:e=>ae(e??``),value:re||null,children:[(0,Z.jsx)(Ae,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(Ne,{placeholder:`Select a channel`})}),(0,Z.jsx)(Me,{className:`md:max-h-64`,children:(0,Z.jsx)(Pe,{children:j.map(e=>(0,Z.jsx)(U,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(rn,{children:[(0,Z.jsx)(D,{disabled:g.isPending,onClick:()=>I(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(D,{disabled:!M||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:se,expectedRevision:c.revision,releaseId:c.id,targetChannel:M}),I(!1),K.success(N?`Bundle copied to ${M}`:`Bundle moved to ${M}`)}catch(e){K.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?N?`Copying…`:`Moving…`:N?`Copy`:`Move`})]})]})})]})}function sa({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(Ee,{className:`size-3`}):(0,Z.jsx)(Ie,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}var ca={data:void 0,error:null,isError:!1,isPending:!0,isPlaceholderData:!1},la={one:`unreachable bundle`,other:`unreachable bundles`},ua=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],da=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}];function fa({channels:e,clearable:t,onChange:n,onClear:i,onManageChannels:a,pending:o,search:s}){let c=s.channelId!==void 0;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)(he,{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)(Zn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsx)(Sn,{allChannels:!0,className:`max-sm:order-1 max-sm:min-w-0 max-sm:basis-full`,onValueChange:t=>n(t===void 0?{channelId:void 0,channels:`all`}:{channelId:e.find(e=>e.name===t)?.id??t}),pending:o,value:s.channelId===void 0?void 0:e.find(({id:e})=>e===s.channelId)?.name??s.channelId}),(0,Z.jsxs)(Fe,{disabled:!c,items:ua,onValueChange:e=>n({platform:e===`android`?`android`:`ios`}),value:s.platform??`ios`,children:[(0,Z.jsx)(Ae,{"aria-label":`Platform`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-sm data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:text-xs sm:data-[size=default]:h-8`,title:c?void 0:`Choose a channel first`,children:(0,Z.jsx)(Ne,{})}),(0,Z.jsx)(Me,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(U,{value:`ios`,children:`iOS`}),(0,Z.jsx)(U,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(Fe,{disabled:!c&&s.scopeKey===void 0,items:da,onValueChange:e=>n({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:s.enabled===void 0?`all`:s.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(Ae,{"aria-label":`Status`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-sm data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:text-xs sm:data-[size=default]:h-8`,children:(0,Z.jsx)(Ne,{})}),(0,Z.jsx)(Me,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(U,{value:`all`,children:`Any Status`}),(0,Z.jsx)(U,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(U,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(D,{"aria-label":`Manage channels`,className:`size-11 max-sm:ml-auto sm:size-7`,onClick:a,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(er,{})}),s.bundleId?(0,Z.jsxs)(q,{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:()=>n({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,s.scopeKey?(0,Z.jsxs)(q,{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:()=>n({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,t?(0,Z.jsxs)(D,{className:`h-11 px-2 text-xs text-muted-foreground hover:text-foreground max-sm:order-3 sm:ml-auto sm:h-8`,onClick:i,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(r,{"data-icon":`inline-start`}),`Clear`]}):null]})}function pa({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=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)(D,{"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)(H,{}):(0,Z.jsx)(ke,{})}):(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)(Ge,{className:`size-3.5`}),` Built-in bundle`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsx)(xn,{icon:Ie,label:`Unreachable: no device gets this bundle with the current delivery settings.`,reason:`No device gets this bundle with the current delivery settings.`,children:`Unreachable`}):null]})}function ma({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=zt(i),o=Lt(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)(Ir,{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 ha(e,t){return{patchCounts:Vt(Array.from(new Set(e.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},slotReleases:e.flatMap(e=>{let n=t.find(t=>t.id===e.channel_id)?.name;return n?[{releaseId:e.id,platform:e.platform,channel:n,builtIn:!e.bundle_id}]:[]})}}var ga=(e,t)=>t>=e.to&&(e.from===void 0||t<e.from);function _a({fold:e,filter:t,channels:n,columns:r,isMobile:i,open:a,onOpenChange:o,render:s}){let c=Pt(t,{...e.from===void 0?{}:{from:e.from},to:e.to},a),l=c.data?.pages.flatMap(e=>e.rows)??[],u=ha(l,n),d=i?void 0:r,f=c.isError?(0,Z.jsx)(qn,{columns:d,label:`Unreachable bundles`,onRetry:()=>void c.refetch(),state:`error`}):c.isPending||c.isFetchingNextPage?(0,Z.jsx)(qn,{columns:d,label:`Loading unreachable bundles`,state:`loading`}):c.hasNextPage?(0,Z.jsx)(qn,{columns:d,label:`Unreachable bundles`,onMore:()=>void c.fetchNextPage(),state:`more`}):null,p={label:Hn(e,la),open:a,onOpenChange:o,panelId:`bundle-fold-${e.to}`};return i?(0,Z.jsxs)(Yn,{...p,children:[l.map(e=>s(e,u)),f]}):(0,Z.jsxs)(Gn,{...p,columns:r,children:[l.map(e=>s(e,u)),f]})}function va(){let e=Te.useSearch(),t=Te.useNavigate(),n=O(),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(),s=Un(),c=It(),l=c.data??[],u=c.data,d=R(e,u),f=d===void 0&&c.isError,p=d??e,m=B(p),h=At({afterReleaseId:p.afterReleaseId,beforeReleaseId:p.beforeReleaseId,filter:m,releaseId:p.releaseId},{enabled:d!==void 0}),g=!Se(e,u),_=d===void 0?ca:h,v=_.data?.entries??[],y=v.flatMap(e=>e.kind===`row`?[e.row]:[]),b=ha(y,l),ee=_.data?.next,x=_.data?.previous,S=Ce(),C=10+S.length,w=new Map(l.map(e=>[e.id,e.name])),te=a!==void 0&&(e=>y.some(t=>t.id===e)||v.some(t=>t.kind===`fold`&&s.isOpen(Wn(t))&&ga(t,e)))(a);(0,X.useEffect)(()=>{a!==void 0&&!te&&o(void 0)},[a,te]);let T=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),E=e=>T(we(p,e)),ne=e=>{y.some(({id:t})=>t===e.id)||s.set(e.id,!0),T({...p,releaseId:e.id},!1)},re=e=>{let t=y.find(t=>t.bundle_id===e.id);if(o(void 0),t){T({...p,releaseId:t.id},!1);return}E({bundleId:e.id})},ie=p.afterReleaseId!==void 0||p.beforeReleaseId!==void 0,oe=x?{...p,afterReleaseId:`after`in x?x.after:void 0,beforeReleaseId:`before`in x?x.before:void 0,releaseId:void 0}:null,se=ee?{...p,afterReleaseId:void 0,beforeReleaseId:ee,releaseId:void 0}:null,ce={...p,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0},le=(e,t)=>{let n=w.get(e.channel_id)??e.channel_id,r=e.bundle_id?t.patchCounts[e.bundle_id]:0,i=te&&a===e.id,s=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(jn,{"aria-label":`Bundle ${e.id}`,className:j(`gap-3`,e.currentlyUnreachable&&`bg-muted/60 saturate-50 hover:bg-muted/60 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":p.releaseId===e.id?`selected`:void 0,onClick:Nn(()=>ne(e)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(pa,{expanded:i,onOpen:()=>ne(e),onToggleExpand:()=>o(i?void 0:e.id),release:e}),(0,Z.jsx)(bn,{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)(tn,{className:`size-4`,platform:e.platform}),e.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)(In,{ms:e.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)(Bn,{percentage:e.rollout_cohort_count/10}),(0,Z.jsx)(sa,{release:e}),e.should_force_update?(0,Z.jsx)(q,{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)(Oe,{appVersion:e.target_app_version,fingerprintHash:e.fingerprint_hash})]})]}),S.map(({Cell:n,feature:r,label:i})=>(0,Z.jsxs)(`div`,{className:`mt-3 text-xs`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:i}),(0,Z.jsx)(n,{releaseId:e.id,releases:t.slotReleases})]},r)),e.message?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.message}):null]}),i&&e.bundle_id?(0,Z.jsx)(ma,{onDetailClick:re,panelId:s,release:e}):null]},e.id)},ue=(e,t)=>{let n=te&&a===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(Dn,{"aria-label":`Open bundle ${e.id}`,className:j(e.currentlyUnreachable&&`bg-muted/60 saturate-50 hover:bg-muted/60 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":p.releaseId===e.id?`selected`:void 0,onOpen:()=>ne(e),children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(pa,{expanded:n,onOpen:()=>ne(e),onToggleExpand:()=>o(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:w.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsx)(en,{platform:e.platform})}),(0,Z.jsx)(Y,{children:e.bundle_id&&t.patchCounts[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&t.patchCounts[e.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[t.patchCounts[e.bundle_id],` `,t.patchCounts[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Oe,{appVersion:e.target_app_version,fingerprintHash:e.fingerprint_hash})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Fr,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Fr,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Bn,{percentage:e.rollout_cohort_count/10})}),S.map(({Cell:n,feature:r})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(n,{releaseId:e.id,releases:t.slotReleases})},r)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(In,{ms:e.created_at_ms})})]}),n&&e.bundle_id?(0,Z.jsx)(_n,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:C,children:(0,Z.jsx)(ma,{onDetailClick:re,panelId:r,release:e})})}):null]},e.id)},de=(e,t)=>(0,Z.jsx)(_a,{channels:l,columns:C,filter:m,fold:e,isMobile:n,onOpenChange:t=>s.set(Wn(e),t),open:s.isOpen(Wn(e)),render:t},`fold-${e.to}`),fe=(0,Z.jsxs)(Z.Fragment,{children:[`No `,p.platform===`android`?`Android`:`iOS`,` bundles in`,` `,(0,Z.jsx)(`span`,{translate:`no`,children:w.get(p.channelId??``)??p.channelId})]}),pe=(0,Z.jsx)(Fn,{icon:Be,title:y.length===0&&v.length>0?`No device gets the bundles here`:ie?`No more bundles`:z(p)?g?`No bundles match these filters`:fe:`No bundles yet`,children:ie?(0,Z.jsx)(I,{className:ae({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:ce,to:`/`,children:`Show the newest bundles`}):g?(0,Z.jsx)(D,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>T({}),variant:`outline`,children:`Clear filters`}):z(p)?(0,Z.jsx)(D,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>E({channelId:void 0,channels:`all`}),variant:`outline`,children:`Show all channels`}):(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)(De,{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)(fa,{channels:l,clearable:g,onChange:E,onClear:()=>T({}),onManageChannels:()=>i(!0),pending:d===void 0,search:p}),(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:[f?(0,Z.jsxs)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Channels couldn't be loaded`}),(0,Z.jsx)(Xe,{children:`Bundles show once the channels load.`}),(0,Z.jsx)($e,{children:(0,Z.jsxs)(D,{className:`min-h-11 sm:min-h-7`,onClick:()=>void c.refetch(),size:`xs`,variant:`outline`,children:[(0,Z.jsx)(We,{"data-icon":`inline-start`}),`Retry`]})})]}):_.isError?(0,Z.jsxs)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Xe,{children:_.error?.message})]}):(0,Z.jsx)(En,{children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:_.isPending?(0,Z.jsx)(Pn,{}):(0,Z.jsxs)(Z.Fragment,{children:[y.length===0?(0,Z.jsx)(kn,{children:pe}):null,v.map(e=>e.kind===`row`?le(e.row,b):de(e,le))]})}):(0,Z.jsx)(Tn,{rowGroups:!0,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`}),S.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:_.isPending?(0,Z.jsx)(Mn,{children:(0,Z.jsx)(On,{columns:C})}):(0,Z.jsxs)(Z.Fragment,{children:[y.length===0?(0,Z.jsx)(Mn,{children:(0,Z.jsx)(An,{columns:C,children:pe})}):null,Jn(v).map(e=>e.kind===`fold`?de(e.fold,ue):(0,Z.jsx)(Mn,{children:e.rows.map(e=>ue(e,b))},`rows-${e.rows[0].id}`))]})})}),!f&&!_.isError&&!_.isPending?(0,Z.jsx)(Ln,{count:y.length,folded:{...Kn(v),label:`unreachable`},label:`Bundle pagination`,noun:[`bundle`,`bundles`],pending:_.isPlaceholderData,newest:ie?{search:ce,to:`/`}:void 0,next:se?{search:se,to:`/`}:void 0,previous:oe?{search:oe,to:`/`}:void 0}):null]}),(0,Z.jsx)(oa,{channels:l,onOpenChange:e=>!e&&T({...p,releaseId:void 0},!1),onShowScope:e=>E({scopeKey:e}),open:!!p.releaseId,releaseId:p.releaseId??``}),(0,Z.jsx)(Lr,{onOpenChange:i,open:r})]})}export{va as component};
1
+ import{$ as e,$n as t,Ar as n,Br as r,Cn as i,Di as a,Ei as o,F as s,Fr as c,H as l,I as u,Ir as d,L as f,Ln as p,M as m,Mr as h,Nn as g,On as _,P as v,Q as y,Qn as b,R as ee,Ri as x,Sn as S,Tr as C,U as w,Un as te,Vi as T,Vr as E,Xn as ne,Zn as re,_ as ie,_r as ae,b as oe,bn as se,dt as ce,et as le,ft as ue,g as de,gn as fe,gr as D,h as O,jr as pe,kr as me,p as he,v as k,vn as A,vr as j,w as ge,wr as M,xn as N,xr as _e,y as P,yn as F}from"./sidebar-BmzmPGuv.js";import{t as I}from"./link-CRMwpc7-.js";import{i as ve,n as L,r as ye}from"./useCompositeListItem-BEDqZ9Ni.js";import{t as be}from"./arrow-right-DjRwIoF1.js";import{t as xe}from"./arrow-up-right-C_1ALUCD.js";import{a as Se,i as R,l as Ce,n as z,o as we,r as B,s as V,t as Te}from"./routes-Z2IGj8MK.js";import{t as Ee}from"./check-C3VCvMOV.js";import{t as H}from"./chevron-down-BkoJHAll.js";import{i as De,r as Oe}from"./TargetDisplay-D0dVdFCk.js";import{t as ke}from"./chevron-right-RAuPv9r1.js";import{a as Ae,d as je,i as U,n as Me,o as Ne,r as Pe,t as Fe,u as W}from"./select-iSWTEY9t.js";import{t as Ie}from"./circle-off-DvYMC5yF.js";import{t as Le}from"./download-CgpaZb23.js";import{t as Re}from"./list-DQ9YBIDW.js";import{t as G}from"./loader-circle-8lunBReu.js";import{E as ze,h as Be,k as Ve,w as He}from"./native-builds-B6t0ZxKP.js";import{t as Ue}from"./plus-DztQIXYL.js";import{n as K,r as We}from"./dist-BEmib-ZM.js";import{t as Ge}from"./rotate-ccw-tITIe0Bd.js";import{n as Ke,t as qe}from"./switch-ByNYRVTN.js";import{t as Je}from"./trash-2-DI0biNI-.js";import{a as Ye,i as Xe,n as Ze,o as Qe,r as $e,t as q}from"./badge-zMibJGR5.js";import{S as et,_ as tt,a as nt,i as rt,r as it,v as at,w as ot,y as st}from"./useAnchoredPopupScrollLock-Cvx6CdPD.js";import{a as ct}from"./insights-search-B4NkHGeC.js";import{a as lt,n as ut,o as dt,r as ft,t as pt}from"./card-BAs80yql.js";import{a as mt,c as ht,d as gt,f as _t,l as vt,n as yt,o as bt,p as xt,s as St,u as Ct}from"./constants-yj-e3ahf.js";import{a as wt,c as Tt,i as Et,n as Dt,r as Ot,t as kt}from"./field-DInLQ5oV.js";import{C as At,S as jt,_ as Mt,a as Nt,b as Pt,c as Ft,i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt,v as Ht,w as Ut,x as Wt,y as Gt}from"./api-znPyglTl.js";import{a as Kt,i as qt,l as Jt,n as Yt,o as Xt,r as Zt,s as Qt,t as $t}from"./alert-dialog-DGPqJBCk.js";import{n as en,t as tn}from"./PlatformIcon-D4KPXCHL.js";import{a as nn,i as rn,n as an,o as on,r as sn,s as cn,t as ln}from"./dialog-BvZDZzdQ.js";import{a as un,i as dn,n as fn,o as pn,t as mn}from"./input-group-CIjTdxCW.js";import{a as hn,i as J,n as gn,o as _n,r as Y,t as vn}from"./table-DbZPkzdz.js";import{t as yn}from"./BundleIdDisplay-CtbmyR7f.js";import{n as bn,t as xn}from"./RowReason-BvIxbpPP.js";import{t as Sn}from"./ChannelPicker-DPR-7lqV.js";import{n as Cn,t as wn}from"./valueToPercent-Db73Kirz.js";import{a as Tn,c as En,d as Dn,f as On,i as kn,l as An,n as jn,o as Mn,p as Nn,r as Pn,s as Fn,t as In,u as Ln}from"./RelativeTime-BQErgQRj.js";import{n as Rn,r as zn,t as Bn}from"./RolloutPercentageBadge-DF4EeZIJ.js";import{t as Vn}from"./HashValueDisplay-DTSMSH9O.js";import{a as Hn,c as Un,i as Wn,n as Gn,o as Kn,r as qn,s as Jn,t as Yn}from"./FoldedRows-ClHLI-NM.js";var Xn=E(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Zn=E(`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`}]]),Qn=E(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),$n=E(`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`}]]),er=E(`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`}]]),tr=o();function nr(){return M}function rr(){return!1}function ir(){return!0}function ar(){return(0,tr.useSyncExternalStore)(nr,rr,ir)}function or(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function sr(e,t){return e-t}function cr(e,t,n){let r=e.slice();return r[t]=n,r.sort(sr)}function lr(e,t,n,r,i,a){let o=e;return o=W(o,n,r),i&&(o=cr(a,t,W(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function ur(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 dr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},X=T(x()),fr=X.createContext(void 0);function pr(){let e=X.useContext(fr);if(e===void 0)throw Error(me(62));return e}var Z=a();function mr(e){return`key`in e?p:g}function hr(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?or(e,t):!1}var gr=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:a,disabled:o=!1,id:s,format:c,largeStep:l=10,locale:u,render:d,max:f=100,min:p=0,minStepsBetweenValues:m=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:ee=`horizontal`,step:x=1,thumbCollisionBehavior:C=`push`,thumbAlignment:w=`center`,value:te,style:T,...E}=e,ne=ue(s),ie=it(ne),ae=h(v),oe=h(y),{clearErrors:ce}=nt(),{state:le,disabled:de,name:fe,setTouched:D,setDirty:O,validityData:me,shouldValidateOnChange:he,validation:k}=et(),{labelId:j}=at(),[M,N]=X.useState(),P=n??rt(j,M),F=de||o,I=fe??_,[L,be]=ve({controlled:te,default:a??p,name:`Slider`}),xe=X.useRef(null),Se=X.useRef(null),R=X.useRef([]),Ce=X.useRef(null),z=X.useRef(null),we=X.useRef(-1),B=X.useRef(null),V=X.useRef(null),Te=X.useRef(`none`),Ee=se(c),[H,De]=X.useState(-1),[Oe,ke]=X.useState(-1),[Ae,je]=X.useState(!1),[U,Me]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=h(e=>{De(e),e!==-1&&ke(e)});st(Se,ne,L),ge(L,()=>{ce(I),he()?k.commit(L):k.commit(L,!0);let e=me.initialValue,t;t=Array.isArray(L)&&Array.isArray(e)?!or(L,e):L!==e,O(t)});let Ie=h(e=>{e&&(Se.current=e)}),Le=Array.isArray(L),Re=X.useMemo(()=>Le?L.slice().sort(sr):[W(L,p,f)],[f,p,Le,L]),G=h((e,t)=>{if(Number.isNaN(e)||hr(e,L))return;let n=t??S(`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,V.current=e,ae(e,n),!n.isCanceled&&be(e)}),ze=h((e,t,n)=>{let r=lr(e,t,p,f,Le,Re);if(ur(r,x,m)){let e=mr(n);G(r,S(e,n.nativeEvent,void 0,{activeThumbIndex:t})),D(!0),oe(V.current??r,i(e,n.nativeEvent))}});pe(()=>{let e=re(A(xe.current));F&&b(xe.current,e)&&e.blur()},[F]),F&&H!==-1&&Fe(-1);let Be=X.useMemo(()=>({...le,activeThumbIndex:H,disabled:F,dragging:Ae,orientation:ee,max:f,min:p,minStepsBetweenValues:m,step:x,values:Re}),[le,H,F,Ae,f,p,m,ee,x,Re]),Ve=X.useMemo(()=>({active:H,controlRef:Se,disabled:F,dragging:Ae,validation:k,formatOptionsRef:Ee,handleInputChange:ze,indicatorPosition:Ne,inset:w!==`center`,labelId:P,rootLabelId:ie,largeStep:l,lastUsedThumbIndex:Oe,lastChangedValueRef:V,lastChangeReasonRef:Te,form:g,locale:u,max:f,min:p,minStepsBetweenValues:m,name:I,onValueCommitted:oe,orientation:ee,pressedInputRef:Ce,pressedThumbCenterOffsetRef:z,pressedThumbIndexRef:we,pressedValuesRef:B,registerFieldControlRef:Ie,renderBeforeHydration:w===`edge`,setActive:Fe,setDragging:je,setIndicatorPosition:Pe,setLabelId:N,setValue:G,state:Be,step:x,thumbCollisionBehavior:C,thumbMap:U,thumbRefs:R,values:Re}),[H,Se,P,ie,F,Ae,k,Ee,ze,Ne,l,Oe,V,Te,g,u,f,p,m,I,oe,ee,Ce,z,we,B,Ie,Fe,je,Pe,N,G,Be,x,C,w,U,R,Re]),He=_e(`div`,e,{state:Be,ref:[t,xe],props:[{"aria-labelledby":P,id:ne,role:`group`},k.getValidationProps,E],stateAttributesMapping:dr});return(0,Z.jsx)(fr.Provider,{value:Ve,children:(0,Z.jsx)(ye,{elementsRef:R,onMapChange:Me,children:He})})});function _r(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function vr(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 yr(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(vr(t),vr(n))))}function br({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]=W(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]=W(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]=W(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function xr({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=W(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,ee=n.map((e,t)=>t===i?h:d[t]??u[t]),x=a;x=v?Math.max(a,n[b]):Math.min(a,n[b]);let S=br({values:n,index:b,nextValue:x,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:ee}),C=v?b-1:b+1;if(C>=0&&C<S.length){let e=S[C-1],t=S[C+1],n=e==null?o:e+f;n=Math.max(n,o+C*f);let r=t==null?s:t-f;r=Math.min(r,s-(S.length-1-C)*f);let i=W(h,n,r);S[C]=Number(i.toFixed(12))}return{value:S,thumbIndex:b,didSwap:!0}}case`push`:return{value:br({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=W(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 Sr=2;function Cr(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 wr(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 Tr=X.forwardRef(function(e,n){let{render:r,className:a,style:o,...s}=e,{disabled:l,dragging:u,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:g,min:v,minStepsBetweenValues:y,onValueCommitted:ee,orientation:x,pressedInputRef:C,pressedThumbCenterOffsetRef:w,pressedThumbIndexRef:T,pressedValuesRef:E,registerFieldControlRef:ne,renderBeforeHydration:ie,setActive:ae,setDragging:oe,setValue:le,state:ue,step:de,thumbCollisionBehavior:fe,thumbRefs:D,values:O}=pr(),pe=ce(),me=O.length>1,he=x===`vertical`,k=X.useRef(null),j=X.useRef(null),ge=h(e=>{e&&j.current==null&&(j.current=c(e).getComputedStyle(e))}),M=X.useRef(null),P=X.useRef(0),I=X.useRef(0),ve=se(O);function L(e){T.current!==e&&(T.current=e);let t=D.current[e];if(!t){w.current=null,C.current=null;return}C.current=t.querySelector(`input[type="range"]`)}function ye(e){let t=k.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=Cr(j.current,he),c=I.current,l=(he?r:n)-s.start-s.end-c*2,u=w.current??0,d=e.x-u,f=e.y-u,p=W(((he?i-f-s.end:(pe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-v)*p+v;if(m=yr(m,de,v),m=W(m,v,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=T.current;if(h<0)return null;let _=xr({behavior:fe,values:O,currentValues:ve.current??O,initialValues:E.current,pressedIndex:h,nextValue:m,min:v,max:g,step:de,minStepsBetweenValues:y});return fe===`swap`&&_.didSwap?L(_.thumbIndex):T.current=_.thumbIndex,_}function be(e){E.current=me?O.slice():null,ve.current=O;let t=T.current,n=t;if(t>-1&&t<O.length){if(O[t]===g){let e=t;for(;e>0&&O[e-1]===g;)--e;n=e}}else{let t=he?`y`:`x`,r;n=-1;for(let i=0;i<D.current.length;i+=1){let a=D.current[i];if(d(a)){let o=_r(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&L(n),f){let e=D.current[n];d(e)&&(I.current=e.getBoundingClientRect()[he?`height`:`width`]/2)}}function xe(e){let t=D.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let Se=h(e=>{let t=wr(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){R(e);return}let n=ye(t);n!=null&&ur(n.value,de,y)&&(!u&&P.current>Sr&&oe(!0),le(n.value,S(_,e,void 0,{activeThumbIndex:n.thumbIndex})),ve.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&xe(n.thumbIndex))});function R(e){ae(-1),oe(!1),C.current=null,w.current=null;let t=wr(e,M),n=t==null?null:ye(t);if(n!=null){let t=m.current;ee(p.current??n.value,i(t,e))}`pointerType`in e&&k.current?.hasPointerCapture(e.pointerId)&&k.current?.releasePointerCapture(e.pointerId),T.current=-1,M.current=null,E.current=null,z()}let Ce=h(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=wr(e,M);if(n!=null){be(n);let t=ye(n);if(t==null)return;xe(t.thumbIndex),le(t.value,S(te,e,void 0,{activeThumbIndex:t.thumbIndex})),ve.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&xe(t.thumbIndex)}P.current=0;let r=A(k.current);r.addEventListener(`touchmove`,Se,{passive:!0}),r.addEventListener(`touchend`,R,{passive:!0})}),z=h(()=>{let e=A(k.current);e.removeEventListener(`pointermove`,Se),e.removeEventListener(`pointerup`,R),e.removeEventListener(`touchmove`,Se),e.removeEventListener(`touchend`,R),E.current=null}),we=F();return X.useEffect(()=>{let e=k.current;if(!e)return()=>z();let t=N(e,`touchstart`,Ce,{passive:!0});return()=>{t(),we.cancel(),z()}},[z,Ce,k,we]),X.useEffect(()=>{l&&z()},[l,z]),_e(`div`,e,{state:ue,ref:[n,ne,k,ge],props:[{"data-base-ui-slider-control":ie?``:void 0,onPointerDown(e){let n=k.current,r=t(e.nativeEvent);if(!n||l||e.defaultPrevented||!d(r)||e.button!==0)return;let i=wr(e,M);if(i!=null){be(i);let t=ye(i);if(t==null)return;b(D.current[t.thumbIndex],re(A(n)))?e.preventDefault():we.request(()=>{xe(t.thumbIndex)}),oe(!0),w.current??(le(t.value,S(te,e.nativeEvent,void 0,{activeThumbIndex:t.thumbIndex})),ve.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&xe(t.thumbIndex))}e.nativeEvent.pointerId&&n.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let a=A(k.current);a.addEventListener(`pointermove`,Se,{passive:!0}),a.addEventListener(`pointerup`,R,{once:!0})}},s],stateAttributesMapping:dr})}),Er=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=pr();return _e(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:dr})}),Dr=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}({}),Or=new Set([...f,w,l]);function kr(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${Cn(e[t],r,n)} start range`:`${Cn(e[t],r,n)} end range`:n?Cn(e[t],r,n):void 0}function Ar(e,t,n,r,i){let a=n===1?e+t:e-t;return W(Number(a.toFixed(Math.max(vr(e),vr(t),vr(r)))),r,i)}var jr=X.forwardRef(function(e,t){let{render:r,children:i,className:a,"aria-describedby":o,"aria-label":d,"aria-labelledby":p,disabled:g=!1,getAriaLabel:_,getAriaValueText:y,id:b,index:x,inputRef:S,onBlur:te,onFocus:T,onKeyDown:E,tabIndex:re,style:ie,...ae}=e,{nonce:oe}=je(),se=ue(b),{active:le,lastUsedThumbIndex:de,controlRef:D,disabled:O,validation:me,formatOptionsRef:he,handleInputChange:k,inset:A,labelId:j,largeStep:ge,locale:M,max:N,min:P,minStepsBetweenValues:F,form:I,name:ve,orientation:ye,pressedInputRef:be,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:Se,renderBeforeHydration:R,setActive:Ce,setIndicatorPosition:z,state:we,step:B,values:V}=pr(),Te=ce(),Ee=g||O,H=V.length>1,De=ye===`vertical`,Oe=Te===`rtl`,{setTouched:ke,setFocused:Ae,validationMode:U}=et(),Me=X.useRef(null),Ne=X.useRef(null),Pe=X.useRef(!1),Fe=ue(),W=tt(),Ie=H?Fe:W,{ref:Le,index:Re}=L({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),G=H?x??Re:0,ze=G===V.length-1,Be=V[G],Ve=wn(Be,P,N),[He,Ue]=X.useState(),K=ar(),We=de>=0&&de<V.length?de:-1,Ge=h(()=>{let e=D.current,t=Me.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=De?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Ve/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ue(s),G===0?z(e=>[s,e[1]]):ze&&z(e=>[e[0],s])});pe(()=>{A&&queueMicrotask(Ge)},[Ge,A]),pe(()=>{A&&Ge()},[Ge,A,Ve]),pe(()=>{if(!A)return;let e=D.current,t=Me.current;if(!e||!t)return;let n=c(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Ge);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[D,Ge,A]);let Ke=De?`bottom`:`insetInlineStart`,qe=De?`left`:`top`,Je;H?le===G?Je=2:We===G&&(Je=1):le===G&&(Je=1);let Ye;Ye=A?{"--position":`${He??0}%`,visibility:R&&K||He===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Ve)?{position:`absolute`,[Ke]:`${Ve}%`,[qe]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Je}:fe;let Xe;ye===`vertical`&&(Xe=Oe?`vertical-rl`:`vertical-lr`);let Ze=typeof _==`function`?_(G):d,Qe=n({"aria-label":Ze,"aria-labelledby":p??(Ze==null?j:void 0),"aria-describedby":o,"aria-orientation":ye,"aria-valuenow":Be,"aria-valuetext":typeof y==`function`?y(Cn(Be,M,he.current??void 0),Be,G):kr(V,G,he.current??void 0,M),disabled:Ee,form:I,id:Ie,max:N,min:P,name:ve,onChange(e){k(e.currentTarget.valueAsNumber,G,e)},onFocus(e){let t=Pe.current;Pe.current=!1,Ce(G),Ae(!0),t&&e.stopPropagation()},onBlur(e){if(Pe.current){e.stopPropagation();return}Me.current&&(Ce(-1),ke(!0),Ae(!1),U===`onBlur`&&me.commit(lr(Be,G,P,N,H,V)))},onKeyDown(e){if(!Or.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=yr(Be,B,P);switch(e.key){case u:t=Ar(n,e.shiftKey?ge:B,1,P,N);break;case s:t=Ar(n,e.shiftKey?ge:B,Oe?-1:1,P,N);break;case m:t=Ar(n,e.shiftKey?ge:B,-1,P,N);break;case v:t=Ar(n,e.shiftKey?ge:B,Oe?1:-1,P,N);break;case w:t=Ar(n,ge,1,P,N);break;case l:t=Ar(n,ge,-1,P,N);break;case`End`:t=N,H&&(t=Number.isFinite(V[G+1])?V[G+1]-B*F:N);break;case ee:t=P,H&&(t=Number.isFinite(V[G-1])?V[G-1]+B*F:P);break;default:break}if(t!==null){let n=e.currentTarget;ne(n)||(Pe.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),k(t,G,e),e.preventDefault()}},step:B,style:{...fe,width:`100%`,height:`100%`,writingMode:Xe},tabIndex:re??void 0,type:`range`,value:Be??``},me.getInputValidationProps),$e=C(Ne,me.inputRef,S);return _e(`div`,e,{state:we,ref:[t,Le,Me],props:[{[Dr.index]:G,children:(0,Z.jsxs)(X.Fragment,{children:[i,(0,Z.jsx)(`input`,{ref:$e,...Qe,suppressHydrationWarning:!0}),A&&K&&R&&ze&&(0,Z.jsx)(`script`,{nonce:oe,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:se,onBlur:te,onFocus:T,onPointerDown(e){if(Se.current=G,Me.current!=null){let t=ye===`horizontal`?`x`:`y`,n=_r(Me.current);xe.current=(ye===`horizontal`?e.clientX:e.clientY)-n[t]}Ne.current!=null&&be.current!==Ne.current&&(be.current=Ne.current)},style:Ye,suppressHydrationWarning:R||void 0},ae],stateAttributesMapping:dr})});function Mr(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 Nr(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 Pr=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{indicatorPosition:o,inset:s,max:c,min:l,orientation:u,renderBeforeHydration:d,state:f,values:p}=pr(),m=ar(),h=u===`vertical`,g=p.length>1,_=s?Mr(h,g,o[0],o[1],d,m):Nr(h,g,wn(p[0],l,c),wn(p[p.length-1],l,c));return _e(`div`,e,{state:f,ref:t,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:_,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:dr})});function Fr({enabled:e,className:t,falseIcon:n=`x`,colorMode:i=`semantic`}){let a=i===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(Ee,{className:j(`h-4 w-4`,a??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(Qn,{className:j(`h-4 w-4`,a??`text-muted-foreground`,t)}):(0,Z.jsx)(r,{className:j(`h-4 w-4`,a??`text-red-600 dark:text-red-400`,t)})}function Ir({panelId:t,bundle:n,bundles:r,loading:i,onDetailClick:a}){let o=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)(q,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),i?(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`}),o?(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)(be,{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)(q,{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)(zn,{uuid:e.id})})]})]}),(0,Z.jsx)(D,{className:`w-full`,onClick:()=>a(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)(be,{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)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(zn,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(D,{onClick:()=>a(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 Lr({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(null),o=Ke(i),{data:s=[],isPending:c}=It(),l=Rt(),u=Bt(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?K.success(`Channel ${e.row.name} created`):K.info(`Channel ${e.row.name} already exists`)}catch(e){K.error(`Failed to create channel`),console.error(e)}},p=async()=>{if(!(!i||u.isPending))try{let e=await u.mutateAsync({id:i.id});e.deleted?K.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?K.error(`Channel ${i.name} is still in use and cannot be deleted`):K.error(`Channel ${i.name} no longer exists`),a(null)}catch(e){K.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ln,{open:e,onOpenChange:t,children:(0,Z.jsxs)(an,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(nn,{children:[(0,Z.jsxs)(on,{className:`flex items-center gap-2`,children:[(0,Z.jsx)($n,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(sn,{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:f,children:(0,Z.jsx)(Et,{className:`gap-2`,children:(0,Z.jsxs)(kt,{orientation:`horizontal`,children:[(0,Z.jsx)(wt,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(y,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(D,{className:`max-md:h-11`,type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(G,{"data-icon":`inline-start`,className:`animate-spin motion-reduce:animate-none`}):(0,Z.jsx)(Ue,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:c?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(G,{className:`mr-2 size-3.5 animate-spin motion-reduce:animate-none`}),`Loading channels`]}):s.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:s.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`,title:e.name,children:e.name}),(0,Z.jsx)(D,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>a(e),className:`text-muted-foreground hover:text-destructive max-md:size-11`,children:(0,Z.jsx)(Je,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)($t,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&a(null)},children:(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsxs)(Jt,{children:[`Delete `,o?.name,`?`]}),(0,Z.jsx)(Kt,{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)(Xt,{children:[(0,Z.jsx)(Zt,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(Yt,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Rr=`[a-zA-Z0-9-]`,zr=String.raw`0|[1-9]\d*`,Br=String.raw`\d+`,Vr=String.raw`\d*[a-zA-Z-]${Rr}*`,Hr=String.raw`(${zr})\.(${zr})\.(${zr})`,Ur=String.raw`(${Br})\.(${Br})\.(${Br})`,Wr=`(?:${Vr}|${zr})`,Gr=`(?:${Vr}|${Br})`,Kr=String.raw`(?:-(${Wr}(?:\.${Wr})*))`,qr=String.raw`(?:-?(${Gr}(?:\.${Gr})*))`,Jr=`${Rr}+`,Yr=String.raw`(?:\+(${Jr}(?:\.${Jr})*))`,Xr=`v?${Hr}${Kr}?${Yr}?`,Zr=String.raw`[v=\s]*${Ur}${qr}?${Yr}?`,Qr=`((?:<|>)?=?)`,$r=String.raw`${zr}|x|X|\*`,ei=String.raw`${Br}|x|X|\*`,ti=String.raw`[v=\s]*(${$r})(?:\.(${$r})(?:\.(${$r})(?:${Kr})?${Yr}?)?)?`,ni=String.raw`[v=\s]*(${ei})(?:\.(${ei})(?:\.(${ei})(?:${qr})?${Yr}?)?)?`,ri=`(?:~>?)`,ii=String.raw`(?:\^)`,ai=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${ai}(?:$|[^\d])`,String.raw`${ai}(?:${Kr})?(?:${Yr})?(?:$|[^\d])`;function oi(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Rr,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(oi(e),t)}var si=Q(`^${Xr}$`),ci=Q(`^${Zr}$`),li=/^\d+$/;function ui(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function di(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?ci:si);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(li.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 fi=Q(String.raw`^${Qr}\s*(${Xr})$|^$`),pi=Q(String.raw`^${Qr}\s*(${Zr})$|^$`);function mi(e){return e.version?`${e.operator}${ui(e.version)}`:``}function hi(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?pi:fi);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?di(r[2],t):null;return{operator:i,options:t,value:a?`${i}${ui(a)}`:``,version:a}}function gi(e){return e.sets.map(e=>e.map(mi).join(` `)).join(`||`)}var _i=new RegExp(Yr,`g`),vi=Q(Yr),yi=Q(String.raw`^\s*(${ti})\s+-\s+(${ti})\s*$`),bi=Q(String.raw`^\s*(${ni})\s+-\s+(${ni})\s*$`),xi=Q(String.raw`(\s*)${Qr}\s*(${Zr}|${ti})`,`g`),Si=Q(String.raw`(\s*)${ri}\s+`,`g`),Ci=Q(String.raw`(\s*)${ii}\s+`,`g`),wi=Q(`^${ri}${ti}$`),Ti=Q(`^${ri}${ni}$`),Ei=Q(`^${ii}${ti}$`),Di=Q(`^${ii}${ni}$`),Oi=Q(String.raw`^${Qr}\s*${ti}$`),ki=Q(String.raw`^${Qr}\s*${ni}$`),Ai=Q(String.raw`(<|>)?=?\s*\*`),ji=/^\s*>=\s*0\.0\.0\s*$/,Mi=/^\s*>=\s*0\.0\.0-0\s*$/,Ni=Q(String.raw`^${Qr}\s*(${Zr})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Pi(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Fi(e,t){let n=t.loose?Ti:wi,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 Ii(e,t){return e.trim().split(/\s+/).map(e=>Fi(e,t)).join(` `)}function Li(e,t){let n=t.loose?Di:Ei,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 Ri(e,t){return e.trim().split(/\s+/).map(e=>Li(e,t)).join(` `)}function zi(e,t){let n=t.loose?ki:Oi;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Pi(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 Bi(e,t){return e.split(/\s+/).map(e=>zi(e,t)).join(` `)}function Vi(e,t){let n=t.loose?bi:yi;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 Hi(e,t){return Bi(Ii(Ri(e.replace(vi,``),t),t),t).trim().replace(Ai,``)}function Ui(e,t){let n=Vi(e.replace(_i,``),t).replace(xi,`$1$2$3`).replace(Si,`$1~`).replace(Ci,`$1^`).split(` `).map(e=>Hi(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Mi:ji,``));t.loose&&(n=n.filter(e=>Ni.test(e)));let r=new Map;for(let e of n.map(e=>hi(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 Wi(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Ui(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 Gi(e,t={}){try{return Wi(e,t)}catch{return null}}function Ki(e,t={}){let n=Gi(e,t);return n?gi(n)||`*`:null}function qi({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 Ji({bundle:e,release:t}){let{data:n,isFetched:r}=Nt(),i=e?Ct(e):null,a=e?vt(e):null,o=e?.gitCommitHash&&r?Rn(n?.console.gitUrl,e.gitCommitHash):null,s=r&&!!e?.gitCommitHash&&!n?.console.gitUrl?.trim(),c=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return c||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(lt,{className:`p-4 pb-3`,children:(0,Z.jsx)(dt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(qi,{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:c??`—`})}),e?.gitCommitHash?(0,Z.jsx)(qi,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(Vn,{className:o?`text-primary`:void 0,hint:s?(0,Z.jsxs)(Z.Fragment,{children:[`Set `,(0,Z.jsx)(`code`,{className:`font-mono`,children:`console.gitUrl`}),` `,`in your config to open commits in your repository.`,` `,(0,Z.jsx)(`a`,{className:`font-medium underline underline-offset-2`,href:yt,rel:`noopener noreferrer`,target:`_blank`,children:`Learn more`})]}):void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`relative shrink-0 text-primary after:absolute after:-inset-2.5 hover:underline md:after:hidden`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(Xn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(qi,{label:`Manifest hash`,value:(0,Z.jsx)(Vn,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(qi,{label:`Base hash`,value:(0,Z.jsx)(Vn,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(qi,{label:`Patch hash`,value:(0,Z.jsx)(Vn,{maxLength:16,value:i})}):null]})})]}):null}var Yi=Array.from({length:bt},(e,t)=>t+1);function Xi({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=xt(t),i=n??[],a=i.length>0,o=r>0&&r<1e3,s=r===bt,c=O(),l=s?Yi:o?Yi.filter(t=>St(e,t)<r):[],u=(r/10).toFixed(1),d=s?bt:l.length,f=bt-d,p=(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)(pt,{children:(0,Z.jsxs)(lt,{className:`p-4`,children:[(0,Z.jsx)(ft,{children:`Selected cohorts`}),(0,Z.jsx)(dt,{className:`font-mono text-2xl tabular-nums`,children:d})]})}),(0,Z.jsx)(pt,{children:(0,Z.jsxs)(lt,{className:`p-4`,children:[(0,Z.jsx)(ft,{children:`Excluded cohorts`}),(0,Z.jsx)(dt,{className:`font-mono text-2xl tabular-nums`,children:f})]})})]}),a?(0,Z.jsxs)(pt,{children:[(0,Z.jsxs)(lt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(dt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(ft,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(ut,{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:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(lt,{className:`p-4 pb-3`,children:(0,Z.jsx)(dt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(ut,{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:l.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:l.map(e=>(0,Z.jsx)(q,{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)(ln,{children:[(0,Z.jsxs)(cn,{render:(0,Z.jsx)(D,{className:`max-md:h-11`,size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Re,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(an,{className:c?`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:c?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(nn,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(on,{children:`Rolled out cohorts`}),(0,Z.jsxs)(sn,{children:[u,`% includes `,d,` of`,` `,bt,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:p}),(0,Z.jsx)(rn,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(nn,{children:[(0,Z.jsx)(on,{children:`Rolled out cohorts`}),(0,Z.jsxs)(sn,{children:[u,`% includes `,d,` of`,` `,bt,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),p,(0,Z.jsx)(rn,{showCloseButton:!0})]})})]})}function Zi({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&&ze(i)!==null,o=Wt(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:[He(s.platform),` `,Be[s.artifact_kind].label,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono`,translate:`no`,children:s.min_bundle_id}),(0,Z.jsx)(xe,{"aria-hidden":`true`,className:`size-3`})]}),r?(0,Z.jsx)(q,{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:`relative underline-offset-4 after:absolute after:-inset-x-2 after:-inset-y-4 hover:text-foreground hover:underline md:after:hidden`,search:{channel:n},to:`/native-builds`,children:`This channel's builds`})]})]})}function Qi({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)(gr,{className:j(`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)(Tr,{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)(Er,{"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)(Pr,{"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)(jr,{"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 max-md:after:-inset-3.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var $i=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],ea=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]}),ta=(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}),na=e=>(e/10).toFixed(1),ra=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},ia=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function aa({value:e,onChange:t}){let[n,r]=(0,X.useState)(na(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(na(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Qi,{"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)(mn,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(dn,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=ia(n)??e;a(!1),r(na(i)),t(i)},onChange:e=>{let n=ra(e.target.value);r(n);let i=ia(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(fn,{align:`inline-end`,children:(0,Z.jsx)(un,{children:`%`})})]})]})}function oa({channels:t,onOpenChange:n,onShowScope:i,open:a,releaseId:o}){let s=jt(o),c=s.data,l=zt(c?.bundle_id??``),u=l.data,d=u?ht(u):null,f=Gt(c?.scope_key??``),p=Ut(),m=Mt(),h=Ft(),g=Ht(),[_,v]=(0,X.useState)(null),[b,ee]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[te,T]=(0,X.useState)(!1),[E,ne]=(0,X.useState)(!1),[re,ae]=(0,X.useState)(``),[se,ce]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?ea(c):null),S(``)},[c]);let ue=c?ea(c):null,fe=_!==null&&ue!==null&&JSON.stringify(_)!==JSON.stringify(ue),O=m.isPending||p.isPending||h.isPending||g.isPending,pe=()=>{if(!O){if(fe){w(!0);return}n(!1)}},me=()=>{if(!_)return;let e=_t(b);if(!gt(e)){S(mt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),ee(``),S(``)},he=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(_t);if(e.some(e=>!gt(e))){S(mt);return}if(c.strategy===`APP_VERSION`&&!Ki(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:ta(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),K.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,j=t.filter(e=>e.id!==c?.channel_id),ge=j.map(e=>({label:e.name,value:e.name})),M=re.trim(),N=se===`copy`,_e=_?Ki(_.targetAppVersion.trim()):null,F=()=>{ae(``),ce(`move`)},I=e=>{!e&&g.isPending||(ne(e),e||F())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(de,{onOpenChange:e=>e?void 0:pe(),open:a,children:(0,Z.jsxs)(ie,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(P,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(oe,{children:`Bundle Detail`}),(0,Z.jsx)(k,{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)(tn,{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,label:c.label,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:A})]}),A?(0,Z.jsx)(Zi,{bundle:u,channel:A,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)(Ze,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Xe,{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:[A?(0,Z.jsx)(V,{release:{platform:c.platform,channel:A,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)(Et,{className:`gap-6`,children:[(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(wt,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(pn,{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)(kt,{children:[(0,Z.jsx)(wt,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(y,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),_e?(0,Z.jsx)(Dt,{children:_e}):null]}):null,(0,Z.jsx)(kt,{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)(wt,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(ct,{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)(qe,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(kt,{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)(wt,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(ct,{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)(qe,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(wt,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(aa,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(kt,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(wt,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Xi,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(y,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>ee(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),me())},placeholder:`e.g. qa-team…`,value:b}),(0,Z.jsx)(D,{"aria-label":`Add cohort`,className:`max-md:size-11`,disabled:!b.trim(),onClick:me,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ue,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(q,{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)(r,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Dt,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Ot,{children:x}):null,(0,Z.jsx)(D,{className:`w-full max-md:h-11`,disabled:!fe||O,onClick:he,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(le,{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)(D,{className:`w-full max-md:h-11`,disabled:!c.bundle_id||O,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(D,{className:`w-full max-md:h-11`,disabled:O,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),K.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Le,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(D,{className:`w-full max-md:h-11`,disabled:c.enabled||O,onClick:()=>T(!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)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Build details are unavailable`}),(0,Z.jsx)(Xe,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(Ji,{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}),i?(0,Z.jsx)(D,{className:`mt-1 h-auto px-0 text-xs max-md:min-h-11`,onClick:()=>i(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)($t,{onOpenChange:w,open:C,children:(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(Jt,{children:`Discard unsaved changes?`}),(0,Z.jsx)(Kt,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(Xt,{children:[(0,Z.jsx)(Zt,{children:`Keep editing`}),(0,Z.jsx)(Yt,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)($t,{onOpenChange:T,open:te,children:(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsxs)(Jt,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(Kt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(Xt,{children:[(0,Z.jsx)(Zt,{children:`Cancel`}),(0,Z.jsx)(Yt,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),K.success(`Bundle removed from ${A??`the channel`}`),T(!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)(ln,{onOpenChange:I,open:E,children:(0,Z.jsxs)(an,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(nn,{children:[(0,Z.jsx)(on,{children:`Promote to Channel`}),(0,Z.jsx)(sn,{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)(Tt,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(Fe,{disabled:g.isPending,items:$i,onValueChange:e=>ce(e),value:se,children:[(0,Z.jsx)(Ae,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(Ne,{placeholder:`Select an action`})}),(0,Z.jsx)(Me,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(U,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(U,{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)(Tt,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(Fe,{disabled:g.isPending,items:ge,onValueChange:e=>ae(e??``),value:re||null,children:[(0,Z.jsx)(Ae,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(Ne,{placeholder:`Select a channel`})}),(0,Z.jsx)(Me,{className:`md:max-h-64`,children:(0,Z.jsx)(Pe,{children:j.map(e=>(0,Z.jsx)(U,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(rn,{children:[(0,Z.jsx)(D,{disabled:g.isPending,onClick:()=>I(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(D,{disabled:!M||g.isPending,onClick:async()=>{if(c)try{let e=await g.mutateAsync({action:se,expectedRevision:c.revision,releaseId:c.id,targetChannel:M});I(!1);let t=e.target.release?.label,n=typeof t==`number`?` as v${t}`:``;K.success(N?`Bundle copied to ${M}${n}`:`Bundle moved to ${M}${n}`)}catch(e){K.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?N?`Copying…`:`Moving…`:N?`Copy`:`Move`})]})]})})]})}function sa({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(Ee,{className:`size-3`}):(0,Z.jsx)(Ie,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}var ca={data:void 0,error:null,isError:!1,isPending:!0,isPlaceholderData:!1},la={one:`unreachable bundle`,other:`unreachable bundles`},ua=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],da=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}];function fa({channels:e,clearable:t,onChange:n,onClear:i,onManageChannels:a,pending:o,search:s}){let c=s.channelId!==void 0;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)(he,{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)(Zn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsx)(Sn,{allChannels:!0,className:`max-sm:order-1 max-sm:min-w-0 max-sm:basis-full`,onValueChange:t=>n(t===void 0?{channelId:void 0,channels:`all`}:{channelId:e.find(e=>e.name===t)?.id??t}),pending:o,value:s.channelId===void 0?void 0:e.find(({id:e})=>e===s.channelId)?.name??s.channelId}),(0,Z.jsxs)(Fe,{disabled:!c,items:ua,onValueChange:e=>n({platform:e===`android`?`android`:`ios`}),value:s.platform??`ios`,children:[(0,Z.jsx)(Ae,{"aria-label":`Platform`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-sm data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:text-xs sm:data-[size=default]:h-8`,title:c?void 0:`Choose a channel first`,children:(0,Z.jsx)(Ne,{})}),(0,Z.jsx)(Me,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(U,{value:`ios`,children:`iOS`}),(0,Z.jsx)(U,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(Fe,{disabled:!c&&s.scopeKey===void 0,items:da,onValueChange:e=>n({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:s.enabled===void 0?`all`:s.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(Ae,{"aria-label":`Status`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-sm data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:text-xs sm:data-[size=default]:h-8`,children:(0,Z.jsx)(Ne,{})}),(0,Z.jsx)(Me,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(U,{value:`all`,children:`Any Status`}),(0,Z.jsx)(U,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(U,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(D,{"aria-label":`Manage channels`,className:`size-11 max-sm:ml-auto sm:size-7`,onClick:a,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(er,{})}),s.bundleId?(0,Z.jsxs)(q,{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:()=>n({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,s.scopeKey?(0,Z.jsxs)(q,{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:()=>n({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,t?(0,Z.jsxs)(D,{className:`h-11 px-2 text-xs text-muted-foreground hover:text-foreground max-sm:order-3 sm:ml-auto sm:h-8`,onClick:i,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(r,{"data-icon":`inline-start`}),`Clear`]}):null]})}function pa({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=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)(D,{"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)(H,{}):(0,Z.jsx)(ke,{})}):(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,label:r.label}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(Ge,{className:`size-3.5`}),` Built-in bundle`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsx)(xn,{icon:Ie,label:`Unreachable: no device gets this bundle with the current delivery settings.`,reason:`No device gets this bundle with the current delivery settings.`,children:`Unreachable`}):null]})}function ma({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=zt(i),o=Lt(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)(Ir,{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 ha(e,t){return{patchCounts:Vt(Array.from(new Set(e.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},slotReleases:e.flatMap(e=>{let n=t.find(t=>t.id===e.channel_id)?.name;return n?[{releaseId:e.id,platform:e.platform,channel:n,builtIn:!e.bundle_id}]:[]})}}var ga=(e,t)=>t>=e.to&&(e.from===void 0||t<e.from);function _a({fold:e,filter:t,channels:n,columns:r,isMobile:i,open:a,onOpenChange:o,render:s}){let c=Pt(t,{...e.from===void 0?{}:{from:e.from},to:e.to},a),l=c.data?.pages.flatMap(e=>e.rows)??[],u=ha(l,n),d=i?void 0:r,f=c.isError?(0,Z.jsx)(qn,{columns:d,label:`Unreachable bundles`,onRetry:()=>void c.refetch(),state:`error`}):c.isPending||c.isFetchingNextPage?(0,Z.jsx)(qn,{columns:d,label:`Loading unreachable bundles`,state:`loading`}):c.hasNextPage?(0,Z.jsx)(qn,{columns:d,label:`Unreachable bundles`,onMore:()=>void c.fetchNextPage(),state:`more`}):null,p={label:Hn(e,la),open:a,onOpenChange:o,panelId:`bundle-fold-${e.to}`};return i?(0,Z.jsxs)(Yn,{...p,children:[l.map(e=>s(e,u)),f]}):(0,Z.jsxs)(Gn,{...p,columns:r,children:[l.map(e=>s(e,u)),f]})}function va(){let e=Te.useSearch(),t=Te.useNavigate(),n=O(),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(),s=Un(),c=It(),l=c.data??[],u=c.data,d=R(e,u),f=d===void 0&&c.isError,p=d??e,m=B(p),h=At({afterReleaseId:p.afterReleaseId,beforeReleaseId:p.beforeReleaseId,filter:m,releaseId:p.releaseId},{enabled:d!==void 0}),g=!Se(e,u),_=d===void 0?ca:h,v=_.data?.entries??[],y=v.flatMap(e=>e.kind===`row`?[e.row]:[]),b=ha(y,l),ee=_.data?.next,x=_.data?.previous,S=Ce(),C=10+S.length,w=new Map(l.map(e=>[e.id,e.name])),te=a!==void 0&&(e=>y.some(t=>t.id===e)||v.some(t=>t.kind===`fold`&&s.isOpen(Wn(t))&&ga(t,e)))(a);(0,X.useEffect)(()=>{a!==void 0&&!te&&o(void 0)},[a,te]);let T=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),E=e=>T(we(p,e)),ne=e=>{y.some(({id:t})=>t===e.id)||s.set(e.id,!0),T({...p,releaseId:e.id},!1)},re=e=>{let t=y.find(t=>t.bundle_id===e.id);if(o(void 0),t){T({...p,releaseId:t.id},!1);return}E({bundleId:e.id})},ie=p.afterReleaseId!==void 0||p.beforeReleaseId!==void 0,oe=x?{...p,afterReleaseId:`after`in x?x.after:void 0,beforeReleaseId:`before`in x?x.before:void 0,releaseId:void 0}:null,se=ee?{...p,afterReleaseId:void 0,beforeReleaseId:ee,releaseId:void 0}:null,ce={...p,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0},le=(e,t)=>{let n=w.get(e.channel_id)??e.channel_id,r=e.bundle_id?t.patchCounts[e.bundle_id]:0,i=te&&a===e.id,s=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(jn,{"aria-label":`Bundle ${e.id}`,className:j(`gap-3`,e.currentlyUnreachable&&`bg-muted/60 saturate-50 hover:bg-muted/60 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":p.releaseId===e.id?`selected`:void 0,onClick:Nn(()=>ne(e)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(pa,{expanded:i,onOpen:()=>ne(e),onToggleExpand:()=>o(i?void 0:e.id),release:e}),(0,Z.jsx)(bn,{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)(tn,{className:`size-4`,platform:e.platform}),e.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)(In,{ms:e.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)(Bn,{percentage:e.rollout_cohort_count/10}),(0,Z.jsx)(sa,{release:e}),e.should_force_update?(0,Z.jsx)(q,{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)(Oe,{appVersion:e.target_app_version,fingerprintHash:e.fingerprint_hash})]})]}),S.map(({Cell:n,feature:r,label:i})=>(0,Z.jsxs)(`div`,{className:`mt-3 text-xs`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:i}),(0,Z.jsx)(n,{releaseId:e.id,releases:t.slotReleases})]},r)),e.message?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.message}):null]}),i&&e.bundle_id?(0,Z.jsx)(ma,{onDetailClick:re,panelId:s,release:e}):null]},e.id)},ue=(e,t)=>{let n=te&&a===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(Dn,{"aria-label":`Open bundle ${e.id}`,className:j(e.currentlyUnreachable&&`bg-muted/60 saturate-50 hover:bg-muted/60 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":p.releaseId===e.id?`selected`:void 0,onOpen:()=>ne(e),children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(pa,{expanded:n,onOpen:()=>ne(e),onToggleExpand:()=>o(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:w.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsx)(en,{platform:e.platform})}),(0,Z.jsx)(Y,{children:e.bundle_id&&t.patchCounts[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&t.patchCounts[e.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[t.patchCounts[e.bundle_id],` `,t.patchCounts[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Oe,{appVersion:e.target_app_version,fingerprintHash:e.fingerprint_hash})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Fr,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Fr,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Bn,{percentage:e.rollout_cohort_count/10})}),S.map(({Cell:n,feature:r})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(n,{releaseId:e.id,releases:t.slotReleases})},r)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(In,{ms:e.created_at_ms})})]}),n&&e.bundle_id?(0,Z.jsx)(_n,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:C,children:(0,Z.jsx)(ma,{onDetailClick:re,panelId:r,release:e})})}):null]},e.id)},de=(e,t)=>(0,Z.jsx)(_a,{channels:l,columns:C,filter:m,fold:e,isMobile:n,onOpenChange:t=>s.set(Wn(e),t),open:s.isOpen(Wn(e)),render:t},`fold-${e.to}`),fe=(0,Z.jsxs)(Z.Fragment,{children:[`No `,p.platform===`android`?`Android`:`iOS`,` bundles in`,` `,(0,Z.jsx)(`span`,{translate:`no`,children:w.get(p.channelId??``)??p.channelId})]}),pe=(0,Z.jsx)(Fn,{icon:Ve,title:y.length===0&&v.length>0?`No device gets the bundles here`:ie?`No more bundles`:z(p)?g?`No bundles match these filters`:fe:`No bundles yet`,children:ie?(0,Z.jsx)(I,{className:ae({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:ce,to:`/`,children:`Show the newest bundles`}):g?(0,Z.jsx)(D,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>T({}),variant:`outline`,children:`Clear filters`}):z(p)?(0,Z.jsx)(D,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>E({channelId:void 0,channels:`all`}),variant:`outline`,children:`Show all channels`}):(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)(De,{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)(fa,{channels:l,clearable:g,onChange:E,onClear:()=>T({}),onManageChannels:()=>i(!0),pending:d===void 0,search:p}),(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:[f?(0,Z.jsxs)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Channels couldn't be loaded`}),(0,Z.jsx)(Xe,{children:`Bundles show once the channels load.`}),(0,Z.jsx)($e,{children:(0,Z.jsxs)(D,{className:`min-h-11 sm:min-h-7`,onClick:()=>void c.refetch(),size:`xs`,variant:`outline`,children:[(0,Z.jsx)(We,{"data-icon":`inline-start`}),`Retry`]})})]}):_.isError?(0,Z.jsxs)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Xe,{children:_.error?.message})]}):(0,Z.jsx)(En,{children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:_.isPending?(0,Z.jsx)(Pn,{}):(0,Z.jsxs)(Z.Fragment,{children:[y.length===0?(0,Z.jsx)(kn,{children:pe}):null,v.map(e=>e.kind===`row`?le(e.row,b):de(e,le))]})}):(0,Z.jsx)(Tn,{rowGroups:!0,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`}),S.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:_.isPending?(0,Z.jsx)(Mn,{children:(0,Z.jsx)(On,{columns:C})}):(0,Z.jsxs)(Z.Fragment,{children:[y.length===0?(0,Z.jsx)(Mn,{children:(0,Z.jsx)(An,{columns:C,children:pe})}):null,Jn(v).map(e=>e.kind===`fold`?de(e.fold,ue):(0,Z.jsx)(Mn,{children:e.rows.map(e=>ue(e,b))},`rows-${e.rows[0].id}`))]})})}),!f&&!_.isError&&!_.isPending?(0,Z.jsx)(Ln,{count:y.length,folded:{...Kn(v),label:`unreachable`},label:`Bundle pagination`,noun:[`bundle`,`bundles`],pending:_.isPlaceholderData,newest:ie?{search:ce,to:`/`}:void 0,next:se?{search:se,to:`/`}:void 0,previous:oe?{search:oe,to:`/`}:void 0}):null]}),(0,Z.jsx)(oa,{channels:l,onOpenChange:e=>!e&&T({...p,releaseId:void 0},!1),onShowScope:e=>E({scopeKey:e}),open:!!p.releaseId,releaseId:p.releaseId??``}),(0,Z.jsx)(Lr,{onOpenChange:i,open:r})]})}export{va as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-C7Pv3Cfg.js","assets/sidebar-BmzmPGuv.js","assets/useCompositeListItem-BEDqZ9Ni.js","assets/link-CRMwpc7-.js","assets/alert-dialog-DGPqJBCk.js","assets/ChannelPicker-DPR-7lqV.js","assets/useAnchoredPopupScrollLock-Cvx6CdPD.js","assets/check-C3VCvMOV.js","assets/chevron-down-BkoJHAll.js","assets/dist-BEmib-ZM.js","assets/input-group-CIjTdxCW.js","assets/api-znPyglTl.js","assets/useMutation-D7IuoOLE.js","assets/constants-yj-e3ahf.js","assets/select-iSWTEY9t.js","assets/switch-ByNYRVTN.js","assets/valueToPercent-Db73Kirz.js","assets/arrow-right-DjRwIoF1.js","assets/arrow-up-right-C_1ALUCD.js","assets/TargetDisplay-Ctuz3qIp.js","assets/copy-BjVLMKbo.js","assets/key-round-BkeLvA1m.js","assets/native-builds-B_pQ4D5H.js","assets/HashValueDisplay-DTSMSH9O.js","assets/chevron-right-RAuPv9r1.js","assets/circle-off-DvYMC5yF.js","assets/download-CgpaZb23.js","assets/list-DQ9YBIDW.js","assets/loader-circle-8lunBReu.js","assets/plus-DztQIXYL.js","assets/rotate-ccw-tITIe0Bd.js","assets/trash-2-DI0biNI-.js","assets/badge-zMibJGR5.js","assets/BundleIdDisplay-C0X-k49t.js","assets/RowReason-BvIxbpPP.js","assets/RelativeTime-m-FKh1Jb.js","assets/relativeTime-RUNbaMyO.js","assets/table-DbZPkzdz.js","assets/FoldedRows-1NvB9gAS.js","assets/insights-search-B4NkHGeC.js","assets/insights-api-C4Dmm34n.js","assets/PlatformIcon-D4KPXCHL.js","assets/RolloutPercentageBadge-DF4EeZIJ.js","assets/card-BAs80yql.js","assets/dialog-BvZDZzdQ.js","assets/field-DInLQ5oV.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,Di as t,Hr as n,Oi as r,Vr as i,_r as a,et as o,vr as s,wi as c,zr as ee}from"./sidebar-BmzmPGuv.js";import{t as l}from"./link-CRMwpc7-.js";import{a as u,c as d,s as f}from"./useCompositeListItem-BEDqZ9Ni.js";import{a as p,i as te,o as m}from"./console-features-api-CtbGqKyr.js";import{_ as h,m as g,s as _,x as v}from"./insights-api-C4Dmm34n.js";import{t as y}from"./key-round-BkeLvA1m.js";import{i as b}from"./switch-ByNYRVTN.js";import{a as x,t as S}from"./insights-search-B4NkHGeC.js";import{a as C,i as w,n as T,o as E,t as D}from"./card-BAs80yql.js";import{r as O}from"./constants-yj-e3ahf.js";var k=i(`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=t(),j={apiKeys:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(l,{to:`/api-keys`,onClick:e})}}},M=c({method:`GET`}).middleware([ee]).handler(r(`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 n({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)(x,{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:r,variant:i=`inline`}){if(!t)return n?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:i===`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 a=r?.builtIn===!0,o=a?0:I(t),c=(0,A.jsx)(`dl`,{className:s(i===`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:r})=>(0,A.jsxs)(`div`,{className:s(`flex`,i===`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:s(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,i===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[n]>0&&!(n===`downloads`&&a)?r:`text-muted-foreground`),children:[n===`downloads`&&a?(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:s(`flex`,i===`card`?`flex-col gap-2`:`items-center gap-1`),children:[r?(0,A.jsx)(l,{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:r.platform,channel:r.channel,releaseId:r.releaseId,bundleWindow:S(r.releaseId)},children:c}):c,i===`card`&&o>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[o.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,i===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let n=_({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),r=n.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[r?(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:s(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,r.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[r.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,h(g(r)),`)`]})]})]})}):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)(x,{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)(D,{children:[(0,A.jsxs)(C,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(E,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(T,{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)(o,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(w,{className:`px-4 pb-4`,children:(0,A.jsxs)(l,{className:a({className:`max-md:h-11`,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 te(`insightsAnalytics`)?null:(0,A.jsxs)(D,{children:[(0,A.jsx)(C,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(E,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(T,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function ne({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 H={Cell:ne},U={insights:{navigation:{icon:(0,A.jsx)(v,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(l,{to:`/insights`,onClick:t}):(0,A.jsx)(l,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:H,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},W={remoteConfig:{navigation:{icon:(0,A.jsx)(b,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(l,{to:`/remote-config`,onClick:e})}}},G={...U,...j,...W},K=Object.keys(m),q=()=>{let e=p().data?.features;return e===void 0?[]:K.flatMap(t=>{let n=G[t];return n!==void 0&&e[t]?[{...n,feature:t,label:m[t].label,features:e}]:[]})},J=()=>q().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function Y({release:e}){return q().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var X=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Z(e){let t=X(e.beforeReleaseId),n=t?void 0:X(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=X(e.bundleId),a=i?void 0:X(e.scopeKey),o=i||a?void 0:X(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,channels:!i&&!a&&!o&&e.channels===`all`?`all`:void 0,enabled:a||o?r:void 0,platform:s,releaseId:X(e.releaseId),scopeKey:a}}function Q(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 re(e){return Q(e).kind!==`all`}function $(e,t){if(e.bundleId||e.scopeKey||e.channelId||e.channels===`all`)return e;if(e.releaseId)return{...e,channels:`all`};if(t===void 0)return;let n=t.find(({name:e})=>e===O);return n?Z({...e,channelId:n.id}):e}function ie(e,t){let n={...e,...t};return t.bundleId?Z({bundleId:n.bundleId}):t.scopeKey?Z({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Z({channelId:n.channelId,channels:n.channels,enabled:n.enabled,platform:n.platform}):Z({bundleId:n.bundleId,channelId:n.channelId,channels:n.channels,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}function ae(e,t){let n=$(e,t),r=$({},t);return n===void 0||r===void 0||JSON.stringify(Q(n))===JSON.stringify(Q(r))}var oe=d(`/`)({component:f(()=>u(()=>import(`./routes-C7Pv3Cfg.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,38,39,40,41,42,43,44,45])),`component`),validateSearch:Z});export{ae as a,q as c,$ as i,J as l,re as n,ie as o,Q as r,Y as s,oe as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-DMooqgLf.js","assets/sidebar-BmzmPGuv.js","assets/useCompositeListItem-BEDqZ9Ni.js","assets/link-CRMwpc7-.js","assets/alert-dialog-DGPqJBCk.js","assets/ChannelPicker-DPR-7lqV.js","assets/useAnchoredPopupScrollLock-Cvx6CdPD.js","assets/check-C3VCvMOV.js","assets/chevron-down-BkoJHAll.js","assets/dist-BEmib-ZM.js","assets/input-group-CIjTdxCW.js","assets/api-znPyglTl.js","assets/useMutation-D7IuoOLE.js","assets/constants-yj-e3ahf.js","assets/select-iSWTEY9t.js","assets/switch-ByNYRVTN.js","assets/valueToPercent-Db73Kirz.js","assets/arrow-right-DjRwIoF1.js","assets/arrow-up-right-C_1ALUCD.js","assets/TargetDisplay-D0dVdFCk.js","assets/copy-BjVLMKbo.js","assets/key-round-BkeLvA1m.js","assets/native-builds-B6t0ZxKP.js","assets/HashValueDisplay-DTSMSH9O.js","assets/chevron-right-RAuPv9r1.js","assets/circle-off-DvYMC5yF.js","assets/download-CgpaZb23.js","assets/list-DQ9YBIDW.js","assets/loader-circle-8lunBReu.js","assets/plus-DztQIXYL.js","assets/rotate-ccw-tITIe0Bd.js","assets/trash-2-DI0biNI-.js","assets/badge-zMibJGR5.js","assets/BundleIdDisplay-CtbmyR7f.js","assets/RowReason-BvIxbpPP.js","assets/RelativeTime-BQErgQRj.js","assets/relativeTime-RUNbaMyO.js","assets/table-DbZPkzdz.js","assets/FoldedRows-ClHLI-NM.js","assets/insights-search-B4NkHGeC.js","assets/insights-api-C4Dmm34n.js","assets/PlatformIcon-D4KPXCHL.js","assets/RolloutPercentageBadge-DF4EeZIJ.js","assets/card-BAs80yql.js","assets/dialog-BvZDZzdQ.js","assets/field-DInLQ5oV.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,Di as t,Hr as n,Oi as r,Vr as i,_r as a,et as o,vr as s,wi as c,zr as ee}from"./sidebar-BmzmPGuv.js";import{t as l}from"./link-CRMwpc7-.js";import{a as u,c as d,s as f}from"./useCompositeListItem-BEDqZ9Ni.js";import{a as p,i as te,o as m}from"./console-features-api-CtbGqKyr.js";import{_ as h,m as g,s as _,x as v}from"./insights-api-C4Dmm34n.js";import{t as y}from"./key-round-BkeLvA1m.js";import{i as b}from"./switch-ByNYRVTN.js";import{a as x,t as S}from"./insights-search-B4NkHGeC.js";import{a as C,i as w,n as T,o as E,t as D}from"./card-BAs80yql.js";import{r as O}from"./constants-yj-e3ahf.js";var k=i(`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=t(),j={apiKeys:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(l,{to:`/api-keys`,onClick:e})}}},M=c({method:`GET`}).middleware([ee]).handler(r(`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 n({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)(x,{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:r,variant:i=`inline`}){if(!t)return n?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:i===`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 a=r?.builtIn===!0,o=a?0:I(t),c=(0,A.jsx)(`dl`,{className:s(i===`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:r})=>(0,A.jsxs)(`div`,{className:s(`flex`,i===`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:s(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,i===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[n]>0&&!(n===`downloads`&&a)?r:`text-muted-foreground`),children:[n===`downloads`&&a?(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:s(`flex`,i===`card`?`flex-col gap-2`:`items-center gap-1`),children:[r?(0,A.jsx)(l,{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:r.platform,channel:r.channel,releaseId:r.releaseId,bundleWindow:S(r.releaseId)},children:c}):c,i===`card`&&o>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[o.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,i===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let n=_({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),r=n.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[r?(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:s(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,r.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[r.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,h(g(r)),`)`]})]})]})}):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)(x,{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)(D,{children:[(0,A.jsxs)(C,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(E,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(T,{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)(o,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(w,{className:`px-4 pb-4`,children:(0,A.jsxs)(l,{className:a({className:`max-md:h-11`,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 te(`insightsAnalytics`)?null:(0,A.jsxs)(D,{children:[(0,A.jsx)(C,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(E,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(T,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function ne({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 H={Cell:ne},U={insights:{navigation:{icon:(0,A.jsx)(v,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(l,{to:`/insights`,onClick:t}):(0,A.jsx)(l,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:H,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},W={remoteConfig:{navigation:{icon:(0,A.jsx)(b,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(l,{to:`/remote-config`,onClick:e})}}},G={...U,...j,...W},K=Object.keys(m),q=()=>{let e=p().data?.features;return e===void 0?[]:K.flatMap(t=>{let n=G[t];return n!==void 0&&e[t]?[{...n,feature:t,label:m[t].label,features:e}]:[]})},J=()=>q().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function Y({release:e}){return q().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var X=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Z(e){let t=X(e.beforeReleaseId),n=t?void 0:X(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=X(e.bundleId),a=i?void 0:X(e.scopeKey),o=i||a?void 0:X(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,channels:!i&&!a&&!o&&e.channels===`all`?`all`:void 0,enabled:a||o?r:void 0,platform:s,releaseId:X(e.releaseId),scopeKey:a}}function Q(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 re(e){return Q(e).kind!==`all`}function $(e,t){if(e.bundleId||e.scopeKey||e.channelId||e.channels===`all`)return e;if(e.releaseId)return{...e,channels:`all`};if(t===void 0)return;let n=t.find(({name:e})=>e===O);return n?Z({...e,channelId:n.id}):e}function ie(e,t){let n={...e,...t};return t.bundleId?Z({bundleId:n.bundleId}):t.scopeKey?Z({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Z({channelId:n.channelId,channels:n.channels,enabled:n.enabled,platform:n.platform}):Z({bundleId:n.bundleId,channelId:n.channelId,channels:n.channels,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}function ae(e,t){let n=$(e,t),r=$({},t);return n===void 0||r===void 0||JSON.stringify(Q(n))===JSON.stringify(Q(r))}var oe=d(`/`)({component:f(()=>u(()=>import(`./routes-DMooqgLf.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,38,39,40,41,42,43,44,45])),`component`),validateSearch:Z});export{ae as a,q as c,$ as i,J as l,re as n,ie as o,Q as r,Y as s,oe as t};