@hot-updater/console 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/EventDetails-gbD_fCqc.js +1 -0
- package/.output/public/assets/{InsightsPageHeader-SYEOMClX.js → InsightsPageHeader-BRw8XkJW.js} +1 -1
- package/.output/public/assets/api-keys-D81VHHNM.js +1 -0
- package/.output/public/assets/api-keys-Dia6i8K1.js +1 -0
- package/.output/public/assets/badge-Bqf3UDee.js +1 -0
- package/.output/public/assets/circle-off-BsbZQtsF.js +1 -0
- package/.output/public/assets/field-GxF9SyUo.js +1 -0
- package/.output/public/assets/{index-C5S4DrO2.js → index-DrkdiRIn.js} +3 -3
- package/.output/public/assets/insights-C-5t8wh2.js +2 -0
- package/.output/public/assets/insights-D_ngQdiz.js +1 -0
- package/.output/public/assets/insights-KigRBDgC.js +42 -0
- package/.output/public/assets/insights-api-1ZjVu3Sb.js +1 -0
- package/.output/public/assets/insights-search-aT8BVCci.js +1 -0
- package/.output/public/assets/{insights-usage-rpc-DTL0_Rp8.js → insights-usage-rpc-DqTiXI1_.js} +1 -1
- package/.output/public/assets/insights_.distribution-Bzl6RFBR.js +2 -0
- package/.output/public/assets/insights_.distribution-Cthgttqb.js +1 -0
- package/.output/public/assets/insights_.distribution-D2c2v1bu.js +1 -0
- package/.output/public/assets/installations-2Nx8Htf-.js +1 -0
- package/.output/public/assets/{installations-we1IV0xp.js → installations-BskJ1xQr.js} +2 -2
- package/.output/public/assets/installations-K2iJ_r0h.js +1 -0
- package/.output/public/assets/{remote-config-uBgCaI-p.js → remote-config-D9X3NiwV.js} +4 -4
- package/.output/public/assets/{remote-config-DyTLPRKh.js → remote-config-DzOOiBIO.js} +1 -1
- package/.output/public/assets/remote-config-ikg7kak0.js +1 -0
- package/.output/public/assets/routes-9rb9P5Y7.js +2 -0
- package/.output/public/assets/routes-P7683vKQ.js +1 -0
- package/.output/public/assets/{select-CV8nkfsf.js → select-M3H2gxCc.js} +1 -1
- package/.output/public/assets/styles-CpiW_YdW.css +2 -0
- package/.output/public/assets/{switch-C8ycp9AH.js → switch-By_vfm8I.js} +1 -1
- package/.output/server/{__23tanstack-start-server-fn-resolver-B2gMrGs6.mjs → __23tanstack-start-server-fn-resolver-KpQ5Z_24.mjs} +40 -40
- package/.output/server/_libs/@base-ui/react+[...].mjs +77 -1
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +2 -2
- package/.output/server/_libs/lucide-react.mjs +1 -1
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/react-redux+[...].mjs +1 -1
- package/.output/server/_libs/recharts+[...].mjs +1 -1
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tanstack__react-query.mjs +1 -1
- package/.output/server/_ssr/{BundleIdDisplay-BIXUWOM_.mjs → BundleIdDisplay-CjSnY65J.mjs} +3 -3
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-B5BX1XJQ.mjs → ConsoleFeatureUnavailable-CHxn9f-w.mjs} +7 -7
- package/.output/server/_ssr/{EventDetails-C0bZVuOS.mjs → EventDetails-l6dF54zp.mjs} +8 -8
- package/.output/server/_ssr/{HashValueDisplay-DtWes-Gr.mjs → HashValueDisplay-Zs7ABoOi.mjs} +3 -3
- package/.output/server/_ssr/{InsightsPageHeader-CLP-sCpY.mjs → InsightsPageHeader-ZlAlDxQy.mjs} +8 -8
- package/.output/server/_ssr/{NotFoundPage-BVQx08zn.mjs → NotFoundPage-u28ndvp1.mjs} +3 -3
- package/.output/server/_ssr/{alert-dialog-BlEXzHma.mjs → alert-dialog-B8AqlJwo.mjs} +2 -2
- package/.output/server/_ssr/{api-CVve4Y9C.mjs → api-C_0B7NXM.mjs} +3 -3
- package/.output/server/_ssr/{api-keys-Dknq3e2R.mjs → api-keys-CLH38u9B.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-2TVuUP_S.mjs → api-keys-pRNvn2-9.mjs} +9 -8
- package/.output/server/_ssr/{api-keys-rpc-D6mjj6ux.mjs → api-keys-rpc-wecWs0nA.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-C2zK3DoM.mjs → api-rpc-DWN8eOHS.mjs} +6 -41
- package/.output/server/_ssr/{auth-rpc-Dss6nG8G.mjs → auth-rpc-CLRArbIl.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-DLi4kbQi.mjs → auth.server-DR9zc0EU.mjs} +2 -2
- package/.output/server/_ssr/badge-BpT7r-ng.mjs +108 -0
- package/.output/server/_ssr/{bundleActivity-M5gzBFNg.mjs → bundleActivity-0qFIcvqt.mjs} +1 -1
- package/.output/server/_ssr/{config.server-B_oTMFxL.mjs → config.server-DTdsG47T.mjs} +4 -4
- package/.output/server/_ssr/{console-access-UB-4rDiA.mjs → console-access-aUpQs49I.mjs} +2 -2
- package/.output/server/_ssr/{console-features-Oz0q20jJ.mjs → console-features-4xAGfZHw.mjs} +1 -1
- package/.output/server/_ssr/{console-features-api-DJV790QE.mjs → console-features-api-DSSgCV3v.mjs} +5 -5
- package/.output/server/_ssr/{console-features-rpc-cai3k4Ac.mjs → console-features-rpc-D6kMlR2A.mjs} +3 -3
- package/.output/server/_ssr/{dialog-CdG-5FiE.mjs → dialog-B4ALf7NJ.mjs} +2 -2
- package/.output/server/_ssr/{downloadBundle-CZysjmNW.mjs → downloadBundle-94jPBGSO.mjs} +1 -1
- package/.output/server/_ssr/{empty-CtbzbPdQ.mjs → empty-Bh1FEeYF.mjs} +3 -3
- package/.output/server/_ssr/{failureReports-DKDhVsXA.mjs → failureReports-Bh22wois.mjs} +4 -4
- package/.output/server/_ssr/field-HKCaPH3e.mjs +89 -0
- package/.output/server/_ssr/{getBundleChildren-Cv9iz1As.mjs → getBundleChildren-DfxB2K8D.mjs} +1 -1
- package/.output/server/_ssr/{input-group-c65TGOPW.mjs → input-group-xm3LzDuq.mjs} +2 -2
- package/.output/server/_ssr/{insights-_IGtova5.mjs → insights-BKZpJ_K4.mjs} +590 -360
- package/.output/server/_ssr/{insights-DU_QAXWM.mjs → insights-CCyTACIw.mjs} +5 -5
- package/.output/server/_ssr/{insights-Bn2m3_41.mjs → insights-CNqWQLJR.mjs} +2 -2
- package/.output/server/_ssr/{insights-api-Ds7dvWu4.mjs → insights-api-DtRFz5X3.mjs} +5 -5
- package/.output/server/_ssr/{insights-errors-BjnFUyZj.mjs → insights-errors-Iy-lBaM7.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-xaa41Buf.mjs → insights-failures-BJN3RfLu.mjs} +3 -3
- package/.output/server/_ssr/{insights-failures-rpc-DdcX5E7T.mjs → insights-failures-rpc-DLZ91uOG.mjs} +12 -12
- package/.output/server/_ssr/{insights-recovery-BWQhiZaF.mjs → insights-recovery-BUuQdlA3.mjs} +1 -1
- package/.output/server/_ssr/{insights-recovery-rpc-DOhy6APf.mjs → insights-recovery-rpc-BQHUhPi7.mjs} +6 -6
- package/.output/server/_ssr/{insights-rpc-US_gs2id.mjs → insights-rpc-C6Vukyn7.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-C70xifQF.mjs → insights-search-CBYoxT7v.mjs} +8 -7
- package/.output/server/_ssr/{insights-usage-BpBM0U0c.mjs → insights-usage-CHqvtehH.mjs} +1 -1
- package/.output/server/_ssr/{insights-usage-rpc-5DtQXLAY.mjs → insights-usage-rpc-BJ7a-xco.mjs} +6 -6
- package/.output/server/_ssr/{insights-usage-rpc-TTivW3zB.mjs → insights-usage-rpc-C-lNUIsD.mjs} +5 -5
- package/.output/server/_ssr/{insightsUsage-CzhVjsc8.mjs → insightsUsage-COUG-_-U.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-D5U5EzU-.mjs → insights_.distribution-CTwilMPm.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-BvA8x4Pc.mjs → insights_.distribution-DmLW8I8a.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-Wm6hKWPa.mjs → insights_.distribution-DztDyrBj.mjs} +14 -13
- package/.output/server/_ssr/{installations-BmuAKPlD.mjs → installations-B6MK5iA8.mjs} +2 -2
- package/.output/server/_ssr/{installations-D6X1wvQA.mjs → installations-Bct7ag5y.mjs} +4 -4
- package/.output/server/_ssr/{installations-rfEUgSuk.mjs → installations-_N4PtYFl.mjs} +12 -11
- package/.output/server/_ssr/{release-adoption-005tQRpo.mjs → release-adoption-DuYJTGuX.mjs} +17 -7
- package/.output/server/_ssr/{release-adoption-rpc-VPRjwQya.mjs → release-adoption-rpc-CHl7G_Zy.mjs} +8 -8
- package/.output/server/_ssr/{releaseAdoption-CtOFkwli.mjs → releaseAdoption-B39cpvfo.mjs} +42 -26
- package/.output/server/_ssr/releaseReachability-bFsuElSS.mjs +39 -0
- package/.output/server/_ssr/{remote-config-BW3yo4ZC.mjs → remote-config-10-obSZ0.mjs} +3 -3
- package/.output/server/_ssr/{remote-config-C6qyWeqT.mjs → remote-config-Dj1eTYi4.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-BdOas6KI.mjs → remote-config-Mj05qVYZ.mjs} +18 -17
- package/.output/server/_ssr/{remote-config-rpc-DNjk69nN.mjs → remote-config-rpc-lteqDSLn.mjs} +3 -3
- package/.output/server/_ssr/{router-DqyQ8o8T.mjs → router-Dr4jjjhx.mjs} +17 -17
- package/.output/server/_ssr/{routes-1TWMRTCY.mjs → routes-B5KrCDwk.mjs} +17 -16
- package/.output/server/_ssr/{routes-DxfbhYOp.mjs → routes-BZbrY_qw.mjs} +17 -17
- package/.output/server/_ssr/{runtime.server-De0QVWc9.mjs → runtime.server-DsHqVqTr.mjs} +2 -2
- package/.output/server/_ssr/{select-CEyhDZtT.mjs → select-BtdGNSmp.mjs} +2 -2
- package/.output/server/_ssr/{server-BUe4_4dH.mjs → server-BxaHSwHh.mjs} +4 -4
- package/.output/server/_ssr/{sidebar-De1__izs.mjs → sidebar-CVsgosaD.mjs} +3 -3
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{switch-B6TmLbu-.mjs → switch-BmARgkUP.mjs} +3 -3
- package/.output/server/_ssr/{table-BEpbu0xs.mjs → table-M5P3YUfY.mjs} +2 -2
- package/.output/server/_ssr/{tabs-DP0GnDdN.mjs → tabs-CrmfOlJj.mjs} +3 -3
- package/.output/server/_ssr/updateFailures-z1IQy_4q.mjs +103 -0
- package/.output/server/{_tanstack-start-manifest_v-DTOQk1l4.mjs → _tanstack-start-manifest_v-_BY9hYTm.mjs} +51 -50
- package/.output/server/index.mjs +204 -197
- package/package.json +7 -7
- package/src/components/features/insights/AppUsage.tsx +15 -2
- package/src/components/features/insights/InsightsControls.tsx +264 -246
- package/src/components/features/insights/InsightsOverview.tsx +90 -68
- package/src/components/features/insights/InsightsScope.tsx +39 -0
- package/src/components/features/insights/ReleaseActivity.tsx +4 -4
- package/src/components/features/insights/ReleaseCombobox.tsx +196 -0
- package/src/components/features/insights/RollbackButton.tsx +4 -0
- package/src/components/features/insights/UpdateFailures.tsx +7 -1
- package/src/lib/insights-failures-rpc.ts +3 -1
- package/src/lib/insights-failures.ts +5 -2
- package/src/lib/insights-recovery.ts +5 -0
- package/src/lib/insights-search.ts +10 -14
- package/src/lib/release-adoption-api.ts +24 -32
- package/src/lib/release-adoption.ts +45 -8
- package/src/lib/server/failureReports.ts +1 -1
- package/src/lib/server/releaseAdoption.ts +75 -26
- package/src/lib/server/updateFailures.ts +131 -10
- package/src/routes/insights.tsx +56 -24
- package/src/routes/insights_.distribution.tsx +2 -1
- package/.output/public/assets/EventDetails-CSX2ayg9.js +0 -1
- package/.output/public/assets/api-keys-BEdLKiib.js +0 -1
- package/.output/public/assets/api-keys-TdTtKm2b.js +0 -1
- package/.output/public/assets/chevron-right-BnvHIJdZ.js +0 -1
- package/.output/public/assets/field-DBMkBfkD.js +0 -1
- package/.output/public/assets/insights-BMKRCIg1.js +0 -2
- package/.output/public/assets/insights-CPyViuyC.js +0 -42
- package/.output/public/assets/insights-D0PbX-Rm.js +0 -1
- package/.output/public/assets/insights-api-Dmd_LgT3.js +0 -1
- package/.output/public/assets/insights-search-DAa0f7Dr.js +0 -1
- package/.output/public/assets/insights_.distribution-BaOQlBV9.js +0 -1
- package/.output/public/assets/insights_.distribution-CxXMIEb5.js +0 -2
- package/.output/public/assets/insights_.distribution-EE5OqxyL.js +0 -1
- package/.output/public/assets/installations-BgISglUQ.js +0 -1
- package/.output/public/assets/installations-DQbgRkSi.js +0 -1
- package/.output/public/assets/remote-config-AQmdmbT8.js +0 -1
- package/.output/public/assets/routes-Br26jzt9.js +0 -1
- package/.output/public/assets/routes-CyirpG2O.js +0 -2
- package/.output/public/assets/styles-DTGEAJFv.css +0 -2
- package/.output/server/_ssr/field-0KdP_8LI.mjs +0 -189
- package/.output/server/_ssr/updateFailures-H6pnnYK4.mjs +0 -40
- /package/.output/public/assets/{ConsoleFeatureUnavailable-B-iNWpuE.js → ConsoleFeatureUnavailable-C0KfsKWL.js} +0 -0
- /package/.output/public/assets/{table-DgGD67Fx.js → table-ek1DmRHq.js} +0 -0
- /package/.output/public/assets/{valueToPercent-C4C1WZVn.js → valueToPercent-B44vDssN.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ConsoleFeatureUnavailable-B-iNWpuE.js";var t=e;export{t as notFoundComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wr as e,ar as t,cr as n,nr as r,rr as i}from"./sidebar-BqX460IW.js";import{m as a}from"./useCompositeListItem-B-UkrDlu.js";var o=t(`chart-no-axes-combined`,[[`path`,{d:`M12 16v5`,key:`zza2cw`}],[`path`,{d:`M16 14v7`,key:`1g90b9`}],[`path`,{d:`M20 10v11`,key:`1iqoj0`}],[`path`,{d:`m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15`,key:`1fw8x9`}],[`path`,{d:`M4 18v3`,key:`1yp0dc`}],[`path`,{d:`M8 14v7`,key:`n3cwzv`}]]),s=t(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),c={"24h":{durationMs:864e5,intervalMs:36e5},"7d":{durationMs:7*864e5,intervalMs:6*36e5},"30d":{durationMs:30*864e5,intervalMs:864e5}},l=e=>Math.ceil(e/36e5)*36e5;function u(e){if(!e||e.platform!==`ios`&&e.platform!==`android`||typeof e.channel!=`string`||!e.channel.trim()||e.channel.length>1024||e.releaseId!==void 0&&(typeof e.releaseId!=`string`||!e.releaseId.trim()||e.releaseId.length>36)||(e.window===void 0?e.releaseId===void 0:!Object.hasOwn(c,e.window)))throw Error(`Choose a platform, channel, and time window.`);return e}var d=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),f=({failedInstallations:e,activeInstallations:t})=>t===0?null:Math.min(1,e/t),p=e=>e===null?`—`:`${(e*100).toFixed(2)}%`,m={check:`Update check`,download:`Download`,install:`Install`},h={network:`Network`,http:`HTTP error`,invalid_response:`Invalid response`,hash_mismatch:`Hash mismatch`,signature:`Signature`,patch:`Patch`,extract:`Extract`,storage:`Storage`,unknown:`No reason reported`},g=e=>m[e]??`Unknown stage`,_=e=>h[e]??`Unknown reason`,v=e=>[...e.httpStatus==null?[]:[`HTTP ${e.httpStatus}`],...e.originCode==null?[]:[e.originCode],...e.transport==null?[]:[e.transport],...e.resource==null?[]:[e.resource]],y=e=>{let t=e.errorMessage||(e.reason===`unknown`?`The client did not report a detailed cause`:_(e.reason));return[`${g(e.stage)} failed: ${t}`,...v(e)].join(` · `)},b=i({method:`GET`}).middleware([r]).handler(e(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),x=i({method:`GET`}).middleware([r]).handler(e(`b4388826a9b515fb4d2113270aa8ded1c50ba13d7f07ac2b268c41396e87d0a3`)),S={rawDays:90,dailyDays:400},C=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,w=({dailyDays:e})=>e>=364;i({method:`GET`}).middleware([r]).handler(e(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var T=i({method:`GET`}).middleware([r]).handler(e(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),E=i({method:`GET`}).middleware([r]).handler(e(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),D=i({method:`GET`}).middleware([r]).handler(e(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),O=i({method:`GET`}).middleware([r]).handler(e(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),k=i({method:`GET`}).middleware([r]).handler(e(`735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1`)),A=3e4,j={reportingInstallations:e=>[`insights`,`reporting-installations`,e],events:e=>[`insights`,`events`,e],installations:e=>[`insights`,`installations`,e],installation:e=>[`insights`,`installation`,e],installationEvents:e=>[`insights`,`installation-events`,e]},M=(e,t)=>n({queryKey:j.events(e),queryFn:()=>T({data:e}),enabled:t,refetchOnWindowFocus:!0,staleTime:A}),N=(e,t)=>n({queryKey:j.installations(e),queryFn:()=>k({data:e}),enabled:t&&e.identity.length>0,staleTime:A}),P=(e,t)=>n({queryKey:j.installation(e),queryFn:()=>D({data:{installId:e}}),enabled:t&&e.length>0,staleTime:A}),F=(e,t)=>n({queryKey:j.installationEvents(e),queryFn:()=>E({data:e}),enabled:t&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:A}),I=(e,t=!0)=>n({queryKey:[`insights`,`update-failures`,e],queryFn:()=>b({data:u(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:A}),L=()=>n({queryKey:[`insights`,`retention`],queryFn:()=>O(),staleTime:1/0}).data??S,R=(e,t)=>a({queryKey:[`insights`,`failure-reports`,e],queryFn:({pageParam:t})=>x({data:{...e,cursor:t}}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,enabled:t,staleTime:A});export{p as _,N as a,s as b,S as c,f as d,y as f,g,_ as h,P as i,C as l,d as m,M as n,L as o,v as p,F as r,I as s,R as t,w as u,l as v,o as x,c as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fn as e,Ur as t,ei as n,it as r,nt as i,ri as a,tt as o}from"./sidebar-BqX460IW.js";import{b as ee}from"./insights-api-Dmd_LgT3.js";var s=a(n(),1),c=t();function l({label:t,children:n}){let a=(0,s.useId)(),[l,u]=(0,s.useState)(!1);return(0,c.jsxs)(o,{open:l,onOpenChange:u,triggerId:a,children:[(0,c.jsx)(r,{id:a,"aria-describedby":l?`${a}-description`:void 0,closeOnClick:!1,onClick:()=>u(e=>!e),render:(0,c.jsx)(e,{"aria-label":t,className:`size-11 sm:size-7`,size:`icon`,variant:`ghost`}),children:(0,c.jsx)(ee,{})}),(0,c.jsx)(i,{id:`${a}-description`,role:`tooltip`,className:`max-w-64`,side:`bottom`,children:n})]})}var u=`[a-zA-Z0-9-]`,d=String.raw`0|[1-9]\d*`,f=String.raw`\d+`,p=String.raw`\d*[a-zA-Z-]${u}*`,m=String.raw`(${d})\.(${d})\.(${d})`,te=String.raw`(${f})\.(${f})\.(${f})`,h=`(?:${p}|${d})`,g=`(?:${p}|${f})`,_=String.raw`(?:-(${h}(?:\.${h})*))`,v=String.raw`(?:-?(${g}(?:\.${g})*))`,y=`${u}+`,b=String.raw`(?:\+(${y}(?:\.${y})*))`,x=`v?${m}${_}?${b}?`,S=String.raw`[v=\s]*${te}${v}?${b}?`,C=String.raw`${d}|x|X|\*`,w=String.raw`${f}|x|X|\*`;String.raw`[v=\s]*(${C})(?:\.(${C})(?:\.(${C})(?:${_})?${b}?)?)?`,String.raw`[v=\s]*(${w})(?:\.(${w})(?:\.(${w})(?:${v})?${b}?)?)?`,String.raw`(?:\^)`;var T=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`,E=String.raw`${T}(?:$|[^\d])`,D=String.raw`${T}(?:${_})?(?:${b})?(?:$|[^\d])`;function O(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[u,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function k(e,t){return new RegExp(O(e),t)}k(`^${x}$`),k(`^${S}$`),k(E),k(D),k(`^${_}$`),k(`^${v}$`);var ne=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.baseBundleId==`string`&&typeof t.baseFileHash==`string`&&typeof t.patchFileHash==`string`&&typeof t.patchStorageUri==`string`},re=e=>Array.isArray(e)?e.filter(ne):[],ie=e=>{let t=re(e.patches),n=new Set;return t.filter(e=>n.has(e.baseBundleId)?!1:(n.add(e.baseBundleId),!0))},A=e=>ie(e)[0]??null,j=e=>A(e)?.baseBundleId??null,M=e=>A(e)?.baseFileHash??null,N=e=>A(e)?.patchFileHash??null,P=1e3,F=P,I=`Invalid cohort. Use 1-1000 or a lowercase slug without spaces, up to 64 characters.`,L=/^[a-z0-9-]+$/;function R(e){if(!/^\d+$/.test(e))return null;let t=Number.parseInt(e,10);return Number.isNaN(t)||t<1||t>1e3?null:t}function z(e,t){return(e%t+t)%t}function B(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function V(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=n%r;n=r,r=e}return n}function H(e,t){let n=0,r=1,i=t,a=z(e,t);for(;a!==0;){let e=Math.floor(i/a);[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}if(i>1)throw Error(`No modular inverse for ${e} mod ${t}`);return z(n,t)}function U(e){let t=z(B(`${e}:multiplier`),997);for(t===0&&(t=1);V(t,P)!==1;)t=z(t+1,P),t===0&&(t=1);let n=z(B(`${e}:offset`),P);return{multiplier:t,offset:n,inverseMultiplier:H(t,P)}}function W(e){return e==null?F:e<=0?0:e>=1e3?P:Math.floor(e)}function G(e){let t=e.trim().toLowerCase(),n=R(t);return n===null?t:String(n)}function K(e){return R(G(e))}function q(e){return K(e)!==null}function J(e){let t=G(e);return t.length>0&&t.length<=64&&!/^\d+$/.test(t)&&L.test(t)}function ae(e){let t=G(e);return q(t)||J(t)}function oe(e,t){if(t<1||t>1e3)throw Error(`Invalid numeric cohort: ${t}`);let{offset:n,inverseMultiplier:r}=U(e);return z(r*(t-1-n),P)}var se=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,Y=e=>typeof e==`string`&&se.test(e),X=e=>{if(!Y(e))throw TypeError(`Expected a canonical lowercase UUIDv7`);let t=e.split(`-`).join(``).slice(0,12);return Number.parseInt(t,16)},Z=e=>typeof e==`string`&&e.trim().length>0&&e.length<=1024?e:void 0,Q=e=>e===`24h`||e===`7d`||e===`30d`?e:void 0,ce=e=>e===`adoption`||e===`crashes`?e:void 0,le=e=>e===`12m`?e:Q(e);function $(e){return{platform:e.platform===`all`||e.platform===`ios`||e.platform===`android`?e.platform:void 0,channel:Z(e.channel),appVersion:Z(e.appVersion),window:le(e.window),bundleWindow:Q(e.bundleWindow),healthPlatform:e.healthPlatform===`ios`||e.healthPlatform===`android`?e.healthPlatform:void 0,healthChannel:Z(e.healthChannel),releaseId:Z(e.releaseId),healthChart:ce(e.healthChart),bundles:Z(e.bundles)}}function ue(e){return{...$(e),version:Z(e.version),page:typeof e.page==`number`&&Number.isSafeInteger(e.page)&&e.page>0?e.page:void 0}}function de(e,t=Date.now()){if(!Y(e))return`7d`;let n=t-X(e);return n<=864e5?`24h`:n<=7*864e5?`7d`:`30d`}var fe=e=>e===void 0?void 0:[...new Set(e.split(`,`).filter(e=>e.length>0))];export{X as a,oe as c,N as d,ae as f,l as h,$ as i,j as l,W as m,fe as n,I as o,G as p,ue as r,P as s,de as t,M as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ConsoleFeatureUnavailable-B-iNWpuE.js";var t=e;export{t as notFoundComponent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-BaOQlBV9.js","assets/ConsoleFeatureUnavailable-B-iNWpuE.js","assets/sidebar-BqX460IW.js","assets/console-features-api-DPE4C06Y.js","assets/arrow-up-right-B5aM0F7f.js","assets/NotFoundPage-Cei6W2lm.js","assets/empty-Bf4DanOL.js","assets/insights_.distribution-EE5OqxyL.js","assets/select-CV8nkfsf.js","assets/useCompositeListItem-B-UkrDlu.js","assets/field-DBMkBfkD.js","assets/insights-usage-rpc-DTL0_Rp8.js","assets/valueToPercent-C4C1WZVn.js","assets/arrow-left-DsivSewE.js","assets/insights-api-Dmd_LgT3.js","assets/insights-search-DAa0f7Dr.js","assets/InsightsPageHeader-SYEOMClX.js","assets/tabs-CgEH_fMT.js","assets/list-Dtj7TtzV.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./console-features-api-DPE4C06Y.js";import{a as t,c as n,s as r}from"./useCompositeListItem-B-UkrDlu.js";import{r as i}from"./insights-search-DAa0f7Dr.js";var a=n(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:r(()=>t(()=>import(`./insights_.distribution-BaOQlBV9.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:r(()=>t(()=>import(`./insights_.distribution-EE5OqxyL.js`),__vite__mapDeps([7,2,8,9,3,10,11,12,13,4,14,15,16,17,18,6])),`component`),validateSearch:i});export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Fn as t,In as n,Ur as r,cr as i}from"./sidebar-BqX460IW.js";import{l as a}from"./console-features-api-DPE4C06Y.js";import{t as o}from"./arrow-left-DsivSewE.js";import{t as s}from"./arrow-up-right-B5aM0F7f.js";import{o as c,u as ee}from"./insights-api-Dmd_LgT3.js";import{_ as te,a as l,f as u,h as d,l as f,m as p,p as m,t as h,u as g,v as _,y as ne}from"./field-DBMkBfkD.js";import{N as v,a as re,i as y,n as b,o as x,r as S,t as C}from"./select-CV8nkfsf.js";import{n as w,r as T,t as E}from"./insights-usage-rpc-DTL0_Rp8.js";import{h as D,i as O}from"./insights-search-DAa0f7Dr.js";import{i as k,o as A,r as j,t as M}from"./empty-Bf4DanOL.js";import{t as N}from"./insights_.distribution-CxXMIEb5.js";import{i as P}from"./valueToPercent-C4C1WZVn.js";import{c as ie,n as F,o as I,t as L}from"./InsightsPageHeader-SYEOMClX.js";var R=r(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}),V=e=>e.releaseId??(e.builtinBundleId?`Built-in bundle ${e.builtinBundleId}`:`Unknown bundle`);function H({bundleId:e}){return(0,R.jsxs)(`div`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2 md:min-h-9`,children:[(0,R.jsx)(F,{}),(0,R.jsx)(P,{bundleId:e,className:`text-muted-foreground`})]})}function U(){let r=N.useSearch(),P=c(),F=N.useNavigate(),U={platform:r.platform??`all`,channel:r.channel??`production`,appVersion:r.appVersion,window:r.window??`24h`},W=i({queryKey:[`insights`,`app-usage`,U],queryFn:()=>E({data:U}),staleTime:3e4}),G=W.error?void 0:W.data,K=G?`since ${B.format(G.distributionSinceMs)}, 00:00 UTC`:`in this period`,q=(G?.bundleDistribution??[]).filter(e=>!r.version||e.appVersion===r.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(r.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...r.version?[r.version]:[]])],Q=O(r),$=e=>void F({search:{...r,page:void 0,...e}});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,R.jsx)(L,{view:`distribution`,overviewSearch:Q}),(0,R.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 px-4 py-6 sm:p-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,R.jsxs)(a,{to:`/insights`,search:Q,className:n({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(o,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to overview`]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,R.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:`Distribution`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(I,{twelveMonths:ee(P),window:U.window,onWindowChange:e=>$({window:e})}),(0,R.jsx)(t,{"aria-label":`Refresh distribution`,variant:`ghost`,size:`icon`,className:`size-11 sm:size-9`,disabled:W.isFetching,onClick:()=>void W.refetch(),children:(0,R.jsx)(T,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(h,{className:`w-full sm:w-64`,children:[(0,R.jsx)(l,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(C,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:r.version?`version:${r.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(re,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(x,{})}),(0,R.jsx)(b,{children:(0,R.jsxs)(S,{children:[(0,R.jsx)(y,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(y,{value:`version:${e}`,children:e},e))]})})]})]}),(0,R.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center gap-2`,"aria-label":`Distribution scope`,children:[(0,R.jsxs)(f,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(v,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(f,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(f,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(p,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(_,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(ne,{children:`Bundles by app version`}),(0,R.jsxs)(D,{label:`How bundle distribution is counted`,children:[`Each installation counts once, by its latest report`,` `,K,`. Shares are within each app version. Built-in bundle: the bundle the native build shipped, by its ID. Unknown bundle: no deployment and no built-in bundle ID.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[W.isPending?(0,R.jsx)(e,{className:`h-9 w-16`}):(0,R.jsx)(`p`,{className:`text-3xl font-semibold tabular-nums`,children:G?`${G.truncated?`≥`:``}${J.toLocaleString()}`:`—`}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Reporting installations`})]})]}),(0,R.jsxs)(d,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(g,{children:[(0,R.jsx)(m,{children:`Partial history`}),(0,R.jsxs)(u,{children:[`Counts and shares reflect reports since`,` `,new Date(G.sinceMs).toLocaleString(`en`,{timeZone:`UTC`}),` `,`UTC. Choose a shorter period for a more complete view.`]})]}):null,W.isPending?(0,R.jsx)(e,{"aria-label":`Loading bundle distribution`,className:`h-64`}):W.error?(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[(0,R.jsx)(ie,{error:W.error,fallbackTitle:`Distribution unavailable`}),(0,R.jsx)(t,{variant:`outline`,onClick:()=>void W.refetch(),children:`Retry distribution`})]}):q.length===0?(0,R.jsxs)(M,{children:[(0,R.jsxs)(k,{children:[(0,R.jsx)(A,{children:`No bundles reported`}),(0,R.jsx)(j,{children:`Choose another version or period, or change the filters in the overview.`})]}),(0,R.jsx)(t,{variant:`outline`,onClick:()=>$({version:void 0}),children:`Show all versions`})]}):(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] gap-4 border-b px-3 pb-3 text-xs text-muted-foreground md:grid`,children:[(0,R.jsx)(`span`,{children:`App version`}),(0,R.jsx)(`span`,{children:`Bundle ID`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Active installations`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Version share`})]}),(0,R.jsx)(`ul`,{"aria-label":`Bundle distribution`,className:`divide-y`,children:q.slice((X-1)*z,X*z).map(e=>{let t=G?.versions.find(t=>t.name===e.appVersion)?.installations??0,n=t>0?e.installations/t*100:0;return(0,R.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-3 px-1 py-4 md:grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] md:px-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-medium`,title:e.appVersion,children:e.appVersion}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(v,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsxs)(`div`,{className:`col-span-2 row-start-2 min-w-0 md:col-span-1 md:row-auto`,children:[e.releaseId?(0,R.jsxs)(a,{to:`/`,search:{releaseId:e.releaseId},"aria-label":`Review bundle ${e.releaseId} for app version ${e.appVersion}`,className:`flex min-h-11 min-w-0 items-center gap-2 text-xs underline-offset-4 hover:underline md:min-h-9`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.releaseId}),(0,R.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):e.builtinBundleId?null:(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`}),e.builtinBundleId?(0,R.jsx)(H,{bundleId:e.builtinBundleId}):null]}),(0,R.jsxs)(`div`,{className:`col-start-2 row-start-1 text-right md:col-auto md:row-auto`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:e.installations.toLocaleString()}),(0,R.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground md:sr-only`,children:`active`}),(0,R.jsxs)(`p`,{className:`mt-1 text-xs tabular-nums text-muted-foreground md:hidden`,children:[n.toFixed(1),`% of version`]})]}),(0,R.jsxs)(`div`,{className:`hidden flex-col gap-2 md:flex`,children:[(0,R.jsxs)(`span`,{className:`text-right text-sm tabular-nums`,children:[n.toFixed(1),`%`]}),(0,R.jsx)(w,{"aria-label":`${V(e)} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId,e.builtinBundleId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(te,{className:`flex flex-wrap items-center justify-between gap-3 border-t pt-4`,children:[(0,R.jsxs)(`p`,{className:`text-xs tabular-nums text-muted-foreground`,children:[(X-1)*z+1,`–`,Math.min(X*z,q.length),` of `,q.length]}),(0,R.jsxs)(`nav`,{"aria-label":`Distribution pages`,className:`flex gap-2`,children:[(0,R.jsx)(t,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X<=1,onClick:()=>$({page:X-1}),children:`Previous`}),(0,R.jsx)(t,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X>=Y,onClick:()=>$({page:X+1}),children:`Next`})]})]}):null]})]})})]})}export{U as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Fn as t,In as n,Ln as r,Ur as i,ei as a,et as o,ir as s,ri as c}from"./sidebar-BqX460IW.js";import{C as l,S as u,f as d,l as f}from"./console-features-api-DPE4C06Y.js";import{d as p,o as m,u as h}from"./useCompositeListItem-B-UkrDlu.js";import{a as g,n as _,o as v,r as y,t as b}from"./EventDetails-CSX2ayg9.js";import{t as x}from"./arrow-left-DsivSewE.js";import{t as S}from"./arrow-up-right-B5aM0F7f.js";import{a as C,c as w,i as T,l as E,n as ee,o as te,r as ne}from"./insights-api-Dmd_LgT3.js";import{a as D,g as O,h as k,m as A,t as j,v as M,x as N,y as P}from"./field-DBMkBfkD.js";import{n as F,t as I}from"./HashValueDisplay-BGkDPaYi.js";import{t as L}from"./refresh-cw-DjIKjmrS.js";import{i as re,n as R,r as ie,t as ae}from"./input-group-B4nrqIh0.js";import{t as oe}from"./search-DuI1FBpg.js";import{a as z,i as se,n as ce,o as le,r as ue,t as B}from"./installations-we1IV0xp.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./table-DgGD67Fx.js";import{a as de,c as q,n as fe,r as pe,t as me}from"./InsightsPageHeader-SYEOMClX.js";function he(){l(d(),!0)}function ge(e){return he(),u(d(),e)}function _e(e){let t=d();return p(t.stores.location,h(e,t))}var J=c(a(),1),Y=i();function ve({events:e,formatter:t,renderIdentity:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,Y.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,Y.jsx)(y,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(_,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,Y.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,Y.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,Y.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,Y.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,Y.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,Y.jsx)(b,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:n,nextCursor:r,onNext:i,onPrevious:a,pageLength:o,pageNumber:s}){return(0,Y.jsxs)(`nav`,{"aria-label":`${n} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:a,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:r===null,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var ye=e=>ue.filter((t,n)=>n===0||z[t].durationMs<=e*864e5);function be({event:e,eventsLocation:t,touch:r=!1}){return(0,Y.jsxs)(`div`,{className:r?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,Y.jsxs)(f,{className:n({className:r?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...t,query:e.installId||void 0,installId:e.installId},state:e=>({insightsPagination:{eventsBack:e.insightsPagination?.eventsBack}}),"aria-label":`View history for ${e.userId??`anonymous installation`} (${e.installId})`,children:[(0,Y.jsx)(`span`,{className:r?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,Y.jsx)(S,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(I,{value:e.installId,maxLength:13,buttonClassName:r?`min-h-11 px-3`:void 0})]})}function xe({children:n,description:r,error:i,eventsLocation:a,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:p,range:m,rawDays:h=90,title:g=`All events`}){let x=v(),S=p>1,C=ye(h),w=m===void 0?void 0:le(m),T=w!==void 0&&C.includes(w)?w:void 0,E=T!==void 0&&d?(0,Y.jsx)(t,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(T),type:`button`,variant:`outline`,children:`Show the last ${z[T].period}`}):null;return(0,Y.jsxs)(A,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,Y.jsxs)(M,{className:`gap-4 p-4 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(P,{children:(0,Y.jsx)(`h2`,{children:g})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[m!==void 0&&d?(0,Y.jsx)(de,{label:`Time range`,onPeriodChange:d,period:m,periods:C.map(e=>({value:e,name:`Last ${z[e].period}`}))}):null,(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(L,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),r?(0,Y.jsx)(O,{children:r}):null]}),n]}),(0,Y.jsx)(k,{className:`min-w-0 p-0`,children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,Y.jsx)(e,{className:`h-12 w-full`}),(0,Y.jsx)(e,{className:`h-12 w-full`}),(0,Y.jsx)(e,{className:`h-12 w-full`})]}):i?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(q,{error:i,fallbackTitle:`Event history unavailable`})}):o?(0,Y.jsxs)(Y.Fragment,{children:[o.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,Y.jsx)(ve,{events:o.data,formatter:x,renderIdentity:e=>(0,Y.jsx)(be,{event:e,eventsLocation:a,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:o.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(_,{value:e.receivedAtMs,formatter:x})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(y,{event:e})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(be,{event:e,eventsLocation:a})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(b,{event:e})})]},e.id))})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S?`No older events in this range.`:m===void 0?g===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${z[m].period}.`}),S?null:E]}),m!==void 0&&o.nextCursor===null&&(o.data.length>0||S)?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),E]}):null,o.data.length>0||S||o.nextCursor?(0,Y.jsx)(X,{hasPrevious:S,label:g,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:p}):null]}):null})]})}var Se=e=>e.userId??`—`,Ce=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function we({error:n,history:r,isLoading:i,onNext:a,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=w,selectedEvent:d,selectedInstallId:f}){let p=v(),m=d?Ce(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,Y.jsxs)(A,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(M,{className:`p-4 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(P,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,Y.jsxs)(O,{children:[`Bundle changes and update failures are kept for`,` `,E(u.rawDays),`; the latest report, for`,` `,E(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:i,children:[(0,Y.jsx)(L,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(k,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,Y.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Se(d)})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,Y.jsx)(I,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,Y.jsxs)(`dd`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-xs`,children:[m?(0,Y.jsx)(I,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`,pe(m,d.minBundleId)?(0,Y.jsx)(fe,{}):null]})]}),h?(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Not launched yet`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,Y.jsx)(I,{value:h})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(g,{event:d})}):null]}),(0,Y.jsx)(o,{})]}):null,f===void 0?null:i?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,Y.jsx)(e,{className:`h-10 w-full`}),(0,Y.jsx)(e,{className:`h-10 w-full`}),(0,Y.jsx)(e,{className:`h-10 w-full`})]}):n?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:n instanceof Error?n:Error(),fallbackTitle:`Installation history unavailable`})}):r&&r.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,Y.jsx)(ve,{events:r.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:r.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(_,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(y,{event:e})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(b,{event:e})})]},e.id))})]})}),(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:r.nextCursor,onNext:a,onPrevious:s,pageLength:r.data.length,pageNumber:l})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),r&&(l>1||r.nextCursor)?(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:r.nextCursor,onNext:a,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Te=e=>e.lastKnownBundleId,Ee=e=>e.userId??`—`;function De({error:e,onNext:i,onPrevious:a,onSelect:o,pageNumber:s,results:c,selectedInstallId:l}){let[u,d]=(0,J.useState)(!1),f=(0,J.useId)(),p=(0,J.useRef)(null),h=!e&&c&&c.data.length>0;return(0,Y.jsxs)(A,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(M,{className:`p-4 sm:px-6`,children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,Y.jsx)(P,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:`Matching installations`})})}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:h?(0,Y.jsx)(t,{"aria-controls":f,"aria-expanded":u,"aria-label":u?`Hide matching installations`:`Show matching installations`,className:`size-11 lg:hidden`,onClick:()=>d(!u),ref:p,size:`icon-lg`,variant:`ghost`,children:(0,Y.jsx)(m,{"aria-hidden":`true`,className:r(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(k,{className:r(`min-h-0 p-0`,h&&!u&&`hidden lg:block`),id:f,children:[e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,Y.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Te(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{"aria-label":`${Ee(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{o(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:Ee(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(N,{"aria-hidden":`true`,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:F(e.installId)})}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:F(t)}):(0,Y.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,Y.jsx)(`a`,{className:n({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),c&&(c.data.length>0||s>1||c.nextCursor)?(0,Y.jsx)(X,{hasPrevious:s>1,label:`Installation results`,nextCursor:c.nextCursor,onNext:i,onPrevious:a,pageLength:c.data.length,pageNumber:s}):null]})]})}function Oe({draftQuery:e,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,Y.jsxs)(j,{className:`gap-2`,children:[(0,Y.jsx)(D,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(ae,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(R,{children:(0,Y.jsx)(oe,{"aria-hidden":`true`})}),(0,Y.jsx)(re,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>n(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,Y.jsx)(R,{align:`inline-end`,children:(0,Y.jsx)(ie,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(s,{"aria-hidden":`true`})})}):null]}),(0,Y.jsx)(t,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function ke(){return(0,Y.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,Y.jsx)(e,{className:`h-64 w-full lg:h-full`}),(0,Y.jsx)(e,{className:`h-64 w-full lg:h-full`})]})}var Ae=20,je=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Me(){let e=B.useSearch(),n=B.useNavigate(),r=te(),[i,a]=(0,J.useState)(e.query??``),[o]=(0,J.useState)(Z),[s]=(0,J.useState)(Z),c=_e({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,h=p||m,g=e.eventsBefore??o,_=e.eventsRange??`7d`,v=e.historyBefore??s,y=(t,r=!1,i={})=>{n({to:`/installations`,search:{...e,...t},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,J.useEffect)(()=>{a(e.query??``)},[e.query]),(0,J.useEffect)(()=>{e.eventsBefore===void 0&&y({eventsBefore:g},!0)},[g,e.eventsBefore]),(0,J.useEffect)(()=>{m&&e.historyBefore===void 0&&y({historyBefore:v},!0)},[m,v,e.historyBefore]);let b=ee({...se(_,g),cursor:e.eventsCursor,limit:20},!h),S=C({cursor:e.searchCursor,identity:f,limit:Ae},p);(0,J.useEffect)(()=>{let e=S.data?.data[0]?.installId;!p||m||e===void 0||y({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,S.data?.data]);let w=T(e.installId??``,m),D=ne({beforeReceivedAtMs:v,cursor:e.historyCursor,installId:e.installId??``,limit:je},m),O=w.data??S.data?.data.find(({installId:t})=>t===e.installId)??D.data?.data[0],j=h?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,M=(0,J.useRef)(null),N=ge({id:j,getKey:ce});(0,J.useLayoutEffect)(()=>{!h&&!b.isLoading&&M.current&&(M.current.scrollTop=N?.scrollY??0)},[b.isLoading,h,N?.scrollY,j]);let P=()=>{a(``),y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},F=(0,Y.jsx)(Oe,{draftQuery:i,onClear:P,onDraftQueryChange:a,onSubmit:()=>{let e=i.trim();if(!e){P();return}y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,Y.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,Y.jsx)(me,{view:`events`}),(0,Y.jsx)(`div`,{ref:M,"data-scroll-restoration-id":j,id:`insights-events-scroll`,className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[h?(0,Y.jsx)(A,{className:`shadow-sm`,children:(0,Y.jsxs)(k,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(t,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:P,variant:`ghost`,children:[(0,Y.jsx)(x,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),F]})}):null,h?S.isLoading&&p?(0,Y.jsx)(ke,{}):(0,Y.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,Y.jsx)(De,{error:S.error,onNext:()=>{S.data?.nextCursor&&y({installId:void 0,searchCursor:S.data.nextCursor},!0,{searchBack:Q(u,e.searchCursor)})},onPrevious:()=>{let e=$(u);y({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{y({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:S.data,selectedInstallId:e.installId}):null,(0,Y.jsx)(we,{error:D.error??w.error,history:D.data,isLoading:D.isLoading||w.isLoading,onNext:()=>{D.data?.nextCursor&&y({historyCursor:D.data.nextCursor},!0,{historyBack:Q(d,e.historyCursor)})},onPrevious:()=>{let e=$(d);y({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{y({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:r,selectedEvent:O,selectedInstallId:e.installId})]}):(0,Y.jsx)(xe,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${E(r.rawDays)}. Launches that change nothing aren't listed.`,error:b.error,eventsLocation:{eventsBefore:g,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:b.data,isFetching:b.isFetching,isLoading:b.isLoading,onNext:()=>{b.data?.nextCursor&&y({eventsCursor:b.data.nextCursor},!0,{eventsBack:Q(l,e.eventsCursor)})},onPrevious:()=>{let e=$(l);y({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{y({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{y({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:_,rawDays:r.rawDays,children:F})]})},j)]})}export{Me as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ConsoleFeatureUnavailable-B-iNWpuE.js";var t=e;export{t as notFoundComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ConsoleFeatureUnavailable-B-iNWpuE.js";var t=e;export{t as notFoundComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,$n 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,P as h,R as g,U as _,Un as v,Ur as y,Ut as b,Wn as x,Xn as S,Xt as C,Yn as w,Yt as ee,Z as T,Zn as E,_ as te,an as ne,ar as D,b as re,bn as ie,ei as ae,er as oe,et as se,g as ce,h as le,ir as O,ln as k,lt as ue,mn as de,p as fe,qt as pe,ri as me,sr as A,tn as he,ut as j,v as ge,vn as _e,w as M,xn as N,y as P,yn as ve}from"./sidebar-BqX460IW.js";import{l as F}from"./console-features-api-DPE4C06Y.js";import{i as ye,n as I,o as be,r as xe}from"./useCompositeListItem-B-UkrDlu.js";import{a as L,i as R,l as z,n as Se,o as B,r as Ce,s as V,t as H}from"./alert-dialog-BtVg50WQ.js";import{a as we,c as Te,d as U,f as Ee,h as De,i as Oe,l as ke,m as Ae,n as je,o as Me,p as Ne,r as Pe,s as Fe,t as Ie,u as Le}from"./api-DoicFJfd.js";import{a as Re,c as W,i as ze,n as G,r as Be,s as Ve,t as He}from"./routes-CyirpG2O.js";import{a as Ue,b as We,c as Ge,f as Ke,g as qe,h as Je,i as Ye,l as K,m as Xe,n as Ze,p as Qe,r as $e,t as et,u as tt,v as nt,x as rt,y as it}from"./field-DBMkBfkD.js";import{t as at}from"./chevron-right-BnvHIJdZ.js";import{A as ot,D as st,E as ct,M as lt,N as ut,P as dt,T as ft,a as pt,d as mt,f as ht,h as gt,i as _t,m as q,n as vt,o as yt,r as bt,t as xt}from"./select-CV8nkfsf.js";import{r as St,t as Ct}from"./HashValueDisplay-BGkDPaYi.js";import{t as wt}from"./list-Dtj7TtzV.js";import{a as Tt,c as Et,i as Dt,l as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./dialog-CGKPxz3n.js";import{a as Pt,i as Ft,n as It,o as Lt,s as Rt,t as zt}from"./input-group-B4nrqIh0.js";import{a as Bt,i as Vt,n as Ht,o as Ut,t as Wt}from"./switch-C8ycp9AH.js";import{n as Gt}from"./dist-dDj-R6uh.js";import{a as Kt,c as qt,d as Jt,f as Yt,h as Xt,l as Zt,m as Qt,o as $t,p as en,s as tn,u as nn}from"./insights-search-DAa0f7Dr.js";import{a as rn,i as J,n as an,o as on,r as Y,t as sn}from"./table-DgGD67Fx.js";import{i as cn,n as ln,t as un}from"./valueToPercent-C4C1WZVn.js";var dn=D(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),fn=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`}]]),pn=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`}]]),mn=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`}]]),hn=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`}]]),gn=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),_n=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`}]]),vn=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`}]]),yn=A();function bn(){return v}function xn(){return!1}function Sn(){return!0}function Cn(){return(0,yn.useSyncExternalStore)(bn,xn,Sn)}var X=me(ae(),1),Z=y(),wn={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 Tn({channel:e,className:t}){return(0,Z.jsx)(K,{variant:`outline`,className:p(wn[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function En({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(rt,{className:p(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(gn,{className:p(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Z.jsx)(O,{className:p(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var Dn=me(Bt(),1),On=me(Vt(),1);Dn.default.extend(On.default);function kn({uuid:e,format:t=`relative`}){let n=(0,Dn.default)(Kt(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 An({panelId:t,bundle:n,bundles:r,loading:a,onDetailClick:o}){let s=le();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(K,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),a?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),s?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(cn,{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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(cn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(kn,{uuid:e.id})})]})]}),(0,Z.jsx)(i,{className:`w-full`,onClick:()=>o(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)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{children:(0,Z.jsxs)(on,{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)(an,{children:r.map(e=>(0,Z.jsxs)(on,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(cn,{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)(cn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(De,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(cn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(K,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(kn,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(i,{onClick:()=>o(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 jn({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=Ht(a),{data:c=[],isPending:l}=Oe(),u=Me(),d=Fe(),f=n.trim(),p=async e=>{if(e.preventDefault(),!(!f||u.isPending))try{let e=await u.mutateAsync({name:f});r(``),e.inserted?Gt.success(`Channel ${e.row.name} created`):Gt.info(`Channel ${e.row.name} already exists`)}catch(e){Gt.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?Gt.success(`Channel ${a.name} deleted`):e.reason===`not_empty`?Gt.error(`Channel ${a.name} is still in use and cannot be deleted`):Gt.error(`Channel ${a.name} no longer exists`),o(null)}catch(e){Gt.error(`Failed to delete channel`),console.error(e)}};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{open:e,onOpenChange:t,children:(0,Z.jsxs)(kt,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsxs)(At,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_n,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(jt,{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)(Ye,{className:`gap-2`,children:(0,Z.jsxs)(et,{orientation:`horizontal`,children:[(0,Z.jsx)(Ue,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(T,{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)(Ot,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Z.jsx)(Et,{"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)(Ot,{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)(Ut,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(H,{open:a!==null,onOpenChange:e=>{!e&&!d.isPending&&o(null)},children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Delete `,s?.name,`?`]}),(0,Z.jsx)(L,{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)(B,{children:[(0,Z.jsx)(Ce,{disabled:d.isPending,children:`Cancel`}),(0,Z.jsx)(Se,{variant:`destructive`,disabled:d.isPending,onClick:e=>{e.preventDefault(),m()},children:d.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Mn=`[a-zA-Z0-9-]`,Nn=String.raw`0|[1-9]\d*`,Pn=String.raw`\d+`,Fn=String.raw`\d*[a-zA-Z-]${Mn}*`,In=String.raw`(${Nn})\.(${Nn})\.(${Nn})`,Ln=String.raw`(${Pn})\.(${Pn})\.(${Pn})`,Rn=`(?:${Fn}|${Nn})`,zn=`(?:${Fn}|${Pn})`,Bn=String.raw`(?:-(${Rn}(?:\.${Rn})*))`,Vn=String.raw`(?:-?(${zn}(?:\.${zn})*))`,Hn=`${Mn}+`,Un=String.raw`(?:\+(${Hn}(?:\.${Hn})*))`,Wn=`v?${In}${Bn}?${Un}?`,Gn=String.raw`[v=\s]*${Ln}${Vn}?${Un}?`,Kn=`((?:<|>)?=?)`,qn=String.raw`${Nn}|x|X|\*`,Jn=String.raw`${Pn}|x|X|\*`,Yn=String.raw`[v=\s]*(${qn})(?:\.(${qn})(?:\.(${qn})(?:${Bn})?${Un}?)?)?`,Xn=String.raw`[v=\s]*(${Jn})(?:\.(${Jn})(?:\.(${Jn})(?:${Vn})?${Un}?)?)?`,Zn=`(?:~>?)`,Qn=String.raw`(?:\^)`,$n=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${$n}(?:$|[^\d])`,String.raw`${$n}(?:${Bn})?(?:${Un})?(?:$|[^\d])`;function er(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Mn,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(er(e),t)}var tr=Q(`^${Wn}$`),nr=Q(`^${Gn}$`),rr=/^\d+$/;function ir(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ar(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?nr:tr);if(!n)throw TypeError(`Invalid version syntax: ${e}`);let r=Number(n[1]),i=Number(n[2]),a=Number(n[3]);if(r>2**53-1||r<0)throw TypeError(`Invalid major version: ${n[1]}`);if(i>2**53-1||i<0)throw TypeError(`Invalid minor version: ${n[2]}`);if(a>2**53-1||a<0)throw TypeError(`Invalid patch version: ${n[3]}`);let o=n[4]?n[4].split(`.`).map(e=>{if(rr.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 or=Q(String.raw`^${Kn}\s*(${Wn})$|^$`),sr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function cr(e){return e.version?`${e.operator}${ir(e.version)}`:``}function lr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?sr:or);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ar(r[2],t):null;return{operator:i,options:t,value:a?`${i}${ir(a)}`:``,version:a}}function ur(e){return e.sets.map(e=>e.map(cr).join(` `)).join(`||`)}var dr=new RegExp(Un,`g`),fr=Q(Un),pr=Q(String.raw`^\s*(${Yn})\s+-\s+(${Yn})\s*$`),mr=Q(String.raw`^\s*(${Xn})\s+-\s+(${Xn})\s*$`),hr=Q(String.raw`(\s*)${Kn}\s*(${Gn}|${Yn})`,`g`),gr=Q(String.raw`(\s*)${Zn}\s+`,`g`),_r=Q(String.raw`(\s*)${Qn}\s+`,`g`),vr=Q(`^${Zn}${Yn}$`),yr=Q(`^${Zn}${Xn}$`),br=Q(`^${Qn}${Yn}$`),xr=Q(`^${Qn}${Xn}$`),Sr=Q(String.raw`^${Kn}\s*${Yn}$`),Cr=Q(String.raw`^${Kn}\s*${Xn}$`),wr=Q(String.raw`(<|>)?=?\s*\*`),Tr=/^\s*>=\s*0\.0\.0\s*$/,Er=/^\s*>=\s*0\.0\.0-0\s*$/,Dr=Q(String.raw`^${Kn}\s*(${Gn})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Or(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function kr(e,t){let n=t.loose?yr:vr,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 Ar(e,t){return e.trim().split(/\s+/).map(e=>kr(e,t)).join(` `)}function jr(e,t){let n=t.loose?xr:br,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 Mr(e,t){return e.trim().split(/\s+/).map(e=>jr(e,t)).join(` `)}function Nr(e,t){let n=t.loose?Cr:Sr;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Or(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 Pr(e,t){return e.split(/\s+/).map(e=>Nr(e,t)).join(` `)}function Fr(e,t){let n=t.loose?mr:pr;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 Ir(e,t){return Pr(Ar(Mr(e.replace(fr,``),t),t),t).trim().replace(wr,``)}function Lr(e,t){let n=Fr(e.replace(dr,``),t).replace(hr,`$1$2$3`).replace(gr,`$1~`).replace(_r,`$1^`).split(` `).map(e=>Ir(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?Er:Tr,``));t.loose&&(n=n.filter(e=>Dr.test(e)));let r=new Map;for(let e of n.map(e=>lr(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 Rr(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Lr(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 zr(e,t={}){try{return Rr(e,t)}catch{return null}}function Br(e,t={}){let n=zr(e,t);return n?ur(n)||`*`:null}var Vr=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$/,``)},Hr=(e,t)=>{if(!e?.trim())return null;let n=Vr(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 Ur({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 Wr({bundle:e,release:t}){let{data:n,isFetched:r}=we(),i=e?Jt(e):null,a=e?nn(e):null,o=e?.gitCommitHash&&r?Hr(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)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(Je,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Ur,{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)(Ur,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(Ct,{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)(pn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Ur,{label:`Manifest hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Ur,{label:`Base hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Ur,{label:`Patch hash`,value:(0,Z.jsx)(Ct,{maxLength:16,value:i})}):null]})})]}):null}var Gr=Array.from({length:tn},(e,t)=>t+1);function Kr({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Qt(t),a=n??[],o=a.length>0,s=r>0&&r<1e3,c=r===tn,l=le(),u=c?Gr:s?Gr.filter(t=>qt(e,t)<r):[],d=(r/10).toFixed(1),f=c?tn:u.length,p=tn-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)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Selected cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:f})]})}),(0,Z.jsx)(Xe,{children:(0,Z.jsxs)(nt,{className:`p-4`,children:[(0,Z.jsx)(qe,{children:`Excluded cohorts`}),(0,Z.jsx)(it,{className:`font-mono text-2xl tabular-nums`,children:p})]})})]}),o?(0,Z.jsxs)(Xe,{children:[(0,Z.jsxs)(nt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(it,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(qe,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(Je,{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)(K,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(Xe,{children:[(0,Z.jsx)(nt,{className:`p-4 pb-3`,children:(0,Z.jsx)(it,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(Je,{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)(K,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(Nt,{children:[(0,Z.jsxs)(Mt,{render:(0,Z.jsx)(i,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(wt,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(kt,{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)(Tt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` 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)(Dt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Rolled out cohorts`}),(0,Z.jsxs)(jt,{children:[d,`% includes `,f,` of`,` `,tn,` numeric cohorts.`,o?` Additional cohorts are always included.`:``]})]}),m,(0,Z.jsx)(Dt,{showCloseButton:!0})]})})]})}function qr(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function Jr(e,t){return e-t}function Yr(e,t,n){let r=e.slice();return r[t]=n,r.sort(Jr)}function Xr(e,t,n,r,i,a){let o=e;return o=q(o,n,r),i&&(o=Yr(a,t,q(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Zr(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 Qr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...lt},$r=X.createContext(void 0);function ei(){let e=X.useContext($r);if(e===void 0)throw Error(l(62));return e}function ti(e){return`key`in e?k:ne}function ni(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?qr(e,t):!1}var ri=X.forwardRef(function(e,t){let{"aria-labelledby":r,className:i,defaultValue:o,disabled:s=!1,id:c,format:l,largeStep:u=10,locale:d,render:f,max:p=100,min:m=0,minStepsBetweenValues:h=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:b=`horizontal`,step:x=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:te,style:ne,...D}=e,re=j(c),ae=mt(re),oe=E(v),se=E(y),{clearErrors:ce}=gt(),{state:le,disabled:O,name:k,setTouched:ue,setDirty:de,validityData:fe,shouldValidateOnChange:me,validation:A}=ot(),{labelId:he}=ct(),[ge,_e]=X.useState(),N=r??ht(he,ge),P=O||s,F=k??_,[I,be]=ye({controlled:te,default:o??m,name:`Slider`}),L=X.useRef(null),R=X.useRef(null),z=X.useRef([]),Se=X.useRef(null),B=X.useRef(null),Ce=X.useRef(-1),V=X.useRef(null),H=X.useRef(null),we=X.useRef(`none`),Te=pe(l),[U,Ee]=X.useState(-1),[De,Oe]=X.useState(-1),[ke,Ae]=X.useState(!1),[je,Me]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=E(e=>{Ee(e),e!==-1&&Oe(e)});st(R,re,I),M(I,()=>{ce(F),me()?A.commit(I):A.commit(I,!0);let e=fe.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!qr(I,e):I!==e,de(t)});let Ie=E(e=>{e&&(R.current=e)}),Le=Array.isArray(I),Re=X.useMemo(()=>Le?I.slice().sort(Jr):[q(I,m,p)],[p,m,Le,I]),W=E((e,t)=>{if(Number.isNaN(e)||ni(e,I))return;let n=t??ee(`none`,void 0,void 0,{activeThumbIndex:-1});we.current=n.reason;let r=n.event,i=new(r.constructor??Event)(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:e,name:F}}),n.event=i,H.current=e,oe(e,n),!n.isCanceled&&be(e)}),ze=E((e,t,n)=>{let r=Xr(e,t,m,p,Le,Re);if(Zr(r,x,h)){let e=ti(n);W(r,ee(e,n.nativeEvent,void 0,{activeThumbIndex:t})),ue(!0),se(H.current??r,C(e,n.nativeEvent))}});S(()=>{let e=ve(a(L.current));P&&ie(L.current,e)&&e.blur()},[P]),P&&U!==-1&&Fe(-1);let G=X.useMemo(()=>({...le,activeThumbIndex:U,disabled:P,dragging:ke,orientation:b,max:p,min:m,minStepsBetweenValues:h,step:x,values:Re}),[le,U,P,ke,p,m,h,b,x,Re]),Be=X.useMemo(()=>({active:U,controlRef:R,disabled:P,dragging:ke,validation:A,formatOptionsRef:Te,handleInputChange:ze,indicatorPosition:Ne,inset:T!==`center`,labelId:N,rootLabelId:ae,largeStep:u,lastUsedThumbIndex:De,lastChangedValueRef:H,lastChangeReasonRef:we,form:g,locale:d,max:p,min:m,minStepsBetweenValues:h,name:F,onValueCommitted:se,orientation:b,pressedInputRef:Se,pressedThumbCenterOffsetRef:B,pressedThumbIndexRef:Ce,pressedValuesRef:V,registerFieldControlRef:Ie,renderBeforeHydration:T===`edge`,setActive:Fe,setDragging:Ae,setIndicatorPosition:Pe,setLabelId:_e,setValue:W,state:G,step:x,thumbCollisionBehavior:w,thumbMap:je,thumbRefs:z,values:Re}),[U,R,N,ae,P,ke,A,Te,ze,Ne,u,De,H,we,g,d,p,m,h,F,se,b,Se,B,Ce,V,Ie,Fe,Ae,Pe,_e,W,G,x,w,T,je,z,Re]),Ve=n(`div`,e,{state:G,ref:[t,L],props:[{"aria-labelledby":N,id:re,role:`group`},A.getValidationProps,D],stateAttributesMapping:Qr});return(0,Z.jsx)($r.Provider,{value:Be,children:(0,Z.jsx)(xe,{elementsRef:z,onMapChange:Me,children:Ve})})});function ii(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ai(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 oi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(ai(t),ai(n))))}function si({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]=q(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]=q(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]=q(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function ci({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=q(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=si({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=q(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:si({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=q(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 li=2;function ui(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 di(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var fi=X.forwardRef(function(e,r){let{render:i,className:o,style:s,...c}=e,{disabled:l,dragging:f,inset:p,lastChangedValueRef:m,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:S,pressedThumbIndexRef:w,pressedValuesRef:T,registerFieldControlRef:te,renderBeforeHydration:ne,setActive:D,setDragging:re,setValue:ae,state:se,step:ce,thumbCollisionBehavior:le,thumbRefs:O,values:k}=ei(),fe=ue(),me=k.length>1,A=b===`vertical`,j=X.useRef(null),ge=X.useRef(null),_e=E(e=>{e&&ge.current==null&&(ge.current=t(e).getComputedStyle(e))}),M=X.useRef(null),P=X.useRef(0),F=X.useRef(0),ye=pe(k);function I(e){w.current!==e&&(w.current=e);let t=O.current[e];if(!t){S.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function be(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=ui(ge.current,A),c=F.current,l=(A?r:n)-s.start-s.end-c*2,u=S.current??0,d=e.x-u,f=e.y-u,p=q(((A?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=oi(m,ce,_),m=q(m,_,g),!me)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let y=ci({behavior:le,values:k,currentValues:ye.current??k,initialValues:T.current,pressedIndex:h,nextValue:m,min:_,max:g,step:ce,minStepsBetweenValues:v});return le===`swap`&&y.didSwap?I(y.thumbIndex):w.current=y.thumbIndex,y}function xe(e){T.current=me?k.slice():null,ye.current=k;let t=w.current,n=t;if(t>-1&&t<k.length){if(k[t]===g){let e=t;for(;e>0&&k[e-1]===g;)--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(oe(a)){let o=ii(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&I(n),p){let e=O.current[n];oe(e)&&(F.current=e.getBoundingClientRect()[A?`height`:`width`]/2)}}function L(e){let t=O.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let R=E(e=>{let t=di(e,M);if(t==null)return;if(P.current+=1,e.type===`pointermove`&&e.buttons===0){z(e);return}let n=be(t);n!=null&&Zr(n.value,ce,v)&&(!f&&P.current>li&&re(!0),ae(n.value,ee(he,e,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))});function z(e){D(-1),re(!1),x.current=null,S.current=null;let t=di(e,M),n=t==null?null:be(t);if(n!=null){let t=h.current;y(m.current??n.value,C(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),w.current=-1,M.current=null,T.current=null,B()}let Se=E(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(M.current=t.identifier);let n=di(e,M);if(n!=null){xe(n);let t=be(n);if(t==null)return;L(t.thumbIndex),ae(t.value,ee(de,e,void 0,{activeThumbIndex:t.thumbIndex})),ye.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&L(t.thumbIndex)}P.current=0;let r=a(j.current);r.addEventListener(`touchmove`,R,{passive:!0}),r.addEventListener(`touchend`,z,{passive:!0})}),B=E(()=>{let e=a(j.current);e.removeEventListener(`pointermove`,R),e.removeEventListener(`pointerup`,z),e.removeEventListener(`touchmove`,R),e.removeEventListener(`touchend`,z),T.current=null}),Ce=d();return X.useEffect(()=>{let e=j.current;if(!e)return()=>B();let t=u(e,`touchstart`,Se,{passive:!0});return()=>{t(),Ce.cancel(),B()}},[B,Se,j,Ce]),X.useEffect(()=>{l&&B()},[l,B]),n(`div`,e,{state:se,ref:[r,te,j,_e],props:[{"data-base-ui-slider-control":ne?``:void 0,onPointerDown(e){let t=j.current,n=N(e.nativeEvent);if(!t||l||e.defaultPrevented||!oe(n)||e.button!==0)return;let r=di(e,M);if(r!=null){xe(r);let n=be(r);if(n==null)return;ie(O.current[n.thumbIndex],ve(a(t)))?e.preventDefault():Ce.request(()=>{L(n.thumbIndex)}),re(!0),S.current??(ae(n.value,ee(de,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ye.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&L(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),P.current=0;let i=a(j.current);i.addEventListener(`pointermove`,R,{passive:!0}),i.addEventListener(`pointerup`,z,{once:!0})}},c],stateAttributesMapping:Qr})}),pi=X.forwardRef(function(e,t){let{render:r,className:i,style:a,...o}=e,{state:s}=ei();return n(`div`,e,{state:s,ref:t,props:[{style:{position:`relative`}},o],stateAttributesMapping:Qr})}),mi=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}({}),hi=new Set([...f,_,o]);function gi(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${ln(e[t],r,n)} start range`:`${ln(e[t],r,n)} end range`:n?ln(e[t],r,n):void 0}function _i(e,t,n,r,i){let a=n===1?e+t:e-t;return q(Number(a.toFixed(Math.max(ai(e),ai(t),ai(r)))),r,i)}var vi=X.forwardRef(function(e,i){let{render:a,children:c,className:l,"aria-describedby":u,"aria-label":d,"aria-labelledby":p,disabled:v=!1,getAriaLabel:y,getAriaValueText:C,id:ee,index:T,inputRef:te,onBlur:ne,onFocus:D,onKeyDown:re,tabIndex:ie,style:ae,...oe}=e,{nonce:se}=dt(),ce=j(ee),{active:le,lastUsedThumbIndex:O,controlRef:k,disabled:de,validation:fe,formatOptionsRef:pe,handleInputChange:me,inset:A,labelId:he,largeStep:ge,locale:M,max:N,min:P,minStepsBetweenValues:ve,form:F,name:ye,orientation:be,pressedInputRef:xe,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:R,renderBeforeHydration:z,setActive:Se,setIndicatorPosition:B,state:Ce,step:V,values:H}=ei(),we=ue(),Te=v||de,U=H.length>1,Ee=be===`vertical`,De=we===`rtl`,{setTouched:Oe,setFocused:ke,validationMode:Ae}=ot(),je=X.useRef(null),Me=X.useRef(null),Ne=X.useRef(!1),Pe=j(),Fe=ft(),Ie=U?Pe:Fe,{ref:Le,index:Re}=I({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),W=U?T??Re:0,ze=W===H.length-1,G=H[W],Be=un(G,P,N),[Ve,He]=X.useState(),Ue=Cn(),We=O>=0&&O<H.length?O:-1,Ge=E(()=>{let e=k.current,t=je.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Ee?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Be/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;He(s),W===0?B(e=>[s,e[1]]):ze&&B(e=>[e[0],s])});S(()=>{A&&queueMicrotask(Ge)},[Ge,A]),S(()=>{A&&Ge()},[Ge,A,Be]),S(()=>{if(!A)return;let e=k.current,n=je.current;if(!e||!n)return;let r=t(e).ResizeObserver;if(typeof r!=`function`)return;let i=new r(Ge);return i.observe(e),i.observe(n),()=>{i.disconnect()}},[k,Ge,A]);let Ke=Ee?`bottom`:`insetInlineStart`,qe=Ee?`left`:`top`,Je;U?le===W?Je=2:We===W&&(Je=1):le===W&&(Je=1);let Ye;Ye=A?{"--position":`${Ve??0}%`,visibility:z&&Ue||Ve===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Be)?{position:`absolute`,[Ke]:`${Be}%`,[qe]:`50%`,translate:`${(Ee||!De?-1:1)*50}% ${(Ee?1:-1)*50}%`,zIndex:Je}:b;let K;be===`vertical`&&(K=De?`vertical-rl`:`vertical-lr`);let Xe=typeof y==`function`?y(W):d,Ze=w({"aria-label":Xe,"aria-labelledby":p??(Xe==null?he:void 0),"aria-describedby":u,"aria-orientation":be,"aria-valuenow":G,"aria-valuetext":typeof C==`function`?C(ln(G,M,pe.current??void 0),G,W):gi(H,W,pe.current??void 0,M),disabled:Te,form:F,id:Ie,max:N,min:P,name:ye,onChange(e){me(e.currentTarget.valueAsNumber,W,e)},onFocus(e){let t=Ne.current;Ne.current=!1,Se(W),ke(!0),t&&e.stopPropagation()},onBlur(e){if(Ne.current){e.stopPropagation();return}je.current&&(Se(-1),Oe(!0),ke(!1),Ae===`onBlur`&&fe.commit(Xr(G,W,P,N,U,H)))},onKeyDown(e){if(!hi.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=oi(G,V,P);switch(e.key){case s:t=_i(n,e.shiftKey?ge:V,1,P,N);break;case r:t=_i(n,e.shiftKey?ge:V,De?-1:1,P,N);break;case m:t=_i(n,e.shiftKey?ge:V,-1,P,N);break;case h:t=_i(n,e.shiftKey?ge:V,De?1:-1,P,N);break;case _:t=_i(n,ge,1,P,N);break;case o:t=_i(n,ge,-1,P,N);break;case`End`:t=N,U&&(t=Number.isFinite(H[W+1])?H[W+1]-V*ve:N);break;case g:t=P,U&&(t=Number.isFinite(H[W-1])?H[W-1]+V*ve:P);break;default:break}if(t!==null){let n=e.currentTarget;_e(n)||(Ne.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),me(t,W,e),e.preventDefault()}},step:V,style:{...b,width:`100%`,height:`100%`,writingMode:K},tabIndex:ie??void 0,type:`range`,value:G??``},fe.getInputValidationProps),Qe=x(Me,fe.inputRef,te);return n(`div`,e,{state:Ce,ref:[i,Le,je],props:[{[mi.index]:W,children:(0,Z.jsxs)(X.Fragment,{children:[c,(0,Z.jsx)(`input`,{ref:Qe,...Ze,suppressHydrationWarning:!0}),A&&Ue&&z&&ze&&(0,Z.jsx)(`script`,{nonce:se,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();'},suppressHydrationWarning:!0})]}),id:ce,onBlur:ne,onFocus:D,onPointerDown(e){if(R.current=W,je.current!=null){let t=be===`horizontal`?`x`:`y`,n=ii(je.current);L.current=(be===`horizontal`?e.clientX:e.clientY)-n[t]}Me.current!=null&&xe.current!==Me.current&&(xe.current=Me.current)},style:Ye,suppressHydrationWarning:z||void 0},oe],stateAttributesMapping:Qr})});function yi(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 bi(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 xi=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}=ei(),h=Cn(),g=d===`vertical`,_=m.length>1,v=c?yi(g,_,s[0],s[1],f,h):bi(g,_,un(m[0],u,l),un(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:Qr})});function Si({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)(ri,{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)(fi,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(pi,{"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)(xi,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(vi,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Ci=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],wi=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]}),Ti=(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}),Ei=e=>(e/10).toFixed(1),Di=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},Oi=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function ki({value:e,onChange:t}){let[n,r]=(0,X.useState)(Ei(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(Ei(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Si,{"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)(zt,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(Ft,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=Oi(n)??e;a(!1),r(Ei(i)),t(i)},onChange:e=>{let n=Di(e.target.value);r(n);let i=Oi(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(It,{align:`inline-end`,children:(0,Z.jsx)(Pt,{children:`%`})})]})]})}function Ai({channels:t,onOpenChange:n,onShowScope:r,open:a,releaseId:o}){let s=Ee(o),c=s.data,l=Pe(c?.bundle_id??``),u=l.data,d=u?Zt(u):null,f=U(c?.scope_key??``),p=Ae(),m=ke(),h=Te(),g=Le(),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(!1),[ee,E]=(0,X.useState)(!1),[ne,D]=(0,X.useState)(!1),[ie,ae]=(0,X.useState)(``),[oe,le]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?wi(c):null),S(``)},[c]);let k=c?wi(c):null,ue=_!==null&&k!==null&&JSON.stringify(_)!==JSON.stringify(k),de=m.isPending||p.isPending||h.isPending||g.isPending,fe=()=>{if(!de){if(ue){w(!0);return}n(!1)}},pe=()=>{if(!_)return;let e=en(y);if(!Yt(e)){S($t);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),b(``),S(``)},me=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(en);if(e.some(e=>!Yt(e))){S($t);return}if(c.strategy===`APP_VERSION`&&!Br(_.targetAppVersion.trim())){S(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:Ti(c,{..._,targetCohorts:e}),releaseId:c.id};S(``);try{await m.mutateAsync(t),await p.mutateAsync(t),Gt.success(`Bundle settings saved`),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},A=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,he=t.filter(e=>e.id!==c?.channel_id),j=he.map(e=>({label:e.name,value:e.name})),_e=ie.trim(),M=oe===`copy`,N=_?Br(_.targetAppVersion.trim()):null,ve=()=>{ae(``),le(`move`)},F=e=>{!e&&g.isPending||(D(e),e||ve())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ce,{onOpenChange:e=>e?void 0:fe(),open:a,children:(0,Z.jsxs)(te,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(P,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(re,{children:`Bundle Detail`}),(0,Z.jsx)(ge,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(ut,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(cn,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:A})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(tt,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Ke,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[A?(0,Z.jsx)(Re,{release:{platform:c.platform,channel:A,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Ye,{className:`gap-6`,children:[(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(Lt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(T,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),N?(0,Z.jsx)(Ze,{children:N}):null]}):null,(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(Xt,{label:`About Enabled`,children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsx)(Wt,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(et,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(Xt,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(Wt,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(et,{children:[(0,Z.jsx)(Ue,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(ki,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(et,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Ue,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Kr,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(T,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),pe())},placeholder:`e.g. qa-team…`,value:y}),(0,Z.jsx)(i,{"aria-label":`Add cohort`,disabled:!y.trim(),onClick:pe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Et,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(K,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(O,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Ze,{children:`Public names—no IDs or secrets.`})]})]}),x?(0,Z.jsx)($e,{children:x}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:!ue||de,onClick:me,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(se,{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:!c.bundle_id||de,onClick:()=>D(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(i,{className:`w-full`,disabled:de,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Gt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(St,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(i,{className:`w-full`,disabled:c.enabled||de,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Build details are unavailable`}),(0,Z.jsx)(Ke,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(Wr,{bundle:u,release:c}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:d})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.scope_key}),r?(0,Z.jsx)(i,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(H,{onOpenChange:w,open:C,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(z,{children:`Discard unsaved changes?`}),(0,Z.jsx)(L,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Keep editing`}),(0,Z.jsx)(Se,{onClick:()=>{w(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(H,{onOpenChange:E,open:ee,children:(0,Z.jsxs)(R,{children:[(0,Z.jsxs)(V,{children:[(0,Z.jsxs)(z,{children:[`Remove this Bundle from `,A??`the channel`,`?`]}),(0,Z.jsx)(L,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(Ce,{children:`Cancel`}),(0,Z.jsx)(Se,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),Gt.success(`Bundle removed from ${A??`the channel`}`),E(!1),n(!1)}catch(e){S(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Z.jsx)(Nt,{onOpenChange:F,open:ne,children:(0,Z.jsxs)(kt,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(At,{children:`Promote to Channel`}),(0,Z.jsx)(jt,{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)(Ge,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:Ci,onValueChange:e=>le(e),value:oe,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(yt,{placeholder:`Select an action`})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(_t,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:M?`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)(Ge,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(xt,{disabled:g.isPending,items:j,onValueChange:e=>ae(e??``),value:ie||null,children:[(0,Z.jsx)(pt,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(yt,{placeholder:`Select a channel`})}),(0,Z.jsx)(vt,{className:`max-h-64`,children:(0,Z.jsx)(bt,{children:he.map(e=>(0,Z.jsx)(_t,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(Dt,{children:[(0,Z.jsx)(i,{disabled:g.isPending,onClick:()=>F(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(i,{disabled:!_e||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:oe,expectedRevision:c.revision,releaseId:c.id,targetChannel:_e}),F(!1),Gt.success(M?`Bundle copied to ${_e}`:`Bundle moved to ${_e}`)}catch(e){Gt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?M?`Copying…`:`Moving…`:M?`Copy`:`Move`})]})]})})]})}function ji({release:e}){return(0,Z.jsxs)(K,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(rt,{className:`size-3`}):(0,Z.jsx)(fn,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Mi({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Z.jsxs)(K,{className:p(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Z.jsx)(We,{className:`h-3 w-3`}):null,r,`%`]})}var Ni=20,Pi=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Fi=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ii=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Li=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}),Ri=e=>t=>{t.target instanceof Element&&t.target.closest(`button, a, input, select, textarea`)||e()};function zi({channels:e,onChange:t,onClear:n,onManageChannels:r,search:a}){let o=G(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)(hn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsxs)(xt,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:a.channelId??`all`,children:[(0,Z.jsx)(pt,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`All Channels`}),e.map(e=>(0,Z.jsx)(_t,{value:e.id,children:e.name},e.id))]})})]}),(0,Z.jsxs)(xt,{disabled:!s,items:Pi,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:a.platform??`ios`,children:[(0,Z.jsx)(pt,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:s?void 0:`Choose a channel first`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`ios`,children:`iOS`}),(0,Z.jsx)(_t,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(xt,{disabled:!s&&a.scopeKey===void 0,items:Fi,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)(pt,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Z.jsx)(yt,{})}),(0,Z.jsx)(vt,{children:(0,Z.jsxs)(bt,{children:[(0,Z.jsx)(_t,{value:`all`,children:`Any Status`}),(0,Z.jsx)(_t,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(_t,{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)(vn,{})}),a.bundleId?(0,Z.jsxs)(K,{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)(O,{className:`size-3`})})]}):null,a.scopeKey?(0,Z.jsxs)(K,{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)(O,{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)(O,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Bi({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)(be,{}):(0,Z.jsx)(at,{})}):(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)(cn,{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)(Rt,{className:`size-3.5`}),` Built-in bundle`]})]}),a?(0,Z.jsx)(K,{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)(fn,{className:`size-3.5`}),`Unreachable`]}):null]})}function Vi({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Pe(i),o=je(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(An,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function Hi(){let t=He.useSearch(),n=He.useNavigate(),r=le(),[a,o]=(0,X.useState)(!1),[s,l]=(0,X.useState)(),u=Ne({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:Be(t),limit:Ni}),d=Oe().data??[],f=u.data?.data??[],m=Ie(Array.from(new Set(f.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},h=u.data?.next,g=u.data?.previous,_=f.flatMap(e=>{let t=d.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t,builtIn:!e.bundle_id}]:[]}),v=Ve(),y=10+v.length,b=new Map(d.map(e=>[e.id,e.name]));(0,X.useEffect)(()=>{s&&!f.some(e=>e.id===s)&&l(void 0)},[s,f]);let x=(e,t=!0)=>void n({resetScroll:t,search:e,to:`/`}),S=e=>x(ze(t,e)),C=e=>{let n=f.find(t=>t.bundle_id===e.id);if(l(void 0),n){x({...t,releaseId:n.id},!1);return}S({bundleId:e.id})},w=t.afterReleaseId!==void 0||t.beforeReleaseId!==void 0,ee=g?{...t,afterReleaseId:g,beforeReleaseId:void 0,releaseId:void 0}:null,T=h?{...t,afterReleaseId:void 0,beforeReleaseId:h,releaseId:void 0}:null,E={...t,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(zi,{channels:d,onChange:S,onClear:()=>x({}),onManageChannels:()=>o(!0),search:t}),(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:[u.isError?(0,Z.jsxs)(tt,{variant:`destructive`,children:[(0,Z.jsx)(We,{}),(0,Z.jsx)(Qe,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Ke,{children:u.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:r?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:u.isPending?(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(t,n)=>(0,Z.jsx)(e,{className:`h-44 w-full`},n))}):f.length?f.map(e=>{let n=b.get(e.channel_id)??e.channel_id,r=e.bundle_id?m[e.bundle_id]:0,i=s===e.id,a=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(`article`,{"aria-label":`Bundle ${e.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`,e.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":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(Bi,{expanded:i,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(i?void 0:e.id),release:e}),(0,Z.jsx)(Tn,{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)(ut,{className:`size-4`,platform:e.platform}),e.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:Ii.format(e.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)(Mi,{percentage:e.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:t,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)(t,{releaseId:e.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)(ji,{release:e}),e.should_force_update?(0,Z.jsx)(K,{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:e.target_app_version??e.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:e.message||`—`})]})]})]})]}),i&&e.bundle_id?(0,Z.jsx)(Vi,{onDetailClick:C,panelId:a,release:e}):null]},e.id)}):(0,Z.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Z.jsxs)(sn,{className:`min-w-max`,children:[(0,Z.jsx)(rn,{className:`bg-muted/40`,children:(0,Z.jsxs)(on,{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)(an,{children:[u.isPending?Array.from({length:7},(t,n)=>(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{colSpan:y,children:(0,Z.jsx)(e,{className:`h-8 w-full`})})},n)):f.map(e=>{let n=s===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(on,{"aria-label":`Open bundle ${e.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`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":t.releaseId===e.id?`selected`:void 0,onClick:Ri(()=>x({...t,releaseId:e.id},!1)),onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),x({...t,releaseId:e.id},!1))},tabIndex:0,children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(Bi,{expanded:n,onOpen:()=>x({...t,releaseId:e.id},!1),onToggleExpand:()=>l(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Tn,{channel:b.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(ut,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})}),(0,Z.jsx)(Y,{children:e.bundle_id&&m[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&m[e.bundle_id]>0?(0,Z.jsxs)(K,{variant:`secondary`,children:[m[e.bundle_id],` `,m[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:e.target_app_version?(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(W,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`font-medium`,children:e.target_app_version})]}):e.fingerprint_hash?(0,Z.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Z.jsx)(mn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(Ct,{maxLength:12,value:e.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)(En,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(En,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Mi,{percentage:e.rollout_cohort_count/10})}),v.map(({Cell:t,feature:n})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(t,{releaseId:e.id,releases:_})},n)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ii.format(e.created_at_ms),children:Li.format(e.created_at_ms)})]}),n&&e.bundle_id?(0,Z.jsx)(on,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:y,children:(0,Z.jsx)(Vi,{onDetailClick:C,panelId:r,release:e})})}):null]},e.id)}),!u.isPending&&f.length===0?(0,Z.jsx)(on,{children:(0,Z.jsx)(Y,{className:`h-40 text-center text-muted-foreground`,colSpan:y,children:w?`No more bundles on this side.`:G(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!u.isError&&!u.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:f.length}),` `,f.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)(F,{className:c({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:E,to:`/`,children:`Newest`}):null,ee?(0,Z.jsxs)(F,{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)(dn,{"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)(dn,{"data-icon":`inline-start`}),`Previous`]}),T?(0,Z.jsxs)(F,{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)(at,{"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)(at,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Z.jsx)(Ai,{channels:d,onOpenChange:e=>!e&&x({...t,releaseId:void 0},!1),onShowScope:e=>S({scopeKey:e}),open:!!t.releaseId,releaseId:t.releaseId??``}),(0,Z.jsx)(jn,{onOpenChange:o,open:a})]})}export{Hi as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-Br26jzt9.js","assets/sidebar-BqX460IW.js","assets/useCompositeListItem-B-UkrDlu.js","assets/console-features-api-DPE4C06Y.js","assets/alert-dialog-BtVg50WQ.js","assets/select-CV8nkfsf.js","assets/field-DBMkBfkD.js","assets/switch-C8ycp9AH.js","assets/valueToPercent-C4C1WZVn.js","assets/api-DoicFJfd.js","assets/chevron-right-BnvHIJdZ.js","assets/HashValueDisplay-BGkDPaYi.js","assets/dist-dDj-R6uh.js","assets/list-Dtj7TtzV.js","assets/dialog-CGKPxz3n.js","assets/input-group-B4nrqIh0.js","assets/insights-search-DAa0f7Dr.js","assets/insights-api-Dmd_LgT3.js","assets/table-DgGD67Fx.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$ as e,In as t,Ln as n,Ur as r,Wr as i,ar as a,cr as o,et as s,nr as c,rr as l}from"./sidebar-BqX460IW.js";import{a as u,i as d,l as f,o as p}from"./console-features-api-DPE4C06Y.js";import{a as ee,c as m,s as h}from"./useCompositeListItem-B-UkrDlu.js";import{_ as g,m as _,s as v,x as y}from"./insights-api-Dmd_LgT3.js";import{_ as b,h as x,m as S,v as C,y as w}from"./field-DBMkBfkD.js";import{t as T}from"./key-round-B4fI1psK.js";import{s as te}from"./switch-C8ycp9AH.js";import{h as E,t as D}from"./insights-search-DAa0f7Dr.js";var O=a(`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=a(`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=r(),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(i(`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 o({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)(E,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:r=!1,input:i,variant:a=`inline`}){if(!t)return r?(0,A.jsx)(e,{"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(t),c=(0,A.jsx)(`dl`,{className:n(a===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:r,color:i})=>(0,A.jsxs)(`div`,{className:n(`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:e}),(0,A.jsxs)(`dd`,{className:n(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,a===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[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:`—`}):t[r].toLocaleString(),r===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},r))});return(0,A.jsxs)(`div`,{className:n(`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:D(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:t}){let r=v({platform:t.platform,channel:t.channel,releaseId:t.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:n(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,i.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[i.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,g(_(i)),`)`]})]})]})}):r.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(E,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let n=N([e]);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:e,loading:n.isFetching,report:n.data?.[e.releaseId]}),(0,A.jsx)(s,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(b,{className:`px-4 pb-4`,children:(0,A.jsxs)(f,{className:t({variant:`outline`,size:`sm`}),to:`/insights`,search:{healthPlatform:e.platform,healthChannel:e.channel,releaseId:e.releaseId,bundleWindow:D(e.releaseId),healthChart:`adoption`},children:[(0,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-Br26jzt9.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};
|