@hot-updater/console 1.2.0-rc.28 → 1.2.0-rc.29

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 (196) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{-native-builds-search-7blX2yQW.js → -native-builds-search-DdHwfe4q.js} +1 -1
  3. package/.output/public/assets/ChannelBadge-CEabmopB.js +1 -0
  4. package/.output/public/assets/{CompositeItem-Dy4xgOMg.js → CompositeItem-KUM5yQVr.js} +1 -1
  5. package/.output/public/assets/{ConsoleFeatureUnavailable-cy_snb33.js → ConsoleFeatureUnavailable-Be-0iTww.js} +1 -1
  6. package/.output/public/assets/EventDetails-bDOYte1z.js +1 -0
  7. package/.output/public/assets/HashValueDisplay-D2f0HmyU.js +1 -0
  8. package/.output/public/assets/{InsightsPageHeader-D5TJspVe.js → InsightsPageHeader-Cj2ROSQO.js} +1 -1
  9. package/.output/public/assets/IosInstall-CHI2C4Yd.js +1 -0
  10. package/.output/public/assets/{NativeBuildsNav-CjOOlbEu.js → NativeBuildsNav-DaqxQPnG.js} +1 -1
  11. package/.output/public/assets/{RelativeTime-CY1dKZpv.js → RelativeTime-B4PK8qDw.js} +1 -1
  12. package/.output/public/assets/{RolloutPercentageBadge-BHgHkBGB.js → RolloutPercentageBadge-D_I0Raj2.js} +1 -1
  13. package/.output/public/assets/{RowReason-BMx_vclu.js → RowReason-B7VM1ztc.js} +1 -1
  14. package/.output/public/assets/{SandboxBadge-irEkMf1P.js → SandboxBadge-BVxHg_HF.js} +1 -1
  15. package/.output/public/assets/TargetDisplay-KU7JhIWG.js +1 -0
  16. package/.output/public/assets/api-keys-DLC8jjaM.js +1 -0
  17. package/.output/public/assets/api-keys-eDnzgFAf.js +1 -0
  18. package/.output/public/assets/download-B2GjTySo.js +1 -0
  19. package/.output/public/assets/{index-CAnjb7M2.js → index-BdyQq4-k.js} +3 -3
  20. package/.output/public/assets/insights-C94CdeAA.js +1 -0
  21. package/.output/public/assets/insights-DILMVpk8.js +2 -0
  22. package/.output/public/assets/{insights-DTF7C4jb.js → insights-_j_ieOyh.js} +1 -1
  23. package/.output/public/assets/{insights-search-TfRz5kGG.js → insights-search-Bgvg6wSP.js} +1 -1
  24. package/.output/public/assets/{insights-usage-rpc-B4V-Qqo4.js → insights-usage-rpc-BUCinjSN.js} +1 -1
  25. package/.output/public/assets/insights_.distribution-Bb6_S-hD.js +2 -0
  26. package/.output/public/assets/{insights_.distribution-BqfzAuAf.js → insights_.distribution-CRkGNelG.js} +1 -1
  27. package/.output/public/assets/insights_.distribution-CyAu3RN3.js +1 -0
  28. package/.output/public/assets/installations-BA01mqJE.js +1 -0
  29. package/.output/public/assets/{installations-D3MbzcFb.js → installations-BsD6LgNc.js} +2 -2
  30. package/.output/public/assets/{installations-BU65zztK.js → installations-CYTzndfP.js} +1 -1
  31. package/.output/public/assets/native-builds-BMbws1g5.js +2 -0
  32. package/.output/public/assets/native-builds-xgHiHQML.js +1 -0
  33. package/.output/public/assets/native-builds_._buildId-B04z9yfk.js +1 -0
  34. package/.output/public/assets/native-builds_._buildId-DaMmTcHo.js +2 -0
  35. package/.output/public/assets/native-builds_.devices-B-u7uLLG.js +2 -0
  36. package/.output/public/assets/native-builds_.devices-CVNAQtSy.js +1 -0
  37. package/.output/public/assets/{remote-config-D1OkfQKt.js → remote-config-Cxkr7_BP.js} +1 -1
  38. package/.output/public/assets/remote-config-DAOyn5xL.js +1 -0
  39. package/.output/public/assets/{remote-config-CGbqsPh_.js → remote-config-DXv25LX1.js} +3 -3
  40. package/.output/public/assets/{routes-BTG3rg0l.js → routes-DM3TyTLW.js} +2 -2
  41. package/.output/public/assets/routes-Des97uK_.js +1 -0
  42. package/.output/public/assets/styles-BHLI87EH.css +2 -0
  43. package/.output/server/{__23tanstack-start-server-fn-resolver-BFiPs5uv.mjs → __23tanstack-start-server-fn-resolver-DTuNq7_z.mjs} +58 -58
  44. package/.output/server/_libs/_.mjs +1 -1
  45. package/.output/server/_ssr/{BundleIdDisplay-BSBR5eJ3.mjs → BundleIdDisplay-BX6DLh1K.mjs} +2 -2
  46. package/.output/server/_ssr/ChannelBadge-D7O95Ack.mjs +23 -0
  47. package/.output/server/_ssr/{ConsoleFeatureUnavailable-DcZ4JBVq.mjs → ConsoleFeatureUnavailable-Dfs3WUZf.mjs} +5 -5
  48. package/.output/server/_ssr/{EventDetails-CUHZuwei.mjs → EventDetails-C1Q9caVa.mjs} +6 -6
  49. package/.output/server/_ssr/{HashValueDisplay-B9ORaCcP.mjs → HashValueDisplay-SIEeZe0O.mjs} +2 -2
  50. package/.output/server/_ssr/{InsightsPageHeader-C0bJqC-n.mjs → InsightsPageHeader-CAcbXSFD.mjs} +5 -5
  51. package/.output/server/_ssr/{IosInstall-C5Y5gnDY.mjs → IosInstall-B7yxnQ7o.mjs} +61 -20
  52. package/.output/server/_ssr/{NativeBuildsNav-hFiyBaFW.mjs → NativeBuildsNav-BwoEX7xx.mjs} +3 -3
  53. package/.output/server/_ssr/{NotFoundPage-D4xRjmIA.mjs → NotFoundPage-Cd_nKv04.mjs} +2 -2
  54. package/.output/server/_ssr/{RelativeTime-DnvxB666.mjs → RelativeTime-B5txzq94.mjs} +23 -6
  55. package/.output/server/_ssr/{RolloutPercentageBadge-NBnIOzY9.mjs → RolloutPercentageBadge-BEV8btLv.mjs} +3 -3
  56. package/.output/server/_ssr/{RowReason-B_jZN48d.mjs → RowReason-CEDEk7-N.mjs} +24 -7
  57. package/.output/server/_ssr/{SandboxBadge-CFtTG1ZJ.mjs → SandboxBadge-wlOMZIUd.mjs} +2 -2
  58. package/.output/server/_ssr/{TargetDisplay-0sb03v_6.mjs → TargetDisplay-076I9qHx.mjs} +29 -20
  59. package/.output/server/_ssr/{alert-dialog-SLr1Q_AI.mjs → alert-dialog-DrD4hAp4.mjs} +1 -1
  60. package/.output/server/_ssr/{api-CkgOQzSb.mjs → api-C1plnjZg.mjs} +3 -3
  61. package/.output/server/_ssr/{api-keys-BP7NJtoX.mjs → api-keys-Bzn-P-lX.mjs} +2 -2
  62. package/.output/server/_ssr/{api-keys-BcSzq0TA.mjs → api-keys-L8_p18pO.mjs} +10 -10
  63. package/.output/server/_ssr/{api-keys-rpc-IWPOq5vn.mjs → api-keys-rpc-Mne2yo8z.mjs} +3 -3
  64. package/.output/server/_ssr/{api-rpc-cNJTB3v4.mjs → api-rpc-ChVBmeca.mjs} +13 -6
  65. package/.output/server/_ssr/{auth-rpc-oaBbtxSP.mjs → auth-rpc-Dml8l_eq.mjs} +4 -4
  66. package/.output/server/_ssr/{auth.server-WQw9JjMm.mjs → auth.server-DOShgraQ.mjs} +2 -2
  67. package/.output/server/_ssr/{badge-n3c0OTBQ.mjs → badge-BasQflNy.mjs} +1 -1
  68. package/.output/server/_ssr/{card-CYgCcRUd.mjs → card-BrGGQYC0.mjs} +1 -1
  69. package/.output/server/_ssr/{config.server-R3KQbcML.mjs → config.server-CVOdMDBk.mjs} +3 -3
  70. package/.output/server/_ssr/{console-access-BLVi82IN.mjs → console-access-Bi-abtY-.mjs} +2 -2
  71. package/.output/server/_ssr/{console-features-api-B2JvJOlE.mjs → console-features-api-Bjxo5ur3.mjs} +3 -3
  72. package/.output/server/_ssr/{console-features-rpc-LAxQoSNw.mjs → console-features-rpc-xzdodg3g.mjs} +3 -3
  73. package/.output/server/_ssr/{dialog-eru_h5oK.mjs → dialog-7iMkt9l0.mjs} +1 -1
  74. package/.output/server/_ssr/{empty-Bu4qodCx.mjs → empty-Chb-YL3R.mjs} +2 -2
  75. package/.output/server/_ssr/{field-DA5lwO5U.mjs → field-mL_Aa6ff.mjs} +2 -2
  76. package/.output/server/_ssr/{input-group-VV5E3q78.mjs → input-group-C00_xYka.mjs} +1 -1
  77. package/.output/server/_ssr/{insights-Ci82qdkq.mjs → insights-BcVNQCXf.mjs} +19 -19
  78. package/.output/server/_ssr/{insights-BJIt1xuT.mjs → insights-BdF3o0Yp.mjs} +2 -2
  79. package/.output/server/_ssr/{insights-C23mopzv.mjs → insights-C9sSQPMF.mjs} +5 -5
  80. package/.output/server/_ssr/{insights-api-BwXMKUSe.mjs → insights-api-CShlv9dA.mjs} +3 -3
  81. package/.output/server/_ssr/{insights-failures-rpc-BuZ-jnby.mjs → insights-failures-rpc-C-cv9bId.mjs} +4 -4
  82. package/.output/server/_ssr/{insights-recovery-rpc-DrXSy9aA.mjs → insights-recovery-rpc-Ct-jIQZU.mjs} +3 -3
  83. package/.output/server/_ssr/{insights-rpc-DyrIZg3a.mjs → insights-rpc-Dc0I8O3n.mjs} +3 -3
  84. package/.output/server/_ssr/{insights-search-CNkNB-aa.mjs → insights-search-D_vVwBwW.mjs} +2 -2
  85. package/.output/server/_ssr/{insights-usage-rpc-C7UC1lom.mjs → insights-usage-rpc-4TR94EHa.mjs} +3 -3
  86. package/.output/server/_ssr/{insights-usage-rpc-cTgmD-Ej.mjs → insights-usage-rpc-D60hOhzl.mjs} +3 -3
  87. package/.output/server/_ssr/{insights_.distribution-CIY_IGmh.mjs → insights_.distribution-BgnfMzw1.mjs} +13 -13
  88. package/.output/server/_ssr/{insights_.distribution-wfFKEv-Z.mjs → insights_.distribution-DkD7uAwA.mjs} +5 -5
  89. package/.output/server/_ssr/{insights_.distribution-BauOpBTE.mjs → insights_.distribution-wT1mjWsG.mjs} +2 -2
  90. package/.output/server/_ssr/{installations-VzacOKHp.mjs → installations-DtRbzy3N.mjs} +2 -2
  91. package/.output/server/_ssr/{installations-jGW7nvEV.mjs → installations-DvxMRP5u.mjs} +4 -4
  92. package/.output/server/_ssr/{installations-Ba3YVrAf.mjs → installations-tFsFnxKk.mjs} +11 -11
  93. package/.output/server/_ssr/{ios-devices-rpc-Bhn7VVIh.mjs → ios-devices-rpc-CIPuCUQ8.mjs} +9 -8
  94. package/.output/server/_ssr/{iosDeviceProfile-_XT8TpgZ.mjs → iosDeviceProfile-WyMC1593.mjs} +2 -2
  95. package/.output/server/_ssr/{iosDevices-Bc27J72d.mjs → iosDevices-B0TjF_sb.mjs} +2 -2
  96. package/.output/server/_ssr/{native-builds-DZFJGcHy.mjs → native-builds-C458T7Ts.mjs} +2 -2
  97. package/.output/server/_ssr/{native-builds-DiNkKHly.mjs → native-builds-C5WxR0BT.mjs} +35 -25
  98. package/.output/server/_ssr/{native-builds_._buildId-CuM1PsT6.mjs → native-builds_._buildId-CyCGKZ1H.mjs} +89 -61
  99. package/.output/server/_ssr/{native-builds_._buildId-D0n4QZY6.mjs → native-builds_._buildId-UsgsqKI8.mjs} +2 -2
  100. package/.output/server/_ssr/{native-builds_.devices-DiM2FdcW.mjs → native-builds_.devices-BcfLIzJs.mjs} +2 -2
  101. package/.output/server/_ssr/{native-builds_.devices-D0JJlX8E.mjs → native-builds_.devices-BpTcIWm0.mjs} +57 -57
  102. package/.output/server/_ssr/{nativeBuildDownloadLink-CvvWuhh0.mjs → nativeBuildDownloadLink-CtB2G7qG.mjs} +3 -3
  103. package/.output/server/_ssr/{nativeBuildInstall-BqcVHBaD.mjs → nativeBuildInstall-PavEyZtZ.mjs} +5 -4
  104. package/.output/server/_ssr/{release-adoption-rpc-Dm-5yAJG.mjs → release-adoption-rpc-DkT6ui4_.mjs} +5 -5
  105. package/.output/server/_ssr/{remote-config-D1BhIBKu.mjs → remote-config-BKlK0dFP.mjs} +2 -2
  106. package/.output/server/_ssr/{remote-config-D7RruPiO.mjs → remote-config-D_nQT__6.mjs} +2 -2
  107. package/.output/server/_ssr/{remote-config-rpc-C7AZy37o.mjs → remote-config-rpc-BW6lyp9Y.mjs} +3 -3
  108. package/.output/server/_ssr/{remote-config-ZFm-l4Gi.mjs → remote-config-v1hs050H.mjs} +20 -20
  109. package/.output/server/_ssr/{router-BGkGFMsT.mjs → router-hKO__Vrv.mjs} +25 -25
  110. package/.output/server/_ssr/{routes-CJJxz-Ak.mjs → routes-DKxm5A7X.mjs} +30 -25
  111. package/.output/server/_ssr/{routes-CiJ2dhL9.mjs → routes-OhljAvlx.mjs} +8 -8
  112. package/.output/server/_ssr/{schema-migration-rpc-D4YlwvGH.mjs → schema-migration-rpc-DrrYEFqy.mjs} +3 -3
  113. package/.output/server/_ssr/{select-BB8GE7OZ.mjs → select-M4kWGKJW.mjs} +1 -1
  114. package/.output/server/_ssr/{server-DAHTchcr.mjs → server-4hXySEh0.mjs} +3 -3
  115. package/.output/server/_ssr/{sidebar-CsKVgZHa.mjs → sidebar-CFlo6lny.mjs} +2 -2
  116. package/.output/server/_ssr/ssr.mjs +1 -1
  117. package/.output/server/_ssr/{switch-BvvmP7Y3.mjs → switch-xTCGSBdC.mjs} +2 -2
  118. package/.output/server/_ssr/{table-WKKzprFn.mjs → table-CqdaVMjd.mjs} +1 -1
  119. package/.output/server/_ssr/{tabs-BJ-4SgmC.mjs → tabs-DtMAFr25.mjs} +2 -2
  120. package/.output/server/_tanstack-start-manifest_v-CYfHRC4i.mjs +225 -0
  121. package/.output/server/index.mjs +351 -344
  122. package/package.json +7 -7
  123. package/src/components/DataTable.tsx +26 -1
  124. package/src/components/FoldedRows.tsx +20 -2
  125. package/src/components/features/api-keys/ApiKeysPage.tsx +1 -1
  126. package/src/components/features/channels/ChannelManagementDialog.tsx +2 -2
  127. package/src/components/features/native-builds/CommitLink.tsx +2 -1
  128. package/src/components/features/native-builds/InstallCard.tsx +76 -39
  129. package/src/components/features/native-builds/IosDevicesPage.tsx +75 -42
  130. package/src/components/features/native-builds/IosInstall.tsx +103 -31
  131. package/src/components/features/native-builds/IpaDevicesCard.tsx +19 -15
  132. package/src/components/features/native-builds/NativeBuildsTable.tsx +17 -13
  133. package/src/components/features/native-builds/ShortHash.tsx +5 -2
  134. package/src/components/features/remote-config/PublishDialog.tsx +4 -1
  135. package/src/components/features/remote-config/VersionsCard.tsx +5 -2
  136. package/src/components/ui/sonner.tsx +3 -1
  137. package/src/lib/api-rpc.ts +14 -1
  138. package/src/lib/ios-devices-rpc.ts +10 -1
  139. package/src/lib/server/nativeBuildInstall.ts +9 -0
  140. package/src/routes/index.tsx +5 -2
  141. package/src/styles.css +2 -2
  142. package/.output/public/assets/EventDetails-sxag8Hfc.js +0 -1
  143. package/.output/public/assets/HashValueDisplay-DMweha_0.js +0 -1
  144. package/.output/public/assets/IosInstall-B5NspihF.js +0 -1
  145. package/.output/public/assets/TargetDisplay-DB8D019f.js +0 -1
  146. package/.output/public/assets/api-keys-Cd-aNt-v.js +0 -1
  147. package/.output/public/assets/api-keys-D3tAc4Uu.js +0 -1
  148. package/.output/public/assets/insights-DIs4nJI9.js +0 -2
  149. package/.output/public/assets/insights-bUk3ChoU.js +0 -1
  150. package/.output/public/assets/insights_.distribution-BPl5oRt4.js +0 -2
  151. package/.output/public/assets/insights_.distribution-BqtmnGTt.js +0 -1
  152. package/.output/public/assets/installations-6U8c_03X.js +0 -1
  153. package/.output/public/assets/native-builds-BdzfAFnF.js +0 -1
  154. package/.output/public/assets/native-builds-CWwvuOXr.js +0 -2
  155. package/.output/public/assets/native-builds-Eh72Vr2G.js +0 -1
  156. package/.output/public/assets/native-builds_._buildId-33ksAlnZ.js +0 -1
  157. package/.output/public/assets/native-builds_._buildId-BVA5GnZP.js +0 -2
  158. package/.output/public/assets/native-builds_.devices-CElovmwq.js +0 -1
  159. package/.output/public/assets/native-builds_.devices-DWtcOVYO.js +0 -2
  160. package/.output/public/assets/remote-config-B3oq9qR0.js +0 -1
  161. package/.output/public/assets/routes-CVbPjRKo.js +0 -1
  162. package/.output/public/assets/styles-B0kzy3kp.css +0 -2
  163. package/.output/server/_ssr/CopyableText-DgNEsByt.mjs +0 -33
  164. package/.output/server/_tanstack-start-manifest_v-CSUJeG5D.mjs +0 -219
  165. /package/.output/public/assets/{BundleIdDisplay-B0gAH01c.js → BundleIdDisplay-CTBdtFQ8.js} +0 -0
  166. /package/.output/public/assets/{NotFoundPage-DDOJarFa.js → NotFoundPage-CVBtl68B.js} +0 -0
  167. /package/.output/public/assets/{PlatformIcon-BBvlg6JY.js → PlatformIcon-DVnzzGqM.js} +0 -0
  168. /package/.output/public/assets/{alert-dialog-CLC_h1fL.js → alert-dialog-Ch0QxRsa.js} +0 -0
  169. /package/.output/public/assets/{api-DLryz9hA.js → api-C1OPeiG1.js} +0 -0
  170. /package/.output/public/assets/{badge-DJMW4YVM.js → badge-FZMD5vvS.js} +0 -0
  171. /package/.output/public/assets/{card-C4sBAMU-.js → card-CyHYmHue.js} +0 -0
  172. /package/.output/public/assets/{dialog-tCTZmAo8.js → dialog-BLj71-Nf.js} +0 -0
  173. /package/.output/public/assets/{dist-Bw_uSBJn.js → dist-DAM__Tdz.js} +0 -0
  174. /package/.output/public/assets/{empty-DsbLxQ1w.js → empty--YaE5Z4p.js} +0 -0
  175. /package/.output/public/assets/{field-DL4OXTJ7.js → field-CdhSgWhI.js} +0 -0
  176. /package/.output/public/assets/{git-branch-ByZMEBxZ.js → git-branch-DG1VDaKq.js} +0 -0
  177. /package/.output/public/assets/{history-wYnPoVmT.js → history-C0wv4htz.js} +0 -0
  178. /package/.output/public/assets/{input-group-B7jx0icS.js → input-group-XKLcUGoa.js} +0 -0
  179. /package/.output/public/assets/{key-round-B-P_hhUB.js → key-round-D7UgdXyA.js} +0 -0
  180. /package/.output/public/assets/{list-fFsS8Wxe.js → list-Bm-CfN5g.js} +0 -0
  181. /package/.output/public/assets/{loader-circle-GWIgH0fo.js → loader-circle-iMqC-8ZE.js} +0 -0
  182. /package/.output/public/assets/{package-CXSDZsME.js → package-BmfoZ5Zj.js} +0 -0
  183. /package/.output/public/assets/{plus-Cx-yFNd9.js → plus-Db0KxLZp.js} +0 -0
  184. /package/.output/public/assets/{refresh-cw-BgiOaFX3.js → refresh-cw-BHhBYjS8.js} +0 -0
  185. /package/.output/public/assets/{relativeTime-CBmDq8wh.js → relativeTime-BYRt19mj.js} +0 -0
  186. /package/.output/public/assets/{rotate-cw-C1v7YuN7.js → rotate-cw-Ba-slJea.js} +0 -0
  187. /package/.output/public/assets/{search-DiOSjaYL.js → search-dJG2BYmx.js} +0 -0
  188. /package/.output/public/assets/{send-BgXZNiEA.js → send-DuMOCzbD.js} +0 -0
  189. /package/.output/public/assets/{smartphone-CxP0GGT6.js → smartphone-D1C6BRd_.js} +0 -0
  190. /package/.output/public/assets/{switch-BTHWmKQ5.js → switch-BsV3d4km.js} +0 -0
  191. /package/.output/public/assets/{table-CwF7yxj4.js → table-D8YjT_ht.js} +0 -0
  192. /package/.output/public/assets/{tabs-CHNnCyvw.js → tabs-RdhEl9sE.js} +0 -0
  193. /package/.output/public/assets/{trash-2-CYISg7ZF.js → trash-2-B5KIvrXy.js} +0 -0
  194. /package/.output/public/assets/{undo-2-Bod3vw7x.js → undo-2-CFcU9dIB.js} +0 -0
  195. /package/.output/public/assets/{uuidv7-CVJ09bBG.js → uuidv7-DAoOOpz9.js} +0 -0
  196. /package/.output/public/assets/{valueToPercent-Db73Kirz.js → valueToPercent-Bn8p2lng.js} +0 -0
@@ -1 +0,0 @@
1
- import{$ as e,Di as t,Hr as n,Oi as r,Ri as i,Si as a,Vi as o,Z as s,_r as c,di as l,gr as u,vr as d,wi as f,zr as p}from"./sidebar-yC7KdImc.js";import{t as ee}from"./link-CN3iHC4A.js";import{t as m}from"./useMutation-w3qYaU2L.js";import{a as h,g,i as _,l as te,o as ne,r as re,s as ie}from"./native-builds-BdzfAFnF.js";import{t as ae}from"./loader-circle-GWIgH0fo.js";import{t as oe}from"./send-BgXZNiEA.js";import{t as se}from"./smartphone-CxP0GGT6.js";import{a as v,i as y,n as b,o as x}from"./badge-DJMW4YVM.js";import{n as ce}from"./relativeTime-CBmDq8wh.js";import{a as le,n as ue,r as de,t as fe}from"./field-DL4OXTJ7.js";import{m as pe}from"./api-DLryz9hA.js";var S=o(i(),1),C=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(C||{}),me=[0,1],w=[1,0],T=[2,3],E=[3,2],he={L:me,M:w,Q:T,H:E},ge=/^\d*$/,_e=/^[A-Z0-9 $%*+./:-]*$/,D=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,O=1,k=40,A=3,ve=3,j=40,ye=10,M=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],N=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],be=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<O||e>k)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,C.Timing),this.setFunctionModule(e,6,e%2==0,C.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,F(r,e));this.setFunctionModule(8,7,F(r,6)),this.setFunctionModule(8,8,F(r,7)),this.setFunctionModule(7,8,F(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,F(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,F(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,F(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=F(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,C.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,C.Alignment)}setFunctionModule(e,t,n,r=C.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==H(t,n))throw RangeError(`Invalid argument`);let r=N[n[0]][t],i=M[n[0]][t],a=Math.floor(V(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=ke(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=Ae(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(V(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=F(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=A:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*j),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*j}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=A:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*j),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*j}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=ve)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*ye,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function P(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function F(e,t){return(e>>>t&1)!=0}var I=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},xe=[1,10,12,14],Se=[2,9,11,13],Ce=[4,8,16,16];function L(e,t){return e[Math.floor((t+7)/17)+1]}function R(e){let t=[];for(let n of e)P(n,8,t);return new I(Ce,e.length,t)}function we(e){if(!z(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);P(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new I(xe,e.length,t)}function Te(e){if(!B(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n;for(n=0;n+2<=e.length;n+=2){let r=D.indexOf(e.charAt(n))*45;r+=D.indexOf(e.charAt(n+1)),P(r,11,t)}return n<e.length&&P(D.indexOf(e.charAt(n)),6,t),new I(Se,e.length,t)}function Ee(e){return e===``?[]:z(e)?[we(e)]:B(e)?[Te(e)]:[R(Oe(e))]}function z(e){return ge.test(e)}function B(e){return _e.test(e)}function De(e,t){let n=0;for(let r of e){let e=L(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function Oe(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function V(e){if(e<O||e>k)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function H(e,t){return Math.floor(V(e)/8)-M[t[0]][e]*N[t[0]][e]}function ke(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=U(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=U(n,2)}return t}function Ae(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=U(t,e))}return n}function U(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function je(e,t,n=1,r=40,i=-1,a=!0){if(!(O<=n&&n<=r&&r<=k)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=H(o,t)*8,i=De(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[w,T,E])a&&s<=H(o,e)*8&&(t=e);let c=[];for(let t of e){P(t.mode[0],4,c),P(t.numChars,L(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=H(o,t)*8;P(0,Math.min(4,l-c.length),c),P(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)P(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new be(o,t,u,i)}function Me(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?Ee(e):Array.isArray(e)?[R(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=je(c,he[n],i,a,o,r),u=Ne({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function Ne(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=C.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}var Pe=e=>{let{data:t,size:n}=Me(e,{ecc:`M`,border:4}),r=``;return t.forEach((e,t)=>e.forEach((e,n)=>{e&&(r+=`M${n} ${t}h1v1h-1z`)})),{size:n,path:r}},W=t();function Fe({value:e,label:t,className:n}){let{size:r,path:i}=(0,S.useMemo)(()=>Pe(e),[e]);return(0,W.jsxs)(`svg`,{"aria-label":t,className:d(`aspect-square rounded-md`,n),role:`img`,shapeRendering:`crispEdges`,viewBox:`0 0 ${r} ${r}`,children:[(0,W.jsx)(`rect`,{fill:`#fff`,height:r,width:r}),(0,W.jsx)(`path`,{d:i,fill:`#000`})]})}var G=o(ce(),1),Ie=f({method:`GET`}).middleware([p]).handler(r(`3a62744a539db57f5a29f39cec7fb03fd2817703b40d98e6da69e2f5e7ae6f3d`)),Le=f({method:`POST`}).middleware([p]).handler(r(`4b173c2b2f5ea074a1f10862282308f11f5a043c044d64b6f63e6a29d571ec64`)),Re=f({method:`POST`}).middleware([p]).handler(r(`24005564c8e58dbdeadba89e3f567255a991f5695359cbcc2e8392e033dac8e1`)),ze=f({method:`POST`}).middleware([p]).handler(r(`7908c24ccc2674ce07a553a645b8f4790889975a80f424a05d71a9fb8ab49787`)),Be=f({method:`POST`}).middleware([p]).handler(r(`4c92dfeae76a6fc898d6f38941eeedaec1f3d118f51a6f31ebf0bb1cea3fcea4`)),Ve=f({method:`POST`}).middleware([p]).handler(r(`8e37ec67413ceba554adb2d4b15e53682595a089d4b431ba7965d4347fb500fc`)),He=f({method:`GET`}).middleware([p]).handler(r(`a11cb4014e6b23528f76382c43684798b0e84a6936aaba02c918e8f4e216e282`)),K={all:[`ios-devices`],list:e=>[`ios-devices`,e??`all`],ipa:e=>[`native-build-ipa-devices`,e]},q=600*1e3;function Ue(e){return n({queryKey:K.list(e),queryFn:()=>Ie({data:e===void 0?{}:{status:e}}),placeholderData:l})}function J(e,t=!0){return n({queryKey:[`ios-device-profile-link`,e],queryFn:()=>Le({data:e}),enabled:t,staleTime:q,refetchInterval:q})}function We(e){return n({queryKey:K.ipa(e),queryFn:()=>He({data:{id:e}})})}var Y=e=>{let t=a();return m({mutationFn:e,onSettled:async()=>{await Promise.all([t.invalidateQueries({queryKey:K.all}),t.invalidateQueries({queryKey:[`native-build-install-eligibility`]})])}})},Ge=()=>Y(e=>ze({data:e})),Ke=()=>Y(e=>Be({data:e})),qe=()=>Y(e=>Ve({data:e})),Je=()=>Y(e=>Re({data:e})),Ye=`With the same bundle ID, this install replaces the App Store's copy of the app on this iPhone.`,X=`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,Xe=e=>/iPhone|iPod|iPad/u.test(e.userAgent)||/Macintosh/u.test(e.userAgent)&&e.maxTouchPoints>1,Ze=()=>{if(typeof window>`u`)return{udid:null,receipt:null,requested:!1};let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`udid`),n=t!==null&&_.test(t)?t:null;return{udid:n,receipt:n===null?null:e.get(`r`),requested:n!==null&&e.get(`requested`)===`1`}},Z=e=>{try{return window.localStorage.getItem(e)}catch{return null}},Q=(e,t)=>{try{window.localStorage.setItem(e,t)}catch{}},Qe=()=>{let[e,t]=(0,S.useState)(null),[n]=(0,S.useState)(Ze);return(0,S.useEffect)(()=>{let e=e=>e!=null&&_.test(e)?e:null,r=n.receipt!==null||n.requested;n.udid!==null&&r&&(Q(h,n.udid),n.receipt!==null&&Q(re,JSON.stringify({udid:n.udid,receipt:n.receipt}))),n.udid!==null&&window.location.hash!==``&&window.history.replaceState(window.history.state,``,`${window.location.pathname}${window.location.search}`);let i=()=>{let r=e(Z(`hot-updater-ios-udid`))??n.udid,i=null;try{let e=JSON.parse(Z(`hot-updater-ios-device-receipt`)??`null`);i=e?.udid===r&&typeof e?.receipt==`string`?e.receipt:null}catch{i=null}i===null&&n.udid===r&&(i=n.receipt),t(e=>e!==null&&e.udid===r&&e.receipt===i?e:{ios:Xe(navigator),udid:r,receipt:i,requested:n.requested})};i();let a=e=>{(e.key===null||e.key===`hot-updater-ios-udid`||e.key===`hot-updater-ios-device-receipt`)&&i()};return window.addEventListener(`storage`,a),window.addEventListener(`pageshow`,i),document.addEventListener(`visibilitychange`,i),()=>{window.removeEventListener(`storage`,a),window.removeEventListener(`pageshow`,i),document.removeEventListener(`visibilitychange`,i)}},[n]),e},$e=300*1e3,et=(e,t)=>{let[,n]=(0,S.useReducer)(e=>e+1,0),r=e+ne-$e;return(0,S.useEffect)(()=>{if(!t)return;let e=setTimeout(n,Math.max(0,r-Date.now()));return document.addEventListener(`visibilitychange`,n),window.addEventListener(`pageshow`,n),()=>{clearTimeout(e),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`pageshow`,n)}},[r,t]),t&&Date.now()>=r};function tt({fetching:e,onRenew:t}){return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`This install link has expired.`,e?` Getting a new one.`:``]}),e?null:(0,W.jsx)(u,{className:X,onClick:t,variant:`outline`,children:`Get a new link`})]})}function nt({build:e,token:t}){return(0,W.jsx)(`a`,{className:c({className:X}),href:g(window.location,e.id,t),children:`Install`})}function rt(){return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On iOS 16 or later, the app opens only with Developer Mode on: Settings, Privacy & Security, Developer Mode.`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Ye})]})}function $({build:t,again:n=!1}){let r=J({mode:`identify`,buildId:t.id});return r.data?.status===`no-secret`?(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,r.data.secretName,` on the Console to check iPhones from this page.`]}):r.data?.status===`issued`?(0,W.jsxs)(`a`,{className:c({className:X,variant:n?`secondary`:`default`}),href:te(ie(window.location,t.id),r.data.token),children:[(0,W.jsx)(se,{"data-icon":`inline-start`}),n?`Check this iPhone again`:`Check this iPhone`]}):r.isError?(0,W.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:`The check couldn't start. Reload the page to try again.`}):(0,W.jsx)(e,{"aria-label":`Preparing the check`,className:`h-11 w-full`})}var it=e=>(0,G.default)(e).format(`MMM D`);function at({build:e,device:t,registry:n,newerBuild:r,registryReadAt:i}){let a=Je(),[o,l]=(0,S.useState)(``),[d,f]=(0,S.useState)(null),p=d!==null&&i<=d.readBefore,m=p?d.device:n,h=(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`p`,{className:`text-sm font-medium`,children:`Not in this build`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This IPA was signed without this iPhone, and iOS won't install it here.`})]});if(m!==null){let e=p?null:r;return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[h,(0,W.jsx)(`p`,{className:`text-sm`,role:`status`,children:m.apple_error!==null&&e===null?`Apple didn't register ${m.name}: ${m.apple_error} A maintainer can see it on the iOS devices page.`:m.status===`pending`?`${m.name} was requested on ${it(m.created_at_ms)}. A maintainer approves it next.`:e===null?`${m.name} is ${m.status}. It joins the next ad hoc build.`:`A newer build has ${m.name}.`}),e===null?null:(0,W.jsx)(ee,{className:c({className:X}),params:{buildId:e},to:`/native-builds/$buildId`,children:`Open the newer build`})]})}if(t.receipt===null)return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[h,(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Check this iPhone once more to request it for the next ad hoc build.`}),(0,W.jsx)($,{build:e,again:!0})]});let g=o.trim();return(0,W.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{if(e.preventDefault(),g===``)return;let n=i;a.mutate({receipt:t.receipt,name:g},{onSuccess:({device:e})=>f({device:e,readBefore:n})})},children:[h,(0,W.jsxs)(fe,{"data-invalid":a.isError||void 0,children:[(0,W.jsx)(le,{htmlFor:`ios-device-name`,children:`This iPhone's name`}),(0,W.jsx)(s,{autoComplete:`off`,className:`h-11 sm:h-8`,id:`ios-device-name`,maxLength:100,onChange:e=>l(e.target.value),placeholder:`Kim's iPhone`,value:o}),(0,W.jsx)(ue,{children:`A maintainer approves it, and it joins the next ad hoc build.`}),(0,W.jsx)(de,{children:a.isError?`The request didn't go through. Check this iPhone again, then try once more.`:null})]}),(0,W.jsxs)(u,{className:X,disabled:g===``||a.isPending,type:`submit`,children:[a.isPending?(0,W.jsx)(ae,{className:`animate-spin`,"data-icon":`inline-start`}):(0,W.jsx)(oe,{"data-icon":`inline-start`}),`Request access`]}),a.isError?(0,W.jsx)($,{again:!0,build:e}):null]})}function ot({build:t,device:n}){let{udid:r}=n,i=pe(t.id,r),{refetch:a}=i,o=et(i.dataUpdatedAt,i.data?.status===`installable`&&i.data.device===`included`);if((0,S.useEffect)(()=>{o&&a()},[o,a]),i.isPending)return(0,W.jsx)(e,{"aria-label":`Reading this IPA`,className:`h-11 w-full`});let s=i.data;if(s===void 0||s.status===`unavailable`)return(0,W.jsxs)(b,{children:[(0,W.jsx)(x,{}),(0,W.jsx)(v,{children:`Installation details unavailable`}),(0,W.jsx)(y,{children:`The Console couldn't read this IPA from storage in parts, which takes an HTTPS download link that answers Range requests. Xcode or Apple Configurator still installs the download over USB.`})]});if(s.status===`store`)return(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This IPA is an App Store export, which installs through TestFlight, not from this page.`});if(s.status===`expired`)return(0,W.jsxs)(b,{variant:`destructive`,children:[(0,W.jsx)(x,{}),(0,W.jsx)(v,{children:`This build's profile has expired`}),(0,W.jsxs)(y,{children:[`It expired on `,(0,G.default)(s.expiresAt).format(`YYYY-MM-DD`),`. A maintainer rebuilds it to install again.`]})]});let c=s.link.status===`issued`?s.link.token:null;return s.link.status===`no-secret`?(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,s.link.secretName,` on the Console to install from this page.`]}):c===null?null:s.device===`included`?(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm font-medium`,children:`This iPhone is in this build.`}),o?(0,W.jsx)(tt,{fetching:i.isFetching,onRenew:()=>void a()}):(0,W.jsx)(nt,{build:t,token:c}),(0,W.jsx)(rt,{})]}):s.device===`not-included`?(0,W.jsx)(at,{build:t,device:n,registry:s.registry,newerBuild:s.newerBuild,registryReadAt:i.dataUpdatedAt}):(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`p`,{className:`text-sm font-medium`,children:`Check this iPhone first`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`iOS installs this IPA only on the devices it lists. A profile reads this iPhone's ID and nothing else: allow the download, then install it in Settings, where iOS calls it not signed. Safari comes back here, and nothing stays installed.`})]}),(0,W.jsx)($,{build:t})]})}export{Ue as a,Ke as c,J as i,Fe as l,Qe as n,We as o,Ge as r,qe as s,ot as t};
@@ -1 +0,0 @@
1
- import{Di as e,Vr as t,vr as n}from"./sidebar-yC7KdImc.js";import{t as r}from"./HashValueDisplay-DMweha_0.js";import{t as i}from"./key-round-B-P_hhUB.js";import{t as a}from"./package-CXSDZsME.js";import{t as o}from"./badge-DJMW4YVM.js";var s=t(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),c=e(),l=new Set([`production`,`staging`,`dev`]);function u({channel:e,className:t}){let r=e.toLowerCase();return(0,c.jsx)(o,{variant:`outline`,translate:`no`,"data-channel":l.has(r)?r:void 0,className:n(`border-channel-other/20 bg-channel-other/10 text-channel-other`,`data-[channel=production]:border-channel-production/20 data-[channel=production]:bg-channel-production/10 data-[channel=production]:text-channel-production`,`data-[channel=staging]:border-channel-staging/20 data-[channel=staging]:bg-channel-staging/10 data-[channel=staging]:text-channel-staging`,`data-[channel=dev]:border-channel-dev/20 data-[channel=dev]:bg-channel-dev/10 data-[channel=dev]:text-channel-dev`,t),children:e})}function d({icon:e,value:t,display:n}){return(0,c.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(e,{className:`size-4 shrink-0 text-muted-foreground`}),(0,c.jsx)(r,{display:n,maxLength:12,value:t})]})}function f(){return(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}function p({appVersion:e,fingerprintHash:t}){return e?(0,c.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(a,{className:`size-4 shrink-0 text-muted-foreground`}),(0,c.jsx)(`span`,{className:`font-medium`,children:e})]}):t?(0,c.jsx)(d,{icon:s,value:t}):(0,c.jsx)(f,{})}function m({value:e}){return e?(0,c.jsx)(d,{display:e.replace(/^nbk1:/,``),icon:i,value:e}):(0,c.jsx)(f,{})}export{u as i,f as n,p as r,m as t};
@@ -1 +0,0 @@
1
- import{$ as e,Di as t,Hr as n,Oi as r,Ri as i,Si as a,Vi as o,Vr as s,Z as c,gr as l,p as u,wi as d,zr as f}from"./sidebar-yC7KdImc.js";import{t as p}from"./useMutation-w3qYaU2L.js";import{t as ee}from"./check-CqWNyG93.js";import{t as te}from"./clipboard-DZrZK5gR.js";import{t as m}from"./key-round-B-P_hhUB.js";import{t as ne}from"./loader-circle-GWIgH0fo.js";import{t as re}from"./plus-Cx-yFNd9.js";import{t as h}from"./refresh-cw-BgiOaFX3.js";import{a as ie,i as g,n as _,o as ae,r as v,t as y}from"./badge-DJMW4YVM.js";import{n as b}from"./dist-Bw_uSBJn.js";import{a as oe,n as se,o as x,t as S}from"./card-C4sBAMU-.js";import{a as C,c as w,i as T,l as E,n as D,o as O,r as k,s as A,t as j,u as M}from"./alert-dialog-CLC_h1fL.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./dialog-tCTZmAo8.js";import{a as z,i as B,n as V,r as H,t as U}from"./field-DL4OXTJ7.js";import{a as W,i as G,n as K,o as q,r as J,t as ce}from"./table-CwF7yxj4.js";var Y=s(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),X=o(i(),1),Z=d({method:`GET`}).middleware([f]).handler(r(`2c7f3cdb9bd3cab2c026a48abdc84c362db0362924a08679052a325640aec56b`)),le=d({method:`POST`}).middleware([f]).handler(r(`68a2d94ee016be64936401f5eba60ab08a47ff373e1cf9de48e4413336e6034b`)),ue=d({method:`POST`}).middleware([f]).handler(r(`a1cb80b19ca72a64fb631ca28ebb9b6941db245983de082d5dd3203ec2eef795`)),Q={list:[`api-keys`,`list`]},de=()=>n({queryKey:Q.list,queryFn:()=>Z()}),fe=()=>{let e=a();return p({mutationFn:e=>le({data:{name:e}}),onSuccess:async()=>{await e.invalidateQueries({queryKey:Q.list})}})},pe=()=>{let e=a();return p({mutationFn:e=>ue({data:{id:e}}),onSuccess:async()=>{await e.invalidateQueries({queryKey:Q.list})}})},$=t(),me=e=>new Date(e).toISOString().slice(0,10);function he(){let[e,t]=(0,X.useState)(!1),[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(null),o=fe(),s=n.trim(),u=s.length>64?`Name must be 64 characters or fewer.`:null,d=()=>{r(``),a(null),o.reset()},f=e=>{t(e),e||d()};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(l,{onClick:()=>t(!0),children:[(0,$.jsx)(re,{"data-icon":`inline-start`}),`Create API key`]}),(0,$.jsx)(R,{open:e,onOpenChange:f,children:(0,$.jsxs)(F,{showCloseButton:i===null,children:[(0,$.jsxs)(N,{children:[(0,$.jsx)(I,{children:i===null?`Create API key`:`Save your API key`}),(0,$.jsx)(L,{children:i===null?`Name the app or environment that will use this key.`:`This key is shown once. Store it securely before closing.`})]}),i===null?(0,$.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),!(s.length===0||u!==null))try{a((await o.mutateAsync(s)).apiKey),b.success(`API key created`)}catch(e){b.error(e instanceof Error?e.message:`Unable to create API key`)}},children:[(0,$.jsx)(B,{children:(0,$.jsxs)(U,{"data-invalid":u!==null||void 0,children:[(0,$.jsx)(z,{htmlFor:`api-key-name`,children:`Name`}),(0,$.jsx)(c,{id:`api-key-name`,autoComplete:`off`,maxLength:65,onChange:e=>r(e.target.value),placeholder:`Production app`,value:n}),(0,$.jsx)(V,{children:`Use a name you can identify before revoking the key.`}),(0,$.jsx)(H,{children:u})]})}),(0,$.jsx)(P,{className:`mt-4`,children:(0,$.jsxs)(l,{disabled:o.isPending||s.length===0||u!==null,type:`submit`,children:[o.isPending?(0,$.jsx)(ne,{"data-icon":`inline-start`,className:`animate-spin`}):(0,$.jsx)(m,{"data-icon":`inline-start`}),`Create API key`]})})]}):(0,$.jsxs)(B,{children:[(0,$.jsxs)(U,{children:[(0,$.jsx)(z,{htmlFor:`created-api-key`,children:`API key`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(c,{id:`created-api-key`,className:`font-mono`,readOnly:!0,value:i}),(0,$.jsxs)(l,{onClick:async()=>{if(i!==null)try{await navigator.clipboard.writeText(i),b.success(`API key copied`)}catch{b.error(`Unable to copy API key`)}},type:`button`,variant:`outline`,children:[(0,$.jsx)(te,{"data-icon":`inline-start`}),`Copy`]})]})]}),(0,$.jsx)(P,{children:(0,$.jsxs)(l,{onClick:()=>f(!1),children:[(0,$.jsx)(ee,{"data-icon":`inline-start`}),`Done`]})})]})]})})]})}function ge({record:e}){let[t,n]=(0,X.useState)(!1),r=pe(),i=async t=>{t.preventDefault();try{await r.mutateAsync(e.id),n(!1),b.success(`API key revoked`)}catch(e){b.error(e instanceof Error?e.message:`Unable to revoke API key`)}};return(0,$.jsxs)(j,{open:t,onOpenChange:e=>{r.isPending||n(e)},children:[(0,$.jsxs)(M,{render:(0,$.jsx)(l,{size:`sm`,variant:`ghost`}),children:[(0,$.jsx)(Y,{"data-icon":`inline-start`}),`Revoke`]}),(0,$.jsxs)(T,{children:[(0,$.jsxs)(A,{children:[(0,$.jsx)(w,{children:(0,$.jsx)(Y,{})}),(0,$.jsxs)(E,{children:[`Revoke `,e.name,`?`]}),(0,$.jsxs)(C,{children:[`Apps using `,e.prefix,`… will immediately lose OTA update and insights access. This action cannot be undone.`]})]}),(0,$.jsxs)(O,{children:[(0,$.jsx)(k,{disabled:r.isPending,children:`Cancel`}),(0,$.jsx)(D,{disabled:r.isPending,onClick:e=>void i(e),variant:`destructive`,children:`Revoke API key`})]})]})]})}function _e(){let t=de();return(0,$.jsxs)(S,{className:`overflow-hidden shadow-sm`,children:[(0,$.jsxs)(oe,{className:`flex-row items-center justify-between space-y-0 border-b px-4 py-3`,children:[(0,$.jsx)(x,{className:`text-sm`,children:(0,$.jsx)(`h2`,{children:`API keys`})}),(0,$.jsx)(he,{})]}),(0,$.jsx)(se,{className:`p-0`,children:t.isError?(0,$.jsx)(`div`,{className:`p-4`,children:(0,$.jsxs)(_,{variant:`destructive`,children:[(0,$.jsx)(ae,{}),(0,$.jsx)(ie,{children:`API keys couldn't be loaded`}),(0,$.jsx)(g,{children:`Check your connection and try again.`}),(0,$.jsx)(v,{children:(0,$.jsxs)(l,{onClick:()=>void t.refetch(),size:`xs`,variant:`outline`,children:[(0,$.jsx)(h,{"data-icon":`inline-start`}),`Retry`]})})]})}):(0,$.jsxs)(ce,{"aria-label":`API keys`,className:`table-fixed`,children:[(0,$.jsx)(W,{children:(0,$.jsxs)(q,{children:[(0,$.jsx)(G,{children:`Key`}),(0,$.jsx)(G,{className:`w-32`,children:`Created`}),(0,$.jsx)(G,{className:`w-24 text-right`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,$.jsx)(K,{children:t.isLoading?Array.from({length:3},(t,n)=>(0,$.jsxs)(q,{children:[(0,$.jsxs)(J,{className:`space-y-2 py-3`,children:[n===0?(0,$.jsx)(`span`,{className:`sr-only`,children:`Loading API keys`}):null,(0,$.jsx)(e,{className:`h-3.5 w-32`}),(0,$.jsx)(e,{className:`h-3 w-20`})]}),(0,$.jsx)(J,{children:(0,$.jsx)(e,{className:`h-3.5 w-20`})}),(0,$.jsx)(J,{children:(0,$.jsx)(e,{className:`ml-auto h-6 w-16`})})]},n)):t.data?.length===0?(0,$.jsx)(q,{children:(0,$.jsx)(J,{colSpan:3,className:`h-40 text-center text-muted-foreground`,children:(0,$.jsxs)(`div`,{className:`mx-auto flex max-w-xs flex-col items-center gap-2`,children:[(0,$.jsx)(m,{className:`size-5`}),(0,$.jsx)(`p`,{className:`font-medium text-foreground`,children:`No API keys`}),(0,$.jsx)(`p`,{children:`Create an API key to connect an app.`})]})})}):t.data?.map(e=>(0,$.jsxs)(q,{className:e.revoked_at_ms===null?void 0:`text-muted-foreground`,children:[(0,$.jsx)(J,{className:`whitespace-normal py-3`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsx)(`p`,{className:`break-words font-medium text-foreground`,children:e.name}),(0,$.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[e.prefix,`…`]})]})}),(0,$.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(`time`,{dateTime:new Date(e.created_at_ms).toISOString(),children:me(e.created_at_ms)})}),(0,$.jsx)(J,{className:`text-right`,children:e.revoked_at_ms===null?(0,$.jsx)(ge,{record:e}):(0,$.jsx)(y,{variant:`outline`,children:`Revoked`})})]},e.id))})]})})]})}function ve(){return(0,$.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,$.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,$.jsx)(u,{className:`-ml-1`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(m,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`text-sm font-medium`,children:`API keys`})]}),(0,$.jsx)(`p`,{className:`basis-full pl-9 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`API keys can download OTA updates and submit insights only.`})]}),(0,$.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-5xl`,children:(0,$.jsx)(_e,{})})})]})}export{ve as component};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-cy_snb33.js";var t=e;export{t as notFoundComponent};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights-bUk3ChoU.js","assets/ConsoleFeatureUnavailable-cy_snb33.js","assets/sidebar-yC7KdImc.js","assets/console-features-api-BO5V64P3.js","assets/arrow-up-right-BFafIOrq.js","assets/NotFoundPage-DDOJarFa.js","assets/link-CN3iHC4A.js","assets/empty-DsbLxQ1w.js","assets/insights-DTF7C4jb.js","assets/alert-dialog-CLC_h1fL.js","assets/select-CA8r-UUe.js","assets/useCompositeListItem-lAmUsXcc.js","assets/check-CqWNyG93.js","assets/tabs-CHNnCyvw.js","assets/insights-usage-rpc-B4V-Qqo4.js","assets/valueToPercent-Db73Kirz.js","assets/EventDetails-sxag8Hfc.js","assets/insights-api-B6Gj74n5.js","assets/preload-helper-CRQjUQaZ.js","assets/copy-CH1__JAW.js","assets/HashValueDisplay-DMweha_0.js","assets/dist-Bw_uSBJn.js","assets/input-group-B7jx0icS.js","assets/smartphone-CxP0GGT6.js","assets/badge-DJMW4YVM.js","assets/InsightsPageHeader-D5TJspVe.js","assets/list-fFsS8Wxe.js","assets/arrow-right-CXp_K3xK.js","assets/chevron-right-DNbYTBX1.js","assets/circle-off-BCkZpskJ.js","assets/refresh-cw-BgiOaFX3.js","assets/rotate-cw-C1v7YuN7.js","assets/undo-2-Bod3vw7x.js","assets/BundleIdDisplay-B0gAH01c.js","assets/insights-search-TfRz5kGG.js","assets/uuidv7-CVJ09bBG.js","assets/PlatformIcon-BBvlg6JY.js","assets/card-C4sBAMU-.js","assets/table-CwF7yxj4.js","assets/api-DLryz9hA.js","assets/useMutation-w3qYaU2L.js"])))=>i.map(i=>d[i]);
2
- import{i as e,r as t,t as n}from"./preload-helper-CRQjUQaZ.js";import{r}from"./console-features-api-BO5V64P3.js";import{a as i}from"./insights-search-TfRz5kGG.js";var a=e(`/insights`)({beforeLoad:({context:e})=>r(e.queryClient,`insightsAnalytics`),notFoundComponent:t(()=>n(()=>import(`./insights-bUk3ChoU.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:t(()=>n(()=>import(`./insights-DTF7C4jb.js`),__vite__mapDeps([8,2,9,10,11,12,13,14,15,6,16,17,18,19,20,21,22,23,24,25,3,26,7,27,4,28,29,30,31,32,33,34,35,36,37,38,39,40])),`component`),validateSearch:i});export{a as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-cy_snb33.js";var t=e;export{t as notFoundComponent};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-BqtmnGTt.js","assets/ConsoleFeatureUnavailable-cy_snb33.js","assets/sidebar-yC7KdImc.js","assets/console-features-api-BO5V64P3.js","assets/arrow-up-right-BFafIOrq.js","assets/NotFoundPage-DDOJarFa.js","assets/link-CN3iHC4A.js","assets/empty-DsbLxQ1w.js","assets/insights_.distribution-BqfzAuAf.js","assets/select-CA8r-UUe.js","assets/useCompositeListItem-lAmUsXcc.js","assets/check-CqWNyG93.js","assets/insights-usage-rpc-B4V-Qqo4.js","assets/valueToPercent-Db73Kirz.js","assets/arrow-left-DQjHJAnT.js","assets/insights-api-B6Gj74n5.js","assets/preload-helper-CRQjUQaZ.js","assets/rotate-cw-C1v7YuN7.js","assets/badge-DJMW4YVM.js","assets/BundleIdDisplay-B0gAH01c.js","assets/insights-search-TfRz5kGG.js","assets/uuidv7-CVJ09bBG.js","assets/PlatformIcon-BBvlg6JY.js","assets/InsightsPageHeader-D5TJspVe.js","assets/tabs-CHNnCyvw.js","assets/list-fFsS8Wxe.js","assets/card-C4sBAMU-.js","assets/field-DL4OXTJ7.js"])))=>i.map(i=>d[i]);
2
- import{i as e,r as t,t as n}from"./preload-helper-CRQjUQaZ.js";import{r}from"./console-features-api-BO5V64P3.js";import{i}from"./insights-search-TfRz5kGG.js";var a=e(`/insights_/distribution`)({beforeLoad:({context:e})=>r(e.queryClient,`insightsAnalytics`),notFoundComponent:t(()=>n(()=>import(`./insights_.distribution-BqtmnGTt.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:t(()=>n(()=>import(`./insights_.distribution-BqfzAuAf.js`),__vite__mapDeps([8,2,9,10,11,12,13,6,14,4,15,16,17,18,19,20,21,22,23,24,3,25,26,7,27])),`component`),validateSearch:i});export{a as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-cy_snb33.js";var t=e;export{t as notFoundComponent};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-cy_snb33.js";var t=e;export{t as notFoundComponent};
@@ -1 +0,0 @@
1
- import{Di as e,Vr as t,gr as n}from"./sidebar-yC7KdImc.js";import{t as r}from"./copy-CH1__JAW.js";import{n as i}from"./dist-Bw_uSBJn.js";import{f as a,p as o}from"./uuidv7-CVJ09bBG.js";var s=t(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),c=e();function l({label:e,value:t,wrap:a=!1}){let o=async()=>{try{await navigator.clipboard.writeText(t),i.success(`Copied to clipboard`)}catch{i.error(`Could not copy ${e}`)}};return(0,c.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-2 rounded-md border bg-muted/40 py-1 pr-1 pl-3`,children:[(0,c.jsx)(`code`,{className:a?`min-w-0 flex-1 text-left font-mono text-xs whitespace-normal sm:whitespace-nowrap`:`min-w-0 flex-1 overflow-x-auto text-left font-mono text-xs whitespace-nowrap`,children:t}),(0,c.jsx)(n,{"aria-label":`Copy ${e}`,className:`size-11 sm:size-7`,onClick:()=>void o(),size:`icon-sm`,variant:`ghost`,children:(0,c.jsx)(r,{"aria-hidden":`true`})})]})}var u=e=>/^[\w@%+=:,./-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`,d={apk:{label:`APK`,installs:`Android device or emulator`},aab:{label:`AAB`,installs:`Google Play or bundletool`},app:{label:`Simulator app`,installs:`iOS Simulator`},ipa:{label:`IPA`,installs:`registered iOS devices`}},f=e=>e===`ios`?`iOS`:`Android`,p=e=>{let t=e.submitted_version??[e.app_version,e.build_number===null?null:`(${e.build_number})`].filter(e=>e!==null).join(` `);return t===``?null:`${f(e.platform)} ${t}`},m=e=>`/api/native-builds/${encodeURIComponent(e)}/download`,h=(e,t,n)=>`${e.origin}${g(e,t)}${m(t)}?t=${encodeURIComponent(n)}`,g=(e,t)=>{let n=_(t);return e.pathname.endsWith(n)?e.pathname.slice(0,-n.length):``},_=e=>`/native-builds/${encodeURIComponent(e)}`,v=3600*1e3,y=`hot-updater-ios-udid`,b=`hot-updater-ios-device-receipt`,x=/^(?:[0-9a-f]{40}|[0-9a-f]{8}-[0-9a-f]{16})$/iu,S=`/native-builds/devices`,C=`/_hot-updater/devices/device.mobileconfig`,w=(e,t)=>`${e}${C}?t=${encodeURIComponent(t)}`,T=`npx hot-updater native-build devices add`,E=e=>`…${e.slice(-6)}`,D=e=>`/_hot-updater/native-builds/${encodeURIComponent(e)}/manifest.plist`,O=(e,t,n)=>{let r=`${e.origin}${g(e,t)}${D(t)}?t=${encodeURIComponent(n)}`;return`itms-services://?action=download-manifest&url=${encodeURIComponent(r)}`},k=e=>o(e.channel_id.slice(8)),A=e=>{if(e.fingerprintHash!==null)return{platform:e.platform,channel:e.channel,fingerprintHash:e.fingerprintHash,appVersion:null};let t=e.targetAppVersion;return t===null||a(t)!==t?null:{platform:e.platform,channel:e.channel,fingerprintHash:null,appVersion:t}},j=e=>{let t=(e.artifact_storage_uri.split(/[?#]/,1)[0]??``).split(`/`).at(-1)??``;try{return decodeURIComponent(t)}catch{return t}},M=[`B`,`KB`,`MB`,`GB`],N=e=>{let t=e,n=0;for(;t>=1024&&n<M.length-1;)t/=1024,n+=1;return`${n===0?t:t.toFixed(1)} ${M[n]}`},P=e=>`npx hot-updater native-build install ${u(e.id)}`;export{s as C,l as S,p as _,y as a,A as b,N as c,d,k as f,O as g,P as h,x as i,w as l,j as m,S as n,v as o,m as p,b as r,g as s,T as t,E as u,h as v,u as x,f as y};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds-Eh72Vr2G.js","assets/sidebar-yC7KdImc.js","assets/preload-helper-CRQjUQaZ.js","assets/link-CN3iHC4A.js","assets/select-CA8r-UUe.js","assets/useCompositeListItem-lAmUsXcc.js","assets/check-CqWNyG93.js","assets/arrow-up-right-BFafIOrq.js","assets/native-builds-BdzfAFnF.js","assets/copy-CH1__JAW.js","assets/dist-Bw_uSBJn.js","assets/uuidv7-CVJ09bBG.js","assets/HashValueDisplay-DMweha_0.js","assets/TargetDisplay-DB8D019f.js","assets/key-round-B-P_hhUB.js","assets/package-CXSDZsME.js","assets/badge-DJMW4YVM.js","assets/-native-builds-search-7blX2yQW.js","assets/history-wYnPoVmT.js","assets/refresh-cw-BgiOaFX3.js","assets/RelativeTime-CY1dKZpv.js","assets/relativeTime-CBmDq8wh.js","assets/chevron-right-DNbYTBX1.js","assets/table-CwF7yxj4.js","assets/RowReason-BMx_vclu.js","assets/PlatformIcon-BBvlg6JY.js","assets/NativeBuildsNav-CjOOlbEu.js","assets/tabs-CHNnCyvw.js","assets/SandboxBadge-irEkMf1P.js","assets/send-BgXZNiEA.js","assets/dialog-tCTZmAo8.js","assets/api-DLryz9hA.js","assets/useMutation-w3qYaU2L.js"])))=>i.map(i=>d[i]);
2
- import{i as e,r as t,t as n}from"./preload-helper-CRQjUQaZ.js";import{r}from"./-native-builds-search-7blX2yQW.js";var i=e(`/native-builds`)({component:t(()=>n(()=>import(`./native-builds-Eh72Vr2G.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])),`component`),validateSearch:r});export{i as t};
@@ -1 +0,0 @@
1
- import{Di as e,Vr as t,_r as n,gr as r,h as i,p as a}from"./sidebar-yC7KdImc.js";import{t as o}from"./link-CN3iHC4A.js";import{o as s}from"./preload-helper-CRQjUQaZ.js";import{t as c}from"./arrow-up-right-BFafIOrq.js";import{S as l,_ as u,c as d,d as f,f as p,m as ee,p as te,y as m}from"./native-builds-BdzfAFnF.js";import{a as ne,i as h,n as re,o as ie,r as ae,t as oe}from"./select-CA8r-UUe.js";import{r as se}from"./HashValueDisplay-DMweha_0.js";import{i as ce,n as g,r as _,t as v}from"./TargetDisplay-DB8D019f.js";import{i as y}from"./-native-builds-search-7blX2yQW.js";import{t as le}from"./history-wYnPoVmT.js";import{t as b}from"./refresh-cw-BgiOaFX3.js";import{a as ue,i as de,n as fe,o as pe,r as me,t as he}from"./badge-DJMW4YVM.js";import{t as ge}from"./uuidv7-CVJ09bBG.js";import{t as x}from"./native-builds-CWwvuOXr.js";import{n as _e,t as ve}from"./PlatformIcon-BBvlg6JY.js";import{a as ye,n as be,o as xe,r as Se,s as Ce,t as we}from"./dialog-tCTZmAo8.js";import{g as Te,i as Ee,p as De}from"./api-DLryz9hA.js";import{i as S,r as C}from"./table-CwF7yxj4.js";import{a as w,c as T,d as E,f as Oe,i as ke,l as Ae,n as je,o as D,p as Me,r as Ne,s as O,t as k,u as Pe}from"./RelativeTime-CY1dKZpv.js";import{a as A,c as Fe,i as j,n as Ie,o as Le,r as Re,s as ze,t as M}from"./RowReason-BMx_vclu.js";import{t as Be}from"./NativeBuildsNav-CjOOlbEu.js";import{i as Ve,n as He,r as N,t as P}from"./SandboxBadge-irEkMf1P.js";var Ue=t(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),F=e(),I=`npx hot-updater native-build import <file>`,L=`https://hot-updater.dev/docs/guides/native-build#import-a-build-made-elsewhere`;function We(){return(0,F.jsxs)(we,{children:[(0,F.jsxs)(Ce,{render:(0,F.jsx)(r,{"aria-label":`Import a build`,className:`min-h-11 min-w-11 sm:min-h-7 sm:min-w-0`,size:`sm`,variant:`outline`}),children:[(0,F.jsx)(Ue,{"data-icon":`inline-start`}),(0,F.jsx)(`span`,{className:`hidden sm:inline`,children:`Import a build`})]}),(0,F.jsxs)(be,{className:`sm:max-w-lg`,children:[(0,F.jsxs)(ye,{children:[(0,F.jsx)(xe,{children:`Import a build`}),(0,F.jsx)(Se,{children:`Track an .ipa, .aab, .apk or .app built elsewhere as a patch base.`})]}),(0,F.jsx)(l,{label:`the import command`,value:I,wrap:!0}),(0,F.jsxs)(`a`,{className:n({className:`min-h-11 w-full sm:min-h-8 sm:w-fit`,variant:`outline`}),href:L,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,F.jsx)(c,{"data-icon":`inline-end`})]})]})]})}var Ge={"app-store":`App Store`,"ad-hoc":`ad hoc`,development:`development`,enterprise:`enterprise`},R=e=>{let t=f[e.artifact_kind].label,n=e.submitted_to===null?e.artifact_kind===`ipa`&&e.export_method!==null?`${Ge[e.export_method]} ${t}`:t:`${Ve[e.submitted_to]} build`;return e.is_sandbox?`sandbox ${n}`:n},Ke=e=>{if(e===void 0)return{sentence:`A newer build on its channel reaches people the same way.`,label:`Older: a newer build on its channel reaches people the same way`};let t=u(e);return{sentence:`A newer ${R(e)} exists${t===null?`.`:`: ${t}`}`,label:`Older: a newer ${R(e)} exists${t===null?``:`, ${t}`}`}};function z({newer:e}){let t=Ke(e);return(0,F.jsx)(M,{icon:le,label:t.label,reason:t.sentence,children:`Older`})}var qe=`https://hot-updater.dev/docs/guides/native-build#how-a-build-is-tracked`,B=10,V=e=>e===void 0?{}:{channel:e},Je={one:`older build`,other:`older builds`};function Ye({channel:e,paged:t,folded:i,onClearChannel:a}){return t||i?(0,F.jsx)(O,{icon:y,title:i?`Each build here has a newer one`:`No more native builds`,children:(0,F.jsx)(o,{className:n({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:V(e),to:`/native-builds`,children:`Show the newest builds`})}):e===void 0?(0,F.jsxs)(O,{icon:y,title:`No native builds`,children:[(0,F.jsxs)(`p`,{children:[`Build one with`,` `,(0,F.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build android`}),` or`,` `,(0,F.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build ios`}),`, or import one built elsewhere:`]}),(0,F.jsx)(`div`,{className:`w-full text-left`,children:(0,F.jsx)(l,{label:`the import command`,value:I,wrap:!0})}),(0,F.jsxs)(`a`,{className:n({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),href:qe,rel:`noreferrer`,target:`_blank`,children:[`Native build guide`,(0,F.jsx)(c,{"data-icon":`inline-end`})]}),(0,F.jsxs)(`a`,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:L,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,F.jsx)(c,{"data-icon":`inline-end`})]})]}):(0,F.jsxs)(O,{icon:y,title:(0,F.jsxs)(F.Fragment,{children:[`No native build embeds `,(0,F.jsx)(`span`,{translate:`no`,children:e})]}),children:[(0,F.jsx)(`p`,{children:`A build embeds the channel it was built on. Build one on this channel, or list every channel's builds.`}),(0,F.jsx)(r,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:a,variant:`outline`,children:`Show all channels`})]})}var H=e=>`${m(e.platform)} ${f[e.artifact_kind].label}`;function U({build:e}){return(0,F.jsx)(o,{"aria-label":H(e),className:`relative rounded-sm font-medium whitespace-nowrap text-foreground transition-colors underline-offset-4 after:absolute after:-inset-x-[10px] after:-inset-y-[10px] hover:text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:after:hidden`,params:{buildId:e.id},to:`/native-builds/$buildId`,children:f[e.artifact_kind].label})}function W({build:e,inTable:t=!1}){return t?(0,F.jsxs)(`span`,{className:`flex max-w-24 flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,F.jsx)(U,{build:e}),(0,F.jsx)(P,{build:e})]}):(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,F.jsx)(U,{build:e}),(0,F.jsx)(P,{build:e})]})}function G({channel:e,onChannel:t}){return(0,F.jsx)(`button`,{"aria-label":`Show the builds that embed ${e}`,className:`relative flex max-w-full min-w-0 rounded-md text-left after:absolute after:inset-x-0 after:-inset-y-[11px] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:after:hidden`,onClick:()=>t(e),title:e,type:`button`,children:(0,F.jsx)(ce,{channel:e,className:`block max-w-32 truncate`})})}function Xe({build:e}){return!N(e)&&!e.is_store_build?(0,F.jsx)(g,{}):(0,F.jsx)(K,{build:e,className:`flex flex-col items-start gap-1`})}function K({build:e,className:t}){return(0,F.jsxs)(`span`,{className:t,children:[(0,F.jsx)(He,{build:e}),e.is_store_build?(0,F.jsx)(he,{className:`px-1.5`,variant:`muted`,children:`Store build`}):null]})}function q({build:e}){return(0,F.jsxs)(`a`,{"aria-label":`Download ${ee(e)}`,className:n({className:`min-h-11 sm:min-h-8`,size:`sm`,variant:`outline`}),download:!0,href:te(e.id),children:[(0,F.jsx)(se,{"data-icon":`inline-start`}),`Download`]})}function Ze({build:e}){return e.build_number?(0,F.jsx)(`span`,{className:`font-mono tabular-nums`,translate:`no`,children:e.build_number}):(0,F.jsx)(g,{})}var J=e=>ge(e.id);function Y({build:e,older:t=!1,newer:n,onChannel:r}){let i=s(),a=p(e);return(0,F.jsxs)(E,{"aria-label":`Open native build ${e.id}`,className:`data-[older=true]:bg-muted/35 data-[older=true]:saturate-50 data-[older=true]:hover:bg-muted/50 data-[older=true]:hover:saturate-100 data-[older=true]:focus-within:saturate-100`,"data-older":t?!0:void 0,onOpen:()=>void i({to:`/native-builds/$buildId`,params:{buildId:e.id}}),children:[(0,F.jsx)(C,{children:(0,F.jsx)(W,{build:e,inTable:!0})}),(0,F.jsx)(C,{children:(0,F.jsx)(G,{channel:a,onChannel:r})}),(0,F.jsx)(C,{className:`whitespace-nowrap`,children:(0,F.jsx)(_e,{platform:e.platform})}),(0,F.jsx)(C,{children:(0,F.jsx)(Ze,{build:e})}),(0,F.jsx)(C,{children:(0,F.jsx)(_,{appVersion:e.app_version,fingerprintHash:e.fingerprint_hash})}),(0,F.jsx)(C,{children:(0,F.jsx)(v,{value:e.build_key})}),(0,F.jsx)(C,{children:(0,F.jsx)(Xe,{build:e})}),(0,F.jsx)(C,{className:`whitespace-nowrap text-muted-foreground tabular-nums`,children:d(e.byte_size)}),(0,F.jsx)(C,{className:`text-xs text-muted-foreground`,children:t?(0,F.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,F.jsx)(k,{ms:J(e)}),(0,F.jsx)(z,{newer:n})]}):(0,F.jsx)(k,{ms:J(e)})}),(0,F.jsx)(C,{className:`text-right`,children:(0,F.jsx)(q,{build:e})})]})}function X({build:e,older:t=!1,newer:n,onChannel:r}){let i=s(),a=p(e),o=N(e)||e.is_store_build;return(0,F.jsxs)(je,{"aria-label":`Native build ${H(e)} ${e.id}`,className:`gap-3 border-b-0 data-[older=true]:bg-muted/35 data-[older=true]:saturate-50 data-[older=true]:hover:bg-muted/50 data-[older=true]:hover:saturate-100 data-[older=true]:focus-within:saturate-100`,"data-older":t?!0:void 0,onClick:Me(()=>void i({to:`/native-builds/$buildId`,params:{buildId:e.id}})),children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-x-2.5`,children:[(0,F.jsx)(ve,{className:`size-4 shrink-0 text-muted-foreground`,platform:e.platform}),(0,F.jsx)(W,{build:e}),t?(0,F.jsx)(z,{newer:n}):null]}),(0,F.jsx)(q,{build:e})]}),(0,F.jsx)(`div`,{className:`flex min-w-0`,children:(0,F.jsx)(G,{channel:a,onChannel:r})}),(0,F.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:m(e.platform)}),e.build_number?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{translate:`no`,children:[`Build`,` `,(0,F.jsx)(`span`,{className:`font-mono tabular-nums text-foreground`,children:e.build_number})]}),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`})]}):null,(0,F.jsx)(`span`,{className:`tabular-nums`,children:d(e.byte_size)}),(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,F.jsx)(k,{ms:J(e)})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-6 text-xs`,children:[(0,F.jsxs)(`span`,{className:`flex items-center`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`Target `}),(0,F.jsx)(_,{appVersion:e.app_version,fingerprintHash:e.fingerprint_hash})]}),e.build_key?(0,F.jsxs)(`span`,{className:`flex items-center`,children:[(0,F.jsx)(`span`,{className:`sr-only`,children:`Build key `}),(0,F.jsx)(v,{value:e.build_key})]}):null]}),o?(0,F.jsx)(K,{build:e,className:`flex flex-wrap items-center gap-1.5`}):null]})}function Qe({fold:e,channel:t,isMobile:n,open:r,onOpenChange:i,onChannel:a}){let o=De(t,{...e.from===void 0?{}:{from:e.from},to:e.to},r),s=o.data?.pages??[],c=Object.assign({},...s.map(e=>e.newer)),l=s.flatMap(e=>e.rows),u=n?void 0:B,d=o.isError?(0,F.jsx)(j,{columns:u,label:`Older builds`,onRetry:()=>void o.refetch(),state:`error`}):o.isPending||o.isFetchingNextPage?(0,F.jsx)(j,{columns:u,label:`Loading older builds`,state:`loading`}):o.hasNextPage?(0,F.jsx)(j,{columns:u,label:`Older builds`,onMore:()=>void o.fetchNextPage(),state:`more`}):null,f={label:Le(e,Je),open:r,onOpenChange:i,panelId:`native-build-fold-${e.to}`};return n?(0,F.jsxs)(Ie,{...f,inList:!0,children:[l.map(e=>(0,F.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,F.jsx)(X,{build:e,newer:c[e.id],older:!0,onChannel:a})},e.id)),d]}):(0,F.jsxs)(Re,{...f,columns:B,children:[l.map(e=>(0,F.jsx)(Y,{build:e,newer:c[e.id],older:!0,onChannel:a},e.id)),d]})}function $e({builds:e,channel:t,paged:n,onChannel:a}){let o=i(),s=Fe(),c=e.data?.entries,{next:l,previous:u}=e.data??{},d=c?.filter(({kind:e})=>e===`row`).length??0;if(e.isError)return(0,F.jsxs)(fe,{variant:`destructive`,children:[(0,F.jsx)(pe,{}),(0,F.jsx)(ue,{children:`Native builds couldn't be loaded`}),(0,F.jsx)(de,{children:`Check your connection and try again.`}),(0,F.jsx)(me,{children:(0,F.jsxs)(r,{onClick:()=>void e.refetch(),size:`xs`,variant:`outline`,children:[(0,F.jsx)(b,{"data-icon":`inline-start`}),`Retry`]})})]});let f=(0,F.jsx)(Ye,{channel:t,folded:(c?.length??0)>0,onClearChannel:()=>a(void 0),paged:n}),p=e=>(0,F.jsx)(Qe,{channel:t,fold:e,isMobile:o,onChannel:a,onOpenChange:t=>s.set(A(e),t),open:s.isOpen(A(e))},`fold-${e.to}`);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(T,{children:o?(0,F.jsx)(`div`,{"aria-busy":e.isPlaceholderData,"aria-label":`Native builds`,className:`h-full overflow-y-auto aria-busy:opacity-60`,role:`list`,children:e.isLoading?(0,F.jsx)(Ne,{label:`Loading native builds`}):(0,F.jsxs)(F.Fragment,{children:[d===0?(0,F.jsx)(ke,{children:f}):null,c?.map(e=>e.kind===`fold`?p(e):(0,F.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,F.jsx)(X,{build:e.row,onChannel:a})},e.row.id))]})}):(0,F.jsx)(w,{"aria-busy":e.isPlaceholderData,"aria-label":`Native builds`,className:`aria-busy:opacity-60 [&_td]:px-1.5 [&_th]:px-1.5`,header:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(S,{children:`Artifact`}),(0,F.jsx)(S,{children:`Channel`}),(0,F.jsx)(S,{children:`Platform`}),(0,F.jsx)(S,{children:`Build`}),(0,F.jsx)(S,{children:`Target`}),(0,F.jsx)(S,{children:`Build key`}),(0,F.jsx)(S,{children:`Store`}),(0,F.jsx)(S,{children:`Size`}),(0,F.jsx)(S,{children:`Created`}),(0,F.jsx)(S,{className:`text-right`,children:(0,F.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),rowGroups:!0,children:e.isLoading?(0,F.jsx)(D,{children:(0,F.jsx)(Oe,{columns:B,label:`Loading native builds`})}):(0,F.jsxs)(F.Fragment,{children:[d===0?(0,F.jsx)(D,{children:(0,F.jsx)(Ae,{columns:B,children:f})}):null,ze(c??[]).map(e=>e.kind===`fold`?p(e.fold):(0,F.jsx)(D,{children:e.rows.map(e=>(0,F.jsx)(Y,{build:e,onChannel:a},e.id))},`rows-${e.rows[0].id}`))]})})}),e.isLoading||c===void 0?null:(0,F.jsx)(Pe,{count:d,label:`Native build pages`,pending:e.isPlaceholderData,newest:n?{search:V(t),to:`/native-builds`}:void 0,next:l===void 0?void 0:{search:{...V(t),before:l},to:`/native-builds`},previous:u===void 0?void 0:{search:{...V(t),...u},to:`/native-builds`}})]})}var Z=`all`,Q=`channel:`,$=e=>`${Q}${e}`;function et({search:e,onSearchChange:t}){let{channel:n,before:i,after:o}=e,s=Te(e),c=Ee(),l=c.data?.map(({name:e})=>e)??[],u=n===void 0||l.includes(n)?l:[n,...l],d=e=>t(e===void 0?{}:{channel:e});return(0,F.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,F.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,F.jsx)(a,{className:`-ml-1 size-11 lg:size-7`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,F.jsx)(`h1`,{className:`text-sm font-medium`,children:`Native builds`})]}),(0,F.jsx)(`p`,{className:`basis-full pl-12 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`Store and test builds, each the built-in bundle its OTAs patch from.`})]}),(0,F.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4 bg-muted/5 p-3 sm:p-6`,children:[(0,F.jsx)(Be,{current:`builds`}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(oe,{items:[{label:`All channels`,value:Z},...u.map(e=>({label:e,value:$(e)}))],onOpenChange:e=>{e&&c.refetch()},onValueChange:e=>d(e?.startsWith(Q)?e.slice(8):void 0),value:n===void 0?Z:$(n),children:[(0,F.jsx)(ne,{"aria-label":`Channel`,className:`min-w-0 flex-1 text-xs data-[size=default]:h-11 sm:w-48 sm:flex-none sm:data-[size=default]:h-8`,children:(0,F.jsx)(ie,{})}),(0,F.jsx)(re,{children:(0,F.jsxs)(ae,{children:[(0,F.jsx)(h,{value:Z,children:`All channels`}),u.map(e=>(0,F.jsx)(h,{translate:`no`,value:$(e),children:e},e))]})})]}),(0,F.jsx)(`div`,{className:`ml-auto`,children:(0,F.jsx)(We,{})}),(0,F.jsx)(r,{"aria-label":`Refresh native builds`,className:`size-11 sm:size-7`,disabled:s.isLoading,onClick:()=>void s.refetch(),size:`icon-sm`,variant:`ghost`,children:(0,F.jsx)(b,{"aria-hidden":`true`})})]}),(0,F.jsx)($e,{builds:s,channel:n,onChannel:d,paged:i!==void 0||o!==void 0})]})]})}function tt(){let e=x.useSearch(),t=x.useNavigate();return(0,F.jsx)(et,{onSearchChange:e=>void t({search:e}),search:e})}export{tt as component};
@@ -1 +0,0 @@
1
- import{$ as e,Di as t,Vi as n,Vr as r,_r as i,gr as a,p as o}from"./sidebar-yC7KdImc.js";import{t as s}from"./link-CN3iHC4A.js";import{t as c}from"./arrow-up-right-BFafIOrq.js";import{C as l,S as u,_ as d,c as f,d as p,h as m,m as h,p as g,v as ee,x as _,y as v}from"./native-builds-BdzfAFnF.js";import{t as te}from"./chevron-right-DNbYTBX1.js";import{n as ne,t as y}from"./native-builds_._buildId-BVA5GnZP.js";import{r as b}from"./HashValueDisplay-DMweha_0.js";import{i as re,n as ie,r as x,t as ae}from"./RolloutPercentageBadge-BHgHkBGB.js";import{i as oe,r as se,t as ce}from"./TargetDisplay-DB8D019f.js";import{t as le}from"./git-branch-ByZMEBxZ.js";import{i as ue}from"./-native-builds-search-7blX2yQW.js";import{t as de}from"./history-wYnPoVmT.js";import{t as S}from"./refresh-cw-BgiOaFX3.js";import{t as fe}from"./smartphone-CxP0GGT6.js";import{a as C,i as w,n as T,o as E,r as D,t as pe}from"./badge-DJMW4YVM.js";import{n as O}from"./dist-Bw_uSBJn.js";import{a as k,n as A,o as j,t as M}from"./card-C4sBAMU-.js";import{r as me}from"./uuidv7-CVJ09bBG.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./empty-DsbLxQ1w.js";import{n as he}from"./relativeTime-CBmDq8wh.js";import{t as ge}from"./PlatformIcon-BBvlg6JY.js";import{a as _e,d as ve,f as ye,h as be,l as xe,u as Se}from"./api-DLryz9hA.js";import{a as z,i as B,n as V,o as H,r as U,t as W}from"./table-CwF7yxj4.js";import{t as Ce}from"./BundleIdDisplay-B0gAH01c.js";import{a as G,n as we,r as K,t as Te}from"./SandboxBadge-irEkMf1P.js";import{l as q,n as Ee,o as De,t as Oe}from"./IosInstall-B5NspihF.js";var ke=r(`package-open`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),J=t();function Ae({value:e,length:t,label:n}){let r=async()=>{try{await navigator.clipboard.writeText(e),O.success(`Copied to clipboard`,{description:e})}catch{O.error(`Could not copy the ${n}`)}};return(0,J.jsx)(`button`,{"aria-label":`Copy the ${n} ${e}`,className:`relative cursor-copy rounded-sm font-mono after:absolute after:-inset-x-2 after:-inset-y-4 sm:after:hidden text-xs whitespace-nowrap tabular-nums underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:e=>{e.stopPropagation(),r()},title:e,translate:`no`,type:`button`,children:e.slice(0,t)})}function je({hash:e}){let t=_e();if(e===null)return(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let n=ie(t.data?.console.gitUrl,e);return n===null?(0,J.jsx)(Ae,{label:`commit`,length:7,value:e}):(0,J.jsx)(`a`,{className:`relative font-mono text-xs whitespace-nowrap underline-offset-4 after:absolute after:-inset-x-2 after:-inset-y-4 hover:underline sm:after:hidden`,href:n,onClick:e=>e.stopPropagation(),rel:`noreferrer`,target:`_blank`,title:e,translate:`no`,children:e.slice(0,7)})}function Y({label:e,children:t}){return(0,J.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[10rem_minmax(0,1fr)] sm:gap-4`,children:[(0,J.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,J.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}function Me({detail:e}){let{build:t}=e,n=xe();if(t.is_sandbox)return null;let r=!t.is_store_build;return(0,J.jsx)(a,{className:`min-h-11 shrink-0 sm:min-h-8`,disabled:n.isPending,onClick:()=>n.mutate({id:t.id,storeBuild:r},{onSuccess:()=>{O.success(r?`Marked as the store build`:`Mark cleared`)},onError:e=>{O.error(`Could not change the mark`,{description:e.message})}}),size:`sm`,type:`button`,variant:`outline`,children:r?`Mark as store build`:`Clear mark`})}function Ne({detail:e}){let{build:t,newestInScope:n,storeBuildInScope:r}=e,i=r??n;if(i===null)return null;let a=i.id===t.id;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border bg-muted/40 p-3 text-xs sm:flex-row sm:items-center sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,J.jsx)(a?ne:de,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),r?.id===t.id?(0,J.jsxs)(`p`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Store build.`}),` New deploys to this scope patch from this build.`]}):a?(0,J.jsxs)(`p`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Current baseline.`}),` The newest build, and no store build is marked. New deploys to this scope patch from this build.`]}):(0,J.jsxs)(`p`,{children:[(0,J.jsx)(`span`,{className:`font-medium`,children:`Not the base.`}),` New deploys patch from`,` `,(0,J.jsxs)(s,{className:`inline-flex items-center gap-0.5 font-medium underline underline-offset-4`,params:{buildId:i.id},to:`/native-builds/$buildId`,children:[d(i)??(0,J.jsxs)(J.Fragment,{children:[v(i.platform),` `,p[i.artifact_kind].label,` ·`,` `,(0,J.jsx)(x,{uuid:i.id})]}),(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-3`})]}),`, so this one gets no new patches.`]})]}),(0,J.jsx)(Me,{detail:e})]})}function Pe({detail:e}){let{build:t,builtInBundle:n,channel:r}=e,i=n?.childCount??0;return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Built-in bundle`})})}),(0,J.jsxs)(A,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,J.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(Y,{label:`Bundle ID`,children:(0,J.jsx)(Ce,{bundleId:t.min_bundle_id})}),(0,J.jsx)(Y,{label:`OTAs patching from it`,children:(0,J.jsx)(`span`,{className:`tabular-nums`,children:i===1?`1 bundle`:`${i} bundles`})}),(0,J.jsx)(Y,{label:`Scope`,children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,J.jsx)(s,{"aria-label":`Show the builds that embed ${r}`,className:`relative rounded-md after:absolute after:inset-x-0 after:-inset-y-[11px] sm:after:hidden`,search:{channel:r},to:`/native-builds`,children:(0,J.jsx)(oe,{channel:r})}),(0,J.jsx)(`span`,{className:`text-xs`,children:v(t.platform)})]})}),(0,J.jsx)(Y,{label:`Target`,children:(0,J.jsx)(`span`,{className:`text-xs`,children:(0,J.jsx)(se,{appVersion:t.app_version,fingerprintHash:t.fingerprint_hash})})}),(0,J.jsx)(Y,{label:`Build key`,children:(0,J.jsx)(`span`,{className:`text-xs`,children:(0,J.jsx)(ce,{value:t.build_key})})}),t.build_number?(0,J.jsx)(Y,{label:`Build`,children:(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,translate:`no`,children:t.build_number})}):null,K(t)?(0,J.jsx)(Y,{label:`Store`,children:(0,J.jsx)(we,{build:t,withTime:!0})}):null,(0,J.jsx)(Y,{label:`Commit`,children:(0,J.jsx)(je,{hash:t.git_commit_hash})}),(0,J.jsx)(Y,{label:`Created`,children:(0,J.jsx)(x,{format:`both`,uuid:t.id})})]}),(0,J.jsx)(Ne,{detail:e}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`A store or test install of this build runs this bundle until its first OTA. That OTA downloads as a patch from this bundle when one exists, and as the full bundle otherwise.`})]})]})}var Fe=n(he(),1),X={ipa:`The .ipa installs only on devices its signing profile allows (development or ad hoc); an App Store export reaches testers through TestFlight.`,aab:`The .aab installs through Google Play or bundletool, not from the file.`},Ie={apk:`Scan with an Android phone's camera, then open the APK to install it.`,ipa:`Scan to download. ${X.ipa}`,aab:`Scan to download. ${X.aab}`,app:`Scan to download the .app.zip on a Mac.`};function Le(){let{origin:e,pathname:t}=window.location;return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(q,{className:`size-48`,label:`Open this page on an iPhone`,value:`${e}${t}`}),(0,J.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:`Scan with an iPhone to install this build from here. The phone signs in to the Console first.`})]})}function Z({build:e,url:t,note:n}){return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(q,{className:`size-48`,label:`Download ${h(e)}`,value:t}),(0,J.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:Ie[e.artifact_kind]}),n?(0,J.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:n}):null]})}function Q({message:e}){return(0,J.jsxs)(T,{variant:`destructive`,children:[(0,J.jsx)(E,{}),(0,J.jsx)(C,{children:`The download link couldn't be created`}),(0,J.jsx)(w,{children:e})]})}function Re({build:t}){let n=ye(t.id),r=n.data?.url;if(r===null){let e=X[t.artifact_kind];return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 text-xs text-muted-foreground`,children:[(0,J.jsx)(`p`,{children:`This storage gives no download link a phone can open without signing in, so there is no QR code. Download the build here, or open this page on the phone signed in to the console.`}),e?(0,J.jsx)(`p`,{children:e}):null]})}return r===void 0?n.isError?(0,J.jsx)(Q,{message:n.error.message}):(0,J.jsx)(e,{className:`size-48`}):(0,J.jsx)(Z,{build:t,note:`This link expires. If the download fails, reload this page.`,url:r})}function $({build:e}){return(0,J.jsx)(`span`,{className:`font-mono text-foreground`,translate:`no`,children:e.submitted_version??`this build`})}function ze({build:e}){let t=e.submitted_to===`testflight`?{name:`App Store Connect`,url:`https://appstoreconnect.apple.com/apps`}:{name:`Play Console`,url:`https://play.google.com/console`};return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Install`})})}),(0,J.jsxs)(A,{className:`flex min-w-0 flex-col gap-4 p-4 sm:p-6`,children:[(0,J.jsx)(Be,{build:e}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[(0,J.jsxs)(`a`,{className:i({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`}),href:t.url,rel:`noreferrer`,target:`_blank`,children:[(0,J.jsx)(re,{"data-icon":`inline-start`}),`Open `,t.name]}),(0,J.jsxs)(`a`,{className:i({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,variant:`outline`}),download:!0,href:g(e.id),children:[(0,J.jsx)(b,{"data-icon":`inline-start`}),(0,J.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,h(e)]})]})]})]})]})}function Be({build:e}){switch(e.artifact_kind){case`apk`:return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your browser needs the "Install unknown apps" permission.`}),e.is_sandbox?(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Its .sandbox ID installs it beside a Play copy.`}):(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`If this package is already installed with another signing key, such as a Play copy, the install fails. Uninstall that copy first, or build with sandbox: true, whose .sandbox ID installs beside it.`}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On an emulator or a phone over USB, install and open it from your project:`}),(0,J.jsx)(u,{label:`the install command`,value:m(e)})]});case`app`:return(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It runs only in the iOS Simulator. In your project, install and open it on the booted one:`}),(0,J.jsx)(u,{label:`the install command`,value:m(e)})]});case`aab`:return K(e)?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Submitted to`,` `,e.submitted_to===`play-internal`?G[`play-internal`].name:G[e.submitted_to].label,` `,`as `,(0,J.jsx)($,{build:e}),`.`,` `,e.submitted_to===`play-production`?`Users`:`Testers`,` get it once its release is rolled out; on an app Play Console hasn't published, the release is a draft you roll out in Play Console.`]}):(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`For testers, build and release to internal testing:`}),(0,J.jsx)(u,{label:`the Google Play command`,value:`npx hot-updater google-play upload`})]});case`ipa`:return K(e)?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`On TestFlight as `,(0,J.jsx)($,{build:e}),`. Internal testers install it from the TestFlight app once App Store Connect has processed it, and a preview's pull request comment shows that state.`]}):(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Over USB, Xcode or Apple Configurator installs it. For testers without a registered device:`}),(0,J.jsx)(u,{label:`the TestFlight command`,value:`npx hot-updater testflight`})]})}}function Ve({link:e,url:t}){return e?.status===`no-secret`?(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,e.secretName,` on the Console to create links.`]}):e?.status!==`issued`||t===null?null:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,J.jsx)(u,{label:`the download link`,value:t}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Anyone with this link can download this build until`,` `,(0,J.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,Fe.default)(e.expiresAt).format(`YYYY-MM-DD`),`.`]})]})]})}function He({build:e}){return K(e)&&(e.artifact_kind===`ipa`||e.artifact_kind===`aab`)?(0,J.jsx)(ze,{build:e}):(0,J.jsx)(Ue,{build:e})}function Ue({build:t}){let n=h(t),r=ve(t.id),a=r.data?.status===`issued`?ee(window.location,t.id,r.data.token):null,o=Ee(),s=t.artifact_kind===`ipa`,c=s&&o?.ios===!0;return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Install`})})}),(0,J.jsxs)(A,{className:c?`flex min-w-0 flex-col gap-6 p-4 sm:p-6`:`grid gap-6 p-4 sm:grid-cols-[12rem_minmax(0,1fr)] sm:p-6`,children:[c?(0,J.jsx)(Oe,{build:t,device:o}):s&&a!==null?(0,J.jsx)(Le,{}):a===null?r.data===void 0?r.isError?(0,J.jsx)(Q,{message:r.error.message}):(0,J.jsx)(e,{className:`size-48`}):(0,J.jsx)(Re,{build:t}):(0,J.jsx)(Z,{build:t,url:a}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,J.jsx)(Be,{build:t}),(0,J.jsxs)(`a`,{className:i({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,variant:`outline`}),download:!0,href:a??g(t.id),children:[(0,J.jsx)(b,{"data-icon":`inline-start`}),(0,J.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,n]})]}),(0,J.jsx)(Ve,{link:r.data,url:a})]})]})]})}function We({build:t}){let n=De(t.id),r=n.data;if(r?.status===`store`||r?.status===`enterprise`)return null;let o=r?.status===`listed`?r.devices:null;return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsxs)(k,{className:`flex flex-row items-center gap-2 border-b px-4 py-3`,children:[(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Devices in this build`})}),o===null?null:(0,J.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:o.length}),(0,J.jsx)(s,{className:i({className:`ml-auto h-11 sm:h-7`,size:`sm`,variant:`ghost`}),to:`/native-builds/devices`,children:`iOS devices`})]}),(0,J.jsx)(A,{className:`p-0`,children:n.isPending?(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Reading this IPA's devices`}),(0,J.jsx)(e,{className:`h-8 w-full`}),(0,J.jsx)(e,{className:`h-8 w-full`})]}):n.isError||r?.status===`unavailable`?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4 text-xs text-muted-foreground`,children:[(0,J.jsx)(`p`,{className:`min-w-0 flex-1`,children:`The Console couldn't read this IPA's devices from storage.`}),(0,J.jsxs)(a,{className:`h-11 sm:h-7`,onClick:()=>void n.refetch(),size:`sm`,variant:`outline`,children:[(0,J.jsx)(S,{"data-icon":`inline-start`}),`Retry`]})]}):o?.length===0?(0,J.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`This IPA lists no devices.`}):(0,J.jsx)(`ul`,{"aria-label":`Devices in this build`,className:`divide-y`,children:o?.map(e=>(0,J.jsxs)(`li`,{className:`flex min-h-11 min-w-0 items-center gap-3 px-4 py-2 text-sm`,children:[(0,J.jsx)(fe,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),e.name===null?(0,J.jsx)(`span`,{className:`min-w-0 font-mono text-xs [overflow-wrap:anywhere]`,translate:`no`,children:e.udid}):(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,J.jsx)(`span`,{className:`truncate`,children:e.name}),(0,J.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,translate:`no`,children:[`…`,e.udid.slice(-6)]})]})]},e.udid))})})]})}var Ge=`https://hot-updater.dev/docs/guides/bundle-diffing#first-ota-update`;function Ke({detail:t,page:n,onPage:r}){let o=n.before!==void 0||n.after!==void 0,u=be(t.build.min_bundle_id,n,o),d=o?u.data:t.patches,{next:p,previous:m}=d??{};return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,id:`patches`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Patches from this build`})})}),(0,J.jsxs)(A,{className:`p-0`,children:[o&&u.isError?(0,J.jsx)(`div`,{className:`p-4`,children:(0,J.jsxs)(T,{variant:`destructive`,children:[(0,J.jsx)(E,{}),(0,J.jsx)(C,{children:`Patches couldn't be loaded`}),(0,J.jsx)(w,{children:u.error.message}),(0,J.jsx)(D,{children:(0,J.jsxs)(a,{onClick:()=>void u.refetch(),size:`xs`,variant:`outline`,children:[(0,J.jsx)(S,{"data-icon":`inline-start`}),`Retry`]})})]})}):d===void 0?(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Loading patches`}),(0,J.jsx)(e,{className:`h-4 w-full`}),(0,J.jsx)(e,{className:`h-4 w-2/3`})]}):d.data.length===0?o?(0,J.jsxs)(R,{className:`py-10`,children:[(0,J.jsx)(P,{children:(0,J.jsx)(I,{children:`No more patches`})}),(0,J.jsx)(a,{className:`min-h-11 sm:min-h-8`,onClick:()=>r({}),variant:`outline`,children:`Show the newest patches`})]}):(0,J.jsxs)(R,{className:`py-10`,children:[(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(le,{})}),(0,J.jsx)(I,{children:`No patches from this build`}),(0,J.jsxs)(L,{children:[`A deploy adds a patch from this build's bundle while it is its scope's store build, or its newest build with none marked, and the deploy config turns patches on, with`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`patch`}),` in`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`hot-updater.config.ts`}),`.`]})]}),(0,J.jsx)(F,{children:(0,J.jsxs)(`a`,{className:i({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:Ge,rel:`noreferrer`,target:`_blank`,children:[`Bundle diffing guide`,(0,J.jsx)(c,{"data-icon":`inline-end`})]})})]}):(0,J.jsxs)(W,{"aria-busy":o&&u.isPlaceholderData,"aria-label":`Patches from this build`,className:`table-fixed`,children:[(0,J.jsx)(z,{children:(0,J.jsxs)(H,{children:[(0,J.jsx)(B,{children:`Target bundle`}),(0,J.jsx)(B,{className:`w-28`,children:`Patch size`}),(0,J.jsx)(B,{className:`hidden w-32 sm:table-cell`,children:`Created`})]})}),(0,J.jsx)(V,{children:d.data.map(e=>(0,J.jsxs)(H,{children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsx)(s,{className:`block font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{bundleId:e.bundleId},title:e.bundleId,to:`/`,translate:`no`,children:e.bundleId})}),(0,J.jsx)(U,{className:`text-xs tabular-nums`,children:f(e.byteSize)}),(0,J.jsx)(U,{className:`hidden sm:table-cell`,children:(0,J.jsx)(x,{uuid:e.bundleId})})]},e.bundleId))})]}),p!==void 0||m!==void 0?(0,J.jsxs)(`nav`,{"aria-label":`Patch pages`,className:`flex items-center justify-end gap-2 border-t px-4 py-2`,children:[(0,J.jsxs)(a,{className:`min-h-11 sm:min-h-7`,disabled:m===void 0||o&&u.isPlaceholderData,onClick:()=>r({after:m}),size:`sm`,variant:`ghost`,children:[(0,J.jsx)(l,{"data-icon":`inline-start`}),`Newer`]}),(0,J.jsxs)(a,{className:`min-h-11 sm:min-h-7`,disabled:p===void 0||o&&u.isPlaceholderData,onClick:()=>r({before:p}),size:`sm`,variant:`ghost`,children:[`Older`,(0,J.jsx)(te,{"data-icon":`inline-end`})]})]}):null]})]})}var qe=(e,t)=>{let n=e.data.find(e=>e.bundleId===t);if(n!==void 0)return{kind:`patch`,byteSize:n.byteSize};let r=e.data.at(-1)?.bundleId;return e.next!==void 0&&r!==void 0&&t<r?{kind:`unknown`}:{kind:`full`}};function Je({download:e}){switch(e.kind){case`patch`:return(0,J.jsxs)(`span`,{className:`text-xs`,children:[`Patch`,` `,(0,J.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`(`,f(e.byteSize),`)`]})]});case`full`:return(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Full bundle`});case`unknown`:return(0,J.jsx)(`a`,{className:`text-xs underline-offset-4 hover:underline`,href:`#patches`,children:`See patches`})}}function Ye({detail:e}){let{build:t,channel:n,servedNow:r,patches:a,catalogScopeKey:o}=e,l=r.find(({rolloutCohortCount:e,targetCohorts:t})=>e>0||t.length>0)?.bundleId,d=t.is_store_build&&l!=null&&qe(a,l).kind===`full`?[`npx hot-updater patch`,`-p ${t.platform}`,`-c ${_(n)}`,`-b ${_(l)}`,`--base-artifact-id ${_(t.min_bundle_id)}`].join(` `):null,f=(0,J.jsxs)(s,{className:`inline-flex items-center gap-0.5 underline-offset-4 hover:underline`,search:{scopeKey:o},to:`/`,children:[`All releases in this scope`,(0,J.jsx)(c,{"aria-hidden":`true`,className:`size-3`})]});return(0,J.jsxs)(M,{className:`overflow-hidden shadow-sm`,children:[(0,J.jsx)(k,{className:`border-b px-4 py-3`,children:(0,J.jsx)(j,{className:`text-sm`,children:(0,J.jsx)(`h2`,{children:`Served now`})})}),(0,J.jsx)(A,{className:`p-0`,children:r.length===0?(0,J.jsxs)(R,{className:`py-10`,children:[(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(ke,{})}),(0,J.jsx)(I,{children:`No OTA for this build yet`}),(0,J.jsxs)(L,{children:[`No release in this build's scope is newer than its built-in bundle. Deploy one with`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`hot-updater deploy`}),`, and it shows here.`]})]}),(0,J.jsx)(F,{children:(0,J.jsx)(s,{className:i({className:`min-h-11 sm:min-h-8`,variant:`outline`}),search:{scopeKey:o},to:`/`,children:`All releases in this scope`})})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(W,{"aria-label":`Served now`,className:`table-fixed`,children:[(0,J.jsx)(z,{children:(0,J.jsxs)(H,{children:[(0,J.jsx)(B,{children:`Bundle`}),(0,J.jsx)(B,{className:`hidden w-40 md:table-cell`,children:`Rollout`}),(0,J.jsx)(B,{className:`hidden w-32 sm:table-cell`,children:`Created`}),(0,J.jsx)(B,{className:`w-32`,children:`First OTA download`})]})}),(0,J.jsx)(V,{children:r.map(e=>{let t=e.bundleId,n=e.rolloutCohortCount/me*100;return(0,J.jsxs)(H,{children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsx)(s,{className:`font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{releaseId:e.releaseId},title:t,to:`/`,translate:`no`,children:t}),e.message?(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.message}):null]})}),(0,J.jsx)(U,{className:`hidden md:table-cell`,children:(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.targetCohorts.length>0?(0,J.jsx)(pe,{variant:`secondary`,children:e.targetCohorts.length===1?`1 cohort`:`${e.targetCohorts.length} cohorts`}):(0,J.jsx)(ae,{percentage:n}),e.shouldForceUpdate?(0,J.jsx)(pe,{variant:`outline`,children:`Forced`}):null]})}),(0,J.jsx)(U,{className:`hidden sm:table-cell`,children:(0,J.jsx)(x,{uuid:t})}),(0,J.jsx)(U,{children:(0,J.jsx)(Je,{download:qe(a,t)})})]},e.releaseId)})})]}),d===null?null:(0,J.jsxs)(`div`,{className:`flex flex-col gap-2 border-t px-4 py-3 text-xs`,children:[(0,J.jsx)(`p`,{children:`The OTA fresh installs get first has no patch from this store build, so they download all of it. Add one from your project:`}),(0,J.jsx)(u,{label:`the patch command`,value:d})]}),(0,J.jsxs)(`p`,{className:`border-t px-4 py-3 text-xs text-muted-foreground`,children:[`What the update check serves an install of this build now, newest first: not the history. `,f]})]})})]})}function Xe({buildId:t,search:n,onSearchChange:r}){let c=Se(t),u=c.data,d={...n.patchesBefore===void 0?{}:{before:n.patchesBefore},...n.patchesAfter===void 0?{}:{after:n.patchesAfter}};return(0,J.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,J.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 items-center gap-x-2 border-b bg-background px-3 py-3 sm:min-h-12 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,J.jsx)(o,{className:`-ml-1 size-11 lg:size-7`}),(0,J.jsxs)(s,{className:i({className:`min-h-11 sm:min-h-7`,size:`sm`,variant:`ghost`}),to:`/native-builds`,children:[(0,J.jsx)(l,{"data-icon":`inline-start`}),`Native builds`]}),u?(0,J.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-1.5 text-sm font-medium`,children:[(0,J.jsx)(ge,{className:`size-3.5 shrink-0 text-muted-foreground`,platform:u.build.platform}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,J.jsxs)(`span`,{className:`sr-only`,children:[v(u.build.platform),` `]}),p[u.build.artifact_kind].label,(0,J.jsx)(Te,{build:u.build})]}),(0,J.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,(0,J.jsx)(`span`,{translate:`no`,children:u.channel})]})]}),(0,J.jsx)(`span`,{className:`hidden text-xs font-normal text-muted-foreground tabular-nums sm:inline`,children:f(u.build.byte_size)})]}):(0,J.jsx)(`h1`,{className:`sr-only`,children:`Native build`})]}),(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,J.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 sm:gap-6`,children:c.isError?(0,J.jsxs)(T,{variant:`destructive`,children:[(0,J.jsx)(E,{}),(0,J.jsx)(C,{children:`The native build couldn't be loaded`}),(0,J.jsx)(w,{children:c.error.message}),(0,J.jsx)(D,{children:(0,J.jsxs)(a,{onClick:()=>void c.refetch(),size:`xs`,variant:`outline`,children:[(0,J.jsx)(S,{"data-icon":`inline-start`}),`Retry`]})})]}):u===void 0?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Loading the native build`}),(0,J.jsx)(e,{className:`h-56 w-full rounded-xl`}),(0,J.jsx)(e,{className:`h-64 w-full rounded-xl`})]}):u===null?(0,J.jsxs)(R,{className:`border py-16`,children:[(0,J.jsxs)(P,{children:[(0,J.jsx)(N,{variant:`icon`,children:(0,J.jsx)(ue,{})}),(0,J.jsx)(I,{children:`Native build not found`}),(0,J.jsxs)(L,{children:[`No native build has this ID. It may have been deleted with`,` `,(0,J.jsx)(`code`,{className:`font-mono`,children:`native-build delete`}),`, or be from another console.`]})]}),(0,J.jsx)(F,{children:(0,J.jsx)(s,{className:i({className:`min-h-11 sm:min-h-8`,variant:`outline`}),to:`/native-builds`,children:`Show all native builds`})})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(He,{build:u.build}),u.build.artifact_kind===`ipa`&&!K(u.build)?(0,J.jsx)(We,{build:u.build}):null,(0,J.jsx)(Pe,{detail:u}),(0,J.jsx)(Ye,{detail:u}),(0,J.jsx)(Ke,{detail:u,onPage:e=>r({...e.before===void 0?{}:{patchesBefore:e.before},...e.after===void 0?{}:{patchesAfter:e.after}}),page:d})]})})})]})}function Ze(){let{buildId:e}=y.useParams(),t=y.useSearch(),n=y.useNavigate();return(0,J.jsx)(Xe,{buildId:e,onSearchChange:e=>void n({search:e,replace:!0}),search:t})}export{Ze as component};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds_._buildId-33ksAlnZ.js","assets/sidebar-yC7KdImc.js","assets/link-CN3iHC4A.js","assets/relativeTime-CBmDq8wh.js","assets/arrow-up-right-BFafIOrq.js","assets/native-builds-BdzfAFnF.js","assets/copy-CH1__JAW.js","assets/dist-Bw_uSBJn.js","assets/uuidv7-CVJ09bBG.js","assets/chevron-right-DNbYTBX1.js","assets/HashValueDisplay-DMweha_0.js","assets/RolloutPercentageBadge-BHgHkBGB.js","assets/badge-DJMW4YVM.js","assets/TargetDisplay-DB8D019f.js","assets/key-round-B-P_hhUB.js","assets/package-CXSDZsME.js","assets/git-branch-ByZMEBxZ.js","assets/-native-builds-search-7blX2yQW.js","assets/history-wYnPoVmT.js","assets/refresh-cw-BgiOaFX3.js","assets/smartphone-CxP0GGT6.js","assets/IosInstall-B5NspihF.js","assets/useMutation-w3qYaU2L.js","assets/loader-circle-GWIgH0fo.js","assets/send-BgXZNiEA.js","assets/field-DL4OXTJ7.js","assets/api-DLryz9hA.js","assets/preload-helper-CRQjUQaZ.js","assets/BundleIdDisplay-B0gAH01c.js","assets/PlatformIcon-BBvlg6JY.js","assets/SandboxBadge-irEkMf1P.js","assets/card-C4sBAMU-.js","assets/empty-DsbLxQ1w.js","assets/table-CwF7yxj4.js"])))=>i.map(i=>d[i]);
2
- import{Vr as e}from"./sidebar-yC7KdImc.js";import{i as t,r as n,t as r}from"./preload-helper-CRQjUQaZ.js";import{n as i}from"./-native-builds-search-7blX2yQW.js";var a=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),o=t(`/native-builds_/$buildId`)({component:n(()=>r(()=>import(`./native-builds_._buildId-33ksAlnZ.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])),`component`),validateSearch:i});export{a as n,o as t};
@@ -1 +0,0 @@
1
- import{$ as e,A as t,An as n,Ar as r,At as i,Bt as a,C as o,Cr as s,Ct as c,Di as l,Dt as u,Er as d,Et as f,Ft as p,Gt as m,Hn as h,Ht as ee,In as g,Jt as _,Kt as te,L as ne,Li as v,Lr as y,Mr as b,Mt as x,Nr as S,Or as C,Ot as w,Pr as T,Pt as re,Qn as E,Qt as D,Ri as O,Rr as ie,Rt as k,Sn as A,Sr as ae,St as j,Tr as M,Tt as oe,Ut as N,Vi as P,Vr as F,Vt as se,Wt as I,Xt as ce,Yt as L,Z as R,Zt as z,_r as B,_t as le,ct as V,dt as ue,en as H,fr as de,ft as U,gr as W,gt as fe,h as pe,hn as me,hr as he,jn as ge,jr as _e,kr as G,kt as ve,lt as K,mr as q,mt as ye,nn as be,ot as xe,p as J,pr as Se,pt as Ce,qt as we,rn as Y,st as Te,tn as Ee,tt as De,ur as Oe,ut as ke,vn as Ae,vr as je,vt as Me,wn as Ne,wt as Pe,xr as Fe,xt as Ie,yt as Le}from"./sidebar-yC7KdImc.js";import{t as Re}from"./link-CN3iHC4A.js";import{t as ze}from"./check-CqWNyG93.js";import{n as Be,r as Ve}from"./useCompositeListItem-lAmUsXcc.js";import{S as He,l as Ue,n as We,s as Ge,t as Ke,u as qe}from"./native-builds-BdzfAFnF.js";import{F as Je,P as Ye,a as Xe,i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,t as rt,u as it}from"./select-CA8r-UUe.js";import{i as at}from"./-native-builds-search-7blX2yQW.js";import{t as ot}from"./loader-circle-GWIgH0fo.js";import{n as st,t as ct}from"./CompositeItem-Dy4xgOMg.js";import{t as lt}from"./refresh-cw-BgiOaFX3.js";import{t as ut}from"./smartphone-CxP0GGT6.js";import{t as dt}from"./trash-2-CYISg7ZF.js";import{a as ft,i as pt,n as mt,o as ht,r as gt,t as _t}from"./badge-DJMW4YVM.js";import{a as vt,n as yt,o as bt,t as xt}from"./card-C4sBAMU-.js";import{t as St}from"./uuidv7-CVJ09bBG.js";import{n as Ct}from"./relativeTime-CBmDq8wh.js";import{a as wt,i as Tt,l as Et,n as Dt,o as Ot,r as kt,s as At,t as jt}from"./alert-dialog-CLC_h1fL.js";import{a as Mt,i as Nt,n as Pt,o as Ft,r as It,t as Lt}from"./dialog-tCTZmAo8.js";import{a as Rt,i as zt,n as Bt,r as Vt,t as Ht}from"./field-DL4OXTJ7.js";import{t as Ut}from"./native-builds_.devices-DWtcOVYO.js";import{i as X,o as Wt,r as Z}from"./table-CwF7yxj4.js";import{a as Gt,c as Kt,f as qt,i as Jt,l as Yt,n as Xt,r as Zt,s as Qt,t as $t}from"./RelativeTime-CY1dKZpv.js";import{t as en}from"./NativeBuildsNav-CjOOlbEu.js";import{a as tn,c as nn,i as rn,l as an,n as on,r as sn,s as cn}from"./IosInstall-B5NspihF.js";var ln=F(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Q=P(O()),un=Q.createContext(void 0);function dn(e=!0){let t=Q.useContext(un);if(t===void 0&&!e)throw Error(G(25));return t}var fn=Q.createContext(void 0);function pn(e){let t=Q.useContext(fn);if(t===void 0&&!e)throw Error(G(33));return t}var mn=Q.createContext(void 0);function hn(e){let t=Q.useContext(mn);if(t===void 0&&!e)throw Error(G(36));return t}function gn(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=dn(!0),d=u!==void 0;return Q.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:g})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!Oe&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var _n={type:`regular-item`};function vn(e){let{closeOnClick:t,disabled:n=!1,highlighted:i,id:a,store:o,typingRef:s=o.context.typingRef,nativeButton:c,itemMetadata:l,nodeId:u}=e,f=Q.useRef(null),{getButtonProps:p,buttonRef:m}=d({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),h=gn({closeOnClick:t,highlighted:i,id:a,nodeId:u,store:o,typingRef:s,itemRef:f,itemMetadata:l}),ee=Q.useCallback(e=>r(h,{onMouseEnter(){l.type===`submenu-trigger`&&l.setActive()}},e,p),[h,p,l]),g=M(f,m);return Q.useMemo(()=>({getItemProps:ee,itemRef:g}),[ee,g])}var yn=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=Be({label:a}),f=pn(!0),p=U(i),{store:m}=hn(),h=m.useState(`isActive`,d.index),ee=m.useState(`itemProps`),{getItemProps:g,itemRef:_}=vn({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:_n});return Fe(`div`,e,{state:{disabled:s,highlighted:h},props:[ee,u,g],ref:[_,t,d.ref]})}),$=l(),bn={...Ce,...x},xn=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=hn(),{side:c,align:l}=pn(),u=nt(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),te=s.useState(`lastOpenChangeReason`),v=s.useState(`rootId`),y=s.useState(`floatingRootContext`),b=s.useState(`floatingTreeRoot`),x=s.useState(`closeDelay`),S=s.useState(`activeTriggerElement`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=_.type===`context-menu`;ve({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){s.setOpen(!1,A(e.reason,e.domEvent))}return b.events.on(`close`,e),()=>{b.events.off(`close`,e)}},[b.events,s]),Me(y,{enabled:C&&!w&&!T&&_.type!==`menubar`,closeDelay:x});let re=Q.useCallback(e=>{s.set(`popupElement`,e)},[s]),E=Fe(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,re],stateAttributesMapping:bn,props:[p,{onKeyDown(e){u&&ne.has(e.key)&&e.stopPropagation()}},V(f),o,{"data-rootownerid":v}]}),D=_.type===void 0||T;return(g||_.type===`menubar`&&te!==`outside-press`)&&(D=!0),(0,$.jsx)(ee,{context:y,modal:T,disabled:!m,returnFocus:a===void 0?D:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:b,previousFocusableElement:S,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:E})}),Sn=Q.createContext(void 0);function Cn(){let e=Q.useContext(Sn);if(e===void 0)throw Error(G(32));return e}var wn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=hn();return i.useState(`mounted`)||n?(0,$.jsx)(Sn.Provider,{value:n,children:(0,$.jsx)(L,{ref:t,...r})}):null}),Tn=Q.forwardRef(function(e,n){let{anchor:r,positionMethod:a=`absolute`,className:o,render:s,side:c,align:l,sideOffset:u=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p=5,arrowPadding:m=5,sticky:ee=!1,disableAnchorTracking:g=!1,collisionAvoidance:_=ce,style:te,...ne}=e,{store:v}=hn(),y=Cn(),b=dn(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),re=v.useState(`modal`),E=v.useState(`openMethod`),D=v.useState(`activeTriggerElement`),O=v.useState(`transitionStatus`),ie=v.useState(`positionerElement`),k=v.useState(`instantType`),ae=v.useState(`hasViewport`),j=v.useState(`lastOpenChangeReason`),M=v.useState(`floatingNodeId`),oe=v.useState(`floatingParentNodeId`),P=S.useState(`domReferenceElement`),F=Q.useRef(null),se=i(ie,!1,!1),I=r,L=u,R=d,B=l,le=_;x.type===`context-menu`&&(I=r??x.context?.anchor,B??=`start`,!c&&B!==`center`&&(R=e.alignOffset??2,L=e.sideOffset??-5));let V=c,ue=B;x.type===`menu`?(V??=`inline-end`,ue??=`start`,le=e.collisionAvoidance??z):x.type===`menubar`&&(V??=`bottom`,ue??=`start`);let H=x.type===`context-menu`,U=K({anchor:I,floatingRootContext:S,positionMethod:b?`fixed`:a,mounted:w,side:V,sideOffset:L,align:ue,alignOffset:R,arrowPadding:H?0:m,collisionBoundary:f,collisionPadding:p,sticky:ee,nodeId:M,keepMounted:y,disableAnchorTracking:g,collisionAvoidance:le,shiftCrossAxis:H&&!(`side`in le&&le.side===`flip`),externalTree:C,adaptiveOrigin:ae?ke:void 0});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===M&&v.set(`hoverEnabled`,!1),e.nodeId!==M&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,A(h)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,M]),Q.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,A(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let W=de();Q.useEffect(()=>{T||W.clear()},[T,W]),Q.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&D&&D!==e.target){let e=v.select(`closeDelay`);e>0?W.isStarted()||W.start(e,()=>{v.setOpen(!1,A(h))}):v.setOpen(!1,A(h))}else W.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,D,v,W]),Q.useEffect(()=>{let e={open:T,nodeId:M,parentNodeId:oe,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,M,oe]),_e(()=>{let e=P,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return se(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,se,v]);let fe={open:T,side:U.side,align:U.align,anchorHidden:U.anchorHidden,nested:x.type===`menu`,instant:k},pe=x.type===`menubar`&&x.context.modal;Qe(T&&(pe||re&&j!==`trigger-hover`),E===`touch`,ie,D);let me=Te(e,fe,{styles:U.positionerStyles,transitionStatus:O,props:ne,refs:[n,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),he=w&&x.type!==`menu`&&(x.type!==`menubar`&&re&&j!==`trigger-hover`||x.type===`menubar`&&x.context.modal),ge=null;return x.type===`menubar`?ge=x.context.contentElement:x.type===void 0&&(ge=D),(0,$.jsxs)(fn.Provider,{value:U,children:[he&&(0,$.jsx)(t,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:xe(!T),cutout:ge}),(0,$.jsx)(N,{id:M,children:(0,$.jsx)(Ve,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:me})})]})}),En=Q.createContext(null);function Dn(e){let t=Q.useContext(En);if(t===null&&!e)throw Error(G(5));return t}var On={...j,disabled:k(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:k(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:k(e=>e.openMethod),allowMouseEnter:k(e=>e.allowMouseEnter),stickIfOpen:k(e=>e.stickIfOpen),parent:k(e=>e.parent),rootId:k(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:k(e=>e.activeIndex),isActive:k((e,t)=>e.activeIndex===t),hoverEnabled:k(e=>e.hoverEnabled),instantType:k(e=>e.instantType),lastOpenChangeReason:k(e=>e.openChangeReason),floatingTreeRoot:k(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:k(e=>e.floatingNodeId),floatingParentNodeId:k(e=>e.floatingParentNodeId),itemProps:k(e=>e.itemProps),closeDelay:k(e=>e.closeDelay),hasViewport:k(e=>e.hasViewport),keyboardEventRelay:k(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},kn=class e extends p{constructor(e){super({...An(),...e},{positionerRef:Q.createRef(),popupRef:Q.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),onOpenChangeComplete:void 0,triggerElements:new c},On),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=S(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function An(){return{...Ie(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new _,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:s,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var jn=Q.createContext(void 0);function Mn(){return Q.useContext(jn)}var Nn=q(function(e){let{children:t,open:n,onOpenChange:i,onOpenChangeComplete:c,defaultOpen:l=!1,disabled:d=!1,modal:p,loopFocus:h=!0,orientation:ee=`vertical`,actionsRef:g,closeParentOnEsc:_=!1,handle:ne,triggerId:v,defaultTriggerId:y=null,highlightItemOnHover:x=!0}=e,S=dn(!0),C=hn(!0),w=Dn(!0),T=Mn(),E=Q.useMemo(()=>T&&C?{type:`menu`,store:C.store}:w?{type:`menubar`,context:w}:S&&!C?{type:`context-menu`,context:S}:{type:void 0},[S,C,w,T]),O=kn.useStore(ne?.store,{open:l,openProp:n,activeTriggerId:y,triggerIdProp:v,parent:E});Se(()=>{n===void 0&&O.state.open===!1&&l===!0&&O.update({open:!0,activeTriggerId:y})}),O.useControlledProp(`openProp`,n),O.useControlledProp(`triggerIdProp`,v),O.useContextCallback(`onOpenChangeComplete`,c);let ie=D(),k=D(),j=O.useState(`floatingTreeRoot`),M=m(j),N=te(),P=O.useState(`open`),F=O.useState(`activeTriggerElement`),se=O.useState(`positionerElement`),ce=O.useState(`hoverEnabled`),L=O.useState(`disabled`),R=O.useState(`lastOpenChangeReason`),z=O.useState(`parent`),B=O.useState(`activeIndex`),le=O.useState(`payload`),V=O.useState(`floatingParentNodeId`),H=Q.useRef(null),U=Q.useRef(z.type!==`context-menu`),W=de(),fe=Q.useRef(!0),pe=de(),me=V!=null,{openMethod:he,triggerProps:G}=o(P);O.useSyncedValues({disabled:d,modal:z.type===void 0?p:void 0,openMethod:he,rootId:ie}),oe(O);let{forceUnmount:ve}=f(P,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0})});_e(()=>{S&&!C?O.update({parent:{type:`context-menu`,context:S},floatingNodeId:M,floatingParentNodeId:N}):C&&O.update({floatingNodeId:M,floatingParentNodeId:N})},[S,C,M,N,O]),Q.useEffect(()=>{if(P||(H.current=null),z.type===`context-menu`){if(!P){W.clear(),U.current=!1;return}W.start(500,()=>{U.current=!0})}},[W,P,z.type]),_e(()=>{!P&&!ce&&O.set(`hoverEnabled`,!0)},[P,ce,O]);let K=b((e,t)=>{let n=t.reason;if(P===e&&t.trigger===F&&R===n||(t.preventUnmountOnClose=()=>{O.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=F??void 0),i?.(e,t),t.isCanceled))return;O.state.floatingRootContext.dispatchOpenChange(e,t);let r=t.event;if(e===!1&&r?.type===`click`&&r.pointerType===`touch`&&!fe.current)return;if(!e&&B!==null){let e=O.context.itemDomElements.current[B];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(fe.current=!1,pe.start(300,()=>{fe.current=!0})):(fe.current=!0,pe.clear());let a=(n===`trigger-press`||n===`item-press`)&&r.detail===0&&r?.isTrusted,o=!e&&(n===`escape-key`||n==null),s={open:e,openChangeReason:n};H.current=t.event??null;let c=t.trigger?.id??null;(c||e)&&(s.activeTriggerId=c,s.activeTriggerElement=t.trigger??null),O.update(s),z.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?O.set(`instantType`,`group`):a||o?O.set(`instantType`,a?`click`:`dismiss`):O.set(`instantType`,void 0)}),q=re({popupStore:O,floatingId:k,nested:N!=null,onOpenChange:K}),ye=q.context.events;Q.useEffect(()=>{let e=({open:e,eventDetails:t})=>K(e,t);return ye.on(`setOpen`,e),()=>{ye?.off(`setOpen`,e)}},[ye,K]);let be=Q.useCallback(()=>{O.setOpen(!1,A(ge))},[O]);Q.useImperativeHandle(g,()=>({unmount:ve,close:be}),[ve,be]);let xe;z.type===`context-menu`&&(xe=z.context),Q.useImperativeHandle(xe?.positionerRef,()=>se,[se]),Q.useImperativeHandle(xe?.actionsRef,()=>({setOpen:K}),[K]);let J=a(q,{enabled:!L,bubbles:{escapeKey:_&&z.type===`menu`},outsidePress(){return z.type!==`context-menu`||H.current?.type===`contextmenu`?!0:U.current},externalTree:me?j:void 0}),Ce=ue(),we=Q.useCallback(e=>{O.select(`activeIndex`)!==e&&O.set(`activeIndex`,e)},[O]),Y=Je(q,{enabled:!L,listRef:O.context.itemDomElements,activeIndex:B,nested:z.type!==void 0,loopFocus:h,orientation:ee,parentOrientation:z.type===`menubar`?z.context.orientation:void 0,rtl:Ce===`rtl`,disabledIndices:ae,onNavigate:we,openOnArrowKeyDown:z.type!==`context-menu`,externalTree:me?j:void 0,focusItemOnHover:x}),Te=Q.useCallback(e=>{O.context.typingRef.current=e},[O]),Ee=Ye(q,{listRef:O.context.itemLabels,elementsRef:O.context.itemDomElements,activeIndex:B,resetMs:500,onMatch:e=>{P&&e!==B&&O.set(`activeIndex`,e)},onTyping:Te});u(O,{floatingRootContext:q,activeTriggerProps:Q.useMemo(()=>{let e=r(Ee.reference,Y.reference,J.reference,{onMouseMove(){O.set(`allowMouseEnter`,!0)}},G);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=P,e},[O,Ee.reference,Y.reference,J.reference,G,P]),inactiveTriggerProps:Q.useMemo(()=>{let e=r(Y.trigger,J.trigger,G);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Y.trigger,J.trigger,G]),popupProps:Q.useMemo(()=>r(Pe,{id:k,role:`menu`,"aria-labelledby":F?.id,onMouseMove(){O.set(`allowMouseEnter`,!0),z.type===`menu`&&O.set(`hoverEnabled`,!1)},onClick(){O.select(`hoverEnabled`)&&O.set(`hoverEnabled`,!1)},onKeyDown(e){let t=O.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ee.floating,Y.floating,J.floating),[F,k,z.type,O,Ee.floating,Y.floating,J.floating]),itemProps:Y.item??s});let De=Q.useMemo(()=>({store:O,parent:E}),[O,E]),Oe=(0,$.jsx)(mn.Provider,{value:De,children:typeof t==`function`?t({payload:le}):t});return z.type===void 0||z.type===`context-menu`?(0,$.jsx)(I,{externalTree:j,children:Oe}):Oe});function Pn(e){if(y(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!ie(e))return Pn(T(e))}var Fn=P(v());function In(e,t){let r=Q.useRef(null);function i(t){Fn.flushSync(()=>{e.setOpen(!1,A(n,t.nativeEvent,t.currentTarget))}),be(r.current)?.focus()}function a(r){let i=e.select(`positionerElement`);if(i&&Y(r,i))e.context.beforeContentFocusGuardRef.current?.focus();else{Fn.flushSync(()=>{e.setOpen(!1,A(n,r.nativeEvent,r.currentTarget))});let a=Ee(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&E(i,a);){let e=a;if(a=H(a),a===e)break}a?.focus()}}return{preFocusGuardRef:r,handlePreFocusGuardFocus:i,handleFocusTargetFocus:a}}function Ln(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Q.useRef(!1);return Q.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Ae(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:s,[t,n,r])}var Rn=2,zn=he(function(e,t){let{render:n,className:i,style:a,disabled:o=!1,nativeButton:c=!0,id:l,openOnHover:u,delay:f=100,closeDelay:p=0,handle:h,payload:ee,...g}=e,ne=hn(!0),v=h?.store??ne?.store;if(!v)throw Error(G(85));let y=U(l),x=v.useState(`isTriggerActive`,y),S=v.useState(`floatingRootContext`),T=v.useState(`isOpenedByTrigger`,y),re=v.useState(`triggerPopupId`,y),D=Q.useRef(null),O=Vn(),ie=C(!0),k=we(),A=Q.useMemo(()=>k??new _,[k]),{registerTrigger:ae,isMountedByThisTrigger:j}=w(y,D,v,{payload:ee,closeDelay:p,parent:O,floatingTreeRoot:A,floatingNodeId:m(A),floatingParentNodeId:te(),keyboardEventRelay:ie?.relayKeyboardEvent}),M=O.type===`menubar`,oe=v.useState(`disabled`),N=o||oe||M&&O.context.disabled,{getButtonProps:P,buttonRef:F}=d({disabled:N,native:c});Q.useEffect(()=>{!T&&O.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,T,O.type]);let I=Q.useRef(null),ce=de(),L=b(e=>{if(!I.current)return;ce.clear(),v.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(E(I.current,t)||E(v.select(`positionerElement`),t)||t===I.current||t!=null&&Pn(t)===v.select(`rootId`))return;let n=it(I.current);e.clientX>=n.left-Rn&&e.clientX<=n.right+Rn&&e.clientY>=n.top-Rn&&e.clientY<=n.bottom+Rn||A.events.emit(`close`,{domEvent:e,reason:Ne})});Q.useEffect(()=>{T&&v.select(`lastOpenChangeReason`)===`trigger-hover`&&Ae(I.current).addEventListener(`mouseup`,L,{once:!0})},[T,L,v]);let R=M&&O.context.hasSubmenuOpen,z=le(S,{enabled:(u??R)&&!N&&O.type!==`context-menu`&&(!M||R&&!j),handleClose:fe({blockPointerEvents:!M}),mouseOnly:!0,move:!1,restMs:O.type===void 0?f:void 0,delay:{close:p},triggerElementRef:D,externalTree:A,isActiveTrigger:x,isClosing:()=>v.select(`transitionStatus`)===`ending`}),B=Bn(T,v.select(`lastOpenChangeReason`)),V=se(S,{enabled:!N&&O.type!==`context-menu`,event:T&&M?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:O.type===void 0?B:!1}),ue=Le(S,{enabled:!N&&R}),H=Ln({open:T,enabled:M,mouseDownAction:`open`}),W=Q.useMemo(()=>r(ue.reference,V.reference),[ue.reference,V.reference]),pe=v.useState(`triggerProps`,j),{preFocusGuardRef:he,handlePreFocusGuardFocus:ge,handleFocusTargetFocus:_e}=In(v,D),ve={disabled:N,open:T},K=[I,t,F,ae,D],q=[W,z??s,pe,{"aria-haspopup":`menu`,"aria-controls":re,id:y,onMouseDown:e=>{v.select(`open`)||(ce.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),Ae(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},M?{role:`menuitem`}:{},H,g,P],be=Fe(`button`,e,{enabled:!M,stateAttributesMapping:ye,state:ve,ref:K,props:q});return M?(0,$.jsx)(ct,{tag:`button`,render:n,className:i,style:a,state:ve,refs:K,props:q,stateAttributesMapping:ye}):T?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(me,{ref:he,onFocus:ge},`${y}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:be},y),(0,$.jsx)(me,{ref:v.context.triggerFocusTargetRef,onFocus:_e},`${y}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:be},y)});function Bn(e,t){let n=de(),[r,i]=Q.useState(!1);return _e(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Vn(){let e=dn(!0),t=hn(!0),n=Dn(!0);return Q.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}var Hn=P(Ct(),1);function Un({...e}){return(0,$.jsx)(Nn,{"data-slot":`dropdown-menu`,...e})}function Wn({...e}){return(0,$.jsx)(zn,{"data-slot":`dropdown-menu-trigger`,...e})}function Gn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,$.jsx)(wn,{children:(0,$.jsx)(Tn,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,$.jsx)(xn,{"data-slot":`dropdown-menu-content`,className:je(`dark z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Kn({className:e,inset:t,variant:n=`default`,...r}){return(0,$.jsx)(yn,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:je(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function qn({className:e,...t}){return(0,$.jsx)(De,{"data-slot":`dropdown-menu-separator`,className:je(`-mx-1 my-1 h-px bg-border/50`,e),...t})}var Jn={pending:`Requested`,approved:`Approved`,registered:`Registered`},Yn={pending:`warning`,approved:`secondary`,registered:`muted`},Xn=`all`,Zn=6,Qn=()=>window.location.pathname.endsWith(`/native-builds/devices`)?window.location.pathname.slice(0,-We.length):Ge(window.location,``),$n=(e,t)=>({approve:t.canApprove&&e.status===`pending`,rename:t.canApprove,remove:t.canApprove,withdraw:!t.canApprove&&e.status===`pending`&&e.requested_by===t.email});function er({device:e}){return e.apple_error===null?null:(0,$.jsx)(`span`,{className:`max-w-64 text-xs whitespace-normal text-muted-foreground`,children:e.apple_error})}function tr({device:e,withError:t=!0}){return(0,$.jsxs)(`div`,{className:`flex min-w-0 shrink-0 flex-col items-start gap-1`,children:[(0,$.jsx)(_t,{variant:Yn[e.status],children:Jn[e.status]}),t?(0,$.jsx)(er,{device:e}):null]})}function nr({device:e}){if(e.build_id===null)return(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let t=`A build`;try{t=`Build of ${(0,Hn.default)(St(e.build_id)).format(`MMM D`)}`}catch{}return(0,$.jsx)(Re,{className:`text-xs font-medium underline-offset-4 hover:underline`,params:{buildId:e.build_id},to:`/native-builds/$buildId`,children:t})}function rr({device:e,viewer:t,onOpen:n}){let r=$n(e,t);return!r.approve&&!r.rename&&!r.remove&&!r.withdraw?null:(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[r.approve?(0,$.jsxs)(W,{className:`h-11 sm:h-7`,onClick:()=>n({kind:`approve`,device:e}),size:`sm`,children:[(0,$.jsx)(ze,{"data-icon":`inline-start`}),`Approve`]}):null,r.withdraw?(0,$.jsx)(W,{className:`h-11 sm:h-7`,onClick:()=>n({kind:`remove`,device:e}),size:`sm`,variant:`outline`,children:`Withdraw`}):null,r.rename||r.remove?(0,$.jsxs)(Un,{children:[(0,$.jsx)(Wn,{render:(0,$.jsx)(W,{"aria-label":`More actions for ${e.name}`,className:`size-11 sm:size-7`,size:`icon-sm`,variant:`ghost`}),children:(0,$.jsx)(ln,{"aria-hidden":`true`})}),(0,$.jsxs)(Gn,{align:`end`,children:[(0,$.jsxs)(Kn,{onClick:()=>n({kind:`rename`,device:e}),children:[(0,$.jsx)(st,{"aria-hidden":`true`}),`Rename`]}),(0,$.jsx)(qn,{}),(0,$.jsxs)(Kn,{onClick:()=>n({kind:`remove`,device:e}),variant:`destructive`,children:[(0,$.jsx)(dt,{"aria-hidden":`true`}),e.status===`pending`?`Decline`:`Remove`]})]})]}):null]})}function ir({device:e,viewer:t,onOpen:n}){return(0,$.jsxs)(Wt,{children:[(0,$.jsx)(Z,{className:`font-medium`,children:e.name}),(0,$.jsx)(Z,{children:(0,$.jsx)(`span`,{className:`font-mono text-xs`,title:e.udid,translate:`no`,children:qe(e.udid)})}),(0,$.jsx)(Z,{className:`text-xs`,children:e.requested_by??(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`Terminal`})}),(0,$.jsx)(Z,{children:(0,$.jsx)(tr,{device:e})}),(0,$.jsx)(Z,{className:`text-xs`,children:(0,$.jsx)($t,{ms:e.created_at_ms})}),(0,$.jsx)(Z,{children:(0,$.jsx)(nr,{device:e})}),(0,$.jsx)(Z,{className:`text-right`,children:(0,$.jsx)(rr,{device:e,onOpen:n,viewer:t})})]})}function ar({device:e,viewer:t,onOpen:n}){return(0,$.jsxs)(Xt,{className:`cursor-default gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name}),(0,$.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,translate:`no`,children:qe(e.udid)})]}),(0,$.jsx)(tr,{device:e,withError:!1})]}),(0,$.jsx)(er,{device:e}),(0,$.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:e.requested_by??`Terminal`}),(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,$.jsx)($t,{ms:e.created_at_ms}),e.build_id===null?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,$.jsx)(nr,{device:e})]})]}),(0,$.jsx)(rr,{device:e,onOpen:n,viewer:t})]})}function or({target:e,onClose:t}){let n=sn(),r=nn(),i=e.kind===`approve`?n:r,[a,o]=(0,Q.useState)(e.device.name),s=a.trim();return(0,$.jsx)(Lt,{onOpenChange:e=>e?null:t(),open:!0,children:(0,$.jsxs)(Pt,{children:[(0,$.jsxs)(Mt,{children:[(0,$.jsx)(Ft,{children:e.kind===`approve`?`Approve ${e.device.name}?`:`Rename ${e.device.name}`}),(0,$.jsx)(It,{children:e.kind===`approve`?`The next ad hoc build registers this iPhone with your Apple account. Each new iPhone uses one of the account's 100 a year, and removing it never gives the slot back.`:`The registry shows this name. The next ad hoc build doesn't rename it at Apple.`})]}),(0,$.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),s!==``&&i.mutate({id:e.device.id,name:s},{onSuccess:t})},children:[(0,$.jsxs)(zt,{children:[e.kind===`approve`?(0,$.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm`,children:[(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:`Requested by`}),(0,$.jsx)(`dd`,{className:`truncate`,children:e.device.requested_by??`Terminal`}),(0,$.jsx)(`dt`,{className:`text-muted-foreground`,children:`UDID`}),(0,$.jsx)(`dd`,{className:`font-mono text-xs`,translate:`no`,children:qe(e.device.udid)})]}):null,(0,$.jsxs)(Ht,{"data-invalid":i.isError||void 0,children:[(0,$.jsx)(Rt,{htmlFor:`ios-device-dialog-name`,children:`Name`}),(0,$.jsx)(R,{autoComplete:`off`,id:`ios-device-dialog-name`,maxLength:100,onChange:e=>o(e.target.value),value:a}),e.kind===`approve`?(0,$.jsx)(Bt,{children:`The iPhone's ID comes from the person who asked. Approve devices you recognize.`}):null,(0,$.jsx)(Vt,{children:i.isError?`Couldn't ${e.kind===`approve`?`approve`:`rename`} ${e.device.name}. Check your connection and try again.`:null})]})]}),(0,$.jsx)(Nt,{className:`mt-4`,children:(0,$.jsxs)(W,{className:`h-11 sm:h-8`,disabled:s===``||i.isPending,type:`submit`,children:[i.isPending?(0,$.jsx)(ot,{className:`animate-spin`,"data-icon":`inline-start`}):(0,$.jsx)(ze,{"data-icon":`inline-start`}),e.kind===`approve`?`Approve`:`Rename`]})})]})]})})}function sr({device:e,viewer:t,onClose:n}){let r=cn(),i=!t.canApprove,a=e.status===`pending`;return(0,$.jsx)(jt,{onOpenChange:e=>e?null:n(),open:!0,children:(0,$.jsxs)(Tt,{children:[(0,$.jsxs)(At,{children:[(0,$.jsx)(Et,{children:i?`Withdraw ${e.name}?`:a?`Decline ${e.name}?`:`Remove ${e.name}?`}),(0,$.jsx)(wt,{children:a?`It leaves the list. Its owner can request it again.`:`It leaves the registry, but it stays in new ad hoc builds while it's enabled in your Apple account: Xcode's automatic ad hoc profile takes every enabled device on the team. A build that is running may already have registered it.`})]}),a||!t.canApprove?null:(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground [&_code]:break-words [&_code]:whitespace-normal`,children:[(0,$.jsx)(`p`,{children:`To keep it out of new builds, disable it at Apple from a terminal. Its slot isn't returned until the membership year renews.`}),(0,$.jsx)(He,{label:`the command that disables it`,value:`npx hot-updater native-build devices remove --udid ${e.udid}`,wrap:!0})]}),r.isError?(0,$.jsxs)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:[`Couldn't `,i?`withdraw`:a?`decline`:`remove`,` `,e.name,`. Check your connection and try again.`]}):null,(0,$.jsxs)(Ot,{children:[(0,$.jsx)(kt,{disabled:r.isPending,children:`Cancel`}),(0,$.jsxs)(Dt,{disabled:r.isPending,onClick:t=>{t.preventDefault(),r.mutate({udid:e.udid},{onSuccess:n})},variant:`destructive`,children:[r.isPending?(0,$.jsx)(ot,{className:`animate-spin`,"data-icon":`inline-start`}):null,i?`Withdraw`:a?`Decline`:`Remove`]})]})]})})}function cr({view:t,devices:n}){let r=on(),[i,a]=(0,Q.useState)(null),o=i??t?.defaultName??``,[s,c]=(0,Q.useState)(o);(0,Q.useEffect)(()=>{let e=setTimeout(()=>c(o.trim()),400);return()=>clearTimeout(e)},[o]);let l=r?.ios===!0,u=rn({mode:`register`,name:s||`iPhone`},l&&t?.registration===`ready`),d=r===null||window.location.protocol===`https:`,f=r?.requested&&r.udid!==null?n?.find(e=>e.udid===r.udid?.toLowerCase()):void 0,p=r===null?(0,$.jsx)(e,{"aria-label":`Loading`,className:`h-36 w-full`}):f===void 0?t?.registration===`local-console`?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`iPhones register through your hosted Console: an iPhone can't reach this computer's.`}):t?.registration===`no-secret`?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`Set BETTER_AUTH_SECRET on this Console to register iPhones.`}):l?d?u.data?.status===`local-console`?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`iPhones register through your hosted Console: an iPhone can't reach this computer's.`}):u.data?.status===`no-secret`?(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,u.data.secretName,` on this Console to register iPhones.`]}):(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,$.jsxs)(Ht,{children:[(0,$.jsx)(Rt,{htmlFor:`ios-device-register-name`,children:`This iPhone's name`}),(0,$.jsx)(R,{autoComplete:`off`,className:`h-11`,id:`ios-device-register-name`,maxLength:100,onChange:e=>a(e.target.value),value:o})]}),u.data?.status===`issued`&&s===o.trim()?(0,$.jsxs)(`a`,{className:B({className:`h-auto min-h-11 w-full whitespace-normal`}),href:Ue(Qn(),u.data.token),children:[(0,$.jsx)(ut,{"data-icon":`inline-start`}),`Install profile`]}):(0,$.jsx)(e,{"aria-label":`Preparing the profile`,className:`h-11 w-full`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Safari only. Allow the download, then install it in Settings, where iOS calls it not signed. Safari comes back here, and nothing stays installed.`})]}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:`iPhones need this Console on HTTPS.`}):(0,$.jsxs)(`div`,{className:`flex flex-col items-start gap-4 sm:flex-row sm:items-center`,children:[(0,$.jsx)(an,{className:`size-36 shrink-0`,label:`Open this page on an iPhone`,value:`${window.location.origin}${Qn()}${We}`}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:`Open this page on the iPhone, in Safari.`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It installs a profile that reads the iPhone's ID, then lists the iPhone here as requested. Nothing stays installed.`})]})]}):(0,$.jsxs)(`p`,{className:`text-sm`,role:`status`,children:[(0,$.jsx)(`span`,{className:`font-medium`,children:f.name}),` ·`,` `,Jn[f.status],`.`,` `,f.status===`pending`?`A maintainer approves it next, and it joins the next ad hoc build.`:`It joins the next ad hoc build.`]});return(0,$.jsxs)(xt,{className:`shadow-sm`,children:[(0,$.jsx)(vt,{className:`border-b px-4 py-3`,children:(0,$.jsx)(bt,{className:`text-sm`,children:(0,$.jsx)(`h2`,{children:`Register an iPhone`})})}),(0,$.jsx)(yt,{className:`p-4 sm:p-6`,children:p})]})}function lr({search:e,onSearchChange:t}){let n=pe(),r=tn(e.status),i=r.data,a=i?.devices,[o,s]=(0,Q.useState)(null),c=()=>s(null),l=(0,$.jsx)(Qt,{icon:ut,title:e.status===void 0?`No iPhones yet`:`No ${Jn[e.status].toLowerCase()} iPhones`,children:e.status===void 0?(0,$.jsx)(`p`,{children:`Open this page on an iPhone to register it.`}):(0,$.jsx)(W,{className:`h-11 sm:h-7`,onClick:()=>t({}),size:`sm`,variant:`outline`,children:`Show all`})});return(0,$.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,$.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,$.jsx)(J,{className:`-ml-1 size-11 lg:size-7`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(at,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`text-sm font-medium`,children:`Native builds`})]}),(0,$.jsx)(`p`,{className:`basis-full pl-12 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`The iPhones and iPads ad hoc builds install on. Android needs none.`})]}),(0,$.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:[(0,$.jsx)(en,{current:`devices`}),(0,$.jsx)(cr,{devices:a,view:i}),i!==void 0&&!i.viewer.approversConfigured?(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground`,children:[(0,$.jsx)(`p`,{children:`Nobody approves in this Console. Approve from a terminal:`}),(0,$.jsx)(He,{label:`the approve command`,value:Ke})]}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(rt,{items:[{label:`All statuses`,value:Xn},...Object.keys(Jn).map(e=>({label:Jn[e],value:e}))],onValueChange:e=>t(e===null||e===Xn?{}:{status:e}),value:e.status??Xn,children:[(0,$.jsx)(Xe,{"aria-label":`Status`,className:`min-w-0 flex-1 text-xs data-[size=default]:h-11 sm:w-44 sm:flex-none sm:data-[size=default]:h-8`,children:(0,$.jsx)(et,{})}),(0,$.jsx)($e,{children:(0,$.jsxs)(tt,{children:[(0,$.jsx)(Ze,{value:Xn,children:`All statuses`}),Object.keys(Jn).map(e=>(0,$.jsx)(Ze,{value:e,children:Jn[e]},e))]})})]}),(0,$.jsx)(W,{"aria-label":`Refresh iOS devices`,className:`ml-auto size-11 sm:size-7`,disabled:r.isFetching,onClick:()=>void r.refetch(),size:`icon-sm`,variant:`ghost`,children:(0,$.jsx)(lt,{"aria-hidden":`true`})})]}),r.isError?(0,$.jsxs)(mt,{variant:`destructive`,children:[(0,$.jsx)(ht,{}),(0,$.jsx)(ft,{children:`iOS devices couldn't be loaded`}),(0,$.jsx)(pt,{children:`Check your connection and try again.`}),(0,$.jsx)(gt,{children:(0,$.jsxs)(W,{onClick:()=>void r.refetch(),size:`xs`,variant:`outline`,children:[(0,$.jsx)(lt,{"data-icon":`inline-start`}),`Retry`]})})]}):(0,$.jsx)(Kt,{children:n?(0,$.jsx)(`div`,{"aria-busy":r.isPlaceholderData,"aria-label":`iOS devices`,className:`aria-busy:opacity-60`,role:`list`,children:r.isLoading?(0,$.jsx)(Zt,{label:`Loading iOS devices`}):a?.length===0?(0,$.jsx)(Jt,{children:l}):a?.map(e=>(0,$.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,$.jsx)(ar,{device:e,onOpen:s,viewer:i.viewer})},e.id))}):(0,$.jsx)(Gt,{"aria-busy":r.isPlaceholderData,"aria-label":`iOS devices`,className:`aria-busy:opacity-60`,header:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X,{children:`Name`}),(0,$.jsx)(X,{children:`UDID`}),(0,$.jsx)(X,{children:`Requested by`}),(0,$.jsx)(X,{children:`Status`}),(0,$.jsx)(X,{children:`Added`}),(0,$.jsx)(X,{children:`Build`}),(0,$.jsx)(X,{className:`text-right`,children:(0,$.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:r.isLoading?(0,$.jsx)(qt,{columns:Zn+1,label:`Loading iOS devices`}):a?.length===0?(0,$.jsx)(Yt,{columns:Zn+1,children:l}):a?.map(e=>(0,$.jsx)(ir,{device:e,onOpen:s,viewer:i.viewer},e.id))})})]}),o!==null&&o.kind!==`remove`?(0,$.jsx)(or,{onClose:c,target:o},o.device.id):null,o?.kind===`remove`&&i!==void 0?(0,$.jsx)(sr,{device:o.device,onClose:c,viewer:i.viewer},o.device.id):null]})}function ur(){let e=Ut.useSearch(),t=Ut.useNavigate();return(0,$.jsx)(lr,{onSearchChange:e=>void t({search:e,replace:!0}),search:e})}export{ur as component};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds_.devices-CElovmwq.js","assets/sidebar-yC7KdImc.js","assets/alert-dialog-CLC_h1fL.js","assets/select-CA8r-UUe.js","assets/useCompositeListItem-lAmUsXcc.js","assets/check-CqWNyG93.js","assets/CompositeItem-Dy4xgOMg.js","assets/tabs-CHNnCyvw.js","assets/link-CN3iHC4A.js","assets/relativeTime-CBmDq8wh.js","assets/native-builds-BdzfAFnF.js","assets/copy-CH1__JAW.js","assets/dist-Bw_uSBJn.js","assets/uuidv7-CVJ09bBG.js","assets/-native-builds-search-7blX2yQW.js","assets/loader-circle-GWIgH0fo.js","assets/refresh-cw-BgiOaFX3.js","assets/smartphone-CxP0GGT6.js","assets/trash-2-CYISg7ZF.js","assets/badge-DJMW4YVM.js","assets/IosInstall-B5NspihF.js","assets/useMutation-w3qYaU2L.js","assets/send-BgXZNiEA.js","assets/field-DL4OXTJ7.js","assets/api-DLryz9hA.js","assets/preload-helper-CRQjUQaZ.js","assets/RelativeTime-CY1dKZpv.js","assets/chevron-right-DNbYTBX1.js","assets/table-CwF7yxj4.js","assets/NativeBuildsNav-CjOOlbEu.js","assets/card-C4sBAMU-.js","assets/dialog-tCTZmAo8.js"])))=>i.map(i=>d[i]);
2
- import{i as e,r as t,t as n}from"./preload-helper-CRQjUQaZ.js";import{t as r}from"./-native-builds-search-7blX2yQW.js";var i=e(`/native-builds_/devices`)({component:t(()=>n(()=>import(`./native-builds_.devices-CElovmwq.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])),`component`),validateSearch:r});export{i as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./ConsoleFeatureUnavailable-cy_snb33.js";var t=e;export{t as notFoundComponent};
@@ -1 +0,0 @@
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,Qn as y,R as b,Ri as x,Sn as S,Tr as C,U as w,Un as ee,Vi as T,Vr as E,Xn as te,Z 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 ve}from"./sidebar-yC7KdImc.js";import{t as F}from"./link-CN3iHC4A.js";import{t as I}from"./arrow-right-CXp_K3xK.js";import{t as ye}from"./arrow-up-right-BFafIOrq.js";import{a as be,i as xe,n as L,r as Se,s as Ce,t as we}from"./routes-BTG3rg0l.js";import{t as R}from"./check-CqWNyG93.js";import{a as z,i as B,n as Te,r as Ee}from"./useCompositeListItem-lAmUsXcc.js";import{S as De,b as V,d as Oe,y as ke}from"./native-builds-BdzfAFnF.js";import{t as Ae}from"./chevron-right-DNbYTBX1.js";import{A as je,D as Me,E as Ne,M as Pe,N as Fe,T as Ie,a as Le,d as Re,f as ze,h as Be,i as H,m as U,n as Ve,o as W,r as He,t as G}from"./select-CA8r-UUe.js";import{t as Ue}from"./circle-off-BCkZpskJ.js";import{r as We,t as Ge}from"./HashValueDisplay-DMweha_0.js";import{i as Ke,n as qe,r as Je,t as Ye}from"./RolloutPercentageBadge-BHgHkBGB.js";import{i as Xe,r as Ze}from"./TargetDisplay-DB8D019f.js";import{t as Qe}from"./list-fFsS8Wxe.js";import{t as $e}from"./loader-circle-GWIgH0fo.js";import{t as et}from"./package-CXSDZsME.js";import{t as tt}from"./plus-Cx-yFNd9.js";import{a as nt,i as rt,n as it,o as at,s as ot,t as st}from"./input-group-B7jx0icS.js";import{n as ct,t as lt}from"./switch-BTHWmKQ5.js";import{t as ut}from"./trash-2-CYISg7ZF.js";import{a as dt,i as ft,n as pt,o as mt,t as K}from"./badge-DJMW4YVM.js";import{n as q}from"./dist-Bw_uSBJn.js";import{o as ht}from"./insights-search-TfRz5kGG.js";import{a as gt,n as _t,o as vt,r as yt,t as bt}from"./card-C4sBAMU-.js";import{a as xt,c as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,u as kt}from"./uuidv7-CVJ09bBG.js";import{a as At,i as jt,l as Mt,n as Nt,o as Pt,r as Ft,s as It,t as Lt}from"./alert-dialog-CLC_h1fL.js";import{n as Rt,t as zt}from"./PlatformIcon-BBvlg6JY.js";import{a as Bt,i as Vt,n as Ht,o as Ut,r as Wt,s as Gt,t as Kt}from"./dialog-tCTZmAo8.js";import{a as qt,c as Jt,i as Yt,n as Xt,r as Zt,t as Qt}from"./field-DL4OXTJ7.js";import{C as $t,S as en,_ as tn,a as nn,b as rn,c as an,i as on,n as sn,o as cn,r as ln,s as un,t as dn,v as fn,w as pn,x as mn,y as hn}from"./api-DLryz9hA.js";import{a as gn,i as J,n as _n,o as vn,r as Y,t as yn}from"./table-CwF7yxj4.js";import{t as bn}from"./BundleIdDisplay-B0gAH01c.js";import{a as xn,c as Sn,d as Cn,f as wn,i as Tn,l as En,n as Dn,o as On,p as kn,r as An,s as jn,t as Mn,u as Nn}from"./RelativeTime-CY1dKZpv.js";import{n as Pn,t as Fn}from"./valueToPercent-Db73Kirz.js";import{a as In,c as Ln,i as Rn,n as zn,o as Bn,r as Vn,s as Hn,t as Un}from"./RowReason-BMx_vclu.js";var Wn=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`}]]),Gn=E(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Kn=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`}]]),qn=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`}]]),Jn=o();function Yn(){return M}function Xn(){return!1}function Zn(){return!0}function Qn(){return(0,Jn.useSyncExternalStore)(Yn,Xn,Zn)}var X=T(x(),1),Z=a();function $n({enabled:e,className:t,falseIcon:n=`x`,colorMode:i=`semantic`}){let a=i===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(R,{className:j(`h-4 w-4`,a??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(Gn,{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 er({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)(bn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{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)(bn,{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)(bn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(I,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(bn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(Je,{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)(yn,{className:`min-w-max`,children:[(0,Z.jsx)(gn,{children:(0,Z.jsxs)(vn,{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)(_n,{children:r.map(e=>(0,Z.jsxs)(vn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{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)(bn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(I,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(bn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(Je,{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 tr({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(null),o=ct(i),{data:s=[],isPending:c}=on(),l=cn(),u=un(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?q.success(`Channel ${e.row.name} created`):q.info(`Channel ${e.row.name} already exists`)}catch(e){q.error(`Failed to create channel`),console.error(e)}},p=async()=>{if(!(!i||u.isPending))try{let e=await u.mutateAsync({id:i.id});e.deleted?q.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?q.error(`Channel ${i.name} is still in use and cannot be deleted`):q.error(`Channel ${i.name} no longer exists`),a(null)}catch(e){q.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Kt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Ht,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsxs)(Ut,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Kn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Wt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:f,children:(0,Z.jsx)(Yt,{className:`gap-2`,children:(0,Z.jsxs)(Qt,{orientation:`horizontal`,children:[(0,Z.jsx)(qt,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ne,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(D,{type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)($e,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(tt,{"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)($e,{className:`mr-2 size-3.5 animate-spin`}),`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`,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`,children:(0,Z.jsx)(ut,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(Lt,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&a(null)},children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsxs)(Mt,{children:[`Delete `,o?.name,`?`]}),(0,Z.jsx)(At,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(Nt,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var nr=`[a-zA-Z0-9-]`,rr=String.raw`0|[1-9]\d*`,ir=String.raw`\d+`,ar=String.raw`\d*[a-zA-Z-]${nr}*`,or=String.raw`(${rr})\.(${rr})\.(${rr})`,sr=String.raw`(${ir})\.(${ir})\.(${ir})`,cr=`(?:${ar}|${rr})`,lr=`(?:${ar}|${ir})`,ur=String.raw`(?:-(${cr}(?:\.${cr})*))`,dr=String.raw`(?:-?(${lr}(?:\.${lr})*))`,fr=`${nr}+`,pr=String.raw`(?:\+(${fr}(?:\.${fr})*))`,mr=`v?${or}${ur}?${pr}?`,hr=String.raw`[v=\s]*${sr}${dr}?${pr}?`,gr=`((?:<|>)?=?)`,_r=String.raw`${rr}|x|X|\*`,vr=String.raw`${ir}|x|X|\*`,yr=String.raw`[v=\s]*(${_r})(?:\.(${_r})(?:\.(${_r})(?:${ur})?${pr}?)?)?`,br=String.raw`[v=\s]*(${vr})(?:\.(${vr})(?:\.(${vr})(?:${dr})?${pr}?)?)?`,xr=`(?:~>?)`,Sr=String.raw`(?:\^)`,Cr=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Cr}(?:$|[^\d])`,String.raw`${Cr}(?:${ur})?(?:${pr})?(?:$|[^\d])`;function wr(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[nr,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(wr(e),t)}var Tr=Q(`^${mr}$`),Er=Q(`^${hr}$`),Dr=/^\d+$/;function Or(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function kr(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?Er:Tr);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(Dr.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 Ar=Q(String.raw`^${gr}\s*(${mr})$|^$`),jr=Q(String.raw`^${gr}\s*(${hr})$|^$`);function Mr(e){return e.version?`${e.operator}${Or(e.version)}`:``}function Nr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?jr:Ar);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?kr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${Or(a)}`:``,version:a}}function Pr(e){return e.sets.map(e=>e.map(Mr).join(` `)).join(`||`)}var Fr=new RegExp(pr,`g`),Ir=Q(pr),Lr=Q(String.raw`^\s*(${yr})\s+-\s+(${yr})\s*$`),Rr=Q(String.raw`^\s*(${br})\s+-\s+(${br})\s*$`),zr=Q(String.raw`(\s*)${gr}\s*(${hr}|${yr})`,`g`),Br=Q(String.raw`(\s*)${xr}\s+`,`g`),Vr=Q(String.raw`(\s*)${Sr}\s+`,`g`),Hr=Q(`^${xr}${yr}$`),Ur=Q(`^${xr}${br}$`),Wr=Q(`^${Sr}${yr}$`),Gr=Q(`^${Sr}${br}$`),Kr=Q(String.raw`^${gr}\s*${yr}$`),qr=Q(String.raw`^${gr}\s*${br}$`),Jr=Q(String.raw`(<|>)?=?\s*\*`),Yr=/^\s*>=\s*0\.0\.0\s*$/,Xr=/^\s*>=\s*0\.0\.0-0\s*$/,Zr=Q(String.raw`^${gr}\s*(${hr})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Qr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function $r(e,t){let n=t.loose?Ur:Hr,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 ei(e,t){return e.trim().split(/\s+/).map(e=>$r(e,t)).join(` `)}function ti(e,t){let n=t.loose?Gr:Wr,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 ni(e,t){return e.trim().split(/\s+/).map(e=>ti(e,t)).join(` `)}function ri(e,t){let n=t.loose?qr:Kr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Qr(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 ii(e,t){return e.split(/\s+/).map(e=>ri(e,t)).join(` `)}function ai(e,t){let n=t.loose?Rr:Lr;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 oi(e,t){return ii(ei(ni(e.replace(Ir,``),t),t),t).trim().replace(Jr,``)}function si(e,t){let n=ai(e.replace(Fr,``),t).replace(zr,`$1$2$3`).replace(Br,`$1~`).replace(Vr,`$1^`).split(` `).map(e=>oi(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Xr:Yr,``));t.loose&&(n=n.filter(e=>Zr.test(e)));let r=new Map;for(let e of n.map(e=>Nr(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 ci(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>si(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 li(e,t={}){try{return ci(e,t)}catch{return null}}function ui(e,t={}){let n=li(e,t);return n?Pr(n)||`*`:null}function di({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 fi({bundle:e,release:t}){let{data:n,isFetched:r}=nn(),i=e?Ot(e):null,a=e?Et(e):null,o=e?.gitCommitHash&&r?qe(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(gt,{className:`p-4 pb-3`,children:(0,Z.jsx)(vt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(_t,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(di,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(di,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(Ge,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(Ke,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(di,{label:`Manifest hash`,value:(0,Z.jsx)(Ge,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(di,{label:`Base hash`,value:(0,Z.jsx)(Ge,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(di,{label:`Patch hash`,value:(0,Z.jsx)(Ge,{maxLength:16,value:i})}):null]})})]}):null}var pi=Array.from({length:Dt},(e,t)=>t+1);function mi({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=kt(t),i=n??[],a=i.length>0,o=r>0&&r<1e3,s=r===Dt,c=O(),l=s?pi:o?pi.filter(t=>Ct(e,t)<r):[],u=(r/10).toFixed(1),d=s?Dt:l.length,f=Dt-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)(bt,{children:(0,Z.jsxs)(gt,{className:`p-4`,children:[(0,Z.jsx)(yt,{children:`Selected cohorts`}),(0,Z.jsx)(vt,{className:`font-mono text-2xl tabular-nums`,children:d})]})}),(0,Z.jsx)(bt,{children:(0,Z.jsxs)(gt,{className:`p-4`,children:[(0,Z.jsx)(yt,{children:`Excluded cohorts`}),(0,Z.jsx)(vt,{className:`font-mono text-2xl tabular-nums`,children:f})]})})]}),a?(0,Z.jsxs)(bt,{children:[(0,Z.jsxs)(gt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(vt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(yt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(_t,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Z.jsx)(K,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(gt,{className:`p-4 pb-3`,children:(0,Z.jsx)(vt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(_t,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children: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)(K,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Kt,{children:[(0,Z.jsxs)(Gt,{render:(0,Z.jsx)(D,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Qe,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Ht,{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)(Bt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Ut,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Wt,{children:[u,`% includes `,d,` of`,` `,Dt,` 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)(Vt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsx)(Ut,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Wt,{children:[u,`% includes `,d,` of`,` `,Dt,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),p,(0,Z.jsx)(Vt,{showCloseButton:!0})]})})]})}function hi({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&&V(i)!==null,o=mn(a?i:null);if(!a)return null;let s=o.data;return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Native build`}),o.isPending?(0,Z.jsx)(e,{className:`h-4 w-40`}):s?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(F,{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:[ke(s.platform),` `,Oe[s.artifact_kind].label,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono`,translate:`no`,children:s.min_bundle_id}),(0,Z.jsx)(ye,{"aria-hidden":`true`,className:`size-3`})]}),r?(0,Z.jsx)(K,{variant:`secondary`,children:(r.patches??[]).some(({baseBundleId:e})=>e===s.min_bundle_id)?`Patches from it`:`No patch from it`}):null]}):o.isError?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Couldn't load the scope's native build.`,` `,(0,Z.jsx)(`button`,{className:`underline underline-offset-4`,onClick:()=>void o.refetch(),type:`button`,children:`Retry`})]}):(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`None tracked for this scope ·`,` `,(0,Z.jsx)(F,{className:`underline-offset-4 hover:text-foreground hover:underline`,search:{channel:n},to:`/native-builds`,children:`This channel's builds`})]})]})}function gi(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function _i(e,t){return e-t}function vi(e,t,n){let r=e.slice();return r[t]=n,r.sort(_i)}function yi(e,t,n,r,i,a){let o=e;return o=U(o,n,r),i&&(o=vi(a,t,U(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function bi(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 xi={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...Pe},Si=X.createContext(void 0);function Ci(){let e=X.useContext(Si);if(e===void 0)throw Error(me(62));return e}function wi(e){return`key`in e?p:g}function Ti(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?gi(e,t):!1}var Ei=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:b,orientation:x=`horizontal`,step:C=1,thumbCollisionBehavior:w=`push`,thumbAlignment:ee=`center`,value:T,style:E,...te}=e,ne=ue(s),ie=Re(ne),ae=h(v),oe=h(b),{clearErrors:ce}=Be(),{state:le,disabled:de,name:fe,setTouched:D,setDirty:O,validityData:me,shouldValidateOnChange:he,validation:k}=je(),{labelId:j}=Ne(),[M,N]=X.useState(),P=n??ze(j,M),ve=de||o,F=fe??_,[I,ye]=B({controlled:T,default:a??p,name:`Slider`}),be=X.useRef(null),xe=X.useRef(null),L=X.useRef([]),Se=X.useRef(null),Ce=X.useRef(null),we=X.useRef(-1),R=X.useRef(null),z=X.useRef(null),Te=X.useRef(`none`),De=se(c),[V,Oe]=X.useState(-1),[ke,Ae]=X.useState(-1),[Pe,Fe]=X.useState(!1),[Ie,Le]=X.useState(()=>new Map),[H,Ve]=X.useState([void 0,void 0]),W=h(e=>{Oe(e),e!==-1&&Ae(e)});Me(xe,ne,I),ge(I,()=>{ce(F),he()?k.commit(I):k.commit(I,!0);let e=me.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!gi(I,e):I!==e,O(t)});let He=h(e=>{e&&(xe.current=e)}),G=Array.isArray(I),Ue=X.useMemo(()=>G?I.slice().sort(_i):[U(I,p,f)],[f,p,G,I]),We=h((e,t)=>{if(Number.isNaN(e)||Ti(e,I))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:F}}),n.event=i,z.current=e,ae(e,n),!n.isCanceled&&ye(e)}),Ge=h((e,t,n)=>{let r=yi(e,t,p,f,G,Ue);if(bi(r,C,m)){let e=wi(n);We(r,S(e,n.nativeEvent,void 0,{activeThumbIndex:t})),D(!0),oe(z.current??r,i(e,n.nativeEvent))}});pe(()=>{let e=re(A(be.current));ve&&y(be.current,e)&&e.blur()},[ve]),ve&&V!==-1&&W(-1);let Ke=X.useMemo(()=>({...le,activeThumbIndex:V,disabled:ve,dragging:Pe,orientation:x,max:f,min:p,minStepsBetweenValues:m,step:C,values:Ue}),[le,V,ve,Pe,f,p,m,x,C,Ue]),qe=X.useMemo(()=>({active:V,controlRef:xe,disabled:ve,dragging:Pe,validation:k,formatOptionsRef:De,handleInputChange:Ge,indicatorPosition:H,inset:ee!==`center`,labelId:P,rootLabelId:ie,largeStep:l,lastUsedThumbIndex:ke,lastChangedValueRef:z,lastChangeReasonRef:Te,form:g,locale:u,max:f,min:p,minStepsBetweenValues:m,name:F,onValueCommitted:oe,orientation:x,pressedInputRef:Se,pressedThumbCenterOffsetRef:Ce,pressedThumbIndexRef:we,pressedValuesRef:R,registerFieldControlRef:He,renderBeforeHydration:ee===`edge`,setActive:W,setDragging:Fe,setIndicatorPosition:Ve,setLabelId:N,setValue:We,state:Ke,step:C,thumbCollisionBehavior:w,thumbMap:Ie,thumbRefs:L,values:Ue}),[V,xe,P,ie,ve,Pe,k,De,Ge,H,l,ke,z,Te,g,u,f,p,m,F,oe,x,Se,Ce,we,R,He,W,Fe,Ve,N,We,Ke,C,w,ee,Ie,L,Ue]),Je=_e(`div`,e,{state:Ke,ref:[t,be],props:[{"aria-labelledby":P,id:ne,role:`group`},k.getValidationProps,te],stateAttributesMapping:xi});return(0,Z.jsx)(Si.Provider,{value:qe,children:(0,Z.jsx)(Ee,{elementsRef:L,onMapChange:Le,children:Je})})});function Di(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Oi(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 ki(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(Oi(t),Oi(n))))}function Ai({values:e,index:t,nextValue:n,min:r,max:i,step:a,minStepsBetweenValues:o,initialValues:s}){if(e.length===0)return[];let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=U(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e]??c[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=U(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e]??c[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=U(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ji({behavior:e,values:t,currentValues:n,initialValues:r,pressedIndex:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;switch(e){case`swap`:{let e=u[i],t=1e-7,n=u.slice(),r=n[i-1],p=n[i+1],m=U(a,r==null?o:r+f,p==null?s:p-f),h=Number(m.toFixed(12));n[i]=h;let g=a>e,_=a<e,v=g&&p!=null&&a>=p-t,y=_&&r!=null&&a<=r+t;if(!v&&!y)return{value:n,thumbIndex:i,didSwap:!1};let b=v?i+1:i-1,x=n.map((e,t)=>t===i?h:d[t]??u[t]),S=a;S=v?Math.max(a,n[b]):Math.min(a,n[b]);let C=Ai({values:n,index:b,nextValue:S,min:o,max:s,step:c,minStepsBetweenValues:l,initialValues:x}),w=v?b-1:b+1;if(w>=0&&w<C.length){let e=C[w-1],t=C[w+1],n=e==null?o:e+f;n=Math.max(n,o+w*f);let r=t==null?s:t-f;r=Math.min(r,s-(C.length-1-w)*f);let i=U(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:Ai({values:u,index:i,nextValue:a,min:o,max:s,step:c,minStepsBetweenValues:l}),thumbIndex:i,didSwap:!1};default:{let e=u.slice(),t=e[i-1],n=e[i+1],r=U(a,t==null?o:t+f,n==null?s:n-f);return e[i]=Number(r.toFixed(12)),{value:e,thumbIndex:i,didSwap:!1}}}}var Mi=2;function Ni(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 Pi(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 Fi=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:b,onValueCommitted:x,orientation:C,pressedInputRef:w,pressedThumbCenterOffsetRef:T,pressedThumbIndexRef:E,pressedValuesRef:te,registerFieldControlRef:ne,renderBeforeHydration:ie,setActive:ae,setDragging:oe,setValue:le,state:ue,step:de,thumbCollisionBehavior:fe,thumbRefs:D,values:O}=Ci(),pe=ce(),me=O.length>1,he=C===`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),F=X.useRef(0),I=se(O);function ye(e){E.current!==e&&(E.current=e);let t=D.current[e];if(!t){T.current=null,w.current=null;return}w.current=t.querySelector(`input[type="range"]`)}function be(e){let t=k.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=Ni(j.current,he),c=F.current,l=(he?r:n)-s.start-s.end-c*2,u=T.current??0,d=e.x-u,f=e.y-u,p=U(((he?i-f-s.end:(pe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-v)*p+v;if(m=ki(m,de,v),m=U(m,v,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=E.current;if(h<0)return null;let _=ji({behavior:fe,values:O,currentValues:I.current??O,initialValues:te.current,pressedIndex:h,nextValue:m,min:v,max:g,step:de,minStepsBetweenValues:b});return fe===`swap`&&_.didSwap?ye(_.thumbIndex):E.current=_.thumbIndex,_}function xe(e){te.current=me?O.slice():null,I.current=O;let t=E.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=Di(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&ye(n),f){let e=D.current[n];d(e)&&(F.current=e.getBoundingClientRect()[he?`height`:`width`]/2)}}function L(e){let t=D.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let Se=h(e=>{let t=Pi(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){Ce(e);return}let n=be(t);n!=null&&bi(n.value,de,b)&&(!u&&P.current>Mi&&oe(!0),le(n.value,S(_,e,void 0,{activeThumbIndex:n.thumbIndex})),I.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))});function Ce(e){ae(-1),oe(!1),w.current=null,T.current=null;let t=Pi(e,M),n=t==null?null:be(t);if(n!=null){let t=m.current;x(p.current??n.value,i(t,e))}`pointerType`in e&&k.current?.hasPointerCapture(e.pointerId)&&k.current?.releasePointerCapture(e.pointerId),E.current=-1,M.current=null,te.current=null,R()}let we=h(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=Pi(e,M);if(n!=null){xe(n);let t=be(n);if(t==null)return;L(t.thumbIndex),le(t.value,S(ee,e,void 0,{activeThumbIndex:t.thumbIndex})),I.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&L(t.thumbIndex)}P.current=0;let r=A(k.current);r.addEventListener(`touchmove`,Se,{passive:!0}),r.addEventListener(`touchend`,Ce,{passive:!0})}),R=h(()=>{let e=A(k.current);e.removeEventListener(`pointermove`,Se),e.removeEventListener(`pointerup`,Ce),e.removeEventListener(`touchmove`,Se),e.removeEventListener(`touchend`,Ce),te.current=null}),z=ve();return X.useEffect(()=>{let e=k.current;if(!e)return()=>R();let t=N(e,`touchstart`,we,{passive:!0});return()=>{t(),z.cancel(),R()}},[R,we,k,z]),X.useEffect(()=>{l&&R()},[l,R]),_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=Pi(e,M);if(i!=null){xe(i);let t=be(i);if(t==null)return;y(D.current[t.thumbIndex],re(A(n)))?e.preventDefault():z.request(()=>{L(t.thumbIndex)}),oe(!0),T.current??(le(t.value,S(ee,e.nativeEvent,void 0,{activeThumbIndex:t.thumbIndex})),I.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&L(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`,Ce,{once:!0})}},s],stateAttributesMapping:xi})}),Ii=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=Ci();return _e(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:xi})}),Li=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}({}),Ri=new Set([...f,w,l]);function zi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${Pn(e[t],r,n)} start range`:`${Pn(e[t],r,n)} end range`:n?Pn(e[t],r,n):void 0}function Bi(e,t,n,r,i){let a=n===1?e+t:e-t;return U(Number(a.toFixed(Math.max(Oi(e),Oi(t),Oi(r)))),r,i)}var Vi=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:x,index:S,inputRef:ee,onBlur:T,onFocus:E,onKeyDown:ne,tabIndex:re,style:ie,...ae}=e,{nonce:oe}=Fe(),se=ue(x),{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:ve,form:F,name:I,orientation:ye,pressedInputRef:be,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:L,renderBeforeHydration:Se,setActive:Ce,setIndicatorPosition:we,state:R,step:z,values:B}=Ci(),Ee=ce(),De=g||O,V=B.length>1,Oe=ye===`vertical`,ke=Ee===`rtl`,{setTouched:Ae,setFocused:Me,validationMode:Ne}=je(),Pe=X.useRef(null),Le=X.useRef(null),Re=X.useRef(!1),ze=ue(),Be=Ie(),H=V?ze:Be,{ref:U,index:Ve}=Te({metadata:X.useMemo(()=>({inputId:H}),[H])}),W=V?S??Ve:0,He=W===B.length-1,G=B[W],Ue=Fn(G,P,N),[We,Ge]=X.useState(),Ke=Qn(),qe=de>=0&&de<B.length?de:-1,Je=h(()=>{let e=D.current,t=Pe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Oe?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Ue/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ge(s),W===0?we(e=>[s,e[1]]):He&&we(e=>[e[0],s])});pe(()=>{A&&queueMicrotask(Je)},[Je,A]),pe(()=>{A&&Je()},[Je,A,Ue]),pe(()=>{if(!A)return;let e=D.current,t=Pe.current;if(!e||!t)return;let n=c(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Je);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[D,Je,A]);let Ye=Oe?`bottom`:`insetInlineStart`,Xe=Oe?`left`:`top`,Ze;V?le===W?Ze=2:qe===W&&(Ze=1):le===W&&(Ze=1);let Qe;Qe=A?{"--position":`${We??0}%`,visibility:Se&&Ke||We===void 0?`hidden`:void 0,position:`absolute`,[Ye]:`var(--position)`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:Number.isFinite(Ue)?{position:`absolute`,[Ye]:`${Ue}%`,[Xe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Ze}:fe;let $e;ye===`vertical`&&($e=ke?`vertical-rl`:`vertical-lr`);let et=typeof _==`function`?_(W):d,tt=n({"aria-label":et,"aria-labelledby":p??(et==null?j:void 0),"aria-describedby":o,"aria-orientation":ye,"aria-valuenow":G,"aria-valuetext":typeof y==`function`?y(Pn(G,M,he.current??void 0),G,W):zi(B,W,he.current??void 0,M),disabled:De,form:F,id:H,max:N,min:P,name:I,onChange(e){k(e.currentTarget.valueAsNumber,W,e)},onFocus(e){let t=Re.current;Re.current=!1,Ce(W),Me(!0),t&&e.stopPropagation()},onBlur(e){if(Re.current){e.stopPropagation();return}Pe.current&&(Ce(-1),Ae(!0),Me(!1),Ne===`onBlur`&&me.commit(yi(G,W,P,N,V,B)))},onKeyDown(e){if(!Ri.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=ki(G,z,P);switch(e.key){case u:t=Bi(n,e.shiftKey?ge:z,1,P,N);break;case s:t=Bi(n,e.shiftKey?ge:z,ke?-1:1,P,N);break;case m:t=Bi(n,e.shiftKey?ge:z,-1,P,N);break;case v:t=Bi(n,e.shiftKey?ge:z,ke?1:-1,P,N);break;case w:t=Bi(n,ge,1,P,N);break;case l:t=Bi(n,ge,-1,P,N);break;case`End`:t=N,V&&(t=Number.isFinite(B[W+1])?B[W+1]-z*ve:N);break;case b:t=P,V&&(t=Number.isFinite(B[W-1])?B[W-1]+z*ve:P);break;default:break}if(t!==null){let n=e.currentTarget;te(n)||(Re.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),k(t,W,e),e.preventDefault()}},step:z,style:{...fe,width:`100%`,height:`100%`,writingMode:$e},tabIndex:re??void 0,type:`range`,value:G??``},me.getInputValidationProps),nt=C(Le,me.inputRef,ee);return _e(`div`,e,{state:R,ref:[t,U,Pe],props:[{[Li.index]:W,children:(0,Z.jsxs)(X.Fragment,{children:[i,(0,Z.jsx)(`input`,{ref:nt,...tt,suppressHydrationWarning:!0}),A&&Ke&&Se&&He&&(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:T,onFocus:E,onPointerDown(e){if(L.current=W,Pe.current!=null){let t=ye===`horizontal`?`x`:`y`,n=Di(Pe.current);xe.current=(ye===`horizontal`?e.clientX:e.clientY)-n[t]}Le.current!=null&&be.current!==Le.current&&(be.current=Le.current)},style:Qe,suppressHydrationWarning:Se||void 0},ae],stateAttributesMapping:xi})});function Hi(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 Ui(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 Wi=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}=Ci(),m=Qn(),h=u===`vertical`,g=p.length>1,_=s?Hi(h,g,o[0],o[1],d,m):Ui(h,g,Fn(p[0],l,c),Fn(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:xi})});function Gi({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)(Ei,{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)(Fi,{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)(Ii,{"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)(Wi,{"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)(Vi,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ki=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],qi=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]}),Ji=(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}),Yi=e=>(e/10).toFixed(1),Xi=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},Zi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Qi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Yi(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Yi(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Gi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(st,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(rt,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Zi(n)??e;a(!1),r(Yi(i)),t(i)},onChange:e=>{let n=Xi(e.target.value);r(n);let i=Zi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(it,{align:`inline-end`,children:(0,Z.jsx)(nt,{children:`%`})})]})]})}function $i({channels:t,onOpenChange:n,onShowScope:i,open:a,releaseId:o}){let s=en(o),c=s.data,l=ln(c?.bundle_id??``),u=l.data,d=u?xt(u):null,f=hn(c?.scope_key??``),p=pn(),m=tn(),h=an(),g=fn(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[ee,T]=(0,X.useState)(!1),[E,te]=(0,X.useState)(!1),[re,ae]=(0,X.useState)(``),[se,ce]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?qi(c):null),S(``)},[c]);let ue=c?qi(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=wt(y);if(!St(e)){S(Tt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},he=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(wt);if(e.some(e=>!St(e))){S(Tt);return}if(c.strategy===`APP_VERSION`&&!ui(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ji(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),q.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},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=_?ui(_.targetAppVersion.trim()):null,ve=()=>{ae(``),ce(`move`)},F=e=>{!e&&g.isPending||(te(e),e||ve())};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)(zt,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(bn,{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)(hi,{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)(pt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(ft,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(be,{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)(Yt,{className:`gap-6`,children:[(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(at,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ne,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),_e?(0,Z.jsx)(Xt,{children:_e}):null]}):null,(0,Z.jsx)(Qt,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(qt,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(ht,{label:`About Enabled`,children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsx)(lt,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(Qt,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(qt,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(ht,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(lt,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(Qt,{children:[(0,Z.jsx)(qt,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Qi,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(Qt,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(qt,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(mi,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ne,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),me())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(D,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:me,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(tt,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(K,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Xt,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Zt,{children:x}):null,(0,Z.jsx)(D,{className:`w-full`,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`,disabled:!c.bundle_id||O,onClick:()=>te(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(D,{className:`w-full`,disabled:O,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),q.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(We,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(D,{className:`w-full`,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)(pt,{variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Build details are unavailable`}),(0,Z.jsx)(ft,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(fi,{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`,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)(Lt,{onOpenChange:w,open:C,children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsx)(Mt,{children:`Discard unsaved changes?`}),(0,Z.jsx)(At,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{children:`Keep editing`}),(0,Z.jsx)(Nt,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(Lt,{onOpenChange:T,open:ee,children:(0,Z.jsxs)(jt,{children:[(0,Z.jsxs)(It,{children:[(0,Z.jsxs)(Mt,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(At,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Ft,{children:`Cancel`}),(0,Z.jsx)(Nt,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),q.success(`Bundle removed from ${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)(Kt,{onOpenChange:F,open:E,children:(0,Z.jsxs)(Ht,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Bt,{children:[(0,Z.jsx)(Ut,{children:`Promote to Channel`}),(0,Z.jsx)(Wt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Jt,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(G,{disabled:g.isPending,items:Ki,onValueChange:e=>ce(e),value:se,children:[(0,Z.jsx)(Le,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(W,{placeholder:`Select an action`})}),(0,Z.jsx)(Ve,{children:(0,Z.jsxs)(He,{children:[(0,Z.jsx)(H,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(H,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:N?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Jt,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(G,{disabled:g.isPending,items:ge,onValueChange:e=>ae(e??``),value:re||null,children:[(0,Z.jsx)(Le,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(W,{placeholder:`Select a channel`})}),(0,Z.jsx)(Ve,{className:`max-h-64`,children:(0,Z.jsx)(He,{children:j.map(e=>(0,Z.jsx)(H,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Vt,{children:[(0,Z.jsx)(D,{disabled:g.isPending,onClick:()=>F(!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}),F(!1),q.success(N?`Bundle copied to ${M}`:`Bundle moved to ${M}`)}catch(e){q.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?N?`Copying…`:`Moving…`:N?`Copy`:`Move`})]})]})})]})}function ea({release:e}){return(0,Z.jsxs)(K,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(R,{className:`size-3`}):(0,Z.jsx)(Ue,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}var ta={one:`unreachable bundle`,other:`unreachable bundles`},na=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],ra=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}];function ia({channels:e,onChange:t,onClear:n,onManageChannels:i,search:a}){let o=L(a),s=a.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(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)(Wn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(G,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(Le,{"aria-label":`Channel`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 sm:w-[140px] sm:data-[size=default]:h-8`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ve,{children:(0,Z.jsxs)(He,{children:[(0,Z.jsx)(H,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(H,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(G,{disabled:!s,items:na,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(Le,{"aria-label":`Platform`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:data-[size=default]:h-8`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ve,{children:(0,Z.jsxs)(He,{children:[(0,Z.jsx)(H,{value:`ios`,children:`iOS`}),(0,Z.jsx)(H,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(G,{disabled:!s&&a.scopeKey===void 0,items:ra,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(Le,{"aria-label":`Status`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-xs data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:data-[size=default]:h-8`,children:(0,Z.jsx)(W,{})}),(0,Z.jsx)(Ve,{children:(0,Z.jsxs)(He,{children:[(0,Z.jsx)(H,{value:`all`,children:`Any Status`}),(0,Z.jsx)(H,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(H,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(D,{"aria-label":`Manage channels`,className:`size-11 max-sm:order-1 sm:size-7`,onClick:i,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(qn,{})}),a.bundleId?(0,Z.jsxs)(K,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(K,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,o?(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:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(r,{"data-icon":`inline-start`}),`Clear`]}):null]})}function aa({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)(z,{}):(0,Z.jsx)(Ae,{})}):(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)(bn,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(ot,{className:`size-3.5`}),` Built-in bundle`]})]}),i?(0,Z.jsx)(K,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsx)(Un,{icon:Ue,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 oa({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=ln(i),o=sn(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(er,{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 sa(e,t){return{patchCounts:dn(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 ca=(e,t)=>t>=e.to&&(e.from===void 0||t<e.from);function la({fold:e,filter:t,channels:n,columns:r,isMobile:i,open:a,onOpenChange:o,render:s}){let c=rn(t,{...e.from===void 0?{}:{from:e.from},to:e.to},a),l=c.data?.pages.flatMap(e=>e.rows)??[],u=sa(l,n),d=i?void 0:r,f=c.isError?(0,Z.jsx)(Rn,{columns:d,label:`Unreachable bundles`,onRetry:()=>void c.refetch(),state:`error`}):c.isPending||c.isFetchingNextPage?(0,Z.jsx)(Rn,{columns:d,label:`Loading unreachable bundles`,state:`loading`}):c.hasNextPage?(0,Z.jsx)(Rn,{columns:d,label:`Unreachable bundles`,onMore:()=>void c.fetchNextPage(),state:`more`}):null,p={label:Bn(e,ta),open:a,onOpenChange:o,panelId:`bundle-fold-${e.to}`};return i?(0,Z.jsxs)(zn,{...p,children:[l.map(e=>s(e,u)),f]}):(0,Z.jsxs)(Vn,{...p,columns:r,children:[l.map(e=>s(e,u)),f]})}function ua(){let e=we.useSearch(),t=we.useNavigate(),n=O(),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(),s=Ln(),c=Se(e),l=$t({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:c,releaseId:e.releaseId}),u=on().data??[],d=l.data?.entries??[],f=d.flatMap(e=>e.kind===`row`?[e.row]:[]),p=sa(f,u),m=l.data?.next,h=l.data?.previous,g=Ce(),_=10+g.length,v=new Map(u.map(e=>[e.id,e.name])),y=a!==void 0&&(e=>f.some(t=>t.id===e)||d.some(t=>t.kind===`fold`&&s.isOpen(In(t))&&ca(t,e)))(a);(0,X.useEffect)(()=>{a!==void 0&&!y&&o(void 0)},[a,y]);let b=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),x=t=>b(xe(e,t)),S=t=>{f.some(({id:e})=>e===t.id)||s.set(t.id,!0),b({...e,releaseId:t.id},!1)},C=t=>{let n=f.find(e=>e.bundle_id===t.id);if(o(void 0),n){b({...e,releaseId:n.id},!1);return}x({bundleId:t.id})},w=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,ee=h?{...e,afterReleaseId:`after`in h?h.after:void 0,beforeReleaseId:`before`in h?h.before:void 0,releaseId:void 0}:null,T=m?{...e,afterReleaseId:void 0,beforeReleaseId:m,releaseId:void 0}:null,E={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0},te=(t,n)=>{let r=v.get(t.channel_id)??t.channel_id,i=t.bundle_id?n.patchCounts[t.bundle_id]:0,s=y&&a===t.id,c=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(Dn,{"aria-label":`Bundle ${t.id}`,className:j(`gap-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,s&&`border-b-0 bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:kn(()=>S(t)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(aa,{expanded:s,onOpen:()=>S(t),onToggleExpand:()=>o(s?void 0:t.id),release:t}),(0,Z.jsx)(Xe,{channel:r,className:`shrink-0`})]}),(0,Z.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-foreground`,children:[(0,Z.jsx)(zt,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]}),i===void 0||i>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(`span`,{children:i===void 0?`Checking patches`:`${i} ${i===1?`patch`:`patches`}`})]}):null,(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(Mn,{ms:t.created_at_ms})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-xs`,children:[(0,Z.jsx)(Ye,{percentage:t.rollout_cohort_count/10}),(0,Z.jsx)(ea,{release:t}),t.should_force_update?(0,Z.jsx)(K,{variant:`secondary`,children:`Force update`}):null,(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:`Target `}),(0,Z.jsx)(Ze,{appVersion:t.target_app_version,fingerprintHash:t.fingerprint_hash})]})]}),g.map(({Cell:e,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)(e,{releaseId:t.id,releases:n.slotReleases})]},r)),t.message?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.message}):null]}),s&&t.bundle_id?(0,Z.jsx)(oa,{onDetailClick:C,panelId:c,release:t}):null]},t.id)},ne=(t,n)=>{let r=y&&a===t.id,i=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(Cn,{"aria-label":`Open bundle ${t.id}`,className:j(t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,r&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onOpen:()=>S(t),children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(aa,{expanded:r,onOpen:()=>S(t),onToggleExpand:()=>o(r?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Xe,{channel:v.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsx)(Rt,{platform:t.platform})}),(0,Z.jsx)(Y,{children:t.bundle_id&&n.patchCounts[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&n.patchCounts[t.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[n.patchCounts[t.bundle_id],` `,n.patchCounts[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Ze,{appVersion:t.target_app_version,fingerprintHash:t.fingerprint_hash})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)($n,{enabled:t.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)($n,{enabled:t.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:t.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Ye,{percentage:t.rollout_cohort_count/10})}),g.map(({Cell:e,feature:r})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:n.slotReleases})},r)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(Mn,{ms:t.created_at_ms})})]}),r&&t.bundle_id?(0,Z.jsx)(vn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:_,children:(0,Z.jsx)(oa,{onDetailClick:C,panelId:i,release:t})})}):null]},t.id)},re=(e,t)=>(0,Z.jsx)(la,{channels:u,columns:_,filter:c,fold:e,isMobile:n,onOpenChange:t=>s.set(In(e),t),open:s.isOpen(In(e)),render:t},`fold-${e.to}`),ie=(0,Z.jsx)(jn,{icon:et,title:f.length===0&&d.length>0?`No device gets the bundles here`:w?`No more bundles`:L(e)?`No bundles match these filters`:`No bundles yet`,children:w?(0,Z.jsx)(F,{className:ae({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:E,to:`/`,children:`Show the newest bundles`}):L(e)?(0,Z.jsx)(D,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>b({}),variant:`outline`,children:`Clear filters`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:`Deploy one from your app's project:`}),(0,Z.jsx)(`div`,{className:`w-full text-left`,children:(0,Z.jsx)(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)(ia,{channels:u,onChange:x,onClear:()=>b({}),onManageChannels:()=>i(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[l.isError?(0,Z.jsxs)(pt,{variant:`destructive`,children:[(0,Z.jsx)(mt,{}),(0,Z.jsx)(dt,{children:`Bundles could not be loaded`}),(0,Z.jsx)(ft,{children:l.error.message})]}):(0,Z.jsx)(Sn,{children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:l.isPending?(0,Z.jsx)(An,{}):(0,Z.jsxs)(Z.Fragment,{children:[f.length===0?(0,Z.jsx)(Tn,{children:ie}):null,d.map(e=>e.kind===`row`?te(e.row,p):re(e,te))]})}):(0,Z.jsx)(xn,{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`}),g.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]}),children:l.isPending?(0,Z.jsx)(On,{children:(0,Z.jsx)(wn,{columns:_})}):(0,Z.jsxs)(Z.Fragment,{children:[f.length===0?(0,Z.jsx)(On,{children:(0,Z.jsx)(En,{columns:_,children:ie})}):null,Hn(d).map(e=>e.kind===`fold`?re(e.fold,ne):(0,Z.jsx)(On,{children:e.rows.map(e=>ne(e,p))},`rows-${e.rows[0].id}`))]})})}),!l.isError&&!l.isPending?(0,Z.jsx)(Nn,{count:f.length,label:`Bundle pagination`,pending:l.isPlaceholderData,newest:w?{search:E,to:`/`}:void 0,next:T?{search:T,to:`/`}:void 0,previous:ee?{search:ee,to:`/`}:void 0}):null]}),(0,Z.jsx)($i,{channels:u,onOpenChange:t=>!t&&b({...e,releaseId:void 0},!1),onShowScope:e=>x({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(tr,{onOpenChange:i,open:r})]})}export{ua as component};