@hot-updater/console 1.0.0-rc.20 → 1.0.0-rc.21
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/{ConsoleFeatureUnavailable-B9VYGA3N.js → ConsoleFeatureUnavailable-D0LPL1Gy.js} +1 -1
- package/.output/public/assets/{HashValueDisplay-D880zntR.js → HashValueDisplay-BmuB4FW-.js} +1 -1
- package/.output/public/assets/InsightsInfo--v4SC07c.js +1 -0
- package/.output/public/assets/InsightsPageHeader-dU83CAQY.js +1 -0
- package/.output/public/assets/{NotFoundPage-Dys8C0cW.js → NotFoundPage-B5mhGG2a.js} +1 -1
- package/.output/public/assets/api-D-vOVlQ4.js +1 -0
- package/.output/public/assets/api-keys-Csh8ARKU.js +1 -0
- package/.output/public/assets/api-keys-OMPUoA_A.js +1 -0
- package/.output/public/assets/arrow-left-Bwq9X1eS.js +1 -0
- package/.output/public/assets/arrow-up-right-BkOVn4if.js +1 -0
- package/.output/public/assets/{card-DzCPSRsh.js → card-C_7d6O9a.js} +1 -1
- package/.output/public/assets/console-features-api-C1jRZTGw.js +1 -0
- package/.output/public/assets/dialog-DE8wFN_P.js +1 -0
- package/.output/public/assets/{dist-Clb6cQ9l.js → dist-C7ENGzpS.js} +1 -1
- package/.output/public/assets/empty-CVd5NlQD.js +1 -0
- package/.output/public/assets/{field-Bou7shoO.js → field-C06q1iC9.js} +1 -1
- package/.output/public/assets/index-BeWlQtO6.js +11 -0
- package/.output/public/assets/{input-group-DVtWFUUF.js → input-group-Bi61biIA.js} +1 -1
- package/.output/public/assets/insights-BjnAtC0f.js +2 -0
- package/.output/public/assets/insights-D86m11yH.js +42 -0
- package/.output/public/assets/insights-DpYstMoY.js +1 -0
- package/.output/public/assets/{insights-recovery-rpc-wvdyM4LD.js → insights-recovery-rpc-BIm5_ALc.js} +1 -1
- package/.output/public/assets/{insights-usage-rpc-qUkNtrWr.js → insights-usage-rpc-VHj8vyBt.js} +1 -1
- package/.output/public/assets/insights_.distribution-ADcrX48c.js +2 -0
- package/.output/public/assets/insights_.distribution-CuuJUN6Y.js +1 -0
- package/.output/public/assets/{insights_.distribution-CItZw3-8.js → insights_.distribution-DJRjuXsO.js} +1 -1
- package/.output/public/assets/installations-BSBBzqWs.js +2 -0
- package/.output/public/assets/installations-DqIE6WcO.js +1 -0
- package/.output/public/assets/installations-UsELbDvw.js +1 -0
- package/.output/public/assets/{loader-circle-Ca7C9YY1.js → loader-circle-CnCBxzHp.js} +1 -1
- package/.output/public/assets/mutation-Csp7xUNh.js +1 -0
- package/.output/public/assets/preload-helper-B-cOmpLH.js +1 -0
- package/.output/public/assets/{refresh-cw-CVGqvy8Z.js → refresh-cw-FF1NtzlQ.js} +1 -1
- package/.output/public/assets/{routes-veKtDW39.js → routes-CoN9XHP_.js} +2 -2
- package/.output/public/assets/routes-DT1jB0Zi.js +1 -0
- package/.output/public/assets/sidebar-D8mJRF15.js +3 -0
- package/.output/public/assets/styles-Bwt7v6U5.css +2 -0
- package/.output/public/assets/table-WBgfvgXg.js +1 -0
- package/.output/public/assets/{useCompositeListItem-CF7vsfcA.js → useCompositeListItem-CloBmDwn.js} +1 -1
- package/.output/public/assets/useMutation-DO8cvsTx.js +1 -0
- package/.output/public/assets/{useOpenInteractionType-AnAMWYIY.js → useOpenInteractionType-ReGr9GzJ.js} +1 -1
- package/.output/public/assets/valueToPercent-BvPAi4bP.js +1 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-CUQLz7hs.mjs → __23tanstack-start-server-fn-resolver-DMRD4e4f.mjs} +34 -42
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +3756 -4022
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +138 -95
- package/.output/server/_libs/tanstack__history.mjs +68 -41
- package/.output/server/_libs/tanstack__query-core.mjs +1618 -309
- package/.output/server/_libs/tanstack__react-query.mjs +255 -20
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-DoxET2AT.mjs → ConsoleFeatureUnavailable-Du7jNPNS.mjs} +7 -7
- package/.output/server/_ssr/{HashValueDisplay-BplboHEb.mjs → HashValueDisplay-GQvFkXoi.mjs} +2 -2
- package/.output/server/_ssr/{InsightsInfo-o2YPd5Qc.mjs → InsightsInfo-Do7QSaFR.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-NExCJL1I.mjs → InsightsPageHeader-DSUWUWRc.mjs} +6 -6
- package/.output/server/_ssr/{NotFoundPage-Cd-A8ock.mjs → NotFoundPage-DsF4Vrhg.mjs} +2 -2
- package/.output/server/_ssr/{api-B1Ro0uys.mjs → api-BEiVs0H7.mjs} +9 -8
- package/.output/server/_ssr/{api-keys-Dvvy1sem.mjs → api-keys-BrvBWGRf.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-CT3HG7KT.mjs → api-keys-K5v32nf7.mjs} +8 -8
- package/.output/server/_ssr/{api-keys-rpc-b1qTTFfG.mjs → api-keys-rpc-B96bBllm.mjs} +5 -5
- package/.output/server/_ssr/{api-rpc-Cbns2MGx.mjs → api-rpc-DcUe280B.mjs} +13 -55
- package/.output/server/_ssr/{auth-rpc-DChS7m9y.mjs → auth-rpc-C68W56DP.mjs} +6 -6
- package/.output/server/_ssr/{api-C0G9MTMI.mjs → auth.server-DM1J6NwR.mjs} +2815 -1308
- package/.output/server/_ssr/{bundleActivity-D17Pb_h5.mjs → bundleActivity-CpuY9CTP.mjs} +1 -1
- package/.output/server/_ssr/{card-DMbcvlPz.mjs → card-CPAEKx0w.mjs} +1 -1
- package/.output/server/_ssr/config-nsIcsHh8.mjs +15 -0
- package/.output/server/_ssr/config.server-DDCZk3Sq.mjs +36 -0
- package/.output/server/_ssr/{console-access-KpPv5lin.mjs → console-access-Da-2Qd7q.mjs} +3 -3
- package/.output/server/_ssr/{console-features-CsbyHYfK.mjs → console-features-Dzu2iUGD.mjs} +6 -6
- package/.output/server/_ssr/{console-features-api-B-KVuo4p.mjs → console-features-api-xAsSgFa_.mjs} +6 -6
- package/.output/server/_ssr/{console-features-rpc-Djyo5740.mjs → console-features-rpc-qARGpB24.mjs} +5 -5
- package/.output/server/_ssr/{createMiddleware-B_I3Ll4M.mjs → createMiddleware-BdBf_ezN.mjs} +41 -56
- package/.output/server/_ssr/{createServerRpc-DuNm5mmo.mjs → createServerRpc-B_y2lrwA.mjs} +2 -2
- package/.output/server/_ssr/databaseJsonValue-Bhxciy7Z.mjs +68 -0
- package/.output/server/_ssr/databaseRows-DwMAjaF8.mjs +74 -0
- package/.output/server/_ssr/{dialog-cOmLTUV2.mjs → dialog-q__BJ7mQ.mjs} +1 -1
- package/.output/server/_ssr/{dist-B-r4u3Lg.mjs → dist-Cxo9ghYv.mjs} +114 -3
- package/.output/server/_ssr/{downloadBundle-CexOFoZ4.mjs → downloadBundle-BW9I-pMQ.mjs} +6 -5
- package/.output/server/_ssr/{empty-BHoY_5jt.mjs → empty-DcBTAooP.mjs} +2 -2
- package/.output/server/_ssr/{empty-plugin-adapters-B5QvGpEl.mjs → empty-plugin-adapters-CYdinE-i.mjs} +1 -1
- package/.output/server/_ssr/{field-mjhcNEXD.mjs → field-QCDBVpXA.mjs} +2 -2
- package/.output/server/_ssr/{getBundleChildren-DbDXe9wB.mjs → getBundleChildren-DIAGCF4a.mjs} +2 -2
- package/.output/server/_ssr/{input-group-96H30HWC.mjs → input-group-hCk2nUoU.mjs} +1 -1
- package/.output/server/_ssr/{insights-DgFv1NsO.mjs → insights-BfBO0RFr.mjs} +18 -18
- package/.output/server/_ssr/{insights-D359GJFL.mjs → insights-DsAU3-TB.mjs} +5 -5
- package/.output/server/_ssr/{insights-D25VDVaz.mjs → insights-RIfg447W.mjs} +2 -2
- package/.output/server/_ssr/{insights-api-ChAKrbhG.mjs → insights-api-CDn-QQHU.mjs} +5 -5
- package/.output/server/_ssr/{insights-failures-WQ-ttjOx.mjs → insights-failures-BBGMhuUr.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-rpc-BFsqlltN.mjs → insights-failures-rpc-rA2dctK2.mjs} +8 -8
- package/.output/server/_ssr/{insights-recovery-DkL6bxMW.mjs → insights-recovery-Dpk6Mfb9.mjs} +1 -1
- package/.output/server/_ssr/{insights-recovery-rpc-2P5m8F62.mjs → insights-recovery-rpc-BCaF-xSd.mjs} +11 -11
- package/.output/server/_ssr/{insights-recovery-rpc-Tj8vNC19.mjs → insights-recovery-rpc-CcgYyUHk.mjs} +5 -5
- package/.output/server/_ssr/{insights-rpc-DrkVmV9o.mjs → insights-rpc-keycmwzw.mjs} +5 -5
- package/.output/server/_ssr/{insights-search-BsalnNw-.mjs → insights-search-BRg5VsNe.mjs} +1 -1
- package/.output/server/_ssr/{insights-usage-1nVTQrLy.mjs → insights-usage-cbw9n2Fq.mjs} +1 -1
- package/.output/server/_ssr/{insights-usage-rpc-Ct_4xHhZ.mjs → insights-usage-rpc-BKgV1QDf.mjs} +8 -8
- package/.output/server/_ssr/{insights-usage-rpc-DaYIRtFK.mjs → insights-usage-rpc-D-JYachy.mjs} +5 -5
- package/.output/server/_ssr/{insightsRecovery-CpGucWN1.mjs → insightsRecovery-B7oMc8d8.mjs} +2 -2
- package/.output/server/_ssr/{insightsUsage-JYpKZAF7.mjs → insightsUsage-Oa7kk5ek.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-jQZEF07J.mjs → insights_.distribution-BIqOqRW0.mjs} +13 -13
- package/.output/server/_ssr/{insights_.distribution-Bcu6uYs_.mjs → insights_.distribution-CuUrDa7P.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-D3Csuyjw.mjs → insights_.distribution-RT_6x_ud.mjs} +5 -5
- package/.output/server/_ssr/{installations-Cxikllmx.mjs → installations-BO5CjX2z.mjs} +11 -11
- package/.output/server/_ssr/{installations-BI5kelHv.mjs → installations-BjaHiIfh.mjs} +2 -2
- package/.output/server/_ssr/{installations-B8Vh54lH.mjs → installations-Dt5luA-N.mjs} +4 -4
- package/.output/server/_ssr/{listReleases-DqU9t1l3.mjs → listReleases-BitHzOYB.mjs} +1 -1
- package/.output/server/_ssr/{router-CRkm-wHD.mjs → router-DfVAixxe.mjs} +42 -39
- package/.output/server/_ssr/{routes-CNAi0Mmv.mjs → routes-C6LstNp8.mjs} +14 -14
- package/.output/server/_ssr/{routes-B3IJo_jL.mjs → routes-Q3Uhmwwz.mjs} +11 -11
- package/.output/server/_ssr/{runtime.server-NucbYjc7.mjs → runtime.server-fL0o6I2b.mjs} +500 -413
- package/.output/server/_ssr/schema-BKY9SqaY.mjs +25 -0
- package/.output/server/_ssr/{select-BkPAJFL7.mjs → select-CUlInmjk.mjs} +1 -1
- package/.output/server/_ssr/server-C43wq9ft.mjs +8330 -0
- package/.output/server/_ssr/{sidebar-Cw1VuC7d.mjs → sidebar-DKbx2ach.mjs} +3 -3
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/start-BXUOv_n8.mjs +4 -0
- package/.output/server/_ssr/{table-q0P9wz7x.mjs → table-NGWV8B-S.mjs} +1 -1
- package/.output/server/_ssr/{updateFailures-DMU9f0pK.mjs → updateFailures-Jwe2Baab.mjs} +3 -3
- package/.output/server/_ssr/{uuidv7-BzSO-fr-.mjs → uuidv7-C8bwiZr8.mjs} +2 -2
- package/.output/server/_tanstack-start-manifest_v-WQ5qGn8n.mjs +124 -0
- package/.output/server/index.mjs +218 -218
- package/LICENSE +13 -14
- package/README.md +16 -12
- package/lib/index.d.mts +18 -8
- package/lib/vite-internal.mjs +15 -8
- package/lib/vite.d.mts +2 -0
- package/package.json +14 -14
- package/src/components/AppSidebar.tsx +9 -0
- package/src/components/ConsoleFeatureUnavailable.tsx +1 -3
- package/src/components/features/bundles/BundleMetadata.tsx +1 -1
- package/src/components/features/bundles/RolloutCohortsDialog.tsx +1 -1
- package/src/components/features/releases/ReleaseEditorSheet.tsx +6 -6
- package/src/index.ts +27 -15
- package/src/lib/api-rpc.ts +1 -54
- package/src/lib/api.ts +8 -89
- package/src/lib/console-features.ts +5 -5
- package/src/lib/scroll-restoration.ts +1 -1
- package/src/lib/server/config.server.ts +15 -52
- package/src/lib/server/console-runtime.server.ts +84 -6
- package/src/lib/server/downloadBundle.ts +10 -6
- package/src/lib/server/releaseReachability.ts +4 -4
- package/src/lib/server/runtime.server.ts +34 -46
- package/src/routeTree.gen.ts +31 -31
- package/src/routes/api/bundles/$bundleId/download.ts +2 -2
- package/src/vite-internal.ts +17 -8
- package/src/vite.ts +2 -0
- package/.output/public/assets/InsightsInfo-By_sPjTE.js +0 -1
- package/.output/public/assets/InsightsPageHeader-9_kx_LL7.js +0 -1
- package/.output/public/assets/api-CtarlV0l.js +0 -1
- package/.output/public/assets/api-keys-DFF_QqtN.js +0 -1
- package/.output/public/assets/api-keys-evfsQ4sN.js +0 -1
- package/.output/public/assets/arrow-left-BP9D-ta_.js +0 -1
- package/.output/public/assets/arrow-up-right-CDP9Tevw.js +0 -1
- package/.output/public/assets/console-features-api-yv7rm3DX.js +0 -1
- package/.output/public/assets/dialog-BDvCy_QO.js +0 -1
- package/.output/public/assets/empty-C5x9mn_s.js +0 -1
- package/.output/public/assets/index-0eg3l8aC.js +0 -10
- package/.output/public/assets/insights-2MbdiSNv.js +0 -1
- package/.output/public/assets/insights-C6tmCZHk.js +0 -2
- package/.output/public/assets/insights-CadS_aIA.js +0 -42
- package/.output/public/assets/insights_.distribution-BhBs6PNA.js +0 -1
- package/.output/public/assets/insights_.distribution-CJUH_wAS.js +0 -2
- package/.output/public/assets/installations-CH2H7JQt.js +0 -2
- package/.output/public/assets/installations-DMeMuwsW.js +0 -1
- package/.output/public/assets/installations-DnvxI9Dt.js +0 -1
- package/.output/public/assets/mutation-x9L28_CD.js +0 -1
- package/.output/public/assets/preload-helper-BN-UkjOE.js +0 -1
- package/.output/public/assets/routes-BhK8DuZA.js +0 -1
- package/.output/public/assets/sidebar-B45aMqRm.js +0 -3
- package/.output/public/assets/styles-Dn0pK1EX.css +0 -2
- package/.output/public/assets/table-CwLnN6KX.js +0 -1
- package/.output/public/assets/useMutation-CN1ygYEr.js +0 -1
- package/.output/public/assets/valueToPercent-C-t8FT0y.js +0 -1
- package/.output/server/_ssr/auth.server-Ccqz2iVv.mjs +0 -37
- package/.output/server/_ssr/config-DMEJdhoW.mjs +0 -13
- package/.output/server/_ssr/config.server-DyypN6cQ.mjs +0 -60
- package/.output/server/_ssr/databaseRows-CXxf_VIB.mjs +0 -132
- package/.output/server/_ssr/deleteBundle-Dcc21Lbd.mjs +0 -56
- package/.output/server/_ssr/server-DKJYsaCP.mjs +0 -7442
- package/.output/server/_ssr/start-DpViQGnt.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-Bb0gKDbb.mjs +0 -124
- package/src/lib/server/deleteBundle.ts +0 -136
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ConsoleFeatureUnavailable-D0LPL1Gy.js";var t=e;export{t as notFoundComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ar as e,nr as t,rr as n}from"./sidebar-D8mJRF15.js";var r=n({method:`GET`}).middleware([t]).handler(e(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`)),i=n({method:`GET`}).middleware([t]).handler(e(`69cd8e2488b082eb2a22e7058be56ad6566f338c471c62557fa6beed5dc1352a`));export{i as n,r as t};
|
package/.output/public/assets/{insights-usage-rpc-qUkNtrWr.js → insights-usage-rpc-VHj8vyBt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ar as e,Br as t,Gn as n,Ln as r,Ur as i,Ut as a,ar as o,er as s,kr as c,nr as l,rr as u,zt as d}from"./sidebar-D8mJRF15.js";import{r as f,t as p}from"./valueToPercent-BvPAi4bP.js";var m=o(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),h=i(t()),g=h.createContext(void 0);function _(){let e=h.useContext(g);if(e===void 0)throw Error(n(51));return e}var v=function(e){return e.complete=`data-complete`,e.indeterminate=`data-indeterminate`,e.progressing=`data-progressing`,e}({}),y={status(e){return e===`progressing`?{[v.progressing]:``}:e===`complete`?{[v.complete]:``}:e===`indeterminate`?{[v.indeterminate]:``}:null}},b=c();function x(e,t){return t==null?`indeterminate progress`:e||`${t}%`}var S=h.forwardRef(function(e,t){let{format:n,getAriaValueText:i=x,locale:o,max:s=100,min:c=0,value:l,render:u,className:p,children:m,style:_,...v}=e,[S,C]=h.useState(),w=a(n),T=`indeterminate`;Number.isFinite(l)&&(T=l===s?`complete`:`progressing`);let E=f(l,o,w.current),D=h.useMemo(()=>({status:T}),[T]),O={"aria-labelledby":S,"aria-valuemax":s,"aria-valuemin":c,"aria-valuenow":l??void 0,"aria-valuetext":i(E,l),role:`progressbar`,children:(0,b.jsxs)(h.Fragment,{children:[m,(0,b.jsx)(`span`,{role:`presentation`,style:d,children:`x`})]})},k=h.useMemo(()=>({formattedValue:E,max:s,min:c,setLabelId:C,state:D,status:T,value:l}),[E,s,c,C,D,T,l]),A=r(`div`,e,{state:D,ref:t,props:[O,v],stateAttributesMapping:y});return(0,b.jsx)(g.Provider,{value:k,children:A})}),C=h.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=_();return r(`div`,e,{state:s,ref:t,props:o,stateAttributesMapping:y})}),w=h.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{max:s,min:c,value:l,state:u}=_(),d=Number.isFinite(l)&&l!==null?p(l,c,s):null;return r(`div`,e,{state:u,ref:t,props:[{style:d==null?{}:{insetInlineStart:0,height:`inherit`,width:`${d}%`}},o],stateAttributesMapping:y})});function T({className:e,children:t,value:n,...r}){return(0,b.jsxs)(S,{value:n,"data-slot":`progress`,className:s(`w-full`,e),...r,children:[t,(0,b.jsx)(E,{children:(0,b.jsx)(D,{})})]})}function E({className:e,...t}){return(0,b.jsx)(C,{className:s(`relative flex h-1 w-full items-center overflow-x-hidden rounded-md bg-muted`,e),"data-slot":`progress-track`,...t})}function D({className:e,...t}){return(0,b.jsx)(w,{"data-slot":`progress-indicator`,className:s(`h-full bg-primary transition-transform motion-reduce:transition-none`,e),...t})}var O=u({method:`GET`}).middleware([l]).handler(e(`8a98cd9c178e4a54185d62c25a95f09d3d59850c43d3f5baa1563e1614ad942e`));export{T as n,m as r,O as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-CuuJUN6Y.js","assets/ConsoleFeatureUnavailable-D0LPL1Gy.js","assets/sidebar-D8mJRF15.js","assets/console-features-api-C1jRZTGw.js","assets/arrow-up-right-BkOVn4if.js","assets/NotFoundPage-B5mhGG2a.js","assets/empty-CVd5NlQD.js","assets/insights_.distribution-DJRjuXsO.js","assets/preload-helper-B-cOmpLH.js","assets/valueToPercent-BvPAi4bP.js","assets/useOpenInteractionType-ReGr9GzJ.js","assets/useCompositeListItem-CloBmDwn.js","assets/field-C06q1iC9.js","assets/InsightsPageHeader-dU83CAQY.js","assets/card-C_7d6O9a.js","assets/insights-usage-rpc-VHj8vyBt.js","assets/arrow-left-Bwq9X1eS.js","assets/InsightsInfo--v4SC07c.js","assets/insights-search-KIF7mRtB.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./console-features-api-C1jRZTGw.js";import{S as t,t as n,x as r}from"./preload-helper-B-cOmpLH.js";import{t as i}from"./insights-search-KIF7mRtB.js";var a=t(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:r(()=>n(()=>import(`./insights_.distribution-CuuJUN6Y.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:r(()=>n(()=>import(`./insights_.distribution-DJRjuXsO.js`),__vite__mapDeps([7,2,8,3,9,10,11,12,13,14,15,16,4,17,6,18])),`component`),validateSearch:i});export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ConsoleFeatureUnavailable-D0LPL1Gy.js";var t=e;export{t as notFoundComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$n as e,Fn as t,Pn as n,cr as r,
|
|
1
|
+
import{$n as e,Fn as t,Pn as n,cr as r,kr as i}from"./sidebar-D8mJRF15.js";import{l as a}from"./console-features-api-C1jRZTGw.js";import{o,u as s}from"./preload-helper-B-cOmpLH.js";import{t as c}from"./arrow-left-Bwq9X1eS.js";import{t as l}from"./arrow-up-right-BkOVn4if.js";import{a as u,c as d,d as f,s as p,t as m,u as h}from"./field-C06q1iC9.js";import{I as g,a as _,c as v,i as y,l as ee,o as te,s as b}from"./valueToPercent-BvPAi4bP.js";import{n as x,r as S,t as C}from"./insights-usage-rpc-VHj8vyBt.js";import{a as w,i as T,n as E,o as D,t as O}from"./card-C_7d6O9a.js";import{t as k}from"./InsightsInfo--v4SC07c.js";import{n as A}from"./insights-search-KIF7mRtB.js";import{t as j}from"./insights_.distribution-ADcrX48c.js";import{a as M,i as N,r as P,t as F}from"./empty-CVd5NlQD.js";import{i as ne,o as I,t as L}from"./InsightsPageHeader-dU83CAQY.js";var R=i(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`});function V(){let i=j.useSearch(),V=o(),H=j.useNavigate(),U={platform:i.platform??`all`,channel:i.channel??`production`,appVersion:i.appVersion,window:i.window??`24h`},W=r({queryKey:[`insights`,`app-usage`,U],queryFn:()=>C({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=>!i.version||e.appVersion===i.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(i.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...i.version?[i.version]:[]])],Q=A(i),$=e=>void H({search:{...i,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:t({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(c,{"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)(ne,{twelveMonths:s(V),window:U.window,onWindowChange:e=>$({window:e})}),(0,R.jsx)(n,{"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)(S,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(m,{className:`w-full sm:w-64`,children:[(0,R.jsx)(u,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(y,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:i.version?`version:${i.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(v,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(ee,{})}),(0,R.jsx)(_,{children:(0,R.jsxs)(te,{children:[(0,R.jsx)(b,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(b,{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)(p,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(g,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(p,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(p,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(O,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(w,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(D,{children:`Bundles by app version`}),(0,R.jsxs)(k,{label:`How bundle distribution is counted`,children:[`Each installation counts once by its latest matching report`,` `,K,`. Latest reports are counted by UTC day. Share is within its app version. Unknown bundle means no deployment ID was observed for the reported file. These counts describe reporting installations, not all installed devices.`]})]}),(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)(E,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(d,{children:[(0,R.jsx)(f,{children:`Partial history`}),(0,R.jsxs)(h,{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)(I,{error:W.error,fallbackTitle:`Distribution unavailable`}),(0,R.jsx)(n,{variant:`outline`,onClick:()=>void W.refetch(),children:`Retry distribution`})]}):q.length===0?(0,R.jsxs)(F,{children:[(0,R.jsxs)(N,{children:[(0,R.jsx)(M,{children:`No bundles reported`}),(0,R.jsx)(P,{children:`Choose another version or period, or change the filters in the overview.`})]}),(0,R.jsx)(n,{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)(g,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsx)(`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)(l,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`})}),(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)(x,{"aria-label":`${e.releaseId??`Unknown bundle`} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(T,{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)(n,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X<=1,onClick:()=>$({page:X-1}),children:`Previous`}),(0,R.jsx)(n,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X>=Y,onClick:()=>$({page:X+1}),children:`Next`})]})]}):null]})]})})]})}export{V as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-UsELbDvw.js","assets/ConsoleFeatureUnavailable-D0LPL1Gy.js","assets/sidebar-D8mJRF15.js","assets/console-features-api-C1jRZTGw.js","assets/arrow-up-right-BkOVn4if.js","assets/NotFoundPage-B5mhGG2a.js","assets/empty-CVd5NlQD.js","assets/installations-DqIE6WcO.js","assets/preload-helper-B-cOmpLH.js","assets/InsightsPageHeader-dU83CAQY.js","assets/useCompositeListItem-CloBmDwn.js","assets/field-C06q1iC9.js","assets/card-C_7d6O9a.js","assets/arrow-left-Bwq9X1eS.js","assets/HashValueDisplay-BmuB4FW-.js","assets/dist-C7ENGzpS.js","assets/refresh-cw-FF1NtzlQ.js","assets/input-group-Bi61biIA.js","assets/table-WBgfvgXg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./console-features-api-C1jRZTGw.js";import{S as t,t as n,x as r}from"./preload-helper-B-cOmpLH.js";function i(){try{return sessionStorage}catch{return}}var a=`tsr-scroll-restoration-v1_3`,o=i();function s(){try{return JSON.parse(o?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var c=s(),l=`data-scroll-restoration-id`,u=e=>e.state.__TSR_key||e.href;function d(e){let t=e.getAttribute(l);if(t)return`[${l}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}function f(e,t){let n=c[(t.getKey||u)(e.latestLocation)];if(!n)return;if(t.id)return n[`[${l}="${t.id}"]`];let r=t.getElement?.();if(r)return n[r===window?m:d(r)]}var p=!1,m=`window`;function h(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function g(e){let t=new Set;for(let n of e){if(n===m)continue;let e=h(n);e&&t.add(e)}return t}function _(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||u,s=new Set,l=e=>{let t=c[e]||={};for(let e of s)e===document?t[m]={scrollX,scrollY}:e.isConnected&&(t[d(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,p=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{p||s.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&l(i(e.fromLocation)),s.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,l(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{o?.setItem(a,JSON.stringify(c))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,a=e.options.scrollToTopSelectors,o=r.n,l=r.h,u;if(s.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let d=i(t.toLocation),f=t.fromLocation&&i(t.fromLocation);if(r.e&&f&&f!==d){let e=c[f];if(e){let t=c[d];for(let n in e){if(n===m){if(o)continue}else{let e=h(n);if(!e||o&&a&&(u??=g(a),u.has(e)))continue}t||=c[d]={},t[n]??=e[n]}}}p=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,s=!1;if(o){!e&&a&&(u??=g(a));let t=e&&i&&l,o=r.e?c[d]:void 0;if(o)for(let e in o){let{scrollX:r,scrollY:i}=o[e];if(e===m){if(t)continue;scrollTo({top:i,left:r,behavior:n}),s=!0}else{let t=h(e);t&&(t.scrollLeft=r,t.scrollTop=i,u?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(s||scrollTo(e),u)for(let t of u)t.scrollTo(e)}}!s&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{p=!1}}))}var v=864e5,y={"24h":{period:`24 hours`,durationMs:v},"7d":{period:`7 days`,durationMs:7*v},"30d":{period:`30 days`,durationMs:30*v},"90d":{period:`90 days`,durationMs:90*v}},b=Object.keys(y),x=e=>b[b.indexOf(e)+1],S=(e,t)=>({beforeReceivedAtMs:t,sinceMs:Math.max(0,t-y[e].durationMs)}),C=e=>typeof e==`string`&&e.length>0?e:void 0,w=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,T=e=>b.find(t=>t===e);function E(e){let t=D(e.search);return t.query===void 0&&t.installId===void 0?`/installations?eventsBefore=${t.eventsBefore??`new`}&eventsRange=${t.eventsRange??`7d`}&eventsCursor=${t.eventsCursor??`first`}`:e.state.__TSR_key}function D(e){return{query:typeof e.query==`string`?e.query:void 0,installId:typeof e.installId==`string`?e.installId:void 0,eventsCursor:C(e.eventsCursor),eventsBefore:w(e.eventsBefore),eventsRange:T(e.eventsRange),searchCursor:C(e.searchCursor),historyCursor:C(e.historyCursor),historyBefore:w(e.historyBefore)}}var O=t(`/installations`)({beforeLoad:({context:t})=>e(t.queryClient,`insights`),notFoundComponent:r(()=>n(()=>import(`./installations-UsELbDvw.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`notFoundComponent`),component:r(()=>n(()=>import(`./installations-DqIE6WcO.js`),__vite__mapDeps([7,2,8,3,9,10,11,12,13,4,14,15,16,17,18])),`component`),staticData:{scrollRestorationKey:E},validateSearch:D});export{y as a,_ as c,S as i,E as n,x as o,b as r,f as s,O as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as e,Br as t,Fn as n,J as r,Pn as i,Ur as a,ar as o,er as s,ir as c,kr as l}from"./sidebar-D8mJRF15.js";import{d as u,l as d,u as f}from"./console-features-api-C1jRZTGw.js";import{a as p,c as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./installations-BSBBzqWs.js";import{a as x,c as S,f as C,i as w,l as T,n as ee,o as te,r as ne,w as E}from"./preload-helper-B-cOmpLH.js";import{t as re}from"./arrow-left-Bwq9X1eS.js";import{t as D}from"./arrow-up-right-BkOVn4if.js";import{a as O,f as k,s as ie,t as A}from"./field-C06q1iC9.js";import{o as j}from"./useCompositeListItem-CloBmDwn.js";import{i as M,n as N,r as P,t as F}from"./HashValueDisplay-BmuB4FW-.js";import{t as ae}from"./refresh-cw-FF1NtzlQ.js";import{a as I,n as L,o as R,r as oe,t as z}from"./card-C_7d6O9a.js";import{a as B,i as V,n as se,o as H,r as U,t as ce}from"./table-WBgfvgXg.js";import{i as le,n as ue,r as de,t as fe}from"./input-group-Bi61biIA.js";import{o as W,r as pe,t as me}from"./InsightsPageHeader-dU83CAQY.js";function he(){m(u(),!0)}function ge(e){return he(),y(u(),e)}function _e(e){let t=u();return f(t.stores.location,E(e,t))}var ve=o(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ye=o(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),be=o(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),G=a(t(),1),K=l(),xe={UPDATE_DOWNLOADED:{label:`Downloaded`,description:`Download complete. Waiting for the app to restart and apply it.`,variant:`default`,icon:M},UPDATE_APPLIED:{label:`Update applied`,description:`The app started using the downloaded update.`,variant:`success`,icon:k},RECOVERED:{label:`Recovered`,description:`Recovered from a crashed bundle.`,variant:`warning`,icon:P},UPDATE_FAILED:{label:`Update failed`,description:`An update check, download, or install failed.`,variant:`destructive`,icon:ye},UNCHANGED:{label:`No change`,description:`No download or apply was reported at this point.`,variant:`secondary`,icon:ve}};function Se(){let[e,t]=(0,G.useState)(`UTC`);return(0,G.useEffect)(()=>{t(Intl.DateTimeFormat().resolvedOptions().timeZone)},[]),new Intl.DateTimeFormat(`en`,{timeZone:e,timeZoneName:`shortOffset`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`})}function Ce(e,t){let n=Object.fromEntries(t.formatToParts(new Date(e)).map(({type:e,value:t})=>[e,t])),r=n.timeZoneName===`GMT`?`GMT+0`:n.timeZoneName;return`${n.year}/${n.month}/${n.day} ${n.hour}:${n.minute}:${n.second} ${r}`}function q({value:e,formatter:t,touch:n=!1}){let r=new Date(e),i=Ce(e,t);return(0,K.jsxs)(`details`,{className:`group/time`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${n?`flex min-h-11 items-center`:``}`,children:(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`time`,{dateTime:r.toISOString(),className:`whitespace-nowrap`,children:i}),(0,K.jsx)(j,{"aria-hidden":`true`,className:`size-3 text-muted-foreground group-open/time:rotate-180`})]})}),(0,K.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:r.toISOString().replace(`T`,` `).replace(`Z`,` UTC`)})]})}var we={patch:`A patch delivered it.`,manifest:`Only the changed files were downloaded.`,archive:`The full archive was downloaded.`},Te=e=>{if(e.type===`UPDATE_FAILED`&&e.failure)return C(e.failure);if(e.type===`UPDATE_DOWNLOADED`&&e.delivery){let t=we[e.delivery]??null;return e.patchFallback?`The patch failed. ${t??``}`.trim():t}return e.type===`RECOVERED`&&e.previousProcessExit?`The crashed process exited with ${e.previousProcessExit}.`:null};function J({event:e}){let t=xe[e.type],n=t.icon,r=Te(e);return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col items-start gap-2`,children:[(0,K.jsxs)(ie,{variant:t.variant,className:`gap-1 whitespace-nowrap [&_svg]:size-3`,children:[(0,K.jsx)(n,{"aria-hidden":`true`}),t.label]}),(0,K.jsx)(`p`,{className:`max-w-56 whitespace-normal text-xs text-muted-foreground`,children:e.type===`UPDATE_FAILED`&&r?r:t.description}),e.type!==`UPDATE_FAILED`&&r?(0,K.jsx)(`p`,{className:`max-w-56 whitespace-normal text-xs text-muted-foreground`,children:r}):null]})}function Y({event:e,touch:t=!1}){let n=e.type===`UPDATE_DOWNLOADED`,r=e.type===`UPDATE_FAILED`,i=!r||e.failure?.stage!==`check`,a=n||r||e.type===`UPDATE_APPLIED`||e.type===`RECOVERED`;return(0,K.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2`,children:[e.fromBundleId&&a?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:n||r?`Running`:`From`}),(0,K.jsx)(`dd`,{children:(0,K.jsx)(F,{value:e.fromBundleId,buttonClassName:t?`min-h-11 px-3`:void 0})})]}):null,i?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:n?`Pending`:r?`Target`:a?`To`:`Current`}),(0,K.jsx)(`dd`,{children:(0,K.jsx)(F,{value:e.toBundleId,buttonClassName:t?`min-h-11 px-3`:void 0})})]}):null]})}function Ee({events:e,formatter:t,renderIdentity:n}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,K.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,K.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,K.jsx)(J,{event:e}),(0,K.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,K.jsx)(q,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,K.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,K.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,K.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,K.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,K.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,K.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,K.jsx)(Y,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:t,nextCursor:n,onNext:r,onPrevious:a,pageLength:o,pageNumber:s}){return(0,K.jsxs)(`nav`,{"aria-label":`${t} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,K.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(i,{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,K.jsx)(i,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:n===null,onClick:r,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var De=e=>v.filter((t,n)=>n===0||p[t].durationMs<=e*864e5);function Oe({event:e,eventsLocation:t,touch:r=!1}){return(0,K.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,K.jsxs)(d,{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,K.jsx)(`span`,{className:r?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,K.jsx)(D,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,K.jsx)(F,{value:e.installId,maxLength:13,buttonClassName:r?`min-h-11 px-3`:void 0})]})}function ke({children:t,description:n,error:r,eventsLocation:a,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:m,range:h,rawDays:g=90,title:v=`All events`}){let y=Se(),b=m>1,x=De(g),S=h===void 0?void 0:_(h),C=S!==void 0&&x.includes(S)?S:void 0,w=C!==void 0&&d?(0,K.jsx)(i,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(C),type:`button`,variant:`outline`,children:`Show the last ${p[C].period}`}):null;return(0,K.jsxs)(z,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,K.jsxs)(I,{className:`gap-4 p-4 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(R,{children:(0,K.jsx)(`h2`,{children:v})}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h!==void 0&&d?(0,K.jsx)(pe,{label:`Time range`,onPeriodChange:d,period:h,periods:x.map(e=>({value:e,name:`Last ${p[e].period}`}))}):null,(0,K.jsxs)(i,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,K.jsx)(ae,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,K.jsx)(oe,{children:n}):null]}),t]}),(0,K.jsx)(L,{className:`min-w-0 p-0`,children:c?(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,K.jsx)(e,{className:`h-12 w-full`}),(0,K.jsx)(e,{className:`h-12 w-full`}),(0,K.jsx)(e,{className:`h-12 w-full`})]}):r?(0,K.jsx)(`div`,{className:`px-6 pb-6`,children:(0,K.jsx)(W,{error:r,fallbackTitle:`Event history unavailable`})}):o?(0,K.jsxs)(K.Fragment,{children:[o.data.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,K.jsx)(Ee,{events:o.data,formatter:y,renderIdentity:e=>(0,K.jsx)(Oe,{event:e,eventsLocation:a,touch:!0})})}),(0,K.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,K.jsxs)(ce,{className:`min-w-4xl table-fixed`,children:[(0,K.jsx)(B,{children:(0,K.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,K.jsx)(V,{className:`w-64`,children:`Time`}),(0,K.jsx)(V,{className:`w-48`,children:`Event`}),(0,K.jsx)(V,{className:`w-48`,children:`User / installation`}),(0,K.jsx)(V,{className:`w-32`,children:`App`}),(0,K.jsx)(V,{className:`w-52`,children:`Bundle`})]})}),(0,K.jsx)(se,{children:o.data.map(e=>(0,K.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,K.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,K.jsx)(q,{value:e.receivedAtMs,formatter:y})}),(0,K.jsx)(U,{children:(0,K.jsx)(J,{event:e})}),(0,K.jsx)(U,{children:(0,K.jsx)(Oe,{event:e,eventsLocation:a})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsx)(Y,{event:e})})]},e.id))})]})})]}):(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b?`No older events in this range.`:h===void 0?v===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${p[h].period}.`}),b?null:w]}),h!==void 0&&o.nextCursor===null&&(o.data.length>0||b)?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),w]}):null,o.data.length>0||b||o.nextCursor?(0,K.jsx)(X,{hasPrevious:b,label:v,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:m}):null]}):null})]})}var Ae=e=>e.userId??`—`,je=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function Me({error:t,history:n,isLoading:a,onNext:o,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=S,selectedEvent:d,selectedInstallId:f}){let p=Se(),m=d?je(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,K.jsxs)(z,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,K.jsx)(I,{className:`p-4 sm:p-6`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,K.jsx)(R,{className:`text-sm font-medium`,children:(0,K.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,K.jsxs)(oe,{children:[`Bundle changes and update failures are kept for`,` `,T(u.rawDays),`; the latest report, for`,` `,T(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,K.jsxs)(i,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:a,children:[(0,K.jsx)(ae,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,K.jsxs)(L,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,K.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,K.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,K.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,K.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Ae(d)})]}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,K.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,K.jsx)(F,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,K.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:m?(0,K.jsx)(F,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`})]}),h?(0,K.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,K.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Pending apply`}),(0,K.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,K.jsx)(F,{value:h})})]}):null]})]}),(0,K.jsx)(r,{})]}):null,f===void 0?null:a?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,K.jsx)(e,{className:`h-10 w-full`}),(0,K.jsx)(e,{className:`h-10 w-full`}),(0,K.jsx)(e,{className:`h-10 w-full`})]}):t?(0,K.jsx)(`div`,{className:`p-6`,children:(0,K.jsx)(W,{error:t instanceof Error?t:Error(),fallbackTitle:`Installation history unavailable`})}):n&&n.data.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,K.jsx)(Ee,{events:n.data,formatter:p})}),(0,K.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,K.jsxs)(ce,{className:`min-w-3xl table-fixed`,children:[(0,K.jsx)(B,{children:(0,K.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,K.jsx)(V,{className:`w-64`,children:`Time`}),(0,K.jsx)(V,{className:`w-48`,children:`Event`}),(0,K.jsx)(V,{className:`w-32`,children:`App`}),(0,K.jsx)(V,{className:`w-52`,children:`Bundle`})]})}),(0,K.jsx)(se,{children:n.data.map(e=>(0,K.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,K.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,K.jsx)(q,{value:e.receivedAtMs,formatter:p})}),(0,K.jsx)(U,{children:(0,K.jsx)(J,{event:e})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,K.jsx)(U,{className:`whitespace-normal text-xs`,children:(0,K.jsx)(Y,{event:e})})]},e.id))})]})}),(0,K.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:o,onPrevious:s,pageLength:n.data.length,pageNumber:l})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),n&&(l>1||n.nextCursor)?(0,K.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:o,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Ne=e=>e.lastKnownBundleId,Pe=e=>e.userId??`—`;function Fe({error:e,onNext:t,onPrevious:r,onSelect:a,pageNumber:o,results:c,selectedInstallId:l}){let[u,d]=(0,G.useState)(!1),f=(0,G.useId)(),p=(0,G.useRef)(null),m=!e&&c&&c.data.length>0;return(0,K.jsxs)(z,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,K.jsx)(I,{className:`p-4 sm:px-6`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,K.jsx)(R,{className:`text-sm font-medium`,children:(0,K.jsx)(`h2`,{children:`Matching installations`})})}),(0,K.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:m?(0,K.jsx)(i,{"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,K.jsx)(j,{"aria-hidden":`true`,className:s(u&&`rotate-180`)})}):null})]})}),(0,K.jsxs)(L,{className:s(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[e?(0,K.jsx)(`div`,{className:`p-6`,children:(0,K.jsx)(W,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,K.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Ne(e),n=e.installId===l;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{"aria-label":`${Pe(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:()=>{a(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,K.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:Pe(e)}),n?(0,K.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,K.jsx)(k,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,K.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,K.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:N(e.installId)})}),(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,K.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:N(t)}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,K.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,K.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||o>1||c.nextCursor)?(0,K.jsx)(X,{hasPrevious:o>1,label:`Installation results`,nextCursor:c.nextCursor,onNext:t,onPrevious:r,pageLength:c.data.length,pageNumber:o}):null]})]})}function Ie({draftQuery:e,onDraftQueryChange:t,onSubmit:n,onClear:r}){return(0,K.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&n()},role:`search`,children:(0,K.jsxs)(A,{className:`gap-2`,children:[(0,K.jsx)(O,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(fe,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,K.jsx)(ue,{children:(0,K.jsx)(be,{"aria-hidden":`true`})}),(0,K.jsx)(le,{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=>t(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,K.jsx)(ue,{align:`inline-end`,children:(0,K.jsx)(de,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:r,size:`icon-xs`,children:(0,K.jsx)(c,{"aria-hidden":`true`})})}):null]}),(0,K.jsx)(i,{"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 Le(){return(0,K.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,K.jsx)(e,{className:`h-64 w-full lg:h-full`}),(0,K.jsx)(e,{className:`h-64 w-full lg:h-full`})]})}var Re=20,ze=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Be(){let e=b.useSearch(),t=b.useNavigate(),n=te(),[r,a]=(0,G.useState)(e.query??``),[o]=(0,G.useState)(Z),[s]=(0,G.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,_=p||m,v=e.eventsBefore??o,y=e.eventsRange??`7d`,S=e.historyBefore??s,C=(n,r=!1,i={})=>{t({to:`/installations`,search:{...e,...n},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,G.useEffect)(()=>{a(e.query??``)},[e.query]),(0,G.useEffect)(()=>{e.eventsBefore===void 0&&C({eventsBefore:v},!0)},[v,e.eventsBefore]),(0,G.useEffect)(()=>{m&&e.historyBefore===void 0&&C({historyBefore:S},!0)},[m,S,e.historyBefore]);let E=ee({...h(y,v),cursor:e.eventsCursor,limit:20},!_),D=x({cursor:e.searchCursor,identity:f,limit:Re},p);(0,G.useEffect)(()=>{let e=D.data?.data[0]?.installId;!p||m||e===void 0||C({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,D.data?.data]);let O=w(e.installId??``,m),k=ne({beforeReceivedAtMs:S,cursor:e.historyCursor,installId:e.installId??``,limit:ze},m),ie=O.data??D.data?.data.find(({installId:t})=>t===e.installId)??k.data?.data[0],A=_?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,j=(0,G.useRef)(null),M=ge({id:A,getKey:g});(0,G.useLayoutEffect)(()=>{!_&&!E.isLoading&&j.current&&(j.current.scrollTop=M?.scrollY??0)},[E.isLoading,_,M?.scrollY,A]);let N=()=>{a(``),C({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},P=(0,K.jsx)(Ie,{draftQuery:r,onClear:N,onDraftQueryChange:a,onSubmit:()=>{let e=r.trim();if(!e){N();return}C({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,K.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,K.jsx)(me,{view:`events`}),(0,K.jsx)(`div`,{ref:j,"data-scroll-restoration-id":A,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,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[_?(0,K.jsx)(z,{className:`shadow-sm`,children:(0,K.jsxs)(L,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,K.jsxs)(i,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:N,variant:`ghost`,children:[(0,K.jsx)(re,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),P]})}):null,_?D.isLoading&&p?(0,K.jsx)(Le,{}):(0,K.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,K.jsx)(Fe,{error:D.error,onNext:()=>{D.data?.nextCursor&&C({installId:void 0,searchCursor:D.data.nextCursor},!0,{searchBack:Q(u,e.searchCursor)})},onPrevious:()=>{let e=$(u);C({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{C({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:D.data,selectedInstallId:e.installId}):null,(0,K.jsx)(Me,{error:k.error??O.error,history:k.data,isLoading:k.isLoading||O.isLoading,onNext:()=>{k.data?.nextCursor&&C({historyCursor:k.data.nextCursor},!0,{historyBack:Q(d,e.historyCursor)})},onPrevious:()=>{let e=$(d);C({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{C({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:n,selectedEvent:ie,selectedInstallId:e.installId})]}):(0,K.jsx)(ke,{description:`Downloads, applies, recoveries, and update failures, newest first, kept for ${T(n.rawDays)}. A launch without an update counts in App usage and in its installation's latest report.`,error:E.error,eventsLocation:{eventsBefore:v,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:E.data,isFetching:E.isFetching,isLoading:E.isLoading,onNext:()=>{E.data?.nextCursor&&C({eventsCursor:E.data.nextCursor},!0,{eventsBack:Q(l,e.eventsCursor)})},onPrevious:()=>{let e=$(l);C({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{C({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{C({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:y,rawDays:n.rawDays,children:P})]})},A)]})}export{Be as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ConsoleFeatureUnavailable-D0LPL1Gy.js";var t=e;export{t as notFoundComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as e}from"./sidebar-
|
|
1
|
+
import{ar as e}from"./sidebar-D8mJRF15.js";var t=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),n=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dr as e,pr as t,ur as n}from"./sidebar-D8mJRF15.js";var r=class extends n{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||i(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(t){let n=()=>{this.#i({type:`continue`})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#r=e({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),a=this.state.status===`pending`,o=!i.canStart();try{if(a)n();else{this.#i({type:`pending`,variables:t,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#i({type:`pending`,context:e,variables:t,isPaused:o})}let e=await i.start();return await this.#n.config.onSuccess?.(e,t,this.state.context,this,r),await this.options.onSuccess?.(e,t,this.state.context,r),await this.#n.config.onSettled?.(e,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(e,null,t,this.state.context,r),this.#i({type:`success`,data:e}),e}catch(e){try{await this.#n.config.onError?.(e,t,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(e,t,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:e}),e}finally{this.#r===i&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),t.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function i(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}export{i as n,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ar as e,Br as t,Fr as n,Nr as r,Ur as i,ar as a,cr as o,kr as s,nr as c,rr as l}from"./sidebar-D8mJRF15.js";import{P as ee,R as te,b as u,d,h as f,l as p,u as ne,x as re}from"./console-features-api-C1jRZTGw.js";var m=`__root__`,h=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=m:this.parentRoute||r();let i=n?m:t?.path;i&&i!==`/`&&(i=u(i));let a=t?.id||i,o=n?m:f((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(a??``));i===`__root__`&&(i=`/`);let s=o===`__root__`?`/`:i===void 0?this.parentRoute.fullPath:f(this.parentRoute.fullPath+`/`+i);this._path=i,this._id=o,this._fullPath=s,this._to=re(s)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>n({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},g=class extends h{constructor(e){super(e)}},_=i(t(),1),v=_.use,ie=_.useLayoutEffect,y=_.createContext(void 0),ae=_.createContext(void 0),b={};function x(e,t){let n=_.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=te(n.current,i):i}}function S(e){let t=d(),n=_.useContext(e.from?ae:y),i=e.from??n,a=t.stores.getMatchStore(i),o=x(e,t),s=ne(a,e=>e?o(e):b);if(s!==b)return s;(e.shouldThrow??!0)&&r()}function C(e){return S({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function w(e){let{select:t,...n}=e;return S({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function T(e){return S({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function E(e){return S({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function D(e){let t=d();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function O(e){return S({...e,select:t=>e.select?e.select(t.context):t.context})}var k=s(),oe=class extends h{constructor(e){super(e),this.useMatch=e=>S({...e,from:this.id}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>E({...e,from:this.id}),this.useParams=e=>T({...e,from:this.id}),this.useLoaderDeps=e=>w({...e,from:this.id}),this.useLoaderData=e=>C({...e,from:this.id}),this.useNavigate=()=>D({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,k.jsx)(p,{ref:t,from:this.fullPath,...e}))}};function A(e){return new oe(e)}function j(){return e=>N(e)}var M=class extends g{constructor(e){super(e),this.useMatch=e=>S({...e,from:this.id}),this.useRouteContext=e=>O({...e,from:this.id}),this.useSearch=e=>E({...e,from:this.id}),this.useParams=e=>T({...e,from:this.id}),this.useLoaderDeps=e=>w({...e,from:this.id}),this.useLoaderData=e=>C({...e,from:this.id}),this.useNavigate=()=>D({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,k.jsx)(p,{ref:t,from:this.fullPath,...e}))}};function N(e){return new M(e)}function P(e){return e=>{let t=A(e);return t.isRoot=!1,t}}function F(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(ee(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(v)v(a());else throw a();return _.createElement(r,e)};return o.preload=a,o}var I=a(`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`}]]),L=a(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),R={"24h":{durationMs:864e5,intervalMs:36e5},"7d":{durationMs:7*864e5,intervalMs:6*36e5},"30d":{durationMs:30*864e5,intervalMs:864e5}};function z(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(R,e.window)))throw Error(`Choose a platform, channel, and time window.`);return e}var B=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),V=({patchDownloads:e,patchFallbacks:t})=>e+t===0?null:t/(e+t),H=({failedInstallations:e,activeInstallations:t})=>t===0?null:Math.min(1,e/t),U=e=>e===null?`—`:`${(e*100).toFixed(2)}%`,W={check:`Update check`,download:`Download`,install:`Install`},G={network:`Network`,http:`HTTP error`,invalid_response:`Invalid response`,hash_mismatch:`Hash mismatch`,signature:`Signature`,patch:`Patch`,extract:`Extract`,storage:`Storage`},K=e=>W[e]??`Unknown stage`,q=e=>G[e]??`Unknown reason`,J=e=>[...e.httpStatus==null?[]:[`HTTP ${e.httpStatus}`],...e.originCode==null?[]:[e.originCode],...e.transport==null?[]:[e.transport],...e.resource==null?[]:[e.resource]],se=e=>[`${K(e.stage)} failed: ${q(e.reason)}`,...J(e)].join(` · `),ce=l({method:`GET`}).middleware([c]).handler(e(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),Y={rawDays:90,dailyDays:400},le=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,ue=({dailyDays:e})=>e>=364;l({method:`GET`}).middleware([c]).handler(e(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var de=l({method:`GET`}).middleware([c]).handler(e(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),fe=l({method:`GET`}).middleware([c]).handler(e(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),pe=l({method:`GET`}).middleware([c]).handler(e(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),me=l({method:`GET`}).middleware([c]).handler(e(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),he=l({method:`GET`}).middleware([c]).handler(e(`735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1`)),X=3e4,Z={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]},ge=(e,t)=>o({queryKey:Z.events(e),queryFn:()=>de({data:e}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),_e=(e,t)=>o({queryKey:Z.installations(e),queryFn:()=>he({data:e}),enabled:t&&e.identity.length>0,staleTime:X}),Q=(e,t)=>o({queryKey:Z.installation(e),queryFn:()=>pe({data:{installId:e}}),enabled:t&&e.length>0,staleTime:X}),ve=(e,t)=>o({queryKey:Z.installationEvents(e),queryFn:()=>fe({data:e}),enabled:t&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:X}),ye=(e,t=!0)=>o({queryKey:[`insights`,`update-failures`,e],queryFn:()=>ce({data:z(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),be=()=>o({queryKey:[`insights`,`retention`],queryFn:()=>me(),staleTime:1/0}).data??Y,xe=`modulepreload`,Se=function(e){return`/`+e},$={},Ce=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Se(t,n),t in $)return;$[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:xe,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{j as C,ie as D,v as E,m as O,P as S,y as T,U as _,_e as a,I as b,Y as c,H as d,se as f,K as g,q as h,Q as i,le as l,B as m,ge as n,be as o,J as p,ve as r,ye as s,Ce as t,ue as u,V as v,x as w,F as x,L as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as e}from"./sidebar-
|
|
1
|
+
import{ar as e}from"./sidebar-D8mJRF15.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-
|
|
2
|
-
import{$n as e,ar as t,cr as n,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-DT1jB0Zi.js","assets/sidebar-D8mJRF15.js","assets/dialog-DE8wFN_P.js","assets/useOpenInteractionType-ReGr9GzJ.js","assets/valueToPercent-BvPAi4bP.js","assets/useCompositeListItem-CloBmDwn.js","assets/field-C06q1iC9.js","assets/console-features-api-C1jRZTGw.js","assets/api-D-vOVlQ4.js","assets/useMutation-DO8cvsTx.js","assets/mutation-Csp7xUNh.js","assets/HashValueDisplay-BmuB4FW-.js","assets/dist-C7ENGzpS.js","assets/loader-circle-CnCBxzHp.js","assets/card-C_7d6O9a.js","assets/input-group-Bi61biIA.js","assets/table-WBgfvgXg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$n as e,ar as t,cr as n,kr as r}from"./sidebar-D8mJRF15.js";import{a as i,i as a,l as o,o as s}from"./console-features-api-C1jRZTGw.js";import{S as c,_ as l,b as u,m as d,s as f,t as p,x as m}from"./preload-helper-B-cOmpLH.js";import{n as h}from"./loader-circle-CnCBxzHp.js";import{a as g,n as _,o as v,t as y}from"./card-C_7d6O9a.js";import{t as b}from"./insights-recovery-rpc-BIm5_ALc.js";import{t as x}from"./InsightsInfo--v4SC07c.js";var S=t(`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`}]]),C=r(),w={apiKeys:{navigation:{icon:(0,C.jsx)(h,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,C.jsx)(o,{to:`/api-keys`,onClick:e})}}};function T(e){let t=[...e].sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return n({queryKey:[`bundle-activity`,t],queryFn:()=>b({data:t}),enabled:t.length>0,staleTime:3e4})}var E=e=>{let t=e.activeDays+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`};function D({report:t,loading:n=!1,input:r}){if(!t)return n?(0,C.jsx)(e,{"aria-label":`Loading release insights`,className:`h-4 w-40`}):(0,C.jsx)(`span`,{"aria-label":`Release insights unavailable`,children:`—`});let i=(0,C.jsxs)(`span`,{className:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1 text-sm`,children:[(0,C.jsxs)(`span`,{children:[`Downloads `,t.downloads.toLocaleString()]}),(0,C.jsxs)(`span`,{children:[`Active days `,t.activeDays.toLocaleString()]}),(0,C.jsxs)(`span`,{children:[`Known crashes `,t.failedLaunches.toLocaleString(),` (`,E(t),`)`]}),t.coverage.kind===`partial`?(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Partial`}):null]});return(0,C.jsxs)(`span`,{className:`flex items-center gap-1`,children:[r?(0,C.jsx)(o,{className:`rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,to:`/insights`,search:{healthPlatform:r.platform,healthChannel:r.channel,releaseId:r.releaseId,bundleWindow:`7d`},children:i}):i,(0,C.jsx)(x,{label:`About release insight metrics`,children:`Active days count each installation once for each UTC day it launched this release. Known crashes are reported OTA launch failures that triggered recovery. The rate is known crashes divided by active days plus known crashes.`})]})}function O({input:t}){let n=f({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),r=n.data;return(0,C.jsxs)(`span`,{className:`flex items-center gap-1 text-sm`,children:[r?(0,C.jsxs)(`span`,{children:[`Download failures `,r.failedUpdates.toLocaleString(),` (`,l(d(r)),`)`]}):n.isPending?(0,C.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,C.jsx)(`span`,{"aria-label":`Download failures unavailable`,children:`—`}),(0,C.jsx)(x,{label:`About download failures`,children:`Reported failures to download or install this release, since its first report; each client reports one at most once a UTC day. The rate is the failure rate of update attempts: failures divided by failures plus download reports.`})]})}function k({input:e}){let t=T([e]);return(0,C.jsxs)(y,{children:[(0,C.jsx)(g,{className:`px-4 pt-4 pb-3`,children:(0,C.jsx)(v,{className:`text-sm font-medium`,children:`Insights`})}),(0,C.jsxs)(_,{className:`flex flex-col gap-2 px-4 pb-4`,children:[(0,C.jsx)(D,{input:e,loading:t.isFetching,report:t.data?.[e.releaseId]}),(0,C.jsx)(O,{input:e})]})]})}function A({input:e}){return a(`insightsAnalytics`)?null:(0,C.jsxs)(y,{children:[(0,C.jsx)(g,{className:`px-4 pt-4 pb-3`,children:(0,C.jsx)(v,{className:`text-sm font-medium`,children:`Insights`})}),(0,C.jsx)(_,{className:`px-4 pb-4`,children:(0,C.jsx)(O,{input:e})})]})}function j({releaseId:e,releases:t}){let n=T(t);return(0,C.jsx)(D,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var M={Cell:j},N={insights:{navigation:{icon:(0,C.jsx)(u,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,C.jsx)(o,{to:`/insights`,onClick:t}):(0,C.jsx)(o,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,C.jsx)(A,{input:e})},insightsAnalytics:{releaseColumn:M,releaseSection:({release:e})=>(0,C.jsx)(k,{input:e})},...w},P=Object.keys(s),F=()=>{let e=i().data?.features;return e===void 0?[]:P.flatMap(t=>{let n=N[t];return n!==void 0&&e[t]?[{...n,feature:t,label:s[t].label,features:e}]:[]})},I=()=>F().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function L({release:e}){return F().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,C.jsx)(n,{release:e},t))}var R=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function z(e){let t=R(e.beforeReleaseId),n=t?void 0:R(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=R(e.bundleId),a=i?void 0:R(e.scopeKey),o=i||a?void 0:R(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:R(e.releaseId),scopeKey:a}}function B(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 V(e){return B(e).kind!==`all`}function H(e,t){let n={...e,...t};return t.bundleId?z({bundleId:n.bundleId}):t.scopeKey?z({scopeKey:n.scopeKey,enabled:n.enabled}):`channelId`in t||`platform`in t?z({channelId:n.channelId,enabled:n.enabled,platform:n.platform}):z({bundleId:n.bundleId,channelId:n.channelId,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}var U=c(`/`)({component:m(()=>p(()=>import(`./routes-DT1jB0Zi.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])),`component`),validateSearch:z});export{L as a,S as c,H as i,V as n,F as o,B as r,I as s,U as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$n as e,A as t,Bn as n,Br as r,Bt as i,Fn as a,Gn as o,Gt as s,Hn as c,Ht as l,J as u,Jn as d,Kn as f,Kt as p,Ln as m,M as h,N as g,O as _,P as v,Pn as y,R as b,Ur as x,Ut as S,Vn as C,Vr as w,Vt as T,Wt as ee,Xn as te,Y as ne,Zn as re,Zt as ie,_ as ae,_n as oe,an as se,ar as E,at as ce,b as le,cn as ue,er as D,g as O,gn as de,h as k,ir as A,j as fe,kr as pe,ot as j,p as M,qn as me,sr as he,tn as N,un as P,v as F,vn as ge,y as _e,yn as I,z as ve,zn as ye,zt as be}from"./sidebar-D8mJRF15.js";import{l as xe}from"./console-features-api-C1jRZTGw.js";import{a as Se,c as L,d as Ce,f as we,g as R,h as z,i as B,l as Te,m as Ee,n as De,o as Oe,p as ke,r as Ae,s as je,t as Me,u as Ne}from"./api-D-vOVlQ4.js";import{a as V,c as Pe,d as Fe,f as Ie,i as Le,n as Re,o as ze,r as H,s as U,t as W,u as Be}from"./field-C06q1iC9.js";import{a as Ve,i as He,n as Ue,o as We,r as Ge}from"./useCompositeListItem-CloBmDwn.js";import{A as Ke,F as qe,I as Je,N as Ye,O as Xe,_ as G,a as Ze,c as Qe,h as $e,i as et,k as tt,l as nt,m as rt,n as it,o as at,s as ot,t as st,u as ct,v as lt}from"./valueToPercent-BvPAi4bP.js";import{i as ut,r as dt,t as ft}from"./HashValueDisplay-BmuB4FW-.js";import{t as pt}from"./loader-circle-CnCBxzHp.js";import{a as mt,c as ht,i as gt,n as _t,r as vt,s as yt,t as bt}from"./routes-CoN9XHP_.js";import{a as xt,c as St,d as Ct,f as wt,g as Tt,i as Et,l as Dt,m as Ot,n as kt,o as At,p as jt,r as Mt,s as Nt,t as Pt,u as Ft,v as It}from"./dialog-DE8wFN_P.js";import{a as Lt,n as Rt,o as zt,r as Bt,s as Vt,t as Ht}from"./card-C_7d6O9a.js";import{n as K}from"./dist-C7ENGzpS.js";import{r as Ut}from"./useOpenInteractionType-ReGr9GzJ.js";import{a as Wt,i as q,n as Gt,o as Kt,r as J,t as qt}from"./table-WBgfvgXg.js";import{a as Jt,i as Yt,n as Xt,o as Zt,t as Qt}from"./input-group-Bi61biIA.js";var $t=E(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),en=E(`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`}]]),tn=E(`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`}]]),nn=E(`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`}]]),rn=E(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),an=E(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),on=E(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),sn=E(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),cn=E(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Y=x(r(),1),X=pe();function ln({bundleId:e,className:t}){return(0,X.jsx)(`span`,{translate:`no`,className:D(`break-all font-mono text-xs tabular-nums`,t),children:e})}var un={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 dn({channel:e,className:t}){return(0,X.jsx)(U,{variant:`outline`,className:D(un[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function fn({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,X.jsx)(Ie,{className:D(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,X.jsx)(an,{className:D(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,X.jsx)(A,{className:D(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var pn=`[a-zA-Z0-9-]`,mn=String.raw`0|[1-9]\d*`,hn=String.raw`\d+`,gn=String.raw`\d*[a-zA-Z-]${pn}*`,_n=String.raw`(${mn})\.(${mn})\.(${mn})`,vn=String.raw`(${hn})\.(${hn})\.(${hn})`,yn=`(?:${gn}|${mn})`,bn=`(?:${gn}|${hn})`,xn=String.raw`(?:-(${yn}(?:\.${yn})*))`,Sn=String.raw`(?:-?(${bn}(?:\.${bn})*))`,Cn=`${pn}+`,wn=String.raw`(?:\+(${Cn}(?:\.${Cn})*))`,Tn=`v?${_n}${xn}?${wn}?`,En=String.raw`[v=\s]*${vn}${Sn}?${wn}?`,Dn=String.raw`${mn}|x|X|\*`,On=String.raw`${hn}|x|X|\*`;String.raw`[v=\s]*(${Dn})(?:\.(${Dn})(?:\.(${Dn})(?:${xn})?${wn}?)?)?`,String.raw`[v=\s]*(${On})(?:\.(${On})(?:\.(${On})(?:${Sn})?${wn}?)?)?`,String.raw`(?:\^)`;var kn=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`,An=String.raw`${kn}(?:$|[^\d])`,jn=String.raw`${kn}(?:${xn})?(?:${wn})?(?:$|[^\d])`;function Mn(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[pn,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Nn(e,t){return new RegExp(Mn(e),t)}Nn(`^${Tn}$`),Nn(`^${En}$`),Nn(An),Nn(jn),Nn(`^${xn}$`),Nn(`^${Sn}$`);var Pn=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`},Fn=e=>Array.isArray(e)?e.filter(Pn):[],In=e=>{let t=Fn(e.patches),n=new Set;return t.filter(e=>n.has(e.baseBundleId)?!1:(n.add(e.baseBundleId),!0))},Ln=e=>In(e)[0]??null,Rn=e=>Ln(e)?.baseBundleId??null,zn=e=>Ln(e)?.baseFileHash??null,Bn=e=>Ln(e)?.patchFileHash??null,Z=1e3,Vn=Z,Hn=`Invalid cohort. Use 1-1000 or a lowercase slug without spaces, up to 64 characters.`,Un=/^[a-z0-9-]+$/;function Wn(e){if(!/^\d+$/.test(e))return null;let t=Number.parseInt(e,10);return Number.isNaN(t)||t<1||t>1e3?null:t}function Gn(e,t){return(e%t+t)%t}function Kn(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 qn(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 Jn(e,t){let n=0,r=1,i=t,a=Gn(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 Gn(n,t)}function Yn(e){let t=Gn(Kn(`${e}:multiplier`),997);for(t===0&&(t=1);qn(t,Z)!==1;)t=Gn(t+1,Z),t===0&&(t=1);let n=Gn(Kn(`${e}:offset`),Z);return{multiplier:t,offset:n,inverseMultiplier:Jn(t,Z)}}function Xn(e){return e==null?Vn:e<=0?0:e>=1e3?Z:Math.floor(e)}function Zn(e){let t=e.trim().toLowerCase(),n=Wn(t);return n===null?t:String(n)}function Qn(e){return Wn(Zn(e))}function $n(e){return Qn(e)!==null}function er(e){let t=Zn(e);return t.length>0&&t.length<=64&&!/^\d+$/.test(t)&&Un.test(t)}function tr(e){let t=Zn(e);return $n(t)||er(t)}function nr(e,t){if(t<1||t>1e3)throw Error(`Invalid numeric cohort: ${t}`);let{offset:n,inverseMultiplier:r}=Yn(e);return Gn(r*(t-1-n),Z)}var rr=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,ir=e=>typeof e==`string`&&rr.test(e),ar=e=>{if(!ir(e))throw TypeError(`Expected a canonical lowercase UUIDv7`);let t=e.split(`-`).join(``).slice(0,12);return Number.parseInt(t,16)},or=w(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof ee||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),te=ee.prototype;return w.prototype=te,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){te[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,ee,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),sr=w(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),cr=x(or(),1),lr=x(sr(),1);cr.default.extend(lr.default);function ur({uuid:e,format:t=`relative`}){let n=(0,cr.default)(ar(e));return t===`relative`?(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function dr({panelId:t,bundle:n,bundles:r,loading:i,onDetailClick:a}){let o=k();return(0,X.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,X.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,X.jsxs)(U,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),i?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(e,{className:`h-10 w-full`}),(0,X.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),o?(0,X.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,X.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,X.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,X.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,X.jsx)(R,{className:`size-4 rotate-90 text-muted-foreground`}),(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,X.jsx)(U,{variant:`secondary`,children:`bsdiff`})]}),(0,X.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,X.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,X.jsx)(ur,{uuid:e.id})})]})]}),(0,X.jsx)(y,{className:`w-full`,onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,X.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,X.jsxs)(qt,{className:`min-w-max`,children:[(0,X.jsx)(Wt,{children:(0,X.jsxs)(Kt,{className:`hover:bg-transparent`,children:[(0,X.jsx)(q,{children:`Target artifact ID`}),(0,X.jsx)(q,{children:`Relation`}),(0,X.jsx)(q,{children:`Artifact`}),(0,X.jsx)(q,{children:`Created`}),(0,X.jsx)(q,{className:`w-24 text-right`,children:`Detail`})]})}),(0,X.jsx)(Gt,{children:r.map(e=>(0,X.jsxs)(Kt,{children:[(0,X.jsx)(J,{children:(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,X.jsx)(J,{children:(0,X.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,X.jsx)(ln,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,X.jsx)(R,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,X.jsx)(ln,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,X.jsx)(J,{children:(0,X.jsx)(U,{variant:`secondary`,children:`bsdiff`})}),(0,X.jsx)(J,{className:`tabular-nums`,children:(0,X.jsx)(ur,{uuid:e.id})}),(0,X.jsx)(J,{className:`text-right`,children:(0,X.jsx)(y,{onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,X.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function fr({open:e,onOpenChange:t}){let[n,r]=(0,Y.useState)(``),[i,a]=(0,Y.useState)(null),{data:o=[],isPending:s}=B(),c=Oe(),l=je(),u=n.trim(),d=async e=>{if(e.preventDefault(),!(!u||c.isPending))try{let e=await c.mutateAsync({name:u});r(``),e.inserted?K.success(`Channel ${e.row.name} created`):K.info(`Channel ${e.row.name} already exists`)}catch(e){K.error(`Failed to create channel`),console.error(e)}},f=async()=>{if(!(!i||l.isPending))try{let e=await l.mutateAsync({id:i.id});e.deleted?K.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?K.error(`Channel ${i.name} is still in use and cannot be deleted`):K.error(`Channel ${i.name} no longer exists`),a(null)}catch(e){K.error(`Failed to delete channel`),console.error(e)}};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Pt,{open:e,onOpenChange:t,children:(0,X.jsxs)(kt,{className:`sm:max-w-lg`,children:[(0,X.jsxs)(xt,{children:[(0,X.jsxs)(At,{className:`flex items-center gap-2`,children:[(0,X.jsx)(on,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,X.jsx)(Mt,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,X.jsx)(`form`,{onSubmit:d,children:(0,X.jsx)(Le,{className:`gap-2`,children:(0,X.jsxs)(W,{orientation:`horizontal`,children:[(0,X.jsx)(V,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,X.jsx)(ne,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:c.isPending}),(0,X.jsxs)(y,{type:`submit`,disabled:!u||c.isPending,children:[c.isPending?(0,X.jsx)(pt,{"data-icon":`inline-start`,className:`animate-spin`}):(0,X.jsx)(It,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,X.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:s?(0,X.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,X.jsx)(pt,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):o.length===0?(0,X.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,X.jsx)(`ul`,{className:`divide-y`,children:o.map(e=>(0,X.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,X.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,X.jsx)(y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:l.isPending,onClick:()=>a(e),className:`text-muted-foreground hover:text-destructive`,children:(0,X.jsx)(cn,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,X.jsx)(St,{open:i!==null,onOpenChange:e=>{!e&&!l.isPending&&a(null)},children:(0,X.jsxs)(Ct,{children:[(0,X.jsxs)(Ot,{children:[(0,X.jsxs)(Tt,{children:[`Delete `,i?.name,`?`]}),(0,X.jsx)(wt,{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,X.jsxs)(jt,{children:[(0,X.jsx)(Ft,{disabled:l.isPending,children:`Cancel`}),(0,X.jsx)(Dt,{variant:`destructive`,disabled:l.isPending,onClick:e=>{e.preventDefault(),f()},children:l.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var pr=`[a-zA-Z0-9-]`,mr=String.raw`0|[1-9]\d*`,hr=String.raw`\d+`,gr=String.raw`\d*[a-zA-Z-]${pr}*`,_r=String.raw`(${mr})\.(${mr})\.(${mr})`,vr=String.raw`(${hr})\.(${hr})\.(${hr})`,yr=`(?:${gr}|${mr})`,br=`(?:${gr}|${hr})`,xr=String.raw`(?:-(${yr}(?:\.${yr})*))`,Sr=String.raw`(?:-?(${br}(?:\.${br})*))`,Cr=`${pr}+`,wr=String.raw`(?:\+(${Cr}(?:\.${Cr})*))`,Tr=`v?${_r}${xr}?${wr}?`,Er=String.raw`[v=\s]*${vr}${Sr}?${wr}?`,Dr=`((?:<|>)?=?)`,Or=String.raw`${mr}|x|X|\*`,kr=String.raw`${hr}|x|X|\*`,Ar=String.raw`[v=\s]*(${Or})(?:\.(${Or})(?:\.(${Or})(?:${xr})?${wr}?)?)?`,jr=String.raw`[v=\s]*(${kr})(?:\.(${kr})(?:\.(${kr})(?:${Sr})?${wr}?)?)?`,Mr=`(?:~>?)`,Nr=String.raw`(?:\^)`,Pr=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Pr}(?:$|[^\d])`,String.raw`${Pr}(?:${xr})?(?:${wr})?(?:$|[^\d])`;function Fr(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[pr,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(Fr(e),t)}var Ir=Q(`^${Tr}$`),Lr=Q(`^${Er}$`),Rr=/^\d+$/;function zr(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function Br(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?Lr:Ir);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 Vr=Q(String.raw`^${Dr}\s*(${Tr})$|^$`),Hr=Q(String.raw`^${Dr}\s*(${Er})$|^$`);function Ur(e){return e.version?`${e.operator}${zr(e.version)}`:``}function Wr(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?Hr:Vr);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?Br(r[2],t):null;return{operator:i,options:t,value:a?`${i}${zr(a)}`:``,version:a}}function Gr(e){return e.sets.map(e=>e.map(Ur).join(` `)).join(`||`)}var Kr=new RegExp(wr,`g`),qr=Q(wr),Jr=Q(String.raw`^\s*(${Ar})\s+-\s+(${Ar})\s*$`),Yr=Q(String.raw`^\s*(${jr})\s+-\s+(${jr})\s*$`),Xr=Q(String.raw`(\s*)${Dr}\s*(${Er}|${Ar})`,`g`),Zr=Q(String.raw`(\s*)${Mr}\s+`,`g`),Qr=Q(String.raw`(\s*)${Nr}\s+`,`g`),$r=Q(`^${Mr}${Ar}$`),ei=Q(`^${Mr}${jr}$`),ti=Q(`^${Nr}${Ar}$`),ni=Q(`^${Nr}${jr}$`),ri=Q(String.raw`^${Dr}\s*${Ar}$`),ii=Q(String.raw`^${Dr}\s*${jr}$`),ai=Q(String.raw`(<|>)?=?\s*\*`),oi=/^\s*>=\s*0\.0\.0\s*$/,si=/^\s*>=\s*0\.0\.0-0\s*$/,ci=Q(String.raw`^${Dr}\s*(${Er})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function li(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function ui(e,t){let n=t.loose?ei:$r,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>$(t)?``:$(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:$(i)?`>=${t}.${n}.0${r} <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${i}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${i} <${t}.${Number(n)+1}.0-0`)}function di(e,t){return e.trim().split(/\s+/).map(e=>ui(e,t)).join(` `)}function fi(e,t){let n=t.loose?ni:ti,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 pi(e,t){return e.trim().split(/\s+/).map(e=>fi(e,t)).join(` `)}function mi(e,t){let n=t.loose?ii:ri;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(li(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 hi(e,t){return e.split(/\s+/).map(e=>mi(e,t)).join(` `)}function gi(e,t){let n=t.loose?Yr:Jr;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 _i(e,t){return hi(di(pi(e.replace(qr,``),t),t),t).trim().replace(ai,``)}function vi(e,t){let n=gi(e.replace(Kr,``),t).replace(Xr,`$1$2$3`).replace(Zr,`$1~`).replace(Qr,`$1^`).split(` `).map(e=>_i(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?si:oi,``));t.loose&&(n=n.filter(e=>ci.test(e)));let r=new Map;for(let e of n.map(e=>Wr(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 yi(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>vi(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 bi(e,t={}){try{return yi(e,t)}catch{return null}}function xi(e,t={}){let n=bi(e,t);return n?Gr(n)||`*`:null}var Si=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$/,``)},Ci=(e,t)=>{if(!e?.trim())return null;let n=Si(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 wi({label:e,value:t}){return(0,X.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function Ti({bundle:e,release:t}){let{data:n,isFetched:r}=Se(),i=e?Bn(e):null,a=e?zn(e):null,o=e?.gitCommitHash&&r?Ci(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,X.jsxs)(Ht,{children:[(0,X.jsx)(Lt,{className:`p-4 pb-3`,children:(0,X.jsx)(zt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,X.jsx)(Rt,{className:`px-4 pb-4`,children:(0,X.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,X.jsx)(wi,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,X.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,X.jsx)(wi,{label:`Git commit`,value:(0,X.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,X.jsx)(ft,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,X.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,X.jsx)(tn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,X.jsx)(wi,{label:`Manifest hash`,value:(0,X.jsx)(ft,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,X.jsx)(wi,{label:`Base hash`,value:(0,X.jsx)(ft,{maxLength:16,value:a})}):null,i?(0,X.jsx)(wi,{label:`Patch hash`,value:(0,X.jsx)(ft,{maxLength:16,value:i})}):null]})})]}):null}var Ei=Array.from({length:Z},(e,t)=>t+1);function Di({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=Xn(t),i=n??[],a=i.length>0,o=r>0&&r<1e3,s=r===Z,c=k(),l=s?Ei:o?Ei.filter(t=>nr(e,t)<r):[],u=(r/10).toFixed(1),d=s?Z:l.length,f=Z-d,p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,X.jsx)(Ht,{children:(0,X.jsxs)(Lt,{className:`p-4`,children:[(0,X.jsx)(Bt,{children:`Selected cohorts`}),(0,X.jsx)(zt,{className:`font-mono text-2xl tabular-nums`,children:d})]})}),(0,X.jsx)(Ht,{children:(0,X.jsxs)(Lt,{className:`p-4`,children:[(0,X.jsx)(Bt,{children:`Excluded cohorts`}),(0,X.jsx)(zt,{className:`font-mono text-2xl tabular-nums`,children:f})]})})]}),a?(0,X.jsxs)(Ht,{children:[(0,X.jsxs)(Lt,{className:`p-4 pb-3`,children:[(0,X.jsx)(zt,{className:`text-sm`,children:`Additional cohorts`}),(0,X.jsx)(Bt,{children:`Always included in addition to the percentage rollout.`})]}),(0,X.jsx)(Rt,{className:`p-4 pt-0`,children:(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,X.jsx)(U,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,X.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,X.jsxs)(Ht,{children:[(0,X.jsx)(Lt,{className:`p-4 pb-3`,children:(0,X.jsx)(zt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,X.jsx)(Rt,{className:`p-4 pt-0`,children:(0,X.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:l.length>0?(0,X.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:l.map(e=>(0,X.jsx)(U,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,X.jsxs)(Pt,{children:[(0,X.jsxs)(Nt,{render:(0,X.jsx)(y,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,X.jsx)(Ve,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,X.jsx)(kt,{className:c?`top-0 left-0 h-dvh max-w-none translate-x-0 translate-y-0 rounded-none border-0 p-0`:`sm:max-w-3xl`,children:c?(0,X.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,X.jsxs)(xt,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,X.jsx)(At,{children:`Rolled out cohorts`}),(0,X.jsxs)(Mt,{children:[u,`% includes `,d,` of`,` `,Z,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),(0,X.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:p}),(0,X.jsx)(Et,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(xt,{children:[(0,X.jsx)(At,{children:`Rolled out cohorts`}),(0,X.jsxs)(Mt,{children:[u,`% includes `,d,` of`,` `,Z,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),p,(0,X.jsx)(Et,{showCloseButton:!0})]})})]})}function Oi(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function ki(e,t){return e-t}function Ai(e,t,n){let r=e.slice();return r[t]=n,r.sort(ki)}function ji(e,t,n,r,i,a){let o=e;return o=G(o,n,r),i&&(o=Ai(a,t,G(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Mi(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 Ni={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...qe},Pi=Y.createContext(void 0);function Fi(){let e=Y.useContext(Pi);if(e===void 0)throw Error(o(62));return e}function Ii(e){return`key`in e?se:N}function Li(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?Oi(e,t):!1}var Ri=Y.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:c,largeStep:l=10,locale:u,render:f,max:h=100,min:g=0,minStepsBetweenValues:_=0,form:v,name:y,onValueChange:b,onValueCommitted:x,orientation:C=`horizontal`,step:w=1,thumbCollisionBehavior:ee=`push`,thumbAlignment:te=`center`,value:ne,style:re,...ie}=e,ae=j(o),se=rt(ae),E=d(b),ce=d(x),{clearErrors:le}=lt(),{state:ue,disabled:D,name:O,setTouched:de,setDirty:k,validityData:A,shouldValidateOnChange:fe,validation:pe}=Ye(),{labelId:M}=tt(),[he,N]=Y.useState(),P=n??$e(M,he),F=D||a,_e=O??y,[I,ve]=He({controlled:ne,default:i??g,name:`Slider`}),ye=Y.useRef(null),be=Y.useRef(null),xe=Y.useRef([]),Se=Y.useRef(null),L=Y.useRef(null),Ce=Y.useRef(-1),we=Y.useRef(null),R=Y.useRef(null),z=Y.useRef(`none`),B=S(c),[Te,Ee]=Y.useState(-1),[De,Oe]=Y.useState(-1),[ke,Ae]=Y.useState(!1),[je,Me]=Y.useState(()=>new Map),[Ne,V]=Y.useState([void 0,void 0]),Pe=d(e=>{Ee(e),e!==-1&&Oe(e)});Ke(be,ae,I),Ut(I,()=>{le(_e),fe()?pe.commit(I):pe.commit(I,!0);let e=A.initialValue,t;t=Array.isArray(I)&&Array.isArray(e)?!Oi(I,e):I!==e,k(t)});let Fe=d(e=>{e&&(be.current=e)}),Ie=Array.isArray(I),Le=Y.useMemo(()=>Ie?I.slice().sort(ki):[G(I,g,h)],[h,g,Ie,I]),Re=d((e,t)=>{if(Number.isNaN(e)||Li(e,I))return;let n=t??s(`none`,void 0,void 0,{activeThumbIndex:-1});z.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:_e}}),n.event=i,R.current=e,E(e,n),!n.isCanceled&&ve(e)}),ze=d((e,t,n)=>{let r=ji(e,t,g,h,Ie,Le);if(Mi(r,w,_)){let e=Ii(n);Re(r,s(e,n.nativeEvent,void 0,{activeThumbIndex:t})),de(!0),ce(R.current??r,p(e,n.nativeEvent))}});me(()=>{let e=oe(T(ye.current));F&&ge(ye.current,e)&&e.blur()},[F]),F&&Te!==-1&&Pe(-1);let H=Y.useMemo(()=>({...ue,activeThumbIndex:Te,disabled:F,dragging:ke,orientation:C,max:h,min:g,minStepsBetweenValues:_,step:w,values:Le}),[ue,Te,F,ke,h,g,_,C,w,Le]),U=Y.useMemo(()=>({active:Te,controlRef:be,disabled:F,dragging:ke,validation:pe,formatOptionsRef:B,handleInputChange:ze,indicatorPosition:Ne,inset:te!==`center`,labelId:P,rootLabelId:se,largeStep:l,lastUsedThumbIndex:De,lastChangedValueRef:R,lastChangeReasonRef:z,form:v,locale:u,max:h,min:g,minStepsBetweenValues:_,name:_e,onValueCommitted:ce,orientation:C,pressedInputRef:Se,pressedThumbCenterOffsetRef:L,pressedThumbIndexRef:Ce,pressedValuesRef:we,registerFieldControlRef:Fe,renderBeforeHydration:te===`edge`,setActive:Pe,setDragging:Ae,setIndicatorPosition:V,setLabelId:N,setValue:Re,state:H,step:w,thumbCollisionBehavior:ee,thumbMap:je,thumbRefs:xe,values:Le}),[Te,be,P,se,F,ke,pe,B,ze,Ne,l,De,R,z,v,u,h,g,_,_e,ce,C,Se,L,Ce,we,Fe,Pe,Ae,V,N,Re,H,w,ee,te,je,xe,Le]),W=m(`div`,e,{state:H,ref:[t,ye],props:[{"aria-labelledby":P,id:ae,role:`group`},pe.getValidationProps,ie],stateAttributesMapping:Ni});return(0,X.jsx)(Pi.Provider,{value:U,children:(0,X.jsx)(Ge,{elementsRef:xe,onMapChange:Me,children:W})})});function zi(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Bi(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 Vi(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(Bi(t),Bi(n))))}function Hi({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]=G(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]=G(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]=G(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function Ui({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=G(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=Hi({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=G(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:Hi({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=G(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 Wi=2;function Gi(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 Ki(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 qi=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{disabled:o,dragging:c,inset:u,lastChangedValueRef:f,lastChangeReasonRef:h,max:g,min:_,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:w,pressedValuesRef:ne,registerFieldControlRef:ae,renderBeforeHydration:se,setActive:E,setDragging:le,setValue:ue,state:D,step:O,thumbCollisionBehavior:de,thumbRefs:k,values:A}=Fi(),fe=ce(),pe=A.length>1,j=b===`vertical`,M=Y.useRef(null),me=Y.useRef(null),he=d(e=>{e&&me.current==null&&(me.current=te(e).getComputedStyle(e))}),N=Y.useRef(null),F=Y.useRef(0),_e=Y.useRef(0),ve=S(A);function ye(e){w.current!==e&&(w.current=e);let t=k.current[e];if(!t){C.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function be(e){let t=M.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=Gi(me.current,j),c=_e.current,l=(j?r:n)-s.start-s.end-c*2,u=C.current??0,d=e.x-u,f=e.y-u,p=G(((j?i-f-s.end:(fe===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-_)*p+_;if(m=Vi(m,O,_),m=G(m,_,g),!pe)return{value:m,thumbIndex:0,didSwap:!1};let h=w.current;if(h<0)return null;let y=Ui({behavior:de,values:A,currentValues:ve.current??A,initialValues:ne.current,pressedIndex:h,nextValue:m,min:_,max:g,step:O,minStepsBetweenValues:v});return de===`swap`&&y.didSwap?ye(y.thumbIndex):w.current=y.thumbIndex,y}function xe(e){ne.current=pe?A.slice():null,ve.current=A;let t=w.current,n=t;if(t>-1&&t<A.length){if(A[t]===g){let e=t;for(;e>0&&A[e-1]===g;)--e;n=e}}else{let t=j?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(re(a)){let o=zi(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&ye(n),u){let e=k.current[n];re(e)&&(_e.current=e.getBoundingClientRect()[j?`height`:`width`]/2)}}function Se(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let L=d(e=>{let t=Ki(e,N);if(t==null)return;if(F.current+=1,e.type===`pointermove`&&e.buttons===0){Ce(e);return}let n=be(t);n!=null&&Mi(n.value,O,v)&&(!c&&F.current>Wi&&le(!0),ue(n.value,s(ie,e,void 0,{activeThumbIndex:n.thumbIndex})),ve.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&Se(n.thumbIndex))});function Ce(e){E(-1),le(!1),x.current=null,C.current=null;let t=Ki(e,N),n=t==null?null:be(t);if(n!=null){let t=h.current;y(f.current??n.value,p(t,e))}`pointerType`in e&&M.current?.hasPointerCapture(e.pointerId)&&M.current?.releasePointerCapture(e.pointerId),w.current=-1,N.current=null,ne.current=null,R()}let we=d(e=>{if(o)return;let t=e.changedTouches[0];t!=null&&(N.current=t.identifier);let n=Ki(e,N);if(n!=null){xe(n);let t=be(n);if(t==null)return;Se(t.thumbIndex),ue(t.value,s(P,e,void 0,{activeThumbIndex:t.thumbIndex})),ve.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&Se(t.thumbIndex)}F.current=0;let r=T(M.current);r.addEventListener(`touchmove`,L,{passive:!0}),r.addEventListener(`touchend`,Ce,{passive:!0})}),R=d(()=>{let e=T(M.current);e.removeEventListener(`pointermove`,L),e.removeEventListener(`pointerup`,Ce),e.removeEventListener(`touchmove`,L),e.removeEventListener(`touchend`,Ce),ne.current=null}),z=l();return Y.useEffect(()=>{let e=M.current;if(!e)return()=>R();let t=ee(e,`touchstart`,we,{passive:!0});return()=>{t(),z.cancel(),R()}},[R,we,M,z]),Y.useEffect(()=>{o&&R()},[o,R]),m(`div`,e,{state:D,ref:[t,ae,M,he],props:[{"data-base-ui-slider-control":se?``:void 0,onPointerDown(e){let t=M.current,n=I(e.nativeEvent);if(!t||o||e.defaultPrevented||!re(n)||e.button!==0)return;let r=Ki(e,N);if(r!=null){xe(r);let n=be(r);if(n==null)return;ge(k.current[n.thumbIndex],oe(T(t)))?e.preventDefault():z.request(()=>{Se(n.thumbIndex)}),le(!0),C.current??(ue(n.value,s(P,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ve.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&Se(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),F.current=0;let i=T(M.current);i.addEventListener(`pointermove`,L,{passive:!0}),i.addEventListener(`pointerup`,Ce,{once:!0})}},a],stateAttributesMapping:Ni})}),Ji=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=Fi();return m(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:Ni})}),Yi=he();function Xi(){return n}function Zi(){return!1}function Qi(){return!0}function $i(){return(0,Yi.useSyncExternalStore)(Xi,Zi,Qi)}var ea=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}({}),ta=new Set([...g,ve,b]);function na(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${it(e[t],r,n)} start range`:`${it(e[t],r,n)} end range`:n?it(e[t],r,n):void 0}function ra(e,t,n,r,i){let a=n===1?e+t:e-t;return G(Number(a.toFixed(Math.max(Bi(e),Bi(t),Bi(r)))),r,i)}var ia=Y.forwardRef(function(e,n){let{render:r,children:i,className:a,"aria-describedby":o,"aria-label":s,"aria-labelledby":c,disabled:l=!1,getAriaLabel:u,getAriaValueText:p,id:y,index:x,inputRef:S,onBlur:w,onFocus:T,onKeyDown:ee,tabIndex:ne,style:re,...ie}=e,{nonce:ae}=ct(),oe=j(y),{active:se,lastUsedThumbIndex:E,controlRef:le,disabled:ue,validation:D,formatOptionsRef:O,handleInputChange:k,inset:A,labelId:pe,largeStep:M,locale:he,max:N,min:P,minStepsBetweenValues:F,form:ge,name:_e,orientation:I,pressedInputRef:ye,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:Se,renderBeforeHydration:L,setActive:Ce,setIndicatorPosition:we,state:R,step:z,values:B}=Fi(),Te=ce(),Ee=l||ue,De=B.length>1,Oe=I===`vertical`,ke=Te===`rtl`,{setTouched:Ae,setFocused:je,validationMode:Me}=Ye(),Ne=Y.useRef(null),V=Y.useRef(null),Pe=Y.useRef(!1),Fe=j(),Ie=Xe(),Le=De?Fe:Ie,{ref:Re,index:ze}=Ue({metadata:Y.useMemo(()=>({inputId:Le}),[Le])}),H=De?x??ze:0,U=H===B.length-1,W=B[H],Be=st(W,P,N),[Ve,He]=Y.useState(),We=$i(),Ge=E>=0&&E<B.length?E:-1,Ke=d(()=>{let e=le.current,t=Ne.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Oe?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Be/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;He(s),H===0?we(e=>[s,e[1]]):U&&we(e=>[e[0],s])});me(()=>{A&&queueMicrotask(Ke)},[Ke,A]),me(()=>{A&&Ke()},[Ke,A,Be]),me(()=>{if(!A)return;let e=le.current,t=Ne.current;if(!e||!t)return;let n=te(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Ke);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[le,Ke,A]);let qe=Oe?`bottom`:`insetInlineStart`,Je=Oe?`left`:`top`,G;De?se===H?G=2:Ge===H&&(G=1):se===H&&(G=1);let Ze;Ze=A?{"--position":`${Ve??0}%`,visibility:L&&We||Ve===void 0?`hidden`:void 0,position:`absolute`,[qe]:`var(--position)`,[Je]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:G}:Number.isFinite(Be)?{position:`absolute`,[qe]:`${Be}%`,[Je]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:G}:be;let Qe;I===`vertical`&&(Qe=ke?`vertical-rl`:`vertical-lr`);let $e=typeof u==`function`?u(H):s,et=f({"aria-label":$e,"aria-labelledby":c??($e==null?pe:void 0),"aria-describedby":o,"aria-orientation":I,"aria-valuenow":W,"aria-valuetext":typeof p==`function`?p(it(W,he,O.current??void 0),W,H):na(B,H,O.current??void 0,he),disabled:Ee,form:ge,id:Le,max:N,min:P,name:_e,onChange(e){k(e.currentTarget.valueAsNumber,H,e)},onFocus(e){let t=Pe.current;Pe.current=!1,Ce(H),je(!0),t&&e.stopPropagation()},onBlur(e){if(Pe.current){e.stopPropagation();return}Ne.current&&(Ce(-1),Ae(!0),je(!1),Me===`onBlur`&&D.commit(ji(W,H,P,N,De,B)))},onKeyDown(e){if(!ta.has(e.key))return;g.has(e.key)&&e.stopPropagation();let n=null,r=Vi(W,z,P);switch(e.key){case h:n=ra(r,e.shiftKey?M:z,1,P,N);break;case fe:n=ra(r,e.shiftKey?M:z,ke?-1:1,P,N);break;case _:n=ra(r,e.shiftKey?M:z,-1,P,N);break;case t:n=ra(r,e.shiftKey?M:z,ke?1:-1,P,N);break;case ve:n=ra(r,M,1,P,N);break;case b:n=ra(r,M,-1,P,N);break;case`End`:n=N,De&&(n=Number.isFinite(B[H+1])?B[H+1]-z*F:N);break;case v:n=P,De&&(n=Number.isFinite(B[H-1])?B[H-1]+z*F:P);break;default:break}if(n!==null){let t=e.currentTarget;de(t)||(Pe.current=!0,t.blur(),t.focus({preventScroll:!0,focusVisible:!0})),k(n,H,e),e.preventDefault()}},step:z,style:{...be,width:`100%`,height:`100%`,writingMode:Qe},tabIndex:ne??void 0,type:`range`,value:W??``},D.getInputValidationProps),tt=C(V,D.inputRef,S);return m(`div`,e,{state:R,ref:[n,Re,Ne],props:[{[ea.index]:H,children:(0,X.jsxs)(Y.Fragment,{children:[i,(0,X.jsx)(`input`,{ref:tt,...et,suppressHydrationWarning:!0}),A&&We&&L&&U&&(0,X.jsx)(`script`,{nonce:ae,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:oe,onBlur:w,onFocus:T,onPointerDown(e){if(Se.current=H,Ne.current!=null){let t=I===`horizontal`?`x`:`y`,n=zi(Ne.current);xe.current=(I===`horizontal`?e.clientX:e.clientY)-n[t]}V.current!=null&&ye.current!==V.current&&(ye.current=V.current)},style:Ze,suppressHydrationWarning:L||void 0},ie],stateAttributesMapping:Ni})});function aa(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 oa(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 sa=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{indicatorPosition:o,inset:s,max:c,min:l,orientation:u,renderBeforeHydration:d,state:f,values:p}=Fi(),h=$i(),g=u===`vertical`,_=p.length>1,v=s?aa(g,_,o[0],o[1],d,h):oa(g,_,st(p[0],l,c),st(p[p.length-1],l,c));return m(`div`,e,{state:f,ref:t,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:v,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:Ni})});function ca({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,X.jsx)(Ri,{className:D(`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,X.jsxs)(qi,{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,X.jsx)(Ji,{"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,X.jsx)(sa,{"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,X.jsx)(ia,{"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 la=Y.createContext(void 0);function ua(){let e=Y.useContext(la);if(e===void 0)throw Error(o(63));return e}var da=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),fa={...qe,checked(e){return e?{[da.checked]:``}:{[da.unchecked]:``}}};function pa(e,t,n,r=!0,i){let[a,o]=Y.useState(),s=j(i?`${i}-label`:void 0),c=e??t??a;return me(()=>{let i=e||t||!r?void 0:ma(n.current,s);a!==i&&o(i)}),c}function ma(e,t){let n=ha(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function ha(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var ga=Y.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:a,"aria-labelledby":o,form:l,id:u,inputRef:d,name:p,nativeButton:h=!1,onCheckedChange:g,readOnly:_=!1,required:v=!1,disabled:y=!1,render:b,uncheckedValue:x,value:S,style:w,...T}=e,{clearErrors:ee}=lt(),{state:ne,setTouched:re,setDirty:ie,validityData:ae,setFilled:oe,setFocused:se,shouldValidateOnChange:E,validationMode:ce,disabled:le,name:D,validation:O}=Ye(),{labelId:de}=tt(),k=le||y,A=D??p,fe=Y.useRef(null),pe=C(fe,d,O.inputRef),M=Y.useRef(null),he=j(),N=Xe({id:u,implicit:!1,controlRef:M}),P=h?void 0:N,[F,ge]=He({controlled:n,default:!!a,name:`Switch`,state:`checked`});Ke(M,he,F),me(()=>{fe.current&&oe(fe.current.checked)},[fe,oe]),Ut(F,()=>{ee(A),ie(F!==ae.initialValue),oe(F),E()?O.commit(F):O.commit(F,!0)});let{getButtonProps:_e,buttonRef:I}=c({disabled:k,native:h}),ve=pa(o,de,fe,!h,P),xe={id:h?N:he,role:`switch`,"aria-checked":F,"aria-readonly":_||void 0,"aria-required":v||void 0,"aria-labelledby":ve,onFocus(){k||se(!0)},onBlur(){let e=fe.current;!e||k||(re(!0),se(!1),ce===`onBlur`&&O.commit(e.checked))},onClick(e){if(_||k)return;e.preventDefault();let t=fe.current;t&&t.dispatchEvent(new(te(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},Se=f({checked:F,disabled:k,form:l,id:P,name:A,required:v,style:A?i:be,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:pe,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(_){e.preventDefault();return}let t=e.currentTarget.checked,n=s(ue,e.nativeEvent);g?.(t,n),!n.isCanceled&&ge(t)},onFocus(){M.current?.focus()}},O.getInputValidationProps,S===void 0?ye:{value:S}),L=Y.useMemo(()=>({...ne,checked:F,disabled:k,readOnly:_,required:v}),[ne,F,k,_,v]),Ce=m(`span`,e,{state:L,ref:[t,M,I],props:[xe,O.getValidationProps,T,_e],stateAttributesMapping:fa});return(0,X.jsxs)(la.Provider,{value:L,children:[Ce,!F&&A&&x!==void 0&&(0,X.jsx)(`input`,{type:`hidden`,form:l,name:A,value:x}),(0,X.jsx)(`input`,{...Se,suppressHydrationWarning:!0})]})}),_a=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return m(`span`,e,{state:ua(),ref:t,stateAttributesMapping:fa,props:a})});function va({className:e,...t}){return(0,X.jsx)(ga,{"data-slot":`switch`,className:D(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,X.jsx)(_a,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var ya=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],ba=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]}),xa=(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}),Sa=e=>(e/10).toFixed(1),Ca=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},wa=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function Ta({value:e,onChange:t}){let[n,r]=(0,Y.useState)(Sa(e)),[i,a]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{i||r(Sa(e))},[i,e]),(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(ca,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,X.jsxs)(Qt,{className:`w-24 shrink-0`,children:[(0,X.jsx)(Yt,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=wa(n)??e;a(!1),r(Sa(i)),t(i)},onChange:e=>{let n=Ca(e.target.value);r(n);let i=wa(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,X.jsx)(Xt,{align:`inline-end`,children:(0,X.jsx)(Jt,{children:`%`})})]})]})}function Ea({channels:t,onOpenChange:n,onShowScope:r,open:i,releaseId:a}){let o=we(a),s=o.data,c=Ae(s?.bundle_id??``),l=c.data,d=l?Rn(l):null,f=Ce(s?.scope_key??``),p=Ee(),m=Te(),h=L(),g=Ne(),[_,v]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(``),[S,C]=(0,Y.useState)(``),[w,T]=(0,Y.useState)(!1),[ee,te]=(0,Y.useState)(!1),[re,ie]=(0,Y.useState)(!1),[oe,se]=(0,Y.useState)(``),[E,ce]=(0,Y.useState)(`move`);(0,Y.useEffect)(()=>{v(s?ba(s):null),C(``)},[s]);let ue=s?ba(s):null,D=_!==null&&ue!==null&&JSON.stringify(_)!==JSON.stringify(ue),de=m.isPending||p.isPending||h.isPending||g.isPending,k=()=>{if(!de){if(D){T(!0);return}n(!1)}},fe=()=>{if(!_)return;let e=Zn(b);if(!tr(e)){C(Hn);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),x(``),C(``)},pe=async()=>{if(!s||!_)return;let e=_.targetCohorts.map(Zn);if(e.some(e=>!tr(e))){C(Hn);return}if(s.strategy===`APP_VERSION`&&!xi(_.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let t={expectedRevision:s.revision,patch:xa(s,{..._,targetCohorts:e}),releaseId:s.id};C(``);try{await m.mutateAsync(t),await p.mutateAsync(t),K.success(`Bundle settings saved`),n(!1)}catch(e){C(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},j=t.find(e=>e.id===s?.channel_id)?.name??s?.channel_id,M=t.filter(e=>e.id!==s?.channel_id),me=M.map(e=>({label:e.name,value:e.name})),he=oe.trim(),N=E===`copy`,P=_?xi(_.targetAppVersion.trim()):null,ge=()=>{se(``),ce(`move`)},I=e=>{!e&&g.isPending||(ie(e),e||ge())};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(O,{onOpenChange:e=>e?void 0:k(),open:i,children:(0,X.jsxs)(ae,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,X.jsxs)(_e,{className:`shrink-0 pr-12`,children:[(0,X.jsx)(le,{children:`Bundle Detail`}),(0,X.jsx)(F,{className:`sr-only`,children:`Edit bundle delivery settings.`}),s?(0,X.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,X.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Je,{className:`size-4`,platform:s.platform}),(0,X.jsx)(`span`,{className:`font-medium`,children:s.platform===`ios`?`iOS`:`Android`})]})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,X.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,X.jsx)(ln,{bundleId:s.id,fullOnMobile:!0,maxLength:18}),s.bundle_id?null:(0,X.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in app`})]})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,X.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:j})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,X.jsx)(`span`,{className:`text-xs text-foreground`,children:s.platform===`ios`?`iOS`:`Android`})]})]}):(0,X.jsx)(e,{className:`h-12 w-full`})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[o.isError?(0,X.jsxs)(Pe,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,X.jsx)(Vt,{}),(0,X.jsx)(Fe,{children:`Bundle details could not be loaded`}),(0,X.jsx)(Be,{children:o.error.message})]}):null,s&&_?(0,X.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[j?(0,X.jsx)(mt,{release:{platform:s.platform,channel:j,releaseId:s.id}}):null,(0,X.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,X.jsxs)(Le,{className:`gap-6`,children:[(0,X.jsxs)(W,{children:[(0,X.jsx)(V,{htmlFor:`release-message`,children:`Message`}),(0,X.jsx)(Zt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),s.strategy===`APP_VERSION`?(0,X.jsxs)(W,{children:[(0,X.jsx)(V,{htmlFor:`release-target`,children:`Target app version`}),(0,X.jsx)(ne,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),P?(0,X.jsx)(Re,{children:P}):null]}):null,(0,X.jsxs)(W,{children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,X.jsx)(V,{htmlFor:`release-enabled`,children:`Enabled`}),(0,X.jsx)(va,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]}),(0,X.jsx)(Re,{children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,X.jsxs)(W,{orientation:`horizontal`,children:[(0,X.jsx)(V,{htmlFor:`release-force-update`,children:`Force update`}),(0,X.jsx)(va,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]}),(0,X.jsxs)(W,{children:[(0,X.jsx)(V,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,X.jsx)(Ta,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,X.jsxs)(W,{children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(V,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,X.jsx)(Di,{releaseId:s.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(ne,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>x(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),fe())},placeholder:`e.g. qa-team…`,value:b}),(0,X.jsx)(y,{"aria-label":`Add cohort`,disabled:!b.trim(),onClick:fe,size:`icon`,type:`button`,variant:`outline`,children:(0,X.jsx)(It,{})})]}),_.targetCohorts.length?(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,X.jsxs)(U,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,X.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,X.jsx)(A,{className:`size-3`})})]},e))}):null,(0,X.jsx)(Re,{children:`Public names—no IDs or secrets.`})]})]}),S?(0,X.jsx)(H,{children:S}):null,(0,X.jsx)(y,{className:`w-full`,disabled:!D||de,onClick:pe,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,X.jsx)(u,{className:`my-2`}),(0,X.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,X.jsx)(y,{className:`w-full`,disabled:s.kind!==`BUNDLE`||de,onClick:()=>ie(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),s.bundle_id?(0,X.jsxs)(y,{className:`w-full`,disabled:de,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(s.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),K.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,X.jsx)(ut,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,X.jsx)(y,{className:`w-full`,disabled:s.enabled||de,onClick:()=>te(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),s.bundle_id&&c.isPending?(0,X.jsx)(e,{className:`h-40 w-full`}):null,s.bundle_id&&c.isError?(0,X.jsxs)(Pe,{variant:`destructive`,children:[(0,X.jsx)(Vt,{}),(0,X.jsx)(Fe,{children:`Build details are unavailable`}),(0,X.jsx)(Be,{children:`Delivery settings are unaffected.`})]}):null,!s.bundle_id||!c.isPending?(0,X.jsx)(Ti,{bundle:l,release:s}):null,(0,X.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,X.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,X.jsx)(`dt`,{children:`Artifact ID`}),(0,X.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.bundle_id??`Built-in app`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Revision`}),(0,X.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:s.revision})]}),d?(0,X.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,X.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,X.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:d})]}):null,(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Catalog generation`}),(0,X.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Catalog size`}),(0,X.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,X.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,X.jsx)(`dt`,{children:`Scope key`}),(0,X.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:s.scope_key}),r?(0,X.jsx)(y,{className:`mt-1 h-auto px-0 text-xs`,onClick:()=>r(s.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,X.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,X.jsx)(St,{onOpenChange:T,open:w,children:(0,X.jsxs)(Ct,{children:[(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Tt,{children:`Discard unsaved changes?`}),(0,X.jsx)(wt,{children:`Your Bundle changes will be lost.`})]}),(0,X.jsxs)(jt,{children:[(0,X.jsx)(Ft,{children:`Keep editing`}),(0,X.jsx)(Dt,{onClick:()=>{T(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,X.jsx)(St,{onOpenChange:te,open:ee,children:(0,X.jsxs)(Ct,{children:[(0,X.jsxs)(Ot,{children:[(0,X.jsxs)(Tt,{children:[`Remove this Bundle from `,j??`the channel`,`?`]}),(0,X.jsx)(wt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,X.jsxs)(jt,{children:[(0,X.jsx)(Ft,{children:`Cancel`}),(0,X.jsx)(Dt,{onClick:async()=>{if(s)try{await h.mutateAsync({expectedRevision:s.revision,releaseId:s.id}),K.success(`Bundle removed from ${j??`the channel`}`),te(!1),n(!1)}catch(e){C(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,X.jsx)(Pt,{onOpenChange:I,open:re,children:(0,X.jsxs)(kt,{showCloseButton:!g.isPending,children:[(0,X.jsxs)(xt,{children:[(0,X.jsx)(At,{children:`Promote to Channel`}),(0,X.jsx)(Mt,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,X.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(ze,{htmlFor:`promote-action`,children:`Action`}),(0,X.jsxs)(et,{disabled:g.isPending,items:ya,onValueChange:e=>ce(e),value:E,children:[(0,X.jsx)(Qe,{className:`w-full`,id:`promote-action`,children:(0,X.jsx)(nt,{placeholder:`Select an action`})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`move`,children:`Move bundle`}),(0,X.jsx)(ot,{value:`copy`,children:`Copy bundle`})]})})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:N?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(ze,{htmlFor:`target-channel`,children:`Target Channel`}),(0,X.jsxs)(et,{disabled:g.isPending,items:me,onValueChange:e=>se(e??``),value:oe||null,children:[(0,X.jsx)(Qe,{className:`w-full`,id:`target-channel`,children:(0,X.jsx)(nt,{placeholder:`Select a channel`})}),(0,X.jsx)(Ze,{className:`max-h-64`,children:(0,X.jsx)(at,{children:M.map(e=>(0,X.jsx)(ot,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,X.jsxs)(Et,{children:[(0,X.jsx)(y,{disabled:g.isPending,onClick:()=>I(!1),variant:`outline`,children:`Cancel`}),(0,X.jsx)(y,{disabled:!he||g.isPending,onClick:async()=>{if(s)try{await g.mutateAsync({action:E,expectedRevision:s.revision,releaseId:s.id,targetChannel:he}),I(!1),K.success(N?`Bundle copied to ${he}`:`Bundle moved to ${he}`)}catch(e){K.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?N?`Copying…`:`Moving…`:N?`Copy`:`Move`})]})]})})]})}function Da({release:e}){return(0,X.jsxs)(U,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,X.jsx)(Ie,{className:`size-3`}):(0,X.jsx)(en,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Oa({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,X.jsxs)(U,{className:D(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,X.jsx)(Vt,{className:`h-3 w-3`}):null,r,`%`]})}var ka=20,Aa=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],ja=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}],Ma=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Na=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function Pa({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let a=_t(i),o=i.channelId!==void 0,s=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))];return(0,X.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,X.jsx)(M,{className:`-ml-1`}),(0,X.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,X.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,X.jsx)(rn,{className:`size-3.5`}),(0,X.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,X.jsxs)(et,{items:s,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,X.jsx)(Qe,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,X.jsx)(nt,{})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`all`,children:`All Channels`}),e.map(e=>(0,X.jsx)(ot,{value:e.id,children:e.name},e.id))]})})]}),(0,X.jsxs)(et,{disabled:!o,items:Aa,onValueChange:e=>t({platform:e===`android`?`android`:`ios`}),value:i.platform??`ios`,children:[(0,X.jsx)(Qe,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,title:o?void 0:`Choose a channel first`,children:(0,X.jsx)(nt,{})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`ios`,children:`iOS`}),(0,X.jsx)(ot,{value:`android`,children:`Android`})]})})]}),(0,X.jsxs)(et,{disabled:!o&&i.scopeKey===void 0,items:ja,onValueChange:e=>t({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:i.enabled===void 0?`all`:i.enabled?`enabled`:`disabled`,children:[(0,X.jsx)(Qe,{"aria-label":`Status`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,X.jsx)(nt,{})}),(0,X.jsx)(Ze,{children:(0,X.jsxs)(at,{children:[(0,X.jsx)(ot,{value:`all`,children:`Any Status`}),(0,X.jsx)(ot,{value:`enabled`,children:`Enabled`}),(0,X.jsx)(ot,{value:`disabled`,children:`Disabled`})]})})]}),(0,X.jsx)(y,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,X.jsx)(sn,{})}),i.bundleId?(0,X.jsxs)(U,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,X.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,X.jsx)(A,{className:`size-3`})})]}):null,i.scopeKey?(0,X.jsxs)(U,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Target filter`,(0,X.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,X.jsx)(A,{className:`size-3`})})]}):null,a?(0,X.jsxs)(y,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,X.jsx)(A,{"data-icon":`inline-start`}),`Clear`]}):null]})}function Fa({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,X.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,X.jsx)(y,{"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,X.jsx)(We,{}):(0,X.jsx)(z,{})}):(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,X.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,X.jsx)(ln,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,X.jsx)(dt,{className:`size-3.5`}),` Built-in app`]})]}),i?(0,X.jsx)(U,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,X.jsxs)(`span`,{"aria-label":`Currently unreachable. No catalog segment or cohort selects this bundle first.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No catalog segment or cohort selects this bundle first with the current delivery settings.`,children:[(0,X.jsx)(en,{className:`size-3.5`}),`Unreachable`]}):null]})}function Ia({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Ae(i),o=De(i);return a.isError||o.isError?(0,X.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,X.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,X.jsx)(e,{className:`h-10 w-full`}),(0,X.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,X.jsx)(dr,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,X.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 La(){let t=bt.useSearch(),n=bt.useNavigate(),r=k(),[i,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(),l=ke({afterReleaseId:t.afterReleaseId,beforeReleaseId:t.beforeReleaseId,filter:vt(t),limit:ka}),u=B().data??[],d=l.data?.data??[],f=Me(Array.from(new Set(d.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},p=l.data?.next,m=l.data?.previous,h=d.flatMap(e=>{let t=u.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t}]:[]}),g=yt(),_=10+g.length,v=new Map(u.map(e=>[e.id,e.name]));(0,Y.useEffect)(()=>{s&&!d.some(e=>e.id===s)&&c(void 0)},[s,d]);let b=(e,t=!0)=>void n({resetScroll:t,search:e,to:`/`}),x=e=>b(gt(t,e)),S=e=>{let n=d.find(t=>t.bundle_id===e.id);if(c(void 0),n){b({...t,releaseId:n.id},!1);return}x({bundleId:e.id})},C=t.afterReleaseId!==void 0||t.beforeReleaseId!==void 0,w=m?{...t,afterReleaseId:m,beforeReleaseId:void 0,releaseId:void 0}:null,T=p?{...t,afterReleaseId:void 0,beforeReleaseId:p,releaseId:void 0}:null,ee={...t,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0};return(0,X.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,X.jsx)(Pa,{channels:u,onChange:x,onClear:()=>b({}),onManageChannels:()=>o(!0),search:t}),(0,X.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[l.isError?(0,X.jsxs)(Pe,{variant:`destructive`,children:[(0,X.jsx)(Vt,{}),(0,X.jsx)(Fe,{children:`Bundles could not be loaded`}),(0,X.jsx)(Be,{children:l.error.message})]}):(0,X.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,X.jsx)(`div`,{className:`h-full overflow-y-auto`,children:l.isPending?(0,X.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(t,n)=>(0,X.jsx)(e,{className:`h-44 w-full`},n))}):d.length?d.map(e=>{let n=v.get(e.channel_id)??e.channel_id,r=e.bundle_id?f[e.bundle_id]:0,i=s===e.id,a=`bundle-lineage-panel-${e.id}`;return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsxs)(`article`,{className:D(`flex flex-col gap-4 border-b p-4 last:border-b-0`,e.currentlyUnreachable&&`bg-muted/35 saturate-50 transition-[background-color,filter] focus-within:saturate-100 motion-reduce:transition-none`,i&&`border-b-0 bg-primary/5`),children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsx)(Fa,{expanded:i,onOpen:()=>b({...t,releaseId:e.id},!1),onToggleExpand:()=>c(i?void 0:e.id),release:e}),(0,X.jsx)(dn,{channel:n,className:`shrink-0`})]}),(0,X.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,X.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,X.jsx)(Je,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,X.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Ma.format(e.created_at_ms)})]}),(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,X.jsx)(`dd`,{className:`mt-1`,children:(0,X.jsx)(Oa,{percentage:e.rollout_cohort_count/10})})]}),(0,X.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,X.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),g.map(({Cell:t,feature:n,label:r})=>(0,X.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:r}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(t,{releaseId:e.id,releases:h})})]},n)),(0,X.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,X.jsx)(Da,{release:e}),e.should_force_update?(0,X.jsx)(U,{variant:`secondary`,children:`Force update`}):null]}),(0,X.jsxs)(`div`,{className:`col-span-2 grid gap-2 rounded-md border bg-background/80 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,X.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:e.target_app_version??e.fingerprint_hash??`—`})]}),(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,X.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:e.message||`—`})]})]})]})]}),i&&e.bundle_id?(0,X.jsx)(Ia,{onDetailClick:S,panelId:a,release:e}):null]},e.id)}):(0,X.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:C?`No more bundles on this side.`:_t(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,X.jsxs)(qt,{className:`min-w-max`,children:[(0,X.jsx)(Wt,{className:`bg-muted/40`,children:(0,X.jsxs)(Kt,{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,X.jsx)(q,{children:`ID`}),(0,X.jsx)(q,{children:`Channel`}),(0,X.jsx)(q,{children:`Platform`}),(0,X.jsx)(q,{children:`Patches`}),(0,X.jsx)(q,{children:`Target`}),(0,X.jsx)(q,{children:`Enabled`}),(0,X.jsx)(q,{children:`Force update`}),(0,X.jsx)(q,{children:`Rollout`}),g.map(({feature:e,label:t})=>(0,X.jsx)(q,{children:t},e)),(0,X.jsx)(q,{children:`Message`}),(0,X.jsx)(q,{children:`Created`})]})}),(0,X.jsxs)(Gt,{children:[l.isPending?Array.from({length:7},(t,n)=>(0,X.jsx)(Kt,{children:(0,X.jsx)(J,{colSpan:_,children:(0,X.jsx)(e,{className:`h-8 w-full`})})},n)):d.map(e=>{let n=s===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsxs)(Kt,{"aria-label":`Open bundle ${e.id}`,className:D(`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:n=>{n.target instanceof Element&&n.target.closest(`button, a, input, select, textarea`)||b({...t,releaseId:e.id},!1)},onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),b({...t,releaseId:e.id},!1))},tabIndex:0,children:[(0,X.jsx)(J,{children:(0,X.jsx)(Fa,{expanded:n,onOpen:()=>b({...t,releaseId:e.id},!1),onToggleExpand:()=>c(n?void 0:e.id),release:e})}),(0,X.jsx)(J,{children:(0,X.jsx)(dn,{channel:v.get(e.channel_id)??e.channel_id})}),(0,X.jsx)(J,{className:`whitespace-nowrap`,children:(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Je,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]})}),(0,X.jsx)(J,{children:e.bundle_id&&f[e.bundle_id]===void 0?(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&f[e.bundle_id]>0?(0,X.jsxs)(U,{variant:`secondary`,children:[f[e.bundle_id],` `,f[e.bundle_id]===1?`patch`:`patches`]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(J,{children:e.target_app_version?(0,X.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(ht,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(`span`,{className:`font-medium`,children:e.target_app_version})]}):e.fingerprint_hash?(0,X.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,X.jsx)(nn,{className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsx)(ft,{maxLength:12,value:e.fingerprint_hash})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(J,{children:(0,X.jsxs)(`span`,{className:`flex items-center`,children:[(0,X.jsx)(fn,{enabled:e.enabled}),(0,X.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,X.jsx)(J,{children:(0,X.jsxs)(`span`,{className:`flex items-center`,children:[(0,X.jsx)(fn,{enabled:e.should_force_update,falseIcon:`minus`}),(0,X.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,X.jsx)(J,{children:(0,X.jsx)(Oa,{percentage:e.rollout_cohort_count/10})}),g.map(({Cell:t,feature:n})=>(0,X.jsx)(J,{children:(0,X.jsx)(t,{releaseId:e.id,releases:h})},n)),(0,X.jsx)(J,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,X.jsx)(J,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Ma.format(e.created_at_ms),children:Na.format(e.created_at_ms)})]}),n&&e.bundle_id?(0,X.jsx)(Kt,{className:`hover:bg-transparent`,children:(0,X.jsx)(J,{className:`border-t-0 p-0`,colSpan:_,children:(0,X.jsx)(Ia,{onDetailClick:S,panelId:r,release:e})})}):null]},e.id)}),!l.isPending&&d.length===0?(0,X.jsx)(Kt,{children:(0,X.jsx)(J,{className:`h-40 text-center text-muted-foreground`,colSpan:_,children:C?`No more bundles on this side.`:_t(t)?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!l.isError&&!l.isPending?(0,X.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,X.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[(0,X.jsx)(`span`,{className:`text-foreground`,children:d.length}),` `,d.length===1?`entry`:`entries`,`, newest first`]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[C?(0,X.jsx)(xe,{className:a({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`ghost`}),search:ee,to:`/`,children:`Newest`}):null,w?(0,X.jsxs)(xe,{className:a({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:w,to:`/`,children:[(0,X.jsx)($t,{"data-icon":`inline-start`}),`Previous`]}):(0,X.jsxs)(y,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,X.jsx)($t,{"data-icon":`inline-start`}),`Previous`]}),T?(0,X.jsxs)(xe,{className:a({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,X.jsx)(z,{"data-icon":`inline-end`})]}):(0,X.jsxs)(y,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,X.jsx)(z,{"data-icon":`inline-end`})]})]})]}):null]}),(0,X.jsx)(Ea,{channels:u,onOpenChange:e=>!e&&b({...t,releaseId:void 0},!1),onShowScope:e=>x({scopeKey:e}),open:!!t.releaseId,releaseId:t.releaseId??``}),(0,X.jsx)(fr,{onOpenChange:o,open:i})]})}export{La as component};
|