@lunora/studio 1.0.0-alpha.367 → 1.0.0-alpha.369
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/dist/packem_chunks/ai-knowledge.mjs +1 -1
- package/dist/standalone/{chunk-U7CBXP36.js → chunk-2JI25KW2.js} +1 -1
- package/dist/standalone/{chunk-CFHHIEAK.js → chunk-2XVH2EXL.js} +1 -1
- package/dist/standalone/{chunk-YM3HTXWH.js → chunk-3526X23C.js} +1 -1
- package/dist/standalone/{chunk-VOG262N5.js → chunk-3CHB2JV2.js} +1 -1
- package/dist/standalone/{chunk-3RDUIFQ2.js → chunk-3DSYXWHK.js} +1 -1
- package/dist/standalone/{chunk-UKVSYL5L.js → chunk-4CP3Z5RO.js} +1 -1
- package/dist/standalone/{chunk-PAR27NLE.js → chunk-4M3NH7JL.js} +1 -1
- package/dist/standalone/{chunk-YESQLEOG.js → chunk-4RB2U4LR.js} +1 -1
- package/dist/standalone/{chunk-MW2MAWEQ.js → chunk-5D3H63PI.js} +1 -1
- package/dist/standalone/{chunk-7OZPINI4.js → chunk-5H7O5AAH.js} +1 -1
- package/dist/standalone/{chunk-DHXZI632.js → chunk-645TBHJ5.js} +1 -1
- package/dist/standalone/chunk-7AJWGPWM.js +7 -0
- package/dist/standalone/{chunk-IM64M6RC.js → chunk-7CCJOJJB.js} +1 -1
- package/dist/standalone/{chunk-TTD4VIKR.js → chunk-7PMFQ2MH.js} +1 -1
- package/dist/standalone/{chunk-HYTBZYDH.js → chunk-AHGTRV37.js} +1 -1
- package/dist/standalone/{chunk-QH3HSOII.js → chunk-AJQGPPJL.js} +1 -1
- package/dist/standalone/{chunk-IV35MWJJ.js → chunk-AW532XQ3.js} +1 -1
- package/dist/standalone/{chunk-HDC7PCKE.js → chunk-AZ4XQOCL.js} +1 -1
- package/dist/standalone/{chunk-W3SIIBHR.js → chunk-BCJWWHAX.js} +1 -1
- package/dist/standalone/{chunk-TPWDY3VI.js → chunk-BDSMWSCC.js} +1 -1
- package/dist/standalone/{chunk-LA3JZW4O.js → chunk-BRSAZHDR.js} +1 -1
- package/dist/standalone/{chunk-SGHIB7TS.js → chunk-BVANRUU4.js} +5 -5
- package/dist/standalone/{chunk-POXXBJ5G.js → chunk-CB7ZTKPV.js} +1 -1
- package/dist/standalone/{chunk-43IIUGWM.js → chunk-CEQ5CLF7.js} +1 -1
- package/dist/standalone/{chunk-Y4QFNP4R.js → chunk-CHRUVO6R.js} +1 -1
- package/dist/standalone/{chunk-OE33ZUC4.js → chunk-CVXWRAOE.js} +1 -1
- package/dist/standalone/{chunk-WQWNIVVZ.js → chunk-D65BU7FE.js} +1 -1
- package/dist/standalone/{chunk-ZH7VXMDC.js → chunk-D7G6QZVG.js} +1 -1
- package/dist/standalone/{chunk-XSWXBYQU.js → chunk-DAKKBHGF.js} +1 -1
- package/dist/standalone/{chunk-5M7I2MKF.js → chunk-DAO4DQDP.js} +1 -1
- package/dist/standalone/{chunk-IXPMM6KT.js → chunk-DAQ5MG2K.js} +1 -1
- package/dist/standalone/{chunk-NMBKSBYQ.js → chunk-DJNIAP4K.js} +1 -1
- package/dist/standalone/{chunk-ESSPRXXR.js → chunk-DK53RZKN.js} +1 -1
- package/dist/standalone/{chunk-SIMN2JMH.js → chunk-E2YYGOOQ.js} +1 -1
- package/dist/standalone/{chunk-MODGPDEE.js → chunk-E7INALU3.js} +1 -1
- package/dist/standalone/{chunk-NMQDQNDF.js → chunk-EU4ZGNNW.js} +1 -1
- package/dist/standalone/{chunk-E2P5QCPC.js → chunk-F3ZG77WE.js} +1 -1
- package/dist/standalone/{chunk-KXDEQH47.js → chunk-FAQYDT7O.js} +1 -1
- package/dist/standalone/{chunk-QHEP3PHU.js → chunk-FJMFQ5AG.js} +1 -1
- package/dist/standalone/{chunk-CSLKRY64.js → chunk-FRAL2RO2.js} +1 -1
- package/dist/standalone/{chunk-MYIDM3IF.js → chunk-FZTPC7NT.js} +1 -1
- package/dist/standalone/{chunk-D6NAWS5P.js → chunk-HAJH74RY.js} +1 -1
- package/dist/standalone/{chunk-RWHCLTTR.js → chunk-HCN5COJB.js} +1 -1
- package/dist/standalone/{chunk-XLCYVOJY.js → chunk-HUFK6COH.js} +1 -1
- package/dist/standalone/{chunk-HPY26HUU.js → chunk-HUIW5YJW.js} +1 -1
- package/dist/standalone/{chunk-BTR2GIRT.js → chunk-IXS7MHHM.js} +1 -1
- package/dist/standalone/{chunk-ZYXDE5GW.js → chunk-J66QR7WA.js} +1 -1
- package/dist/standalone/{chunk-3SKL6OEA.js → chunk-JK3WW3ZA.js} +1 -1
- package/dist/standalone/{chunk-IDEFXN4C.js → chunk-JKUOZ7WC.js} +1 -1
- package/dist/standalone/{chunk-NZMLDVDH.js → chunk-JMFIJ3RC.js} +1 -1
- package/dist/standalone/{chunk-2AVOAV4Y.js → chunk-JULHAFJ4.js} +1 -1
- package/dist/standalone/chunk-K3DHV2YQ.js +1 -0
- package/dist/standalone/{chunk-GBL62M7L.js → chunk-KFQGXMDN.js} +1 -1
- package/dist/standalone/{chunk-GZWXXJKZ.js → chunk-KPTRMV5Y.js} +1 -1
- package/dist/standalone/{chunk-PNFIIVQG.js → chunk-L2IIDFS6.js} +1 -1
- package/dist/standalone/{chunk-ZMBRGW6J.js → chunk-LJKB6B3H.js} +1 -1
- package/dist/standalone/{chunk-23UYZ7NC.js → chunk-LPNUYR43.js} +1 -1
- package/dist/standalone/{chunk-UJ6FKZC4.js → chunk-LT4GBBFX.js} +1 -1
- package/dist/standalone/{chunk-XBVE6NFA.js → chunk-LTUZJBOU.js} +1 -1
- package/dist/standalone/{chunk-JBGSBRHU.js → chunk-MQ5QAANP.js} +1 -1
- package/dist/standalone/{chunk-IOU52UNN.js → chunk-MTQ2AME6.js} +1 -1
- package/dist/standalone/{chunk-3U6JHRLU.js → chunk-NCHRXGHE.js} +1 -1
- package/dist/standalone/{chunk-NEGISEDY.js → chunk-NQK3Y5UV.js} +1 -1
- package/dist/standalone/{chunk-Q5RHT6OH.js → chunk-OX4CGBCH.js} +1 -1
- package/dist/standalone/{chunk-3ZGPXDJ4.js → chunk-P37PUSCM.js} +1 -1
- package/dist/standalone/{chunk-QHMICJL5.js → chunk-P4FZSY2J.js} +1 -1
- package/dist/standalone/{chunk-UQHDIACF.js → chunk-PACPUEWB.js} +1 -1
- package/dist/standalone/{chunk-7F3IYLYN.js → chunk-PXVIHVAC.js} +1 -1
- package/dist/standalone/{chunk-OBVZIDIU.js → chunk-QJQESOSM.js} +1 -1
- package/dist/standalone/{chunk-36PLWIHK.js → chunk-QNWL62VF.js} +1 -1
- package/dist/standalone/{chunk-TRYQANZO.js → chunk-R47IHY6Y.js} +1 -1
- package/dist/standalone/{chunk-WL3MWYDB.js → chunk-RJBL7JY4.js} +1 -1
- package/dist/standalone/{chunk-C4IDZOYU.js → chunk-RL5SUZ6J.js} +1 -1
- package/dist/standalone/{chunk-YPMRBJDE.js → chunk-SBK3TAAB.js} +1 -1
- package/dist/standalone/{chunk-BOBQQR2H.js → chunk-SLEA53CP.js} +1 -1
- package/dist/standalone/{chunk-QB74D2O2.js → chunk-SPSYM34I.js} +1 -1
- package/dist/standalone/{chunk-7TWHRQXV.js → chunk-SVFX7F32.js} +1 -1
- package/dist/standalone/{chunk-ISN26NX7.js → chunk-UA3LPAFC.js} +1 -1
- package/dist/standalone/{chunk-MVYIJ6YK.js → chunk-UDDIUQ2F.js} +1 -1
- package/dist/standalone/{chunk-OIZPNC33.js → chunk-UUWJUMOH.js} +1 -1
- package/dist/standalone/{chunk-TWVNHWE7.js → chunk-UWVPGEJM.js} +1 -1
- package/dist/standalone/{chunk-2TG6UMQG.js → chunk-UXLXNYF2.js} +1 -1
- package/dist/standalone/{chunk-HZK2UJ3K.js → chunk-VRBDHZHG.js} +1 -1
- package/dist/standalone/{chunk-FWCWPMMH.js → chunk-VZGMGBF2.js} +1 -1
- package/dist/standalone/{chunk-VW5JVONI.js → chunk-WRP4JGYX.js} +1 -1
- package/dist/standalone/{chunk-M4KIEY3B.js → chunk-WSKN5NCB.js} +1 -1
- package/dist/standalone/{chunk-7MYNH4FV.js → chunk-WYXSCWNG.js} +1 -1
- package/dist/standalone/{chunk-ZK24PPCD.js → chunk-XC3XUPB7.js} +1 -1
- package/dist/standalone/{chunk-ARYARX6T.js → chunk-XTU27CFW.js} +1 -1
- package/dist/standalone/{chunk-6ONPEGTC.js → chunk-YPNUYWQA.js} +1 -1
- package/dist/standalone/{chunk-JUCO5WUV.js → chunk-YTZ7LWZ4.js} +1 -1
- package/dist/standalone/{chunk-SKTCQUAH.js → chunk-YUJEQHLF.js} +1 -1
- package/dist/standalone/{chunk-GYZWBIV5.js → chunk-YWBYKFUD.js} +1 -1
- package/dist/standalone/{chunk-7HUPWAKM.js → chunk-Z2OFUUXB.js} +1 -1
- package/dist/standalone/{chunk-5L4C6Z7K.js → chunk-Z5FIGWZI.js} +1 -1
- package/dist/standalone/{chunk-X3BATMFU.js → chunk-ZHH5ZUAS.js} +1 -1
- package/dist/standalone/{chunk-RR4CQOLR.js → chunk-ZPOWCFQA.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +5 -5
- package/dist/standalone/chunk-ASX4ZF2M.js +0 -1
- package/dist/standalone/chunk-N5AFTHW5.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-PACPUEWB.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as $}from"./chunk-LJKB6B3H.js";import{b as v}from"./chunk-SVFX7F32.js";import"./chunk-YUVGMKHG.js";import{a as j}from"./chunk-DK53RZKN.js";import"./chunk-QNWL62VF.js";import{a as I,b as _,c as q,d as p,e as o,f as i}from"./chunk-J66QR7WA.js";import"./chunk-2JI25KW2.js";import"./chunk-R47IHY6Y.js";import"./chunk-4PI2OSSP.js";import{a as g}from"./chunk-2W4UO5BC.js";import{c as h}from"./chunk-RL5SUZ6J.js";import{a as K,e as S}from"./chunk-ZHH5ZUAS.js";import"./chunk-7AJWGPWM.js";import"./chunk-ZPQBVYNN.js";import{B as T,w as F}from"./chunk-BVANRUU4.js";import"./chunk-PDBW6GTJ.js";import{a as oe}from"./chunk-GWNGVKLG.js";import{a as ne,b as ie}from"./chunk-6G3E4PJ2.js";import{a as d,d as k}from"./chunk-5PEAXTYQ.js";var Q=k(oe(),1),G=k(ne(),1);var e=k(ie(),1);var H="agent_threads",de="agent_messages",L="agent_run_queue",J=100,N=250,le={},ce={filters:[],limit:J,offset:0,orderBy:{column:"updatedAt",direction:"desc"},skipCount:!0,table:H},c=d((s,t)=>{let a=s[t];return typeof a=="string"?a:void 0},"c"),B=d((s,t)=>{let a=s[t];return typeof a=="number"?a:void 0},"E"),O=d(s=>{let{usage:t}=s;if(t===null||typeof t!="object")return;let{totalTokens:a}=t;return typeof a=="number"?a:void 0},"H"),me=d(s=>{let{toolCalls:t}=s;return Array.isArray(t)?t.map(a=>a!==null&&typeof a=="object"?a.name:void 0).filter(a=>typeof a=="string"):[]},"de"),ue=d(s=>{switch(s){case"awaiting_input":return"warning";case"cancelled":return"warning";case"error":return"destructive";case"running":return"info";default:return"outline"}},"le"),he=d(s=>{switch(s){case"approved":return"success";case"rejected":return"destructive";default:return"warning"}},"ie"),ge=d(s=>{let t=(0,Q.c)(3),{fetched:a}=s,m=T(),l;return t[0]!==a||t[1]!==m?(l=a<=N?null:(0,e.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"agents-messages-truncated",children:m("Showing the latest {count} messages; older ones are not shown.",{count:N})}),t[0]=a,t[1]=m,t[2]=l):l=t[2],l},"ce"),Te=d(({initialShardKey:s=""})=>{let t=T(),[a,m]=(0,G.useState)(void 0),{data:l}=h(g.listTables,le,{live:!0,shardKey:s}),V=l!==void 0,f=Array.isArray(l)&&l.some(r=>r.name===H),W=Array.isArray(l)&&l.some(r=>r.name===L),{data:E,error:X,errorSource:Y,liveError:Z}=h(g.readTablePage,ce,{enabled:f,live:!0,shardKey:s}),ee={filters:[{column:"threadKey",operator:"eq",value:a??""}],limit:N+1,offset:0,orderBy:{column:"seq",direction:"desc"},skipCount:!0,table:de},{data:P}=h(g.readTablePage,{limit:J,offset:0,orderBy:{column:"position",direction:"asc"},skipCount:!0,table:L},{enabled:W,live:!0,shardKey:s}),{data:U,error:te,errorSource:ae}=h(g.readTablePage,ee,{enabled:f&&a!==void 0,live:!0,shardKey:s}),b=Array.isArray(E?.rows)?E.rows:[],re=Array.isArray(P?.rows)?P.rows:[],z=d(r=>re.filter(n=>c(n,"threadKey")===r).length,"C"),M=Array.isArray(U?.rows)?U.rows:[],R=M.slice(0,N).toReversed(),D=b.find(r=>c(r,"key")===a),x;return V&&!f?x=(0,e.jsx)($,{description:t("No @lunora/agent tables found in this deployment. Add lunora/agents.ts with defineAgent(...) and merge the agent schema extension to run durable AI agents."),testId:"agents-unconfigured",title:t("No agents configured")}):f&&b.length===0?x=(0,e.jsx)($,{description:t("No agent has run yet. Start a run with ctx.agents.<name>.run(...) and its thread appears here."),testId:"agents-empty",title:t("No agent threads yet")}):x=(0,e.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,e.jsx)(K,{className:"overflow-hidden py-0",children:(0,e.jsx)(S,{className:"px-0",children:(0,e.jsxs)(I,{"data-testid":"agents-threads-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(o,{children:t("Agent")}),(0,e.jsx)(o,{children:t("Key")}),(0,e.jsx)(o,{children:t("Status")}),(0,e.jsx)(o,{children:t("Queued")}),(0,e.jsx)(o,{children:t("Messages")}),(0,e.jsx)(o,{children:t("Tokens")}),(0,e.jsx)(o,{children:t("Updated")}),(0,e.jsx)(o,{"aria-label":t("Actions")})]})}),(0,e.jsx)(q,{children:b.map(r=>{let n=c(r,"key")??"",u=c(r,"status"),y=O(r);return(0,e.jsxs)(p,{"data-active":n===a?"":void 0,"data-testid":`agents-thread-${n}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs",children:c(r,"agent")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs text-muted-foreground",children:n}),(0,e.jsx)(i,{children:(0,e.jsx)(v,{"data-testid":`agents-thread-status-${n}`,variant:ue(u),children:u??"\u2014"})}),(0,e.jsx)(i,{className:"tabular-nums",children:z(n)===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)(v,{"data-testid":`agents-thread-queued-${n}`,variant:"warning",children:z(n)})}),(0,e.jsx)(i,{className:"tabular-nums",children:B(r,"messageCount")??"\u2014"}),(0,e.jsx)(i,{className:"tabular-nums text-muted-foreground",children:y??"\u2014"}),(0,e.jsx)(i,{className:"text-muted-foreground tabular-nums",children:F(B(r,"updatedAt"),"\u2014")}),(0,e.jsx)(i,{className:"text-right",children:(0,e.jsx)(C,{"data-testid":`agents-thread-open-${n}`,onClick:d(()=>{m(n)},"onClick"),size:"sm",type:"button",variant:"outline",children:t("Timeline")})})]},n)})})]})})}),te!==null&&(0,e.jsx)(j,{error:ae,shardKey:s,testId:"agents-messages-error"}),a!==void 0&&(0,e.jsx)(K,{className:"overflow-hidden py-0","data-testid":"agents-thread-detail",children:(0,e.jsxs)(S,{className:"flex flex-col gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t("Timeline")," \xB7 ",a,D!==void 0&&(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" \xB7 ",t("Usage"),": ",O(D)??0," ",t("Tokens")]})]}),(0,e.jsx)(C,{"data-testid":"agents-thread-detail-close",onClick:d(()=>{m(void 0)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Close")})]}),(0,e.jsx)(ge,{fetched:M.length}),R.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:t("This thread has no messages yet.")}):(0,e.jsxs)(I,{"data-testid":"agents-messages-table",children:[(0,e.jsx)(_,{children:(0,e.jsxs)(p,{children:[(0,e.jsx)(o,{children:t("Role")}),(0,e.jsx)(o,{children:t("Content")}),(0,e.jsx)(o,{children:t("Tool")}),(0,e.jsx)(o,{children:t("Approval")})]})}),(0,e.jsx)(q,{children:R.map((r,n)=>{let u=c(r,"role")??"\u2014",y=me(r),se=c(r,"toolName"),w=c(r,"status"),A=B(r,"seq")??n;return(0,e.jsxs)(p,{"data-testid":`agents-message-${String(A)}`,children:[(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:u}),(0,e.jsx)(i,{className:"max-w-md font-mono text-xs whitespace-pre-wrap break-words",children:c(r,"content")??"\u2014"}),(0,e.jsx)(i,{className:"font-mono text-xs align-top text-muted-foreground",children:se??(y.length>0?y.join(", "):"\u2014")}),(0,e.jsx)(i,{className:"align-top",children:w===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"\u2014"}):(0,e.jsx)(v,{"data-testid":`agents-message-approval-${String(A)}`,variant:he(w),children:w})})]},c(r,"messageKey")??`${u}:${String(A)}`)})})]})]})})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-agents-panel",children:[X!==null&&(0,e.jsx)(j,{error:Y,shardKey:s,testId:"agents-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Agents run as durable workflows. Each run persists a thread of assistant and tool messages; select a thread to inspect its timeline, tool calls, approvals, and token usage.")}),Z!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"agents-live-error",role:"alert",children:t("Live updates unavailable; showing the last evaluation.")}),x]})},"Ee");export{Te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ke}from"./chunk-Y4QFNP4R.js";import{g as we}from"./chunk-OIZPNC33.js";import"./chunk-GXTSE66Z.js";import"./chunk-6ONPEGTC.js";import"./chunk-CL3JOU6F.js";import{a as ne}from"./chunk-ARYARX6T.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-XLCYVOJY.js";import"./chunk-QAOZXPLU.js";import"./chunk-DA2CAFXI.js";import{a as ue}from"./chunk-HZK2UJ3K.js";import"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import{i as ye}from"./chunk-NMQDQNDF.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as me}from"./chunk-UQHDIACF.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as de}from"./chunk-ZMBRGW6J.js";import{b as oe}from"./chunk-7TWHRQXV.js";import"./chunk-YUVGMKHG.js";import{a as re,b as le,c as ae,d as B,e as S,f as J}from"./chunk-ZYXDE5GW.js";import"./chunk-TRYQANZO.js";import"./chunk-4PI2OSSP.js";import"./chunk-2W4UO5BC.js";import{b as te}from"./chunk-C4IDZOYU.js";import{a as Q,e as X}from"./chunk-X3BATMFU.js";import{m as se}from"./chunk-N5AFTHW5.js";import"./chunk-ZPQBVYNN.js";import{B as V,j as ce,k as ge,s as G,w as ee,x as Ne}from"./chunk-SGHIB7TS.js";import"./chunk-PDBW6GTJ.js";import{a as ve}from"./chunk-GWNGVKLG.js";import{a as xe,b as be}from"./chunk-6G3E4PJ2.js";import{a as b,d as ie}from"./chunk-5PEAXTYQ.js";var Y=ie(ve(),1),U=ie(xe(),1);var t=ie(be(),1);var Ce=ie(ve(),1),he=ie(xe(),1);var F=ie(be(),1);var Ae=b(r=>Number.isFinite(r)?ee(r,"\u2014"):"\u2014","X"),je=b(r=>r.toSorted((e,u)=>e.scheduledFor-u.scheduledFor),"F"),Ie=b((r,e,u)=>e!==void 0?e:u===void 0?a=>r.cancelScheduledJob(a):void 0,"Y"),Se=b(r=>{let e=(0,Ce.c)(16),{cancelJob:u,loadJobs:a}=r===void 0?{}:r,o=se(),l=V(),n=a===void 0,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=["lunora-scheduled-jobs"],e[0]=s):s=e[0];let N=te(s,async()=>{let p=await(a??(()=>o.listScheduledJobs()))();return je(p)}),[y,i]=(0,he.useState)(void 0),[h,g]=(0,he.useState)(void 0),v,f;e[1]!==o||e[2]!==n?(v=b(()=>{if(n)return o.subscribeScheduledJobs(p=>{g(void 0),i(je(p))})},"v"),f=[n,o],e[1]=o,e[2]=n,e[3]=v,e[4]=f):(v=e[3],f=e[4]),(0,he.useEffect)(v,f);let d;e[5]!==N?(d=b(()=>N.poll(),"y"),e[5]=N,e[6]=d):d=e[6],ne(d,!n);let c=Ie(o,u,a),m=y??N.data,k=h??N.error,w=b(async p=>{if(c!==void 0){g(void 0);try{await c(p),n||N.refetch()}catch(L){g(ce(L))}}},"E"),T="flex flex-col gap-3",j="lunora-scheduled-jobs",$;e[7]!==k?($=k!==null&&(0,F.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:k}),e[7]=k,e[8]=$):$=e[8];let C;e[9]!==m?.length||e[10]!==l?(C=m?.length===0&&(0,F.jsx)(de,{description:l("Jobs queued with runAfter / runAt will appear here."),icon:(0,F.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,F.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,F.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:l("No scheduled jobs.")}),e[9]=m?.length,e[10]=l,e[11]=C):C=e[11];let I=m!==void 0&&m.length>0&&(0,F.jsx)(Q,{className:"overflow-hidden py-0",children:(0,F.jsx)(X,{className:"px-0",children:(0,F.jsxs)(re,{"data-testid":"sj-table",children:[(0,F.jsx)(le,{children:(0,F.jsxs)(B,{children:[(0,F.jsx)(S,{children:l("function")}),(0,F.jsx)(S,{children:l("scheduled for")}),(0,F.jsx)(S,{children:l("pool")}),(0,F.jsx)(S,{children:l("attempts")}),(0,F.jsx)(S,{children:l("shard")}),(0,F.jsx)(S,{children:l("id")}),c!==void 0&&(0,F.jsx)(S,{"aria-label":l("Actions")})]})}),(0,F.jsx)(ae,{children:m.map(p=>(0,F.jsxs)(B,{"data-testid":`sj-row-${p.id}`,children:[(0,F.jsx)(J,{className:"font-mono text-xs",children:p.workflow??p.functionPath}),(0,F.jsx)(J,{className:"text-muted-foreground tabular-nums",children:Ae(p.scheduledFor)}),(0,F.jsx)(J,{className:"font-mono text-xs",children:p.pool??""}),(0,F.jsx)(J,{className:"tabular-nums",children:p.attempts??0}),(0,F.jsx)(J,{children:p.shardKey??""}),(0,F.jsx)(J,{className:"font-mono text-xs",children:p.id}),c!==void 0&&(0,F.jsx)(J,{className:"text-right",children:(0,F.jsx)(ue,{confirmLabel:l("Cancel job?"),onConfirm:b(()=>{G(w(p.id))},"onConfirm"),testId:`sj-cancel-${p.id}`,children:l("Cancel")})})]},p.id))})]})})}),A;return e[12]!==I||e[13]!==$||e[14]!==C?(A=(0,F.jsxs)("div",{className:T,"data-testid":j,children:[$,C,I]}),e[12]=I,e[13]=$,e[14]=C,e[15]=A):A=e[15],A},"he");var Je={failed:"destructive",skipped:"warning",succeeded:"success"},Le=25,Te=b(r=>r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(1)} s`,"we"),Fe=b(r=>{let e=(0,Y.c)(39),{inFlight:u,last:a}=r,o=V();if(u!==void 0){let c;e[0]!==o?(c=o("running"),e[0]=o,e[1]=c):c=e[1];let m;e[2]!==c?(m=(0,t.jsx)(oe,{variant:"info",children:c}),e[2]=c,e[3]=m):m=e[3];let k;e[4]!==u.startedAt?(k=ee(u.startedAt,"\u2014"),e[4]=u.startedAt,e[5]=k):k=e[5];let w;e[6]!==k?(w=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:k}),e[6]=k,e[7]=w):w=e[7];let T;e[8]!==u.skipped||e[9]!==o?(T=u.skipped>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("{count} ticks skipped",{count:u.skipped})}),e[8]=u.skipped,e[9]=o,e[10]=T):T=e[10];let j;return e[11]!==m||e[12]!==w||e[13]!==T?(j=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[m,w,T]}),e[11]=m,e[12]=w,e[13]=T,e[14]=j):j=e[14],j}if(a===void 0){let c;e[15]!==o?(c=o("never"),e[15]=o,e[16]=c):c=e[16];let m;return e[17]!==c?(m=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c}),e[17]=c,e[18]=m):m=e[18],m}let l;e[19]!==o?(l=o("failed"),e[19]=o,e[20]=l):l=e[20];let n;e[21]!==o?(n=o("skipped"),e[21]=o,e[22]=n):n=e[22];let s;e[23]!==o?(s=o("succeeded"),e[23]=o,e[24]=s):s=e[24];let N;e[25]!==l||e[26]!==n||e[27]!==s?(N={failed:l,skipped:n,succeeded:s},e[25]=l,e[26]=n,e[27]=s,e[28]=N):N=e[28];let y=N,i=Je[a.status],h=y[a.status],g;e[29]!==i||e[30]!==h?(g=(0,t.jsx)(oe,{variant:i,children:h}),e[29]=i,e[30]=h,e[31]=g):g=e[31];let v;e[32]!==a.startedAt?(v=ee(a.startedAt,"\u2014"),e[32]=a.startedAt,e[33]=v):v=e[33];let f;e[34]!==v?(f=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:v}),e[34]=v,e[35]=f):f=e[35];let d;return e[36]!==g||e[37]!==f?(d=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[g,f]}),e[36]=g,e[37]=f,e[38]=d):d=e[38],d},"ke"),De=b(r=>{let e=(0,Y.c)(80),{runs:u}=r,a=V();if(u.length===0)return;let o,l,n,s,N,y,i,h,g,v,f;if(e[0]!==u||e[1]!==a){let T=u.toSorted(qe).slice(0,Le),j;e[13]!==a?(j=a("failed"),e[13]=a,e[14]=j):j=e[14];let $;e[15]!==a?($=a("skipped"),e[15]=a,e[16]=$):$=e[16];let C;e[17]!==a?(C=a("succeeded"),e[17]=a,e[18]=C):C=e[18];let I;e[19]!==C||e[20]!==j||e[21]!==$?(I={failed:j,skipped:$,succeeded:C},e[19]=C,e[20]=j,e[21]=$,e[22]=I):I=e[22];let A=I;g="flex flex-col gap-2",v="cron-run-history";let p;e[23]!==a?(p=a("Recent runs"),e[23]=a,e[24]=p):p=e[24],e[25]!==p?(f=(0,t.jsx)("h3",{className:"text-sm font-medium",children:p}),e[25]=p,e[26]=f):f=e[26],s=Q,h="overflow-hidden py-0",n=X,i="px-0",l=re;let L;e[27]!==a?(L=a("name"),e[27]=a,e[28]=L):L=e[28];let x;e[29]!==L?(x=(0,t.jsx)(S,{children:L}),e[29]=L,e[30]=x):x=e[30];let D;e[31]!==a?(D=a("status"),e[31]=a,e[32]=D):D=e[32];let E;e[33]!==D?(E=(0,t.jsx)(S,{children:D}),e[33]=D,e[34]=E):E=e[34];let R;e[35]!==a?(R=a("started"),e[35]=a,e[36]=R):R=e[36];let P;e[37]!==R?(P=(0,t.jsx)(S,{children:R}),e[37]=R,e[38]=P):P=e[38];let Z;e[39]!==a?(Z=a("duration"),e[39]=a,e[40]=Z):Z=e[40];let O;e[41]!==Z?(O=(0,t.jsx)(S,{children:Z}),e[41]=Z,e[42]=O):O=e[42];let H;e[43]!==a?(H=a("skipped"),e[43]=a,e[44]=H):H=e[44];let _;e[45]!==H?(_=(0,t.jsx)(S,{children:H}),e[45]=H,e[46]=_):_=e[46];let z;e[47]!==a?(z=a("error"),e[47]=a,e[48]=z):z=e[48];let K;e[49]!==z?(K=(0,t.jsx)(S,{children:z}),e[49]=z,e[50]=K):K=e[50],e[51]!==x||e[52]!==E||e[53]!==P||e[54]!==O||e[55]!==_||e[56]!==K?(y=(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[x,E,P,O,_,K]})}),e[51]=x,e[52]=E,e[53]=P,e[54]=O,e[55]=_,e[56]=K,e[57]=y):y=e[57],o=ae;let W;e[58]!==A?(W=b(M=>(0,t.jsxs)(B,{"data-testid":`cron-run-row-${M.runId}`,children:[(0,t.jsx)(J,{children:M.name}),(0,t.jsx)(J,{children:(0,t.jsx)(oe,{variant:Je[M.status],children:A[M.status]})}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:ee(M.startedAt,"\u2014")}),(0,t.jsx)(J,{className:"tabular-nums",children:M.status==="skipped"?"":Te(M.durationMs)}),(0,t.jsx)(J,{className:"tabular-nums",children:M.skipped>0?M.skipped:""}),(0,t.jsx)(J,{className:"text-xs text-destructive",children:M.error??""})]},M.runId),"B"),e[58]=A,e[59]=W):W=e[59],N=T.map(W),e[0]=u,e[1]=a,e[2]=o,e[3]=l,e[4]=n,e[5]=s,e[6]=N,e[7]=y,e[8]=i,e[9]=h,e[10]=g,e[11]=v,e[12]=f}else o=e[2],l=e[3],n=e[4],s=e[5],N=e[6],y=e[7],i=e[8],h=e[9],g=e[10],v=e[11],f=e[12];let d;e[60]!==o||e[61]!==N?(d=(0,t.jsx)(o,{children:N}),e[60]=o,e[61]=N,e[62]=d):d=e[62];let c;e[63]!==l||e[64]!==y||e[65]!==d?(c=(0,t.jsxs)(l,{children:[y,d]}),e[63]=l,e[64]=y,e[65]=d,e[66]=c):c=e[66];let m;e[67]!==n||e[68]!==i||e[69]!==c?(m=(0,t.jsx)(n,{className:i,children:c}),e[67]=n,e[68]=i,e[69]=c,e[70]=m):m=e[70];let k;e[71]!==s||e[72]!==m||e[73]!==h?(k=(0,t.jsx)(s,{className:h,children:m}),e[71]=s,e[72]=m,e[73]=h,e[74]=k):k=e[74];let w;return e[75]!==k||e[76]!==g||e[77]!==v||e[78]!==f?(w=(0,t.jsxs)("div",{className:g,"data-testid":v,children:[f,k]}),e[75]=k,e[76]=g,e[77]=v,e[78]=f,e[79]=w):w=e[79],w},"Ce");function qe(r,e){return e.startedAt-r.startedAt}b(qe,"Te");var Re=b(()=>{let r=(0,Y.c)(50),e=V(),u=ke(""),[a,o]=(0,U.useState)(""),[l,n]=(0,U.useState)(void 0),[s,N]=(0,U.useState)(!1);if(u.unavailable)return null;let y;r[0]!==u?(y=u.pending("cron"),r[0]=u,r[1]=y):y=r[1];let i=y,h;r[2]!==u?(h=u.reason("cron"),r[2]=u,r[3]=h):h=r[3];let g=h,v;r[4]!==a||r[5]!==u?(v=b(()=>{let R=a.trim();R!==""&&G((async()=>{let P=await u.suggestCron(R);N(!1),n(P)})())},"x"),r[4]=a,r[5]=u,r[6]=v):v=r[6];let f=v,d;r[7]!==l?(d=b(()=>{let R="navigator"in globalThis?globalThis.navigator.clipboard:void 0;R===void 0||l===void 0||G((async()=>{try{await R.writeText(l),N(!0)}catch{N(!1)}})())},"o"),r[7]=l,r[8]=d):d=r[8];let c=d,m;r[9]!==e?(m=e("Describe a schedule"),r[9]=e,r[10]=m):m=r[10];let k;r[11]===Symbol.for("react.memo_cache_sentinel")?(k=b(R=>{o(R.target.value)},"b"),r[11]=k):k=r[11];let w;r[12]!==f?(w=b(R=>{R.key==="Enter"&&(R.preventDefault(),f())},"y"),r[12]=f,r[13]=w):w=r[13];let T;r[14]!==e?(T=e("Describe a schedule"),r[14]=e,r[15]=T):T=r[15];let j;r[16]!==i||r[17]!==a||r[18]!==m||r[19]!==w||r[20]!==T?(j=(0,t.jsx)(ye,{"aria-label":m,className:"h-7 flex-1 text-xs","data-testid":"cron-assistant-prompt",disabled:i,onChange:k,onKeyDown:w,placeholder:T,value:a}),r[16]=i,r[17]=a,r[18]=m,r[19]=w,r[20]=T,r[21]=j):j=r[21];let $=i&&"opacity-60",C;r[22]!==$?(C=Ne("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",$),r[22]=$,r[23]=C):C=r[23];let I;r[24]!==i||r[25]!==a?(I=i||a.trim()==="",r[24]=i,r[25]=a,r[26]=I):I=r[26];let A;r[27]!==i||r[28]!==e?(A=e(i?"Thinking\u2026":"Suggest schedule"),r[27]=i,r[28]=e,r[29]=A):A=r[29];let p;r[30]!==f||r[31]!==C||r[32]!==I||r[33]!==A?(p=(0,t.jsx)("button",{className:C,"data-testid":"cron-assistant-generate",disabled:I,onClick:f,type:"button",children:A}),r[30]=f,r[31]=C,r[32]=I,r[33]=A,r[34]=p):p=r[34];let L;r[35]!==p||r[36]!==j?(L=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[j,p]}),r[35]=p,r[36]=j,r[37]=L):L=r[37];let x;r[38]!==s||r[39]!==c||r[40]!==l||r[41]!==e?(x=l!==void 0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs tabular-nums","data-testid":"cron-assistant-result",children:l}),(0,t.jsx)("button",{className:"rounded-md border border-border px-2 py-0.5 text-[11px] outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cron-assistant-copy",onClick:c,type:"button",children:e(s?"Copied":"Copy")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e("Add it to lunora/crons.ts \u2014 triggers are compiled into the worker.")})]}),r[38]=s,r[39]=c,r[40]=l,r[41]=e,r[42]=x):x=r[42];let D;r[43]!==g||r[44]!==e?(D=g!==void 0&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"cron-assistant-reason",role:"status",children:e(g==="ai-error"?"The model could not be reached.":"The model did not return a schedule Cron Triggers accept.")}),r[43]=g,r[44]=e,r[45]=D):D=r[45];let E;return r[46]!==L||r[47]!==x||r[48]!==D?(E=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"cron-assistant",children:[L,x,D]}),r[46]=L,r[47]=x,r[48]=D,r[49]=E):E=r[49],E},"Se"),Ee={kind:"idle"},Me="SCHEDULER_NOT_CONFIGURED",pe={inFlight:[],runs:[]},Be=b((r,e,u)=>u!==void 0?u:e===void 0?a=>r.runCronJob(a):void 0,"Ae"),Pe=b(({loadCronJobs:r,loadCronRuns:e,runCronJob:u}={})=>{let a=se(),o=V(),[l,n]=(0,U.useState)({}),s=te(["lunora-cron-jobs",r?"custom":"default"],()=>(r??(()=>a.getCronJobs()))()),{data:N,error:y}=s,i=e??(r===void 0?()=>a.listCronRuns():void 0),h=te(["lunora-cron-runs",e?"custom":"default"],async()=>i===void 0?pe:i().catch(d=>{if(ge(d)===Me)return pe;throw d})),g=h.data??pe;ne(()=>h.poll(),i!==void 0);let v=Be(a,r,u),f=b(async d=>{if(v!==void 0){n(c=>({...c,[d]:{kind:"running"}}));try{await v(d),n(c=>({...c,[d]:{kind:"ok"}})),s.refetch(),h.refetch()}catch(c){n(m=>({...m,[d]:{kind:"error",message:ce(c)}}))}}},"p");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[(0,t.jsx)(Re,{}),y!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:y}),h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-runs-error",role:"alert",children:h.error}),N?.length===0&&(0,t.jsx)(de,{description:o("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:o("No cron triggers.")}),N!==void 0&&N.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"cron-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:o("name")}),(0,t.jsx)(S,{children:o("schedule")}),(0,t.jsx)(S,{children:o("target")}),(0,t.jsx)(S,{children:o("shard")}),(0,t.jsx)(S,{children:o("last run")}),v!==void 0&&(0,t.jsx)(S,{"aria-label":o("Actions")})]})}),(0,t.jsx)(ae,{children:N.map(d=>{let c=l[d.name]??Ee;return(0,t.jsxs)(B,{"data-testid":`cron-row-${d.name}`,children:[(0,t.jsx)(J,{children:d.name}),(0,t.jsx)(J,{className:"font-mono text-xs tabular-nums",children:d.cron}),(0,t.jsx)(J,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[d.workflow===void 0?(0,t.jsx)(oe,{variant:"outline",children:o("function")}):(0,t.jsx)(oe,{variant:"secondary",children:o("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:d.workflow??d.functionPath})]})}),(0,t.jsx)(J,{children:d.shardKey??""}),(0,t.jsx)(J,{"data-testid":`cron-last-run-${d.name}`,children:(0,t.jsx)(Fe,{inFlight:g.inFlight.find(m=>m.name===d.name),last:g.runs.find(m=>m.name===d.name)})}),v!==void 0&&(0,t.jsx)(J,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[c.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${d.name}`,children:o("ran")}),c.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${d.name}`,role:"alert",children:c.message}),(0,t.jsx)(ue,{confirmLabel:o("Run now?"),disabled:c.kind==="running",onConfirm:b(()=>{G(f(d.name))},"onConfirm"),testId:`cron-run-${d.name}`,children:c.kind==="running"?o("Running\u2026"):o("Run now")})]})})]},`${d.cron}:${d.name}`)})})]})})}),(0,t.jsx)(De,{runs:g.runs})]})},"Le"),He=b(r=>Number.isFinite(r)?ee(r,"\u2014"):"\u2014","Re"),Ke=b(r=>{let e=(0,Y.c)(34),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadJobs:a,removeJob:o,retryJob:l}=u,n=se(),s=V(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let y;e[3]!==n||e[4]!==a?(y=b(async()=>(await(a??(()=>n.listDeadJobs()))()).toSorted(We),"v"),e[3]=n,e[4]=a,e[5]=y):y=e[5];let i=te(N,y),h=i.data,[g,v]=(0,U.useState)(void 0),f=i.error??g,d=a===void 0,c;e[6]!==n||e[7]!==d||e[8]!==l?(c=l??(d?x=>n.retryDeadJob(x):void 0),e[6]=n,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m=c,k;e[10]!==n||e[11]!==d||e[12]!==o?(k=o??(d?x=>n.removeDeadJob(x):void 0),e[10]=n,e[11]=d,e[12]=o,e[13]=k):k=e[13];let w=k,T;e[14]!==i?(T=b(()=>i.poll(),"I"),e[14]=i,e[15]=T):T=e[15],ne(T,!0);let j;e[16]!==i?(j=b(async x=>{v(void 0);try{await x,i.refetch()}catch(D){v(ce(D))}},"w"),e[16]=i,e[17]=j):j=e[17];let $=j,C=m!==void 0||w!==void 0,I;e[18]!==f?(I=f!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:f}),e[18]=f,e[19]=I):I=e[19];let A;e[20]!==h?.length||e[21]!==s?(A=h?.length===0&&(0,t.jsx)(de,{description:s("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:s("No dead-letter jobs.")}),e[20]=h?.length,e[21]=s,e[22]=A):A=e[22];let p;e[23]!==$||e[24]!==C||e[25]!==h||e[26]!==w||e[27]!==m||e[28]!==s?(p=h!==void 0&&h.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"dlq-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:s("function")}),(0,t.jsx)(S,{children:s("attempts")}),(0,t.jsx)(S,{children:s("last tried")}),(0,t.jsx)(S,{children:s("pool")}),(0,t.jsx)(S,{children:s("shard")}),(0,t.jsx)(S,{children:s("id")}),C&&(0,t.jsx)(S,{"aria-label":s("Actions")})]})}),(0,t.jsx)(ae,{children:h.map(x=>(0,t.jsxs)(B,{"data-testid":`dlq-row-${x.id}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:x.workflow??x.functionPath}),(0,t.jsx)(J,{className:"tabular-nums",children:x.attempts??0}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:He(x.scheduledFor)}),(0,t.jsx)(J,{className:"font-mono text-xs",children:x.pool??""}),(0,t.jsx)(J,{children:x.shardKey??""}),(0,t.jsx)(J,{className:"font-mono text-xs",children:x.id}),C&&(0,t.jsx)(J,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[m!==void 0&&(0,t.jsx)(me,{"data-testid":`dlq-retry-${x.id}`,onClick:b(()=>{G($(m(x.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:s("Retry")}),w!==void 0&&(0,t.jsx)(ue,{confirmLabel:s("Drop job?"),onConfirm:b(()=>{G($(w(x.id)))},"onConfirm"),testId:`dlq-remove-${x.id}`,children:s("Drop")})]})})]},x.id))})]})})}),e[23]=$,e[24]=C,e[25]=h,e[26]=w,e[27]=m,e[28]=s,e[29]=p):p=e[29];let L;return e[30]!==p||e[31]!==I||e[32]!==A?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[I,A,p]}),e[30]=p,e[31]=I,e[32]=A,e[33]=L):L=e[33],L},"De");function We(r,e){return(e.attempts??0)-(r.attempts??0)}b(We,"Ee");var Ve={canceled:"secondary",failed:"destructive",pending:"outline",running:"info",succeeded:"success"},_e=b(r=>{let e=(0,Y.c)(47),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadJobs:a}=u,o=se(),l=V(),n;e[2]!==o||e[3]!==a?(n=a??(async q=>o.listScheduledHistory(q===void 0?{}:{cursor:q})),e[2]=o,e[3]=a,e[4]=n):n=e[4];let s=n,N=a?"custom":"default",y;e[5]!==N?(y=["lunora-job-history",N],e[5]=N,e[6]=y):y=e[6];let i;e[7]!==s?(i=b(async()=>s(),"d"),e[7]=s,e[8]=i):i=e[8];let h=te(y,i),[g,v]=(0,U.useState)(void 0),[f,d]=(0,U.useState)(!1),[c,m]=(0,U.useState)(void 0),k=h.data?.records,w;e[9]!==k?(w=new Set(k?.map(ze)),e[9]=k,e[10]=w):w=e[10];let T=w,j=k===void 0?void 0:[...k,...(g?.records??[]).filter(q=>!T.has(q.id))],$=g===void 0?h.data?.cursor:g.cursor,C;e[11]!==s||e[12]!==$?(C=b(async()=>{d(!0),m(void 0);try{let q=await s($);v($e=>({cursor:q.cursor,records:[...$e?.records??[],...q.records]})),d(!1)}catch(q){m(ce(q)),d(!1)}},"S"),e[11]=s,e[12]=$,e[13]=C):C=e[13];let I=C,A;e[14]!==l?(A=l("canceled"),e[14]=l,e[15]=A):A=e[15];let p;e[16]!==l?(p=l("failed"),e[16]=l,e[17]=p):p=e[17];let L;e[18]!==l?(L=l("pending"),e[18]=l,e[19]=L):L=e[19];let x;e[20]!==l?(x=l("running"),e[20]=l,e[21]=x):x=e[21];let D;e[22]!==l?(D=l("succeeded"),e[22]=l,e[23]=D):D=e[23];let E;e[24]!==L||e[25]!==x||e[26]!==D||e[27]!==A||e[28]!==p?(E={canceled:A,failed:p,pending:L,running:x,succeeded:D},e[24]=L,e[25]=x,e[26]=D,e[27]=A,e[28]=p,e[29]=E):E=e[29];let R=E,P;e[30]!==h?(P=b(()=>h.poll(),"P"),e[30]=h,e[31]=P):P=e[31],ne(P,g===void 0);let Z="flex flex-col gap-3",O="lunora-job-history",H;e[32]!==h.error?(H=h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"job-history-error",role:"alert",children:h.error}),e[32]=h.error,e[33]=H):H=e[33];let _=j?.length===0&&(0,t.jsx)(de,{description:l("Jobs that succeed, fail or are cancelled stay here for seven days."),testId:"job-history-empty",title:l("No finished jobs.")}),z=j!==void 0&&j.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"job-history-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:l("function")}),(0,t.jsx)(S,{children:l("state")}),(0,t.jsx)(S,{children:l("finished")}),(0,t.jsx)(S,{children:l("error")}),(0,t.jsx)(S,{children:l("id")})]})}),(0,t.jsx)(ae,{children:j.map(q=>(0,t.jsxs)(B,{"data-testid":`job-history-row-${q.id}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:q.workflow??q.functionPath}),(0,t.jsx)(J,{children:(0,t.jsx)(oe,{"data-testid":`job-history-state-${q.id}`,variant:Ve[q.state],children:R[q.state]})}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:ee(q.completedAt,"\u2014")}),(0,t.jsx)(J,{className:"text-xs text-destructive",children:q.error??""}),(0,t.jsx)(J,{className:"font-mono text-xs",children:q.id})]},q.id))})]})})}),K;e[34]!==c?(K=c!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:c}),e[34]=c,e[35]=K):K=e[35];let W;e[36]!==f||e[37]!==$||e[38]!==I||e[39]!==l?(W=$!==void 0&&(0,t.jsx)("div",{children:(0,t.jsx)(me,{"data-testid":"job-history-load-more",disabled:f,onClick:b(()=>{G(I())},"onClick"),variant:"outline",children:l(f?"Loading\u2026":"Load more")})}),e[36]=f,e[37]=$,e[38]=I,e[39]=l,e[40]=W):W=e[40];let M;return e[41]!==H||e[42]!==_||e[43]!==z||e[44]!==K||e[45]!==W?(M=(0,t.jsxs)("div",{className:Z,"data-testid":O,children:[H,_,z,K,W]}),e[41]=H,e[42]=_,e[43]=z,e[44]=K,e[45]=W,e[46]=M):M=e[46],M},"Je");function ze(r){return r.id}b(ze,"Fe");var fe=b(r=>{let e=(0,Y.c)(8),{label:u,testId:a,value:o}=r,l;e[0]!==u?(l=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),e[0]=u,e[1]=l):l=e[1];let n;e[2]!==a||e[3]!==o?(n=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":a,children:o}),e[2]=a,e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==l||e[6]!==n?(s=(0,t.jsx)(Q,{className:"flex-1 py-0",children:(0,t.jsxs)(X,{className:"flex flex-col gap-1 p-4",children:[l,n]})}),e[5]=l,e[6]=n,e[7]=s):s=e[7],s},"de"),Ue=b(r=>{let e=(0,Y.c)(25),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadStatus:a}=u,o=se(),l=V(),n=a===void 0,s;e[2]!==n?(s=["lunora-scheduler-status",n],e[2]=n,e[3]=s):s=e[3];let N;e[4]!==o||e[5]!==a?(N=b(async()=>{let k=await(a??(()=>o.schedulerStatus()))();return{...k,pools:k.pools.toSorted(Ge)}},"N"),e[4]=o,e[5]=a,e[6]=N):N=e[6];let y=te(s,N),{data:i,error:h}=y,g;e[7]!==y?(g=b(()=>y.poll(),"g"),e[7]=y,e[8]=g):g=e[8],ne(g,!0);let v;e[9]!==h?(v=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:h}),e[9]=h,e[10]=v):v=e[10];let f;e[11]!==i||e[12]!==l?(f=i!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(fe,{label:l("backlog"),testId:"pools-backlog",value:i.backlog}),(0,t.jsx)(fe,{label:l("in flight"),testId:"pools-inflight",value:i.inFlight}),(0,t.jsx)(fe,{label:l("pools"),testId:"pools-count",value:i.pools.length})]}),e[11]=i,e[12]=l,e[13]=f):f=e[13];let d;e[14]!==i?.pools.length||e[15]!==l?(d=i?.pools.length===0&&(0,t.jsx)(de,{description:l("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:l("No workpools.")}),e[14]=i?.pools.length,e[15]=l,e[16]=d):d=e[16];let c;e[17]!==i||e[18]!==l?(c=i!==void 0&&i.pools.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"pools-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:l("pool")}),(0,t.jsx)(S,{children:l("queued")}),(0,t.jsx)(S,{children:l("in flight")}),(0,t.jsx)(S,{children:l("max concurrency")})]})}),(0,t.jsx)(ae,{children:i.pools.map(Qe)})]})})}),e[17]=i,e[18]=l,e[19]=c):c=e[19];let m;return e[20]!==v||e[21]!==f||e[22]!==d||e[23]!==c?(m=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[v,f,d,c]}),e[20]=v,e[21]=f,e[22]=d,e[23]=c,e[24]=m):m=e[24],m},"Oe");function Ge(r,e){return e.queued-r.queued}b(Ge,"Pe");function Qe(r){return(0,t.jsxs)(B,{"data-testid":`pools-row-${r.name}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:r.name}),(0,t.jsx)(J,{className:"tabular-nums",children:r.queued}),(0,t.jsxs)(J,{className:"tabular-nums",children:[r.inFlight," / ",r.maxConcurrency]}),(0,t.jsx)(J,{className:"tabular-nums",children:r.maxConcurrency})]},r.name)}b(Qe,"qe");var Xe=["jobs","history","dead","pools","cron"],jt=b(r=>{let e=(0,Y.c)(48),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadCronJobs:a,scheduledCancel:o,scheduledLoad:l}=u,n=V(),[s,N]=(0,U.useState)("jobs"),y;e[2]!==n?(y=n("Cron triggers"),e[2]=n,e[3]=y):y=e[3];let i;e[4]!==n?(i=n("Dead letter"),e[4]=n,e[5]=i):i=e[5];let h;e[6]!==n?(h=n("History"),e[6]=n,e[7]=h):h=e[7];let g;e[8]!==n?(g=n("Scheduled jobs"),e[8]=n,e[9]=g):g=e[9];let v;e[10]!==n?(v=n("Pools"),e[10]=n,e[11]=v):v=e[11];let f;e[12]!==y||e[13]!==i||e[14]!==h||e[15]!==g||e[16]!==v?(f={cron:y,dead:i,history:h,jobs:g,pools:v},e[12]=y,e[13]=i,e[14]=h,e[15]=g,e[16]=v,e[17]=f):f=e[17];let d=f,c;e[18]===Symbol.for("react.memo_cache_sentinel")?(c=b(x=>{N(x.currentTarget.dataset.view)},"c"),e[18]=c):c=e[18];let m=c,k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsx)(we,{}),e[19]=k):k=e[19];let w;e[20]!==n?(w=n("Schedule view"),e[20]=n,e[21]=w):w=e[21];let T;e[22]!==s||e[23]!==d?(T=Xe.map(x=>(0,t.jsx)(me,{"aria-selected":s===x,"data-testid":`schedule-view-${x}`,"data-view":x,onClick:m,role:"tab",size:"sm",type:"button",variant:s===x?"default":"outline",children:d[x]},x)),e[22]=s,e[23]=d,e[24]=T):T=e[24];let j;e[25]!==w||e[26]!==T?(j=(0,t.jsx)("div",{"aria-label":w,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:T}),e[25]=w,e[26]=T,e[27]=j):j=e[27];let $;e[28]!==o||e[29]!==l||e[30]!==s?($=s==="jobs"&&(0,t.jsx)(Se,{cancelJob:o,loadJobs:l}),e[28]=o,e[29]=l,e[30]=s,e[31]=$):$=e[31];let C;e[32]!==s?(C=s==="history"&&(0,t.jsx)(_e,{}),e[32]=s,e[33]=C):C=e[33];let I;e[34]!==s?(I=s==="dead"&&(0,t.jsx)(Ke,{}),e[34]=s,e[35]=I):I=e[35];let A;e[36]!==s?(A=s==="pools"&&(0,t.jsx)(Ue,{}),e[36]=s,e[37]=A):A=e[37];let p;e[38]!==a||e[39]!==s?(p=s==="cron"&&(0,t.jsx)(Pe,{loadCronJobs:a}),e[38]=a,e[39]=s,e[40]=p):p=e[40];let L;return e[41]!==j||e[42]!==$||e[43]!==C||e[44]!==I||e[45]!==A||e[46]!==p?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[k,j,$,C,I,A,p]}),e[41]=j,e[42]=$,e[43]=C,e[44]=I,e[45]=A,e[46]=p,e[47]=L):L=e[47],L},"it");export{jt as SchedulePanel};
|
|
1
|
+
import{a as ke}from"./chunk-CHRUVO6R.js";import{g as we}from"./chunk-UUWJUMOH.js";import"./chunk-GXTSE66Z.js";import"./chunk-YPNUYWQA.js";import"./chunk-CL3JOU6F.js";import{a as ne}from"./chunk-XTU27CFW.js";import"./chunk-KTK4NDWQ.js";import"./chunk-XLYFGUEF.js";import"./chunk-D65UVZIA.js";import"./chunk-NGVP66OH.js";import"./chunk-HUFK6COH.js";import"./chunk-QAOZXPLU.js";import"./chunk-DA2CAFXI.js";import{a as ue}from"./chunk-VRBDHZHG.js";import"./chunk-ZSWW2UGP.js";import"./chunk-RTS5G3ET.js";import"./chunk-QRA7AKYO.js";import{i as ye}from"./chunk-EU4ZGNNW.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import{a as me}from"./chunk-PACPUEWB.js";import"./chunk-JMZT3CEW.js";import"./chunk-VUOEJJUH.js";import{a as de}from"./chunk-LJKB6B3H.js";import{b as oe}from"./chunk-SVFX7F32.js";import"./chunk-YUVGMKHG.js";import{a as re,b as le,c as ae,d as B,e as S,f as J}from"./chunk-J66QR7WA.js";import"./chunk-R47IHY6Y.js";import"./chunk-4PI2OSSP.js";import"./chunk-2W4UO5BC.js";import{b as te}from"./chunk-RL5SUZ6J.js";import{a as Q,e as X}from"./chunk-ZHH5ZUAS.js";import{m as se}from"./chunk-7AJWGPWM.js";import"./chunk-ZPQBVYNN.js";import{B as V,j as ce,k as ge,s as G,w as ee,x as Ne}from"./chunk-BVANRUU4.js";import"./chunk-PDBW6GTJ.js";import{a as ve}from"./chunk-GWNGVKLG.js";import{a as xe,b as be}from"./chunk-6G3E4PJ2.js";import{a as b,d as ie}from"./chunk-5PEAXTYQ.js";var Y=ie(ve(),1),U=ie(xe(),1);var t=ie(be(),1);var Ce=ie(ve(),1),he=ie(xe(),1);var F=ie(be(),1);var Ae=b(r=>Number.isFinite(r)?ee(r,"\u2014"):"\u2014","X"),je=b(r=>r.toSorted((e,u)=>e.scheduledFor-u.scheduledFor),"F"),Ie=b((r,e,u)=>e!==void 0?e:u===void 0?a=>r.cancelScheduledJob(a):void 0,"Y"),Se=b(r=>{let e=(0,Ce.c)(16),{cancelJob:u,loadJobs:a}=r===void 0?{}:r,o=se(),l=V(),n=a===void 0,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=["lunora-scheduled-jobs"],e[0]=s):s=e[0];let N=te(s,async()=>{let p=await(a??(()=>o.listScheduledJobs()))();return je(p)}),[y,i]=(0,he.useState)(void 0),[h,g]=(0,he.useState)(void 0),v,f;e[1]!==o||e[2]!==n?(v=b(()=>{if(n)return o.subscribeScheduledJobs(p=>{g(void 0),i(je(p))})},"v"),f=[n,o],e[1]=o,e[2]=n,e[3]=v,e[4]=f):(v=e[3],f=e[4]),(0,he.useEffect)(v,f);let d;e[5]!==N?(d=b(()=>N.poll(),"y"),e[5]=N,e[6]=d):d=e[6],ne(d,!n);let c=Ie(o,u,a),m=y??N.data,k=h??N.error,w=b(async p=>{if(c!==void 0){g(void 0);try{await c(p),n||N.refetch()}catch(L){g(ce(L))}}},"E"),T="flex flex-col gap-3",j="lunora-scheduled-jobs",$;e[7]!==k?($=k!==null&&(0,F.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:k}),e[7]=k,e[8]=$):$=e[8];let C;e[9]!==m?.length||e[10]!==l?(C=m?.length===0&&(0,F.jsx)(de,{description:l("Jobs queued with runAfter / runAt will appear here."),icon:(0,F.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,F.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,F.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:l("No scheduled jobs.")}),e[9]=m?.length,e[10]=l,e[11]=C):C=e[11];let I=m!==void 0&&m.length>0&&(0,F.jsx)(Q,{className:"overflow-hidden py-0",children:(0,F.jsx)(X,{className:"px-0",children:(0,F.jsxs)(re,{"data-testid":"sj-table",children:[(0,F.jsx)(le,{children:(0,F.jsxs)(B,{children:[(0,F.jsx)(S,{children:l("function")}),(0,F.jsx)(S,{children:l("scheduled for")}),(0,F.jsx)(S,{children:l("pool")}),(0,F.jsx)(S,{children:l("attempts")}),(0,F.jsx)(S,{children:l("shard")}),(0,F.jsx)(S,{children:l("id")}),c!==void 0&&(0,F.jsx)(S,{"aria-label":l("Actions")})]})}),(0,F.jsx)(ae,{children:m.map(p=>(0,F.jsxs)(B,{"data-testid":`sj-row-${p.id}`,children:[(0,F.jsx)(J,{className:"font-mono text-xs",children:p.workflow??p.functionPath}),(0,F.jsx)(J,{className:"text-muted-foreground tabular-nums",children:Ae(p.scheduledFor)}),(0,F.jsx)(J,{className:"font-mono text-xs",children:p.pool??""}),(0,F.jsx)(J,{className:"tabular-nums",children:p.attempts??0}),(0,F.jsx)(J,{children:p.shardKey??""}),(0,F.jsx)(J,{className:"font-mono text-xs",children:p.id}),c!==void 0&&(0,F.jsx)(J,{className:"text-right",children:(0,F.jsx)(ue,{confirmLabel:l("Cancel job?"),onConfirm:b(()=>{G(w(p.id))},"onConfirm"),testId:`sj-cancel-${p.id}`,children:l("Cancel")})})]},p.id))})]})})}),A;return e[12]!==I||e[13]!==$||e[14]!==C?(A=(0,F.jsxs)("div",{className:T,"data-testid":j,children:[$,C,I]}),e[12]=I,e[13]=$,e[14]=C,e[15]=A):A=e[15],A},"he");var Je={failed:"destructive",skipped:"warning",succeeded:"success"},Le=25,Te=b(r=>r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(1)} s`,"we"),Fe=b(r=>{let e=(0,Y.c)(39),{inFlight:u,last:a}=r,o=V();if(u!==void 0){let c;e[0]!==o?(c=o("running"),e[0]=o,e[1]=c):c=e[1];let m;e[2]!==c?(m=(0,t.jsx)(oe,{variant:"info",children:c}),e[2]=c,e[3]=m):m=e[3];let k;e[4]!==u.startedAt?(k=ee(u.startedAt,"\u2014"),e[4]=u.startedAt,e[5]=k):k=e[5];let w;e[6]!==k?(w=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:k}),e[6]=k,e[7]=w):w=e[7];let T;e[8]!==u.skipped||e[9]!==o?(T=u.skipped>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("{count} ticks skipped",{count:u.skipped})}),e[8]=u.skipped,e[9]=o,e[10]=T):T=e[10];let j;return e[11]!==m||e[12]!==w||e[13]!==T?(j=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[m,w,T]}),e[11]=m,e[12]=w,e[13]=T,e[14]=j):j=e[14],j}if(a===void 0){let c;e[15]!==o?(c=o("never"),e[15]=o,e[16]=c):c=e[16];let m;return e[17]!==c?(m=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c}),e[17]=c,e[18]=m):m=e[18],m}let l;e[19]!==o?(l=o("failed"),e[19]=o,e[20]=l):l=e[20];let n;e[21]!==o?(n=o("skipped"),e[21]=o,e[22]=n):n=e[22];let s;e[23]!==o?(s=o("succeeded"),e[23]=o,e[24]=s):s=e[24];let N;e[25]!==l||e[26]!==n||e[27]!==s?(N={failed:l,skipped:n,succeeded:s},e[25]=l,e[26]=n,e[27]=s,e[28]=N):N=e[28];let y=N,i=Je[a.status],h=y[a.status],g;e[29]!==i||e[30]!==h?(g=(0,t.jsx)(oe,{variant:i,children:h}),e[29]=i,e[30]=h,e[31]=g):g=e[31];let v;e[32]!==a.startedAt?(v=ee(a.startedAt,"\u2014"),e[32]=a.startedAt,e[33]=v):v=e[33];let f;e[34]!==v?(f=(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:v}),e[34]=v,e[35]=f):f=e[35];let d;return e[36]!==g||e[37]!==f?(d=(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[g,f]}),e[36]=g,e[37]=f,e[38]=d):d=e[38],d},"ke"),De=b(r=>{let e=(0,Y.c)(80),{runs:u}=r,a=V();if(u.length===0)return;let o,l,n,s,N,y,i,h,g,v,f;if(e[0]!==u||e[1]!==a){let T=u.toSorted(qe).slice(0,Le),j;e[13]!==a?(j=a("failed"),e[13]=a,e[14]=j):j=e[14];let $;e[15]!==a?($=a("skipped"),e[15]=a,e[16]=$):$=e[16];let C;e[17]!==a?(C=a("succeeded"),e[17]=a,e[18]=C):C=e[18];let I;e[19]!==C||e[20]!==j||e[21]!==$?(I={failed:j,skipped:$,succeeded:C},e[19]=C,e[20]=j,e[21]=$,e[22]=I):I=e[22];let A=I;g="flex flex-col gap-2",v="cron-run-history";let p;e[23]!==a?(p=a("Recent runs"),e[23]=a,e[24]=p):p=e[24],e[25]!==p?(f=(0,t.jsx)("h3",{className:"text-sm font-medium",children:p}),e[25]=p,e[26]=f):f=e[26],s=Q,h="overflow-hidden py-0",n=X,i="px-0",l=re;let L;e[27]!==a?(L=a("name"),e[27]=a,e[28]=L):L=e[28];let x;e[29]!==L?(x=(0,t.jsx)(S,{children:L}),e[29]=L,e[30]=x):x=e[30];let D;e[31]!==a?(D=a("status"),e[31]=a,e[32]=D):D=e[32];let E;e[33]!==D?(E=(0,t.jsx)(S,{children:D}),e[33]=D,e[34]=E):E=e[34];let R;e[35]!==a?(R=a("started"),e[35]=a,e[36]=R):R=e[36];let P;e[37]!==R?(P=(0,t.jsx)(S,{children:R}),e[37]=R,e[38]=P):P=e[38];let Z;e[39]!==a?(Z=a("duration"),e[39]=a,e[40]=Z):Z=e[40];let O;e[41]!==Z?(O=(0,t.jsx)(S,{children:Z}),e[41]=Z,e[42]=O):O=e[42];let H;e[43]!==a?(H=a("skipped"),e[43]=a,e[44]=H):H=e[44];let _;e[45]!==H?(_=(0,t.jsx)(S,{children:H}),e[45]=H,e[46]=_):_=e[46];let z;e[47]!==a?(z=a("error"),e[47]=a,e[48]=z):z=e[48];let K;e[49]!==z?(K=(0,t.jsx)(S,{children:z}),e[49]=z,e[50]=K):K=e[50],e[51]!==x||e[52]!==E||e[53]!==P||e[54]!==O||e[55]!==_||e[56]!==K?(y=(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[x,E,P,O,_,K]})}),e[51]=x,e[52]=E,e[53]=P,e[54]=O,e[55]=_,e[56]=K,e[57]=y):y=e[57],o=ae;let W;e[58]!==A?(W=b(M=>(0,t.jsxs)(B,{"data-testid":`cron-run-row-${M.runId}`,children:[(0,t.jsx)(J,{children:M.name}),(0,t.jsx)(J,{children:(0,t.jsx)(oe,{variant:Je[M.status],children:A[M.status]})}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:ee(M.startedAt,"\u2014")}),(0,t.jsx)(J,{className:"tabular-nums",children:M.status==="skipped"?"":Te(M.durationMs)}),(0,t.jsx)(J,{className:"tabular-nums",children:M.skipped>0?M.skipped:""}),(0,t.jsx)(J,{className:"text-xs text-destructive",children:M.error??""})]},M.runId),"B"),e[58]=A,e[59]=W):W=e[59],N=T.map(W),e[0]=u,e[1]=a,e[2]=o,e[3]=l,e[4]=n,e[5]=s,e[6]=N,e[7]=y,e[8]=i,e[9]=h,e[10]=g,e[11]=v,e[12]=f}else o=e[2],l=e[3],n=e[4],s=e[5],N=e[6],y=e[7],i=e[8],h=e[9],g=e[10],v=e[11],f=e[12];let d;e[60]!==o||e[61]!==N?(d=(0,t.jsx)(o,{children:N}),e[60]=o,e[61]=N,e[62]=d):d=e[62];let c;e[63]!==l||e[64]!==y||e[65]!==d?(c=(0,t.jsxs)(l,{children:[y,d]}),e[63]=l,e[64]=y,e[65]=d,e[66]=c):c=e[66];let m;e[67]!==n||e[68]!==i||e[69]!==c?(m=(0,t.jsx)(n,{className:i,children:c}),e[67]=n,e[68]=i,e[69]=c,e[70]=m):m=e[70];let k;e[71]!==s||e[72]!==m||e[73]!==h?(k=(0,t.jsx)(s,{className:h,children:m}),e[71]=s,e[72]=m,e[73]=h,e[74]=k):k=e[74];let w;return e[75]!==k||e[76]!==g||e[77]!==v||e[78]!==f?(w=(0,t.jsxs)("div",{className:g,"data-testid":v,children:[f,k]}),e[75]=k,e[76]=g,e[77]=v,e[78]=f,e[79]=w):w=e[79],w},"Ce");function qe(r,e){return e.startedAt-r.startedAt}b(qe,"Te");var Re=b(()=>{let r=(0,Y.c)(50),e=V(),u=ke(""),[a,o]=(0,U.useState)(""),[l,n]=(0,U.useState)(void 0),[s,N]=(0,U.useState)(!1);if(u.unavailable)return null;let y;r[0]!==u?(y=u.pending("cron"),r[0]=u,r[1]=y):y=r[1];let i=y,h;r[2]!==u?(h=u.reason("cron"),r[2]=u,r[3]=h):h=r[3];let g=h,v;r[4]!==a||r[5]!==u?(v=b(()=>{let R=a.trim();R!==""&&G((async()=>{let P=await u.suggestCron(R);N(!1),n(P)})())},"x"),r[4]=a,r[5]=u,r[6]=v):v=r[6];let f=v,d;r[7]!==l?(d=b(()=>{let R="navigator"in globalThis?globalThis.navigator.clipboard:void 0;R===void 0||l===void 0||G((async()=>{try{await R.writeText(l),N(!0)}catch{N(!1)}})())},"o"),r[7]=l,r[8]=d):d=r[8];let c=d,m;r[9]!==e?(m=e("Describe a schedule"),r[9]=e,r[10]=m):m=r[10];let k;r[11]===Symbol.for("react.memo_cache_sentinel")?(k=b(R=>{o(R.target.value)},"b"),r[11]=k):k=r[11];let w;r[12]!==f?(w=b(R=>{R.key==="Enter"&&(R.preventDefault(),f())},"y"),r[12]=f,r[13]=w):w=r[13];let T;r[14]!==e?(T=e("Describe a schedule"),r[14]=e,r[15]=T):T=r[15];let j;r[16]!==i||r[17]!==a||r[18]!==m||r[19]!==w||r[20]!==T?(j=(0,t.jsx)(ye,{"aria-label":m,className:"h-7 flex-1 text-xs","data-testid":"cron-assistant-prompt",disabled:i,onChange:k,onKeyDown:w,placeholder:T,value:a}),r[16]=i,r[17]=a,r[18]=m,r[19]=w,r[20]=T,r[21]=j):j=r[21];let $=i&&"opacity-60",C;r[22]!==$?(C=Ne("rounded-md border border-border px-2 py-1 text-xs outline-none transition-colors hover:bg-accent focus-visible:bg-accent",$),r[22]=$,r[23]=C):C=r[23];let I;r[24]!==i||r[25]!==a?(I=i||a.trim()==="",r[24]=i,r[25]=a,r[26]=I):I=r[26];let A;r[27]!==i||r[28]!==e?(A=e(i?"Thinking\u2026":"Suggest schedule"),r[27]=i,r[28]=e,r[29]=A):A=r[29];let p;r[30]!==f||r[31]!==C||r[32]!==I||r[33]!==A?(p=(0,t.jsx)("button",{className:C,"data-testid":"cron-assistant-generate",disabled:I,onClick:f,type:"button",children:A}),r[30]=f,r[31]=C,r[32]=I,r[33]=A,r[34]=p):p=r[34];let L;r[35]!==p||r[36]!==j?(L=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[j,p]}),r[35]=p,r[36]=j,r[37]=L):L=r[37];let x;r[38]!==s||r[39]!==c||r[40]!==l||r[41]!==e?(x=l!==void 0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs tabular-nums","data-testid":"cron-assistant-result",children:l}),(0,t.jsx)("button",{className:"rounded-md border border-border px-2 py-0.5 text-[11px] outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cron-assistant-copy",onClick:c,type:"button",children:e(s?"Copied":"Copy")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e("Add it to lunora/crons.ts \u2014 triggers are compiled into the worker.")})]}),r[38]=s,r[39]=c,r[40]=l,r[41]=e,r[42]=x):x=r[42];let D;r[43]!==g||r[44]!==e?(D=g!==void 0&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground","data-testid":"cron-assistant-reason",role:"status",children:e(g==="ai-error"?"The model could not be reached.":"The model did not return a schedule Cron Triggers accept.")}),r[43]=g,r[44]=e,r[45]=D):D=r[45];let E;return r[46]!==L||r[47]!==x||r[48]!==D?(E=(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"cron-assistant",children:[L,x,D]}),r[46]=L,r[47]=x,r[48]=D,r[49]=E):E=r[49],E},"Se"),Ee={kind:"idle"},Me="SCHEDULER_NOT_CONFIGURED",pe={inFlight:[],runs:[]},Be=b((r,e,u)=>u!==void 0?u:e===void 0?a=>r.runCronJob(a):void 0,"Ae"),Pe=b(({loadCronJobs:r,loadCronRuns:e,runCronJob:u}={})=>{let a=se(),o=V(),[l,n]=(0,U.useState)({}),s=te(["lunora-cron-jobs",r?"custom":"default"],()=>(r??(()=>a.getCronJobs()))()),{data:N,error:y}=s,i=e??(r===void 0?()=>a.listCronRuns():void 0),h=te(["lunora-cron-runs",e?"custom":"default"],async()=>i===void 0?pe:i().catch(d=>{if(ge(d)===Me)return pe;throw d})),g=h.data??pe;ne(()=>h.poll(),i!==void 0);let v=Be(a,r,u),f=b(async d=>{if(v!==void 0){n(c=>({...c,[d]:{kind:"running"}}));try{await v(d),n(c=>({...c,[d]:{kind:"ok"}})),s.refetch(),h.refetch()}catch(c){n(m=>({...m,[d]:{kind:"error",message:ce(c)}}))}}},"p");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[(0,t.jsx)(Re,{}),y!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:y}),h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-runs-error",role:"alert",children:h.error}),N?.length===0&&(0,t.jsx)(de,{description:o("Triggers declared with the cronJobs() builder appear here."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:o("No cron triggers.")}),N!==void 0&&N.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"cron-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:o("name")}),(0,t.jsx)(S,{children:o("schedule")}),(0,t.jsx)(S,{children:o("target")}),(0,t.jsx)(S,{children:o("shard")}),(0,t.jsx)(S,{children:o("last run")}),v!==void 0&&(0,t.jsx)(S,{"aria-label":o("Actions")})]})}),(0,t.jsx)(ae,{children:N.map(d=>{let c=l[d.name]??Ee;return(0,t.jsxs)(B,{"data-testid":`cron-row-${d.name}`,children:[(0,t.jsx)(J,{children:d.name}),(0,t.jsx)(J,{className:"font-mono text-xs tabular-nums",children:d.cron}),(0,t.jsx)(J,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[d.workflow===void 0?(0,t.jsx)(oe,{variant:"outline",children:o("function")}):(0,t.jsx)(oe,{variant:"secondary",children:o("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:d.workflow??d.functionPath})]})}),(0,t.jsx)(J,{children:d.shardKey??""}),(0,t.jsx)(J,{"data-testid":`cron-last-run-${d.name}`,children:(0,t.jsx)(Fe,{inFlight:g.inFlight.find(m=>m.name===d.name),last:g.runs.find(m=>m.name===d.name)})}),v!==void 0&&(0,t.jsx)(J,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[c.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${d.name}`,children:o("ran")}),c.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${d.name}`,role:"alert",children:c.message}),(0,t.jsx)(ue,{confirmLabel:o("Run now?"),disabled:c.kind==="running",onConfirm:b(()=>{G(f(d.name))},"onConfirm"),testId:`cron-run-${d.name}`,children:c.kind==="running"?o("Running\u2026"):o("Run now")})]})})]},`${d.cron}:${d.name}`)})})]})})}),(0,t.jsx)(De,{runs:g.runs})]})},"Le"),He=b(r=>Number.isFinite(r)?ee(r,"\u2014"):"\u2014","Re"),Ke=b(r=>{let e=(0,Y.c)(34),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadJobs:a,removeJob:o,retryJob:l}=u,n=se(),s=V(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let y;e[3]!==n||e[4]!==a?(y=b(async()=>(await(a??(()=>n.listDeadJobs()))()).toSorted(We),"v"),e[3]=n,e[4]=a,e[5]=y):y=e[5];let i=te(N,y),h=i.data,[g,v]=(0,U.useState)(void 0),f=i.error??g,d=a===void 0,c;e[6]!==n||e[7]!==d||e[8]!==l?(c=l??(d?x=>n.retryDeadJob(x):void 0),e[6]=n,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m=c,k;e[10]!==n||e[11]!==d||e[12]!==o?(k=o??(d?x=>n.removeDeadJob(x):void 0),e[10]=n,e[11]=d,e[12]=o,e[13]=k):k=e[13];let w=k,T;e[14]!==i?(T=b(()=>i.poll(),"I"),e[14]=i,e[15]=T):T=e[15],ne(T,!0);let j;e[16]!==i?(j=b(async x=>{v(void 0);try{await x,i.refetch()}catch(D){v(ce(D))}},"w"),e[16]=i,e[17]=j):j=e[17];let $=j,C=m!==void 0||w!==void 0,I;e[18]!==f?(I=f!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:f}),e[18]=f,e[19]=I):I=e[19];let A;e[20]!==h?.length||e[21]!==s?(A=h?.length===0&&(0,t.jsx)(de,{description:s("Jobs that exhaust their retry budget are parked here instead of being dropped."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:s("No dead-letter jobs.")}),e[20]=h?.length,e[21]=s,e[22]=A):A=e[22];let p;e[23]!==$||e[24]!==C||e[25]!==h||e[26]!==w||e[27]!==m||e[28]!==s?(p=h!==void 0&&h.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"dlq-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:s("function")}),(0,t.jsx)(S,{children:s("attempts")}),(0,t.jsx)(S,{children:s("last tried")}),(0,t.jsx)(S,{children:s("pool")}),(0,t.jsx)(S,{children:s("shard")}),(0,t.jsx)(S,{children:s("id")}),C&&(0,t.jsx)(S,{"aria-label":s("Actions")})]})}),(0,t.jsx)(ae,{children:h.map(x=>(0,t.jsxs)(B,{"data-testid":`dlq-row-${x.id}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:x.workflow??x.functionPath}),(0,t.jsx)(J,{className:"tabular-nums",children:x.attempts??0}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:He(x.scheduledFor)}),(0,t.jsx)(J,{className:"font-mono text-xs",children:x.pool??""}),(0,t.jsx)(J,{children:x.shardKey??""}),(0,t.jsx)(J,{className:"font-mono text-xs",children:x.id}),C&&(0,t.jsx)(J,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[m!==void 0&&(0,t.jsx)(me,{"data-testid":`dlq-retry-${x.id}`,onClick:b(()=>{G($(m(x.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:s("Retry")}),w!==void 0&&(0,t.jsx)(ue,{confirmLabel:s("Drop job?"),onConfirm:b(()=>{G($(w(x.id)))},"onConfirm"),testId:`dlq-remove-${x.id}`,children:s("Drop")})]})})]},x.id))})]})})}),e[23]=$,e[24]=C,e[25]=h,e[26]=w,e[27]=m,e[28]=s,e[29]=p):p=e[29];let L;return e[30]!==p||e[31]!==I||e[32]!==A?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[I,A,p]}),e[30]=p,e[31]=I,e[32]=A,e[33]=L):L=e[33],L},"De");function We(r,e){return(e.attempts??0)-(r.attempts??0)}b(We,"Ee");var Ve={canceled:"secondary",failed:"destructive",pending:"outline",running:"info",succeeded:"success"},_e=b(r=>{let e=(0,Y.c)(47),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadJobs:a}=u,o=se(),l=V(),n;e[2]!==o||e[3]!==a?(n=a??(async q=>o.listScheduledHistory(q===void 0?{}:{cursor:q})),e[2]=o,e[3]=a,e[4]=n):n=e[4];let s=n,N=a?"custom":"default",y;e[5]!==N?(y=["lunora-job-history",N],e[5]=N,e[6]=y):y=e[6];let i;e[7]!==s?(i=b(async()=>s(),"d"),e[7]=s,e[8]=i):i=e[8];let h=te(y,i),[g,v]=(0,U.useState)(void 0),[f,d]=(0,U.useState)(!1),[c,m]=(0,U.useState)(void 0),k=h.data?.records,w;e[9]!==k?(w=new Set(k?.map(ze)),e[9]=k,e[10]=w):w=e[10];let T=w,j=k===void 0?void 0:[...k,...(g?.records??[]).filter(q=>!T.has(q.id))],$=g===void 0?h.data?.cursor:g.cursor,C;e[11]!==s||e[12]!==$?(C=b(async()=>{d(!0),m(void 0);try{let q=await s($);v($e=>({cursor:q.cursor,records:[...$e?.records??[],...q.records]})),d(!1)}catch(q){m(ce(q)),d(!1)}},"S"),e[11]=s,e[12]=$,e[13]=C):C=e[13];let I=C,A;e[14]!==l?(A=l("canceled"),e[14]=l,e[15]=A):A=e[15];let p;e[16]!==l?(p=l("failed"),e[16]=l,e[17]=p):p=e[17];let L;e[18]!==l?(L=l("pending"),e[18]=l,e[19]=L):L=e[19];let x;e[20]!==l?(x=l("running"),e[20]=l,e[21]=x):x=e[21];let D;e[22]!==l?(D=l("succeeded"),e[22]=l,e[23]=D):D=e[23];let E;e[24]!==L||e[25]!==x||e[26]!==D||e[27]!==A||e[28]!==p?(E={canceled:A,failed:p,pending:L,running:x,succeeded:D},e[24]=L,e[25]=x,e[26]=D,e[27]=A,e[28]=p,e[29]=E):E=e[29];let R=E,P;e[30]!==h?(P=b(()=>h.poll(),"P"),e[30]=h,e[31]=P):P=e[31],ne(P,g===void 0);let Z="flex flex-col gap-3",O="lunora-job-history",H;e[32]!==h.error?(H=h.error!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"job-history-error",role:"alert",children:h.error}),e[32]=h.error,e[33]=H):H=e[33];let _=j?.length===0&&(0,t.jsx)(de,{description:l("Jobs that succeed, fail or are cancelled stay here for seven days."),testId:"job-history-empty",title:l("No finished jobs.")}),z=j!==void 0&&j.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"job-history-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:l("function")}),(0,t.jsx)(S,{children:l("state")}),(0,t.jsx)(S,{children:l("finished")}),(0,t.jsx)(S,{children:l("error")}),(0,t.jsx)(S,{children:l("id")})]})}),(0,t.jsx)(ae,{children:j.map(q=>(0,t.jsxs)(B,{"data-testid":`job-history-row-${q.id}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:q.workflow??q.functionPath}),(0,t.jsx)(J,{children:(0,t.jsx)(oe,{"data-testid":`job-history-state-${q.id}`,variant:Ve[q.state],children:R[q.state]})}),(0,t.jsx)(J,{className:"text-muted-foreground tabular-nums",children:ee(q.completedAt,"\u2014")}),(0,t.jsx)(J,{className:"text-xs text-destructive",children:q.error??""}),(0,t.jsx)(J,{className:"font-mono text-xs",children:q.id})]},q.id))})]})})}),K;e[34]!==c?(K=c!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:c}),e[34]=c,e[35]=K):K=e[35];let W;e[36]!==f||e[37]!==$||e[38]!==I||e[39]!==l?(W=$!==void 0&&(0,t.jsx)("div",{children:(0,t.jsx)(me,{"data-testid":"job-history-load-more",disabled:f,onClick:b(()=>{G(I())},"onClick"),variant:"outline",children:l(f?"Loading\u2026":"Load more")})}),e[36]=f,e[37]=$,e[38]=I,e[39]=l,e[40]=W):W=e[40];let M;return e[41]!==H||e[42]!==_||e[43]!==z||e[44]!==K||e[45]!==W?(M=(0,t.jsxs)("div",{className:Z,"data-testid":O,children:[H,_,z,K,W]}),e[41]=H,e[42]=_,e[43]=z,e[44]=K,e[45]=W,e[46]=M):M=e[46],M},"Je");function ze(r){return r.id}b(ze,"Fe");var fe=b(r=>{let e=(0,Y.c)(8),{label:u,testId:a,value:o}=r,l;e[0]!==u?(l=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u}),e[0]=u,e[1]=l):l=e[1];let n;e[2]!==a||e[3]!==o?(n=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":a,children:o}),e[2]=a,e[3]=o,e[4]=n):n=e[4];let s;return e[5]!==l||e[6]!==n?(s=(0,t.jsx)(Q,{className:"flex-1 py-0",children:(0,t.jsxs)(X,{className:"flex flex-col gap-1 p-4",children:[l,n]})}),e[5]=l,e[6]=n,e[7]=s):s=e[7],s},"de"),Ue=b(r=>{let e=(0,Y.c)(25),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadStatus:a}=u,o=se(),l=V(),n=a===void 0,s;e[2]!==n?(s=["lunora-scheduler-status",n],e[2]=n,e[3]=s):s=e[3];let N;e[4]!==o||e[5]!==a?(N=b(async()=>{let k=await(a??(()=>o.schedulerStatus()))();return{...k,pools:k.pools.toSorted(Ge)}},"N"),e[4]=o,e[5]=a,e[6]=N):N=e[6];let y=te(s,N),{data:i,error:h}=y,g;e[7]!==y?(g=b(()=>y.poll(),"g"),e[7]=y,e[8]=g):g=e[8],ne(g,!0);let v;e[9]!==h?(v=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:h}),e[9]=h,e[10]=v):v=e[10];let f;e[11]!==i||e[12]!==l?(f=i!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(fe,{label:l("backlog"),testId:"pools-backlog",value:i.backlog}),(0,t.jsx)(fe,{label:l("in flight"),testId:"pools-inflight",value:i.inFlight}),(0,t.jsx)(fe,{label:l("pools"),testId:"pools-count",value:i.pools.length})]}),e[11]=i,e[12]=l,e[13]=f):f=e[13];let d;e[14]!==i?.pools.length||e[15]!==l?(d=i?.pools.length===0&&(0,t.jsx)(de,{description:l("Pools created with createWorkpool appear here once they have activity."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:l("No workpools.")}),e[14]=i?.pools.length,e[15]=l,e[16]=d):d=e[16];let c;e[17]!==i||e[18]!==l?(c=i!==void 0&&i.pools.length>0&&(0,t.jsx)(Q,{className:"overflow-hidden py-0",children:(0,t.jsx)(X,{className:"px-0",children:(0,t.jsxs)(re,{"data-testid":"pools-table",children:[(0,t.jsx)(le,{children:(0,t.jsxs)(B,{children:[(0,t.jsx)(S,{children:l("pool")}),(0,t.jsx)(S,{children:l("queued")}),(0,t.jsx)(S,{children:l("in flight")}),(0,t.jsx)(S,{children:l("max concurrency")})]})}),(0,t.jsx)(ae,{children:i.pools.map(Qe)})]})})}),e[17]=i,e[18]=l,e[19]=c):c=e[19];let m;return e[20]!==v||e[21]!==f||e[22]!==d||e[23]!==c?(m=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[v,f,d,c]}),e[20]=v,e[21]=f,e[22]=d,e[23]=c,e[24]=m):m=e[24],m},"Oe");function Ge(r,e){return e.queued-r.queued}b(Ge,"Pe");function Qe(r){return(0,t.jsxs)(B,{"data-testid":`pools-row-${r.name}`,children:[(0,t.jsx)(J,{className:"font-mono text-xs",children:r.name}),(0,t.jsx)(J,{className:"tabular-nums",children:r.queued}),(0,t.jsxs)(J,{className:"tabular-nums",children:[r.inFlight," / ",r.maxConcurrency]}),(0,t.jsx)(J,{className:"tabular-nums",children:r.maxConcurrency})]},r.name)}b(Qe,"qe");var Xe=["jobs","history","dead","pools","cron"],jt=b(r=>{let e=(0,Y.c)(48),u;e[0]!==r?(u=r===void 0?{}:r,e[0]=r,e[1]=u):u=e[1];let{loadCronJobs:a,scheduledCancel:o,scheduledLoad:l}=u,n=V(),[s,N]=(0,U.useState)("jobs"),y;e[2]!==n?(y=n("Cron triggers"),e[2]=n,e[3]=y):y=e[3];let i;e[4]!==n?(i=n("Dead letter"),e[4]=n,e[5]=i):i=e[5];let h;e[6]!==n?(h=n("History"),e[6]=n,e[7]=h):h=e[7];let g;e[8]!==n?(g=n("Scheduled jobs"),e[8]=n,e[9]=g):g=e[9];let v;e[10]!==n?(v=n("Pools"),e[10]=n,e[11]=v):v=e[11];let f;e[12]!==y||e[13]!==i||e[14]!==h||e[15]!==g||e[16]!==v?(f={cron:y,dead:i,history:h,jobs:g,pools:v},e[12]=y,e[13]=i,e[14]=h,e[15]=g,e[16]=v,e[17]=f):f=e[17];let d=f,c;e[18]===Symbol.for("react.memo_cache_sentinel")?(c=b(x=>{N(x.currentTarget.dataset.view)},"c"),e[18]=c):c=e[18];let m=c,k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsx)(we,{}),e[19]=k):k=e[19];let w;e[20]!==n?(w=n("Schedule view"),e[20]=n,e[21]=w):w=e[21];let T;e[22]!==s||e[23]!==d?(T=Xe.map(x=>(0,t.jsx)(me,{"aria-selected":s===x,"data-testid":`schedule-view-${x}`,"data-view":x,onClick:m,role:"tab",size:"sm",type:"button",variant:s===x?"default":"outline",children:d[x]},x)),e[22]=s,e[23]=d,e[24]=T):T=e[24];let j;e[25]!==w||e[26]!==T?(j=(0,t.jsx)("div",{"aria-label":w,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:T}),e[25]=w,e[26]=T,e[27]=j):j=e[27];let $;e[28]!==o||e[29]!==l||e[30]!==s?($=s==="jobs"&&(0,t.jsx)(Se,{cancelJob:o,loadJobs:l}),e[28]=o,e[29]=l,e[30]=s,e[31]=$):$=e[31];let C;e[32]!==s?(C=s==="history"&&(0,t.jsx)(_e,{}),e[32]=s,e[33]=C):C=e[33];let I;e[34]!==s?(I=s==="dead"&&(0,t.jsx)(Ke,{}),e[34]=s,e[35]=I):I=e[35];let A;e[36]!==s?(A=s==="pools"&&(0,t.jsx)(Ue,{}),e[36]=s,e[37]=A):A=e[37];let p;e[38]!==a||e[39]!==s?(p=s==="cron"&&(0,t.jsx)(Pe,{loadCronJobs:a}),e[38]=a,e[39]=s,e[40]=p):p=e[40];let L;return e[41]!==j||e[42]!==$||e[43]!==C||e[44]!==I||e[45]!==A||e[46]!==p?(L=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[k,j,$,C,I,A,p]}),e[41]=j,e[42]=$,e[43]=C,e[44]=I,e[45]=A,e[46]=p,e[47]=L):L=e[47],L},"it");export{jt as SchedulePanel};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{D as xe,I as Ge,J as Ce,K as Qe,L as Ze,M as et,N as tt,b as Q,d as He,f as qe,l as Xe}from"./chunk-HFBSWKJS.js";import{f as $e,u as L,v as O,w as ge}from"./chunk-VUOEJJUH.js";import{a as ie,b as Je,d as be,g as M,i as ve,j as J}from"./chunk-YUVGMKHG.js";import{x as ze}from"./chunk-
|
|
1
|
+
import{D as xe,I as Ge,J as Ce,K as Qe,L as Ze,M as et,N as tt,b as Q,d as He,f as qe,l as Xe}from"./chunk-HFBSWKJS.js";import{f as $e,u as L,v as O,w as ge}from"./chunk-VUOEJJUH.js";import{a as ie,b as Je,d as be,g as M,i as ve,j as J}from"./chunk-YUVGMKHG.js";import{x as ze}from"./chunk-BVANRUU4.js";import{a as St}from"./chunk-GWNGVKLG.js";import{a as k,b as ae}from"./chunk-6G3E4PJ2.js";import{a as t,c as Mt,d as E}from"./chunk-5PEAXTYQ.js";var ht=E(St(),1);var Et=E(k(),1);var Te={};Mt(Te,{Control:()=>Ct,Description:()=>vt,Error:()=>bt,Item:()=>It,Label:()=>Rt,Root:()=>pt,Validity:()=>yt});var P=E(k(),1);var Fe=E(k(),1);var rt="data-valid",ot="data-invalid";var se={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ot={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},it={disabled:!1,...Ot},H={valid(r){return r===null?null:r?{[rt]:""}:{[ot]:""}}};var wt={invalid:void 0,name:void 0,validityData:{state:se,errors:[],error:"",value:"",initialValue:null},setValidityData:M,disabled:void 0,setTouched:M,setDirty:M,setFilled:M,setFocused:M,validationMode:"onSubmit",shouldValidateOnChange:t(()=>!1,"shouldValidateOnChange"),state:it,registerFieldControl:M,validation:{getValidationProps:t((r,e=ve)=>e,"getValidationProps"),inputRef:{current:null},registeredInputs:new Map,registerInput:M,getInputControl:t(()=>null,"getInputControl"),commit:t(async()=>{},"commit"),change:M}},Oe=Fe.createContext(wt);function Y(r=!0){let e=Fe.useContext(Oe);if(e.setValidityData===M&&!r)throw new Error(be(28));return e}t(Y,"useFieldRootContext");var ye=E(k(),1);var _t=ye.createContext(void 0);function nt(r=!1){let e=ye.useContext(_t);if(!e&&!r)throw new Error(be(86));return e}t(nt,"useFieldsetRootContext");var Ie=E(k(),1);var Pt=Ie.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:M,validationMode:"onSubmit",submitCountRef:{current:0}});function Z(){return Ie.useContext(Pt)}t(Z,"useFormContext");var ne=E(k(),1);var Ee=E(k(),1);var we=Ee.createContext({controlId:void 0,registerControlId:M,resetControlId:M,labelId:void 0,setLabelId:M,messageIds:[],setMessageIds:M,getDescriptionProps:t(r=>r,"getDescriptionProps")});function U(){return Ee.useContext(we)}t(U,"useLabelableContext");var at=E(ae(),1);var Ve=t(function(e){let o=Q(),[s,c]=ne.useState(o),[d,l]=ne.useState(),[R,f]=ne.useState([]),u=s===void 0?o:s,a=ie(()=>new Map),{messageIds:b}=U(),C=L((D,I)=>{let x=a.current;I===void 0?x.delete(D):x.set(D,I),c(w=>{if(x.size===0)return w;let A;for(let i of x.values()){if(i===w)return w;A===void 0&&(A=i)}return A})}),g=L(()=>{a.current.size===0&&c(o)}),v=ne.useCallback(D=>{let I=D["aria-describedby"]?D["aria-describedby"].split(" "):[];return I.push(...b,...R),{...D,"aria-describedby":Array.from(new Set(I)).join(" ")||void 0}},[b,R]),N=ne.useMemo(()=>({controlId:u,registerControlId:C,resetControlId:g,labelId:d,setLabelId:l,messageIds:R,setMessageIds:f,getDescriptionProps:v}),[u,C,g,d,l,R,f,v]);return(0,at.jsx)(we.Provider,{value:N,children:e.children})},"LabelableProvider");var _e=E(k(),1);function st(r={}){let{id:e,enabled:o=!0}=r,{controlId:s,registerControlId:c,resetControlId:d}=U(),l=Q(),R=ie(()=>Symbol()),f=_e.useRef(!1),u=_e.useRef(!1),a=L(()=>{!f.current||c===M||(f.current=!1,c(R.current,void 0))});return O(()=>{if(!o||c===M){a();return}let b;if(e!==void 0)u.current=!0,b=e;else if(u.current)b=l;else{d();return}if(b===void 0){a();return}f.current=!0,c(R.current,b)},[e,o,c,d,l,R,a]),O(()=>a,[a]),(o?s:void 0)??e??l}t(st,"useLabelableId");function lt(r,e){let o=Q(r);return O(()=>(e(o),()=>{e(s=>s===o?void 0:s)}),[o,e]),o}t(lt,"useRegisteredLabelId");function dt(r={}){let{id:e,fallbackControlId:o,native:s=!1,setLabelId:c,focusControl:d}=r,{controlId:l,setLabelId:R}=U(),f=L(g=>{R(g),c?.(g)}),u=lt(e,f),a=l??o;function b(g){if(d){d(g,a);return}if(!a)return;let v=ge(g.currentTarget).getElementById(a);$e(v)&&At(v)}t(b,"focusControl");function C(g){qe(g.nativeEvent)?.closest("button,input,select,textarea")||(!g.defaultPrevented&&g.detail>1&&g.preventDefault(),!s&&b(g))}return t(C,"handleInteraction"),s?{id:u,htmlFor:a,onMouseDown:C}:{id:u,onClick:C,onPointerDown(g){g.preventDefault()}}}t(dt,"useLabel");function At(r){r.focus({focusVisible:!0})}t(At,"focusElementWithVisible");var oe=E(k(),1);function le(r,e){return{...r,state:{...r.state,valid:!e&&r.state.valid}}}t(le,"getCombinedFieldValidityData");var Pe=Object.keys(se);function kt(r,e){return r.matches(":disabled")?!1:!e||r.form===e?!0:r.form===null&&!r.hasAttribute("form")}t(kt,"isEligibleInput");function ut(r,e){let o=null;for(let s of r.keys())if(kt(s,e)){if(!s.validity.valid)return s;o??=s}return o}t(ut,"findRepresentativeInput");function ct(r){return{...se,valid:!r,customError:r}}t(ct,"makeState");function Ae(r){return r&&r.validationMessage?[r.validationMessage]:[]}t(Ae,"getNativeErrors");function ft(r){let{elementRef:e,formRef:o}=Z(),{setValidityData:s,validate:c,validityData:d,validationDebounceTime:l,invalid:R,markedDirtyRef:f,state:u,shouldValidateOnChange:a,validationMode:b,registeredFieldIdRef:C}=r,{controlId:g,getDescriptionProps:v}=U(),N=xe(),D=oe.useRef(null),I=ie(()=>new Map).current,x=oe.useRef(0),w=oe.useRef(null),A=oe.useCallback((S,j)=>(I.set(S,j),()=>{I.delete(S)}),[I]),i=L(()=>{let S=ut(I,e.current);return S&&I.get(S)?.controlRef.current||null}),V=L(async(S,j=!1)=>{x.current+=1;let h=x.current;function $(n,m=R){let p=C.current??g;if(p==null)return;let y=o.current.fields.get(p);if(!y)return;let W=le(n,m);o.current.fields.set(p,{...y,validityData:W})}t($,"updateRegisteredFieldValidity");function ee(n,m){let p=n.valid===!1?m:[];return{value:S,state:n,error:p[0]??"",errors:p,initialValue:d.initialValue}}t(ee,"makeValidityData");function te(n,m){let p=n.validity.customError?n.validationMessage:"",y=m.replace(/\r\n?/g,`
|
|
2
2
|
`);n.setCustomValidity(y),w.current=[n,y,p]}t(te,"setCustomValidity");function X(){let n=w.current;w.current=null,n&&(!n[0].willValidate||n[0].validationMessage===n[1])&&n[0].setCustomValidity(n[2])}t(X,"clearCustomValidity");function _(n,m,p){let y=ee(n,m);$(y,p),s(y)}t(_,"publish");function q(n){let m=Pe.reduce((y,W)=>(y[W]=n.validity[W],y),{}),p=!1;for(let y of Pe)if(y!=="valid"){if(y==="valueMissing"&&m[y])p=!0;else if(m[y])return m}return p&&!f.current&&(m.valid=!0,m.valueMissing=!1),m}t(q,"getState");function re(){return I.size>0?ut(I,e.current):D.current}t(re,"resolveRepresentativeInput");let T=re();function G(){return T=re(),T?.willValidate?q(T):ct(!1)}if(t(G,"refreshState"),j){if(u.valid!==!1||!T)return;if(!T.validity.valueMissing){X();let n=re(),m=n?.validity.customError?Ae(n):[];_(ct(m.length>0),m,!1);return}for(let n of Pe)if(n!=="valid"&&n!=="valueMissing"&&n!=="customError"&&T.validity[n])return}N.clear(),X();let B=G(),K=Ae(T),ue=a();if(K.length===0||ue){let n=Array.from(o.current.fields.values()).reduce((y,W)=>(W.name&&(y[W.name]=W.getValue()),y),{}),m=c(S,n),p;if(typeof m=="object"&&m!==null&&"then"in m){if(B.valid===!1?_(B,K):(b==="onSubmit"||!d.state.customError)&&(B.valid=null,_(B,K)),p=await m,h!==x.current)return;B=G()}else p=m;K=p?[].concat(p).filter(Boolean):[],K.length>0?(B.valid=!1,B.customError=!0,T?.willValidate&&te(T,K.join(`
|
|
3
3
|
`))):K=Ae(T)}_(B,K)}),F=L((S,j=!1)=>{if(N.clear(),x.current+=1,j)return;let h=a();h&&S!==""&&l?N.start(l,()=>{V(S)}):V(S,!h)}),z=oe.useCallback((S,j={})=>Je(v(j),u.valid===!1&&!u.disabled&&!S?{"aria-invalid":!0}:ve),[v,u.disabled,u.valid]);return oe.useMemo(()=>({getValidationProps:z,inputRef:D,registeredInputs:I,registerInput:A,getInputControl:i,commit:V,change:F}),[z,I,A,i,V,F])}t(ft,"useFieldValidation");var he=E(k(),1);function mt(r){let{change:e,commit:o,invalid:s,markedDirtyRef:c,name:d,setRegisteredFieldName:l,registeredFieldIdRef:R,setValidityData:f,validityData:u}=r,{formRef:a}=Z(),b=he.useRef(null),C=he.useRef(null),g=he.useRef(!1),v=L(()=>{let i=C.current;if(i)return i.getValue?i.getValue():i.value});function N(i){return i.value===void 0?v():i.value}t(N,"getRegistrationValue");let D=L(()=>{let i=C.current;if(c.current=!0,!i){o(u.value);return}o(N(i))});function I(){let i=C.current;!i||!i.id||a.current.fields.set(i.id,{getValue:v,name:d??i.name,controlRef:i.controlRef,validityData:le(u,s),validate:D})}t(I,"refreshRegistration");function x(i=C.current?.id){i&&a.current.fields.delete(i)}t(x,"deleteRegistration");function w(i){if(g.current)return;g.current=!0;let V=N(i);f(F=>F.initialValue===V?F:{...F,initialValue:V})}t(w,"captureInitialValue"),O(()=>{let i=C.current;!i||!i.id||(l(d?void 0:i.name),a.current.fields.set(i.id,{getValue:v,name:d??i.name,controlRef:i.controlRef,validityData:le(u,s),validate:D}))},[a,v,s,d,l,D,u]),O(()=>{let i=a.current.fields;return()=>{let V=C.current?.id;V&&i.delete(V)}},[a]);let A=L((i,V)=>{if(!V){b.current===i&&(b.current=null,e(void 0,!0),x(),C.current=null,l(void 0),R.current=void 0);return}let F=C.current?.id,z=b.current;z&&z!==i&&e(void 0,!0),b.current=i,C.current=V,d||l(V.name),R.current=V.id,F&&F!==V.id&&x(F),w(V),I()});return[D,A]}t(mt,"useFieldControlRegistration");var De=E(ae(),1);var Ut=P.forwardRef(t(function(e,o){let{errors:s,validationMode:c,submitCountRef:d}=Z(),{render:l,className:R,validate:f,validationDebounceTime:u=0,validationMode:a=c,name:b,disabled:C=!1,invalid:g,dirty:v,touched:N,actionsRef:D,style:I,...x}=e,w=nt(!0)?.disabled,A=L(f||(()=>null)),i=w||C,[V,F]=P.useState(!1),[z,S]=P.useState(!1),[j,h]=P.useState(!1),[$,ee]=P.useState(!1),te=v??z,X=N??V,_=P.useRef(te),q=P.useRef(void 0),[re,T]=P.useState(),G=b??re;O(()=>{v!==void 0&&(_.current=v)},[v]);let B=L(Re=>{v===void 0&&(Re&&(_.current=!0),S(Re))}),K=L(Re=>{N===void 0&&F(Re)}),ue=L(()=>a==="onChange"||a==="onSubmit"&&d.current>0),n=G&&Object.hasOwn(s,G)?s[G]:null,m=!!(Array.isArray(n)?n.length:n),p=g===!0||m,[y,W]=P.useState({state:se,error:"",errors:[],value:null,initialValue:null}),We=!p&&(i?null:y.state.valid),me=P.useMemo(()=>({disabled:i,touched:X,dirty:te,valid:We,filled:j,focused:$}),[i,X,te,We,j,$]),pe=ft({setValidityData:W,validate:A,validityData:y,validationDebounceTime:u,invalid:p,markedDirtyRef:_,state:me,shouldValidateOnChange:ue,validationMode:a,registeredFieldIdRef:q}),[Ye,Ke]=mt({change:pe.change,commit:pe.commit,invalid:p,markedDirtyRef:_,name:b,setRegisteredFieldName:T,registeredFieldIdRef:q,setValidityData:W,validityData:y});P.useImperativeHandle(D,()=>({validate:Ye}),[Ye]);let Lt=P.useMemo(()=>({invalid:p,name:G,validityData:y,setValidityData:W,disabled:i,setTouched:K,setDirty:B,setFilled:h,setFocused:ee,validationMode:a,shouldValidateOnChange:ue,state:me,registerFieldControl:Ke,validation:pe}),[p,G,y,i,K,B,h,ee,a,ue,me,Ke,pe]),Nt=J("div",e,{ref:o,state:me,props:x,stateAttributesMapping:H});return(0,De.jsx)(Oe.Provider,{value:Lt,children:Nt})},"FieldRootInner")),pt=P.forwardRef(t(function(e,o){return(0,De.jsx)(Ve,{children:(0,De.jsx)(Ut,{...e,ref:o})})},"FieldRoot"));var ce=E(k(),1);var Le=E(k(),1);var ke=Le.createContext({disabled:!1});function Ne(){return Le.useContext(ke)}t(Ne,"useFieldItemContext");var Rt=ce.forwardRef(t(function(e,o){let{render:s,className:c,style:d,id:l,nativeLabel:R=!0,...f}=e,u=Y(!1),a=Ne(),{labelId:b}=U(),C={...u.state,disabled:u.disabled||a.disabled},g=ce.useRef(null),v=dt({id:b??l,native:R});return J("label",e,{ref:[o,g],state:C,props:[v,f],stateAttributesMapping:H})},"FieldLabel"));var de=E(k(),1);var Ue=E(ae(),1);var jt={...H,...Xe},bt=de.forwardRef(t(function(e,o){let{render:s,id:c,className:d,match:l,style:R,...f}=e,u=Q(c),{validityData:a,state:b,name:C}=Y(!1),{setMessageIds:g}=U(),{errors:v}=Z(),N=C&&Object.hasOwn(v,C)?v[C]:null,D=!!(Array.isArray(N)?N.length:N),I=typeof l=="string",x=!1;l===!0?x=!0:b.disabled?x=!1:I?x=!!a.state[l]:x=D||a.state.valid===!1;let{mounted:w,transitionStatus:A,setMounted:i}=Ce(x);O(()=>{if(!(!x||!u))return g(_=>_.concat(u)),()=>{g(_=>_.filter(q=>q!==u))}},[x,u,g]);let V=de.useRef(null),[F,z]=de.useState(null),[S,j]=de.useState(null),h=a.error;!I&&D?h=N:a.errors.length>1&&(h=a.errors);let $=h;Array.isArray(h)&&($=h.length>1?(0,Ue.jsx)("ul",{children:h.map(_=>(0,Ue.jsx)("li",{children:_},_))}):h[0]);let ee=Array.isArray(h)?JSON.stringify(h):h;x&&ee!==S&&(j(ee),z($)),Ge({open:x,ref:V,onComplete(){x||i(!1)}});let te={...b,transitionStatus:A},X=J("div",e,{ref:[o,V],state:te,props:[{id:u,children:x?$:F},f],stateAttributesMapping:jt,enabled:w});return w?X:null},"FieldError"));var gt=E(k(),1);var vt=gt.forwardRef(t(function(e,o){let{render:s,id:c,className:d,style:l,...R}=e,f=Q(c),u=Y(!1),a=Ne(),{setMessageIds:b}=U(),C={...u.state,disabled:u.disabled||a.disabled};return O(()=>{if(f)return b(v=>v.concat(f)),()=>{b(v=>v.filter(N=>N!==f))}},[f,b]),J("p",e,{ref:o,state:C,props:[{id:f},R],stateAttributesMapping:H})},"FieldDescription"));var Me=E(k(),1);function xt(r,e,o,s,c=!0,d){let{registerFieldControl:l}=Y(),R=ie(()=>Symbol());O(()=>{let f=R.current;if(!c){l(f,void 0);return}l(f,{controlRef:r,getValue:s,id:e,name:d,value:o})},[r,c,s,e,d,l,R,o]),O(()=>{let f=R.current;return()=>{l(f,void 0)}},[l,R])}t(xt,"useRegisterFieldControl");var Ct=Me.forwardRef(t(function(e,o){let{render:s,className:c,id:d,name:l,value:R,disabled:f=!1,onValueChange:u,defaultValue:a,autoFocus:b=!1,style:C,...g}=e,{state:v,name:N,disabled:D,setTouched:I,setDirty:x,validityData:w,setFocused:A,setFilled:i,validationMode:V,validation:F}=Y(),{clearErrors:z,elementRef:S,submitCountRef:j}=Z(),h=D||f,$=N??l,ee={...v,disabled:h},{labelId:te}=U(),X=st({id:d}),[_]=Qe({controlled:R,default:a,name:"FieldControl",state:"value"}),q=R!==void 0,re=q?_:void 0,T=re==null?void 0:String(re),G=L(()=>F.inputRef.current?.value);xt(F.inputRef,X,T,G,!h,l),O(()=>{let n=T??F.inputRef.current?.value;n!==void 0&&i(n!=="")},[T,F.inputRef,i]),Ze(T,()=>{T!==void 0&&(z($),x(T!==(w.initialValue??"")),F.change(T))});let B=Me.useRef(null),K=xe();return O(()=>{b&&B.current===He(ge(B.current))&&A(!0)},[b,A]),J("input",e,{ref:[o,B],state:ee,props:[{id:X,disabled:h,name:$,ref:F.inputRef,"aria-labelledby":te,autoFocus:b,...q?{value:re}:{defaultValue:a},onChange(n){let m=n.currentTarget.value,p=tt(et.none,n.nativeEvent);u?.(m,p),!q&&(x(m!==(w.initialValue??"")),i(m!==""),!n.nativeEvent.defaultPrevented&&!p.isCanceled&&(z($),F.change(m)))},onFocus(){A(!0)},onBlur(n){if(I(!0),A(!1),V==="onBlur"){let m=n.currentTarget.value;F.commit(m),q&&queueMicrotask(()=>{let p=F.inputRef.current?.value;p!==void 0&&p!==m&&p!==(w.initialValue??"")&&F.commit(p)})}},onKeyDown(n){if(n.currentTarget.tagName==="INPUT"&&n.key==="Enter"){I(!0);let m=n.currentTarget.value,p=n.currentTarget.form;if(p&&p===S.current&&!n.defaultPrevented){let y=n.currentTarget,W=j.current;K.start(0,()=>{j.current===W&&F.commit(y.value)})}else F.commit(m)}}},g,n=>F.getValidationProps(h,n)],stateAttributesMapping:H})},"FieldControl"));var fe=E(k(),1);var Ft=E(ae(),1);var yt=t(function(e){let{children:o}=e,{validityData:s,invalid:c}=Y(!1),d=fe.useMemo(()=>le(s,c),[s,c]),l=d.state.valid===!1,{transitionStatus:R}=Ce(l),f=fe.useMemo(()=>({...d,validity:d.state,transitionStatus:R}),[d,R]);return(0,Ft.jsx)(fe.Fragment,{children:o(f)})},"FieldValidity");var Se=E(k(),1);var je=E(ae(),1);var It=Se.forwardRef(t(function(e,o){let{render:s,className:c,style:d,disabled:l=!1,...R}=e,{state:f,disabled:u}=Y(!1),a=u||l,b={...f,disabled:a},C=Se.useMemo(()=>({disabled:a}),[a]),g=J("div",e,{ref:o,state:b,props:R,stateAttributesMapping:H});return(0,je.jsx)(Ve,{children:(0,je.jsx)(ke.Provider,{value:C,children:g})})},"FieldItem"));var Vt=E(ae(),1);var Be=Et.forwardRef(t(function(e,o){return(0,Vt.jsx)(Te.Control,{ref:o,...e})},"Input"));var Dt=E(ae(),1);function Pi(r){let e=(0,ht.c)(10),o,s,c;e[0]!==r?({className:o,type:c,...s}=r,e[0]=r,e[1]=o,e[2]=s,e[3]=c):(o=e[1],s=e[2],c=e[3]);let d;e[4]!==o?(d=ze("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",o),e[4]=o,e[5]=d):d=e[5];let l;return e[6]!==s||e[7]!==d||e[8]!==c?(l=(0,Dt.jsx)(Be,{type:c,"data-slot":"input",className:d,...s}),e[6]=s,e[7]=d,e[8]=c,e[9]=l):l=e[9],l}t(Pi,"m");export{H as a,Y as b,Z as c,U as d,st as e,dt as f,Ne as g,xt as h,Pi as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ut,b as he,c as Xe,d as Ke,e as pt,f as cr}from"./chunk-O3AZ7JKE.js";import{a as sr,b as ir,c as lr,d as ar}from"./chunk-VNH4OBJS.js";import{B as Do,C as _o,E as Uo,F as ko,G as Fo,J as Ho,X as Bo,a as Eo,aa as jo,ba as zo,e as wo,ea as Wo,fa as Go,la as Yo,ma as $o,na as Xo,o as Pt,oa as Ko,qa as Jo,r as Oo,ra as Zo,sa as Qo,ta as er,u as Lo}from"./chunk-XLYFGUEF.js";import{a as Po,b as qo}from"./chunk-D65UVZIA.js";import{a as Mo,b as Vo}from"./chunk-NGVP66OH.js";import{a as tr,b as or,i as rr,j as nr,k as ct}from"./chunk-QAOZXPLU.js";import{a as Ct,b as qe,c as So,d as ho,e as At,f as Co,h as No}from"./chunk-NMQDQNDF.js";import{A as Io,D as Ye,F as Ao,I as Ve,J as $e,K as $t,L as To,M as oe,N as ce,b as xo,c as Ro,e as Nt,l as Me,n as Yt,o as bo,p as yo,q as Tt,r as vo}from"./chunk-HFBSWKJS.js";import{c as Et}from"./chunk-JMZT3CEW.js";import{b as It,u as ve,v as te,w as lt}from"./chunk-VUOEJJUH.js";import{a as mo,b as it,d as Ie,e as go,g as at,h as qt,i as wt,j as w}from"./chunk-YUVGMKHG.js";import{x as He}from"./chunk-SGHIB7TS.js";import{a as Rn}from"./chunk-GWNGVKLG.js";import{a as O,b as xe}from"./chunk-6G3E4PJ2.js";import{a as o,c as hn,d as b}from"./chunk-5PEAXTYQ.js";var St=b(Rn(),1);var re={};hn(re,{Arrow:()=>Jr,Backdrop:()=>Ur,Group:()=>an,GroupLabel:()=>un,Icon:()=>Vr,Item:()=>qr,ItemIndicator:()=>$r,ItemText:()=>Xr,Label:()=>Cr,List:()=>Wr,Popup:()=>jr,Portal:()=>Dr,Positioner:()=>kr,Root:()=>vr,ScrollDownArrow:()=>tn,ScrollUpArrow:()=>nn,Separator:()=>dn,Trigger:()=>Nr,Value:()=>Pr});var U=b(O(),1);var ur=b(O(),1);function pr(e){let t=ur.useRef(!0);t.current&&(t.current=!1,e())}o(pr,"useOnFirstRender");var Oe=b(O(),1);var Xt=Oe.createContext(void 0),Kt=Oe.createContext(void 0),Jt=Oe.createContext(void 0);function L(){let e=Oe.useContext(Xt);if(e===void 0)throw new Error(Ie(60));return e}o(L,"useSelectRootContext");function Le(){let e=Oe.useContext(Kt);if(e===void 0)throw new Error(Ie(101));return e}o(Le,"useSelectRootPropsContext");function Mt(){let e=Oe.useContext(Jt);if(e===void 0)throw new Error(Ie(61));return e}o(Mt,"useSelectFloatingContext");function fr(e,t,r=Object.is){let{length:n}=e;if(n!==t.length)return!1;for(let s=0;s<n;s+=1)if(!r(e[s],t[s]))return!1;return!0}o(fr,"areArraysEqual");var Qt=o((e,t)=>Object.is(e,t),"defaultItemEquality");function Ce(e,t,r){return e==null||t==null?Object.is(e,t):r(e,t)}o(Ce,"compareItemEquality");function dr(e,t,r){return Array.isArray(e)&&Array.isArray(t)?!fr(e,t,(n,s)=>Ce(n,s,r)):e!==t}o(dr,"isSelectedValueDirty");function Zt(e,t,r){return e?e.some(n=>n===void 0?!1:Ce(t,n,r)):!1}o(Zt,"selectedValueIncludes");function ft(e,t,r){return e?e.findIndex(n=>n===void 0?!1:Ce(n,t,r)):-1}o(ft,"findItemIndex");function bn(e,t){if(t!==Qt)return n=>Zt(e,n,t);let r=new Set(e);return r.delete(void 0),n=>r.has(n)&&(n!==0||e.some(s=>Object.is(n,s)))}o(bn,"createSelectionMatcher");function eo(e,t,r,n){let s=n&&Array.isArray(t)?e.findIndex(bn(t,r)):ft(e,t,r);return s===-1?null:s}o(eo,"findSelectionIndex");function mr(e,t,r,n,s,a){return Zt(n,t,s)?a!=null&&e>a&&Zt(n,r[a],s)?a:e:e===a?eo(r,n,s,!0):a}o(mr,"resolveSelectedIndex");function gr(e,t,r){return e.filter(n=>!Ce(t,n,r))}o(gr,"removeItem");var Sr=b(O(),1);function Vt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}o(Vt,"serializeValue");var xr=b(xe(),1);function yn(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}o(yn,"isGroup");function hr(e){return yn(e?.[0])}o(hr,"isGroupedItems");function vn(e){return hr(e)?e.flatMap(t=>t.items):e}o(vn,"flattenLeafItems");function Rr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(hr(t)){for(let r of t)for(let n of r.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let r of t)if(r&&r.value==null&&r.label!=null)return!0;return!1}o(Rr,"hasNullItemLabel");function to(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 Vt(e)}o(to,"stringifyAsLabel");function De(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Vt(e.value):Vt(e)}o(De,"stringifyAsValue");function oo(e,t,r){function n(){return to(e,r)}if(o(n,"fallback"),r&&e!=null)return r(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??n();if(Array.isArray(t)){let a=vn(t);if(e==null||typeof e!="object"){let i=a.find(u=>u.value===e);return i&&i.label!=null?i.label:n()}if("value"in e){let i=a.find(u=>u&&u.value===e.value);if(i&&i.label!=null)return i.label}}return n()}o(oo,"resolveSelectedLabel");function br(e,t,r){return e.reduce((n,s,a)=>(a>0&&n.push(", "),n.push((0,xr.jsx)(Sr.Fragment,{children:oo(s,t,r)},a)),n),[])}o(br,"resolveMultipleLabels");var yr={id:o(e=>e.id,"id"),labelId:o(e=>e.labelId,"labelId"),modal:o(e=>e.modal,"modal"),items:o(e=>e.items,"items"),itemToStringLabel:o(e=>e.itemToStringLabel,"itemToStringLabel"),isItemEqualToValue:o(e=>e.isItemEqualToValue,"isItemEqualToValue"),value:o(e=>e.value,"value"),hasSelectedValue:o(e=>{let{value:t,multiple:r,itemToStringValue:n}=e;return t==null?!1:r&&Array.isArray(t)?t.length>0:De(t,n)!==""},"hasSelectedValue"),hasNullItemLabel:o((e,t)=>t?Rr(e.items):!1,"hasNullItemLabel"),open:o(e=>e.open,"open"),mounted:o(e=>e.mounted,"mounted"),forceMount:o(e=>e.forceMount,"forceMount"),transitionStatus:o(e=>e.transitionStatus,"transitionStatus"),openMethod:o(e=>e.openMethod,"openMethod"),activeIndex:o(e=>e.activeIndex,"activeIndex"),selectedIndex:o(e=>e.selectedIndex,"selectedIndex"),isActive:o((e,t)=>e.activeIndex===t,"isActive"),isSelected:o((e,t)=>{let r=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(s=>Ce(t,s,r)):Ce(t,n,r)},"isSelected"),isSelectedByFocus:o((e,t)=>e.selectedIndex===t,"isSelectedByFocus"),popupProps:o(e=>e.popupProps,"popupProps"),triggerProps:o(e=>e.triggerProps,"triggerProps"),triggerElement:o(e=>e.triggerElement,"triggerElement"),positionerElement:o(e=>e.positionerElement,"positionerElement"),listElement:o(e=>e.listElement,"listElement"),popupSide:o(e=>e.popupSide,"popupSide"),scrollUpArrowVisible:o(e=>e.scrollUpArrowVisible,"scrollUpArrowVisible"),scrollDownArrowVisible:o(e=>e.scrollDownArrowVisible,"scrollDownArrowVisible"),hasScrollArrows:o(e=>e.hasScrollArrows,"hasScrollArrows")};var Be=b(xe(),1);function vr(e){let{id:t,value:r,defaultValue:n=null,onValueChange:s,open:a,defaultOpen:i=!1,onOpenChange:u,name:l,form:m,autoComplete:p,disabled:h=!1,readOnly:y=!1,required:d=!1,modal:N=!0,actionsRef:v,inputRef:H,onOpenChangeComplete:S,items:j,multiple:I=!1,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M=Qt,highlightItemOnHover:T=!0,children:k}=e,{clearErrors:Q}=So(),{setDirty:$,setTouched:W,setFocused:X,validityData:c,setFilled:z,name:q,disabled:ie,validation:G,validationMode:le}=qe(),F=At({id:t}),f=ie||h,E=q??l,[R,x]=$t({controlled:r,default:I?n??qt:n,name:"Select",state:"value"}),[P,K]=$t({controlled:a,default:i,name:"Select",state:"open"}),ne=U.useRef([]),J=U.useRef([]),ue=U.useRef(null),Se=U.useRef(null),ee=U.useRef(0),pe=U.useRef(null),V=U.useRef([]),D=U.useRef(!1),ae=U.useRef(null),Z=U.useRef(null),Ue=U.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ae=U.useRef(!1),Ne=U.useRef(R),{mounted:fe,setMounted:ke,transitionStatus:Te}=$e(P),{openMethod:se,triggerProps:xt}=Wo(P),_=mo(()=>new Fo({id:F,labelId:void 0,modal:N,multiple:I,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,value:R,open:P,mounted:fe,transitionStatus:Te,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:wt,triggerProps:wt,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:at,setOpen:at,handleScrollArrowVisibility:at,onOpenChangeComplete:at,listRef:ne,popupRef:ue,scrollHandlerRef:Se,scrollArrowsMountedCountRef:ee,valueRef:pe,valuesRef:V,labelsRef:J,typingRef:D,selectionRef:Ue,firstItemTextRef:ae,selectedItemTextRef:Z,alignItemWithTriggerActiveRef:Ae,initialValueRef:Ne},yr)).current,be=_.useState("activeIndex"),ht=_.useState("selectedIndex"),Rt=_.useState("triggerElement"),ye=_.useState("positionerElement"),bt=er(se),yt=se??bt,ze=U.useMemo(()=>I?"":De(R,C),[I,R,C]),Ee=U.useMemo(()=>I&&Array.isArray(R)?R.map(A=>De(A,C)):De(R,C),[I,R,C]),Bt=Pt(Rt),tt=ve(()=>Ee);No(Bt,F,R,tt,!f,l);let ot=I?Array.isArray(R)&&R.length>0:R!=null&&ze!=="";te(()=>{z(ot)},[ot,z]),te(o(function(){let Y=eo(V.current,R,M,I);Y===null&&(Z.current=null),!P&&_.set("selectedIndex",Y)},"syncSelectedIndex"),[I,P,R,M,_]),To(R,()=>{Q(E),$(dr(R,c.initialValue,M)),G.change(R)});let rt=ve((A,Y)=>{u?.(A,Y),!Y.isCanceled&&(K(A),!A&&(Y.reason===oe.focusOut||Y.reason===oe.outsidePress)&&(W(!0),X(!1),le==="onBlur"&&G.commit(R)))}),We=ve(()=>{ke(!1),_.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),S?.(!1)});Ve({enabled:!v,open:P,ref:ue,onComplete(){P||We()}}),U.useImperativeHandle(v,()=>({unmount:We}),[We]);let nt=ve((A,Y)=>{s?.(A,Y),!Y.isCanceled&&x(A)}),jt=ve(A=>{let Y=Xe(A.scrollHeight,A.clientHeight),vt=Ke(A.scrollTop,Y),zt=vt>0,st=vt<Y;_.set("scrollUpArrowVisible",zt),_.set("scrollDownArrowVisible",st)}),Fe=Bo({open:P,onOpenChange:rt,elements:{reference:Rt,floating:ye}}),de=_o(Fe,{enabled:!f,event:"mousedown"}),we=Uo(Fe),Pe=jo(Fe,{enabled:!f,listRef:ne,activeIndex:be,selectedIndex:ht,disabledIndices:qt,onNavigate(A){A===null&&!P||_.set("activeIndex",A)},focusItemOnHover:T}),Ge=zo(Fe,{enabled:!f&&(P||!y&&!I),listRef:J,activeIndex:be,selectedIndex:ht,disabledIndices:o(A=>ar(ne.current[A]),"disabledIndices"),onMatch(A){P?_.set("activeIndex",A):nt(V.current[A],ce(oe.none))},onTyping(A){D.current=A}}),lo=U.useMemo(()=>it(Ge.reference,Pe.reference,we.reference,de.reference,xt),[de.reference,Ge.reference,Pe.reference,we.reference,xt]),ao=U.useMemo(()=>it(Ho,Ge.floating,Pe.floating,we.floating),[Ge.floating,Pe.floating,we.floating]),co=Pe.item??wt;_.useContextCallback("setValue",nt),_.useContextCallback("setOpen",rt),_.useContextCallback("handleScrollArrowVisibility",jt),_.useContextCallback("onOpenChangeComplete",S),pr(()=>{_.update({popupProps:ao,triggerProps:lo})}),_.useSyncedValues({id:F,modal:N,multiple:I,value:R,open:P,mounted:fe,transitionStatus:Te,popupProps:ao,triggerProps:lo,items:j,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,openMethod:yt});let mn=U.useMemo(()=>({disabled:f,readOnly:y,required:d,multiple:I,highlightItemOnHover:T,itemProps:co}),[f,y,d,I,T,co]),gn=go(H,G.inputRef),uo=I?void 0:E,Sn=U.useMemo(()=>!I||!Array.isArray(R)||!E?null:R.map(A=>{let Y=De(A,C);return(0,Be.jsx)("input",{type:"hidden",form:m,name:E,value:Y,disabled:f},Y)}),[I,R,m,E,C,f]);return(0,Be.jsxs)(Xt.Provider,{value:_,children:[(0,Be.jsx)(Kt.Provider,{value:mn,children:(0,Be.jsx)(Jt.Provider,{value:Fe,children:k})}),(0,Be.jsx)("input",{...G.getValidationProps(f,{onFocus(){_.state.triggerElement?.focus({focusVisible:!0})},onChange(A){if(A.nativeEvent.defaultPrevented||f||y)return;let Y=A.currentTarget.value,vt=ce(oe.none,A.nativeEvent);function zt(){if(I)return;let st=Y.toLowerCase(),Wt=V.current.findIndex(Gt=>De(Gt,C).toLowerCase()===st||to(Gt,g).toLowerCase()===st);Wt===-1&&(Wt=V.current.findIndex((Gt,xn)=>{let fo=J.current[xn];return fo!=null&&fo.toLowerCase()===st}));let po=V.current[Wt];po!=null&&nt(po,vt)}o(zt,"handleChange"),_.set("forceMount",!0),queueMicrotask(zt)}}),id:F&&uo==null?`${F}-hidden-input`:void 0,form:m,name:uo,autoComplete:p,value:ze,disabled:f,required:d&&!(I&&ot),readOnly:y,ref:gn,style:E?Vo:Mo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Sn]})}o(vr,"SelectRoot");var wr=b(O(),1);function Ir(e){return e==null?void 0:`${e}-label`}o(Ir,"getDefaultLabelId");function Er(e,t){return e??t}o(Er,"resolveAriaLabelledBy");var Cr=wr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=i;delete u.id;let l=qe(),m=L(),p=m.useState("triggerElement"),h=m.useState("id"),y=Ir(h),d=Co({id:y,fallbackControlId:p?.id??h,setLabelId(N){let v=typeof N=="function"?N(m.state.labelId):N;m.set("labelId",v)}});return w("div",t,{ref:r,state:l.state,props:[d,i],stateAttributesMapping:Ct})},"SelectLabel"));var Je=b(O(),1);var Gs=Yt.popupOpen,qs=Yt.pressed;var Ar="data-popup-side";var En=400,wn={...yo,...Ct,popupSide:o(e=>e?{[Ar]:e}:null,"popupSide"),value:o(()=>null,"value")},Nr=Je.forwardRef(o(function(t,r){let{render:n,className:s,id:a,disabled:i=!1,nativeButton:u=!0,style:l,...m}=t,{setTouched:p,setFocused:h,validationMode:y,validation:d,state:N,disabled:v}=qe(),{labelId:H}=ho(),S=L(),{readOnly:j,required:I,disabled:g}=Le(),C=v||g||i,M=S.useState("open"),T=S.useState("mounted"),k=S.useState("value"),Q=S.useState("triggerProps"),$=S.useState("positionerElement"),W=S.useState("listElement"),X=S.useState("popupSide"),c=S.useState("id"),z=S.useState("labelId"),q=S.useState("hasSelectedValue"),ie=T&&$?X:null,G=a??c,le=Er(H,z);At({id:a});let F=Pt($),f=Je.useRef(null),{getButtonProps:E,buttonRef:R}=Et({disabled:C,native:u}),x=S.useStateSetter("triggerElement"),P=Ye(),K=Ye(),ne=Ye();Je.useEffect(()=>{if(M)return ne.start(En,()=>{S.context.selectionRef.current.allowUnselectedMouseUp=!0,S.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ne.clear()};S.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[M,S,K,ne]);let J=it(Q,{id:G,role:"combobox","aria-expanded":M,"aria-haspopup":"listbox","aria-controls":M?W?.id??Io($)?.id:void 0,"aria-labelledby":le,"aria-readonly":j||void 0,"aria-required":I||void 0,tabIndex:C?-1:0,onFocus(ee){h(!0),M&&S.context.alignItemWithTriggerActiveRef.current&&S.context.setOpen(!1,ce(oe.none,ee.nativeEvent)),P.start(0,()=>{S.set("forceMount",!0)})},onBlur(ee){Nt($,ee.relatedTarget)||(p(!0),h(!1),y==="onBlur"&&d.commit(k))},onMouseDown(ee){if(M)return;let pe=lt(ee.currentTarget);function V(D){if(!f.current)return;let ae=D.target;Nt(f.current,ae)||Nt(F.current,ae)||lr(D,f.current)||S.context.setOpen(!1,ce(oe.cancelOpen,D))}o(V,"handleMouseUp"),K.start(0,()=>{pe.addEventListener("mouseup",V,{once:!0})})}},m,E),ue=d.getValidationProps(C,J);ue.role="combobox";let Se={...N,open:M,disabled:C,value:k,readOnly:j,popupSide:ie,placeholder:!q};return w("button",t,{ref:[r,f,R,x],state:Se,stateAttributesMapping:wn,props:ue})},"SelectTrigger"));var Tr=b(O(),1);var Cn={value:o(()=>null,"value")},Pr=Tr.forwardRef(o(function(t,r){let{className:n,render:s,children:a,placeholder:i,style:u,...l}=t,m=L(),p=m.useState("value"),h=m.useState("items"),y=m.useState("itemToStringLabel"),d=m.useState("hasSelectedValue"),N=!d&&i!=null&&a==null,v=m.useState("hasNullItemLabel",N),H={value:p,placeholder:!d},S=null;return typeof a=="function"?S=a(p):a!=null?S=a:N&&!v?S=i:Array.isArray(p)?S=br(p,h,y):S=oo(p,h,y),w("span",t,{state:H,ref:[r,m.context.valueRef],props:[{children:S},l],stateAttributesMapping:Cn})},"SelectValue"));var Mr=b(O(),1);var Vr=Mr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,m={open:L().useState("open")};return w("span",t,{state:m,ref:r,props:[{"aria-hidden":!0,children:"\u25BC"},i],stateAttributesMapping:bo})},"SelectIcon"));var Or=b(O(),1);var Lr=b(xe(),1);var Dr=Or.forwardRef(o(function(t,r){let n=L(),s=n.useState("mounted"),a=n.useState("forceMount");return s||a?(0,Lr.jsx)(Lo,{ref:r,...t}):null},"SelectPortal"));var _r=b(O(),1);var An={...Tt,...Me},Ur=_r.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),l=u.useState("open"),m=u.useState("mounted"),p=u.useState("transitionStatus");return w("div",t,{state:{open:l,transitionStatus:p},ref:r,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:An})},"SelectBackdrop"));var me=b(O(),1);var Ot=b(O(),1);var ro=Ot.createContext(void 0);function _e(){let e=Ot.useContext(ro);if(!e)throw new Error(Ie(59));return e}o(_e,"useSelectPositionerContext");function Ze(e,t){e&&Object.assign(e.style,t)}o(Ze,"clearStyles");var Lt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var dt=b(xe(),1);var Nn={position:"fixed"},kr=me.forwardRef(o(function(t,r){let{anchor:n,className:s,render:a,positionMethod:i,side:u,align:l,sideOffset:m,alignOffset:p,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:d,sticky:N,disableAnchorTracking:v,alignItemWithTrigger:H=!0,collisionAvoidance:S=Oo,style:j,...I}=t,g=L(),C=Mt(),M=g.useState("open"),T=g.useState("mounted"),k=g.useState("modal"),Q=g.useState("value"),$=g.useState("openMethod"),W=g.useState("positionerElement"),X=g.useState("triggerElement"),c=g.useState("isItemEqualToValue"),z=g.useState("transitionStatus"),q=me.useRef(null),ie=me.useRef(null),[G,le]=me.useState(H),F=T&&G&&$!=="touch";!T&&G!==H&&le(H),me.useImperativeHandle(g.context.alignItemWithTriggerActiveRef,()=>F),Jo((F||k)&&M,$==="touch",W,X);let f=Yo({anchor:n,floatingRootContext:C,positionMethod:i,mounted:T,side:u,sideOffset:m,align:l,alignOffset:p,arrowPadding:d,collisionBoundary:h,collisionPadding:y,sticky:N,disableAnchorTracking:v??F,collisionAvoidance:S,keepMounted:!0}),E=F?"none":f.side,R=F?Nn:f.positionerStyles,x={open:M,side:E,align:f.align,anchorHidden:f.anchorHidden};te(()=>{g.set("popupSide",f.side)},[g,f.side]);let P=g.useStateSetter("positionerElement"),K=Ko(t,x,{styles:R,transitionStatus:z,props:I,refs:[r,P],hidden:!T,inert:!M}),ne=me.useRef(0),J=ve(Se=>{if(g.context.valuesRef.current.length===0)return;let ee=ne.current;ne.current=Se.size;let pe=ce(oe.none);if(ee!==0&&!g.state.multiple&&Q!==null&&ft(g.context.valuesRef.current,Q,c)===-1){let D=g.context.initialValueRef.current,Z=D!=null&&ft(g.context.valuesRef.current,D,c)!==-1?D:null;g.context.setValue(Z,pe),Z===null&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null)}if(ee!==0&&g.state.multiple&&Array.isArray(Q)){let V=Q.filter(D=>ft(g.context.valuesRef.current,D,c)!==-1);V.length!==Q.length&&(g.context.setValue(V,pe),V.length===0&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null))}if(M&&F){g.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let V={height:""};Ze(W,V),Ze(g.context.popupRef.current,V)}}),ue=me.useMemo(()=>({...f,side:E,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:q,scrollDownArrowRef:ie}),[f,E,F,le]);return(0,dt.jsx)(ir,{elementsRef:g.context.listRef,labelsRef:g.context.labelsRef,onMapChange:J,children:(0,dt.jsxs)(ro.Provider,{value:ue,children:[T&&k&&(0,dt.jsx)($o,{inert:Go(!M),cutout:X}),K]})})},"SelectPositioner"));var ge=b(O(),1);var no="--transform-origin";var Ut=b(xe(),1);var Pn={...Tt,...Me},jr=ge.forwardRef(o(function(t,r){let{render:n,className:s,style:a,finalFocus:i,...u}=t,l=L(),{multiple:m,readOnly:p,highlightItemOnHover:h}=Le(),y=Mt(),{side:d,align:N,alignItemWithTriggerActive:v,isPositioned:H,setControlledAlignItemWithTrigger:S}=_e(),j=Qo(!0)!=null,I=qo(),{nonce:g,disableStyleElements:C}=cr(),M=l.useState("id"),T=l.useState("open"),k=l.useState("openMethod"),Q=l.useState("mounted"),$=l.useState("popupProps"),W=l.useState("transitionStatus"),X=l.useState("triggerElement"),c=l.useState("positionerElement"),z=l.useState("listElement"),q=ge.useRef(!1),ie=ge.useRef(!1),G=ge.useRef({}),le=Ao(),F=ve(x=>{if(!c||!l.context.popupRef.current||!ie.current)return;let P=c.style.top==="0px",K=c.style.bottom==="0px";if(q.current||!v||!P&&!K){l.context.handleScrollArrowVisibility(x);return}let ne=Hr(c),J=mt(c.getBoundingClientRect().height,"y",ne),ue=lt(c),Se=It(c),ee=Se.getComputedStyle(c),pe=parseFloat(ee.marginTop),V=parseFloat(ee.marginBottom),D=Fr(Se.getComputedStyle(l.context.popupRef.current)),ae=Math.min(ue.documentElement.clientHeight-pe-V,D),Z=x.scrollTop,Ue=Dt(x),Ae=null,Ne=o(se=>{c.style.height=`${se}px`},"setHeight"),fe=P?Ue-Z:Z,ke=Math.min(J+fe,ae);if(fe<=he){let se=ut(fe,0,ae-J);se>0&&Ne(J+se),x.scrollTop=P?Ue:0,ae-(J+se)<=he&&(q.current=!0),l.context.handleScrollArrowVisibility(x);return}if(ae-ke>he)Ae=P?1/0:0;else if(K&&Z<Ue){let se=J+fe-ae;Ae=Z-(fe-se)}let Te=Math.ceil(ke);if(Te!==0&&Ne(Te),Ae!=null){let se=ut(Ae,0,Dt(x));Math.abs(x.scrollTop-se)>he&&(x.scrollTop=se)}Te>=ae-he&&(q.current=!0),l.context.handleScrollArrowVisibility(x)});ge.useImperativeHandle(l.context.scrollHandlerRef,()=>F,[F]),Ve({open:T,ref:l.context.popupRef,onComplete(){T&&l.context.onOpenChangeComplete(!0)}});let f={open:T,transitionStatus:W,side:d,align:N};te(()=>{!c||!l.context.popupRef.current||Object.keys(G.current).length||(G.current={top:c.style.top||"0",left:c.style.left||"0",right:c.style.right,height:c.style.height,bottom:c.style.bottom,minHeight:c.style.minHeight,maxHeight:c.style.maxHeight,marginTop:c.style.marginTop,marginBottom:c.style.marginBottom})},[l,c]),te(()=>{T||v||(ie.current=!1,q.current=!1,Ze(c,G.current))},[T,v,c]),te(()=>{let x=l.context.popupRef.current;if(!T||!X||!c||!x||v&&!H||l.state.transitionStatus==="ending")return;if(ie.current=!0,x.style.removeProperty(no),!v){le.request(()=>l.context.handleScrollArrowVisibility(z||x));return}let P=Mn(x);try{let K=l.context.selectedItemTextRef.current;K?.isConnected||(K=!l.select("hasSelectedValue")&&l.context.firstItemTextRef.current?.isConnected?l.context.firstItemTextRef.current:null);let ne=l.context.valueRef.current,J=It(c),ue=J.getComputedStyle(c),Se=J.getComputedStyle(x),ee=lt(X),pe=Hr(X),V=_t(X.getBoundingClientRect(),pe),D=_t(c.getBoundingClientRect(),pe),ae=V.height,Z=z||x,Ue=Z.scrollHeight,Ae=parseFloat(Se.borderBottomWidth),Ne=parseFloat(ue.marginTop)||10,fe=parseFloat(ue.marginBottom)||10,ke=parseFloat(ue.minHeight)||100,Te=Fr(Se),se=5,xt=5,_=20,be=ee.documentElement.clientHeight-Ne-fe,ht=ee.documentElement.clientWidth,Rt=be-V.bottom+ae,ye,bt=I==="rtl"?V.right-D.width:V.left,yt=0;if(K&&ne){let de=_t(ne.getBoundingClientRect(),pe);ye=_t(K.getBoundingClientRect(),pe),bt=D.left+(I==="rtl"?de.right-ye.right:de.left-ye.left);let we=de.top-V.top+de.height/2;yt=ye.top-D.top+ye.height/2-we}let ze=Rt+yt+fe+Ae,Ee=Math.min(be,ze),Bt=be-Ne-fe,tt=ze-Ee,ot=ht-xt;c.style.left=`${ut(bt,se,ot-D.width)}px`,c.style.height=`${Ee}px`,c.style.maxHeight="none",c.style.marginTop=`${Ne}px`,c.style.marginBottom=`${fe}px`,x.style.height="100%";let rt=Dt(Z),We=tt>=rt-he;We&&(Ee=Math.min(be,D.height)-(tt-rt));let nt=V.top<_||V.bottom>be-_||Math.ceil(Ee)+he<Math.min(Ue,ke),jt=(J.visualViewport?.scale??1)!==1&&Ro.engine.webkit;if(nt||jt){Ze(c,G.current),S(!1);return}let Fe=Math.max(ke,Ee);if(We){let de=Math.max(0,be-ze);c.style.top=D.height>=Bt?"0":`${de}px`,c.style.height=`${Ee}px`,Z.scrollTop=Dt(Z)}else c.style.bottom="0",Z.scrollTop=tt;if(ye){let de=D.top,we=D.height,Pe=ye.top+ye.height/2,Ge=ut(we>0?(Pe-de)/we*100:50,0,100);x.style.setProperty(no,`50% ${Ge}%`)}(Fe===be||Ee>=Te)&&(q.current=!0),l.context.handleScrollArrowVisibility(Z),h&&l.state.selectedIndex===null&&l.state.activeIndex===null&&l.context.listRef.current[0]!=null&&l.set("activeIndex",0)}finally{P()}},[l,T,c,X,v,S,le,z,h,I,H]),ge.useEffect(()=>{if(!v||!c||!T)return;let x=It(c);function P(K){l.context.setOpen(!1,ce(oe.windowResize,K))}return o(P,"handleResize"),Po(x,"resize",P)},[l,v,c,T]);let E={...z?{role:"presentation"}:{role:"listbox","aria-multiselectable":m||void 0,"aria-readonly":p||void 0,id:`${M}-list`},onKeyDown(x){j&&Zo.has(x.key)&&x.stopPropagation()},onScroll(x){z||F(x.currentTarget)},...v&&{style:z?{height:"100%"}:Lt},className:!z&&v?pt.className:void 0},R=w("div",t,{ref:[r,l.context.popupRef],state:f,stateAttributesMapping:Pn,props:[$,E,Xo(W),u]});return(0,Ut.jsxs)(ge.Fragment,{children:[!C&&pt.getElement(g),(0,Ut.jsx)(Do,{context:y,modal:!1,disabled:!Q,openInteractionType:k,returnFocus:i,restoreFocus:!0,children:R})]})},"SelectPopup"));function Fr(e){let t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}o(Fr,"getMaxPopupHeight");function Dt(e){return Xe(e.scrollHeight,e.clientHeight)}o(Dt,"getMaxScrollTop");function Hr(e){return ko.getScale(e)}o(Hr,"getScale");function mt(e,t,r){return e/r[t]}o(mt,"normalizeSize");function _t(e,t){return wo({x:mt(e.x,"x",t),y:mt(e.y,"y",t),width:mt(e.width,"x",t),height:mt(e.height,"y",t)})}o(_t,"normalizeRect");var Br=[["transform","none"],["scale","1"],["translate","0 0"]];function Mn(e){let{style:t}=e,r={};for(let[n,s]of Br)r[n]=t.getPropertyValue(n),t.setProperty(n,s,"important");return()=>{for(let[n]of Br){let s=r[n];s?t.setProperty(n,s):t.removeProperty(n)}}}o(Mn,"unsetTransformStyles");var zr=b(O(),1);var Wr=zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{multiple:l,readOnly:m}=Le(),{alignItemWithTriggerActive:p}=_e(),h=u.useState("hasScrollArrows"),y=u.useState("openMethod"),N={id:`${u.useState("id")}-list`,role:"listbox","aria-multiselectable":l||void 0,"aria-readonly":m||void 0,onScroll(H){u.context.scrollHandlerRef.current?.(H.currentTarget)},...p&&{style:Lt},className:h&&y!=="touch"?pt.className:void 0},v=u.useStateSetter("listElement");return w("div",t,{ref:[r,v],props:[N,i]})},"SelectList"));var Re=b(O(),1);var kt=b(O(),1);var so=kt.createContext(void 0);function gt(){let e=kt.useContext(so);if(!e)throw new Error(Ie(57));return e}o(gt,"useSelectItemContext");var Gr=b(xe(),1);var qr=Re.memo(Re.forwardRef(o(function(t,r){let{render:n,className:s,style:a,value:i=null,label:u,disabled:l=!1,nativeButton:m=!1,...p}=t,h=Re.useRef(null),y=sr({guess:!0,label:u,textRef:h}),d=L(),{itemProps:N,multiple:v,disabled:H,readOnly:S}=Le(),j=H||l,I=d.useState("isActive",y.index),g=d.useState("open"),C=d.useState("isSelected",i),M=d.useState("isSelectedByFocus",y.index),T=d.useState("isItemEqualToValue"),k=y.index,Q=Re.useRef(null);te(()=>{let f=d.context.valuesRef.current;return f[k]=i,()=>{delete f[k]}},[k,i,d]),te(()=>{let f=d.state.value,E=d.state.selectedIndex,R=E,x;v&&Array.isArray(f)?(R=mr(k,i,d.context.valuesRef.current,f,T,E),x=R===k,k===E&&!x&&(d.context.selectedItemTextRef.current=null)):(x=f!==void 0&&Ce(i,f,T),x&&(R=k)),d.set("selectedIndex",R),x&&h.current&&(d.context.selectedItemTextRef.current=h.current)},[k,v,T,d,i]);let $=Re.useRef("mouse"),W=Re.useRef(!1),{getButtonProps:X,buttonRef:c}=Et({disabled:j,focusableWhenDisabled:!0,native:m,composite:!0}),z={disabled:j,selected:C,highlighted:I};function q(f){if(H||S)return;let E=d.state.value;if(v){let R=Array.isArray(E)?E:[],x=C?gr(R,i,T):[...R,i];d.context.setValue(x,ce(oe.itemPress,f))}else d.context.setValue(i,ce(oe.itemPress,f)),d.context.setOpen(!1,ce(oe.itemPress,f))}o(q,"commitSelection");function ie(){d.context.selectionRef.current.dragY=0}o(ie,"resetDragMovement");let G={role:"option","aria-selected":C,tabIndex:g&&I?0:-1,onKeyDown(f){d.set("activeIndex",k),f.key===" "&&d.context.typingRef.current&&f.preventDefault()},onClick(f){let E=$.current!=="touch",R=f.nativeEvent.pointerType,x=E&&Eo(f.nativeEvent)&&(R!==void 0||I),P=E&&!x&&!W.current;W.current=!1,!(j||P)&&q(f.nativeEvent)},onPointerEnter(f){$.current=f.pointerType},onPointerMove(f){if(f.pointerType==="mouse"&&f.buttons===1){let E=d.context.selectionRef.current;E.dragY+=f.movementY,E.dragY**2>=64&&(E.allowUnselectedMouseUp=!0)}},onPointerDown(f){$.current=f.pointerType,W.current=!0,ie()},onMouseUp(){if(ie(),j||$.current==="touch"||W.current)return;let f=!d.context.selectionRef.current.allowSelectedMouseUp&&C,E=!d.context.selectionRef.current.allowUnselectedMouseUp&&!C;f||E||(W.current=!0,Q.current?.click(),W.current=!1)}},le=w("div",t,{ref:[c,r,y.ref,Q],state:z,props:[N,G,p,X]}),F=Re.useMemo(()=>({selected:C,index:k,textRef:h,selectedByFocus:M}),[C,k,h,M]);return(0,Gr.jsx)(so.Provider,{value:F,children:le})},"SelectItem")));var je=b(O(),1);var Yr=b(xe(),1);var $r=je.forwardRef(o(function(t,r){let{selected:n}=gt();return t.keepMounted||n?(0,Yr.jsx)(Vn,{...t,ref:r}):null},"SelectItemIndicator")),Vn=je.memo(je.forwardRef((e,t)=>{let{render:r,className:n,style:s,keepMounted:a,...i}=e,{selected:u}=gt(),l=je.useRef(null),{transitionStatus:m,setMounted:p}=$e(u),y=w("span",e,{ref:[t,l],state:{selected:u,transitionStatus:m},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},i],stateAttributesMapping:Me});return Ve({batch:!0,enabled:!u,open:u,ref:l,onComplete(){u||p(!1)}}),y}));var Qe=b(O(),1);var Xr=Qe.memo(Qe.forwardRef(o(function(t,r){let{index:n,textRef:s,selectedByFocus:a}=gt(),i=L(),{render:u,className:l,style:m,...p}=t,h=Qe.useCallback(d=>{d&&(n===0&&(i.context.firstItemTextRef.current=d),a&&(i.context.selectedItemTextRef.current=d))},[i,n,a]);return w("div",t,{ref:[h,r,s],props:p})},"SelectItemText")));var Kr=b(O(),1);var Jr=Kr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{side:l,align:m,arrowRef:p,arrowStyles:h,arrowUncentered:y,alignItemWithTriggerActive:d}=_e(),v={open:u.useState("open"),side:l,align:m,uncentered:y},H=w("div",t,{state:v,ref:[p,r],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:vo});return d?null:H},"SelectArrow"));var Qr=b(O(),1);var Zr=b(O(),1);var Ft=Zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,direction:i,keepMounted:u,...l}=t,m=i==="up",p=L(),{side:h,scrollDownArrowRef:y,scrollUpArrowRef:d}=_e(),N=m?"scrollUpArrowVisible":"scrollDownArrowVisible",v=p.useState(N),H=p.useState("openMethod"),S=v&&H!=="touch",j=Ye(),I=m?d:y,{mounted:g,transitionStatus:C,setMounted:M}=$e(S);te(()=>(p.context.scrollArrowsMountedCountRef.current+=1,p.set("hasScrollArrows",!0),()=>{p.context.scrollArrowsMountedCountRef.current=Math.max(0,p.context.scrollArrowsMountedCountRef.current-1),p.context.scrollArrowsMountedCountRef.current===0&&p.set("hasScrollArrows",!1)}),[p]),Ve({open:S,ref:I,onComplete(){S||M(!1)}});let Q=w("div",t,{ref:[r,I],state:{direction:i,visible:S,side:h,transitionStatus:C},props:[{"aria-hidden":!0,children:m?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(W){if(W.movementX===0&&W.movementY===0||j.isStarted())return;p.set("activeIndex",null);function X(){let c=p.state.listElement??p.context.popupRef.current;if(!c)return;p.set("activeIndex",null),p.context.handleScrollArrowVisibility(c);let z=Xe(c.scrollHeight,c.clientHeight),q=Ke(c.scrollTop,z),ie=q===(m?0:z),G=p.context.listRef.current;if(q!==c.scrollTop&&(c.scrollTop=q),ie){j.clear();return}if(G.length>0){let le=I.current?.offsetHeight||0;c.scrollTop=On(G,m,q,c.clientHeight,le,z)}j.start(40,X)}o(X,"scrollNextItem"),j.start(40,X)},onMouseLeave(){j.clear()}},l],stateAttributesMapping:Me});return g||u?Q:null},"SelectScrollArrow"));function On(e,t,r,n,s,a){if(t){let p=0,h=r+s-he;for(let N=0;N<e.length;N+=1){let v=e[N];if(v&&v.offsetTop>=h){p=N;break}}let y=Math.max(0,p-1),d=e[y];return y<p&&d?Ke(d.offsetTop-s,a):0}let i=e.length-1,u=r+n-s+he;for(let p=0;p<e.length;p+=1){let h=e[p];if(h&&h.offsetTop+h.offsetHeight>u){i=Math.max(0,p-1);break}}let l=Math.min(e.length-1,i+1),m=e[l];return l>i&&m?Ke(m.offsetTop+m.offsetHeight-n+s,a):a}o(On,"getTargetScrollTop");var en=b(xe(),1);var tn=Qr.forwardRef(o(function(t,r){return(0,en.jsx)(Ft,{...t,ref:r,direction:"down"})},"SelectScrollDownArrow"));var on=b(O(),1);var rn=b(xe(),1);var nn=on.forwardRef(o(function(t,r){return(0,rn.jsx)(Ft,{...t,ref:r,direction:"up"})},"SelectScrollUpArrow"));var et=b(O(),1);var Ht=b(O(),1);var io=Ht.createContext(void 0);function sn(){let e=Ht.useContext(io);if(e===void 0)throw new Error(Ie(56));return e}o(sn,"useSelectGroupContext");var ln=b(xe(),1);var an=et.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,[u,l]=et.useState(),m=et.useMemo(()=>({labelId:u,setLabelId:l}),[u,l]),p=w("div",t,{ref:r,props:[{role:"group","aria-labelledby":u},i]});return(0,ln.jsx)(io.Provider,{value:m,children:p})},"SelectGroup"));var cn=b(O(),1);var un=cn.forwardRef(o(function(t,r){let{render:n,className:s,style:a,id:i,...u}=t,{setLabelId:l}=sn(),m=xo(i);return te(()=>(l(m),()=>{l(h=>h===m?void 0:h)}),[m,l]),w("div",t,{ref:r,props:[{id:m,"aria-hidden":!0},u]})},"SelectGroupLabel"));var pn=b(O(),1);var fn=pn.forwardRef(o(function(t,r){let{className:n,render:s,orientation:a="horizontal",style:i,...u}=t;return w("div",t,{state:{orientation:a},ref:r,props:[{role:"presentation"},u]})},"ListboxSeparator"));var dn=fn;var B=b(xe(),1);var hc=re.Root;function Rc(e){let t=(0,St.c)(8),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("flex flex-1 text-start",r),t[3]=r,t[4]=s):s=t[4];let a;return t[5]!==n||t[6]!==s?(a=(0,B.jsx)(re.Value,{"data-slot":"select-value",className:s,...n}),t[5]=n,t[6]=s,t[7]=a):a=t[7],a}o(Rc,"$");function bc({className:e,size:t="default",children:r,...n}){return(0,B.jsxs)(re.Trigger,{"data-slot":"select-trigger","data-size":t,className:He("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *: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-4",e),...n,children:[r,(0,B.jsx)(re.Icon,{render:(0,B.jsx)(ct,{icon:nr,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}o(bc,"j");function yc({className:e,children:t,side:r="bottom",sideOffset:n=4,align:s="center",alignOffset:a=0,alignItemWithTrigger:i=!0,...u}){return(0,B.jsx)(re.Portal,{children:(0,B.jsx)(re.Positioner,{side:r,sideOffset:n,align:s,alignOffset:a,alignItemWithTrigger:i,className:"isolate z-50",children:(0,B.jsxs)(re.Popup,{"data-slot":"select-content","data-align-trigger":i,className:He("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md 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-start-2 data-[side=inline-start]:slide-in-from-end-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 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...u,children:[(0,B.jsx)(Ln,{}),(0,B.jsx)(re.List,{children:t}),(0,B.jsx)(Dn,{})]})})})}o(yc,"A");function vc(e){let t=(0,St.c)(13),r,n,s;t[0]!==e?({className:n,children:r,...s}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=s):(r=t[1],n=t[2],s=t[3]);let a;t[4]!==n?(a=He("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs 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-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=a):a=t[5];let i;t[6]!==r?(i=(0,B.jsx)(re.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:r}),t[6]=r,t[7]=i):i=t[7];let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,B.jsx)(re.ItemIndicator,{render:(0,B.jsx)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:(0,B.jsx)(ct,{icon:rr,strokeWidth:2,className:"pointer-events-none"})}),t[8]=u):u=t[8];let l;return t[9]!==s||t[10]!==a||t[11]!==i?(l=(0,B.jsxs)(re.Item,{"data-slot":"select-item",className:a,...s,children:[i,u]}),t[9]=s,t[10]=a,t[11]=i,t[12]=l):l=t[12],l}o(vc,"U");function Ln(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:or,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Ln,"x");function Dn(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:tr,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Dn,"w");export{hc as a,Rc as b,bc as c,yc as d,vc as e};
|
|
1
|
+
import{a as ut,b as he,c as Xe,d as Ke,e as pt,f as cr}from"./chunk-O3AZ7JKE.js";import{a as sr,b as ir,c as lr,d as ar}from"./chunk-VNH4OBJS.js";import{B as Do,C as _o,E as Uo,F as ko,G as Fo,J as Ho,X as Bo,a as Eo,aa as jo,ba as zo,e as wo,ea as Wo,fa as Go,la as Yo,ma as $o,na as Xo,o as Pt,oa as Ko,qa as Jo,r as Oo,ra as Zo,sa as Qo,ta as er,u as Lo}from"./chunk-XLYFGUEF.js";import{a as Po,b as qo}from"./chunk-D65UVZIA.js";import{a as Mo,b as Vo}from"./chunk-NGVP66OH.js";import{a as tr,b as or,i as rr,j as nr,k as ct}from"./chunk-QAOZXPLU.js";import{a as Ct,b as qe,c as So,d as ho,e as At,f as Co,h as No}from"./chunk-EU4ZGNNW.js";import{A as Io,D as Ye,F as Ao,I as Ve,J as $e,K as $t,L as To,M as oe,N as ce,b as xo,c as Ro,e as Nt,l as Me,n as Yt,o as bo,p as yo,q as Tt,r as vo}from"./chunk-HFBSWKJS.js";import{c as Et}from"./chunk-JMZT3CEW.js";import{b as It,u as ve,v as te,w as lt}from"./chunk-VUOEJJUH.js";import{a as mo,b as it,d as Ie,e as go,g as at,h as qt,i as wt,j as w}from"./chunk-YUVGMKHG.js";import{x as He}from"./chunk-BVANRUU4.js";import{a as Rn}from"./chunk-GWNGVKLG.js";import{a as O,b as xe}from"./chunk-6G3E4PJ2.js";import{a as o,c as hn,d as b}from"./chunk-5PEAXTYQ.js";var St=b(Rn(),1);var re={};hn(re,{Arrow:()=>Jr,Backdrop:()=>Ur,Group:()=>an,GroupLabel:()=>un,Icon:()=>Vr,Item:()=>qr,ItemIndicator:()=>$r,ItemText:()=>Xr,Label:()=>Cr,List:()=>Wr,Popup:()=>jr,Portal:()=>Dr,Positioner:()=>kr,Root:()=>vr,ScrollDownArrow:()=>tn,ScrollUpArrow:()=>nn,Separator:()=>dn,Trigger:()=>Nr,Value:()=>Pr});var U=b(O(),1);var ur=b(O(),1);function pr(e){let t=ur.useRef(!0);t.current&&(t.current=!1,e())}o(pr,"useOnFirstRender");var Oe=b(O(),1);var Xt=Oe.createContext(void 0),Kt=Oe.createContext(void 0),Jt=Oe.createContext(void 0);function L(){let e=Oe.useContext(Xt);if(e===void 0)throw new Error(Ie(60));return e}o(L,"useSelectRootContext");function Le(){let e=Oe.useContext(Kt);if(e===void 0)throw new Error(Ie(101));return e}o(Le,"useSelectRootPropsContext");function Mt(){let e=Oe.useContext(Jt);if(e===void 0)throw new Error(Ie(61));return e}o(Mt,"useSelectFloatingContext");function fr(e,t,r=Object.is){let{length:n}=e;if(n!==t.length)return!1;for(let s=0;s<n;s+=1)if(!r(e[s],t[s]))return!1;return!0}o(fr,"areArraysEqual");var Qt=o((e,t)=>Object.is(e,t),"defaultItemEquality");function Ce(e,t,r){return e==null||t==null?Object.is(e,t):r(e,t)}o(Ce,"compareItemEquality");function dr(e,t,r){return Array.isArray(e)&&Array.isArray(t)?!fr(e,t,(n,s)=>Ce(n,s,r)):e!==t}o(dr,"isSelectedValueDirty");function Zt(e,t,r){return e?e.some(n=>n===void 0?!1:Ce(t,n,r)):!1}o(Zt,"selectedValueIncludes");function ft(e,t,r){return e?e.findIndex(n=>n===void 0?!1:Ce(n,t,r)):-1}o(ft,"findItemIndex");function bn(e,t){if(t!==Qt)return n=>Zt(e,n,t);let r=new Set(e);return r.delete(void 0),n=>r.has(n)&&(n!==0||e.some(s=>Object.is(n,s)))}o(bn,"createSelectionMatcher");function eo(e,t,r,n){let s=n&&Array.isArray(t)?e.findIndex(bn(t,r)):ft(e,t,r);return s===-1?null:s}o(eo,"findSelectionIndex");function mr(e,t,r,n,s,a){return Zt(n,t,s)?a!=null&&e>a&&Zt(n,r[a],s)?a:e:e===a?eo(r,n,s,!0):a}o(mr,"resolveSelectedIndex");function gr(e,t,r){return e.filter(n=>!Ce(t,n,r))}o(gr,"removeItem");var Sr=b(O(),1);function Vt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}o(Vt,"serializeValue");var xr=b(xe(),1);function yn(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}o(yn,"isGroup");function hr(e){return yn(e?.[0])}o(hr,"isGroupedItems");function vn(e){return hr(e)?e.flatMap(t=>t.items):e}o(vn,"flattenLeafItems");function Rr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(hr(t)){for(let r of t)for(let n of r.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let r of t)if(r&&r.value==null&&r.label!=null)return!0;return!1}o(Rr,"hasNullItemLabel");function to(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 Vt(e)}o(to,"stringifyAsLabel");function De(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Vt(e.value):Vt(e)}o(De,"stringifyAsValue");function oo(e,t,r){function n(){return to(e,r)}if(o(n,"fallback"),r&&e!=null)return r(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??n();if(Array.isArray(t)){let a=vn(t);if(e==null||typeof e!="object"){let i=a.find(u=>u.value===e);return i&&i.label!=null?i.label:n()}if("value"in e){let i=a.find(u=>u&&u.value===e.value);if(i&&i.label!=null)return i.label}}return n()}o(oo,"resolveSelectedLabel");function br(e,t,r){return e.reduce((n,s,a)=>(a>0&&n.push(", "),n.push((0,xr.jsx)(Sr.Fragment,{children:oo(s,t,r)},a)),n),[])}o(br,"resolveMultipleLabels");var yr={id:o(e=>e.id,"id"),labelId:o(e=>e.labelId,"labelId"),modal:o(e=>e.modal,"modal"),items:o(e=>e.items,"items"),itemToStringLabel:o(e=>e.itemToStringLabel,"itemToStringLabel"),isItemEqualToValue:o(e=>e.isItemEqualToValue,"isItemEqualToValue"),value:o(e=>e.value,"value"),hasSelectedValue:o(e=>{let{value:t,multiple:r,itemToStringValue:n}=e;return t==null?!1:r&&Array.isArray(t)?t.length>0:De(t,n)!==""},"hasSelectedValue"),hasNullItemLabel:o((e,t)=>t?Rr(e.items):!1,"hasNullItemLabel"),open:o(e=>e.open,"open"),mounted:o(e=>e.mounted,"mounted"),forceMount:o(e=>e.forceMount,"forceMount"),transitionStatus:o(e=>e.transitionStatus,"transitionStatus"),openMethod:o(e=>e.openMethod,"openMethod"),activeIndex:o(e=>e.activeIndex,"activeIndex"),selectedIndex:o(e=>e.selectedIndex,"selectedIndex"),isActive:o((e,t)=>e.activeIndex===t,"isActive"),isSelected:o((e,t)=>{let r=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(s=>Ce(t,s,r)):Ce(t,n,r)},"isSelected"),isSelectedByFocus:o((e,t)=>e.selectedIndex===t,"isSelectedByFocus"),popupProps:o(e=>e.popupProps,"popupProps"),triggerProps:o(e=>e.triggerProps,"triggerProps"),triggerElement:o(e=>e.triggerElement,"triggerElement"),positionerElement:o(e=>e.positionerElement,"positionerElement"),listElement:o(e=>e.listElement,"listElement"),popupSide:o(e=>e.popupSide,"popupSide"),scrollUpArrowVisible:o(e=>e.scrollUpArrowVisible,"scrollUpArrowVisible"),scrollDownArrowVisible:o(e=>e.scrollDownArrowVisible,"scrollDownArrowVisible"),hasScrollArrows:o(e=>e.hasScrollArrows,"hasScrollArrows")};var Be=b(xe(),1);function vr(e){let{id:t,value:r,defaultValue:n=null,onValueChange:s,open:a,defaultOpen:i=!1,onOpenChange:u,name:l,form:m,autoComplete:p,disabled:h=!1,readOnly:y=!1,required:d=!1,modal:N=!0,actionsRef:v,inputRef:H,onOpenChangeComplete:S,items:j,multiple:I=!1,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M=Qt,highlightItemOnHover:T=!0,children:k}=e,{clearErrors:Q}=So(),{setDirty:$,setTouched:W,setFocused:X,validityData:c,setFilled:z,name:q,disabled:ie,validation:G,validationMode:le}=qe(),F=At({id:t}),f=ie||h,E=q??l,[R,x]=$t({controlled:r,default:I?n??qt:n,name:"Select",state:"value"}),[P,K]=$t({controlled:a,default:i,name:"Select",state:"open"}),ne=U.useRef([]),J=U.useRef([]),ue=U.useRef(null),Se=U.useRef(null),ee=U.useRef(0),pe=U.useRef(null),V=U.useRef([]),D=U.useRef(!1),ae=U.useRef(null),Z=U.useRef(null),Ue=U.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ae=U.useRef(!1),Ne=U.useRef(R),{mounted:fe,setMounted:ke,transitionStatus:Te}=$e(P),{openMethod:se,triggerProps:xt}=Wo(P),_=mo(()=>new Fo({id:F,labelId:void 0,modal:N,multiple:I,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,value:R,open:P,mounted:fe,transitionStatus:Te,items:j,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:wt,triggerProps:wt,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:at,setOpen:at,handleScrollArrowVisibility:at,onOpenChangeComplete:at,listRef:ne,popupRef:ue,scrollHandlerRef:Se,scrollArrowsMountedCountRef:ee,valueRef:pe,valuesRef:V,labelsRef:J,typingRef:D,selectionRef:Ue,firstItemTextRef:ae,selectedItemTextRef:Z,alignItemWithTriggerActiveRef:Ae,initialValueRef:Ne},yr)).current,be=_.useState("activeIndex"),ht=_.useState("selectedIndex"),Rt=_.useState("triggerElement"),ye=_.useState("positionerElement"),bt=er(se),yt=se??bt,ze=U.useMemo(()=>I?"":De(R,C),[I,R,C]),Ee=U.useMemo(()=>I&&Array.isArray(R)?R.map(A=>De(A,C)):De(R,C),[I,R,C]),Bt=Pt(Rt),tt=ve(()=>Ee);No(Bt,F,R,tt,!f,l);let ot=I?Array.isArray(R)&&R.length>0:R!=null&&ze!=="";te(()=>{z(ot)},[ot,z]),te(o(function(){let Y=eo(V.current,R,M,I);Y===null&&(Z.current=null),!P&&_.set("selectedIndex",Y)},"syncSelectedIndex"),[I,P,R,M,_]),To(R,()=>{Q(E),$(dr(R,c.initialValue,M)),G.change(R)});let rt=ve((A,Y)=>{u?.(A,Y),!Y.isCanceled&&(K(A),!A&&(Y.reason===oe.focusOut||Y.reason===oe.outsidePress)&&(W(!0),X(!1),le==="onBlur"&&G.commit(R)))}),We=ve(()=>{ke(!1),_.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),S?.(!1)});Ve({enabled:!v,open:P,ref:ue,onComplete(){P||We()}}),U.useImperativeHandle(v,()=>({unmount:We}),[We]);let nt=ve((A,Y)=>{s?.(A,Y),!Y.isCanceled&&x(A)}),jt=ve(A=>{let Y=Xe(A.scrollHeight,A.clientHeight),vt=Ke(A.scrollTop,Y),zt=vt>0,st=vt<Y;_.set("scrollUpArrowVisible",zt),_.set("scrollDownArrowVisible",st)}),Fe=Bo({open:P,onOpenChange:rt,elements:{reference:Rt,floating:ye}}),de=_o(Fe,{enabled:!f,event:"mousedown"}),we=Uo(Fe),Pe=jo(Fe,{enabled:!f,listRef:ne,activeIndex:be,selectedIndex:ht,disabledIndices:qt,onNavigate(A){A===null&&!P||_.set("activeIndex",A)},focusItemOnHover:T}),Ge=zo(Fe,{enabled:!f&&(P||!y&&!I),listRef:J,activeIndex:be,selectedIndex:ht,disabledIndices:o(A=>ar(ne.current[A]),"disabledIndices"),onMatch(A){P?_.set("activeIndex",A):nt(V.current[A],ce(oe.none))},onTyping(A){D.current=A}}),lo=U.useMemo(()=>it(Ge.reference,Pe.reference,we.reference,de.reference,xt),[de.reference,Ge.reference,Pe.reference,we.reference,xt]),ao=U.useMemo(()=>it(Ho,Ge.floating,Pe.floating,we.floating),[Ge.floating,Pe.floating,we.floating]),co=Pe.item??wt;_.useContextCallback("setValue",nt),_.useContextCallback("setOpen",rt),_.useContextCallback("handleScrollArrowVisibility",jt),_.useContextCallback("onOpenChangeComplete",S),pr(()=>{_.update({popupProps:ao,triggerProps:lo})}),_.useSyncedValues({id:F,modal:N,multiple:I,value:R,open:P,mounted:fe,transitionStatus:Te,popupProps:ao,triggerProps:lo,items:j,itemToStringLabel:g,itemToStringValue:C,isItemEqualToValue:M,openMethod:yt});let mn=U.useMemo(()=>({disabled:f,readOnly:y,required:d,multiple:I,highlightItemOnHover:T,itemProps:co}),[f,y,d,I,T,co]),gn=go(H,G.inputRef),uo=I?void 0:E,Sn=U.useMemo(()=>!I||!Array.isArray(R)||!E?null:R.map(A=>{let Y=De(A,C);return(0,Be.jsx)("input",{type:"hidden",form:m,name:E,value:Y,disabled:f},Y)}),[I,R,m,E,C,f]);return(0,Be.jsxs)(Xt.Provider,{value:_,children:[(0,Be.jsx)(Kt.Provider,{value:mn,children:(0,Be.jsx)(Jt.Provider,{value:Fe,children:k})}),(0,Be.jsx)("input",{...G.getValidationProps(f,{onFocus(){_.state.triggerElement?.focus({focusVisible:!0})},onChange(A){if(A.nativeEvent.defaultPrevented||f||y)return;let Y=A.currentTarget.value,vt=ce(oe.none,A.nativeEvent);function zt(){if(I)return;let st=Y.toLowerCase(),Wt=V.current.findIndex(Gt=>De(Gt,C).toLowerCase()===st||to(Gt,g).toLowerCase()===st);Wt===-1&&(Wt=V.current.findIndex((Gt,xn)=>{let fo=J.current[xn];return fo!=null&&fo.toLowerCase()===st}));let po=V.current[Wt];po!=null&&nt(po,vt)}o(zt,"handleChange"),_.set("forceMount",!0),queueMicrotask(zt)}}),id:F&&uo==null?`${F}-hidden-input`:void 0,form:m,name:uo,autoComplete:p,value:ze,disabled:f,required:d&&!(I&&ot),readOnly:y,ref:gn,style:E?Vo:Mo,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Sn]})}o(vr,"SelectRoot");var wr=b(O(),1);function Ir(e){return e==null?void 0:`${e}-label`}o(Ir,"getDefaultLabelId");function Er(e,t){return e??t}o(Er,"resolveAriaLabelledBy");var Cr=wr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=i;delete u.id;let l=qe(),m=L(),p=m.useState("triggerElement"),h=m.useState("id"),y=Ir(h),d=Co({id:y,fallbackControlId:p?.id??h,setLabelId(N){let v=typeof N=="function"?N(m.state.labelId):N;m.set("labelId",v)}});return w("div",t,{ref:r,state:l.state,props:[d,i],stateAttributesMapping:Ct})},"SelectLabel"));var Je=b(O(),1);var Gs=Yt.popupOpen,qs=Yt.pressed;var Ar="data-popup-side";var En=400,wn={...yo,...Ct,popupSide:o(e=>e?{[Ar]:e}:null,"popupSide"),value:o(()=>null,"value")},Nr=Je.forwardRef(o(function(t,r){let{render:n,className:s,id:a,disabled:i=!1,nativeButton:u=!0,style:l,...m}=t,{setTouched:p,setFocused:h,validationMode:y,validation:d,state:N,disabled:v}=qe(),{labelId:H}=ho(),S=L(),{readOnly:j,required:I,disabled:g}=Le(),C=v||g||i,M=S.useState("open"),T=S.useState("mounted"),k=S.useState("value"),Q=S.useState("triggerProps"),$=S.useState("positionerElement"),W=S.useState("listElement"),X=S.useState("popupSide"),c=S.useState("id"),z=S.useState("labelId"),q=S.useState("hasSelectedValue"),ie=T&&$?X:null,G=a??c,le=Er(H,z);At({id:a});let F=Pt($),f=Je.useRef(null),{getButtonProps:E,buttonRef:R}=Et({disabled:C,native:u}),x=S.useStateSetter("triggerElement"),P=Ye(),K=Ye(),ne=Ye();Je.useEffect(()=>{if(M)return ne.start(En,()=>{S.context.selectionRef.current.allowUnselectedMouseUp=!0,S.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ne.clear()};S.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},K.clear()},[M,S,K,ne]);let J=it(Q,{id:G,role:"combobox","aria-expanded":M,"aria-haspopup":"listbox","aria-controls":M?W?.id??Io($)?.id:void 0,"aria-labelledby":le,"aria-readonly":j||void 0,"aria-required":I||void 0,tabIndex:C?-1:0,onFocus(ee){h(!0),M&&S.context.alignItemWithTriggerActiveRef.current&&S.context.setOpen(!1,ce(oe.none,ee.nativeEvent)),P.start(0,()=>{S.set("forceMount",!0)})},onBlur(ee){Nt($,ee.relatedTarget)||(p(!0),h(!1),y==="onBlur"&&d.commit(k))},onMouseDown(ee){if(M)return;let pe=lt(ee.currentTarget);function V(D){if(!f.current)return;let ae=D.target;Nt(f.current,ae)||Nt(F.current,ae)||lr(D,f.current)||S.context.setOpen(!1,ce(oe.cancelOpen,D))}o(V,"handleMouseUp"),K.start(0,()=>{pe.addEventListener("mouseup",V,{once:!0})})}},m,E),ue=d.getValidationProps(C,J);ue.role="combobox";let Se={...N,open:M,disabled:C,value:k,readOnly:j,popupSide:ie,placeholder:!q};return w("button",t,{ref:[r,f,R,x],state:Se,stateAttributesMapping:wn,props:ue})},"SelectTrigger"));var Tr=b(O(),1);var Cn={value:o(()=>null,"value")},Pr=Tr.forwardRef(o(function(t,r){let{className:n,render:s,children:a,placeholder:i,style:u,...l}=t,m=L(),p=m.useState("value"),h=m.useState("items"),y=m.useState("itemToStringLabel"),d=m.useState("hasSelectedValue"),N=!d&&i!=null&&a==null,v=m.useState("hasNullItemLabel",N),H={value:p,placeholder:!d},S=null;return typeof a=="function"?S=a(p):a!=null?S=a:N&&!v?S=i:Array.isArray(p)?S=br(p,h,y):S=oo(p,h,y),w("span",t,{state:H,ref:[r,m.context.valueRef],props:[{children:S},l],stateAttributesMapping:Cn})},"SelectValue"));var Mr=b(O(),1);var Vr=Mr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,m={open:L().useState("open")};return w("span",t,{state:m,ref:r,props:[{"aria-hidden":!0,children:"\u25BC"},i],stateAttributesMapping:bo})},"SelectIcon"));var Or=b(O(),1);var Lr=b(xe(),1);var Dr=Or.forwardRef(o(function(t,r){let n=L(),s=n.useState("mounted"),a=n.useState("forceMount");return s||a?(0,Lr.jsx)(Lo,{ref:r,...t}):null},"SelectPortal"));var _r=b(O(),1);var An={...Tt,...Me},Ur=_r.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),l=u.useState("open"),m=u.useState("mounted"),p=u.useState("transitionStatus");return w("div",t,{state:{open:l,transitionStatus:p},ref:r,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:An})},"SelectBackdrop"));var me=b(O(),1);var Ot=b(O(),1);var ro=Ot.createContext(void 0);function _e(){let e=Ot.useContext(ro);if(!e)throw new Error(Ie(59));return e}o(_e,"useSelectPositionerContext");function Ze(e,t){e&&Object.assign(e.style,t)}o(Ze,"clearStyles");var Lt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var dt=b(xe(),1);var Nn={position:"fixed"},kr=me.forwardRef(o(function(t,r){let{anchor:n,className:s,render:a,positionMethod:i,side:u,align:l,sideOffset:m,alignOffset:p,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:d,sticky:N,disableAnchorTracking:v,alignItemWithTrigger:H=!0,collisionAvoidance:S=Oo,style:j,...I}=t,g=L(),C=Mt(),M=g.useState("open"),T=g.useState("mounted"),k=g.useState("modal"),Q=g.useState("value"),$=g.useState("openMethod"),W=g.useState("positionerElement"),X=g.useState("triggerElement"),c=g.useState("isItemEqualToValue"),z=g.useState("transitionStatus"),q=me.useRef(null),ie=me.useRef(null),[G,le]=me.useState(H),F=T&&G&&$!=="touch";!T&&G!==H&&le(H),me.useImperativeHandle(g.context.alignItemWithTriggerActiveRef,()=>F),Jo((F||k)&&M,$==="touch",W,X);let f=Yo({anchor:n,floatingRootContext:C,positionMethod:i,mounted:T,side:u,sideOffset:m,align:l,alignOffset:p,arrowPadding:d,collisionBoundary:h,collisionPadding:y,sticky:N,disableAnchorTracking:v??F,collisionAvoidance:S,keepMounted:!0}),E=F?"none":f.side,R=F?Nn:f.positionerStyles,x={open:M,side:E,align:f.align,anchorHidden:f.anchorHidden};te(()=>{g.set("popupSide",f.side)},[g,f.side]);let P=g.useStateSetter("positionerElement"),K=Ko(t,x,{styles:R,transitionStatus:z,props:I,refs:[r,P],hidden:!T,inert:!M}),ne=me.useRef(0),J=ve(Se=>{if(g.context.valuesRef.current.length===0)return;let ee=ne.current;ne.current=Se.size;let pe=ce(oe.none);if(ee!==0&&!g.state.multiple&&Q!==null&&ft(g.context.valuesRef.current,Q,c)===-1){let D=g.context.initialValueRef.current,Z=D!=null&&ft(g.context.valuesRef.current,D,c)!==-1?D:null;g.context.setValue(Z,pe),Z===null&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null)}if(ee!==0&&g.state.multiple&&Array.isArray(Q)){let V=Q.filter(D=>ft(g.context.valuesRef.current,D,c)!==-1);V.length!==Q.length&&(g.context.setValue(V,pe),V.length===0&&(g.set("selectedIndex",null),g.context.selectedItemTextRef.current=null))}if(M&&F){g.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let V={height:""};Ze(W,V),Ze(g.context.popupRef.current,V)}}),ue=me.useMemo(()=>({...f,side:E,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:q,scrollDownArrowRef:ie}),[f,E,F,le]);return(0,dt.jsx)(ir,{elementsRef:g.context.listRef,labelsRef:g.context.labelsRef,onMapChange:J,children:(0,dt.jsxs)(ro.Provider,{value:ue,children:[T&&k&&(0,dt.jsx)($o,{inert:Go(!M),cutout:X}),K]})})},"SelectPositioner"));var ge=b(O(),1);var no="--transform-origin";var Ut=b(xe(),1);var Pn={...Tt,...Me},jr=ge.forwardRef(o(function(t,r){let{render:n,className:s,style:a,finalFocus:i,...u}=t,l=L(),{multiple:m,readOnly:p,highlightItemOnHover:h}=Le(),y=Mt(),{side:d,align:N,alignItemWithTriggerActive:v,isPositioned:H,setControlledAlignItemWithTrigger:S}=_e(),j=Qo(!0)!=null,I=qo(),{nonce:g,disableStyleElements:C}=cr(),M=l.useState("id"),T=l.useState("open"),k=l.useState("openMethod"),Q=l.useState("mounted"),$=l.useState("popupProps"),W=l.useState("transitionStatus"),X=l.useState("triggerElement"),c=l.useState("positionerElement"),z=l.useState("listElement"),q=ge.useRef(!1),ie=ge.useRef(!1),G=ge.useRef({}),le=Ao(),F=ve(x=>{if(!c||!l.context.popupRef.current||!ie.current)return;let P=c.style.top==="0px",K=c.style.bottom==="0px";if(q.current||!v||!P&&!K){l.context.handleScrollArrowVisibility(x);return}let ne=Hr(c),J=mt(c.getBoundingClientRect().height,"y",ne),ue=lt(c),Se=It(c),ee=Se.getComputedStyle(c),pe=parseFloat(ee.marginTop),V=parseFloat(ee.marginBottom),D=Fr(Se.getComputedStyle(l.context.popupRef.current)),ae=Math.min(ue.documentElement.clientHeight-pe-V,D),Z=x.scrollTop,Ue=Dt(x),Ae=null,Ne=o(se=>{c.style.height=`${se}px`},"setHeight"),fe=P?Ue-Z:Z,ke=Math.min(J+fe,ae);if(fe<=he){let se=ut(fe,0,ae-J);se>0&&Ne(J+se),x.scrollTop=P?Ue:0,ae-(J+se)<=he&&(q.current=!0),l.context.handleScrollArrowVisibility(x);return}if(ae-ke>he)Ae=P?1/0:0;else if(K&&Z<Ue){let se=J+fe-ae;Ae=Z-(fe-se)}let Te=Math.ceil(ke);if(Te!==0&&Ne(Te),Ae!=null){let se=ut(Ae,0,Dt(x));Math.abs(x.scrollTop-se)>he&&(x.scrollTop=se)}Te>=ae-he&&(q.current=!0),l.context.handleScrollArrowVisibility(x)});ge.useImperativeHandle(l.context.scrollHandlerRef,()=>F,[F]),Ve({open:T,ref:l.context.popupRef,onComplete(){T&&l.context.onOpenChangeComplete(!0)}});let f={open:T,transitionStatus:W,side:d,align:N};te(()=>{!c||!l.context.popupRef.current||Object.keys(G.current).length||(G.current={top:c.style.top||"0",left:c.style.left||"0",right:c.style.right,height:c.style.height,bottom:c.style.bottom,minHeight:c.style.minHeight,maxHeight:c.style.maxHeight,marginTop:c.style.marginTop,marginBottom:c.style.marginBottom})},[l,c]),te(()=>{T||v||(ie.current=!1,q.current=!1,Ze(c,G.current))},[T,v,c]),te(()=>{let x=l.context.popupRef.current;if(!T||!X||!c||!x||v&&!H||l.state.transitionStatus==="ending")return;if(ie.current=!0,x.style.removeProperty(no),!v){le.request(()=>l.context.handleScrollArrowVisibility(z||x));return}let P=Mn(x);try{let K=l.context.selectedItemTextRef.current;K?.isConnected||(K=!l.select("hasSelectedValue")&&l.context.firstItemTextRef.current?.isConnected?l.context.firstItemTextRef.current:null);let ne=l.context.valueRef.current,J=It(c),ue=J.getComputedStyle(c),Se=J.getComputedStyle(x),ee=lt(X),pe=Hr(X),V=_t(X.getBoundingClientRect(),pe),D=_t(c.getBoundingClientRect(),pe),ae=V.height,Z=z||x,Ue=Z.scrollHeight,Ae=parseFloat(Se.borderBottomWidth),Ne=parseFloat(ue.marginTop)||10,fe=parseFloat(ue.marginBottom)||10,ke=parseFloat(ue.minHeight)||100,Te=Fr(Se),se=5,xt=5,_=20,be=ee.documentElement.clientHeight-Ne-fe,ht=ee.documentElement.clientWidth,Rt=be-V.bottom+ae,ye,bt=I==="rtl"?V.right-D.width:V.left,yt=0;if(K&&ne){let de=_t(ne.getBoundingClientRect(),pe);ye=_t(K.getBoundingClientRect(),pe),bt=D.left+(I==="rtl"?de.right-ye.right:de.left-ye.left);let we=de.top-V.top+de.height/2;yt=ye.top-D.top+ye.height/2-we}let ze=Rt+yt+fe+Ae,Ee=Math.min(be,ze),Bt=be-Ne-fe,tt=ze-Ee,ot=ht-xt;c.style.left=`${ut(bt,se,ot-D.width)}px`,c.style.height=`${Ee}px`,c.style.maxHeight="none",c.style.marginTop=`${Ne}px`,c.style.marginBottom=`${fe}px`,x.style.height="100%";let rt=Dt(Z),We=tt>=rt-he;We&&(Ee=Math.min(be,D.height)-(tt-rt));let nt=V.top<_||V.bottom>be-_||Math.ceil(Ee)+he<Math.min(Ue,ke),jt=(J.visualViewport?.scale??1)!==1&&Ro.engine.webkit;if(nt||jt){Ze(c,G.current),S(!1);return}let Fe=Math.max(ke,Ee);if(We){let de=Math.max(0,be-ze);c.style.top=D.height>=Bt?"0":`${de}px`,c.style.height=`${Ee}px`,Z.scrollTop=Dt(Z)}else c.style.bottom="0",Z.scrollTop=tt;if(ye){let de=D.top,we=D.height,Pe=ye.top+ye.height/2,Ge=ut(we>0?(Pe-de)/we*100:50,0,100);x.style.setProperty(no,`50% ${Ge}%`)}(Fe===be||Ee>=Te)&&(q.current=!0),l.context.handleScrollArrowVisibility(Z),h&&l.state.selectedIndex===null&&l.state.activeIndex===null&&l.context.listRef.current[0]!=null&&l.set("activeIndex",0)}finally{P()}},[l,T,c,X,v,S,le,z,h,I,H]),ge.useEffect(()=>{if(!v||!c||!T)return;let x=It(c);function P(K){l.context.setOpen(!1,ce(oe.windowResize,K))}return o(P,"handleResize"),Po(x,"resize",P)},[l,v,c,T]);let E={...z?{role:"presentation"}:{role:"listbox","aria-multiselectable":m||void 0,"aria-readonly":p||void 0,id:`${M}-list`},onKeyDown(x){j&&Zo.has(x.key)&&x.stopPropagation()},onScroll(x){z||F(x.currentTarget)},...v&&{style:z?{height:"100%"}:Lt},className:!z&&v?pt.className:void 0},R=w("div",t,{ref:[r,l.context.popupRef],state:f,stateAttributesMapping:Pn,props:[$,E,Xo(W),u]});return(0,Ut.jsxs)(ge.Fragment,{children:[!C&&pt.getElement(g),(0,Ut.jsx)(Do,{context:y,modal:!1,disabled:!Q,openInteractionType:k,returnFocus:i,restoreFocus:!0,children:R})]})},"SelectPopup"));function Fr(e){let t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}o(Fr,"getMaxPopupHeight");function Dt(e){return Xe(e.scrollHeight,e.clientHeight)}o(Dt,"getMaxScrollTop");function Hr(e){return ko.getScale(e)}o(Hr,"getScale");function mt(e,t,r){return e/r[t]}o(mt,"normalizeSize");function _t(e,t){return wo({x:mt(e.x,"x",t),y:mt(e.y,"y",t),width:mt(e.width,"x",t),height:mt(e.height,"y",t)})}o(_t,"normalizeRect");var Br=[["transform","none"],["scale","1"],["translate","0 0"]];function Mn(e){let{style:t}=e,r={};for(let[n,s]of Br)r[n]=t.getPropertyValue(n),t.setProperty(n,s,"important");return()=>{for(let[n]of Br){let s=r[n];s?t.setProperty(n,s):t.removeProperty(n)}}}o(Mn,"unsetTransformStyles");var zr=b(O(),1);var Wr=zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{multiple:l,readOnly:m}=Le(),{alignItemWithTriggerActive:p}=_e(),h=u.useState("hasScrollArrows"),y=u.useState("openMethod"),N={id:`${u.useState("id")}-list`,role:"listbox","aria-multiselectable":l||void 0,"aria-readonly":m||void 0,onScroll(H){u.context.scrollHandlerRef.current?.(H.currentTarget)},...p&&{style:Lt},className:h&&y!=="touch"?pt.className:void 0},v=u.useStateSetter("listElement");return w("div",t,{ref:[r,v],props:[N,i]})},"SelectList"));var Re=b(O(),1);var kt=b(O(),1);var so=kt.createContext(void 0);function gt(){let e=kt.useContext(so);if(!e)throw new Error(Ie(57));return e}o(gt,"useSelectItemContext");var Gr=b(xe(),1);var qr=Re.memo(Re.forwardRef(o(function(t,r){let{render:n,className:s,style:a,value:i=null,label:u,disabled:l=!1,nativeButton:m=!1,...p}=t,h=Re.useRef(null),y=sr({guess:!0,label:u,textRef:h}),d=L(),{itemProps:N,multiple:v,disabled:H,readOnly:S}=Le(),j=H||l,I=d.useState("isActive",y.index),g=d.useState("open"),C=d.useState("isSelected",i),M=d.useState("isSelectedByFocus",y.index),T=d.useState("isItemEqualToValue"),k=y.index,Q=Re.useRef(null);te(()=>{let f=d.context.valuesRef.current;return f[k]=i,()=>{delete f[k]}},[k,i,d]),te(()=>{let f=d.state.value,E=d.state.selectedIndex,R=E,x;v&&Array.isArray(f)?(R=mr(k,i,d.context.valuesRef.current,f,T,E),x=R===k,k===E&&!x&&(d.context.selectedItemTextRef.current=null)):(x=f!==void 0&&Ce(i,f,T),x&&(R=k)),d.set("selectedIndex",R),x&&h.current&&(d.context.selectedItemTextRef.current=h.current)},[k,v,T,d,i]);let $=Re.useRef("mouse"),W=Re.useRef(!1),{getButtonProps:X,buttonRef:c}=Et({disabled:j,focusableWhenDisabled:!0,native:m,composite:!0}),z={disabled:j,selected:C,highlighted:I};function q(f){if(H||S)return;let E=d.state.value;if(v){let R=Array.isArray(E)?E:[],x=C?gr(R,i,T):[...R,i];d.context.setValue(x,ce(oe.itemPress,f))}else d.context.setValue(i,ce(oe.itemPress,f)),d.context.setOpen(!1,ce(oe.itemPress,f))}o(q,"commitSelection");function ie(){d.context.selectionRef.current.dragY=0}o(ie,"resetDragMovement");let G={role:"option","aria-selected":C,tabIndex:g&&I?0:-1,onKeyDown(f){d.set("activeIndex",k),f.key===" "&&d.context.typingRef.current&&f.preventDefault()},onClick(f){let E=$.current!=="touch",R=f.nativeEvent.pointerType,x=E&&Eo(f.nativeEvent)&&(R!==void 0||I),P=E&&!x&&!W.current;W.current=!1,!(j||P)&&q(f.nativeEvent)},onPointerEnter(f){$.current=f.pointerType},onPointerMove(f){if(f.pointerType==="mouse"&&f.buttons===1){let E=d.context.selectionRef.current;E.dragY+=f.movementY,E.dragY**2>=64&&(E.allowUnselectedMouseUp=!0)}},onPointerDown(f){$.current=f.pointerType,W.current=!0,ie()},onMouseUp(){if(ie(),j||$.current==="touch"||W.current)return;let f=!d.context.selectionRef.current.allowSelectedMouseUp&&C,E=!d.context.selectionRef.current.allowUnselectedMouseUp&&!C;f||E||(W.current=!0,Q.current?.click(),W.current=!1)}},le=w("div",t,{ref:[c,r,y.ref,Q],state:z,props:[N,G,p,X]}),F=Re.useMemo(()=>({selected:C,index:k,textRef:h,selectedByFocus:M}),[C,k,h,M]);return(0,Gr.jsx)(so.Provider,{value:F,children:le})},"SelectItem")));var je=b(O(),1);var Yr=b(xe(),1);var $r=je.forwardRef(o(function(t,r){let{selected:n}=gt();return t.keepMounted||n?(0,Yr.jsx)(Vn,{...t,ref:r}):null},"SelectItemIndicator")),Vn=je.memo(je.forwardRef((e,t)=>{let{render:r,className:n,style:s,keepMounted:a,...i}=e,{selected:u}=gt(),l=je.useRef(null),{transitionStatus:m,setMounted:p}=$e(u),y=w("span",e,{ref:[t,l],state:{selected:u,transitionStatus:m},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},i],stateAttributesMapping:Me});return Ve({batch:!0,enabled:!u,open:u,ref:l,onComplete(){u||p(!1)}}),y}));var Qe=b(O(),1);var Xr=Qe.memo(Qe.forwardRef(o(function(t,r){let{index:n,textRef:s,selectedByFocus:a}=gt(),i=L(),{render:u,className:l,style:m,...p}=t,h=Qe.useCallback(d=>{d&&(n===0&&(i.context.firstItemTextRef.current=d),a&&(i.context.selectedItemTextRef.current=d))},[i,n,a]);return w("div",t,{ref:[h,r,s],props:p})},"SelectItemText")));var Kr=b(O(),1);var Jr=Kr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,u=L(),{side:l,align:m,arrowRef:p,arrowStyles:h,arrowUncentered:y,alignItemWithTriggerActive:d}=_e(),v={open:u.useState("open"),side:l,align:m,uncentered:y},H=w("div",t,{state:v,ref:[p,r],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:vo});return d?null:H},"SelectArrow"));var Qr=b(O(),1);var Zr=b(O(),1);var Ft=Zr.forwardRef(o(function(t,r){let{render:n,className:s,style:a,direction:i,keepMounted:u,...l}=t,m=i==="up",p=L(),{side:h,scrollDownArrowRef:y,scrollUpArrowRef:d}=_e(),N=m?"scrollUpArrowVisible":"scrollDownArrowVisible",v=p.useState(N),H=p.useState("openMethod"),S=v&&H!=="touch",j=Ye(),I=m?d:y,{mounted:g,transitionStatus:C,setMounted:M}=$e(S);te(()=>(p.context.scrollArrowsMountedCountRef.current+=1,p.set("hasScrollArrows",!0),()=>{p.context.scrollArrowsMountedCountRef.current=Math.max(0,p.context.scrollArrowsMountedCountRef.current-1),p.context.scrollArrowsMountedCountRef.current===0&&p.set("hasScrollArrows",!1)}),[p]),Ve({open:S,ref:I,onComplete(){S||M(!1)}});let Q=w("div",t,{ref:[r,I],state:{direction:i,visible:S,side:h,transitionStatus:C},props:[{"aria-hidden":!0,children:m?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(W){if(W.movementX===0&&W.movementY===0||j.isStarted())return;p.set("activeIndex",null);function X(){let c=p.state.listElement??p.context.popupRef.current;if(!c)return;p.set("activeIndex",null),p.context.handleScrollArrowVisibility(c);let z=Xe(c.scrollHeight,c.clientHeight),q=Ke(c.scrollTop,z),ie=q===(m?0:z),G=p.context.listRef.current;if(q!==c.scrollTop&&(c.scrollTop=q),ie){j.clear();return}if(G.length>0){let le=I.current?.offsetHeight||0;c.scrollTop=On(G,m,q,c.clientHeight,le,z)}j.start(40,X)}o(X,"scrollNextItem"),j.start(40,X)},onMouseLeave(){j.clear()}},l],stateAttributesMapping:Me});return g||u?Q:null},"SelectScrollArrow"));function On(e,t,r,n,s,a){if(t){let p=0,h=r+s-he;for(let N=0;N<e.length;N+=1){let v=e[N];if(v&&v.offsetTop>=h){p=N;break}}let y=Math.max(0,p-1),d=e[y];return y<p&&d?Ke(d.offsetTop-s,a):0}let i=e.length-1,u=r+n-s+he;for(let p=0;p<e.length;p+=1){let h=e[p];if(h&&h.offsetTop+h.offsetHeight>u){i=Math.max(0,p-1);break}}let l=Math.min(e.length-1,i+1),m=e[l];return l>i&&m?Ke(m.offsetTop+m.offsetHeight-n+s,a):a}o(On,"getTargetScrollTop");var en=b(xe(),1);var tn=Qr.forwardRef(o(function(t,r){return(0,en.jsx)(Ft,{...t,ref:r,direction:"down"})},"SelectScrollDownArrow"));var on=b(O(),1);var rn=b(xe(),1);var nn=on.forwardRef(o(function(t,r){return(0,rn.jsx)(Ft,{...t,ref:r,direction:"up"})},"SelectScrollUpArrow"));var et=b(O(),1);var Ht=b(O(),1);var io=Ht.createContext(void 0);function sn(){let e=Ht.useContext(io);if(e===void 0)throw new Error(Ie(56));return e}o(sn,"useSelectGroupContext");var ln=b(xe(),1);var an=et.forwardRef(o(function(t,r){let{render:n,className:s,style:a,...i}=t,[u,l]=et.useState(),m=et.useMemo(()=>({labelId:u,setLabelId:l}),[u,l]),p=w("div",t,{ref:r,props:[{role:"group","aria-labelledby":u},i]});return(0,ln.jsx)(io.Provider,{value:m,children:p})},"SelectGroup"));var cn=b(O(),1);var un=cn.forwardRef(o(function(t,r){let{render:n,className:s,style:a,id:i,...u}=t,{setLabelId:l}=sn(),m=xo(i);return te(()=>(l(m),()=>{l(h=>h===m?void 0:h)}),[m,l]),w("div",t,{ref:r,props:[{id:m,"aria-hidden":!0},u]})},"SelectGroupLabel"));var pn=b(O(),1);var fn=pn.forwardRef(o(function(t,r){let{className:n,render:s,orientation:a="horizontal",style:i,...u}=t;return w("div",t,{state:{orientation:a},ref:r,props:[{role:"presentation"},u]})},"ListboxSeparator"));var dn=fn;var B=b(xe(),1);var hc=re.Root;function Rc(e){let t=(0,St.c)(8),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("flex flex-1 text-start",r),t[3]=r,t[4]=s):s=t[4];let a;return t[5]!==n||t[6]!==s?(a=(0,B.jsx)(re.Value,{"data-slot":"select-value",className:s,...n}),t[5]=n,t[6]=s,t[7]=a):a=t[7],a}o(Rc,"$");function bc({className:e,size:t="default",children:r,...n}){return(0,B.jsxs)(re.Trigger,{"data-slot":"select-trigger","data-size":t,className:He("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *: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-4",e),...n,children:[r,(0,B.jsx)(re.Icon,{render:(0,B.jsx)(ct,{icon:nr,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}o(bc,"j");function yc({className:e,children:t,side:r="bottom",sideOffset:n=4,align:s="center",alignOffset:a=0,alignItemWithTrigger:i=!0,...u}){return(0,B.jsx)(re.Portal,{children:(0,B.jsx)(re.Positioner,{side:r,sideOffset:n,align:s,alignOffset:a,alignItemWithTrigger:i,className:"isolate z-50",children:(0,B.jsxs)(re.Popup,{"data-slot":"select-content","data-align-trigger":i,className:He("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md 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-start-2 data-[side=inline-start]:slide-in-from-end-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 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...u,children:[(0,B.jsx)(Ln,{}),(0,B.jsx)(re.List,{children:t}),(0,B.jsx)(Dn,{})]})})})}o(yc,"A");function vc(e){let t=(0,St.c)(13),r,n,s;t[0]!==e?({className:n,children:r,...s}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=s):(r=t[1],n=t[2],s=t[3]);let a;t[4]!==n?(a=He("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs 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-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=a):a=t[5];let i;t[6]!==r?(i=(0,B.jsx)(re.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:r}),t[6]=r,t[7]=i):i=t[7];let u;t[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,B.jsx)(re.ItemIndicator,{render:(0,B.jsx)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:(0,B.jsx)(ct,{icon:rr,strokeWidth:2,className:"pointer-events-none"})}),t[8]=u):u=t[8];let l;return t[9]!==s||t[10]!==a||t[11]!==i?(l=(0,B.jsxs)(re.Item,{"data-slot":"select-item",className:a,...s,children:[i,u]}),t[9]=s,t[10]=a,t[11]=i,t[12]=l):l=t[12],l}o(vc,"U");function Ln(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:or,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Ln,"x");function Dn(e){let t=(0,St.c)(9),r,n;t[0]!==e?({className:r,...n}=e,t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]);let s;t[3]!==r?(s=He("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",r),t[3]=r,t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,B.jsx)(ct,{icon:tr,strokeWidth:2}),t[5]=a):a=t[5];let i;return t[6]!==n||t[7]!==s?(i=(0,B.jsx)(re.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:s,...n,children:a}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}o(Dn,"w");export{hc as a,Rc as b,bc as c,yc as d,vc as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-HUIW5YJW.js";import{a as A}from"./chunk-XTU27CFW.js";import{a as W}from"./chunk-J45HAKBU.js";import{a as L}from"./chunk-4RB2U4LR.js";import"./chunk-3D67ZJRW.js";import"./chunk-ZSWW2UGP.js";import"./chunk-EU4ZGNNW.js";import"./chunk-HFBSWKJS.js";import"./chunk-4EPW63HS.js";import"./chunk-VUOEJJUH.js";import{a as G}from"./chunk-LJKB6B3H.js";import{b as $}from"./chunk-SVFX7F32.js";import"./chunk-YUVGMKHG.js";import{a as q}from"./chunk-DK53RZKN.js";import"./chunk-QNWL62VF.js";import{a as H,b as O,c as Q,d as D,e as T,f as K}from"./chunk-J66QR7WA.js";import"./chunk-2JI25KW2.js";import"./chunk-R47IHY6Y.js";import"./chunk-4PI2OSSP.js";import{a as _}from"./chunk-2W4UO5BC.js";import{c as j}from"./chunk-RL5SUZ6J.js";import{a as E}from"./chunk-ZHH5ZUAS.js";import"./chunk-7AJWGPWM.js";import"./chunk-ZPQBVYNN.js";import{B}from"./chunk-BVANRUU4.js";import"./chunk-PDBW6GTJ.js";import{a as J}from"./chunk-GWNGVKLG.js";import{b as V}from"./chunk-6G3E4PJ2.js";import{a as S,d as F}from"./chunk-5PEAXTYQ.js";var R=F(J(),1);var t=F(V(),1);var U=S(c=>`${c.toString()} ms`,"D"),X=S(c=>c.totalConnections===0&&c.shapePoke.passes===0&&c.whisper.passes===0&&c.shapeProbe.run===0&&c.shapeProbe.served===0&&c.globalPoll.drains===0&&c.globalPoll.pairsSkipped===0,"J"),z=S(c=>{let e=(0,R.c)(48),{counters:o,includeTiming:a,prefix:r,t:l,title:u}=c,d=`${r}-section`,n;e[0]!==u?(n=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:u}),e[0]=u,e[1]=n):n=e[1];let s=`${r}-stats`,i;e[2]!==l?(i=l("Passes"),e[2]=l,e[3]=i):i=e[3];let m=`${r}-passes`,I;e[4]!==o.passes||e[5]!==i||e[6]!==m?(I=(0,t.jsx)(v,{label:i,testId:m,value:o.passes}),e[4]=o.passes,e[5]=i,e[6]=m,e[7]=I):I=e[7];let g;e[8]!==l?(g=l("Sockets iterated"),e[8]=l,e[9]=g):g=e[9];let k=`${r}-iterated`,p;e[10]!==o.socketsIterated||e[11]!==g||e[12]!==k?(p=(0,t.jsx)(v,{label:g,testId:k,value:o.socketsIterated}),e[10]=o.socketsIterated,e[11]=g,e[12]=k,e[13]=p):p=e[13];let f;e[14]!==l?(f=l("Delivered"),e[14]=l,e[15]=f):f=e[15];let y=`${r}-delivered`,h;e[16]!==o.socketsDelivered||e[17]!==f||e[18]!==y?(h=(0,t.jsx)(v,{label:f,testId:y,value:o.socketsDelivered}),e[16]=o.socketsDelivered,e[17]=f,e[18]=y,e[19]=h):h=e[19];let x;e[20]!==l?(x=l("Peak width"),e[20]=l,e[21]=x):x=e[21];let N=`${r}-peak`,b;e[22]!==o.peakSocketsIterated||e[23]!==x||e[24]!==N?(b=(0,t.jsx)(v,{label:x,testId:N,value:o.peakSocketsIterated}),e[22]=o.peakSocketsIterated,e[23]=x,e[24]=N,e[25]=b):b=e[25];let C;e[26]!==o.totalMs||e[27]!==a||e[28]!==r||e[29]!==l?(C=a&&(0,t.jsx)(v,{label:l("Total time"),testId:`${r}-total-ms`,value:U(o.totalMs)}),e[26]=o.totalMs,e[27]=a,e[28]=r,e[29]=l,e[30]=C):C=e[30];let P;e[31]!==o.maxMs||e[32]!==a||e[33]!==r||e[34]!==l?(P=a&&(0,t.jsx)(v,{label:l("Max time"),testId:`${r}-max-ms`,value:U(o.maxMs)}),e[31]=o.maxMs,e[32]=a,e[33]=r,e[34]=l,e[35]=P):P=e[35];let M;e[36]!==h||e[37]!==b||e[38]!==C||e[39]!==P||e[40]!==s||e[41]!==I||e[42]!==p?(M=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":s,children:[I,p,h,b,C,P]}),e[36]=h,e[37]=b,e[38]=C,e[39]=P,e[40]=s,e[41]=I,e[42]=p,e[43]=M):M=e[43];let w;return e[44]!==d||e[45]!==M||e[46]!==n?(w=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":d,children:[n,M]}),e[44]=d,e[45]=M,e[46]=n,e[47]=w):w=e[47],w},"F"),Y=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Membership probes"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Queries run"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.run||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-probe-run",value:o.run}),e[6]=o.run,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Shared from cache"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.served||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-probe-served",value:o.served}),e[11]=o.served,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-probe-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-probe-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"V"),Z=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Global shape polls"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Global reads"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.drains||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-global-poll-drains",value:o.drains}),e[6]=o.drains,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Pairs skipped"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.pairsSkipped||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-global-poll-pairs-skipped",value:o.pairsSkipped}),e[11]=o.pairsSkipped,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-global-poll-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-global-poll-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"X"),pe=S(c=>{let e=(0,R.c)(32),{initialShardKey:o}=c,a=B(),{queryShardKey:r,setShardKey:l,shardKey:u}=W(o),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={},e[0]=d):d=e[0];let n;e[1]!==r?(n={keepPreviousData:!0,shardKey:r},e[1]=r,e[2]=n):n=e[2];let{data:s,error:i,errorSource:m,poll:I}=j(_.getFanoutMetrics,d,n);A(I,!0);let g;e[3]!==s?(g=s!==void 0&&X(s),e[3]=s,e[4]=g):g=e[4];let k=g,p;e[5]!==l||e[6]!==u?(p=(0,t.jsx)(L,{onChange:l,testId:"fanout-shard-input",value:u}),e[5]=l,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==s||e[9]!==a?(f=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"fanout-count",children:[s.promoted&&(0,t.jsx)($,{"data-testid":"fanout-promoted",variant:s.relayCount>=s.maxRelays?"destructive":"default",children:s.relayCount>=s.maxRelays?a("auto-scaled: {relayCount}/{maxRelays} relays (at ceiling)",{maxRelays:s.maxRelays,relayCount:s.relayCount}):a("auto-scaled: {relayCount}/{maxRelays} relays",{maxRelays:s.maxRelays,relayCount:s.relayCount})}),(0,t.jsx)($,{variant:"secondary",children:a("{count} connections",{count:s.totalConnections})}),(0,t.jsx)($,{variant:"secondary",children:a("peak {count} subscribers",{count:s.peakSubscribers})})]}),e[8]=s,e[9]=a,e[10]=f):f=e[10];let y;e[11]!==p||e[12]!==f?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13];let h;e[14]!==i||e[15]!==m||e[16]!==r?(h=i!==null&&(0,t.jsx)(q,{error:m,shardKey:r,testId:"fanout-error"}),e[14]=i,e[15]=m,e[16]=r,e[17]=h):h=e[17];let x;e[18]!==i||e[19]!==k||e[20]!==a?(x=i===null&&k&&(0,t.jsx)(G,{description:a("Realtime fan-out cost and per-topic subscriber counts for this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 12h4l3 7 4-14 3 7h2"})}),testId:"fanout-empty",title:a("No fan-out activity yet.")}),e[18]=i,e[19]=k,e[20]=a,e[21]=x):x=e[21];let N;e[22]!==i||e[23]!==k||e[24]!==s||e[25]!==a?(N=i===null&&s!==void 0&&!k&&(0,t.jsxs)(t.Fragment,{children:[s.topics.length>0&&(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-topics-section",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:a("Hot topics")}),(0,t.jsx)(E,{className:"overflow-hidden py-0",children:(0,t.jsxs)(H,{"data-testid":"fanout-topics-table",children:[(0,t.jsx)(O,{children:(0,t.jsxs)(D,{children:[(0,t.jsx)(T,{children:a("Topic")}),(0,t.jsx)(T,{children:a("Kind")}),(0,t.jsx)(T,{className:"text-right",children:a("Subscribers")})]})}),(0,t.jsx)(Q,{children:s.topics.map(ee)})]})})]}),(0,t.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"fanout-cost",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:a("Fan-out cost since this instance woke")}),(0,t.jsx)(z,{counters:s.shapePoke,includeTiming:!0,prefix:"fanout-poke",t:a,title:a("Shape pokes")}),(0,t.jsx)(z,{counters:s.whisper,includeTiming:!1,prefix:"fanout-whisper",t:a,title:a("Whisper broadcasts")}),(0,t.jsx)(Y,{counters:s.shapeProbe,t:a}),(0,t.jsx)(Z,{counters:s.globalPoll,t:a})]})]}),e[22]=i,e[23]=k,e[24]=s,e[25]=a,e[26]=N):N=e[26];let b;return e[27]!==y||e[28]!==h||e[29]!==x||e[30]!==N?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"fanout-panel",children:[y,h,x,N]}),e[27]=y,e[28]=h,e[29]=x,e[30]=N,e[31]=b):b=e[31],b},"me");function ee(c){return(0,t.jsxs)(D,{"data-testid":"fanout-topic-row",children:[(0,t.jsx)(K,{className:"font-mono text-xs",children:c.topic}),(0,t.jsx)(K,{children:(0,t.jsx)($,{variant:"outline",children:c.kind})}),(0,t.jsx)(K,{className:"text-right font-medium tabular-nums",children:c.subscribers})]},`${c.kind}:${c.topic}`)}S(ee,"Y");export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-RL5SUZ6J.js";import{m as l}from"./chunk-7AJWGPWM.js";import{a as g}from"./chunk-GWNGVKLG.js";import{a as r,d as f}from"./chunk-5PEAXTYQ.js";var m=f(g(),1);var p={capabilities:{accounts:!0,admin:!0,inviteOnly:!1,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},h=r(()=>{let o=(0,m.c)(6),t=l(),a;o[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],o[0]=a):a=o[0];let e;o[1]!==t?(e=r(()=>t.getAuthConfig(),"t"),o[1]=t,o[2]=e):e=o[2];let{data:d,isLoading:u}=c(a,e),n=d??p,s=!u,i;return o[3]!==n||o[4]!==s?(i={config:n,ready:s},o[3]=n,o[4]=s,o[5]=i):i=o[5],i},"y");export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,d as W,e as $,f as q,h as D,i as F,j as H,k as A,l as S,m as I,n as J,o as M,p as P}from"./chunk-
|
|
1
|
+
import{c as L,d as W,e as $,f as q,h as D,i as F,j as H,k as A,l as S,m as I,n as J,o as M,p as P}from"./chunk-AJQGPPJL.js";import{a as O}from"./chunk-RJBL7JY4.js";import{a as X,b as z,c as B,d as K,e as E,f as G}from"./chunk-J66QR7WA.js";import{B as C,r as j}from"./chunk-BVANRUU4.js";import{a as U}from"./chunk-GWNGVKLG.js";import{b as V}from"./chunk-6G3E4PJ2.js";import{a as f,d as T}from"./chunk-5PEAXTYQ.js";var N=T(U(),1);var t=T(V(),1);var _=50,R={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},Q=f(r=>{let a=r.columns.find(e=>r.rows.length>0&&r.rows.every(n=>typeof n[e]=="number"))??null;return{label:r.columns.find(e=>e!==a)??null,value:a}},"D"),Y=f(r=>{let a=(0,N.c)(3),{data:e,kind:n}=r,l;return a[0]!==e||a[1]!==n?(l=(0,t.jsx)(H,{className:"h-full w-full",config:R,children:n==="area"?(0,t.jsxs)(F,{data:e,children:[(0,t.jsx)(L,{vertical:!1}),(0,t.jsx)(q,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(S,{content:(0,t.jsx)(A,{})}),(0,t.jsx)($,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):(0,t.jsxs)(D,{data:e,children:[(0,t.jsx)(L,{vertical:!1}),(0,t.jsx)(q,{axisLine:!1,dataKey:"label",tickLine:!1}),(0,t.jsx)(S,{content:(0,t.jsx)(A,{})}),(0,t.jsx)(W,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),a[0]=e,a[1]=n,a[2]=l):l=a[2],l},"J"),na=f(r=>{let a=(0,N.c)(21),{axes:e,kind:n,result:l}=r,u=C(),o;a[0]!==l?(o=Q(l),a[0]=l,a[1]=o):o=a[1];let d=o,m;a[2]!==l.columns?(m=new Set(l.columns),a[2]=l.columns,a[3]=m):m=a[3];let s=m,c=e!==void 0&&s.has(e.x)?e.x:d.label,p;a[4]!==e?.y||a[5]!==s?(p=e?.y.find(i=>s.has(i)),a[4]=e?.y,a[5]=s,a[6]=p):p=a[6];let x=p,y=x??d.value,b;a[7]!==c||a[8]!==l.rows||a[9]!==y?(b=y===null?[]:l.rows.slice(0,_).map((i,w)=>({label:c===null?`#${(w+1).toString()}`:j(i[c]),value:Number(i[y])||0})),a[7]=c,a[8]=l.rows,a[9]=y,a[10]=b):b=a[10];let k=b;if(y===null){let i;a[11]!==u?(i=u("No numeric column to chart."),a[11]=u,a[12]=i):i=a[12];let w;return a[13]!==i?(w=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:i}),a[13]=i,a[14]=w):w=a[14],w}let h=n??(e!==void 0&&x!==void 0?e.kind:"bar"),v;a[15]!==k||a[16]!==h?(v=h==="bar"?(0,t.jsxs)(I,{className:"h-full w-full",config:R,data:k,children:[(0,t.jsx)(M,{dataKey:"label"}),(0,t.jsx)(J,{dataKey:"value"}),(0,t.jsx)(P,{})]}):(0,t.jsx)(Y,{data:k,kind:h}),a[15]=k,a[16]=h,a[17]=v):v=a[17];let g;return a[18]!==h||a[19]!==v?(g=(0,t.jsx)("div",{className:"h-80 w-full p-3","data-chart-kind":h,"data-testid":"sql-chart",children:v}),a[18]=h,a[19]=v,a[20]=g):g=a[20],g},"oe"),oa=f(r=>{let a=(0,N.c)(19),{result:e}=r,n=C();if(e.columns.length===0){let s;a[0]!==e.rowCount||a[1]!==n?(s=n("{count} rows",{count:e.rowCount}),a[0]=e.rowCount,a[1]=n,a[2]=s):s=a[2];let c;return a[3]!==s?(c=(0,t.jsx)("p",{className:"p-4 text-sm text-muted-foreground",children:s}),a[3]=s,a[4]=c):c=a[4],c}let l;a[5]!==e.columns?(l=e.columns.map(Z),a[5]=e.columns,a[6]=l):l=a[6];let u;a[7]!==l?(u=(0,t.jsx)(z,{className:"sticky top-0 z-10 bg-muted",children:(0,t.jsx)(K,{children:l})}),a[7]=l,a[8]=u):u=a[8];let o;if(a[9]!==e.columns||a[10]!==e.rows){let s;a[12]!==e.columns?(s=f((c,p)=>(0,t.jsx)(K,{"data-testid":"sql-row",children:e.columns.map(x=>(0,t.jsx)(G,{className:"max-w-md truncate font-mono text-xs",children:(0,t.jsx)(O,{value:c[x]})},x))},p),"s"),a[12]=e.columns,a[13]=s):s=a[13],o=e.rows.map(s),a[9]=e.columns,a[10]=e.rows,a[11]=o}else o=a[11];let d;a[14]!==o?(d=(0,t.jsx)(B,{children:o}),a[14]=o,a[15]=d):d=a[15];let m;return a[16]!==u||a[17]!==d?(m=(0,t.jsxs)(X,{"data-testid":"sql-rows",children:[u,d]}),a[16]=u,a[17]=d,a[18]=m):m=a[18],m},"ne");function Z(r){return(0,t.jsx)(E,{children:r},r)}f(Z,"P");export{na as a,oa as b};
|