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

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 (286) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{-native-builds-search-OlRj4Jz0.js → -native-builds-search-7blX2yQW.js} +1 -1
  3. package/.output/public/assets/BundleIdDisplay-B0gAH01c.js +1 -0
  4. package/.output/public/assets/CompositeItem-Dy4xgOMg.js +1 -0
  5. package/.output/public/assets/{ConsoleFeatureUnavailable-DUqlpHCp.js → ConsoleFeatureUnavailable-cy_snb33.js} +1 -1
  6. package/.output/public/assets/{EventDetails-DZsRlDHk.js → EventDetails-sxag8Hfc.js} +1 -1
  7. package/.output/public/assets/{HashValueDisplay-MoZMmTeP.js → HashValueDisplay-DMweha_0.js} +1 -1
  8. package/.output/public/assets/{InsightsPageHeader-2bTrjXln.js → InsightsPageHeader-D5TJspVe.js} +1 -1
  9. package/.output/public/assets/IosInstall-B5NspihF.js +1 -0
  10. package/.output/public/assets/NativeBuildsNav-CjOOlbEu.js +1 -0
  11. package/.output/public/assets/{NotFoundPage-Ckb5GMhh.js → NotFoundPage-DDOJarFa.js} +1 -1
  12. package/.output/public/assets/{PlatformIcon-CJ69KopR.js → PlatformIcon-BBvlg6JY.js} +1 -1
  13. package/.output/public/assets/RelativeTime-CY1dKZpv.js +1 -0
  14. package/.output/public/assets/{RolloutPercentageBadge-G6qt8rVb.js → RolloutPercentageBadge-BHgHkBGB.js} +1 -1
  15. package/.output/public/assets/RowReason-BMx_vclu.js +1 -0
  16. package/.output/public/assets/SandboxBadge-irEkMf1P.js +1 -0
  17. package/.output/public/assets/TargetDisplay-DB8D019f.js +1 -0
  18. package/.output/public/assets/{alert-dialog-DiRLrFVe.js → alert-dialog-CLC_h1fL.js} +1 -1
  19. package/.output/public/assets/api-DLryz9hA.js +1 -0
  20. package/.output/public/assets/api-keys-Cd-aNt-v.js +1 -0
  21. package/.output/public/assets/api-keys-D3tAc4Uu.js +1 -0
  22. package/.output/public/assets/arrow-left-DQjHJAnT.js +1 -0
  23. package/.output/public/assets/arrow-right-CXp_K3xK.js +1 -0
  24. package/.output/public/assets/arrow-up-right-BFafIOrq.js +1 -0
  25. package/.output/public/assets/{badge-D0NFvUY5.js → badge-DJMW4YVM.js} +1 -1
  26. package/.output/public/assets/card-C4sBAMU-.js +1 -0
  27. package/.output/public/assets/check-CqWNyG93.js +1 -0
  28. package/.output/public/assets/chevron-right-DNbYTBX1.js +1 -0
  29. package/.output/public/assets/{circle-off-C7Muo0ss.js → circle-off-BCkZpskJ.js} +1 -1
  30. package/.output/public/assets/{clipboard-DQbOcrL7.js → clipboard-DZrZK5gR.js} +1 -1
  31. package/.output/public/assets/{console-features-api-DEXSwFtc.js → console-features-api-BO5V64P3.js} +1 -1
  32. package/.output/public/assets/{copy-DsuLj3oj.js → copy-CH1__JAW.js} +1 -1
  33. package/.output/public/assets/dialog-tCTZmAo8.js +1 -0
  34. package/.output/public/assets/{dist-Bf1BPKMs.js → dist-Bw_uSBJn.js} +1 -1
  35. package/.output/public/assets/empty-DsbLxQ1w.js +1 -0
  36. package/.output/public/assets/field-DL4OXTJ7.js +1 -0
  37. package/.output/public/assets/git-branch-ByZMEBxZ.js +1 -0
  38. package/.output/public/assets/history-wYnPoVmT.js +1 -0
  39. package/.output/public/assets/index-CAnjb7M2.js +10 -0
  40. package/.output/public/assets/{input-group-D_NfhUbX.js → input-group-B7jx0icS.js} +1 -1
  41. package/.output/public/assets/insights-DIs4nJI9.js +2 -0
  42. package/.output/public/assets/insights-DTF7C4jb.js +42 -0
  43. package/.output/public/assets/insights-api-B6Gj74n5.js +1 -0
  44. package/.output/public/assets/insights-bUk3ChoU.js +1 -0
  45. package/.output/public/assets/{insights-search-CYPrQVUC.js → insights-search-TfRz5kGG.js} +1 -1
  46. package/.output/public/assets/insights-usage-rpc-B4V-Qqo4.js +1 -0
  47. package/.output/public/assets/insights_.distribution-BPl5oRt4.js +2 -0
  48. package/.output/public/assets/{insights_.distribution-_dZi1_ay.js → insights_.distribution-BqfzAuAf.js} +1 -1
  49. package/.output/public/assets/insights_.distribution-BqtmnGTt.js +1 -0
  50. package/.output/public/assets/installations-6U8c_03X.js +1 -0
  51. package/.output/public/assets/{installations-Y_7QW_p8.js → installations-BU65zztK.js} +1 -1
  52. package/.output/public/assets/installations-D3MbzcFb.js +2 -0
  53. package/.output/public/assets/{key-round-DzBe6DHr.js → key-round-B-P_hhUB.js} +1 -1
  54. package/.output/public/assets/{link-DTEyW70e.js → link-CN3iHC4A.js} +2 -2
  55. package/.output/public/assets/{list-B6GeoQ_b.js → list-fFsS8Wxe.js} +1 -1
  56. package/.output/public/assets/loader-circle-GWIgH0fo.js +1 -0
  57. package/.output/public/assets/native-builds-BdzfAFnF.js +1 -0
  58. package/.output/public/assets/native-builds-CWwvuOXr.js +2 -0
  59. package/.output/public/assets/native-builds-Eh72Vr2G.js +1 -0
  60. package/.output/public/assets/native-builds_._buildId-33ksAlnZ.js +1 -0
  61. package/.output/public/assets/native-builds_._buildId-BVA5GnZP.js +2 -0
  62. package/.output/public/assets/native-builds_.devices-CElovmwq.js +1 -0
  63. package/.output/public/assets/native-builds_.devices-DWtcOVYO.js +2 -0
  64. package/.output/public/assets/{package-ytYrywZH.js → package-CXSDZsME.js} +1 -1
  65. package/.output/public/assets/plus-Cx-yFNd9.js +1 -0
  66. package/.output/public/assets/preload-helper-CRQjUQaZ.js +1 -0
  67. package/.output/public/assets/{refresh-cw-C-tvoCcE.js → refresh-cw-BgiOaFX3.js} +1 -1
  68. package/.output/public/assets/{relativeTime-DvyxGIsm.js → relativeTime-CBmDq8wh.js} +1 -1
  69. package/.output/public/assets/remote-config-B3oq9qR0.js +1 -0
  70. package/.output/public/assets/remote-config-CGbqsPh_.js +6 -0
  71. package/.output/public/assets/remote-config-D1OkfQKt.js +1 -0
  72. package/.output/public/assets/{rotate-cw-Clk5xTeE.js → rotate-cw-C1v7YuN7.js} +1 -1
  73. package/.output/public/assets/{routes-gQXSzO_n.js → routes-BTG3rg0l.js} +2 -2
  74. package/.output/public/assets/routes-CVbPjRKo.js +1 -0
  75. package/.output/public/assets/search-DiOSjaYL.js +1 -0
  76. package/.output/public/assets/select-CA8r-UUe.js +1 -0
  77. package/.output/public/assets/send-BgXZNiEA.js +1 -0
  78. package/.output/public/assets/{sidebar-Di9SN47G.js → sidebar-yC7KdImc.js} +1 -1
  79. package/.output/public/assets/smartphone-CxP0GGT6.js +1 -0
  80. package/.output/public/assets/styles-B0kzy3kp.css +2 -0
  81. package/.output/public/assets/switch-BTHWmKQ5.js +1 -0
  82. package/.output/public/assets/table-CwF7yxj4.js +1 -0
  83. package/.output/public/assets/tabs-CHNnCyvw.js +1 -0
  84. package/.output/public/assets/trash-2-CYISg7ZF.js +1 -0
  85. package/.output/public/assets/{undo-2-Bt0YXG26.js → undo-2-Bod3vw7x.js} +1 -1
  86. package/.output/public/assets/{useCompositeListItem-JmyDfo3-.js → useCompositeListItem-lAmUsXcc.js} +1 -1
  87. package/.output/public/assets/{useMutation-DbYw7boA.js → useMutation-w3qYaU2L.js} +1 -1
  88. package/.output/server/{__23tanstack-start-server-fn-resolver-z8rr63xV.mjs → __23tanstack-start-server-fn-resolver-BFiPs5uv.mjs} +85 -49
  89. package/.output/server/_libs/@base-ui/react+[...].mjs +1488 -183
  90. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  91. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
  92. package/.output/server/_libs/_.mjs +1 -1
  93. package/.output/server/_libs/lucide-react.mjs +22 -2
  94. package/.output/server/_libs/next-themes.mjs +1 -1
  95. package/.output/server/_libs/react-redux+[...].mjs +1 -1
  96. package/.output/server/_libs/recharts+[...].mjs +1 -1
  97. package/.output/server/_libs/sonner.mjs +1 -1
  98. package/.output/server/_libs/tanstack__react-query.mjs +1 -1
  99. package/.output/server/_ssr/{-native-builds-search-M6t7EIt4.mjs → -native-builds-search-Mm_AZoRU.mjs} +8 -2
  100. package/.output/server/_ssr/{BundleIdDisplay-DRnAzJse.mjs → BundleIdDisplay-BSBR5eJ3.mjs} +3 -3
  101. package/.output/server/_ssr/{ConsoleFeatureUnavailable-BEU7r4aH.mjs → ConsoleFeatureUnavailable-DcZ4JBVq.mjs} +8 -8
  102. package/.output/server/_ssr/CopyableText-DgNEsByt.mjs +33 -0
  103. package/.output/server/_ssr/{EventDetails-CjT6o2sJ.mjs → EventDetails-CUHZuwei.mjs} +9 -9
  104. package/.output/server/_ssr/{HashValueDisplay-Bkim8r3-.mjs → HashValueDisplay-B9ORaCcP.mjs} +3 -3
  105. package/.output/server/_ssr/{InsightsPageHeader-Ctw4N3SZ.mjs → InsightsPageHeader-C0bJqC-n.mjs} +9 -9
  106. package/.output/server/_ssr/IosInstall-C5Y5gnDY.mjs +574 -0
  107. package/.output/server/_ssr/NativeBuildsNav-hFiyBaFW.mjs +38 -0
  108. package/.output/server/_ssr/{NotFoundPage-Bh3gFsR6.mjs → NotFoundPage-D4xRjmIA.mjs} +3 -3
  109. package/.output/server/_ssr/{PlatformIcon-CMLs3Wez.mjs → PlatformIcon-BpGOEXjU.mjs} +2 -2
  110. package/.output/server/_ssr/{RelativeTime-DjdCU0J7.mjs → RelativeTime-DnvxB666.mjs} +20 -9
  111. package/.output/server/_ssr/{RolloutPercentageBadge-BiIHw-V2.mjs → RolloutPercentageBadge-NBnIOzY9.mjs} +4 -4
  112. package/.output/server/_ssr/RowReason-B_jZN48d.mjs +169 -0
  113. package/.output/server/_ssr/{StoreSubmission-Cv59joPo.mjs → SandboxBadge-CFtTG1ZJ.mjs} +17 -17
  114. package/.output/server/_ssr/{TargetDisplay-D1PKOupt.mjs → TargetDisplay-0sb03v_6.mjs} +7 -33
  115. package/.output/server/_ssr/{alert-dialog-BOKQTpmP.mjs → alert-dialog-SLr1Q_AI.mjs} +2 -2
  116. package/.output/server/_ssr/{api-CDvGGB1B.mjs → api-CkgOQzSb.mjs} +74 -17
  117. package/.output/server/_ssr/{api-keys-DvbSgd9L.mjs → api-keys-BP7NJtoX.mjs} +2 -2
  118. package/.output/server/_ssr/{api-keys-NYJ0VaDB.mjs → api-keys-BcSzq0TA.mjs} +11 -11
  119. package/.output/server/_ssr/{api-keys-rpc-B0MrcD15.mjs → api-keys-rpc-IWPOq5vn.mjs} +3 -3
  120. package/.output/server/_ssr/{api-rpc-CIB9gcI7.mjs → api-rpc-cNJTB3v4.mjs} +48 -32
  121. package/.output/server/_ssr/{auth-rpc-DsIffEXe.mjs → auth-rpc-oaBbtxSP.mjs} +4 -4
  122. package/.output/server/_ssr/{auth.server-Dt9XHLs_.mjs → auth.server-WQw9JjMm.mjs} +587 -19
  123. package/.output/server/_ssr/{badge-KS3YftV5.mjs → badge-n3c0OTBQ.mjs} +2 -2
  124. package/.output/server/_ssr/{bundleActivity-BGVvqWx7.mjs → bundleActivity-BP40zYSt.mjs} +1 -1
  125. package/.output/server/_ssr/{card-CG5GqIoA.mjs → card-CYgCcRUd.mjs} +2 -2
  126. package/.output/server/_ssr/{config.server-CJs-9Zd_.mjs → config.server-R3KQbcML.mjs} +4 -4
  127. package/.output/server/_ssr/{console-access-ClmTMpo_.mjs → console-access-BLVi82IN.mjs} +2 -2
  128. package/.output/server/_ssr/{console-features-api-CpMYF0Pb.mjs → console-features-api-B2JvJOlE.mjs} +4 -4
  129. package/.output/server/_ssr/{console-features-rpc-D-dr-WF8.mjs → console-features-rpc-LAxQoSNw.mjs} +3 -3
  130. package/.output/server/_ssr/{console-features-CRP-pfov.mjs → console-features-xaGDhRC9.mjs} +1 -1
  131. package/.output/server/_ssr/deviceProfileToken-CwWb1lPq.mjs +82 -0
  132. package/.output/server/_ssr/{dialog-DvHMJkq7.mjs → dialog-eru_h5oK.mjs} +2 -2
  133. package/.output/server/_ssr/{downloadBundle-BX8ODCZT.mjs → downloadBundle-DnoYpi36.mjs} +1 -1
  134. package/.output/server/_ssr/{empty-Bx8DnyWN.mjs → empty-Bu4qodCx.mjs} +3 -3
  135. package/.output/server/_ssr/{failureReports-C_CmBF4x.mjs → failureReports-BA2eg11O.mjs} +3 -3
  136. package/.output/server/_ssr/{field-BVI4lxoz.mjs → field-DA5lwO5U.mjs} +3 -3
  137. package/.output/server/_ssr/foldedPage-CqpVk31Q.mjs +176 -0
  138. package/.output/server/_ssr/{getBundleChildren-BJTufthT.mjs → getBundleChildren-CdqFonhl.mjs} +1 -1
  139. package/.output/server/_ssr/{input-group-CpJwooTk.mjs → input-group-VV5E3q78.mjs} +2 -2
  140. package/.output/server/_ssr/{insights-b1hq1O0p.mjs → insights-BJIt1xuT.mjs} +2 -2
  141. package/.output/server/_ssr/{insights-B-VtObqr.mjs → insights-C23mopzv.mjs} +5 -5
  142. package/.output/server/_ssr/{insights-DxlHHXPK.mjs → insights-Ci82qdkq.mjs} +27 -27
  143. package/.output/server/_ssr/{insights-api-8PWQ7PiR.mjs → insights-api-BwXMKUSe.mjs} +5 -5
  144. package/.output/server/_ssr/{insights-errors-Bz3sWNZm.mjs → insights-errors-CXHg1lLV.mjs} +2 -2
  145. package/.output/server/_ssr/{insights-failures-DNQ9qVVf.mjs → insights-failures-7zH97WOO.mjs} +2 -2
  146. package/.output/server/_ssr/{insights-failures-rpc-pY2KV9HI.mjs → insights-failures-rpc-BuZ-jnby.mjs} +10 -10
  147. package/.output/server/_ssr/{insights-recovery-DOkpqnQ8.mjs → insights-recovery-BhOg6kz2.mjs} +1 -1
  148. package/.output/server/_ssr/{insights-recovery-rpc-CejmWL_y.mjs → insights-recovery-rpc-DrXSy9aA.mjs} +6 -6
  149. package/.output/server/_ssr/{insights-rpc-D_7d_AAJ.mjs → insights-rpc-DyrIZg3a.mjs} +3 -3
  150. package/.output/server/_ssr/{insights-search-CoMkZvRt.mjs → insights-search-CNkNB-aa.mjs} +3 -3
  151. package/.output/server/_ssr/{insights-usage-4KDIN3Kg.mjs → insights-usage-h8fipPTv.mjs} +1 -1
  152. package/.output/server/_ssr/{insights-usage-rpc-CrGZDHzO.mjs → insights-usage-rpc-C7UC1lom.mjs} +6 -6
  153. package/.output/server/_ssr/{insights-usage-rpc-B1XSuara.mjs → insights-usage-rpc-cTgmD-Ej.mjs} +5 -5
  154. package/.output/server/_ssr/{insightsUsage-DmQdJZqT.mjs → insightsUsage-BjSiV_X_.mjs} +3 -3
  155. package/.output/server/_ssr/{insights_.distribution-EOOOOTb6.mjs → insights_.distribution-BauOpBTE.mjs} +2 -2
  156. package/.output/server/_ssr/{insights_.distribution-CpqnDZNG.mjs → insights_.distribution-CIY_IGmh.mjs} +16 -16
  157. package/.output/server/_ssr/{insights_.distribution-B9sPDvG4.mjs → insights_.distribution-wfFKEv-Z.mjs} +5 -5
  158. package/.output/server/_ssr/{installations-BOI_y7Ma.mjs → installations-Ba3YVrAf.mjs} +13 -13
  159. package/.output/server/_ssr/{installations-dWlOOS7Y.mjs → installations-VzacOKHp.mjs} +2 -2
  160. package/.output/server/_ssr/{installations-D0_0hzdi.mjs → installations-jGW7nvEV.mjs} +4 -4
  161. package/.output/server/_ssr/ios-devices-rpc-Bhn7VVIh.mjs +138 -0
  162. package/.output/server/_ssr/iosDeviceProfile-_XT8TpgZ.mjs +176 -0
  163. package/.output/server/_ssr/iosDevices-Bc27J72d.mjs +129 -0
  164. package/.output/server/_ssr/listReleases-DYYA5alS.mjs +94 -0
  165. package/.output/server/_ssr/{native-builds-OUdRtp6m.mjs → native-builds-BXBkklfA.mjs} +28 -6
  166. package/.output/server/_ssr/{native-builds-Bx_az6YZ.mjs → native-builds-DZFJGcHy.mjs} +3 -3
  167. package/.output/server/_ssr/{native-builds-C721Rw23.mjs → native-builds-DiNkKHly.mjs} +221 -86
  168. package/.output/server/_ssr/{native-builds_._buildId-ubi48Sfs.mjs → native-builds_._buildId-CuM1PsT6.mjs} +108 -294
  169. package/.output/server/_ssr/{native-builds_._buildId-YItxv8j9.mjs → native-builds_._buildId-D0n4QZY6.mjs} +3 -3
  170. package/.output/server/_ssr/native-builds_.devices-D0JJlX8E.mjs +689 -0
  171. package/.output/server/_ssr/native-builds_.devices-DiM2FdcW.mjs +10 -0
  172. package/.output/server/_ssr/{nativeBuildDownloadLink-C0I8eLpS.mjs → nativeBuildDownloadLink-CvvWuhh0.mjs} +3 -3
  173. package/.output/server/_ssr/{nativeBuildInstall-CxG8K8TL.mjs → nativeBuildInstall-BqcVHBaD.mjs} +54 -7
  174. package/.output/server/_ssr/{nativeBuilds-CRLmvFaO.mjs → nativeBuilds-Cub0EUGN.mjs} +135 -13
  175. package/.output/server/_ssr/{publicConsoleBase-DvHYxDaG.mjs → publicConsoleBase-f67NLLXZ.mjs} +11 -3
  176. package/.output/server/_ssr/{release-adoption-C7sUFDwa.mjs → release-adoption-DeICczY7.mjs} +2 -2
  177. package/.output/server/_ssr/{release-adoption-rpc-DcZAYRWJ.mjs → release-adoption-rpc-Dm-5yAJG.mjs} +8 -8
  178. package/.output/server/_ssr/{releaseAdoption-D6ScSu-W.mjs → releaseAdoption-kHZo8P90.mjs} +3 -3
  179. package/.output/server/_ssr/{remote-config-gKqDKMxk.mjs → remote-config-D1BhIBKu.mjs} +3 -3
  180. package/.output/server/_ssr/{remote-config-DOcSXzxG.mjs → remote-config-D7RruPiO.mjs} +2 -2
  181. package/.output/server/_ssr/{remote-config-BZ_vGV97.mjs → remote-config-ZFm-l4Gi.mjs} +20 -20
  182. package/.output/server/_ssr/{remote-config-rpc-CVPd3V69.mjs → remote-config-rpc-C7AZy37o.mjs} +3 -3
  183. package/.output/server/_ssr/{router-Bcyej4cr.mjs → router-BGkGFMsT.mjs} +72 -75
  184. package/.output/server/_ssr/{routes-B10xsCh4.mjs → routes-CJJxz-Ak.mjs} +304 -230
  185. package/.output/server/_ssr/{routes-ddBRVSju.mjs → routes-CiJ2dhL9.mjs} +14 -13
  186. package/.output/server/_ssr/{runtime.server-wcHT2Cop.mjs → runtime.server-CkSbWaZm.mjs} +2 -2
  187. package/.output/server/_ssr/{schema-migration-rpc-iWZzLv70.mjs → schema-migration-rpc-D4YlwvGH.mjs} +3 -3
  188. package/.output/server/_ssr/{select-i4WT0c9r.mjs → select-BB8GE7OZ.mjs} +3 -3
  189. package/.output/server/_ssr/{server-CMgMPrDx.mjs → server-DAHTchcr.mjs} +5 -5
  190. package/.output/server/_ssr/{sidebar-mIQgB0iy.mjs → sidebar-CsKVgZHa.mjs} +3 -3
  191. package/.output/server/_ssr/ssr.mjs +1 -1
  192. package/.output/server/_ssr/{start-By4wHYjG.mjs → start-D3noqqOK.mjs} +1 -1
  193. package/.output/server/_ssr/{switch-DR8EAh5C.mjs → switch-BvvmP7Y3.mjs} +3 -3
  194. package/.output/server/_ssr/{table-DXmK6G7A.mjs → table-WKKzprFn.mjs} +2 -2
  195. package/.output/server/_ssr/{tabs-DAfypcYe.mjs → tabs-BJ-4SgmC.mjs} +4 -4
  196. package/.output/server/_ssr/{updateFailures-DNiv3S_y.mjs → updateFailures-D0bP_Ume.mjs} +3 -3
  197. package/.output/server/_tanstack-start-manifest_v-CSUJeG5D.mjs +219 -0
  198. package/.output/server/index.mjs +436 -366
  199. package/lib/index.d.mts +9 -0
  200. package/package.json +7 -30
  201. package/src/components/DataTable.tsx +21 -2
  202. package/src/components/FoldedRows.tsx +201 -0
  203. package/src/components/RowReason.tsx +56 -0
  204. package/src/components/features/native-builds/InstallCard.tsx +1 -1
  205. package/src/components/features/native-builds/IosDevicesPage.tsx +892 -0
  206. package/src/components/features/native-builds/IosInstall.tsx +292 -62
  207. package/src/components/features/native-builds/IpaDevicesCard.tsx +107 -0
  208. package/src/components/features/native-builds/NativeBuildDetailPage.tsx +7 -0
  209. package/src/components/features/native-builds/NativeBuildsNav.tsx +44 -0
  210. package/src/components/features/native-builds/NativeBuildsPage.tsx +2 -0
  211. package/src/components/features/native-builds/NativeBuildsTable.tsx +214 -30
  212. package/src/components/features/native-builds/OlderBuildLabel.tsx +61 -0
  213. package/src/index.ts +9 -0
  214. package/src/lib/api-rpc.ts +56 -29
  215. package/src/lib/api.ts +65 -2
  216. package/src/lib/ios-devices-api.ts +110 -0
  217. package/src/lib/ios-devices-rpc.ts +174 -0
  218. package/src/lib/native-builds.ts +72 -7
  219. package/src/lib/server/console-runtime.server.ts +9 -2
  220. package/src/lib/server/deviceProfileToken.ts +187 -0
  221. package/src/lib/server/foldedPage.ts +360 -0
  222. package/src/lib/server/iosDeviceProfile.ts +230 -0
  223. package/src/lib/server/iosDevices.ts +223 -0
  224. package/src/lib/server/listReleases.ts +101 -62
  225. package/src/lib/server/nativeBuildInstall.ts +138 -7
  226. package/src/lib/server/nativeBuilds.ts +221 -26
  227. package/src/routeTree.gen.ts +64 -67
  228. package/src/routes/-native-builds-search.ts +20 -0
  229. package/src/routes/[_]hot-updater/devices/device-response.ts +21 -0
  230. package/src/routes/[_]hot-updater/devices/device[.]mobileconfig.ts +17 -0
  231. package/src/routes/index.tsx +444 -299
  232. package/src/routes/native-builds_.devices.tsx +21 -0
  233. package/.output/public/assets/BundleIdDisplay-CP6rsdFO.js +0 -1
  234. package/.output/public/assets/RelativeTime-TCmpOVPg.js +0 -1
  235. package/.output/public/assets/StoreSubmission-CqSg880n.js +0 -1
  236. package/.output/public/assets/TargetDisplay-DwOaMOiI.js +0 -1
  237. package/.output/public/assets/api-LQJH44FU.js +0 -1
  238. package/.output/public/assets/api-keys-4w2-ofii.js +0 -1
  239. package/.output/public/assets/api-keys-uFY8FsN9.js +0 -1
  240. package/.output/public/assets/arrow-left-g9cKqXuC.js +0 -1
  241. package/.output/public/assets/arrow-right-CNII8TYn.js +0 -1
  242. package/.output/public/assets/arrow-up-right-DK8Zdg40.js +0 -1
  243. package/.output/public/assets/card-ulgg5xHn.js +0 -1
  244. package/.output/public/assets/check-CXVR3s3X.js +0 -1
  245. package/.output/public/assets/chevron-right-BoUXo82O.js +0 -1
  246. package/.output/public/assets/dialog-CLIaC82_.js +0 -1
  247. package/.output/public/assets/empty-Bhlj8PEo.js +0 -1
  248. package/.output/public/assets/field-q4sTYzNU.js +0 -1
  249. package/.output/public/assets/history-DakJoeSM.js +0 -1
  250. package/.output/public/assets/index-CJclLsbG.js +0 -10
  251. package/.output/public/assets/insights-0TUItqwh.js +0 -1
  252. package/.output/public/assets/insights-B75txQ_F.js +0 -42
  253. package/.output/public/assets/insights-C17Z0whn.js +0 -2
  254. package/.output/public/assets/insights-api-BVCXJsoV.js +0 -1
  255. package/.output/public/assets/insights-usage-rpc-BbFllvi_.js +0 -1
  256. package/.output/public/assets/insights_.distribution-AZcfvK7x.js +0 -1
  257. package/.output/public/assets/insights_.distribution-gDqNqI5E.js +0 -2
  258. package/.output/public/assets/installations-Ap2G2tDs.js +0 -1
  259. package/.output/public/assets/installations-D0g3xvw8.js +0 -2
  260. package/.output/public/assets/native-builds-Ba6cEZfm.js +0 -2
  261. package/.output/public/assets/native-builds-C3_-21we.js +0 -1
  262. package/.output/public/assets/native-builds_._buildId-BnP31v32.js +0 -1
  263. package/.output/public/assets/native-builds_._buildId-Cp9LJiMP.js +0 -2
  264. package/.output/public/assets/plus-BVhOauU3.js +0 -1
  265. package/.output/public/assets/preload-helper-B44EvKhG.js +0 -1
  266. package/.output/public/assets/remote-config-BRdy8QFR.js +0 -1
  267. package/.output/public/assets/remote-config-C9p5Pcdj.js +0 -6
  268. package/.output/public/assets/remote-config-CIAEArwq.js +0 -1
  269. package/.output/public/assets/routes-BLTF7nwe.js +0 -1
  270. package/.output/public/assets/search-nnvSOTEB.js +0 -1
  271. package/.output/public/assets/select-CBIU0_M1.js +0 -1
  272. package/.output/public/assets/smartphone-r0rRdPas.js +0 -1
  273. package/.output/public/assets/styles-BdlrKlVs.css +0 -2
  274. package/.output/public/assets/switch-CP6GsHmN.js +0 -1
  275. package/.output/public/assets/table-TUtVz-2l.js +0 -1
  276. package/.output/public/assets/tabs-CP3CSmtI.js +0 -1
  277. package/.output/public/assets/useInfiniteQuery-DX4WpBRG.js +0 -1
  278. package/.output/server/_ssr/listReleases-CQEceg8j.mjs +0 -79
  279. package/.output/server/_ssr/nativeBuildDevice-DJUAzAIj.mjs +0 -210
  280. package/.output/server/_tanstack-start-manifest_v-8M7ggCuB.mjs +0 -192
  281. package/src/lib/server/nativeBuildDevice.ts +0 -253
  282. package/src/routes/[_]hot-updater/native-builds/$buildId/device-response.ts +0 -17
  283. package/src/routes/[_]hot-updater/native-builds/$buildId/device.ts +0 -17
  284. package/src/routes/[_]hot-updater/native-builds/$buildId/device[.]mobileconfig.ts +0 -17
  285. /package/.output/public/assets/{uuidv7-cI6C63Fm.js → uuidv7-CVJ09bBG.js} +0 -0
  286. /package/.output/public/assets/{valueToPercent-B6X9rUJM.js → valueToPercent-Db73Kirz.js} +0 -0
@@ -0,0 +1 @@
1
+ import{$ as e,$n as t,Ar as n,Br as r,Cn as i,Di as a,Ei as o,F as s,Fr as c,H as l,I as u,Ir as d,L as f,Ln as p,M as m,Mr as h,Nn as g,On as _,P as v,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};
@@ -0,0 +1 @@
1
+ import{Vr as e}from"./sidebar-yC7KdImc.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{$n as e,$t as t,A as n,An as r,Ar as i,Bn as a,Bt as o,C as s,Cr as c,Di as l,Er as u,Fr as d,Ht as f,In as p,Ir as m,It as h,Jn as g,Kt as _,L as v,Lr as y,Lt as b,Mr as x,Mt as S,Nr as C,Nt as ee,O as w,Qn as T,Ri as E,Rn as D,Rt as O,Sn as k,Sr as te,Tr as A,Vi as j,Vr as M,Vt as N,Xt as ne,Yn as re,Yt as P,Zn as F,_n as ie,an as ae,ar as oe,bn as se,bt as I,cn as ce,ct as le,dn as L,dr as R,dt as z,er as B,fn as V,fr as H,ft as U,gn as ue,ht as W,in as G,ir as K,jr as q,kr as de,kt as fe,ln as J,lt as pe,mn as me,mt as he,nr as ge,on as _e,or as ve,ot as ye,pn as be,pr as xe,pt as Se,qn as Ce,qt as we,rr as Te,sn as Ee,st as De,tr as Oe,un as ke,vn as Ae,vr as je,w as Me,wn as Ne,wr as Y,wt as Pe,xn as Fe,xr as X,yn as Ie,zt as Le}from"./sidebar-yC7KdImc.js";import{t as Re}from"./check-CqWNyG93.js";import{a as ze,i as Be,n as Ve,r as He,t as Ue}from"./useCompositeListItem-lAmUsXcc.js";var We=M(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Z=j(E()),Ge=`Escape`;function Ke(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function qe(e,t){return Ke(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Je(e,t,n){return Ke(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ye(e,t,n){return Ke(t,n?e===Oe:e===ge,e===B)}function Xe(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Ge:Ke(t,n?e===ge:e===Oe,e===Te)}function Ze(n,i){let{listRef:a,activeIndex:o,onNavigate:s=()=>{},enabled:c=!0,selectedIndex:l=null,allowEscape:u=!1,loopFocus:d=!1,nested:f=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:h=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:C=`vertical`,parentOrientation:ee,cols:w=1,id:E,resetOnPointerLeave:O=!0,externalTree:te}=i,A=`rootStore`in n?n.rootStore:n,j=A.useState(`open`),M=A.useState(`floatingElement`),N=A.useState(`domReferenceElement`),ne=A.context.dataRef,P=g(M),ie=re(N),I=se(P),le=_(),L=we(te),R=Z.useRef(h),z=Z.useRef(l??-1),B=Z.useRef(null),H=Z.useRef(!0),U=x(e=>{s(z.current===-1?null:z.current,e)}),ue=Z.useRef(U),W=Z.useRef(!!M),de=Z.useRef(j),fe=Z.useRef(!1),pe=Z.useRef(!1),me=Z.useRef(null),he=se(S),ge=se(j),ye=se(l),xe=se(O),Se=Ie(),Ce=Ie(),Te=x(()=>{function e(e){m?L?.events.emit(`virtualfocus`,e):me.current=t(e,{sync:fe.current,preventScroll:!0})}let n=a.current[z.current],r=pe.current;n&&e(n),(fe.current?e=>e():e=>Se.request(e))(()=>{let t=a.current[z.current]||n;t&&(n||e(t),Y&&(r||!H.current)&&t.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{ne.current.orientation=C},[ne,C]),q(()=>{c&&(j&&M?(z.current=l??-1,R.current&&l!=null&&(pe.current=!0,U())):W.current&&(z.current=-1,ue.current()))},[c,j,M,l,U]),q(()=>{if(c){if(!j){fe.current=!1;return}if(M)if(o==null){if(fe.current=!1,ye.current!=null)return;if(W.current&&(z.current=-1,Te()),(!de.current||!W.current)&&R.current&&(B.current!=null||R.current===!0&&B.current==null)){let e=0,t=()=>{a.current[0]==null?(e<2&&(e?e=>Ce.request(e):queueMicrotask)(t),e+=1):(z.current=B.current==null||Je(B.current,C,p)||f?ke(a):J(a),B.current=null,U())};t()}}else V(a.current,o)||(z.current=o,Te(),pe.current=!1)}},[c,j,M,o,ye,f,a,C,p,U,Te,Ce]),q(()=>{if(!c||M||!L||m||!W.current)return;let e=L.nodesRef.current,t=e.find(e=>e.id===le)?.context?.elements.floating,n=F(Ae(M)),r=e.some(e=>e.context&&T(e.context.elements.floating,n));t&&!r&&H.current&&t.focus({preventScroll:!0})},[c,M,L,le,m]),q(()=>{ue.current=U,de.current=j,W.current=!!M}),q(()=>{j||(B.current=null,R.current=h)},[j,h]);let De=o!=null,Oe=x(e=>{if(!ge.current)return;let t=a.current.indexOf(e.currentTarget);t!==-1&&(z.current!==t||o!==t)&&(z.current=t,U(e))}),je=x(()=>ee??L?.nodesRef.current.find(e=>e.id===le)?.context?.dataRef?.current.orientation),Me=x(()=>ke(a,he.current)),Ne=x(e=>{if(H.current=!1,fe.current=!0,e.which===229||!ge.current&&e.currentTarget===I.current)return;if(f&&Xe(e.key,C,p,w)){qe(e.key,je())||ve(e),A.setOpen(!1,k(D,e.nativeEvent)),y(N)&&(m?L?.events.emit(`virtualfocus`,N):N.focus());return}let t=z.current,n=ke(a,S),r=J(a,S);if(ie||(e.key===`Home`&&(ve(e),z.current=n,U(e)),e.key===`End`&&(ve(e),z.current=r,U(e))),w>1){let t=Array.from({length:a.current.length},()=>({width:1,height:1})),i=G(t,w,!1),o=i.findIndex(e=>e!=null&&!be(a.current,e,S)),s=i.reduce((e,t,n)=>t!=null&&!be(a.current,t,S)?n:e,-1),c=i[ce(i.map(e=>e==null?null:a.current[e]),{event:e,orientation:C,loopFocus:d,rtl:p,cols:w,disabledIndices:Ee([...(typeof S==`function`?null:S)||a.current.map((e,t)=>be(a.current,t,S)?t:void 0),void 0],i),minIndex:o,maxIndex:s,prevIndex:_e(z.current>r?n:z.current,t,i,w,e.key===`ArrowDown`?`bl`:e.key===(p?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(z.current=c,U(e)),C===`both`)return}if(qe(e.key,C)){if(ve(e),j&&!m&&F(e.currentTarget.ownerDocument)===e.currentTarget){z.current=Je(e.key,C,p)?n:r,U(e);return}Je(e.key,C,p)?d?t>=r?u&&t!==a.current.length?z.current=-1:(fe.current=!1,z.current=n):z.current=ae(a.current,{startingIndex:t,disabledIndices:S}):z.current=Math.min(r,ae(a.current,{startingIndex:t,disabledIndices:S})):d?t<=n?u&&t!==-1?z.current=a.current.length:(fe.current=!1,z.current=r):z.current=ae(a.current,{startingIndex:t,decrement:!0,disabledIndices:S}):z.current=Math.max(n,ae(a.current,{startingIndex:t,decrement:!0,disabledIndices:S})),V(a.current,z.current)&&(z.current=-1),U(e)}}),Y=Z.useMemo(()=>({onFocus(e){fe.current=!0,Oe(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){fe.current=!0,pe.current=!1,v&&Oe(e)},onPointerLeave(e){if(!ge.current||!H.current||e.pointerType===`touch`)return;fe.current=!0;let t=e.relatedTarget;if(!(!v||a.current.includes(t))&&xe.current&&(me.current?.(),me.current=null,z.current=-1,U(e),!m)){let e=I.current,t=F(Ae(e));e&&T(e,t)&&e.focus({preventScroll:!0})}}}),[Oe,ge,I,v,a,U,xe,m]),Pe=Z.useMemo(()=>m&&j&&De&&{"aria-activedescendant":`${E}-${o}`},[m,j,De,E,o]),Fe=Z.useMemo(()=>({"aria-orientation":C===`both`?void 0:C,...ie?{}:Pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&j&&!m){let n=e(t.nativeEvent);if(n&&!T(I.current,n))return;ve(t),A.setOpen(!1,k(r,t.nativeEvent)),y(N)&&N.focus();return}Ne(t)},onPointerMove(){H.current=!0}}),[Pe,Ne,I,C,ie,A,j,m,N]),X=Z.useMemo(()=>{function e(e){A.setOpen(!0,k(D,e.nativeEvent,e.currentTarget))}function t(e){h===`auto`&&K(e.nativeEvent)&&(R.current=!m)}function n(e){R.current=h,h===`auto`&&oe(e.nativeEvent)&&(R.current=!0)}return{onKeyDown(t){let n=A.select(`open`);H.current=!1;let r=t.key.startsWith(`Arrow`),i=Ye(t.key,je(),p),a=qe(t.key,C),o=(f?i:a)||t.key===`Enter`||t.key.trim()===``;if(m&&n)return Ne(t);if(!(!n&&!b&&r)){if(o){let e=qe(t.key,je());B.current=f&&e?null:t.key}if(f){i&&(ve(t),n?(z.current=Me(),U(t)):e(t));return}a&&(ye.current!=null&&(z.current=ye.current),ve(t),!n&&b?e(t):Ne(t),n&&U(t))}},onFocus(e){A.select(`open`)&&!m&&(z.current=-1,U(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[Ne,h,Me,f,U,A,b,C,je,p,ye,m]),Le=Z.useMemo(()=>({...Pe,...X}),[Pe,X]);return Z.useMemo(()=>c?{reference:Le,floating:Fe,item:Y,trigger:X}:{},[c,Le,Fe,X,Y])}function Qe(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,onTyping:o,enabled:s=!0,resetMs:c=750,selectedIndex:l=null}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=H(),p=Z.useRef(``),m=Z.useRef(l??i??-1),h=Z.useRef(null),g=x(e=>{function t(e){let t=r?.current[e];return!t||L(t)}function s(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let u=n.current;if(p.current.length>0&&e.key===` `&&(ve(e),o?.(!0)),p.current.length>0&&p.current[0]!==` `&&s(u,p.current)===-1&&e.key!==` `&&o?.(!1),u==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;d&&e.key!==` `&&(ve(e),o?.(!0));let g=p.current===``;g&&(m.current=l??i??-1),u.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&p.current===e.key&&(p.current=``,m.current=h.current),p.current+=e.key,f.start(c,()=>{p.current=``,m.current=h.current,o?.(!1)});let _=((g?l??i??-1:m.current)??0)+1,v=s(u,p.current,_);v===-1?e.key!==` `&&(p.current=``,o?.(!1)):(a?.(v),h.current=v)}),_=x(e=>{let t=e.relatedTarget,n=u.select(`domReferenceElement`),r=u.select(`floatingElement`);T(n,t)||T(r,t)||(f.clear(),p.current=``,m.current=h.current,o?.(!1))});q(()=>{!d&&l!==null||(f.clear(),h.current=null,p.current!==``&&(p.current=``))},[d,l,f]),q(()=>{d&&p.current===``&&(m.current=l??i??-1)},[d,l,i]);let v=Z.useMemo(()=>({onKeyDown:g,onBlur:_}),[g,_]);return Z.useMemo(()=>s?{reference:v,floating:v}:{},[s,v])}function $e(e){let[t,n]=Z.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}var Q=l(),et=Z.createContext(void 0),tt={disableStyleElements:!1};function nt(){return Z.useContext(et)??tt}var rt=Z.createContext(null),it=Z.createContext(null);function at(){let e=Z.useContext(rt);if(e===null)throw Error(de(60));return e}function ot(){let e=Z.useContext(it);if(e===null)throw Error(de(61));return e}var st=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),ct={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},lt={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},ut={disabled:!1,...lt},dt={valid(e){return e===null?null:e?{[st.valid]:``}:{[st.invalid]:``}}},ft={invalid:void 0,name:void 0,validityData:{state:ct,errors:[],error:``,value:``,initialValue:null},setValidityData:Y,disabled:void 0,touched:lt.touched,setTouched:Y,dirty:lt.dirty,setDirty:Y,filled:lt.filled,setFilled:Y,focused:lt.focused,setFocused:Y,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:ut,markedDirtyRef:{current:!1},registerFieldControl:Y,validation:{getValidationProps:(e=c)=>e,getInputValidationProps:(e=c)=>e,inputRef:{current:null},commit:async()=>{}}},pt=Z.createContext(ft);function mt(e=!0){let t=Z.useContext(pt);if(t.setValidityData===Y&&!e)throw Error(de(28));return t}function ht(e,t,n,r,i=!0){let{registerFieldControl:a}=mt(),o=Z.useRef(null);o.current||=Symbol(),q(()=>{let s=o.current;if(!(!s||!i))return a(s,{controlRef:e,getValue:r,id:t,value:n}),()=>{a(s,void 0)}},[e,i,r,t,a,n])}var gt=Z.createContext({controlId:void 0,registerControlId:Y,labelId:void 0,setLabelId:Y,messageIds:[],setMessageIds:Y,getDescriptionProps:e=>e});function _t(){return Z.useContext(gt)}function vt(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=_t(),o=U(t),s=n?i:void 0,c=C(()=>Symbol(`labelable-control`)),l=Z.useRef(!1),u=Z.useRef(t!=null),d=x(()=>{!l.current||a===Y||(l.current=!1,a(c.current,void 0))});return q(()=>{if(a===Y)return;let e;if(n){let n=r?.current;e=m(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),Z.useEffect(()=>d,[d]),i??o}var yt=(e,t)=>Object.is(e,t);function bt(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function xt(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:bt(t,e,n))}function St(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:bt(e,t,n))}function Ct(e,t,n){return e.filter(e=>!bt(t,e,n))}function wt(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Tt(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Et(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Tt(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Dt(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return wt(e)}function Ot(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?wt(e.value):wt(e)}function kt(e,t,n){function r(){return Dt(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=Tt(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function At(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Q.jsx)(Z.Fragment,{children:kt(r,t,n)},i)),e),[])}var $={id:O(e=>e.id),labelId:O(e=>e.labelId),modal:O(e=>e.modal),multiple:O(e=>e.multiple),items:O(e=>e.items),itemToStringLabel:O(e=>e.itemToStringLabel),itemToStringValue:O(e=>e.itemToStringValue),isItemEqualToValue:O(e=>e.isItemEqualToValue),value:O(e=>e.value),hasSelectedValue:O(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Ot(t,r)!==``}),hasNullItemLabel:O((e,t)=>t?Et(e.items):!1),open:O(e=>e.open),mounted:O(e=>e.mounted),forceMount:O(e=>e.forceMount),transitionStatus:O(e=>e.transitionStatus),openMethod:O(e=>e.openMethod),activeIndex:O(e=>e.activeIndex),selectedIndex:O(e=>e.selectedIndex),isActive:O((e,t)=>e.activeIndex===t),isSelected:O((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>bt(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:bt(n,i,r)}),isSelectedByFocus:O((e,t)=>e.selectedIndex===t),popupProps:O(e=>e.popupProps),triggerProps:O(e=>e.triggerProps),triggerElement:O(e=>e.triggerElement),positionerElement:O(e=>e.positionerElement),listElement:O(e=>e.listElement),popupSide:O(e=>e.popupSide),scrollUpArrowVisible:O(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:O(e=>e.scrollDownArrowVisible),hasScrollArrows:O(e=>e.hasScrollArrows)},jt=Z.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Y,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function Mt(){return Z.useContext(jt)}function Nt(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Pt(e,t){return Math.max(0,e-t)}function Ft(e,t){if(t<=0)return 0;let n=Nt(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function It(e){let{id:t,value:n,defaultValue:r=null,onValueChange:l,open:u,defaultOpen:d=!1,onOpenChange:f,name:p,form:m,autoComplete:g,disabled:_=!1,readOnly:v=!1,required:y=!1,modal:S=!0,actionsRef:w,inputRef:T,onOpenChangeComplete:E,items:D,multiple:O=!1,itemToStringLabel:j,itemToStringValue:M,isItemEqualToValue:ne=yt,highlightItemOnHover:re=!0,children:P}=e,{clearErrors:F}=Mt(),{setDirty:ae,setTouched:oe,setFocused:ce,shouldValidateOnChange:le,validityData:L,setFilled:R,name:z,disabled:B,validation:V,validationMode:H}=mt(),U=vt({id:t}),W=B||_,G=z??p,[K,de]=Be({controlled:n,default:O?r??te:r,name:`Select`,state:`value`}),[J,pe]=Be({controlled:u,default:d,name:`Select`,state:`open`}),me=Z.useRef([]),he=Z.useRef([]),ge=Z.useRef(null),_e=Z.useRef(null),ve=Z.useRef(0),ye=Z.useRef(null),be=Z.useRef([]),Se=Z.useRef(!1),Ce=Z.useRef(!1),we=Z.useRef(null),Te=Z.useRef(null),Ee=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),De=Z.useRef(!1),{mounted:Oe,setMounted:ke,transitionStatus:Ae}=ee(J),{openMethod:je,triggerProps:Ne}=s(J),Y=C(()=>new h({id:U,labelId:void 0,modal:S,multiple:O,itemToStringLabel:j,itemToStringValue:M,isItemEqualToValue:ne,value:K,open:J,mounted:Oe,transitionStatus:Ae,items:D,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Fe=b(Y,$.activeIndex),X=b(Y,$.selectedIndex),Ie=b(Y,$.triggerElement),Le=b(Y,$.positionerElement),Re=$e(je),ze=je??Re,Ve=Z.useMemo(()=>O&&Array.isArray(K)&&K.length===0?``:Ot(K,M),[O,K,M]),He=Z.useMemo(()=>O&&Array.isArray(K)?K.map(e=>Ot(e,M)):Ot(K,M),[O,K,M]);ht(se(Y.state.triggerElement),U,K,x(()=>He));let Ue=Z.useRef(K),We=O?Array.isArray(K)&&K.length>0:K!=null;q(()=>{K!==Ue.current&&Y.set(`forceMount`,!0)},[Y,K]),q(()=>{R(We)},[We,R]),q(function(){let e=be.current,t;if(O){let n=Array.isArray(K)?K:[];if(n.length===0)t=null;else{let r=n[n.length-1],i=St(e,r,ne);t=i===-1?null:i}}else{let n=St(e,K,ne);t=n===-1?null:n}t===null&&(Te.current=null),!J&&Y.set(`selectedIndex`,t)},[We,O,J,K,be,ne,Y,Te]),Me(K,()=>{F(G),ae(K!==L.initialValue),le()?V.commit(K):V.commit(K,!0)});let Ge=x((e,t)=>{if(f?.(e,t),!t.isCanceled&&(pe(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(oe(!0),ce(!1),H===`onBlur`&&V.commit(K)),!e&&Y.state.activeIndex!==null)){let e=me.current[Y.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Ke=x(()=>{ke(!1),Y.update({activeIndex:null,openMethod:null}),E?.(!1)});fe({enabled:!w,open:J,ref:ge,onComplete(){J||Ke()}}),Z.useImperativeHandle(w,()=>({unmount:Ke}),[Ke]);let qe=x((e,t)=>{l?.(e,t),!t.isCanceled&&de(e)}),Je=x(()=>{let e=Y.state.listElement||ge.current;if(!e)return;let t=Pt(e.scrollHeight,e.clientHeight),n=Ft(e.scrollTop,t),r=n>0,i=n<t;Y.state.scrollUpArrowVisible!==r&&Y.set(`scrollUpArrowVisible`,r),Y.state.scrollDownArrowVisible!==i&&Y.set(`scrollDownArrowVisible`,i)}),Ye=I({open:J,onOpenChange:Ge,elements:{reference:Ie,floating:Le}}),Xe=N(Ye,{enabled:!v&&!W,event:`mousedown`}),et=o(Ye),tt=Ze(Ye,{enabled:!v&&!W,listRef:me,activeIndex:Fe,selectedIndex:X,disabledIndices:te,onNavigate(e){e===null&&!J||Y.set(`activeIndex`,e)},focusItemOnHover:re}),nt=Qe(Ye,{enabled:!v&&!W&&(J||!O),listRef:he,activeIndex:Fe,selectedIndex:X,onMatch(e){J?Y.set(`activeIndex`,e):qe(be.current[e],k(`none`))},onTyping(e){Se.current=e}}),at=Z.useMemo(()=>{let e=i(nt.reference,tt.reference,et.reference,Xe.reference,Ne);return U&&(e.id=U),e},[Xe.reference,nt.reference,tt.reference,et.reference,Ne,U]),ot=Z.useMemo(()=>i(Pe,nt.floating,tt.floating,et.floating),[nt.floating,tt.floating,et.floating]),st=tt.item??c;xe(()=>{Y.update({popupProps:ot,triggerProps:at})}),q(()=>{Y.update({id:U,modal:S,multiple:O,value:K,open:J,mounted:Oe,transitionStatus:Ae,popupProps:ot,triggerProps:at,items:D,itemToStringLabel:j,itemToStringValue:M,isItemEqualToValue:ne,openMethod:ze})},[Y,U,S,O,K,J,Oe,Ae,ot,at,D,j,M,ne,ze]);let ct=Z.useMemo(()=>({store:Y,name:G,required:y,disabled:W,readOnly:v,multiple:O,highlightItemOnHover:re,setValue:qe,setOpen:Ge,listRef:me,popupRef:ge,scrollHandlerRef:_e,handleScrollArrowVisibility:Je,scrollArrowsMountedCountRef:ve,itemProps:st,events:Ye.context.events,valueRef:ye,valuesRef:be,labelsRef:he,typingRef:Se,selectionRef:Ee,firstItemTextRef:we,selectedItemTextRef:Te,validation:V,onOpenChangeComplete:E,keyboardActiveRef:Ce,alignItemWithTriggerActiveRef:De,initialValueRef:Ue}),[Y,G,y,W,v,O,re,qe,Ge,st,Ye.context.events,V,E,Je]),lt=A(T,V.inputRef),ut=O&&Array.isArray(K)&&K.length>0,dt=O?void 0:G,ft=Z.useMemo(()=>!O||!Array.isArray(K)||!G?null:K.map(e=>{let t=Ot(e,M);return(0,Q.jsx)(`input`,{type:`hidden`,form:m,name:G,value:t},t)}),[O,K,m,G,M]);return(0,Q.jsx)(rt.Provider,{value:ct,children:(0,Q.jsxs)(it.Provider,{value:Ye,children:[P,(0,Q.jsx)(`input`,{...V.getInputValidationProps({onFocus(){Y.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||W||v){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=k(a,e.nativeEvent);function r(){if(O)return;let e=be.current.find(e=>Ot(e,M).toLowerCase()===t.toLowerCase()||Dt(e,j).toLowerCase()===t.toLowerCase());e!=null&&(ae(e!==L.initialValue),qe(e,n),le()&&V.commit(e))}Y.set(`forceMount`,!0),queueMicrotask(r)}}),id:U&&dt==null?`${U}-hidden-input`:void 0,form:m,name:dt,autoComplete:g,value:Ve,disabled:W,required:y&&!ut,readOnly:v,ref:lt,style:G?ie:ue,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ft]})})}function Lt(e){return e==null?void 0:`${e}-label`}function Rt(e,t){return e??t}function zt(e){let t=e.getBoundingClientRect(),n=d(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),f=l-t.width,p=u-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-p/2,bottom:t.bottom+p/2}}var Bt=2,Vt=400,Ht={...he,...dt,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Ut=Z.forwardRef(function(e,t){let{render:n,className:r,id:o,disabled:s=!1,nativeButton:c=!0,style:l,...d}=e,{setTouched:f,setFocused:p,validationMode:m,state:h,disabled:_}=mt(),{labelId:v}=_t(),{store:y,setOpen:S,selectionRef:C,validation:ee,readOnly:w,required:E,alignItemWithTriggerActiveRef:D,disabled:O,keyboardActiveRef:te}=at(),j=_||O||s,M=b(y,$.open),N=b(y,$.mounted),ne=b(y,$.value),re=b(y,$.triggerProps),P=b(y,$.positionerElement),F=b(y,$.listElement),ie=b(y,$.popupSide),ae=b(y,$.id),oe=b(y,$.labelId),I=b(y,$.hasSelectedValue),ce=N&&P?ie:null,le=o??ae,L=Rt(v,oe);vt({id:le});let R=se(P),z=Z.useRef(null),{getButtonProps:B,buttonRef:V}=u({disabled:j,native:c}),U=A(t,z,V,x(e=>{y.set(`triggerElement`,e)})),ue=H(),W=H(),G=H();Z.useEffect(()=>{if(M)return G.start(Vt,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}),()=>{G.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},W.clear()},[M,C,W,G]);let K=i(re,{id:le,role:`combobox`,"aria-expanded":M?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":M?F?.id??g(P)?.id:void 0,"aria-labelledby":L,"aria-readonly":w||void 0,"aria-required":E||void 0,tabIndex:j?-1:0,ref:U,onFocus(e){p(!0),M&&D.current&&S(!1,k(a,e.nativeEvent)),ue.start(0,()=>{y.set(`forceMount`,!0)})},onBlur(e){T(P,e.relatedTarget)||(f(!0),p(!1),m===`onBlur`&&ee.commit(ne))},onPointerMove(){te.current=!1},onKeyDown(){te.current=!0},onMouseDown(e){if(M)return;let t=Ae(e.currentTarget);function n(e){if(!z.current)return;let t=e.target;if(T(z.current,t)||T(R.current,t)||t===z.current)return;let n=zt(z.current);e.clientX>=n.left-Bt&&e.clientX<=n.right+Bt&&e.clientY>=n.top-Bt&&e.clientY<=n.bottom+Bt||S(!1,k(Ne,e))}W.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},ee.getValidationProps,d,B);K.role=`combobox`;let q={...h,open:M,disabled:j,value:ne,readOnly:w,popupSide:ce,placeholder:!I};return X(`button`,e,{ref:[t,z],state:q,stateAttributesMapping:Ht,props:K})}),Wt={value:()=>null},Gt=Z.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=at(),u=b(c,$.value),d=b(c,$.items),f=b(c,$.itemToStringLabel),p=b(c,$.hasSelectedValue),m=!p&&a!=null&&i==null,h=b(c,$.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(!p&&a!=null&&!h?a:Array.isArray(u)?At(u,d,f):kt(u,d,f)),X(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:Wt})}),Kt=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=at();return X(`span`,e,{state:{open:b(o,$.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:W})}),qt=Z.createContext(void 0),Jt=Z.forwardRef(function(e,t){let{store:n}=at(),r=b(n,$.mounted),i=b(n,$.forceMount);return r||i?(0,Q.jsx)(qt.Provider,{value:!0,children:(0,Q.jsx)(P,{ref:t,...e})}):null}),Yt=Z.createContext(void 0);function Xt(){let e=Z.useContext(Yt);if(!e)throw Error(de(59));return e}function Zt(e,t){e&&Object.assign(e.style,t)}var Qt={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},$t=20;function en(e,t,n,r){let[i,a]=Z.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=Ae(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-$t)},[e,t,n]),w(e&&(!t||i),r)}var tn={position:`fixed`},nn=Z.forwardRef(function(e,t){let{anchor:r,positionMethod:i=`absolute`,className:o,render:s,side:c=`bottom`,align:l=`center`,sideOffset:u=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g,alignItemWithTrigger:_=!0,collisionAvoidance:v=ne,style:y,...S}=e,{store:C,listRef:ee,labelsRef:w,alignItemWithTriggerActiveRef:T,selectedItemTextRef:E,valuesRef:D,initialValueRef:O,popupRef:te,setValue:A}=at(),j=ot(),M=b(C,$.open),N=b(C,$.mounted),re=b(C,$.modal),P=b(C,$.value),F=b(C,$.openMethod),ie=b(C,$.positionerElement),ae=b(C,$.triggerElement),oe=b(C,$.isItemEqualToValue),se=b(C,$.transitionStatus),I=Z.useRef(null),ce=Z.useRef(null),[le,L]=Z.useState(_),R=N&&le&&F!==`touch`;!N&&le!==_&&L(_),q(()=>{N||($.scrollUpArrowVisible(C.state)&&C.set(`scrollUpArrowVisible`,!1),$.scrollDownArrowVisible(C.state)&&C.set(`scrollDownArrowVisible`,!1))},[C,N]),Z.useImperativeHandle(T,()=>R),en((R||re)&&M,F===`touch`,ie,ae);let z=pe({anchor:r,floatingRootContext:j,positionMethod:i,mounted:N,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g??R,collisionAvoidance:v,keepMounted:!0}),B=R?`none`:z.side,V=R?tn:z.positionerStyles,H={open:M,side:B,align:z.align,anchorHidden:z.anchorHidden};q(()=>{C.set(`popupSide`,z.side)},[C,z.side]);let U=De(e,H,{styles:V,transitionStatus:se,props:S,refs:[t,x(e=>{C.set(`positionerElement`,e)})],hidden:!N,inert:!M}),ue=Z.useRef(0),W=x(e=>{if(e.size===0&&ue.current===0||D.current.length===0)return;let t=ue.current;if(ue.current=e.size,e.size===t)return;let n=k(a);if(t!==0&&!C.state.multiple&&P!==null&&St(D.current,P,oe)===-1){let e=O.current,t=e!=null&&St(D.current,e,oe)!==-1?e:null;A(t,n),t===null&&(C.set(`selectedIndex`,null),E.current=null)}if(t!==0&&C.state.multiple&&Array.isArray(P)){let e=e=>St(D.current,e,oe)!==-1,t=P.filter(t=>e(t));(t.length!==P.length||t.some(e=>!xt(P,e,oe)))&&(A(t,n),t.length===0&&(C.set(`selectedIndex`,null),E.current=null))}if(M&&R){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};Zt(ie,e),Zt(te.current,e)}}),G=Z.useMemo(()=>({...z,side:B,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:L,scrollUpArrowRef:I,scrollDownArrowRef:ce}),[z,B,R,L]);return(0,Q.jsx)(He,{elementsRef:ee,labelsRef:w,onMapChange:W,children:(0,Q.jsxs)(Yt.Provider,{value:G,children:[N&&re&&(0,Q.jsx)(n,{inert:ye(!M),cutout:ae}),U]})})}),rn=`base-ui-disable-scrollbar`,an={className:rn,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:rn,precedence:`base-ui:low`,children:`.${rn}{scrollbar-width:none}.${rn}::-webkit-scrollbar{display:none}`})}},on=Z.createContext(void 0);function sn(e){let t=Z.useContext(on);if(t===void 0&&!e)throw Error(de(69));return t}var cn={...Se,...S},ln=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:p,firstItemTextRef:m,selectedItemTextRef:h,keyboardActiveRef:g,multiple:_,handleScrollArrowVisibility:y,scrollHandlerRef:S,listRef:C,highlightItemOnHover:ee}=at(),{side:w,align:T,alignItemWithTriggerActive:E,isPositioned:D,setControlledAlignItemWithTrigger:O,scrollDownArrowRef:te,scrollUpArrowRef:A}=Xt(),j=sn(!0)!=null,M=ot(),N=z(),{nonce:ne,disableStyleElements:re}=nt(),P=b(s,$.id),F=b(s,$.open),ie=b(s,$.mounted),ae=b(s,$.popupProps),oe=b(s,$.transitionStatus),se=b(s,$.triggerElement),I=b(s,$.positionerElement),ce=b(s,$.listElement),L=Z.useRef(!1),B=Z.useRef(!1),V=Z.useRef({}),H=Ie(),U=x(e=>{if(!I||!c.current||!B.current)return;if(L.current||!E){y();return}let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(!t&&!n){y();return}let r=fn(I),i=pn(I.getBoundingClientRect().height,`y`,r),a=Ae(I),o=getComputedStyle(I),s=parseFloat(o.marginTop),l=parseFloat(o.marginBottom),u=un(getComputedStyle(c.current)),d=Math.min(a.documentElement.clientHeight-s-l,u),f=e.scrollTop,p=dn(e),m=0,h=null,g=!1,_=!1,v=e=>{I.style.height=`${e}px`},b=(t,n)=>{let r=Nt(t,0,d-i);r>0&&v(i+r),e.scrollTop=n,d-(i+r)<=1&&(L.current=!0),y()},x=t?p-f:f,S=Math.min(i+x,d);if(m=S,x<=1){b(x,t?p:0);return}if(d-S>1?t?_=!0:h=0:(g=!0,n&&f<p&&(h=f-(x-(i+x-d)))),m=Math.ceil(m),m!==0&&v(m),_||h!=null){let t=dn(e),n=_?t:Nt(h,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(g||m>=d-1)&&(L.current=!0),y()});Z.useImperativeHandle(S,()=>U,[U]),fe({open:F,ref:c,onComplete(){F&&l?.(!0)}});let ue={open:F,transitionStatus:oe,side:w,align:T};q(()=>{!I||!c.current||Object.keys(V.current).length||(V.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),q(()=>{F||E||(B.current=!1,L.current=!1,Zt(I,V.current))},[F,E,I,c]),q(()=>{let e=c.current;if(!F||!se||!I||!e||E&&!D||s.state.transitionStatus===`ending`)return;if(!E){B.current=!0,H.request(y),e.style.removeProperty(`--transform-origin`);return}let t=gn(e);e.style.removeProperty(`--transform-origin`);try{let t=h.current;t?.isConnected||(t=!$.hasSelectedValue(s.state)&&m.current?.isConnected?m.current:null);let n=p.current,r=getComputedStyle(I),i=getComputedStyle(e),a=Ae(se),o=d(I),c=fn(se),l=mn(se.getBoundingClientRect(),c),u=mn(I.getBoundingClientRect(),c),f=l.height,g=ce||e,_=g.scrollHeight,v=parseFloat(i.borderBottomWidth),b=parseFloat(r.marginTop)||10,x=parseFloat(r.marginBottom)||10,S=parseFloat(r.minHeight)||100,w=un(i),T=a.documentElement.clientHeight-b-x,E=a.documentElement.clientWidth,D=T-l.bottom+f,k,te=N===`rtl`?l.right-u.width:l.left,A=0;if(t&&n){let e=mn(n.getBoundingClientRect(),c);k=mn(t.getBoundingClientRect(),c),te=u.left+(N===`rtl`?e.right-k.right:e.left-k.left);let r=e.top-l.top+e.height/2;A=k.top-u.top+k.height/2-r}let j=D+A+x+v,M=Math.min(T,j),ne=T-b-x,re=j-M,P=E-5;I.style.left=`${Nt(te,5,P-u.width)}px`,I.style.height=`${M}px`,I.style.maxHeight=`auto`,I.style.marginTop=`${b}px`,I.style.marginBottom=`${x}px`,e.style.height=`100%`;let F=dn(g),ie=re>=F-1;ie&&(M=Math.min(T,u.height)-(re-F));let ae=l.top<20||l.bottom>T-20||Math.ceil(M)+1<Math.min(_,S),oe=(o.visualViewport?.scale??1)!==1&&R;if(ae||oe){B.current=!0,Zt(I,V.current),O(!1);return}let le=Math.max(S,M);if(ie){let e=Math.max(0,T-j);I.style.top=u.height>=ne?`0`:`${e}px`,I.style.height=`${M}px`,g.scrollTop=dn(g)}else I.style.bottom=`0`,g.scrollTop=re;if(k){let t=u.top,n=u.height,r=k.top+k.height/2,i=Nt(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(le===T||M>=w)&&(L.current=!0),y(),ee&&s.state.selectedIndex===null&&s.state.activeIndex===null&&C.current[0]!=null&&s.set(`activeIndex`,0),B.current=!0}finally{t()}},[s,F,I,se,p,m,h,c,y,E,O,H,te,A,ce,C,ee,N,D]),Z.useEffect(()=>{if(!E||!I||!F)return;let e=d(I);function t(e){u(!1,k(Ce,e))}return Fe(e,`resize`,t)},[u,E,I,F]);let W={...ce?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":_||void 0,id:`${P}-list`},onKeyDown(e){g.current=!0,j&&v.has(e.key)&&e.stopPropagation()},onMouseMove(){g.current=!1},onScroll(e){ce||U(e.currentTarget)},...E&&{style:ce?{height:`100%`}:Qt}},G=X(`div`,e,{ref:[t,c],state:ue,stateAttributesMapping:cn,props:[ae,W,le(oe),{className:!ce&&E?an.className:void 0},o]});return(0,Q.jsxs)(Z.Fragment,{children:[!re&&an.getElement(ne),(0,Q.jsx)(f,{context:M,modal:!1,disabled:!ie,returnFocus:a,restoreFocus:!0,children:G})]})});function un(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function dn(e){return Pt(e.scrollHeight,e.clientHeight)}function fn(e){return Le.getScale(e)}function pn(e,t,n){return e/n[t]}function mn(e,t){return me({x:pn(e.x,`x`,t),y:pn(e.y,`y`,t),width:pn(e.width,`x`,t),height:pn(e.height,`y`,t)})}var hn=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function gn(e){let{style:t}=e,n={};for(let[e,r]of hn)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of hn){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var _n=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s}=at(),{alignItemWithTriggerActive:c}=Xt(),l=b(o,$.hasScrollArrows),u=b(o,$.openMethod),d=b(o,$.multiple),f={id:`${b(o,$.id)}-list`,role:`listbox`,"aria-multiselectable":d||void 0,onScroll(e){s.current?.(e.currentTarget)},...c&&{style:Qt},className:l&&u!==`touch`?an.className:void 0};return X(`div`,e,{ref:[t,x(e=>{o.set(`listElement`,e)})],props:[f,a]})}),vn=Z.createContext(void 0);function yn(){let e=Z.useContext(vn);if(!e)throw Error(de(57));return e}var bn=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,d=Z.useRef(null),f=Ve({label:o,textRef:d,indexGuessBehavior:Ue.GuessFromOrder}),{store:m,itemProps:h,setOpen:g,setValue:_,selectionRef:v,typingRef:y,valuesRef:x,multiple:S,selectedItemTextRef:C}=at(),ee=b(m,$.isActive,f.index),w=b(m,$.isSelected,f.index,a),T=b(m,$.isSelectedByFocus,f.index),E=b(m,$.isItemEqualToValue),D=f.index,O=D!==-1,te=Z.useRef(null);q(()=>{if(!O)return;let e=x.current;return e[D]=a,()=>{delete e[D]}},[O,D,a,x]),q(()=>{if(!O)return;let e=m.state.value,t=e;S&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&bt(a,t,E)&&(m.set(`selectedIndex`,D),d.current&&(C.current=d.current))},[O,D,S,E,m,a,C]);let A=Z.useRef(null),j=Z.useRef(`mouse`),M=Z.useRef(!1),{getButtonProps:N,buttonRef:ne}=u({disabled:s,focusableWhenDisabled:!0,native:c,composite:!0}),re={disabled:s,selected:w,highlighted:ee};function P(e){let t=m.state.value;if(S){let n=Array.isArray(t)?t:[];_(w?Ct(n,a,E):[...n,a],k(p,e))}else _(a,k(p,e)),g(!1,k(p,e))}function F(){v.current.dragY=0}let ie={role:`option`,"aria-selected":w,tabIndex:ee?0:-1,onKeyDown(e){A.current=e.key,m.set(`activeIndex`,D),e.key===` `&&y.current&&e.preventDefault()},onClick(e){let t=e.type===`click`&&j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&K(e.nativeEvent)&&(n!==void 0||ee),i=t&&!r&&!M.current;M.current=!1,!(e.type===`keydown`&&A.current===null)&&(s||e.type===`keydown`&&A.current===` `&&y.current||i||(A.current=null,P(e.nativeEvent)))},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=v.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,F()},onMouseUp(){if(F(),s||j.current===`touch`||M.current)return;let e=!v.current.allowSelectedMouseUp&&w,t=!v.current.allowUnselectedMouseUp&&!w;e||t||(M.current=!0,te.current?.click(),M.current=!1)}},ae=X(`div`,e,{ref:[ne,t,f.ref,te],state:re,props:[h,ie,l,N]}),oe=Z.useMemo(()=>({selected:w,index:D,textRef:d,selectedByFocus:T,hasRegistered:O}),[w,D,d,T,O]);return(0,Q.jsx)(vn.Provider,{value:oe,children:ae})})),xn=Z.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=yn();return n||r?(0,Q.jsx)(Sn,{...e,ref:t}):null}),Sn=Z.memo(Z.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=yn(),c=Z.useRef(null),{transitionStatus:l,setMounted:u}=ee(s),d=X(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:S});return fe({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Cn=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i,hasRegistered:a}=yn(),{firstItemTextRef:o,selectedItemTextRef:s}=at(),{render:c,className:l,style:u,...d}=e;return X(`div`,e,{ref:[Z.useCallback(e=>{e&&(a&&n===0&&(o.current=e),a&&i&&(s.current=e))},[o,s,n,i,a]),t,r],props:d})})),wn=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o=!1,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=at(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=Xt(),_=b(l,c?$.scrollUpArrowVisible:$.scrollDownArrowVisible),v=b(l,$.openMethod),y=_&&v!==`touch`,x=H(),S=c?g:h,{transitionStatus:C,setMounted:w}=ee(y);q(()=>(p.current+=1,l.state.hasScrollArrows||l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.state.hasScrollArrows&&l.set(`hasScrollArrows`,!1)}),[l,p]),fe({open:y,ref:S,onComplete(){y||w(!1)}});let T=X(`div`,e,{ref:[t,S],state:{direction:a,visible:y,side:m,transitionStatus:C},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||x.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f();let n=Pt(e.scrollHeight,e.clientHeight),r=Ft(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),a.length===0&&l.set(c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,!i),i){x.clear();return}if(a.length>0){let t=S.current?.offsetHeight||0;e.scrollTop=Tn(a,c,r,e.clientHeight,t,n)}x.start(40,t)}x.start(40,t)},onMouseLeave(){x.clear()}},s]});return y||o?T:null});function Tn(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?Ft(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?Ft(l.offsetTop+l.offsetHeight-r+i,a):a}var En=Z.forwardRef(function(e,t){return(0,Q.jsx)(wn,{...e,ref:t,direction:`down`})}),Dn=Z.forwardRef(function(e,t){return(0,Q.jsx)(wn,{...e,ref:t,direction:`up`})}),On=Z.createContext(void 0),kn=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Z.useState(),c=Z.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=X(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,Q.jsx)(On.Provider,{value:c,children:l})}),An=It;function jn({className:e,...t}){return(0,Q.jsx)(kn,{"data-slot":`select-group`,className:je(`scroll-my-1 p-1`,e),...t})}function Mn({className:e,...t}){return(0,Q.jsx)(Gt,{"data-slot":`select-value`,className:je(`flex flex-1 text-left`,e),...t})}function Nn({className:e,size:t=`default`,children:n,...r}){return(0,Q.jsxs)(Ut,{"data-slot":`select-trigger`,"data-size":t,className:je(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...r,children:[n,(0,Q.jsx)(Kt,{render:(0,Q.jsx)(ze,{className:`pointer-events-none size-3.5 text-muted-foreground`})})]})}function Pn({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Q.jsx)(Jt,{children:(0,Q.jsx)(nn,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Q.jsxs)(ln,{"data-slot":`select-content`,"data-align-trigger":o,className:je(`dark relative isolate 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 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-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:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Q.jsx)(In,{}),(0,Q.jsx)(_n,{children:t}),(0,Q.jsx)(Ln,{})]})})})}function Fn({className:e,children:t,...n}){return(0,Q.jsxs)(bn,{"data-slot":`select-item`,className:je(`relative flex min-h-7 w-full 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-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Q.jsx)(Cn,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Q.jsx)(xn,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Q.jsx)(Re,{className:`pointer-events-none`})})]})}function In({className:e,...t}){return(0,Q.jsx)(Dn,{"data-slot":`select-scroll-up-button`,className:je(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,e),...t,children:(0,Q.jsx)(We,{})})}function Ln({className:e,...t}){return(0,Q.jsx)(En,{"data-slot":`select-scroll-down-button`,className:je(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,e),...t,children:(0,Q.jsx)(ze,{})})}export{mt as A,Ct as C,ht as D,_t as E,Ze as F,dt as M,nt as N,ft as O,Qe as P,St as S,vt as T,Tt as _,Nn as a,bt as b,an as c,Lt as d,Rt as f,Et as g,Mt as h,Fn as i,lt as j,pt as k,en as l,Nt as m,Pn as n,Mn as o,Ft as p,jn as r,sn as s,An as t,zt as u,Dt as v,xt as w,yt as x,Ot as y};
@@ -0,0 +1 @@
1
+ import{Vr as e}from"./sidebar-yC7KdImc.js";var t=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t};