@hot-updater/console 1.0.0-rc.2 → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/InsightsPageHeader-C-Xc2MB9.js +1 -0
- package/.output/public/assets/api-keys-C1sgC6ko.js +1 -0
- package/.output/public/assets/{api-keys-api-BHcODB7q.js → api-keys-api-LchP65vQ.js} +1 -1
- package/.output/public/assets/badge-BuMDU0Rf.js +1 -0
- package/.output/public/assets/card-BEvx_QKh.js +1 -0
- package/.output/public/assets/{chart-no-axes-combined-Dy4WJv2U.js → chart-no-axes-combined-C0G0fQ3J.js} +1 -1
- package/.output/public/assets/{composite-Bp98A0Ld.js → composite-CHTH1Xhh.js} +1 -1
- package/.output/public/assets/createServerFn-DHc2erub.js +3 -0
- package/.output/public/assets/dialog-dyZ1SphZ.js +1 -0
- package/.output/public/assets/{dist-C_NydL0e.js → dist-Bh1gaDfB.js} +1 -1
- package/.output/public/assets/field-79SVH26s.js +1 -0
- package/.output/public/assets/index-BNkxg4jz.js +10 -0
- package/.output/public/assets/input-group-BbHfaBzQ.js +1 -0
- package/.output/public/assets/insights-D_7uSKfc.js +1 -0
- package/.output/public/assets/installations-BzoHWuXw.js +1 -0
- package/.output/public/assets/{installations-CE33wgbY.js → installations-DvjbUqd1.js} +2 -2
- package/.output/public/assets/{lazyRouteComponent-Ccp3bwBY.js → lazyRouteComponent-BN0MS05o.js} +1 -1
- package/.output/public/assets/{link-CI8idAUi.js → link-BG06whwB.js} +1 -1
- package/.output/public/assets/{loader-circle-BoxLrsOu.js → loader-circle-Bbp8LGVC.js} +1 -1
- package/.output/public/assets/{refresh-cw-Bqc72UZG.js → refresh-cw-DZgiAOMk.js} +1 -1
- package/.output/public/assets/routes-BFE-oRIT.js +1 -0
- package/.output/public/assets/{routes-DGVXdzpw.js → routes-DaPMY31P.js} +2 -2
- package/.output/public/assets/{shield-check-uK3MHWJZ.js → shield-check-DoIiaaXU.js} +1 -1
- package/.output/public/assets/signing-BTRhaF5D.js +1 -0
- package/.output/public/assets/styles-C7U0oVke.css +2 -0
- package/.output/public/assets/table-BBEzJ7Xl.js +1 -0
- package/.output/public/assets/useCompositeListItem-BkPDaqyj.js +42 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-B7ioJhtE.mjs → __23tanstack-start-server-fn-resolver-Dr2ixDgQ.mjs} +40 -32
- package/.output/server/_libs/@base-ui/react+[...].mjs +1 -1
- package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
- package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +1 -1
- package/.output/server/_libs/d3-array.mjs +231 -0
- package/.output/server/_libs/d3-color.mjs +330 -0
- package/.output/server/_libs/d3-format.mjs +252 -0
- package/.output/server/_libs/d3-interpolate.mjs +207 -0
- package/.output/server/_libs/d3-path.mjs +77 -0
- package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
- package/.output/server/_libs/d3-shape.mjs +818 -0
- package/.output/server/_libs/decimal.js-light.mjs +884 -0
- package/.output/server/_libs/es-toolkit.mjs +1159 -0
- package/.output/server/_libs/eventemitter3.mjs +236 -0
- package/.output/server/_libs/immer.mjs +532 -0
- package/.output/server/_libs/lucide-react.mjs +9 -2
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/react-redux+[...].mjs +205 -0
- package/.output/server/_libs/recharts+[...].mjs +15054 -0
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tanstack__react-query.mjs +1 -1
- package/.output/server/_runtime.mjs +10 -1
- package/.output/server/_ssr/InsightsPageHeader-C5Has8Ry.mjs +60 -0
- package/.output/server/_ssr/{api-keys-CZeTPQys.mjs → api-keys-DJml_XoK.mjs} +10 -8
- package/.output/server/_ssr/{api-keys-api-BUPQVSpk.mjs → api-keys-api-CrCZyvnl.mjs} +2 -2
- package/.output/server/_ssr/{api-keys-rpc-Cs7tS5_j.mjs → api-keys-rpc-CFaNf-q0.mjs} +3 -3
- package/.output/server/_ssr/{api-rpc-tAupfGQm.mjs → api-rpc-B61KL3Eo.mjs} +25 -25
- package/.output/server/_ssr/{auth-rpc-DUaeOWKK.mjs → auth-rpc-D_hv52-J.mjs} +4 -4
- package/.output/server/_ssr/{auth.server-DW71WzsD.mjs → auth.server-DF_shCeq.mjs} +1 -1
- package/.output/server/_ssr/badge-BgsCP9Dp.mjs +28 -0
- package/.output/server/_ssr/{bundle-signing-rpc-BhnBw0-d.mjs → bundle-signing-rpc-BBipZnFs.mjs} +2 -2
- package/.output/server/_ssr/{bundle-signing.server-C4NW5mWx.mjs → bundle-signing.server-Co_zHdJx.mjs} +1 -1
- package/.output/server/_ssr/bundleActivity-D3_fIda2.mjs +27 -0
- package/.output/server/_ssr/{card-BRiPmi0C.mjs → card-DrbxCPtG.mjs} +3 -25
- package/.output/server/_ssr/chart-qxa-_30a.mjs +162 -0
- package/.output/server/_ssr/{config.server-afDuAwaG.mjs → config.server-CBr6PDj5.mjs} +5 -5
- package/.output/server/_ssr/{createSsrRpc-DjWNJ0uc.mjs → createSsrRpc-NHF2PxuK.mjs} +4 -4
- package/.output/server/_ssr/{deleteBundle-BTGwBgzx.mjs → deleteBundle-BAq3JuGr.mjs} +1 -1
- package/.output/server/_ssr/{dialog-DS-nw-pA.mjs → dialog-DUaIgpgd.mjs} +1 -1
- package/.output/server/_ssr/{downloadBundle-CNnYxYO2.mjs → downloadBundle-B3ert-pY.mjs} +1 -1
- package/.output/server/_ssr/{table-CnZmon_Z.mjs → field-CqNUlqUq.mjs} +4 -50
- package/.output/server/_ssr/{getBundleChildren-C0vh4ZvE.mjs → getBundleChildren-COMt16m_.mjs} +1 -1
- package/.output/server/_ssr/{input-group-BpsnmvZw.mjs → input-group-Bb8ueylQ.mjs} +51 -2
- package/.output/server/_ssr/insights-B-DUbksX.mjs +502 -0
- package/.output/server/_ssr/insights-recovery-DSFM-YTL.mjs +21 -0
- package/.output/server/_ssr/insights-recovery-rpc-P71FH66n.mjs +37 -0
- package/.output/server/_ssr/{insights-rpc-38DujK0G.mjs → insights-rpc-DrIQCjpD.mjs} +2 -2
- package/.output/server/_ssr/insightsRecovery-CqcosG7B.mjs +149 -0
- package/.output/server/_ssr/{installations-CtA59MQG.mjs → installations-BQrppti7.mjs} +2 -2
- package/.output/server/_ssr/{installations-DiVKEF5T.mjs → installations-YumqpNpa.mjs} +426 -11
- package/.output/server/_ssr/{router-B9wG_9f8.mjs → router-iP95Vqi2.mjs} +14 -14
- package/.output/server/_ssr/{routes-CKrrS2q2.mjs → routes-BDabsmc7.mjs} +2 -2
- package/.output/server/_ssr/{routes-D7Yh_jfj.mjs → routes-ivsV2TDu.mjs} +224 -13
- package/.output/server/_ssr/{runtime.server-DacU1TBV.mjs → runtime.server-jmZOKIQM.mjs} +1 -1
- package/.output/server/_ssr/{server-D_C2rMzf.mjs → server-p7yrVBfD.mjs} +3 -3
- package/.output/server/_ssr/{signing-Dz1WkZOf.mjs → signing-CxCbnFCt.mjs} +5 -4
- package/.output/server/_ssr/ssr.mjs +1 -1
- package/.output/server/_ssr/table-D1mL8fJu.mjs +53 -0
- package/.output/server/_tanstack-start-manifest_v-Cwpu0C9Q.mjs +100 -0
- package/.output/server/index.mjs +154 -154
- package/package.json +3 -3
- package/src/components/features/bundles/BundleActivityChart.tsx +95 -0
- package/src/components/features/bundles/BundleInsightsSummary.tsx +121 -0
- package/src/components/features/insights/InsightsControls.tsx +1 -15
- package/src/components/features/insights/InsightsOverview.tsx +368 -179
- package/src/components/features/releases/ReleaseEditorSheet.tsx +10 -0
- package/src/components/ui/empty.tsx +101 -0
- package/src/lib/bundle-activity.ts +21 -0
- package/src/lib/insights-recovery-rpc.ts +38 -0
- package/src/lib/insights-recovery.ts +59 -0
- package/src/lib/server/bundleActivity.ts +37 -0
- package/src/lib/server/insightsHistory.ts +52 -0
- package/src/lib/server/insightsRecovery.ts +186 -0
- package/src/routes/index.tsx +33 -3
- package/src/routes/insights.tsx +1 -42
- package/.output/public/assets/HashValueDisplay-CB0Eskit.js +0 -1
- package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +0 -1
- package/.output/public/assets/api-keys-BzKocqRy.js +0 -1
- package/.output/public/assets/card-Dhr_eFYj.js +0 -1
- package/.output/public/assets/createServerFn-CA8fs7QD.js +0 -3
- package/.output/public/assets/dialog-CUTrcPlB.js +0 -1
- package/.output/public/assets/index-DdAz-CXv.js +0 -10
- package/.output/public/assets/input-group-cSOG4wh_.js +0 -1
- package/.output/public/assets/insights-C0PBSZ-n.js +0 -1
- package/.output/public/assets/installations-CStZja8x.js +0 -1
- package/.output/public/assets/routes-DTlwOr8I.js +0 -1
- package/.output/public/assets/signing-CMf4aqDO.js +0 -1
- package/.output/public/assets/styles-BCvbtKsm.css +0 -2
- package/.output/public/assets/table-2vcV89QB.js +0 -1
- package/.output/public/assets/useCompositeListItem-CHLITE_4.js +0 -1
- package/.output/public/assets/x-DCd0j8c6.js +0 -1
- package/.output/server/_ssr/HashValueDisplay-DwpGLfrl.mjs +0 -55
- package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +0 -484
- package/.output/server/_ssr/insights-BdS364Xu.mjs +0 -460
- package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +0 -97
- package/src/components/features/insights/InsightsBundleReports.tsx +0 -51
- /package/.output/public/assets/{preload-helper-CQ36nxok.js → preload-helper-uTix4PVD.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,$t as t,An as n,At as r,Bt as i,C as a,Ct as o,D as s,Dt as c,E as l,En as u,Et as d,Ft as f,Gn as p,H as m,Hn as h,Ht as g,In as _,J as v,Jn as y,K as b,Kn as x,Kt as S,Ln as C,Lt as w,Mt as T,Nt as E,O as D,On as O,Or as k,P as A,Pn as j,Pt as M,Q as ee,Qn as N,Rn as P,Rt as te,S as ne,Sn as F,St as I,Tn as L,Tt as re,U as R,Un as z,Ut as ie,Vn as ae,Vt as B,W as V,Wn as oe,Wt as se,X as ce,Xt as H,Y as U,Yn as W,Yt as le,Zn as G,Zt as K,_n as ue,_t as de,an as fe,b as pe,bn as me,bt as he,cn as ge,en as _e,et as ve,fn as ye,gn as be,gt as xe,h as Se,hn as Ce,ht as we,in as Te,jr as q,k as Ee,kn as De,kr as Oe,kt as ke,ln as Ae,m as je,mn as J,mt as Me,nn as Ne,on as Pe,pt as Fe,q as Y,rn as Ie,rt as Le,t as Re,tn as ze,un as Be,vn as Ve,vr as He,vt as Ue,w as We,x as Ge,xn as X,xt as Ke,yn as qe,yt as Je,zn as Ye}from"./createServerFn-DHc2erub.js";import{t as Xe}from"./link-BG06whwB.js";import{n as Ze,t as Qe}from"./loader-circle-Bbp8LGVC.js";import{a as $e,c as et,i as tt,n as nt,o as rt,r as it,s as at,t as ot}from"./table-BBEzJ7Xl.js";import{a as st,i as ct,l as lt,n as ut,o as dt,s as ft,t as pt,u as mt}from"./input-group-BbHfaBzQ.js";import{n as ht,r as gt,t as _t}from"./routes-DaPMY31P.js";import{A as vt,C as yt,D as bt,E as xt,M as St,N as Ct,O as wt,S as Tt,T as Et,_ as Dt,a as Ot,b as kt,c as At,d as jt,f as Mt,h as Nt,i as Pt,j as Ft,k as It,l as Lt,m as Rt,n as zt,o as Bt,p as Vt,r as Ht,s as Ut,t as Wt,u as Gt,w as Kt,x as qt,y as Jt}from"./dialog-dyZ1SphZ.js";import{n as Yt}from"./dist-Bh1gaDfB.js";import{a as Xt,l as Zt,n as Qt,o as $t,r as en,s as tn,t as nn,u as rn}from"./card-BEvx_QKh.js";import{a as an,d as on,f as sn,i as cn,o as ln,r as un,s as dn,t as fn}from"./composite-CHTH1Xhh.js";import{t as pn}from"./badge-BuMDU0Rf.js";import{a as mn,i as hn,n as gn,o as _n,r as vn,t as yn}from"./field-79SVH26s.js";import{$ as bn,A as xn,C as Sn,D as Cn,E as wn,F as Tn,G as En,H as Dn,I as On,J as kn,K as An,L as jn,M as Mn,N as Nn,O as Pn,P as Fn,Q as In,R as Ln,S as Rn,T as zn,U as Bn,X as Vn,Y as Hn,Z as Un,_ as Wn,_t as Gn,a as Kn,at as qn,b as Jn,c as Yn,ct as Xn,d as Zn,dt as Qn,et as $n,f as er,ft as tr,g as nr,gt as rr,h as ir,ht as ar,i as or,it as sr,j as cr,k as lr,l as ur,lt as dr,m as fr,mt as pr,n as mr,nt as hr,o as gr,ot as _r,p as vr,q as yr,r as br,rt as xr,s as Sr,t as Cr,tt as wr,u as Tr,ut as Er,v as Dr,w as Or,x as kr,y as Ar}from"./useCompositeListItem-BkPDaqyj.js";var jr=x(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Mr=x(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Nr=x(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Pr=x(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Fr=x(`circle-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]),Ir=x(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Lr=x(`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`}]]),Rr=x(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),zr=x(`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`}]]),Br=x(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Vr=x(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Hr=x(`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`}]]),Ur=x(`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`}]]),Wr=x(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Z=q(k()),Gr=`Escape`;function Kr(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function qr(e,t){return Kr(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Jr(e,t,n){return Kr(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Yr(e,t,n){return Kr(t,n?e===Te:e===fe,e===Ie)}function Xr(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Gr:Kr(t,n?e===fe:e===Te,e===Pe)}function Zr(t,i){let{listRef:a,activeIndex:o,onNavigate:s=()=>{},enabled:l=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b=void 0,orientation:x=`vertical`,parentOrientation:S,cols:C=1,id:w,resetOnPointerLeave:T=!0,externalTree:D}=i,O=`rootStore`in t?t.rootStore:t,k=O.useState(`open`),A=O.useState(`floatingElement`),j=O.useState(`domReferenceElement`),M=O.context.dataRef,N=H(A),P=K(j),ne=r(N),F=ee(),re=e(D),R=Z.useRef(_),z=Z.useRef(d??-1),ae=Z.useRef(null),B=Z.useRef(!0),V=u(e=>{s(z.current===-1?null:z.current,e)}),oe=Z.useRef(V),se=Z.useRef(!!A),ce=Z.useRef(k),U=Z.useRef(!1),W=Z.useRef(!1),le=Z.useRef(null),G=r(b),ue=r(k),fe=r(d),pe=r(T),me=ke(),he=ke(),ve=u(()=>{function e(e){g?re?.events.emit(`virtualfocus`,e):le.current=St(e,{sync:U.current,preventScroll:!0})}let t=a.current[z.current],n=W.current;t&&e(t),(U.current?e=>e():e=>me.request(e))(()=>{let r=a.current[z.current]||t;r&&(t||e(r),q&&(n||!B.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});L(()=>{M.current.orientation=x},[M,x]),L(()=>{l&&(k&&A?(z.current=d??-1,R.current&&d!=null&&(W.current=!0,V())):se.current&&(z.current=-1,oe.current()))},[l,k,A,d,V]),L(()=>{if(l){if(!k){U.current=!1;return}if(A)if(o==null){if(U.current=!1,fe.current!=null)return;if(se.current&&(z.current=-1,ve()),(!ce.current||!se.current)&&R.current&&(ae.current!=null||R.current===!0&&ae.current==null)){let e=0,t=()=>{a.current[0]==null?(e<2&&(e?e=>he.request(e):queueMicrotask)(t),e+=1):(z.current=ae.current==null||Jr(ae.current,x,h)||m?Je(a):Ue(a),ae.current=null,V())};t()}}else Ke(a.current,o)||(z.current=o,ve(),W.current=!1)}},[l,k,A,o,fe,m,a,x,h,V,ve,he]),L(()=>{if(!l||A||!re||g||!se.current)return;let e=re.nodesRef.current,t=e.find(e=>e.id===F)?.context?.elements.floating,n=_e(c(A)),r=e.some(e=>e.context&&ze(e.context.elements.floating,n));t&&!r&&B.current&&t.focus({preventScroll:!0})},[l,A,re,F,g]),L(()=>{oe.current=V,ce.current=k,se.current=!!A}),L(()=>{k||(ae.current=null,R.current=_)},[k,_]);let ye=o!=null,be=u(e=>{if(!ue.current)return;let t=a.current.indexOf(e.currentTarget);t!==-1&&(z.current!==t||o!==t)&&(z.current=t,V(e))}),Se=u(()=>S??re?.nodesRef.current.find(e=>e.id===F)?.context?.dataRef?.current.orientation),Ce=u(()=>Je(a,G.current)),Te=u(e=>{if(B.current=!1,U.current=!0,e.which===229||!ue.current&&e.currentTarget===ne.current)return;if(m&&Xr(e.key,x,h,C)){qr(e.key,Se())||Be(e),O.setOpen(!1,E(ie,e.nativeEvent)),n(j)&&(g?re?.events.emit(`virtualfocus`,j):j.focus());return}let t=z.current,r=Je(a,b),i=Ue(a,b);if(P||(e.key===`Home`&&(Be(e),z.current=r,V(e)),e.key===`End`&&(Be(e),z.current=i,V(e))),C>1){let t=Array.from({length:a.current.length},()=>({width:1,height:1})),n=Fe(t,C,!1),o=n.findIndex(e=>e!=null&&!I(a.current,e,b)),s=n.reduce((e,t,n)=>t!=null&&!I(a.current,t,b)?n:e,-1),c=n[de(n.map(e=>e==null?null:a.current[e]),{event:e,orientation:x,loopFocus:p,rtl:h,cols:C,disabledIndices:xe([...(typeof b==`function`?null:b)||a.current.map((e,t)=>I(a.current,t,b)?t:void 0),void 0],n),minIndex:o,maxIndex:s,prevIndex:we(z.current>i?r:z.current,t,n,C,e.key===`ArrowDown`?`bl`:e.key===(h?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(z.current=c,V(e)),x===`both`)return}if(qr(e.key,x)){if(Be(e),k&&!g&&_e(e.currentTarget.ownerDocument)===e.currentTarget){z.current=Jr(e.key,x,h)?r:i,V(e);return}Jr(e.key,x,h)?p?t>=i?f&&t!==a.current.length?z.current=-1:(U.current=!1,z.current=r):z.current=Me(a.current,{startingIndex:t,disabledIndices:b}):z.current=Math.min(i,Me(a.current,{startingIndex:t,disabledIndices:b})):p?t<=r?f&&t!==-1?z.current=a.current.length:(U.current=!1,z.current=i):z.current=Me(a.current,{startingIndex:t,decrement:!0,disabledIndices:b}):z.current=Math.max(r,Me(a.current,{startingIndex:t,decrement:!0,disabledIndices:b})),Ke(a.current,z.current)&&(z.current=-1),V(e)}}),q=Z.useMemo(()=>({onFocus(e){U.current=!0,be(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){U.current=!0,W.current=!1,v&&be(e)},onPointerLeave(e){if(!ue.current||!B.current||e.pointerType===`touch`)return;U.current=!0;let t=e.relatedTarget;if(!(!v||a.current.includes(t))&&pe.current&&(le.current?.(),le.current=null,z.current=-1,V(e),!g)){let e=ne.current,t=_e(c(e));e&&ze(e,t)&&e.focus({preventScroll:!0})}}}),[be,ue,ne,v,a,V,pe,g]),Ee=Z.useMemo(()=>g&&k&&ye&&{"aria-activedescendant":`${w}-${o}`},[g,k,ye,w,o]),De=Z.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...P?{}:Ee,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&k&&!g){let t=Ne(e.nativeEvent);if(t&&!ze(ne.current,t))return;Be(e),O.setOpen(!1,E(te,e.nativeEvent)),n(j)&&j.focus();return}Te(e)},onPointerMove(){B.current=!0}}),[Ee,Te,ne,x,P,O,k,g,j]),Oe=Z.useMemo(()=>{function e(e){O.setOpen(!0,E(ie,e.nativeEvent,e.currentTarget))}function t(e){_===`auto`&&ge(e.nativeEvent)&&(R.current=!g)}function n(e){R.current=_,_===`auto`&&Ae(e.nativeEvent)&&(R.current=!0)}return{onKeyDown(t){let n=O.select(`open`);B.current=!1;let r=t.key.startsWith(`Arrow`),i=Yr(t.key,Se(),h),a=qr(t.key,x),o=(m?i:a)||t.key===`Enter`||t.key.trim()===``;if(g&&n)return Te(t);if(!(!n&&!y&&r)){if(o){let e=qr(t.key,Se());ae.current=m&&e?null:t.key}if(m){i&&(Be(t),n?(z.current=Ce(),V(t)):e(t));return}a&&(fe.current!=null&&(z.current=fe.current),Be(t),!n&&y?e(t):Te(t),n&&V(t))}},onFocus(e){O.select(`open`)&&!g&&(z.current=-1,V(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[Te,_,Ce,m,V,O,y,x,Se,h,fe,g]),je=Z.useMemo(()=>({...Ee,...Oe}),[Ee,Oe]);return Z.useMemo(()=>l?{reference:je,floating:De,item:q,trigger:Oe}:{},[l,je,De,Oe,q])}function Qr(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,onTyping:o,enabled:s=!0,resetMs:c=750,selectedIndex:l=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=J(),m=Z.useRef(``),h=Z.useRef(l??i??-1),g=Z.useRef(null),_=u(e=>{function t(e){let t=r?.current[e];return!t||he(t)}function s(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let u=n.current;if(m.current.length>0&&e.key===` `&&(Be(e),o?.(!0)),m.current.length>0&&m.current[0]!==` `&&s(u,m.current)===-1&&e.key!==` `&&o?.(!1),u==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Be(e),o?.(!0));let d=m.current===``;d&&(h.current=l??i??-1),u.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(c,()=>{m.current=``,h.current=g.current,o?.(!1)});let _=((d?l??i??-1:h.current)??0)+1,v=s(u,m.current,_);v===-1?e.key!==` `&&(m.current=``,o?.(!1)):(a?.(v),g.current=v)}),v=u(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);ze(n,t)||ze(r,t)||(p.clear(),m.current=``,h.current=g.current,o?.(!1))});L(()=>{!f&&l!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,l,p]),L(()=>{f&&m.current===``&&(h.current=l??i??-1)},[f,l,i]);let y=Z.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return Z.useMemo(()=>s?{reference:y,floating:y}:{},[s,y])}function $r(e){let[t,n]=Z.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}var Q=N();function ei({bundleId:e,className:t}){return(0,Q.jsx)(`span`,{translate:`no`,className:X(`break-all font-mono text-xs tabular-nums`,t),children:e})}var ti={production:`bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20`,dev:`bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20`,staging:`bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20`};function ni({channel:e,className:t}){return(0,Q.jsx)(pn,{variant:`outline`,className:X(ti[e.toLowerCase()]||`bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20`,t),children:e})}function ri({enabled:e,className:t,falseIcon:n=`x`,colorMode:r=`semantic`}){let i=r===`inherit`?`text-current`:void 0;return e?(0,Q.jsx)(et,{className:X(`h-4 w-4`,i??`text-green-600 dark:text-green-400`,t)}):n===`minus`?(0,Q.jsx)(Vr,{className:X(`h-4 w-4`,i??`text-muted-foreground`,t)}):(0,Q.jsx)(at,{className:X(`h-4 w-4`,i??`text-red-600 dark:text-red-400`,t)})}var ii=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.baseBundleId==`string`&&typeof t.baseFileHash==`string`&&typeof t.patchFileHash==`string`&&typeof t.patchStorageUri==`string`},ai=e=>Array.isArray(e)?e.filter(ii):[],oi=e=>{let t=ai(e.patches),n=new Set;return t.filter(e=>n.has(e.baseBundleId)?!1:(n.add(e.baseBundleId),!0))},si=e=>oi(e)[0]??null,ci=e=>si(e)?.baseBundleId??null,li=e=>si(e)?.baseFileHash??null,ui=e=>si(e)?.patchFileHash??null,di=1e3,fi=di,pi=`Invalid cohort. Use 1-1000 or a lowercase slug without spaces, up to 64 characters.`,mi=/^[a-z0-9-]+$/;function hi(e){if(!/^\d+$/.test(e))return null;let t=Number.parseInt(e,10);return Number.isNaN(t)||t<1||t>1e3?null:t}function gi(e,t){return(e%t+t)%t}function _i(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function vi(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let e=n%r;n=r,r=e}return n}function yi(e,t){let n=0,r=1,i=t,a=gi(e,t);for(;a!==0;){let e=Math.floor(i/a);[n,r]=[r,n-e*r],[i,a]=[a,i-e*a]}if(i>1)throw Error(`No modular inverse for ${e} mod ${t}`);return gi(n,t)}function bi(e){let t=gi(_i(`${e}:multiplier`),997);for(t===0&&(t=1);vi(t,di)!==1;)t=gi(t+1,di),t===0&&(t=1);let n=gi(_i(`${e}:offset`),di);return{multiplier:t,offset:n,inverseMultiplier:yi(t,di)}}function xi(e){return e==null?fi:e<=0?0:e>=1e3?di:Math.floor(e)}function Si(e){let t=e.trim().toLowerCase(),n=hi(t);return n===null?t:String(n)}function Ci(e){return hi(Si(e))}function wi(e){return Ci(e)!==null}function Ti(e){let t=Si(e);return t.length>0&&t.length<=64&&!/^\d+$/.test(t)&&mi.test(t)}function Ei(e){let t=Si(e);return wi(t)||Ti(t)}function Di(e,t){if(t<1||t>1e3)throw Error(`Invalid numeric cohort: ${t}`);let{offset:n,inverseMultiplier:r}=bi(e);return gi(r*(t-1-n),di)}var Oi=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,ki=e=>typeof e==`string`&&Oi.test(e),Ai=e=>{if(!ki(e))throw TypeError(`Expected a canonical lowercase UUIDv7`);let t=e.split(`-`).join(``).slice(0,12);return Number.parseInt(t,16)};function ji(e){let t=new Uint8Array(10);crypto.getRandomValues(t);let n=Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``),r=n.slice(0,3),i=n.slice(3,19),a=`7${r}`,o=(128|parseInt(i.slice(0,2),16)&63).toString(16).padStart(2,`0`);return[e.slice(0,8),e.slice(8,12),a,o+i.slice(2,4),i.slice(4,16)].join(`-`)}var Mi=()=>ji(Date.now().toString(16).padStart(12,`0`)),Ni=Oe(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Pi=Oe(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),Fi=q(Ni(),1),Ii=q(Pi(),1);Fi.default.extend(Ii.default);function Li({uuid:e,format:t=`relative`}){let n=(0,Fi.default)(Ai(e));return t===`relative`?(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.fromNow()}):t===`absolute`?(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)}):(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{className:`text-sm`,children:n.fromNow()}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.format(`YYYY-MM-DD HH:mm:ss`)})]})}function Ri({panelId:e,bundle:t,bundles:n,loading:r,onDetailClick:i}){let a=Se();return(0,Q.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-3 sm:p-4`,id:e,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium`,children:`Advanced artifact diagnostics`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 text-sm sm:items-center`,children:[(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Base artifact ID`}),(0,Q.jsx)(ei,{bundleId:t.id,fullOnMobile:!0,maxLength:18})]}),(0,Q.jsxs)(pn,{variant:`outline`,children:[n.length,` `,n.length===1?`patch`:`patches`]})]}),r?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(be,{className:`h-10 w-full`}),(0,Q.jsx)(be,{className:`h-10 w-full`})]}):n.length>0?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),a?(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,Q.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Target artifact ID`}),(0,Q.jsx)(ei,{bundleId:e.id,fullOnMobile:!0,maxLength:18})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Relation`}),(0,Q.jsxs)(`div`,{className:`flex flex-col items-start gap-1 text-sm`,children:[(0,Q.jsx)(ei,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Q.jsx)(jr,{className:`size-4 rotate-90 text-muted-foreground`}),(0,Q.jsx)(ei,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Artifact`}),(0,Q.jsx)(pn,{variant:`secondary`,children:`bsdiff`})]}),(0,Q.jsxs)(`div`,{className:`space-y-1 text-right`,children:[(0,Q.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:`Created`}),(0,Q.jsx)(`div`,{className:`text-xs tabular-nums text-foreground`,children:(0,Q.jsx)(Li,{uuid:e.id})})]})]}),(0,Q.jsx)(qe,{className:`w-full`,onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})]})},e.id))}):(0,Q.jsx)(`div`,{className:`overflow-x-auto rounded-md border bg-background`,children:(0,Q.jsxs)(ot,{className:`min-w-max`,children:[(0,Q.jsx)($e,{children:(0,Q.jsxs)(rt,{className:`hover:bg-transparent`,children:[(0,Q.jsx)(tt,{children:`Target artifact ID`}),(0,Q.jsx)(tt,{children:`Relation`}),(0,Q.jsx)(tt,{children:`Artifact`}),(0,Q.jsx)(tt,{children:`Created`}),(0,Q.jsx)(tt,{className:`w-24 text-right`,children:`Detail`})]})}),(0,Q.jsx)(nt,{children:n.map(e=>(0,Q.jsxs)(rt,{children:[(0,Q.jsx)(it,{children:(0,Q.jsx)(ei,{bundleId:e.id,fullOnMobile:!0,maxLength:18})}),(0,Q.jsx)(it,{children:(0,Q.jsxs)(`div`,{className:`flex min-w-[280px] flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2`,children:[(0,Q.jsx)(ei,{bundleId:t.id,fullOnMobile:!0,maxLength:12}),(0,Q.jsx)(jr,{className:`size-4 shrink-0 rotate-90 text-muted-foreground sm:rotate-0`}),(0,Q.jsx)(ei,{bundleId:e.id,fullOnMobile:!0,maxLength:12})]})}),(0,Q.jsx)(it,{children:(0,Q.jsx)(pn,{variant:`secondary`,children:`bsdiff`})}),(0,Q.jsx)(it,{className:`tabular-nums`,children:(0,Q.jsx)(Li,{uuid:e.id})}),(0,Q.jsx)(it,{className:`text-right`,children:(0,Q.jsx)(qe,{onClick:()=>i(e),size:`sm`,type:`button`,variant:`outline`,children:`Detail`})})]},e.id))})]})})]}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-semibold uppercase text-muted-foreground/70`,children:`Patch artifacts from this base`}),(0,Q.jsx)(`div`,{className:`rounded-md border bg-background p-3 text-sm text-muted-foreground`,children:`No direct patch artifacts.`})]})]})})}function zi(e){let t=[...e].sort((e,t)=>e.releaseId.localeCompare(t.releaseId));return W({queryKey:[`bundle-activity`,t],queryFn:()=>Gn({data:t}),enabled:t.length>0,staleTime:3e4})}function Bi(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function Vi(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var Hi=(e,t,n)=>cr(e,`xAxis`,Bi(e,t),n),Ui=(e,t,n)=>Nn(e,`xAxis`,Bi(e,t),n),Wi=(e,t,n)=>cr(e,`yAxis`,Vi(e,t),n),Gi=(e,t,n)=>Nn(e,`yAxis`,Vi(e,t),n),Ki=sr([yr,Hi,Wi,Ui,Gi],(e,t,n,r,i)=>hr(e,`xAxis`)?Un(t,r,!1):Un(n,i,!1)),qi=sr([Fn,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),Ji=e=>hr(yr(e),`xAxis`)?`yAxis`:`xAxis`,Yi=(e,t)=>Ji(e)===`yAxis`?Vi(e,t):Bi(e,t),Xi=sr([yr,Hi,Wi,Ui,Gi,sr([qi,(e,t,n)=>Mn(e,Ji(e),Yi(e,t),n)],(e,t)=>{if(!(e==null||t==null)){var{stackId:n}=e,r=Tn(e);if(!(n==null||r==null)){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Ln,Ki,qi,jn],(e,t,n,r,i,a,o,s,c,l)=>{var{chartData:u,dataStartIndex:d,dataEndIndex:f}=o;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var{data:p}=c,m=p&&p.length>0?p:u?.slice(d,f+1);if(m!=null)return Sa({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:m,chartBaseValue:l,bandSize:s})}}),Zi=[`id`],Qi=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function $i(){return $i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$i.apply(null,arguments)}function ea(e,t){if(e==null)return{};var n,r,i=ta(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ta(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function na(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?na(Object(n),!0).forEach(function(t){ia(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):na(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ia(e,t,n){return(t=aa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aa(e){var t=oa(e,`string`);return typeof t==`symbol`?t:t+``}function oa(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function sa(e,t){return e&&e!==`none`?e:t}var ca=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:sa(r,i),value:$n(n,t),payload:e}]},la=Z.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:tr,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:$n(o,t),hide:s,type:l,color:sa(r,a),unit:c,graphicalItemId:u}};return Z.createElement(Or,{tooltipEntrySettings:d})});function ua(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,s=rr(r);return Z.createElement(Jn,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function da(e){var{showLabels:t,children:n,points:r}=e,i=r.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return ra(ra({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return Z.createElement(wn,{value:t?i:void 0},n)}function fa(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:s,stroke:c,connectNulls:l,isRange:u}=a,{id:d}=a,f=ea(a,Zi),p=rr(f),m=ar(f);return Z.createElement(Z.Fragment,null,t?.length>1&&Z.createElement(pr,{clipPath:r?`url(#clipPath-${i})`:void 0},Z.createElement(En,$i({},m,{id:d,points:t,connectNulls:l,type:s,baseLine:n,layout:o,stroke:`none`,className:`recharts-area-area`})),c!==`none`&&Z.createElement(En,$i({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:t})),c!==`none`&&u&&Array.isArray(n)&&Z.createElement(En,$i({},p,{className:`recharts-area-curve`,layout:o,type:s,connectNulls:l,fill:`none`,points:n}))),Z.createElement(ua,{points:t,props:f,clipPathId:i}))}function pa(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.y,o=r[r.length-1]?.y;if(!xr(a)||!xr(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.x||0));return Qn(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.x||0),c)),Qn(c)?Z.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}function ma(e){var{alpha:t,baseLine:n,points:r,strokeWidth:i}=e,a=r[0]?.x,o=r[r.length-1]?.x;if(!xr(a)||!xr(o))return null;var s=t*Math.abs(a-o),c=Math.max(...r.map(e=>e.y||0));return Qn(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(e=>e.y||0),c)),Qn(c)?Z.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}function ha(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n===`vertical`?Z.createElement(pa,{alpha:t,points:r,baseLine:i,strokeWidth:a}):Z.createElement(ma,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function ga(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationStart:f,onAnimationEnd:p}=r,m=Dn((0,Z.useMemo)(()=>({points:o,baseLine:s}),[o,s]),`recharts-area-`),h=kn(),[g,_]=(0,Z.useState)(!1),v=!g,y=(0,Z.useCallback)(()=>{typeof p==`function`&&p(),_(!1)},[p]),b=(0,Z.useCallback)(()=>{typeof f==`function`&&f(),_(!0)},[f]);if(h==null)return null;var x=i.current,S=a.current;return Z.createElement(da,{showLabels:v,points:o},r.children,Z.createElement(Bn,{animationId:m,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:y,onAnimationStart:b,key:m},e=>{if(x){var l=x.length/o.length,u=e===1?o:o.map((t,n)=>{var r=Math.floor(n*l);if(x[r]){var i=x[r];return ra(ra({},t),{},{x:Xn(i.x,t.x,e),y:Xn(i.y,t.y,e)})}return t}),d=Qn(s)?Xn(S,s,e):Er(s)||dr(s)?Xn(S,0,e):s.map((t,n)=>{var r=Math.floor(n*l);if(Array.isArray(S)&&S[r]){var i=S[r];return ra(ra({},t),{},{x:Xn(i.x,t.x,e),y:Xn(i.y,t.y,e)})}return t});return e>0&&(i.current=u,a.current=d),Z.createElement(fa,{points:u,baseLine:d,needClip:t,clipPathId:n,props:r})}return e>0&&(i.current=o,a.current=s),Z.createElement(pr,null,c&&Z.createElement(`defs`,null,Z.createElement(`clipPath`,{id:`animationClipPath-${n}`},Z.createElement(ha,{alpha:e,points:o,baseLine:s,layout:h,strokeWidth:r.strokeWidth}))),Z.createElement(pr,{clipPath:`url(#animationClipPath-${n})`},Z.createElement(fa,{points:o,baseLine:s,needClip:t,clipPathId:n,props:r})))}),Z.createElement(Cn,{label:r.label}))}function _a(e){var{needClip:t,clipPathId:n,props:r}=e,i=(0,Z.useRef)(null),a=(0,Z.useRef)();return Z.createElement(ga,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var va=class extends Z.PureComponent{render(){var{hide:e,dot:t,points:n,className:r,top:i,left:a,needClip:o,xAxisId:s,yAxisId:c,width:l,height:u,id:d,baseLine:f,zIndex:p}=this.props;if(e)return null;var m=j(`recharts-area`,r),h=d,{r:g,strokeWidth:_}=fr(t),v=zn(t),y=g*2+_,b=o?`url(#clipPath-${v?``:`dots-`}${h})`:void 0;return Z.createElement(lr,{zIndex:p},Z.createElement(pr,{className:m},o&&Z.createElement(`defs`,null,Z.createElement(ir,{clipPathId:h,xAxisId:s,yAxisId:c}),!v&&Z.createElement(`clipPath`,{id:`clipPath-dots-${h}`},Z.createElement(`rect`,{x:a-y/2,y:i-y/2,width:l+y,height:u+y}))),Z.createElement(_a,{needClip:o,clipPathId:h,props:this.props})),Z.createElement(Dr,{points:n,mainColor:sa(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}),this.props.isRange&&Array.isArray(f)&&Z.createElement(Dr,{points:f,mainColor:sa(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:b}))}},ya={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,xAxisId:0,yAxisId:0,zIndex:On.area};function ba(e){var{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,connectNulls:a,dot:o,fill:s,fillOpacity:c,hide:l,isAnimationActive:u,legendType:d,stroke:f,xAxisId:p,yAxisId:m}=e,h=ea(e,Qi),g=Hn(),_=xn(),{needClip:v}=nr(p,m),y=Vn(),{points:b,isRange:x,baseLine:S}=qn(t=>Xi(t,e.id,y))??{},C=Ar();if(g!==`horizontal`&&g!==`vertical`||C==null||_!==`AreaChart`&&_!==`ComposedChart`)return null;var{height:w,width:T,x:E,y:D}=C;return!b||!b.length?null:Z.createElement(va,$i({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:S,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:w,hide:l,layout:g,isAnimationActive:u,isRange:x,legendType:d,needClip:v,points:b,stroke:f,width:T,left:E,top:D,xAxisId:p,yAxisId:m}))}var xa=(e,t,n,r,i)=>{var a=n??t;if(Qn(a))return a;var o=e===`horizontal`?i:r,s=o.scale.domain();if(o.type===`number`){var c=Math.max(s[0],s[1]),l=Math.min(s[0],s[1]);return a===`dataMin`?l:a===`dataMax`||c<0?c:Math.max(Math.min(s[0],s[1]),0)}return a===`dataMin`?s[0]:a===`dataMax`?s[1]:s[0]};function Sa(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:s,yAxis:c,displayedData:l,dataStartIndex:u,xAxisTicks:d,yAxisTicks:f,bandSize:p}=e,m=i&&i.length,h=xa(a,o,n,s,c),g=a===`horizontal`,_=!1,v=l.map((e,n)=>{var a;if(m)a=i[u+n];else{var o=wr(e,r);Array.isArray(o)?(a=o,_=!0):a=[h,o]}var l=a?.[1]??null,v=l==null||m&&!t&&wr(e,r)==null;return g?{x:In({axis:s,ticks:d,bandSize:p,entry:e,index:n}),y:v?null:c.scale.map(l)??null,value:a,payload:e}:{x:v?null:s.scale.map(l)??null,y:In({axis:c,ticks:f,bandSize:p,entry:e,index:n}),value:a,payload:e}});return{points:v,baseLine:(m||_?v.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:t!=null&&e.y!=null?c.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:s.scale.map(t)??null,y:e.y,payload:e.payload}}):g?c.scale.map(h):s.scale.map(h))??0,isRange:_}}function Ca(e){var t=_r(e,ya),n=Vn();return Z.createElement(Rn,{id:t.id,type:`area`},e=>Z.createElement(Z.Fragment,null,Z.createElement(Sn,{legendPayload:ca(t)}),Z.createElement(la,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),Z.createElement(kr,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:bn(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),Z.createElement(ba,$i({},t,{id:e}))))}var wa=Z.memo(Ca,An);wa.displayName=`Area`;var Ta=[`axis`],Ea=(0,Z.forwardRef)((e,t)=>Z.createElement(Zn,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:Ta,tooltipPayloadSearcher:Pn,categoricalChartProps:e,ref:t})),Da={active:{label:`Active`,color:`var(--chart-2)`},recoveredInstallations:{label:`Rollback`,color:`var(--muted-foreground)`}},Oa=e=>new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,timeZone:`UTC`}).format(e);function ka({series:e}){return e?(0,Q.jsx)(`div`,{className:`border-t pt-3`,children:(0,Q.jsx)(gr,{"aria-label":`Bundle activity over 30 days, UTC`,className:`h-32 w-full aspect-auto sm:h-40`,config:Da,children:(0,Q.jsxs)(Ea,{accessibilityLayer:!0,data:e.points,margin:{left:-16,right:4,top:4},children:[(0,Q.jsx)(Wn,{vertical:!1}),(0,Q.jsx)(vr,{axisLine:!1,dataKey:`startMs`,minTickGap:28,tickFormatter:Oa,tickLine:!1}),(0,Q.jsx)(er,{allowDecimals:!1,axisLine:!1,tickLine:!1,width:40}),(0,Q.jsx)(Sr,{content:(0,Q.jsx)(Yn,{})}),(0,Q.jsx)(ur,{content:(0,Q.jsx)(Tr,{labelFormatter:(e,t)=>`${Oa(t[0]?.payload.startMs)} · UTC`})}),(0,Q.jsx)(wa,{dataKey:`active`,fill:`var(--color-active)`,fillOpacity:.12,isAnimationActive:!1,stroke:`var(--color-active)`,strokeWidth:2,type:`linear`}),(0,Q.jsx)(wa,{dataKey:`recoveredInstallations`,fill:`var(--color-recoveredInstallations)`,fillOpacity:.04,isAnimationActive:!1,stroke:`var(--color-recoveredInstallations)`,strokeWidth:1.5,type:`linear`})]})})}):(0,Q.jsx)(`p`,{className:`flex h-16 items-center justify-center border-t text-xs text-muted-foreground sm:h-20`,children:`No reports in 30 days. Check again after the app reports activity.`})}function Aa({report:e,loading:t=!1}){if(!e)return t?(0,Q.jsx)(be,{"aria-label":`Loading bundle activity`,className:`h-4 w-32`}):(0,Q.jsx)(`span`,{"aria-label":`30-day bundle activity unavailable`,className:`text-sm text-muted-foreground`,children:`—`});let n=e.series[0];return(0,Q.jsxs)(`div`,{role:`group`,"aria-label":`Bundle activity over 30 days`,title:e.truncated?`Partial history. Counts include only the available reports.`:`Active: last observed ID per installation. Rollbacks: distinct installations recovered from this ID in 30 days.`,className:`flex min-w-[140px] items-baseline gap-3 whitespace-nowrap`,children:[(0,Q.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Active`}),(0,Q.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:n?.activeInstallations??0})]}),(0,Q.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Rollback`}),(0,Q.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:n?.recoveredInstallations??0})]}),e.truncated?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Partial`}):null]})}function ja({input:e}){let t=zi([e]),n=t.data?.[e.releaseId],r=n?.series[0];return(0,Q.jsxs)(nn,{children:[(0,Q.jsx)(Xt,{className:`px-4 pt-4 pb-3`,children:(0,Q.jsx)($t,{className:`text-sm font-medium`,children:`Activity · 30 days`})}),(0,Q.jsx)(Qt,{className:`flex flex-col gap-3 px-4 pb-4`,children:t.isPending?(0,Q.jsx)(be,{"aria-label":`Loading bundle activity`,className:`h-32 w-full`}):t.error?(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-sm text-muted-foreground`,children:[`Insights unavailable`,(0,Q.jsx)(qe,{variant:`outline`,size:`sm`,onClick:()=>void t.refetch(),children:`Retry`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`dl`,{className:`grid grid-cols-2 divide-x divide-border/70`,children:[(0,Q.jsxs)(`div`,{className:`pr-4`,children:[(0,Q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Active`}),(0,Q.jsx)(`dd`,{className:`mt-1 text-xl font-semibold tabular-nums`,children:r?.activeInstallations??0})]}),(0,Q.jsxs)(`div`,{className:`pl-4`,children:[(0,Q.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Rollback · 30d`}),(0,Q.jsx)(`dd`,{className:`mt-1 text-xl font-semibold tabular-nums`,children:r?.recoveredInstallations??0})]})]}),(0,Q.jsx)(ka,{series:r}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Last observed active installations · daily rollbacks`,n?.truncated?` · Partial history`:``]})]})})]})}var Ma=Re({method:`GET`}).handler(He(`206547cb1526f961070a989818ca7b9e34f6b2b0e4ab851698c3807fe9fb5e0c`)),Na=Re({method:`GET`}).handler(He(`a6f23116eeaf76166d405e28a95213123025613c6603030894e519015bf48032`)),Pa=Re({method:`POST`}).handler(He(`7ea0186f19f9f2bc2ca4b26e3c59636891cf046957f84287b6783f8d88bd8cb7`)),Fa=Re({method:`POST`}).handler(He(`b46c95dba95a6a3e8fa5c9d100e3622fa5ae7af4f38e10fb1ed2fa48289a3a8f`)),Ia=Re({method:`POST`}).handler(He(`d5b58722ce514e3b63a377f736b4823c2011782495442ae4870ed547e392c70b`)),La=Re({method:`POST`}).handler(He(`956539a300d79a7efa191c1cc2d529d62fc4bfd940442548fdbc1404e0d53078`)),Ra=Re({method:`GET`}).handler(He(`e8c24b7247936f045a145ffd5c177fd0e3df3b52769d67dfbd8d1de491d66396`)),za=Re().handler(He(`51a34c05479a893c7d320bd4cd1604427289d667698c48b9f30a01aabf8a5e68`)),Ba=Re().handler(He(`79ada05964de8f2123bfcd62b10097d59bf8fd689ef5c7161031e5871d8396c5`)),Va=Re({method:`POST`}).handler(He(`2b9b8d1f49f79a511589617d8d4bfc6094a3acf5264f33651b9569ba66d3f321`)),Ha=Re({method:`POST`}).handler(He(`52756dde414919a906bfe83d1ab6d29910c63bcafdb47653d6f1df562d958920`));Re().handler(He(`f8bdca3d0579adb812d6404f55d9261a89cdb025e920b1fcad82883646a5fe9e`)),Re({method:`GET`}).handler(He(`00ccacb4a0212c83ec29f4d11719046ad91ea8291cfc557d514dbf00d3bd7f5f`));var Ua=Re({method:`GET`}).handler(He(`1bd85c2a50e24785cb6abb023a247a9f048f37ddfa85cbb1c57e579563bad013`)),Wa=Re({method:`GET`}).handler(He(`4370f1bf70b91f1168d85379d3008449a1bedb915e9878ca4ef89d5f3a80fa7f`)),Ga=Re({method:`GET`}).handler(He(`4ca367070b00f58179a572f0bb8196a4ccdd3881e9b1dbfe33deee0cb6e1f549`));Re({method:`POST`}).handler(He(`16cc7c2f080ea5b73e0c6bba815b110dbd7727796036d248ba0d8ae819ddef08`)),Re({method:`POST`}).handler(He(`3a27ff5679228b86a346b3fe42142e7a5bf0264f73173c0dbe5f07fb37c43cf7`)),Re({method:`POST`}).handler(He(`61de3b69779c5ce2a5f5d3c27e2cfaca8fba8f14c8803559b9cd733c456494fa`));var Ka=[`bundles`],qa=[`releases`],Ja={config:[`config`],channels:[`channels`],configLoaded:[`config-loaded`],bundles:{all:Ka,list:e=>[...Ka,e??{}]},releases:{all:qa,list:e=>[...qa,e??{}]},release:e=>[`release`,e],releaseCatalog:e=>[`release-catalog`,e],bundleChildren:{all:[`bundle-children`],list:e=>[`bundle-children`,e],counts:e=>[`bundle-children`,`counts`,...e]},bundle:e=>[`bundle`,e]};function Ya(){return W({queryKey:Ja.config,queryFn:()=>za(),staleTime:1/0})}function Xa(){return W({queryKey:Ja.channels,queryFn:()=>Ba(),staleTime:1/0})}function Za(e){return W({queryKey:Ja.releases.list(e),queryFn:()=>Ma({data:e}),placeholderData:e=>e})}function Qa(e){return W({enabled:e.length>0,queryFn:()=>Na({data:{releaseId:e}}),queryKey:Ja.release(e)})}function $a(e){return W({enabled:e.length>0,queryFn:()=>Ra({data:{scopeKey:e}}),queryKey:Ja.releaseCatalog(e)})}function eo(e){return W({queryKey:Ja.bundle(e),queryFn:()=>Ua({data:{bundleId:e}}),staleTime:1/0,enabled:!!e})}function to(e){return W({queryKey:Ja.bundleChildren.list(e),queryFn:()=>Wa({data:{baseBundleId:e}}),staleTime:1/0,enabled:!!e})}function no(e){let t=[...e].sort((e,t)=>e.localeCompare(t));return W({queryKey:Ja.bundleChildren.counts(t),queryFn:()=>Ga({data:{bundleIds:t}}),staleTime:1/0,enabled:t.length>0})}function ro(){let e=G();return Ze({mutationFn:e=>Va({data:e}).then(e=>e.data),onSuccess:async()=>{await e.invalidateQueries({queryKey:Ja.channels})}})}function io(){let e=G();return Ze({mutationFn:e=>Ha({data:e}).then(e=>e.data),onSettled:async()=>{await e.invalidateQueries({queryKey:Ja.channels})}})}function ao(){let e=G();return Ze({mutationFn:e=>Pa({data:e}),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:Ja.releases.all}),e.invalidateQueries({queryKey:Ja.release(n.releaseId)}),e.invalidateQueries({queryKey:[`release-catalog`]}),e.invalidateQueries({queryKey:Ja.channels})])}})}function oo(){return Ze({mutationFn:e=>Fa({data:e})})}function so(){let e=G();return Ze({mutationFn:e=>Ia({data:e}),onSuccess:async(t,n)=>{e.removeQueries({queryKey:Ja.release(n.releaseId)}),await Promise.all([e.invalidateQueries({queryKey:Ja.releases.all}),e.invalidateQueries({queryKey:[`release-catalog`]}),e.invalidateQueries({queryKey:Ja.channels})])}})}function co(){let e=G();return Ze({mutationFn:e=>La({data:e}),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:Ja.releases.all}),e.invalidateQueries({queryKey:[`release`]}),e.invalidateQueries({queryKey:[`release-catalog`]}),e.invalidateQueries({queryKey:Ja.channels})])}})}function lo({open:e,onOpenChange:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(null),{data:o=[],isPending:s}=Xa(),c=ro(),l=io(),u=n.trim(),d=async e=>{if(e.preventDefault(),!(!u||c.isPending))try{let e=await c.mutateAsync({row:{id:Mi(),name:u},onConflict:`returnExisting`});r(``),e.inserted?Yt.success(`Channel ${e.row.name} created`):Yt.info(`Channel ${e.row.name} already exists`)}catch(e){Yt.error(`Failed to create channel`),console.error(e)}},f=async()=>{if(!(!i||l.isPending))try{let e=await l.mutateAsync({id:i.id});e.deleted?Yt.success(`Channel ${i.name} deleted`):e.reason===`not_empty`?Yt.error(`Channel ${i.name} is still in use and cannot be deleted`):Yt.error(`Channel ${i.name} no longer exists`),a(null)}catch(e){Yt.error(`Failed to delete channel`),console.error(e)}};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Wt,{open:e,onOpenChange:t,children:(0,Q.jsxs)(zt,{className:`sm:max-w-lg`,children:[(0,Q.jsxs)(Ot,{children:[(0,Q.jsxs)(Bt,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Hr,{className:`size-4 text-muted-foreground`}),`Channels`]}),(0,Q.jsx)(Ht,{children:`Create deployment channels and remove them when no bundle uses them. Empty channels remain available until you delete them.`})]}),(0,Q.jsx)(`form`,{onSubmit:d,children:(0,Q.jsx)(hn,{className:`gap-2`,children:(0,Q.jsxs)(yn,{orientation:`horizontal`,children:[(0,Q.jsx)(mn,{htmlFor:`channel-name`,className:`sr-only`,children:`Channel name`}),(0,Q.jsx)(Ve,{id:`channel-name`,value:n,onChange:e=>r(e.target.value),placeholder:`Channel name`,autoComplete:`off`,disabled:c.isPending}),(0,Q.jsxs)(qe,{type:`submit`,disabled:!u||c.isPending,children:[c.isPending?(0,Q.jsx)(Qe,{"data-icon":`inline-start`,className:`animate-spin`}):(0,Q.jsx)(Ct,{"data-icon":`inline-start`}),`Create`]})]})})}),(0,Q.jsx)(`div`,{className:`max-h-72 overflow-y-auto rounded-lg border`,children:s?(0,Q.jsxs)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(Qe,{className:`mr-2 size-3.5 animate-spin`}),`Loading channels`]}):o.length===0?(0,Q.jsx)(`div`,{className:`flex h-20 items-center justify-center text-muted-foreground`,children:`No channels yet`}):(0,Q.jsx)(`ul`,{className:`divide-y`,children:o.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-h-12 items-center gap-3 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.name}),(0,Q.jsx)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,Q.jsx)(qe,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete ${e.name}`,title:`Delete ${e.name}`,disabled:l.isPending,onClick:()=>a(e),className:`text-muted-foreground hover:text-destructive`,children:(0,Q.jsx)(Wr,{"data-icon":`inline-start`})})]},e.id))})})]})}),(0,Q.jsx)(Lt,{open:i!==null,onOpenChange:e=>{!e&&!l.isPending&&a(null)},children:(0,Q.jsxs)(Mt,{children:[(0,Q.jsxs)(Nt,{children:[(0,Q.jsxs)(Dt,{children:[`Delete `,i?.name,`?`]}),(0,Q.jsx)(Vt,{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,Q.jsxs)(Rt,{children:[(0,Q.jsx)(jt,{disabled:l.isPending,children:`Cancel`}),(0,Q.jsx)(Gt,{variant:`destructive`,disabled:l.isPending,onClick:e=>{e.preventDefault(),f()},children:l.isPending?`Deleting...`:`Delete channel`})]})]})})]})}var uo=`[a-zA-Z0-9-]`,fo=String.raw`0|[1-9]\d*`,po=String.raw`\d+`,mo=String.raw`\d*[a-zA-Z-]${uo}*`,ho=String.raw`(${fo})\.(${fo})\.(${fo})`,go=String.raw`(${po})\.(${po})\.(${po})`,_o=`(?:${mo}|${fo})`,vo=`(?:${mo}|${po})`,yo=String.raw`(?:-(${_o}(?:\.${_o})*))`,bo=String.raw`(?:-?(${vo}(?:\.${vo})*))`,xo=`${uo}+`,So=String.raw`(?:\+(${xo}(?:\.${xo})*))`,Co=`v?${ho}${yo}?${So}?`,wo=String.raw`[v=\s]*${go}${bo}?${So}?`,To=`((?:<|>)?=?)`,Eo=String.raw`${fo}|x|X|\*`,Do=String.raw`${po}|x|X|\*`,Oo=String.raw`[v=\s]*(${Eo})(?:\.(${Eo})(?:\.(${Eo})(?:${yo})?${So}?)?)?`,ko=String.raw`[v=\s]*(${Do})(?:\.(${Do})(?:\.(${Do})(?:${bo})?${So}?)?)?`,Ao=`(?:~>?)`,jo=String.raw`(?:\^)`,Mo=String.raw`(^|[^\d])(\d{1,${16}})(?:\.(\d{1,${16}}))?(?:\.(\d{1,${16}}))?`;String.raw`${Mo}(?:$|[^\d])`,String.raw`${Mo}(?:${yo})?(?:${So})?(?:$|[^\d])`;function No(e){let t=[[String.raw`\s`,1],[String.raw`\d`,256],[uo,250]];for(let[n,r]of t)e=e.split(`${n}*`).join(`${n}{0,${r}}`).split(`${n}+`).join(`${n}{1,${r}}`);return e}function Po(e,t){return new RegExp(No(e),t)}var Fo=Po(`^${Co}$`),Io=Po(`^${wo}$`),Lo=/^\d+$/;function Ro(e){let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease?.length?`${t}-${e.prerelease.join(`.`)}`:t}function zo(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?Io:Fo);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(Lo.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 Bo=Po(String.raw`^${To}\s*(${Co})$|^$`),Vo=Po(String.raw`^${To}\s*(${wo})$|^$`);function Ho(e){return e.version?`${e.operator}${Ro(e.version)}`:``}function Uo(e,t={}){if(typeof e!=`string`)return e;let n=e.trim().replaceAll(/\s+/g,` `),r=n.match(t.loose?Vo:Bo);if(!r)throw TypeError(`Invalid comparator: ${n}`);let i=r[1]===`=`?``:r[1]||``,a=r[2]?zo(r[2],t):null;return{operator:i,options:t,value:a?`${i}${Ro(a)}`:``,version:a}}function Wo(e){return e.sets.map(e=>e.map(Ho).join(` `)).join(`||`)}var Go=new RegExp(So,`g`),Ko=Po(So),qo=Po(String.raw`^\s*(${Oo})\s+-\s+(${Oo})\s*$`),Jo=Po(String.raw`^\s*(${ko})\s+-\s+(${ko})\s*$`),Yo=Po(String.raw`(\s*)${To}\s*(${wo}|${Oo})`,`g`),Xo=Po(String.raw`(\s*)${Ao}\s+`,`g`),Zo=Po(String.raw`(\s*)${jo}\s+`,`g`),Qo=Po(`^${Ao}${Oo}$`),$o=Po(`^${Ao}${ko}$`),es=Po(`^${jo}${Oo}$`),ts=Po(`^${jo}${ko}$`),ns=Po(String.raw`^${To}\s*${Oo}$`),rs=Po(String.raw`^${To}\s*${ko}$`),is=Po(String.raw`(<|>)?=?\s*\*`),as=/^\s*>=\s*0\.0\.0\s*$/,os=/^\s*>=\s*0\.0\.0-0\s*$/,ss=Po(String.raw`^${To}\s*(${wo})$|^$`);function cs(e){return!e||String(e).toLowerCase()===`x`||String(e)===`*`}function ls(e,t,n){return cs(e)&&!cs(t)||cs(t)&&!!n&&!cs(n)}function us(e,t){let n=t.loose?$o:Qo,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>cs(t)?``:cs(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:cs(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 ds(e,t){return e.trim().split(/\s+/).map(e=>us(e,t)).join(` `)}function fs(e,t){let n=t.loose?ts:es,r=t.includePrerelease?`-0`:``;return e.replace(n,(e,t,n,i,a)=>cs(t)?``:cs(n)?`>=${t}.0.0${r} <${Number(t)+1}.0.0-0`:cs(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 ps(e,t){return e.trim().split(/\s+/).map(e=>fs(e,t)).join(` `)}function ms(e,t){let n=t.loose?rs:ns;return e.trim().replace(n,(n,r,i,a,o)=>{let s=r,c=i,l=a,u=o;if(ls(String(c),l===void 0?void 0:String(l),u===void 0?void 0:String(u)))return e;let d=cs(c),f=d||cs(l),p=f||cs(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 hs(e,t){return e.split(/\s+/).map(e=>ms(e,t)).join(` `)}function gs(e,t){let n=t.loose?Jo:qo;return e.replace(n,(e,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n,m=c;return p=cs(r)?``:cs(i)?`>=${r}.0.0${t.includePrerelease?`-0`:``}`:cs(a)?`>=${r}.${i}.0${t.includePrerelease?`-0`:``}`:o?`>=${p}`:`>=${p}${t.includePrerelease?`-0`:``}`,m=cs(l)?``:cs(u)?`<${Number(l)+1}.0.0-0`:cs(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 _s(e,t){return hs(ds(ps(e.replace(Ko,``),t),t),t).trim().replace(is,``)}function vs(e,t){let n=gs(e.replace(Go,``),t).replace(Yo,`$1$2$3`).replace(Xo,`$1~`).replace(Zo,`$1^`).split(` `).map(e=>_s(e,t)).join(` `).split(/\s+/).map(e=>e.trim().replace(t.includePrerelease?os:as,``));t.loose&&(n=n.filter(e=>ss.test(e)));let r=new Map;for(let e of n.map(e=>Uo(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 ys(e,t={}){if(typeof e!=`string`)return e;let n={...t},r=e.trim().replaceAll(/\s+/g,` `),i=r.split(`||`).map(e=>vs(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 bs(e,t={}){try{return ys(e,t)}catch{return null}}function xs(e,t={}){let n=bs(e,t);return n?Wo(n)||`*`:null}var Ss=e=>{let t=e.trim();if(t.startsWith(`git@`)){let e=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(e)return`https://${e[1]}/${e[2]}`}if(t.startsWith(`ssh://`))try{let e=new URL(t);return`https://${e.hostname}${e.pathname}`.replace(/\/+$/,``).replace(/\.git$/,``)}catch{return t.replace(/\/+$/,``).replace(/\.git$/,``)}return t.replace(/\/+$/,``).replace(/\.git$/,``)},Cs=(e,t)=>{if(!e?.trim())return null;let n=Ss(e);try{let{hostname:e}=new URL(n);if(e.includes(`gitlab`))return`${n}/-/commit/${t}`;if(e.includes(`bitbucket`))return`${n}/commits/${t}`}catch{}return`${n}/commit/${t}`};function ws({label:e,value:t}){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-4`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`min-w-0 text-left text-sm sm:text-right`,children:t})]})}function Ts({bundle:e,release:t}){let{data:n,isFetched:r}=Ya(),i=e?ui(e):null,a=e?li(e):null,o=e?.gitCommitHash&&r?Cs(n?.console.gitUrl,e.gitCommitHash):null,s=t.strategy===`APP_VERSION`?t.target_app_version:t.fingerprint_hash;return s||e?.gitCommitHash||e?.fileHash||a||i?(0,Q.jsxs)(nn,{children:[(0,Q.jsx)(Xt,{className:`p-4 pb-3`,children:(0,Q.jsx)($t,{className:`text-sm font-medium`,children:`Metadata`})}),(0,Q.jsx)(Qt,{className:`px-4 pb-4`,children:(0,Q.jsxs)(`dl`,{className:`flex flex-col gap-3 text-sm`,children:[(0,Q.jsx)(ws,{label:t.strategy===`APP_VERSION`?`Target app version`:`Fingerprint target`,value:(0,Q.jsx)(`span`,{className:`break-all font-mono text-xs`,translate:`no`,children:s??`—`})}),e?.gitCommitHash?(0,Q.jsx)(ws,{label:`Git commit`,value:(0,Q.jsxs)(`div`,{className:`flex items-center justify-start gap-1 sm:justify-end`,children:[(0,Q.jsx)(ft,{className:o?`text-primary`:void 0,maxLength:12,value:e.gitCommitHash}),o?(0,Q.jsx)(`a`,{"aria-label":`Open git commit`,className:`shrink-0 text-primary hover:underline`,href:o,rel:`noopener noreferrer`,target:`_blank`,children:(0,Q.jsx)(Lr,{"aria-hidden":`true`})}):null]})}):null,e?.fileHash?(0,Q.jsx)(ws,{label:`Bundle hash`,value:(0,Q.jsx)(ft,{maxLength:16,value:e.fileHash})}):null,a?(0,Q.jsx)(ws,{label:`Base hash`,value:(0,Q.jsx)(ft,{maxLength:16,value:a})}):null,i?(0,Q.jsx)(ws,{label:`Patch hash`,value:(0,Q.jsx)(ft,{maxLength:16,value:i})}):null]})})]}):null}var Es=Array.from({length:di},(e,t)=>t+1);function Ds({releaseId:e,rolloutCohortCount:t,targetCohorts:n}){let r=xi(t),i=n??[],a=i.length>0,o=r>0&&r<1e3,s=r===di,c=Se(),l=s?Es:o?Es.filter(t=>Di(e,t)<r):[],u=(r/10).toFixed(1),d=s?di:l.length,f=di-d,p=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Q.jsx)(nn,{children:(0,Q.jsxs)(Xt,{className:`p-4`,children:[(0,Q.jsx)(en,{children:`Selected cohorts`}),(0,Q.jsx)($t,{className:`font-mono text-2xl tabular-nums`,children:d})]})}),(0,Q.jsx)(nn,{children:(0,Q.jsxs)(Xt,{className:`p-4`,children:[(0,Q.jsx)(en,{children:`Excluded cohorts`}),(0,Q.jsx)($t,{className:`font-mono text-2xl tabular-nums`,children:f})]})})]}),a?(0,Q.jsxs)(nn,{children:[(0,Q.jsxs)(Xt,{className:`p-4 pb-3`,children:[(0,Q.jsx)($t,{className:`text-sm`,children:`Additional cohorts`}),(0,Q.jsx)(en,{children:`Always included in addition to the percentage rollout.`})]}),(0,Q.jsx)(Qt,{className:`p-4 pt-0`,children:(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2 rounded-lg border bg-muted/20 p-3`,children:i.map(e=>(0,Q.jsx)(pn,{className:`max-w-full font-mono`,variant:`secondary`,children:(0,Q.jsx)(`span`,{className:`truncate`,children:e})},e))})})]}):null,(0,Q.jsxs)(nn,{children:[(0,Q.jsx)(Xt,{className:`p-4 pb-3`,children:(0,Q.jsx)($t,{className:`text-sm`,children:`Numeric cohorts`})}),(0,Q.jsx)(Qt,{className:`p-4 pt-0`,children:(0,Q.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,Q.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,Q.jsx)(pn,{className:`justify-center font-mono tabular-nums`,role:`listitem`,variant:`outline`,children:e},e))}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No numeric cohorts are included.`})})})]})]});return(0,Q.jsxs)(Wt,{children:[(0,Q.jsxs)(Ut,{render:(0,Q.jsx)(qe,{size:`sm`,type:`button`,variant:`outline`}),children:[(0,Q.jsx)(Br,{"data-icon":`inline-start`}),`Preview cohorts`]}),(0,Q.jsx)(zt,{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,Q.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,Q.jsxs)(Ot,{className:`shrink-0 border-b border-border/70 px-4 py-4`,children:[(0,Q.jsx)(Bt,{children:`Rolled out cohorts`}),(0,Q.jsxs)(Ht,{children:[u,`% includes `,d,` of`,` `,di,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain px-4 py-4`,children:p}),(0,Q.jsx)(Pt,{className:`shrink-0 border-t border-border/70 px-4 py-3`,showCloseButton:!0})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(Ot,{children:[(0,Q.jsx)(Bt,{children:`Rolled out cohorts`}),(0,Q.jsxs)(Ht,{children:[u,`% includes `,d,` of`,` `,di,` numeric cohorts.`,a?` Additional cohorts are always included.`:``]})]}),p,(0,Q.jsx)(Pt,{showCloseButton:!0})]})})]})}function Os({className:e}){return(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,fill:`currentColor`,children:(0,Q.jsx)(`path`,{d:`M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701`})})}function ks({className:e}){return(0,Q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,fill:`currentColor`,children:(0,Q.jsx)(`path`,{d:`M18.4395 5.5586c-.675 1.1664-1.352 2.3318-2.0274 3.498-.0366-.0155-.0742-.0286-.1113-.043-1.8249-.6957-3.484-.8-4.42-.787-1.8551.0185-3.3544.4643-4.2597.8203-.084-.1494-1.7526-3.021-2.0215-3.4864a1.1451 1.1451 0 0 0-.1406-.1914c-.3312-.364-.9054-.4859-1.379-.203-.475.282-.7136.9361-.3886 1.5019 1.9466 3.3696-.0966-.2158 1.9473 3.3593.0172.031-.4946.2642-1.3926 1.0177C2.8987 12.176.452 14.772 0 18.9902h24c-.119-1.1108-.3686-2.099-.7461-3.0683-.7438-1.9118-1.8435-3.2928-2.7402-4.1836a12.1048 12.1048 0 0 0-2.1309-1.6875c.6594-1.122 1.312-2.2559 1.9649-3.3848.2077-.3615.1886-.7956-.0079-1.1191a1.1001 1.1001 0 0 0-.8515-.5332c-.5225-.0536-.9392.3128-1.0488.5449zm-.0391 8.461c.3944.5926.324 1.3306-.1563 1.6503-.4799.3197-1.188.0985-1.582-.4941-.3944-.5927-.324-1.3307.1563-1.6504.4727-.315 1.1812-.1086 1.582.4941zM7.207 13.5273c.4803.3197.5506 1.0577.1563 1.6504-.394.5926-1.1038.8138-1.584.4941-.48-.3197-.5503-1.0577-.1563-1.6504.4008-.6021 1.1087-.8106 1.584-.4941z`})})}function As({platform:e,className:t}){return e===`ios`?(0,Q.jsx)(Os,{className:t}):(0,Q.jsx)(ks,{className:t})}var js=Z.createContext(null),Ms=Z.createContext(null);function Ns(){let e=Z.useContext(js);if(e===null)throw Error(z(60));return e}function Ps(){let e=Z.useContext(Ms);if(e===null)throw Error(z(61));return e}var Fs=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),Is={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ls={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Rs={disabled:!1,...Ls},zs={valid(e){return e===null?null:e?{[Fs.valid]:``}:{[Fs.invalid]:``}}},Bs={invalid:void 0,name:void 0,validityData:{state:Is,errors:[],error:``,value:``,initialValue:null},setValidityData:Ye,disabled:void 0,touched:Ls.touched,setTouched:Ye,dirty:Ls.dirty,setDirty:Ye,filled:Ls.filled,setFilled:Ye,focused:Ls.focused,setFocused:Ye,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Rs,markedDirtyRef:{current:!1},registerFieldControl:Ye,validation:{getValidationProps:(e=P)=>e,getInputValidationProps:(e=P)=>e,inputRef:{current:null},commit:async()=>{}}},Vs=Z.createContext(Bs);function Hs(e=!0){let t=Z.useContext(Vs);if(t.setValidityData===Ye&&!e)throw Error(z(28));return t}function Us(e,t,n,r,i=!0){let{registerFieldControl:a}=Hs(),o=Z.useRef(null);o.current||=Symbol(),L(()=>{let s=o.current;if(!(!s||!i))return a(s,{controlRef:e,getValue:r,id:t,value:n}),()=>{a(s,void 0)}},[e,i,r,t,a,n])}var Ws=Z.createContext({controlId:void 0,registerControlId:Ye,labelId:void 0,setLabelId:Ye,messageIds:[],setMessageIds:Ye,getDescriptionProps:e=>e});function Gs(){return Z.useContext(Ws)}function Ks(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=Gs(),o=We(t),s=n?i:void 0,c=h(()=>Symbol(`labelable-control`)),l=Z.useRef(!1),d=Z.useRef(t!=null),f=u(()=>{!l.current||a===Ye||(l.current=!1,a(c.current,void 0))});return L(()=>{if(a===Ye)return;let e;if(n){let n=r?.current;e=De(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)d.current=!0,e=t;else if(d.current)e=o;else{f();return}if(e===void 0){f();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,f]),Z.useEffect(()=>f,[f]),i??o}var qs=(e,t)=>Object.is(e,t);function Js(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Ys(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:Js(t,e,n))}function Xs(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:Js(e,t,n))}function Zs(e,t,n){return e.filter(e=>!Js(t,e,n))}function Qs(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function $s(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function ec(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if($s(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function tc(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return Qs(e)}function nc(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Qs(e.value):Qs(e)}function rc(e,t,n){function r(){return tc(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=$s(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function ic(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Q.jsx)(Z.Fragment,{children:rc(r,t,n)},i)),e),[])}var $={id:v(e=>e.id),labelId:v(e=>e.labelId),modal:v(e=>e.modal),multiple:v(e=>e.multiple),items:v(e=>e.items),itemToStringLabel:v(e=>e.itemToStringLabel),itemToStringValue:v(e=>e.itemToStringValue),isItemEqualToValue:v(e=>e.isItemEqualToValue),value:v(e=>e.value),hasSelectedValue:v(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:nc(t,r)!==``}),hasNullItemLabel:v((e,t)=>t?ec(e.items):!1),open:v(e=>e.open),mounted:v(e=>e.mounted),forceMount:v(e=>e.forceMount),transitionStatus:v(e=>e.transitionStatus),openMethod:v(e=>e.openMethod),activeIndex:v(e=>e.activeIndex),selectedIndex:v(e=>e.selectedIndex),isActive:v((e,t)=>e.activeIndex===t),isSelected:v((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>Js(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Js(n,i,r)}),isSelectedByFocus:v((e,t)=>e.selectedIndex===t),popupProps:v(e=>e.popupProps),triggerProps:v(e=>e.triggerProps),triggerElement:v(e=>e.triggerElement),positionerElement:v(e=>e.positionerElement),listElement:v(e=>e.listElement),popupSide:v(e=>e.popupSide),scrollUpArrowVisible:v(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:v(e=>e.scrollDownArrowVisible),hasScrollArrows:v(e=>e.hasScrollArrows)},ac=Z.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ye,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function oc(){return Z.useContext(ac)}function sc(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function cc(e,t){return Math.max(0,e-t)}function lc(e,t){if(t<=0)return 0;let n=sc(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function uc(e){let{id:t,value:n,defaultValue:i=null,onValueChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,name:l,form:f,autoComplete:p,disabled:g=!1,readOnly:_=!1,required:v=!1,modal:y=!0,actionsRef:x,inputRef:S,onOpenChangeComplete:w,items:T,multiple:D=!1,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:j=qs,highlightItemOnHover:M=!0,children:ee}=e,{clearErrors:N}=oc(),{setDirty:te,setTouched:ne,setFocused:F,shouldValidateOnChange:I,validityData:R,setFilled:z,name:ie,disabled:B,validation:H,validationMode:U}=Hs(),W=Ks({id:t}),le=B||g,G=ie??l,[K,ue]=Kn({controlled:n,default:D?i??C:i,name:`Select`,state:`value`}),[de,fe]=Kn({controlled:o,default:s,name:`Select`,state:`open`}),pe=Z.useRef([]),me=Z.useRef([]),he=Z.useRef(null),ge=Z.useRef(null),_e=Z.useRef(0),ve=Z.useRef(null),ye=Z.useRef([]),be=Z.useRef(!1),xe=Z.useRef(!1),Se=Z.useRef(null),we=Z.useRef(null),Te=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),q=Z.useRef(!1),{mounted:De,setMounted:Oe,transitionStatus:ke}=V(de),{openMethod:Ae,triggerProps:je}=Jt(de),J=h(()=>new b({id:W,labelId:void 0,modal:y,multiple:D,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:j,value:K,open:de,mounted:De,transitionStatus:ke,items:T,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Me=Y(J,$.activeIndex),Ne=Y(J,$.selectedIndex),Pe=Y(J,$.triggerElement),Fe=Y(J,$.positionerElement),Ie=$r(Ae),Le=Ae??Ie,Re=Z.useMemo(()=>D&&Array.isArray(K)&&K.length===0?``:nc(K,k),[D,K,k]),ze=Z.useMemo(()=>D&&Array.isArray(K)?K.map(e=>nc(e,k)):nc(K,k),[D,K,k]);Us(r(J.state.triggerElement),W,K,u(()=>ze));let Be=Z.useRef(K),Ve=D?Array.isArray(K)&&K.length>0:K!=null;L(()=>{K!==Be.current&&J.set(`forceMount`,!0)},[J,K]),L(()=>{z(Ve)},[Ve,z]),L(function(){let e=ye.current,t;if(D){let n=Array.isArray(K)?K:[];if(n.length===0)t=null;else{let r=n[n.length-1],i=Xs(e,r,j);t=i===-1?null:i}}else{let n=Xs(e,K,j);t=n===-1?null:n}t===null&&(we.current=null),!de&&J.set(`selectedIndex`,t)},[Ve,D,de,K,ye,j,J,we]),kt(K,()=>{N(G),te(K!==R.initialValue),I()?H.commit(K):H.commit(K,!0)});let He=u((e,t)=>{if(c?.(e,t),!t.isCanceled&&(fe(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(ne(!0),F(!1),U===`onBlur`&&H.commit(K)),!e&&J.state.activeIndex!==null)){let e=pe.current[J.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Ue=u(()=>{Oe(!1),J.update({activeIndex:null,openMethod:null}),w?.(!1)});m({enabled:!x,open:de,ref:he,onComplete(){de||Ue()}}),Z.useImperativeHandle(x,()=>({unmount:Ue}),[Ue]);let We=u((e,t)=>{a?.(e,t),!t.isCanceled&&ue(e)}),Ge=u(()=>{let e=J.state.listElement||he.current;if(!e)return;let t=cc(e.scrollHeight,e.clientHeight),n=lc(e.scrollTop,t),r=n>0,i=n<t;J.state.scrollUpArrowVisible!==r&&J.set(`scrollUpArrowVisible`,r),J.state.scrollDownArrowVisible!==i&&J.set(`scrollDownArrowVisible`,i)}),X=Ee({open:de,onOpenChange:He,elements:{reference:Pe,floating:Fe}}),Ke=vt(X,{enabled:!_&&!le,event:`mousedown`}),qe=ce(X),Je=Zr(X,{enabled:!_&&!le,listRef:pe,activeIndex:Me,selectedIndex:Ne,disabledIndices:C,onNavigate(e){e===null&&!de||J.set(`activeIndex`,e)},focusItemOnHover:M}),Ye=Qr(X,{enabled:!_&&!le&&(de||!D),listRef:me,activeIndex:Me,selectedIndex:Ne,onMatch(e){de?J.set(`activeIndex`,e):We(ye.current[e],E(`none`))},onTyping(e){be.current=e}}),Xe=Z.useMemo(()=>{let e=oe(Ye.reference,Je.reference,qe.reference,Ke.reference,je);return W&&(e.id=W),e},[Ke.reference,Ye.reference,Je.reference,qe.reference,je,W]),Ze=Z.useMemo(()=>oe(A,Ye.floating,Je.floating,qe.floating),[Ye.floating,Je.floating,qe.floating]),Qe=Je.item??P;Ce(()=>{J.update({popupProps:Ze,triggerProps:Xe})}),L(()=>{J.update({id:W,modal:y,multiple:D,value:K,open:de,mounted:De,transitionStatus:ke,popupProps:Ze,triggerProps:Xe,items:T,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:j,openMethod:Le})},[J,W,y,D,K,de,De,ke,Ze,Xe,T,O,k,j,Le]);let $e=Z.useMemo(()=>({store:J,name:G,required:v,disabled:le,readOnly:_,multiple:D,highlightItemOnHover:M,setValue:We,setOpen:He,listRef:pe,popupRef:he,scrollHandlerRef:ge,handleScrollArrowVisibility:Ge,scrollArrowsMountedCountRef:_e,itemProps:Qe,events:X.context.events,valueRef:ve,valuesRef:ye,labelsRef:me,typingRef:be,selectionRef:Te,firstItemTextRef:Se,selectedItemTextRef:we,validation:H,onOpenChangeComplete:w,keyboardActiveRef:xe,alignItemWithTriggerActiveRef:q,initialValueRef:Be}),[J,G,v,le,_,D,M,We,He,Qe,X.context.events,H,w,Ge]),et=ae(S,H.inputRef),tt=D&&Array.isArray(K)&&K.length>0,nt=D?void 0:G,rt=Z.useMemo(()=>!D||!Array.isArray(K)||!G?null:K.map(e=>{let t=nc(e,k);return(0,Q.jsx)(`input`,{type:`hidden`,form:f,name:G,value:t},t)}),[D,K,f,G,k]);return(0,Q.jsx)(js.Provider,{value:$e,children:(0,Q.jsxs)(Ms.Provider,{value:X,children:[ee,(0,Q.jsx)(`input`,{...H.getInputValidationProps({onFocus(){J.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||le||_){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=E(se,e.nativeEvent);function r(){if(D)return;let e=ye.current.find(e=>nc(e,k).toLowerCase()===t.toLowerCase()||tc(e,O).toLowerCase()===t.toLowerCase());e!=null&&(te(e!==R.initialValue),We(e,n),I()&&H.commit(e))}J.set(`forceMount`,!0),queueMicrotask(r)}}),id:W&&nt==null?`${W}-hidden-input`:void 0,form:f,name:nt,autoComplete:p,value:Re,disabled:le,required:v&&!tt,readOnly:_,ref:et,style:G?d:re,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),rt]})})}function dc(e){return e==null?void 0:`${e}-label`}function fc(e,t){return e??t}function pc(e){let t=e.getBoundingClientRect(),n=O(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var mc=2,hc=400,gc={...s,...zs,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},_c=Z.forwardRef(function(e,t){let{render:n,className:i,id:a,disabled:o=!1,nativeButton:s=!0,style:l,...d}=e,{setTouched:p,setFocused:m,validationMode:h,state:g,disabled:v}=Hs(),{labelId:y}=Gs(),{store:b,setOpen:x,selectionRef:S,validation:C,readOnly:w,required:T,alignItemWithTriggerActiveRef:D,disabled:O,keyboardActiveRef:k}=Ns(),A=v||O||o,j=Y(b,$.open),M=Y(b,$.mounted),ee=Y(b,$.value),N=Y(b,$.triggerProps),P=Y(b,$.positionerElement),te=Y(b,$.listElement),ne=Y(b,$.popupSide),I=Y(b,$.id),L=Y(b,$.labelId),re=Y(b,$.hasSelectedValue),R=M&&P?ne:null,z=a??I,ie=fc(y,L);Ks({id:z});let B=r(P),V=Z.useRef(null),{getButtonProps:ce,buttonRef:U}=F({disabled:A,native:s}),W=ae(t,V,U,u(e=>{b.set(`triggerElement`,e)})),le=J(),G=J(),K=J();Z.useEffect(()=>{if(j)return K.start(hc,()=>{S.current.allowUnselectedMouseUp=!0,S.current.allowSelectedMouseUp=!0}),()=>{K.clear()};S.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},G.clear()},[j,S,G,K]);let ue=oe(N,{id:z,role:`combobox`,"aria-expanded":j?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":j?te?.id??H(P)?.id:void 0,"aria-labelledby":ie,"aria-readonly":w||void 0,"aria-required":T||void 0,tabIndex:A?-1:0,ref:W,onFocus(e){m(!0),j&&D.current&&x(!1,E(se,e.nativeEvent)),le.start(0,()=>{b.set(`forceMount`,!0)})},onBlur(e){ze(P,e.relatedTarget)||(p(!0),m(!1),h===`onBlur`&&C.commit(ee))},onPointerMove(){k.current=!1},onKeyDown(){k.current=!0},onMouseDown(e){if(j)return;let t=c(e.currentTarget);function n(e){if(!V.current)return;let t=e.target;if(ze(V.current,t)||ze(B.current,t)||t===V.current)return;let n=pc(V.current);e.clientX>=n.left-mc&&e.clientX<=n.right+mc&&e.clientY>=n.top-mc&&e.clientY<=n.bottom+mc||x(!1,E(f,e))}G.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},C.getValidationProps,d,ce);ue.role=`combobox`;let de={...g,open:j,disabled:A,value:ee,readOnly:w,popupSide:R,placeholder:!re};return _(`button`,e,{ref:[t,V],state:de,stateAttributesMapping:gc,props:ue})}),vc={value:()=>null},yc=Z.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=Ns(),u=Y(c,$.value),d=Y(c,$.items),f=Y(c,$.itemToStringLabel),p=Y(c,$.hasSelectedValue),m=!p&&a!=null&&i==null,h=Y(c,$.hasNullItemLabel,m),g={value:u,placeholder:!p},v=null;return v=typeof i==`function`?i(u):i??(!p&&a!=null&&!h?a:Array.isArray(u)?ic(u,d,f):rc(u,d,f)),_(`span`,e,{state:g,ref:[t,l],props:[{children:v},s],stateAttributesMapping:vc})}),bc=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=Ns();return _(`span`,e,{state:{open:Y(o,$.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:D})}),xc=Z.createContext(void 0),Sc=Z.forwardRef(function(e,t){let{store:n}=Ns(),r=Y(n,$.mounted),i=Y(n,$.forceMount);return r||i?(0,Q.jsx)(xc.Provider,{value:!0,children:(0,Q.jsx)(ve,{ref:t,...e})}):null}),Cc=Z.createContext(void 0);function wc(){let e=Z.useContext(Cc);if(!e)throw Error(z(59));return e}function Tc(e,t){e&&Object.assign(e.style,t)}var Ec={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Dc=20;function Oc(e,t,n,r){let[i,a]=Z.useState(!1);L(()=>{if(!e||!t||n==null){a(!1);return}let r=c(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Dc)},[e,t,n]),wt(e&&(!t||i),r)}var kc={position:`fixed`},Ac=Z.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:_=Le,style:v,...y}=e,{store:b,listRef:x,labelsRef:S,alignItemWithTriggerActiveRef:C,selectedItemTextRef:w,valuesRef:T,initialValueRef:D,popupRef:O,setValue:k}=Ns(),A=Ps(),j=Y(b,$.open),M=Y(b,$.mounted),ee=Y(b,$.modal),N=Y(b,$.value),P=Y(b,$.openMethod),te=Y(b,$.positionerElement),F=Y(b,$.triggerElement),I=Y(b,$.isItemEqualToValue),re=Y(b,$.transitionStatus),R=Z.useRef(null),z=Z.useRef(null),[ie,ae]=Z.useState(g),B=M&&ie&&P!==`touch`;!M&&ie!==g&&ae(g),L(()=>{M||($.scrollUpArrowVisible(b.state)&&b.set(`scrollUpArrowVisible`,!1),$.scrollDownArrowVisible(b.state)&&b.set(`scrollDownArrowVisible`,!1))},[b,M]),Z.useImperativeHandle(C,()=>B),Oc((B||ee)&&j,P===`touch`,te,F);let V=ne({anchor:n,floatingRootContext:A,positionMethod:r,mounted:M,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h??B,collisionAvoidance:_,keepMounted:!0}),oe=B?`none`:V.side,ce=B?kc:V.positionerStyles,H={open:j,side:oe,align:V.align,anchorHidden:V.anchorHidden};L(()=>{b.set(`popupSide`,V.side)},[b,V.side]);let U=pe(e,H,{styles:ce,transitionStatus:re,props:y,refs:[t,u(e=>{b.set(`positionerElement`,e)})],hidden:!M,inert:!j}),W=Z.useRef(0),le=u(e=>{if(e.size===0&&W.current===0||T.current.length===0)return;let t=W.current;if(W.current=e.size,e.size===t)return;let n=E(se);if(t!==0&&!b.state.multiple&&N!==null&&Xs(T.current,N,I)===-1){let e=D.current,t=e!=null&&Xs(T.current,e,I)!==-1?e:null;k(t,n),t===null&&(b.set(`selectedIndex`,null),w.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(N)){let e=e=>Xs(T.current,e,I)!==-1,t=N.filter(t=>e(t));(t.length!==N.length||t.some(e=>!Ys(N,e,I)))&&(k(t,n),t.length===0&&(b.set(`selectedIndex`,null),w.current=null))}if(j&&B){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};Tc(te,e),Tc(O.current,e)}}),G=Z.useMemo(()=>({...V,side:oe,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:ae,scrollUpArrowRef:R,scrollDownArrowRef:z}),[V,oe,B,ae]);return(0,Q.jsx)(or,{elementsRef:x,labelsRef:S,onMapChange:le,children:(0,Q.jsxs)(Cc.Provider,{value:G,children:[M&&ee&&(0,Q.jsx)(yt,{inert:It(!j),cutout:F}),U]})})}),jc=`base-ui-disable-scrollbar`,Mc={className:jc,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:jc,precedence:`base-ui:low`,children:`.${jc}{scrollbar-width:none}.${jc}::-webkit-scrollbar{display:none}`})}},Nc=Z.createContext(void 0),Pc={disableStyleElements:!1};function Fc(){return Z.useContext(Nc)??Pc}var Ic={...l,...R},Lc=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:o,...s}=e,{store:l,popupRef:d,onOpenChangeComplete:f,setOpen:p,valueRef:h,firstItemTextRef:g,selectedItemTextRef:v,keyboardActiveRef:y,multiple:b,handleScrollArrowVisibility:x,scrollHandlerRef:S,listRef:C,highlightItemOnHover:w}=Ns(),{side:D,align:k,alignItemWithTriggerActive:A,isPositioned:j,setControlledAlignItemWithTrigger:M,scrollDownArrowRef:ee,scrollUpArrowRef:N}=wc(),P=br(!0)!=null,te=Ps(),ne=a(),{nonce:F,disableStyleElements:I}=Fc(),re=Y(l,$.id),R=Y(l,$.open),z=Y(l,$.mounted),ie=Y(l,$.popupProps),ae=Y(l,$.transitionStatus),B=Y(l,$.triggerElement),V=Y(l,$.positionerElement),oe=Y(l,$.listElement),se=Z.useRef(!1),ce=Z.useRef(!1),H=Z.useRef({}),U=ke(),W=u(e=>{if(!V||!d.current||!ce.current)return;if(se.current||!A){x();return}let t=V.style.top===`0px`,n=V.style.bottom===`0px`;if(!t&&!n){x();return}let r=Bc(V),i=Vc(V.getBoundingClientRect().height,`y`,r),a=c(V),o=getComputedStyle(V),s=parseFloat(o.marginTop),l=parseFloat(o.marginBottom),u=Rc(getComputedStyle(d.current)),f=Math.min(a.documentElement.clientHeight-s-l,u),p=e.scrollTop,m=zc(e),h=0,g=null,_=!1,v=!1,y=e=>{V.style.height=`${e}px`},b=(t,n)=>{let r=sc(t,0,f-i);r>0&&y(i+r),e.scrollTop=n,f-(i+r)<=1&&(se.current=!0),x()},S=t?m-p:p,C=Math.min(i+S,f);if(h=C,S<=1){b(S,t?m:0);return}if(f-C>1?t?v=!0:g=0:(_=!0,n&&p<m&&(g=p-(S-(i+S-f)))),h=Math.ceil(h),h!==0&&y(h),v||g!=null){let t=zc(e),n=v?t:sc(g,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(_||h>=f-1)&&(se.current=!0),x()});Z.useImperativeHandle(S,()=>W,[W]),m({open:R,ref:d,onComplete(){R&&f?.(!0)}});let G={open:R,transitionStatus:ae,side:D,align:k};L(()=>{!V||!d.current||Object.keys(H.current).length||(H.current={top:V.style.top||`0`,left:V.style.left||`0`,right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[d,V]),L(()=>{R||A||(ce.current=!1,se.current=!1,Tc(V,H.current))},[R,A,V,d]),L(()=>{let e=d.current;if(!R||!B||!V||!e||A&&!j||l.state.transitionStatus===`ending`)return;if(!A){ce.current=!0,U.request(x),e.style.removeProperty(`--transform-origin`);return}let t=Wc(e);e.style.removeProperty(`--transform-origin`);try{let t=v.current;t?.isConnected||(t=!$.hasSelectedValue(l.state)&&g.current?.isConnected?g.current:null);let n=h.current,r=getComputedStyle(V),i=getComputedStyle(e),a=c(B),o=O(V),s=Bc(B),u=Hc(B.getBoundingClientRect(),s),d=Hc(V.getBoundingClientRect(),s),f=u.height,p=oe||e,m=p.scrollHeight,_=parseFloat(i.borderBottomWidth),y=parseFloat(r.marginTop)||10,b=parseFloat(r.marginBottom)||10,S=parseFloat(r.minHeight)||100,T=Rc(i),E=a.documentElement.clientHeight-y-b,D=a.documentElement.clientWidth,k=E-u.bottom+f,A,j=ne===`rtl`?u.right-d.width:u.left,ee=0;if(t&&n){let e=Hc(n.getBoundingClientRect(),s);A=Hc(t.getBoundingClientRect(),s),j=d.left+(ne===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-u.top+e.height/2;ee=A.top-d.top+A.height/2-r}let N=k+ee+b+_,P=Math.min(E,N),te=E-y-b,F=N-P,I=D-5;V.style.left=`${sc(j,5,I-d.width)}px`,V.style.height=`${P}px`,V.style.maxHeight=`auto`,V.style.marginTop=`${y}px`,V.style.marginBottom=`${b}px`,e.style.height=`100%`;let L=zc(p),re=F>=L-1;re&&(P=Math.min(E,d.height)-(F-L));let R=u.top<20||u.bottom>E-20||Math.ceil(P)+1<Math.min(m,S),z=(o.visualViewport?.scale??1)!==1&&ye;if(R||z){ce.current=!0,Tc(V,H.current),M(!1);return}let ie=Math.max(S,P);if(re){let e=Math.max(0,E-N);V.style.top=d.height>=te?`0`:`${e}px`,V.style.height=`${P}px`,p.scrollTop=zc(p)}else V.style.bottom=`0`,p.scrollTop=F;if(A){let t=d.top,n=d.height,r=A.top+A.height/2,i=sc(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(ie===E||P>=T)&&(se.current=!0),x(),w&&l.state.selectedIndex===null&&l.state.activeIndex===null&&C.current[0]!=null&&l.set(`activeIndex`,0),ce.current=!0}finally{t()}},[l,R,V,B,h,g,v,d,x,A,M,U,ee,N,oe,C,w,ne,j]),Z.useEffect(()=>{if(!A||!V||!R)return;let e=O(V);function t(e){p(!1,E(le,e))}return T(e,`resize`,t)},[p,A,V,R]);let K={...oe?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":b||void 0,id:`${re}-list`},onKeyDown(e){y.current=!0,P&&ln.has(e.key)&&e.stopPropagation()},onMouseMove(){y.current=!1},onScroll(e){oe||W(e.currentTarget)},...A&&{style:oe?{height:`100%`}:Ec}},ue=_(`div`,e,{ref:[t,d],state:G,stateAttributesMapping:Ic,props:[ie,K,Ge(ae),{className:!oe&&A?Mc.className:void 0},s]});return(0,Q.jsxs)(Z.Fragment,{children:[!I&&Mc.getElement(F),(0,Q.jsx)(Ft,{context:te,modal:!1,disabled:!z,returnFocus:o,restoreFocus:!0,children:ue})]})});function Rc(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function zc(e){return cc(e.scrollHeight,e.clientHeight)}function Bc(e){return U.getScale(e)}function Vc(e,t,n){return e/n[t]}function Hc(e,t){return o({x:Vc(e.x,`x`,t),y:Vc(e.y,`y`,t),width:Vc(e.width,`x`,t),height:Vc(e.height,`y`,t)})}var Uc=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Wc(e){let{style:t}=e,n={};for(let[e,r]of Uc)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Uc){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Gc=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s}=Ns(),{alignItemWithTriggerActive:c}=wc(),l=Y(o,$.hasScrollArrows),d=Y(o,$.openMethod),f=Y(o,$.multiple),p={id:`${Y(o,$.id)}-list`,role:`listbox`,"aria-multiselectable":f||void 0,onScroll(e){s.current?.(e.currentTarget)},...c&&{style:Ec},className:l&&d!==`touch`?Mc.className:void 0};return _(`div`,e,{ref:[t,u(e=>{o.set(`listElement`,e)})],props:[p,a]})}),Kc=Z.createContext(void 0);function qc(){let e=Z.useContext(Kc);if(!e)throw Error(z(57));return e}var Jc=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=Z.useRef(null),d=mr({label:o,textRef:u,indexGuessBehavior:Cr.GuessFromOrder}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:v,valuesRef:y,multiple:b,selectedItemTextRef:x}=Ns(),S=Y(f,$.isActive,d.index),C=Y(f,$.isSelected,d.index,a),w=Y(f,$.isSelectedByFocus,d.index),T=Y(f,$.isItemEqualToValue),D=d.index,O=D!==-1,k=Z.useRef(null);L(()=>{if(!O)return;let e=y.current;return e[D]=a,()=>{delete e[D]}},[O,D,a,y]),L(()=>{if(!O)return;let e=f.state.value,t=e;b&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&Js(a,t,T)&&(f.set(`selectedIndex`,D),u.current&&(x.current=u.current))},[O,D,b,T,f,a,x]);let A=Z.useRef(null),j=Z.useRef(`mouse`),M=Z.useRef(!1),{getButtonProps:ee,buttonRef:N}=F({disabled:s,focusableWhenDisabled:!0,native:c,composite:!0}),P={disabled:s,selected:C,highlighted:S};function te(e){let t=f.state.value;if(b){let n=Array.isArray(t)?t:[];h(C?Zs(n,a,T):[...n,a],E(B,e))}else h(a,E(B,e)),m(!1,E(B,e))}function ne(){g.current.dragY=0}let I={role:`option`,"aria-selected":C,tabIndex:S?0:-1,onKeyDown(e){A.current=e.key,f.set(`activeIndex`,D),e.key===` `&&v.current&&e.preventDefault()},onClick(e){let t=e.type===`click`&&j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&ge(e.nativeEvent)&&(n!==void 0||S),i=t&&!r&&!M.current;M.current=!1,!(e.type===`keydown`&&A.current===null)&&(s||e.type===`keydown`&&A.current===` `&&v.current||i||(A.current=null,te(e.nativeEvent)))},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,ne()},onMouseUp(){if(ne(),s||j.current===`touch`||M.current)return;let e=!g.current.allowSelectedMouseUp&&C,t=!g.current.allowUnselectedMouseUp&&!C;e||t||(M.current=!0,k.current?.click(),M.current=!1)}},re=_(`div`,e,{ref:[N,t,d.ref,k],state:P,props:[p,I,l,ee]}),R=Z.useMemo(()=>({selected:C,index:D,textRef:u,selectedByFocus:w,hasRegistered:O}),[C,D,u,w,O]);return(0,Q.jsx)(Kc.Provider,{value:R,children:re})})),Yc=Z.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=qc();return n||r?(0,Q.jsx)(Xc,{...e,ref:t}):null}),Xc=Z.memo(Z.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=qc(),c=Z.useRef(null),{transitionStatus:l,setMounted:u}=V(s),d=_(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:R});return m({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Zc=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i,hasRegistered:a}=qc(),{firstItemTextRef:o,selectedItemTextRef:s}=Ns(),{render:c,className:l,style:u,...d}=e;return _(`div`,e,{ref:[Z.useCallback(e=>{e&&(a&&n===0&&(o.current=e),a&&i&&(s.current=e))},[o,s,n,i,a]),t,r],props:d})})),Qc=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o=!1,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=Ns(),{side:h,scrollDownArrowRef:g,scrollUpArrowRef:v}=wc(),y=Y(l,c?$.scrollUpArrowVisible:$.scrollDownArrowVisible),b=Y(l,$.openMethod),x=y&&b!==`touch`,S=J(),C=c?v:g,{transitionStatus:w,setMounted:T}=V(x);L(()=>(p.current+=1,l.state.hasScrollArrows||l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.state.hasScrollArrows&&l.set(`hasScrollArrows`,!1)}),[l,p]),m({open:x,ref:C,onComplete(){x||T(!1)}});let E=_(`div`,e,{ref:[t,C],state:{direction:a,visible:x,side:h,transitionStatus:w},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||S.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f();let n=cc(e.scrollHeight,e.clientHeight),r=lc(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),a.length===0&&l.set(c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,!i),i){S.clear();return}if(a.length>0){let t=C.current?.offsetHeight||0;e.scrollTop=$c(a,c,r,e.clientHeight,t,n)}S.start(40,t)}S.start(40,t)},onMouseLeave(){S.clear()}},s]});return x||o?E:null});function $c(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?lc(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?lc(l.offsetTop+l.offsetHeight-r+i,a):a}var el=Z.forwardRef(function(e,t){return(0,Q.jsx)(Qc,{...e,ref:t,direction:`down`})}),tl=Z.forwardRef(function(e,t){return(0,Q.jsx)(Qc,{...e,ref:t,direction:`up`})}),nl=Z.createContext(void 0),rl=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Z.useState(),c=Z.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=_(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,Q.jsx)(nl.Provider,{value:c,children:l})}),il=uc;function al({className:e,...t}){return(0,Q.jsx)(rl,{"data-slot":`select-group`,className:X(`scroll-my-1 p-1`,e),...t})}function ol({className:e,...t}){return(0,Q.jsx)(yc,{"data-slot":`select-value`,className:X(`flex flex-1 text-left`,e),...t})}function sl({className:e,size:t=`default`,children:n,...r}){return(0,Q.jsxs)(_c,{"data-slot":`select-trigger`,"data-size":t,className:X(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,e),...r,children:[n,(0,Q.jsx)(bc,{render:(0,Q.jsx)(mt,{className:`pointer-events-none size-3.5 text-muted-foreground`})})]})}function cl({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Q.jsx)(Sc,{children:(0,Q.jsx)(Ac,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Q.jsxs)(Lc,{"data-slot":`select-content`,"data-align-trigger":o,className:X(`dark relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Q.jsx)(ul,{}),(0,Q.jsx)(Gc,{children:t}),(0,Q.jsx)(dl,{})]})})})}function ll({className:e,children:t,...n}){return(0,Q.jsxs)(Jc,{"data-slot":`select-item`,className:X(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Q.jsx)(Zc,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Q.jsx)(Yc,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Q.jsx)(et,{className:`pointer-events-none`})})]})}function ul({className:e,...t}){return(0,Q.jsx)(tl,{"data-slot":`select-scroll-up-button`,className:X(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,e),...t,children:(0,Q.jsx)(Pr,{})})}function dl({className:e,...t}){return(0,Q.jsx)(el,{"data-slot":`select-scroll-down-button`,className:X(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5`,e),...t,children:(0,Q.jsx)(mt,{})})}function fl({...e}){return(0,Q.jsx)(At,{"data-slot":`sheet`,...e})}function pl({...e}){return(0,Q.jsx)(Tt,{"data-slot":`sheet-portal`,...e})}function ml({className:e,...t}){return(0,Q.jsx)(bt,{"data-slot":`sheet-overlay`,className:X(`fixed inset-0 z-50 bg-black/80 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function hl({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,Q.jsxs)(pl,{children:[(0,Q.jsx)(ml,{}),(0,Q.jsxs)(Kt,{"data-slot":`sheet-content`,"data-side":n,className:X(`fixed z-50 flex flex-col bg-background bg-clip-padding text-xs/relaxed shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,Q.jsxs)(xt,{"data-slot":`sheet-close`,render:(0,Q.jsx)(qe,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,Q.jsx)(at,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function gl({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sheet-header`,className:X(`flex flex-col gap-1.5 p-6`,e),...t})}function _l({className:e,...t}){return(0,Q.jsx)(qt,{"data-slot":`sheet-title`,className:X(`text-sm font-medium text-foreground`,e),...t})}function vl({className:e,...t}){return(0,Q.jsx)(Et,{"data-slot":`sheet-description`,className:X(`text-xs/relaxed text-muted-foreground`,e),...t})}function yl(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function bl(e,t){return e-t}function xl(e,t,n){let r=e.slice();return r[t]=n,r.sort(bl)}function Sl(e,t,n,r,i,a){let o=e;return o=sc(o,n,r),i&&(o=xl(a,t,sc(o,a[t-1]||-1/0,a[t+1]||1/0))),o}function Cl(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 wl={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null,...zs},Tl=Z.createContext(void 0);function El(){let e=Z.useContext(Tl);if(e===void 0)throw Error(z(62));return e}function Dl(e){return`key`in e?g:i}function Ol(e,t){return typeof e==`number`&&typeof t==`number`?e===t:Array.isArray(e)&&Array.isArray(t)?yl(e,t):!1}var kl=Z.forwardRef(function(e,t){let{"aria-labelledby":n,className:i,defaultValue:a,disabled:o=!1,id:s,format:l,largeStep:d=10,locale:f,render:p,max:m=100,min:h=0,minStepsBetweenValues:g=0,form:v,name:y,onValueChange:b,onValueCommitted:x,orientation:S=`horizontal`,step:C=1,thumbCollisionBehavior:w=`push`,thumbAlignment:T=`center`,value:D,style:O,...k}=e,A=We(s),j=dc(A),ee=u(b),N=u(x),{clearErrors:P}=oc(),{state:te,disabled:ne,name:F,setTouched:I,setDirty:re,validityData:R,shouldValidateOnChange:z,validation:ie}=Hs(),{labelId:ae}=Gs(),[B,V]=Z.useState(),oe=n??fc(ae,B),se=ne||o,ce=F??y,[H,U]=Kn({controlled:D,default:a??h,name:`Slider`}),W=Z.useRef(null),le=Z.useRef(null),G=Z.useRef([]),K=Z.useRef(null),ue=Z.useRef(null),de=Z.useRef(-1),fe=Z.useRef(null),pe=Z.useRef(null),me=Z.useRef(`none`),he=r(l),[ge,ve]=Z.useState(-1),[ye,be]=Z.useState(-1),[xe,Se]=Z.useState(!1),[Ce,we]=Z.useState(()=>new Map),[Te,q]=Z.useState([void 0,void 0]),Ee=u(e=>{ve(e),e!==-1&&be(e)});Us(le,A,H),kt(H,()=>{P(ce),z()?ie.commit(H):ie.commit(H,!0);let e=R.initialValue,t;t=Array.isArray(H)&&Array.isArray(e)?!yl(H,e):H!==e,re(t)});let De=u(e=>{e&&(le.current=e)}),Oe=Array.isArray(H),ke=Z.useMemo(()=>Oe?H.slice().sort(bl):[sc(H,h,m)],[m,h,Oe,H]),Ae=u((e,t)=>{if(Number.isNaN(e)||Ol(e,H))return;let n=t??E(`none`,void 0,void 0,{activeThumbIndex:-1});me.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:ce}}),n.event=i,pe.current=e,ee(e,n),!n.isCanceled&&U(e)}),je=u((e,t,n)=>{let r=Sl(e,t,h,m,Oe,ke);if(Cl(r,C,g)){let e=Dl(n);Ae(r,E(e,n.nativeEvent,void 0,{activeThumbIndex:t})),I(!0),N(pe.current??r,M(e,n.nativeEvent))}});L(()=>{let e=_e(c(W.current));se&&ze(W.current,e)&&e.blur()},[se]),se&&ge!==-1&&Ee(-1);let J=Z.useMemo(()=>({...te,activeThumbIndex:ge,disabled:se,dragging:xe,orientation:S,max:m,min:h,minStepsBetweenValues:g,step:C,values:ke}),[te,ge,se,xe,m,h,g,S,C,ke]),Me=Z.useMemo(()=>({active:ge,controlRef:le,disabled:se,dragging:xe,validation:ie,formatOptionsRef:he,handleInputChange:je,indicatorPosition:Te,inset:T!==`center`,labelId:oe,rootLabelId:j,largeStep:d,lastUsedThumbIndex:ye,lastChangedValueRef:pe,lastChangeReasonRef:me,form:v,locale:f,max:m,min:h,minStepsBetweenValues:g,name:ce,onValueCommitted:N,orientation:S,pressedInputRef:K,pressedThumbCenterOffsetRef:ue,pressedThumbIndexRef:de,pressedValuesRef:fe,registerFieldControlRef:De,renderBeforeHydration:T===`edge`,setActive:Ee,setDragging:Se,setIndicatorPosition:q,setLabelId:V,setValue:Ae,state:J,step:C,thumbCollisionBehavior:w,thumbMap:Ce,thumbRefs:G,values:ke}),[ge,le,oe,j,se,xe,ie,he,je,Te,d,ye,pe,me,v,f,m,h,g,ce,N,S,K,ue,de,fe,De,Ee,Se,q,V,Ae,J,C,w,T,Ce,G,ke]),Ne=_(`div`,e,{state:J,ref:[t,W],props:[{"aria-labelledby":oe,id:A,role:`group`},ie.getValidationProps,k],stateAttributesMapping:wl});return(0,Q.jsx)(Tl.Provider,{value:Me,children:(0,Q.jsx)(or,{elementsRef:G,onMapChange:we,children:Ne})})}),Al=new Map;function jl(e,t){let n=JSON.stringify({locale:e,options:t}),r=Al.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return Al.set(n,i),i}function Ml(e,t,n){return e==null?``:jl(t,n).format(e)}function Nl(e){let t=e.getBoundingClientRect();return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Pl(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 Fl(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(Pl(t),Pl(n))))}function Il({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]=sc(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]=sc(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]=sc(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function Ll({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=sc(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=Il({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=sc(h,n,r);C[w]=Number(i.toFixed(12))}return{value:C,thumbIndex:b,didSwap:!0}}case`push`:return{value:Il({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=sc(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 Rl=2;function zl(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 Bl(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 Vl=Z.forwardRef(function(e,t){let{render:n,className:i,style:o,...s}=e,{disabled:l,dragging:d,inset:f,lastChangedValueRef:p,lastChangeReasonRef:m,max:h,min:g,minStepsBetweenValues:v,onValueCommitted:y,orientation:b,pressedInputRef:x,pressedThumbCenterOffsetRef:C,pressedThumbIndexRef:D,pressedValuesRef:k,registerFieldControlRef:A,renderBeforeHydration:j,setActive:ee,setDragging:N,setValue:P,state:te,step:ne,thumbCollisionBehavior:F,thumbRefs:I,values:L}=El(),re=a(),R=L.length>1,z=b===`vertical`,ie=Z.useRef(null),ae=Z.useRef(null),B=u(e=>{e&&ae.current==null&&(ae.current=O(e).getComputedStyle(e))}),V=Z.useRef(null),oe=Z.useRef(0),se=Z.useRef(0),ce=r(L);function H(e){D.current!==e&&(D.current=e);let t=I.current[e];if(!t){C.current=null,x.current=null;return}x.current=t.querySelector(`input[type="range"]`)}function U(e){let t=ie.current;if(!t)return null;let{width:n,height:r,bottom:i,left:a,right:o}=t.getBoundingClientRect(),s=zl(ae.current,z),c=se.current,l=(z?r:n)-s.start-s.end-c*2,u=C.current??0,d=e.x-u,f=e.y-u,p=sc(((z?i-f-s.end:(re===`rtl`?o-d:d-a)-s.start)-c)/l,0,1),m=(h-g)*p+g;if(m=Fl(m,ne,g),m=sc(m,g,h),!R)return{value:m,thumbIndex:0,didSwap:!1};let _=D.current;if(_<0)return null;let y=Ll({behavior:F,values:L,currentValues:ce.current??L,initialValues:k.current,pressedIndex:_,nextValue:m,min:g,max:h,step:ne,minStepsBetweenValues:v});return F===`swap`&&y.didSwap?H(y.thumbIndex):D.current=y.thumbIndex,y}function W(e){k.current=R?L.slice():null,ce.current=L;let t=D.current,n=t;if(t>-1&&t<L.length){if(L[t]===h){let e=t;for(;e>0&&L[e-1]===h;)--e;n=e}}else{let t=z?`y`:`x`,r;n=-1;for(let i=0;i<I.current.length;i+=1){let a=I.current[i];if(De(a)){let o=Nl(a),s=Math.abs(e[t]-o[t]);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&H(n),f){let e=I.current[n];De(e)&&(se.current=e.getBoundingClientRect()[z?`height`:`width`]/2)}}function le(e){let t=I.current?.[e]?.querySelector(`input[type="range"]`);t&&t.focus({preventScroll:!0,focusVisible:!1})}let G=u(e=>{let t=Bl(e,V);if(t==null)return;if(oe.current+=1,e.type===`pointermove`&&e.buttons===0){K(e);return}let n=U(t);n!=null&&Cl(n.value,ne,v)&&(!d&&oe.current>Rl&&N(!0),P(n.value,E(w,e,void 0,{activeThumbIndex:n.thumbIndex})),ce.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&le(n.thumbIndex))});function K(e){ee(-1),N(!1),x.current=null,C.current=null;let t=Bl(e,V),n=t==null?null:U(t);if(n!=null){let t=m.current;y(p.current??n.value,M(t,e))}`pointerType`in e&&ie.current?.hasPointerCapture(e.pointerId)&&ie.current?.releasePointerCapture(e.pointerId),D.current=-1,V.current=null,k.current=null,de()}let ue=u(e=>{if(l)return;let t=e.changedTouches[0];t!=null&&(V.current=t.identifier);let n=Bl(e,V);if(n!=null){W(n);let t=U(n);if(t==null)return;le(t.thumbIndex),P(t.value,E(S,e,void 0,{activeThumbIndex:t.thumbIndex})),ce.current=Array.isArray(t.value)?t.value:[t.value],t.didSwap&&le(t.thumbIndex)}oe.current=0;let r=c(ie.current);r.addEventListener(`touchmove`,G,{passive:!0}),r.addEventListener(`touchend`,K,{passive:!0})}),de=u(()=>{let e=c(ie.current);e.removeEventListener(`pointermove`,G),e.removeEventListener(`pointerup`,K),e.removeEventListener(`touchmove`,G),e.removeEventListener(`touchend`,K),k.current=null}),fe=ke();return Z.useEffect(()=>{let e=ie.current;if(!e)return()=>de();let t=T(e,`touchstart`,ue,{passive:!0});return()=>{t(),fe.cancel(),de()}},[de,ue,ie,fe]),Z.useEffect(()=>{l&&de()},[l,de]),_(`div`,e,{state:te,ref:[t,A,ie,B],props:[{"data-base-ui-slider-control":j?``:void 0,onPointerDown(e){let t=ie.current,n=Ne(e.nativeEvent);if(!t||l||e.defaultPrevented||!De(n)||e.button!==0)return;let r=Bl(e,V);if(r!=null){W(r);let n=U(r);if(n==null)return;ze(I.current[n.thumbIndex],_e(c(t)))?e.preventDefault():fe.request(()=>{le(n.thumbIndex)}),N(!0),C.current??(P(n.value,E(S,e.nativeEvent,void 0,{activeThumbIndex:n.thumbIndex})),ce.current=Array.isArray(n.value)?n.value:[n.value],n.didSwap&&le(n.thumbIndex))}e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),oe.current=0;let i=c(ie.current);i.addEventListener(`pointermove`,G,{passive:!0}),i.addEventListener(`pointerup`,K,{once:!0})}},s],stateAttributesMapping:wl})}),Hl=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=El();return _(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:wl})}),Ul=y();function Wl(){return Ye}function Gl(){return!1}function Kl(){return!0}function ql(){return(0,Ul.useSyncExternalStore)(Wl,Gl,Kl)}function Jl(e,t,n){return(e-t)*100/(n-t)}var Yl=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}({}),Xl=new Set([...ln,sn,on]);function Zl(e,t,n,r){if(!(t<0))return e.length===2?t===0?`${Ml(e[t],r,n)} start range`:`${Ml(e[t],r,n)} end range`:n?Ml(e[t],r,n):void 0}function Ql(e,t,n,r,i){let a=n===1?e+t:e-t;return sc(Number(a.toFixed(Math.max(Pl(e),Pl(t),Pl(r)))),r,i)}var $l=Z.forwardRef(function(e,n){let{render:r,children:i,className:o,"aria-describedby":s,"aria-label":c,"aria-labelledby":l,disabled:d=!1,getAriaLabel:f,getAriaValueText:p,id:m,index:h,inputRef:g,onBlur:v,onFocus:y,onKeyDown:b,tabIndex:x,style:S,...C}=e,{nonce:w}=Fc(),T=We(m),{active:E,lastUsedThumbIndex:D,controlRef:k,disabled:A,validation:j,formatOptionsRef:M,handleInputChange:ee,inset:N,labelId:P,largeStep:te,locale:ne,max:F,min:I,minStepsBetweenValues:R,form:z,name:ie,orientation:B,pressedInputRef:V,pressedThumbCenterOffsetRef:se,pressedThumbIndexRef:ce,renderBeforeHydration:H,setActive:U,setIndicatorPosition:W,state:le,step:G,values:K}=El(),ue=a(),de=d||A,fe=K.length>1,pe=B===`vertical`,me=ue===`rtl`,{setTouched:he,setFocused:ge,validationMode:_e}=Hs(),ve=Z.useRef(null),ye=Z.useRef(null),be=Z.useRef(!1),xe=We(),Se=Ks(),Ce=fe?xe:Se,{ref:we,index:Te}=mr({metadata:Z.useMemo(()=>({inputId:Ce}),[Ce])}),q=fe?h??Te:0,Ee=q===K.length-1,De=K[q],Oe=Jl(De,I,F),[ke,Ae]=Z.useState(),je=ql(),J=D>=0&&D<K.length?D:-1,Me=u(()=>{let e=k.current,t=ve.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=pe?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Oe/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Ae(s),q===0?W(e=>[s,e[1]]):Ee&&W(e=>[e[0],s])});L(()=>{N&&queueMicrotask(Me)},[Me,N]),L(()=>{N&&Me()},[Me,N,Oe]),L(()=>{if(!N)return;let e=k.current,t=ve.current;if(!e||!t)return;let n=O(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(Me);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[k,Me,N]);let Ne=pe?`bottom`:`insetInlineStart`,Pe=pe?`left`:`top`,Fe;fe?E===q?Fe=2:J===q&&(Fe=1):E===q&&(Fe=1);let Y;Y=N?{"--position":`${ke??0}%`,visibility:H&&je||ke===void 0?`hidden`:void 0,position:`absolute`,[Ne]:`var(--position)`,[Pe]:`50%`,translate:`${(pe||!me?-1:1)*50}% ${(pe?1:-1)*50}%`,zIndex:Fe}:Number.isFinite(Oe)?{position:`absolute`,[Ne]:`${Oe}%`,[Pe]:`50%`,translate:`${(pe||!me?-1:1)*50}% ${(pe?1:-1)*50}%`,zIndex:Fe}:re;let Ie;B===`vertical`&&(Ie=me?`vertical-rl`:`vertical-lr`);let Le=typeof f==`function`?f(q):c,Re=oe({"aria-label":Le,"aria-labelledby":l??(Le==null?P:void 0),"aria-describedby":s,"aria-orientation":B,"aria-valuenow":De,"aria-valuetext":typeof p==`function`?p(Ml(De,ne,M.current??void 0),De,q):Zl(K,q,M.current??void 0,ne),disabled:de,form:z,id:Ce,max:F,min:I,name:ie,onChange(e){ee(e.currentTarget.valueAsNumber,q,e)},onFocus(e){let t=be.current;be.current=!1,U(q),ge(!0),t&&e.stopPropagation()},onBlur(e){if(be.current){e.stopPropagation();return}ve.current&&(U(-1),he(!0),ge(!1),_e===`onBlur`&&j.commit(Sl(De,q,I,F,fe,K)))},onKeyDown(e){if(!Xl.has(e.key))return;ln.has(e.key)&&e.stopPropagation();let n=null,r=Fl(De,G,I);switch(e.key){case an:n=Ql(r,e.shiftKey?te:G,1,I,F);break;case cn:n=Ql(r,e.shiftKey?te:G,me?-1:1,I,F);break;case fn:n=Ql(r,e.shiftKey?te:G,-1,I,F);break;case un:n=Ql(r,e.shiftKey?te:G,me?1:-1,I,F);break;case sn:n=Ql(r,te,1,I,F);break;case on:n=Ql(r,te,-1,I,F);break;case`End`:n=F,fe&&(n=Number.isFinite(K[q+1])?K[q+1]-G*R:F);break;case dn:n=I,fe&&(n=Number.isFinite(K[q-1])?K[q-1]+G*R:I);break;default:break}if(n!==null){let r=e.currentTarget;t(r)||(be.current=!0,r.blur(),r.focus({preventScroll:!0,focusVisible:!0})),ee(n,q,e),e.preventDefault()}},step:G,style:{...re,width:`100%`,height:`100%`,writingMode:Ie},tabIndex:x??void 0,type:`range`,value:De??``},j.getInputValidationProps),ze=ae(ye,j.inputRef,g);return _(`div`,e,{state:le,ref:[n,we,ve],props:[{[Yl.index]:q,children:(0,Q.jsxs)(Z.Fragment,{children:[i,(0,Q.jsx)(`input`,{ref:ze,...Re,suppressHydrationWarning:!0}),N&&je&&H&&Ee&&(0,Q.jsx)(`script`,{nonce:w,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:T,onBlur:v,onFocus:y,onPointerDown(e){if(ce.current=q,ve.current!=null){let t=B===`horizontal`?`x`:`y`,n=Nl(ve.current);se.current=(B===`horizontal`?e.clientX:e.clientY)-n[t]}ye.current!=null&&V.current!==ye.current&&(V.current=ye.current)},style:Y,suppressHydrationWarning:H||void 0},C],stateAttributesMapping:wl})});function eu(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 tu(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 nu=Z.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}=El(),m=ql(),h=u===`vertical`,g=p.length>1,v=s?eu(h,g,o[0],o[1],d,m):tu(h,g,Jl(p[0],l,c),Jl(p[p.length-1],l,c));return _(`div`,e,{state:f,ref:t,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:v,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:wl})});function ru({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,Q.jsx)(kl,{className:X(`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,Q.jsxs)(Vl,{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,Q.jsx)(Hl,{"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,Q.jsx)(nu,{"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,Q.jsx)($l,{"data-slot":`slider-thumb`,className:`relative block size-4 shrink-0 rounded-full border border-primary/50 bg-background shadow transition-colors select-none after:absolute after:-inset-2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-disabled:pointer-events-none data-disabled:opacity-50`},t))]})})}var iu=Z.createContext(void 0);function au(){let e=Z.useContext(iu);if(e===void 0)throw Error(z(63));return e}var ou=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),su={...zs,checked(e){return e?{[ou.checked]:``}:{[ou.unchecked]:``}}};function cu(e,t,n,r=!0,i){let[a,o]=Z.useState(),s=We(i?`${i}-label`:void 0),c=e??t??a;return L(()=>{let i=e||t||!r?void 0:lu(n.current,s);a!==i&&o(i)}),c}function lu(e,t){let n=uu(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function uu(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var du=Z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:f,readOnly:p=!1,required:m=!1,disabled:h=!1,render:g,uncheckedValue:v,value:y,style:b,...x}=e,{clearErrors:S}=oc(),{state:C,setTouched:w,setDirty:T,validityData:D,setFilled:k,setFocused:A,shouldValidateOnChange:j,validationMode:M,disabled:ee,name:N,validation:te}=Hs(),{labelId:ne}=Gs(),I=ee||h,R=N??l,z=Z.useRef(null),ie=ae(z,c,te.inputRef),B=Z.useRef(null),V=We(),ce=Ks({id:s,implicit:!1,controlRef:B}),H=u?void 0:ce,[U,W]=Kn({controlled:n,default:!!i,name:`Switch`,state:`checked`});Us(B,V,U),L(()=>{z.current&&k(z.current.checked)},[z,k]),kt(U,()=>{S(R),T(U!==D.initialValue),k(U),j()?te.commit(U):te.commit(U,!0)});let{getButtonProps:le,buttonRef:G}=F({disabled:I,native:u}),K=cu(a,ne,z,!u,H),ue={id:u?ce:V,role:`switch`,"aria-checked":U,"aria-readonly":p||void 0,"aria-required":m||void 0,"aria-labelledby":K,onFocus(){I||A(!0)},onBlur(){let e=z.current;!e||I||(w(!0),A(!1),M===`onBlur`&&te.commit(e.checked))},onClick(e){if(p||I)return;e.preventDefault();let t=z.current;t&&t.dispatchEvent(new(O(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},de=oe({checked:U,disabled:I,form:o,id:H,name:R,required:m,style:R?d:re,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ie,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(p){e.preventDefault();return}let t=e.currentTarget.checked,n=E(se,e.nativeEvent);f?.(t,n),!n.isCanceled&&W(t)},onFocus(){B.current?.focus()}},te.getInputValidationProps,y===void 0?P:{value:y}),fe=Z.useMemo(()=>({...C,checked:U,disabled:I,readOnly:p,required:m}),[C,U,I,p,m]),pe=_(`span`,e,{state:fe,ref:[t,B,G],props:[ue,te.getValidationProps,x,le],stateAttributesMapping:su});return(0,Q.jsxs)(iu.Provider,{value:fe,children:[pe,!U&&R&&v!==void 0&&(0,Q.jsx)(`input`,{type:`hidden`,form:o,name:R,value:v}),(0,Q.jsx)(`input`,{...de,suppressHydrationWarning:!0})]})}),fu=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return _(`span`,e,{state:au(),ref:t,stateAttributesMapping:su,props:a})});function pu({className:e,...t}){return(0,Q.jsx)(du,{"data-slot":`switch`,className:X(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,Q.jsx)(fu,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-checked:translate-x-4 data-unchecked:translate-x-0`})})}var mu=[{label:`Move bundle`,value:`move`},{label:`Copy bundle`,value:`copy`}],hu=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]}),gu=(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}),_u=e=>(e/10).toFixed(1),vu=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},yu=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1e3,Math.max(0,Math.trunc(t*10))):null};function bu({value:e,onChange:t}){let[n,r]=(0,Z.useState)(_u(e)),[i,a]=(0,Z.useState)(!1);return(0,Z.useEffect)(()=>{i||r(_u(e))},[i,e]),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(ru,{"aria-label":`Rollout percentage`,max:1e3,min:0,onValueChange:n=>t(Array.isArray(n)?n[0]??e:n),step:1,value:e}),(0,Q.jsxs)(pt,{className:`w-24 shrink-0`,children:[(0,Q.jsx)(ct,{"aria-label":`Rollout percentage`,autoComplete:`off`,className:`text-right tabular-nums`,id:`release-rollout-percentage`,inputMode:`decimal`,name:`rolloutPercentage`,onBlur:()=>{let i=yu(n)??e;a(!1),r(_u(i)),t(i)},onChange:e=>{let n=vu(e.target.value);r(n);let i=yu(n);i!==null&&t(i)},onFocus:()=>a(!0),value:n}),(0,Q.jsx)(ut,{align:`inline-end`,children:(0,Q.jsx)(st,{children:`%`})})]})]})}function xu({channels:e,onOpenChange:t,open:n,releaseId:r}){let i=Qa(r),a=i.data,o=eo(a?.bundle_id??``),s=o.data,c=s?ci(s):null,l=$a(a?.scope_key??``),u=ao(),d=oo(),f=so(),m=co(),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(!1),[D,O]=(0,Z.useState)(``),[k,A]=(0,Z.useState)(`move`);(0,Z.useEffect)(()=>{g(a?hu(a):null),b(``)},[a]);let j=a?hu(a):null,M=h!==null&&j!==null&&JSON.stringify(h)!==JSON.stringify(j),ee=d.isPending||u.isPending||f.isPending||m.isPending,N=()=>{if(!ee){if(M){S(!0);return}t(!1)}},P=()=>{if(!h)return;let e=Si(_);if(!Ei(e)){b(pi);return}g({...h,targetCohorts:Array.from(new Set([...h.targetCohorts,e]))}),v(``),b(``)},te=async()=>{if(!a||!h)return;let e=h.targetCohorts.map(Si);if(e.some(e=>!Ei(e))){b(pi);return}if(a.strategy===`APP_VERSION`&&!xs(h.targetAppVersion.trim())){b(`Enter a valid target app version range.`);return}let n={expectedRevision:a.revision,patch:gu(a,{...h,targetCohorts:e}),releaseId:a.id};b(``);try{await d.mutateAsync(n),await u.mutateAsync(n),Yt.success(`Bundle settings saved`),t(!1)}catch(e){b(e instanceof Error?e.message:`Bundle settings could not be saved.`)}},ne=e.find(e=>e.id===a?.channel_id)?.name??a?.channel_id,F=e.filter(e=>e.id!==a?.channel_id),I=F.map(e=>({label:e.name,value:e.name})),L=D.trim(),re=k===`copy`,R=h?xs(h.targetAppVersion.trim()):null,z=()=>{O(``),A(`move`)},ie=e=>{!e&&m.isPending||(E(e),e||z())};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(fl,{onOpenChange:e=>e?void 0:N(),open:n,children:(0,Q.jsxs)(hl,{className:`min-w-0 overflow-hidden data-[side=right]:w-full sm:max-w-[600px]`,children:[(0,Q.jsxs)(gl,{className:`shrink-0 pr-12`,children:[(0,Q.jsx)(_l,{children:`Bundle Detail`}),(0,Q.jsx)(vl,{className:`sr-only`,children:`Edit bundle delivery settings.`}),a?(0,Q.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-col gap-3 text-sm`,children:[(0,Q.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(As,{className:`size-4`,platform:a.platform}),(0,Q.jsx)(`span`,{className:`font-medium`,children:a.platform===`ios`?`iOS`:`Android`})]})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`ID`}),(0,Q.jsxs)(`span`,{className:`min-w-0 basis-full sm:basis-auto`,children:[(0,Q.jsx)(ei,{bundleId:a.id,fullOnMobile:!0,maxLength:18}),a.bundle_id?null:(0,Q.jsx)(`span`,{className:`text-xs text-foreground`,children:`Built-in app`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Channel`}),(0,Q.jsx)(`span`,{className:`text-xs text-foreground`,translate:`no`,children:ne})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Platform`}),(0,Q.jsx)(`span`,{className:`text-xs text-foreground`,children:a.platform===`ios`?`iOS`:`Android`})]})]}):(0,Q.jsx)(be,{className:`h-12 w-full`})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[i.isError?(0,Q.jsxs)(tn,{className:`m-4 sm:m-6`,variant:`destructive`,children:[(0,Q.jsx)(p,{}),(0,Q.jsx)(rn,{children:`Bundle details could not be loaded`}),(0,Q.jsx)(Zt,{children:i.error.message})]}):null,a&&h?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6 px-4 pb-4 sm:px-6 sm:pb-6`,children:[ne?(0,Q.jsx)(ja,{input:{platform:a.platform,channel:ne,releaseId:a.id}}):null,(0,Q.jsxs)(`section`,{"aria-labelledby":`delivery-settings-heading`,className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium`,id:`delivery-settings-heading`,children:`Delivery settings`}),(0,Q.jsxs)(hn,{className:`gap-6`,children:[(0,Q.jsxs)(yn,{children:[(0,Q.jsx)(mn,{htmlFor:`release-message`,children:`Message`}),(0,Q.jsx)(dt,{autoComplete:`off`,id:`release-message`,name:`message`,onChange:e=>g({...h,message:e.target.value}),rows:3,value:h.message})]}),a.strategy===`APP_VERSION`?(0,Q.jsxs)(yn,{children:[(0,Q.jsx)(mn,{htmlFor:`release-target`,children:`Target app version`}),(0,Q.jsx)(Ve,{autoComplete:`off`,id:`release-target`,name:`targetAppVersion`,onChange:e=>g({...h,targetAppVersion:e.target.value}),value:h.targetAppVersion}),R?(0,Q.jsx)(gn,{children:R}):null]}):null,(0,Q.jsxs)(yn,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(mn,{htmlFor:`release-enabled`,children:`Enabled`}),(0,Q.jsx)(pu,{"aria-label":`Enabled`,checked:h.enabled,id:`release-enabled`,name:`enabled`,onCheckedChange:e=>g({...h,enabled:e})})]}),(0,Q.jsx)(gn,{children:`Disabling rolls devices back to the previous enabled bundle on their next check, or to the built-in app when none remains.`})]}),(0,Q.jsxs)(yn,{orientation:`horizontal`,children:[(0,Q.jsx)(mn,{htmlFor:`release-force-update`,children:`Force update`}),(0,Q.jsx)(pu,{"aria-label":`Force update`,checked:h.shouldForceUpdate,id:`release-force-update`,name:`shouldForceUpdate`,onCheckedChange:e=>g({...h,shouldForceUpdate:e})})]}),(0,Q.jsxs)(yn,{children:[(0,Q.jsx)(mn,{htmlFor:`release-rollout-percentage`,children:`Rollout percentage`}),(0,Q.jsx)(bu,{onChange:e=>g({...h,rolloutCohortCount:e}),value:h.rolloutCohortCount})]}),(0,Q.jsxs)(yn,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(mn,{htmlFor:`release-cohort`,children:`Additional cohorts (optional)`}),(0,Q.jsx)(Ds,{releaseId:a.id,rolloutCohortCount:h.rolloutCohortCount,targetCohorts:h.targetCohorts})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(Ve,{autoComplete:`off`,id:`release-cohort`,name:`targetCohort`,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),P())},placeholder:`e.g. qa-team…`,value:_}),(0,Q.jsx)(qe,{"aria-label":`Add cohort`,disabled:!_.trim(),onClick:P,size:`icon`,type:`button`,variant:`outline`,children:(0,Q.jsx)(Ct,{})})]}),h.targetCohorts.length?(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:h.targetCohorts.map(e=>(0,Q.jsxs)(pn,{className:`gap-1 font-mono`,variant:`secondary`,children:[e,(0,Q.jsx)(`button`,{"aria-label":`Remove cohort ${e}`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>g({...h,targetCohorts:h.targetCohorts.filter(t=>t!==e)}),type:`button`,children:(0,Q.jsx)(at,{className:`size-3`})})]},e))}):null,(0,Q.jsx)(gn,{children:`Public names—no IDs or secrets.`})]})]}),y?(0,Q.jsx)(vn,{children:y}):null,(0,Q.jsx)(qe,{className:`w-full`,disabled:!M||ee,onClick:te,size:`lg`,children:d.isPending||u.isPending?`Saving…`:`Save changes`})]}),(0,Q.jsx)(ue,{className:`my-2`}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium`,children:`Actions`}),(0,Q.jsx)(qe,{className:`w-full`,disabled:a.kind!==`BUNDLE`||ee,onClick:()=>E(!0),size:`sm`,variant:`outline`,children:`Promote to channel`}),a.bundle_id?(0,Q.jsxs)(qe,{className:`w-full`,disabled:ee,onClick:()=>{window.open(`/api/bundles/${encodeURIComponent(a.bundle_id)}/download`,`_blank`,`noopener,noreferrer`),Yt.success(`Bundle download started`)},size:`sm`,variant:`outline`,children:[(0,Q.jsx)(Ir,{"data-icon":`inline-start`}),`Download bundle`]}):null,(0,Q.jsx)(qe,{className:`w-full`,disabled:a.enabled||ee,onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:`Remove from channel`})]}),a.bundle_id&&o.isPending?(0,Q.jsx)(be,{className:`h-40 w-full`}):null,a.bundle_id&&o.isError?(0,Q.jsxs)(tn,{variant:`destructive`,children:[(0,Q.jsx)(p,{}),(0,Q.jsx)(rn,{children:`Build details are unavailable`}),(0,Q.jsx)(Zt,{children:`Delivery settings are unaffected.`})]}):null,!a.bundle_id||!o.isPending?(0,Q.jsx)(Ts,{bundle:s,release:a}):null,(0,Q.jsxs)(`details`,{className:`rounded-lg border bg-muted/10 p-4 text-xs`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer font-medium`,children:`Advanced diagnostics`}),(0,Q.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-muted-foreground sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Q.jsx)(`dt`,{children:`Artifact ID`}),(0,Q.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:a.bundle_id??`Built-in app`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{children:`Revision`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:a.revision})]}),c?(0,Q.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Q.jsx)(`dt`,{children:`Patch base artifact ID`}),(0,Q.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:c})]}):null,(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{children:`Catalog generation`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:l.data?.generation??`—`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{children:`Catalog size`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-foreground`,children:l.data?`${l.data.byte_size} bytes`:`—`})]}),(0,Q.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Q.jsx)(`dt`,{children:`Scope key`}),(0,Q.jsx)(`dd`,{className:`mt-1 break-all font-mono text-foreground`,children:a.scope_key})]})]}),l.isError?(0,Q.jsx)(`p`,{className:`mt-3 text-destructive`,children:`Diagnostics are unavailable. Bundle settings are unaffected.`}):null]})]}):null]})]})}),(0,Q.jsx)(Lt,{onOpenChange:S,open:x,children:(0,Q.jsxs)(Mt,{children:[(0,Q.jsxs)(Nt,{children:[(0,Q.jsx)(Dt,{children:`Discard unsaved changes?`}),(0,Q.jsx)(Vt,{children:`Your Bundle changes will be lost.`})]}),(0,Q.jsxs)(Rt,{children:[(0,Q.jsx)(jt,{children:`Keep editing`}),(0,Q.jsx)(Gt,{onClick:()=>{S(!1),t(!1)},variant:`destructive`,children:`Discard changes`})]})]})}),(0,Q.jsx)(Lt,{onOpenChange:w,open:C,children:(0,Q.jsxs)(Mt,{children:[(0,Q.jsxs)(Nt,{children:[(0,Q.jsxs)(Dt,{children:[`Remove this Bundle from `,ne??`the channel`,`?`]}),(0,Q.jsx)(Vt,{children:`The uploaded artifact stays available. This only removes the Bundle from the channel.`})]}),(0,Q.jsxs)(Rt,{children:[(0,Q.jsx)(jt,{children:`Cancel`}),(0,Q.jsx)(Gt,{onClick:async()=>{if(a)try{await f.mutateAsync({expectedRevision:a.revision,releaseId:a.id}),Yt.success(`Bundle removed from ${ne??`the channel`}`),w(!1),t(!1)}catch(e){b(e instanceof Error?e.message:`Bundle could not be removed from the channel.`)}},variant:`destructive`,children:`Remove from channel`})]})]})}),(0,Q.jsx)(Wt,{onOpenChange:ie,open:T,children:(0,Q.jsxs)(zt,{showCloseButton:!m.isPending,children:[(0,Q.jsxs)(Ot,{children:[(0,Q.jsx)(Bt,{children:`Promote to Channel`}),(0,Q.jsx)(Ht,{children:`Choose how to promote this Bundle, then select the target channel.`})]}),(0,Q.jsxs)(`div`,{className:`space-y-4 py-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(_n,{htmlFor:`promote-action`,children:`Action`}),(0,Q.jsxs)(il,{disabled:m.isPending,items:mu,onValueChange:e=>A(e),value:k,children:[(0,Q.jsx)(sl,{className:`w-full`,id:`promote-action`,children:(0,Q.jsx)(ol,{placeholder:`Select an action`})}),(0,Q.jsx)(cl,{children:(0,Q.jsxs)(al,{children:[(0,Q.jsx)(ll,{value:`move`,children:`Move bundle`}),(0,Q.jsx)(ll,{value:`copy`,children:`Copy bundle`})]})})]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:re?`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,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(_n,{htmlFor:`target-channel`,children:`Target Channel`}),(0,Q.jsxs)(il,{disabled:m.isPending,items:I,onValueChange:e=>O(e??``),value:D||null,children:[(0,Q.jsx)(sl,{className:`w-full`,id:`target-channel`,children:(0,Q.jsx)(ol,{placeholder:`Select a channel`})}),(0,Q.jsx)(cl,{className:`max-h-64`,children:(0,Q.jsx)(al,{children:F.map(e=>(0,Q.jsx)(ll,{value:e.name,children:e.name},e.id))})})]})]})]}),(0,Q.jsxs)(Pt,{children:[(0,Q.jsx)(qe,{disabled:m.isPending,onClick:()=>ie(!1),variant:`outline`,children:`Cancel`}),(0,Q.jsx)(qe,{disabled:!L||m.isPending,onClick:async()=>{if(a)try{await m.mutateAsync({action:k,expectedRevision:a.revision,releaseId:a.id,targetChannel:L}),ie(!1),Yt.success(re?`Bundle copied to ${L}`:`Bundle moved to ${L}`)}catch(e){Yt.error(e instanceof Error?e.message:`Bundle could not be promoted.`)}},children:m.isPending?re?`Copying…`:`Moving…`:re?`Copy`:`Move`})]})]})})]})}function Su({release:e}){return(0,Q.jsxs)(pn,{className:`gap-1 font-normal text-muted-foreground`,variant:e.enabled?`outline`:`secondary`,children:[e.enabled?(0,Q.jsx)(et,{className:`size-3`}):(0,Q.jsx)(Fr,{className:`size-3`}),e.enabled?`Enabled`:`Disabled`]})}function Cu({percentage:e,className:t}){let n=e<100,r=e.toFixed(1);return(0,Q.jsxs)(pn,{className:X(`gap-1`,t),variant:n?`secondary`:`default`,children:[n?(0,Q.jsx)(p,{className:`h-3 w-3`}):null,r,`%`]})}var wu=20,Tu=[{label:`All Platforms`,value:`all`},{label:`iOS`,value:`ios`},{label:`Android`,value:`android`}],Eu=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),Du=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function Ou({channels:e,onChange:t,onClear:n,onManageChannels:r,search:i}){let[a,o]=(0,Z.useState)(i.targetAppVersion??``),s=!!(i.bundleId||i.channelId||i.enabled!==void 0||i.platform||i.targetAppVersion),c=[{label:`All Channels`,value:`all`},...e.map(e=>({label:e.name,value:e.id}))],l=()=>{t({targetAppVersion:a.trim()||void 0})};return(0,Z.useEffect)(()=>{o(i.targetAppVersion??``)},[i.targetAppVersion]),(0,Q.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,Q.jsx)(je,{className:`-ml-1`}),(0,Q.jsx)(`h1`,{className:`sr-only`,children:`Bundles`}),(0,Q.jsxs)(`div`,{className:`ml-1 flex items-center gap-1.5 text-muted-foreground sm:ml-2`,children:[(0,Q.jsx)(zr,{className:`size-3.5`}),(0,Q.jsx)(`span`,{className:`text-xs font-medium`,children:`Filters`})]}),(0,Q.jsxs)(il,{items:Tu,onValueChange:e=>t({platform:e===`all`?void 0:e}),value:i.platform??`all`,children:[(0,Q.jsx)(sl,{"aria-label":`Platform`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Q.jsx)(ol,{})}),(0,Q.jsx)(cl,{children:(0,Q.jsxs)(al,{children:[(0,Q.jsx)(ll,{value:`all`,children:`All Platforms`}),(0,Q.jsx)(ll,{value:`ios`,children:`iOS`}),(0,Q.jsx)(ll,{value:`android`,children:`Android`})]})})]}),(0,Q.jsx)(Ve,{"aria-label":`Target app version`,className:`h-8 w-full min-w-[132px] text-xs sm:w-[160px]`,onBlur:l,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l()},placeholder:`Target version`,value:a}),(0,Q.jsxs)(il,{items:c,onValueChange:e=>t({channelId:e===null||e===`all`?void 0:e}),value:i.channelId??`all`,children:[(0,Q.jsx)(sl,{"aria-label":`Channel`,className:`h-8 w-[calc(50%-0.25rem)] min-w-[132px] text-xs sm:w-[140px]`,children:(0,Q.jsx)(ol,{})}),(0,Q.jsx)(cl,{children:(0,Q.jsxs)(al,{children:[(0,Q.jsx)(ll,{value:`all`,children:`All Channels`}),e.map(e=>(0,Q.jsx)(ll,{value:e.id,children:e.name},e.id))]})})]}),(0,Q.jsx)(qe,{"aria-label":`Manage channels`,onClick:r,size:`icon-sm`,title:`Manage channels`,variant:`outline`,children:(0,Q.jsx)(Ur,{})}),i.bundleId?(0,Q.jsxs)(pn,{className:`max-w-48 gap-1`,variant:`secondary`,children:[`Artifact filter`,(0,Q.jsx)(`button`,{"aria-label":`Clear artifact filter`,className:`rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>t({bundleId:void 0}),type:`button`,children:(0,Q.jsx)(at,{className:`size-3`})})]}):null,s?(0,Q.jsxs)(qe,{className:`h-8 px-2 text-xs text-muted-foreground hover:text-foreground sm:ml-auto`,onClick:n,size:`sm`,variant:`ghost`,children:[(0,Q.jsx)(at,{"data-icon":`inline-start`}),`Clear`]}):null]})}function ku({expanded:e,onOpen:t,onToggleExpand:n,release:r}){let i=r.operation===`PROMOTE`?`Promoted`:r.operation===`ROLLBACK`?`Rollback`:null;return(0,Q.jsxs)(`div`,{className:`flex min-w-[240px] items-center gap-3`,children:[r.bundle_id?(0,Q.jsx)(qe,{"aria-controls":`bundle-lineage-panel-${r.id}`,"aria-expanded":e,"aria-label":e?`Hide advanced artifact diagnostics`:`Show advanced artifact diagnostics`,title:`Advanced artifact diagnostics`,className:`size-8 shrink-0 touch-manipulation`,onClick:n,size:`icon`,type:`button`,variant:`ghost`,children:e?(0,Q.jsx)(mt,{}):(0,Q.jsx)(Nr,{})}):(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`size-8 shrink-0`}),(0,Q.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,Q.jsx)(ei,{bundleId:r.id,fullOnMobile:!0}),r.bundle_id?null:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-sm`,children:[(0,Q.jsx)(lt,{className:`size-3.5`}),` Built-in app`]})]}),i?(0,Q.jsx)(pn,{className:`shrink-0 font-normal`,variant:`secondary`,children:i}):null,r.currentlyUnreachable?(0,Q.jsxs)(`span`,{"aria-label":`Currently unreachable. No catalog segment or cohort selects this bundle first.`,className:`inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,title:`No catalog segment or cohort selects this bundle first with the current delivery settings.`,children:[(0,Q.jsx)(Fr,{className:`size-3.5`}),`Unreachable`]}):null]})}function Au({onDetailClick:e,panelId:t,release:n}){let r=n.bundle_id??``,i=eo(r),a=to(r);return i.isError||a.isError?(0,Q.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Patch lineage could not be loaded.`}):i.isPending?(0,Q.jsxs)(`div`,{"aria-live":`polite`,className:`flex flex-col gap-2 border-t bg-muted/10 p-4`,id:t,children:[(0,Q.jsx)(be,{className:`h-10 w-full`}),(0,Q.jsx)(be,{className:`h-10 w-full`})]}):i.data?(0,Q.jsx)(Ri,{bundle:i.data,bundles:a.data??[],loading:a.isPending,onDetailClick:e,panelId:t}):(0,Q.jsx)(`div`,{"aria-live":`polite`,className:`border-t bg-muted/10 p-4 text-sm text-muted-foreground`,id:t,children:`Bundle details are unavailable.`})}function ju(){let e=_t.useSearch(),t=_t.useNavigate(),n=Se(),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(),s=Za({afterReleaseId:e.afterReleaseId,beforeReleaseId:e.beforeReleaseId,bundleId:e.bundleId,channelId:e.channelId,enabled:e.enabled,limit:wu,page:e.page,platform:e.platform,targetAppVersion:e.targetAppVersion}),c=Xa().data??[],l=s.data?.data??[],u=no(Array.from(new Set(l.flatMap(e=>e.bundle_id?[e.bundle_id]:[])))).data??{},d=s.data?.pagination,f=zi(l.flatMap(e=>{let t=c.find(t=>t.id===e.channel_id)?.name;return t?[{releaseId:e.id,platform:e.platform,channel:t}]:[]})),m=new Map(c.map(e=>[e.id,e.name]));(0,Z.useEffect)(()=>{a&&!l.some(e=>e.id===a)&&o(void 0)},[a,l]);let h=(e,n=!0)=>void t({resetScroll:n,search:e,to:`/`}),g=t=>h(ht(e,t)),_=t=>{let n=l.find(e=>e.bundle_id===t.id);if(o(void 0),n){h({...e,releaseId:n.id},!1);return}g({bundleId:t.id})},v=d?.currentPage??1,y=l.length===0?0:(v-1)*wu+1,b=y===0?0:y+l.length-1,x=v-1,S=l[0]?.id,C=l.at(-1)?.id,w=d?.hasPreviousPage&&S?{...e,afterReleaseId:S,beforeReleaseId:void 0,page:x>1?x:void 0,releaseId:void 0}:null,T=d?.hasNextPage&&C?{...e,afterReleaseId:void 0,beforeReleaseId:C,page:v+1,releaseId:void 0}:null;return(0,Q.jsxs)(`div`,{className:`flex h-svh min-h-0 min-w-0 flex-col`,children:[(0,Q.jsx)(Ou,{channels:c,onChange:g,onClear:()=>h({}),onManageChannels:()=>i(!0),search:e}),(0,Q.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:[s.isError?(0,Q.jsxs)(tn,{variant:`destructive`,children:[(0,Q.jsx)(p,{}),(0,Q.jsx)(rn,{children:`Bundles could not be loaded`}),(0,Q.jsx)(Zt,{children:s.error.message})]}):(0,Q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm [&_[data-slot=table-container]]:h-full [&_[data-slot=table-container]]:overflow-auto`,children:n?(0,Q.jsx)(`div`,{className:`h-full overflow-y-auto`,children:s.isPending?(0,Q.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:Array.from({length:5},(e,t)=>(0,Q.jsx)(be,{className:`h-44 w-full`},t))}):l.length?l.map(t=>{let n=m.get(t.channel_id)??t.channel_id,r=t.bundle_id?u[t.bundle_id]:0,i=a===t.id,s=`bundle-lineage-panel-${t.id}`;return(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsxs)(`article`,{className:X(`flex flex-col gap-4 border-b p-4 last:border-b-0`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 transition-[background-color,filter] focus-within:saturate-100 motion-reduce:transition-none`,i&&`border-b-0 bg-primary/5`),children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsx)(ku,{expanded:i,onOpen:()=>h({...e,releaseId:t.id},!1),onToggleExpand:()=>o(i?void 0:t.id),release:t}),(0,Q.jsx)(ni,{channel:n,className:`shrink-0`})]}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Platform`}),(0,Q.jsxs)(`dd`,{className:`mt-1 flex items-center gap-2 font-medium`,children:[(0,Q.jsx)(As,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})]}),(0,Q.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,Q.jsx)(`dd`,{className:`mt-1 tabular-nums`,children:Eu.format(t.created_at_ms)})]}),(0,Q.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Rollout`}),(0,Q.jsx)(`dd`,{className:`mt-1`,children:(0,Q.jsx)(Cu,{percentage:t.rollout_cohort_count/10})})]}),(0,Q.jsxs)(`div`,{className:`rounded-md bg-muted/40 p-3`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Patches`}),(0,Q.jsx)(`dd`,{className:`mt-1`,children:r===void 0?`Checking`:r>0?`${r} ${r===1?`patch`:`patches`}`:`—`})]}),(0,Q.jsxs)(`div`,{className:`col-span-2 rounded-md bg-muted/40 p-3`,children:[(0,Q.jsx)(`dt`,{className:`mb-2 text-muted-foreground`,children:`Activity · 30d`}),(0,Q.jsx)(`dd`,{children:(0,Q.jsx)(Aa,{report:f.data?.[t.id],loading:f.isFetching})})]}),(0,Q.jsxs)(`div`,{className:`col-span-2 flex flex-wrap items-center gap-2 rounded-md bg-muted/40 p-3`,children:[(0,Q.jsx)(Su,{release:t}),t.should_force_update?(0,Q.jsx)(pn,{variant:`secondary`,children:`Force update`}):null]}),(0,Q.jsxs)(`div`,{className:`col-span-2 grid gap-2 rounded-md border bg-background/80 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,Q.jsx)(`dd`,{className:`min-w-0 truncate text-right font-mono`,children:t.target_app_version??t.fingerprint_hash??`—`})]}),(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Message`}),(0,Q.jsx)(`dd`,{className:`min-w-0 text-right text-foreground`,children:t.message||`—`})]})]})]})]}),i&&t.bundle_id?(0,Q.jsx)(Au,{onDetailClick:_,panelId:s,release:t}):null]},t.id)}):(0,Q.jsx)(`p`,{className:`p-8 text-center text-sm text-muted-foreground`,children:e.bundleId||e.channelId||e.enabled!==void 0||e.platform||e.targetAppVersion?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):(0,Q.jsxs)(ot,{className:`min-w-max`,children:[(0,Q.jsx)($e,{className:`bg-muted/40`,children:(0,Q.jsxs)(rt,{className:`border-b border-border/60 hover:bg-transparent [&>th]:h-10 [&>th]:text-xs [&>th]:font-semibold [&>th]:uppercase [&>th]:text-muted-foreground/70`,children:[(0,Q.jsx)(tt,{children:`ID`}),(0,Q.jsx)(tt,{children:`Channel`}),(0,Q.jsx)(tt,{children:`Platform`}),(0,Q.jsx)(tt,{children:`Patches`}),(0,Q.jsx)(tt,{children:`Target`}),(0,Q.jsx)(tt,{children:`Enabled`}),(0,Q.jsx)(tt,{children:`Force update`}),(0,Q.jsx)(tt,{children:`Rollout`}),(0,Q.jsx)(tt,{children:`Activity · 30d`}),(0,Q.jsx)(tt,{children:`Message`}),(0,Q.jsx)(tt,{children:`Created`})]})}),(0,Q.jsxs)(nt,{children:[s.isPending?Array.from({length:7},(e,t)=>(0,Q.jsx)(rt,{children:(0,Q.jsx)(it,{colSpan:11,children:(0,Q.jsx)(be,{className:`h-8 w-full`})})},t)):l.map(t=>{let n=a===t.id,r=`bundle-lineage-panel-${t.id}`;return(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsxs)(rt,{"aria-label":`Open bundle ${t.id}`,className:X(`cursor-pointer transition-[background-color,filter] hover:bg-muted/10 focus-within:bg-muted/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring motion-reduce:transition-none data-[state=selected]:bg-muted/15 [&>td]:py-3`,t.currentlyUnreachable&&`bg-muted/35 saturate-50 hover:bg-muted/50 hover:saturate-100 focus-within:saturate-100`,n&&`bg-primary/5`),"data-state":e.releaseId===t.id?`selected`:void 0,onClick:n=>{n.target instanceof Element&&n.target.closest(`button, a, input, select, textarea`)||h({...e,releaseId:t.id},!1)},onKeyDown:n=>{n.target!==n.currentTarget||n.key!==`Enter`&&n.key!==` `||(n.preventDefault(),h({...e,releaseId:t.id},!1))},tabIndex:0,children:[(0,Q.jsx)(it,{children:(0,Q.jsx)(ku,{expanded:n,onOpen:()=>h({...e,releaseId:t.id},!1),onToggleExpand:()=>o(n?void 0:t.id),release:t})}),(0,Q.jsx)(it,{children:(0,Q.jsx)(ni,{channel:m.get(t.channel_id)??t.channel_id})}),(0,Q.jsx)(it,{className:`whitespace-nowrap`,children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(As,{className:`size-4`,platform:t.platform}),t.platform===`ios`?`iOS`:`Android`]})}),(0,Q.jsx)(it,{children:t.bundle_id&&u[t.bundle_id]===void 0?(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Checking`}):t.bundle_id&&u[t.bundle_id]>0?(0,Q.jsxs)(pn,{variant:`secondary`,children:[u[t.bundle_id],` `,u[t.bundle_id]===1?`patch`:`patches`]}):(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Q.jsx)(it,{children:t.target_app_version?(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(gt,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`font-medium`,children:t.target_app_version})]}):t.fingerprint_hash?(0,Q.jsxs)(`span`,{className:`flex min-w-[160px] items-center gap-2`,children:[(0,Q.jsx)(Rr,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Q.jsx)(ft,{maxLength:12,value:t.fingerprint_hash})]}):(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,Q.jsx)(it,{children:(0,Q.jsxs)(`span`,{className:`flex items-center`,children:[(0,Q.jsx)(ri,{enabled:t.enabled}),(0,Q.jsx)(`span`,{className:`sr-only`,children:t.enabled?`Enabled`:`Disabled`})]})}),(0,Q.jsx)(it,{children:(0,Q.jsxs)(`span`,{className:`flex items-center`,children:[(0,Q.jsx)(ri,{enabled:t.should_force_update,falseIcon:`minus`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:t.should_force_update?`Required`:`Optional`})]})}),(0,Q.jsx)(it,{children:(0,Q.jsx)(Cu,{percentage:t.rollout_cohort_count/10})}),(0,Q.jsx)(it,{children:(0,Q.jsx)(Aa,{report:f.data?.[t.id],loading:f.isFetching})}),(0,Q.jsx)(it,{className:`text-sm text-muted-foreground`,title:t.message??void 0,children:t.message||`-`}),(0,Q.jsx)(it,{className:`whitespace-nowrap text-xs text-muted-foreground`,title:Eu.format(t.created_at_ms),children:Du.format(t.created_at_ms)})]}),n&&t.bundle_id?(0,Q.jsx)(rt,{className:`hover:bg-transparent`,children:(0,Q.jsx)(it,{className:`border-t-0 p-0`,colSpan:11,children:(0,Q.jsx)(Au,{onDetailClick:_,panelId:r,release:t})})}):null]},t.id)}),!s.isPending&&l.length===0?(0,Q.jsx)(rt,{children:(0,Q.jsx)(it,{className:`h-40 text-center text-muted-foreground`,colSpan:11,children:e.bundleId||e.channelId||e.enabled!==void 0||e.platform||e.targetAppVersion?`No bundles match these filters.`:`No bundles yet. Deploy an update to see it here.`})}):null]})]})}),!s.isError&&!s.isPending?(0,Q.jsxs)(`nav`,{"aria-label":`Bundle pagination`,className:`flex flex-col gap-3 px-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[`Showing `,(0,Q.jsx)(`span`,{className:`text-foreground`,children:y}),` to`,` `,(0,Q.jsx)(`span`,{className:`text-foreground`,children:b}),` entries`]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 sm:justify-end`,children:[(0,Q.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[`Page `,(0,Q.jsx)(`span`,{className:`text-foreground`,children:v})]}),w?(0,Q.jsxs)(Xe,{className:me({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:w,to:`/`,children:[(0,Q.jsx)(Mr,{"data-icon":`inline-start`}),`Previous`]}):(0,Q.jsxs)(qe,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[(0,Q.jsx)(Mr,{"data-icon":`inline-start`}),`Previous`]}),T?(0,Q.jsxs)(Xe,{className:me({className:`h-8 flex-1 px-3 text-xs sm:flex-none`,size:`sm`,variant:`outline`}),search:T,to:`/`,children:[`Next`,(0,Q.jsx)(Nr,{"data-icon":`inline-end`})]}):(0,Q.jsxs)(qe,{className:`h-8 flex-1 px-3 text-xs sm:flex-none`,disabled:!0,size:`sm`,variant:`outline`,children:[`Next`,(0,Q.jsx)(Nr,{"data-icon":`inline-end`})]})]})]}):null]}),(0,Q.jsx)(xu,{channels:c,onOpenChange:t=>!t&&h({...e,releaseId:void 0},!1),open:!!e.releaseId,releaseId:e.releaseId??``}),(0,Q.jsx)(lo,{onOpenChange:i,open:r})]})}export{ju as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-BFE-oRIT.js","assets/createServerFn-DHc2erub.js","assets/dialog-dyZ1SphZ.js","assets/composite-CHTH1Xhh.js","assets/table-BBEzJ7Xl.js","assets/useCompositeListItem-BkPDaqyj.js","assets/loader-circle-Bbp8LGVC.js","assets/link-BG06whwB.js","assets/input-group-BbHfaBzQ.js","assets/dist-Bh1gaDfB.js","assets/card-BEvx_QKh.js","assets/badge-BuMDU0Rf.js","assets/field-79SVH26s.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Kn as e}from"./createServerFn-DHc2erub.js";import{n as t,t as n}from"./lazyRouteComponent-BN0MS05o.js";import{t as r}from"./preload-helper-uTix4PVD.js";var i=e(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),a=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0;function o(e){let t=typeof e.page==`number`?e.page:typeof e.page==`string`?Number(e.page):void 0,n=a(e.beforeReleaseId),r=n?void 0:a(e.afterReleaseId),i=e.enabled===!0||e.enabled===`true`?!0:e.enabled===!1||e.enabled===`false`?!1:void 0;return{afterReleaseId:r,beforeReleaseId:n,bundleId:a(e.bundleId),channelId:a(e.channelId),enabled:i,page:t!==void 0&&Number.isInteger(t)&&t>1?t:void 0,platform:e.platform===`ios`||e.platform===`android`?e.platform:void 0,releaseId:a(e.releaseId),targetAppVersion:a(e.targetAppVersion)}}function s(e,t){return{...e,...t,afterReleaseId:void 0,beforeReleaseId:void 0,page:void 0,releaseId:void 0}}var c=t(`/`)({component:n(()=>r(()=>import(`./routes-BFE-oRIT.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),`component`),validateSearch:o});export{s as n,i as r,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kn as e}from"./createServerFn-DHc2erub.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),n=e(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),r=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{n,t as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Gn as e,Qn as t,Yn as n,gn as r,m as i,t as a,vr as o,yn as s}from"./createServerFn-DHc2erub.js";import{n as c,r as l,t as u}from"./shield-check-DoIiaaXU.js";import{t as d}from"./refresh-cw-DZgiAOMk.js";import{a as f,c as p,l as m,n as h,o as g,r as _,s as v,t as y,u as b}from"./card-BEvx_QKh.js";import{t as x}from"./badge-BuMDU0Rf.js";var S=a({method:`GET`}).handler(o(`662034966679a6d29db2b55e7ba665e26e6c9a58a5529f33aa857a2049616233`)),C=[`bundle-signing`],w=()=>({queryFn:()=>S(),queryKey:C,staleTime:3e4}),T=()=>n(w()),E=t();function D(){return(0,E.jsxs)(`div`,{"aria-label":`Loading bundle signing`,className:`flex flex-col gap-6`,children:[(0,E.jsxs)(y,{children:[(0,E.jsxs)(f,{children:[(0,E.jsx)(r,{className:`h-4 w-36`}),(0,E.jsx)(r,{className:`h-3 w-4/5`})]}),(0,E.jsxs)(h,{className:`flex flex-col gap-4`,children:[(0,E.jsx)(r,{className:`h-12 w-full`}),(0,E.jsx)(r,{className:`h-12 w-full`})]})]}),(0,E.jsxs)(y,{children:[(0,E.jsxs)(f,{children:[(0,E.jsx)(r,{className:`h-4 w-28`}),(0,E.jsx)(r,{className:`h-3 w-3/5`})]}),(0,E.jsx)(h,{children:(0,E.jsx)(r,{className:`h-56 w-full`})})]})]})}function O({refetch:t}){return(0,E.jsxs)(v,{variant:`destructive`,children:[(0,E.jsx)(e,{"aria-hidden":`true`}),(0,E.jsx)(b,{children:`Bundle signing couldn't be loaded`}),(0,E.jsx)(m,{children:`Check the Console connection and try again.`}),(0,E.jsx)(p,{children:(0,E.jsxs)(s,{onClick:t,size:`xs`,variant:`outline`,children:[(0,E.jsx)(d,{"data-icon":`inline-start`}),`Retry`]})})]})}function k({inspection:e}){let t=e.status===`enabled`;return(0,E.jsxs)(y,{children:[(0,E.jsxs)(f,{children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,E.jsx)(g,{className:`text-sm font-medium`,children:(0,E.jsx)(`h2`,{children:`Signing status`})}),(0,E.jsx)(x,{variant:t?`default`:`outline`,children:t?`Enabled`:`Disabled`})]}),(0,E.jsx)(_,{children:t?`Bundle signing is enabled in the current Hot Updater configuration.`:`Bundle signing is disabled in the current Hot Updater configuration.`})]}),(0,E.jsx)(h,{className:`flex flex-col gap-5`,children:e.status===`disabled`?(0,E.jsxs)(v,{children:[(0,E.jsx)(c,{"aria-hidden":`true`}),(0,E.jsx)(b,{children:`Configure signing outside the Console`}),(0,E.jsx)(m,{children:`Use your signing provider or the Hot Updater CLI to configure a key. The Console never creates or stores private keys.`})]}):(0,E.jsxs)(`dl`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,E.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Provider`}),(0,E.jsx)(`dd`,{className:`truncate text-sm font-medium`,children:e.provider})]}),(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,E.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:`Algorithm`}),(0,E.jsx)(`dd`,{className:`text-sm font-medium`,children:e.algorithm})]})]})})]})}function A(){let e=T();return e.isLoading?(0,E.jsx)(D,{}):e.isError||!e.data?(0,E.jsx)(O,{refetch:()=>void e.refetch()}):(0,E.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,E.jsx)(k,{inspection:e.data}),(0,E.jsxs)(v,{children:[(0,E.jsx)(l,{"aria-hidden":`true`}),(0,E.jsx)(b,{children:`Read-only inspection`}),(0,E.jsx)(m,{children:`Configure or rotate signing keys through the provider or Hot Updater CLI. The Console never accesses signing credentials.`})]})]})}function j(){return(0,E.jsxs)(`div`,{className:`flex h-svh min-h-0 flex-col`,children:[(0,E.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,E.jsx)(i,{className:`-ml-1`}),(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,E.jsx)(u,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),(0,E.jsx)(`h1`,{className:`text-sm font-medium`,children:`Bundle signing`})]}),(0,E.jsx)(x,{variant:`outline`,children:`Read-only`}),(0,E.jsx)(`p`,{className:`basis-full pl-9 text-xs text-muted-foreground sm:basis-auto sm:pl-0`,children:`Inspect the public key used to verify signed updates.`})]}),(0,E.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto bg-muted/5 p-3 sm:p-6`,children:(0,E.jsx)(`div`,{className:`mx-auto w-full max-w-5xl`,children:(0,E.jsx)(A,{})})})]})}export{j as component};
|