@hot-updater/console 1.0.0-rc.39 → 1.0.0-rc.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{EventDetails-BUTZTAVo.js → EventDetails-3DgVjwDn.js} +1 -1
- package/.output/public/assets/{InsightsInfo-B8i-PPsH.js → InsightsInfo-NUuLFYqg.js} +1 -1
- package/.output/public/assets/{InsightsPageHeader-CASeYum3.js → InsightsPageHeader-DqCp0vf7.js} +1 -1
- package/.output/public/assets/{index-YSc3HCcR.js → index-B7BSdp0k.js} +2 -2
- package/.output/public/assets/insights-CevVB_8E.js +2 -0
- package/.output/public/assets/insights-DMH-zhbe.js +42 -0
- package/.output/public/assets/insights_.distribution-B9MOEnzZ.js +2 -0
- package/.output/public/assets/insights_.distribution-O73SKvoa.js +1 -0
- package/.output/public/assets/{installations-C-QP0sM1.js → installations-DtZj5jk2.js} +1 -1
- package/.output/public/assets/{installations-yQkxp5fm.js → installations-LJBhFDEM.js} +2 -2
- package/.output/public/assets/{preload-helper-DuV6lz46.js → preload-helper-D9SUwQT7.js} +1 -1
- package/.output/public/assets/{routes-DuBSi7uM.js → routes-CJSxovHS.js} +1 -1
- package/.output/public/assets/routes-DyZCr794.js +2 -0
- package/.output/public/assets/styles-DwA6mhnh.css +2 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-DNbgEvfb.mjs → __23tanstack-start-server-fn-resolver-CUp7Too4.mjs} +36 -36
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-BCGWklf8.mjs → ConsoleFeatureUnavailable-BxaV7ca0.mjs} +5 -5
- package/.output/server/_ssr/{EventDetails-vtXoqSGS.mjs → EventDetails-B5HHZsCk.mjs} +7 -7
- package/.output/server/_ssr/{InsightsInfo-B0AtaDnr.mjs → InsightsInfo-C7K_HKHZ.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-BryzBlT8.mjs → InsightsPageHeader-BPaYzzkg.mjs} +18 -7
- package/.output/server/_ssr/{NotFoundPage-xK1bhpoZ.mjs → NotFoundPage-CyBONH8d.mjs} +2 -2
- package/.output/server/_ssr/{alert-dialog-Cc9d0p8Y.mjs → alert-dialog-BsqgyNOZ.mjs} +1 -1
- package/.output/server/_ssr/{api-keys-C2jqeEZ_.mjs → api-keys-CY1d8bCZ.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-DnKkFZ3T.mjs → api-keys-D8R-eRJ-.mjs} +8 -8
- package/.output/server/_ssr/{api-keys-rpc-BJ0MKu1e.mjs → api-keys-rpc-CC1ERVtk.mjs} +3 -3
- package/.output/server/_ssr/{api-Bz1UGqdn.mjs → api-otC0m2Cl.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-B9mAeGyS.mjs → api-rpc-C99iexLk.mjs} +4 -4
- package/.output/server/_ssr/{auth-rpc-Bs4tYGIg.mjs → auth-rpc-PABg7kHk.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-CcTNWmd4.mjs → auth.server-8-IRXBc-.mjs} +2 -2
- package/.output/server/_ssr/{card-GK-VihZc.mjs → card-ijGSudc_.mjs} +1 -1
- package/.output/server/_ssr/{config.server-DaeqzKiu.mjs → config.server-08RES1G-.mjs} +3 -3
- package/.output/server/_ssr/{console-access-CSVqeikY.mjs → console-access-D0bQJ9tx.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-CuukSjL8.mjs → console-features-api-BRGAxAgc.mjs} +3 -3
- package/.output/server/_ssr/{console-features-rpc-Dxv_D020.mjs → console-features-rpc-845alOXy.mjs} +3 -3
- package/.output/server/_ssr/{dialog-Vjm_bDw9.mjs → dialog-BnfVyv4I.mjs} +1 -1
- package/.output/server/_ssr/{empty-DeVHKygf.mjs → empty-CnGZqF1a.mjs} +2 -2
- package/.output/server/_ssr/{failureReports-CRYHdQBQ.mjs → failureReports-_trbWCVo.mjs} +2 -2
- package/.output/server/_ssr/{field-CcbQSAiS.mjs → field-CysUuRJx.mjs} +2 -2
- package/.output/server/_ssr/{input-group-D7oZhqZP.mjs → input-group-C44twsSf.mjs} +1 -1
- package/.output/server/_ssr/{insights-C2_kuG7Z.mjs → insights-Br6JnctH.mjs} +2 -2
- package/.output/server/_ssr/{insights-DFBjq_u1.mjs → insights-CgRV7dlP.mjs} +134 -125
- package/.output/server/_ssr/{insights-CdkhyQHH.mjs → insights-CrrlG-bz.mjs} +5 -5
- package/.output/server/_ssr/{insights-api-CBBcHIUP.mjs → insights-api-MpLvDjmC.mjs} +5 -5
- package/.output/server/_ssr/{insights-errors-F-7hOApm.mjs → insights-errors-Cy03daYs.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-BZaGNNij.mjs → insights-failures-HHiiIbag.mjs} +4 -5
- package/.output/server/_ssr/{insights-failures-rpc-CTf5QF7O.mjs → insights-failures-rpc-CGiDJbg-.mjs} +8 -8
- package/.output/server/_ssr/{insights-recovery-rpc-CPKwBt4V.mjs → insights-recovery-rpc-Bul_1cyL.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-DjhnYd2B.mjs → insights-rpc-D24DKKlx.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-CLHRgGDT.mjs → insights-usage-rpc-iG8wRo4G.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-CLyldyrz.mjs → insights-usage-rpc-tVCHkzGH.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-DXCwHGBj.mjs → insights_.distribution-Ckc_O360.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-WDmsXtQl.mjs → insights_.distribution-DbO4X6X6.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-Buu3dsat.mjs → insights_.distribution-DsujaomV.mjs} +13 -13
- package/.output/server/_ssr/{installations-BiZY4zjE.mjs → installations-DV3sNoM5.mjs} +10 -10
- package/.output/server/_ssr/{installations-Dfe3WTAY.mjs → installations-DkJq_y8i.mjs} +2 -2
- package/.output/server/_ssr/{installations-sR2BlZxi.mjs → installations-F6vBSPUU.mjs} +4 -4
- package/.output/server/_ssr/{release-adoption-rpc-DVhlhHRR.mjs → release-adoption-rpc-h_r3KQsi.mjs} +5 -5
- package/.output/server/_ssr/{router-HumF5rJs.mjs → router-C_IshN2d.mjs} +13 -13
- package/.output/server/_ssr/{routes-kDK03EWa.mjs → routes-BEHlOXKL.mjs} +33 -22
- package/.output/server/_ssr/{routes-CN0fvuLB.mjs → routes-DeSps20R.mjs} +14 -10
- package/.output/server/_ssr/{select-ycdfR07Y.mjs → select-BL10bGzk.mjs} +1 -1
- package/.output/server/_ssr/{server-CyAnx61_.mjs → server-DIIIVgcN.mjs} +3 -3
- package/.output/server/_ssr/{sidebar-B2SHpuig.mjs → sidebar-DLus-ndm.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{table-COXYXU49.mjs → table-U7InIZlH.mjs} +1 -1
- package/.output/server/_ssr/{updateFailures-BP-A8Ppr.mjs → updateFailures-BLs3R7j0.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-DcB4oGQp.mjs → _tanstack-start-manifest_v-VxUXUIhM.mjs} +25 -25
- package/.output/server/index.mjs +113 -113
- package/package.json +7 -7
- package/src/components/features/insights/BuiltinBundle.tsx +18 -3
- package/src/components/features/insights/FailureReports.tsx +15 -2
- package/src/components/features/insights/ReleaseActivity.tsx +1 -1
- package/src/components/features/insights/UpdateFailures.tsx +103 -104
- package/src/components/features/releases/ReleaseEditorSheet.tsx +2 -2
- package/src/lib/insights-failures.ts +1 -11
- package/src/routes/index.tsx +33 -15
- package/src/routes/insights.tsx +1 -1
- package/src/routes/insights_.distribution.tsx +3 -3
- package/.output/public/assets/insights-BT0ER2ff.js +0 -2
- package/.output/public/assets/insights-DPY9akyx.js +0 -42
- package/.output/public/assets/insights_.distribution-NyB0_bbh.js +0 -2
- package/.output/public/assets/insights_.distribution-jH_7sKdg.js +0 -1
- package/.output/public/assets/routes-DQWmO9Ow.js +0 -2
- package/.output/public/assets/styles-Cm2ONGCt.css +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$n as e,$r as t,$t as n,Bn as r,F as i,Fn as a,Gn as o,Gt as s,H as c,Hn as l,Hr as u,Ht as d,I as f,In as p,Jn as m,Jt as h,Kt as g,L as _,Ln as v,M as y,Nn as b,P as x,Pn as S,R as C,U as w,Un as T,Ut as E,Vt as ee,Wn as te,Wt as ne,Xn as re,Yn as ie,Z as ae,Zn as D,_ as oe,_n as se,ar as O,b as ce,ct as k,ei as A,er as le,fn as j,g as ue,gn as de,h as M,ir as N,ni as P,p as fe,qt as F,rn as I,sn as L,sr as R,st as z,un as B,v as pe,vn as me,w as he,y as ge,yn as _e}from"./sidebar-RBvHzq8e.js";import{l as V}from"./console-features-api-BhUIxeL-.js";import{a as H,i as U,l as ve,n as ye,o as W,r as G,s as be,t as xe}from"./alert-dialog-DXxrSU0G.js";import{a as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as K,u as Ie}from"./api-BiZP_i-u.js";import{a as Le,c as Re,i as ze,n as Be,r as Ve,s as He,t as Ue}from"./routes-DQWmO9Ow.js";import{a as We,c as Ge,d as Ke,f as qe,i as Je,n as Ye,o as Xe,r as Ze,s as q,t as Qe,u as $e}from"./field-bPoDrs6K.js";import{a as et,i as tt,n as nt,o as rt,r as it}from"./useCompositeListItem-BxJspDxS.js";import{A as at,F as ot,I as st,L as ct,N as lt,O as ut,_ as dt,a as ft,c as pt,h as mt,i as ht,k as gt,l as _t,m as vt,n as yt,o as bt,s as xt,t as St,u as Ct,v as wt}from"./valueToPercent-Ci2-fmWp.js";import{a as Tt,i as Et,l as Dt,n as Ot,o as kt,s as At,t as jt,u as Mt}from"./input-group-_PD0i7wZ.js";import{t as Nt}from"./loader-circle-iTGehfyV.js";import{a as Pt,c as Ft,i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt}from"./dialog-DxjO7ofz.js";import{a as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./card-DKr2pZMA.js";import{n as Jt}from"./dist-BzWwzt98.js";import{c as Yt,d as Xt,f as Zt,h as Qt,l as $t,m as en,o as tn,p as nn,s as rn,u as an}from"./InsightsInfo-B8i-PPsH.js";import{a as on,i as J,n as sn,o as cn,r as Y,t as ln}from"./table-BYmouPt9.js";var un=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),dn=O(`circle-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]),fn=O(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),pn=O(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),mn=O(`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`}]]),hn=O(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),gn=O(`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`}]]),_n=O(`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`}]]),vn=O(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),X=P(t(),1),Z=u(),yn={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function bn({channel:e,className:t}){return(0,Z.jsx)(q,{variant:`outline`,className:v(yn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function xn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(qe,{className:v(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(hn,{className:v(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(N,{className:v(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Sn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),ee=E.prototype;return w.prototype=ee,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){ee[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Cn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),wn=P(Sn(),1),Tn=P(Cn(),1);wn.default.extend(Tn.default);function En({uuid:e,format:t=`relative`}){let n=(0,wn.default)(tn(e));return t===`relative`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function Dn({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:i}){let o=M();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:e,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)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(q,{variant:`outline`,children:[n.length,` `,n.length===1?`patch`:`patches`]})]}),r?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):n.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:n.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)(ct,{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)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(En,{uuid:e.id})})]})]}),(0,Z.jsx)(a,{className:`w-full`,onClick:()=>i(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)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{children:(0,Z.jsxs)(cn,{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)(sn,{children:n.map(e=>(0,Z.jsxs)(cn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(ct,{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)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(En,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(a,{onClick:()=>i(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 On({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,o]=(0,X.useState)(null),{data:s=[],isPending:c}=Oe(),l=Me(),u=Fe(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?Jt.success(`Channel ${e.row.name} created`):Jt.info(`Channel ${e.row.name} already exists`)}catch(e){Jt.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?Jt.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?Jt.error(`Channel ${i.name} is still in use and cannot be deleted`):Jt.error(`Channel ${i.name} no longer exists`),o(null)}catch(e){Jt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Lt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsxs)(Rt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(gn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(zt,{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)(Je,{className:`gap-2`,children:(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ae,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(a,{type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(Nt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Ft,{"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)(Nt,{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.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(vn,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(xe,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&o(null)},children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Delete `,i?.name,`?`]}),(0,Z.jsx)(H,{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)(W,{children:[(0,Z.jsx)(G,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(ye,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var kn=`[a-zA-Z0-9-]`,An=String.raw`0|[1-9]\d*`,jn=String.raw`\d+`,Mn=String.raw`\d*[a-zA-Z-]${kn}*`,Nn=String.raw`(${An})\.(${An})\.(${An})`,Pn=String.raw`(${jn})\.(${jn})\.(${jn})`,Fn=`(?:${Mn}|${An})`,In=`(?:${Mn}|${jn})`,Ln=String.raw`(?:-(${Fn}(?:\.${Fn})*))`,Rn=String.raw`(?:-?(${In}(?:\.${In})*))`,zn=`${kn}+`,Bn=String.raw`(?:\+(${zn}(?:\.${zn})*))`,Vn=`v?${Nn}${Ln}?${Bn}?`,Hn=String.raw`[v=\s]*${Pn}${Rn}?${Bn}?`,Un=`((?:<|>)?=?)`,Wn=String.raw`${An}|x|X|\*`,Gn=String.raw`${jn}|x|X|\*`,Kn=String.raw`[v=\s]*(${Wn})(?:\.(${Wn})(?:\.(${Wn})(?:${Ln})?${Bn}?)?)?`,qn=String.raw`[v=\s]*(${Gn})(?:\.(${Gn})(?:\.(${Gn})(?:${Rn})?${Bn}?)?)?`,Jn=`(?:~>?)`,Yn=String.raw`(?:\^)`,Xn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Xn}(?:$|[^\d])`,String.raw`${Xn}(?:${Ln})?(?:${Bn})?(?:$|[^\d])`;function Zn(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(Zn(e),t)}var Qn=Q(`^${Vn}$`),$n=Q(`^${Hn}$`),er=/^\d+$/;function tr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function nr(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?$n:Qn);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(er.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 rr=Q(String.raw`^${Un}\s*(${Vn})$|^$`),ir=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function ar(e){return e.version?`${e.operator}${tr(e.version)}`:``}function or(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?ir:rr);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?nr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${tr(a)}`:``,version:a}}function sr(e){return e.sets.map(e=>e.map(ar).join(` `)).join(`||`)}var cr=new RegExp(Bn,`g`),lr=Q(Bn),ur=Q(String.raw`^\s*(${Kn})\s+-\s+(${Kn})\s*$`),dr=Q(String.raw`^\s*(${qn})\s+-\s+(${qn})\s*$`),fr=Q(String.raw`(\s*)${Un}\s*(${Hn}|${Kn})`,`g`),pr=Q(String.raw`(\s*)${Jn}\s+`,`g`),mr=Q(String.raw`(\s*)${Yn}\s+`,`g`),hr=Q(`^${Jn}${Kn}$`),gr=Q(`^${Jn}${qn}$`),_r=Q(`^${Yn}${Kn}$`),vr=Q(`^${Yn}${qn}$`),yr=Q(String.raw`^${Un}\s*${Kn}$`),br=Q(String.raw`^${Un}\s*${qn}$`),xr=Q(String.raw`(<|>)?=?\s*\*`),Sr=/^\s*>=\s*0\.0\.0\s*$/,Cr=/^\s*>=\s*0\.0\.0-0\s*$/,wr=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Tr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Er(e,t){let n=t.loose?gr: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 Dr(e,t){return e.trim().split(/\s+/).map(e=>Er(e,t)).join(` `)}function Or(e,t){let n=t.loose?vr:_r,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function kr(e,t){return e.trim().split(/\s+/).map(e=>Or(e,t)).join(` `)}function Ar(e,t){let n=t.loose?br:yr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Tr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function jr(e,t){return e.split(/\s+/).map(e=>Ar(e,t)).join(` `)}function Mr(e,t){let n=t.loose?dr:ur;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 Nr(e,t){return jr(Dr(kr(e.replace(lr,``),t),t),t).trim().replace(xr,``)}function Pr(e,t){let n=Mr(e.replace(cr,``),t).replace(fr,`$1$2$3`).replace(pr,`$1~`).replace(mr,`$1^`).split(` `).map(e=>Nr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Cr:Sr,``));t.loose&&(n=n.filter(e=>wr.test(e)));let r=new Map;for(let e of n.map(e=>or(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 Fr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Pr(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 Ir(e,t={}){try{return Fr(e,t)}catch{return null}}function Lr(e,t={}){let n=Ir(e,t);return n?sr(n)||`*`:null}var Rr=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},zr=(e,t)=>{if(!e?.trim())return null;let n=Rr(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function Br({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 Vr({bundle:e,release:t}){let{data:n,isFetched:r}=Se(),i=e?Zt(e):null,a=e?Xt(e):null,o=e?.gitCommitHash&&r?zr(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)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Br,{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)(Br,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(At,{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)(fn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Br,{label:`Manifest hash`,value:(0,Z.jsx)(At,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Br,{label:`Base hash`,value:(0,Z.jsx)(At,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Br,{label:`Patch hash`,value:(0,Z.jsx)(At,{maxLength:16,value:i})}):null]})})]}):null}var Hr=Array.from({length:Yt},(e,t)=>t+1);function Ur({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),i=n??[],o=i.length>0,s=r>0&&r<1e3,c=r===Yt,l=M(),u=c?Hr:s?Hr.filter(t=>$t(e,t)<r):[],d=(r/10).toFixed(1),f=c?Yt:u.length,p=Yt-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Selected cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Excluded cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Ht,{className:`p-4 pb-3`,children:[(0,Z.jsx)(Wt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(Gt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(q,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Vt,{children:[(0,Z.jsxs)(Bt,{render:(0,Z.jsx)(a,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(et,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Lt,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Pt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(It,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(It,{showCloseButton:!0})]})})]})}function Wr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Gr(e,t){return e-t}function Kr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Gr)}function qr(e,t,n,r,i,a){let o=e;return o=dt(o,n,r),i&&(o=Kr(a,t,dt(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Jr(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 Yr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},Xr=X.createContext(void 0);function Zr(){let e=X.useContext(Xr);if(e===void 0)throw Error(m(62));return e}function Qr(e){return`key`in e?L:I}function $r(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Wr(e,t):!1}var ei=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:i,defaultValue:a,disabled:o=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:g=0,form:_,name:v,onValueChange:y,onValueCommitted:b,orientation:x=`horizontal`,step:S=1,thumbCollisionBehavior:C=`push`,thumbAlignment:w=`center`,value:T,style:ee,...te}=e,ne=k(c),ie=vt(ne),ae=D(y),oe=D(b),{clearErrors:O}=wt(),{state:ce,disabled:A,name:le,setTouched:j,setDirty:ue,validityData:de,shouldValidateOnChange:M,validation:N}=lt(),{labelId:P}=gt(),[fe,I]=X.useState(),L=n??mt(P,fe),R=A||o,z=le??v,[B,pe]=tt({controlled:T,default:a??m,name:`Slider`}),ge=X.useRef(null),_e=X.useRef(null),V=X.useRef([]),H=X.useRef(null),U=X.useRef(null),ve=X.useRef(-1),ye=X.useRef(null),W=X.useRef(null),G=X.useRef(`none`),be=s(l),[xe,Se]=X.useState(-1),[Ce,we]=X.useState(-1),[Te,Ee]=X.useState(!1),[De,Oe]=X.useState(()=>new Map),[ke,Ae]=X.useState([void 0,void 0]),je=D(e=>{Se(e),e!==-1&&we(e)});at(_e,ne,B),he(B,()=>{O(z),M()?N.commit(B):N.commit(B,!0);let e=de.initialValue,t;t=Array.isArray(B)&&Array.isArray(e)?!Wr(B,e):B!==e,ue(t)});let Me=D(e=>{e&&(_e.current=e)}),Ne=Array.isArray(B),Pe=X.useMemo(()=>Ne?B.slice().sort(Gr):[dt(B,m,p)],[p,m,Ne,B]),Fe=D((e,t)=>{if(Number.isNaN(e)||$r(e,B))return;let n=t??F(`none`,void 0,void 0,{activeThumbIndex:-1});G.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:z}}),n.event=i,W.current=e,ae(e,n),!n.isCanceled&&pe(e)}),K=D((e,t,n)=>{let r=qr(e,t,m,p,Ne,Pe);if(Jr(r,S,g)){let e=Qr(n);Fe(r,F(e,n.nativeEvent,void 0,{activeThumbIndex:t})),j(!0),oe(W.current??r,h(e,n.nativeEvent))}});re(()=>{let e=se(E(ge.current));R&&me(ge.current,e)&&e.blur()},[R]),R&&xe!==-1&&je(-1);let Ie=X.useMemo(()=>({...ce,activeThumbIndex:xe,disabled:R,dragging:Te,orientation:x,max:p,min:m,minStepsBetweenValues:g,step:S,values:Pe}),[ce,xe,R,Te,p,m,g,x,S,Pe]),Le=X.useMemo(()=>({active:xe,controlRef:_e,disabled:R,dragging:Te,validation:N,formatOptionsRef:be,handleInputChange:K,indicatorPosition:ke,inset:w!==`center`,labelId:L,rootLabelId:ie,largeStep:u,lastUsedThumbIndex:Ce,lastChangedValueRef:W,lastChangeReasonRef:G,form:_,locale:d,max:p,min:m,minStepsBetweenValues:g,name:z,onValueCommitted:oe,orientation:x,pressedInputRef:H,pressedThumbCenterOffsetRef:U,pressedThumbIndexRef:ve,pressedValuesRef:ye,registerFieldControlRef:Me,renderBeforeHydration:w===`edge`,setActive:je,setDragging:Ee,setIndicatorPosition:Ae,setLabelId:I,setValue:Fe,state:Ie,step:S,thumbCollisionBehavior:C,thumbMap:De,thumbRefs:V,values:Pe}),[xe,_e,L,ie,R,Te,N,be,K,ke,u,Ce,W,G,_,d,p,m,g,z,oe,x,H,U,ve,ye,Me,je,Ee,Ae,I,Fe,Ie,S,C,w,De,V,Pe]),Re=r(`div`,e,{state:Ie,ref:[t,ge],props:[{"aria-labelledby":L,id:ne,role:`group`},N.getValidationProps,te],stateAttributesMapping:Yr});return(0,Z.jsx)(Xr.Provider,{value:Le,children:(0,Z.jsx)(it,{elementsRef:V,onMapChange:Oe,children:Re})})});function ti(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ni(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 ri(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ni(t),ni(n))))}function ii({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]=dt(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]=dt(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]=dt(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ai({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=dt(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=ii({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=dt(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:ii({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=dt(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 oi=2;function si(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 ci(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 li=X.forwardRef(function(t,i){let{render:a,className:o,style:c,...l}=t,{disabled:u,dragging:d,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:_,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:S,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:ee,renderBeforeHydration:te,setActive:re,setDragging:ie,setValue:ae,state:oe,step:O,thumbCollisionBehavior:ce,thumbRefs:k,values:A}=Zr(),ue=z(),de=A.length>1,M=x===`vertical`,N=X.useRef(null),P=X.useRef(null),fe=D(t=>{t&&P.current==null&&(P.current=e(t).getComputedStyle(t))}),I=X.useRef(null),L=X.useRef(0),R=X.useRef(0),B=s(A);function pe(e){w.current!==e&&(w.current=e);let t=k.current[e];if(!t){C.current=null,S.current=null;return}S.current=t.querySelector(`input[type="range"]`)}function he(e){let t=N.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=si(P.current,M),c=R.current,l=(M?r:n)-s.start-s.end-c*2,u=C.current??0,d=e.x-u,f=e.y-u,p=dt(((M?i-f-s.end:(ue===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(_-v)*p+v;if(m=ri(m,O,v),m=dt(m,v,_),!de)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let g=ai({behavior:ce,values:A,currentValues:B.current??A,initialValues:T.current,pressedIndex:h,nextValue:m,min:v,max:_,step:O,minStepsBetweenValues:y});return ce===`swap`&&g.didSwap?pe(g.thumbIndex):w.current=g.thumbIndex,g}function ge(e){T.current=de?A.slice():null,B.current=A;let t=w.current,n=t;if(t>-1&&t<A.length){if(A[t]===_){let e=t;for(;e>0&&A[e-1]===_;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(le(a)){let o=ti(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&pe(n),f){let e=k.current[n];le(e)&&(R.current=e.getBoundingClientRect()[M?`height`:`width`]/2)}}function V(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let H=D(e=>{let t=ci(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){U(e);return}let r=he(t);r!=null&&Jr(r.value,O,y)&&(!d&&L.current>oi&&ie(!0),ae(r.value,F(n,e,void 0,{activeThumbIndex:r.thumbIndex})),B.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&V(r.thumbIndex))});function U(e){re(-1),ie(!1),S.current=null,C.current=null;let t=ci(e,I),n=t==null?null:he(t);if(n!=null){let t=m.current;b(p.current??n.value,h(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),w.current=-1,I.current=null,T.current=null,ye()}let ve=D(e=>{if(u)return;let t=e.changedTouches[0];t!=null&&(I.current=t.identifier);let n=ci(e,I);if(n!=null){ge(n);let t=he(n);if(t==null)return;V(t.thumbIndex),ae(t.value,F(j,e,void 0,{activeThumbIndex:t.thumbIndex})),B.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&V(t.thumbIndex)}L.current=0;let r=E(N.current);r.addEventListener(`touchmove`,H,{passive:!0}),r.addEventListener(`touchend`,U,{passive:!0})}),ye=D(()=>{let e=E(N.current);e.removeEventListener(`pointermove`,H),e.removeEventListener(`pointerup`,U),e.removeEventListener(`touchmove`,H),e.removeEventListener(`touchend`,U),T.current=null}),W=ne();return X.useEffect(()=>{let e=N.current;if(!e)return()=>ye();let t=g(e,`touchstart`,ve,{passive:!0});return()=>{t(),W.cancel(),ye()}},[ye,ve,N,W]),X.useEffect(()=>{u&&ye()},[u,ye]),r(`div`,t,{state:oe,ref:[i,ee,N,fe],props:[{"data-base-ui-slider-control":te?``:void 0,onPointerDown(e){let t=N.current,n=_e(e.nativeEvent);if(!t||u||e.defaultPrevented||!le(n)||e.button!==0)return;let r=ci(e,I);if(r!=null){ge(r);let n=he(r);if(n==null)return;me(k.current[n.thumbIndex],se(E(t)))?e.preventDefault():W.request(()=>{V(n.thumbIndex)}),ie(!0),C.current??(ae(n.value,F(j,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),B.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&V(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0;let i=E(N.current);i.addEventListener(`pointermove`,H,{passive:!0}),i.addEventListener(`pointerup`,U,{once:!0})}},l],stateAttributesMapping:Yr})}),ui=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=Zr();return r(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Yr})}),di=R();function fi(){return T}function pi(){return!1}function mi(){return!0}function hi(){return(0,di.useSyncExternalStore)(fi,pi,mi)}var gi=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}({}),_i=new Set([..._,w,c]);function vi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${yt(e[t],r,n)} start range`:`${yt(e[t],r,n)} end range`:n?yt(e[t],r,n):void 0}function yi(e,t,n,r,i){let a=n===1?e+t:e-t;return dt(Number(a.toFixed(Math.max(ni(e),ni(t),ni(r)))),r,i)}var bi=X.forwardRef(function(t,n){let{render:a,children:o,className:s,"aria-describedby":l,"aria-label":u,"aria-labelledby":d,disabled:p=!1,getAriaLabel:m,getAriaValueText:h,id:g,index:v,inputRef:b,onBlur:S,onFocus:T,onKeyDown:E,tabIndex:ne,style:ae,...oe}=t,{nonce:se}=Ct(),O=k(g),{active:ce,lastUsedThumbIndex:A,controlRef:le,disabled:j,validation:ue,formatOptionsRef:M,handleInputChange:N,inset:P,labelId:fe,largeStep:F,locale:I,max:L,min:R,minStepsBetweenValues:B,form:pe,name:me,orientation:he,pressedInputRef:ge,pressedThumbCenterOffsetRef:_e,pressedThumbIndexRef:V,renderBeforeHydration:H,setActive:U,setIndicatorPosition:ve,state:ye,step:W,values:G}=Zr(),be=z(),xe=p||j,Se=G.length>1,Ce=he===`vertical`,we=be===`rtl`,{setTouched:Te,setFocused:Ee,validationMode:De}=lt(),Oe=X.useRef(null),ke=X.useRef(null),Ae=X.useRef(!1),je=k(),Me=ut(),Ne=Se?je:Me,{ref:Pe,index:Fe}=nt({metadata:X.useMemo(()=>({inputId:Ne}),[Ne])}),K=Se?v??Fe:0,Ie=K===G.length-1,Le=G[K],Re=St(Le,R,L),[ze,Be]=X.useState(),Ve=hi(),He=A>=0&&A<G.length?A:-1,Ue=D(()=>{let e=le.current,t=Oe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Re/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Be(s),K===0?ve(e=>[s,e[1]]):Ie&&ve(e=>[e[0],s])});re(()=>{P&&queueMicrotask(Ue)},[Ue,P]),re(()=>{P&&Ue()},[Ue,P,Re]),re(()=>{if(!P)return;let t=le.current,n=Oe.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ue);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[le,Ue,P]);let We=Ce?`bottom`:`insetInlineStart`,Ge=Ce?`left`:`top`,Ke;Se?ce===K?Ke=2:He===K&&(Ke=1):ce===K&&(Ke=1);let qe;qe=P?{"--position":`${ze??0}%`,visibility:H&&Ve||ze===void 0?`hidden`:void 0,position:`absolute`,[We]:`var(--position)`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:Number.isFinite(Re)?{position:`absolute`,[We]:`${Re}%`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:ee;let Je;he===`vertical`&&(Je=we?`vertical-rl`:`vertical-lr`);let Ye=typeof m==`function`?m(K):u,Xe=ie({"aria-label":Ye,"aria-labelledby":d??(Ye==null?fe:void 0),"aria-describedby":l,"aria-orientation":he,"aria-valuenow":Le,"aria-valuetext":typeof h==`function`?h(yt(Le,I,M.current??void 0),Le,K):vi(G,K,M.current??void 0,I),disabled:xe,form:pe,id:Ne,max:L,min:R,name:me,onChange(e){N(e.currentTarget.valueAsNumber,K,e)},onFocus(e){let t=Ae.current;Ae.current=!1,U(K),Ee(!0),t&&e.stopPropagation()},onBlur(e){if(Ae.current){e.stopPropagation();return}Oe.current&&(U(-1),Te(!0),Ee(!1),De===`onBlur`&&ue.commit(qr(Le,K,R,L,Se,G)))},onKeyDown(e){if(!_i.has(e.key))return;_.has(e.key)&&e.stopPropagation();let t=null,n=ri(Le,W,R);switch(e.key){case f:t=yi(n,e.shiftKey?F:W,1,R,L);break;case i:t=yi(n,e.shiftKey?F:W,we?-1:1,R,L);break;case y:t=yi(n,e.shiftKey?F:W,-1,R,L);break;case x:t=yi(n,e.shiftKey?F:W,we?1:-1,R,L);break;case w:t=yi(n,F,1,R,L);break;case c:t=yi(n,F,-1,R,L);break;case`End`:t=L,Se&&(t=Number.isFinite(G[K+1])?G[K+1]-W*B:L);break;case C:t=R,Se&&(t=Number.isFinite(G[K-1])?G[K-1]+W*B:R);break;default:break}if(t!==null){let n=e.currentTarget;de(n)||(Ae.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),N(t,K,e),e.preventDefault()}},step:W,style:{...ee,width:`100%`,height:`100%`,writingMode:Je},tabIndex:ne??void 0,type:`range`,value:Le??``},ue.getInputValidationProps),Ze=te(ke,ue.inputRef,b);return r(`div`,t,{state:ye,ref:[n,Pe,Oe],props:[{[gi.index]:K,children:(0,Z.jsxs)(X.Fragment,{children:[o,(0,Z.jsx)(`input`,{ref:Ze,...Xe,suppressHydrationWarning:!0}),P&&Ve&&H&&Ie&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:O,onBlur:S,onFocus:T,onPointerDown(e){if(V.current=K,Oe.current!=null){let t=he===`horizontal`?`x`:`y`,n=ti(Oe.current);_e.current=(he===`horizontal`?e.clientX:e.clientY)-n[t]}ke.current!=null&&ge.current!==ke.current&&(ge.current=ke.current)},style:qe,suppressHydrationWarning:H||void 0},oe],stateAttributesMapping:Yr})});function xi(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 Si(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 Ci=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=Zr(),h=hi(),g=d===`vertical`,_=m.length>1,v=c?xi(g,_,s[0],s[1],f,h):Si(g,_,St(m[0],u,l),St(m[m.length-1],u,l));return r(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Yr})});function wi({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:v(`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)(li,{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)(ui,{"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)(Ci,{"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)(bi,{"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 Ti=X.createContext(void 0);function Ei(){let e=X.useContext(Ti);if(e===void 0)throw Error(m(63));return e}var Di=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,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}({}),Oi={...ot,checked(e){return e?{[Di.checked]:``}:{[Di.unchecked]:``}}};function ki(e,t,n,r=!0,i){let[a,o]=X.useState(),s=k(i?`${i}-label`:void 0),c=e??t??a;return re(()=>{let i=e||t||!r?void 0:Ai(n.current,s);a!==i&&o(i)}),c}function Ai(e,t){let n=ji(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ji(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Mi=X.forwardRef(function(t,n){let{checked:i,className:a,defaultChecked:s,"aria-labelledby":c,form:u,id:f,inputRef:p,name:m,nativeButton:h=!1,onCheckedChange:g,readOnly:_=!1,required:v=!1,disabled:y=!1,render:b,uncheckedValue:x,value:S,style:C,...w}=t,{clearErrors:T}=wt(),{state:E,setTouched:ne,setDirty:ae,validityData:D,setFilled:oe,setFocused:se,shouldValidateOnChange:O,validationMode:ce,disabled:A,name:le,validation:j}=lt(),{labelId:ue}=gt(),de=A||y,M=le??m,N=X.useRef(null),P=te(N,p,j.inputRef),fe=X.useRef(null),I=k(),L=ut({id:f,implicit:!1,controlRef:fe}),R=h?void 0:L,[z,pe]=tt({controlled:i,default:!!s,name:`Switch`,state:`checked`});at(fe,I,z),re(()=>{N.current&&oe(N.current.checked)},[N,oe]),he(z,()=>{T(M),ae(z!==D.initialValue),oe(z),O()?j.commit(z):j.commit(z,!0)});let{getButtonProps:me,buttonRef:ge}=o({disabled:de,native:h}),_e=ki(c,ue,N,!h,R),V={id:h?L:I,role:`switch`,"aria-checked":z,"aria-readonly":_||void 0,"aria-required":v||void 0,"aria-labelledby":_e,onFocus(){de||se(!0)},onBlur(){let e=N.current;!e||de||(ne(!0),se(!1),ce===`onBlur`&&j.commit(e.checked))},onClick(t){if(_||de)return;t.preventDefault();let n=N.current;n&&n.dispatchEvent(new(e(n)).PointerEvent(`click`,{bubbles:!0,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}},H=ie({checked:z,disabled:de,form:u,id:R,name:M,required:v,style:M?d:ee,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:P,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(_){e.preventDefault();return}let t=e.currentTarget.checked,n=F(B,e.nativeEvent);g?.(t,n),!n.isCanceled&&pe(t)},onFocus(){fe.current?.focus()}},j.getInputValidationProps,S===void 0?l:{value:S}),U=X.useMemo(()=>({...E,checked:z,disabled:de,readOnly:_,required:v}),[E,z,de,_,v]),ve=r(`span`,t,{state:U,ref:[n,fe,ge],props:[V,j.getValidationProps,w,me],stateAttributesMapping:Oi});return(0,Z.jsxs)(Ti.Provider,{value:U,children:[ve,!z&&M&&x!==void 0&&(0,Z.jsx)(`input`,{type:`hidden`,form:u,name:M,value:x}),(0,Z.jsx)(`input`,{...H,suppressHydrationWarning:!0})]})}),Ni=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e;return r(`span`,e,{state:Ei(),ref:t,stateAttributesMapping:Oi,props:o})});function Pi({className:e,...t}){return(0,Z.jsx)(Mi,{"data-slot":`switch`,className:v(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,Z.jsx)(Ni,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var Fi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ii=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]}),Li=(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}),Ri=e=>(e/10).toFixed(1),zi=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},Bi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Vi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ri(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ri(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(wi,{"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)(jt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Et,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Bi(n)??e;a(!1),r(Ri(i)),t(i)},onChange:e=>{let n=zi(e.target.value);r(n);let i=Bi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(Ot,{align:`inline-end`,children:(0,Z.jsx)(Tt,{children:`%`})})]})]})}function Hi({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:i}){let o=Te(i),s=o.data,c=Pe(s?.bundle_id??``),l=c.data,u=l?an(l):null,d=we(s?.scope_key??``),f=Ae(),p=ke(),m=Ce(),h=Ie(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),[x,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1),[E,ee]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(!1),[re,ie]=(0,X.useState)(``),[D,se]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{_(s?Ii(s):null),C(``)},[s]);let O=s?Ii(s):null,k=g!==null&&O!==null&&JSON.stringify(g)!==JSON.stringify(O),A=p.isPending||f.isPending||m.isPending||h.isPending,le=()=>{if(!A){if(k){T(!0);return}t(!1)}},j=()=>{if(!g)return;let e=en(v);if(!nn(e)){C(rn);return}_({...g,targetCohorts:Array.from(new Set([...g.targetCohorts,e]))}),y(``),C(``)},de=async()=>{if(!s||!g)return;let e=g.targetCohorts.map(en);if(e.some(e=>!nn(e))){C(rn);return}if(s.strategy===`APP_VERSION`&&!Lr(g.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:Li(s,{...g,targetCohorts:e}),releaseId:s.id};C(``);try{await p.mutateAsync(n),await f.mutateAsync(n),Jt.success(`Bundle settings saved`),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},M=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,P=e.filter(e=>e.id!==s?.channel_id),fe=P.map(e=>({label:e.name,value:e.name})),F=re.trim(),I=D===`copy`,L=g?Lr(g.targetAppVersion.trim()):null,R=()=>{ie(``),se(`move`)},z=e=>{!e&&h.isPending||(ne(e),e||R())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{onOpenChange:e=>e?void 0:le(),open:r,children:(0,Z.jsxs)(oe,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(ge,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ce,{children:`Bundle Detail`}),(0,Z.jsx)(pe,{className:`sr-only`,children:`Edit bundle delivery settings.`}),s?(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)(st,{className:`size-4`,platform:s.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:s.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)(ct,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in app`})]})]}),(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:M})]}),(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:s.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(b,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[o.isError?(0,Z.jsxs)(Ge,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundle details could not be loaded`}),(0,Z.jsx)($e,{children:o.error.message})]}):null,s&&g?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[M?(0,Z.jsx)(Le,{release:{platform:s.platform,channel:M,releaseId:s.id,builtIn:!s.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)(Je,{className:`gap-6`,children:[(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(kt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>_({...g,message:e.target.value}),rows:3,value:g.message})]}),s.strategy===`APP_VERSION`?(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>_({...g,targetAppVersion:e.target.value}),value:g.targetAppVersion}),L?(0,Z.jsx)(Ye,{children:L}):null]}):null,(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(We,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Pi,{"aria-label":`Enabled`,checked:g.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>_({...g,enabled:e})})]}),(0,Z.jsx)(Ye,{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.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Pi,{"aria-label":`Force update`,checked:g.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>_({...g,shouldForceUpdate:e})})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Vi,{onChange:e=>_({...g,rolloutCohortCount:e}),value:g.rolloutCohortCount})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(We,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Ur,{releaseId:s.id,rolloutCohortCount:g.rolloutCohortCount,targetCohorts:g.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),j())},placeholder:`e.g. qa-team…`,value:v}),(0,Z.jsx)(a,{"aria-label":`Add cohort`,disabled:!v.trim(),onClick:j,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ft,{})})]}),g.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.targetCohorts.map(e=>(0,Z.jsxs)(q,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>_({...g,targetCohorts:g.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ye,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Ze,{children:x}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:!k||A,onClick:de,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(S,{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)(a,{className:`w-full`,disabled:s.kind!==`BUNDLE`||A,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(a,{className:`w-full`,disabled:A,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Jt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Mt,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:s.enabled||A,onClick:()=>ee(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(b,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Build details are unavailable`}),(0,Z.jsx)($e,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,Z.jsx)(Vr,{bundle:l,release:s}):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:s.bundle_id??`Built-in app`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:s.revision})]}),u?(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:u})]}):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:d.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:d.data?`${d.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:s.scope_key}),n?(0,Z.jsx)(a,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>n(s.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),d.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(xe,{onOpenChange:T,open:w,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(ve,{children:`Discard unsaved changes?`}),(0,Z.jsx)(H,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Keep editing`}),(0,Z.jsx)(ye,{onClick:()=>{T(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(xe,{onOpenChange:ee,open:E,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Remove this Bundle from `,M??`the channel`,`?`]}),(0,Z.jsx)(H,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Cancel`}),(0,Z.jsx)(ye,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),Jt.success(`Bundle removed from ${M??`the channel`}`),ee(!1),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Vt,{onOpenChange:z,open:te,children:(0,Z.jsxs)(Lt,{showCloseButton:!h.isPending,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Promote to Channel`}),(0,Z.jsx)(zt,{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)(Xe,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:Fi,onValueChange:e=>se(e),value:D,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(_t,{placeholder:`Select an action`})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(xt,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:I?`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)(Xe,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:fe,onValueChange:e=>ie(e??``),value:re||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(_t,{placeholder:`Select a channel`})}),(0,Z.jsx)(ft,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:P.map(e=>(0,Z.jsx)(xt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(It,{children:[(0,Z.jsx)(a,{disabled:h.isPending,onClick:()=>z(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(a,{disabled:!F||h.isPending,onClick:async()=>{if(s)try{await h.mutateAsync({action:D,expectedRevision:s.revision,releaseId:s.id,targetChannel:F}),z(!1),Jt.success(I?`Bundle copied to ${F}`:`Bundle moved to ${F}`)}catch(e){Jt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:h.isPending?I?`Copying…`:`Moving…`:I?`Copy`:`Move`})]})]})})]})}function Ui({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(qe,{className:`size-3`}):(0,Z.jsx)(dn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Wi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(q,{className:v(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Kt,{className:`h-3 w-3`}):null,r,`%`]})}var Gi=20,Ki=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],qi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ji=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Yi=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function Xi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let o=Be(i),s=i.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)(fe,{className:`-ml-1`}),(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)(mn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(ht,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(xt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(ht,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:i.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(xt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(ht,{disabled:!s&&i.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:i.enabled===void 0?`all`:i.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(xt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(xt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(a,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(_n,{})}),i.bundleId?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,i.scopeKey?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(a,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(N,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Zi({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)(a,{"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-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(rt,{}):(0,Z.jsx)(De,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(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)(ct,{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)(Dt,{className:`size-3.5`}),` Built-in app`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(dn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Qi({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=Pe(r),a=je(r);return i.isError||a.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Patch lineage could not be loaded.`}):i.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:t,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):i.data?(0,Z.jsx)(Dn,{bundle:i.data,bundles:a.data??[],loading:a.isPending,onDetailClick:e,panelId:t}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Bundle details are unavailable.`})}function $i(){let e=Ue.useSearch(),t=Ue.useNavigate(),n=M(),[r,i]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),c=Ne({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Ve(e),limit:Gi}),l=Oe().data??[],u=c.data?.data??[],d=K(Array.from(new Set(u.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},f=c.data?.next,m=c.data?.previous,h=u.flatMap(e=>{let t=l.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),g=He(),_=10+g.length,y=new Map(l.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!u.some(e=>e.id===o)&&s(void 0)},[o,u]);let x=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>x(ze(e,t)),C=t=>{let n=u.find(e=>e.bundle_id===t.id);if(s(void 0),n){x({...e,releaseId:n.id},!1);return}S({bundleId:t.id})},w=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,T=m?{...e,afterReleaseId:m,beforeReleaseId:void 0,releaseId:void 0}:null,E=f?{...e,afterReleaseId:void 0,beforeReleaseId:f,releaseId:void 0}:null,ee={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(Xi,{channels:l,onChange:S,onClear:()=>x({}),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:[c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundles could not be loaded`}),(0,Z.jsx)($e,{children:c.error.message})]}):(0,Z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:c.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Z.jsx)(b,{className:`h-44 w-full`},t))}):u.length?u.map(t=>{let n=y.get(t.channel_id)??t.channel_id,r=t.bundle_id?d[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{className:v(`flex flex-col gap-4 border-b p-4 last:border-b-0`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 transition-[background-color,filter] focus-within:saturate-100 motion-reduce:transition-none`,i&&`border-b-0 bg-primary/5`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Zi,{expanded:i,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(i?void 0:t.id),release:t}),(0,Z.jsx)(bn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Z.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Z.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ji.format(t.created_at_ms)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),g.map(({Cell:e,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})})]},n)),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(Ui,{release:t}),t.should_force_update?(0,Z.jsx)(q,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:t.target_app_version??t.fingerprint_hash??`—`})]}),(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:t.message||`—`})]})]})]})]}),i&&t.bundle_id?(0,Z.jsx)(Qi,{onDetailClick:C,panelId:a,release:t}):null]},t.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{className:`bg-muted/40`,children:(0,Z.jsxs)(cn,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,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`})]})}),(0,Z.jsxs)(sn,{children:[c.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{colSpan:_,children:(0,Z.jsx)(b,{className:`h-8 w-full`})})},t)):u.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(cn,{"aria-label":`Open bundle ${t.id}`,className:v(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:n=>{n.target instanceof Element&&n.target.closest(`button, a, input, select, textarea`)||x({...e,releaseId:t.id},!1)},onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...e,releaseId:t.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Zi,{expanded:n,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:y.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:t.bundle_id&&d[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&d[t.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[d[t.bundle_id],` `,d[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:t.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Re,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:t.target_app_version})]}):t.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(pn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(At,{maxLength:12,value:t.fingerprint_hash})]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{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)(xn,{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)(Wi,{percentage:t.rollout_cohort_count/10})}),g.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ji.format(t.created_at_ms),children:Yi.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Z.jsx)(cn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:_,children:(0,Z.jsx)(Qi,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!c.isPending&&u.length===0?(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!c.isError&&!c.isPending?(0,Z.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:u.length}),` `,u.length===1?`entry`:`entries`,`, newest first`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[w?(0,Z.jsx)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:ee,to:`/`,children:`Newest`}):null,T?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}),E?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:E,to:`/`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Hi,{channels:l,onOpenChange:t=>!t&&x({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(On,{onOpenChange:i,open:r})]})}export{$i as component};
|
|
1
|
+
import{$n as e,$r as t,$t as n,Bn as r,F as i,Fn as a,Gn as o,Gt as s,H as c,Hn as l,Hr as u,Ht as d,I as f,In as p,Jn as m,Jt as h,Kt as g,L as _,Ln as v,M as y,Nn as b,P as x,Pn as S,R as C,U as w,Un as T,Ut as E,Vt as ee,Wn as te,Wt as ne,Xn as re,Yn as ie,Z as ae,Zn as D,_ as oe,_n as se,ar as O,b as ce,ct as k,ei as A,er as le,fn as j,g as ue,gn as de,h as M,ir as N,ni as P,p as fe,qt as F,rn as I,sn as L,sr as R,st as z,un as B,v as pe,vn as me,w as he,y as ge,yn as _e}from"./sidebar-RBvHzq8e.js";import{l as V}from"./console-features-api-BhUIxeL-.js";import{a as H,i as U,l as ve,n as ye,o as W,r as G,s as be,t as xe}from"./alert-dialog-DXxrSU0G.js";import{a as Se,c as Ce,d as we,f as Te,g as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as K,u as Ie}from"./api-BiZP_i-u.js";import{a as Le,c as Re,i as ze,n as Be,r as Ve,s as He,t as Ue}from"./routes-DyZCr794.js";import{a as We,c as Ge,d as Ke,f as qe,i as Je,n as Ye,o as Xe,r as Ze,s as q,t as Qe,u as $e}from"./field-bPoDrs6K.js";import{a as et,i as tt,n as nt,o as rt,r as it}from"./useCompositeListItem-BxJspDxS.js";import{A as at,F as ot,I as st,L as ct,N as lt,O as ut,_ as dt,a as ft,c as pt,h as mt,i as ht,k as gt,l as _t,m as vt,n as yt,o as bt,s as xt,t as St,u as Ct,v as wt}from"./valueToPercent-Ci2-fmWp.js";import{a as Tt,i as Et,l as Dt,n as Ot,o as kt,s as At,t as jt,u as Mt}from"./input-group-_PD0i7wZ.js";import{t as Nt}from"./loader-circle-iTGehfyV.js";import{a as Pt,c as Ft,i as It,n as Lt,o as Rt,r as zt,s as Bt,t as Vt}from"./dialog-DxjO7ofz.js";import{a as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./card-DKr2pZMA.js";import{n as Jt}from"./dist-BzWwzt98.js";import{c as Yt,d as Xt,f as Zt,h as Qt,l as $t,m as en,o as tn,p as nn,s as rn,u as an}from"./InsightsInfo-NUuLFYqg.js";import{a as on,i as J,n as sn,o as cn,r as Y,t as ln}from"./table-BYmouPt9.js";var un=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),dn=O(`circle-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]),fn=O(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),pn=O(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),mn=O(`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`}]]),hn=O(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),gn=O(`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`}]]),_n=O(`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`}]]),vn=O(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),X=P(t(),1),Z=u(),yn={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function bn({channel:e,className:t}){return(0,Z.jsx)(q,{variant:`outline`,className:v(yn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function xn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(qe,{className:v(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(hn,{className:v(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(N,{className:v(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Sn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),ee=E.prototype;return w.prototype=ee,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){ee[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Cn=A(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),wn=P(Sn(),1),Tn=P(Cn(),1);wn.default.extend(Tn.default);function En({uuid:e,format:t=`relative`}){let n=(0,wn.default)(tn(e));return t===`relative`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function Dn({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:i}){let o=M();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:e,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)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(q,{variant:`outline`,children:[n.length,` `,n.length===1?`patch`:`patches`]})]}),r?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):n.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:n.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)(ct,{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)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(En,{uuid:e.id})})]})]}),(0,Z.jsx)(a,{className:`w-full`,onClick:()=>i(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)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{children:(0,Z.jsxs)(cn,{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)(sn,{children:n.map(e=>(0,Z.jsxs)(cn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(ct,{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)(ct,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Ee,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(ct,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(En,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(a,{onClick:()=>i(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 On({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,o]=(0,X.useState)(null),{data:s=[],isPending:c}=Oe(),l=Me(),u=Fe(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});r(``),e.inserted?Jt.success(`Channel ${e.row.name} created`):Jt.info(`Channel ${e.row.name} already exists`)}catch(e){Jt.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?Jt.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?Jt.error(`Channel ${i.name} is still in use and cannot be deleted`):Jt.error(`Channel ${i.name} no longer exists`),o(null)}catch(e){Jt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(Lt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsxs)(Rt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(gn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(zt,{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)(Je,{className:`gap-2`,children:(0,Z.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ae,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(a,{type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(Nt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Ft,{"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)(Nt,{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.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Z.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(vn,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(xe,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&o(null)},children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Delete `,i?.name,`?`]}),(0,Z.jsx)(H,{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)(W,{children:[(0,Z.jsx)(G,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(ye,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var kn=`[a-zA-Z0-9-]`,An=String.raw`0|[1-9]\d*`,jn=String.raw`\d+`,Mn=String.raw`\d*[a-zA-Z-]${kn}*`,Nn=String.raw`(${An})\.(${An})\.(${An})`,Pn=String.raw`(${jn})\.(${jn})\.(${jn})`,Fn=`(?:${Mn}|${An})`,In=`(?:${Mn}|${jn})`,Ln=String.raw`(?:-(${Fn}(?:\.${Fn})*))`,Rn=String.raw`(?:-?(${In}(?:\.${In})*))`,zn=`${kn}+`,Bn=String.raw`(?:\+(${zn}(?:\.${zn})*))`,Vn=`v?${Nn}${Ln}?${Bn}?`,Hn=String.raw`[v=\s]*${Pn}${Rn}?${Bn}?`,Un=`((?:<|>)?=?)`,Wn=String.raw`${An}|x|X|\*`,Gn=String.raw`${jn}|x|X|\*`,Kn=String.raw`[v=\s]*(${Wn})(?:\.(${Wn})(?:\.(${Wn})(?:${Ln})?${Bn}?)?)?`,qn=String.raw`[v=\s]*(${Gn})(?:\.(${Gn})(?:\.(${Gn})(?:${Rn})?${Bn}?)?)?`,Jn=`(?:~>?)`,Yn=String.raw`(?:\^)`,Xn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Xn}(?:$|[^\d])`,String.raw`${Xn}(?:${Ln})?(?:${Bn})?(?:$|[^\d])`;function Zn(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[kn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Q(e,t){return new RegExp(Zn(e),t)}var Qn=Q(`^${Vn}$`),$n=Q(`^${Hn}$`),er=/^\d+$/;function tr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function nr(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?$n:Qn);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(er.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 rr=Q(String.raw`^${Un}\s*(${Vn})$|^$`),ir=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function ar(e){return e.version?`${e.operator}${tr(e.version)}`:``}function or(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?ir:rr);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?nr(r[2],t):null;return{operator:i,options:t,value:a?`${i}${tr(a)}`:``,version:a}}function sr(e){return e.sets.map(e=>e.map(ar).join(` `)).join(`||`)}var cr=new RegExp(Bn,`g`),lr=Q(Bn),ur=Q(String.raw`^\s*(${Kn})\s+-\s+(${Kn})\s*$`),dr=Q(String.raw`^\s*(${qn})\s+-\s+(${qn})\s*$`),fr=Q(String.raw`(\s*)${Un}\s*(${Hn}|${Kn})`,`g`),pr=Q(String.raw`(\s*)${Jn}\s+`,`g`),mr=Q(String.raw`(\s*)${Yn}\s+`,`g`),hr=Q(`^${Jn}${Kn}$`),gr=Q(`^${Jn}${qn}$`),_r=Q(`^${Yn}${Kn}$`),vr=Q(`^${Yn}${qn}$`),yr=Q(String.raw`^${Un}\s*${Kn}$`),br=Q(String.raw`^${Un}\s*${qn}$`),xr=Q(String.raw`(<|>)?=?\s*\*`),Sr=/^\s*>=\s*0\.0\.0\s*$/,Cr=/^\s*>=\s*0\.0\.0-0\s*$/,wr=Q(String.raw`^${Un}\s*(${Hn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Tr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Er(e,t){let n=t.loose?gr: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 Dr(e,t){return e.trim().split(/\s+/).map(e=>Er(e,t)).join(` `)}function Or(e,t){let n=t.loose?vr:_r,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?t===`0`?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0${r} <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${i}-${a} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${i} <${t}.${n}.${Number(i)+1}-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${Number(t)+1}.0.0-0`)}function kr(e,t){return e.trim().split(/\s+/).map(e=>Or(e,t)).join(` `)}function Ar(e,t){let n=t.loose?br:yr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Tr(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=$(c),f=d||$(l),p=f||$(u);if(s===`=`&&p&&(s=``),d)return s===`>`||s===`<`?`<0.0.0-0`:`*`;let m=t.includePrerelease?`-0`:``;return s&&p?(f&&(l=0),u=0,s===`>`?(s=`>=`,f?(c=Number(c)+1,l=0):l=Number(l)+1):s===`<=`&&(s=`<`,f?c=Number(c)+1:l=Number(l)+1),s===`<`&&(m=`-0`),`${s}${c}.${l}.${u}${m}`):f?`>=${c}.0.0${m} <${Number(c)+1}.0.0-0`:p?`>=${c}.${l}.0${m} <${c}.${Number(l)+1}.0-0`:n})}function jr(e,t){return e.split(/\s+/).map(e=>Ar(e,t)).join(` `)}function Mr(e,t){let n=t.loose?dr:ur;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 Nr(e,t){return jr(Dr(kr(e.replace(lr,``),t),t),t).trim().replace(xr,``)}function Pr(e,t){let n=Mr(e.replace(cr,``),t).replace(fr,`$1$2$3`).replace(pr,`$1~`).replace(mr,`$1^`).split(` `).map(e=>Nr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Cr:Sr,``));t.loose&&(n=n.filter(e=>wr.test(e)));let r=new Map;for(let e of n.map(e=>or(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 Fr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Pr(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 Ir(e,t={}){try{return Fr(e,t)}catch{return null}}function Lr(e,t={}){let n=Ir(e,t);return n?sr(n)||`*`:null}var Rr=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},zr=(e,t)=>{if(!e?.trim())return null;let n=Rr(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function Br({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 Vr({bundle:e,release:t}){let{data:n,isFetched:r}=Se(),i=e?Zt(e):null,a=e?Xt(e):null,o=e?.gitCommitHash&&r?zr(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)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Br,{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)(Br,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(At,{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)(fn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Br,{label:`Manifest hash`,value:(0,Z.jsx)(At,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Br,{label:`Base hash`,value:(0,Z.jsx)(At,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Br,{label:`Patch hash`,value:(0,Z.jsx)(At,{maxLength:16,value:i})}):null]})})]}):null}var Hr=Array.from({length:Yt},(e,t)=>t+1);function Ur({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),i=n??[],o=i.length>0,s=r>0&&r<1e3,c=r===Yt,l=M(),u=c?Hr:s?Hr.filter(t=>$t(e,t)<r):[],d=(r/10).toFixed(1),f=c?Yt:u.length,p=Yt-f,m=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Selected cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(qt,{children:(0,Z.jsxs)(Ht,{className:`p-4`,children:[(0,Z.jsx)(Gt,{children:`Excluded cohorts`}),(0,Z.jsx)(Wt,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(qt,{children:[(0,Z.jsxs)(Ht,{className:`p-4 pb-3`,children:[(0,Z.jsx)(Wt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(Gt,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(qt,{children:[(0,Z.jsx)(Ht,{className:`p-4 pb-3`,children:(0,Z.jsx)(Wt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:u.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:u.map(e=>(0,Z.jsx)(q,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Vt,{children:[(0,Z.jsxs)(Bt,{render:(0,Z.jsx)(a,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(et,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(Lt,{className:l?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(Pt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:m}),(0,Z.jsx)(It,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(zt,{children:[d,`% includes `,f,` of`,` `,Yt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(It,{showCloseButton:!0})]})})]})}function Wr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Gr(e,t){return e-t}function Kr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Gr)}function qr(e,t,n,r,i,a){let o=e;return o=dt(o,n,r),i&&(o=Kr(a,t,dt(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Jr(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 Yr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},Xr=X.createContext(void 0);function Zr(){let e=X.useContext(Xr);if(e===void 0)throw Error(m(62));return e}function Qr(e){return`key`in e?L:I}function $r(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Wr(e,t):!1}var ei=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:i,defaultValue:a,disabled:o=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:g=0,form:_,name:v,onValueChange:y,onValueCommitted:b,orientation:x=`horizontal`,step:S=1,thumbCollisionBehavior:C=`push`,thumbAlignment:w=`center`,value:T,style:ee,...te}=e,ne=k(c),ie=vt(ne),ae=D(y),oe=D(b),{clearErrors:O}=wt(),{state:ce,disabled:A,name:le,setTouched:j,setDirty:ue,validityData:de,shouldValidateOnChange:M,validation:N}=lt(),{labelId:P}=gt(),[fe,I]=X.useState(),L=n??mt(P,fe),R=A||o,z=le??v,[B,pe]=tt({controlled:T,default:a??m,name:`Slider`}),ge=X.useRef(null),_e=X.useRef(null),V=X.useRef([]),H=X.useRef(null),U=X.useRef(null),ve=X.useRef(-1),ye=X.useRef(null),W=X.useRef(null),G=X.useRef(`none`),be=s(l),[xe,Se]=X.useState(-1),[Ce,we]=X.useState(-1),[Te,Ee]=X.useState(!1),[De,Oe]=X.useState(()=>new Map),[ke,Ae]=X.useState([void 0,void 0]),je=D(e=>{Se(e),e!==-1&&we(e)});at(_e,ne,B),he(B,()=>{O(z),M()?N.commit(B):N.commit(B,!0);let e=de.initialValue,t;t=Array.isArray(B)&&Array.isArray(e)?!Wr(B,e):B!==e,ue(t)});let Me=D(e=>{e&&(_e.current=e)}),Ne=Array.isArray(B),Pe=X.useMemo(()=>Ne?B.slice().sort(Gr):[dt(B,m,p)],[p,m,Ne,B]),Fe=D((e,t)=>{if(Number.isNaN(e)||$r(e,B))return;let n=t??F(`none`,void 0,void 0,{activeThumbIndex:-1});G.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:z}}),n.event=i,W.current=e,ae(e,n),!n.isCanceled&&pe(e)}),K=D((e,t,n)=>{let r=qr(e,t,m,p,Ne,Pe);if(Jr(r,S,g)){let e=Qr(n);Fe(r,F(e,n.nativeEvent,void 0,{activeThumbIndex:t})),j(!0),oe(W.current??r,h(e,n.nativeEvent))}});re(()=>{let e=se(E(ge.current));R&&me(ge.current,e)&&e.blur()},[R]),R&&xe!==-1&&je(-1);let Ie=X.useMemo(()=>({...ce,activeThumbIndex:xe,disabled:R,dragging:Te,orientation:x,max:p,min:m,minStepsBetweenValues:g,step:S,values:Pe}),[ce,xe,R,Te,p,m,g,x,S,Pe]),Le=X.useMemo(()=>({active:xe,controlRef:_e,disabled:R,dragging:Te,validation:N,formatOptionsRef:be,handleInputChange:K,indicatorPosition:ke,inset:w!==`center`,labelId:L,rootLabelId:ie,largeStep:u,lastUsedThumbIndex:Ce,lastChangedValueRef:W,lastChangeReasonRef:G,form:_,locale:d,max:p,min:m,minStepsBetweenValues:g,name:z,onValueCommitted:oe,orientation:x,pressedInputRef:H,pressedThumbCenterOffsetRef:U,pressedThumbIndexRef:ve,pressedValuesRef:ye,registerFieldControlRef:Me,renderBeforeHydration:w===`edge`,setActive:je,setDragging:Ee,setIndicatorPosition:Ae,setLabelId:I,setValue:Fe,state:Ie,step:S,thumbCollisionBehavior:C,thumbMap:De,thumbRefs:V,values:Pe}),[xe,_e,L,ie,R,Te,N,be,K,ke,u,Ce,W,G,_,d,p,m,g,z,oe,x,H,U,ve,ye,Me,je,Ee,Ae,I,Fe,Ie,S,C,w,De,V,Pe]),Re=r(`div`,e,{state:Ie,ref:[t,ge],props:[{"aria-labelledby":L,id:ne,role:`group`},N.getValidationProps,te],stateAttributesMapping:Yr});return(0,Z.jsx)(Xr.Provider,{value:Le,children:(0,Z.jsx)(it,{elementsRef:V,onMapChange:Oe,children:Re})})});function ti(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ni(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 ri(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ni(t),ni(n))))}function ii({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]=dt(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]=dt(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]=dt(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ai({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=dt(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=ii({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=dt(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:ii({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=dt(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 oi=2;function si(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 ci(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 li=X.forwardRef(function(t,i){let{render:a,className:o,style:c,...l}=t,{disabled:u,dragging:d,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:_,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:S,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:ee,renderBeforeHydration:te,setActive:re,setDragging:ie,setValue:ae,state:oe,step:O,thumbCollisionBehavior:ce,thumbRefs:k,values:A}=Zr(),ue=z(),de=A.length>1,M=x===`vertical`,N=X.useRef(null),P=X.useRef(null),fe=D(t=>{t&&P.current==null&&(P.current=e(t).getComputedStyle(t))}),I=X.useRef(null),L=X.useRef(0),R=X.useRef(0),B=s(A);function pe(e){w.current!==e&&(w.current=e);let t=k.current[e];if(!t){C.current=null,S.current=null;return}S.current=t.querySelector(`input[type="range"]`)}function he(e){let t=N.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=si(P.current,M),c=R.current,l=(M?r:n)-s.start-s.end-c*2,u=C.current??0,d=e.x-u,f=e.y-u,p=dt(((M?i-f-s.end:(ue===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(_-v)*p+v;if(m=ri(m,O,v),m=dt(m,v,_),!de)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let g=ai({behavior:ce,values:A,currentValues:B.current??A,initialValues:T.current,pressedIndex:h,nextValue:m,min:v,max:_,step:O,minStepsBetweenValues:y});return ce===`swap`&&g.didSwap?pe(g.thumbIndex):w.current=g.thumbIndex,g}function ge(e){T.current=de?A.slice():null,B.current=A;let t=w.current,n=t;if(t>-1&&t<A.length){if(A[t]===_){let e=t;for(;e>0&&A[e-1]===_;)--e;n=e}}else{let t=M?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(le(a)){let o=ti(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&pe(n),f){let e=k.current[n];le(e)&&(R.current=e.getBoundingClientRect()[M?`height`:`width`]/2)}}function V(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let H=D(e=>{let t=ci(e,I);if(t==null)return;if(L.current+=1,e.type===`pointermove`&&e.buttons===0){U(e);return}let r=he(t);r!=null&&Jr(r.value,O,y)&&(!d&&L.current>oi&&ie(!0),ae(r.value,F(n,e,void 0,{activeThumbIndex:r.thumbIndex})),B.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&V(r.thumbIndex))});function U(e){re(-1),ie(!1),S.current=null,C.current=null;let t=ci(e,I),n=t==null?null:he(t);if(n!=null){let t=m.current;b(p.current??n.value,h(t,e))}`pointerType`in e&&N.current?.hasPointerCapture(e.pointerId)&&N.current?.releasePointerCapture(e.pointerId),w.current=-1,I.current=null,T.current=null,ye()}let ve=D(e=>{if(u)return;let t=e.changedTouches[0];t!=null&&(I.current=t.identifier);let n=ci(e,I);if(n!=null){ge(n);let t=he(n);if(t==null)return;V(t.thumbIndex),ae(t.value,F(j,e,void 0,{activeThumbIndex:t.thumbIndex})),B.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&V(t.thumbIndex)}L.current=0;let r=E(N.current);r.addEventListener(`touchmove`,H,{passive:!0}),r.addEventListener(`touchend`,U,{passive:!0})}),ye=D(()=>{let e=E(N.current);e.removeEventListener(`pointermove`,H),e.removeEventListener(`pointerup`,U),e.removeEventListener(`touchmove`,H),e.removeEventListener(`touchend`,U),T.current=null}),W=ne();return X.useEffect(()=>{let e=N.current;if(!e)return()=>ye();let t=g(e,`touchstart`,ve,{passive:!0});return()=>{t(),W.cancel(),ye()}},[ye,ve,N,W]),X.useEffect(()=>{u&&ye()},[u,ye]),r(`div`,t,{state:oe,ref:[i,ee,N,fe],props:[{"data-base-ui-slider-control":te?``:void 0,onPointerDown(e){let t=N.current,n=_e(e.nativeEvent);if(!t||u||e.defaultPrevented||!le(n)||e.button!==0)return;let r=ci(e,I);if(r!=null){ge(r);let n=he(r);if(n==null)return;me(k.current[n.thumbIndex],se(E(t)))?e.preventDefault():W.request(()=>{V(n.thumbIndex)}),ie(!0),C.current??(ae(n.value,F(j,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),B.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&V(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),L.current=0;let i=E(N.current);i.addEventListener(`pointermove`,H,{passive:!0}),i.addEventListener(`pointerup`,U,{once:!0})}},l],stateAttributesMapping:Yr})}),ui=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=Zr();return r(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Yr})}),di=R();function fi(){return T}function pi(){return!1}function mi(){return!0}function hi(){return(0,di.useSyncExternalStore)(fi,pi,mi)}var gi=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}({}),_i=new Set([..._,w,c]);function vi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${yt(e[t],r,n)} start range`:`${yt(e[t],r,n)} end range`:n?yt(e[t],r,n):void 0}function yi(e,t,n,r,i){let a=n===1?e+t:e-t;return dt(Number(a.toFixed(Math.max(ni(e),ni(t),ni(r)))),r,i)}var bi=X.forwardRef(function(t,n){let{render:a,children:o,className:s,"aria-describedby":l,"aria-label":u,"aria-labelledby":d,disabled:p=!1,getAriaLabel:m,getAriaValueText:h,id:g,index:v,inputRef:b,onBlur:S,onFocus:T,onKeyDown:E,tabIndex:ne,style:ae,...oe}=t,{nonce:se}=Ct(),O=k(g),{active:ce,lastUsedThumbIndex:A,controlRef:le,disabled:j,validation:ue,formatOptionsRef:M,handleInputChange:N,inset:P,labelId:fe,largeStep:F,locale:I,max:L,min:R,minStepsBetweenValues:B,form:pe,name:me,orientation:he,pressedInputRef:ge,pressedThumbCenterOffsetRef:_e,pressedThumbIndexRef:V,renderBeforeHydration:H,setActive:U,setIndicatorPosition:ve,state:ye,step:W,values:G}=Zr(),be=z(),xe=p||j,Se=G.length>1,Ce=he===`vertical`,we=be===`rtl`,{setTouched:Te,setFocused:Ee,validationMode:De}=lt(),Oe=X.useRef(null),ke=X.useRef(null),Ae=X.useRef(!1),je=k(),Me=ut(),Ne=Se?je:Me,{ref:Pe,index:Fe}=nt({metadata:X.useMemo(()=>({inputId:Ne}),[Ne])}),K=Se?v??Fe:0,Ie=K===G.length-1,Le=G[K],Re=St(Le,R,L),[ze,Be]=X.useState(),Ve=hi(),He=A>=0&&A<G.length?A:-1,Ue=D(()=>{let e=le.current,t=Oe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Re/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Be(s),K===0?ve(e=>[s,e[1]]):Ie&&ve(e=>[e[0],s])});re(()=>{P&&queueMicrotask(Ue)},[Ue,P]),re(()=>{P&&Ue()},[Ue,P,Re]),re(()=>{if(!P)return;let t=le.current,n=Oe.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ue);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[le,Ue,P]);let We=Ce?`bottom`:`insetInlineStart`,Ge=Ce?`left`:`top`,Ke;Se?ce===K?Ke=2:He===K&&(Ke=1):ce===K&&(Ke=1);let qe;qe=P?{"--position":`${ze??0}%`,visibility:H&&Ve||ze===void 0?`hidden`:void 0,position:`absolute`,[We]:`var(--position)`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:Number.isFinite(Re)?{position:`absolute`,[We]:`${Re}%`,[Ge]:`50%`,translate:`${(Ce||!we?-1:1)*50}% ${(Ce?1:-1)*50}%`,zIndex:Ke}:ee;let Je;he===`vertical`&&(Je=we?`vertical-rl`:`vertical-lr`);let Ye=typeof m==`function`?m(K):u,Xe=ie({"aria-label":Ye,"aria-labelledby":d??(Ye==null?fe:void 0),"aria-describedby":l,"aria-orientation":he,"aria-valuenow":Le,"aria-valuetext":typeof h==`function`?h(yt(Le,I,M.current??void 0),Le,K):vi(G,K,M.current??void 0,I),disabled:xe,form:pe,id:Ne,max:L,min:R,name:me,onChange(e){N(e.currentTarget.valueAsNumber,K,e)},onFocus(e){let t=Ae.current;Ae.current=!1,U(K),Ee(!0),t&&e.stopPropagation()},onBlur(e){if(Ae.current){e.stopPropagation();return}Oe.current&&(U(-1),Te(!0),Ee(!1),De===`onBlur`&&ue.commit(qr(Le,K,R,L,Se,G)))},onKeyDown(e){if(!_i.has(e.key))return;_.has(e.key)&&e.stopPropagation();let t=null,n=ri(Le,W,R);switch(e.key){case f:t=yi(n,e.shiftKey?F:W,1,R,L);break;case i:t=yi(n,e.shiftKey?F:W,we?-1:1,R,L);break;case y:t=yi(n,e.shiftKey?F:W,-1,R,L);break;case x:t=yi(n,e.shiftKey?F:W,we?1:-1,R,L);break;case w:t=yi(n,F,1,R,L);break;case c:t=yi(n,F,-1,R,L);break;case`End`:t=L,Se&&(t=Number.isFinite(G[K+1])?G[K+1]-W*B:L);break;case C:t=R,Se&&(t=Number.isFinite(G[K-1])?G[K-1]+W*B:R);break;default:break}if(t!==null){let n=e.currentTarget;de(n)||(Ae.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),N(t,K,e),e.preventDefault()}},step:W,style:{...ee,width:`100%`,height:`100%`,writingMode:Je},tabIndex:ne??void 0,type:`range`,value:Le??``},ue.getInputValidationProps),Ze=te(ke,ue.inputRef,b);return r(`div`,t,{state:ye,ref:[n,Pe,Oe],props:[{[gi.index]:K,children:(0,Z.jsxs)(X.Fragment,{children:[o,(0,Z.jsx)(`input`,{ref:Ze,...Xe,suppressHydrationWarning:!0}),P&&Ve&&H&&Ie&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:O,onBlur:S,onFocus:T,onPointerDown(e){if(V.current=K,Oe.current!=null){let t=he===`horizontal`?`x`:`y`,n=ti(Oe.current);_e.current=(he===`horizontal`?e.clientX:e.clientY)-n[t]}ke.current!=null&&ge.current!==ke.current&&(ge.current=ke.current)},style:qe,suppressHydrationWarning:H||void 0},oe],stateAttributesMapping:Yr})});function xi(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 Si(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 Ci=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=Zr(),h=hi(),g=d===`vertical`,_=m.length>1,v=c?xi(g,_,s[0],s[1],f,h):Si(g,_,St(m[0],u,l),St(m[m.length-1],u,l));return r(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Yr})});function wi({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:v(`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)(li,{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)(ui,{"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)(Ci,{"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)(bi,{"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 Ti=X.createContext(void 0);function Ei(){let e=X.useContext(Ti);if(e===void 0)throw Error(m(63));return e}var Di=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,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}({}),Oi={...ot,checked(e){return e?{[Di.checked]:``}:{[Di.unchecked]:``}}};function ki(e,t,n,r=!0,i){let[a,o]=X.useState(),s=k(i?`${i}-label`:void 0),c=e??t??a;return re(()=>{let i=e||t||!r?void 0:Ai(n.current,s);a!==i&&o(i)}),c}function Ai(e,t){let n=ji(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ji(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Mi=X.forwardRef(function(t,n){let{checked:i,className:a,defaultChecked:s,"aria-labelledby":c,form:u,id:f,inputRef:p,name:m,nativeButton:h=!1,onCheckedChange:g,readOnly:_=!1,required:v=!1,disabled:y=!1,render:b,uncheckedValue:x,value:S,style:C,...w}=t,{clearErrors:T}=wt(),{state:E,setTouched:ne,setDirty:ae,validityData:D,setFilled:oe,setFocused:se,shouldValidateOnChange:O,validationMode:ce,disabled:A,name:le,validation:j}=lt(),{labelId:ue}=gt(),de=A||y,M=le??m,N=X.useRef(null),P=te(N,p,j.inputRef),fe=X.useRef(null),I=k(),L=ut({id:f,implicit:!1,controlRef:fe}),R=h?void 0:L,[z,pe]=tt({controlled:i,default:!!s,name:`Switch`,state:`checked`});at(fe,I,z),re(()=>{N.current&&oe(N.current.checked)},[N,oe]),he(z,()=>{T(M),ae(z!==D.initialValue),oe(z),O()?j.commit(z):j.commit(z,!0)});let{getButtonProps:me,buttonRef:ge}=o({disabled:de,native:h}),_e=ki(c,ue,N,!h,R),V={id:h?L:I,role:`switch`,"aria-checked":z,"aria-readonly":_||void 0,"aria-required":v||void 0,"aria-labelledby":_e,onFocus(){de||se(!0)},onBlur(){let e=N.current;!e||de||(ne(!0),se(!1),ce===`onBlur`&&j.commit(e.checked))},onClick(t){if(_||de)return;t.preventDefault();let n=N.current;n&&n.dispatchEvent(new(e(n)).PointerEvent(`click`,{bubbles:!0,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}},H=ie({checked:z,disabled:de,form:u,id:R,name:M,required:v,style:M?d:ee,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:P,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(_){e.preventDefault();return}let t=e.currentTarget.checked,n=F(B,e.nativeEvent);g?.(t,n),!n.isCanceled&&pe(t)},onFocus(){fe.current?.focus()}},j.getInputValidationProps,S===void 0?l:{value:S}),U=X.useMemo(()=>({...E,checked:z,disabled:de,readOnly:_,required:v}),[E,z,de,_,v]),ve=r(`span`,t,{state:U,ref:[n,fe,ge],props:[V,j.getValidationProps,w,me],stateAttributesMapping:Oi});return(0,Z.jsxs)(Ti.Provider,{value:U,children:[ve,!z&&M&&x!==void 0&&(0,Z.jsx)(`input`,{type:`hidden`,form:u,name:M,value:x}),(0,Z.jsx)(`input`,{...H,suppressHydrationWarning:!0})]})}),Ni=X.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e;return r(`span`,e,{state:Ei(),ref:t,stateAttributesMapping:Oi,props:o})});function Pi({className:e,...t}){return(0,Z.jsx)(Mi,{"data-slot":`switch`,className:v(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,Z.jsx)(Ni,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var Fi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ii=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]}),Li=(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}),Ri=e=>(e/10).toFixed(1),zi=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},Bi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Vi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ri(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ri(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(wi,{"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)(jt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Et,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Bi(n)??e;a(!1),r(Ri(i)),t(i)},onChange:e=>{let n=zi(e.target.value);r(n);let i=Bi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(Ot,{align:`inline-end`,children:(0,Z.jsx)(Tt,{children:`%`})})]})]})}function Hi({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:i}){let o=Te(i),s=o.data,c=Pe(s?.bundle_id??``),l=c.data,u=l?an(l):null,d=we(s?.scope_key??``),f=Ae(),p=ke(),m=Ce(),h=Ie(),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),[x,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1),[E,ee]=(0,X.useState)(!1),[te,ne]=(0,X.useState)(!1),[re,ie]=(0,X.useState)(``),[D,se]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{_(s?Ii(s):null),C(``)},[s]);let O=s?Ii(s):null,k=g!==null&&O!==null&&JSON.stringify(g)!==JSON.stringify(O),A=p.isPending||f.isPending||m.isPending||h.isPending,le=()=>{if(!A){if(k){T(!0);return}t(!1)}},j=()=>{if(!g)return;let e=en(v);if(!nn(e)){C(rn);return}_({...g,targetCohorts:Array.from(new Set([...g.targetCohorts,e]))}),y(``),C(``)},de=async()=>{if(!s||!g)return;let e=g.targetCohorts.map(en);if(e.some(e=>!nn(e))){C(rn);return}if(s.strategy===`APP_VERSION`&&!Lr(g.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:Li(s,{...g,targetCohorts:e}),releaseId:s.id};C(``);try{await p.mutateAsync(n),await f.mutateAsync(n),Jt.success(`Bundle settings saved`),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},M=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,P=e.filter(e=>e.id!==s?.channel_id),fe=P.map(e=>({label:e.name,value:e.name})),F=re.trim(),I=D===`copy`,L=g?Lr(g.targetAppVersion.trim()):null,R=()=>{ie(``),se(`move`)},z=e=>{!e&&h.isPending||(ne(e),e||R())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{onOpenChange:e=>e?void 0:le(),open:r,children:(0,Z.jsxs)(oe,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(ge,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ce,{children:`Bundle Detail`}),(0,Z.jsx)(pe,{className:`sr-only`,children:`Edit bundle delivery settings.`}),s?(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)(st,{className:`size-4`,platform:s.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:s.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)(ct,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.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:M})]}),(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:s.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(b,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[o.isError?(0,Z.jsxs)(Ge,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundle details could not be loaded`}),(0,Z.jsx)($e,{children:o.error.message})]}):null,s&&g?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[M?(0,Z.jsx)(Le,{release:{platform:s.platform,channel:M,releaseId:s.id,builtIn:!s.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)(Je,{className:`gap-6`,children:[(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(kt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>_({...g,message:e.target.value}),rows:3,value:g.message})]}),s.strategy===`APP_VERSION`?(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>_({...g,targetAppVersion:e.target.value}),value:g.targetAppVersion}),L?(0,Z.jsx)(Ye,{children:L}):null]}):null,(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsx)(We,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Pi,{"aria-label":`Enabled`,checked:g.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>_({...g,enabled:e})})]}),(0,Z.jsx)(Ye,{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.jsxs)(Qe,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Pi,{"aria-label":`Force update`,checked:g.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>_({...g,shouldForceUpdate:e})})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsx)(We,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Vi,{onChange:e=>_({...g,rolloutCohortCount:e}),value:g.rolloutCohortCount})]}),(0,Z.jsxs)(Qe,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(We,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Ur,{releaseId:s.id,rolloutCohortCount:g.rolloutCohortCount,targetCohorts:g.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ae,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),j())},placeholder:`e.g. qa-team…`,value:v}),(0,Z.jsx)(a,{"aria-label":`Add cohort`,disabled:!v.trim(),onClick:j,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ft,{})})]}),g.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.targetCohorts.map(e=>(0,Z.jsxs)(q,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>_({...g,targetCohorts:g.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ye,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)(Ze,{children:x}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:!k||A,onClick:de,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(S,{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)(a,{className:`w-full`,disabled:s.kind!==`BUNDLE`||A,onClick:()=>ne(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(a,{className:`w-full`,disabled:A,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Jt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Mt,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(a,{className:`w-full`,disabled:s.enabled||A,onClick:()=>ee(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(b,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Build details are unavailable`}),(0,Z.jsx)($e,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,Z.jsx)(Vr,{bundle:l,release:s}):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:s.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:s.revision})]}),u?(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:u})]}):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:d.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:d.data?`${d.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:s.scope_key}),n?(0,Z.jsx)(a,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>n(s.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),d.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(xe,{onOpenChange:T,open:w,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(ve,{children:`Discard unsaved changes?`}),(0,Z.jsx)(H,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Keep editing`}),(0,Z.jsx)(ye,{onClick:()=>{T(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(xe,{onOpenChange:ee,open:E,children:(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(be,{children:[(0,Z.jsxs)(ve,{children:[`Remove this Bundle from `,M??`the channel`,`?`]}),(0,Z.jsx)(H,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(G,{children:`Cancel`}),(0,Z.jsx)(ye,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),Jt.success(`Bundle removed from ${M??`the channel`}`),ee(!1),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Vt,{onOpenChange:z,open:te,children:(0,Z.jsxs)(Lt,{showCloseButton:!h.isPending,children:[(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Rt,{children:`Promote to Channel`}),(0,Z.jsx)(zt,{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)(Xe,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:Fi,onValueChange:e=>se(e),value:D,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(_t,{placeholder:`Select an action`})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(xt,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:I?`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)(Xe,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(ht,{disabled:h.isPending,items:fe,onValueChange:e=>ie(e??``),value:re||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(_t,{placeholder:`Select a channel`})}),(0,Z.jsx)(ft,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:P.map(e=>(0,Z.jsx)(xt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(It,{children:[(0,Z.jsx)(a,{disabled:h.isPending,onClick:()=>z(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(a,{disabled:!F||h.isPending,onClick:async()=>{if(s)try{await h.mutateAsync({action:D,expectedRevision:s.revision,releaseId:s.id,targetChannel:F}),z(!1),Jt.success(I?`Bundle copied to ${F}`:`Bundle moved to ${F}`)}catch(e){Jt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:h.isPending?I?`Copying…`:`Moving…`:I?`Copy`:`Move`})]})]})})]})}function Ui({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(qe,{className:`size-3`}):(0,Z.jsx)(dn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Wi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(q,{className:v(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Kt,{className:`h-3 w-3`}):null,r,`%`]})}var Gi=20,Ki=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],qi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ji=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Yi=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Xi=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function Zi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let o=Be(i),s=i.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)(fe,{className:`-ml-1`}),(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)(mn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(ht,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(xt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(ht,{disabled:!s,items:Ki,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:i.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(xt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(ht,{disabled:!s&&i.scopeKey===void 0,items:qi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:i.enabled===void 0?`all`:i.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(_t,{})}),(0,Z.jsx)(ft,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(xt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(xt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(xt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(a,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(_n,{})}),i.bundleId?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,i.scopeKey?(0,Z.jsxs)(q,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(N,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(a,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(N,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Qi({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)(a,{"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-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(rt,{}):(0,Z.jsx)(De,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(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)(ct,{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)(Dt,{className:`size-3.5`}),` Built-in bundle`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(dn,{className:`size-3.5`}),`Unreachable`]}):null]})}function $i({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=Pe(r),a=je(r);return i.isError||a.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Patch lineage could not be loaded.`}):i.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:t,children:[(0,Z.jsx)(b,{className:`h-10 w-full`}),(0,Z.jsx)(b,{className:`h-10 w-full`})]}):i.data?(0,Z.jsx)(Dn,{bundle:i.data,bundles:a.data??[],loading:a.isPending,onDetailClick:e,panelId:t}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Bundle details are unavailable.`})}function ea(){let e=Ue.useSearch(),t=Ue.useNavigate(),n=M(),[r,i]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),c=Ne({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Ve(e),limit:Gi}),l=Oe().data??[],u=c.data?.data??[],d=K(Array.from(new Set(u.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},f=c.data?.next,m=c.data?.previous,h=u.flatMap(e=>{let t=l.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),g=He(),_=10+g.length,y=new Map(l.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!u.some(e=>e.id===o)&&s(void 0)},[o,u]);let x=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>x(ze(e,t)),C=t=>{let n=u.find(e=>e.bundle_id===t.id);if(s(void 0),n){x({...e,releaseId:n.id},!1);return}S({bundleId:t.id})},w=e.afterReleaseId!==void 0||e.beforeReleaseId!==void 0,T=m?{...e,afterReleaseId:m,beforeReleaseId:void 0,releaseId:void 0}:null,E=f?{...e,afterReleaseId:void 0,beforeReleaseId:f,releaseId:void 0}:null,ee={...e,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(Zi,{channels:l,onChange:S,onClear:()=>x({}),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:[c.isError?(0,Z.jsxs)(Ge,{variant:`destructive`,children:[(0,Z.jsx)(Kt,{}),(0,Z.jsx)(Ke,{children:`Bundles could not be loaded`}),(0,Z.jsx)($e,{children:c.error.message})]}):(0,Z.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:c.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Z.jsx)(b,{className:`h-44 w-full`},t))}):u.length?u.map(t=>{let n=y.get(t.channel_id)??t.channel_id,r=t.bundle_id?d[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${t.id}`,className:v(`flex cursor-pointer touch-manipulation flex-col gap-4 border-b p-4 transition-[background-color,filter] last:border-b-0 hover:bg-muted/10 active:bg-muted/20 motion-reduce:transition-none data-[state=selected]:bg-muted/15`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:Xi(()=>x({...e,releaseId:t.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Qi,{expanded:i,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(i?void 0:t.id),release:t}),(0,Z.jsx)(bn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Z.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Z.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ji.format(t.created_at_ms)})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:(0,Z.jsx)(Wi,{percentage:t.rollout_cohort_count/10})})]}),(0,Z.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Z.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),g.map(({Cell:e,feature:n,label:r})=>(0,Z.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})})]},n)),(0,Z.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Z.jsx)(Ui,{release:t}),t.should_force_update?(0,Z.jsx)(q,{variant:`secondary`,children:`Force update`}):null]}),(0,Z.jsxs)(`div`,{className:`col-span-2 grid grid-cols-1 gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Z.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:t.target_app_version??t.fingerprint_hash??`—`})]}),(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:t.message||`—`})]})]})]})]}),i&&t.bundle_id?(0,Z.jsx)($i,{onDetailClick:C,panelId:a,release:t}):null]},t.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(ln,{className:`min-w-max`,children:[(0,Z.jsx)(on,{className:`bg-muted/40`,children:(0,Z.jsxs)(cn,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,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`})]})}),(0,Z.jsxs)(sn,{children:[c.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{colSpan:_,children:(0,Z.jsx)(b,{className:`h-8 w-full`})})},t)):u.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(cn,{"aria-label":`Open bundle ${t.id}`,className:v(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:Xi(()=>x({...e,releaseId:t.id},!1)),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...e,releaseId:t.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Qi,{expanded:n,onOpen:()=>x({...e,releaseId:t.id},!1),onToggleExpand:()=>s(n?void 0:t.id),release:t})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(bn,{channel:y.get(t.channel_id)??t.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(st,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:t.bundle_id&&d[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&d[t.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[d[t.bundle_id],` `,d[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:t.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Re,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:t.target_app_version})]}):t.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(pn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(At,{maxLength:12,value:t.fingerprint_hash})]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(xn,{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)(xn,{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)(Wi,{percentage:t.rollout_cohort_count/10})}),g.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:h})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ji.format(t.created_at_ms),children:Yi.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Z.jsx)(cn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:_,children:(0,Z.jsx)($i,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!c.isPending&&u.length===0?(0,Z.jsx)(cn,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:w?`No more bundles on this side.`:Be(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!c.isError&&!c.isPending?(0,Z.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Z.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:u.length}),` `,u.length===1?`entry`:`entries`,`, newest first`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[w?(0,Z.jsx)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:ee,to:`/`,children:`Newest`}):null,T?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}),E?(0,Z.jsxs)(V,{className:p({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:E,to:`/`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(a,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(De,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Hi,{channels:l,onOpenChange:t=>!t&&x({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(On,{onOpenChange:i,open:r})]})}export{ea as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CJSxovHS.js","assets/sidebar-RBvHzq8e.js","assets/alert-dialog-DXxrSU0G.js","assets/mutation-B4EZNS91.js","assets/valueToPercent-Ci2-fmWp.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/console-features-api-BhUIxeL-.js","assets/api-BiZP_i-u.js","assets/input-group-_PD0i7wZ.js","assets/dist-BzWwzt98.js","assets/loader-circle-iTGehfyV.js","assets/dialog-DxjO7ofz.js","assets/card-DKr2pZMA.js","assets/InsightsInfo-NUuLFYqg.js","assets/preload-helper-D9SUwQT7.js","assets/table-BYmouPt9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Hr as e,In as t,Ln as n,Nn as r,Pn as i,Ur as a,ar as o,cr as s,nr as c,rr as l}from"./sidebar-RBvHzq8e.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-BhUIxeL-.js";import{C as m,S as h,c as g,h as _,t as v,v as y,w as b}from"./preload-helper-D9SUwQT7.js";import{n as x}from"./loader-circle-iTGehfyV.js";import{a as S,i as C,n as w,o as T,t as E}from"./card-DKr2pZMA.js";import{n as D,t as O}from"./InsightsInfo-NUuLFYqg.js";var k=o(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),A=o(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),j=e(),M={apiKeys:{navigation:{icon:(0,j.jsx)(x,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,j.jsx)(f,{to:`/api-keys`,onClick:e})}}},N=l({method:`GET`}).middleware([c]).handler(a(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function P(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return s({queryKey:[`bundle-activity`,t],queryFn:()=>N({data:t}),enabled:t.length>0,staleTime:3e4})}var F=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],I=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},L=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function R(){return(0,j.jsx)(O,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function z({report:e,loading:t=!1,input:i,variant:a=`inline`}){if(!e)return t?(0,j.jsx)(r,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,j.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:L(e),c=(0,j.jsx)(`dl`,{className:n(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:F.map(({label:t,field:r,color:i})=>(0,j.jsxs)(`div`,{className:n(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,j.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:t}),(0,j.jsxs)(`dd`,{className:n(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,e[r]>0&&!(r===`downloads`&&o)?i:`text-muted-foreground`),children:[r===`downloads`&&o?(0,j.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):e[r].toLocaleString(),r===`failedLaunches`?(0,j.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,I(e),`)`]}):null]})]},r))});return(0,j.jsxs)(`div`,{className:n(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,j.jsx)(f,{className:`min-w-0 rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,to:`/insights`,search:{healthPlatform:i.platform,healthChannel:i.channel,releaseId:i.releaseId,bundleWindow:D(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,j.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,j.jsx)(R,{}):null]})}function B({input:e}){let t=g({platform:e.platform,channel:e.channel,releaseId:e.releaseId}),i=t.data;return(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,j.jsx)(`dl`,{children:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,j.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,j.jsxs)(`dd`,{className:n(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,j.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,y(_(i)),`)`]})]})]})}):t.isPending?(0,j.jsx)(r,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,j.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,j.jsx)(O,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function V({input:e}){let n=P([e]);return(0,j.jsxs)(E,{children:[(0,j.jsxs)(S,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,j.jsx)(T,{className:`text-sm font-medium`,children:`Insights`}),(0,j.jsx)(R,{})]}),(0,j.jsxs)(w,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,j.jsx)(z,{variant:`card`,input:e,loading:n.isFetching,report:n.data?.[e.releaseId]}),(0,j.jsx)(i,{}),(0,j.jsx)(B,{input:e})]}),(0,j.jsx)(C,{className:`px-4 pb-4`,children:(0,j.jsxs)(f,{className:t({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:e.platform,healthChannel:e.channel,releaseId:e.releaseId,bundleWindow:D(e.releaseId),healthChart:`adoption`},children:[(0,j.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function H({input:e}){return d(`insightsAnalytics`)?null:(0,j.jsxs)(E,{children:[(0,j.jsx)(S,{className:`px-4 pt-4 pb-3`,children:(0,j.jsx)(T,{className:`text-sm font-medium`,children:`Insights`})}),(0,j.jsx)(w,{className:`px-4 pb-4`,children:(0,j.jsx)(B,{input:e})})]})}function U({releaseId:e,releases:t}){let n=P(t);return(0,j.jsx)(z,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var W={Cell:U},G={insights:{navigation:{icon:(0,j.jsx)(h,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,j.jsx)(f,{to:`/insights`,onClick:t}):(0,j.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,j.jsx)(H,{input:e})},insightsAnalytics:{releaseColumn:W,releaseSection:({release:e})=>(0,j.jsx)(V,{input:e})},...M},K=Object.keys(p),q=()=>{let e=u().data?.features;return e===void 0?[]:K.flatMap(t=>{let n=G[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},J=()=>q().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function Y({release:e}){return q().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,j.jsx)(n,{release:e},t))}var X=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Z(e){let t=X(e.beforeReleaseId),n=t?void 0:X(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=X(e.bundleId),a=i?void 0:X(e.scopeKey),o=i||a?void 0:X(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:X(e.releaseId),scopeKey:a}}function Q(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function $(e){return Q(e).kind!==`all`}function ee(e,t){let n={...e,...t};return t.bundleId?Z({bundleId:n.bundleId}):t.scopeKey?Z({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Z({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Z({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var te=b(`/`)({component:m(()=>v(()=>import(`./routes-CJSxovHS.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])),`component`),validateSearch:Z});export{Y as a,A as c,ee as i,$ as n,q as o,Q as r,J as s,te as t};
|