@hot-updater/console 1.2.0-rc.41 → 1.2.0-rc.43
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/ChannelPicker-Ck8vBdjI.js +1 -0
- package/.output/public/assets/{CompositeItem-B7uxFM46.js → CompositeItem-UhIlCBg4.js} +1 -1
- package/.output/public/assets/EventDetails-BGglj3Ap.js +1 -0
- package/.output/public/assets/{InsightsPageHeader-BjUAikRe.js → InsightsPageHeader-ypKKV3rL.js} +1 -1
- package/.output/public/assets/{IosInstall-B5IdjCP2.js → IosInstall-DvV3pRKv.js} +1 -1
- package/.output/public/assets/{NativeBuildsNav-BKdnlKMN.js → NativeBuildsNav-ChBahvFN.js} +1 -1
- package/.output/public/assets/api-B-1SpJeB.js +1 -0
- package/.output/public/assets/chevron-down-BkoJHAll.js +1 -0
- package/.output/public/assets/index-BHt1lVdq.js +10 -0
- package/.output/public/assets/insights-CSHfYaU4.js +2 -0
- package/.output/public/assets/insights-api-C4Dmm34n.js +1 -0
- package/.output/public/assets/{insights-fSY6n4k3.js → insights-nnyldFdS.js} +1 -1
- package/.output/public/assets/{insights-search-CZtvD-Vf.js → insights-search-CfbhmuFL.js} +1 -1
- package/.output/public/assets/{insights_.distribution-Cws8lYLC.js → insights_.distribution-7l1cAZVo.js} +1 -1
- package/.output/public/assets/insights_.distribution-CzuSRyqb.js +2 -0
- package/.output/public/assets/installations-BHWbfpbI.js +1 -0
- package/.output/public/assets/installations-DlTdbNgY.js +2 -0
- package/.output/public/assets/native-builds-DDTZlyLe.js +1 -0
- package/.output/public/assets/native-builds-DhwYkLmx.js +2 -0
- package/.output/public/assets/native-builds_._buildId-2cLz1YM1.js +2 -0
- package/.output/public/assets/native-builds_._buildId-C4ZAkDN_.js +1 -0
- package/.output/public/assets/native-builds_.devices-Bet7RN0x.js +2 -0
- package/.output/public/assets/{native-builds_.devices-DF3g--dt.js → native-builds_.devices-C0ebsrcu.js} +1 -1
- package/.output/public/assets/{remote-config-Dm1MCHDN.js → remote-config-C7grLPjp.js} +1 -1
- package/.output/public/assets/remote-config-DfUXmtPZ.js +6 -0
- package/.output/public/assets/routes-BHP1sMv1.js +1 -0
- package/.output/public/assets/routes-C047Z4F3.js +2 -0
- package/.output/public/assets/select-iSWTEY9t.js +1 -0
- package/.output/public/assets/styles-CiSUsSSk.css +2 -0
- package/.output/public/assets/{switch-CI393qIT.js → switch-ByNYRVTN.js} +1 -1
- package/.output/public/assets/{tabs-BnpNC0zf.js → tabs-Byfy8Qls.js} +1 -1
- package/.output/public/assets/useCompositeListItem-BEDqZ9Ni.js +1 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-76SKGuoc.mjs → __23tanstack-start-server-fn-resolver-Di97E0sc.mjs} +58 -58
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/_.mjs +1 -1
- package/.output/server/_ssr/{BundleIdDisplay-By3CbbRM.mjs → BundleIdDisplay-DQxYhm-N.mjs} +2 -2
- package/.output/server/_ssr/{ChannelBadge-CDup7l56.mjs → ChannelBadge-CP-TWSyB.mjs} +3 -3
- package/.output/server/_ssr/{ChannelPicker-Du2TmP3P.mjs → ChannelPicker-D6zw--W3.mjs} +4 -4
- package/.output/server/_ssr/{ConsoleFeatureUnavailable-C6aGoKDE.mjs → ConsoleFeatureUnavailable-Dl-Fl5Og.mjs} +6 -6
- package/.output/server/_ssr/{EventDetails-VbcnMnSs.mjs → EventDetails-DZRx0V4a.mjs} +6 -6
- package/.output/server/_ssr/{HashValueDisplay-CnC2fHER.mjs → HashValueDisplay-DScPLPS8.mjs} +2 -2
- package/.output/server/_ssr/{InsightsPageHeader-BuOanVZL.mjs → InsightsPageHeader-BjWFQX3i.mjs} +6 -6
- package/.output/server/_ssr/{IosInstall-BAFhW7Q9.mjs → IosInstall-CnKo3S9u.mjs} +7 -7
- package/.output/server/_ssr/{NativeBuildsNav-BoTu4aLF.mjs → NativeBuildsNav-hD5lklyI.mjs} +8 -7
- package/.output/server/_ssr/{NotFoundPage-Bz05xF5Q.mjs → NotFoundPage-DCAZbQLF.mjs} +2 -2
- package/.output/server/_ssr/{QrCode-DWshAW81.mjs → QrCode-CIAfd6iz.mjs} +2 -2
- package/.output/server/_ssr/{RelativeTime-D5kDQVn1.mjs → RelativeTime-BojzYLmu.mjs} +3 -3
- package/.output/server/_ssr/{RolloutPercentageBadge-Dwx7dEeQ.mjs → RolloutPercentageBadge-CoVlujKZ.mjs} +3 -3
- package/.output/server/_ssr/{RowReason-pVOWQ7t5.mjs → RowReason-B5lUGbHE.mjs} +4 -4
- package/.output/server/_ssr/{SandboxBadge-DFbUYwhO.mjs → SandboxBadge-eRsQxh3w.mjs} +2 -2
- package/.output/server/_ssr/{TargetDisplay-BtE5vntq.mjs → TargetDisplay-C-954ehl.mjs} +3 -3
- package/.output/server/_ssr/{alert-dialog-tcfkkNUX.mjs → alert-dialog-CucltJGZ.mjs} +1 -1
- package/.output/server/_ssr/{api-xOHZxbzu.mjs → api-Bvs1Zo6y.mjs} +3 -3
- package/.output/server/_ssr/{api-keys-Bm8uDp2u.mjs → api-keys-4ygc-JJ2.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-12_U0SQM.mjs → api-keys-BuHPiQWI.mjs} +9 -9
- package/.output/server/_ssr/{api-keys-rpc-BxkfToWI.mjs → api-keys-rpc-Dnksoen-.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-TSnLWB7e.mjs → api-rpc-CINk1JMA.mjs} +12 -12
- package/.output/server/_ssr/{auth-rpc-D3w54vsW.mjs → auth-rpc-Ddr5UMAl.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-a2eP6q5P.mjs → auth.server-Dre0Opn4.mjs} +102 -13
- package/.output/server/_ssr/{badge-DrfbN1n0.mjs → badge-Bi4Y5qRl.mjs} +1 -1
- package/.output/server/_ssr/{card-DEItjgKG.mjs → card-ByVzQmTy.mjs} +1 -1
- package/.output/server/_ssr/{config.server-K8dd4dRv.mjs → config.server-CWANXCvN.mjs} +3 -3
- package/.output/server/_ssr/{console-access-D-DHU4YH.mjs → console-access-DuVVXB19.mjs} +2 -2
- package/.output/server/_ssr/{console-features-api-Chy2PrzZ.mjs → console-features-api-qCbOD3ic.mjs} +5 -5
- package/.output/server/_ssr/{console-features-rpc-_31L0k1i.mjs → console-features-rpc-Ck6GST8b.mjs} +3 -3
- package/.output/server/_ssr/{dialog-SAl1vP74.mjs → dialog-DPodcY6g.mjs} +1 -1
- package/.output/server/_ssr/{empty-opJc9Fjw.mjs → empty-CiP4EN5d.mjs} +2 -2
- package/.output/server/_ssr/{field-D6Y7zDZd.mjs → field-PGo_pDtX.mjs} +2 -2
- package/.output/server/_ssr/{input-group-D2PvPRdm.mjs → input-group-BQoPYzEQ.mjs} +1 -1
- package/.output/server/_ssr/{insights-dWeLneo1.mjs → insights-BilJke9p.mjs} +20 -20
- package/.output/server/_ssr/{insights-vmCmvfXx.mjs → insights-EdozMYaS.mjs} +5 -5
- package/.output/server/_ssr/{insights-api-BPyvQert.mjs → insights-api-CRUlsyoh.mjs} +3 -3
- package/.output/server/_ssr/{insights-failures-rpc-D7M8-Et9.mjs → insights-failures-rpc-QISgmlSm.mjs} +4 -4
- package/.output/server/_ssr/{insights-recovery-rpc-BUMK4m4H.mjs → insights-recovery-rpc-D3asO-kT.mjs} +3 -3
- package/.output/server/_ssr/{insights-rpc-BZZ4U2Ll.mjs → insights-rpc-DVnKi1LU.mjs} +3 -3
- package/.output/server/_ssr/{insights-search-Czi553oN.mjs → insights-search-DTl9VUKf.mjs} +2 -2
- package/.output/server/_ssr/{insights-Cro4cYp7.mjs → insights-sooz-phW.mjs} +2 -2
- package/.output/server/_ssr/{insights-usage-rpc-HOr6mniz.mjs → insights-usage-rpc-DUskJzrq.mjs} +3 -3
- package/.output/server/_ssr/{insights-usage-rpc-BXvUr-z6.mjs → insights-usage-rpc-xX-9B1du.mjs} +3 -3
- package/.output/server/_ssr/{insights_.distribution-B2dxcCd_.mjs → insights_.distribution-BTlq0Jaq.mjs} +2 -2
- package/.output/server/_ssr/{insights_.distribution-B5V_NbK4.mjs → insights_.distribution-BvaiJBnX.mjs} +14 -14
- package/.output/server/_ssr/{insights_.distribution-DongF2jp.mjs → insights_.distribution-m7AkU8fV.mjs} +5 -5
- package/.output/server/_ssr/{installations-bieZA3xt.mjs → installations-Bx8kA-Ke.mjs} +11 -11
- package/.output/server/_ssr/{installations-B7w4LGJp.mjs → installations-CggqUqQz.mjs} +4 -4
- package/.output/server/_ssr/{installations-B84kSetd.mjs → installations-DOgCyxdC.mjs} +2 -2
- package/.output/server/_ssr/{ios-devices-rpc-DOQg4dpb.mjs → ios-devices-rpc-uewwfpWZ.mjs} +7 -7
- package/.output/server/_ssr/{iosDeviceCookie-DhWNFpC6.mjs → iosDeviceCookie-CLc4wP05.mjs} +3 -3
- package/.output/server/_ssr/{iosDeviceProfile-jC8w4zEF.mjs → iosDeviceProfile-BilG5zM5.mjs} +2 -2
- package/.output/server/_ssr/{iosDevices-B4kQLURA.mjs → iosDevices-Cc0qE1gW.mjs} +2 -2
- package/.output/server/_ssr/{native-builds-zpCsEYyA.mjs → native-builds-Bp7j5uXS.mjs} +2 -2
- package/.output/server/_ssr/{native-builds-BU9Njiwm.mjs → native-builds-C-vxNqdJ.mjs} +14 -14
- package/.output/server/_ssr/{native-builds_._buildId-RHUotAYb.mjs → native-builds_._buildId-9bx3_XQ2.mjs} +60 -26
- package/.output/server/_ssr/{native-builds_._buildId-BJ4R32fq.mjs → native-builds_._buildId-BORxwOTj.mjs} +2 -2
- package/.output/server/_ssr/{native-builds_.devices-C0IlQkLv.mjs → native-builds_.devices-C9WscI5E.mjs} +2 -2
- package/.output/server/_ssr/{native-builds_.devices-D1Ke-Fc-.mjs → native-builds_.devices-CUafAj_X.mjs} +16 -16
- package/.output/server/_ssr/{nativeBuildDownloadLink-MCd5xUqP.mjs → nativeBuildDownloadLink-DJNy6tr6.mjs} +2 -2
- package/.output/server/_ssr/{nativeBuildInstall-DcsqDS-O.mjs → nativeBuildInstall-bJHsfQpY.mjs} +4 -4
- package/.output/server/_ssr/{nativeBuilds-CRa36wNn.mjs → nativeBuilds-S1_ZcH6M.mjs} +8 -5
- package/.output/server/_ssr/{release-adoption-rpc-C4G_d8qK.mjs → release-adoption-rpc-BmzvBFQR.mjs} +5 -5
- package/.output/server/_ssr/{remote-config-1QZ0HgEu.mjs → remote-config-C8gMUot7.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-CsbpqWAR.mjs → remote-config-CZNuR1MR.mjs} +18 -18
- package/.output/server/_ssr/{remote-config-DkgBxBka.mjs → remote-config-CyOkNk-G.mjs} +2 -2
- package/.output/server/_ssr/{remote-config-rpc-KjJA9DC-.mjs → remote-config-rpc-DRtGMy4r.mjs} +3 -3
- package/.output/server/_ssr/{router-Dy3fmb8q.mjs → router-C-4VNx1_.mjs} +35 -35
- package/.output/server/_ssr/{routes-68rZQGee.mjs → routes-8xr_pKpa.mjs} +23 -23
- package/.output/server/_ssr/{routes-Ug9uqzob.mjs → routes-Bsx6TIVQ.mjs} +10 -10
- package/.output/server/_ssr/{schema-migration-rpc-kntY9oPm.mjs → schema-migration-rpc-Blg-OnSu.mjs} +3 -3
- package/.output/server/_ssr/{select-BOKFFr_G.mjs → select-CBTbx_SM.mjs} +1 -1
- package/.output/server/_ssr/{server-DetMvRBJ.mjs → server-C9cse1Jz.mjs} +3 -3
- package/.output/server/_ssr/{sidebar-B46houn0.mjs → sidebar-C7hMYecb.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/{switch-BMYzd71j.mjs → switch-CnKohTF2.mjs} +2 -2
- package/.output/server/_ssr/{table-DWrYwJ_a.mjs → table-Bsc5jVIe.mjs} +1 -1
- package/.output/server/_ssr/{tabs-DusHAcYy.mjs → tabs-BXTMWLJg.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-CD1q5k0m.mjs → _tanstack-start-manifest_v-Dm__dcXw.mjs} +40 -39
- package/.output/server/index.mjs +237 -237
- package/package.json +7 -7
- package/src/components/features/native-builds/InstallCard.tsx +64 -4
- package/src/components/features/native-builds/NativeBuildDetailPage.tsx +6 -3
- package/src/components/features/native-builds/NativeBuildsNav.tsx +4 -3
- package/src/lib/server/nativeBuilds.ts +14 -2
- package/.output/public/assets/ChannelPicker-BQKoyxnf.js +0 -1
- package/.output/public/assets/EventDetails-CWiI1CXb.js +0 -1
- package/.output/public/assets/api-eO-sq3Jd.js +0 -1
- package/.output/public/assets/index-Ck4fZq4M.js +0 -10
- package/.output/public/assets/insights-api-D4-FZeEI.js +0 -1
- package/.output/public/assets/insights-osTmFzzR.js +0 -2
- package/.output/public/assets/insights_.distribution-DpppHhaU.js +0 -2
- package/.output/public/assets/installations-Byojb0Rv.js +0 -2
- package/.output/public/assets/installations-CFGDrY-W.js +0 -1
- package/.output/public/assets/native-builds-C4u6JvxV.js +0 -2
- package/.output/public/assets/native-builds-D9hoJd6W.js +0 -1
- package/.output/public/assets/native-builds_._buildId-CXx2xjoI.js +0 -1
- package/.output/public/assets/native-builds_._buildId-DymsEZlO.js +0 -2
- package/.output/public/assets/native-builds_.devices-QToUV8FB.js +0 -2
- package/.output/public/assets/preload-helper-CE9OukVC.js +0 -1
- package/.output/public/assets/remote-config-BJJAxy_g.js +0 -6
- package/.output/public/assets/routes-9gxYg__u.js +0 -1
- package/.output/public/assets/routes-CUsayL0T.js +0 -2
- package/.output/public/assets/select-Bk52fOVX.js +0 -1
- package/.output/public/assets/styles-C1iqL6CR.css +0 -2
- package/.output/public/assets/useCompositeListItem-Cbk_weKW.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/installations-CcPrSZwW.js","assets/ConsoleFeatureUnavailable-B3VCINom.js","assets/sidebar-BmzmPGuv.js","assets/console-features-api-CtbGqKyr.js","assets/arrow-up-right-C_1ALUCD.js","assets/NotFoundPage-BEpesHEm.js","assets/link-CRMwpc7-.js","assets/empty-C5GqArX9.js","assets/installations-CFGDrY-W.js","assets/preload-helper-CE9OukVC.js","assets/useCompositeListItem-Cbk_weKW.js","assets/EventDetails-CWiI1CXb.js","assets/insights-api-D4-FZeEI.js","assets/check-C3VCvMOV.js","assets/copy-BjVLMKbo.js","assets/download-CgpaZb23.js","assets/dist-BEmib-ZM.js","assets/rotate-ccw-tITIe0Bd.js","assets/smartphone-Dy13ukaU.js","assets/badge-zMibJGR5.js","assets/HashValueDisplay-DvwvQchI.js","assets/InsightsPageHeader-BjUAikRe.js","assets/tabs-BnpNC0zf.js","assets/list-DQ9YBIDW.js","assets/arrow-left-68S4uy4I.js","assets/search-BfEqtE64.js","assets/card-BAs80yql.js","assets/field-DInLQ5oV.js","assets/input-group-CIjTdxCW.js","assets/table-DbZPkzdz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,r as t,t as n}from"./preload-helper-CE9OukVC.js";import{r}from"./console-features-api-CtbGqKyr.js";var i=864e5,a={"24h":{period:`24 hours`,durationMs:i},"7d":{period:`7 days`,durationMs:7*i},"30d":{period:`30 days`,durationMs:30*i},"90d":{period:`90 days`,durationMs:90*i}},o=Object.keys(a),s=e=>o[o.indexOf(e)+1],c=(e,t)=>({beforeReceivedAtMs:t,sinceMs:Math.max(0,t-a[e].durationMs)}),l=e=>typeof e==`string`&&e.length>0?e:void 0,u=e=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=0?e:void 0,d=e=>o.find(t=>t===e);function f(e){let t=p(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 p(e){return{query:typeof e.query==`string`?e.query:void 0,installId:typeof e.installId==`string`?e.installId:void 0,eventsCursor:l(e.eventsCursor),eventsBefore:u(e.eventsBefore),eventsRange:d(e.eventsRange),searchCursor:l(e.searchCursor),historyCursor:l(e.historyCursor),historyBefore:u(e.historyBefore)}}var m=e(`/installations`)({beforeLoad:({context:e})=>r(e.queryClient,`insights`),notFoundComponent:t(()=>n(()=>import(`./installations-CcPrSZwW.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:t(()=>n(()=>import(`./installations-CFGDrY-W.js`),__vite__mapDeps([8,2,9,6,10,11,12,13,14,15,16,17,18,19,20,21,22,3,23,7,24,4,25,26,27,28,29])),`component`),staticData:{scrollRestorationKey:f},validateSearch:p});export{a,c as i,f as n,s as o,o as r,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Br as t,Di as n,Ri as r,Vi as i,_r as a,et as o,gr as s,vr as c}from"./sidebar-BmzmPGuv.js";import{h as l,i as u,m as d,t as f}from"./link-CRMwpc7-.js";import{c as p,s as m}from"./preload-helper-CE9OukVC.js";import{a as h,n as g,o as _,r as v,t as y}from"./EventDetails-CWiI1CXb.js";import{t as b}from"./arrow-left-68S4uy4I.js";import{t as x}from"./arrow-up-right-C_1ALUCD.js";import{a as S,c as C,i as w,l as T,n as E,o as ee,r as te}from"./insights-api-D4-FZeEI.js";import{t as D}from"./check-C3VCvMOV.js";import{a as O}from"./useCompositeListItem-Cbk_weKW.js";import{r as k}from"./dist-BEmib-ZM.js";import{t as A}from"./search-BfEqtE64.js";import{a as j,n as M,o as N,r as P,t as F}from"./card-BAs80yql.js";import{a as I,t as ne}from"./field-DInLQ5oV.js";import{a as L,i as re,n as ie,o as ae,r as oe,t as se}from"./installations-Byojb0Rv.js";import{i as ce,n as R,r as le,t as ue}from"./input-group-CIjTdxCW.js";import{a as z,i as B,n as V,o as H,r as U,t as W}from"./table-DbZPkzdz.js";import{n as G,t as K}from"./HashValueDisplay-DvwvQchI.js";import{a as de,c as q,n as fe,r as pe,t as me}from"./InsightsPageHeader-BjUAikRe.js";function he(){l(u(),!0)}function ge(e){return he(),d(u(),e)}function _e(e){let t=u();return p(t.stores.location,m(e,t))}var J=i(r(),1),Y=n();function ve({events:e,formatter:t,renderIdentity:n}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`px-4 pb-2 text-xs text-muted-foreground sm:px-6`,children:`Time in your browser zone`}),(0,Y.jsx)(`ol`,{"aria-label":`Events`,className:`divide-y border-y`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-1`,children:[(0,Y.jsx)(v,{event:e}),(0,Y.jsx)(`div`,{className:`text-xs tabular-nums`,children:(0,Y.jsx)(g,{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)(y,{event:e,touch:!0})})]},e.id))})]})}function X({hasPrevious:e,label:t,nextCursor:n,onNext:r,onPrevious:i,pageLength:a,pageNumber:o}){return(0,Y.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,Y.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[`Page `,o,` · `,a.toLocaleString(),` rows`]}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(s,{className:`h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2`,disabled:!e,onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Previous`}),(0,Y.jsx)(s,{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 ye=e=>oe.filter((t,n)=>n===0||L[t].durationMs<=e*864e5);function be({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)(f,{className:a({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)(x,{"aria-hidden":`true`,"data-icon":`inline-end`})]}),(0,Y.jsx)(K,{value:e.installId,maxLength:13,buttonClassName:n?`min-h-11 px-3`:void 0})]})}function xe({children:t,description:n,error:r,eventsLocation:i,history:a,isFetching:o,isLoading:c,onNext:l,onPrevious:u,onRangeChange:d,onRefresh:f,pageNumber:p,range:m,rawDays:h=90,title:b=`All events`}){let x=_(),S=p>1,C=ye(h),w=m===void 0?void 0:ae(m),T=w!==void 0&&C.includes(w)?w:void 0,E=T!==void 0&&d?(0,Y.jsx)(s,{className:`h-11 px-3 lg:h-8`,onClick:()=>d(T),type:`button`,variant:`outline`,children:`Show the last ${L[T].period}`}):null;return(0,Y.jsxs)(F,{className:`@container min-w-0 shadow-sm`,"aria-busy":o,children:[(0,Y.jsxs)(j,{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)(N,{children:(0,Y.jsx)(`h2`,{children:b})}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[m!==void 0&&d?(0,Y.jsx)(de,{label:`Time range`,onPeriodChange:d,period:m,periods:C.map(e=>({value:e,name:`Last ${L[e].period}`}))}):null,(0,Y.jsxs)(s,{className:`h-11 lg:h-8`,disabled:o,onClick:f,size:`lg`,variant:`outline`,children:[(0,Y.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]})]})]}),n?(0,Y.jsx)(P,{children:n}):null]}),t]}),(0,Y.jsx)(M,{className:`min-w-0 p-0`,children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,role:`status`,"aria-label":`Loading events`,children:[(0,Y.jsx)(e,{className:`h-12 w-full`}),(0,Y.jsx)(e,{className:`h-12 w-full`}),(0,Y.jsx)(e,{className:`h-12 w-full`})]}):r?(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(q,{error:r,fallbackTitle:`Event history unavailable`})}):a?(0,Y.jsxs)(Y.Fragment,{children:[a.data.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`@[58rem]:hidden`,children:(0,Y.jsx)(ve,{events:a.data,formatter:x,renderIdentity:e=>(0,Y.jsx)(be,{event:e,eventsLocation:i,touch:!0})})}),(0,Y.jsx)(`div`,{className:`hidden @[58rem]:block`,children:(0,Y.jsxs)(W,{className:`min-w-4xl table-fixed`,children:[(0,Y.jsx)(z,{children:(0,Y.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(B,{className:`w-64`,children:`Time`}),(0,Y.jsx)(B,{className:`w-48`,children:`Event`}),(0,Y.jsx)(B,{className:`w-48`,children:`User / installation`}),(0,Y.jsx)(B,{className:`w-32`,children:`App`}),(0,Y.jsx)(B,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(V,{children:a.data.map(e=>(0,Y.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(g,{value:e.receivedAtMs,formatter:x})}),(0,Y.jsx)(U,{children:(0,Y.jsx)(v,{event:e})}),(0,Y.jsx)(U,{children:(0,Y.jsx)(be,{event:e,eventsLocation:i})}),(0,Y.jsx)(U,{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)(U,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(y,{event:e})})]},e.id))})]})})]}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S?`No older events in this range.`:m===void 0?b===`All events`?`No events recorded yet`:`No matching reports in this period`:`No events in the last ${L[m].period}.`}),S?null:E]}),m!==void 0&&a.nextCursor===null&&(a.data.length>0||S)?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start of range reached`}),E]}):null,a.data.length>0||S||a.nextCursor?(0,Y.jsx)(X,{hasPrevious:S,label:b,nextCursor:a.nextCursor,onNext:l,onPrevious:u,pageLength:a.data.length,pageNumber:p}):null]}):null})]})}var Se=e=>e.userId??`—`,Ce=e=>`lastKnownBundleId`in e?e.lastKnownBundleId:e.type===`UPDATE_DOWNLOADED`||e.type===`UPDATE_FAILED`?e.fromBundleId:e.toBundleId;function we({error:t,history:n,isLoading:r,onNext:i,onPrevious:a,onRefresh:c,pageNumber:l,retention:u=C,selectedEvent:d,selectedInstallId:f}){let p=_(),m=d?Ce(d):void 0,b=d&&`pendingBundleId`in d?d.pendingBundleId:d&&`type`in d&&d.type===`UPDATE_DOWNLOADED`?d.toBundleId:null;return(0,Y.jsxs)(F,{className:`@container min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(j,{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)(N,{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)(P,{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,Y.jsxs)(s,{className:`h-11 lg:h-8`,size:`lg`,variant:`outline`,onClick:c,disabled:r,children:[(0,Y.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Refresh`]}):null]})}),(0,Y.jsxs)(M,{className:`min-h-0 p-0`,children:[f!==void 0&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{"aria-labelledby":`latest-installation-state`,className:`px-4 pb-4 sm:px-6 sm:pb-6`,children:[(0,Y.jsx)(`h3`,{className:`sr-only`,id:`latest-installation-state`,children:`Latest reported state`}),(0,Y.jsxs)(`dl`,{className:`grid grid-cols-2 gap-4 @[36rem]:grid-cols-3`,children:[(0,Y.jsxs)(`div`,{className:`col-span-2 min-w-0 @[36rem]:col-span-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`User ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 text-sm font-medium wrap-anywhere`,children:Se(d)})]}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Install ID`}),(0,Y.jsx)(`dd`,{className:`mt-1 font-mono text-xs`,children:(0,Y.jsx)(K,{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)(K,{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]})]}),b?(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)(K,{value:b})})]}):null]}),d.httpResponse?(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(h,{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)(e,{className:`h-10 w-full`}),(0,Y.jsx)(e,{className:`h-10 w-full`}),(0,Y.jsx)(e,{className:`h-10 w-full`})]}):t?(0,Y.jsx)(`div`,{className:`p-6`,children:(0,Y.jsx)(q,{error:t instanceof Error?t: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)(ve,{events:n.data,formatter:p})}),(0,Y.jsx)(`div`,{className:`hidden @[48rem]:block`,children:(0,Y.jsxs)(W,{className:`min-w-3xl table-fixed`,children:[(0,Y.jsx)(z,{children:(0,Y.jsxs)(H,{className:`[&>th]:px-4 sm:[&>th]:px-6`,children:[(0,Y.jsx)(B,{className:`w-64`,children:`Time`}),(0,Y.jsx)(B,{className:`w-48`,children:`Event`}),(0,Y.jsx)(B,{className:`w-32`,children:`App`}),(0,Y.jsx)(B,{className:`w-52`,children:`Bundle`})]})}),(0,Y.jsx)(V,{children:n.data.map(e=>(0,Y.jsxs)(H,{className:`[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6`,children:[(0,Y.jsx)(U,{className:`whitespace-normal text-xs tabular-nums`,children:(0,Y.jsx)(g,{value:e.receivedAtMs,formatter:p})}),(0,Y.jsx)(U,{children:(0,Y.jsx)(v,{event:e})}),(0,Y.jsx)(U,{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)(U,{className:`whitespace-normal text-xs`,children:(0,Y.jsx)(y,{event:e})})]},e.id))})]})}),(0,Y.jsx)(X,{hasPrevious:l>1,label:`Installation history`,nextCursor:n.nextCursor,onNext:i,onPrevious:a,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:a,pageLength:0,pageNumber:l}):null]})]})]})}var Te=e=>e.lastKnownBundleId,Ee=e=>e.userId??`—`;function De({error:e,onNext:t,onPrevious:n,onSelect:r,pageNumber:i,results:o,selectedInstallId:l}){let[u,d]=(0,J.useState)(!1),f=(0,J.useId)(),p=(0,J.useRef)(null),m=!e&&o&&o.data.length>0;return(0,Y.jsxs)(F,{className:`min-h-0 min-w-0 shadow-sm`,children:[(0,Y.jsx)(j,{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)(N,{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)(s,{"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)(O,{"aria-hidden":`true`,className:c(u&&`rotate-180`)})}):null})]})}),(0,Y.jsxs)(M,{className:c(`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`})}):o&&o.data.length>0?(0,Y.jsx)(`ul`,{"aria-label":`Matching installations`,className:`divide-y`,children:o.data.map(e=>{let t=Te(e),n=e.installId===l;return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(`button`,{"aria-label":`${Ee(e)}, install ID ${e.installId}`,"aria-pressed":n,className:`group flex w-full min-w-0 flex-col gap-2 border-l-2 border-transparent px-4 py-4 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:bg-muted/40 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30 aria-pressed:border-primary aria-pressed:bg-muted/60 motion-reduce:transition-none sm:px-6`,onClick:()=>{r(e.installId),d(!1),p.current?.focus()},type:`button`,children:[(0,Y.jsxs)(`span`,{className:`flex w-full min-w-0 items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:Ee(e)}),n?(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs font-medium text-primary`,children:[(0,Y.jsx)(D,{"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:G(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:G(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:a({variant:`outline`,className:`h-11 px-3 lg:h-8`}),href:`#installation-history-search`,children:`Edit search`})]}),o&&(o.data.length>0||i>1||o.nextCursor)?(0,Y.jsx)(X,{hasPrevious:i>1,label:`Installation results`,nextCursor:o.nextCursor,onNext:t,onPrevious:n,pageLength:o.data.length,pageNumber:i}):null]})]})}function Oe({draftQuery:e,onDraftQueryChange:n,onSubmit:r,onClear:i}){return(0,Y.jsx)(`form`,{"aria-label":`Find installation`,onSubmit:t=>{t.preventDefault(),e.trim()&&r()},role:`search`,children:(0,Y.jsxs)(ne,{className:`gap-2`,children:[(0,Y.jsx)(I,{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)(ue,{className:`h-11 w-auto min-w-0 flex-1 basis-44 lg:h-8`,children:[(0,Y.jsx)(R,{children:(0,Y.jsx)(A,{"aria-hidden":`true`})}),(0,Y.jsx)(ce,{autoComplete:`off`,className:`h-11 text-base md:text-base lg:h-8 lg:text-xs`,id:`installation-history-search`,maxLength:1024,name:`installation`,onChange:e=>n(e.target.value),placeholder:`User ID or installation ID`,spellCheck:!1,type:`search`,value:e}),e.length>0?(0,Y.jsx)(R,{align:`inline-end`,children:(0,Y.jsx)(le,{"aria-label":`Clear installation lookup`,className:`size-11 lg:size-5`,onClick:i,size:`icon-xs`,children:(0,Y.jsx)(t,{"aria-hidden":`true`})})}):null]}),(0,Y.jsx)(s,{"aria-label":`Find installation`,className:`h-11 px-3 lg:h-8`,disabled:e.trim().length===0,size:`lg`,type:`submit`,variant:`outline`,children:`Find`})]})]})})}function ke(){return(0,Y.jsxs)(`div`,{className:`grid items-stretch gap-6 lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`,children:[(0,Y.jsx)(e,{className:`h-64 w-full lg:h-full`}),(0,Y.jsx)(e,{className:`h-64 w-full lg:h-full`})]})}var Ae=20,je=50,Z=()=>Date.now(),Q=(e,t)=>[...e,t??``],$=e=>({cursor:e?.at(-1)||void 0,stack:e.slice(0,-1)});function Me(){let e=se.useSearch(),t=se.useNavigate(),n=ee(),[r,i]=(0,J.useState)(e.query??``),[a]=(0,J.useState)(Z),[o]=(0,J.useState)(Z),c=_e({select:e=>e.state.insightsPagination}),l=c?.eventsBack??[],u=c?.searchBack??[],d=c?.historyBack??[],f=e.query?.trim()??``,p=f.length>0,m=e.installId!==void 0,h=p||m,g=e.eventsBefore??a,_=e.eventsRange??`7d`,v=e.historyBefore??o,y=(n,r=!1,i={})=>{t({to:`/installations`,search:{...e,...n},state:e=>({...e,insightsPagination:{...e.insightsPagination,...i}}),replace:r})};(0,J.useEffect)(()=>{i(e.query??``)},[e.query]),(0,J.useEffect)(()=>{e.eventsBefore===void 0&&y({eventsBefore:g},!0)},[g,e.eventsBefore]),(0,J.useEffect)(()=>{m&&e.historyBefore===void 0&&y({historyBefore:v},!0)},[m,v,e.historyBefore]);let x=E({...re(_,g),cursor:e.eventsCursor,limit:20},!h),C=S({cursor:e.searchCursor,identity:f,limit:Ae},p);(0,J.useEffect)(()=>{let e=C.data?.data[0]?.installId;!p||m||e===void 0||y({historyBefore:Z(),historyCursor:void 0,installId:e},!0,{historyBack:[]})},[p,m,C.data?.data]);let D=w(e.installId??``,m),O=te({beforeReceivedAtMs:v,cursor:e.historyCursor,installId:e.installId??``,limit:je},m),k=D.data??C.data?.data.find(({installId:t})=>t===e.installId)??O.data?.data[0],A=h?`installation-history-${e.historyCursor??`first`}`:`all-events-${e.eventsCursor??`first`}`,j=(0,J.useRef)(null),N=ge({id:A,getKey:ie});(0,J.useLayoutEffect)(()=>{!h&&!x.isLoading&&j.current&&(j.current.scrollTop=N?.scrollY??0)},[x.isLoading,h,N?.scrollY,A]);let P=()=>{i(``),y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:void 0,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})},I=(0,Y.jsx)(Oe,{draftQuery:r,onClear:P,onDraftQueryChange:i,onSubmit:()=>{let e=r.trim();if(!e){P();return}y({historyBefore:void 0,historyCursor:void 0,installId:void 0,query:e,searchCursor:void 0},!1,{historyBack:[],searchBack:[]})}});return(0,Y.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,Y.jsx)(me,{view:`events`}),(0,Y.jsx)(`div`,{ref: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:[h?(0,Y.jsx)(F,{className:`shadow-sm`,children:(0,Y.jsxs)(M,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,Y.jsxs)(s,{className:`-ml-2 h-11 self-start lg:h-8`,onClick:P,variant:`ghost`,children:[(0,Y.jsx)(b,{"aria-hidden":`true`,"data-icon":`inline-start`}),`Back to all events`]}),I]})}):null,h?C.isLoading&&p?(0,Y.jsx)(ke,{}):(0,Y.jsxs)(`div`,{className:`grid min-h-0 min-w-0 items-stretch gap-4 sm:gap-6 ${p?`lg:min-h-96 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)]`:`lg:grid-cols-1`}`,children:[p?(0,Y.jsx)(De,{error:C.error,onNext:()=>{C.data?.nextCursor&&y({installId:void 0,searchCursor:C.data.nextCursor},!0,{searchBack:Q(u,e.searchCursor)})},onPrevious:()=>{let e=$(u);y({installId:void 0,searchCursor:e.cursor},!0,{searchBack:e.stack})},onSelect:e=>{y({historyBefore:Z(),historyCursor:void 0,installId:e},!1,{historyBack:[]})},pageNumber:u.length+1,results:C.data,selectedInstallId:e.installId}):null,(0,Y.jsx)(we,{error:O.error??D.error,history:O.data,isLoading:O.isLoading||D.isLoading,onNext:()=>{O.data?.nextCursor&&y({historyCursor:O.data.nextCursor},!0,{historyBack:Q(d,e.historyCursor)})},onPrevious:()=>{let e=$(d);y({historyCursor:e.cursor},!0,{historyBack:e.stack})},onRefresh:()=>{y({historyBefore:Z(),historyCursor:void 0},!0,{historyBack:[]})},pageNumber:d.length+1,retention:n,selectedEvent:k,selectedInstallId:e.installId})]}):(0,Y.jsx)(xe,{description:`Downloads, launches, crashes, update failures, and other changes to what an installation runs, newest first, kept for ${T(n.rawDays)}. Launches that change nothing aren't listed.`,error:x.error,eventsLocation:{eventsBefore:g,eventsCursor:e.eventsCursor,eventsRange:e.eventsRange},history:x.data,isFetching:x.isFetching,isLoading:x.isLoading,onNext:()=>{x.data?.nextCursor&&y({eventsCursor:x.data.nextCursor},!0,{eventsBack:Q(l,e.eventsCursor)})},onPrevious:()=>{let e=$(l);y({eventsCursor:e.cursor},!0,{eventsBack:e.stack})},onRangeChange:e=>{y({eventsBefore:Z(),eventsCursor:void 0,eventsRange:e},!1,{eventsBack:[]})},onRefresh:()=>{y({eventsBefore:Z(),eventsCursor:void 0},!0,{eventsBack:[]})},pageNumber:l.length+1,range:_,rawDays:n.rawDays,children:I})]})},A)]})}export{Me as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds-D9hoJd6W.js","assets/sidebar-BmzmPGuv.js","assets/preload-helper-CE9OukVC.js","assets/link-CRMwpc7-.js","assets/ChannelPicker-BQKoyxnf.js","assets/useAnchoredPopupScrollLock-Cvx6CdPD.js","assets/useCompositeListItem-Cbk_weKW.js","assets/check-C3VCvMOV.js","assets/dist-BEmib-ZM.js","assets/input-group-CIjTdxCW.js","assets/api-eO-sq3Jd.js","assets/useMutation-D7IuoOLE.js","assets/constants-C5gi7fdZ.js","assets/arrow-up-right-C_1ALUCD.js","assets/TargetDisplay-DG_I3qln.js","assets/copy-BjVLMKbo.js","assets/key-round-BkeLvA1m.js","assets/native-builds-zwqucwx2.js","assets/HashValueDisplay-DvwvQchI.js","assets/-native-builds-search-BFcW2mlI.js","assets/history-Ci4dhphE.js","assets/badge-zMibJGR5.js","assets/ChannelBadge-BgVCJfJs.js","assets/RelativeTime-5ZP9WlQ6.js","assets/relativeTime-RUNbaMyO.js","assets/chevron-right-RAuPv9r1.js","assets/table-DbZPkzdz.js","assets/RowReason-CXMCJ-Jc.js","assets/PlatformIcon-D4KPXCHL.js","assets/NativeBuildsNav-BKdnlKMN.js","assets/tabs-BnpNC0zf.js","assets/SandboxBadge-PM92jCk6.js","assets/dialog-BvZDZzdQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,r as t,t as n}from"./preload-helper-CE9OukVC.js";import{i as r}from"./-native-builds-search-BFcW2mlI.js";var i=e(`/native-builds`)({component:t(()=>n(()=>import(`./native-builds-D9hoJd6W.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])),`component`),validateSearch:r});export{i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Di as e,Vr as t,_r as n,gr as r,h as i,p as a}from"./sidebar-BmzmPGuv.js";import{t as o}from"./link-CRMwpc7-.js";import{o as s}from"./preload-helper-CE9OukVC.js";import{t as c}from"./arrow-up-right-C_1ALUCD.js";import{i as l,n as u,r as d,t as f}from"./TargetDisplay-DG_I3qln.js";import{o as p,t as ee}from"./-native-builds-search-BFcW2mlI.js";import{t as m}from"./history-Ci4dhphE.js";import{C as h,d as g,g as _,h as v,x as te}from"./native-builds-zwqucwx2.js";import{r as y}from"./dist-BEmib-ZM.js";import{a as b,i as x,n as S,o as C,r as w,t as ne}from"./badge-zMibJGR5.js";import{r as re}from"./constants-C5gi7fdZ.js";import{g as T,i as ie,p as ae}from"./api-eO-sq3Jd.js";import{t as E}from"./native-builds-C4u6JvxV.js";import{n as oe,t as se}from"./PlatformIcon-D4KPXCHL.js";import{a as ce,n as le,o as ue,r as de,s as fe,t as pe}from"./dialog-BvZDZzdQ.js";import{i as D,r as O}from"./table-DbZPkzdz.js";import{t as me}from"./ChannelBadge-BgVCJfJs.js";import{t as he}from"./ChannelPicker-BQKoyxnf.js";import{a as ge,c as _e,d as ve,f as ye,i as be,l as xe,n as Se,o as k,p as A,r as j,s as M,t as N,u as Ce}from"./RelativeTime-5ZP9WlQ6.js";import{a as P,c as we,i as F,l as Te,n as Ee,o as De,r as Oe,s as ke,t as Ae}from"./RowReason-CXMCJ-Jc.js";import{t as je}from"./NativeBuildsNav-BKdnlKMN.js";import{i as Me,n as Ne,r as I,t as L}from"./SandboxBadge-PM92jCk6.js";var Pe=t(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),R=e(),z=`npx hot-updater native-build import <file>`,B=`https://hot-updater.dev/docs/guides/native-build#import-a-build-made-elsewhere`;function Fe(){return(0,R.jsxs)(pe,{children:[(0,R.jsxs)(fe,{render:(0,R.jsx)(r,{"aria-label":`Import a build`,className:`min-h-11 min-w-11 sm:min-h-7 sm:min-w-0`,size:`sm`,variant:`outline`}),children:[(0,R.jsx)(Pe,{"data-icon":`inline-start`}),(0,R.jsx)(`span`,{className:`hidden sm:inline`,children:`Import a build`})]}),(0,R.jsxs)(le,{className:`sm:max-w-lg`,children:[(0,R.jsxs)(ce,{children:[(0,R.jsx)(ue,{children:`Import a build`}),(0,R.jsx)(de,{children:`Track an .ipa, .aab, .apk or .app built elsewhere as a patch base.`})]}),(0,R.jsx)(l,{label:`the import command`,value:z,wrap:!0}),(0,R.jsxs)(`a`,{className:n({className:`min-h-11 w-full sm:min-h-8 sm:w-fit`,variant:`outline`}),href:B,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,R.jsx)(c,{"data-icon":`inline-end`})]})]})]})}var Ie={"app-store":`App Store`,"ad-hoc":`ad hoc`,development:`development`,enterprise:`enterprise`},V=e=>{let t=v[e.artifact_kind].label,n=e.submitted_to===null?e.artifact_kind===`ipa`&&e.export_method!==null?`${Ie[e.export_method]} ${t}`:t:`${Me[e.submitted_to]} build`;return e.is_sandbox?`sandbox ${n}`:n},Le=e=>{if(e===void 0)return{sentence:`A newer build on its channel reaches people the same way.`,label:`Older: a newer build on its channel reaches people the same way`};let t=te(e);return{sentence:`A newer ${V(e)} exists${t===null?`.`:`: ${t}`}`,label:`Older: a newer ${V(e)} exists${t===null?``:`, ${t}`}`}};function H({newer:e}){let t=Le(e);return(0,R.jsx)(Ae,{icon:m,label:t.label,reason:t.sentence,children:`Older`})}var Re=`https://hot-updater.dev/docs/guides/native-build#how-a-build-is-tracked`,U=9,W=e=>e===void 0?{channels:`all`}:{channel:e},ze={one:`older build`,other:`older builds`};function Be({channel:e,paged:t,folded:i,onClearChannel:a}){return t||i?(0,R.jsx)(M,{icon:p,title:i?`Each build here has a newer one`:`No more native builds`,children:(0,R.jsx)(o,{className:n({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:W(e),to:`/native-builds`,children:`Show the newest builds`})}):e===void 0?(0,R.jsxs)(M,{icon:p,title:`No native builds`,children:[(0,R.jsxs)(`p`,{children:[`Build one with`,` `,(0,R.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build android`}),` or`,` `,(0,R.jsx)(`code`,{className:`font-mono text-xs`,children:`native-build ios`}),`, or import one built elsewhere:`]}),(0,R.jsx)(`div`,{className:`w-full text-left`,children:(0,R.jsx)(l,{label:`the import command`,value:z,wrap:!0})}),(0,R.jsxs)(`a`,{className:n({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),href:Re,rel:`noreferrer`,target:`_blank`,children:[`Native build guide`,(0,R.jsx)(c,{"data-icon":`inline-end`})]}),(0,R.jsxs)(`a`,{className:n({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:B,rel:`noreferrer`,target:`_blank`,children:[`Import guide`,(0,R.jsx)(c,{"data-icon":`inline-end`})]})]}):(0,R.jsxs)(M,{icon:p,title:(0,R.jsxs)(R.Fragment,{children:[`No native build embeds `,(0,R.jsx)(`span`,{translate:`no`,children:e})]}),children:[(0,R.jsx)(`p`,{children:`A build embeds the channel it was built on. Build one on this channel, or list every channel's builds.`}),(0,R.jsx)(r,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:a,variant:`outline`,children:`Show all channels`})]})}var G=e=>`${h(e.platform)} ${v[e.artifact_kind].label}`;function K({build:e}){return(0,R.jsx)(o,{"aria-label":G(e),className:`relative rounded-sm font-medium whitespace-nowrap text-foreground transition-colors underline-offset-4 after:absolute after:-inset-x-[10px] after:-inset-y-[10px] hover:text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:after:hidden`,params:{buildId:e.id},to:`/native-builds/$buildId`,children:v[e.artifact_kind].label})}function q({build:e,inTable:t=!1,older:n=!1,newer:r}){return t?(0,R.jsxs)(`span`,{className:`flex max-w-24 flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,R.jsx)(K,{build:e}),(0,R.jsx)(L,{build:e}),n?(0,R.jsx)(H,{newer:r}):null]}):(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,R.jsx)(K,{build:e}),(0,R.jsx)(L,{build:e})]})}function J({channel:e,onChannel:t}){return(0,R.jsx)(`button`,{"aria-label":`Show the builds that embed ${e}`,className:`relative flex max-w-full min-w-0 rounded-md text-left after:absolute after:-inset-x-1 after:-inset-y-[11px] focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:after:hidden`,onClick:()=>t(e),title:e,type:`button`,children:(0,R.jsx)(me,{channel:e,className:`block max-w-32 truncate`})})}function Ve({build:e}){return!I(e)&&!e.is_store_build?(0,R.jsx)(u,{}):(0,R.jsx)(Y,{build:e,className:`flex flex-col items-start gap-1`})}function Y({build:e,className:t}){return(0,R.jsxs)(`span`,{className:t,children:[(0,R.jsx)(Ne,{build:e}),e.is_store_build?(0,R.jsx)(ne,{className:`px-1.5`,variant:`muted`,children:`Store build`}):null]})}function X({build:e}){return e.build_number?(0,R.jsx)(`span`,{className:`font-mono tabular-nums`,translate:`no`,children:e.build_number}):(0,R.jsx)(u,{})}var Z=e=>re(e.id);function Q({build:e,older:t=!1,newer:n,onChannel:r}){let i=s(),a=_(e);return(0,R.jsxs)(ve,{"aria-label":`Open native build ${e.id}`,className:`data-[older=true]:bg-muted/60 data-[older=true]:saturate-50 data-[older=true]:hover:bg-muted/60 data-[older=true]:hover:saturate-100 data-[older=true]:focus-within:saturate-100`,"data-older":t?!0:void 0,onOpen:()=>void i({to:`/native-builds/$buildId`,params:{buildId:e.id}}),children:[(0,R.jsx)(O,{children:(0,R.jsx)(q,{build:e,inTable:!0,newer:n,older:t})}),(0,R.jsx)(O,{children:(0,R.jsx)(J,{channel:a,onChannel:r})}),(0,R.jsx)(O,{className:`whitespace-nowrap`,children:(0,R.jsx)(oe,{platform:e.platform})}),(0,R.jsx)(O,{children:(0,R.jsx)(X,{build:e})}),(0,R.jsx)(O,{children:(0,R.jsx)(d,{appVersion:e.app_version,fingerprintHash:e.fingerprint_hash,nativeAppVersion:e.native_app_version})}),(0,R.jsx)(O,{children:(0,R.jsx)(f,{value:e.build_key})}),(0,R.jsx)(O,{children:(0,R.jsx)(Ve,{build:e})}),(0,R.jsx)(O,{className:`whitespace-nowrap text-muted-foreground tabular-nums`,children:g(e.byte_size)}),(0,R.jsx)(O,{className:`text-xs text-muted-foreground`,children:(0,R.jsx)(N,{ms:Z(e)})})]})}function $({build:e,older:t=!1,newer:n,onChannel:r}){let i=s(),a=_(e),o=I(e)||e.is_store_build;return(0,R.jsxs)(Se,{"aria-label":`Native build ${G(e)} ${e.id}`,className:`gap-3 border-b-0 data-[older=true]:bg-muted/60 data-[older=true]:saturate-50 data-[older=true]:hover:bg-muted/60 data-[older=true]:hover:saturate-100 data-[older=true]:focus-within:saturate-100`,"data-older":t?!0:void 0,onClick:A(()=>void i({to:`/native-builds/$buildId`,params:{buildId:e.id}})),children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-x-2.5`,children:[(0,R.jsx)(se,{className:`size-4 shrink-0 text-muted-foreground`,platform:e.platform}),(0,R.jsx)(q,{build:e}),t?(0,R.jsx)(H,{newer:n}):null]}),(0,R.jsx)(`div`,{className:`flex min-w-0`,children:(0,R.jsx)(J,{channel:a,onChannel:r})}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:h(e.platform)}),e.build_number?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{translate:`no`,children:[`Build`,` `,(0,R.jsx)(`span`,{className:`font-mono tabular-nums text-foreground`,children:e.build_number})]}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`·`})]}):null,(0,R.jsx)(`span`,{className:`tabular-nums`,children:g(e.byte_size)}),(0,R.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,R.jsx)(N,{ms:Z(e)})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-4 gap-y-6 text-xs`,children:[(0,R.jsxs)(`span`,{className:`flex items-center`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`Target `}),(0,R.jsx)(d,{appVersion:e.app_version,fingerprintHash:e.fingerprint_hash,nativeAppVersion:e.native_app_version})]}),e.build_key?(0,R.jsxs)(`span`,{className:`flex items-center`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`Build key `}),(0,R.jsx)(f,{value:e.build_key})]}):null]}),o?(0,R.jsx)(Y,{build:e,className:`flex flex-wrap items-center gap-1.5`}):null]})}function He({fold:e,channel:t,isMobile:n,open:r,onOpenChange:i,onChannel:a}){let o=ae(t,{...e.from===void 0?{}:{from:e.from},to:e.to},r),s=o.data?.pages??[],c=Object.assign({},...s.map(e=>e.newer)),l=s.flatMap(e=>e.rows),u=n?void 0:U,d=o.isError?(0,R.jsx)(F,{columns:u,label:`Older builds`,onRetry:()=>void o.refetch(),state:`error`}):o.isPending||o.isFetchingNextPage?(0,R.jsx)(F,{columns:u,label:`Loading older builds`,state:`loading`}):o.hasNextPage?(0,R.jsx)(F,{columns:u,label:`Older builds`,onMore:()=>void o.fetchNextPage(),state:`more`}):null,f={label:De(e,ze),open:r,onOpenChange:i,panelId:`native-build-fold-${e.to}`};return n?(0,R.jsxs)(Ee,{...f,inList:!0,children:[l.map(e=>(0,R.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,R.jsx)($,{build:e,newer:c[e.id],older:!0,onChannel:a})},e.id)),d]}):(0,R.jsxs)(Oe,{...f,columns:U,children:[l.map(e=>(0,R.jsx)(Q,{build:e,newer:c[e.id],older:!0,onChannel:a},e.id)),d]})}function Ue({builds:e,channel:t,paged:n,onChannel:a}){let o=i(),s=Te(),c=e.data?.entries,{next:l,previous:u}=e.data??{},d=c?.filter(({kind:e})=>e===`row`).length??0;if(e.isError)return(0,R.jsxs)(S,{variant:`destructive`,children:[(0,R.jsx)(C,{}),(0,R.jsx)(b,{children:`Native builds couldn't be loaded`}),(0,R.jsx)(x,{children:`Check your connection and try again.`}),(0,R.jsx)(w,{children:(0,R.jsxs)(r,{onClick:()=>void e.refetch(),size:`xs`,variant:`outline`,children:[(0,R.jsx)(y,{"data-icon":`inline-start`}),`Retry`]})})]});let f=(0,R.jsx)(Be,{channel:t,folded:(c?.length??0)>0,onClearChannel:()=>a(void 0),paged:n}),p=e=>(0,R.jsx)(He,{channel:t,fold:e,isMobile:o,onChannel:a,onOpenChange:t=>s.set(P(e),t),open:s.isOpen(P(e))},`fold-${e.to}`);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(_e,{children:o?(0,R.jsx)(`div`,{"aria-busy":e.isPlaceholderData,"aria-label":`Native builds`,className:`h-full overflow-y-auto aria-busy:opacity-60`,role:`list`,children:e.isPending?(0,R.jsx)(j,{label:`Loading native builds`}):(0,R.jsxs)(R.Fragment,{children:[d===0?(0,R.jsx)(be,{children:f}):null,c?.map(e=>e.kind===`fold`?p(e):(0,R.jsx)(`div`,{className:`border-b last:border-b-0`,role:`listitem`,children:(0,R.jsx)($,{build:e.row,onChannel:a})},e.row.id))]})}):(0,R.jsx)(ge,{"aria-busy":e.isPlaceholderData,"aria-label":`Native builds`,className:`aria-busy:opacity-60 [&_td]:px-1.5 [&_th]:px-1.5`,header:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D,{children:`Artifact`}),(0,R.jsx)(D,{children:`Channel`}),(0,R.jsx)(D,{children:`Platform`}),(0,R.jsx)(D,{children:`Build`}),(0,R.jsx)(D,{children:`Target`}),(0,R.jsx)(D,{children:`Build key`}),(0,R.jsx)(D,{children:`Store`}),(0,R.jsx)(D,{children:`Size`}),(0,R.jsx)(D,{children:`Created`})]}),rowGroups:!0,children:e.isPending?(0,R.jsx)(k,{children:(0,R.jsx)(ye,{columns:U,label:`Loading native builds`})}):(0,R.jsxs)(R.Fragment,{children:[d===0?(0,R.jsx)(k,{children:(0,R.jsx)(xe,{columns:U,children:f})}):null,we(c??[]).map(e=>e.kind===`fold`?p(e.fold):(0,R.jsx)(k,{children:e.rows.map(e=>(0,R.jsx)(Q,{build:e,onChannel:a},e.id))},`rows-${e.rows[0].id}`))]})})}),e.isPending||c===void 0?null:(0,R.jsx)(Ce,{count:d,folded:{...ke(c),label:`older`},label:`Native build pages`,noun:[`build`,`builds`],pending:e.isPlaceholderData,newest:n?{search:W(t),to:`/native-builds`}:void 0,next:l===void 0?void 0:{search:{...W(t),before:l},to:`/native-builds`},previous:u===void 0?void 0:{search:{...W(t),...u},to:`/native-builds`}})]})}var We={data:void 0,isError:!1,isPending:!0,isPlaceholderData:!1,refetch:()=>void 0};function Ge({search:e,onSearchChange:t}){let n=ie(),i=n.data?.map(({name:e})=>e)??[],o=ee(e,n.data&&i),s=o===void 0,c=s&&n.isError,{channel:l,before:u,after:d}=o??e,f=T(o??{},{enabled:!s}),m=s?We:f,h=e=>t(e===void 0?{channels:`all`}:{channel:e});return(0,R.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,R.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b bg-background px-3 py-3 sm:min-h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,R.jsx)(a,{className:`-ml-1 size-11 lg:size-7`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(p,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,R.jsx)(`h1`,{className:`text-sm font-medium`,children:`Native builds`})]}),(0,R.jsx)(`p`,{className:`basis-full pl-12 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`Store and test builds, each the built-in bundle its OTAs patch from.`})]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4 bg-muted/5 p-3 sm:p-6`,children:[(0,R.jsx)(je,{current:`builds`}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(he,{allChannels:!0,className:`max-sm:min-w-0 max-sm:basis-full`,onValueChange:h,pending:s,value:l}),(0,R.jsx)(`div`,{className:`ml-auto`,children:(0,R.jsx)(Fe,{})}),(0,R.jsx)(r,{"aria-label":`Refresh native builds`,className:`size-11 sm:size-7`,disabled:m.isPending,onClick:()=>void m.refetch(),size:`icon-sm`,variant:`ghost`,children:(0,R.jsx)(y,{"aria-hidden":`true`})})]}),c?(0,R.jsxs)(S,{variant:`destructive`,children:[(0,R.jsx)(C,{}),(0,R.jsx)(b,{children:`Channels couldn't be loaded`}),(0,R.jsx)(x,{children:`Native builds show once the channels load.`}),(0,R.jsx)(w,{children:(0,R.jsxs)(r,{className:`min-h-11 sm:min-h-7`,onClick:()=>void n.refetch(),size:`xs`,variant:`outline`,children:[(0,R.jsx)(y,{"data-icon":`inline-start`}),`Retry`]})})]}):(0,R.jsx)(Ue,{builds:m,channel:l,onChannel:h,paged:u!==void 0||d!==void 0})]})]})}function Ke(){let e=E.useSearch(),t=E.useNavigate();return(0,R.jsx)(Ge,{onSearchChange:e=>void t({search:e}),search:e})}export{Ke as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,Di as t,Ri as n,Vi as r,Vr as i,_r as a,gr as o,p as s}from"./sidebar-BmzmPGuv.js";import{t as c}from"./link-CRMwpc7-.js";import{t as l}from"./arrow-up-right-C_1ALUCD.js";import{a as u,i as d,n as f,r as p,t as ee}from"./TargetDisplay-DG_I3qln.js";import{t as m}from"./chevron-right-RAuPv9r1.js";import{n as te,t as h}from"./native-builds_._buildId-DymsEZlO.js";import{t as ne}from"./download-CgpaZb23.js";import{t as re}from"./git-branch-BGatQV8Q.js";import{o as ie}from"./-native-builds-search-BFcW2mlI.js";import{t as ae}from"./history-Ci4dhphE.js";import{C as g,D as _,S as oe,_ as v,d as y,h as b,m as se,s as x,v as S,x as ce,y as C}from"./native-builds-zwqucwx2.js";import{n as w,r as T}from"./dist-BEmib-ZM.js";import{t as le}from"./smartphone-Dy13ukaU.js";import{a as E,i as D,n as O,o as k,r as ue,t as A}from"./badge-zMibJGR5.js";import{a as j,n as M,o as N,t as P}from"./card-BAs80yql.js";import{a as de}from"./constants-C5gi7fdZ.js";import{n as fe}from"./relativeTime-RUNbaMyO.js";import{a as pe,d as me,f as he,h as ge,l as _e,u as ve}from"./api-eO-sq3Jd.js";import{a as ye,m as be,n as xe}from"./IosInstall-B5IdjCP2.js";import{a as F,i as I,n as L,o as R,r as z,t as B}from"./empty-C5GqArX9.js";import{t as Se}from"./PlatformIcon-D4KPXCHL.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./table-DbZPkzdz.js";import{t as Ce}from"./BundleIdDisplay-C0X-k49t.js";import{t as we}from"./ChannelBadge-BgVCJfJs.js";import{n as Te,r as q,t as Ee}from"./RolloutPercentageBadge-DCtG7c1o.js";import{n as De,r as J,t as Oe}from"./SandboxBadge-PM92jCk6.js";import{t as Y}from"./QrCode-BFSCkbPj.js";var ke=i(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),Ae=i(`package-open`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),X=t();function Z({value:e,length:t,shown:n=e.slice(0,t),label:r}){let i=async()=>{try{await navigator.clipboard.writeText(e),w.success(`Copied to clipboard`,{description:e})}catch{w.error(`Could not copy the ${r}`)}};return(0,X.jsx)(`button`,{"aria-label":`Copy the ${r} ${e}`,className:`relative cursor-copy rounded-sm font-mono after:absolute after:-inset-x-2 after:-inset-y-4 sm:after:hidden text-xs whitespace-nowrap tabular-nums underline-offset-4 hover:underline focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,onClick:e=>{e.stopPropagation(),i()},title:e,translate:`no`,type:`button`,children:n})}function je({hash:e}){let t=pe();if(e===null)return(0,X.jsx)(f,{});let n=Te(t.data?.console.gitUrl,e);return n===null?(0,X.jsx)(Z,{label:`commit`,length:7,value:e}):(0,X.jsx)(`a`,{className:`relative font-mono text-xs whitespace-nowrap underline-offset-4 after:absolute after:-inset-x-2 after:-inset-y-4 hover:underline sm:after:hidden`,href:n,onClick:e=>e.stopPropagation(),rel:`noreferrer`,target:`_blank`,title:e,translate:`no`,children:e.slice(0,7)})}function Q({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[10rem_minmax(0,1fr)] sm:gap-4`,children:[(0,X.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}function Me({detail:e}){let{build:t}=e,n=_e();if(t.is_sandbox)return null;let r=!t.is_store_build;return(0,X.jsx)(o,{className:`min-h-11 shrink-0 sm:min-h-8`,disabled:n.isPending,onClick:()=>n.mutate({id:t.id,storeBuild:r},{onSuccess:()=>{w.success(r?`Marked as the store build`:`Mark cleared`)},onError:e=>{w.error(`Could not change the mark`,{description:e.message})}}),size:`sm`,type:`button`,variant:`outline`,children:r?`Mark as store build`:`Clear mark`})}function Ne({detail:e}){let{build:t,newestInScope:n,storeBuildInScope:r}=e;if(t.is_sandbox)return(0,X.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border bg-muted/40 p-3 text-xs`,children:[(0,X.jsx)(ke,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`No patch base.`}),` `,x]})]});let i=r??n;if(i===null)return null;let a=i.id===t.id;return(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-md border bg-muted/40 p-3 text-xs sm:flex-row sm:items-center sm:justify-between`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,X.jsx)(a?te:ae,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),r?.id===t.id?(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Store build.`}),` New deploys to this scope patch from this build.`]}):a?(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Current baseline.`}),` The newest build, and no store build is marked. New deploys to this scope patch from this build.`]}):(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{className:`font-medium`,children:`Not the base.`}),` New deploys patch from`,` `,(0,X.jsxs)(c,{className:`inline-flex items-center gap-0.5 font-medium underline underline-offset-4`,params:{buildId:i.id},to:`/native-builds/$buildId`,children:[ce(i)??(0,X.jsxs)(X.Fragment,{children:[g(i.platform),` `,b[i.artifact_kind].label,` ·`,` `,(0,X.jsx)(q,{uuid:i.id})]}),(0,X.jsx)(l,{"aria-hidden":`true`,className:`size-3`})]}),`, so this one gets no new patches.`]})]}),(0,X.jsx)(Me,{detail:e})]})}function Pe({detail:e}){let{build:t,builtInBundle:n,channel:r}=e,i=n?.childCount??0;return(0,X.jsxs)(P,{className:`overflow-hidden shadow-sm`,children:[(0,X.jsx)(j,{className:`border-b px-4 py-3`,children:(0,X.jsx)(N,{className:`text-sm`,children:(0,X.jsx)(`h2`,{children:`Built-in bundle`})})}),(0,X.jsxs)(M,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,X.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(Q,{label:`Bundle ID`,children:(0,X.jsx)(Ce,{bundleId:t.min_bundle_id})}),(0,X.jsx)(Q,{label:`OTAs patching from it`,children:(0,X.jsx)(`span`,{className:`tabular-nums`,children:i===1?`1 bundle`:`${i} bundles`})}),(0,X.jsx)(Q,{label:`Scope`,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,X.jsx)(c,{"aria-label":`Show the builds that embed ${r}`,className:`relative rounded-md after:absolute after:-inset-x-1 after:-inset-y-[11px] sm:after:hidden`,search:{channel:r},to:`/native-builds`,children:(0,X.jsx)(we,{channel:r})}),(0,X.jsx)(`span`,{className:`text-xs`,children:g(t.platform)})]})}),(0,X.jsx)(Q,{label:`Target`,children:(0,X.jsx)(`span`,{className:`text-xs`,children:(0,X.jsx)(p,{appVersion:t.app_version,fingerprintHash:t.fingerprint_hash,nativeAppVersion:t.native_app_version})})}),(0,X.jsx)(Q,{label:`Build key`,children:(0,X.jsx)(`span`,{className:`text-xs`,children:(0,X.jsx)(ee,{value:t.build_key})})}),t.build_number?(0,X.jsx)(Q,{label:`Build`,children:(0,X.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,translate:`no`,children:t.build_number})}):null,(0,X.jsx)(Q,{label:`Commit`,children:(0,X.jsx)(je,{hash:t.git_commit_hash})}),(0,X.jsx)(Q,{label:`Created`,children:(0,X.jsx)(q,{format:`both`,uuid:t.id})})]}),(0,X.jsx)(Ne,{detail:e}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.is_sandbox?`An install of this build runs this bundle until it opens an OTA.`:`A store or test install of this build runs this bundle until its first OTA. That OTA downloads as a patch from this bundle when one exists, and as the full bundle otherwise.`})]})]})}var Fe=r(fe(),1),$=r(n(),1),Ie=`The .ipa installs only on devices its signing profile allows (development or ad hoc)`,Le=e=>{switch(e.artifact_kind){case`ipa`:return e.is_sandbox?`${Ie}.`:`${Ie}; an App Store export reaches testers through TestFlight.`;case`aab`:return`The .aab installs through Google Play or bundletool, not from the file.`;default:return}},Re=e=>{switch(e.artifact_kind){case`apk`:return`Scan with an Android phone's camera, then open the APK to install it.`;case`app`:return`Scan to download the .app.zip on a Mac.`;default:return`Scan to download. ${Le(e)}`}};function ze(){let{origin:e,pathname:t}=window.location;return(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,X.jsx)(Y,{className:`size-48`,label:`Open this page on an iPhone`,value:`${e}${t}`}),(0,X.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:`Scan with an iPhone to install this build from here. The phone signs in to the Console first.`})]})}function Be({build:e,url:t,note:n}){return(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,X.jsx)(Y,{className:`size-48`,label:`Download ${S(e)}`,value:t}),(0,X.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:Re(e)}),n?(0,X.jsx)(`p`,{className:`max-w-56 text-center text-xs text-muted-foreground`,children:n}):null]})}function Ve({message:e}){return(0,X.jsxs)(O,{variant:`destructive`,children:[(0,X.jsx)(k,{}),(0,X.jsx)(E,{children:`The download link couldn't be created`}),(0,X.jsx)(D,{children:e})]})}function He({build:t}){let n=he(t.id),r=n.data?.url;if(r===null){let e=Le(t);return(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{children:`This storage gives no download link a phone can open without signing in, so there is no QR code. Download the build here, or open this page on the phone signed in to the console.`}),e?(0,X.jsx)(`p`,{children:e}):null]})}return r===void 0?n.isError?(0,X.jsx)(Ve,{message:n.error.message}):(0,X.jsx)(e,{className:`size-48`}):(0,X.jsx)(Be,{build:t,note:`This link expires. If the download fails, reload this page.`,url:r})}function Ue({build:e,href:t}){return(0,X.jsxs)(`a`,{className:a({className:`h-auto min-h-11 w-full min-w-0 py-2 whitespace-normal sm:min-h-8 sm:w-fit`,variant:e.artifact_kind===`ipa`?`ghost`:`outline`}),download:!0,href:t,children:[(0,X.jsx)(ne,{"data-icon":`inline-start`}),(0,X.jsxs)(`span`,{className:`text-left [overflow-wrap:anywhere]`,children:[`Download `,S(e)]})]})}function We({build:e}){return(0,X.jsxs)(P,{className:`overflow-hidden shadow-sm`,children:[(0,X.jsx)(j,{className:`border-b px-4 py-3`,children:(0,X.jsx)(N,{className:`text-sm`,children:(0,X.jsx)(`h2`,{children:`Install`})})}),(0,X.jsxs)(M,{className:`flex min-w-0 flex-col gap-4 p-4 sm:p-6`,children:[(0,X.jsx)(De,{build:e,withTime:!0}),(0,X.jsx)(Ge,{build:e}),(0,X.jsx)(Ue,{build:e,href:v(e.id)})]})]})}function Ge({build:e}){switch(e.artifact_kind){case`apk`:return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your browser needs the "Install unknown apps" permission.`}),e.is_sandbox?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Its .sandbox ID installs it beside a Play copy.`}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`If this package is already installed with another signing key, such as a Play copy, the install fails. Uninstall that copy first, or build with sandbox: true, whose .sandbox ID installs beside it.`}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`On an emulator or a phone over USB, install and open it from your project:`}),(0,X.jsx)(d,{label:`the install command`,value:C(e)})]});case`app`:return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`It runs only in the iOS Simulator. In your project, install and open it on the booted one:`}),(0,X.jsx)(d,{label:`the install command`,value:C(e)})]});case`aab`:return J(e)?(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.submitted_to===`play-production`?`Users`:`Testers`,` get it once its release is rolled out; on an app Play Console hasn't published, the release is a draft you roll out in Play Console.`]}):(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`For testers, build and release to internal testing:`}),(0,X.jsx)(d,{label:`the Google Play command`,value:`npx hot-updater google-play upload`})]});case`ipa`:return J(e)?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Internal testers install it from the TestFlight app once App Store Connect has processed it.`}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Over USB, Xcode or Apple Configurator installs it.`})}}function Ke({link:e,url:t}){return e?.status===`no-secret`?(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:[`Set `,e.secretName,` on the Console to create links.`]}):e?.status!==`issued`||t===null?null:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,X.jsx)(d,{label:`the download link`,value:t}),(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Anyone with this link can download this build until`,` `,(0,X.jsxs)(`span`,{className:`whitespace-nowrap`,children:[(0,Fe.default)(e.expiresAt).format(`YYYY-MM-DD`),`.`]})]})]})}function qe({build:e}){return J(e)&&(e.artifact_kind===`ipa`||e.artifact_kind===`aab`)?(0,X.jsx)(We,{build:e}):(0,X.jsx)(Ye,{build:e})}function Je({children:e}){let[t,n]=(0,$.useState)(!1),r=(0,$.useId)();return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 border-t pt-3`,children:[(0,X.jsxs)(`button`,{"aria-controls":r,"aria-expanded":t,className:`group/other -mx-1 flex min-h-11 items-center gap-1.5 self-start rounded-md px-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none motion-reduce:transition-none sm:min-h-8`,onClick:()=>n(e=>!e),type:`button`,children:[(0,X.jsx)(m,{"aria-hidden":`true`,className:`size-3.5 shrink-0 transition-transform group-aria-expanded/other:rotate-90 motion-reduce:transition-none`}),`Other ways to install`]}),(0,X.jsx)(`div`,{hidden:!t,id:r,children:e})]})}function Ye({build:t}){let n=me(t.id),r=n.data?.status===`issued`?oe(window.location,t.id,n.data.token):null,i=ye(),a=t.artifact_kind===`ipa`,o=a&&i?.ios===!0,s=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,X.jsx)(Ge,{build:t}),(0,X.jsx)(Ue,{build:t,href:r??v(t.id)}),(0,X.jsx)(Ke,{link:n.data,url:r})]});return(0,X.jsxs)(P,{className:`overflow-hidden shadow-sm`,children:[(0,X.jsx)(j,{className:`border-b px-4 py-3`,children:(0,X.jsx)(N,{className:`text-sm`,children:(0,X.jsx)(`h2`,{children:`Install`})})}),o?(0,X.jsxs)(M,{className:`flex min-w-0 flex-col gap-4 p-4 sm:p-6`,children:[(0,X.jsx)(xe,{build:t,device:i}),(0,X.jsx)(Je,{children:s})]}):(0,X.jsxs)(M,{className:`grid gap-6 p-4 sm:grid-cols-[12rem_minmax(0,1fr)] sm:p-6`,children:[a&&r!==null?(0,X.jsx)(ze,{}):r===null?n.data===void 0?n.isError?(0,X.jsx)(Ve,{message:n.error.message}):(0,X.jsx)(e,{className:`size-48`}):(0,X.jsx)(He,{build:t}):(0,X.jsx)(Be,{build:t,url:r}),s]})]})}function Xe({build:t}){let n=be(t.id),r=n.data;if(r?.status===`store`||r?.status===`enterprise`)return null;let i=r?.status===`listed`?r.devices:null;return(0,X.jsxs)(P,{className:`overflow-hidden shadow-sm`,children:[(0,X.jsxs)(j,{className:`flex flex-row items-center gap-2 border-b px-4 py-3`,children:[(0,X.jsx)(N,{className:`text-sm`,children:(0,X.jsx)(`h2`,{children:`Devices in this build`})}),i===null?null:(0,X.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:i.length}),(0,X.jsx)(c,{className:a({className:`ml-auto h-11 sm:h-7`,size:`sm`,variant:`ghost`}),to:`/native-builds/devices`,children:`iOS devices`})]}),(0,X.jsx)(M,{className:`p-0`,children:n.isPending?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`Reading this IPA's devices`}),(0,X.jsx)(e,{className:`h-8 w-full`}),(0,X.jsx)(e,{className:`h-8 w-full`})]}):n.isError||r?.status===`unavailable`?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 p-4 text-xs text-muted-foreground`,children:[(0,X.jsx)(`p`,{className:`min-w-0 flex-1`,children:`The Console couldn't read this IPA's devices from storage.`}),(0,X.jsxs)(o,{className:`h-11 sm:h-7`,onClick:()=>void n.refetch(),size:`sm`,variant:`outline`,children:[(0,X.jsx)(T,{"data-icon":`inline-start`}),`Retry`]})]}):i?.length===0?(0,X.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`This IPA lists no devices.`}):(0,X.jsx)(`ul`,{"aria-label":`Devices in this build`,className:`divide-y`,children:i?.map(e=>(0,X.jsxs)(`li`,{className:`flex min-h-11 min-w-0 items-center gap-3 px-4 py-2 text-sm`,children:[(0,X.jsx)(le,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start`,children:[(0,X.jsx)(`span`,{className:e.name===null?`truncate text-muted-foreground`:`truncate`,children:e.name??`Unknown device`}),(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:(0,X.jsx)(Z,{label:`UDID`,shown:se(e.udid),value:e.udid})})]})]},e.udid))})})]})}var Ze=`https://hot-updater.dev/docs/guides/bundle-diffing#first-ota-update`;function Qe({detail:t,page:n,onPage:r}){let i=n.before!==void 0||n.after!==void 0,s=ge(t.build.min_bundle_id,n,i),d=i?s.data:t.patches,{next:f,previous:p}=d??{};return(0,X.jsxs)(P,{className:`overflow-hidden shadow-sm`,id:`patches`,children:[(0,X.jsx)(j,{className:`border-b px-4 py-3`,children:(0,X.jsx)(N,{className:`text-sm`,children:(0,X.jsx)(`h2`,{children:`Patches from this build`})})}),(0,X.jsxs)(M,{className:`p-0`,children:[i&&s.isError?(0,X.jsx)(`div`,{className:`p-4`,children:(0,X.jsxs)(O,{variant:`destructive`,children:[(0,X.jsx)(k,{}),(0,X.jsx)(E,{children:`Patches couldn't be loaded`}),(0,X.jsx)(D,{children:s.error.message}),(0,X.jsx)(ue,{children:(0,X.jsxs)(o,{onClick:()=>void s.refetch(),size:`xs`,variant:`outline`,children:[(0,X.jsx)(T,{"data-icon":`inline-start`}),`Retry`]})})]})}):d===void 0?(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`Loading patches`}),(0,X.jsx)(e,{className:`h-4 w-full`}),(0,X.jsx)(e,{className:`h-4 w-2/3`})]}):d.data.length===0?i?(0,X.jsxs)(B,{className:`py-10`,children:[(0,X.jsx)(I,{children:(0,X.jsx)(R,{children:`No more patches`})}),(0,X.jsx)(o,{className:`min-h-11 sm:min-h-8`,onClick:()=>r({}),variant:`outline`,children:`Show the newest patches`})]}):(0,X.jsxs)(B,{className:`py-10`,children:[(0,X.jsxs)(I,{children:[(0,X.jsx)(F,{variant:`icon`,children:(0,X.jsx)(re,{})}),(0,X.jsx)(R,{children:`No patches from this build`}),(0,X.jsx)(z,{children:t.build.is_sandbox?x:(0,X.jsxs)(X.Fragment,{children:[`A deploy adds a patch from this build's bundle while it is its scope's store build, or its newest build with none marked, and the deploy config turns patches on, with`,` `,(0,X.jsx)(`code`,{className:`font-mono`,children:`patch`}),` in`,` `,(0,X.jsx)(`code`,{className:`font-mono`,children:`hot-updater.config.ts`}),`.`]})})]}),t.build.is_sandbox?null:(0,X.jsx)(L,{children:(0,X.jsxs)(`a`,{className:a({className:`min-h-11 sm:min-h-8`,variant:`outline`}),href:Ze,rel:`noreferrer`,target:`_blank`,children:[`Bundle diffing guide`,(0,X.jsx)(l,{"data-icon":`inline-end`})]})})]}):(0,X.jsxs)(K,{"aria-busy":i&&s.isPlaceholderData,"aria-label":`Patches from this build`,className:`table-fixed`,children:[(0,X.jsx)(V,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(H,{children:`Target bundle`}),(0,X.jsx)(H,{className:`w-28`,children:`Patch size`}),(0,X.jsx)(H,{className:`hidden w-32 sm:table-cell`,children:`Created`})]})}),(0,X.jsx)(U,{children:d.data.map(e=>(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{className:`py-3 whitespace-normal`,children:(0,X.jsx)(c,{className:`block font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{bundleId:e.bundleId},title:e.bundleId,to:`/`,translate:`no`,children:e.bundleId})}),(0,X.jsx)(G,{className:`text-xs tabular-nums`,children:y(e.byteSize)}),(0,X.jsx)(G,{className:`hidden sm:table-cell`,children:(0,X.jsx)(q,{uuid:e.bundleId})})]},e.bundleId))})]}),f!==void 0||p!==void 0?(0,X.jsxs)(`nav`,{"aria-label":`Patch pages`,className:`flex items-center justify-end gap-2 border-t px-4 py-2`,children:[(0,X.jsxs)(o,{className:`min-h-11 sm:min-h-7`,disabled:p===void 0||i&&s.isPlaceholderData,onClick:()=>r({after:p}),size:`sm`,variant:`ghost`,children:[(0,X.jsx)(u,{"data-icon":`inline-start`}),`Newer`]}),(0,X.jsxs)(o,{className:`min-h-11 sm:min-h-7`,disabled:f===void 0||i&&s.isPlaceholderData,onClick:()=>r({before:f}),size:`sm`,variant:`ghost`,children:[`Older`,(0,X.jsx)(m,{"data-icon":`inline-end`})]})]}):null]})]})}var $e=(e,t)=>{let n=e.data.find(e=>e.bundleId===t);if(n!==void 0)return{kind:`patch`,byteSize:n.byteSize};let r=e.data.at(-1)?.bundleId;return e.next!==void 0&&r!==void 0&&t<r?{kind:`unknown`}:{kind:`full`}};function et({download:e}){switch(e.kind){case`patch`:return(0,X.jsxs)(`span`,{className:`text-xs`,children:[`Patch`,` `,(0,X.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`(`,y(e.byteSize),`)`]})]});case`full`:return(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Full bundle`});case`unknown`:return(0,X.jsx)(`a`,{className:`text-xs underline-offset-4 hover:underline`,href:`#patches`,children:`See patches`})}}function tt({detail:e}){let{build:t,channel:n,servedNow:r,patches:i,catalogScopeKey:o}=e,s=r.find(({rolloutCohortCount:e,targetCohorts:t})=>e>0||t.length>0)?.bundleId,u=t.is_store_build&&s!=null&&$e(i,s).kind===`full`?[`npx hot-updater patch`,`-p ${t.platform}`,`-c ${_(n)}`,`-b ${_(s)}`,`--base-artifact-id ${_(t.min_bundle_id)}`].join(` `):null,f=(0,X.jsxs)(c,{className:`inline-flex items-center gap-0.5 underline-offset-4 hover:underline`,search:{scopeKey:o},to:`/`,children:[`All releases in this scope`,(0,X.jsx)(l,{"aria-hidden":`true`,className:`size-3`})]});return(0,X.jsxs)(P,{className:`overflow-hidden shadow-sm`,children:[(0,X.jsx)(j,{className:`border-b px-4 py-3`,children:(0,X.jsx)(N,{className:`text-sm`,children:(0,X.jsx)(`h2`,{children:`Served now`})})}),(0,X.jsx)(M,{className:`p-0`,children:r.length===0?(0,X.jsxs)(B,{className:`py-10`,children:[(0,X.jsxs)(I,{children:[(0,X.jsx)(F,{variant:`icon`,children:(0,X.jsx)(Ae,{})}),(0,X.jsx)(R,{children:`No OTA for this build yet`}),(0,X.jsxs)(z,{children:[`No release in this build's scope is newer than its built-in bundle. Deploy one with`,` `,(0,X.jsx)(`code`,{className:`font-mono`,children:`hot-updater deploy`}),`, and it shows here.`]})]}),(0,X.jsx)(L,{children:(0,X.jsx)(c,{className:a({className:`min-h-11 sm:min-h-8`,variant:`outline`}),search:{scopeKey:o},to:`/`,children:`All releases in this scope`})})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(K,{"aria-label":`Served now`,className:`table-fixed`,children:[(0,X.jsx)(V,{children:(0,X.jsxs)(W,{children:[(0,X.jsx)(H,{children:`Bundle`}),(0,X.jsx)(H,{className:`hidden w-40 md:table-cell`,children:`Rollout`}),(0,X.jsx)(H,{className:`hidden w-32 sm:table-cell`,children:`Created`}),(0,X.jsx)(H,{className:`w-32`,children:`First OTA download`})]})}),(0,X.jsx)(U,{children:r.map(e=>{let t=e.bundleId,n=e.rolloutCohortCount/de*100;return(0,X.jsxs)(W,{children:[(0,X.jsx)(G,{className:`py-3 whitespace-normal`,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(c,{className:`font-mono text-xs [overflow-wrap:anywhere] underline-offset-4 hover:underline`,search:{releaseId:e.releaseId},title:t,to:`/`,translate:`no`,children:t}),e.message?(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.message}):null]})}),(0,X.jsx)(G,{className:`hidden md:table-cell`,children:(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.targetCohorts.length>0?(0,X.jsx)(A,{variant:`secondary`,children:e.targetCohorts.length===1?`1 cohort`:`${e.targetCohorts.length} cohorts`}):(0,X.jsx)(Ee,{percentage:n}),e.shouldForceUpdate?(0,X.jsx)(A,{variant:`outline`,children:`Forced`}):null]})}),(0,X.jsx)(G,{className:`hidden sm:table-cell`,children:(0,X.jsx)(q,{uuid:t})}),(0,X.jsx)(G,{children:(0,X.jsx)(et,{download:$e(i,t)})})]},e.releaseId)})})]}),u===null?null:(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 border-t px-4 py-3 text-xs`,children:[(0,X.jsx)(`p`,{children:`The OTA fresh installs get first has no patch from this store build, so they download all of it. Add one from your project:`}),(0,X.jsx)(d,{label:`the patch command`,value:u})]}),(0,X.jsxs)(`p`,{className:`border-t px-4 py-3 text-xs text-muted-foreground`,children:[`What the update check serves an install of this build now, newest first: not the history. `,f]})]})})]})}function nt({buildId:t,search:n,onSearchChange:r}){let i=ve(t),l=i.data,d={...n.patchesBefore===void 0?{}:{before:n.patchesBefore},...n.patchesAfter===void 0?{}:{after:n.patchesAfter}};return(0,X.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,X.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 items-center gap-x-2 border-b bg-background px-3 py-3 sm:min-h-12 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,X.jsx)(s,{className:`-ml-1 size-11 lg:size-7`}),(0,X.jsxs)(c,{className:a({className:`min-h-11 sm:min-h-7`,size:`sm`,variant:`ghost`}),search:l?{channel:l.channel}:{channels:`all`},to:`/native-builds`,children:[(0,X.jsx)(u,{"data-icon":`inline-start`}),`Native builds`]}),l?(0,X.jsxs)(`h1`,{className:`flex min-w-0 items-center gap-1.5 text-sm font-medium`,children:[(0,X.jsx)(Se,{className:`size-3.5 shrink-0 text-muted-foreground`,platform:l.build.platform}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5`,children:[(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,X.jsxs)(`span`,{className:`sr-only`,children:[g(l.build.platform),` `]}),b[l.build.artifact_kind].label,(0,X.jsx)(Oe,{build:l.build})]}),(0,X.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,(0,X.jsx)(`span`,{translate:`no`,children:l.channel})]})]}),(0,X.jsx)(`span`,{className:`hidden text-xs font-normal text-muted-foreground tabular-nums sm:inline`,children:y(l.build.byte_size)})]}):(0,X.jsx)(`h1`,{className:`sr-only`,children:`Native build`})]}),(0,X.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,X.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 sm:gap-6`,children:i.isError?(0,X.jsxs)(O,{variant:`destructive`,children:[(0,X.jsx)(k,{}),(0,X.jsx)(E,{children:`The native build couldn't be loaded`}),(0,X.jsx)(D,{children:i.error.message}),(0,X.jsx)(ue,{children:(0,X.jsxs)(o,{onClick:()=>void i.refetch(),size:`xs`,variant:`outline`,children:[(0,X.jsx)(T,{"data-icon":`inline-start`}),`Retry`]})})]}):l===void 0?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sr-only`,children:`Loading the native build`}),(0,X.jsx)(e,{className:`h-56 w-full rounded-xl`}),(0,X.jsx)(e,{className:`h-64 w-full rounded-xl`})]}):l===null?(0,X.jsxs)(B,{className:`border py-16`,children:[(0,X.jsxs)(I,{children:[(0,X.jsx)(F,{variant:`icon`,children:(0,X.jsx)(ie,{})}),(0,X.jsx)(R,{children:`Native build not found`}),(0,X.jsx)(z,{children:`No native build has this ID. It may have been deleted, or be from another console.`})]}),(0,X.jsx)(L,{children:(0,X.jsx)(c,{className:a({className:`min-h-11 sm:min-h-8`,variant:`outline`}),search:{channels:`all`},to:`/native-builds`,children:`Show all native builds`})})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(qe,{build:l.build}),l.build.artifact_kind===`ipa`&&!J(l.build)?(0,X.jsx)(Xe,{build:l.build}):null,(0,X.jsx)(Pe,{detail:l}),(0,X.jsx)(tt,{detail:l}),(0,X.jsx)(Qe,{detail:l,onPage:e=>r({...e.before===void 0?{}:{patchesBefore:e.before},...e.after===void 0?{}:{patchesAfter:e.after}}),page:d})]})})})]})}function rt(){let{buildId:e}=h.useParams(),t=h.useSearch(),n=h.useNavigate();return(0,X.jsx)(nt,{buildId:e,onSearchChange:e=>void n({search:e,replace:!0}),search:t})}export{rt as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds_._buildId-CXx2xjoI.js","assets/sidebar-BmzmPGuv.js","assets/link-CRMwpc7-.js","assets/relativeTime-RUNbaMyO.js","assets/arrow-up-right-C_1ALUCD.js","assets/TargetDisplay-DG_I3qln.js","assets/copy-BjVLMKbo.js","assets/key-round-BkeLvA1m.js","assets/native-builds-zwqucwx2.js","assets/constants-C5gi7fdZ.js","assets/dist-BEmib-ZM.js","assets/HashValueDisplay-DvwvQchI.js","assets/chevron-right-RAuPv9r1.js","assets/download-CgpaZb23.js","assets/git-branch-BGatQV8Q.js","assets/-native-builds-search-BFcW2mlI.js","assets/history-Ci4dhphE.js","assets/smartphone-Dy13ukaU.js","assets/badge-zMibJGR5.js","assets/QrCode-BFSCkbPj.js","assets/BundleIdDisplay-C0X-k49t.js","assets/ChannelBadge-BgVCJfJs.js","assets/PlatformIcon-D4KPXCHL.js","assets/RolloutPercentageBadge-DCtG7c1o.js","assets/IosInstall-B5IdjCP2.js","assets/useMutation-D7IuoOLE.js","assets/loader-circle-8lunBReu.js","assets/field-DInLQ5oV.js","assets/api-eO-sq3Jd.js","assets/preload-helper-CE9OukVC.js","assets/SandboxBadge-PM92jCk6.js","assets/card-BAs80yql.js","assets/empty-C5GqArX9.js","assets/table-DbZPkzdz.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{Vr as e}from"./sidebar-BmzmPGuv.js";import{i as t,r as n,t as r}from"./preload-helper-CE9OukVC.js";import{r as i}from"./-native-builds-search-BFcW2mlI.js";var a=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),o=t(`/native-builds_/$buildId`)({component:n(()=>r(()=>import(`./native-builds_._buildId-CXx2xjoI.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),`component`),validateSearch:i});export{a as n,o as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-builds_.devices-DF3g--dt.js","assets/sidebar-BmzmPGuv.js","assets/alert-dialog-DGPqJBCk.js","assets/useAnchoredPopupScrollLock-Cvx6CdPD.js","assets/select-Bk52fOVX.js","assets/useCompositeListItem-Cbk_weKW.js","assets/check-C3VCvMOV.js","assets/CompositeItem-B7uxFM46.js","assets/tabs-BnpNC0zf.js","assets/link-CRMwpc7-.js","assets/relativeTime-RUNbaMyO.js","assets/TargetDisplay-DG_I3qln.js","assets/copy-BjVLMKbo.js","assets/key-round-BkeLvA1m.js","assets/native-builds-zwqucwx2.js","assets/constants-C5gi7fdZ.js","assets/dist-BEmib-ZM.js","assets/HashValueDisplay-DvwvQchI.js","assets/-native-builds-search-BFcW2mlI.js","assets/loader-circle-8lunBReu.js","assets/smartphone-Dy13ukaU.js","assets/trash-2-DI0biNI-.js","assets/badge-zMibJGR5.js","assets/QrCode-BFSCkbPj.js","assets/RelativeTime-5ZP9WlQ6.js","assets/chevron-right-RAuPv9r1.js","assets/table-DbZPkzdz.js","assets/IosInstall-B5IdjCP2.js","assets/useMutation-D7IuoOLE.js","assets/field-DInLQ5oV.js","assets/api-eO-sq3Jd.js","assets/preload-helper-CE9OukVC.js","assets/NativeBuildsNav-BKdnlKMN.js","assets/card-BAs80yql.js","assets/dialog-BvZDZzdQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,r as t,t as n}from"./preload-helper-CE9OukVC.js";import{n as r}from"./-native-builds-search-BFcW2mlI.js";var i=e(`/native-builds_/devices`)({component:t(()=>n(()=>import(`./native-builds_.devices-DF3g--dt.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34])),`component`),validateSearch:r});export{i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Di as e,Ni as t,Qr as n,Ri as r,Ti as i,Ur as a,Vi as o,ei as s,ji as c,ti as l}from"./sidebar-BmzmPGuv.js";import{S as u,_ as d,g as f,i as p,n as m,p as h,r as g,t as _,v,w as y}from"./link-CRMwpc7-.js";var b=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=h:this.parentRoute||c();let r=n?h:t?.path;r&&r!==`/`&&(r=d(r));let i=t?.id||r,a=n?h:f((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:f(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=v(o)},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=>t({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.`)}},x=class extends b{constructor(e){super(e)}},S=o(r(),1),C=S.use,w=S.useLayoutEffect,T=i();function E(e,t){return e===t}function D(e,t=e=>e,n){let r=n?.compare??E,i=(0,S.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,S.useCallback)(()=>e.get(),[e]);return(0,T.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var O={};function k(e,t){let n=S.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=y(n.current,i):i}}function A(e){let t=p(),n=S.useContext(e.from?m:g),r=e.from??n,i=t.stores.getMatchStore(r),a=k(e,t),o=D(i,e=>e?a(e):O);if(o!==O)return o;(e.shouldThrow??!0)&&c()}function j(e){return A({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function M(e){let{select:t,...n}=e;return A({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function N(e){return A({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 P(e){return A({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function F(e){let t=p();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function I(e){return A({...e,select:t=>e.select?e.select(t.context):t.context})}var L=e(),R=class extends b{constructor(e){super(e),this.useMatch=e=>A({...e,from:this.id}),this.useRouteContext=e=>I({...e,from:this.id}),this.useSearch=e=>P({...e,from:this.id}),this.useParams=e=>N({...e,from:this.id}),this.useLoaderDeps=e=>M({...e,from:this.id}),this.useLoaderData=e=>j({...e,from:this.id}),this.useNavigate=()=>F({from:this.fullPath}),this.Link=S.forwardRef((e,t)=>(0,L.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function z(e){return new R(e)}function B(){return e=>H(e)}var V=class extends x{constructor(e){super(e),this.useMatch=e=>A({...e,from:this.id}),this.useRouteContext=e=>I({...e,from:this.id}),this.useSearch=e=>P({...e,from:this.id}),this.useParams=e=>N({...e,from:this.id}),this.useLoaderDeps=e=>M({...e,from:this.id}),this.useLoaderData=e=>j({...e,from:this.id}),this.useNavigate=()=>F({from:this.fullPath}),this.Link=S.forwardRef((e,t)=>(0,L.jsx)(_,{ref:t,from:this.fullPath,...e}))}};function H(e){return new V(e)}function U(e){return e=>{let t=z(e);return t.isRoot=!1,t}}function W(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(u(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(C)C(a());else throw a();return S.createElement(r,e)};return o.preload=a,o}var G=class extends n{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:o,isRefetchError:c}=r,u=n.fetchMeta?.fetchMore?.direction,d=o&&u===`forward`,f=i&&u===`forward`,p=o&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:s(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:c&&!d&&!p,isRefetching:a&&!f&&!m}}};function K(e,t){return a(e,G,t)}var q=`modulepreload`,J=function(e){return`/`+e},Y={},X=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=J(t,n),t in Y)return;Y[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`:q,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{B as a,D as c,U as i,C as l,K as n,F as o,W as r,k as s,X as t,w as u};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-config-BIIj0Faf.js","assets/ConsoleFeatureUnavailable-B3VCINom.js","assets/sidebar-BmzmPGuv.js","assets/console-features-api-CtbGqKyr.js","assets/arrow-up-right-C_1ALUCD.js","assets/NotFoundPage-BEpesHEm.js","assets/link-CRMwpc7-.js","assets/empty-C5GqArX9.js","assets/remote-config-Dm1MCHDN.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$ as e,Bn as t,Br as n,Di as r,Er as i,Hr as a,Mr as o,Oi as s,Q as c,Ri as l,Si as u,Sn as d,Sr as f,Vi as p,Vr as m,di as h,ft as g,gr as _,kr as v,p as y,vr as b,wi as x,xr as S,yr as C,zr as w}from"./sidebar-BmzmPGuv.js";import{i as T,n as ee,r as te,t as E}from"./preload-helper-CE9OukVC.js";import{t as D}from"./useMutation-D7IuoOLE.js";import{r as O}from"./console-features-api-CtbGqKyr.js";import{t as k}from"./arrow-right-DjRwIoF1.js";import{i as ne}from"./useCompositeListItem-Cbk_weKW.js";import{a as A,i as j,n as re,o as ie,r as ae,s as oe,t as se}from"./select-Bk52fOVX.js";import{t as ce}from"./clipboard-D0JWZ1KF.js";import{t as le}from"./git-branch-BGatQV8Q.js";import{t as ue}from"./history-Ci4dhphE.js";import{t as de}from"./loader-circle-8lunBReu.js";import{n as fe,t as pe}from"./CompositeItem-B7uxFM46.js";import{t as M}from"./plus-DztQIXYL.js";import{n as N,r as me}from"./dist-BEmib-ZM.js";import{t as he}from"./rotate-ccw-tITIe0Bd.js";import{t as ge}from"./search-BfEqtE64.js";import{i as _e,n as P,r as ve,t as ye}from"./switch-CI393qIT.js";import{t as be}from"./smartphone-Dy13ukaU.js";import{t as xe}from"./trash-2-DI0biNI-.js";import{a as F,i as I,n as L,o as R,r as z,t as B}from"./badge-zMibJGR5.js";import{t as Se}from"./undo-2-CxhBbgJw.js";import{a as Ce,n as we,o as Te,r as Ee,t as V}from"./card-BAs80yql.js";import{n as De,t as Oe}from"./relativeTime-RUNbaMyO.js";import{a as H,i as ke,n as Ae,o as je,r as U,s as Me,t as W}from"./field-DInLQ5oV.js";import{i as Ne}from"./api-eO-sq3Jd.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,t as ze}from"./empty-C5GqArX9.js";import{i as Be,n as Ve,o as He,r as Ue,t as We}from"./tabs-BnpNC0zf.js";import{a as Ge,i as Ke,l as qe,n as Je,o as Ye,r as Xe,s as Ze,t as Qe}from"./alert-dialog-DGPqJBCk.js";import{t as $e}from"./PlatformIcon-D4KPXCHL.js";import{a as et,i as tt,n as nt,o as rt,r as it,t as at}from"./dialog-BvZDZzdQ.js";import{i as ot,n as st,o as ct,r as lt,t as ut}from"./input-group-CIjTdxCW.js";var dt=m(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),ft=m(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),pt=m(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),mt=m(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ht=m(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),G=p(l()),K=r(),gt=p(De(),1),_t=p(Oe(),1),vt=x({method:`GET`}).middleware([w]).handler(s(`0ccfae64b399b03d820328fa98a38e2caa0b622d3da5a7ca633c5a0e8101e3f6`)),yt=x({method:`GET`}).middleware([w]).handler(s(`3377db68b9d1d971971595469029c0466da0777a177b294d655cd0c039737f1a`)),bt=x({method:`GET`}).middleware([w]).handler(s(`af71e3c55a659ce46093e33b9d70e729359610eec7d576502e8f0e26c785b317`)),xt=x({method:`POST`}).middleware([w]).handler(s(`4182bf9ccbb675700638f30bc6122517ccd90b16a339a6823a0f5f6c808d70a6`)),St=x({method:`POST`}).middleware([w]).handler(s(`98c10bdc514eb4d3fe65af546be44452b492a81092cfe45625778a4c9f731727`)),Ct=x({method:`POST`}).middleware([w]).handler(s(`1371bff16085636e2c44b60a573ae434b556c63045c40a0a93a93ab69ec47999`)),q={all:[`remote-config`],active:[`remote-config`,`active`],versions:[`remote-config`,`versions`],version:e=>[`remote-config`,`version`,e],preview:e=>[`remote-config`,`preview`,e]},wt=()=>a({queryKey:q.active,queryFn:()=>vt(),staleTime:6e4}),Tt=({enabled:e})=>ee({queryKey:q.versions,queryFn:({pageParam:e})=>yt({data:e===void 0?{}:{cursor:e}}),initialPageParam:void 0,getNextPageParam:e=>e.next,staleTime:6e4,enabled:e}),Et=e=>a({queryKey:q.version(e??0),queryFn:()=>bt({data:{version:e}}),enabled:e!==null,staleTime:1/0}),Dt=()=>{let e=u();return async()=>{await Promise.all([e.invalidateQueries({queryKey:q.active}),e.invalidateQueries({queryKey:q.versions})])}},Ot=()=>{let e=Dt();return D({mutationFn:e=>xt({data:e}),onSuccess:async t=>{(t.status===`published`||t.status===`conflict`)&&await e()}})},kt=()=>D({mutationFn:e=>St({data:e}),onSuccess:Dt()}),At=e=>a({queryKey:q.preview(e),queryFn:()=>Ct({data:e}),placeholderData:h,staleTime:1/0}),J={STRING:`String`,NUMBER:`Number`,BOOLEAN:`Boolean`,JSON:`JSON`},Y={platform:`Platform`,channel:`Channel`,appVersion:`App version`,percent:`Percentage of installs`,cohort:`Cohort`,fingerprint:`Fingerprint`,dateTime:`Date and time`},X=(e,t)=>e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0,jt=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Mt=(e,t,n,r)=>{let i=Object.entries(e.parameters),a=t===null?-1:i.findIndex(([e])=>e===t),o=a===-1?[...i.filter(([e])=>e!==n),[n,r]]:i.map((e,t)=>t===a?[n,r]:e);return{...e,parameters:Object.fromEntries(o)}},Nt=(e,t)=>({...e,parameters:Object.fromEntries(Object.entries(e.parameters).filter(([e])=>e!==t))}),Pt=(e,t)=>Object.fromEntries(Object.entries(e.parameters).map(([e,n])=>{let{conditionalValues:r,...i}=n,a=Object.entries(r??{}).flatMap(([e,n])=>{let r=t(e);return r===null?[]:[[r,n]]});return[e,a.length===0?i:{...i,conditionalValues:Object.fromEntries(a)}]})),Ft=(e,t,n)=>t===null?{...e,conditions:[...e.conditions,n]}:{conditions:e.conditions.map(e=>e.name===t?n:e),parameters:t===n.name?e.parameters:Pt(e,e=>e===t?n.name:e)},It=(e,t)=>({conditions:e.conditions.filter(e=>e.name!==t),parameters:Pt(e,e=>e===t?null:e)}),Lt=(e,t,n)=>{let r=t+n;if(r<0||r>=e.conditions.length)return e;let i=[...e.conditions];return[i[t],i[r]]=[i[r],i[t]],{...e,conditions:i}},Rt=(e,t)=>Object.entries(e.parameters).filter(([,e])=>X(e.conditionalValues,t)!==void 0).map(([e])=>e),zt=(e,t=3)=>e.length<=t?e.join(`, `):`${e.slice(0,t).join(`, `)} +${e.length-t}`,Bt=e=>Number.isInteger(e)?String(e):e.toFixed(1),Vt=e=>{let t=new Intl.DateTimeFormat(`en`,{timeZone:e,timeZoneName:e===`UTC`?`short`:`shortOffset`,year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`});return e=>t.format(new Date(e))},Ht=Vt(`UTC`),Ut=(e=new Date)=>{let t=new Date(e);t.setMinutes(60,0,0);let n=new Date(e);n.setDate(n.getDate()+1),n.setHours(9,0,0,0);let r=new Date(e);return r.setSeconds(0,0),[{label:`Now`,iso:r.toISOString()},{label:`Next hour`,iso:t.toISOString()},{label:`Tomorrow 09:00`,iso:n.toISOString()}]},Wt=(e,t=new Date)=>{let n=e===void 0?t:new Date(e),r=e=>{let t=new Date(n);return t.setDate(t.getDate()+e),t.setSeconds(0,0),t.toISOString()};return[{label:`+1 day`,iso:r(1)},{label:`+1 week`,iso:r(7)}]},Gt=e=>{if(e===void 0)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`},Kt=e=>{if(e.length===0)return;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toISOString():void 0},qt=(e,t=Ht)=>{switch(e.type){case`platform`:return`Platform is ${zt(e.platforms.map(e=>e===`ios`?`iOS`:`Android`))}`;case`channel`:return`Channel is ${zt(e.channels)}`;case`appVersion`:return`App version ${e.range}`;case`cohort`:return`Cohort is ${zt(e.cohorts)}`;case`percent`:return e.from===0?`${Bt(e.to)}% of installs`:`${Bt(e.from)}–${Bt(e.to)}% of installs`;case`fingerprint`:return`Fingerprint is ${zt(e.hashes.map(e=>e.slice(0,8)))}`;case`dateTime`:return e.from!==void 0&&e.to!==void 0?`From ${t(e.from)} until ${t(e.to)}`:e.from===void 0?`Until ${t(e.to??``)}`:`From ${t(e.from)}`}},Z=e=>`value`in e?e.value.length===0?`""`:e.value:`In-app default`,Jt=()=>{let e=crypto.getRandomValues(new Uint8Array(6));return Array.from(e,e=>e.toString(36).padStart(2,`0`)).join(``).slice(0,8)},Yt=(e,t)=>({added:Object.keys(t).filter(t=>!Object.hasOwn(e,t)),changed:Object.keys(t).filter(n=>Object.hasOwn(e,n)&&JSON.stringify(e[n])!==JSON.stringify(t[n])),removed:Object.keys(e).filter(e=>!Object.hasOwn(t,e))}),Xt=(e,t)=>{let n=e=>Object.fromEntries(e.conditions.map(e=>[e.name,e])),r=(e,t)=>e.conditions.map(({name:e})=>e).filter(e=>t.conditions.some(t=>t.name===e));return{parameters:Yt(e.parameters,t.parameters),conditions:Yt(n(e),n(t)),reordered:r(e,t).join(`
|
|
3
|
-
`)!==r(t,e).join(`
|
|
4
|
-
`)}},Q=`Not set`,Zt=(e,t)=>{let n=[],r=(e,t,r)=>{(t===null?r!==Q:t!==r)&&n.push({field:e,before:t,after:r})};r(`Type`,e===null?null:J[e.valueType],J[t.valueType]),r(`Default`,e===null?null:Z(e.defaultValue),Z(t.defaultValue));let i=new Set([...Object.keys(e?.conditionalValues??{}),...Object.keys(t.conditionalValues??{})]);for(let n of i){let i=X(e?.conditionalValues,n),a=X(t.conditionalValues,n);r(`When ${n}`,e===null?null:i===void 0?Q:Z(i),a===void 0?Q:Z(a))}return r(`Description`,e===null?null:e.description??Q,t.description??Q),n},Qt=(e,t,n=Ht)=>{let r=e=>e.rules.map(e=>qt(e,n)).join(` · `),i=r(t);if(e===null)return[{field:`Rules`,before:null,after:i}];let a=r(e);return a===i?[]:[{field:`Rules`,before:a,after:i}]},$t=`hot-updater:remote-config-draft`,$=e=>typeof e==`object`&&!!e&&!Array.isArray(e),en=e=>$(e)&&(typeof e.value==`string`||e.useInAppDefault===!0),tn=e=>$(e)&&$(e.parameters)&&Array.isArray(e.conditions)&&Object.values(e.parameters).every(e=>$(e)&&Object.hasOwn(J,String(e.valueType))&&en(e.defaultValue)&&(e.conditionalValues===void 0||$(e.conditionalValues)&&Object.values(e.conditionalValues).every(en)))&&e.conditions.every(e=>$(e)&&typeof e.name==`string`&&Array.isArray(e.rules)&&e.rules.every(e=>$(e)&&Object.hasOwn(Y,String(e.type)))),nn=e=>{try{let t=window.localStorage.getItem($t);if(t===null)return null;let n=JSON.parse(t);return!$(n)||n.baseVersion!==e.version||!tn(n.base)||!tn(n.template)||!jt(n.base,e.template)||jt(n.template,e.template)?null:{baseVersion:e.version,base:n.base,template:n.template}}catch{return null}},rn=e=>{try{return e===null?window.localStorage.removeItem($t):window.localStorage.setItem($t,JSON.stringify(e)),!0}catch{return!1}},an=/^[A-Za-z_][A-Za-z0-9_]{0,255}$/u,on=(e,t)=>e.length===0?`Enter a key.`:an.test(e)?t.includes(e)?`Another parameter uses this key.`:null:`Start with a letter or _, then use letters, digits, and _.`,sn=(e,t)=>{if(e===`NUMBER`)return t.trim().length>0&&Number.isFinite(Number(t))?null:`Enter a number.`;if(e===`JSON`)try{return JSON.parse(t),null}catch{return`Enter valid JSON.`}return e===`BOOLEAN`&&t!==`true`&&t!==`false`?`Choose true or false.`:null},cn=(e,t,n)=>{let r=e.map(e=>qt(e,n)).join(` · `),i=r.length<=100?r:`${r.slice(0,99).trimEnd()}…`;if(i.length===0||!t.includes(i))return i;for(let e=2;;e+=1){let n=` (${e})`,r=`${i.slice(0,100-n.length)}${n}`;if(!t.includes(r))return r}},ln=(e,t)=>{let n=e.trim();return n.length===0?`Enter a name.`:n.length>100?`Use 100 characters or fewer.`:t.includes(n)?`Another condition uses this name.`:null},un=e=>[...new Set(e.split(/[\n,]/u).map(e=>e.trim()).filter(e=>e.length>0))],dn=e=>{switch(e.type){case`platform`:return e.platforms.length===0?`Choose a platform.`:null;case`channel`:return e.channels.length===0?`Enter a channel.`:null;case`appVersion`:return e.range.trim().length===0?`Enter a version range, such as >=1.4.0.`:null;case`cohort`:return e.cohorts.length===0?`Enter a cohort.`:null;case`percent`:return e.from>=e.to||e.from<0||e.to>100||Math.abs(e.to*10-Math.round(e.to*10))>1e-9||Math.abs(e.from*10-Math.round(e.from*10))>1e-9?`Use a range from 0 to 100 in steps of 0.1.`:null;case`fingerprint`:return e.hashes.length===0?`Enter a fingerprint.`:null;case`dateTime`:return e.from===void 0&&e.to===void 0?`Choose a start, an end, or both.`:e.from!==void 0&&e.to!==void 0&&e.from>=e.to?`End after the start.`:null}},fn=e=>{switch(e){case`platform`:return{type:e,platforms:[`ios`]};case`channel`:return{type:e,channels:[]};case`appVersion`:return{type:e,range:``};case`cohort`:return{type:e,cohorts:[]};case`percent`:return{type:e,seed:Jt(),from:0,to:10};case`fingerprint`:return{type:e,hashes:[]};case`dateTime`:return{type:e,from:Ut()[1].iso}}},pn=G.createContext(void 0);function mn(e=!0){let t=G.useContext(pn);if(t===void 0&&!e)throw Error(v(7));return t}var hn=G.forwardRef(function(e,n){let{className:r,defaultPressed:a=!1,disabled:o=!1,form:s,onPressedChange:c,pressed:l,render:u,type:f,value:p,nativeButton:m=!0,style:h,..._}=e,v=g(p||void 0),y=mn(),b=y?.value??[],x=y?void 0:a,C=(o||y?.disabled)??!1,[w,T]=ne({controlled:y?v!==void 0&&b.indexOf(v)>-1:l,default:x,name:`Toggle`,state:`pressed`}),{getButtonProps:ee,buttonRef:te}=i({disabled:C,native:m}),E={disabled:C,pressed:w},D=[te,n],O=[{"aria-pressed":w,onClick(e){let n=!w,r=d(t,e.nativeEvent);v&&y?.setGroupValue?.(v,n,r),c?.(n,r),!r.isCanceled&&T(n)}},_,ee],k=S(`button`,e,{enabled:!y,state:E,ref:D,props:O});return y?(0,K.jsx)(pe,{tag:`button`,render:u,className:r,style:h,state:E,refs:D,props:O}):k}),gn=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),_n={multiple(e){return e?{[gn.multiple]:``}:null}},vn=G.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:s=`horizontal`,multiple:c=!1,value:l,className:u,render:d,style:p,...m}=e,h=oe(!0),g=G.useMemo(()=>l!==void 0||n!==void 0,[l,n]),_=(h?.disabled??!1)||r,[v,y]=ne({controlled:l,default:l===void 0?n??f:void 0,name:`ToggleGroup`,state:`value`}),b=o((e,t,n)=>{let r;c?(r=v.slice(),t?r.push(e):r.splice(v.indexOf(e),1)):r=t?[e]:[],a?.(r,n),!n.isCanceled&&y(r)}),x={disabled:_,multiple:c,orientation:s},C=G.useMemo(()=>({disabled:_,orientation:s,setGroupValue:b,value:v,isValueInitialized:g}),[_,s,b,v,g]),w={role:`group`},T=S(`div`,e,{enabled:!!h,state:x,ref:t,props:[w,m],stateAttributesMapping:_n});return(0,K.jsx)(pn.Provider,{value:C,children:h?T:(0,K.jsx)(He,{render:d,className:u,style:p,state:x,refs:[t],props:[w,m],stateAttributesMapping:_n,loopFocus:i,enableHomeAndEndKeys:!0,orientation:s})})}),yn=C(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-7 min-w-7 px-2 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,sm:`h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),bn=G.createContext({size:`default`,variant:`default`,spacing:2,orientation:`horizontal`});function xn({className:e,variant:t,size:n,spacing:r=2,orientation:i=`horizontal`,children:a,...o}){return(0,K.jsx)(vn,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:b(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,K.jsx)(bn.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function Sn({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=G.useContext(bn);return(0,K.jsx)(hn,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:b(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,yn({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}function Cn(){let[e,t]=(0,G.useState)(`UTC`);return(0,G.useEffect)(()=>{t(Intl.DateTimeFormat().resolvedOptions().timeZone)},[]),{timeZone:e,dateTimeText:(0,G.useMemo)(()=>Vt(e),[e])}}var wn=Object.keys(Y);function Tn({id:e,values:t,onChange:n,placeholder:r,multiline:i=!1}){let[a,o]=(0,G.useState)(t.join(`, `)),[s,l]=(0,G.useState)(t);s!==t&&(l(t),un(a).join(`
|
|
5
|
-
`)!==t.join(`
|
|
6
|
-
`)&&o(t.join(`, `)));let u=e=>{o(e),n(un(e))};return i?(0,K.jsx)(ct,{className:`min-h-20 font-mono text-xs`,id:e,onChange:e=>u(e.target.value),placeholder:r,spellCheck:!1,value:a}):(0,K.jsx)(c,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:e,onChange:e=>u(e.target.value),placeholder:r,value:a})}function En({id:e,label:t,value:r,presets:i,onChange:a}){return(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:e,children:t}),(0,K.jsxs)(ut,{className:`h-11 sm:h-9`,children:[(0,K.jsx)(ot,{className:`h-11 tabular-nums sm:h-9`,id:e,onChange:e=>a(Kt(e.target.value)),type:`datetime-local`,value:Gt(r)}),r===void 0?null:(0,K.jsx)(st,{align:`inline-end`,children:(0,K.jsx)(lt,{"aria-label":`Clear ${t.toLowerCase()}`,className:`size-11 sm:size-5`,onClick:()=>a(void 0),size:`icon-xs`,children:(0,K.jsx)(n,{})})})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,K.jsx)(_,{"aria-pressed":e.iso===r,className:`min-h-11 sm:min-h-6`,onClick:()=>a(e.iso),size:`xs`,type:`button`,variant:e.iso===r?`secondary`:`outline`,children:e.label},e.label))})]})}function Dn({rule:e,onChange:t}){let n=(0,G.useId)(),r=Ne();switch(e.type){case`platform`:return(0,K.jsx)(xn,{"aria-label":`Platforms`,multiple:!0,onValueChange:n=>t({...e,platforms:n.filter(e=>e===`ios`||e===`android`)}),value:[...e.platforms],variant:`outline`,children:[`ios`,`android`].map(e=>(0,K.jsxs)(Sn,{className:`min-h-11 px-3 sm:min-h-8`,value:e,children:[(0,K.jsx)($e,{className:`size-3.5`,platform:e}),e===`ios`?`iOS`:`Android`]},e))});case`channel`:{let i=(r.data??[]).map(({name:e})=>e).filter(t=>!e.channels.includes(t));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(Tn,{id:`${n}-channels`,onChange:n=>t({...e,channels:n}),placeholder:`production, beta`,values:e.channels}),i.length>0?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Add:`}),i.slice(0,8).map(n=>(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-6`,onClick:()=>t({...e,channels:[...e.channels,n]}),size:`xs`,type:`button`,variant:`outline`,children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),n]},n))]}):null]})}case`appVersion`:return(0,K.jsx)(c,{"aria-label":`App version range`,autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,onChange:n=>t({...e,range:n.target.value}),placeholder:`>=1.4.0`,value:e.range});case`cohort`:return(0,K.jsx)(Tn,{id:`${n}-cohorts`,onChange:n=>t({...e,cohorts:n}),placeholder:`1, 2, beta-testers`,values:e.cohorts});case`percent`:return(0,K.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[repeat(2,minmax(0,8rem))_minmax(0,1fr)]`,children:[(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${n}-from`,children:`From %`}),(0,K.jsx)(c,{className:`min-h-11 tabular-nums sm:min-h-9`,id:`${n}-from`,inputMode:`decimal`,max:100,min:0,onChange:n=>t({...e,from:Number(n.target.value)}),step:.1,type:`number`,value:e.from})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${n}-to`,children:`To %`}),(0,K.jsx)(c,{className:`min-h-11 tabular-nums sm:min-h-9`,id:`${n}-to`,inputMode:`decimal`,max:100,min:0,onChange:n=>t({...e,to:Number(n.target.value)}),step:.1,type:`number`,value:e.to})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${n}-seed`,children:`Seed`}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(c,{autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,id:`${n}-seed`,onChange:n=>t({...e,seed:n.target.value}),value:e.seed}),(0,K.jsx)(_,{"aria-label":`New seed`,className:`size-11 sm:size-9`,onClick:()=>t({...e,seed:Jt()}),size:`icon`,type:`button`,variant:`outline`,children:(0,K.jsx)(me,{})})]})]})]});case`fingerprint`:return(0,K.jsx)(Tn,{id:`${n}-hashes`,multiline:!0,onChange:n=>t({...e,hashes:n}),placeholder:`One fingerprint hash per line`,values:e.hashes});case`dateTime`:{let r=(n,r)=>{let{[n]:i,...a}=e;t(r===void 0?a:{...a,[n]:r})};return(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(En,{id:`${n}-from`,label:`From`,onChange:e=>r(`from`,e),presets:Ut(),value:e.from}),(0,K.jsx)(En,{id:`${n}-until`,label:`Until`,onChange:e=>r(`to`,e),presets:Wt(e.from),value:e.to})]})}}}var On={platform:`Devices on any of these platforms.`,channel:`Devices on any of these channels, separated by commas.`,appVersion:`A semver range of native app versions, as release targets use: 2.x, >=1.4.0 <2.0.0.`,percent:`Installs whose numeric cohort lands in this share. Rules with one seed split the same order, so 0–10 and 10–20 never overlap.`,cohort:`Numeric cohorts from 1 to 1000, or custom cohort names.`,fingerprint:`Native builds with any of these fingerprints.`,dateTime:`Leave either end empty to keep it open. Devices get the change at their next fetch.`};function kn({open:e,onOpenChange:t,condition:n,takenNames:r,onSave:i}){let a=ve(e);return(0,K.jsx)(at,{onOpenChange:t,open:e,children:(0,K.jsx)(nt,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-xl`,children:(0,K.jsx)(An,{condition:n,onCancel:()=>t(!1),onSave:e=>{i(e),t(!1)},takenNames:r},a)})})}function An({condition:e,takenNames:t,onSave:n,onCancel:r}){let i=(0,G.useId)(),{dateTimeText:a,timeZone:o}=Cn(),[s,l]=(0,G.useState)(()=>e===null||e.name===cn(e.rules,t,a)?``:e.name),[u,d]=(0,G.useState)(e===null?[fn(`platform`)]:[...e.rules]),[f,p]=(0,G.useState)(!1),m=cn(u,t,a),h=s.trim().length===0?m:s,g=ln(h,t),v=u.map(dn),y=wn.filter(e=>!u.some(t=>t.type===e)),b=g!==null||u.length===0||v.some(e=>e!==null);return(0,K.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:e=>{e.preventDefault(),e.stopPropagation(),p(!0),!b&&n({name:h.trim(),rules:u.map(e=>e.type===`appVersion`?{...e,range:e.range.trim()}:e)})},children:[(0,K.jsxs)(et,{children:[(0,K.jsx)(rt,{children:e===null?`Add condition`:`Edit condition`}),(0,K.jsx)(it,{children:`A device matches when it matches every rule.`})]}),(0,K.jsxs)(ke,{children:[(0,K.jsxs)(W,{"data-invalid":f&&g!==null||void 0,children:[(0,K.jsx)(H,{htmlFor:`${i}-name`,children:`Name`}),(0,K.jsx)(c,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${i}-name`,maxLength:101,onChange:e=>l(e.target.value),placeholder:m||`Beta testers on iOS`,value:s}),(0,K.jsx)(Ae,{children:`Optional: without one, it is named after its rules.`}),(0,K.jsx)(U,{children:f?g:null})]}),(0,K.jsxs)(Me,{children:[(0,K.jsx)(je,{variant:`label`,children:`Rules`}),u.length===0?(0,K.jsx)(U,{children:f?`Add at least one rule.`:null}):null,(0,K.jsx)(`ol`,{className:`flex flex-col gap-3`,children:u.map((e,t)=>(0,K.jsx)(`li`,{className:`rounded-lg border p-3`,children:(0,K.jsxs)(W,{"data-invalid":f&&v[t]!==null||void 0,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:Y[e.type]}),(0,K.jsx)(_,{"aria-label":`Remove the ${Y[e.type].toLowerCase()} rule`,className:`size-11 sm:size-7`,onClick:()=>d(u.filter((e,n)=>n!==t)),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,K.jsx)(xe,{})})]}),(0,K.jsx)(Dn,{onChange:e=>d(u.map((n,r)=>r===t?e:n)),rule:e}),(0,K.jsx)(Ae,{children:e.type===`dateTime`?`In your time zone, ${o}. ${On.dateTime}`:On[e.type]}),(0,K.jsx)(U,{children:f?v[t]:null})]})},e.type))}),y.length>0?(0,K.jsxs)(se,{items:Object.fromEntries(y.map(e=>[e,Y[e]])),onValueChange:e=>{e!==null&&d([...u,fn(e)])},value:null,children:[(0,K.jsxs)(A,{"aria-label":`Add a rule`,className:`min-h-11 w-full sm:min-h-9 sm:w-56`,children:[(0,K.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(ie,{placeholder:`Add a rule`})]}),(0,K.jsx)(re,{alignItemWithTrigger:!1,children:(0,K.jsx)(ae,{children:y.map(e=>(0,K.jsx)(j,{value:e,children:Y[e]},e))})})]}):null]})]}),(0,K.jsxs)(tt,{children:[(0,K.jsx)(_,{onClick:r,type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsx)(_,{type:`submit`,children:e===null?`Add condition`:`Save condition`})]})]})}function jn({condition:e,dateTimeText:t}){let n=e.rules.map(e=>qt(e,t)).join(` · `);return n===e.name?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})}function Mn({template:e,onSaveCondition:t,onRemoveCondition:n,onMoveCondition:r}){let[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(null),c=P(i),l=P(o),{dateTimeText:u}=Cn(),{conditions:d}=e,f=c?.condition?.name??null,p=t=>{let r=Rt(e,t);r.length===0?n(t):s({name:t,users:r})};return(0,K.jsxs)(V,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Ce,{className:`flex-row flex-wrap items-center justify-between gap-3 space-y-0 border-b px-4 py-3 sm:px-6`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(Te,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Conditions`})}),(0,K.jsx)(Ee,{className:`text-xs`,children:`Listed by priority: when several match a device, the first wins.`})]}),(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({condition:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add condition`]})]}),(0,K.jsx)(we,{className:`p-0`,children:d.length===0?(0,K.jsxs)(ze,{className:`py-10`,children:[(0,K.jsxs)(Fe,{children:[(0,K.jsx)(Pe,{variant:`icon`,children:(0,K.jsx)(le,{})}),(0,K.jsx)(Le,{children:`No conditions`}),(0,K.jsx)(Re,{children:`Add a condition to give some devices other values: a platform, channel, app version range, cohort, or a share of installs.`})]}),(0,K.jsx)(Ie,{children:(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({condition:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add condition`]})})]}):(0,K.jsx)(`ol`,{"aria-label":`Conditions`,className:`divide-y`,children:d.map((t,n)=>{let i=Rt(e,t.name);return(0,K.jsxs)(`li`,{className:`grid gap-3 px-4 py-3 sm:px-6 md:grid-cols-[auto_minmax(0,1fr)_auto] md:items-center`,children:[(0,K.jsx)(`span`,{"aria-label":`Priority ${n+1}`,className:`flex size-6 items-center justify-center rounded-md bg-muted text-xs font-medium tabular-nums`,children:n+1}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:t.name}),(0,K.jsx)(jn,{condition:t,dateTimeText:u}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:i.length===0?`No parameter uses it yet`:`Sets ${i.length===1?`1 parameter`:`${i.length} parameters`}: ${i.slice(0,3).join(`, `)}${i.length>3?`…`:``}`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-1 md:justify-end`,children:[(0,K.jsx)(_,{"aria-label":`Move ${t.name} up`,className:`size-11 md:size-7`,disabled:n===0,onClick:()=>r(n,-1),size:`icon`,variant:`ghost`,children:(0,K.jsx)(ft,{})}),(0,K.jsx)(_,{"aria-label":`Move ${t.name} down`,className:`size-11 md:size-7`,disabled:n===d.length-1,onClick:()=>r(n,1),size:`icon`,variant:`ghost`,children:(0,K.jsx)(dt,{})}),(0,K.jsxs)(_,{"aria-label":`Edit ${t.name}`,className:`min-h-11 md:min-h-7`,onClick:()=>a({condition:t}),size:`sm`,variant:`outline`,children:[(0,K.jsx)(fe,{"data-icon":`inline-start`}),`Edit`]}),(0,K.jsx)(_,{"aria-label":`Delete ${t.name}`,className:`size-11 md:size-7`,onClick:()=>p(t.name),size:`icon`,variant:`ghost`,children:(0,K.jsx)(xe,{})})]})]},t.name)})})}),(0,K.jsx)(kn,{condition:c?.condition??null,onOpenChange:e=>{e||a(null)},onSave:e=>t(f,e),open:i!==null,takenNames:d.map(({name:e})=>e).filter(e=>e!==f)}),(0,K.jsx)(Qe,{onOpenChange:e=>{e||s(null)},open:o!==null,children:(0,K.jsxs)(Ke,{children:[(0,K.jsxs)(Ze,{children:[(0,K.jsxs)(qe,{children:[`Delete `,l?.name,`?`]}),(0,K.jsxs)(Ge,{children:[l?.users.length===1?`1 parameter has a value for it`:`${l?.users.length} parameters have a value for it`,` `,`(`,l?.users.join(`, `),`). Those values are removed too, so matching devices get the default value after you publish.`]})]}),(0,K.jsxs)(Ye,{children:[(0,K.jsx)(Xe,{children:`Cancel`}),(0,K.jsx)(Je,{onClick:e=>{e.preventDefault(),o!==null&&n(o.name),s(null)},variant:`destructive`,children:`Delete condition`})]})]})})]})}var Nn=e=>e===`BOOLEAN`?`false`:e===`NUMBER`?`0`:e===`JSON`?`{}`:``,Pn=(e,t)=>`value`in t?sn(e,t.value):null;function Fn({id:e,label:t,valueType:n,value:r,onChange:i,showErrors:a}){let o=!(`value`in r),s=`value`in r?r.value:``,l=a?Pn(n,r):null,u=e=>i({value:e});return(0,K.jsxs)(W,{"data-invalid":l!==null||void 0,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(H,{htmlFor:e,id:`${e}-label`,children:t}),(0,K.jsxs)(`div`,{className:`flex min-h-11 items-center gap-2 text-xs text-muted-foreground sm:min-h-0`,children:[(0,K.jsx)(ye,{checked:o,id:`${e}-in-app-default`,onCheckedChange:e=>i(e?{useInAppDefault:!0}:{value:Nn(n)})}),(0,K.jsx)(`label`,{htmlFor:`${e}-in-app-default`,children:`Use in-app default`})]})]}),o?(0,K.jsxs)(`p`,{className:`rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground`,id:e,children:[`Devices keep the default set in the app's`,` `,(0,K.jsxs)(`code`,{className:`font-mono`,children:[`remoteConfig(`,`{ defaults }`,`)`]}),`.`]}):n===`BOOLEAN`?(0,K.jsxs)(xn,{"aria-labelledby":`${e}-label`,id:e,onValueChange:e=>{let[t]=e;(t===`true`||t===`false`)&&u(t)},value:[s],variant:`outline`,children:[(0,K.jsx)(Sn,{className:`min-h-11 px-4 sm:min-h-8`,value:`true`,children:`true`}),(0,K.jsx)(Sn,{className:`min-h-11 px-4 sm:min-h-8`,value:`false`,children:`false`})]}):n===`NUMBER`?(0,K.jsx)(c,{"aria-invalid":l!==null||void 0,autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,id:e,inputMode:`decimal`,onChange:e=>u(e.target.value),value:s}):n===`JSON`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(ct,{"aria-invalid":l!==null||void 0,className:`min-h-24 font-mono text-xs`,id:e,onChange:e=>u(e.target.value),spellCheck:!1,value:s}),(0,K.jsxs)(_,{className:`self-start`,disabled:sn(`JSON`,s)!==null,onClick:()=>u(JSON.stringify(JSON.parse(s),null,2)),size:`sm`,type:`button`,variant:`outline`,children:[(0,K.jsx)(pt,{"data-icon":`inline-start`}),`Format JSON`]})]}):(0,K.jsx)(ct,{"aria-invalid":l!==null||void 0,className:`min-h-11 text-sm sm:min-h-9`,id:e,onChange:e=>u(e.target.value),rows:2,value:s}),(0,K.jsx)(U,{children:l})]})}var In=Object.keys(J),Ln={STRING:`getString`,NUMBER:`getNumber`,BOOLEAN:`getBoolean`,JSON:`getString`},Rn=(e,t)=>`value`in e&&Pn(t,e)!==null?{value:Nn(t)}:e;function zn({open:e,onOpenChange:t,parameterKey:n,parameter:r,takenKeys:i,conditions:a,onSave:o,onAddCondition:s}){let c=ve(e);return(0,K.jsx)(at,{onOpenChange:t,open:e,children:(0,K.jsx)(nt,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto data-nested-dialog-open:after:absolute data-nested-dialog-open:after:inset-0 data-nested-dialog-open:after:rounded-xl data-nested-dialog-open:after:bg-background/70 sm:max-w-2xl`,children:(0,K.jsx)(Bn,{conditions:a,onAddCondition:s,onCancel:()=>t(!1),onSave:(e,n)=>{o(e,n),t(!1)},parameter:r,parameterKey:n,takenKeys:i},c)})})}function Bn({parameterKey:e,parameter:t,takenKeys:r,conditions:i,onSave:a,onCancel:o,onAddCondition:s}){let l=(0,G.useId)(),{dateTimeText:u}=Cn(),[d,f]=(0,G.useState)(e??``),[p,m]=(0,G.useState)(t?.valueType??`STRING`),[h,g]=(0,G.useState)(t?.description??``),v=h.trim().length>256,[y,b]=(0,G.useState)(t?.defaultValue??{value:``}),[x,S]=(0,G.useState)(t?.conditionalValues??{}),[C,w]=(0,G.useState)({}),[T,ee]=(0,G.useState)(!1),[te,E]=(0,G.useState)(!1),D=on(d.trim(),r),O=i.filter(({name:e})=>X(x,e)!==void 0),k=i.filter(({name:e})=>X(x,e)===void 0),ne=D!==null||v||[y,...Object.values(x)].some(e=>Pn(p,e)!==null),oe=e=>{m(e),b(Rn(y,e)),S(Object.fromEntries(Object.entries(x).map(([t,n])=>[t,Rn(n,e)])))},ce=e=>{let t=X(C,e);S({...x,[e]:t===void 0?{value:Nn(p)}:Rn(t,p)})},le=e=>{let{[e]:t,...n}=x;t!==void 0&&w({...C,[e]:t}),S(n)};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:e=>{if(e.preventDefault(),ee(!0),ne)return;let t=Object.fromEntries(O.map(({name:e})=>[e,X(x,e)]));a(d.trim(),{valueType:p,defaultValue:y,...Object.keys(t).length===0?{}:{conditionalValues:t},...h.trim().length===0?{}:{description:h.trim()}})},children:[(0,K.jsxs)(et,{children:[(0,K.jsx)(rt,{children:e===null?`Add parameter`:`Edit parameter`}),(0,K.jsxs)(it,{children:[`The app reads it with`,` `,(0,K.jsxs)(`code`,{className:`font-mono`,children:[`hotUpdater.remoteConfig.`,Ln[p],`("`,d.trim()||`key`,`")`]}),`, which is null when neither the server nor the app's defaults have a value.`]})]}),(0,K.jsxs)(ke,{children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-[minmax(0,1fr)_11rem]`,children:[(0,K.jsxs)(W,{"data-invalid":T&&D!==null||void 0,children:[(0,K.jsx)(H,{htmlFor:`${l}-key`,children:`Key`}),(0,K.jsx)(c,{autoComplete:`off`,className:`min-h-11 font-mono sm:min-h-9`,id:`${l}-key`,maxLength:257,onChange:e=>f(e.target.value),placeholder:`welcome_message`,spellCheck:!1,value:d}),(0,K.jsx)(U,{children:T?D:null})]}),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${l}-type`,children:`Type`}),(0,K.jsxs)(se,{items:J,onValueChange:e=>{e!==null&&oe(e)},value:p,children:[(0,K.jsx)(A,{className:`min-h-11 w-full sm:min-h-9`,id:`${l}-type`,children:(0,K.jsx)(ie,{})}),(0,K.jsx)(re,{children:(0,K.jsx)(ae,{children:In.map(e=>(0,K.jsx)(j,{value:e,children:J[e]},e))})})]})]})]}),(0,K.jsxs)(W,{"data-invalid":v||void 0,children:[(0,K.jsx)(H,{htmlFor:`${l}-description`,children:`Description`}),(0,K.jsx)(c,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${l}-description`,onChange:e=>g(e.target.value),placeholder:`Optional: what the app does with it`,value:h}),(0,K.jsx)(U,{children:v?`Use 256 characters or fewer.`:null})]}),(0,K.jsx)(Fn,{id:`${l}-default`,label:`Default value`,onChange:b,showErrors:T,value:y,valueType:p}),(0,K.jsxs)(Me,{children:[(0,K.jsx)(je,{variant:`label`,children:`Conditional values`}),(0,K.jsx)(Ae,{children:`Devices that match a condition get its value. When several match, the first in the Conditions list wins. Removing a value keeps the condition, and its devices get the default value.`}),O.length>0?(0,K.jsx)(`ul`,{className:`flex flex-col gap-3`,children:O.map(e=>(0,K.jsxs)(`li`,{className:`rounded-lg border p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-start justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name}),(0,K.jsx)(jn,{condition:e,dateTimeText:u})]}),(0,K.jsxs)(_,{"aria-label":`Remove the value for ${e.name}`,className:`min-h-11 shrink-0 text-muted-foreground sm:min-h-7`,onClick:()=>le(e.name),size:`sm`,type:`button`,variant:`ghost`,children:[(0,K.jsx)(n,{"data-icon":`inline-start`}),`Remove value`]})]}),(0,K.jsx)(Fn,{id:`${l}-${e.name}`,label:(0,K.jsxs)(K.Fragment,{children:[`Value`,(0,K.jsxs)(`span`,{className:`sr-only`,children:[` for `,e.name]})]}),onChange:t=>S({...x,[e.name]:t}),showErrors:T,value:X(x,e.name),valueType:p})]},e.name))}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[k.length>0?(0,K.jsxs)(se,{items:Object.fromEntries(k.map(({name:e})=>[e,e])),onValueChange:e=>{e!==null&&ce(e)},value:null,children:[(0,K.jsxs)(A,{"aria-label":`Add a value for a condition`,className:`min-h-11 w-full sm:min-h-9 sm:w-64`,children:[(0,K.jsx)(M,{"aria-hidden":`true`,className:`size-3.5`}),(0,K.jsx)(ie,{placeholder:`Add a value for a condition`})]}),(0,K.jsx)(re,{alignItemWithTrigger:!1,children:(0,K.jsx)(ae,{children:k.map(({name:e})=>(0,K.jsx)(j,{value:e,children:e},e))})})]}):null,(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-9`,onClick:()=>E(!0),type:`button`,variant:`outline`,children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`New condition`]})]})]})]}),(0,K.jsxs)(tt,{children:[(0,K.jsx)(_,{onClick:o,type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsx)(_,{type:`submit`,children:e===null?`Add parameter`:`Save parameter`})]})]}),(0,K.jsx)(kn,{condition:null,onOpenChange:E,onSave:e=>{s(e),ce(e.name)},open:te,takenNames:i.map(({name:e})=>e)})]})}function Vn({text:e}){return(0,K.jsx)(`span`,{className:`line-clamp-2 block min-w-0 break-words font-mono text-xs text-foreground`,title:e,children:e})}function Hn({parameterKey:e,parameter:t,conditions:n,onEdit:r,onRemove:i}){let a=n.filter(({name:e})=>X(t.conditionalValues,e)!==void 0);return(0,K.jsxs)(`li`,{className:`grid gap-3 px-4 py-3 sm:px-6 md:grid-cols-[minmax(0,15rem)_minmax(0,1fr)_auto] md:items-start`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate font-mono text-sm font-medium`,children:e}),(0,K.jsx)(B,{className:`shrink-0`,variant:`outline`,children:J[t.valueType]})]}),t.description===void 0?null:(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:t.description})]}),(0,K.jsxs)(`dl`,{className:`grid min-w-0 grid-cols-[minmax(0,9rem)_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs`,children:[a.map(({name:e})=>(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`line-clamp-2 break-words text-muted-foreground`,title:e,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0`,children:(0,K.jsx)(Vn,{text:Z(X(t.conditionalValues,e))})})]},e)),(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:`Default`}),(0,K.jsx)(`dd`,{className:`min-w-0`,children:`value`in t.defaultValue?(0,K.jsx)(Vn,{text:Z(t.defaultValue)}):(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`In-app default`})})]}),(0,K.jsxs)(`div`,{className:`flex gap-1 md:justify-end`,children:[(0,K.jsxs)(_,{"aria-label":`Edit ${e}`,className:`min-h-11 md:min-h-7`,onClick:r,size:`sm`,variant:`outline`,children:[(0,K.jsx)(fe,{"data-icon":`inline-start`}),`Edit`]}),(0,K.jsx)(_,{"aria-label":`Delete ${e}`,className:`size-11 md:size-7`,onClick:i,size:`icon`,variant:`ghost`,children:(0,K.jsx)(xe,{})})]})]})}function Un({template:e,onSaveParameter:t,onRemoveParameter:n,onAddCondition:r}){let[i,a]=(0,G.useState)(null),o=P(i),[s,c]=(0,G.useState)(``),l=Object.keys(e.parameters),u=l.filter(e=>e.toLowerCase().includes(s.trim().toLowerCase())),d=o?.key??null;return(0,K.jsxs)(V,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Ce,{className:`flex-row flex-wrap items-center justify-between gap-3 space-y-0 border-b px-4 py-3 sm:px-6`,children:[(0,K.jsx)(Te,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Parameters`})}),(0,K.jsxs)(`div`,{className:`flex w-full flex-wrap gap-2 sm:w-auto`,children:[l.length>5?(0,K.jsxs)(ut,{className:`min-h-11 w-full sm:min-h-8 sm:w-56`,children:[(0,K.jsx)(st,{children:(0,K.jsx)(ge,{"aria-hidden":`true`})}),(0,K.jsx)(ot,{"aria-label":`Filter parameters by key`,className:`text-base sm:text-xs`,onChange:e=>c(e.target.value),placeholder:`Filter by key`,value:s})]}):null,(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({key:null,parameter:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add parameter`]})]})]}),(0,K.jsx)(we,{className:`p-0`,children:l.length===0?(0,K.jsxs)(ze,{className:`py-10`,children:[(0,K.jsxs)(Fe,{children:[(0,K.jsx)(Pe,{variant:`icon`,children:(0,K.jsx)(_e,{})}),(0,K.jsx)(Le,{children:`No parameters`}),(0,K.jsx)(Re,{children:`Add a parameter, give it a default, then publish to change the app without a new build.`})]}),(0,K.jsx)(Ie,{children:(0,K.jsxs)(_,{className:`min-h-11 sm:min-h-7`,onClick:()=>a({key:null,parameter:null}),children:[(0,K.jsx)(M,{"data-icon":`inline-start`}),`Add parameter`]})})]}):u.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-center text-xs text-muted-foreground`,children:[(0,K.jsx)(`p`,{className:`font-medium text-foreground`,children:`No matching keys`}),(0,K.jsx)(_,{onClick:()=>c(``),size:`sm`,variant:`outline`,children:`Clear filter`})]}):(0,K.jsx)(`ul`,{"aria-label":`Parameters`,className:`divide-y`,children:u.map(t=>(0,K.jsx)(Hn,{conditions:e.conditions,onEdit:()=>a({key:t,parameter:e.parameters[t]??null}),onRemove:()=>n(t),parameter:e.parameters[t],parameterKey:t},t))})}),(0,K.jsx)(zn,{conditions:e.conditions,onAddCondition:r,onOpenChange:e=>{e||a(null)},onSave:(e,n)=>t(d,e,n),open:i!==null,parameter:o?.parameter??null,parameterKey:d,takenKeys:l.filter(e=>e!==d)})]})}var Wn={platform:`ios`,channel:`production`,appVersion:`1.0.0`,cohort:`1`,fingerprintHash:``,at:``},Gn=(e,t=300)=>{let[n,r]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n};function Kn({template:t,isDraft:n}){let r=(0,G.useId)(),[i,a]=(0,G.useState)(Wn),{at:o,...s}=Gn(i),l=Kt(o),u=At({template:t,context:{...s,...l===void 0?{}:{now:Date.parse(l)}}}),d=Object.keys(t.parameters),f=(e,t)=>a({...i,[e]:t});return(0,K.jsxs)(V,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsxs)(Ce,{className:`border-b px-4 py-3 sm:px-6`,children:[(0,K.jsx)(Te,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Preview a device`})}),(0,K.jsx)(Ee,{className:`text-xs`,children:n?`The values this device would get once your changes are published, now or at the time you pick.`:`The values this device gets from the active version, now or at the time you pick.`})]}),(0,K.jsxs)(we,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:[(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-platform`,children:`Platform`}),(0,K.jsxs)(se,{items:{ios:`iOS`,android:`Android`},onValueChange:e=>{(e===`ios`||e===`android`)&&f(`platform`,e)},value:i.platform,children:[(0,K.jsx)(A,{className:`min-h-11 w-full sm:min-h-9`,id:`${r}-platform`,children:(0,K.jsxs)(ie,{children:[(0,K.jsx)($e,{className:`size-3.5`,platform:i.platform}),i.platform===`ios`?`iOS`:`Android`]})}),(0,K.jsx)(re,{children:(0,K.jsxs)(ae,{children:[(0,K.jsxs)(j,{value:`ios`,children:[(0,K.jsx)($e,{className:`size-3.5`,platform:`ios`}),`iOS`]}),(0,K.jsxs)(j,{value:`android`,children:[(0,K.jsx)($e,{className:`size-3.5`,platform:`android`}),`Android`]})]})})]})]}),[[`channel`,`Channel`,`production`],[`appVersion`,`App version`,`1.0.0`],[`cohort`,`Cohort`,`1-1000 or a name`],[`fingerprintHash`,`Fingerprint`,`Optional`]].map(([e,t,n])=>(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-${e}`,children:t}),(0,K.jsx)(c,{autoComplete:`off`,className:`min-h-11 text-base sm:min-h-9 sm:text-xs`,id:`${r}-${e}`,onChange:t=>f(e,t.target.value),placeholder:n,spellCheck:!1,value:i[e]})]},e)),(0,K.jsxs)(W,{children:[(0,K.jsx)(H,{htmlFor:`${r}-at`,children:`Time`}),(0,K.jsxs)(ut,{className:`h-11 sm:h-9`,children:[(0,K.jsx)(ot,{className:`h-11 text-base tabular-nums sm:h-9 sm:text-xs`,id:`${r}-at`,onChange:e=>f(`at`,e.target.value),type:`datetime-local`,value:i.at}),i.at.length===0?null:(0,K.jsx)(st,{align:`inline-end`,children:(0,K.jsx)(lt,{className:`min-h-11 sm:min-h-6`,onClick:()=>f(`at`,``),size:`xs`,children:`Now`})})]})]})]}),d.length===0?(0,K.jsx)(ze,{className:`border py-8`,children:(0,K.jsxs)(Fe,{children:[(0,K.jsx)(Pe,{variant:`icon`,children:(0,K.jsx)(be,{})}),(0,K.jsx)(Le,{children:`Nothing to preview`}),(0,K.jsx)(Re,{children:`Add a parameter, and its value for this device shows here.`})]})}):u.data?.status===`invalid`?(0,K.jsxs)(L,{variant:`destructive`,children:[(0,K.jsx)(R,{}),(0,K.jsx)(F,{children:`The draft has problems to fix first`}),(0,K.jsx)(I,{children:(0,K.jsx)(`ul`,{className:`list-disc pl-4`,children:u.data.issues.slice(0,5).map(e=>(0,K.jsxs)(`li`,{children:[e.path===``?``:`${e.path}: `,e.message]},`${e.path}:${e.message}`))})})]}):u.isError?(0,K.jsxs)(L,{variant:`destructive`,children:[(0,K.jsx)(R,{}),(0,K.jsx)(F,{children:`The preview couldn't be loaded`}),(0,K.jsx)(I,{children:`Check the connection, then change a field to try again.`})]}):u.data===void 0?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Loading the preview`}),d.slice(0,4).map(t=>(0,K.jsx)(e,{className:`h-8 w-full`},t))]}):(0,K.jsx)(`dl`,{"aria-busy":u.isFetching||void 0,className:`divide-y rounded-lg border`,children:d.map(e=>{let t=u.data.status===`ok`?u.data.parameters[e]:void 0;return(0,K.jsxs)(`div`,{className:`grid gap-1 px-3 py-2.5 sm:grid-cols-[minmax(0,14rem)_minmax(0,1fr)_auto] sm:items-center sm:gap-3`,children:[(0,K.jsx)(`dt`,{className:`truncate font-mono text-xs font-medium`,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0 truncate font-mono text-xs`,children:t===void 0?`…`:t.value===null?(0,K.jsx)(`span`,{className:`font-sans text-muted-foreground`,children:`In-app default`}):(0,K.jsx)(`span`,{title:t.value,children:t.value.length===0?`""`:t.value})}),(0,K.jsx)(`dd`,{children:t?.condition===void 0?null:t.condition===null?(0,K.jsx)(B,{variant:`outline`,children:`Default value`}):(0,K.jsx)(B,{variant:`secondary`,children:t.condition})})]},e)})})]})]})}function qn({name:e,fields:t}){return(0,K.jsxs)(`li`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`break-words font-mono`,children:e}),t.length===0?null:(0,K.jsx)(`ul`,{className:`mt-0.5 flex flex-col gap-0.5`,children:t.map(e=>(0,K.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:e.field}),e.before===null?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`max-w-full truncate font-mono line-through decoration-muted-foreground/60`,title:e.before,children:e.before}),(0,K.jsx)(k,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,K.jsx)(`span`,{className:`sr-only`,children:`to`})]}),(0,K.jsx)(`span`,{className:`max-w-full truncate font-mono text-foreground`,title:e.after,children:e.after})]},e.field))})]})}function Jn({label:e,changes:t,describe:n}){let r=[[`Added`,t.added],[`Changed`,t.changed],[`Removed`,t.removed]];return r.every(([,e])=>e.length===0)?null:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-medium`,children:e}),(0,K.jsx)(`dl`,{className:`mt-1 grid grid-cols-[5rem_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:r.map(([e,t])=>t.length===0?null:(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,K.jsx)(`dd`,{className:`min-w-0`,children:e===`Removed`?(0,K.jsx)(`span`,{className:`break-words font-mono`,children:t.join(`, `)}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:t.map(e=>(0,K.jsx)(qn,{fields:n(e),name:e},e))})})]},e))})]})}function Yn({open:e,onOpenChange:t,base:n,baseVersion:r,draft:i,onPublished:a,onLoadLatest:o,onPublishOver:s}){let l=(0,G.useId)(),u=Ot(),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(null),{dateTimeText:h}=Cn(),g=Xt(n,i),v=e=>{let t=Object.hasOwn(n.parameters,e)?n.parameters[e]:null,r=Object.hasOwn(i.parameters,e)?i.parameters[e]:null;return r===null?[]:Zt(t,r)},y=e=>{let t=n.conditions.find(t=>t.name===e)??null,r=i.conditions.find(t=>t.name===e)??null;return r===null?[]:Qt(t,r,h)},b=d.trim().length>256,x=e=>{u.isPending||(t(e),e||(m(null),u.reset()))};return(0,K.jsx)(at,{onOpenChange:x,open:e,children:(0,K.jsx)(nt,{className:`max-h-[calc(100svh-2rem)] overflow-y-auto sm:max-w-lg`,children:(0,K.jsxs)(`form`,{className:`flex flex-col gap-4`,noValidate:!0,onSubmit:async e=>{if(e.preventDefault(),!b)try{let e=await u.mutateAsync({template:i,baseVersion:r,...d.trim().length===0?{}:{description:d.trim()}});m(e),e.status===`published`&&(N.success(`Published version ${e.version.version}`),f(``),m(null),t(!1),a())}catch(e){N.error(e instanceof Error?e.message:`Unable to publish`)}},children:[(0,K.jsxs)(et,{children:[(0,K.jsx)(rt,{children:`Publish changes`}),(0,K.jsxs)(it,{children:[`This becomes version `,r+1,`. Devices get its values on their next fetch; earlier versions stay available to roll back to.`]})]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border p-3`,children:[(0,K.jsx)(Jn,{changes:g.parameters,describe:v,label:`Parameters`}),(0,K.jsx)(Jn,{changes:g.conditions,describe:y,label:`Conditions`}),g.reordered?(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Condition priority changed.`}):null]}),p?.status===`invalid`?(0,K.jsxs)(L,{variant:`destructive`,children:[(0,K.jsx)(R,{}),(0,K.jsx)(F,{children:`The server refused the template`}),(0,K.jsx)(I,{children:(0,K.jsx)(`ul`,{className:`list-disc pl-4`,children:p.issues.slice(0,6).map(e=>(0,K.jsxs)(`li`,{children:[e.path===``?``:`${e.path}: `,e.message]},`${e.path}:${e.message}`))})})]}):null,p?.status===`conflict`?(0,K.jsxs)(L,{children:[(0,K.jsx)(R,{}),(0,K.jsxs)(F,{children:[`Version `,p.currentVersion,` was published while you edited`]}),(0,K.jsx)(I,{children:`Load it to review what changed, or publish yours after it, replacing its values.`}),(0,K.jsxs)(`div`,{className:`col-span-full mt-2 flex flex-wrap gap-2`,children:[(0,K.jsxs)(_,{onClick:()=>{x(!1),o()},size:`sm`,type:`button`,variant:`outline`,children:[`Load version `,p.currentVersion]}),(0,K.jsx)(_,{onClick:()=>{s(p.currentVersion),m(null)},size:`sm`,type:`button`,variant:`ghost`,children:`Publish mine after it`})]})]}):null,(0,K.jsxs)(W,{"data-invalid":b||void 0,children:[(0,K.jsx)(H,{htmlFor:`${l}-description`,children:`Description`}),(0,K.jsx)(c,{autoComplete:`off`,className:`min-h-11 sm:min-h-9`,id:`${l}-description`,onChange:e=>f(e.target.value),placeholder:`What changed and why`,value:d}),(0,K.jsx)(Ae,{children:`Shown in the version history.`}),(0,K.jsx)(U,{children:b?`Use 256 characters or fewer.`:null})]}),(0,K.jsxs)(tt,{children:[(0,K.jsx)(_,{disabled:u.isPending,onClick:()=>x(!1),type:`button`,variant:`outline`,children:`Cancel`}),(0,K.jsxs)(_,{disabled:u.isPending||p?.status===`conflict`,type:`submit`,children:[u.isPending?(0,K.jsx)(de,{className:`animate-spin motion-reduce:animate-none`,"data-icon":`inline-start`}):(0,K.jsx)(ht,{"data-icon":`inline-start`}),`Publish version `,r+1]})]})]})})})}function Xn({ms:e}){let t=new Date(e);return(0,K.jsx)(`time`,{className:`tabular-nums`,dateTime:t.toISOString(),title:`${t.toISOString().replace(`T`,` `).slice(0,19)} UTC`,children:(0,gt.default)(e).format(`YYYY/MM/DD HH:mm`)})}function Zn({open:t,version:n,onOpenChange:r}){let i=Et(n),a=i.data===null||i.data===void 0?null:JSON.stringify(i.data.template,null,2);return(0,K.jsx)(at,{onOpenChange:r,open:t,children:(0,K.jsxs)(nt,{className:`max-h-[calc(100svh-2rem)] grid-rows-[auto_minmax(0,1fr)] sm:max-w-2xl`,children:[(0,K.jsxs)(et,{children:[(0,K.jsxs)(rt,{children:[`Version `,n]}),(0,K.jsx)(it,{children:`The template as it was published, in the JSON the admin API takes.`})]}),i.isLoading?(0,K.jsx)(e,{className:`h-48 w-full`}):i.isError?(0,K.jsxs)(L,{variant:`destructive`,children:[(0,K.jsx)(R,{}),(0,K.jsx)(F,{children:`This version couldn't be loaded`}),(0,K.jsx)(I,{children:`Check the connection and try again.`}),(0,K.jsx)(z,{children:(0,K.jsxs)(_,{onClick:()=>void i.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(me,{"data-icon":`inline-start`}),`Retry`]})})]}):a===null?(0,K.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Version `,n,` no longer exists.`]}):(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-2`,children:[(0,K.jsx)(`pre`,{className:`min-h-0 overflow-auto rounded-md bg-muted p-3 font-mono text-xs`,children:a}),(0,K.jsxs)(_,{className:`self-end`,onClick:()=>{navigator.clipboard.writeText(a).then(()=>N.success(`Template JSON copied`),()=>N.error(`Unable to copy the template`))},size:`sm`,variant:`outline`,children:[(0,K.jsx)(ce,{"data-icon":`inline-start`}),`Copy JSON`]})]})]})})}function Qn({activeVersion:t,hasDraft:n,onRolledBack:r,onStartEditing:i}){let a=Tt({enabled:!0}),o=kt(),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),d=P(s),f=P(l),p=a.data?.pages.flatMap(e=>e.versions)??[],m=async e=>{if(e.preventDefault(),l!==null)try{let e=await o.mutateAsync({version:l.source,baseVersion:l.next-1});e.status===`published`?(N.success(`Version ${e.version.version} restores version ${l.source}`),r()):e.status===`conflict`?N.error(`Version ${e.currentVersion} was published meanwhile. Review it, then roll back again.`):N.error(`That version no longer exists.`),u(null)}catch(e){N.error(e instanceof Error?e.message:`Unable to roll back`)}};return(0,K.jsxs)(V,{className:`overflow-hidden shadow-sm`,children:[(0,K.jsx)(Ce,{className:`border-b px-4 py-3 sm:px-6`,children:(0,K.jsx)(Te,{className:`text-sm`,children:(0,K.jsx)(`h2`,{children:`Versions`})})}),(0,K.jsx)(we,{className:`p-0`,children:a.isError?(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsxs)(L,{variant:`destructive`,children:[(0,K.jsx)(R,{}),(0,K.jsx)(F,{children:`Versions couldn't be loaded`}),(0,K.jsx)(I,{children:`Check the connection and try again.`}),(0,K.jsx)(z,{children:(0,K.jsxs)(_,{onClick:()=>void a.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(me,{"data-icon":`inline-start`}),`Retry`]})})]})}):a.isLoading?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:p-6`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Loading versions`}),Array.from({length:3},(t,n)=>(0,K.jsx)(e,{className:`h-10 w-full`},n))]}):p.length===0?(0,K.jsxs)(ze,{className:`py-10`,children:[(0,K.jsxs)(Fe,{children:[(0,K.jsx)(Pe,{variant:`icon`,children:(0,K.jsx)(ue,{})}),(0,K.jsx)(Le,{children:`No versions yet`}),(0,K.jsx)(Re,{children:`Your first publish becomes version 1. Every publish after it is kept here, ready to roll back to.`})]}),(0,K.jsx)(Ie,{children:(0,K.jsx)(_,{className:`min-h-11 sm:min-h-7`,onClick:i,children:`Add a parameter`})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`ol`,{"aria-label":`Versions`,className:`divide-y`,children:p.map(e=>(0,K.jsxs)(`li`,{className:`grid gap-2 px-4 py-3 sm:px-6 md:grid-cols-[minmax(0,1fr)_auto] md:items-center`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:`text-sm font-medium tabular-nums`,children:[`Version `,e.version]}),e.version===t?(0,K.jsx)(B,{children:`Active`}):null,e.updateType===`ROLLBACK`?(0,K.jsxs)(B,{variant:`outline`,children:[`Rollback to v`,e.rollbackSource]}):null]}),(0,K.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[(0,K.jsx)(Xn,{ms:e.createdAtMs}),e.description===null||e.updateType===`ROLLBACK`&&e.description===`Rollback to version ${e.rollbackSource}`?null:(0,K.jsxs)(K.Fragment,{children:[` · `,e.description]})]})]}),(0,K.jsxs)(`div`,{className:`flex gap-1 md:justify-end`,children:[(0,K.jsxs)(_,{"aria-label":`View version ${e.version}`,className:`min-h-11 md:min-h-7`,onClick:()=>c(e.version),size:`sm`,variant:`ghost`,children:[(0,K.jsx)(mt,{"data-icon":`inline-start`}),`View`]}),(0,K.jsxs)(_,{"aria-label":`Roll back to version ${e.version}`,className:`min-h-11 md:min-h-7`,disabled:e.version===t,onClick:()=>u({source:e.version,next:t+1}),size:`sm`,variant:`outline`,children:[(0,K.jsx)(he,{"data-icon":`inline-start`}),`Roll back`]})]})]},e.version))}),a.hasNextPage?(0,K.jsx)(`div`,{className:`border-t px-4 py-3 sm:px-6`,children:(0,K.jsxs)(_,{className:`min-h-11 w-full sm:min-h-7 sm:w-auto`,disabled:a.isFetchingNextPage,onClick:()=>void a.fetchNextPage(),variant:`outline`,children:[a.isFetchingNextPage?(0,K.jsx)(de,{className:`animate-spin motion-reduce:animate-none`,"data-icon":`inline-start`}):null,`Load older versions`]})}):null]})}),(0,K.jsx)(Zn,{onOpenChange:e=>{e||c(null)},open:s!==null,version:d}),(0,K.jsx)(Qe,{onOpenChange:e=>{!o.isPending&&!e&&u(null)},open:l!==null,children:(0,K.jsxs)(Ke,{children:[(0,K.jsxs)(Ze,{children:[(0,K.jsxs)(qe,{children:[`Roll back to version `,f?.source,`?`]}),(0,K.jsxs)(Ge,{children:[`Version `,f?.next,` will publish a copy of version`,` `,f?.source,`, and devices get its values on their next fetch.`,n?` Your unpublished changes are discarded.`:``]})]}),(0,K.jsxs)(Ye,{children:[(0,K.jsx)(Xe,{disabled:o.isPending,children:`Cancel`}),(0,K.jsxs)(Je,{disabled:o.isPending,onClick:e=>void m(e),children:[o.isPending?(0,K.jsx)(de,{className:`animate-spin motion-reduce:animate-none`,"data-icon":`inline-start`}):(0,K.jsx)(he,{"data-icon":`inline-start`}),`Roll back`]})]})]})})]})}gt.default.extend(_t.default);var $n=[`parameters`,`conditions`,`preview`,`versions`];function er({tab:t,onTabChange:n}){let r=wt(),[i,a]=(0,G.useState)(null),[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(!1),f=r.data,p=i?.template??f?.template,m=i!==null&&f!==void 0&&!jt(i.template,f.template),h=m&&f!==void 0&&i.baseVersion!==f.version;(0,G.useEffect)(()=>{if(o||f===void 0)return;s(!0);let e=nn(f);e!==null&&(a(e),l(!0))},[f,o]),(0,G.useEffect)(()=>{if(i===null||!m||rn(i))return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[i,m]);let g=()=>{a(null),l(!1),rn(null)},v=e=>{f===void 0||p===void 0||(l(!1),a({baseVersion:i?.baseVersion??f.version,base:i?.base??f.template,template:e(p)}))},b={parameters:p===void 0?null:Object.keys(p.parameters).length,conditions:p?.conditions.length??null};return(0,K.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,K.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b bg-background px-3 py-3 sm:min-h-12 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm`,children:[(0,K.jsx)(y,{className:`-ml-1 size-11 lg:size-7`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(_e,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,K.jsx)(`h1`,{className:`text-sm font-medium`,children:`Remote Config`})]}),f===void 0?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f.version===0?`Nothing published yet`:(0,K.jsxs)(K.Fragment,{children:[`Version `,f.version,f.updatedAtMs===null?null:(0,K.jsxs)(K.Fragment,{children:[` · published `,(0,K.jsx)(`time`,{dateTime:new Date(f.updatedAtMs).toISOString(),title:(0,gt.default)(f.updatedAtMs).format(`YYYY/MM/DD HH:mm:ss`),children:(0,gt.default)(f.updatedAtMs).fromNow()})]})]})}),m?(0,K.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,K.jsx)(B,{className:`hidden sm:inline-flex`,variant:`secondary`,children:`Unpublished changes`}),(0,K.jsxs)(_,{className:`min-h-11 lg:min-h-7`,onClick:g,variant:`ghost`,children:[(0,K.jsx)(Se,{"data-icon":`inline-start`}),`Discard`]}),(0,K.jsxs)(_,{className:`min-h-11 lg:min-h-7`,onClick:()=>d(!0),children:[(0,K.jsx)(ht,{"data-icon":`inline-start`}),`Publish changes`]})]}):null]}),(0,K.jsx)(`div`,{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-5xl flex-col gap-4`,children:[r.isError?(0,K.jsxs)(L,{variant:`destructive`,children:[(0,K.jsx)(R,{}),(0,K.jsx)(F,{children:`Remote Config couldn't be loaded`}),(0,K.jsx)(I,{children:`Check the connection and try again.`}),(0,K.jsx)(z,{children:(0,K.jsxs)(_,{onClick:()=>void r.refetch(),size:`xs`,variant:`outline`,children:[(0,K.jsx)(me,{"data-icon":`inline-start`}),`Retry`]})})]}):null,c&&m&&i!==null?(0,K.jsxs)(L,{children:[(0,K.jsx)(ue,{}),(0,K.jsx)(F,{children:`Your unpublished changes are back`}),(0,K.jsxs)(I,{children:[`This browser kept them from your last visit, on version`,` `,i.baseVersion,`.`]}),(0,K.jsx)(z,{children:(0,K.jsx)(_,{onClick:g,size:`xs`,variant:`outline`,children:`Discard them`})})]}):null,h&&i!==null&&f!==void 0?(0,K.jsxs)(L,{children:[(0,K.jsx)(R,{}),(0,K.jsxs)(F,{children:[`Version `,f.version,` was published while you edited`]}),(0,K.jsxs)(I,{children:[`Your draft started from version `,i.baseVersion,`. Discard it to review version `,f.version,`, or publish yours after it.`]}),(0,K.jsx)(z,{children:(0,K.jsxs)(_,{onClick:g,size:`xs`,variant:`outline`,children:[`Load version `,f.version]})})]}):null,(0,K.jsxs)(We,{onValueChange:e=>n(e),value:t,children:[(0,K.jsx)(Ue,{"aria-label":`Remote Config views`,className:`max-w-full group-data-horizontal/tabs:h-auto`,children:[[`parameters`,`Parameters`,b.parameters],[`conditions`,`Conditions`,b.conditions],[`preview`,`Preview`,null],[`versions`,`Versions`,null]].map(([e,t,n])=>(0,K.jsxs)(Be,{className:`min-h-11 flex-none px-3 lg:min-h-7`,value:e,children:[t,n===null?null:(0,K.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:n})]},e))}),p===void 0||f===void 0?r.isError?null:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 pt-2`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Loading Remote Config`}),(0,K.jsx)(e,{className:`h-14 w-full`}),(0,K.jsx)(e,{className:`h-14 w-full`}),(0,K.jsx)(e,{className:`h-14 w-full`})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ve,{value:`parameters`,children:(0,K.jsx)(Un,{onAddCondition:e=>v(t=>Ft(t,null,e)),onRemoveParameter:e=>v(t=>Nt(t,e)),onSaveParameter:(e,t,n)=>v(r=>Mt(r,e,t,n)),template:p})}),(0,K.jsx)(Ve,{value:`conditions`,children:(0,K.jsx)(Mn,{onMoveCondition:(e,t)=>v(n=>Lt(n,e,t)),onRemoveCondition:e=>v(t=>It(t,e)),onSaveCondition:(e,t)=>v(n=>Ft(n,e,t)),template:p})}),(0,K.jsx)(Ve,{value:`preview`,children:(0,K.jsx)(Kn,{isDraft:m,template:p})}),(0,K.jsx)(Ve,{value:`versions`,children:(0,K.jsx)(Qn,{activeVersion:f.version,hasDraft:m,onRolledBack:g,onStartEditing:()=>n(`parameters`)})})]})]})]})}),f!==void 0&&i!==null?(0,K.jsx)(Yn,{base:f.template,baseVersion:i.baseVersion,draft:i.template,onLoadLatest:g,onOpenChange:d,onPublishOver:e=>a({...i,baseVersion:e,base:f.template}),onPublished:g,open:u}):null]})}var tr=T(`/remote-config`)({beforeLoad:({context:e})=>O(e.queryClient,`remoteConfig`),notFoundComponent:te(()=>E(()=>import(`./remote-config-BIIj0Faf.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`notFoundComponent`),component:te(()=>E(()=>import(`./remote-config-Dm1MCHDN.js`),__vite__mapDeps([8,2])),`component`),validateSearch:e=>$n.includes(e.tab)&&e.tab!==`parameters`?{tab:e.tab}:{}});export{er as n,tr as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,$n as t,Ar as n,Br as r,Cn as i,Di as a,Ei as o,F as s,Fr as c,H as l,I as u,Ir as d,L as f,Ln as p,M as m,Mr as h,Nn as g,On as _,P as v,Q as y,Qn as b,R as x,Ri as S,Sn as C,Tr as w,U as T,Un as ee,Vi as E,Vr as D,Xn as O,Zn as te,_ as ne,_r as re,b as ie,bn as ae,dt as oe,et as se,ft as ce,g as le,gn as ue,gr as k,h as A,jr as de,kr as fe,p as pe,v as j,vn as M,vr as N,w as me,wr as P,xn as F,xr as he,y as I,yn as ge}from"./sidebar-BmzmPGuv.js";import{t as L}from"./link-CRMwpc7-.js";import{t as R}from"./arrow-right-DjRwIoF1.js";import{t as _e}from"./arrow-up-right-C_1ALUCD.js";import{a as ve,i as ye,l as be,n as z,o as xe,r as Se,s as Ce,t as B}from"./routes-CUsayL0T.js";import{t as V}from"./check-C3VCvMOV.js";import{a as we,i as Te,n as Ee,r as De}from"./useCompositeListItem-Cbk_weKW.js";import{i as Oe,r as ke}from"./TargetDisplay-DG_I3qln.js";import{t as Ae}from"./chevron-right-RAuPv9r1.js";import{a as je,d as Me,i as H,n as U,o as Ne,r as Pe,t as Fe,u as W}from"./select-Bk52fOVX.js";import{t as Ie}from"./circle-off-DvYMC5yF.js";import{t as Le}from"./download-CgpaZb23.js";import{t as Re}from"./list-DQ9YBIDW.js";import{t as G}from"./loader-circle-8lunBReu.js";import{C as ze,O as Be,T as Ve,h as He}from"./native-builds-zwqucwx2.js";import{t as Ue}from"./plus-DztQIXYL.js";import{n as K,r as We}from"./dist-BEmib-ZM.js";import{t as Ge}from"./rotate-ccw-tITIe0Bd.js";import{n as Ke,t as qe}from"./switch-CI393qIT.js";import{t as Je}from"./trash-2-DI0biNI-.js";import{a as Ye,i as Xe,n as Ze,o as Qe,r as $e,t as q}from"./badge-zMibJGR5.js";import{S as et,_ as tt,a as nt,i as rt,r as it,v as at,w as ot,y as st}from"./useAnchoredPopupScrollLock-Cvx6CdPD.js";import{a as ct}from"./insights-search-CZtvD-Vf.js";import{a as lt,n as ut,o as dt,r as ft,t as pt}from"./card-BAs80yql.js";import{a as mt,c as ht,d as gt,f as _t,i as vt,l as yt,o as bt,s as xt,u as St}from"./constants-C5gi7fdZ.js";import{a as Ct,c as wt,i as Tt,n as Et,r as Dt,t as Ot}from"./field-DInLQ5oV.js";import{C as kt,S as At,_ as jt,a as Mt,b as Nt,c as Pt,i as Ft,n as It,o as Lt,r as Rt,s as zt,t as Bt,v as Vt,w as Ht,x as Ut,y as Wt}from"./api-eO-sq3Jd.js";import{a as Gt,i as Kt,l as qt,n as Jt,o as Yt,r as Xt,s as Zt,t as Qt}from"./alert-dialog-DGPqJBCk.js";import{n as $t,t as en}from"./PlatformIcon-D4KPXCHL.js";import{a as tn,i as nn,n as rn,o as an,r as on,s as sn,t as cn}from"./dialog-BvZDZzdQ.js";import{a as ln,i as un,n as dn,o as fn,t as pn}from"./input-group-CIjTdxCW.js";import{a as mn,i as J,n as hn,o as gn,r as Y,t as _n}from"./table-DbZPkzdz.js";import{t as vn}from"./BundleIdDisplay-C0X-k49t.js";import{t as yn}from"./ChannelBadge-BgVCJfJs.js";import{t as bn}from"./ChannelPicker-BQKoyxnf.js";import{n as xn,t as Sn}from"./valueToPercent-Db73Kirz.js";import{a as Cn,c as wn,d as Tn,f as En,i as Dn,l as On,n as kn,o as An,p as jn,r as Mn,s as Nn,t as Pn,u as Fn}from"./RelativeTime-5ZP9WlQ6.js";import{n as In,r as Ln,t as Rn}from"./RolloutPercentageBadge-DCtG7c1o.js";import{t as zn}from"./HashValueDisplay-DvwvQchI.js";import{a as Bn,c as Vn,i as Hn,l as Un,n as Wn,o as Gn,r as Kn,s as qn,t as Jn}from"./RowReason-CXMCJ-Jc.js";var Yn=D(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Xn=D(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Zn=D(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Qn=D(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),$n=D(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),er=o();function tr(){return P}function nr(){return!1}function rr(){return!0}function ir(){return(0,er.useSyncExternalStore)(tr,nr,rr)}function ar(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function or(e,t){return e-t}function sr(e,t,n){let r=e.slice();return r[t]=n,r.sort(or)}function cr(e,t,n,r,i,a){let o=e;return o=W(o,n,r),i&&(o=sr(a,t,W(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function lr(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 ur={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...ot},X=E(S()),dr=X.createContext(void 0);function fr(){let e=X.useContext(dr);if(e===void 0)throw Error(fe(62));return e}var Z=a();function pr(e){return`key`in e?p:g}function mr(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?ar(e,t):!1}var hr=X.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:a,disabled:o=!1,id:s,format:c,largeStep:l=10,locale:u,render:d,max:f=100,min:p=0,minStepsBetweenValues:m=0,form:g,name:_,onValueChange:v,onValueCommitted:y,orientation:x=`horizontal`,step:S=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:ee,style:E,...D}=e,O=ce(s),ne=it(O),re=h(v),ie=h(y),{clearErrors:oe}=nt(),{state:se,disabled:le,name:ue,setTouched:k,setDirty:A,validityData:fe,shouldValidateOnChange:pe,validation:j}=et(),{labelId:N}=at(),[P,F]=X.useState(),I=n??rt(N,P),ge=le||o,L=ue??_,[R,_e]=Te({controlled:ee,default:a??p,name:`Slider`}),ve=X.useRef(null),ye=X.useRef(null),be=X.useRef([]),z=X.useRef(null),xe=X.useRef(null),Se=X.useRef(-1),Ce=X.useRef(null),B=X.useRef(null),V=X.useRef(`none`),we=ae(c),[Ee,Oe]=X.useState(-1),[ke,Ae]=X.useState(-1),[je,Me]=X.useState(!1),[H,U]=X.useState(()=>new Map),[Ne,Pe]=X.useState([void 0,void 0]),Fe=h(e=>{Oe(e),e!==-1&&Ae(e)});st(ye,O,R),me(R,()=>{oe(L),pe()?j.commit(R):j.commit(R,!0);let e=fe.initialValue,t;t=Array.isArray(R)&&Array.isArray(e)?!ar(R,e):R!==e,A(t)});let Ie=h(e=>{e&&(ye.current=e)}),Le=Array.isArray(R),Re=X.useMemo(()=>Le?R.slice().sort(or):[W(R,p,f)],[f,p,Le,R]),G=h((e,t)=>{if(Number.isNaN(e)||mr(e,R))return;let n=t??C(`none`,void 0,void 0,{activeThumbIndex:-1});V.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:L}}),n.event=i,B.current=e,re(e,n),!n.isCanceled&&_e(e)}),ze=h((e,t,n)=>{let r=cr(e,t,p,f,Le,Re);if(lr(r,S,m)){let e=pr(n);G(r,C(e,n.nativeEvent,void 0,{activeThumbIndex:t})),k(!0),ie(B.current??r,i(e,n.nativeEvent))}});de(()=>{let e=te(M(ve.current));ge&&b(ve.current,e)&&e.blur()},[ge]),ge&&Ee!==-1&&Fe(-1);let Be=X.useMemo(()=>({...se,activeThumbIndex:Ee,disabled:ge,dragging:je,orientation:x,max:f,min:p,minStepsBetweenValues:m,step:S,values:Re}),[se,Ee,ge,je,f,p,m,x,S,Re]),Ve=X.useMemo(()=>({active:Ee,controlRef:ye,disabled:ge,dragging:je,validation:j,formatOptionsRef:we,handleInputChange:ze,indicatorPosition:Ne,inset:T!==`center`,labelId:I,rootLabelId:ne,largeStep:l,lastUsedThumbIndex:ke,lastChangedValueRef:B,lastChangeReasonRef:V,form:g,locale:u,max:f,min:p,minStepsBetweenValues:m,name:L,onValueCommitted:ie,orientation:x,pressedInputRef:z,pressedThumbCenterOffsetRef:xe,pressedThumbIndexRef:Se,pressedValuesRef:Ce,registerFieldControlRef:Ie,renderBeforeHydration:T===`edge`,setActive:Fe,setDragging:Me,setIndicatorPosition:Pe,setLabelId:F,setValue:G,state:Be,step:S,thumbCollisionBehavior:w,thumbMap:H,thumbRefs:be,values:Re}),[Ee,ye,I,ne,ge,je,j,we,ze,Ne,l,ke,B,V,g,u,f,p,m,L,ie,x,z,xe,Se,Ce,Ie,Fe,Me,Pe,F,G,Be,S,w,T,H,be,Re]),He=he(`div`,e,{state:Be,ref:[t,ve],props:[{"aria-labelledby":I,id:O,role:`group`},j.getValidationProps,D],stateAttributesMapping:ur});return(0,Z.jsx)(dr.Provider,{value:Ve,children:(0,Z.jsx)(De,{elementsRef:be,onMapChange:U,children:He})})});function gr(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function _r(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 vr(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(_r(t),_r(n))))}function yr({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]=W(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]=W(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]=W(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function br({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=W(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=yr({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=W(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:yr({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=W(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 xr=2;function Sr(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 Cr(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 wr=X.forwardRef(function(e,n){let{render:r,className:a,style:o,...s}=e,{disabled:l,dragging:u,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:g,min:v,minStepsBetweenValues:y,onValueCommitted:x,orientation:S,pressedInputRef:w,pressedThumbCenterOffsetRef:T,pressedThumbIndexRef:E,pressedValuesRef:D,registerFieldControlRef:O,renderBeforeHydration:ne,setActive:re,setDragging:ie,setValue:se,state:ce,step:le,thumbCollisionBehavior:ue,thumbRefs:k,values:A}=fr(),de=oe(),fe=A.length>1,pe=S===`vertical`,j=X.useRef(null),N=X.useRef(null),me=h(e=>{e&&N.current==null&&(N.current=c(e).getComputedStyle(e))}),P=X.useRef(null),I=X.useRef(0),L=X.useRef(0),R=ae(A);function _e(e){E.current!==e&&(E.current=e);let t=k.current[e];if(!t){T.current=null,w.current=null;return}w.current=t.querySelector(`input[type="range"]`)}function ve(e){let t=j.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=Sr(N.current,pe),c=L.current,l=(pe?r:n)-s.start-s.end-c*2,u=T.current??0,d=e.x-u,f=e.y-u,p=W(((pe?i-f-s.end:(de===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(g-v)*p+v;if(m=vr(m,le,v),m=W(m,v,g),!fe)return{value:m,thumbIndex:0,didSwap:!1};let h=E.current;if(h<0)return null;let _=br({behavior:ue,values:A,currentValues:R.current??A,initialValues:D.current,pressedIndex:h,nextValue:m,min:v,max:g,step:le,minStepsBetweenValues:y});return ue===`swap`&&_.didSwap?_e(_.thumbIndex):E.current=_.thumbIndex,_}function ye(e){D.current=fe?A.slice():null,R.current=A;let t=E.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=pe?`y`:`x`,r;n=-1;for(let i=0;i<k.current.length;i+=1){let a=k.current[i];if(d(a)){let o=gr(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&_e(n),f){let e=k.current[n];d(e)&&(L.current=e.getBoundingClientRect()[pe?`height`:`width`]/2)}}function be(e){let t=k.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let z=h(e=>{let t=Cr(e,P);if(t==null)return;if(I.current+=1,e.type===`pointermove`&&e.buttons===0){xe(e);return}let n=ve(t);n!=null&&lr(n.value,le,y)&&(!u&&I.current>xr&&ie(!0),se(n.value,C(_,e,void 0,{activeThumbIndex:n.thumbIndex})),R.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&be(n.thumbIndex))});function xe(e){re(-1),ie(!1),w.current=null,T.current=null;let t=Cr(e,P),n=t==null?null:ve(t);if(n!=null){let t=m.current;x(p.current??n.value,i(t,e))}`pointerType`in e&&j.current?.hasPointerCapture(e.pointerId)&&j.current?.releasePointerCapture(e.pointerId),E.current=-1,P.current=null,D.current=null,Ce()}let Se=h(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(P.current=t.identifier);let n=Cr(e,P);if(n!=null){ye(n);let t=ve(n);if(t==null)return;be(t.thumbIndex),se(t.value,C(ee,e,void 0,{activeThumbIndex:t.thumbIndex})),R.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&be(t.thumbIndex)}I.current=0;let r=M(j.current);r.addEventListener(`touchmove`,z,{passive:!0}),r.addEventListener(`touchend`,xe,{passive:!0})}),Ce=h(()=>{let e=M(j.current);e.removeEventListener(`pointermove`,z),e.removeEventListener(`pointerup`,xe),e.removeEventListener(`touchmove`,z),e.removeEventListener(`touchend`,xe),D.current=null}),B=ge();return X.useEffect(()=>{let e=j.current;if(!e)return()=>Ce();let t=F(e,`touchstart`,Se,{passive:!0});return()=>{t(),B.cancel(),Ce()}},[Ce,Se,j,B]),X.useEffect(()=>{l&&Ce()},[l,Ce]),he(`div`,e,{state:ce,ref:[n,O,j,me],props:[{"data-base-ui-slider-control":ne?``:void 0,onPointerDown(e){let n=j.current,r=t(e.nativeEvent);if(!n||l||e.defaultPrevented||!d(r)||e.button!==0)return;let i=Cr(e,P);if(i!=null){ye(i);let t=ve(i);if(t==null)return;b(k.current[t.thumbIndex],te(M(n)))?e.preventDefault():B.request(()=>{be(t.thumbIndex)}),ie(!0),T.current??(se(t.value,C(ee,e.nativeEvent,void 0,{activeThumbIndex:t.thumbIndex})),R.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&be(t.thumbIndex))}e.nativeEvent.pointerId&&n.setPointerCapture(e.nativeEvent.pointerId),I.current=0;let a=M(j.current);a.addEventListener(`pointermove`,z,{passive:!0}),a.addEventListener(`pointerup`,xe,{once:!0})}},s],stateAttributesMapping:ur})}),Tr=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=fr();return he(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:ur})}),Er=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}({}),Dr=new Set([...f,T,l]);function Or(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${xn(e[t],r,n)} start range`:`${xn(e[t],r,n)} end range`:n?xn(e[t],r,n):void 0}function kr(e,t,n,r,i){let a=n===1?e+t:e-t;return W(Number(a.toFixed(Math.max(_r(e),_r(t),_r(r)))),r,i)}var Ar=X.forwardRef(function(e,t){let{render:r,children:i,className:a,"aria-describedby":o,"aria-label":d,"aria-labelledby":p,disabled:g=!1,getAriaLabel:_,getAriaValueText:y,id:b,index:S,inputRef:C,onBlur:ee,onFocus:E,onKeyDown:D,tabIndex:te,style:ne,...re}=e,{nonce:ie}=Me(),ae=ce(b),{active:se,lastUsedThumbIndex:le,controlRef:k,disabled:A,validation:fe,formatOptionsRef:pe,handleInputChange:j,inset:M,labelId:N,largeStep:me,locale:P,max:F,min:I,minStepsBetweenValues:ge,form:L,name:R,orientation:_e,pressedInputRef:ve,pressedThumbCenterOffsetRef:ye,pressedThumbIndexRef:be,renderBeforeHydration:z,setActive:xe,setIndicatorPosition:Se,state:Ce,step:B,values:V}=fr(),we=oe(),Te=g||A,De=V.length>1,Oe=_e===`vertical`,ke=we===`rtl`,{setTouched:Ae,setFocused:je,validationMode:H}=et(),U=X.useRef(null),Ne=X.useRef(null),Pe=X.useRef(!1),Fe=ce(),W=tt(),Ie=De?Fe:W,{ref:Le,index:Re}=Ee({metadata:X.useMemo(()=>({inputId:Ie}),[Ie])}),G=De?S??Re:0,ze=G===V.length-1,Be=V[G],Ve=Sn(Be,I,F),[He,Ue]=X.useState(),K=ir(),We=le>=0&&le<V.length?le:-1,Ge=h(()=>{let e=k.current,t=U.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*Ve/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ue(s),G===0?Se(e=>[s,e[1]]):ze&&Se(e=>[e[0],s])});de(()=>{M&&queueMicrotask(Ge)},[Ge,M]),de(()=>{M&&Ge()},[Ge,M,Ve]),de(()=>{if(!M)return;let e=k.current,t=U.current;if(!e||!t)return;let n=c(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Ge);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[k,Ge,M]);let Ke=Oe?`bottom`:`insetInlineStart`,qe=Oe?`left`:`top`,Je;De?se===G?Je=2:We===G&&(Je=1):se===G&&(Je=1);let Ye;Ye=M?{"--position":`${He??0}%`,visibility:z&&K||He===void 0?`hidden`:void 0,position:`absolute`,[Ke]:`var(--position)`,[qe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Je}:Number.isFinite(Ve)?{position:`absolute`,[Ke]:`${Ve}%`,[qe]:`50%`,translate:`${(Oe||!ke?-1:1)*50}% ${(Oe?1:-1)*50}%`,zIndex:Je}:ue;let Xe;_e===`vertical`&&(Xe=ke?`vertical-rl`:`vertical-lr`);let Ze=typeof _==`function`?_(G):d,Qe=n({"aria-label":Ze,"aria-labelledby":p??(Ze==null?N:void 0),"aria-describedby":o,"aria-orientation":_e,"aria-valuenow":Be,"aria-valuetext":typeof y==`function`?y(xn(Be,P,pe.current??void 0),Be,G):Or(V,G,pe.current??void 0,P),disabled:Te,form:L,id:Ie,max:F,min:I,name:R,onChange(e){j(e.currentTarget.valueAsNumber,G,e)},onFocus(e){let t=Pe.current;Pe.current=!1,xe(G),je(!0),t&&e.stopPropagation()},onBlur(e){if(Pe.current){e.stopPropagation();return}U.current&&(xe(-1),Ae(!0),je(!1),H===`onBlur`&&fe.commit(cr(Be,G,I,F,De,V)))},onKeyDown(e){if(!Dr.has(e.key))return;f.has(e.key)&&e.stopPropagation();let t=null,n=vr(Be,B,I);switch(e.key){case u:t=kr(n,e.shiftKey?me:B,1,I,F);break;case s:t=kr(n,e.shiftKey?me:B,ke?-1:1,I,F);break;case m:t=kr(n,e.shiftKey?me:B,-1,I,F);break;case v:t=kr(n,e.shiftKey?me:B,ke?1:-1,I,F);break;case T:t=kr(n,me,1,I,F);break;case l:t=kr(n,me,-1,I,F);break;case`End`:t=F,De&&(t=Number.isFinite(V[G+1])?V[G+1]-B*ge:F);break;case x:t=I,De&&(t=Number.isFinite(V[G-1])?V[G-1]+B*ge:I);break;default:break}if(t!==null){let n=e.currentTarget;O(n)||(Pe.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),j(t,G,e),e.preventDefault()}},step:B,style:{...ue,width:`100%`,height:`100%`,writingMode:Xe},tabIndex:te??void 0,type:`range`,value:Be??``},fe.getInputValidationProps),$e=w(Ne,fe.inputRef,C);return he(`div`,e,{state:Ce,ref:[t,Le,U],props:[{[Er.index]:G,children:(0,Z.jsxs)(X.Fragment,{children:[i,(0,Z.jsx)(`input`,{ref:$e,...Qe,suppressHydrationWarning:!0}),M&&K&&z&&ze&&(0,Z.jsx)(`script`,{nonce:ie,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:ae,onBlur:ee,onFocus:E,onPointerDown(e){if(be.current=G,U.current!=null){let t=_e===`horizontal`?`x`:`y`,n=gr(U.current);ye.current=(_e===`horizontal`?e.clientX:e.clientY)-n[t]}Ne.current!=null&&ve.current!==Ne.current&&(ve.current=Ne.current)},style:Ye,suppressHydrationWarning:z||void 0},re],stateAttributesMapping:ur})});function jr(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 Mr(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 Nr=X.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}=fr(),m=ir(),h=u===`vertical`,g=p.length>1,_=s?jr(h,g,o[0],o[1],d,m):Mr(h,g,Sn(p[0],l,c),Sn(p[p.length-1],l,c));return he(`div`,e,{state:f,ref:t,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:_,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:ur})});function Pr({enabled:e,className:t,falseIcon:n=`x`,colorMode:i=`semantic`}){let a=i===`inherit`?`text-current`:void 0;return e?(0,Z.jsx)(V,{className:N(`h-4 w-4`,a??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Z.jsx)(Zn,{className:N(`h-4 w-4`,a??`text-muted-foreground`,t)}):(0,Z.jsx)(r,{className:N(`h-4 w-4`,a??`text-red-600 dark:text-red-400`,t)})}function Fr({panelId:t,bundle:n,bundles:r,loading:i,onDetailClick:a}){let o=A();return(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:t,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Z.jsx)(vn,{bundleId:n.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(q,{variant:`outline`,children:[r.length,` `,r.length===1?`patch`:`patches`]})]}),i?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):r.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),o?(0,Z.jsx)(`div`,{className:`flex flex-col gap-2`,children:r.map(e=>(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Z.jsx)(vn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Z.jsx)(vn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(R,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Z.jsx)(vn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Z.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Z.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Z.jsx)(Ln,{uuid:e.id})})]})]}),(0,Z.jsx)(k,{className:`w-full`,onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Z.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Z.jsxs)(_n,{className:`min-w-max`,children:[(0,Z.jsx)(mn,{children:(0,Z.jsxs)(gn,{className:`hover:bg-transparent`,children:[(0,Z.jsx)(J,{children:`Target artifact ID`}),(0,Z.jsx)(J,{children:`Relation`}),(0,Z.jsx)(J,{children:`Artifact`}),(0,Z.jsx)(J,{children:`Created`}),(0,Z.jsx)(J,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Z.jsx)(hn,{children:r.map(e=>(0,Z.jsxs)(gn,{children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(vn,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Z.jsx)(vn,{bundleId:n.id,fullOnMobile:!0,maxLength:12}),(0,Z.jsx)(R,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Z.jsx)(vn,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(q,{variant:`secondary`,children:`bsdiff`})}),(0,Z.jsx)(Y,{className:`tabular-nums`,children:(0,Z.jsx)(Ln,{uuid:e.id})}),(0,Z.jsx)(Y,{className:`text-right`,children:(0,Z.jsx)(k,{onClick:()=>a(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Z.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function Ir({open:e,onOpenChange:t}){let[n,r]=(0,X.useState)(``),[i,a]=(0,X.useState)(null),o=Ke(i),{data:s=[],isPending:c}=Ft(),l=Lt(),u=zt(),d=n.trim(),f=async e=>{if(e.preventDefault(),!(!d||l.isPending))try{let e=await l.mutateAsync({name:d});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)}},p=async()=>{if(!(!i||u.isPending))try{let e=await u.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,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{open:e,onOpenChange:t,children:(0,Z.jsxs)(rn,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(tn,{children:[(0,Z.jsxs)(an,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Qn,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Z.jsx)(on,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Z.jsx)(`form`,{onSubmit:f,children:(0,Z.jsx)(Tt,{className:`gap-2`,children:(0,Z.jsxs)(Ot,{orientation:`horizontal`,children:[(0,Z.jsx)(Ct,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Z.jsx)(y,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:l.isPending}),(0,Z.jsxs)(k,{className:`max-md:h-11`,type:`submit`,disabled:!d||l.isPending,children:[l.isPending?(0,Z.jsx)(G,{"data-icon":`inline-start`,className:`animate-spin motion-reduce:animate-none`}):(0,Z.jsx)(Ue,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Z.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:c?(0,Z.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Z.jsx)(G,{className:`mr-2 size-3.5 animate-spin motion-reduce:animate-none`}),`Loading channels`]}):s.length===0?(0,Z.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:s.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Z.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,title:e.name,children:e.name}),(0,Z.jsx)(k,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:u.isPending,onClick:()=>a(e),className:`text-muted-foreground hover:text-destructive max-md:size-11`,children:(0,Z.jsx)(Je,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Z.jsx)(Qt,{open:i!==null,onOpenChange:e=>{!e&&!u.isPending&&a(null)},children:(0,Z.jsxs)(Kt,{children:[(0,Z.jsxs)(Zt,{children:[(0,Z.jsxs)(qt,{children:[`Delete `,o?.name,`?`]}),(0,Z.jsx)(Gt,{children:`Only empty channels can be removed. The server checks this when you delete it, and the channel can be created again later with a new ID.`})]}),(0,Z.jsxs)(Yt,{children:[(0,Z.jsx)(Xt,{disabled:u.isPending,children:`Cancel`}),(0,Z.jsx)(Jt,{variant:`destructive`,disabled:u.isPending,onClick:e=>{e.preventDefault(),p()},children:u.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var Lr=`[a-zA-Z0-9-]`,Rr=String.raw`0|[1-9]\d*`,zr=String.raw`\d+`,Br=String.raw`\d*[a-zA-Z-]${Lr}*`,Vr=String.raw`(${Rr})\.(${Rr})\.(${Rr})`,Hr=String.raw`(${zr})\.(${zr})\.(${zr})`,Ur=`(?:${Br}|${Rr})`,Wr=`(?:${Br}|${zr})`,Gr=String.raw`(?:-(${Ur}(?:\.${Ur})*))`,Kr=String.raw`(?:-?(${Wr}(?:\.${Wr})*))`,qr=`${Lr}+`,Jr=String.raw`(?:\+(${qr}(?:\.${qr})*))`,Yr=`v?${Vr}${Gr}?${Jr}?`,Xr=String.raw`[v=\s]*${Hr}${Kr}?${Jr}?`,Zr=`((?:<|>)?=?)`,Qr=String.raw`${Rr}|x|X|\*`,$r=String.raw`${zr}|x|X|\*`,ei=String.raw`[v=\s]*(${Qr})(?:\.(${Qr})(?:\.(${Qr})(?:${Gr})?${Jr}?)?)?`,ti=String.raw`[v=\s]*(${$r})(?:\.(${$r})(?:\.(${$r})(?:${Kr})?${Jr}?)?)?`,ni=`(?:~>?)`,ri=String.raw`(?:\^)`,ii=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${ii}(?:$|[^\d])`,String.raw`${ii}(?:${Gr})?(?:${Jr})?(?:$|[^\d])`;function ai(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[Lr,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(ai(e),t)}var oi=Q(`^${Yr}$`),si=Q(`^${Xr}$`),ci=/^\d+$/;function li(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function ui(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?si:oi);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(ci.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 di=Q(String.raw`^${Zr}\s*(${Yr})$|^$`),fi=Q(String.raw`^${Zr}\s*(${Xr})$|^$`);function pi(e){return e.version?`${e.operator}${li(e.version)}`:``}function mi(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?fi:di);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?ui(r[2],t):null;return{operator:i,options:t,value:a?`${i}${li(a)}`:``,version:a}}function hi(e){return e.sets.map(e=>e.map(pi).join(` `)).join(`||`)}var gi=new RegExp(Jr,`g`),_i=Q(Jr),vi=Q(String.raw`^\s*(${ei})\s+-\s+(${ei})\s*$`),yi=Q(String.raw`^\s*(${ti})\s+-\s+(${ti})\s*$`),bi=Q(String.raw`(\s*)${Zr}\s*(${Xr}|${ei})`,`g`),xi=Q(String.raw`(\s*)${ni}\s+`,`g`),Si=Q(String.raw`(\s*)${ri}\s+`,`g`),Ci=Q(`^${ni}${ei}$`),wi=Q(`^${ni}${ti}$`),Ti=Q(`^${ri}${ei}$`),Ei=Q(`^${ri}${ti}$`),Di=Q(String.raw`^${Zr}\s*${ei}$`),Oi=Q(String.raw`^${Zr}\s*${ti}$`),ki=Q(String.raw`(<|>)?=?\s*\*`),Ai=/^\s*>=\s*0\.0\.0\s*$/,ji=/^\s*>=\s*0\.0\.0-0\s*$/,Mi=Q(String.raw`^${Zr}\s*(${Xr})$|^$`);function $(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function Ni(e,t,n){return $(e)&&!$(t)||$(t)&&!!n&&!$(n)}function Pi(e,t){let n=t.loose?wi:Ci,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 Fi(e,t){return e.trim().split(/\s+/).map(e=>Pi(e,t)).join(` `)}function Ii(e,t){let n=t.loose?Ei: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 Li(e,t){return e.trim().split(/\s+/).map(e=>Ii(e,t)).join(` `)}function Ri(e,t){let n=t.loose?Oi:Di;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(Ni(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 zi(e,t){return e.split(/\s+/).map(e=>Ri(e,t)).join(` `)}function Bi(e,t){let n=t.loose?yi:vi;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 Vi(e,t){return zi(Fi(Li(e.replace(_i,``),t),t),t).trim().replace(ki,``)}function Hi(e,t){let n=Bi(e.replace(gi,``),t).replace(bi,`$1$2$3`).replace(xi,`$1~`).replace(Si,`$1^`).split(` `).map(e=>Vi(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?ji:Ai,``));t.loose&&(n=n.filter(e=>Mi.test(e)));let r=new Map;for(let e of n.map(e=>mi(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 Ui(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>Hi(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 Wi(e,t={}){try{return Ui(e,t)}catch{return null}}function Gi(e,t={}){let n=Wi(e,t);return n?hi(n)||`*`:null}function Ki({label:e,value:t}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Z.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function qi({bundle:e,release:t}){let{data:n,isFetched:r}=Mt(),i=e?yt(e):null,a=e?ht(e):null,o=e?.gitCommitHash&&r?In(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.manifestFileHash||a||i?(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(lt,{className:`p-4 pb-3`,children:(0,Z.jsx)(dt,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Z.jsx)(ut,{className:`px-4 pb-4`,children:(0,Z.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Z.jsx)(Ki,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Z.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Z.jsx)(Ki,{label:`Git commit`,value:(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Z.jsx)(zn,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Z.jsx)(`a`,{"aria-label":`Open git commit`,className:`relative shrink-0 text-primary after:absolute after:-inset-2.5 hover:underline md:after:hidden`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Z.jsx)(Yn,{"aria-hidden":`true`})}):null]})}):null,e?.manifestFileHash?(0,Z.jsx)(Ki,{label:`Manifest hash`,value:(0,Z.jsx)(zn,{maxLength:16,value:e.manifestFileHash})}):null,a?(0,Z.jsx)(Ki,{label:`Base hash`,value:(0,Z.jsx)(zn,{maxLength:16,value:a})}):null,i?(0,Z.jsx)(Ki,{label:`Patch hash`,value:(0,Z.jsx)(zn,{maxLength:16,value:i})}):null]})})]}):null}var Ji=Array.from({length:mt},(e,t)=>t+1);function Yi({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=_t(t),i=n??[],a=i.length>0,o=r>0&&r<1e3,s=r===mt,c=A(),l=s?Ji:o?Ji.filter(t=>bt(e,t)<r):[],u=(r/10).toFixed(1),d=s?mt:l.length,f=mt-d,p=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(pt,{children:(0,Z.jsxs)(lt,{className:`p-4`,children:[(0,Z.jsx)(ft,{children:`Selected cohorts`}),(0,Z.jsx)(dt,{className:`font-mono text-2xl tabular-nums`,children:d})]})}),(0,Z.jsx)(pt,{children:(0,Z.jsxs)(lt,{className:`p-4`,children:[(0,Z.jsx)(ft,{children:`Excluded cohorts`}),(0,Z.jsx)(dt,{className:`font-mono text-2xl tabular-nums`,children:f})]})})]}),a?(0,Z.jsxs)(pt,{children:[(0,Z.jsxs)(lt,{className:`p-4 pb-3`,children:[(0,Z.jsx)(dt,{className:`text-sm`,children:`Additional cohorts`}),(0,Z.jsx)(ft,{children:`Always included in addition to the percentage rollout.`})]}),(0,Z.jsx)(ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Z.jsx)(q,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(lt,{className:`p-4 pb-3`,children:(0,Z.jsx)(dt,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Z.jsx)(ut,{className:`p-4 pt-0`,children:(0,Z.jsx)(`div`,{className:`max-h-[50vh] overflow-y-auto overscroll-contain rounded-lg border bg-muted/20 p-3 sm:max-h-[45vh]`,children:l.length>0?(0,Z.jsx)(`div`,{"aria-label":`Included numeric cohorts`,className:`grid grid-cols-3 gap-2 sm:grid-cols-6 lg:grid-cols-8`,role:`list`,children:l.map(e=>(0,Z.jsx)(q,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Z.jsxs)(cn,{children:[(0,Z.jsxs)(sn,{render:(0,Z.jsx)(k,{className:`max-md:h-11`,size:`sm`,type:`button`,variant:`outline`}),children:[(0,Z.jsx)(Re,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Z.jsx)(rn,{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,Z.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Z.jsxs)(tn,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Z.jsx)(an,{children:`Rolled out cohorts`}),(0,Z.jsxs)(on,{children:[u,`% includes `,d,` of`,` `,mt,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:p}),(0,Z.jsx)(nn,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(tn,{children:[(0,Z.jsx)(an,{children:`Rolled out cohorts`}),(0,Z.jsxs)(on,{children:[u,`% includes `,d,` of`,` `,mt,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),p,(0,Z.jsx)(nn,{showCloseButton:!0})]})})]})}function Xi({release:t,channel:n,bundle:r}){let i=t.bundle_id===null?null:{platform:t.platform,channel:n,fingerprintHash:t.fingerprint_hash,targetAppVersion:t.target_app_version},a=i!==null&&Ve(i)!==null,o=Ut(a?i:null);if(!a)return null;let s=o.data;return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Native build`}),o.isPending?(0,Z.jsx)(e,{className:`h-4 w-40`}):s?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{className:`inline-flex flex-wrap items-center gap-x-1 gap-y-0.5 text-xs text-foreground underline-offset-4 hover:underline`,params:{buildId:s.id},to:`/native-builds/$buildId`,children:[ze(s.platform),` `,He[s.artifact_kind].label,` ·`,` `,(0,Z.jsx)(`span`,{className:`font-mono`,translate:`no`,children:s.min_bundle_id}),(0,Z.jsx)(_e,{"aria-hidden":`true`,className:`size-3`})]}),r?(0,Z.jsx)(q,{variant:`secondary`,children:(r.patches??[]).some(({baseBundleId:e})=>e===s.min_bundle_id)?`Patches from it`:`No patch from it`}):null]}):o.isError?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Couldn't load the scope's native build.`,` `,(0,Z.jsx)(`button`,{className:`underline underline-offset-4`,onClick:()=>void o.refetch(),type:`button`,children:`Retry`})]}):(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`None tracked for this scope ·`,` `,(0,Z.jsx)(L,{className:`relative underline-offset-4 after:absolute after:-inset-x-2 after:-inset-y-4 hover:text-foreground hover:underline md:after:hidden`,search:{channel:n},to:`/native-builds`,children:`This channel's builds`})]})]})}function Zi({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=Array.isArray(n)?n:n===void 0?Array.isArray(t)?t:t===void 0?[r]:[t]:[n];return(0,Z.jsx)(hr,{className:N(`data-horizontal:w-full data-vertical:h-full`,e),"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,thumbAlignment:`edge`,...a,children:(0,Z.jsxs)(wr,{className:`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,children:[(0,Z.jsx)(Tr,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-primary/20 select-none data-horizontal:h-1.5 data-horizontal:w-full data-vertical:h-full data-vertical:w-1.5`,children:(0,Z.jsx)(Nr,{"data-slot":`slider-range`,className:`bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,Z.jsx)(Ar,{"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 max-md:after:-inset-3.5 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var Qi=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],$i=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]}),ea=(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}),ta=e=>(e/10).toFixed(1),na=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},ra=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function ia({value:e,onChange:t}){let[n,r]=(0,X.useState)(ta(e)),[i,a]=(0,X.useState)(!1);return(0,X.useEffect)(()=>{i||r(ta(e))},[i,e]),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Zi,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Z.jsxs)(pn,{className:`w-24 shrink-0`,children:[(0,Z.jsx)(un,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=ra(n)??e;a(!1),r(ta(i)),t(i)},onChange:e=>{let n=na(e.target.value);r(n);let i=ra(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Z.jsx)(dn,{align:`inline-end`,children:(0,Z.jsx)(ln,{children:`%`})})]})]})}function aa({channels:t,onOpenChange:n,onShowScope:i,open:a,releaseId:o}){let s=At(o),c=s.data,l=Rt(c?.bundle_id??``),u=l.data,d=u?xt(u):null,f=Wt(c?.scope_key??``),p=Ht(),m=jt(),h=Pt(),g=Vt(),[_,v]=(0,X.useState)(null),[b,x]=(0,X.useState)(``),[S,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1),[ee,E]=(0,X.useState)(!1),[D,O]=(0,X.useState)(!1),[te,re]=(0,X.useState)(``),[ae,oe]=(0,X.useState)(`move`);(0,X.useEffect)(()=>{v(c?$i(c):null),C(``)},[c]);let ce=c?$i(c):null,ue=_!==null&&ce!==null&&JSON.stringify(_)!==JSON.stringify(ce),A=m.isPending||p.isPending||h.isPending||g.isPending,de=()=>{if(!A){if(ue){T(!0);return}n(!1)}},fe=()=>{if(!_)return;let e=gt(b);if(!St(e)){C(vt);return}v({..._,targetCohorts:Array.from(new Set([..._.targetCohorts,e]))}),x(``),C(``)},pe=async()=>{if(!c||!_)return;let e=_.targetCohorts.map(gt);if(e.some(e=>!St(e))){C(vt);return}if(c.strategy===`APP_VERSION`&&!Gi(_.targetAppVersion.trim())){C(`Enter a valid target app version range.`);return}let t={expectedRevision:c.revision,patch:ea(c,{..._,targetCohorts:e}),releaseId:c.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.`)}},M=t.find(e=>e.id===c?.channel_id)?.name??c?.channel_id,N=t.filter(e=>e.id!==c?.channel_id),me=N.map(e=>({label:e.name,value:e.name})),P=te.trim(),F=ae===`copy`,he=_?Gi(_.targetAppVersion.trim()):null,ge=()=>{re(``),oe(`move`)},L=e=>{!e&&g.isPending||(O(e),e||ge())};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(le,{onOpenChange:e=>e?void 0:de(),open:a,children:(0,Z.jsxs)(ne,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Z.jsxs)(I,{className:`shrink-0 pr-12`,children:[(0,Z.jsx)(ie,{children:`Bundle Detail`}),(0,Z.jsx)(j,{className:`sr-only`,children:`Edit bundle delivery settings.`}),c?(0,Z.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(en,{className:`size-4`,platform:c.platform}),(0,Z.jsx)(`span`,{className:`font-medium`,children:c.platform===`ios`?`iOS`:`Android`})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Z.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Z.jsx)(vn,{bundleId:c.id,fullOnMobile:!0,maxLength:18}),c.bundle_id?null:(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in bundle`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:M})]}),M?(0,Z.jsx)(Xi,{bundle:u,channel:M,release:c}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Z.jsx)(`span`,{className:`text-xs text-foreground`,children:c.platform===`ios`?`iOS`:`Android`})]})]}):(0,Z.jsx)(e,{className:`h-12 w-full`})]}),(0,Z.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[s.isError?(0,Z.jsxs)(Ze,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Bundle details could not be loaded`}),(0,Z.jsx)(Xe,{children:s.error.message})]}):null,c&&_?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[M?(0,Z.jsx)(Ce,{release:{platform:c.platform,channel:M,releaseId:c.id,builtIn:!c.bundle_id}}):null,(0,Z.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Z.jsxs)(Tt,{className:`gap-6`,children:[(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(Ct,{htmlFor:`release-message`,children:`Message`}),(0,Z.jsx)(fn,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>v({..._,message:e.target.value}),rows:3,value:_.message})]}),c.strategy===`APP_VERSION`?(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(Ct,{htmlFor:`release-target`,children:`Target app version`}),(0,Z.jsx)(y,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>v({..._,targetAppVersion:e.target.value}),value:_.targetAppVersion}),he?(0,Z.jsx)(Et,{children:he}):null]}):null,(0,Z.jsx)(Ot,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ct,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Z.jsx)(ct,{label:`About Enabled`,children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Z.jsx)(qe,{"aria-label":`Enabled`,checked:_.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>v({..._,enabled:e})})]})}),(0,Z.jsx)(Ot,{children:(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Ct,{htmlFor:`release-force-update`,children:`Force update`}),(0,Z.jsx)(ct,{label:`About Force update`,children:`Devices apply this bundle right away, and so do devices that skip it to update straight to a newer bundle.`})]}),(0,Z.jsx)(qe,{"aria-label":`Force update`,checked:_.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>v({..._,shouldForceUpdate:e})})]})}),(0,Z.jsxs)(Ot,{children:[(0,Z.jsx)(Ct,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Z.jsx)(ia,{onChange:e=>v({..._,rolloutCohortCount:e}),value:_.rolloutCohortCount})]}),(0,Z.jsxs)(Ot,{children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(Ct,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Z.jsx)(Yi,{releaseId:c.id,rolloutCohortCount:_.rolloutCohortCount,targetCohorts:_.targetCohorts})]}),(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(y,{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,Z.jsx)(k,{"aria-label":`Add cohort`,className:`max-md:size-11`,disabled:!b.trim(),onClick:fe,size:`icon`,type:`button`,variant:`outline`,children:(0,Z.jsx)(Ue,{})})]}),_.targetCohorts.length?(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:_.targetCohorts.map(e=>(0,Z.jsxs)(q,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Z.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>v({..._,targetCohorts:_.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]},e))}):null,(0,Z.jsx)(Et,{children:`Public names—no IDs or secrets.`})]})]}),S?(0,Z.jsx)(Dt,{children:S}):null,(0,Z.jsx)(k,{className:`w-full max-md:h-11`,disabled:!ue||A,onClick:pe,size:`lg`,children:m.isPending||p.isPending?`Saving…`:`Save changes`})]}),(0,Z.jsx)(se,{className:`my-2`}),(0,Z.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Z.jsx)(k,{className:`w-full max-md:h-11`,disabled:!c.bundle_id||A,onClick:()=>O(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),c.bundle_id?(0,Z.jsxs)(k,{className:`w-full max-md:h-11`,disabled:A,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(c.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),K.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Z.jsx)(Le,{"data-icon":`inline-start`}),`Download manifest`]}):null,(0,Z.jsx)(k,{className:`w-full max-md:h-11`,disabled:c.enabled||A,onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),c.bundle_id&&l.isPending?(0,Z.jsx)(e,{className:`h-40 w-full`}):null,c.bundle_id&&l.isError?(0,Z.jsxs)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Build details are unavailable`}),(0,Z.jsx)(Xe,{children:`Delivery settings are unaffected.`})]}):null,!c.bundle_id||!l.isPending?(0,Z.jsx)(qi,{bundle:u,release:c}):null,(0,Z.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Z.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Z.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.bundle_id??`Built-in bundle`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Revision`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:c.revision})]}),d?(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:d})]}):null,(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog generation`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?.generation??`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`dt`,{children:`Catalog size`}),(0,Z.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:f.data?`${f.data.byte_size} bytes`:`—`})]}),(0,Z.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Z.jsx)(`dt`,{children:`Scope key`}),(0,Z.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c.scope_key}),i?(0,Z.jsx)(k,{className:`mt-1 h-auto px-0 text-xs max-md:min-h-11`,onClick:()=>i(c.scope_key),size:`sm`,variant:`link`,children:`Show bundles for this target`}):null]})]}),f.isError?(0,Z.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Z.jsx)(Qt,{onOpenChange:T,open:w,children:(0,Z.jsxs)(Kt,{children:[(0,Z.jsxs)(Zt,{children:[(0,Z.jsx)(qt,{children:`Discard unsaved changes?`}),(0,Z.jsx)(Gt,{children:`Your Bundle changes will be lost.`})]}),(0,Z.jsxs)(Yt,{children:[(0,Z.jsx)(Xt,{children:`Keep editing`}),(0,Z.jsx)(Jt,{onClick:()=>{T(!1),n(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Z.jsx)(Qt,{onOpenChange:E,open:ee,children:(0,Z.jsxs)(Kt,{children:[(0,Z.jsxs)(Zt,{children:[(0,Z.jsxs)(qt,{children:[`Remove this Bundle from `,M??`the channel`,`?`]}),(0,Z.jsx)(Gt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Z.jsxs)(Yt,{children:[(0,Z.jsx)(Xt,{children:`Cancel`}),(0,Z.jsx)(Jt,{onClick:async()=>{if(c)try{await h.mutateAsync({expectedRevision:c.revision,releaseId:c.id}),K.success(`Bundle removed from ${M??`the channel`}`),E(!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,Z.jsx)(cn,{onOpenChange:L,open:D,children:(0,Z.jsxs)(rn,{showCloseButton:!g.isPending,children:[(0,Z.jsxs)(tn,{children:[(0,Z.jsx)(an,{children:`Promote to Channel`}),(0,Z.jsx)(on,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(wt,{htmlFor:`promote-action`,children:`Action`}),(0,Z.jsxs)(Fe,{disabled:g.isPending,items:Qi,onValueChange:e=>oe(e),value:ae,children:[(0,Z.jsx)(je,{className:`w-full`,id:`promote-action`,children:(0,Z.jsx)(Ne,{placeholder:`Select an action`})}),(0,Z.jsx)(U,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(H,{value:`move`,children:`Move bundle`}),(0,Z.jsx)(H,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F?`Make this Bundle available in the target channel and keep it in the current channel.`:`Move this Bundle to the target channel. Devices in the current channel may fall back to an earlier Bundle.`})]}),(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(wt,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Z.jsxs)(Fe,{disabled:g.isPending,items:me,onValueChange:e=>re(e??``),value:te||null,children:[(0,Z.jsx)(je,{className:`w-full`,id:`target-channel`,children:(0,Z.jsx)(Ne,{placeholder:`Select a channel`})}),(0,Z.jsx)(U,{className:`md:max-h-64`,children:(0,Z.jsx)(Pe,{children:N.map(e=>(0,Z.jsx)(H,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Z.jsxs)(nn,{children:[(0,Z.jsx)(k,{disabled:g.isPending,onClick:()=>L(!1),variant:`outline`,children:`Cancel`}),(0,Z.jsx)(k,{disabled:!P||g.isPending,onClick:async()=>{if(c)try{await g.mutateAsync({action:ae,expectedRevision:c.revision,releaseId:c.id,targetChannel:P}),L(!1),K.success(F?`Bundle copied to ${P}`:`Bundle moved to ${P}`)}catch(e){K.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:g.isPending?F?`Copying…`:`Moving…`:F?`Copy`:`Move`})]})]})})]})}function oa({release:e}){return(0,Z.jsxs)(q,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Z.jsx)(V,{className:`size-3`}):(0,Z.jsx)(Ie,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}var sa={data:void 0,error:null,isError:!1,isPending:!0,isPlaceholderData:!1},ca={one:`unreachable bundle`,other:`unreachable bundles`},la=[{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],ua=[{label:`Any Status`,value:`all`},{label:`Enabled`,value:`enabled`},{label:`Disabled`,value:`disabled`}];function da({channels:e,clearable:t,onChange:n,onClear:i,onManageChannels:a,pending:o,search:s}){let c=s.channelId!==void 0;return(0,Z.jsxs)(`header`,{className:`sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-2 border-b bg-background px-3 py-3 sm:h-12 sm:flex-nowrap sm:bg-card/70 sm:px-4 sm:py-0 sm:backdrop-blur-sm`,children:[(0,Z.jsx)(pe,{className:`-ml-1 size-11 lg:size-7`}),(0,Z.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Z.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Z.jsx)(Xn,{className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Z.jsx)(bn,{allChannels:!0,className:`max-sm:order-1 max-sm:min-w-0 max-sm:basis-full`,onValueChange:t=>n(t===void 0?{channelId:void 0,channels:`all`}:{channelId:e.find(e=>e.name===t)?.id??t}),pending:o,value:s.channelId===void 0?void 0:e.find(({id:e})=>e===s.channelId)?.name??s.channelId}),(0,Z.jsxs)(Fe,{disabled:!c,items:la,onValueChange:e=>n({platform:e===`android`?`android`:`ios`}),value:s.platform??`ios`,children:[(0,Z.jsx)(je,{"aria-label":`Platform`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-sm data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:text-xs sm:data-[size=default]:h-8`,title:c?void 0:`Choose a channel first`,children:(0,Z.jsx)(Ne,{})}),(0,Z.jsx)(U,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(H,{value:`ios`,children:`iOS`}),(0,Z.jsx)(H,{value:`android`,children:`Android`})]})})]}),(0,Z.jsxs)(Fe,{disabled:!c&&s.scopeKey===void 0,items:ua,onValueChange:e=>n({enabled:e===`enabled`?!0:e===`disabled`?!1:void 0}),value:s.enabled===void 0?`all`:s.enabled?`enabled`:`disabled`,children:[(0,Z.jsx)(je,{"aria-label":`Status`,className:`w-[calc(50%-0.25rem)] min-w-[132px] text-sm data-[size=default]:h-11 max-sm:order-2 sm:w-[140px] sm:text-xs sm:data-[size=default]:h-8`,children:(0,Z.jsx)(Ne,{})}),(0,Z.jsx)(U,{children:(0,Z.jsxs)(Pe,{children:[(0,Z.jsx)(H,{value:`all`,children:`Any Status`}),(0,Z.jsx)(H,{value:`enabled`,children:`Enabled`}),(0,Z.jsx)(H,{value:`disabled`,children:`Disabled`})]})})]}),(0,Z.jsx)(k,{"aria-label":`Manage channels`,className:`size-11 max-sm:ml-auto sm:size-7`,onClick:a,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Z.jsx)($n,{})}),s.bundleId?(0,Z.jsxs)(q,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Artifact filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>n({bundleId:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,s.scopeKey?(0,Z.jsxs)(q,{className:`max-w-48 gap-1 max-sm:order-3`,variant:`secondary`,children:[`Target filter`,(0,Z.jsx)(`button`,{"aria-label":`Clear target filter`,className:`relative rounded-sm after:absolute after:-inset-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,onClick:()=>n({scopeKey:void 0}),type:`button`,children:(0,Z.jsx)(r,{className:`size-3`})})]}):null,t?(0,Z.jsxs)(k,{className:`h-11 px-2 text-xs text-muted-foreground hover:text-foreground max-sm:order-3 sm:ml-auto sm:h-8`,onClick:i,size:`sm`,variant:`ghost`,children:[(0,Z.jsx)(r,{"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,Z.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Z.jsx)(k,{"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-11 shrink-0 touch-manipulation sm:size-8`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Z.jsx)(we,{}):(0,Z.jsx)(Ae,{})}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-11 shrink-0 sm:size-8`}),(0,Z.jsxs)(`button`,{"aria-label":`Open details for ID ${r.id}`,className:`min-w-0 rounded-sm text-left text-foreground transition-colors underline-offset-4 hover:text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:t,title:r.id,type:`button`,children:[(0,Z.jsx)(vn,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Z.jsx)(Ge,{className:`size-3.5`}),` Built-in bundle`]})]}),i?(0,Z.jsx)(q,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Z.jsx)(Jn,{icon:Ie,label:`Unreachable: no device gets this bundle with the current delivery settings.`,reason:`No device gets this bundle with the current delivery settings.`,children:`Unreachable`}):null]})}function pa({onDetailClick:t,panelId:n,release:r}){let i=r.bundle_id??``,a=Rt(i),o=It(i);return a.isError||o.isError?(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Patch lineage could not be loaded.`}):a.isPending?(0,Z.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:n,children:[(0,Z.jsx)(e,{className:`h-10 w-full`}),(0,Z.jsx)(e,{className:`h-10 w-full`})]}):a.data?(0,Z.jsx)(Fr,{bundle:a.data,bundles:o.data??[],loading:o.isPending,onDetailClick:t,panelId:n}):(0,Z.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:n,children:`Bundle details are unavailable.`})}function ma(e,t){return{patchCounts:Bt(Array.from(new Set(e.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},slotReleases:e.flatMap(e=>{let n=t.find(t=>t.id===e.channel_id)?.name;return n?[{releaseId:e.id,platform:e.platform,channel:n,builtIn:!e.bundle_id}]:[]})}}var ha=(e,t)=>t>=e.to&&(e.from===void 0||t<e.from);function ga({fold:e,filter:t,channels:n,columns:r,isMobile:i,open:a,onOpenChange:o,render:s}){let c=Nt(t,{...e.from===void 0?{}:{from:e.from},to:e.to},a),l=c.data?.pages.flatMap(e=>e.rows)??[],u=ma(l,n),d=i?void 0:r,f=c.isError?(0,Z.jsx)(Hn,{columns:d,label:`Unreachable bundles`,onRetry:()=>void c.refetch(),state:`error`}):c.isPending||c.isFetchingNextPage?(0,Z.jsx)(Hn,{columns:d,label:`Loading unreachable bundles`,state:`loading`}):c.hasNextPage?(0,Z.jsx)(Hn,{columns:d,label:`Unreachable bundles`,onMore:()=>void c.fetchNextPage(),state:`more`}):null,p={label:Gn(e,ca),open:a,onOpenChange:o,panelId:`bundle-fold-${e.to}`};return i?(0,Z.jsxs)(Wn,{...p,children:[l.map(e=>s(e,u)),f]}):(0,Z.jsxs)(Kn,{...p,columns:r,children:[l.map(e=>s(e,u)),f]})}function _a(){let e=B.useSearch(),t=B.useNavigate(),n=A(),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(),s=Un(),c=Ft(),l=c.data??[],u=c.data,d=ye(e,u),f=d===void 0&&c.isError,p=d??e,m=Se(p),h=kt({afterReleaseId:p.afterReleaseId,beforeReleaseId:p.beforeReleaseId,filter:m,releaseId:p.releaseId},{enabled:d!==void 0}),g=!ve(e,u),_=d===void 0?sa:h,v=_.data?.entries??[],y=v.flatMap(e=>e.kind===`row`?[e.row]:[]),b=ma(y,l),x=_.data?.next,S=_.data?.previous,C=be(),w=10+C.length,T=new Map(l.map(e=>[e.id,e.name])),ee=a!==void 0&&(e=>y.some(t=>t.id===e)||v.some(t=>t.kind===`fold`&&s.isOpen(Bn(t))&&ha(t,e)))(a);(0,X.useEffect)(()=>{a!==void 0&&!ee&&o(void 0)},[a,ee]);let E=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),D=e=>E(xe(p,e)),O=e=>{y.some(({id:t})=>t===e.id)||s.set(e.id,!0),E({...p,releaseId:e.id},!1)},te=e=>{let t=y.find(t=>t.bundle_id===e.id);if(o(void 0),t){E({...p,releaseId:t.id},!1);return}D({bundleId:e.id})},ne=p.afterReleaseId!==void 0||p.beforeReleaseId!==void 0,ie=S?{...p,afterReleaseId:`after`in S?S.after:void 0,beforeReleaseId:`before`in S?S.before:void 0,releaseId:void 0}:null,ae=x?{...p,afterReleaseId:void 0,beforeReleaseId:x,releaseId:void 0}:null,oe={...p,afterReleaseId:void 0,beforeReleaseId:void 0,releaseId:void 0},se=(e,t)=>{let n=T.get(e.channel_id)??e.channel_id,r=e.bundle_id?t.patchCounts[e.bundle_id]:0,i=ee&&a===e.id,s=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(kn,{"aria-label":`Bundle ${e.id}`,className:N(`gap-3`,e.currentlyUnreachable&&`bg-muted/60 saturate-50 hover:bg-muted/60 hover:saturate-100 focus-within:saturate-100`,i&&`border-b-0 bg-primary/5`),"data-state":p.releaseId===e.id?`selected`:void 0,onClick:jn(()=>O(e)),children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsx)(fa,{expanded:i,onOpen:()=>O(e),onToggleExpand:()=>o(i?void 0:e.id),release:e}),(0,Z.jsx)(yn,{channel:n,className:`shrink-0`})]}),(0,Z.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-foreground`,children:[(0,Z.jsx)(en,{className:`size-4`,platform:e.platform}),e.platform===`ios`?`iOS`:`Android`]}),r===void 0||r>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(`span`,{children:r===void 0?`Checking patches`:`${r} ${r===1?`patch`:`patches`}`})]}):null,(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Z.jsx)(Pn,{ms:e.created_at_ms})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 text-xs`,children:[(0,Z.jsx)(Rn,{percentage:e.rollout_cohort_count/10}),(0,Z.jsx)(oa,{release:e}),e.should_force_update?(0,Z.jsx)(q,{variant:`secondary`,children:`Force update`}):null,(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:`Target `}),(0,Z.jsx)(ke,{appVersion:e.target_app_version,fingerprintHash:e.fingerprint_hash})]})]}),C.map(({Cell:n,feature:r,label:i})=>(0,Z.jsxs)(`div`,{className:`mt-3 text-xs`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,children:i}),(0,Z.jsx)(n,{releaseId:e.id,releases:t.slotReleases})]},r)),e.message?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:e.message}):null]}),i&&e.bundle_id?(0,Z.jsx)(pa,{onDetailClick:te,panelId:s,release:e}):null]},e.id)},ce=(e,t)=>{let n=ee&&a===e.id,r=`bundle-lineage-panel-${e.id}`;return(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsxs)(Tn,{"aria-label":`Open bundle ${e.id}`,className:N(e.currentlyUnreachable&&`bg-muted/60 saturate-50 hover:bg-muted/60 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":p.releaseId===e.id?`selected`:void 0,onOpen:()=>O(e),children:[(0,Z.jsx)(Y,{children:(0,Z.jsx)(fa,{expanded:n,onOpen:()=>O(e),onToggleExpand:()=>o(n?void 0:e.id),release:e})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(yn,{channel:T.get(e.channel_id)??e.channel_id})}),(0,Z.jsx)(Y,{className:`whitespace-nowrap`,children:(0,Z.jsx)($t,{platform:e.platform})}),(0,Z.jsx)(Y,{children:e.bundle_id&&t.patchCounts[e.bundle_id]===void 0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):e.bundle_id&&t.patchCounts[e.bundle_id]>0?(0,Z.jsxs)(q,{variant:`secondary`,children:[t.patchCounts[e.bundle_id],` `,t.patchCounts[e.bundle_id]===1?`patch`:`patches`]}):(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(ke,{appVersion:e.target_app_version,fingerprintHash:e.fingerprint_hash})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Pr,{enabled:e.enabled}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.enabled?`Enabled`:`Disabled`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsxs)(`span`,{className:`flex items-center`,children:[(0,Z.jsx)(Pr,{enabled:e.should_force_update,falseIcon:`minus`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.should_force_update?`Required`:`Optional`})]})}),(0,Z.jsx)(Y,{children:(0,Z.jsx)(Rn,{percentage:e.rollout_cohort_count/10})}),C.map(({Cell:n,feature:r})=>(0,Z.jsx)(Y,{children:(0,Z.jsx)(n,{releaseId:e.id,releases:t.slotReleases})},r)),(0,Z.jsx)(Y,{className:`text-sm text-muted-foreground`,title:e.message??void 0,children:e.message||`-`}),(0,Z.jsx)(Y,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(Pn,{ms:e.created_at_ms})})]}),n&&e.bundle_id?(0,Z.jsx)(gn,{className:`hover:bg-transparent`,children:(0,Z.jsx)(Y,{className:`border-t-0 p-0`,colSpan:w,children:(0,Z.jsx)(pa,{onDetailClick:te,panelId:r,release:e})})}):null]},e.id)},le=(e,t)=>(0,Z.jsx)(ga,{channels:l,columns:w,filter:m,fold:e,isMobile:n,onOpenChange:t=>s.set(Bn(e),t),open:s.isOpen(Bn(e)),render:t},`fold-${e.to}`),ue=(0,Z.jsxs)(Z.Fragment,{children:[`No `,p.platform===`android`?`Android`:`iOS`,` bundles in`,` `,(0,Z.jsx)(`span`,{translate:`no`,children:T.get(p.channelId??``)??p.channelId})]}),de=(0,Z.jsx)(Nn,{icon:Be,title:y.length===0&&v.length>0?`No device gets the bundles here`:ne?`No more bundles`:z(p)?g?`No bundles match these filters`:ue:`No bundles yet`,children:ne?(0,Z.jsx)(L,{className:re({className:`mt-1 min-h-11 sm:min-h-8`,variant:`outline`}),search:oe,to:`/`,children:`Show the newest bundles`}):g?(0,Z.jsx)(k,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>E({}),variant:`outline`,children:`Clear filters`}):z(p)?(0,Z.jsx)(k,{className:`mt-1 min-h-11 sm:min-h-8`,onClick:()=>D({channelId:void 0,channels:`all`}),variant:`outline`,children:`Show all channels`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{children:`Deploy one from your app's project:`}),(0,Z.jsx)(`div`,{className:`w-full text-left`,children:(0,Z.jsx)(Oe,{label:`the deploy command`,value:`npx hot-updater deploy`,wrap:!0})})]})});return(0,Z.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Z.jsx)(da,{channels:l,clearable:g,onChange:D,onClear:()=>E({}),onManageChannels:()=>i(!0),pending:d===void 0,search:p}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-6 bg-muted/5 p-3 sm:p-6`,children:[f?(0,Z.jsxs)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Channels couldn't be loaded`}),(0,Z.jsx)(Xe,{children:`Bundles show once the channels load.`}),(0,Z.jsx)($e,{children:(0,Z.jsxs)(k,{className:`min-h-11 sm:min-h-7`,onClick:()=>void c.refetch(),size:`xs`,variant:`outline`,children:[(0,Z.jsx)(We,{"data-icon":`inline-start`}),`Retry`]})})]}):_.isError?(0,Z.jsxs)(Ze,{variant:`destructive`,children:[(0,Z.jsx)(Qe,{}),(0,Z.jsx)(Ye,{children:`Bundles could not be loaded`}),(0,Z.jsx)(Xe,{children:_.error?.message})]}):(0,Z.jsx)(wn,{children:n?(0,Z.jsx)(`div`,{className:`h-full overflow-y-auto`,children:_.isPending?(0,Z.jsx)(Mn,{}):(0,Z.jsxs)(Z.Fragment,{children:[y.length===0?(0,Z.jsx)(Dn,{children:de}):null,v.map(e=>e.kind===`row`?se(e.row,b):le(e,se))]})}):(0,Z.jsx)(Cn,{rowGroups:!0,header:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(J,{children:`ID`}),(0,Z.jsx)(J,{children:`Channel`}),(0,Z.jsx)(J,{children:`Platform`}),(0,Z.jsx)(J,{children:`Patches`}),(0,Z.jsx)(J,{children:`Target`}),(0,Z.jsx)(J,{children:`Enabled`}),(0,Z.jsx)(J,{children:`Force update`}),(0,Z.jsx)(J,{children:`Rollout`}),C.map(({feature:e,label:t})=>(0,Z.jsx)(J,{children:t},e)),(0,Z.jsx)(J,{children:`Message`}),(0,Z.jsx)(J,{children:`Created`})]}),children:_.isPending?(0,Z.jsx)(An,{children:(0,Z.jsx)(En,{columns:w})}):(0,Z.jsxs)(Z.Fragment,{children:[y.length===0?(0,Z.jsx)(An,{children:(0,Z.jsx)(On,{columns:w,children:de})}):null,Vn(v).map(e=>e.kind===`fold`?le(e.fold,ce):(0,Z.jsx)(An,{children:e.rows.map(e=>ce(e,b))},`rows-${e.rows[0].id}`))]})})}),!f&&!_.isError&&!_.isPending?(0,Z.jsx)(Fn,{count:y.length,folded:{...qn(v),label:`unreachable`},label:`Bundle pagination`,noun:[`bundle`,`bundles`],pending:_.isPlaceholderData,newest:ne?{search:oe,to:`/`}:void 0,next:ae?{search:ae,to:`/`}:void 0,previous:ie?{search:ie,to:`/`}:void 0}):null]}),(0,Z.jsx)(aa,{channels:l,onOpenChange:e=>!e&&E({...p,releaseId:void 0},!1),onShowScope:e=>D({scopeKey:e}),open:!!p.releaseId,releaseId:p.releaseId??``}),(0,Z.jsx)(Ir,{onOpenChange:i,open:r})]})}export{_a as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-9gxYg__u.js","assets/sidebar-BmzmPGuv.js","assets/alert-dialog-DGPqJBCk.js","assets/ChannelPicker-BQKoyxnf.js","assets/useAnchoredPopupScrollLock-Cvx6CdPD.js","assets/useCompositeListItem-Cbk_weKW.js","assets/check-C3VCvMOV.js","assets/dist-BEmib-ZM.js","assets/input-group-CIjTdxCW.js","assets/api-eO-sq3Jd.js","assets/preload-helper-CE9OukVC.js","assets/link-CRMwpc7-.js","assets/useMutation-D7IuoOLE.js","assets/constants-C5gi7fdZ.js","assets/select-Bk52fOVX.js","assets/switch-CI393qIT.js","assets/valueToPercent-Db73Kirz.js","assets/arrow-right-DjRwIoF1.js","assets/arrow-up-right-C_1ALUCD.js","assets/TargetDisplay-DG_I3qln.js","assets/copy-BjVLMKbo.js","assets/key-round-BkeLvA1m.js","assets/native-builds-zwqucwx2.js","assets/HashValueDisplay-DvwvQchI.js","assets/chevron-right-RAuPv9r1.js","assets/circle-off-DvYMC5yF.js","assets/download-CgpaZb23.js","assets/list-DQ9YBIDW.js","assets/loader-circle-8lunBReu.js","assets/plus-DztQIXYL.js","assets/rotate-ccw-tITIe0Bd.js","assets/trash-2-DI0biNI-.js","assets/badge-zMibJGR5.js","assets/BundleIdDisplay-C0X-k49t.js","assets/ChannelBadge-BgVCJfJs.js","assets/RelativeTime-5ZP9WlQ6.js","assets/relativeTime-RUNbaMyO.js","assets/table-DbZPkzdz.js","assets/RowReason-CXMCJ-Jc.js","assets/insights-search-CZtvD-Vf.js","assets/insights-api-D4-FZeEI.js","assets/PlatformIcon-D4KPXCHL.js","assets/RolloutPercentageBadge-DCtG7c1o.js","assets/card-BAs80yql.js","assets/dialog-BvZDZzdQ.js","assets/field-DInLQ5oV.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$ as e,Di as t,Hr as n,Oi as r,Vr as i,_r as a,et as o,vr as s,wi as c,zr as ee}from"./sidebar-BmzmPGuv.js";import{t as l}from"./link-CRMwpc7-.js";import{i as u,r as d,t as f}from"./preload-helper-CE9OukVC.js";import{a as p,i as te,o as m}from"./console-features-api-CtbGqKyr.js";import{_ as h,m as g,s as _,x as v}from"./insights-api-D4-FZeEI.js";import{t as y}from"./key-round-BkeLvA1m.js";import{i as b}from"./switch-CI393qIT.js";import{a as x,t as S}from"./insights-search-CZtvD-Vf.js";import{a as C,i as w,n as T,o as E,t as D}from"./card-BAs80yql.js";import{n as O}from"./constants-C5gi7fdZ.js";var k=i(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),A=t(),j={apiKeys:{navigation:{icon:(0,A.jsx)(y,{}),paths:[`/api-keys`],link:({onClick:e})=>(0,A.jsx)(l,{to:`/api-keys`,onClick:e})}}},M=c({method:`GET`}).middleware([ee]).handler(r(`b4bf4c461903edcdc44eea52468c737b5b600a586f542138ff022dcbbe86c45c`));function N(e){let t=e.map(({releaseId:e,platform:t,channel:n})=>({releaseId:e,platform:t,channel:n})).sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return n({queryKey:[`bundle-activity`,t],queryFn:()=>M({data:t}),enabled:t.length>0,staleTime:3e4})}var P=[{label:`Downloaded`,field:`downloads`,color:`text-primary/85`},{label:`Launched`,field:`launched`,color:`text-success/85`},{label:`Crashed`,field:`failedLaunches`,color:`text-warning/85`}],F=e=>{let t=e.launched+e.failedLaunches;return t===0?`—`:`${(e.failedLaunches/t*100).toFixed(2)}%`},I=e=>Math.max(0,e.downloads-e.launched-e.failedLaunches);function L(){return(0,A.jsx)(x,{label:`About release insight metrics`,children:`Downloaded: got this bundle. Launched: ran it. Crashed: crashed on it and rolled back. Once every installation restarts, Downloaded = Launched + Crashed.`})}function R({report:t,loading:n=!1,input:r,variant:i=`inline`}){if(!t)return n?(0,A.jsx)(e,{"aria-label":`Loading release insights`,className:i===`card`?`h-16 w-full`:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Release insights unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let a=r?.builtIn===!0,o=a?0:I(t),c=(0,A.jsx)(`dl`,{className:s(i===`card`?`grid grid-cols-[1fr_1fr_auto] gap-4`:`flex min-w-[220px] flex-wrap items-baseline gap-x-3 gap-y-1`),children:P.map(({label:e,field:n,color:r})=>(0,A.jsxs)(`div`,{className:s(`flex`,i===`card`?`min-w-0 flex-col gap-1`:`items-baseline gap-1.5 whitespace-nowrap`),children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,A.jsxs)(`dd`,{className:s(`flex flex-wrap items-baseline gap-x-1.5 tabular-nums`,i===`card`?`text-xl font-semibold`:`text-sm font-medium`,t[n]>0&&!(n===`downloads`&&a)?r:`text-muted-foreground`),children:[n===`downloads`&&a?(0,A.jsx)(`span`,{title:`The built-in bundle is never downloaded`,children:`—`}):t[n].toLocaleString(),n===`failedLaunches`?(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,F(t),`)`]}):null]})]},n))});return(0,A.jsxs)(`div`,{className:s(`flex`,i===`card`?`flex-col gap-2`:`items-center gap-1`),children:[r?(0,A.jsx)(l,{className:`relative min-w-0 rounded-sm after:absolute after:inset-x-0 after:-inset-y-3 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:after:hidden`,to:`/insights`,search:{platform:r.platform,channel:r.channel,releaseId:r.releaseId,bundleWindow:S(r.releaseId)},children:c}):c,i===`card`&&o>0?(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[o.toLocaleString(),` downloaded but not launched yet: waiting for a restart, or passed over for a newer bundle.`]}):null,i===`inline`?(0,A.jsx)(L,{}):null]})}function z({input:t}){let n=_({platform:t.platform,channel:t.channel,releaseId:t.releaseId}),r=n.data;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[r?(0,A.jsx)(`dl`,{children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Download failures`}),(0,A.jsxs)(`dd`,{className:s(`flex items-baseline gap-1.5 text-sm font-medium tabular-nums`,r.failedUpdates>0?`text-warning/85`:`text-muted-foreground`),children:[r.failedUpdates.toLocaleString(),(0,A.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[`(`,h(g(r)),`)`]})]})]})}):n.isPending?(0,A.jsx)(e,{"aria-label":`Loading download failures`,className:`h-4 w-40`}):(0,A.jsx)(`span`,{"aria-label":`Download failures unavailable`,className:`text-sm text-muted-foreground`,children:`—`}),(0,A.jsx)(x,{label:`About download failures`,children:`Failed downloads or installs of this bundle, at most one per installation a day. Rate = failures ÷ (failures + downloads).`})]})}function B({input:e}){let t=N([e]);return(0,A.jsxs)(D,{children:[(0,A.jsxs)(C,{className:`flex-row items-center justify-between px-4 pt-4 pb-3`,children:[(0,A.jsx)(E,{className:`text-sm font-medium`,children:`Insights`}),(0,A.jsx)(L,{})]}),(0,A.jsxs)(T,{className:`flex flex-col gap-3 px-4 pb-4`,children:[(0,A.jsx)(R,{variant:`card`,input:e,loading:t.isFetching,report:t.data?.[e.releaseId]}),(0,A.jsx)(o,{}),(0,A.jsx)(z,{input:e})]}),(0,A.jsx)(w,{className:`px-4 pb-4`,children:(0,A.jsxs)(l,{className:a({className:`max-md:h-11`,variant:`outline`,size:`sm`}),to:`/insights`,search:{platform:e.platform,channel:e.channel,releaseId:e.releaseId,bundleWindow:S(e.releaseId),healthChart:`adoption`},children:[(0,A.jsx)(k,{"aria-hidden":`true`,"data-icon":`inline-start`}),`View adoption`]})})]})}function V({input:e}){return te(`insightsAnalytics`)?null:(0,A.jsxs)(D,{children:[(0,A.jsx)(C,{className:`px-4 pt-4 pb-3`,children:(0,A.jsx)(E,{className:`text-sm font-medium`,children:`Insights`})}),(0,A.jsx)(T,{className:`px-4 pb-4`,children:(0,A.jsx)(z,{input:e})})]})}function ne({releaseId:e,releases:t}){let n=N(t);return(0,A.jsx)(R,{input:t.find(t=>t.releaseId===e),loading:n.isFetching,report:n.data?.[e]})}var H={Cell:ne},U={insights:{navigation:{icon:(0,A.jsx)(v,{}),paths:[`/insights`,`/insights/distribution`,`/installations`],link:({features:e,onClick:t})=>e.insightsAnalytics?(0,A.jsx)(l,{to:`/insights`,onClick:t}):(0,A.jsx)(l,{to:`/installations`,onClick:t})},releaseSection:({release:e})=>(0,A.jsx)(V,{input:e})},insightsAnalytics:{releaseColumn:H,releaseSection:({release:e})=>(0,A.jsx)(B,{input:e})}},W={remoteConfig:{navigation:{icon:(0,A.jsx)(b,{}),paths:[`/remote-config`],link:({onClick:e})=>(0,A.jsx)(l,{to:`/remote-config`,onClick:e})}}},G={...U,...j,...W},K=Object.keys(m),q=()=>{let e=p().data?.features;return e===void 0?[]:K.flatMap(t=>{let n=G[t];return n!==void 0&&e[t]?[{...n,feature:t,label:m[t].label,features:e}]:[]})},J=()=>q().flatMap(({feature:e,label:t,releaseColumn:n})=>n===void 0?[]:[{...n,feature:e,label:t}]);function Y({release:e}){return q().map(({feature:t,releaseSection:n})=>n===void 0?null:(0,A.jsx)(n,{release:e},t))}var X=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function Z(e){let t=X(e.beforeReleaseId),n=t?void 0:X(e.afterReleaseId),r=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0,i=X(e.bundleId),a=i?void 0:X(e.scopeKey),o=i||a?void 0:X(e.channelId),s=o===void 0?void 0:e.platform===`android`?`android`:`ios`;return{afterReleaseId:n,beforeReleaseId:t,bundleId:i,channelId:o,channels:!i&&!a&&!o&&e.channels===`all`?`all`:void 0,enabled:a||o?r:void 0,platform:s,releaseId:X(e.releaseId),scopeKey:a}}function Q(e){let t=e.enabled===void 0?{}:{enabled:e.enabled};return e.bundleId?{kind:`bundle`,bundleId:e.bundleId}:e.scopeKey?{kind:`scope`,scopeKey:e.scopeKey,...t}:e.channelId&&e.platform?{kind:`channelPlatform`,channelId:e.channelId,platform:e.platform,...t}:{kind:`all`}}function re(e){return Q(e).kind!==`all`}function $(e,t){if(e.bundleId||e.scopeKey||e.channelId||e.channels===`all`)return e;if(e.releaseId)return{...e,channels:`all`};if(t===void 0)return;let n=t.find(({name:e})=>e===O);return n?Z({...e,channelId:n.id}):e}function ie(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,channels:n.channels,enabled:n.enabled,platform:n.platform}):Z({bundleId:n.bundleId,channelId:n.channelId,channels:n.channels,enabled:n.enabled,platform:n.platform,scopeKey:n.scopeKey})}function ae(e,t){let n=$(e,t),r=$({},t);return n===void 0||r===void 0||JSON.stringify(Q(n))===JSON.stringify(Q(r))}var oe=u(`/`)({component:d(()=>f(()=>import(`./routes-9gxYg__u.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),`component`),validateSearch:Z});export{ae as a,q as c,$ as i,J as l,re as n,ie as o,Q as r,Y as s,oe as t};
|