@hot-updater/console 1.0.0-rc.39 → 1.0.0-rc.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{EventDetails-BUTZTAVo.js → EventDetails-3DgVjwDn.js} +1 -1
- package/.output/public/assets/{InsightsInfo-B8i-PPsH.js → InsightsInfo-NUuLFYqg.js} +1 -1
- package/.output/public/assets/{InsightsPageHeader-CASeYum3.js → InsightsPageHeader-DqCp0vf7.js} +1 -1
- package/.output/public/assets/{index-YSc3HCcR.js → index-B7BSdp0k.js} +2 -2
- package/.output/public/assets/insights-CevVB_8E.js +2 -0
- package/.output/public/assets/insights-DMH-zhbe.js +42 -0
- package/.output/public/assets/insights_.distribution-B9MOEnzZ.js +2 -0
- package/.output/public/assets/insights_.distribution-O73SKvoa.js +1 -0
- package/.output/public/assets/{installations-C-QP0sM1.js → installations-DtZj5jk2.js} +1 -1
- package/.output/public/assets/{installations-yQkxp5fm.js → installations-LJBhFDEM.js} +2 -2
- package/.output/public/assets/{preload-helper-DuV6lz46.js → preload-helper-D9SUwQT7.js} +1 -1
- package/.output/public/assets/{routes-DuBSi7uM.js → routes-CJSxovHS.js} +1 -1
- package/.output/public/assets/routes-DyZCr794.js +2 -0
- package/.output/public/assets/styles-DwA6mhnh.css +2 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-DNbgEvfb.mjs → __23tanstack-start-server-fn-resolver-CUp7Too4.mjs} +36 -36
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-BCGWklf8.mjs → ConsoleFeatureUnavailable-BxaV7ca0.mjs} +5 -5
- package/.output/server/_ssr/{EventDetails-vtXoqSGS.mjs → EventDetails-B5HHZsCk.mjs} +7 -7
- package/.output/server/_ssr/{InsightsInfo-B0AtaDnr.mjs → InsightsInfo-C7K_HKHZ.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-BryzBlT8.mjs → InsightsPageHeader-BPaYzzkg.mjs} +18 -7
- package/.output/server/_ssr/{NotFoundPage-xK1bhpoZ.mjs → NotFoundPage-CyBONH8d.mjs} +2 -2
- package/.output/server/_ssr/{alert-dialog-Cc9d0p8Y.mjs → alert-dialog-BsqgyNOZ.mjs} +1 -1
- package/.output/server/_ssr/{api-keys-C2jqeEZ_.mjs → api-keys-CY1d8bCZ.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-DnKkFZ3T.mjs → api-keys-D8R-eRJ-.mjs} +8 -8
- package/.output/server/_ssr/{api-keys-rpc-BJ0MKu1e.mjs → api-keys-rpc-CC1ERVtk.mjs} +3 -3
- package/.output/server/_ssr/{api-Bz1UGqdn.mjs → api-otC0m2Cl.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-B9mAeGyS.mjs → api-rpc-C99iexLk.mjs} +4 -4
- package/.output/server/_ssr/{auth-rpc-Bs4tYGIg.mjs → auth-rpc-PABg7kHk.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-CcTNWmd4.mjs → auth.server-8-IRXBc-.mjs} +2 -2
- package/.output/server/_ssr/{card-GK-VihZc.mjs → card-ijGSudc_.mjs} +1 -1
- package/.output/server/_ssr/{config.server-DaeqzKiu.mjs → config.server-08RES1G-.mjs} +3 -3
- package/.output/server/_ssr/{console-access-CSVqeikY.mjs → console-access-D0bQJ9tx.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-CuukSjL8.mjs → console-features-api-BRGAxAgc.mjs} +3 -3
- package/.output/server/_ssr/{console-features-rpc-Dxv_D020.mjs → console-features-rpc-845alOXy.mjs} +3 -3
- package/.output/server/_ssr/{dialog-Vjm_bDw9.mjs → dialog-BnfVyv4I.mjs} +1 -1
- package/.output/server/_ssr/{empty-DeVHKygf.mjs → empty-CnGZqF1a.mjs} +2 -2
- package/.output/server/_ssr/{failureReports-CRYHdQBQ.mjs → failureReports-_trbWCVo.mjs} +2 -2
- package/.output/server/_ssr/{field-CcbQSAiS.mjs → field-CysUuRJx.mjs} +2 -2
- package/.output/server/_ssr/{input-group-D7oZhqZP.mjs → input-group-C44twsSf.mjs} +1 -1
- package/.output/server/_ssr/{insights-C2_kuG7Z.mjs → insights-Br6JnctH.mjs} +2 -2
- package/.output/server/_ssr/{insights-DFBjq_u1.mjs → insights-CgRV7dlP.mjs} +134 -125
- package/.output/server/_ssr/{insights-CdkhyQHH.mjs → insights-CrrlG-bz.mjs} +5 -5
- package/.output/server/_ssr/{insights-api-CBBcHIUP.mjs → insights-api-MpLvDjmC.mjs} +5 -5
- package/.output/server/_ssr/{insights-errors-F-7hOApm.mjs → insights-errors-Cy03daYs.mjs} +2 -2
- package/.output/server/_ssr/{insights-failures-BZaGNNij.mjs → insights-failures-HHiiIbag.mjs} +4 -5
- package/.output/server/_ssr/{insights-failures-rpc-CTf5QF7O.mjs → insights-failures-rpc-CGiDJbg-.mjs} +8 -8
- package/.output/server/_ssr/{insights-recovery-rpc-CPKwBt4V.mjs → insights-recovery-rpc-Bul_1cyL.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-DjhnYd2B.mjs → insights-rpc-D24DKKlx.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-CLHRgGDT.mjs → insights-usage-rpc-iG8wRo4G.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-CLyldyrz.mjs → insights-usage-rpc-tVCHkzGH.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-DXCwHGBj.mjs → insights_.distribution-Ckc_O360.mjs} +5 -5
- package/.output/server/_ssr/{insights_.distribution-WDmsXtQl.mjs → insights_.distribution-DbO4X6X6.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-Buu3dsat.mjs → insights_.distribution-DsujaomV.mjs} +13 -13
- package/.output/server/_ssr/{installations-BiZY4zjE.mjs → installations-DV3sNoM5.mjs} +10 -10
- package/.output/server/_ssr/{installations-Dfe3WTAY.mjs → installations-DkJq_y8i.mjs} +2 -2
- package/.output/server/_ssr/{installations-sR2BlZxi.mjs → installations-F6vBSPUU.mjs} +4 -4
- package/.output/server/_ssr/{release-adoption-rpc-DVhlhHRR.mjs → release-adoption-rpc-h_r3KQsi.mjs} +5 -5
- package/.output/server/_ssr/{router-HumF5rJs.mjs → router-C_IshN2d.mjs} +13 -13
- package/.output/server/_ssr/{routes-kDK03EWa.mjs → routes-BEHlOXKL.mjs} +33 -22
- package/.output/server/_ssr/{routes-CN0fvuLB.mjs → routes-DeSps20R.mjs} +14 -10
- package/.output/server/_ssr/{select-ycdfR07Y.mjs → select-BL10bGzk.mjs} +1 -1
- package/.output/server/_ssr/{server-CyAnx61_.mjs → server-DIIIVgcN.mjs} +3 -3
- package/.output/server/_ssr/{sidebar-B2SHpuig.mjs → sidebar-DLus-ndm.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{table-COXYXU49.mjs → table-U7InIZlH.mjs} +1 -1
- package/.output/server/_ssr/{updateFailures-BP-A8Ppr.mjs → updateFailures-BLs3R7j0.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-DcB4oGQp.mjs → _tanstack-start-manifest_v-VxUXUIhM.mjs} +25 -25
- package/.output/server/index.mjs +113 -113
- package/package.json +7 -7
- package/src/components/features/insights/BuiltinBundle.tsx +18 -3
- package/src/components/features/insights/FailureReports.tsx +15 -2
- package/src/components/features/insights/ReleaseActivity.tsx +1 -1
- package/src/components/features/insights/UpdateFailures.tsx +103 -104
- package/src/components/features/releases/ReleaseEditorSheet.tsx +2 -2
- package/src/lib/insights-failures.ts +1 -11
- package/src/routes/index.tsx +33 -15
- package/src/routes/insights.tsx +1 -1
- package/src/routes/insights_.distribution.tsx +3 -3
- package/.output/public/assets/insights-BT0ER2ff.js +0 -2
- package/.output/public/assets/insights-DPY9akyx.js +0 -42
- package/.output/public/assets/insights_.distribution-NyB0_bbh.js +0 -2
- package/.output/public/assets/insights_.distribution-jH_7sKdg.js +0 -1
- package/.output/public/assets/routes-DQWmO9Ow.js +0 -2
- package/.output/public/assets/styles-Cm2ONGCt.css +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/insights_.distribution-WTcKITzb.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/insights_.distribution-O73SKvoa.js","assets/preload-helper-D9SUwQT7.js","assets/valueToPercent-Ci2-fmWp.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/InsightsPageHeader-DqCp0vf7.js","assets/card-DKr2pZMA.js","assets/insights-usage-rpc-pz2XQBi3.js","assets/arrow-left-BPK7iqvj.js","assets/InsightsInfo-NUuLFYqg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./console-features-api-BhUIxeL-.js";import{C as t,t as n,w as r}from"./preload-helper-D9SUwQT7.js";import{i}from"./InsightsInfo-NUuLFYqg.js";var a=r(`/insights_/distribution`)({beforeLoad:({context:t})=>e(t.queryClient,`insightsAnalytics`),notFoundComponent:t(()=>n(()=>import(`./insights_.distribution-WTcKITzb.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:t(()=>n(()=>import(`./insights_.distribution-O73SKvoa.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,13,14,4,15])),`component`),validateSearch:i});export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fn as e,Hr as t,In as n,Nn as r,cr as i}from"./sidebar-RBvHzq8e.js";import{l as a}from"./console-features-api-BhUIxeL-.js";import{d as o,s}from"./preload-helper-D9SUwQT7.js";import{t as c}from"./arrow-left-BPK7iqvj.js";import{a as ee,i as te,o as l,r as u,t as d}from"./empty-DtangHOp.js";import{a as f,c as p,d as m,s as h,t as g,u as _}from"./field-bPoDrs6K.js";import{I as v,L as y,a as ne,c as re,i as b,l as x,o as S,s as C}from"./valueToPercent-Ci2-fmWp.js";import{n as w,r as T,t as E}from"./insights-usage-rpc-pz2XQBi3.js";import{a as D,i as O,n as k,o as A,t as j}from"./card-DKr2pZMA.js";import{a as M,t as N}from"./InsightsInfo-NUuLFYqg.js";import{t as P}from"./insights_.distribution-B9MOEnzZ.js";import{f as ie,n as F,o as I,t as L}from"./InsightsPageHeader-DqCp0vf7.js";var R=t(),z=20,B=new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}),V=e=>e.releaseId??(e.builtinBundleId?`Built-in bundle ${e.builtinBundleId}`:`Unknown bundle`);function H({bundleId:e}){return(0,R.jsxs)(`div`,{className:`flex min-h-11 min-w-0 flex-wrap items-center gap-2 md:min-h-9`,children:[(0,R.jsx)(F,{}),(0,R.jsx)(y,{bundleId:e,className:`text-muted-foreground`})]})}function U(){let t=P.useSearch(),y=s(),F=P.useNavigate(),U={platform:t.platform??`all`,channel:t.channel??`production`,appVersion:t.appVersion,window:t.window??`24h`},W=i({queryKey:[`insights`,`app-usage`,U],queryFn:()=>E({data:U}),staleTime:3e4}),G=W.error?void 0:W.data,K=G?`since ${B.format(G.distributionSinceMs)}, 00:00 UTC`:`in this period`,q=(G?.bundleDistribution??[]).filter(e=>!t.version||e.appVersion===t.version),J=q.reduce((e,t)=>e+t.installations,0),Y=Math.max(1,Math.ceil(q.length/z)),X=Math.min(t.page??1,Y),Z=[...new Set([...G?.versions.map(e=>e.name)??[],...t.version?[t.version]:[]])],Q=M(t),$=e=>void F({search:{...t,page:void 0,...e}});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,R.jsx)(L,{view:`distribution`,overviewSearch:Q}),(0,R.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 px-4 py-6 sm:p-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-6`,children:[(0,R.jsxs)(a,{to:`/insights`,search:Q,className:n({variant:`ghost`,className:`h-11 w-fit sm:h-9`}),children:[(0,R.jsx)(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)(I,{twelveMonths:o(y),window:U.window,onWindowChange:e=>$({window:e})}),(0,R.jsx)(e,{"aria-label":`Refresh distribution`,variant:`ghost`,size:`icon`,className:`size-11 sm:size-9`,disabled:W.isFetching,onClick:()=>void W.refetch(),children:(0,R.jsx)(T,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,R.jsxs)(g,{className:`w-full sm:w-64`,children:[(0,R.jsx)(f,{htmlFor:`distribution-version`,children:`App version`}),(0,R.jsxs)(b,{items:Object.fromEntries([[`all`,`All versions`],...Z.map(e=>[`version:${e}`,e])]),value:t.version?`version:${t.version}`:`all`,onValueChange:e=>{e!==null&&$({version:e===`all`?void 0:e.slice(8)})},children:[(0,R.jsx)(re,{id:`distribution-version`,className:`min-h-11 w-full sm:min-h-9`,children:(0,R.jsx)(x,{})}),(0,R.jsx)(ne,{children:(0,R.jsxs)(S,{children:[(0,R.jsx)(C,{value:`all`,children:`All versions`}),Z.map(e=>(0,R.jsx)(C,{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)(h,{variant:`outline`,className:`gap-1.5`,children:[U.platform===`all`?null:(0,R.jsx)(v,{platform:U.platform,className:`size-3.5`}),U.platform===`all`?`All platforms`:U.platform===`ios`?`iOS`:`Android`]}),(0,R.jsx)(h,{variant:`outline`,children:U.channel}),U.appVersion?(0,R.jsxs)(h,{variant:`outline`,children:[`Reports from `,U.appVersion]}):null]})]}),(0,R.jsxs)(j,{"aria-label":`Bundles by app version`,role:`region`,className:`min-w-0`,children:[(0,R.jsxs)(D,{className:`flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(A,{children:`Bundles by app version`}),(0,R.jsxs)(N,{label:`How bundle distribution is counted`,children:[`Each installation counts once, by its latest report`,` `,K,`. Shares are within each app version. Built-in bundle: the bundle the native build shipped, by its ID. Unknown bundle: no deployment and no built-in bundle ID.`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[W.isPending?(0,R.jsx)(r,{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)(k,{className:`flex min-w-0 flex-col gap-4`,children:[G?.truncated?(0,R.jsxs)(p,{children:[(0,R.jsx)(m,{children:`Partial history`}),(0,R.jsxs)(_,{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)(r,{"aria-label":`Loading bundle distribution`,className:`h-64`}):W.error?(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-4`,children:[(0,R.jsx)(ie,{error:W.error,fallbackTitle:`Distribution unavailable`}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>void W.refetch(),children:`Retry distribution`})]}):q.length===0?(0,R.jsxs)(d,{children:[(0,R.jsxs)(te,{children:[(0,R.jsx)(ee,{children:`No bundles reported`}),(0,R.jsx)(u,{children:`Choose another version or period, or change the filters in the overview.`})]}),(0,R.jsx)(e,{variant:`outline`,onClick:()=>$({version:void 0}),children:`Show all versions`})]}):(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`div`,{"aria-hidden":`true`,className:`hidden grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] gap-4 border-b px-3 pb-3 text-xs text-muted-foreground md:grid`,children:[(0,R.jsx)(`span`,{children:`App version`}),(0,R.jsx)(`span`,{children:`Bundle ID`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Active installations`}),(0,R.jsx)(`span`,{className:`text-right`,children:`Version share`})]}),(0,R.jsx)(`ul`,{"aria-label":`Bundle distribution`,className:`divide-y`,children:q.slice((X-1)*z,X*z).map(e=>{let t=G?.versions.find(t=>t.name===e.appVersion)?.installations??0,n=t>0?e.installations/t*100:0;return(0,R.jsxs)(`li`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-3 px-1 py-4 md:grid-cols-[8rem_minmax(0,1fr)_7rem_7rem] md:px-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-medium`,title:e.appVersion,children:e.appVersion}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(v,{platform:e.platform,className:`size-3.5`}),e.platform===`ios`?`iOS`:`Android`]})]}),(0,R.jsxs)(`div`,{className:`col-span-2 row-start-2 min-w-0 md:col-span-1 md:row-auto`,children:[e.releaseId?(0,R.jsxs)(a,{to:`/`,search:{releaseId:e.releaseId},"aria-label":`Review bundle ${e.releaseId} for app version ${e.appVersion}`,className:`flex min-h-11 min-w-0 items-center gap-2 text-xs underline-offset-4 hover:underline md:min-h-9`,children:[(0,R.jsx)(`span`,{className:`break-all font-mono`,children:e.releaseId}),(0,R.jsx)(l,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}):e.builtinBundleId?null:(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Unknown bundle`}),e.builtinBundleId?(0,R.jsx)(H,{bundleId:e.builtinBundleId}):null]}),(0,R.jsxs)(`div`,{className:`col-start-2 row-start-1 text-right md:col-auto md:row-auto`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:e.installations.toLocaleString()}),(0,R.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground md:sr-only`,children:`active`}),(0,R.jsxs)(`p`,{className:`mt-1 text-xs tabular-nums text-muted-foreground md:hidden`,children:[n.toFixed(1),`% of version`]})]}),(0,R.jsxs)(`div`,{className:`hidden flex-col gap-2 md:flex`,children:[(0,R.jsxs)(`span`,{className:`text-right text-sm tabular-nums`,children:[n.toFixed(1),`%`]}),(0,R.jsx)(w,{"aria-label":`${V(e)} share in ${e.appVersion} on ${e.platform}`,value:n})]})]},JSON.stringify([e.appVersion,e.platform,e.releaseId,e.builtinBundleId]))})})]})]}),G&&q.length>0?(0,R.jsxs)(O,{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)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X<=1,onClick:()=>$({page:X-1}),children:`Previous`}),(0,R.jsx)(e,{variant:`outline`,className:`h-11 sm:h-9`,disabled:X>=Y,onClick:()=>$({page:X+1}),children:`Next`})]})]}):null]})]})})]})}export{U as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$r as e,Fn as t,Hr as n,In as r,Ln as i,Nn as a,Pn as o,ar as s,ir as c,ni as l}from"./sidebar-RBvHzq8e.js";import{d as u,l as d,u as f}from"./console-features-api-BhUIxeL-.js";import{a as p,c as m,i as h,n as ee,o as g,r as _,s as v,t as y}from"./installations-yQkxp5fm.js";import{D as b,a as x,i as S,l as C,o as te,r as ne,s as re,u as w}from"./preload-helper-DuV6lz46.js";import{a as T,n as E,o as D,r as O,t as k}from"./EventDetails-BUTZTAVo.js";import{t as ie}from"./arrow-left-BPK7iqvj.js";import{o as A}from"./empty-DtangHOp.js";import{a as j,f as M,t as N}from"./field-bPoDrs6K.js";import{o as P}from"./useCompositeListItem-BxJspDxS.js";import{c as ae,i as oe,n as se,r as ce,s as F,t as le}from"./input-group-_PD0i7wZ.js";import{t as I}from"./refresh-cw-3fSQ1FYY.js";import{a as L,n as R,o as z,r as ue,t as B}from"./card-DKr2pZMA.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./table-BYmouPt9.js";import{a as de,f as q,n as fe,r as pe,t as me}from"./InsightsPageHeader-CASeYum3.js";function he(){m(u(),!0)}function ge(e){return he(),v(u(),e)}function _e(e){let t=u();return f(t.stores.location,b(e,t))}var ve=s(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),J=l(e(),1),Y=n();function ye({events:e,formatter:t,renderIdentity:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,Y.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,Y.jsx)(O,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,Y.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,Y.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,Y.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,Y.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,Y.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,Y.jsx)(k,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:n,nextCursor:r,onNext:i,onPrevious:a,pageLength:o,pageNumber:s}){return(0,Y.jsxs)(`nav`,{"aria-label":`${n} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:a,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:r===null,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var be=e=>_.filter((t,n)=>n===0||p[t].durationMs<=e*864e5);function xe({event:e,eventsLocation:t,touch:n=!1}){return(0,Y.jsxs)(`div`,{className:n?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,Y.jsxs)(d,{className:r({className:n?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...t,query:e.installId||void 0,installId:e.installId},state:e=>({insightsPagination:{eventsBack:e.insightsPagination?.eventsBack}}),"aria-label":`View history for ${e.userId??`anonymous installation`} (${e.installId})`,children:[(0,Y.jsx)(`span`,{className:n?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,Y.jsx)(A,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(F,{value:e.installId,maxLength:13,buttonClassName:n?`min-h-11 px-3`:void 0})]})}function Se({children:e,description:n,error:r,eventsLocation:i,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:m,range:h,rawDays:ee=90,title:_=`All events`}){let v=D(),y=m>1,b=be(ee),x=h===void 0?void 0:g(h),S=x!==void 0&&b.includes(x)?x:void 0,C=S!==void 0&&d?(0,Y.jsx)(t,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(S),type:`button`,variant:`outline`,children:`Show the last ${p[S].period}`}):null;return(0,Y.jsxs)(B,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,Y.jsxs)(L,{className:`gap-4 p-4 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(z,{children:(0,Y.jsx)(`h2`,{children:_})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h!==void 0&&d?(0,Y.jsx)(de,{label:`Time range`,onPeriodChange:d,period:h,periods:b.map(e=>({value:e,name:`Last ${p[e].period}`}))}):null,(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,Y.jsx)(ue,{children:n}):null]}),e]}),(0,Y.jsx)(R,{className:`min-w-0 p-0`,children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`})]}):r?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(q,{error:r,fallbackTitle:`Event history unavailable`})}):o?(0,Y.jsxs)(Y.Fragment,{children:[o.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,Y.jsx)(ye,{events:o.data,formatter:v,renderIdentity:e=>(0,Y.jsx)(xe,{event:e,eventsLocation:i,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:o.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:v})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(xe,{event:e,eventsLocation:i})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y?`No older events in this range.`:h===void 0?_===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${p[h].period}.`}),y?null:C]}),h!==void 0&&o.nextCursor===null&&(o.data.length>0||y)?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),C]}):null,o.data.length>0||y||o.nextCursor?(0,Y.jsx)(X,{hasPrevious:y,label:_,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:m}):null]}):null})]})}var Ce=e=>e.userId??`—`,we=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function Te({error:e,history:n,isLoading:r,onNext:i,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=C,selectedEvent:d,selectedInstallId:f}){let p=D(),m=d?we(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,Y.jsxs)(B,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,Y.jsxs)(ue,{children:[`Bundle changes and update failures are kept for`,` `,w(u.rawDays),`; the latest report, for`,` `,w(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:r,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(R,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,Y.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Ce(d)})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,Y.jsx)(F,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,Y.jsxs)(`dd`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-xs`,children:[m?(0,Y.jsx)(F,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`,pe(m,d.minBundleId)?(0,Y.jsx)(fe,{}):null]})]}),h?(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Not launched yet`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,Y.jsx)(F,{value:h})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(T,{event:d})}):null]}),(0,Y.jsx)(o,{})]}):null,f===void 0?null:r?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`})]}):e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation history unavailable`})}):n&&n.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,Y.jsx)(ye,{events:n.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:n.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})}),(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:n.data.length,pageNumber:l})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),n&&(l>1||n.nextCursor)?(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Ee=e=>e.lastKnownBundleId,De=e=>e.userId??`—`;function Oe({error:e,onNext:n,onPrevious:a,onSelect:o,pageNumber:s,results:c,selectedInstallId:l}){let[u,d]=(0,J.useState)(!1),f=(0,J.useId)(),p=(0,J.useRef)(null),m=!e&&c&&c.data.length>0;return(0,Y.jsxs)(B,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:px-6`,children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:`Matching installations`})})}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:m?(0,Y.jsx)(t,{"aria-controls":f,"aria-expanded":u,"aria-label":u?`Hide matching installations`:`Show matching installations`,className:`size-11 lg:hidden`,onClick:()=>d(!u),ref:p,size:`icon-lg`,variant:`ghost`,children:(0,Y.jsx)(P,{"aria-hidden":`true`,className:i(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(R,{className:i(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,Y.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Ee(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{"aria-label":`${De(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{o(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:De(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:ae(e.installId)})}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:ae(t)}):(0,Y.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,Y.jsx)(`a`,{className:r({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),c&&(c.data.length>0||s>1||c.nextCursor)?(0,Y.jsx)(X,{hasPrevious:s>1,label:`Installation results`,nextCursor:c.nextCursor,onNext:n,onPrevious:a,pageLength:c.data.length,pageNumber:s}):null]})]})}function ke({draftQuery:e,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,Y.jsxs)(N,{className:`gap-2`,children:[(0,Y.jsx)(j,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(le,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(se,{children:(0,Y.jsx)(ve,{"aria-hidden":`true`})}),(0,Y.jsx)(oe,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>n(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,Y.jsx)(se,{align:`inline-end`,children:(0,Y.jsx)(ce,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(c,{"aria-hidden":`true`})})}):null]}),(0,Y.jsx)(t,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function Ae(){return(0,Y.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`}),(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`})]})}var je=20,Me=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Ne(){let e=y.useSearch(),n=y.useNavigate(),r=re(),[i,a]=(0,J.useState)(e.query??``),[o]=(0,J.useState)(Z),[s]=(0,J.useState)(Z),c=_e({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,g=p||m,_=e.eventsBefore??o,v=e.eventsRange??`7d`,b=e.historyBefore??s,C=(t,r=!1,i={})=>{n({to:`/installations`,search:{...e,...t},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,J.useEffect)(()=>{a(e.query??``)},[e.query]),(0,J.useEffect)(()=>{e.eventsBefore===void 0&&C({eventsBefore:_},!0)},[_,e.eventsBefore]),(0,J.useEffect)(()=>{m&&e.historyBefore===void 0&&C({historyBefore:b},!0)},[m,b,e.historyBefore]);let T=ne({...h(v,_),cursor:e.eventsCursor,limit:20},!g),E=te({cursor:e.searchCursor,identity:f,limit:je},p);(0,J.useEffect)(()=>{let e=E.data?.data[0]?.installId;!p||m||e===void 0||C({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,E.data?.data]);let D=x(e.installId??``,m),O=S({beforeReceivedAtMs:b,cursor:e.historyCursor,installId:e.installId??``,limit:Me},m),k=D.data??E.data?.data.find(({installId:t})=>t===e.installId)??O.data?.data[0],A=g?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,j=(0,J.useRef)(null),M=ge({id:A,getKey:ee});(0,J.useLayoutEffect)(()=>{!g&&!T.isLoading&&j.current&&(j.current.scrollTop=M?.scrollY??0)},[T.isLoading,g,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,Y.jsx)(ke,{draftQuery:i,onClear:N,onDraftQueryChange:a,onSubmit:()=>{let e=i.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,Y.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,Y.jsx)(me,{view:`events`}),(0,Y.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,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[g?(0,Y.jsx)(B,{className:`shadow-sm`,children:(0,Y.jsxs)(R,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(t,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:N,variant:`ghost`,children:[(0,Y.jsx)(ie,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),P]})}):null,g?E.isLoading&&p?(0,Y.jsx)(Ae,{}):(0,Y.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,Y.jsx)(Oe,{error:E.error,onNext:()=>{E.data?.nextCursor&&C({installId:void 0,searchCursor:E.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:E.data,selectedInstallId:e.installId}):null,(0,Y.jsx)(Te,{error:O.error??D.error,history:O.data,isLoading:O.isLoading||D.isLoading,onNext:()=>{O.data?.nextCursor&&C({historyCursor:O.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:r,selectedEvent:k,selectedInstallId:e.installId})]}):(0,Y.jsx)(Se,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${w(r.rawDays)}. Launches that change nothing aren't listed.`,error:T.error,eventsLocation:{eventsBefore:_,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:T.data,isFetching:T.isFetching,isLoading:T.isLoading,onNext:()=>{T.data?.nextCursor&&C({eventsCursor:T.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:v,rawDays:r.rawDays,children:P})]})},A)]})}export{Ne as component};
|
|
1
|
+
import{$r as e,Fn as t,Hr as n,In as r,Ln as i,Nn as a,Pn as o,ar as s,ir as c,ni as l}from"./sidebar-RBvHzq8e.js";import{d as u,l as d,u as f}from"./console-features-api-BhUIxeL-.js";import{a as p,c as m,i as h,n as ee,o as g,r as _,s as v,t as y}from"./installations-LJBhFDEM.js";import{E as b,a as x,i as S,l as C,o as te,r as ne,s as re,u as w}from"./preload-helper-D9SUwQT7.js";import{a as T,n as E,o as D,r as O,t as k}from"./EventDetails-3DgVjwDn.js";import{t as ie}from"./arrow-left-BPK7iqvj.js";import{o as A}from"./empty-DtangHOp.js";import{a as j,f as M,t as N}from"./field-bPoDrs6K.js";import{o as P}from"./useCompositeListItem-BxJspDxS.js";import{c as ae,i as oe,n as se,r as ce,s as F,t as le}from"./input-group-_PD0i7wZ.js";import{t as I}from"./refresh-cw-3fSQ1FYY.js";import{a as L,n as R,o as z,r as ue,t as B}from"./card-DKr2pZMA.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./table-BYmouPt9.js";import{a as de,f as q,n as fe,r as pe,t as me}from"./InsightsPageHeader-DqCp0vf7.js";function he(){m(u(),!0)}function ge(e){return he(),v(u(),e)}function _e(e){let t=u();return f(t.stores.location,b(e,t))}var ve=s(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),J=l(e(),1),Y=n();function ye({events:e,formatter:t,renderIdentity:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,Y.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,Y.jsx)(O,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:t,touch:!0})})]}),n?.(e),(0,Y.jsxs)(`dl`,{className:`flex flex-wrap gap-x-2 gap-y-1 text-sm`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`App`}),(0,Y.jsxs)(`dd`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]})]}),(0,Y.jsxs)(`div`,{className:`min-w-0 text-muted-foreground`,children:[(0,Y.jsx)(`dt`,{className:`sr-only`,children:`Channel`}),(0,Y.jsx)(`dd`,{className:`wrap-anywhere`,children:e.channel})]})]}),(0,Y.jsx)(`div`,{className:`text-xs`,"aria-label":`Bundle`,children:(0,Y.jsx)(k,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:n,nextCursor:r,onNext:i,onPrevious:a,pageLength:o,pageNumber:s}){return(0,Y.jsxs)(`nav`,{"aria-label":`${n} pagination`,className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,s,` · `,o.toLocaleString(),` rows`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:a,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,Y.jsx)(t,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:r===null,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Next`})]})]})}var be=e=>_.filter((t,n)=>n===0||p[t].durationMs<=e*864e5);function xe({event:e,eventsLocation:t,touch:n=!1}){return(0,Y.jsxs)(`div`,{className:n?`flex min-w-0 flex-wrap items-center justify-between gap-2`:`flex min-w-0 flex-col items-start gap-2`,children:[(0,Y.jsxs)(d,{className:r({className:n?`-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm`:`-ml-2 max-w-full justify-start`,size:`sm`,variant:`ghost`}),to:`/installations`,search:{...t,query:e.installId||void 0,installId:e.installId},state:e=>({insightsPagination:{eventsBack:e.insightsPagination?.eventsBack}}),"aria-label":`View history for ${e.userId??`anonymous installation`} (${e.installId})`,children:[(0,Y.jsx)(`span`,{className:n?`min-w-0 text-left wrap-anywhere`:`truncate`,children:e.userId??`Anonymous installation`}),(0,Y.jsx)(A,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(F,{value:e.installId,maxLength:13,buttonClassName:n?`min-h-11 px-3`:void 0})]})}function Se({children:e,description:n,error:r,eventsLocation:i,history:o,isFetching:s,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:m,range:h,rawDays:ee=90,title:_=`All events`}){let v=D(),y=m>1,b=be(ee),x=h===void 0?void 0:g(h),S=x!==void 0&&b.includes(x)?x:void 0,C=S!==void 0&&d?(0,Y.jsx)(t,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(S),type:`button`,variant:`outline`,children:`Show the last ${p[S].period}`}):null;return(0,Y.jsxs)(B,{className:`@container min-w-0 shadow-sm`,"aria-busy":s,children:[(0,Y.jsxs)(L,{className:`gap-4 p-4 sm:p-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(z,{children:(0,Y.jsx)(`h2`,{children:_})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h!==void 0&&d?(0,Y.jsx)(de,{label:`Time range`,onPeriodChange:d,period:h,periods:b.map(e=>({value:e,name:`Last ${p[e].period}`}))}):null,(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,disabled:s,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,Y.jsx)(ue,{children:n}):null]}),e]}),(0,Y.jsx)(R,{className:`min-w-0 p-0`,children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`}),(0,Y.jsx)(a,{className:`h-12 w-full`})]}):r?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(q,{error:r,fallbackTitle:`Event history unavailable`})}):o?(0,Y.jsxs)(Y.Fragment,{children:[o.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,Y.jsx)(ye,{events:o.data,formatter:v,renderIdentity:e=>(0,Y.jsx)(xe,{event:e,eventsLocation:i,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:o.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:v})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(xe,{event:e,eventsLocation:i})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y?`No older events in this range.`:h===void 0?_===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${p[h].period}.`}),y?null:C]}),h!==void 0&&o.nextCursor===null&&(o.data.length>0||y)?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),C]}):null,o.data.length>0||y||o.nextCursor?(0,Y.jsx)(X,{hasPrevious:y,label:_,nextCursor:o.nextCursor,onNext:l,onPrevious:u,pageLength:o.data.length,pageNumber:m}):null]}):null})]})}var Ce=e=>e.userId??`—`,we=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function Te({error:e,history:n,isLoading:r,onNext:i,onPrevious:s,onRefresh:c,pageNumber:l,retention:u=C,selectedEvent:d,selectedInstallId:f}){let p=D(),m=d?we(d):void 0,h=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,Y.jsxs)(B,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:p-6`,children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:f===void 0?`Select an installation`:`Installation history`})}),f===void 0?null:(0,Y.jsxs)(ue,{children:[`Bundle changes and update failures are kept for`,` `,w(u.rawDays),`; the latest report, for`,` `,w(u.dailyDays),` after the installation last reports.`]})]}),c&&f!==void 0?(0,Y.jsxs)(t,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:r,children:[(0,Y.jsx)(I,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(R,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,Y.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Ce(d)})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,Y.jsx)(F,{value:f,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`})})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Last known bundle`}),(0,Y.jsxs)(`dd`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-xs`,children:[m?(0,Y.jsx)(F,{value:m,buttonClassName:`min-h-11 px-3 lg:min-h-0 lg:px-1.5`}):`—`,pe(m,d.minBundleId)?(0,Y.jsx)(fe,{}):null]})]}),h?(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Downloaded · Not launched yet`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-xs`,children:(0,Y.jsx)(F,{value:h})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(T,{event:d})}):null]}),(0,Y.jsx)(o,{})]}):null,f===void 0?null:r?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 p-6`,role:`status`,"aria-label":`Loading installation history`,children:[(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`}),(0,Y.jsx)(a,{className:`h-10 w-full`})]}):e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation history unavailable`})}):n&&n.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[48rem]:hidden`,children:(0,Y.jsx)(ye,{events:n.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(K,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(V,{children:(0,Y.jsxs)(W,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(H,{className:`w-64`,children:`Time`}),(0,Y.jsx)(H,{className:`w-48`,children:`Event`}),(0,Y.jsx)(H,{className:`w-32`,children:`App`}),(0,Y.jsx)(H,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(U,{children:n.data.map(e=>(0,Y.jsxs)(W,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(G,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(E,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(G,{children:(0,Y.jsx)(O,{event:e})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`span`,{children:[e.platform===`ios`?`iOS`:`Android`,` `,e.appVersion]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.channel})]})}),(0,Y.jsx)(G,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(k,{event:e})})]},e.id))})]})}),(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:n.data.length,pageNumber:l})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:l>1?`No older bundle changes.`:`No bundle changes recorded yet.`}),n&&(l>1||n.nextCursor)?(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:s,pageLength:0,pageNumber:l}):null]})]})]})}var Ee=e=>e.lastKnownBundleId,De=e=>e.userId??`—`;function Oe({error:e,onNext:n,onPrevious:a,onSelect:o,pageNumber:s,results:c,selectedInstallId:l}){let[u,d]=(0,J.useState)(!1),f=(0,J.useId)(),p=(0,J.useRef)(null),m=!e&&c&&c.data.length>0;return(0,Y.jsxs)(B,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(L,{className:`p-4 sm:px-6`,children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:(0,Y.jsx)(z,{className:`text-sm font-medium`,children:(0,Y.jsx)(`h2`,{children:`Matching installations`})})}),(0,Y.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:m?(0,Y.jsx)(t,{"aria-controls":f,"aria-expanded":u,"aria-label":u?`Hide matching installations`:`Show matching installations`,className:`size-11 lg:hidden`,onClick:()=>d(!u),ref:p,size:`icon-lg`,variant:`ghost`,children:(0,Y.jsx)(P,{"aria-hidden":`true`,className:i(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(R,{className:i(`min-h-0 p-0`,m&&!u&&`hidden lg:block`),id:f,children:[e?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:e instanceof Error?e:Error(),fallbackTitle:`Installation search unavailable`})}):c&&c.data.length>0?(0,Y.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:c.data.map(e=>{let t=Ee(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{"aria-label":`${De(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{o(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:De(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`sr-only`,children:`Selected`})]}):null]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap items-center gap-2`,children:(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:e.installId,children:ae(e.installId)})}),(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Bundle`}),t?(0,Y.jsx)(`span`,{className:`font-mono text-xs`,title:t,children:ae(t)}):(0,Y.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`—`})]})]})},e.installId)})}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 p-4 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No matches`}),(0,Y.jsx)(`a`,{className:r({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),c&&(c.data.length>0||s>1||c.nextCursor)?(0,Y.jsx)(X,{hasPrevious:s>1,label:`Installation results`,nextCursor:c.nextCursor,onNext:n,onPrevious:a,pageLength:c.data.length,pageNumber:s}):null]})]})}function ke({draftQuery:e,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,Y.jsxs)(N,{className:`gap-2`,children:[(0,Y.jsx)(j,{className:`sr-only`,htmlFor:`installation-history-search`,children:`User ID or installation ID`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(le,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(se,{children:(0,Y.jsx)(ve,{"aria-hidden":`true`})}),(0,Y.jsx)(oe,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>n(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,Y.jsx)(se,{align:`inline-end`,children:(0,Y.jsx)(ce,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(c,{"aria-hidden":`true`})})}):null]}),(0,Y.jsx)(t,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function Ae(){return(0,Y.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`}),(0,Y.jsx)(a,{className:`h-64 w-full lg:h-full`})]})}var je=20,Me=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Ne(){let e=y.useSearch(),n=y.useNavigate(),r=re(),[i,a]=(0,J.useState)(e.query??``),[o]=(0,J.useState)(Z),[s]=(0,J.useState)(Z),c=_e({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,g=p||m,_=e.eventsBefore??o,v=e.eventsRange??`7d`,b=e.historyBefore??s,C=(t,r=!1,i={})=>{n({to:`/installations`,search:{...e,...t},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,J.useEffect)(()=>{a(e.query??``)},[e.query]),(0,J.useEffect)(()=>{e.eventsBefore===void 0&&C({eventsBefore:_},!0)},[_,e.eventsBefore]),(0,J.useEffect)(()=>{m&&e.historyBefore===void 0&&C({historyBefore:b},!0)},[m,b,e.historyBefore]);let T=ne({...h(v,_),cursor:e.eventsCursor,limit:20},!g),E=te({cursor:e.searchCursor,identity:f,limit:je},p);(0,J.useEffect)(()=>{let e=E.data?.data[0]?.installId;!p||m||e===void 0||C({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,E.data?.data]);let D=x(e.installId??``,m),O=S({beforeReceivedAtMs:b,cursor:e.historyCursor,installId:e.installId??``,limit:Me},m),k=D.data??E.data?.data.find(({installId:t})=>t===e.installId)??O.data?.data[0],A=g?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,j=(0,J.useRef)(null),M=ge({id:A,getKey:ee});(0,J.useLayoutEffect)(()=>{!g&&!T.isLoading&&j.current&&(j.current.scrollTop=M?.scrollY??0)},[T.isLoading,g,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,Y.jsx)(ke,{draftQuery:i,onClear:N,onDraftQueryChange:a,onSubmit:()=>{let e=i.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,Y.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,Y.jsx)(me,{view:`events`}),(0,Y.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,Y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-4 sm:gap-6`,children:[g?(0,Y.jsx)(B,{className:`shadow-sm`,children:(0,Y.jsxs)(R,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(t,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:N,variant:`ghost`,children:[(0,Y.jsx)(ie,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),P]})}):null,g?E.isLoading&&p?(0,Y.jsx)(Ae,{}):(0,Y.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,Y.jsx)(Oe,{error:E.error,onNext:()=>{E.data?.nextCursor&&C({installId:void 0,searchCursor:E.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:E.data,selectedInstallId:e.installId}):null,(0,Y.jsx)(Te,{error:O.error??D.error,history:O.data,isLoading:O.isLoading||D.isLoading,onNext:()=>{O.data?.nextCursor&&C({historyCursor:O.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:r,selectedEvent:k,selectedInstallId:e.installId})]}):(0,Y.jsx)(Se,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${w(r.rawDays)}. Launches that change nothing aren't listed.`,error:T.error,eventsLocation:{eventsBefore:_,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:T.data,isFetching:T.isFetching,isLoading:T.isLoading,onNext:()=>{T.data?.nextCursor&&C({eventsCursor:T.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:v,rawDays:r.rawDays,children:P})]})},A)]})}export{Ne as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-CstW4tEL.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/installations-
|
|
2
|
-
import{r as e}from"./console-features-api-BhUIxeL-.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-CstW4tEL.js","assets/ConsoleFeatureUnavailable-BH7LLqAg.js","assets/sidebar-RBvHzq8e.js","assets/console-features-api-BhUIxeL-.js","assets/empty-DtangHOp.js","assets/NotFoundPage-CkgdpWvl.js","assets/installations-DtZj5jk2.js","assets/preload-helper-D9SUwQT7.js","assets/InsightsPageHeader-DqCp0vf7.js","assets/useCompositeListItem-BxJspDxS.js","assets/field-bPoDrs6K.js","assets/card-DKr2pZMA.js","assets/EventDetails-3DgVjwDn.js","assets/input-group-_PD0i7wZ.js","assets/dist-BzWwzt98.js","assets/arrow-left-BPK7iqvj.js","assets/refresh-cw-3fSQ1FYY.js","assets/table-BYmouPt9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./console-features-api-BhUIxeL-.js";import{C as t,t as n,w as r}from"./preload-helper-D9SUwQT7.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=r(`/installations`)({beforeLoad:({context:t})=>e(t.queryClient,`insights`),notFoundComponent:t(()=>n(()=>import(`./installations-CstW4tEL.js`),__vite__mapDeps([0,1,2,3,4,5])),`notFoundComponent`),component:t(()=>n(()=>import(`./installations-DtZj5jk2.js`),__vite__mapDeps([6,2,7,3,8,9,10,11,12,4,13,14,15,16,17])),`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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$r as e,Hr as t,Jr as n,Kr as r,Ur as i,ar as a,br as o,cr as s,lr as c,ni as l,nr as u,rr as d,vr as f,xr as p}from"./sidebar-RBvHzq8e.js";import{P as m,R as ee,b as te,d as h,h as g,l as _,u as ne,x as re}from"./console-features-api-BhUIxeL-.js";var v=`__root__`,y=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=v:this.parentRoute||r();let i=n?v:t?.path;i&&i!==`/`&&(i=te(i));let a=t?.id||i,o=n?v:g((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(a??``));i===`__root__`&&(i=`/`);let s=o===`__root__`?`/`:i===void 0?this.parentRoute.fullPath:g(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.`)}},ie=class extends y{constructor(e){super(e)}},ae=class extends f{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:s,isRefetchError:c}=r,l=n.fetchMeta?.fetchMore?.direction,u=s&&l===`forward`,d=i&&l===`forward`,f=s&&l===`backward`,m=i&&l===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:o(t,n.data),hasPreviousPage:p(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:m,isRefetchError:c&&!u&&!f,isRefetching:a&&!d&&!m}}};function oe(e,t){return c(e,ae,t)}var b=l(e(),1),x=b.use,se=b.useLayoutEffect,S=b.createContext(void 0),ce=b.createContext(void 0),C={};function w(e,t){let n=b.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ee(n.current,i):i}}function T(e){let t=h(),n=b.useContext(e.from?ce:S),i=e.from??n,a=t.stores.getMatchStore(i),o=w(e,t),s=ne(a,e=>e?o(e):C);if(s!==C)return s;(e.shouldThrow??!0)&&r()}function E(e){return T({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function D(e){let{select:t,...n}=e;return T({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function O(e){return T({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 k(e){return T({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function A(e){let t=h();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function j(e){return T({...e,select:t=>e.select?e.select(t.context):t.context})}var M=t(),N=class extends y{constructor(e){super(e),this.useMatch=e=>T({...e,from:this.id}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({...e,from:this.id}),this.useParams=e=>O({...e,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,M.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function P(e){return new N(e)}function F(){return e=>L(e)}var I=class extends ie{constructor(e){super(e),this.useMatch=e=>T({...e,from:this.id}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({...e,from:this.id}),this.useParams=e=>O({...e,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,M.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function L(e){return new I(e)}function R(e){return e=>{let t=P(e);return t.isRoot=!1,t}}function z(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(m(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(x)x(a());else throw a();return b.createElement(r,e)};return o.preload=a,o}var B=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`}]]),V=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`}]]),H={"24h":{durationMs:864e5,intervalMs:36e5},"7d":{durationMs:7*864e5,intervalMs:6*36e5},"30d":{durationMs:30*864e5,intervalMs:864e5}},U=e=>Math.ceil(e/36e5)*36e5;function W(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(H,e.window)))throw Error(`Choose a platform, channel, and time window.`);return e}var G=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),le=({patchDownloads:e,patchFallbacks:t})=>e+t===0?null:t/(e+t),ue=({failedInstallations:e,activeInstallations:t})=>t===0?null:Math.min(1,e/t),de=e=>e===null?`—`:`${(e*100).toFixed(2)}%`,fe={check:`Update check`,download:`Download`,install:`Install`},pe={network:`Network`,http:`HTTP error`,invalid_response:`Invalid response`,hash_mismatch:`Hash mismatch`,signature:`Signature`,patch:`Patch`,extract:`Extract`,storage:`Storage`},K=e=>fe[e]??`Unknown stage`,q=e=>pe[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]],me=e=>{let t=e.errorMessage||(e.reason===`unknown`?`The client did not report a detailed cause`:q(e.reason));return[`${K(e.stage)} failed: ${t}`,...J(e)].join(` · `)},he=d({method:`GET`}).middleware([u]).handler(i(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),ge=d({method:`GET`}).middleware([u]).handler(i(`b4388826a9b515fb4d2113270aa8ded1c50ba13d7f07ac2b268c41396e87d0a3`)),Y={rawDays:90,dailyDays:400},_e=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,ve=({dailyDays:e})=>e>=364;d({method:`GET`}).middleware([u]).handler(i(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var ye=d({method:`GET`}).middleware([u]).handler(i(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),be=d({method:`GET`}).middleware([u]).handler(i(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),xe=d({method:`GET`}).middleware([u]).handler(i(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),Se=d({method:`GET`}).middleware([u]).handler(i(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),Ce=d({method:`GET`}).middleware([u]).handler(i(`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]},we=(e,t)=>s({queryKey:Z.events(e),queryFn:()=>ye({data:e}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),Q=(e,t)=>s({queryKey:Z.installations(e),queryFn:()=>Ce({data:e}),enabled:t&&e.identity.length>0,staleTime:X}),Te=(e,t)=>s({queryKey:Z.installation(e),queryFn:()=>xe({data:{installId:e}}),enabled:t&&e.length>0,staleTime:X}),Ee=(e,t)=>s({queryKey:Z.installationEvents(e),queryFn:()=>be({data:e}),enabled:t&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:X}),De=(e,t=!0)=>s({queryKey:[`insights`,`update-failures`,e],queryFn:()=>he({data:W(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),Oe=()=>s({queryKey:[`insights`,`retention`],queryFn:()=>Se(),staleTime:1/0}).data??Y,ke=(e,t)=>oe({queryKey:[`insights`,`failure-reports`,e],queryFn:({pageParam:t})=>ge({data:{...e,cursor:t}}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,enabled:t,staleTime:X}),Ae=`modulepreload`,je=function(e){return`/`+e},$={},Me=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=je(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`:Ae,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{se as A,B as C,w as D,F as E,S as O,V as S,R as T,K as _,Te as a,U as b,De as c,ve as d,ue as f,q as g,G as h,Ee as i,v as j,x as k,Y as l,J as m,ke as n,Q as o,me as p,we as r,Oe as s,Me as t,_e as u,de as v,z as w,H as x,le as y};
|
|
1
|
+
import{$r as e,Hr as t,Jr as n,Kr as r,Ur as i,ar as a,br as o,cr as s,lr as c,ni as l,nr as u,rr as d,vr as f,xr as p}from"./sidebar-RBvHzq8e.js";import{P as m,R as ee,b as te,d as h,h as g,l as _,u as ne,x as re}from"./console-features-api-BhUIxeL-.js";var v=`__root__`,y=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=v:this.parentRoute||r();let i=n?v:t?.path;i&&i!==`/`&&(i=te(i));let a=t?.id||i,o=n?v:g((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(a??``));i===`__root__`&&(i=`/`);let s=o===`__root__`?`/`:i===void 0?this.parentRoute.fullPath:g(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.`)}},ie=class extends y{constructor(e){super(e)}},ae=class extends f{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:s,isRefetchError:c}=r,l=n.fetchMeta?.fetchMore?.direction,u=s&&l===`forward`,d=i&&l===`forward`,f=s&&l===`backward`,m=i&&l===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:o(t,n.data),hasPreviousPage:p(t,n.data),isFetchNextPageError:u,isFetchingNextPage:d,isFetchPreviousPageError:f,isFetchingPreviousPage:m,isRefetchError:c&&!u&&!f,isRefetching:a&&!d&&!m}}};function oe(e,t){return c(e,ae,t)}var b=l(e(),1),x=b.use,se=b.useLayoutEffect,S=b.createContext(void 0),ce=b.createContext(void 0),C={};function w(e,t){let n=b.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ee(n.current,i):i}}function T(e){let t=h(),n=b.useContext(e.from?ce:S),i=e.from??n,a=t.stores.getMatchStore(i),o=w(e,t),s=ne(a,e=>e?o(e):C);if(s!==C)return s;(e.shouldThrow??!0)&&r()}function E(e){return T({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function D(e){let{select:t,...n}=e;return T({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function O(e){return T({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 k(e){return T({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function A(e){let t=h();return b.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function j(e){return T({...e,select:t=>e.select?e.select(t.context):t.context})}var M=t(),N=class extends y{constructor(e){super(e),this.useMatch=e=>T({...e,from:this.id}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({...e,from:this.id}),this.useParams=e=>O({...e,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,M.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function P(e){return new N(e)}function F(){return e=>L(e)}var I=class extends ie{constructor(e){super(e),this.useMatch=e=>T({...e,from:this.id}),this.useRouteContext=e=>j({...e,from:this.id}),this.useSearch=e=>k({...e,from:this.id}),this.useParams=e=>O({...e,from:this.id}),this.useLoaderDeps=e=>D({...e,from:this.id}),this.useLoaderData=e=>E({...e,from:this.id}),this.useNavigate=()=>A({from:this.fullPath}),this.Link=b.forwardRef((e,t)=>(0,M.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function L(e){return new I(e)}function R(e){return e=>{let t=P(e);return t.isRoot=!1,t}}function z(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(m(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(x)x(a());else throw a();return b.createElement(r,e)};return o.preload=a,o}var B=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`}]]),V=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`}]]),H={"24h":{durationMs:864e5,intervalMs:36e5},"7d":{durationMs:7*864e5,intervalMs:6*36e5},"30d":{durationMs:30*864e5,intervalMs:864e5}},U=e=>Math.ceil(e/36e5)*36e5;function W(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(H,e.window)))throw Error(`Choose a platform, channel, and time window.`);return e}var G=({failedUpdates:e,downloads:t})=>e+t===0?null:e/(e+t),le=({failedInstallations:e,activeInstallations:t})=>t===0?null:Math.min(1,e/t),ue=e=>e===null?`—`:`${(e*100).toFixed(2)}%`,de={check:`Update check`,download:`Download`,install:`Install`},fe={network:`Network`,http:`HTTP error`,invalid_response:`Invalid response`,hash_mismatch:`Hash mismatch`,signature:`Signature`,patch:`Patch`,extract:`Extract`,storage:`Storage`,unknown:`No reason reported`},K=e=>de[e]??`Unknown stage`,q=e=>fe[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]],pe=e=>{let t=e.errorMessage||(e.reason===`unknown`?`The client did not report a detailed cause`:q(e.reason));return[`${K(e.stage)} failed: ${t}`,...J(e)].join(` · `)},me=d({method:`GET`}).middleware([u]).handler(i(`0d1dacdd1e5ee6b100e5c142fb9af03602b6f2c6fe6af79312b36c223d7f8f97`)),he=d({method:`GET`}).middleware([u]).handler(i(`b4388826a9b515fb4d2113270aa8ded1c50ba13d7f07ac2b268c41396e87d0a3`)),Y={rawDays:90,dailyDays:400},ge=e=>`${e.toLocaleString(`en`)} ${e===1?`day`:`days`}`,_e=({dailyDays:e})=>e>=364;d({method:`GET`}).middleware([u]).handler(i(`ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd`));var ve=d({method:`GET`}).middleware([u]).handler(i(`d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19`)),ye=d({method:`GET`}).middleware([u]).handler(i(`3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0`)),be=d({method:`GET`}).middleware([u]).handler(i(`6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370`)),xe=d({method:`GET`}).middleware([u]).handler(i(`c6f18db42ac40385dbff247095197ee9f3fd3a97dc914efd368ce0ded1f098c6`)),Se=d({method:`GET`}).middleware([u]).handler(i(`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]},Ce=(e,t)=>s({queryKey:Z.events(e),queryFn:()=>ve({data:e}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),we=(e,t)=>s({queryKey:Z.installations(e),queryFn:()=>Se({data:e}),enabled:t&&e.identity.length>0,staleTime:X}),Q=(e,t)=>s({queryKey:Z.installation(e),queryFn:()=>be({data:{installId:e}}),enabled:t&&e.length>0,staleTime:X}),Te=(e,t)=>s({queryKey:Z.installationEvents(e),queryFn:()=>ye({data:e}),enabled:t&&e.installId.length>0,refetchOnWindowFocus:!0,staleTime:X}),Ee=(e,t=!0)=>s({queryKey:[`insights`,`update-failures`,e],queryFn:()=>me({data:W(e)}),enabled:t,refetchOnWindowFocus:!0,staleTime:X}),De=()=>s({queryKey:[`insights`,`retention`],queryFn:()=>xe(),staleTime:1/0}).data??Y,Oe=(e,t)=>oe({queryKey:[`insights`,`failure-reports`,e],queryFn:({pageParam:t})=>he({data:{...e,cursor:t}}),initialPageParam:void 0,getNextPageParam:e=>e.nextCursor??void 0,enabled:t,staleTime:X}),ke=`modulepreload`,Ae=function(e){return`/`+e},$={},je=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=Ae(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`:ke,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{v as A,z as C,S as D,w as E,x as O,B as S,F as T,K as _,Q as a,H as b,Ee as c,_e as d,le as f,q as g,G as h,Te as i,se as k,Y as l,J as m,Oe as n,we as o,pe as p,Ce as r,De as s,je as t,ge as u,ue as v,R as w,V as x,U as y};
|