@tapflowio/relay 0.22.0 → 0.23.0

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.
Files changed (158) hide show
  1. package/dist/RelayServer.d.ts +18 -0
  2. package/dist/RelayServer.d.ts.map +1 -1
  3. package/dist/RelayServer.js +110 -12
  4. package/dist/RelayServer.js.map +1 -1
  5. package/dist/SessionManager.d.ts +4 -1
  6. package/dist/SessionManager.d.ts.map +1 -1
  7. package/dist/SessionManager.js +7 -0
  8. package/dist/SessionManager.js.map +1 -1
  9. package/dist/api/auth.d.ts.map +1 -1
  10. package/dist/api/auth.js +2 -1
  11. package/dist/api/auth.js.map +1 -1
  12. package/dist/api/passwordReset.d.ts +6 -2
  13. package/dist/api/passwordReset.d.ts.map +1 -1
  14. package/dist/api/passwordReset.js +21 -6
  15. package/dist/api/passwordReset.js.map +1 -1
  16. package/dist/index.d.ts +2 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/lib/clientAddress.d.ts +15 -0
  21. package/dist/lib/clientAddress.d.ts.map +1 -1
  22. package/dist/lib/clientAddress.js +21 -0
  23. package/dist/lib/clientAddress.js.map +1 -1
  24. package/dist/lib/config.d.ts +2 -0
  25. package/dist/lib/config.d.ts.map +1 -1
  26. package/dist/lib/config.js +6 -0
  27. package/dist/lib/config.js.map +1 -1
  28. package/dist/lib/proxyConfig.d.ts +10 -0
  29. package/dist/lib/proxyConfig.d.ts.map +1 -1
  30. package/dist/lib/proxyConfig.js +14 -0
  31. package/dist/lib/proxyConfig.js.map +1 -1
  32. package/dist/server.js +3 -1
  33. package/dist/server.js.map +1 -1
  34. package/package.json +5 -5
  35. package/public/assets/AppCenter-OTDuqwSf.js +21 -0
  36. package/public/assets/AppCenter-OTDuqwSf.js.br +0 -0
  37. package/public/assets/AppCenter-OTDuqwSf.js.gz +0 -0
  38. package/public/assets/{Default-2rFTkbo9.js → Default-D9GLpWlN.js} +1 -1
  39. package/public/assets/Default-D9GLpWlN.js.br +0 -0
  40. package/public/assets/Default-D9GLpWlN.js.gz +0 -0
  41. package/public/assets/{Invite-aN4DXJyM.js → Invite-Bhiam8En.js} +1 -1
  42. package/public/assets/Invite-Bhiam8En.js.br +0 -0
  43. package/public/assets/Invite-Bhiam8En.js.gz +0 -0
  44. package/public/assets/{MacResources-D3IlesXU.js → MacResources-DObzVJxQ.js} +1 -1
  45. package/public/assets/MacResources-DObzVJxQ.js.br +0 -0
  46. package/public/assets/MacResources-DObzVJxQ.js.gz +0 -0
  47. package/public/assets/{NotFound-BoDDivK5.js → NotFound-Dz_k_Mzf.js} +1 -1
  48. package/public/assets/NotFound-Dz_k_Mzf.js.br +0 -0
  49. package/public/assets/NotFound-Dz_k_Mzf.js.gz +0 -0
  50. package/public/assets/QASession-2crubOLY.js +150 -0
  51. package/public/assets/QASession-2crubOLY.js.br +0 -0
  52. package/public/assets/QASession-2crubOLY.js.gz +0 -0
  53. package/public/assets/{ResetPassword-DPc5kwQU.js → ResetPassword-EUm12ojo.js} +1 -1
  54. package/public/assets/ResetPassword-EUm12ojo.js.br +0 -0
  55. package/public/assets/ResetPassword-EUm12ojo.js.gz +0 -0
  56. package/public/assets/{Setup-CwPx_e_O.js → Setup-Fc_0RW0a.js} +1 -1
  57. package/public/assets/Setup-Fc_0RW0a.js.br +0 -0
  58. package/public/assets/Setup-Fc_0RW0a.js.gz +0 -0
  59. package/public/assets/Team-Ac5aOGgx.js +6 -0
  60. package/public/assets/Team-Ac5aOGgx.js.br +0 -0
  61. package/public/assets/Team-Ac5aOGgx.js.gz +0 -0
  62. package/public/assets/{Tokens-DdMMke73.js → Tokens-pEnCy-7l.js} +1 -1
  63. package/public/assets/Tokens-pEnCy-7l.js.br +0 -0
  64. package/public/assets/Tokens-pEnCy-7l.js.gz +0 -0
  65. package/public/assets/alert-dialog-DhOTocMh.js +1 -0
  66. package/public/assets/alert-dialog-DhOTocMh.js.br +0 -0
  67. package/public/assets/alert-dialog-DhOTocMh.js.gz +0 -0
  68. package/public/assets/{badge-CMf8d5RJ.js → badge-B4gbViMs.js} +1 -1
  69. package/public/assets/badge-B4gbViMs.js.br +0 -0
  70. package/public/assets/badge-B4gbViMs.js.gz +0 -0
  71. package/public/assets/build-format-DKGajT96.js +11 -0
  72. package/public/assets/build-format-DKGajT96.js.br +0 -0
  73. package/public/assets/build-format-DKGajT96.js.gz +0 -0
  74. package/public/assets/dialog-DEL1xxKJ.js +11 -0
  75. package/public/assets/dialog-DEL1xxKJ.js.br +0 -0
  76. package/public/assets/dialog-DEL1xxKJ.js.gz +0 -0
  77. package/public/assets/index-COIlCLCW.js +218 -0
  78. package/public/assets/index-COIlCLCW.js.br +0 -0
  79. package/public/assets/index-COIlCLCW.js.gz +0 -0
  80. package/public/assets/pencil-CPaoEKFm.js +6 -0
  81. package/public/assets/pencil-CPaoEKFm.js.br +0 -0
  82. package/public/assets/pencil-CPaoEKFm.js.gz +0 -0
  83. package/public/assets/resource-health-Ca4-5Rde.js +1 -0
  84. package/public/assets/resource-health-Ca4-5Rde.js.br +0 -0
  85. package/public/assets/resource-health-Ca4-5Rde.js.gz +0 -0
  86. package/public/assets/{table-CL9AvoTp.js → table-CSeGVnii.js} +1 -1
  87. package/public/assets/table-CSeGVnii.js.br +0 -0
  88. package/public/assets/table-CSeGVnii.js.gz +0 -0
  89. package/public/assets/trash-CD9Y9G-i.js +11 -0
  90. package/public/assets/trash-CD9Y9G-i.js.br +0 -0
  91. package/public/assets/trash-CD9Y9G-i.js.gz +0 -0
  92. package/public/assets/{vendor-charts-8kVeHLwY.js → vendor-charts-YPhPkjLw.js} +1 -1
  93. package/public/assets/vendor-charts-YPhPkjLw.js.br +0 -0
  94. package/public/assets/vendor-charts-YPhPkjLw.js.gz +0 -0
  95. package/public/assets/vendor-react-C5H_1fOn.js +49 -0
  96. package/public/assets/vendor-react-C5H_1fOn.js.br +0 -0
  97. package/public/assets/vendor-react-C5H_1fOn.js.gz +0 -0
  98. package/public/assets/{vendor-router-BFibuab1.js → vendor-router-CnmrRwJF.js} +1 -1
  99. package/public/assets/vendor-router-CnmrRwJF.js.br +0 -0
  100. package/public/assets/vendor-router-CnmrRwJF.js.gz +0 -0
  101. package/public/index.html +3 -3
  102. package/public/index.html.br +0 -0
  103. package/public/index.html.gz +0 -0
  104. package/public/assets/AppCenter-gbsJscjW.js +0 -21
  105. package/public/assets/AppCenter-gbsJscjW.js.br +0 -0
  106. package/public/assets/AppCenter-gbsJscjW.js.gz +0 -0
  107. package/public/assets/Default-2rFTkbo9.js.br +0 -0
  108. package/public/assets/Default-2rFTkbo9.js.gz +0 -0
  109. package/public/assets/Invite-aN4DXJyM.js.br +0 -0
  110. package/public/assets/Invite-aN4DXJyM.js.gz +0 -0
  111. package/public/assets/MacResources-D3IlesXU.js.br +0 -0
  112. package/public/assets/MacResources-D3IlesXU.js.gz +0 -0
  113. package/public/assets/NotFound-BoDDivK5.js.br +0 -0
  114. package/public/assets/NotFound-BoDDivK5.js.gz +0 -0
  115. package/public/assets/QASession-U29t9j0E.js +0 -140
  116. package/public/assets/QASession-U29t9j0E.js.br +0 -0
  117. package/public/assets/QASession-U29t9j0E.js.gz +0 -0
  118. package/public/assets/ResetPassword-DPc5kwQU.js.br +0 -0
  119. package/public/assets/ResetPassword-DPc5kwQU.js.gz +0 -0
  120. package/public/assets/Setup-CwPx_e_O.js.br +0 -0
  121. package/public/assets/Setup-CwPx_e_O.js.gz +0 -0
  122. package/public/assets/Team-DD9li-7M.js +0 -6
  123. package/public/assets/Team-DD9li-7M.js.br +0 -0
  124. package/public/assets/Team-DD9li-7M.js.gz +0 -0
  125. package/public/assets/Tokens-DdMMke73.js.br +0 -0
  126. package/public/assets/Tokens-DdMMke73.js.gz +0 -0
  127. package/public/assets/alert-dialog-DADd1jHN.js +0 -1
  128. package/public/assets/alert-dialog-DADd1jHN.js.br +0 -0
  129. package/public/assets/alert-dialog-DADd1jHN.js.gz +0 -0
  130. package/public/assets/badge-CMf8d5RJ.js.br +0 -0
  131. package/public/assets/badge-CMf8d5RJ.js.gz +0 -0
  132. package/public/assets/build-format-lp_8kSvq.js +0 -11
  133. package/public/assets/build-format-lp_8kSvq.js.br +0 -0
  134. package/public/assets/build-format-lp_8kSvq.js.gz +0 -0
  135. package/public/assets/dialog-pS8vHXXv.js +0 -11
  136. package/public/assets/dialog-pS8vHXXv.js.br +0 -0
  137. package/public/assets/dialog-pS8vHXXv.js.gz +0 -0
  138. package/public/assets/index-Cajf0T-5.js +0 -198
  139. package/public/assets/index-Cajf0T-5.js.br +0 -0
  140. package/public/assets/index-Cajf0T-5.js.gz +0 -0
  141. package/public/assets/pencil-LD1ga-Kk.js +0 -6
  142. package/public/assets/pencil-LD1ga-Kk.js.br +0 -0
  143. package/public/assets/pencil-LD1ga-Kk.js.gz +0 -0
  144. package/public/assets/resource-health-BScurILF.js +0 -1
  145. package/public/assets/resource-health-BScurILF.js.br +0 -0
  146. package/public/assets/resource-health-BScurILF.js.gz +0 -0
  147. package/public/assets/table-CL9AvoTp.js.br +0 -0
  148. package/public/assets/table-CL9AvoTp.js.gz +0 -0
  149. package/public/assets/trash-mvVp4nwq.js +0 -11
  150. package/public/assets/trash-mvVp4nwq.js.br +0 -0
  151. package/public/assets/trash-mvVp4nwq.js.gz +0 -0
  152. package/public/assets/vendor-charts-8kVeHLwY.js.br +0 -0
  153. package/public/assets/vendor-charts-8kVeHLwY.js.gz +0 -0
  154. package/public/assets/vendor-react-AJpf4YZ0.js +0 -49
  155. package/public/assets/vendor-react-AJpf4YZ0.js.br +0 -0
  156. package/public/assets/vendor-react-AJpf4YZ0.js.gz +0 -0
  157. package/public/assets/vendor-router-BFibuab1.js.br +0 -0
  158. package/public/assets/vendor-router-BFibuab1.js.gz +0 -0
@@ -0,0 +1,6 @@
1
+ import{i,j as e}from"./vendor-react-C5H_1fOn.js";import{a1 as X,ai as Y,aa as Z,B as r,I as N,L as A,h as ee,C as se,c as ie,d as te,a as ne,a9 as x,a7 as L,a8 as u,O as ae}from"./index-COIlCLCW.js";import{D as le,f as re,a as oe,d as ce,e as de,S as I,i as R,j as E,g as O,h as n}from"./dialog-DEL1xxKJ.js";import{A as me,c as he,f as xe,g as ue,d as je,e as ve,b as pe,a as ge}from"./alert-dialog-DhOTocMh.js";import{T as fe,d as be,e as P,c as o,a as Se,b as c}from"./table-CSeGVnii.js";import{j as ye,l as Ce}from"./publicLink-D6zKS_wu.js";import"./vendor-router-CnmrRwJF.js";/**
2
+ * @license lucide-react v1.45.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const $={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};$.node;const ke=X($),we=L({email:u().email(),role:u().min(1)}),De=L({token:u(),emailSent:ae(),inviteUrl:u().nullable()});function Pe(){const[g,V]=i.useState([]),[F,f]=i.useState({}),[d,b]=i.useState(""),[H,S]=i.useState(!1),[B,m]=i.useState(""),y=i.useId(),C=i.useRef(null),[M,Q]=i.useState(!1),[j,v]=i.useState(null),{register:z,handleSubmit:_,control:J,reset:U,formState:{errors:k,isSubmitting:w}}=Y({resolver:Z(we),mode:"onBlur",defaultValues:{email:"",role:"QA"}});function p(){fetch("/api/v1/team/members",{credentials:"include"}).then(s=>s.json()).then(V)}i.useEffect(()=>{p()},[]),i.useEffect(()=>{var s;d&&((s=C.current)==null||s.focus())},[d]);async function q(s){m("");try{const t=await fetch("/api/v1/team/invite",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s.email,role:s.role})});if(!t.ok)throw new Error(`Server error: ${t.status}`);const l=De.parse(await t.json()),h=l.inviteUrl??ye((await Ce()).linkBase,`/invite?token=${l.token}`),a=await(navigator.clipboard?navigator.clipboard.writeText(h):Promise.reject(new Error("no clipboard"))).then(()=>!0,()=>!1);b(h),S(a),m(`${l.emailSent?`Invite email sent to ${s.email}.`:"Email could not be sent."} ${a?"Invite link copied to clipboard.":"Copy the invite link."}`),l.emailSent?x.success(`Invite email sent to ${s.email}`):a?x.warning("Invite link copied — email could not be sent. Check your SMTP settings."):x.warning("Email could not be sent. Copy the invite link from the dialog, and check your SMTP settings.")}catch{x.error("Failed to create invite link"),m("Failed to create invite link.")}}function D(s){Q(s),s||(b(""),S(!1),m(""),U())}async function G(s,t){await fetch(`/api/v1/team/members/${s}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t})}),p()}async function K(s){const h=(await(await fetch(`/api/v1/team/members/${s}/send-reset`,{method:"POST",credentials:"include"})).json()).emailSent?"Sent":"No SMTP";f(a=>({...a,[s]:h})),setTimeout(()=>f(a=>{const T={...a};return delete T[s],T}),3e3)}async function W(s){await fetch(`/api/v1/team/members/${s}`,{method:"DELETE",credentials:"include"}),v(null),p()}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsx(me,{open:j!==null,onOpenChange:s=>{s||v(null)},children:e.jsxs(he,{children:[e.jsxs(xe,{children:[e.jsx(ue,{children:"Remove this member?"}),e.jsx(je,{children:"This member will lose access to the team immediately."})]}),e.jsxs(ve,{children:[e.jsx(pe,{children:"Cancel"}),e.jsx(ge,{className:"bg-destructive/10 text-destructive hover:bg-destructive/20 border-0",onClick:()=>j!==null&&W(j),children:"Remove"})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Team"}),e.jsxs(le,{open:M,onOpenChange:D,children:[e.jsx(re,{asChild:!0,children:e.jsxs(r,{size:"sm",children:[e.jsx(ke,{className:"mr-2 h-4 w-4"}),"Invite member"]})}),e.jsxs(oe,{className:"sm:max-w-md",children:[e.jsx(ce,{children:e.jsx(de,{children:"Invite team member"})}),e.jsx("p",{role:"status",className:"sr-only",children:B}),d?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx("p",{id:y,className:"text-sm text-muted-foreground",children:H?"Invite link copied to clipboard:":"Copy this invite link:"}),e.jsx(N,{ref:C,readOnly:!0,value:d,"aria-labelledby":y,onFocus:s=>s.currentTarget.select(),className:"font-mono text-xs"}),e.jsx(r,{onClick:()=>D(!1),children:"Done"})]}):e.jsxs("form",{onSubmit:_(q),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(A,{htmlFor:"invite-email",children:"Email"}),e.jsx(N,{id:"invite-email",type:"email",...z("email")}),k.email&&e.jsx("p",{className:"text-sm text-destructive",children:k.email.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(A,{htmlFor:"invite-role",children:"Role"}),e.jsx(ee,{name:"role",control:J,render:({field:s})=>e.jsxs(I,{value:s.value,onValueChange:s.onChange,children:[e.jsx(R,{id:"invite-role",children:e.jsx(E,{})}),e.jsxs(O,{children:[e.jsx(n,{value:"Admin",children:"Admin"}),e.jsx(n,{value:"Developer",children:"Developer"}),e.jsx(n,{value:"QA",children:"QA"}),e.jsx(n,{value:"Viewer",children:"Viewer"})]})]})})]}),e.jsx(r,{type:"submit",disabled:w,children:w?"Creating link…":"Generate invite link"})]})]})]})]}),e.jsxs(se,{children:[e.jsx(ie,{children:e.jsxs(te,{children:["Members (",g.length,")"]})}),e.jsx(ne,{className:"px-4 pt-0 pb-2",children:e.jsxs(fe,{children:[e.jsx(be,{children:e.jsxs(P,{children:[e.jsx(o,{children:"Nickname"}),e.jsx(o,{children:"Email"}),e.jsx(o,{children:"Role"}),e.jsx(o,{children:"Joined"}),e.jsx(o,{className:"w-10"})]})}),e.jsx(Se,{children:g.map(s=>e.jsxs(P,{className:"hover:bg-transparent",children:[e.jsx(c,{className:"font-medium",children:s.display_name||"—"}),e.jsx(c,{className:"text-muted-foreground text-sm",children:s.email}),e.jsx(c,{children:e.jsxs(I,{value:s.role,onValueChange:t=>G(s.id,t),children:[e.jsx(R,{className:"h-7 w-28",children:e.jsx(E,{})}),e.jsxs(O,{children:[e.jsx(n,{value:"Admin",children:"Admin"}),e.jsx(n,{value:"Developer",children:"Developer"}),e.jsx(n,{value:"QA",children:"QA"}),e.jsx(n,{value:"Viewer",children:"Viewer"})]})]})}),e.jsx(c,{className:"text-muted-foreground text-sm",children:new Date(s.joined_at).toLocaleDateString()}),e.jsx(c,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r,{variant:"secondary",size:"nav",onClick:()=>K(s.id),children:F[s.id]??"Reset pwd"}),e.jsx(r,{variant:"destructive",size:"nav",onClick:()=>v(s.id),children:"Remove"})]})})]},s.id))})]})})]})]})}export{Pe as TeamSettings};
@@ -1 +1 @@
1
- import{i as t,j as e}from"./vendor-react-AJpf4YZ0.js";import{ad as $,a5 as M,B as d,I as p,a4 as a,L as y,C as J,c as U,d as q,b as G,a as K,a2 as Q,a3 as F}from"./index-Cajf0T-5.js";import{B}from"./badge-CMf8d5RJ.js";import{A as X,c as Y,f as Z,g as ee,d as se,e as te,b as ae}from"./alert-dialog-DADd1jHN.js";import{D as ne,f as re,a as oe,d as le,e as ie,S as ce,i as de,j as xe,g as me,h as R}from"./dialog-pS8vHXXv.js";import{T as he,d as ue,e as v,c as x,a as pe,b as l}from"./table-CL9AvoTp.js";import{l as je}from"./publicLink-D6zKS_wu.js";import{P as ge,T as fe}from"./trash-mvVp4nwq.js";import"./vendor-router-BFibuab1.js";const ke=Q({name:F().min(1),expiresDays:F().refine(m=>{const i=parseInt(m,10);return!isNaN(i)&&i>=1&&i<=365},{message:"Must be between 1 and 365"})});function Ae(){const[m,i]=t.useState([]),[_,P]=t.useState(!1),[n,N]=t.useState(""),[c,b]=t.useState("api"),[w,T]=t.useState(""),[j,g]=t.useState(null),C=t.useId(),D=t.useId(),f=t.useRef(null),[L,r]=t.useState(""),{register:S,handleSubmit:O,reset:H,formState:{errors:h,isSubmitting:A}}=$({resolver:M(ke),mode:"onBlur",defaultValues:{name:"",expiresDays:"30"}});function k(){fetch("/api/v1/tokens",{credentials:"include"}).then(s=>s.json()).then(i)}t.useEffect(()=>{k()},[]),t.useEffect(()=>{var s;n&&((s=f.current)==null||s.focus())},[n]);async function z(s){r("");try{const u=await fetch("/api/v1/tokens",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.name,expires_in_days:parseInt(s.expiresDays,10),...c==="agent"?{scope:"agent"}:{}})});if(!u.ok){const o=await u.json().catch(()=>null);a.error((o==null?void 0:o.error)??"Failed to create token"),r((o==null?void 0:o.error)??"Failed to create token");return}const W=await u.json();c==="agent"&&T((await je()).agentWsBase),a.success("Token created"),N(W.token),k()}catch{a.error("Network error"),r("Network error")}}function I(s){P(s),s||(N(""),b("api"),T(""),r(""),H())}async function V(s){try{return(await fetch(`/api/v1/tokens/${s}`,{method:"DELETE",credentials:"include"})).ok?(a.success("Token revoked"),k(),!0):(a.error("Failed to revoke token"),!1)}catch{return a.error("Network error"),!1}}function E(s){return s.expires_at&&new Date(s.expires_at)<new Date}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Personal Access Tokens"}),e.jsxs(ne,{open:_,onOpenChange:I,children:[e.jsx(re,{asChild:!0,children:e.jsxs(d,{size:"sm",children:[e.jsx(ge,{className:"mr-2 h-4 w-4"}),"New token"]})}),e.jsxs(oe,{className:"sm:max-w-md",children:[e.jsx(le,{children:e.jsx(ie,{children:"Create token"})}),e.jsx("p",{role:"status",className:"sr-only",children:L}),n?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx("p",{id:C,className:"text-sm text-muted-foreground",children:"Copy this token now — it won't be shown again."}),e.jsx(p,{ref:f,readOnly:!0,value:n,"aria-labelledby":C,onFocus:s=>s.currentTarget.select(),className:"font-mono text-xs"}),c==="agent"&&w&&e.jsxs(e.Fragment,{children:[e.jsx("p",{id:D,className:"text-sm text-muted-foreground",children:"Run this on the agent Mac to connect it to this relay:"}),e.jsx(p,{readOnly:!0,value:`tapflow agent start --relay ${w} --token ${n}`,"aria-labelledby":D,onFocus:s=>s.currentTarget.select(),className:"font-mono text-xs"})]}),e.jsx(d,{onClick:()=>{r(""),(navigator.clipboard?navigator.clipboard.writeText(n):Promise.reject(new Error("no clipboard"))).then(()=>{a.success("Token copied to clipboard"),I(!1)}).catch(()=>{var s;a.error("Failed to copy — copy manually"),r("Could not copy the token. Select it and copy it by hand."),(s=f.current)==null||s.focus()})},children:"Copy & close"})]}):e.jsxs("form",{onSubmit:O(z),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-name",children:"Name"}),e.jsx(p,{id:"token-name",placeholder:"e.g. ci-deploy",...S("name")}),h.name&&e.jsx("p",{className:"text-sm text-destructive",children:h.name.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"expires",children:"Expires in (days)"}),e.jsx(p,{id:"expires",type:"number",...S("expiresDays")}),h.expiresDays&&e.jsx("p",{className:"text-sm text-destructive",children:h.expiresDays.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-type",children:"Type"}),e.jsxs(ce,{value:c,onValueChange:s=>b(s),children:[e.jsx(de,{id:"token-type",children:e.jsx(xe,{})}),e.jsxs(me,{children:[e.jsx(R,{value:"api",children:"API — CI uploads & API access"}),e.jsx(R,{value:"agent",children:"Agent — connect remote device agents (Admin only)"})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scope: ",e.jsx(B,{variant:"secondary",children:c==="agent"?"agent":"view, builds:write"})]}),e.jsx(d,{type:"submit",disabled:A,children:A?"Creating…":"Create token"})]})]})]})]}),e.jsxs(J,{children:[e.jsxs(U,{children:[e.jsx(q,{children:"Active tokens"}),e.jsxs(G,{children:["Use these tokens with ",e.jsx("code",{className:"text-xs",children:"Authorization: Bearer <token>"})," for API deployments."]})]}),e.jsx(K,{className:"px-4 pt-0 pb-2",children:e.jsxs(he,{children:[e.jsx(ue,{children:e.jsxs(v,{children:[e.jsx(x,{children:"Name"}),e.jsx(x,{children:"Scope"}),e.jsx(x,{children:"Last used"}),e.jsx(x,{children:"Expires"}),e.jsx(x,{className:"w-10"})]})}),e.jsx(pe,{children:m.length===0?e.jsx(v,{children:e.jsx(l,{colSpan:5,className:"h-20 text-center text-muted-foreground",children:"No tokens yet."})}):m.map(s=>e.jsxs(v,{className:"hover:bg-transparent",children:[e.jsx(l,{className:"font-medium",children:s.name}),e.jsx(l,{children:e.jsx(B,{variant:"secondary",children:s.scope})}),e.jsx(l,{className:"text-muted-foreground text-sm",children:s.last_used_at?new Date(s.last_used_at).toLocaleDateString():"Never"}),e.jsx(l,{children:s.expires_at?e.jsx("span",{className:E(s)?"text-destructive text-sm":"text-muted-foreground text-sm",children:E(s)?"Expired":new Date(s.expires_at).toLocaleDateString()}):e.jsx("span",{className:"text-muted-foreground text-sm",children:"Never"})}),e.jsx(l,{children:e.jsx(d,{variant:"destructive",size:"icon",className:"h-7 w-7","aria-label":"Revoke token",onClick:()=>g(s.id),children:e.jsx(fe,{className:"h-4 w-4"})})})]},s.id))})]})})]}),e.jsx(X,{open:j!==null,onOpenChange:s=>{s||g(null)},children:e.jsxs(Y,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Revoke token?"}),e.jsx(se,{children:"Any active API calls using this token will immediately fail."})]}),e.jsxs(te,{children:[e.jsx(ae,{children:"Cancel"}),e.jsx(d,{variant:"destructive",onClick:async()=>{if(j===null)return;await V(j)&&g(null)},children:"Revoke"})]})]})})]})}export{Ae as TokenSettings};
1
+ import{i as t,j as e}from"./vendor-react-C5H_1fOn.js";import{ai as $,aa as M,B as d,I as p,a9 as a,L as y,C as J,c as U,d as q,b as G,a as K,a7 as Q,a8 as F}from"./index-COIlCLCW.js";import{B}from"./badge-B4gbViMs.js";import{A as X,c as Y,f as Z,g as ee,d as se,e as te,b as ae}from"./alert-dialog-DhOTocMh.js";import{D as ne,f as re,a as oe,d as le,e as ie,S as ce,i as de,j as xe,g as me,h as R}from"./dialog-DEL1xxKJ.js";import{T as he,d as ue,e as v,c as x,a as pe,b as l}from"./table-CSeGVnii.js";import{l as je}from"./publicLink-D6zKS_wu.js";import{P as ge,T as fe}from"./trash-CD9Y9G-i.js";import"./vendor-router-CnmrRwJF.js";const ke=Q({name:F().min(1),expiresDays:F().refine(m=>{const i=parseInt(m,10);return!isNaN(i)&&i>=1&&i<=365},{message:"Must be between 1 and 365"})});function Ae(){const[m,i]=t.useState([]),[_,P]=t.useState(!1),[n,N]=t.useState(""),[c,b]=t.useState("api"),[w,T]=t.useState(""),[j,g]=t.useState(null),C=t.useId(),D=t.useId(),f=t.useRef(null),[L,r]=t.useState(""),{register:S,handleSubmit:O,reset:H,formState:{errors:h,isSubmitting:A}}=$({resolver:M(ke),mode:"onBlur",defaultValues:{name:"",expiresDays:"30"}});function k(){fetch("/api/v1/tokens",{credentials:"include"}).then(s=>s.json()).then(i)}t.useEffect(()=>{k()},[]),t.useEffect(()=>{var s;n&&((s=f.current)==null||s.focus())},[n]);async function z(s){r("");try{const u=await fetch("/api/v1/tokens",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.name,expires_in_days:parseInt(s.expiresDays,10),...c==="agent"?{scope:"agent"}:{}})});if(!u.ok){const o=await u.json().catch(()=>null);a.error((o==null?void 0:o.error)??"Failed to create token"),r((o==null?void 0:o.error)??"Failed to create token");return}const W=await u.json();c==="agent"&&T((await je()).agentWsBase),a.success("Token created"),N(W.token),k()}catch{a.error("Network error"),r("Network error")}}function I(s){P(s),s||(N(""),b("api"),T(""),r(""),H())}async function V(s){try{return(await fetch(`/api/v1/tokens/${s}`,{method:"DELETE",credentials:"include"})).ok?(a.success("Token revoked"),k(),!0):(a.error("Failed to revoke token"),!1)}catch{return a.error("Network error"),!1}}function E(s){return s.expires_at&&new Date(s.expires_at)<new Date}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Personal Access Tokens"}),e.jsxs(ne,{open:_,onOpenChange:I,children:[e.jsx(re,{asChild:!0,children:e.jsxs(d,{size:"sm",children:[e.jsx(ge,{className:"mr-2 h-4 w-4"}),"New token"]})}),e.jsxs(oe,{className:"sm:max-w-md",children:[e.jsx(le,{children:e.jsx(ie,{children:"Create token"})}),e.jsx("p",{role:"status",className:"sr-only",children:L}),n?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx("p",{id:C,className:"text-sm text-muted-foreground",children:"Copy this token now — it won't be shown again."}),e.jsx(p,{ref:f,readOnly:!0,value:n,"aria-labelledby":C,onFocus:s=>s.currentTarget.select(),className:"font-mono text-xs"}),c==="agent"&&w&&e.jsxs(e.Fragment,{children:[e.jsx("p",{id:D,className:"text-sm text-muted-foreground",children:"Run this on the agent Mac to connect it to this relay:"}),e.jsx(p,{readOnly:!0,value:`tapflow agent start --relay ${w} --token ${n}`,"aria-labelledby":D,onFocus:s=>s.currentTarget.select(),className:"font-mono text-xs"})]}),e.jsx(d,{onClick:()=>{r(""),(navigator.clipboard?navigator.clipboard.writeText(n):Promise.reject(new Error("no clipboard"))).then(()=>{a.success("Token copied to clipboard"),I(!1)}).catch(()=>{var s;a.error("Failed to copy — copy manually"),r("Could not copy the token. Select it and copy it by hand."),(s=f.current)==null||s.focus()})},children:"Copy & close"})]}):e.jsxs("form",{onSubmit:O(z),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-name",children:"Name"}),e.jsx(p,{id:"token-name",placeholder:"e.g. ci-deploy",...S("name")}),h.name&&e.jsx("p",{className:"text-sm text-destructive",children:h.name.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"expires",children:"Expires in (days)"}),e.jsx(p,{id:"expires",type:"number",...S("expiresDays")}),h.expiresDays&&e.jsx("p",{className:"text-sm text-destructive",children:h.expiresDays.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-type",children:"Type"}),e.jsxs(ce,{value:c,onValueChange:s=>b(s),children:[e.jsx(de,{id:"token-type",children:e.jsx(xe,{})}),e.jsxs(me,{children:[e.jsx(R,{value:"api",children:"API — CI uploads & API access"}),e.jsx(R,{value:"agent",children:"Agent — connect remote device agents (Admin only)"})]})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scope: ",e.jsx(B,{variant:"secondary",children:c==="agent"?"agent":"view, builds:write"})]}),e.jsx(d,{type:"submit",disabled:A,children:A?"Creating…":"Create token"})]})]})]})]}),e.jsxs(J,{children:[e.jsxs(U,{children:[e.jsx(q,{children:"Active tokens"}),e.jsxs(G,{children:["Use these tokens with ",e.jsx("code",{className:"text-xs",children:"Authorization: Bearer <token>"})," for API deployments."]})]}),e.jsx(K,{className:"px-4 pt-0 pb-2",children:e.jsxs(he,{children:[e.jsx(ue,{children:e.jsxs(v,{children:[e.jsx(x,{children:"Name"}),e.jsx(x,{children:"Scope"}),e.jsx(x,{children:"Last used"}),e.jsx(x,{children:"Expires"}),e.jsx(x,{className:"w-10"})]})}),e.jsx(pe,{children:m.length===0?e.jsx(v,{children:e.jsx(l,{colSpan:5,className:"h-20 text-center text-muted-foreground",children:"No tokens yet."})}):m.map(s=>e.jsxs(v,{className:"hover:bg-transparent",children:[e.jsx(l,{className:"font-medium",children:s.name}),e.jsx(l,{children:e.jsx(B,{variant:"secondary",children:s.scope})}),e.jsx(l,{className:"text-muted-foreground text-sm",children:s.last_used_at?new Date(s.last_used_at).toLocaleDateString():"Never"}),e.jsx(l,{children:s.expires_at?e.jsx("span",{className:E(s)?"text-destructive text-sm":"text-muted-foreground text-sm",children:E(s)?"Expired":new Date(s.expires_at).toLocaleDateString()}):e.jsx("span",{className:"text-muted-foreground text-sm",children:"Never"})}),e.jsx(l,{children:e.jsx(d,{variant:"destructive",size:"icon",className:"h-7 w-7","aria-label":"Revoke token",onClick:()=>g(s.id),children:e.jsx(fe,{className:"h-4 w-4"})})})]},s.id))})]})})]}),e.jsx(X,{open:j!==null,onOpenChange:s=>{s||g(null)},children:e.jsxs(Y,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Revoke token?"}),e.jsx(se,{children:"Any active API calls using this token will immediately fail."})]}),e.jsxs(te,{children:[e.jsx(ae,{children:"Cancel"}),e.jsx(d,{variant:"destructive",onClick:async()=>{if(j===null)return;await V(j)&&g(null)},children:"Revoke"})]})]})})]})}export{Ae as TokenSettings};
@@ -0,0 +1 @@
1
+ import{i as r,j as o}from"./vendor-react-C5H_1fOn.js";import{m as T,ae as u,j as O,Y as S,n as b,k as $,i as m,a0 as v,l as E,$ as h,D as z,o as F,W as g,Q as x}from"./index-COIlCLCW.js";var k=Object.defineProperty,n=(t,e)=>k(t,"name",{value:e,configurable:!0}),H="AlertDialog",[M,pe]=h(H,[v]),c=v(),I=n(t=>{const{__scopeAlertDialog:e,...a}=t,l=c(e);return o.jsx(z,{...l,...a,modal:!0})},"AlertDialog"),L=r.forwardRef(n(function(e,a){const{__scopeAlertDialog:l,...i}=e,s=c(l);return o.jsx(F,{...s,...i,ref:a})},"AlertDialogTrigger")),Q=n(t=>{const{__scopeAlertDialog:e,...a}=t,l=c(e);return o.jsx(T,{...l,...a})},"AlertDialogPortal"),V=r.forwardRef(n(function(e,a){const{__scopeAlertDialog:l,...i}=e,s=c(l);return o.jsx(E,{...s,...i,ref:a})},"AlertDialogOverlay")),W="AlertDialogContent",[Y,q]=M(W),B=r.forwardRef(n(function(e,a){const{__scopeAlertDialog:l,children:i,...s}=e,p=c(l),f=r.useRef(null),P=u(a,f),D=r.useRef(null);return o.jsx(Y,{scope:l,cancelRef:D,children:o.jsx(O,{role:"alertdialog",...p,...s,ref:P,onOpenAutoFocus:S(s.onOpenAutoFocus,d=>{var A;d.preventDefault(),(A=D.current)==null||A.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:i})})},"AlertDialogContent")),G=r.forwardRef(n(function(e,a){const{__scopeAlertDialog:l,...i}=e,s=c(l);return o.jsx(b,{...s,...i,ref:a})},"AlertDialogTitle")),J=r.forwardRef(n(function(e,a){const{__scopeAlertDialog:l,...i}=e,s=c(l);return o.jsx($,{...s,...i,ref:a})},"AlertDialogDescription")),K=r.forwardRef(n(function(e,a){const{__scopeAlertDialog:l,...i}=e,s=c(l);return o.jsx(m,{...s,...i,ref:a})},"AlertDialogAction")),U="AlertDialogCancel",X=r.forwardRef(n(function(e,a){const{__scopeAlertDialog:l,...i}=e,{cancelRef:s}=q(U,l),p=c(l),f=u(a,s);return o.jsx(m,{...p,...i,ref:f})},"AlertDialogCancel")),Z=I,ee=L,ae=Q,N=V,j=B,y=K,_=X,C=G,R=J;const fe=Z,De=ee,te=ae,w=r.forwardRef(({className:t,...e},a)=>o.jsx(N,{className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:a}));w.displayName=N.displayName;const oe=r.forwardRef(({className:t,...e},a)=>o.jsxs(te,{children:[o.jsx(w,{}),o.jsx(j,{ref:a,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));oe.displayName=j.displayName;const le=({className:t,...e})=>o.jsx("div",{className:g("flex flex-col space-y-2 text-center sm:text-left",t),...e});le.displayName="AlertDialogHeader";const re=({className:t,...e})=>o.jsx("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});re.displayName="AlertDialogFooter";const se=r.forwardRef(({className:t,...e},a)=>o.jsx(C,{ref:a,className:g("text-lg font-semibold",t),...e}));se.displayName=C.displayName;const ie=r.forwardRef(({className:t,...e},a)=>o.jsx(R,{ref:a,className:g("text-sm text-muted-foreground",t),...e}));ie.displayName=R.displayName;const ne=r.forwardRef(({className:t,...e},a)=>o.jsx(y,{ref:a,className:g(x(),t),...e}));ne.displayName=y.displayName;const ce=r.forwardRef(({className:t,...e},a)=>o.jsx(_,{ref:a,className:g(x({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));ce.displayName=_.displayName;export{fe as A,ne as a,ce as b,oe as c,ie as d,re as e,le as f,se as g,De as h};
@@ -1 +1 @@
1
- import{j as n}from"./vendor-react-AJpf4YZ0.js";import{J as d,a0 as o}from"./index-Cajf0T-5.js";const s=o("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"},tone:{backlog:"border-transparent bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",progress:"border-transparent bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300",done:"border-transparent bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-300",rejected:"border-transparent bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-300",ios:"border-transparent bg-sky-50 text-sky-700 dark:bg-sky-950 dark:text-sky-300",android:"border-transparent bg-emerald-50 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300"}},defaultVariants:{variant:"default"}});function g({className:r,variant:e,tone:t,...a}){return n.jsx("div",{className:d(s({variant:e,tone:t}),r),...a})}export{g as B};
1
+ import{j as n}from"./vendor-react-C5H_1fOn.js";import{W as d,a5 as o}from"./index-COIlCLCW.js";const s=o("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"},tone:{backlog:"border-transparent bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",progress:"border-transparent bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300",done:"border-transparent bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-300",rejected:"border-transparent bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-300",ios:"border-transparent bg-sky-50 text-sky-700 dark:bg-sky-950 dark:text-sky-300",android:"border-transparent bg-emerald-50 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300"}},defaultVariants:{variant:"default"}});function g({className:r,variant:e,tone:t,...a}){return n.jsx("div",{className:d(s({variant:e,tone:t}),r),...a})}export{g as B};
@@ -0,0 +1,11 @@
1
+ import{a1 as o,I as d}from"./index-COIlCLCW.js";import{j as i}from"./vendor-react-C5H_1fOn.js";/**
2
+ * @license lucide-react v1.45.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const r={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};r.node;const h=o(r);/**
7
+ * @license lucide-react v1.45.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const c={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};c.node;const l=o(c);function m({value:e,onChange:t,placeholder:a,className:n}){return i.jsxs("div",{className:"relative",children:[i.jsx(l,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),i.jsx(d,{placeholder:a,value:e,onChange:s=>t(s.target.value),className:`h-8 pl-8 ${n??"w-48"}`})]})}async function y(){const e=await fetch("/api/v1/apps",{credentials:"include"});return e.ok?(await e.json()).items:[]}async function b({appId:e,search:t,statusFilter:a}){const n=new URLSearchParams({app_id:String(e),limit:"100",sort:"uploaded_at",dir:"desc"});t&&n.set("q",t),a&&a!=="all"&&n.set("status",a);const s=await fetch(`/api/v1/builds?${n}`,{credentials:"include"});return s.ok?(await s.json()).items:[]}async function w(e){const t=await fetch("/api/v1/apps",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.status===409?{error:"App with this bundle ID and platform already exists"}:t.ok?t.json():null}async function _(e,t){await fetch(`/api/v1/builds/${e}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status_label:t})})}async function j(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"POST",credentials:"include"});if(!t.ok)throw new Error(`Failed to schedule deletion (${t.status})`);return(await t.json()).delete_after}async function v(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error(`Failed to cancel scheduled deletion (${t.status})`)}async function g(e){const t=await fetch(`/api/v1/builds/${e}`,{credentials:"include"});return t.ok?t.json():null}function k(e){const t=new Map;for(const a of e){const n=a.version_name??"Unversioned";t.has(n)||t.set(n,[]),t.get(n).push(a)}return Array.from(t.entries()).map(([a,n])=>({versionName:a,builds:n}))}const S={Backlog:"backlog","In Progress":"progress",Done:"done",Rejected:"rejected"};function $(e){return e.version_name&&e.build_number?`${e.version_name} · build ${e.build_number}`:e.version_name??e.version_label??(e.build_number?`build ${e.build_number}`:"Build")}export{h as P,S,l as a,m as b,$ as c,v as d,w as e,g as f,y as g,b as h,k as i,j as s,_ as u};
@@ -0,0 +1,11 @@
1
+ import{i as t,j as n,r as Ee}from"./vendor-react-C5H_1fOn.js";import{a1 as De,ae as U,A as st,y as L,Y as E,P as at,ak as X,x as lt,ad as ye,aj as Me,a2 as Oe,Z as ct,a6 as it,ah as dt,R as ut,F as pt,p as ft,$ as mt,a4 as ht,g as gt,V as St,ag as xt,af as Pe,E as vt,W as M,e as wt,D as yt,o as Ct,m as bt,j as ke,i as It,X as Tt,n as Le,l as Ae,k as Be}from"./index-COIlCLCW.js";/**
2
+ * @license lucide-react v1.45.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Ve={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Ve.node;const He=De(Ve);/**
7
+ * @license lucide-react v1.45.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Fe={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};Fe.node;const Pt=De(Fe);var Rt=Object.defineProperty,Nt=(s,e)=>Rt(s,"name",{value:e,configurable:!0});function ve(s,[e,r]){return Math.min(r,Math.max(e,s))}Nt(ve,"clamp");var _t=Object.defineProperty,jt=(s,e)=>_t(s,"name",{value:e,configurable:!0});function Ue(s){const e=t.useRef({value:s,previous:s});return t.useMemo(()=>(e.current.value!==s&&(e.current.previous=e.current.value,e.current.value=s),e.current.previous),[s])}jt(Ue,"usePrevious");var Et=Object.defineProperty,x=(s,e)=>Et(s,"name",{value:e,configurable:!0}),Dt=[" ","Enter","ArrowUp","ArrowDown"],Mt=[" ","Enter"],ie="Select",[me,he,Ot]=ct(ie),[re,Co]=mt(ie,[Ot,Oe]),Ce=Oe(),[kt,Z]=re(ie),[Lt,At]=re(ie);function We(s){const{__scopeSelect:e,children:r,open:o,defaultOpen:u,onOpenChange:i,value:f,defaultValue:c,onValueChange:l,dir:a,name:S,autoComplete:v,disabled:C,required:I,form:T,internal_do_not_use_render:N}=s,d=Ce(e),[h,y]=t.useState(null),[m,p]=t.useState(null),[_,j]=t.useState(!1),J=xt(a),[k,B]=Pe({prop:o,defaultProp:u??!1,onChange:i,caller:ie}),[Q,z]=Pe({prop:f,defaultProp:c,onChange:l,caller:ie}),W=t.useRef(null),$=t.useRef(Q);t.useEffect(()=>{const D=T?h==null?void 0:h.ownerDocument.getElementById(T):h==null?void 0:h.form;if(D instanceof HTMLFormElement){const F=x(()=>z($.current),"reset");return D.addEventListener("reset",F),()=>D.removeEventListener("reset",F)}},[T,h,z]);const ee=h?!!T||!!h.closest("form"):!0,[K,V]=t.useState(new Set),G=Me(),Y=Array.from(K).map(D=>D.props.value).join(";"),q=t.useCallback(D=>{V(F=>new Set(F).add(D))},[]),H=t.useCallback(D=>{V(F=>{const le=new Set(F);return le.delete(D),le})},[]),ae={required:I,trigger:h,onTriggerChange:y,valueNode:m,onValueNodeChange:p,valueNodeHasChildren:_,onValueNodeHasChildrenChange:j,contentId:G,value:Q,onValueChange:z,open:k,onOpenChange:B,dir:J,triggerPointerDownPosRef:W,disabled:C,name:S,autoComplete:v,form:T,nativeOptions:K,nativeSelectKey:Y,isFormControl:ee};return n.jsx(vt,{...d,children:n.jsx(kt,{scope:e,...ae,children:n.jsx(me.Provider,{scope:e,children:n.jsx(Lt,{scope:e,onNativeOptionAdd:q,onNativeOptionRemove:H,children:et(N)?N(ae):r})})})})}x(We,"SelectProvider");var Bt=x(s=>{const{__scopeSelect:e,children:r,...o}=s;return n.jsx(We,{__scopeSelect:e,...o,internal_do_not_use_render:({isFormControl:u})=>n.jsxs(n.Fragment,{children:[r,u?n.jsx(lo,{__scopeSelect:e}):null]})})},"Select"),Vt="SelectTrigger",$e=t.forwardRef(x(function(e,r){const{__scopeSelect:o,disabled:u=!1,...i}=e,f=Ce(o),c=Z(Vt,o),l=c.disabled||u,a=U(r,c.onTriggerChange),S=he(o),v=t.useRef("touch"),[C,I,T]=Ie(d=>{const h=S().filter(p=>!p.disabled),y=h.find(p=>p.value===c.value),m=Te(h,d,y);m!==void 0&&c.onValueChange(m.value)}),N=x(d=>{l||(c.onOpenChange(!0),T()),d&&(c.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})},"handleOpen");return n.jsx(st,{asChild:!0,...f,children:n.jsx(L.button,{type:"button",role:"combobox","aria-controls":c.open?c.contentId:void 0,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":ue(c.value)?"":void 0,...i,ref:a,onClick:E(i.onClick,d=>{d.currentTarget.focus(),v.current!=="mouse"&&N(d)}),onPointerDown:E(i.onPointerDown,d=>{v.current=d.pointerType;const h=d.target;h.hasPointerCapture(d.pointerId)&&h.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(N(d),d.preventDefault())}),onKeyDown:E(i.onKeyDown,d=>{const h=C.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&I(d.key),!(h&&d.key===" ")&&Dt.includes(d.key)&&(N(),d.preventDefault())})})})},"SelectTrigger")),Ht="SelectValue",Ft=t.forwardRef(x(function(e,r){const{__scopeSelect:o,className:u,style:i,children:f,placeholder:c="",...l}=e,a=Z(Ht,o),{onValueNodeHasChildrenChange:S}=a,v=f!==void 0,C=U(r,a.onValueNodeChange);X(()=>{S(v)},[S,v]);const I=ue(a.value);return n.jsx(L.span,{...l,asChild:I?!1:l.asChild,ref:C,style:{pointerEvents:"none"},children:n.jsx(t.Fragment,{children:I?c:f},I?"placeholder":"value")})},"SelectValue")),Ut=t.forwardRef(x(function(e,r){const{__scopeSelect:o,children:u,...i}=e;return n.jsx(L.span,{"aria-hidden":!0,...i,ref:r,children:u||"▼"})},"SelectIcon")),Wt="SelectPortal",[$t,Kt]=re(Wt,{forceMount:void 0}),zt=x(s=>{const{__scopeSelect:e,forceMount:r,...o}=s;return n.jsx($t,{scope:s.__scopeSelect,forceMount:r,children:n.jsx(at,{asChild:!0,...o})})},"SelectPortal"),ne="SelectContent",Ke=t.forwardRef(x(function(e,r){const o=Kt(ne,e.__scopeSelect),{forceMount:u=o.forceMount,...i}=e,f=Z(ne,e.__scopeSelect),[c,l]=t.useState();return X(()=>{l(new DocumentFragment)},[]),n.jsx(lt,{present:u||f.open,children:({present:a})=>a?n.jsx(qt,{...i,ref:r}):n.jsx(Gt,{...i,fragment:c})})},"SelectContent")),Gt=t.forwardRef(x(function(e,r){const{__scopeSelect:o,children:u,fragment:i}=e;return i?Ee.createPortal(n.jsx(ze,{scope:o,children:n.jsx(me.Slot,{scope:o,children:n.jsx("div",{ref:r,children:u})})}),i):null},"SelectContentFragment")),A=10,[ze,se]=re(ne),Yt=ht("SelectContent.RemoveScroll"),qt=t.forwardRef(x(function(e,r){const{__scopeSelect:o}=e,{position:u="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:f,onPointerDownOutside:c,side:l,sideOffset:a,align:S,alignOffset:v,arrowPadding:C,collisionBoundary:I,collisionPadding:T,sticky:N,hideWhenDetached:d,avoidCollisions:h,...y}=e,m=Z(ne,o),[p,_]=t.useState(null),[j,J]=t.useState(null),k=U(r,_),[B,Q]=t.useState(null),[z,W]=t.useState(null),$=he(o),[ee,K]=t.useState(!1),V=t.useRef(!1);t.useEffect(()=>{if(p)return it(p)},[p]),dt();const G=t.useCallback(g=>{const[R,...O]=$().map(b=>b.ref.current),[P]=O.slice(-1),w=document.activeElement;for(const b of g)if(b===w||(b==null||b.scrollIntoView({block:"nearest"}),b===R&&j&&(j.scrollTop=0),b===P&&j&&(j.scrollTop=j.scrollHeight),b==null||b.focus(),document.activeElement!==w))return},[$,j]),Y=t.useCallback(()=>G([B,p]),[G,B,p]);t.useEffect(()=>{ee&&Y()},[ee,Y]);const{onOpenChange:q,triggerPointerDownPosRef:H}=m;t.useEffect(()=>{if(p){let g={x:0,y:0};const R=x(P=>{var w,b;g={x:Math.abs(Math.round(P.pageX)-(((w=H.current)==null?void 0:w.x)??0)),y:Math.abs(Math.round(P.pageY)-(((b=H.current)==null?void 0:b.y)??0))}},"handlePointerMove"),O=x(P=>{g.x<=10&&g.y<=10?P.preventDefault():P.composedPath().includes(p)||q(!1),document.removeEventListener("pointermove",R),H.current=null},"handlePointerUp");return H.current!==null&&(document.addEventListener("pointermove",R),document.addEventListener("pointerup",O,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",O,{capture:!0})}}},[p,q,H]),t.useEffect(()=>{const g=x(()=>q(!1),"close");return window.addEventListener("blur",g),window.addEventListener("resize",g),()=>{window.removeEventListener("blur",g),window.removeEventListener("resize",g)}},[q]);const[ae,D]=Ie(g=>{const R=$().filter(w=>!w.disabled),O=R.find(w=>w.ref.current===document.activeElement),P=Te(R,g,O);P&&setTimeout(()=>{var w;return(w=P.ref.current)==null?void 0:w.focus()})}),F=t.useCallback((g,R,O)=>{const P=!V.current&&!O;(m.value!==void 0&&m.value===R||P)&&(Q(g),P&&(V.current=!0))},[m.value]),le=t.useCallback(()=>p==null?void 0:p.focus(),[p]),ce=t.useCallback((g,R,O)=>{const P=!V.current&&!O;(m.value!==void 0&&m.value===R||P)&&W(g)},[m.value]),pe=u==="popper"?Re:Xt,de=pe===Re?{side:l,sideOffset:a,align:S,alignOffset:v,arrowPadding:C,collisionBoundary:I,collisionPadding:T,sticky:N,hideWhenDetached:d,avoidCollisions:h}:{};return n.jsx(ze,{scope:o,content:p,viewport:j,onViewportChange:J,itemRefCallback:F,selectedItem:B,onItemLeave:le,itemTextRefCallback:ce,focusSelectedItem:Y,selectedItemText:z,position:u,isPositioned:ee,searchRef:ae,children:n.jsx(ut,{as:Yt,allowPinchZoom:!0,children:n.jsx(pt,{asChild:!0,trapped:m.open,onMountAutoFocus:g=>{g.preventDefault()},onUnmountAutoFocus:E(i,g=>{var R;(R=m.trigger)==null||R.focus({preventScroll:!0}),g.preventDefault()}),children:n.jsx(ft,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:n.jsx(pe,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:g=>g.preventDefault(),...y,...de,onPlaced:()=>K(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:E(y.onKeyDown,g=>{const R=g.ctrlKey||g.altKey||g.metaKey;if(g.key==="Tab"&&g.preventDefault(),!R&&g.key.length===1&&D(g.key),["ArrowUp","ArrowDown","Home","End"].includes(g.key)){let P=$().filter(w=>!w.disabled).map(w=>w.ref.current);if(["ArrowUp","End"].includes(g.key)&&(P=P.slice().reverse()),["ArrowUp","ArrowDown"].includes(g.key)){const w=g.target,b=P.indexOf(w);P=P.slice(b+1)}setTimeout(()=>G(P)),g.preventDefault()}})})})})})})},"SelectContentImpl")),Xt=t.forwardRef(x(function(e,r){const{__scopeSelect:o,onPlaced:u,...i}=e,f=Z(ne,o),c=se(ne,o),[l,a]=t.useState(null),[S,v]=t.useState(null),C=U(r,v),I=he(o),T=t.useRef(!1),N=t.useRef(!0),{viewport:d,selectedItem:h,selectedItemText:y,focusSelectedItem:m}=c,p=t.useCallback(()=>{if(f.trigger&&f.valueNode&&l&&S&&d&&h&&y){const k=f.trigger.getBoundingClientRect(),B=S.getBoundingClientRect(),Q=f.valueNode.getBoundingClientRect(),z=y.getBoundingClientRect();if(f.dir!=="rtl"){const w=z.left-B.left,b=Q.left-w,te=k.left-b,oe=k.width+te,ge=Math.max(oe,B.width),Se=window.innerWidth-A,xe=ve(b,[A,Math.max(A,Se-ge)]);l.style.minWidth=oe+"px",l.style.left=xe+"px"}else{const w=B.right-z.right,b=window.innerWidth-Q.right-w,te=window.innerWidth-k.right-b,oe=k.width+te,ge=Math.max(oe,B.width),Se=window.innerWidth-A,xe=ve(b,[A,Math.max(A,Se-ge)]);l.style.minWidth=oe+"px",l.style.right=xe+"px"}const W=I(),$=window.innerHeight-A*2,ee=d.scrollHeight,K=window.getComputedStyle(S),V=parseInt(K.borderTopWidth,10),G=parseInt(K.paddingTop,10),Y=parseInt(K.borderBottomWidth,10),q=parseInt(K.paddingBottom,10),H=V+G+ee+q+Y,ae=Math.min(h.offsetHeight*5,H),D=window.getComputedStyle(d),F=parseInt(D.paddingTop,10),le=parseInt(D.paddingBottom,10),ce=k.top+k.height/2-A,pe=$-ce,de=h.offsetHeight/2,g=h.offsetTop+de,R=V+G+g,O=H-R;if(R<=ce){const w=W.length>0&&h===W[W.length-1].ref.current;l.style.bottom="0px";const b=S.clientHeight-d.offsetTop-d.offsetHeight,te=Math.max(pe,de+(w?le:0)+b+Y),oe=R+te;l.style.height=oe+"px"}else{const w=W.length>0&&h===W[0].ref.current;l.style.top="0px";const te=Math.max(ce,V+d.offsetTop+(w?F:0)+de)+O;l.style.height=te+"px",d.scrollTop=R-ce+d.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=ae+"px",l.style.maxHeight=$+"px",u==null||u(),requestAnimationFrame(()=>T.current=!0)}},[I,f.trigger,f.valueNode,l,S,d,h,y,f.dir,u]);X(()=>p(),[p]);const[_,j]=t.useState();X(()=>{S&&j(window.getComputedStyle(S).zIndex)},[S]);const J=t.useCallback(k=>{k&&N.current===!0&&(p(),m==null||m(),N.current=!1)},[p,m]);return n.jsx(Zt,{scope:o,contentWrapper:l,shouldExpandOnScrollRef:T,onScrollButtonChange:J,children:n.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:n.jsx(L.div,{...i,ref:C,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),Re=t.forwardRef(x(function(e,r){const{__scopeSelect:o,align:u="start",collisionPadding:i=A,...f}=e,c=Ce(o);return n.jsx(gt,{...c,...f,ref:r,align:u,collisionPadding:i,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[Zt,be]=re(ne,{}),Ne="SelectViewport",Jt=t.forwardRef(x(function(e,r){const{__scopeSelect:o,nonce:u,...i}=e,f=se(Ne,o),c=be(Ne,o),l=U(r,f.onViewportChange),a=t.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),n.jsx(me.Slot,{scope:o,children:n.jsx(L.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:E(i.onScroll,S=>{const v=S.currentTarget,{contentWrapper:C,shouldExpandOnScrollRef:I}=c;if(I!=null&&I.current&&C){const T=Math.abs(a.current-v.scrollTop);if(T>0){const N=window.innerHeight-A*2,d=parseFloat(C.style.minHeight),h=parseFloat(C.style.height),y=Math.max(d,h);if(y<N){const m=y+T,p=Math.min(N,m),_=m-p;C.style.height=p+"px",C.style.bottom==="0px"&&(v.scrollTop=_>0?_:0,C.style.justifyContent="flex-end")}}}a.current=v.scrollTop})})})]})},"SelectViewport")),Qt="SelectGroup",[bo,eo]=re(Qt),to="SelectLabel",Ge=t.forwardRef(x(function(e,r){const{__scopeSelect:o,...u}=e,i=eo(to,o);return n.jsx(L.div,{id:i.id,...u,ref:r})},"SelectLabel")),we="SelectItem",[oo,Ye]=re(we),qe=t.forwardRef(x(function(e,r){const{__scopeSelect:o,value:u,disabled:i=!1,textValue:f,...c}=e,l=Z(we,o),a=se(we,o),S=l.value===u,[v,C]=t.useState(f??""),[I,T]=t.useState(!1),N=ye(p=>{var _;return(_=a.itemRefCallback)==null?void 0:_.call(a,p,u,i)}),d=U(r,N),h=Me(),y=t.useRef("touch"),m=x(()=>{i||(l.onValueChange(u),l.onOpenChange(!1))},"handleSelect");return n.jsx(oo,{scope:o,value:u,disabled:i,textId:h,isSelected:S,onItemTextChange:t.useCallback(p=>{C(_=>_||((p==null?void 0:p.textContent)??"").trim())},[]),children:n.jsx(me.ItemSlot,{scope:o,value:u,disabled:i,textValue:v,children:n.jsx(L.div,{role:"option","aria-labelledby":h,"data-highlighted":I?"":void 0,"aria-selected":S&&I,"data-state":S?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:d,onFocus:E(c.onFocus,()=>T(!0)),onBlur:E(c.onBlur,()=>T(!1)),onClick:E(c.onClick,()=>{y.current!=="mouse"&&m()}),onPointerUp:E(c.onPointerUp,()=>{y.current==="mouse"&&m()}),onPointerDown:E(c.onPointerDown,p=>{y.current=p.pointerType}),onPointerMove:E(c.onPointerMove,p=>{var _;y.current=p.pointerType,i?(_=a.onItemLeave)==null||_.call(a):y.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(c.onPointerLeave,p=>{var _;p.currentTarget===document.activeElement&&((_=a.onItemLeave)==null||_.call(a))}),onKeyDown:E(c.onKeyDown,p=>{var j;i||p.target!==p.currentTarget||((j=a.searchRef)==null?void 0:j.current)!==""&&p.key===" "||(Mt.includes(p.key)&&m(),p.key===" "&&p.preventDefault())})})})})},"SelectItem")),fe="SelectItemText",no=t.forwardRef(x(function(e,r){const{__scopeSelect:o,className:u,style:i,...f}=e,c=Z(fe,o),l=se(fe,o),a=Ye(fe,o),S=At(fe,o),[v,C]=t.useState(null),I=ye(m=>{var p;return(p=l.itemTextRefCallback)==null?void 0:p.call(l,m,a.value,a.disabled)}),T=U(r,C,a.onItemTextChange,I),N=v==null?void 0:v.textContent,d=t.useMemo(()=>n.jsx("option",{value:a.value,disabled:a.disabled,children:N},a.value),[a.disabled,a.value,N]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=S;return X(()=>(h(d),()=>y(d)),[h,y,d]),n.jsxs(n.Fragment,{children:[n.jsx(L.span,{id:a.textId,...f,ref:T}),a.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!ue(c.value)?Ee.createPortal(f.children,c.valueNode):null]})},"SelectItemText")),ro="SelectItemIndicator",so=t.forwardRef(x(function(e,r){const{__scopeSelect:o,...u}=e;return Ye(ro,o).isSelected?n.jsx(L.span,{"aria-hidden":!0,...u,ref:r}):null},"SelectItemIndicator")),_e="SelectScrollUpButton",Xe=t.forwardRef(x(function(e,r){const o=se(_e,e.__scopeSelect),u=be(_e,e.__scopeSelect),[i,f]=t.useState(!1),c=U(r,u.onScrollButtonChange);return X(()=>{if(o.viewport&&o.isPositioned){let l=function(){const S=a.scrollTop>0;f(S)};x(l,"handleScroll");const a=o.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[o.viewport,o.isPositioned]),i?n.jsx(Je,{...e,ref:c,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=o;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null},"SelectScrollUpButton")),je="SelectScrollDownButton",Ze=t.forwardRef(x(function(e,r){const o=se(je,e.__scopeSelect),u=be(je,e.__scopeSelect),[i,f]=t.useState(!1),c=U(r,u.onScrollButtonChange);return X(()=>{if(o.viewport&&o.isPositioned){let l=function(){const S=a.scrollHeight-a.clientHeight,v=Math.ceil(a.scrollTop)<S;f(v)};x(l,"handleScroll");const a=o.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[o.viewport,o.isPositioned]),i?n.jsx(Je,{...e,ref:c,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=o;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null},"SelectScrollDownButton")),Je=t.forwardRef(x(function(e,r){const{__scopeSelect:o,onAutoScroll:u,...i}=e,f=se("SelectScrollButton",o),c=t.useRef(null),l=he(o),a=t.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return t.useEffect(()=>()=>a(),[a]),X(()=>{var v;const S=l().find(C=>C.ref.current===document.activeElement);(v=S==null?void 0:S.ref.current)==null||v.scrollIntoView({block:"nearest"})},[l]),n.jsx(L.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:E(i.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(u,50))}),onPointerMove:E(i.onPointerMove,()=>{var S;(S=f.onItemLeave)==null||S.call(f),c.current===null&&(c.current=window.setInterval(u,50))}),onPointerLeave:E(i.onPointerLeave,()=>{a()})})},"SelectScrollButtonImpl")),Qe=t.forwardRef(x(function(e,r){const{__scopeSelect:o,...u}=e;return n.jsx(L.div,{"aria-hidden":!0,...u,ref:r})},"SelectSeparator")),ao="SelectBubbleInput",lo=t.forwardRef(x(function({__scopeSelect:e,...r},o){const u=Z(ao,e),{value:i,onValueChange:f,required:c,disabled:l,name:a,autoComplete:S,form:v}=u,{nativeOptions:C,nativeSelectKey:I}=u,T=t.useRef(null),N=U(o,T),d=i??"",h=Ue(d),y=Array.from(C).some(m=>(m.props.value??"")==="");return t.useEffect(()=>{const m=T.current;if(!m)return;const p=window.HTMLSelectElement.prototype,j=Object.getOwnPropertyDescriptor(p,"value").set;if(h!==d&&j){const J=new Event("change",{bubbles:!0});j.call(m,d),m.dispatchEvent(J)}},[h,d]),n.jsxs(L.select,{"aria-hidden":!0,required:c,tabIndex:-1,name:a,autoComplete:S,disabled:l,form:v,onChange:m=>f(m.target.value),...r,style:{...St,...r.style},ref:N,defaultValue:d,children:[ue(i)&&!y?n.jsx("option",{value:""}):null,Array.from(C)]},I)},"SelectBubbleInput"));function et(s){return typeof s=="function"}x(et,"isFunction");function ue(s){return s===""||s===void 0}x(ue,"shouldShowPlaceholder");function Ie(s){const e=ye(s),r=t.useRef(""),o=t.useRef(0),u=t.useCallback(f=>{const c=r.current+f;e(c),x((function l(a){r.current=a,window.clearTimeout(o.current),a!==""&&(o.current=window.setTimeout(()=>l(""),1e3))}),"updateSearch")(c)},[e]),i=t.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,u,i]}x(Ie,"useTypeaheadSearch");function Te(s,e,r){const u=e.length>1&&Array.from(e).every(a=>a===e[0])?e[0]:e,i=r?s.indexOf(r):-1;let f=tt(s,Math.max(i,0));u.length===1&&(f=f.filter(a=>a!==r));const l=f.find(a=>a.textValue.toLowerCase().startsWith(u.toLowerCase()));return l!==r?l:void 0}x(Te,"findNextItem");function tt(s,e){return s.map((r,o)=>s[(e+o)%s.length])}x(tt,"wrapArray");const Io=Bt,To=Ft,co=t.forwardRef(({className:s,children:e,...r},o)=>n.jsxs($e,{ref:o,className:M("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...r,children:[e,n.jsx(Ut,{asChild:!0,children:n.jsx(He,{className:"h-4 w-4 opacity-50"})})]}));co.displayName=$e.displayName;const ot=t.forwardRef(({className:s,...e},r)=>n.jsx(Xe,{ref:r,className:M("flex cursor-default items-center justify-center py-1",s),...e,children:n.jsx(Pt,{className:"h-4 w-4"})}));ot.displayName=Xe.displayName;const nt=t.forwardRef(({className:s,...e},r)=>n.jsx(Ze,{ref:r,className:M("flex cursor-default items-center justify-center py-1",s),...e,children:n.jsx(He,{className:"h-4 w-4"})}));nt.displayName=Ze.displayName;const io=t.forwardRef(({className:s,children:e,position:r="popper",...o},u)=>n.jsx(zt,{children:n.jsxs(Ke,{ref:u,className:M("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 origin-[--radix-select-content-transform-origin]",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:r,...o,children:[n.jsx(ot,{}),n.jsx(Jt,{className:M("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),n.jsx(nt,{})]})}));io.displayName=Ke.displayName;const uo=t.forwardRef(({className:s,...e},r)=>n.jsx(Ge,{ref:r,className:M("py-1.5 pl-8 pr-2 text-sm font-semibold",s),...e}));uo.displayName=Ge.displayName;const po=t.forwardRef(({className:s,children:e,...r},o)=>n.jsxs(qe,{ref:o,className:M("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(so,{children:n.jsx(wt,{className:"h-4 w-4"})})}),n.jsx(no,{children:e})]}));po.displayName=qe.displayName;const fo=t.forwardRef(({className:s,...e},r)=>n.jsx(Qe,{ref:r,className:M("-mx-1 my-1 h-px bg-muted",s),...e}));fo.displayName=Qe.displayName;const Po=yt,Ro=Ct,mo=bt,rt=t.forwardRef(({className:s,...e},r)=>n.jsx(Ae,{ref:r,className:M("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...e}));rt.displayName=Ae.displayName;const ho=t.forwardRef(({className:s,children:e,...r},o)=>n.jsxs(mo,{children:[n.jsx(rt,{}),n.jsxs(ke,{ref:o,className:M("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...r,children:[e,n.jsxs(It,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[n.jsx(Tt,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ho.displayName=ke.displayName;const go=({className:s,...e})=>n.jsx("div",{className:M("flex flex-col space-y-1.5 text-center sm:text-left",s),...e});go.displayName="DialogHeader";const So=({className:s,...e})=>n.jsx("div",{className:M("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...e});So.displayName="DialogFooter";const xo=t.forwardRef(({className:s,...e},r)=>n.jsx(Le,{ref:r,className:M("text-lg font-semibold leading-none tracking-tight",s),...e}));xo.displayName=Le.displayName;const vo=t.forwardRef(({className:s,...e},r)=>n.jsx(Be,{ref:r,className:M("text-sm text-muted-foreground",s),...e}));vo.displayName=Be.displayName;export{He as C,Po as D,Io as S,ho as a,vo as b,So as c,go as d,xo as e,Ro as f,io as g,po as h,co as i,To as j,ve as k};