@hot-updater/console 1.0.0-rc.46 → 1.0.0-rc.47
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/{index-DNqzBBQm.js → index-6o51GkFe.js} +1 -1
- package/.output/public/assets/{routes-CcHyRuhT.js → routes-B88Erkpk.js} +2 -2
- package/.output/public/assets/{routes-Cnc-0wCf.js → routes-CfzsAleC.js} +1 -1
- package/.output/server/{__23tanstack-start-server-fn-resolver-DBoGuFHl.mjs → __23tanstack-start-server-fn-resolver-wNsrC5RP.mjs} +40 -40
- package/.output/server/_ssr/{BundleIdDisplay-BLIcWfKh.mjs → BundleIdDisplay-BN_yzs7-.mjs} +2 -2
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-tkUa36qH.mjs → ConsoleFeatureUnavailable-Bo-j3Xkx.mjs} +5 -5
- package/.output/server/_ssr/{EventDetails-BfatDL9h.mjs → EventDetails-CohvHa6T.mjs} +6 -6
- package/.output/server/_ssr/{HashValueDisplay-Db7UyXRv.mjs → HashValueDisplay-ChmRwgp9.mjs} +2 -2
- package/.output/server/_ssr/{InsightsInfo-Bf5ScSi9.mjs → InsightsInfo-DJDOyhri.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-Bl-joCfN.mjs → InsightsPageHeader-CEajHA2h.mjs} +5 -5
- package/.output/server/_ssr/{NotFoundPage-Bi2qUsx1.mjs → NotFoundPage-BmDI-TTU.mjs} +2 -2
- package/.output/server/_ssr/{alert-dialog-sMWGv43S.mjs → alert-dialog-DYhgTygY.mjs} +1 -1
- package/.output/server/_ssr/{api-DtU13_AI.mjs → api-CkJ5zfP-.mjs} +3 -3
- package/.output/server/_ssr/{api-keys-B40C8x9k.mjs → api-keys-DVBxXOE6.mjs} +7 -7
- package/.output/server/_ssr/{api-keys-M8Dotim_.mjs → api-keys-daS3TW4f.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-Tag1hm3M.mjs → api-keys-rpc-Cqzq1ew2.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-D4Bj1ivx.mjs → api-rpc-CY1yVoPV.mjs} +4 -4
- package/.output/server/_ssr/{auth-rpc-sa9Klhqj.mjs → auth-rpc-BTlkcfMp.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-C7gBA8hC.mjs → auth.server-BfcrSHHM.mjs} +13 -27
- package/.output/server/_ssr/{config.server-RKYRoVbq.mjs → config.server-BNTou-FV.mjs} +3 -3
- package/.output/server/_ssr/{console-access-DQhcMCMv.mjs → console-access-DV0L5QBE.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-Bn7S9NPh.mjs → console-features-api-BB0eGm1y.mjs} +3 -3
- package/.output/server/_ssr/{console-features-rpc-M7C9V3UZ.mjs → console-features-rpc-vvXdG_Jn.mjs} +3 -3
- package/.output/server/_ssr/{dialog-CED2DFlP.mjs → dialog-CBdhkpSk.mjs} +1 -1
- package/.output/server/_ssr/{empty-X3Mb-0Rh.mjs → empty-BVLdvl5J.mjs} +2 -2
- package/.output/server/_ssr/{field-Bq9ez4V0.mjs → field-DVEmueAp.mjs} +2 -2
- package/.output/server/_ssr/{input-group-BDVVM0Zn.mjs → input-group-BKegW2hW.mjs} +1 -1
- package/.output/server/_ssr/{insights-CZfz7BbH.mjs → insights-Ba9gNBIM.mjs} +5 -5
- package/.output/server/_ssr/{insights-BDBmvZ6K.mjs → insights-DIUxXAsI.mjs} +18 -18
- package/.output/server/_ssr/{insights-api-BiflmVk6.mjs → insights-api-DjWRfXk7.mjs} +3 -3
- package/.output/server/_ssr/{insights-failures-rpc-D77GE8Sa.mjs → insights-failures-rpc-Z5yZCc1q.mjs} +4 -4
- package/.output/server/_ssr/{insights-recovery-rpc-giYcsG87.mjs → insights-recovery-rpc-BJ_UaRyZ.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-zGPxWSbl.mjs → insights-rpc-AbUMV-T2.mjs} +3 -3
- package/.output/server/_ssr/{insights-DGKnQkgB.mjs → insights-trzIiznD.mjs} +2 -2
- package/.output/server/_ssr/{insights-usage-rpc-DC6Bu-Um.mjs → insights-usage-rpc-BT8kENhw.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-B9F5Atkw.mjs → insights-usage-rpc-BkllFiHy.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-D9qvWJk0.mjs → insights_.distribution-BNFFVSWT.mjs} +11 -11
- package/.output/server/_ssr/{insights_.distribution-BUrD0M3t.mjs → insights_.distribution-BVpUh1qI.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-C2IgQYXY.mjs → insights_.distribution-C8adKkTW.mjs} +2 -2
- package/.output/server/_ssr/{installations-dAUE-ioO.mjs → installations-CYjdORi5.mjs} +10 -10
- package/.output/server/_ssr/{installations-BV0OM7Uy.mjs → installations-DlAhTja1.mjs} +2 -2
- package/.output/server/_ssr/{installations-C21DpVcb.mjs → installations-ajbybMmj.mjs} +4 -4
- package/.output/server/_ssr/{release-adoption-rpc-DFZ-Op6d.mjs → release-adoption-rpc-Cd84_HX-.mjs} +6 -6
- package/.output/server/_ssr/{releaseAdoption-2PJPA09N.mjs → releaseAdoption-CtOFkwli.mjs} +3 -3
- package/.output/server/_ssr/{remote-config-BFvOUuyk.mjs → remote-config-D5jG9du_.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-_tZx6Ge2.mjs → remote-config-D_zqJs1l.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-DFYC51RV.mjs → remote-config-i0uiV0MH.mjs} +15 -15
- package/.output/server/_ssr/{remote-config-rpc-CjHJ1ure.mjs → remote-config-rpc-BVUbAz9P.mjs} +3 -3
- package/.output/server/_ssr/{router-DhFb-pDT.mjs → router-Dxvg6cMi.mjs} +13 -13
- package/.output/server/_ssr/{routes-CFDo4Koe.mjs → routes-B88rzWV4.mjs} +8 -8
- package/.output/server/_ssr/{routes-BQmkLu_-.mjs → routes-D7E2ZhyU.mjs} +14 -14
- package/.output/server/_ssr/{select-OIka_qhv.mjs → select-BBg5QTMs.mjs} +1 -1
- package/.output/server/_ssr/{server-nJn93aLo.mjs → server-CRRQpHln.mjs} +3 -3
- package/.output/server/_ssr/{sidebar-DwaxcWKo.mjs → sidebar-CMcaTuNe.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{switch-C28pz0ID.mjs → switch-D3KIrQ_R.mjs} +2 -2
- package/.output/server/_ssr/{table-x55cOnVQ.mjs → table-x2zVKsax.mjs} +1 -1
- package/.output/server/_ssr/{tabs-CAsCh1zC.mjs → tabs-BYao6a0g.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-Cxw82E0f.mjs → _tanstack-start-manifest_v-55AGsehh.mjs} +5 -5
- package/.output/server/index.mjs +108 -108
- package/package.json +7 -7
- package/src/components/features/releases/ReleaseEditorSheet.tsx +1 -1
- package/src/lib/server/releaseAdoption.ts +2 -5
- package/src/lib/server/releaseReachability.ts +0 -1
package/.output/nitro.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/api-keys-DVTL_--f.js","assets/ConsoleFeatureUnavailable-jB4Loglh.js","assets/sidebar-DNVyJPfX.js","assets/console-features-api-BH5m_PtQ.js","assets/arrow-up-right-BtffZA6e.js","assets/NotFoundPage-DIqCpWa3.js","assets/empty-CuT2UhFp.js","assets/api-keys-CIO9L_wu.js","assets/alert-dialog-Bbk_4-WJ.js","assets/field-BBDpjIqu.js","assets/clipboard-DS9ucUQL.js","assets/key-round-wS_SIZ6b.js","assets/dialog-Bqbb7B0N.js","assets/refresh-cw-BYgoNCco.js","assets/dist-LxKJB-Vu.js","assets/table-Gm4qRWwE.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$r as e,Ar as t,Br as n,Dr as r,Er as i,Fn as a,Fr as o,Gr as s,Jr as c,Kr as l,Lr as u,Mr as d,Nr as f,Or as p,Pr as m,Qr as h,Tr as g,Ur as _,Vr as v,Wr as y,Xr as b,a as x,ar as S,c as C,d as w,ei as ee,f as te,i as ne,kr as re,l as ie,m as ae,n as oe,o as se,qr as ce,r as le,ri as T,rr as E,s as ue,t as de,ti as fe,tt as pe,u as D,wr as O,yr as me}from"./sidebar-DNVyJPfX.js";import{A as he,C as ge,D as _e,E as ve,F as ye,I as be,L as xe,M as Se,N as Ce,O as we,R as Te,S as Ee,T as De,_ as Oe,d as ke,f as Ae,g as je,h as Me,j as Ne,k as Pe,l as Fe,m as Ie,p as Le,r as Re,t as ze,u as Be,v as Ve,w as He,x as Ue,y as We}from"./console-features-api-BH5m_PtQ.js";import{c as Ge,t as Ke}from"./installations-BazSJXE0.js";import{a as qe,c as Je,d as Ye,f as Xe,h as Ze,l as Qe,p as $e,s as et,u as tt}from"./useCompositeListItem-9E4pj_CH.js";import{f as nt}from"./alert-dialog-Bbk_4-WJ.js";import{t as rt}from"./remote-config-Br56BODb.js";import{c as it,o as at,t as ot}from"./routes-
|
|
2
|
+
import{$r as e,Ar as t,Br as n,Dr as r,Er as i,Fn as a,Fr as o,Gr as s,Jr as c,Kr as l,Lr as u,Mr as d,Nr as f,Or as p,Pr as m,Qr as h,Tr as g,Ur as _,Vr as v,Wr as y,Xr as b,a as x,ar as S,c as C,d as w,ei as ee,f as te,i as ne,kr as re,l as ie,m as ae,n as oe,o as se,qr as ce,r as le,ri as T,rr as E,s as ue,t as de,ti as fe,tt as pe,u as D,wr as O,yr as me}from"./sidebar-DNVyJPfX.js";import{A as he,C as ge,D as _e,E as ve,F as ye,I as be,L as xe,M as Se,N as Ce,O as we,R as Te,S as Ee,T as De,_ as Oe,d as ke,f as Ae,g as je,h as Me,j as Ne,k as Pe,l as Fe,m as Ie,p as Le,r as Re,t as ze,u as Be,v as Ve,w as He,x as Ue,y as We}from"./console-features-api-BH5m_PtQ.js";import{c as Ge,t as Ke}from"./installations-BazSJXE0.js";import{a as qe,c as Je,d as Ye,f as Xe,h as Ze,l as Qe,p as $e,s as et,u as tt}from"./useCompositeListItem-9E4pj_CH.js";import{f as nt}from"./alert-dialog-Bbk_4-WJ.js";import{t as rt}from"./remote-config-Br56BODb.js";import{c as it,o as at,t as ot}from"./routes-B88Erkpk.js";import{b as st}from"./insights-api-BigAU9sZ.js";import{b as ct}from"./field-BBDpjIqu.js";import{l as lt}from"./dialog-Bqbb7B0N.js";import{n as ut,t as dt}from"./dist-LxKJB-Vu.js";import{t as ft}from"./NotFoundPage-DIqCpWa3.js";import{t as pt}from"./insights-CxZ2GCYV.js";import{t as mt}from"./insights_.distribution-DZtkibX1.js";var ht=fe((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function ne(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=ne,re=function(){ae.postMessage(null)}}else re=function(){_(ne,0)};function oe(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),gt=fe(((e,t)=>{t.exports=ht()})),_t=fe((t=>{var n=gt(),r=ee(),i=e();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,T=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function D(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function O(e,t){fe++,de[fe]=e.current,e.current=t}var me=pe(null),he=pe(null),ge=pe(null),_e=pe(null);function ve(e,t){switch(O(ge,t),O(he,e),O(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}D(me),O(me,e)}function ye(){D(me),D(he),D(ge)}function be(e){e.memoizedState!==null&&O(_e,e);var t=me.current,n=Hd(t,e.type);t!==n&&(O(he,e),O(me,n))}function xe(e){he.current===e&&(D(me),D(he)),_e.current===e&&(D(_e),Qf._currentValue=ue)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-
|
|
2
|
-
import{In as e,Ln as t,Nn as n,Pn as r,Ur as i,Wr as a,ar as o,cr as s,nr as c,rr as l}from"./sidebar-DNVyJPfX.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-BH5m_PtQ.js";import{a as ee,c as m,s as h}from"./useCompositeListItem-9E4pj_CH.js";import{_ as g,m as _,s as v,x as y}from"./insights-api-BigAU9sZ.js";import{_ as b,h as x,m as S,v as C,y as w}from"./field-BBDpjIqu.js";import{t as T}from"./key-round-wS_SIZ6b.js";import{s as te}from"./switch-DZ1TPwx-.js";import{n as E,t as D}from"./InsightsInfo-BNO0WznZ.js";var O=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`}]]),k=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`}]]),A=i(),j={apiKeys:{navigation:{icon:(0,A.jsx)(T,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/api-keys`,onClick:e})}}},M=l({method:`GET`}).middleware([c]).handler(a(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return s({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(D,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:e,loading:r=!1,input:i,variant:a=`inline`}){if(!e)return r?(0,A.jsx)(n,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:I(e),c=(0,A.jsx)(`dl`,{className:t(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:n,field:r,color:i})=>(0,A.jsxs)(`div`,{className:t(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n}),(0,A.jsxs)(`dd`,{className:t(`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,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):e[r].toLocaleString(),r===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(e),`)`]}):null]})]},r))});return(0,A.jsxs)(`div`,{className:t(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,A.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:E(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:e}){let r=v({platform:e.platform,channel:e.channel,releaseId:e.releaseId}),i=r.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:t(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,g(_(i)),`)`]})]})]})}):r.isPending?(0,A.jsx)(n,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(D,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:t}){let n=N([t]);return(0,A.jsxs)(S,{children:[(0,A.jsxs)(C,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(x,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:t,loading:n.isFetching,report:n.data?.[t.releaseId]}),(0,A.jsx)(r,{}),(0,A.jsx)(z,{input:t})]}),(0,A.jsx)(b,{className:`px-4 pb-4`,children:(0,A.jsxs)(f,{className:e({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:t.platform,healthChannel:t.channel,releaseId:t.releaseId,bundleWindow:E(t.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(O,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return d(`insightsAnalytics`)?null:(0,A.jsxs)(S,{children:[(0,A.jsx)(C,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(x,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(f,{to:`/insights`,onClick:t}):(0,A.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(te,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(p),J=()=>{let e=u().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:Z(e.releaseId),scopeKey:a}}function $(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function ne(e){return $(e).kind!==`all`}function re(e,t){let n={...e,...t};return t.bundleId?Q({bundleId:n.bundleId}):t.scopeKey?Q({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Q({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Q({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var ie=m(`/`)({component:h(()=>ee(()=>import(`./routes-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CfzsAleC.js","assets/sidebar-DNVyJPfX.js","assets/useCompositeListItem-9E4pj_CH.js","assets/console-features-api-BH5m_PtQ.js","assets/alert-dialog-Bbk_4-WJ.js","assets/select-BZZBXMkr.js","assets/field-BBDpjIqu.js","assets/switch-DZ1TPwx-.js","assets/valueToPercent-CH8GCHaL.js","assets/api-DCM0wr6O.js","assets/chevron-right-BqD5wtFb.js","assets/HashValueDisplay-BFX_kY3-.js","assets/dist-LxKJB-Vu.js","assets/list-CgrYiadM.js","assets/dialog-Bqbb7B0N.js","assets/input-group-ja_30qaF.js","assets/InsightsInfo-BNO0WznZ.js","assets/insights-api-BigAU9sZ.js","assets/table-Gm4qRWwE.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{In as e,Ln as t,Nn as n,Pn as r,Ur as i,Wr as a,ar as o,cr as s,nr as c,rr as l}from"./sidebar-DNVyJPfX.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-BH5m_PtQ.js";import{a as ee,c as m,s as h}from"./useCompositeListItem-9E4pj_CH.js";import{_ as g,m as _,s as v,x as y}from"./insights-api-BigAU9sZ.js";import{_ as b,h as x,m as S,v as C,y as w}from"./field-BBDpjIqu.js";import{t as T}from"./key-round-wS_SIZ6b.js";import{s as te}from"./switch-DZ1TPwx-.js";import{n as E,t as D}from"./InsightsInfo-BNO0WznZ.js";var O=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`}]]),k=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`}]]),A=i(),j={apiKeys:{navigation:{icon:(0,A.jsx)(T,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/api-keys`,onClick:e})}}},M=l({method:`GET`}).middleware([c]).handler(a(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return s({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(D,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:e,loading:r=!1,input:i,variant:a=`inline`}){if(!e)return r?(0,A.jsx)(n,{"aria-label":`Loading release insights`,className:a===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let o=i?.builtIn===!0,s=o?0:I(e),c=(0,A.jsx)(`dl`,{className:t(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:n,field:r,color:i})=>(0,A.jsxs)(`div`,{className:t(`flex`,a===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n}),(0,A.jsxs)(`dd`,{className:t(`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,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):e[r].toLocaleString(),r===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(e),`)`]}):null]})]},r))});return(0,A.jsxs)(`div`,{className:t(`flex`,a===`card`?`flex-col gap-2`:`items-center gap-1`),children:[i?(0,A.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:E(i.releaseId)},children:c}):c,a===`card`&&s>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,a===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:e}){let r=v({platform:e.platform,channel:e.channel,releaseId:e.releaseId}),i=r.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[i?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:t(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,g(_(i)),`)`]})]})]})}):r.isPending?(0,A.jsx)(n,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(D,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:t}){let n=N([t]);return(0,A.jsxs)(S,{children:[(0,A.jsxs)(C,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(x,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:t,loading:n.isFetching,report:n.data?.[t.releaseId]}),(0,A.jsx)(r,{}),(0,A.jsx)(z,{input:t})]}),(0,A.jsx)(b,{className:`px-4 pb-4`,children:(0,A.jsxs)(f,{className:e({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:t.platform,healthChannel:t.channel,releaseId:t.releaseId,bundleWindow:E(t.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(O,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return d(`insightsAnalytics`)?null:(0,A.jsxs)(S,{children:[(0,A.jsx)(C,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(w,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(x,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function H({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var U={Cell:H},W={insights:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(f,{to:`/insights`,onClick:t}):(0,A.jsx)(f,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:U,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},G={remoteConfig:{navigation:{icon:(0,A.jsx)(te,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(f,{to:`/remote-config`,onClick:e})}}},K={...W,...j,...G},q=Object.keys(p),J=()=>{let e=u().data?.features;return e===void 0?[]:q.flatMap(t=>{let n=K[t];return n!==void 0&&e[t]?[{...n,feature:t,label:p[t].label,features:e}]:[]})},Y=()=>J().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function X({release:e}){return J().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var Z=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Q(e){let t=Z(e.beforeReleaseId),n=t?void 0:Z(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=Z(e.bundleId),a=i?void 0:Z(e.scopeKey),o=i||a?void 0:Z(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,enabled:a||o?r:void 0,platform:s,releaseId:Z(e.releaseId),scopeKey:a}}function $(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function ne(e){return $(e).kind!==`all`}function re(e,t){let n={...e,...t};return t.bundleId?Q({bundleId:n.bundleId}):t.scopeKey?Q({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?Q({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):Q({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var ie=m(`/`)({component:h(()=>ee(()=>import(`./routes-CfzsAleC.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])),`component`),validateSearch:Q});export{X as a,k as c,re as i,ne as n,J as o,$ as r,Y as s,ie as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$n as e,$t as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,Nn as h,P as g,Pn as _,R as v,U as y,Un as b,Ur as x,Ut as S,Vt as C,Wn as w,Wt as ee,Xn as T,Yn as te,Z as ne,Zn as E,_ as re,_n as ie,ar as D,b as ae,ct as oe,ei as se,er as ce,fn as le,g as ue,gn as de,h as O,ir as k,p as fe,qt as pe,ri as me,rn as A,sn as j,sr as he,st as ge,v as _e,vn as ve,w as M,y as N,yn as ye}from"./sidebar-DNVyJPfX.js";import{l as P}from"./console-features-api-BH5m_PtQ.js";import{i as be,n as F,o as xe,r as Se}from"./useCompositeListItem-9E4pj_CH.js";import{a as I,i as L,l as R,n as Ce,o as z,r as we,s as B,t as V}from"./alert-dialog-Bbk_4-WJ.js";import{a as Te,c as Ee,d as H,f as De,h as Oe,i as ke,l as Ae,m as je,n as Me,o as Ne,p as Pe,r as Fe,s as Ie,t as Le,u as Re}from"./api-DCM0wr6O.js";import{a as ze,c as U,i as Be,n as W,r as Ve,s as He,t as Ue}from"./routes-CcHyRuhT.js";import{a as We,b as Ge,c as Ke,f as qe,g as Je,h as Ye,i as Xe,l as G,m as Ze,n as Qe,p as $e,r as et,t as tt,u as nt,v as rt,x as it,y as at}from"./field-BBDpjIqu.js";import{t as ot}from"./chevron-right-BqD5wtFb.js";import{A as st,D as ct,E as lt,M as ut,N as dt,P as ft,T as pt,a as mt,d as ht,f as gt,h as _t,i as vt,m as K,n as yt,o as bt,r as xt,t as St}from"./select-BZZBXMkr.js";import{r as Ct,t as wt}from"./HashValueDisplay-BFX_kY3-.js";import{t as Tt}from"./list-CgrYiadM.js";import{a as Et,c as Dt,i as Ot,l as kt,n as At,o as jt,r as Mt,s as Nt,t as Pt}from"./dialog-Bqbb7B0N.js";import{a as Ft,i as It,n as Lt,o as Rt,s as zt,t as Bt}from"./input-group-ja_30qaF.js";import{a as Vt,i as Ht,n as Ut,o as Wt,t as Gt}from"./switch-DZ1TPwx-.js";import{n as q}from"./dist-LxKJB-Vu.js";import{c as Kt,d as qt,f as Jt,h as Yt,l as Xt,m as Zt,o as Qt,p as $t,s as en,u as tn}from"./InsightsInfo-BNO0WznZ.js";import{a as nn,i as J,n as rn,o as an,r as Y,t as on}from"./table-Gm4qRWwE.js";import{i as sn,n as cn,t as ln}from"./valueToPercent-CH8GCHaL.js";var un=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),dn=D(`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=D(`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=D(`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=D(`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=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),gn=D(`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=D(`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=he();function yn(){return b}function bn(){return!1}function xn(){return!0}function Sn(){return(0,vn.useSyncExternalStore)(yn,bn,xn)}var X=me(se(),1),Z=x(),Cn={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 wn({channel:e,className:t}){return(0,Z.jsx)(G,{variant:`outline`,className:p(Cn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function Tn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(it,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(hn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(k,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var En=me(Vt(),1),Dn=me(Ht(),1);En.default.extend(Dn.default);function On({uuid:e,format:t=`relative`}){let n=(0,En.default)(Qt(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 kn({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:a}){let o=O();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id: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)(sn,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(G,{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)(h,{className:`h-10 w-full`}),(0,Z.jsx)(h,{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)(sn,{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)(sn,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Oe,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(sn,{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)(G,{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)(On,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(on,{className:`min-w-max`,children:[(0,Z.jsx)(nn,{children:(0,Z.jsxs)(an,{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)(rn,{children:n.map(e=>(0,Z.jsxs)(an,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(sn,{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)(sn,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Oe,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(sn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(G,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(On,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function An({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=Ut(a),{data:c=[],isPending:l}=ke(),u=Ne(),d=Ie(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?q.success(`Channel ${e.row.name} created`):q.info(`Channel ${e.row.name} already exists`)}catch(e){q.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?q.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?q.error(`Channel ${a.name} is still in use and cannot be deleted`):q.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){q.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Pt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(At,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsxs)(jt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(gn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Mt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:p,children:(0,Z.jsx)(Xe,{className:`gap-2`,children:(0,Z.jsxs)(tt,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ne,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)(kt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Dt,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(kt,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:c.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.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)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(Wt,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(V,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(L,{children:[(0,Z.jsxs)(B,{children:[(0,Z.jsxs)(R,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(I,{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)(z,{children:[(0,Z.jsx)(we,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Ce,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var jn=`[a-zA-Z0-9-]`,Mn=String.raw`0|[1-9]\d*`,Nn=String.raw`\d+`,Pn=String.raw`\d*[a-zA-Z-]${jn}*`,Fn=String.raw`(${Mn})\.(${Mn})\.(${Mn})`,In=String.raw`(${Nn})\.(${Nn})\.(${Nn})`,Ln=`(?:${Pn}|${Mn})`,Rn=`(?:${Pn}|${Nn})`,zn=String.raw`(?:-(${Ln}(?:\.${Ln})*))`,Bn=String.raw`(?:-?(${Rn}(?:\.${Rn})*))`,Vn=`${jn}+`,Hn=String.raw`(?:\+(${Vn}(?:\.${Vn})*))`,Un=`v?${Fn}${zn}?${Hn}?`,Wn=String.raw`[v=\s]*${In}${Bn}?${Hn}?`,Gn=`((?:<|>)?=?)`,Kn=String.raw`${Mn}|x|X|\*`,qn=String.raw`${Nn}|x|X|\*`,Jn=String.raw`[v=\s]*(${Kn})(?:\.(${Kn})(?:\.(${Kn})(?:${zn})?${Hn}?)?)?`,Yn=String.raw`[v=\s]*(${qn})(?:\.(${qn})(?:\.(${qn})(?:${Bn})?${Hn}?)?)?`,Xn=`(?:~>?)`,Zn=String.raw`(?:\^)`,Qn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Qn}(?:$|[^\d])`,String.raw`${Qn}(?:${zn})?(?:${Hn})?(?:$|[^\d])`;function $n(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[jn,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($n(e),t)}var er=Q(`^${Un}$`),tr=Q(`^${Wn}$`),nr=/^\d+$/;function rr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ir(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?tr:er);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(nr.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var ar=Q(String.raw`^${Gn}\s*(${Un})$|^$`),or=Q(String.raw`^${Gn}\s*(${Wn})$|^$`);function sr(e){return e.version?`${e.operator}${rr(e.version)}`:``}function cr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?or:ar);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ir(r[2],t):null;return{operator:i,options:t,value:a?`${i}${rr(a)}`:``,version:a}}function lr(e){return e.sets.map(e=>e.map(sr).join(` `)).join(`||`)}var ur=new RegExp(Hn,`g`),dr=Q(Hn),fr=Q(String.raw`^\s*(${Jn})\s+-\s+(${Jn})\s*$`),pr=Q(String.raw`^\s*(${Yn})\s+-\s+(${Yn})\s*$`),mr=Q(String.raw`(\s*)${Gn}\s*(${Wn}|${Jn})`,`g`),hr=Q(String.raw`(\s*)${Xn}\s+`,`g`),gr=Q(String.raw`(\s*)${Zn}\s+`,`g`),_r=Q(`^${Xn}${Jn}$`),vr=Q(`^${Xn}${Yn}$`),yr=Q(`^${Zn}${Jn}$`),br=Q(`^${Zn}${Yn}$`),xr=Q(String.raw`^${Gn}\s*${Jn}$`),Sr=Q(String.raw`^${Gn}\s*${Yn}$`),Cr=Q(String.raw`(<|>)?=?\s*\*`),wr=/^\s*>=\s*0\.0\.0\s*$/,Tr=/^\s*>=\s*0\.0\.0-0\s*$/,Er=Q(String.raw`^${Gn}\s*(${Wn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Dr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}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}.${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 kr(e,t){return e.trim().split(/\s+/).map(e=>Or(e,t)).join(` `)}function Ar(e,t){let n=t.loose?br:yr,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 jr(e,t){return e.trim().split(/\s+/).map(e=>Ar(e,t)).join(` `)}function Mr(e,t){let n=t.loose?Sr:xr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Dr(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 Nr(e,t){return e.split(/\s+/).map(e=>Mr(e,t)).join(` `)}function Pr(e,t){let n=t.loose?pr:fr;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 Fr(e,t){return Nr(kr(jr(e.replace(dr,``),t),t),t).trim().replace(Cr,``)}function Ir(e,t){let n=Pr(e.replace(ur,``),t).replace(mr,`$1$2$3`).replace(hr,`$1~`).replace(gr,`$1^`).split(` `).map(e=>Fr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Tr:wr,``));t.loose&&(n=n.filter(e=>Er.test(e)));let r=new Map;for(let e of n.map(e=>cr(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Lr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Ir(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 Rr(e,t={}){try{return Lr(e,t)}catch{return null}}function zr(e,t={}){let n=Rr(e,t);return n?lr(n)||`*`:null}var Br=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$/,``)},Vr=(e,t)=>{if(!e?.trim())return null;let n=Br(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 Hr({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 Ur({bundle:e,release:t}){let{data:n,isFetched:r}=Te(),i=e?Jt(e):null,a=e?qt(e):null,o=e?.gitCommitHash&&r?Vr(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)(Ze,{children:[(0,Z.jsx)(rt,{className:`p-4 pb-3`,children:(0,Z.jsx)(at,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ye,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Hr,{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)(Hr,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(wt,{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)(Hr,{label:`Manifest hash`,value:(0,Z.jsx)(wt,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Hr,{label:`Base hash`,value:(0,Z.jsx)(wt,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Hr,{label:`Patch hash`,value:(0,Z.jsx)(wt,{maxLength:16,value:i})}):null]})})]}):null}var Wr=Array.from({length:Kt},(e,t)=>t+1);function Gr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Yt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===Kt,l=O(),u=c?Wr:s?Wr.filter(t=>Xt(e,t)<r):[],d=(r/10).toFixed(1),f=c?Kt:u.length,p=Kt-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)(Ze,{children:(0,Z.jsxs)(rt,{className:`p-4`,children:[(0,Z.jsx)(Je,{children:`Selected cohorts`}),(0,Z.jsx)(at,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(Ze,{children:(0,Z.jsxs)(rt,{className:`p-4`,children:[(0,Z.jsx)(Je,{children:`Excluded cohorts`}),(0,Z.jsx)(at,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(Ze,{children:[(0,Z.jsxs)(rt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(at,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(Je,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ye,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:a.map(e=>(0,Z.jsx)(G,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(Ze,{children:[(0,Z.jsx)(rt,{className:`p-4 pb-3`,children:(0,Z.jsx)(at,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ye,{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)(G,{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)(Pt,{children:[(0,Z.jsxs)(Nt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Tt,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(At,{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)(Et,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(jt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Mt,{children:[d,`% includes `,f,` of`,` `,Kt,` 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)(Ot,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(jt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Mt,{children:[d,`% includes `,f,` of`,` `,Kt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Ot,{showCloseButton:!0})]})})]})}function Kr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function qr(e,t){return e-t}function Jr(e,t,n){let r=e.slice();return r[t]=n,r.sort(qr)}function Yr(e,t,n,r,i,a){let o=e;return o=K(o,n,r),i&&(o=Jr(a,t,K(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Xr(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 Zr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ut},Qr=X.createContext(void 0);function $r(){let e=X.useContext(Qr);if(e===void 0)throw Error(l(62));return e}function ei(e){return`key`in e?j:A}function ti(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Kr(e,t):!1}var ni=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:d=10,locale:f,render:p,max:m=100,min:h=0,minStepsBetweenValues:g=0,form:_,name:v,onValueChange:y,onValueCommitted:b,orientation:x=`horizontal`,step:C=1,thumbCollisionBehavior:w=`push`,thumbAlignment:ee=`center`,value:te,style:ne,...re}=e,D=oe(c),ae=ht(D),se=E(y),ce=E(b),{clearErrors:le}=_t(),{state:ue,disabled:de,name:O,setTouched:k,setDirty:fe,validityData:me,shouldValidateOnChange:A,validation:j}=st(),{labelId:he}=lt(),[ge,_e]=X.useState(),N=r??gt(he,ge),ye=de||s,P=O??v,[F,xe]=be({controlled:te,default:o??h,name:`Slider`}),I=X.useRef(null),L=X.useRef(null),R=X.useRef([]),Ce=X.useRef(null),z=X.useRef(null),we=X.useRef(-1),B=X.useRef(null),V=X.useRef(null),Te=X.useRef(`none`),Ee=a(l),[H,De]=X.useState(-1),[Oe,ke]=X.useState(-1),[Ae,je]=X.useState(!1),[Me,Ne]=X.useState(()=>new Map),[Pe,Fe]=X.useState([void 0,void 0]),Ie=E(e=>{De(e),e!==-1&&ke(e)});ct(L,D,F),M(F,()=>{le(P),A()?j.commit(F):j.commit(F,!0);let e=me.initialValue,t;t=Array.isArray(F)&&Array.isArray(e)?!Kr(F,e):F!==e,fe(t)});let Le=E(e=>{e&&(L.current=e)}),Re=Array.isArray(F),ze=X.useMemo(()=>Re?F.slice().sort(qr):[K(F,h,m)],[m,h,Re,F]),U=E((e,t)=>{if(Number.isNaN(e)||ti(e,F))return;let n=t??pe(`none`,void 0,void 0,{activeThumbIndex:-1});Te.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:P}}),n.event=i,V.current=e,se(e,n),!n.isCanceled&&xe(e)}),Be=E((e,t,n)=>{let r=Yr(e,t,h,m,Re,ze);if(Xr(r,C,g)){let e=ei(n);U(r,pe(e,n.nativeEvent,void 0,{activeThumbIndex:t})),k(!0),ce(V.current??r,u(e,n.nativeEvent))}});T(()=>{let e=ie(S(I.current));ye&&ve(I.current,e)&&e.blur()},[ye]),ye&&H!==-1&&Ie(-1);let W=X.useMemo(()=>({...ue,activeThumbIndex:H,disabled:ye,dragging:Ae,orientation:x,max:m,min:h,minStepsBetweenValues:g,step:C,values:ze}),[ue,H,ye,Ae,m,h,g,x,C,ze]),Ve=X.useMemo(()=>({active:H,controlRef:L,disabled:ye,dragging:Ae,validation:j,formatOptionsRef:Ee,handleInputChange:Be,indicatorPosition:Pe,inset:ee!==`center`,labelId:N,rootLabelId:ae,largeStep:d,lastUsedThumbIndex:Oe,lastChangedValueRef:V,lastChangeReasonRef:Te,form:_,locale:f,max:m,min:h,minStepsBetweenValues:g,name:P,onValueCommitted:ce,orientation:x,pressedInputRef:Ce,pressedThumbCenterOffsetRef:z,pressedThumbIndexRef:we,pressedValuesRef:B,registerFieldControlRef:Le,renderBeforeHydration:ee===`edge`,setActive:Ie,setDragging:je,setIndicatorPosition:Fe,setLabelId:_e,setValue:U,state:W,step:C,thumbCollisionBehavior:w,thumbMap:Me,thumbRefs:R,values:ze}),[H,L,N,ae,ye,Ae,j,Ee,Be,Pe,d,Oe,V,Te,_,f,m,h,g,P,ce,x,Ce,z,we,B,Le,Ie,je,Fe,_e,U,W,C,w,ee,Me,R,ze]),He=n(`div`,e,{state:W,ref:[t,I],props:[{"aria-labelledby":N,id:D,role:`group`},j.getValidationProps,re],stateAttributesMapping:Zr});return(0,Z.jsx)(Qr.Provider,{value:Ve,children:(0,Z.jsx)(Se,{elementsRef:R,onMapChange:Ne,children:He})})});function ri(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ii(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 ai(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ii(t),ii(n))))}function oi({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]=K(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]=K(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]=K(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function si({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=K(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=oi({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=K(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:oi({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=K(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 ci=2;function li(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 ui(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 di=X.forwardRef(function(r,i){let{render:o,className:s,style:c,...l}=r,{disabled:f,dragging:p,inset:m,lastChangedValueRef:h,lastChangeReasonRef:g,max:_,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:C,pressedThumbCenterOffsetRef:w,pressedThumbIndexRef:T,pressedValuesRef:te,registerFieldControlRef:ne,renderBeforeHydration:re,setActive:D,setDragging:ae,setValue:oe,state:se,step:ue,thumbCollisionBehavior:de,thumbRefs:O,values:k}=$r(),fe=ge(),me=k.length>1,A=x===`vertical`,j=X.useRef(null),he=X.useRef(null),_e=E(t=>{t&&he.current==null&&(he.current=e(t).getComputedStyle(t))}),M=X.useRef(null),N=X.useRef(0),P=X.useRef(0),be=a(k);function F(e){T.current!==e&&(T.current=e);let t=O.current[e];if(!t){w.current=null,C.current=null;return}C.current=t.querySelector(`input[type="range"]`)}function xe(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=li(he.current,A),c=P.current,l=(A?r:n)-s.start-s.end-c*2,u=w.current??0,d=e.x-u,f=e.y-u,p=K(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(_-v)*p+v;if(m=ai(m,ue,v),m=K(m,v,_),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=T.current;if(h<0)return null;let g=si({behavior:de,values:k,currentValues:be.current??k,initialValues:te.current,pressedIndex:h,nextValue:m,min:v,max:_,step:ue,minStepsBetweenValues:y});return de===`swap`&&g.didSwap?F(g.thumbIndex):T.current=g.thumbIndex,g}function Se(e){te.current=me?k.slice():null,be.current=k;let t=T.current,n=t;if(t>-1&&t<k.length){if(k[t]===_){let e=t;for(;e>0&&k[e-1]===_;)--e;n=e}}else{let t=A?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(ce(a)){let o=ri(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&F(n),m){let e=O.current[n];ce(e)&&(P.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function I(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let L=E(e=>{let n=ui(e,M);if(n==null)return;if(N.current+=1,e.type===`pointermove`&&e.buttons===0){R(e);return}let r=xe(n);r!=null&&Xr(r.value,ue,y)&&(!p&&N.current>ci&&ae(!0),oe(r.value,pe(t,e,void 0,{activeThumbIndex:r.thumbIndex})),be.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&I(r.thumbIndex))});function R(e){D(-1),ae(!1),C.current=null,w.current=null;let t=ui(e,M),n=t==null?null:xe(t);if(n!=null){let t=g.current;b(h.current??n.value,u(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),T.current=-1,M.current=null,te.current=null,z()}let Ce=E(e=>{if(f)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=ui(e,M);if(n!=null){Se(n);let t=xe(n);if(t==null)return;I(t.thumbIndex),oe(t.value,pe(le,e,void 0,{activeThumbIndex:t.thumbIndex})),be.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&I(t.thumbIndex)}N.current=0;let r=S(j.current);r.addEventListener(`touchmove`,L,{passive:!0}),r.addEventListener(`touchend`,R,{passive:!0})}),z=E(()=>{let e=S(j.current);e.removeEventListener(`pointermove`,L),e.removeEventListener(`pointerup`,R),e.removeEventListener(`touchmove`,L),e.removeEventListener(`touchend`,R),te.current=null}),we=ee();return X.useEffect(()=>{let e=j.current;if(!e)return()=>z();let t=d(e,`touchstart`,Ce,{passive:!0});return()=>{t(),we.cancel(),z()}},[z,Ce,j,we]),X.useEffect(()=>{f&&z()},[f,z]),n(`div`,r,{state:se,ref:[i,ne,j,_e],props:[{"data-base-ui-slider-control":re?``:void 0,onPointerDown(e){let t=j.current,n=ye(e.nativeEvent);if(!t||f||e.defaultPrevented||!ce(n)||e.button!==0)return;let r=ui(e,M);if(r!=null){Se(r);let n=xe(r);if(n==null)return;ve(O.current[n.thumbIndex],ie(S(t)))?e.preventDefault():we.request(()=>{I(n.thumbIndex)}),ae(!0),w.current??(oe(n.value,pe(le,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),be.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&I(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),N.current=0;let i=S(j.current);i.addEventListener(`pointermove`,L,{passive:!0}),i.addEventListener(`pointerup`,R,{once:!0})}},l],stateAttributesMapping:Zr})}),fi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=$r();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Zr})}),pi=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}({}),mi=new Set([...f,y,o]);function hi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${cn(e[t],r,n)} start range`:`${cn(e[t],r,n)} end range`:n?cn(e[t],r,n):void 0}function gi(e,t,n,r,i){let a=n===1?e+t:e-t;return K(Number(a.toFixed(Math.max(ii(e),ii(t),ii(r)))),r,i)}var _i=X.forwardRef(function(t,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:h=!1,getAriaLabel:_,getAriaValueText:b,id:x,index:S,inputRef:ee,onBlur:ne,onFocus:re,onKeyDown:ie,tabIndex:D,style:ae,...se}=t,{nonce:ce}=ft(),le=oe(x),{active:ue,lastUsedThumbIndex:O,controlRef:k,disabled:fe,validation:pe,formatOptionsRef:me,handleInputChange:A,inset:j,labelId:he,largeStep:_e,locale:ve,max:M,min:N,minStepsBetweenValues:ye,form:P,name:be,orientation:xe,pressedInputRef:Se,pressedThumbCenterOffsetRef:I,pressedThumbIndexRef:L,renderBeforeHydration:R,setActive:Ce,setIndicatorPosition:z,state:we,step:B,values:V}=$r(),Te=ge(),Ee=h||fe,H=V.length>1,De=xe===`vertical`,Oe=Te===`rtl`,{setTouched:ke,setFocused:Ae,validationMode:je}=st(),Me=X.useRef(null),Ne=X.useRef(null),Pe=X.useRef(!1),Fe=oe(),Ie=pt(),Le=H?Fe:Ie,{ref:Re,index:ze}=F({metadata:X.useMemo(()=>({inputId:Le}),[Le])}),U=H?S??ze:0,Be=U===V.length-1,W=V[U],Ve=ln(W,N,M),[He,Ue]=X.useState(),We=Sn(),Ge=O>=0&&O<V.length?O:-1,Ke=E(()=>{let e=k.current,t=Me.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=De?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Ve/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ue(s),U===0?z(e=>[s,e[1]]):Be&&z(e=>[e[0],s])});T(()=>{j&&queueMicrotask(Ke)},[Ke,j]),T(()=>{j&&Ke()},[Ke,j,Ve]),T(()=>{if(!j)return;let t=k.current,n=Me.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ke);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[k,Ke,j]);let qe=De?`bottom`:`insetInlineStart`,Je=De?`left`:`top`,Ye;H?ue===U?Ye=2:Ge===U&&(Ye=1):ue===U&&(Ye=1);let Xe;Xe=j?{"--position":`${He??0}%`,visibility:R&&We||He===void 0?`hidden`:void 0,position:`absolute`,[qe]:`var(--position)`,[Je]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Ye}:Number.isFinite(Ve)?{position:`absolute`,[qe]:`${Ve}%`,[Je]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Ye}:C;let G;xe===`vertical`&&(G=Oe?`vertical-rl`:`vertical-lr`);let Ze=typeof _==`function`?_(U):d,Qe=te({"aria-label":Ze,"aria-labelledby":p??(Ze==null?he:void 0),"aria-describedby":u,"aria-orientation":xe,"aria-valuenow":W,"aria-valuetext":typeof b==`function`?b(cn(W,ve,me.current??void 0),W,U):hi(V,U,me.current??void 0,ve),disabled:Ee,form:P,id:Le,max:M,min:N,name:be,onChange(e){A(e.currentTarget.valueAsNumber,U,e)},onFocus(e){let t=Pe.current;Pe.current=!1,Ce(U),Ae(!0),t&&e.stopPropagation()},onBlur(e){if(Pe.current){e.stopPropagation();return}Me.current&&(Ce(-1),ke(!0),Ae(!1),je===`onBlur`&&pe.commit(Yr(W,U,N,M,H,V)))},onKeyDown(e){if(!mi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=ai(W,B,N);switch(e.key){case s:t=gi(n,e.shiftKey?_e:B,1,N,M);break;case r:t=gi(n,e.shiftKey?_e:B,Oe?-1:1,N,M);break;case m:t=gi(n,e.shiftKey?_e:B,-1,N,M);break;case g:t=gi(n,e.shiftKey?_e:B,Oe?1:-1,N,M);break;case y:t=gi(n,_e,1,N,M);break;case o:t=gi(n,_e,-1,N,M);break;case`End`:t=M,H&&(t=Number.isFinite(V[U+1])?V[U+1]-B*ye:M);break;case v:t=N,H&&(t=Number.isFinite(V[U-1])?V[U-1]+B*ye:N);break;default:break}if(t!==null){let n=e.currentTarget;de(n)||(Pe.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),A(t,U,e),e.preventDefault()}},step:B,style:{...C,width:`100%`,height:`100%`,writingMode:G},tabIndex:D??void 0,type:`range`,value:W??``},pe.getInputValidationProps),$e=w(Ne,pe.inputRef,ee);return n(`div`,t,{state:we,ref:[i,Re,Me],props:[{[pi.index]:U,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:$e,...Qe,suppressHydrationWarning:!0}),j&&We&&R&&Be&&(0,Z.jsx)(`script`,{nonce:ce,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:le,onBlur:ne,onFocus:re,onPointerDown(e){if(L.current=U,Me.current!=null){let t=xe===`horizontal`?`x`:`y`,n=ri(Me.current);I.current=(xe===`horizontal`?e.clientX:e.clientY)-n[t]}Ne.current!=null&&Se.current!==Ne.current&&(Se.current=Ne.current)},style:Xe,suppressHydrationWarning:R||void 0},se],stateAttributesMapping:Zr})});function vi(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 yi(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 bi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=$r(),h=Sn(),g=d===`vertical`,_=m.length>1,v=c?vi(g,_,s[0],s[1],f,h):yi(g,_,ln(m[0],u,l),ln(m[m.length-1],u,l));return n(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Zr})});function xi({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)(ni,{className:p(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(di,{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)(fi,{"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)(bi,{"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)(_i,{"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 Si=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ci=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]}),wi=(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}),Ti=e=>(e/10).toFixed(1),Ei=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},Di=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Oi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ti(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ti(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(xi,{"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)(Bt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(It,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Di(n)??e;a(!1),r(Ti(i)),t(i)},onChange:e=>{let n=Ei(e.target.value);r(n);let i=Di(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(Lt,{align:`inline-end`,children:(0,Z.jsx)(Ft,{children:`%`})})]})]})}function ki({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:a}){let o=De(a),s=o.data,c=Fe(s?.bundle_id??``),l=c.data,u=l?tn(l):null,d=H(s?.scope_key??``),f=je(),p=Ae(),m=Ee(),g=Re(),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(``),[S,C]=(0,X.useState)(``),[w,ee]=(0,X.useState)(!1),[T,te]=(0,X.useState)(!1),[E,ie]=(0,X.useState)(!1),[D,oe]=(0,X.useState)(``),[se,ce]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{y(s?Ci(s):null),C(``)},[s]);let le=s?Ci(s):null,de=v!==null&&le!==null&&JSON.stringify(v)!==JSON.stringify(le),O=p.isPending||f.isPending||m.isPending||g.isPending,fe=()=>{if(!O){if(de){ee(!0);return}t(!1)}},pe=()=>{if(!v)return;let e=Zt(b);if(!$t(e)){C(en);return}y({...v,targetCohorts:Array.from(new Set([...v.targetCohorts,e]))}),x(``),C(``)},me=async()=>{if(!s||!v)return;let e=v.targetCohorts.map(Zt);if(e.some(e=>!$t(e))){C(en);return}if(s.strategy===`APP_VERSION`&&!zr(v.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:wi(s,{...v,targetCohorts:e}),releaseId:s.id};C(``);try{await p.mutateAsync(n),await f.mutateAsync(n),q.success(`Bundle settings saved`),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,j=e.filter(e=>e.id!==s?.channel_id),he=j.map(e=>({label:e.name,value:e.name})),ge=D.trim(),ve=se===`copy`,M=v?zr(v.targetAppVersion.trim()):null,ye=()=>{oe(``),ce(`move`)},P=e=>{!e&&g.isPending||(ie(e),e||ye())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{onOpenChange:e=>e?void 0:fe(),open:r,children:(0,Z.jsxs)(re,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(N,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ae,{children:`Bundle Detail`}),(0,Z.jsx)(_e,{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)(dt,{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)(sn,{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:A})]}),(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)(h,{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)(nt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Ge,{}),(0,Z.jsx)($e,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(qe,{children:o.error.message})]}):null,s&&v?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(ze,{release:{platform:s.platform,channel:A,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)(Xe,{className:`gap-6`,children:[(0,Z.jsxs)(tt,{children:[(0,Z.jsx)(We,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(Rt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>y({...v,message:e.target.value}),rows:3,value:v.message})]}),s.strategy===`APP_VERSION`?(0,Z.jsxs)(tt,{children:[(0,Z.jsx)(We,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ne,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>y({...v,targetAppVersion:e.target.value}),value:v.targetAppVersion}),M?(0,Z.jsx)(Qe,{children:M}):null]}):null,(0,Z.jsxs)(tt,{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)(Gt,{"aria-label":`Enabled`,checked:v.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>y({...v,enabled:e})})]}),(0,Z.jsx)(Qe,{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)(tt,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Gt,{"aria-label":`Force update`,checked:v.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>y({...v,shouldForceUpdate:e})})]}),(0,Z.jsxs)(tt,{children:[(0,Z.jsx)(We,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Oi,{onChange:e=>y({...v,rolloutCohortCount:e}),value:v.rolloutCohortCount})]}),(0,Z.jsxs)(tt,{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)(Gr,{releaseId:s.id,rolloutCohortCount:v.rolloutCohortCount,targetCohorts:v.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ne,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>x(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`e.g. qa-team…`,value:b}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!b.trim(),onClick:pe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Dt,{})})]}),v.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:v.targetCohorts.map(e=>(0,Z.jsxs)(G,{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:()=>y({...v,targetCohorts:v.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(k,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Qe,{children:`Public names—no IDs or secrets.`})]})]}),S?(0,Z.jsx)(et,{children:S}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!de||O,onClick:me,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(_,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(i,{className:`w-full`,disabled:s.kind!==`BUNDLE`||O,onClick:()=>ie(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:O,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),q.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Ct,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:s.enabled||O,onClick:()=>te(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(h,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(nt,{variant:`destructive`,children:[(0,Z.jsx)(Ge,{}),(0,Z.jsx)($e,{children:`Build details are unavailable`}),(0,Z.jsx)(qe,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,Z.jsx)(Ur,{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)(i,{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)(V,{onOpenChange:ee,open:w,children:(0,Z.jsxs)(L,{children:[(0,Z.jsxs)(B,{children:[(0,Z.jsx)(R,{children:`Discard unsaved changes?`}),(0,Z.jsx)(I,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(we,{children:`Keep editing`}),(0,Z.jsx)(Ce,{onClick:()=>{ee(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(V,{onOpenChange:te,open:T,children:(0,Z.jsxs)(L,{children:[(0,Z.jsxs)(B,{children:[(0,Z.jsxs)(R,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(I,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(we,{children:`Cancel`}),(0,Z.jsx)(Ce,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),q.success(`Bundle removed from ${A??`the channel`}`),te(!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)(Pt,{onOpenChange:P,open:E,children:(0,Z.jsxs)(At,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(jt,{children:`Promote to Channel`}),(0,Z.jsx)(Mt,{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)(Ke,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(St,{disabled:g.isPending,items:Si,onValueChange:e=>ce(e),value:se,children:[(0,Z.jsx)(mt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(bt,{placeholder:`Select an action`})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(vt,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ve?`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)(Ke,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(St,{disabled:g.isPending,items:he,onValueChange:e=>oe(e??``),value:D||null,children:[(0,Z.jsx)(mt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(bt,{placeholder:`Select a channel`})}),(0,Z.jsx)(yt,{className:`max-h-64`,children:(0,Z.jsx)(xt,{children:j.map(e=>(0,Z.jsx)(vt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>P(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!ge||g.isPending,onClick:async()=>{if(s)try{await g.mutateAsync({action:se,expectedRevision:s.revision,releaseId:s.id,targetChannel:ge}),P(!1),q.success(ve?`Bundle copied to ${ge}`:`Bundle moved to ${ge}`)}catch(e){q.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?ve?`Copying…`:`Moving…`:ve?`Copy`:`Move`})]})]})})]})}function Ai({release:e}){return(0,Z.jsxs)(G,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(it,{className:`size-3`}):(0,Z.jsx)(dn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function ji({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(G,{className:p(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Ge,{className:`h-3 w-3`}):null,r,`%`]})}var Mi=20,Ni=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Pi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Fi=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Li=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function Ri({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=W(a),s=a.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(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)(St,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(mt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(bt,{})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(vt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(St,{disabled:!s,items:Ni,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(mt,{"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)(bt,{})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(vt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(St,{disabled:!s&&a.scopeKey===void 0,items:Pi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(mt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(bt,{})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(vt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(vt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(i,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(_n,{})}),a.bundleId?(0,Z.jsxs)(G,{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)(k,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(G,{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)(k,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(i,{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)(k,{"data-icon":`inline-start`}),`Clear`]}):null]})}function zi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let a=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(i,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(xe,{}):(0,Z.jsx)(ot,{})}):(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)(sn,{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)(zt,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(G,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(dn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Bi({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=Fe(r),a=Me(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)(h,{className:`h-10 w-full`}),(0,Z.jsx)(h,{className:`h-10 w-full`})]}):i.data?(0,Z.jsx)(kn,{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 Vi(){let e=Ue.useSearch(),t=Ue.useNavigate(),n=O(),[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),l=Pe({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Ve(e),limit:Mi}),u=ke().data??[],d=l.data?.data??[],f=Le(Array.from(new Set(d.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},m=l.data?.next,g=l.data?.previous,_=d.flatMap(e=>{let t=u.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),v=He(),y=10+v.length,b=new Map(u.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!d.some(e=>e.id===o)&&s(void 0)},[o,d]);let x=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>x(Be(e,t)),C=t=>{let n=d.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,ee=g?{...e,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,T=m?{...e,afterReleaseId:void 0,beforeReleaseId:m,releaseId:void 0}:null,te={...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)(Ri,{channels:u,onChange:S,onClear:()=>x({}),onManageChannels:()=>a(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[l.isError?(0,Z.jsxs)(nt,{variant:`destructive`,children:[(0,Z.jsx)(Ge,{}),(0,Z.jsx)($e,{children:`Bundles could not be loaded`}),(0,Z.jsx)(qe,{children:l.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:l.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Z.jsx)(h,{className:`h-44 w-full`},t))}):d.length?d.map(t=>{let n=b.get(t.channel_id)??t.channel_id,r=t.bundle_id?f[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${t.id}`,className:p(`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:Li(()=>x({...e,releaseId:t.id},!1)),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)(wn,{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)(dt,{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:Fi.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)(ji,{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`}`:`—`})]}),v.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:_})})]},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)(Ai,{release:t}),t.should_force_update?(0,Z.jsx)(G,{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)(Bi,{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.`:W(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(on,{className:`min-w-max`,children:[(0,Z.jsx)(nn,{className:`bg-muted/40`,children:(0,Z.jsxs)(an,{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`}),v.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)(rn,{children:[l.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(an,{children:(0,Z.jsx)(Y,{colSpan:y,children:(0,Z.jsx)(h,{className:`h-8 w-full`})})},t)):d.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(an,{"aria-label":`Open bundle ${t.id}`,className:p(`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:Li(()=>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)(wn,{channel:b.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)(dt,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:t.bundle_id&&f[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&f[t.bundle_id]>0?(0,Z.jsxs)(G,{variant:`secondary`,children:[f[t.bundle_id],` `,f[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:t.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(U,{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)(wt,{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)(Tn,{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)(Tn,{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)(ji,{percentage:t.rollout_cohort_count/10})}),v.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:_})},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:Fi.format(t.created_at_ms),children:Ii.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Z.jsx)(an,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:y,children:(0,Z.jsx)(Bi,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!l.isPending&&d.length===0?(0,Z.jsx)(an,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:W(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!l.isError&&!l.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:d.length}),` `,d.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)(P,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:te,to:`/`,children:`Newest`}):null,ee?(0,Z.jsxs)(P,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:ee,to:`/`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(i,{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`]}),T?(0,Z.jsxs)(P,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,Z.jsx)(ot,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(ot,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(ki,{channels:u,onOpenChange:t=>!t&&x({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(An,{onOpenChange:a,open:r})]})}export{Vi as component};
|
|
1
|
+
import{$n as e,$t as t,Bn as n,F as r,Fn as i,Gt as a,H as o,I as s,In as c,Jn as l,Jt as u,Kt as d,L as f,Ln as p,M as m,Nn as h,P as g,Pn as _,R as v,U as y,Un as b,Ur as x,Ut as S,Vt as C,Wn as w,Wt as ee,Xn as T,Yn as te,Z as ne,Zn as E,_ as re,_n as ie,ar as D,b as ae,ct as oe,ei as se,er as ce,fn as le,g as ue,gn as de,h as O,ir as k,p as fe,qt as pe,ri as me,rn as A,sn as j,sr as he,st as ge,v as _e,vn as ve,w as M,y as N,yn as ye}from"./sidebar-DNVyJPfX.js";import{l as P}from"./console-features-api-BH5m_PtQ.js";import{i as be,n as F,o as xe,r as Se}from"./useCompositeListItem-9E4pj_CH.js";import{a as I,i as L,l as R,n as Ce,o as z,r as we,s as B,t as V}from"./alert-dialog-Bbk_4-WJ.js";import{a as Te,c as Ee,d as H,f as De,h as Oe,i as ke,l as Ae,m as je,n as Me,o as Ne,p as Pe,r as Fe,s as Ie,t as Le,u as Re}from"./api-DCM0wr6O.js";import{a as ze,c as U,i as Be,n as W,r as Ve,s as He,t as Ue}from"./routes-B88Erkpk.js";import{a as We,b as Ge,c as Ke,f as qe,g as Je,h as Ye,i as Xe,l as G,m as Ze,n as Qe,p as $e,r as et,t as tt,u as nt,v as rt,x as it,y as at}from"./field-BBDpjIqu.js";import{t as ot}from"./chevron-right-BqD5wtFb.js";import{A as st,D as ct,E as lt,M as ut,N as dt,P as ft,T as pt,a as mt,d as ht,f as gt,h as _t,i as vt,m as K,n as yt,o as bt,r as xt,t as St}from"./select-BZZBXMkr.js";import{r as Ct,t as wt}from"./HashValueDisplay-BFX_kY3-.js";import{t as Tt}from"./list-CgrYiadM.js";import{a as Et,c as Dt,i as Ot,l as kt,n as At,o as jt,r as Mt,s as Nt,t as Pt}from"./dialog-Bqbb7B0N.js";import{a as Ft,i as It,n as Lt,o as Rt,s as zt,t as Bt}from"./input-group-ja_30qaF.js";import{a as Vt,i as Ht,n as Ut,o as Wt,t as Gt}from"./switch-DZ1TPwx-.js";import{n as q}from"./dist-LxKJB-Vu.js";import{c as Kt,d as qt,f as Jt,h as Yt,l as Xt,m as Zt,o as Qt,p as $t,s as en,u as tn}from"./InsightsInfo-BNO0WznZ.js";import{a as nn,i as J,n as rn,o as an,r as Y,t as on}from"./table-Gm4qRWwE.js";import{i as sn,n as cn,t as ln}from"./valueToPercent-CH8GCHaL.js";var un=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),dn=D(`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=D(`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=D(`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=D(`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=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),gn=D(`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=D(`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=he();function yn(){return b}function bn(){return!1}function xn(){return!0}function Sn(){return(0,vn.useSyncExternalStore)(yn,bn,xn)}var X=me(se(),1),Z=x(),Cn={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 wn({channel:e,className:t}){return(0,Z.jsx)(G,{variant:`outline`,className:p(Cn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function Tn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(it,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(hn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(k,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var En=me(Vt(),1),Dn=me(Ht(),1);En.default.extend(Dn.default);function On({uuid:e,format:t=`relative`}){let n=(0,En.default)(Qt(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 kn({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:a}){let o=O();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id: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)(sn,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(G,{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)(h,{className:`h-10 w-full`}),(0,Z.jsx)(h,{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)(sn,{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)(sn,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Oe,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(sn,{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)(G,{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)(On,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(on,{className:`min-w-max`,children:[(0,Z.jsx)(nn,{children:(0,Z.jsxs)(an,{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)(rn,{children:n.map(e=>(0,Z.jsxs)(an,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(sn,{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)(sn,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(Oe,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(sn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(G,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(On,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function An({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=Ut(a),{data:c=[],isPending:l}=ke(),u=Ne(),d=Ie(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?q.success(`Channel ${e.row.name} created`):q.info(`Channel ${e.row.name} already exists`)}catch(e){q.error(`Failed to create channel`),console.error(e)}},m=async()=>{if(!(!a||d.isPending))try{let e=await d.mutateAsync({id:a.id});e.deleted?q.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?q.error(`Channel ${a.name} is still in use and cannot be deleted`):q.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){q.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Pt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(At,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsxs)(jt,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(gn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(Mt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:p,children:(0,Z.jsx)(Xe,{className:`gap-2`,children:(0,Z.jsxs)(tt,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(ne,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:u.isPending}),(0,Z.jsxs)(i,{type:`submit`,disabled:!f||u.isPending,children:[u.isPending?(0,Z.jsx)(kt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Dt,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:l?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(kt,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):c.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:c.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.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)(i,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:d.isPending,onClick:()=>o(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Z.jsx)(Wt,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(V,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(L,{children:[(0,Z.jsxs)(B,{children:[(0,Z.jsxs)(R,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(I,{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)(z,{children:[(0,Z.jsx)(we,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Ce,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var jn=`[a-zA-Z0-9-]`,Mn=String.raw`0|[1-9]\d*`,Nn=String.raw`\d+`,Pn=String.raw`\d*[a-zA-Z-]${jn}*`,Fn=String.raw`(${Mn})\.(${Mn})\.(${Mn})`,In=String.raw`(${Nn})\.(${Nn})\.(${Nn})`,Ln=`(?:${Pn}|${Mn})`,Rn=`(?:${Pn}|${Nn})`,zn=String.raw`(?:-(${Ln}(?:\.${Ln})*))`,Bn=String.raw`(?:-?(${Rn}(?:\.${Rn})*))`,Vn=`${jn}+`,Hn=String.raw`(?:\+(${Vn}(?:\.${Vn})*))`,Un=`v?${Fn}${zn}?${Hn}?`,Wn=String.raw`[v=\s]*${In}${Bn}?${Hn}?`,Gn=`((?:<|>)?=?)`,Kn=String.raw`${Mn}|x|X|\*`,qn=String.raw`${Nn}|x|X|\*`,Jn=String.raw`[v=\s]*(${Kn})(?:\.(${Kn})(?:\.(${Kn})(?:${zn})?${Hn}?)?)?`,Yn=String.raw`[v=\s]*(${qn})(?:\.(${qn})(?:\.(${qn})(?:${Bn})?${Hn}?)?)?`,Xn=`(?:~>?)`,Zn=String.raw`(?:\^)`,Qn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Qn}(?:$|[^\d])`,String.raw`${Qn}(?:${zn})?(?:${Hn})?(?:$|[^\d])`;function $n(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[jn,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($n(e),t)}var er=Q(`^${Un}$`),tr=Q(`^${Wn}$`),nr=/^\d+$/;function rr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ir(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?tr:er);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(nr.test(e)){let t=Number(e);if(t>=0&&t<2**53-1)return t}return e}):void 0;return{build:n[5]?.split(`.`),major:r,minor:i,patch:a,prerelease:o}}var ar=Q(String.raw`^${Gn}\s*(${Un})$|^$`),or=Q(String.raw`^${Gn}\s*(${Wn})$|^$`);function sr(e){return e.version?`${e.operator}${rr(e.version)}`:``}function cr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?or:ar);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ir(r[2],t):null;return{operator:i,options:t,value:a?`${i}${rr(a)}`:``,version:a}}function lr(e){return e.sets.map(e=>e.map(sr).join(` `)).join(`||`)}var ur=new RegExp(Hn,`g`),dr=Q(Hn),fr=Q(String.raw`^\s*(${Jn})\s+-\s+(${Jn})\s*$`),pr=Q(String.raw`^\s*(${Yn})\s+-\s+(${Yn})\s*$`),mr=Q(String.raw`(\s*)${Gn}\s*(${Wn}|${Jn})`,`g`),hr=Q(String.raw`(\s*)${Xn}\s+`,`g`),gr=Q(String.raw`(\s*)${Zn}\s+`,`g`),_r=Q(`^${Xn}${Jn}$`),vr=Q(`^${Xn}${Yn}$`),yr=Q(`^${Zn}${Jn}$`),br=Q(`^${Zn}${Yn}$`),xr=Q(String.raw`^${Gn}\s*${Jn}$`),Sr=Q(String.raw`^${Gn}\s*${Yn}$`),Cr=Q(String.raw`(<|>)?=?\s*\*`),wr=/^\s*>=\s*0\.0\.0\s*$/,Tr=/^\s*>=\s*0\.0\.0-0\s*$/,Er=Q(String.raw`^${Gn}\s*(${Wn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Dr(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}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}.${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 kr(e,t){return e.trim().split(/\s+/).map(e=>Or(e,t)).join(` `)}function Ar(e,t){let n=t.loose?br:yr,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 jr(e,t){return e.trim().split(/\s+/).map(e=>Ar(e,t)).join(` `)}function Mr(e,t){let n=t.loose?Sr:xr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Dr(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 Nr(e,t){return e.split(/\s+/).map(e=>Mr(e,t)).join(` `)}function Pr(e,t){let n=t.loose?pr:fr;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 Fr(e,t){return Nr(kr(jr(e.replace(dr,``),t),t),t).trim().replace(Cr,``)}function Ir(e,t){let n=Pr(e.replace(ur,``),t).replace(mr,`$1$2$3`).replace(hr,`$1~`).replace(gr,`$1^`).split(` `).map(e=>Fr(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Tr:wr,``));t.loose&&(n=n.filter(e=>Er.test(e)));let r=new Map;for(let e of n.map(e=>cr(e,t))){if(e.value===`<0.0.0-0`)return[e];r.set(e.value,e)}return r.size>1&&r.delete(``),[...r.values()]}function Lr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Ir(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 Rr(e,t={}){try{return Lr(e,t)}catch{return null}}function zr(e,t={}){let n=Rr(e,t);return n?lr(n)||`*`:null}var Br=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$/,``)},Vr=(e,t)=>{if(!e?.trim())return null;let n=Br(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 Hr({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 Ur({bundle:e,release:t}){let{data:n,isFetched:r}=Te(),i=e?Jt(e):null,a=e?qt(e):null,o=e?.gitCommitHash&&r?Vr(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)(Ze,{children:[(0,Z.jsx)(rt,{className:`p-4 pb-3`,children:(0,Z.jsx)(at,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Ye,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Hr,{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)(Hr,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(wt,{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)(Hr,{label:`Manifest hash`,value:(0,Z.jsx)(wt,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Hr,{label:`Base hash`,value:(0,Z.jsx)(wt,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Hr,{label:`Patch hash`,value:(0,Z.jsx)(wt,{maxLength:16,value:i})}):null]})})]}):null}var Wr=Array.from({length:Kt},(e,t)=>t+1);function Gr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Yt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===Kt,l=O(),u=c?Wr:s?Wr.filter(t=>Xt(e,t)<r):[],d=(r/10).toFixed(1),f=c?Kt:u.length,p=Kt-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)(Ze,{children:(0,Z.jsxs)(rt,{className:`p-4`,children:[(0,Z.jsx)(Je,{children:`Selected cohorts`}),(0,Z.jsx)(at,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(Ze,{children:(0,Z.jsxs)(rt,{className:`p-4`,children:[(0,Z.jsx)(Je,{children:`Excluded cohorts`}),(0,Z.jsx)(at,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(Ze,{children:[(0,Z.jsxs)(rt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(at,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(Je,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Ye,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:a.map(e=>(0,Z.jsx)(G,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(Ze,{children:[(0,Z.jsx)(rt,{className:`p-4 pb-3`,children:(0,Z.jsx)(at,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Ye,{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)(G,{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)(Pt,{children:[(0,Z.jsxs)(Nt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Tt,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(At,{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)(Et,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(jt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Mt,{children:[d,`% includes `,f,` of`,` `,Kt,` 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)(Ot,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(jt,{children:`Rolled out cohorts`}),(0,Z.jsxs)(Mt,{children:[d,`% includes `,f,` of`,` `,Kt,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Ot,{showCloseButton:!0})]})})]})}function Kr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function qr(e,t){return e-t}function Jr(e,t,n){let r=e.slice();return r[t]=n,r.sort(qr)}function Yr(e,t,n,r,i,a){let o=e;return o=K(o,n,r),i&&(o=Jr(a,t,K(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Xr(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 Zr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ut},Qr=X.createContext(void 0);function $r(){let e=X.useContext(Qr);if(e===void 0)throw Error(l(62));return e}function ei(e){return`key`in e?j:A}function ti(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Kr(e,t):!1}var ni=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:d=10,locale:f,render:p,max:m=100,min:h=0,minStepsBetweenValues:g=0,form:_,name:v,onValueChange:y,onValueCommitted:b,orientation:x=`horizontal`,step:C=1,thumbCollisionBehavior:w=`push`,thumbAlignment:ee=`center`,value:te,style:ne,...re}=e,D=oe(c),ae=ht(D),se=E(y),ce=E(b),{clearErrors:le}=_t(),{state:ue,disabled:de,name:O,setTouched:k,setDirty:fe,validityData:me,shouldValidateOnChange:A,validation:j}=st(),{labelId:he}=lt(),[ge,_e]=X.useState(),N=r??gt(he,ge),ye=de||s,P=O??v,[F,xe]=be({controlled:te,default:o??h,name:`Slider`}),I=X.useRef(null),L=X.useRef(null),R=X.useRef([]),Ce=X.useRef(null),z=X.useRef(null),we=X.useRef(-1),B=X.useRef(null),V=X.useRef(null),Te=X.useRef(`none`),Ee=a(l),[H,De]=X.useState(-1),[Oe,ke]=X.useState(-1),[Ae,je]=X.useState(!1),[Me,Ne]=X.useState(()=>new Map),[Pe,Fe]=X.useState([void 0,void 0]),Ie=E(e=>{De(e),e!==-1&&ke(e)});ct(L,D,F),M(F,()=>{le(P),A()?j.commit(F):j.commit(F,!0);let e=me.initialValue,t;t=Array.isArray(F)&&Array.isArray(e)?!Kr(F,e):F!==e,fe(t)});let Le=E(e=>{e&&(L.current=e)}),Re=Array.isArray(F),ze=X.useMemo(()=>Re?F.slice().sort(qr):[K(F,h,m)],[m,h,Re,F]),U=E((e,t)=>{if(Number.isNaN(e)||ti(e,F))return;let n=t??pe(`none`,void 0,void 0,{activeThumbIndex:-1});Te.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:P}}),n.event=i,V.current=e,se(e,n),!n.isCanceled&&xe(e)}),Be=E((e,t,n)=>{let r=Yr(e,t,h,m,Re,ze);if(Xr(r,C,g)){let e=ei(n);U(r,pe(e,n.nativeEvent,void 0,{activeThumbIndex:t})),k(!0),ce(V.current??r,u(e,n.nativeEvent))}});T(()=>{let e=ie(S(I.current));ye&&ve(I.current,e)&&e.blur()},[ye]),ye&&H!==-1&&Ie(-1);let W=X.useMemo(()=>({...ue,activeThumbIndex:H,disabled:ye,dragging:Ae,orientation:x,max:m,min:h,minStepsBetweenValues:g,step:C,values:ze}),[ue,H,ye,Ae,m,h,g,x,C,ze]),Ve=X.useMemo(()=>({active:H,controlRef:L,disabled:ye,dragging:Ae,validation:j,formatOptionsRef:Ee,handleInputChange:Be,indicatorPosition:Pe,inset:ee!==`center`,labelId:N,rootLabelId:ae,largeStep:d,lastUsedThumbIndex:Oe,lastChangedValueRef:V,lastChangeReasonRef:Te,form:_,locale:f,max:m,min:h,minStepsBetweenValues:g,name:P,onValueCommitted:ce,orientation:x,pressedInputRef:Ce,pressedThumbCenterOffsetRef:z,pressedThumbIndexRef:we,pressedValuesRef:B,registerFieldControlRef:Le,renderBeforeHydration:ee===`edge`,setActive:Ie,setDragging:je,setIndicatorPosition:Fe,setLabelId:_e,setValue:U,state:W,step:C,thumbCollisionBehavior:w,thumbMap:Me,thumbRefs:R,values:ze}),[H,L,N,ae,ye,Ae,j,Ee,Be,Pe,d,Oe,V,Te,_,f,m,h,g,P,ce,x,Ce,z,we,B,Le,Ie,je,Fe,_e,U,W,C,w,ee,Me,R,ze]),He=n(`div`,e,{state:W,ref:[t,I],props:[{"aria-labelledby":N,id:D,role:`group`},j.getValidationProps,re],stateAttributesMapping:Zr});return(0,Z.jsx)(Qr.Provider,{value:Ve,children:(0,Z.jsx)(Se,{elementsRef:R,onMapChange:Ne,children:He})})});function ri(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ii(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 ai(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ii(t),ii(n))))}function oi({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]=K(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]=K(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]=K(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function si({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=K(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=oi({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=K(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:oi({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=K(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 ci=2;function li(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 ui(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 di=X.forwardRef(function(r,i){let{render:o,className:s,style:c,...l}=r,{disabled:f,dragging:p,inset:m,lastChangedValueRef:h,lastChangeReasonRef:g,max:_,min:v,minStepsBetweenValues:y,onValueCommitted:b,orientation:x,pressedInputRef:C,pressedThumbCenterOffsetRef:w,pressedThumbIndexRef:T,pressedValuesRef:te,registerFieldControlRef:ne,renderBeforeHydration:re,setActive:D,setDragging:ae,setValue:oe,state:se,step:ue,thumbCollisionBehavior:de,thumbRefs:O,values:k}=$r(),fe=ge(),me=k.length>1,A=x===`vertical`,j=X.useRef(null),he=X.useRef(null),_e=E(t=>{t&&he.current==null&&(he.current=e(t).getComputedStyle(t))}),M=X.useRef(null),N=X.useRef(0),P=X.useRef(0),be=a(k);function F(e){T.current!==e&&(T.current=e);let t=O.current[e];if(!t){w.current=null,C.current=null;return}C.current=t.querySelector(`input[type="range"]`)}function xe(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=li(he.current,A),c=P.current,l=(A?r:n)-s.start-s.end-c*2,u=w.current??0,d=e.x-u,f=e.y-u,p=K(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(_-v)*p+v;if(m=ai(m,ue,v),m=K(m,v,_),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=T.current;if(h<0)return null;let g=si({behavior:de,values:k,currentValues:be.current??k,initialValues:te.current,pressedIndex:h,nextValue:m,min:v,max:_,step:ue,minStepsBetweenValues:y});return de===`swap`&&g.didSwap?F(g.thumbIndex):T.current=g.thumbIndex,g}function Se(e){te.current=me?k.slice():null,be.current=k;let t=T.current,n=t;if(t>-1&&t<k.length){if(k[t]===_){let e=t;for(;e>0&&k[e-1]===_;)--e;n=e}}else{let t=A?`y`:`x`,r;n=-1;for(let i=0;i<O.current.length;i+=1){let a=O.current[i];if(ce(a)){let o=ri(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&F(n),m){let e=O.current[n];ce(e)&&(P.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function I(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let L=E(e=>{let n=ui(e,M);if(n==null)return;if(N.current+=1,e.type===`pointermove`&&e.buttons===0){R(e);return}let r=xe(n);r!=null&&Xr(r.value,ue,y)&&(!p&&N.current>ci&&ae(!0),oe(r.value,pe(t,e,void 0,{activeThumbIndex:r.thumbIndex})),be.current=Array.isArray(r.value)?r.value:[r.value],r.didSwap&&I(r.thumbIndex))});function R(e){D(-1),ae(!1),C.current=null,w.current=null;let t=ui(e,M),n=t==null?null:xe(t);if(n!=null){let t=g.current;b(h.current??n.value,u(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),T.current=-1,M.current=null,te.current=null,z()}let Ce=E(e=>{if(f)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=ui(e,M);if(n!=null){Se(n);let t=xe(n);if(t==null)return;I(t.thumbIndex),oe(t.value,pe(le,e,void 0,{activeThumbIndex:t.thumbIndex})),be.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&I(t.thumbIndex)}N.current=0;let r=S(j.current);r.addEventListener(`touchmove`,L,{passive:!0}),r.addEventListener(`touchend`,R,{passive:!0})}),z=E(()=>{let e=S(j.current);e.removeEventListener(`pointermove`,L),e.removeEventListener(`pointerup`,R),e.removeEventListener(`touchmove`,L),e.removeEventListener(`touchend`,R),te.current=null}),we=ee();return X.useEffect(()=>{let e=j.current;if(!e)return()=>z();let t=d(e,`touchstart`,Ce,{passive:!0});return()=>{t(),we.cancel(),z()}},[z,Ce,j,we]),X.useEffect(()=>{f&&z()},[f,z]),n(`div`,r,{state:se,ref:[i,ne,j,_e],props:[{"data-base-ui-slider-control":re?``:void 0,onPointerDown(e){let t=j.current,n=ye(e.nativeEvent);if(!t||f||e.defaultPrevented||!ce(n)||e.button!==0)return;let r=ui(e,M);if(r!=null){Se(r);let n=xe(r);if(n==null)return;ve(O.current[n.thumbIndex],ie(S(t)))?e.preventDefault():we.request(()=>{I(n.thumbIndex)}),ae(!0),w.current??(oe(n.value,pe(le,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),be.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&I(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),N.current=0;let i=S(j.current);i.addEventListener(`pointermove`,L,{passive:!0}),i.addEventListener(`pointerup`,R,{once:!0})}},l],stateAttributesMapping:Zr})}),fi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=$r();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Zr})}),pi=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}({}),mi=new Set([...f,y,o]);function hi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${cn(e[t],r,n)} start range`:`${cn(e[t],r,n)} end range`:n?cn(e[t],r,n):void 0}function gi(e,t,n,r,i){let a=n===1?e+t:e-t;return K(Number(a.toFixed(Math.max(ii(e),ii(t),ii(r)))),r,i)}var _i=X.forwardRef(function(t,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:h=!1,getAriaLabel:_,getAriaValueText:b,id:x,index:S,inputRef:ee,onBlur:ne,onFocus:re,onKeyDown:ie,tabIndex:D,style:ae,...se}=t,{nonce:ce}=ft(),le=oe(x),{active:ue,lastUsedThumbIndex:O,controlRef:k,disabled:fe,validation:pe,formatOptionsRef:me,handleInputChange:A,inset:j,labelId:he,largeStep:_e,locale:ve,max:M,min:N,minStepsBetweenValues:ye,form:P,name:be,orientation:xe,pressedInputRef:Se,pressedThumbCenterOffsetRef:I,pressedThumbIndexRef:L,renderBeforeHydration:R,setActive:Ce,setIndicatorPosition:z,state:we,step:B,values:V}=$r(),Te=ge(),Ee=h||fe,H=V.length>1,De=xe===`vertical`,Oe=Te===`rtl`,{setTouched:ke,setFocused:Ae,validationMode:je}=st(),Me=X.useRef(null),Ne=X.useRef(null),Pe=X.useRef(!1),Fe=oe(),Ie=pt(),Le=H?Fe:Ie,{ref:Re,index:ze}=F({metadata:X.useMemo(()=>({inputId:Le}),[Le])}),U=H?S??ze:0,Be=U===V.length-1,W=V[U],Ve=ln(W,N,M),[He,Ue]=X.useState(),We=Sn(),Ge=O>=0&&O<V.length?O:-1,Ke=E(()=>{let e=k.current,t=Me.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=De?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Ve/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ue(s),U===0?z(e=>[s,e[1]]):Be&&z(e=>[e[0],s])});T(()=>{j&&queueMicrotask(Ke)},[Ke,j]),T(()=>{j&&Ke()},[Ke,j,Ve]),T(()=>{if(!j)return;let t=k.current,n=Me.current;if(!t||!n)return;let r=e(t).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ke);return i.observe(t),i.observe(n),()=>{i.disconnect()}},[k,Ke,j]);let qe=De?`bottom`:`insetInlineStart`,Je=De?`left`:`top`,Ye;H?ue===U?Ye=2:Ge===U&&(Ye=1):ue===U&&(Ye=1);let Xe;Xe=j?{"--position":`${He??0}%`,visibility:R&&We||He===void 0?`hidden`:void 0,position:`absolute`,[qe]:`var(--position)`,[Je]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Ye}:Number.isFinite(Ve)?{position:`absolute`,[qe]:`${Ve}%`,[Je]:`50%`,translate:`${(De||!Oe?-1:1)*50}% ${(De?1:-1)*50}%`,zIndex:Ye}:C;let G;xe===`vertical`&&(G=Oe?`vertical-rl`:`vertical-lr`);let Ze=typeof _==`function`?_(U):d,Qe=te({"aria-label":Ze,"aria-labelledby":p??(Ze==null?he:void 0),"aria-describedby":u,"aria-orientation":xe,"aria-valuenow":W,"aria-valuetext":typeof b==`function`?b(cn(W,ve,me.current??void 0),W,U):hi(V,U,me.current??void 0,ve),disabled:Ee,form:P,id:Le,max:M,min:N,name:be,onChange(e){A(e.currentTarget.valueAsNumber,U,e)},onFocus(e){let t=Pe.current;Pe.current=!1,Ce(U),Ae(!0),t&&e.stopPropagation()},onBlur(e){if(Pe.current){e.stopPropagation();return}Me.current&&(Ce(-1),ke(!0),Ae(!1),je===`onBlur`&&pe.commit(Yr(W,U,N,M,H,V)))},onKeyDown(e){if(!mi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=ai(W,B,N);switch(e.key){case s:t=gi(n,e.shiftKey?_e:B,1,N,M);break;case r:t=gi(n,e.shiftKey?_e:B,Oe?-1:1,N,M);break;case m:t=gi(n,e.shiftKey?_e:B,-1,N,M);break;case g:t=gi(n,e.shiftKey?_e:B,Oe?1:-1,N,M);break;case y:t=gi(n,_e,1,N,M);break;case o:t=gi(n,_e,-1,N,M);break;case`End`:t=M,H&&(t=Number.isFinite(V[U+1])?V[U+1]-B*ye:M);break;case v:t=N,H&&(t=Number.isFinite(V[U-1])?V[U-1]+B*ye:N);break;default:break}if(t!==null){let n=e.currentTarget;de(n)||(Pe.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),A(t,U,e),e.preventDefault()}},step:B,style:{...C,width:`100%`,height:`100%`,writingMode:G},tabIndex:D??void 0,type:`range`,value:W??``},pe.getInputValidationProps),$e=w(Ne,pe.inputRef,ee);return n(`div`,t,{state:we,ref:[i,Re,Me],props:[{[pi.index]:U,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:$e,...Qe,suppressHydrationWarning:!0}),j&&We&&R&&Be&&(0,Z.jsx)(`script`,{nonce:ce,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:le,onBlur:ne,onFocus:re,onPointerDown(e){if(L.current=U,Me.current!=null){let t=xe===`horizontal`?`x`:`y`,n=ri(Me.current);I.current=(xe===`horizontal`?e.clientX:e.clientY)-n[t]}Ne.current!=null&&Se.current!==Ne.current&&(Se.current=Ne.current)},style:Xe,suppressHydrationWarning:R||void 0},se],stateAttributesMapping:Zr})});function vi(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 yi(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 bi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{indicatorPosition:s,inset:c,max:l,min:u,orientation:d,renderBeforeHydration:f,state:p,values:m}=$r(),h=Sn(),g=d===`vertical`,_=m.length>1,v=c?vi(g,_,s[0],s[1],f,h):yi(g,_,ln(m[0],u,l),ln(m[m.length-1],u,l));return n(`div`,e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":f?``:void 0,style:v,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Zr})});function xi({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)(ni,{className:p(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(di,{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)(fi,{"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)(bi,{"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)(_i,{"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 Si=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],Ci=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]}),wi=(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}),Ti=e=>(e/10).toFixed(1),Ei=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},Di=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Oi({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ti(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ti(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(xi,{"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)(Bt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(It,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Di(n)??e;a(!1),r(Ti(i)),t(i)},onChange:e=>{let n=Ei(e.target.value);r(n);let i=Di(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(Lt,{align:`inline-end`,children:(0,Z.jsx)(Ft,{children:`%`})})]})]})}function ki({channels:e,onOpenChange:t,onShowScope:n,open:r,releaseId:a}){let o=De(a),s=o.data,c=Fe(s?.bundle_id??``),l=c.data,u=l?tn(l):null,d=H(s?.scope_key??``),f=je(),p=Ae(),m=Ee(),g=Re(),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(``),[S,C]=(0,X.useState)(``),[w,ee]=(0,X.useState)(!1),[T,te]=(0,X.useState)(!1),[E,ie]=(0,X.useState)(!1),[D,oe]=(0,X.useState)(``),[se,ce]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{y(s?Ci(s):null),C(``)},[s]);let le=s?Ci(s):null,de=v!==null&&le!==null&&JSON.stringify(v)!==JSON.stringify(le),O=p.isPending||f.isPending||m.isPending||g.isPending,fe=()=>{if(!O){if(de){ee(!0);return}t(!1)}},pe=()=>{if(!v)return;let e=Zt(b);if(!$t(e)){C(en);return}y({...v,targetCohorts:Array.from(new Set([...v.targetCohorts,e]))}),x(``),C(``)},me=async()=>{if(!s||!v)return;let e=v.targetCohorts.map(Zt);if(e.some(e=>!$t(e))){C(en);return}if(s.strategy===`APP_VERSION`&&!zr(v.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let n={expectedRevision:s.revision,patch:wi(s,{...v,targetCohorts:e}),releaseId:s.id};C(``);try{await p.mutateAsync(n),await f.mutateAsync(n),q.success(`Bundle settings saved`),t(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=e.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,j=e.filter(e=>e.id!==s?.channel_id),he=j.map(e=>({label:e.name,value:e.name})),ge=D.trim(),ve=se===`copy`,M=v?zr(v.targetAppVersion.trim()):null,ye=()=>{oe(``),ce(`move`)},P=e=>{!e&&g.isPending||(ie(e),e||ye())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ue,{onOpenChange:e=>e?void 0:fe(),open:r,children:(0,Z.jsxs)(re,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(N,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ae,{children:`Bundle Detail`}),(0,Z.jsx)(_e,{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)(dt,{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)(sn,{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:A})]}),(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)(h,{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)(nt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Ge,{}),(0,Z.jsx)($e,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(qe,{children:o.error.message})]}):null,s&&v?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(ze,{release:{platform:s.platform,channel:A,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)(Xe,{className:`gap-6`,children:[(0,Z.jsxs)(tt,{children:[(0,Z.jsx)(We,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(Rt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>y({...v,message:e.target.value}),rows:3,value:v.message})]}),s.strategy===`APP_VERSION`?(0,Z.jsxs)(tt,{children:[(0,Z.jsx)(We,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(ne,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>y({...v,targetAppVersion:e.target.value}),value:v.targetAppVersion}),M?(0,Z.jsx)(Qe,{children:M}):null]}):null,(0,Z.jsxs)(tt,{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)(Gt,{"aria-label":`Enabled`,checked:v.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>y({...v,enabled:e})})]}),(0,Z.jsx)(Qe,{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)(tt,{orientation:`horizontal`,children:[(0,Z.jsx)(We,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Gt,{"aria-label":`Force update`,checked:v.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>y({...v,shouldForceUpdate:e})})]}),(0,Z.jsxs)(tt,{children:[(0,Z.jsx)(We,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(Oi,{onChange:e=>y({...v,rolloutCohortCount:e}),value:v.rolloutCohortCount})]}),(0,Z.jsxs)(tt,{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)(Gr,{releaseId:s.id,rolloutCohortCount:v.rolloutCohortCount,targetCohorts:v.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(ne,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>x(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`e.g. qa-team…`,value:b}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!b.trim(),onClick:pe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Dt,{})})]}),v.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:v.targetCohorts.map(e=>(0,Z.jsxs)(G,{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:()=>y({...v,targetCohorts:v.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(k,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Qe,{children:`Public names—no IDs or secrets.`})]})]}),S?(0,Z.jsx)(et,{children:S}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!de||O,onClick:me,size:`lg`,children:p.isPending||f.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(_,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(i,{className:`w-full`,disabled:!s.bundle_id||O,onClick:()=>ie(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:O,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),q.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Ct,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:s.enabled||O,onClick:()=>te(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,Z.jsx)(h,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,Z.jsxs)(nt,{variant:`destructive`,children:[(0,Z.jsx)(Ge,{}),(0,Z.jsx)($e,{children:`Build details are unavailable`}),(0,Z.jsx)(qe,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,Z.jsx)(Ur,{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)(i,{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)(V,{onOpenChange:ee,open:w,children:(0,Z.jsxs)(L,{children:[(0,Z.jsxs)(B,{children:[(0,Z.jsx)(R,{children:`Discard unsaved changes?`}),(0,Z.jsx)(I,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(we,{children:`Keep editing`}),(0,Z.jsx)(Ce,{onClick:()=>{ee(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(V,{onOpenChange:te,open:T,children:(0,Z.jsxs)(L,{children:[(0,Z.jsxs)(B,{children:[(0,Z.jsxs)(R,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(I,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(we,{children:`Cancel`}),(0,Z.jsx)(Ce,{onClick:async()=>{if(s)try{await m.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),q.success(`Bundle removed from ${A??`the channel`}`),te(!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)(Pt,{onOpenChange:P,open:E,children:(0,Z.jsxs)(At,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(jt,{children:`Promote to Channel`}),(0,Z.jsx)(Mt,{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)(Ke,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(St,{disabled:g.isPending,items:Si,onValueChange:e=>ce(e),value:se,children:[(0,Z.jsx)(mt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(bt,{placeholder:`Select an action`})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(vt,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ve?`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)(Ke,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(St,{disabled:g.isPending,items:he,onValueChange:e=>oe(e??``),value:D||null,children:[(0,Z.jsx)(mt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(bt,{placeholder:`Select a channel`})}),(0,Z.jsx)(yt,{className:`max-h-64`,children:(0,Z.jsx)(xt,{children:j.map(e=>(0,Z.jsx)(vt,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>P(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!ge||g.isPending,onClick:async()=>{if(s)try{await g.mutateAsync({action:se,expectedRevision:s.revision,releaseId:s.id,targetChannel:ge}),P(!1),q.success(ve?`Bundle copied to ${ge}`:`Bundle moved to ${ge}`)}catch(e){q.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?ve?`Copying…`:`Moving…`:ve?`Copy`:`Move`})]})]})})]})}function Ai({release:e}){return(0,Z.jsxs)(G,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(it,{className:`size-3`}):(0,Z.jsx)(dn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function ji({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(G,{className:p(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(Ge,{className:`h-3 w-3`}):null,r,`%`]})}var Mi=20,Ni=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Pi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Fi=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Li=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function Ri({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=W(a),s=a.channelId!==void 0,c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(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)(St,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(mt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(bt,{})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(vt,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(St,{disabled:!s,items:Ni,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(mt,{"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)(bt,{})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`ios`,children:`iOS`}),(0,Z.jsx)(vt,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(St,{disabled:!s&&a.scopeKey===void 0,items:Pi,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:a.enabled===void 0?`all`:a.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(mt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(bt,{})}),(0,Z.jsx)(yt,{children:(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(vt,{value:`all`,children:`Any Status`}),(0,Z.jsx)(vt,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(vt,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(i,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)(_n,{})}),a.bundleId?(0,Z.jsxs)(G,{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)(k,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(G,{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)(k,{className:`size-3`})})]}):null,o?(0,Z.jsxs)(i,{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)(k,{"data-icon":`inline-start`}),`Clear`]}):null]})}function zi({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let a=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(i,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(xe,{}):(0,Z.jsx)(ot,{})}):(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)(sn,{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)(zt,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(G,{className:`shrink-0 font-normal`,variant:`secondary`,children:a}):null,r.currentlyUnreachable?(0,Z.jsxs)(`span`,{"aria-label":`Unreachable: no device gets this bundle with the current delivery settings.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No device gets this bundle with the current delivery settings.`,children:[(0,Z.jsx)(dn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Bi({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=Fe(r),a=Me(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)(h,{className:`h-10 w-full`}),(0,Z.jsx)(h,{className:`h-10 w-full`})]}):i.data?(0,Z.jsx)(kn,{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 Vi(){let e=Ue.useSearch(),t=Ue.useNavigate(),n=O(),[r,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(),l=Pe({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,filter:Ve(e),limit:Mi}),u=ke().data??[],d=l.data?.data??[],f=Le(Array.from(new Set(d.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},m=l.data?.next,g=l.data?.previous,_=d.flatMap(e=>{let t=u.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),v=He(),y=10+v.length,b=new Map(u.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{o&&!d.some(e=>e.id===o)&&s(void 0)},[o,d]);let x=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),S=t=>x(Be(e,t)),C=t=>{let n=d.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,ee=g?{...e,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,T=m?{...e,afterReleaseId:void 0,beforeReleaseId:m,releaseId:void 0}:null,te={...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)(Ri,{channels:u,onChange:S,onClear:()=>x({}),onManageChannels:()=>a(!0),search:e}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[l.isError?(0,Z.jsxs)(nt,{variant:`destructive`,children:[(0,Z.jsx)(Ge,{}),(0,Z.jsx)($e,{children:`Bundles could not be loaded`}),(0,Z.jsx)(qe,{children:l.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:l.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Z.jsx)(h,{className:`h-44 w-full`},t))}):d.length?d.map(t=>{let n=b.get(t.channel_id)??t.channel_id,r=t.bundle_id?f[t.bundle_id]:0,i=o===t.id,a=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${t.id}`,className:p(`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:Li(()=>x({...e,releaseId:t.id},!1)),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)(wn,{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)(dt,{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:Fi.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)(ji,{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`}`:`—`})]}),v.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:_})})]},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)(Ai,{release:t}),t.should_force_update?(0,Z.jsx)(G,{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)(Bi,{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.`:W(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(on,{className:`min-w-max`,children:[(0,Z.jsx)(nn,{className:`bg-muted/40`,children:(0,Z.jsxs)(an,{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`}),v.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)(rn,{children:[l.isPending?Array.from({length:7},(e,t)=>(0,Z.jsx)(an,{children:(0,Z.jsx)(Y,{colSpan:y,children:(0,Z.jsx)(h,{className:`h-8 w-full`})})},t)):d.map(t=>{let n=o===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(an,{"aria-label":`Open bundle ${t.id}`,className:p(`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:Li(()=>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)(wn,{channel:b.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)(dt,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:t.bundle_id&&f[t.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&f[t.bundle_id]>0?(0,Z.jsxs)(G,{variant:`secondary`,children:[f[t.bundle_id],` `,f[t.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:t.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(U,{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)(wt,{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)(Tn,{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)(Tn,{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)(ji,{percentage:t.rollout_cohort_count/10})}),v.map(({Cell:e,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(e,{releaseId:t.id,releases:_})},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:Fi.format(t.created_at_ms),children:Ii.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Z.jsx)(an,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:y,children:(0,Z.jsx)(Bi,{onDetailClick:C,panelId:r,release:t})})}):null]},t.id)}),!l.isPending&&d.length===0?(0,Z.jsx)(an,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:W(e)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!l.isError&&!l.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:d.length}),` `,d.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)(P,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:te,to:`/`,children:`Newest`}):null,ee?(0,Z.jsxs)(P,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:ee,to:`/`,children:[(0,Z.jsx)(un,{"data-icon":`inline-start`}),`Previous`]}):(0,Z.jsxs)(i,{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`]}),T?(0,Z.jsxs)(P,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,Z.jsx)(ot,{"data-icon":`inline-end`})]}):(0,Z.jsxs)(i,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Z.jsx)(ot,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(ki,{channels:u,onOpenChange:t=>!t&&x({...e,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Z.jsx)(An,{onOpenChange:a,open:r})]})}export{Vi as component};
|