@snagset/server 0.1.47 → 0.1.49

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 (91) hide show
  1. package/dist/db/migrations/0017_attachments_site_idx.sql +20 -0
  2. package/dist/jobs/reaper.js +43 -7
  3. package/dist/jobs/reaper.js.map +1 -1
  4. package/dist/routes/sites.js +7 -0
  5. package/dist/routes/sites.js.map +1 -1
  6. package/package.json +1 -1
  7. package/static/dashboard/assets/CompositeItem-Dlay6yU9.js +1 -0
  8. package/static/dashboard/assets/{CompositeList-CP60mNVK.js → CompositeList-Dwya2aET.js} +1 -1
  9. package/static/dashboard/assets/{ConfirmDialog-BsHHrPi0.js → ConfirmDialog-CI4lfGTy.js} +1 -1
  10. package/static/dashboard/assets/{CopyButton-Drniwbyh.js → CopyButton-C-KCr0MF.js} +1 -1
  11. package/static/dashboard/assets/{FieldItemContext-D0PwWPOC.js → FieldItemContext-CgKFsCxF.js} +1 -1
  12. package/static/dashboard/assets/InstallTag-m5sxp8bY.js +17 -0
  13. package/static/dashboard/assets/InstanceRows-Bzwj6LZ6.js +1 -0
  14. package/static/dashboard/assets/{McpTokens-BAlNfNd7.js → McpTokens-DKqRkxCT.js} +1 -1
  15. package/static/dashboard/assets/{SaveState-Cd1Ay9eR.js → SaveState-BfVze7xL.js} +1 -1
  16. package/static/dashboard/assets/{_app-gdbZO1qh.js → _app-CMWnhNah.js} +2 -2
  17. package/static/dashboard/assets/{_app-DKYhNXgR.js → _app-wDjbs9TO.js} +1 -1
  18. package/static/dashboard/assets/{activity-Bhm2xtHX.js → activity-B0i6FGLk.js} +1 -1
  19. package/static/dashboard/assets/{arrow-left-BePtugkE.js → arrow-left-BdulZ2N2.js} +1 -1
  20. package/static/dashboard/assets/avatar-CaEv2hMS.js +1 -0
  21. package/static/dashboard/assets/{badge-VIGkRs4v.js → badge-CTKpfsRI.js} +1 -1
  22. package/static/dashboard/assets/{card-BI3eAi_u.js → card-CGjT73CQ.js} +1 -1
  23. package/static/dashboard/assets/{check-BWPSlb5c.js → check-DOzkll0G.js} +1 -1
  24. package/static/dashboard/assets/{chevron-down-rCu-Llo-.js → chevron-down-C-tz7Ypu.js} +1 -1
  25. package/static/dashboard/assets/{chevron-right-CEWgWiw7.js → chevron-right-DoJvWwhg.js} +1 -1
  26. package/static/dashboard/assets/{copy-DqKLS4Wq.js → copy-CeZ_egx3.js} +1 -1
  27. package/static/dashboard/assets/dialog-BQKOXDHO.js +6 -0
  28. package/static/dashboard/assets/{dropdown-menu-8UzHM47U.js → dropdown-menu-JwoQU2iu.js} +3 -3
  29. package/static/dashboard/assets/{forgot-BkiP4xvQ.js → forgot-B0XXho6c.js} +1 -1
  30. package/static/dashboard/assets/{image-off-Ccb5M8cE.js → image-off-Bqobgs6b.js} +1 -1
  31. package/static/dashboard/assets/{index-N-I90MR_.js → index-DAdE1N-R.js} +3 -3
  32. package/static/dashboard/assets/inertValue-C7RCWgtk.js +1 -0
  33. package/static/dashboard/assets/{invite-BjcujTlZ.js → invite-BnuAkGJV.js} +1 -1
  34. package/static/dashboard/assets/isElementDisabled-CwHw_lZC.js +1 -0
  35. package/static/dashboard/assets/{label-BasLSUbe.js → label-ComnO04i.js} +1 -1
  36. package/static/dashboard/assets/{layout-grid-0UvojwDX.js → layout-grid-DFwgnnTY.js} +1 -1
  37. package/static/dashboard/assets/me-CPtVQtAA.js +1 -0
  38. package/static/dashboard/assets/{parts-D5D8UvJZ.js → parts-CmbgXJj-.js} +1 -1
  39. package/static/dashboard/assets/{plus-CY7ZoXBb.js → plus-BvOlN259.js} +1 -1
  40. package/static/dashboard/assets/{reset-CM1Lbm5Y.js → reset-Bh0sMyz7.js} +1 -1
  41. package/static/dashboard/assets/{s._site-qjz6oyIe.js → s._site-CWq3mZQw.js} +1 -1
  42. package/static/dashboard/assets/{s._site.comments-g2SJ-ibY.js → s._site.comments-CeTjN5Kp.js} +3 -3
  43. package/static/dashboard/assets/s._site.reviewers-Bug-Q-ge.js +1 -0
  44. package/static/dashboard/assets/s._site.settings-DKcZEHhs.js +1 -0
  45. package/static/dashboard/assets/serializeValue-B8e3iXO-.js +1 -0
  46. package/static/dashboard/assets/{setup-CYOlLmfs.js → setup-Iu06TDZs.js} +1 -1
  47. package/static/dashboard/assets/{sign-in-Cgz8eQ3f.js → sign-in-B0OEOoe5.js} +1 -1
  48. package/static/dashboard/assets/{sign-up-3lt50o_b.js → sign-up-BeFiwRrx.js} +1 -1
  49. package/static/dashboard/assets/sites-BE9RqJnf.js +1 -0
  50. package/static/dashboard/assets/{studio-CpQminn4.js → studio-Cg1Oy1vK.js} +1 -1
  51. package/static/dashboard/assets/studio-DllMPJ8r.js +1 -0
  52. package/static/dashboard/assets/studio.index-DLNyob4p.js +1 -0
  53. package/static/dashboard/assets/studio.integrations-Db87XYUB.js +1 -0
  54. package/static/dashboard/assets/{studio.members-zPXfLzqQ.js → studio.members-KAqQDCv5.js} +2 -2
  55. package/static/dashboard/assets/studio.plan-5xTPUYos.js +1 -0
  56. package/static/dashboard/assets/{sun-BBapmFM7.js → sun-BlID8y0w.js} +1 -1
  57. package/static/dashboard/assets/{switch-Bsz6KmWY.js → switch-BnkPAxu8.js} +1 -1
  58. package/static/dashboard/assets/{table-DzETz1FN.js → table-BBCwsDcH.js} +1 -1
  59. package/static/dashboard/assets/{useAriaLabelledBy-G2WKNZQz.js → useAriaLabelledBy-DBIPA8TM.js} +1 -1
  60. package/static/dashboard/assets/{useBaseQuery-CN0OIcOk.js → useBaseQuery-CgPeQebj.js} +1 -1
  61. package/static/dashboard/assets/useCompositeItem-CU7GSvP-.js +1 -0
  62. package/static/dashboard/assets/useQuery-Bt47w3ja.js +1 -0
  63. package/static/dashboard/assets/useRender-DQYQmhIj.js +1 -0
  64. package/static/dashboard/assets/{useValueChanged-CtiAjxsm.js → useValueChanged-uYr-YTth.js} +1 -1
  65. package/static/dashboard/assets/{users-xtSDzXF_.js → users-CDypTaZ2.js} +1 -1
  66. package/static/dashboard/assets/welcome-CFlCPiEh.js +11 -0
  67. package/static/dashboard/assets/{widget-signin-TVLP12BC.js → widget-signin-BL4LoDmO.js} +1 -1
  68. package/static/dashboard/assets/you-BFacaF4g.js +1 -0
  69. package/static/dashboard/assets/{zod-BXmCiwU1.js → zod-BfBWjDq8.js} +1 -1
  70. package/static/dashboard/index.html +1 -1
  71. package/static/widget/build.json +2 -2
  72. package/static/widget/snag.js +1 -1
  73. package/static/widget/snag.runtime.js +1 -1
  74. package/static/dashboard/assets/CompositeItem-BTXT0lX3.js +0 -1
  75. package/static/dashboard/assets/InstallTag-w7NKoYXb.js +0 -1
  76. package/static/dashboard/assets/InstanceRows-BIZM7ybm.js +0 -1
  77. package/static/dashboard/assets/avatar-CVYnp83R.js +0 -1
  78. package/static/dashboard/assets/dialog-CcUiqZEq.js +0 -6
  79. package/static/dashboard/assets/me-D4xGiOon.js +0 -1
  80. package/static/dashboard/assets/s._site.reviewers-Dpth1JRK.js +0 -1
  81. package/static/dashboard/assets/s._site.settings-p9OdU758.js +0 -1
  82. package/static/dashboard/assets/serializeValue-DRMAHja_.js +0 -1
  83. package/static/dashboard/assets/sites-C9rP2ynx.js +0 -1
  84. package/static/dashboard/assets/studio-CMVnubeo.js +0 -1
  85. package/static/dashboard/assets/studio.index-CkTmhLMH.js +0 -1
  86. package/static/dashboard/assets/studio.integrations-ChEjzS_W.js +0 -1
  87. package/static/dashboard/assets/studio.plan-DnwQn2IX.js +0 -1
  88. package/static/dashboard/assets/useQuery-OxQw-0wS.js +0 -1
  89. package/static/dashboard/assets/useRender-B_SZ1tbi.js +0 -1
  90. package/static/dashboard/assets/welcome-CUouc6FU.js +0 -11
  91. package/static/dashboard/assets/you-C6Mc4irF.js +0 -1
@@ -1 +0,0 @@
1
- import{r as x,E as rn,l as q,aI as we,aE as pe,aJ as xe,g as se,aK as Et,aG as Ze,aF as bt,aL as kn,aM as sn,aN as Dn,aO as St,aP as cn,aQ as it,aR as vt,aS as _t,aT as ln,n as In,e as U,f as ie,aa as Fn,k as Ct,i as Wn,j as Pt,h as an}from"./index-N-I90MR_.js";import{$ as At,w as Mt,i as ht,aa as Vn,av as fn,ad as un,U as $n,aw as zn,v as ue,L as Bn,ax as Hn,ay as Nt,az as pt,aA as Kt,aB as fe,aC as Xe,a0 as _n,a4 as Nn,aD as st,aE as ct,aF as dn,aG as Tt,aH as Kn,aI as jn,aJ as Yn,aK as Xn,C as Un,aL as qn,aM as Gn}from"./dialog-CcUiqZEq.js";import{t as Jn,g as mn,c as Je,x as xt,r as et,a as He,B as jt,m as Qn}from"./label-BasLSUbe.js";import{u as Zn}from"./useValueChanged-CtiAjxsm.js";import{u as eo}from"./CompositeList-CP60mNVK.js";const Le=Math.min,de=Math.max,tt=Math.round,Ue=Math.floor,me=e=>({x:e,y:e}),to={left:"right",right:"left",bottom:"top",top:"bottom"};function gn(e,t,n){return de(e,Le(t,n))}function ye(e,t){return typeof e=="function"?e(t):e}function Q(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function Lt(e){return e==="x"?"y":"x"}function kt(e){return e==="y"?"height":"width"}function J(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Dt(e){return Lt(J(e))}function no(e,t,n){n===void 0&&(n=!1);const o=Re(e),r=Dt(e),i=kt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nt(s)),[s,nt(s)]}function oo(e){const t=nt(e);return[Ot(e),t,Ot(t)]}function Ot(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Yt=["left","right"],Xt=["right","left"],ro=["top","bottom"],io=["bottom","top"];function so(e,t,n){switch(e){case"top":case"bottom":return n?t?Xt:Yt:t?Yt:Xt;case"left":case"right":return t?ro:io;default:return[]}}function co(e,t,n,o){const r=Re(e);let i=so(Q(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(Ot)))),i}function nt(e){const t=Q(e);return to[t]+e.slice(t.length)}function lo(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function hn(e){return typeof e!="number"?lo(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function wr(e,t={}){const{enabled:n=!0,event:o="click",toggle:r=!0,ignoreMouse:i=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Jn}=t,f="rootStore"in e?e.rootStore:e,u=f.context.dataRef,a=x.useRef(void 0),g=At(),d=Mt(),m=x.useMemo(()=>{function p(y,w,E,R){const v=Je(l,w,E);y&&R==="touch"&&c>0?d.start(c,()=>{f.setOpen(!0,v)}):f.setOpen(y,v)}function h(y,w,E){const R=u.current.openEvent,v=f.select("domReferenceElement")!==w;return y&&v||!y||!r?!0:R&&s?!E(R.type):!1}return{onPointerDown(y){a.current=ht(y.pointerType,!0)&&fn(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=a.current,E=y.nativeEvent,R=f.select("open");if(y.button!==0||o==="click"||ht(w,!0)&&i)return;const v=h(R,y.currentTarget,A=>A==="click"||A==="mousedown"),S=mn(E);if(Vn(S)){p(v,E,S,w);return}const P=y.currentTarget;g.request(()=>{p(v,E,P,w)})},onClick(y){if(o==="mousedown-only")return;const w=a.current;if(o==="mousedown"&&w){a.current=void 0;return}if(ht(w,!0)&&i)return;const E=f.select("open"),R=h(E,y.currentTarget,v=>v==="click"||v==="mousedown"||v==="keydown"||v==="keyup");p(R,y.nativeEvent,y.currentTarget,w)},onKeyDown(){a.current=void 0}}},[u,o,i,l,f,s,r,g,d,c]);return x.useMemo(()=>n?{reference:m}:rn,[n,m])}function Ut(e,t,n){let{reference:o,floating:r}=e;const i=J(t),s=Dt(t),c=kt(s),l=Q(t),f=i==="y",u=o.x+o.width/2-r.width/2,a=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let d;switch(l){case"top":d={x:u,y:o.y-r.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:a};break;case"left":d={x:o.x-r.width,y:a};break;default:d={x:o.x,y:o.y}}const m=Re(t);return m&&(d[s]+=g*(m==="end"?1:-1)*(n&&f?-1:1)),d}async function ao(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:a="floating",altBoundary:g=!1,padding:d=0}=ye(t,e),m=hn(d),h=c[g?a==="floating"?"reference":"floating":a],y=ot(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(h)))==null||n?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:l})),w=a==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),R=await(i.isElement==null?void 0:i.isElement(E))&&await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1},v=ot(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:E,strategy:l}):w);return{top:(y.top-v.top+m.top)/R.y,bottom:(v.bottom-y.bottom+m.bottom)/R.y,left:(y.left-v.left+m.left)/R.x,right:(v.right-y.right+m.right)/R.x}}const fo=50,uo=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:ao},l=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:a}=Ut(f,o,l),g=o,d=0;const m={};for(let p=0;p<i.length;p++){const h=i[p];if(!h)continue;const{name:y,fn:w}=h,{x:E,y:R,data:v,reset:S}=await w({x:u,y:a,initialPlacement:o,placement:g,strategy:r,middlewareData:m,rects:f,platform:c,elements:{reference:e,floating:t}});u=E??u,a=R??a,m[y]={...m[y],...v},S&&d<fo&&(d++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(f=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:u,y:a}=Ut(f,g,l)),p=-1)}return{x:u,y:a,placement:g,strategy:r,middlewareData:m}},mo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:l,elements:f}=t,{mainAxis:u=!0,crossAxis:a=!0,fallbackPlacements:g,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...h}=ye(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Q(r),w=J(c),E=Q(c)===c,R=await(l.isRTL==null?void 0:l.isRTL(f.floating)),v=g||(E||!p?[nt(c)]:oo(c)),S=m!=="none";!g&&S&&v.push(...co(c,p,m,R));const P=[c,...v],A=await l.detectOverflow(t,h),k=[];let L=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&k.push(A[y]),a){const T=no(r,s,R);k.push(A[T[0]],A[T[1]])}if(L=[...L,{placement:r,overflows:k}],!k.every(T=>T<=0)){var D,K;const T=(((D=i.flip)==null?void 0:D.index)||0)+1,$=P[T];if($&&(!(a==="alignment"?w!==J($):!1)||L.every(b=>J(b.placement)===w?b.overflows[0]>0:!0)))return{data:{index:T,overflows:L},reset:{placement:$}};let F=(K=L.filter(W=>W.overflows[0]<=0).sort((W,b)=>W.overflows[1]-b.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(d){case"bestFit":{var _;const W=(_=L.filter(b=>{if(S){const z=J(b.placement);return z===w||z==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(z=>z>0).reduce((z,B)=>z+B,0)]).sort((b,z)=>b[1]-z[1])[0])==null?void 0:_[0];W&&(F=W);break}case"initialPlacement":F=c;break}if(r!==F)return{reset:{placement:F}}}return{}}}},pn=new Set(["left","top"]);async function go(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Q(n),c=Re(n),l=J(n)==="y",f=pn.has(s)?-1:1,u=i&&l?-1:1,a=ye(t,e);let{mainAxis:g,crossAxis:d,alignmentAxis:m}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return c&&typeof m=="number"&&(d=c==="end"?m*-1:m),l?{x:d*u,y:g*f}:{x:g*f,y:d*u}}const ho=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await go(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},po=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:E,y:R}=w;return{x:E,y:R}}},...f}=ye(e,t),u={x:n,y:o},a=await i.detectOverflow(t,f),g=J(r),d=Lt(g);let m=u[d],p=u[g];const h=(w,E)=>gn(E+a[w==="y"?"top":"left"],E,E-a[w==="y"?"bottom":"right"]);s&&(m=h(d,m)),c&&(p=h(g,p));const y=l.fn({...t,[d]:m,[g]:p});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[d]:s,[g]:c}}}}}},xo=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:s,rects:c,middlewareData:l}=t,{offset:f=0,mainAxis:u=!0,crossAxis:a=!0}=ye(e,t),g={x:r,y:i},d=J(s),m=Lt(d);let p=g[m],h=g[d];const y=ye(f,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(o=y.crossAxis)!=null?o:0};if(u){const v=m==="y"?"height":"width",S=c.reference[m]-c.floating[v]+w.mainAxis,P=c.reference[m]+c.reference[v]-w.mainAxis;p<S?p=S:p>P&&(p=P)}if(a){var E,R;const v=m==="y"?"width":"height",S=pn.has(Q(s)),P=c.reference[d]-c.floating[v]+(S&&((E=l.offset)==null?void 0:E[d])||0)+(S?0:w.crossAxis),A=c.reference[d]+c.reference[v]+(S?0:((R=l.offset)==null?void 0:R[d])||0)-(S?w.crossAxis:0);h<P?h=P:h>A&&(h=A)}return{[m]:p,[d]:h}}}},yo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:s=()=>{},...c}=ye(e,t),l=await r.detectOverflow(t,c),f=Q(n),u=Re(n),a=J(n)==="y",{width:g,height:d}=o.floating;let m,p;f==="top"||f==="bottom"?(m=f,p=u===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(p=f,m=u==="end"?"top":"bottom");const h=d-l.top-l.bottom,y=g-l.left-l.right,w=Le(d-l[m],h),E=Le(g-l[p],y),R=t.middlewareData.shift,v=!R;let S=w,P=E;R!=null&&R.enabled.x&&(P=y),R!=null&&R.enabled.y&&(S=h),v&&!u&&(a?P=g-2*de(l.left,l.right):S=d-2*de(l.top,l.bottom)),await s({...t,availableWidth:P,availableHeight:S});const A=await r.getDimensions(i.floating);return g!==A.width||d!==A.height?{reset:{rects:!0}}:{}}}};function xn(e){const t=xe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=pe(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=tt(n)!==i||tt(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function It(e){return q(e)?e:e.contextElement}function Te(e){const t=It(e);if(!pe(t))return me(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=xn(t);let s=(i?tt(n.width):n.width)/o,c=(i?tt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const wo=me(0);function yn(e){const t=se(e);return!ln()||!t.visualViewport?wo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ro(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===se(e)}function Ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=It(e);let s=me(1);t&&(o?q(o)&&(s=Te(o)):s=Te(e));const c=Ro(i,n,o)?yn(i):me(0);let l=(r.left+c.x)/s.x,f=(r.top+c.y)/s.y,u=r.width/s.x,a=r.height/s.y;if(i&&o){const g=se(i),d=q(o)?se(o):o;let m=g,p=_t(m);for(;p&&d!==m;){const h=Te(p),y=p.getBoundingClientRect(),w=xe(p),E=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*h.x,R=y.top+(p.clientTop+parseFloat(w.paddingTop))*h.y;l*=h.x,f*=h.y,u*=h.x,a*=h.y,l+=E,f+=R,m=se(p),p=_t(m)}}return ot({width:u,height:a,x:l,y:f})}function lt(e,t){const n=it(e).scrollLeft;return t?t.left+n:Ae(we(e)).left+n}function wn(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-lt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=we(o),c=t?Et(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},f=me(1);const u=me(0),a=pe(o);if((a||!i)&&((St(o)!=="body"||cn(s))&&(l=it(o)),a)){const d=Ae(o);f=Te(o),u.x=d.x+o.clientLeft,u.y=d.y+o.clientTop}const g=s&&!a&&!i?wn(s,l):me(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+g.x,y:n.y*f.y-l.scrollTop*f.y+u.y+g.y}}function vo(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ao(e){const t=it(e),n=e.ownerDocument.body,o=de(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=de(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+lt(e);const s=-t.scrollTop;return xe(n).direction==="rtl"&&(i+=de(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}const Oo=25;function Eo(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=se(e),i=we(e),s=r.visualViewport;let c=i.clientWidth,l=i.clientHeight,f=0,u=0;if(s){const g=!ln()||t==="fixed";o?g||(f=-s.offsetLeft,u=-s.offsetTop):(c=s.width,l=s.height,g&&(f=s.offsetLeft,u=s.offsetTop))}if(lt(i)<=0){const g=i.ownerDocument,d=g.body,m=getComputedStyle(d),p=g.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(i.clientWidth-d.clientWidth-p),y=getComputedStyle(i).scrollbarGutter==="stable both-edges"?h/2:h;y<=Oo&&(c-=y)}return{width:c,height:l,x:f,y:u}}function So(e,t){const n=Ae(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Te(e),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,f=o*i.y;return{width:s,height:c,x:l,y:f}}function qt(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=Eo(e,n,t);else if(t==="document")o=Ao(we(e));else if(q(t))o=So(t,n);else{const r=yn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ot(o)}function Co(e,t){const n=t.get(e);if(n)return n;let o=vt(e,[],!1).filter(c=>q(c)&&St(c)!=="body"),r=null;const i=xe(e).position==="fixed";let s=i?Ze(e):e;for(;q(s)&&!bt(s);){const c=xe(s),l=sn(s),f=r?r.position:i?"fixed":"";!l&&(f==="fixed"||f==="absolute"&&c.position==="static")?o=o.filter(a=>a!==s):r=c,s=Ze(s)}return t.set(e,o),o}function Po(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Et(t)?[]:Co(t,this._c):[].concat(n),o],c=qt(t,s[0],r);let l=c.top,f=c.right,u=c.bottom,a=c.left;for(let g=1;g<s.length;g++){const d=qt(t,s[g],r);l=de(d.top,l),f=Le(d.right,f),u=Le(d.bottom,u),a=de(d.left,a)}return{width:f-a,height:u-l,x:a,y:l}}function Mo(e){const{width:t,height:n}=xn(e);return{width:t,height:n}}function To(e,t,n){const o=pe(t),r=we(t),i=n==="fixed",s=Ae(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const l=me(0);if((o||!i)&&((St(t)!=="body"||cn(r))&&(c=it(t)),o)){const g=Ae(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}!o&&r&&(l.x=lt(r));const f=r&&!o&&!i?wn(r,c):me(0),u=s.left+c.scrollLeft-l.x-f.x,a=s.top+c.scrollTop-l.y-f.y;return{x:u,y:a,width:s.width,height:s.height}}function yt(e){return xe(e).position==="static"}function Gt(e,t){if(!pe(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function Rn(e,t){const n=se(e);if(Et(e))return n;if(!pe(e)){let r=Ze(e);for(;r&&!bt(r);){if(q(r)&&!yt(r))return r;r=Ze(r)}return n}let o=Gt(e,t);for(;o&&kn(o)&&yt(o);)o=Gt(o,t);return o&&bt(o)&&yt(o)&&!sn(o)?n:o||Dn(e)||n}const Lo=async function(e){const t=this.getOffsetParent||Rn,n=this.getDimensions,o=await n(e.floating);return{reference:To(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ko(e){return xe(e).direction==="rtl"}const Do={convertOffsetParentRelativeRectToViewportRelativeRect:bo,getDocumentElement:we,getClippingRect:Po,getOffsetParent:Rn,getElementRects:Lo,getClientRects:vo,getDimensions:Mo,getScale:Te,isElement:q,isRTL:ko};function bn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Io(e,t,n){let o=null,r;const i=we(e);function s(){var u;clearTimeout(r),(u=o)==null||u.disconnect(),o=null}function c(u,a){u===void 0&&(u=!1),a===void 0&&(a=1),s();const g=e.getBoundingClientRect(),{left:d,top:m,width:p,height:h}=g;if(u||t(),!p||!h)return;const y=Ue(m),w=Ue(i.clientWidth-(d+p)),E=Ue(i.clientHeight-(m+h)),R=Ue(d),S={rootMargin:-y+"px "+-w+"px "+-E+"px "+-R+"px",threshold:de(0,Le(1,a))||1};let P=!0;function A(k){const L=k[0].intersectionRatio;if(!bn(g,e.getBoundingClientRect()))return c();if(L!==a){if(!P)return c();L?c(!1,L):r=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(A,{...S,root:i.ownerDocument})}catch{o=new IntersectionObserver(A,S)}o.observe(e)}const l=se(e),f=()=>c(n);return l.addEventListener("resize",f),c(!0),()=>{l.removeEventListener("resize",f),s()}}function Jt(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=It(e),u=r||i?[...f?vt(f):[],...t?vt(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n),i&&y.addEventListener("resize",n)});const a=f&&c?Io(f,n,i):null;let g=-1,d=null;s&&(d=new ResizeObserver(y=>{let[w]=y;w&&w.target===f&&d&&t&&(d.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var E;(E=d)==null||E.observe(t)})),n()}),f&&!l&&d.observe(f),t&&d.observe(t));let m,p=l?Ae(e):null;l&&h();function h(){const y=Ae(e);p&&!bn(p,y)&&n(),p=y,m=requestAnimationFrame(h)}return n(),()=>{var y;u.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),a?.(),(y=d)==null||y.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const Fo=ho,Wo=po,Vo=mo,$o=yo,zo=xo,Bo=(e,t,n)=>{const o=new Map,r=n??{},i={...Do,...r.platform,_c:o};return uo(e,t,{...r,platform:i})};var Ho=typeof document<"u",_o=function(){},Qe=Ho?x.useLayoutEffect:_o;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!rt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!rt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function vn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qt(e,t){const n=vn(e);return Math.round(t*n)/n}function wt(e){const t=x.useRef(e);return Qe(()=>{t.current=e}),t}function No(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:f}=e,[u,a]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,d]=x.useState(o);rt(g,o)||d(o);const[m,p]=x.useState(null),[h,y]=x.useState(null),w=x.useCallback(b=>{b!==S.current&&(S.current=b,p(b))},[]),E=x.useCallback(b=>{b!==P.current&&(P.current=b,y(b))},[]),R=i||m,v=s||h,S=x.useRef(null),P=x.useRef(null),A=x.useRef(u),k=l!=null,L=wt(l),D=wt(r),K=wt(f),_=x.useCallback(()=>{if(!S.current||!P.current)return;const b={placement:t,strategy:n,middleware:g};D.current&&(b.platform=D.current),Bo(S.current,P.current,b).then(z=>{const B={...z,isPositioned:K.current!==!1};T.current&&!rt(A.current,B)&&(A.current=B,In.flushSync(()=>{a(B)}))})},[g,t,n,D,K]);Qe(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,a(b=>({...b,isPositioned:!1})))},[f]);const T=x.useRef(!1);Qe(()=>(T.current=!0,()=>{T.current=!1}),[]),Qe(()=>{if(R&&(S.current=R),v&&(P.current=v),R&&v){if(L.current)return L.current(R,v,_);_()}},[R,v,_,L,k]);const $=x.useMemo(()=>({reference:S,floating:P,setReference:w,setFloating:E}),[w,E]),F=x.useMemo(()=>({reference:R,floating:v}),[R,v]),W=x.useMemo(()=>{const b={position:n,left:0,top:0};if(!F.floating)return b;const z=Qt(F.floating,u.x),B=Qt(F.floating,u.y);return c?{...b,transform:"translate("+z+"px, "+B+"px)",...vn(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:B}},[n,c,F.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:_,refs:$,elements:F,floatingStyles:W}),[u,_,$,F,W])}const Ko=(e,t)=>{const n=Fo(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>{const n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yo=(e,t)=>({fn:zo(e).fn,options:[e,t]}),Xo=(e,t)=>{const n=Vo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uo=(e,t)=>{const n=$o(e);return{name:n.name,fn:n.fn,options:[e,t]}};function qo(e){return Go(e,e.rootContext)}function Go(e,t){const{nodeId:n,externalTree:o}=e,r=t.useState("referenceElement"),i=t.useState("floatingElement"),s=t.useState("domReferenceElement"),c=t.useState("open"),l=t.useState("floatingId"),[f,u]=x.useState(null),[a,g]=x.useState(void 0),[d,m]=x.useState(void 0),p=x.useRef(null),h=un(o),y=x.useMemo(()=>({reference:r,floating:i,domReference:s}),[r,i,s]),w=No({...e,elements:{...y,...f&&{reference:f}}}),E=q(a)?a:null,R=d===void 0?t.state.floatingElement:d;t.useSyncedValue("referenceElement",a??null),t.useSyncedValue("domReferenceElement",a===void 0?s:E),t.useSyncedValue("floatingElement",R);const v=x.useCallback(D=>{const K=q(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;u(K),w.refs.setReference(K)},[w.refs]),S=x.useCallback(D=>{(q(D)||D===null)&&(p.current=D,g(D)),(q(w.refs.reference.current)||w.refs.reference.current===null||D!==null&&!q(D))&&w.refs.setReference(D)},[w.refs,g]),P=x.useCallback(D=>{m(D),w.refs.setFloating(D)},[w.refs]),A=x.useMemo(()=>({...w.refs,setReference:S,setFloating:P,setPositionReference:v,domReference:p}),[w.refs,S,P,v]),k=x.useMemo(()=>({...w.elements,domReference:s}),[w.elements,s]),L=x.useMemo(()=>({...w,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:l,refs:A,elements:k,nodeId:n,rootStore:t}),[w,A,k,n,t,c,l]);return U(()=>{s&&(p.current=s)},[s]),U(()=>{t.context.dataRef.current.floatingContext=L;const D=h?.nodesRef.current.find(K=>K.id===n);D&&(D.context=L)}),x.useMemo(()=>({...w,context:L,refs:A,elements:k,rootStore:t}),[w,A,k,L,t])}const Jo="Escape";function Zt(e){return _n&&e.movementX===0&&e.movementY===0}function at(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function qe(e,t){return at(t,e===dn||e===Tt,e===st||e===ct)}function Rt(e,t,n){return at(t,e===Tt,n?e===st:e===ct)||e==="Enter"||e===" "||e===""}function Qo(e,t,n){return at(t,n?e===st:e===ct,e===Tt)}function Zo(e,t,n,o){const r=n?e===ct:e===st,i=e===dn;return t==="both"||t==="horizontal"&&o?e===Jo:at(t,r,i)}function Rr(e,t){const{listRef:n,activeIndex:o,onNavigate:r=()=>{},enabled:i=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:f=!1,rtl:u=!1,virtual:a=!1,focusItemOnOpen:g="auto",focusItemOnHover:d=!0,openOnArrowKeyDown:m=!0,disabledIndices:p=void 0,orientation:h="vertical",parentOrientation:y,id:w,resetOnPointerLeave:E=!0,externalTree:R,grid:v}=t,S=v!=null,P="rootStore"in e?e.rootStore:e,A=P.useState("open"),k=P.useState("floatingElement"),L=P.useState("domReferenceElement"),D=P.context.dataRef,K=$n(k),_=zn(L),T=ue(K),$=Bn(),F=un(R),W=x.useRef(g),b=x.useRef(s??-1),z=x.useRef(null),B=x.useRef(!0),N=ie(O=>{r(b.current===-1?null:b.current,O)}),be=x.useRef(!!k),H=x.useRef(A),Y=x.useRef(!1),Oe=x.useRef(!1),ke=x.useRef(null),ft=ue(p),Ee=ue(A),ee=ue(s),ce=ue(E),De=At(),Se=At(),Ie=ie(()=>{function O(V){a?F?.events.emit("virtualfocus",V):ke.current=Hn(V,{sync:Y.current,preventScroll:!0})}const C=n.current[b.current],j=Oe.current;C&&O(C),(Y.current?V=>V():V=>De.request(V))(()=>{const V=n.current[b.current]||C;if(!V)return;C||O(V),Ce&&(j||!B.current)&&V.scrollIntoView?.({block:"nearest",inline:"nearest"})})});U(()=>{D.current.orientation=h},[D,h]),U(()=>{i&&(A&&k?(b.current=s??-1,W.current&&s!=null&&(Oe.current=!0,N())):be.current&&(b.current=-1,N()))},[i,A,k,s,N]),U(()=>{if(i){if(!A){Y.current=!1;return}if(k)if(o==null){if(Y.current=!1,ee.current!=null)return;if(be.current&&(b.current=-1,Ie()),(!H.current||!be.current)&&W.current&&(z.current!=null||W.current===!0&&z.current==null)){let O=0;const C=()=>{n.current[0]==null?(O<2&&(O?M=>Se.request(M):queueMicrotask)(C),O+=1):(b.current=z.current==null||Rt(z.current,h,u)||f?pt(n):Kt(n),z.current=null,N())};C()}}else Nt(n.current,o)||(b.current=o,Ie(),Oe.current=!1)}},[i,A,k,o,ee,f,n,h,u,N,Ie,Se]),U(()=>{if(!i||k||!F||a||!be.current)return;const O=F.nodesRef.current,C=O.find(V=>V.id===$)?.context?.elements.floating,j=xt(et(L??C??null)),M=O.some(V=>V.context&&He(V.context.elements.floating,j));C&&!M&&B.current&&C.focus({preventScroll:!0})},[i,k,L,F,$,a]),U(()=>{H.current=A,be.current=!!k}),U(()=>{A||(z.current=null,W.current=g)},[A,g]);const _e=o!=null,te=ie(O=>{if(!Ee.current)return;const C=n.current.indexOf(O.currentTarget);C!==-1&&(b.current!==C||o!==C)&&(b.current=C,N(O))}),ve=ie(()=>y??F?.nodesRef.current.find(O=>O.id===$)?.context?.dataRef?.current.orientation),Fe=ie(()=>pt(n,ft.current)),ge=ie(O=>{if(B.current=!1,Y.current=!0,O.which===229||!Ee.current&&O.currentTarget===T.current)return;if(f&&Zo(O.key,h,u,S)){qe(O.key,ve())||fe(O),P.setOpen(!1,Je(jt,O.nativeEvent)),pe(L)&&(a?F?.events.emit("virtualfocus",L):L.focus());return}const C=b.current,j=pt(n,p),M=Kt(n,p);if(_||(O.key==="Home"&&(fe(O),b.current=j,N(O)),O.key==="End"&&(fe(O),b.current=M,N(O))),v!=null){const V=v(O,b.current,n,h,l,u,p,j,M);if(V!=null&&(b.current=V,N(O)),h==="both")return}if(qe(O.key,h)){if(fe(O),A&&!a&&xt(O.currentTarget.ownerDocument)===O.currentTarget){b.current=Rt(O.key,h,u)?j:M,N(O);return}Rt(O.key,h,u)?l?C>=M?c&&C!==n.current.length?b.current=-1:(Y.current=!1,b.current=j):b.current=Xe(n.current,{startingIndex:C,disabledIndices:p}):b.current=Math.min(M,Xe(n.current,{startingIndex:C,disabledIndices:p})):l?C<=j?c&&C!==-1?b.current=n.current.length:(Y.current=!1,b.current=M):b.current=Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p}):b.current=Math.max(j,Xe(n.current,{startingIndex:C,decrement:!0,disabledIndices:p})),Nt(n.current,b.current)&&(b.current=-1),N(O)}}),Ce=x.useMemo(()=>({onFocus(C){Y.current=!0,te(C)},onClick:({currentTarget:C})=>C.focus({preventScroll:!0}),onMouseMove(C){Zt(C)||(Y.current=!0,Oe.current=!1,d&&te(C))},onPointerLeave(C){if(!Ee.current||!B.current||C.pointerType==="touch")return;Y.current=!0;const j=C.relatedTarget;if(!(!d||n.current.includes(j))&&ce.current&&(ke.current?.(),ke.current=null,b.current=-1,N(C),!a)){const M=T.current,V=xt(et(M));M&&He(M,V)&&M.focus({preventScroll:!0})}}}),[te,Ee,T,d,n,N,ce,a]),he=x.useMemo(()=>a&&A&&_e&&{"aria-activedescendant":`${w}-${o}`},[a,A,_e,w,o]),le=x.useMemo(()=>({"aria-orientation":h==="both"?void 0:h,..._?{}:he,onKeyDown(O){if(O.key==="Tab"&&O.shiftKey&&A&&!a){const C=mn(O.nativeEvent);if(C&&!He(T.current,C))return;fe(O),P.setOpen(!1,Je(Qn,O.nativeEvent)),pe(L)&&L.focus();return}ge(O)},onPointerMove(O){Zt(O)||(B.current=!0)}}),[he,ge,T,h,_,P,A,a,L]),ne=x.useMemo(()=>{function O(M){P.setOpen(!0,Je(jt,M.nativeEvent,M.currentTarget))}function C(M){g==="auto"&&Nn(M.nativeEvent)&&(W.current=!a)}function j(M){W.current=g,g==="auto"&&fn(M.nativeEvent)&&(W.current=!0)}return{onKeyDown(M){const V=P.select("open");B.current=!1;const Z=M.key.startsWith("Arrow"),Ve=Qo(M.key,ve(),u),$e=qe(M.key,h),Ne=(f?Ve:$e)||M.key==="Enter"||M.key.trim()==="";if(a&&V)return ge(M);if(!(!V&&!m&&Z)){if(Ne){const Pe=qe(M.key,ve());z.current=f&&Pe?null:M.key}if(f){Ve&&(fe(M),V?(b.current=Fe(),N(M)):O(M));return}$e&&(ee.current!=null&&(b.current=ee.current),fe(M),!V&&m?O(M):ge(M),V&&N(M))}},onFocus(M){P.select("open")&&!a&&(b.current=-1,N(M))},onPointerDown:j,onPointerEnter:j,onMouseDown:C,onClick:C}},[ge,g,Fe,f,N,P,m,h,ve,u,ee,a]),We=x.useMemo(()=>({...he,...ne}),[he,ne]);return x.useMemo(()=>i?{reference:We,floating:le,item:Ce,trigger:ne}:{},[i,We,le,ne,Ce])}function br(e,t){const{listRef:n,elementsRef:o,activeIndex:r,onMatch:i,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:f=750,selectedIndex:u=null}=t,a="rootStore"in e?e.rootStore:e,g=a.useState("open"),d=Mt(),m=x.useRef(""),p=x.useRef(u??r??-1),h=x.useRef(null),y=ie(R=>{function v(T){return o?.current[T]}function S(T){const $=v(T);return $&&!Kn($)||$?.matches(":disabled")?!1:s==null||!jn(Fn,T,s)}function P(T,$,F=0){if(T.length===0)return-1;const W=(F%T.length+T.length)%T.length,b=$.toLowerCase();for(let z=0;z<T.length;z+=1){const B=(W+z)%T.length;if(!(!T[B]?.toLowerCase().startsWith(b)||!S(B)))return B}return-1}const A=n.current;if(m.current.length>0&&R.key===" "&&(fe(R),c?.(!0)),m.current.length>0&&m.current[0]!==" "&&P(A,m.current)===-1&&R.key!==" "&&c?.(!1),A==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;g&&R.key!==" "&&(fe(R),c?.(!0));const k=m.current==="";k&&(p.current=u??r??-1),A.every((T,$)=>T&&S($)?T[0]?.toLowerCase()!==T[1]?.toLowerCase():!0)&&m.current===R.key&&(m.current="",p.current=h.current),m.current+=R.key,d.start(f,()=>{m.current="",p.current=h.current,c?.(!1)});const K=((k?u??r??-1:p.current)??0)+1,_=P(A,m.current,K);_!==-1?(i?.(_),h.current=_):R.key!==" "&&(m.current="",c?.(!1))}),w=ie(R=>{const v=R.relatedTarget,S=a.select("domReferenceElement"),P=a.select("floatingElement");He(S,v)||He(P,v)||(d.clear(),m.current="",p.current=h.current,c?.(!1))});U(()=>{!g&&u!==null||(d.clear(),h.current=null,m.current!==""&&(m.current=""))},[g,u,d]);const E=x.useMemo(()=>({onKeyDown:y,onBlur:w}),[y,w]);return x.useMemo(()=>l?{reference:E,floating:E}:{},[l,E])}function er(e){const t=x.useRef(""),n=x.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:x.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function tr(e,t){const n=ie((i,s)=>{(typeof e=="function"?e():e)||t(s||(Yn?"touch":""))}),{onClick:o,onPointerDown:r}=er(n);return x.useMemo(()=>({onClick:o,onPointerDown:r}),[o,r])}function vr(e){const[t,n]=x.useState(null),o=tr(e,n);return Zn(e,r=>{r&&!e&&n(null)}),x.useMemo(()=>({openMethod:t,triggerProps:o}),[t,o])}const nr=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:f,padding:u=0,offsetParent:a="real"}=ye(e,t)||{};if(f==null)return{};const g=hn(u),d={x:n,y:o},m=Dt(r),p=kt(m),h=await s.getDimensions(f),y=m==="y",w=y?"top":"left",E=y?"bottom":"right",R=y?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[m]-d[m]-i.floating[p],S=d[m]-i.reference[m],P=a==="real"?await s.getOffsetParent?.(f):c.floating;let A=c.floating[R]||i.floating[p];(!A||!await s.isElement?.(P))&&(A=c.floating[R]||i.floating[p]);const k=v/2-S/2,L=A/2-h[p]/2-1,D=Math.min(g[w],L),K=Math.min(g[E],L),_=D,T=A-h[p]-K,$=A/2-h[p]/2+k,F=gn(_,$,T),W=!l.arrow&&Re(r)!=null&&$!==F&&i.reference[p]/2-($<_?D:K)-h[p]/2<0,b=W?$<_?$-_:$-T:0;return{[m]:d[m]+b,data:{[m]:F,centerOffset:$-F-b,...W&&{alignmentOffset:b}},reset:W}}}),or=(e,t)=>({...nr(e),options:[e,t]}),rr={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,i=t===0&&n===0&&o===0&&r===0,s=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:s.top-n>=0||s.right-t>=0||s.bottom-n>=0||s.left-t>=0||i}}}},ir={sideX:"left",sideY:"top"},en="--available-width",tn="--available-height";function An(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function nn(e,t,n){const{rects:o,placement:r}=e;return{side:An(t,Q(r),n),align:Re(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function Ar(e){return sr(e,qo)}function sr(e,t){const{anchor:n,positionMethod:o="absolute",side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:c=0,collisionBoundary:l,collisionPadding:f=5,sticky:u=!1,arrowPadding:a=5,disableAnchorTracking:g=!1,inline:d,keepMounted:m=!1,floatingRootContext:p,mounted:h,collisionAvoidance:y,shift:w,nodeId:E,adaptiveOrigin:R,lazyFlip:v=!1,externalTree:S}=e,[P,A]=x.useState(null);!h&&P!==null&&A(null);const k=y.side||"flip",L=y.align||"flip",D=y.fallbackAxisSide||"end",K=w?.crossAxis??!1,_=w?.rootBoundary,T=typeof n=="function"?n:void 0,$=ie(T),F=T?$:n,W=ue(n),b=ue(h),B=eo()==="rtl",N=P||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],be=s==="center"?N:`${N}-${s}`;let H=f;typeof H=="number"?H={top:H,right:H,bottom:H,left:H}:H&&(H={top:H.top||0,right:H.right||0,bottom:H.bottom||0,left:H.left||0});const Y=1,Oe=r==="bottom"?Y:0,ke=r==="top"?Y:0,ft=r==="right"?Y:0,Ee=r==="left"?Y:0,ee={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:H},ce=x.useRef(null),De=ue(i),Se=ue(c),Ie=typeof i!="function"?i:0,_e=typeof c!="function"?c:0,te=[];d&&te.push(d),te.push(Ko(I=>{const G=nn(I,r,B),oe=typeof De.current=="function"?De.current(G):De.current,X=typeof Se.current=="function"?Se.current(G):Se.current;return{mainAxis:oe,crossAxis:X,alignmentAxis:X}},[Ie,_e,B,r]));const ve=L==="none"&&k!=="shift",Fe=!ve&&(u||K||k==="shift"),ge=k==="none"?null:Xo({...ee,padding:{top:H.top+Y+Oe,right:H.right+Y+Ee,bottom:H.bottom+Y+ke,left:H.left+Y+ft},mainAxis:!K&&k==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),Ce=ve?null:jo({...ee,rootBoundary:_,mainAxis:L!=="none",crossAxis:Fe,limiter:u||K?void 0:Yo(I=>{if(!ce.current)return{};const{width:G,height:oe}=ce.current.getBoundingClientRect(),X=J(Q(I.placement)),ae=X==="y"?G:oe,re=X==="y"?H.left+H.right:H.top+H.bottom;return{offset:ae/2+re/2}})},[ee,u,K,_,H,L]);k==="shift"||L==="shift"||s==="center"?te.push(Ce,ge):te.push(ge,Ce),te.push(Uo({...ee,apply({elements:{floating:I},availableWidth:G,availableHeight:oe,rects:X}){if(!b.current)return;const ae=I.style;ae.setProperty(en,`${G}px`),ae.setProperty(tn,`${oe}px`);const re=se(I).devicePixelRatio||1,{x:ze,y:je,width:Ye,height:ut}=X.reference,dt=(Math.round((ze+Ye)*re)-Math.round(ze*re))/re,mt=(Math.round((je+ut)*re)-Math.round(je*re))/re;ae.setProperty("--anchor-width",`${dt}px`),ae.setProperty("--anchor-height",`${mt}px`)}}),or(I=>({element:ce.current||et(I.elements.floating).createElement("div"),padding:a,offsetParent:"floating"}),[a]),{name:"transformOrigin",fn(I){const{elements:G,middlewareData:oe,placement:X,rects:ae,y:re}=I,ze=Q(X),je=J(ze),Ye=ce.current,ut=oe.arrow?.x||0,dt=oe.arrow?.y||0,mt=Ye?.clientWidth||0,Sn=Ye?.clientHeight||0,gt=ut+mt/2,Ht=dt+Sn/2,Cn=Math.abs(oe.shift?.y||0),Pn=ae.reference.height/2,Be=typeof i=="function"?i(nn(I,r,B)):i,Mn=Cn>Be,Tn={top:`${gt}px calc(100% + ${Be}px)`,bottom:`${gt}px ${-Be}px`,left:`calc(100% + ${Be}px) ${Ht}px`,right:`${-Be}px ${Ht}px`}[ze],Ln=`${gt}px ${ae.reference.y+Pn-re}px`;return G.floating.style.setProperty("--transform-origin",Fe&&je==="y"&&Mn?Ln:Tn),{}}},rr,R),U(()=>{!h&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[h,p]);const he=x.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:le,elements:ne,x:We,y:O,middlewareData:C,update:j,placement:M,context:V,isPositioned:Z,floatingStyles:Ve}=t({rootContext:p,open:m?h:void 0,placement:be,middleware:te,strategy:o,whileElementsMounted:m?void 0:(...I)=>Jt(...I,he),nodeId:E,externalTree:S}),{sideX:$e,sideY:Ne}=C.adaptiveOrigin||ir,Pe=Z?o:"fixed",Ft=x.useMemo(()=>{let I;return Z?R?I={position:Pe,[$e]:We,[Ne]:O}:I={...Ve,position:Pe}:I={position:Pe,top:0,left:0},I[en]="100vw",I[tn]="100vh",Z||(I.opacity=0),I},[R,Pe,$e,We,Ne,O,Ve,Z]),Ke=x.useRef(null);U(()=>{if(!h)return;const I=W.current,G=typeof I=="function"?I():I,X=(on(G)?G.current:G)||null||null;X!==Ke.current&&(le.setPositionReference(X),Ke.current=X)},[h,le,F,W]),x.useEffect(()=>{if(!h)return;const I=W.current;typeof I!="function"&&on(I)&&I.current!==Ke.current&&(le.setPositionReference(I.current),Ke.current=I.current)},[h,le,F,W]),x.useEffect(()=>{if(m&&h&&ne.reference&&ne.floating)return Jt(ne.reference,ne.floating,j,he)},[m,h,ne,j,he]);const Me=Q(M),Wt=An(r,Me,B),Vt=Re(M)||"center",$t=!!C.hide?.referenceHidden;U(()=>{v&&h&&Z&&Me!==N&&A(Me)},[v,h,Z,Me,N]);const zt=x.useMemo(()=>({position:"absolute",top:C.arrow?.y,left:C.arrow?.x}),[C.arrow]),Bt=C.arrow?.centerOffset!==0;return x.useMemo(()=>({positionerStyles:Ft,arrowStyles:zt,arrowRef:ce,arrowUncentered:Bt,side:Wt,align:Vt,physicalSide:Me,anchorHidden:$t,refs:le,context:V,isPositioned:Z,update:j}),[Ft,zt,ce,Bt,Wt,Vt,Me,$t,le,V,Z,j])}function on(e){return e!=null&&"current"in e}function cr(e){return e==="starting"?Xn:rn}function Or(e,t,{styles:n,transitionStatus:o,props:r,refs:i,hidden:s,inert:c=!1}){const l={...n};return c&&(l.pointerEvents="none"),Ct("div",e,{state:t,ref:i,props:[{role:"presentation",hidden:s,style:l},cr(o),r],stateAttributesMapping:Un})}const lr=x.createContext(void 0);function Er(e){return x.useContext(lr)}const ar=20;function Sr(e,t,n,o){const[r,i]=x.useState(!1);U(()=>{if(!e||!t||n==null){i(!1);return}const s=et(n).documentElement.clientWidth,c=n.offsetWidth;i(s>0&&c>0&&c>=s-ar)},[e,t,n]),qn(e&&(!t||r),o)}const Ge=5;function Cr(e,t){const n=fr(t);return e.clientX>=n.left-Ge&&e.clientX<=n.right+Ge&&e.clientY>=n.top-Ge&&e.clientY<=n.bottom+Ge}function fr(e){const t=e.getBoundingClientRect(),n=se(e);if(Gn)return t;const o=n.getComputedStyle(e,"::before"),r=n.getComputedStyle(e,"::after");if(!(o.content!=="none"||r.content!=="none"))return t;const s=parseFloat(o.width)||0,c=parseFloat(o.height)||0,l=parseFloat(r.width)||0,f=parseFloat(r.height)||0,u=Math.max(t.width,s,l),a=Math.max(t.height,c,f),g=u-t.width,d=a-t.height;return{left:t.left-g/2,right:t.right+g/2,top:t.top-d/2,bottom:t.bottom+d/2}}const On=x.createContext(void 0);function ur(){const e=x.useContext(On);if(e===void 0)throw new Error(Wn(13));return e}const En={imageLoadingStatus:()=>null},dr=x.forwardRef(function(t,n){const{className:o,render:r,style:i,...s}=t,[c,l]=x.useState("idle"),f={imageLoadingStatus:c},u=x.useMemo(()=>({imageLoadingStatus:c,setImageLoadingStatus:l}),[c,l]),a=Ct("span",t,{state:f,ref:n,props:s,stateAttributesMapping:En});return Pt.jsx(On.Provider,{value:u,children:a})}),mr=x.forwardRef(function(t,n){const{className:o,render:r,delay:i=0,style:s,...c}=t,{imageLoadingStatus:l}=ur(),[f,u]=x.useState(i===0),a=Mt();return x.useEffect(()=>(i>0?a.start(i,()=>u(!0)):u(!0),a.clear),[a,i]),Ct("span",t,{state:{imageLoadingStatus:l},ref:n,props:c,stateAttributesMapping:En,enabled:l!=="loaded"&&(i===0||f)})});function Pr({className:e,size:t="default",...n}){return Pt.jsx(dr,{"data-slot":"avatar","data-size":t,className:an("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...n})}function Mr({className:e,...t}){return Pt.jsx(mr,{"data-slot":"avatar-fallback",className:an("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{Pr as A,Or as a,Mr as b,vr as c,wr as d,Rr as e,br as f,cr as g,Sr as h,Cr as i,Er as j,Do as p,ot as r,Ar as u};
@@ -1,6 +0,0 @@
1
- import{c as zn,aE as Z,l as Pe,aJ as mt,aO as oe,b5 as bt,r as l,aa as Jn,a9 as ke,f as K,n as Ze,e as N,i as zt,k as Ae,ac as Qn,j as I,ak as Jt,E as ve,b6 as Zn,ab as Pt,g as et,aF as ot,aG as er,b7 as tr,b8 as Qt,b9 as nr,aP as rr,B as Zt,h as Fe}from"./index-N-I90MR_.js";import{a as A,r as U,x as ge,c as Se,C as or,u as en,m as tn,e as yt,b as nn,o as rn,g as Ee,t as on,z as sn,n as sr,y as ir,i as ar}from"./label-BasLSUbe.js";/**
2
- * @license lucide-react v1.39.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 cr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ur=zn("x",cr);function lr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:dr,platform:fr,maxTouchPoints:pr}=lr(),tt=dr.toLowerCase(),_e=fr.toLowerCase(),St=/^i(os$|p)/.test(_e)||_e==="macintel"&&pr>1,wt="android",lt=_e===wt||tt.includes(wt),gr=!St&&_e.startsWith("mac");_e.startsWith("win");const hr=gr||St,Me=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Me&&tt.includes("firefox");!Me&&tt.includes("chrom");const mr=hr,an=/jsdom|happydom/.test(tt),dt="data-base-ui-focusable",cn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",gs="ArrowLeft",hs="ArrowRight",ms="ArrowUp",bs="ArrowDown";function ys(e,t){if(!Pe(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(A(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function st(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function br(e){return e.matches("html,body")}function un(e){return Z(e)&&e.matches(cn)}function Ss(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${cn}`)!=null}function kt(e){return e?e.getAttribute("role")==="combobox"&&un(e):!1}function Es(e){if(!e||an)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function At(e){return e?e.hasAttribute(dt)?e:e.querySelector(`[${dt}]`)||e:null}function Ve(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...Ve(e,o.id,n)])}function Ft(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function yr(e){e.preventDefault(),e.stopPropagation()}function Sr(e){return"nativeEvent"in e}function Er(e){return e.pointerType===""&&e.isTrusted?!0:lt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rr(e){return an?!1:!lt&&e.width===0&&e.height===0||lt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Rs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Tr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ts(e,t){return t<0||t>=e.length}function xs(e,t){return ln(e.current,{disabledIndices:t})}function vs(e,t){return ln(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ln(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&xr(e,s,r));return s}function xr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!Et(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function vr(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Et(e,t=e?mt(e):null){return!e||!e.isConnected||!t||vr(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Cr='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Or(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return bt(n)?n.host:null}function ft(e){for(const t of Array.from(e.children))if(oe(t)==="summary")return t;return null}function Ir(e,t){const n=ft(t);return!!n&&(e===n||A(n,e))}function dn(e){const t=e?oe(e):"";return e!=null&&e.matches(Cr)&&(t!=="summary"||e.parentElement!=null&&oe(e.parentElement)==="details"&&ft(e.parentElement)===e)&&(t!=="details"||ft(e)==null)&&(t!=="input"||e.type!=="hidden")}function fn(e){if(!dn(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Or(t)){const n=t!==e,r=oe(t)==="slot";if(t.hasAttribute("inert")||n&&oe(t)==="details"&&!t.open&&!Ir(e,t)||t.hasAttribute("hidden")||!r&&!Pr(t,n))return!1}return!0}function Pr(e,t){const n=mt(e);return t?n.display!=="none":Et(e,n)}function pn(e){const t=e.tabIndex;if(t<0){const n=oe(e);if(n==="details"||n==="audio"||n==="video"||Z(e)&&e.isContentEditable)return 0}return t}function it(e){if(oe(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function wr(e,t){const n=it(e);if(!n)return!0;const r=t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form})===n}function gn(e){if(Z(e)&&oe(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Z(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hn(e,t){gn(e).forEach(n=>{dn(n)&&t.push(n),hn(n,t)})}function mn(e,t,n){gn(e).forEach(r=>{Z(r)&&r.matches(t)&&n.push(r),mn(r,t,n)})}function Rt(e){return fn(e)&&pn(e)>=0}function bn(e){const t=[];return hn(e,t),t.filter(fn)}function Ue(e){const t=bn(e);return t.filter(n=>pn(n)>=0&&wr(n,t))}function yn(e,t){const n=Ue(e),r=n.length;if(r===0)return;const o=ge(U(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function Sn(e){return yn(U(e).body,1)||e}function En(e){return yn(U(e).body,-1)||e}function Rn(e,t){if(!e)return null;const n=Ue(U(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Cs(e){return Rn(e,1)}function Os(e){return Rn(e,-1)}function He(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function kr(e){Ue(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Mt(e){const t=[];mn(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Tn(e){l.useEffect(e,Jn)}const Be=0;class Ce{static create(){return new Ce}currentId=Be;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Be,n()},t)}isStarted(){return this.currentId!==Be}clear=()=>{this.currentId!==Be&&(clearTimeout(this.currentId),this.currentId=Be)};disposeEffect=()=>this.clear}function ze(){const e=ke(Ce.create).current;return Tn(e.disposeEffect),e}const Ge=null;class Ar{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let Ke=new Ar;class ue{static create(){return new ue}static request(t){return Ke.request(t)}static cancel(t){return Ke.cancel(t)}currentId=Ge;request(t){this.cancel(),this.currentId=Ke.request(()=>{this.currentId=Ge,t()})}cancel=()=>{this.currentId!==Ge&&(Ke.cancel(this.currentId),this.currentId=Ge)};disposeEffect=()=>this.cancel}function xn(){const e=ke(ue.create).current;return Tn(e.disposeEffect),e}function he(e){return e==null?e:"current"in e?e.current:e}function Fr(e,t=!1){const n=xn();return K((r,o=null)=>{n.cancel();const s=he(e);if(s==null)return;const a=s,c=()=>{Ze.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function u(){Promise.all(a.getAnimations().map(i=>i.finished)).then(()=>{o?.aborted||c()},()=>{if(o?.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){u();return}c()})}if(t){const i="data-starting-style";if(!a.hasAttribute(i)){n.request(u);return}const d=new MutationObserver(()=>{a.hasAttribute(i)||(d.disconnect(),u())});d.observe(a,{attributes:!0,attributeFilter:[i]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(u)})}function vn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=K(o),a=Fr(r,n);l.useEffect(()=>{if(!t)return;const c=new AbortController;return a(s,c.signal),()=>{c.abort()}},[t,n,s,a])}let Dt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Mr={"data-starting-style":""},Dr={"data-ending-style":""},Cn={transitionStatus(e){return e==="starting"?Mr:e==="ending"?Dr:null}};function Nr(e,t=!1,n=!1){const[r,o]=l.useState(e&&t?"idle":void 0),[s,a]=l.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),N(()=>{if(!e&&s&&r!=="ending"&&n){const c=ue.request(()=>{o("ending")});return()=>{ue.cancel(c)}}},[e,s,r,n]),N(()=>{if(!e||t)return;const c=ue.request(()=>{o(void 0)});return()=>{ue.cancel(c)}},[t,e]),N(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=ue.request(()=>{o("idle")});return()=>{ue.cancel(c)}},[t,e,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}const On=l.createContext(void 0);function Oe(e){const t=l.useContext(On);if(!e&&t===void 0)throw new Error(zt(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Dt.startingStyle]="startingStyle",e[e.endingStyle=Dt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Lr={"data-popup-open":""},Br={"data-popup-open":"","data-pressed":""},Wr={"data-open":""},Hr={"data-closed":""},jr={"data-anchor-hidden":""},Is={open(e){return e?Lr:null}},Ps={open(e){return e?Br:null}},In={open(e){return e?Wr:Hr},anchorHidden(e){return e?jr:null}},_r={...In,...Cn},Vr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:a=!1,...c}=t,u=Oe(),i=u.useState("open"),d=u.useState("nested"),R=u.useState("mounted"),f=u.useState("transitionStatus");return Ae("div",t,{state:{open:i,transitionStatus:f},ref:[u.context.backdropRef,n],stateAttributesMapping:_r,props:[{role:"presentation",hidden:!R,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!d})}),Pn=l.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:a=!1,nativeButton:c=!0,...u}=t,i=Oe(),d=i.useState("open"),{getButtonProps:R,buttonRef:f}=Qn({disabled:a,native:c}),g={disabled:a};function m(x){d&&i.setOpen(!1,Se(or,x.nativeEvent))}return Ae("button",t,{state:g,ref:[n,f],props:[{onClick:m},u,R]})}),Ur=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("descriptionElementId",i),Ae("p",t,{ref:n,props:[{id:i},c]})});function D(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function we(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function $e(e){const t=ke(Yr,e).current;return t.next=e,N(t.effect),t}function Yr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const wn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Gr={...wn,position:"fixed",top:0,left:0},ws={...wn,position:"absolute"},Je=l.forwardRef(function(t,n){const[r,o]=l.useState();N(()=>{mr&&Me&&o("button")},[]);const s={tabIndex:0,role:r};return I.jsx("span",{...t,ref:n,style:Gr,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Qe(e){return`data-base-ui-${e}`}let qe=0;function at(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame(qe);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Jt;const a=requestAnimationFrame(s);return qe=a,()=>{qe===a&&(cancelAnimationFrame(a),qe=0)}}const ct={inert:new WeakMap,"aria-hidden":new WeakMap},Nt="data-base-ui-inert",pt={inert:new WeakSet,"aria-hidden":new WeakSet};let We=new WeakMap,ut=0;function Kr(e){return pt[e]}function kn(e){return e?bt(e)?e.host:kn(e.parentNode):null}const Lt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kn(n);return e.contains(r)?r:null}).filter(n=>n!=null),Bt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Wt=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{oe(a)!=="script"&&(t.has(a)?o(a):r.push(a))})};return o(e),r};function $r(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,c=null;const u=Lt(t,e),i=o?Wt(t,Bt(u),new Set(u)):[],d=[],R=[];if(s){const f=ct[s],g=Kr(s);c=g,a=f;const m=Lt(t,Array.from(t.querySelectorAll("[aria-live]"))),x=u.concat(m);Wt(t,Bt(x),new Set(x)).forEach(S=>{const b=S.getAttribute(s),Y=b!==null&&b!=="false",v=(f.get(S)||0)+1;f.set(S,v),d.push(S),v===1&&Y&&g.add(S),Y||S.setAttribute(s,s==="inert"?"":"true")})}return o&&i.forEach(f=>{const g=(We.get(f)||0)+1;We.set(f,g),R.push(f),g===1&&f.setAttribute(Nt,"")}),ut+=1,()=>{a&&d.forEach(f=>{const m=(a.get(f)||0)-1;a.set(f,m),m||(!c?.has(f)&&s&&f.removeAttribute(s),c?.delete(f))}),o&&R.forEach(f=>{const g=(We.get(f)||0)-1;We.set(f,g),g||f.removeAttribute(Nt)}),ut-=1,ut||(ct.inert=new WeakMap,ct["aria-hidden"]=new WeakMap,pt.inert=new WeakSet,pt["aria-hidden"]=new WeakSet,We=new WeakMap)}}function Ht(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=U(e[0]).body;return $r(e,s,n,r,{mark:o})}const ks=500,As=500,Fs={style:{transition:"none"}},qr="data-base-ui-click-trigger",Ms={fallbackAxisSide:"none"},Ds={fallbackAxisSide:"end"},Xr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},An=l.createContext(null),Fn=()=>l.useContext(An),zr=Qe("portal");function Jr(e={}){const{ref:t,container:n,componentProps:r=ve,elementProps:o}=e,s=yt(),c=Fn()?.portalNode,[u,i]=l.useState(null),[d,R]=l.useState(null),f=K(y=>{y!==null&&R(y)}),g=l.useRef(null);N(()=>{if(n===null){g.current&&(g.current=null,R(null),i(null));return}const y=(n&&(Zn(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,R(null),i(null));return}g.current!==y&&(g.current=y,R(null),i(y))},[n,c]);const m=Ae("div",r,{ref:[t,f],props:[{id:s,[zr]:""},o]}),x=u&&m?Ze.createPortal(m,u):null;return{node:d,nodeId:l.isValidElement(m)?m.props.id:void 0,subtree:x}}const Qr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,children:a,container:c,...u}=t,{node:i,nodeId:d,subtree:R}=Jr({container:c,ref:n,componentProps:t,elementProps:u}),f=l.useRef(null),g=l.useRef(null),m=l.useRef(null),x=l.useRef(null),[y,S]=l.useState(null),b=l.useRef(!1),Y=y?.modal,v=y?.open,B=!!y&&!y.modal&&y.open&&!!i;l.useEffect(()=>{if(!i||Y)return;function F(H){i&&H.relatedTarget&&He(H)&&(H.type==="focusin"?b.current&&(Mt(i),b.current=!1):(kr(i),b.current=!0))}return we(D(i,"focusin",F,!0),D(i,"focusout",F,!0))},[i,Y]),N(()=>{!i||v!==!0||!b.current||(Mt(i),b.current=!1)},[v,i]);const $=l.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:m,afterInsideRef:x,portalNode:i,setFocusManagerState:S}),[i]);return I.jsxs(l.Fragment,{children:[R,I.jsxs(An.Provider,{value:$,children:[B&&i&&I.jsx(Je,{"data-type":"outside",ref:f,onFocus:F=>{if(He(F,i))m.current?.focus();else{const H=y?y.domReference:null;En(H)?.focus()}}}),B&&i&&I.jsx("span",{"aria-owns":d,style:Xr}),i&&Ze.createPortal(a,i),B&&i&&I.jsx(Je,{"data-type":"outside",ref:g,onFocus:F=>{if(He(F,i))x.current?.focus();else{const H=y?y.domReference:null;Sn(H)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Se(tn,F.nativeEvent))}}})]})]})});function Mn(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Zr{nodesRef={current:[]};events=Mn();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Dn=l.createContext(null),Nn=l.createContext(null),Tt=()=>l.useContext(Dn)?.id||null,xt=e=>{const t=l.useContext(Nn);return e??t};function Ns(e){const t=yt(),n=xt(e),r=Tt();return N(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Ls(e){const{children:t,id:n}=e,r=Tt();return I.jsx(Dn.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Bs(e){const{children:t,externalTree:n}=e,r=ke(()=>n??new Zr).current;return I.jsx(Nn.Provider,{value:r,children:t})}function eo(e,t){const n=et(Ee(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const jt=20;let ye=[];function vt(){ye=ye.filter(e=>e.deref()?.isConnected)}function _t(e){vt(),e&&oe(e)!=="body"&&(ye.push(new WeakRef(e)),ye.length>jt&&(ye=ye.slice(-jt)))}function Vt(){return vt(),ye[ye.length-1]?.deref()}function to(e){return e?Rt(e)?e:Ue(e)[0]||e:null}function Ut(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=bn(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Rt(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function no(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:i="",nextFocusableElement:d,previousFocusableElement:R,beforeContentFocusGuardRef:f,externalTree:g,getInsideElements:m}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),S=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:Y,dataRef:v}=x.context,B=K(()=>v.current.floatingContext?.nodeId),$=o===!1,F=kt(S)&&$,H=$e(o),M=$e(s),X=$e(i),me=$e(y),_=xt(g),P=Fn(),q=l.useRef(!1),le=l.useRef(!1),se=l.useRef(!1),ie=l.useRef(null),Re=l.useRef(""),be=l.useRef(""),Te=l.useRef(null),Ie=l.useRef(null),w=Pt(Te,f,P?.beforeInsideRef),ee=Pt(Ie,P?.afterInsideRef),de=ze(),fe=ze(),De=xn(),Ye=P!=null,C=At(b),ae=K((O=C)=>O?Ue(O):[]),re=K(()=>m?.().filter(O=>O!=null)??[]);l.useEffect(()=>{if(r||!c)return;function O(G){G.key==="Tab"&&A(C,ge(U(C)))&&ae().length===0&&!F&&yr(G)}const j=U(C);return D(j,"keydown",O)},[r,C,c,F,ae]),l.useEffect(()=>{if(r||!y)return;const O=U(C);function j(){se.current=!1}function G(te){const T=Ee(te),L=re(),E=A(b,T)||A(S,T)||A(P?.portalNode,T)||L.some(V=>V===T||A(V,T));se.current=!E,be.current=te.pointerType||"keyboard",T?.closest(`[${qr}]`)&&(le.current=!0,fe.start(0,()=>{le.current=!1}))}function z(){be.current="keyboard"}return we(D(O,"pointerdown",G,!0),D(O,"pointerup",j,!0),D(O,"pointercancel",j,!0),D(O,"keydown",z,!0),j)},[r,b,S,C,y,P,fe,re]),l.useEffect(()=>{if(r||!u)return;const O=U(C);function j(){le.current=!0,fe.start(0,()=>{le.current=!1})}function G(L){const E=Ee(L);Rt(E)&&(ie.current=E)}function z(L){const E=L.relatedTarget,V=L.currentTarget,J=Ee(L);c&&E==null&&J!=null&&A(b,J)&&_t(J),queueMicrotask(()=>{const W=B(),ne=x.context.triggerElements,p=re(),h=E?.hasAttribute(Qe("focus-guard"))&&[Te.current,Ie.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,he(R),he(d)].includes(E),Q=!(A(S,E)||A(b,E)||A(E,b)||A(P?.portalNode,E)||p.some(k=>k===E||A(k,E))||ne.hasMatchingElement(k=>A(k,E))||h||_&&(Ve(_.nodesRef.current,W).find(k=>A(k.context?.elements.floating,E)||A(k.context?.elements.domReference,E))||Ft(_.nodesRef.current,W).find(k=>[k.context?.elements.floating,At(k.context?.elements.floating)].includes(E)||k.context?.elements.domReference===E)));if(V===S&&C&&Ut(C),a&&V!==S&&!Et(J)&&ge(O)===O.body){if(Z(C)&&(C.focus(),a==="popup")){De.request(()=>{C.focus()});return}const k=ae(),pe=ie.current,Ne=(pe&&k.includes(pe)?pe:null)||k[k.length-1]||C;Z(Ne)&&Ne.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(F||!c)&&E&&Q&&!le.current&&(F||E!==Vt())&&(q.current=!0,x.setOpen(!1,Se(tn,L)))})}function te(){se.current||(v.current.insideReactTree=!0,de.start(0,()=>{v.current.insideReactTree=!1}))}const T=Z(S)?S:null;if(!(!b&&!T))return we(T&&D(T,"focusout",z),T&&D(T,"pointerdown",j),b&&D(b,"focusin",G),b&&D(b,"focusout",z),b&&P&&D(b,"focusout",te,!0))},[r,S,b,C,c,_,P,x,u,a,ae,F,B,v,de,fe,De,d,R,re]),l.useEffect(()=>{if(r||!b||!y)return;const O=Array.from(P?.portalNode?.querySelectorAll(`[${Qe("portal")}]`)||[]),G=(_?Ft(_.nodesRef.current,B()):[]).find(V=>kt(V.context?.elements.domReference||null))?.context?.elements.domReference,te=[...[b,...O,Te.current,Ie.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...re()],G,he(R),he(d),F?S:null].filter(V=>V!=null),T=Ht(te,{ariaHidden:c||F,mark:!1}),L=[b,...O].filter(V=>V!=null),E=Ht(L);return()=>{E(),T()}},[y,r,S,b,c,P,F,_,B,d,R,re]),N(()=>{if(!y||r||!Z(C))return;Re.current="",be.current="";const O=U(C),j=ge(O);queueMicrotask(()=>{const G=H.current,z=typeof G=="function"?G(X.current||""):G;if(z===void 0||z===!1||A(C,j))return;let T=null;const L=()=>(T==null&&(T=ae(C)),T[0]||C);let E;z===!0||z===null?E=L():E=he(z),E=E||L();const V=A(C,ge(O));at(E,{preventScroll:E===C,shouldFocus(){if(!me.current)return!1;if(V)return!0;const J=ge(O);return!(J!==E&&A(C,J))}})})},[r,y,C,ae,H,X,me]),N(()=>{if(r||!C)return;const O=U(C),j=ge(O),G=X.current==null;_t(j);function z(T){if(T.open||(Re.current=eo(T.nativeEvent,be.current)),T.reason===nn&&T.nativeEvent.type==="mouseleave"&&(q.current=!0),T.reason===rn)if(T.nested)q.current=!1;else if(Er(T.nativeEvent)||Rr(T.nativeEvent))q.current=!1;else{let L=!1;U(C).createElement("div").focus({get preventScroll(){return L=!0,!1}}),L?q.current=!1:q.current=!0}}Y.on("openchange",z);function te(T){const L=M.current;let E=typeof L=="function"?L(T):L;if(E===void 0||E===!1)return null;E===null&&(E=!0);const V=S?.isConnected?S:null,J=j?.isConnected&&oe(j)!=="body"?j:null;let W=G?J||V:V||J;return W||(W=Vt()||null),typeof E=="boolean"?W:he(E)||W||null}return()=>{Y.off("openchange",z);const T=ge(O),L=re(),E=A(b,T)||L.some(ne=>ne===T||A(ne,T))||_&&Ve(_.nodesRef.current,B(),!1).some(ne=>A(ne.context?.elements.floating,T)),V=M.current,J=Re.current,W=te(J);queueMicrotask(()=>{const ne=to(W),p=typeof V!="boolean";if(V&&!q.current&&Z(ne)&&(!(!p&&ne!==T&&T!==O.body)||E)){const h={preventScroll:!0};J==="keyboard"&&(h.focusVisible=!0),ne.focus(h)}q.current=!1})}},[r,b,C,M,X,Y,_,S,B,re]),N(()=>{if(!Me||y||!b)return;const O=ge(U(b));!Z(O)||!un(O)||A(b,O)&&O.blur()},[y,b]),N(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:x.setOpen,domReference:S}),()=>{P.setFocusManagerState(null)}},[r,P,c,y,x,u,S]),N(()=>{if(!(r||!C))return Ut(C),()=>{queueMicrotask(vt)}},[r,C]);const xe=!r&&(c?!F:!0)&&(Ye||c);return I.jsxs(l.Fragment,{children:[xe&&I.jsx(Je,{"data-type":"inside",ref:w,onFocus:O=>{if(c){const j=ae();at(j[j.length-1])}else P?.portalNode&&(q.current=!1,He(O,P.portalNode)?Sn(S)?.focus():he(R??P.beforeOutsideRef)?.focus())}}),n,xe&&I.jsx(Je,{"data-type":"inside",ref:ee,onFocus:O=>{c?at(ae()[0]):P?.portalNode&&(u&&(q.current=!0),He(O,P.portalNode)?En(S)?.focus():he(d??P.afterOutsideRef)?.focus())}})]})}function ro(){return!1}function oo(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function so(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:a=ro,bubbles:c,externalTree:u}=t,i="rootStore"in e?e.rootStore:e,d=i.useState("open"),R=i.useState("floatingElement"),{dataRef:f}=i.context,g=xt(u),m=K(typeof o=="function"?o:()=>!1),x=typeof o=="function"?m:o,y=x!==!1,S=K(()=>s),{escapeKey:b,outsidePress:Y}=oo(c),v=l.useRef(!1),B=l.useRef(!1),$=l.useRef(!1),F=l.useRef(!1),H=l.useRef(""),M=l.useRef(null),X=ze(),me=ze(),_=K(()=>{me.clear(),f.current.insideReactTree=!1}),P=K(w=>{const ee=f.current.floatingContext?.nodeId;return(g?Ve(g.nodesRef.current,ee):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[w])}),q=K(w=>st(w,i.select("floatingElement"))||st(w,i.select("domReferenceElement"))),le=K(w=>{a()&&i.setOpen(!1,Se(on,w.nativeEvent))}),se=K(w=>{if(!d||!n||!r||w.key!=="Escape"||F.current||!b&&P("__escapeKeyBubbles"))return;const ee=Sr(w)?w.nativeEvent:w,de=Se(sn,ee);i.setOpen(!1,de),de.isCanceled||w.preventDefault(),!b&&!de.isPropagationAllowed&&w.stopPropagation()}),ie=K(()=>{f.current.insideReactTree=!0,me.start(0,_)}),Re=K(w=>{if(!d||!n||w.button!==0)return;const ee=Ee(w.nativeEvent);A(i.select("floatingElement"),ee)&&(v.current||(v.current=!0,B.current=!1))}),be=K(w=>{!d||!n||(w.defaultPrevented||w.nativeEvent.defaultPrevented)&&v.current&&(B.current=!0)});l.useEffect(()=>{if(!d||!n)return _;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=Y;const w=new Ce,ee=new Ce;function de(){w.clear(),F.current=!0}function fe(){w.start(Me?5:0,()=>{F.current=!1})}function De(){$.current=!0,ee.start(0,()=>{$.current=!1})}function Ye(){v.current=!1,B.current=!1}function C(){const p=H.current,h=p==="pen"||!p?"mouse":p,Q=S(),k=typeof Q=="function"?Q():Q;return typeof k=="string"?k:k[h]}function ae(p){const h=C();return h==="intentional"&&p.type!=="click"||h==="sloppy"&&p.type==="click"}function re(p){const h=f.current.floatingContext?.nodeId,Q=g&&Ve(g.nodesRef.current,h).some(k=>st(p,k.context?.elements.floating));return q(p)||Q}function xe(p){if(ae(p)){p.type!=="click"&&!q(p)&&(ee.clear(),$.current=!1),_();return}if(f.current.insideReactTree){_();return}const h=Ee(p),Q=`[${Qe("inert")}]`,k=Pe(h)?h.getRootNode():null,pe=Array.from((bt(k)?k:U(i.select("floatingElement"))).querySelectorAll(Q)),Ne=i.context.triggerElements;if(h&&(Ne.hasElement(h)||Ne.hasMatchingElement(ce=>A(ce,h))))return;let Le=Pe(h)?h:null;for(;Le&&!ot(Le);){const ce=er(Le);if(ot(ce)||!Pe(ce))break;Le=ce}if(!(pe.length&&Pe(h)&&!br(h)&&!A(h,i.select("floatingElement"))&&pe.every(ce=>!A(Le,ce)))){if(Z(h)&&!("touches"in p)){const ce=ot(h),rt=mt(h),It=/auto|scroll/,Un=ce||It.test(rt.overflowX),Yn=ce||It.test(rt.overflowY),Gn=Un&&h.clientWidth>0&&h.scrollWidth>h.clientWidth,Kn=Yn&&h.clientHeight>0&&h.scrollHeight>h.clientHeight,$n=rt.direction==="rtl",qn=Kn&&($n?p.offsetX<=h.offsetWidth-h.clientWidth:p.offsetX>h.clientWidth),Xn=Gn&&p.offsetY>h.clientHeight;if(qn||Xn)return}if(!re(p)){if(C()==="intentional"&&$.current){ee.clear(),$.current=!1;return}typeof x=="function"&&!x(p)||P("__outsidePressBubbles")||(i.setOpen(!1,Se(rn,p)),_())}}}function O(p){C()!=="sloppy"||p.pointerType==="touch"||!i.select("open")||!n||q(p)||xe(p)}function j(p){if(C()!=="sloppy"||!i.select("open")||!n||q(p))return;const h=p.touches[0];h&&(M.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},X.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function G(p,h){const Q=Ee(p);if(!Q)return;const k=D(Q,p.type,()=>{h(p),k()})}function z(p){H.current="touch",G(p,j)}function te(p){X.clear(),p.type==="pointerdown"&&(H.current=p.pointerType),!(p.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&G(p,h=>{h.type==="pointerdown"?O(h):xe(h)})}function T(p){if(!v.current)return;const h=B.current;if(Ye(),C()==="intentional"){if(p.type==="pointercancel"){h&&De();return}if(!re(p)){if(h){De();return}typeof x=="function"&&!x(p)||(ee.clear(),$.current=!0,_())}}}function L(p){if(C()!=="sloppy"||!M.current||q(p))return;const h=p.touches[0];if(!h)return;const Q=Math.abs(h.clientX-M.current.startX),k=Math.abs(h.clientY-M.current.startY),pe=Math.sqrt(Q*Q+k*k);pe>5&&(M.current.dismissOnTouchEnd=!0),pe>10&&(xe(p),X.clear(),M.current=null)}function E(p){G(p,L)}function V(p){C()!=="sloppy"||!M.current||q(p)||(M.current.dismissOnTouchEnd&&xe(p),X.clear(),M.current=null)}function J(p){G(p,V)}const W=U(R),ne=we(r&&we(D(W,"keydown",se),D(W,"compositionstart",de),D(W,"compositionend",fe)),y&&we(D(W,"click",te,!0),D(W,"pointerdown",te,!0),D(W,"pointerup",T,!0),D(W,"pointercancel",T,!0),D(W,"mousedown",te,!0),D(W,"mouseup",T,!0),D(W,"touchstart",z,!0),D(W,"touchmove",E,!0),D(W,"touchend",J,!0)));return()=>{ne(),w.clear(),ee.clear(),Ye(),$.current=!1,_()}},[f,R,r,y,x,d,n,b,Y,se,_,S,P,q,g,i,X]);const Te=l.useMemo(()=>({onKeyDown:se,onPointerDown:le,onClick:le}),[se,le]),Ie=l.useMemo(()=>({onKeyDown:se,onPointerDown:be,onMouseDown:be,onClickCapture:ie,onMouseDownCapture(w){ie(),Re(w)},onPointerDownCapture(w){ie(),Re(w)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[se,ie,Re,be]);return l.useMemo(()=>n?{reference:Te,floating:Ie,trigger:Te}:{},[n,Te,Ie])}var Ln=tr();const gt=[];let ht;function io(){return ht}function ao(e){gt.push(e)}function co(e){const t=(n,r)=>{const o=ke(uo).current;let s;try{ht=o;for(const a of gt)a.before(o);s=e(n,r);for(const a of gt)a.after(o);o.didInitialize=!0}finally{ht=void 0}return s};return t.displayName=e.displayName||e.name,t}function Ws(e){return l.forwardRef(co(e))}function uo(){return{didInitialize:!1}}const lo=Qt(19),fo=lo?go:ho;function Bn(e,t,n,r,o){return fo(e,t,n,r,o)}function po(e,t,n,r,o){const s=l.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Ln.useSyncExternalStore(e.subscribe,s,s)}ao({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),Ln.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function go(e,t,n,r,o){const s=io();if(!s)return po(e,t,n,r,o);const a=s.syncIndex;s.syncIndex+=1;let c;return s.didInitialize?(c=s.syncHooks[a],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,o))&&(c.store!==e&&(s.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=o,c.value=t(e.getSnapshot(),n,r,o))):(c={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(c)),c.value}function ho(e,t,n,r,o){return nr.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class mo{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Bn(this,t,n,r,o)}}class Wn extends mo{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){l.useDebugValue(t);const r=this;N(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;N(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);N(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){l.useDebugValue(t);const r=this,o=n!==void 0;N(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return l.useDebugValue(t),Bn(this,this.selectors[t],n,r,o)}useContextCallback(t,n){l.useDebugValue(t);const r=K(n??Jt);this.context[t]=r}useStateSetter(t){const n=l.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const c=o;o=a,n(a,c,this)}})}}const bo={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Ct extends Wn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Mn(),nested:r,triggerElements:s},bo),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Tr(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function yo(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:a}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),i=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,R=a,f=l.useRef(null);r===void 0&&f.current===null&&(f.current=new Ct({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:i,triggerElements:d,onOpenChange:R,floatingId:o,syncOnly:!0,nested:s}));const g=r??f.current;return t.useSyncedValue("floatingId",o),N(()=>{const m={open:c,floatingId:o,referenceElement:u,floatingElement:i};Pe(u)&&(m.domReferenceElement=u),g.state.positionReference===g.state.referenceElement&&(m.positionReference=u),g.update(m)},[c,o,u,i,g]),g.context.onOpenChange=R,g.context.nested=s,g}const So={tabIndex:-1,[dt]:""};function Eo(e){return t=>t==="touch"?e.current:!0}function Ro(e,t=!1){const n=yt(),r=Tt()!=null,o=ke(()=>e(n,r)).current;return yo({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function To({handle:e,store:t}){return N(()=>e.attachStore(t),[e,t]),null}function xo(e,t){const n=l.useRef(null),r=l.useRef(null);return l.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const a=n.current,c=r.current,u=t.context.triggerElements.getById(a);c&&u===c&&(t.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const a=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==a&&t.set("triggerCount",a)}},[t,e])}function Hn(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function vo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Hs(e,t,n,r={}){const o=n.reason,s=o===nn,a=t&&o===ir,c=!t&&(o===on||o===sn),u=vo(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const d={...r.extraState,open:t};a?d.instantType="focus":c?d.instantType="dismiss":s&&(d.instantType=void 0),Hn(d,t,n.trigger,u()),e.update(d)};s?Ze.flushSync(i):i()}function js(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=xo(e,n),a=K(u=>{const i=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:u,...i?r:null});return}d==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})}),c=l.useCallback(u=>{s(u),u&&a(u)},[s,a]);return N(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:o}}function Co(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=l.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),a=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");N(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,i={};e.state.triggerCount!==u&&(i.triggerCount=u);const d=e.select("activeTriggerId");let R=null;if(d){const f=e.context.triggerElements.getById(d);if(f)r.current=d,f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f);else{for(const[g,m]of e.context.triggerElements.entries())if(m===e.state.activeTriggerElement){i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g;break}i.activeTriggerId===void 0&&(r.current===d?R=d:r.current=null)}}else r.current=null;if(!R&&!d&&u===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[g,m]=f.value;i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),R&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===R&&!e.context.triggerElements.getById(R)){const f=Se(sr);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,a,c,n])}function Oo(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Nr(e),a=t.useState("preventUnmountingOnClose"),c=e?!1:a;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:c});const u=K(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return vn({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:s}}function Io(e,t){e.useSyncedValues(t),N(()=>()=>{e.update({activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve})},[e])}function Po(e,t){N(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),N(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class jn{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function wo(){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new jn,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ko(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:wo(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve}}function Ao(e,t,n=!1){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const je=e=>e.triggerIdProp??e.activeTriggerId,Ot=e=>e.openProp??e.open,Yt=e=>(e.popupElement?.id??e.floatingId)||void 0;function _n(e,t){return t!==void 0&&Ot(e)&&je(e)===t}function Fo(e,t){return _n(e,t)?!0:t!==void 0&&Ot(e)&&je(e)==null&&e.triggerCount===1}const Mo={open:Ot,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:je,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Yt,isTriggerActive:(e,t)=>t!==void 0&&je(e)===t,isOpenedByTrigger:(e,t)=>_n(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&je(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Fo(e,t)?Yt(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},Vn=l.createContext(void 0);function Do(){const e=l.useContext(Vn);if(e===void 0)throw new Error(zt(26));return e}const No="ArrowUp",Lo="ArrowDown",Bo="ArrowLeft",Wo="ArrowRight",Ho="Home",jo="End",_o=new Set([No,Lo,Bo,Wo,Ho,jo]),Vo="Shift",_s=[Vo,"Control","Alt","Meta"];function Uo(e){return Z(e)&&e.tagName==="INPUT"}function Vs(e){return!!(Uo(e)&&e.selectionStart!=null||Z(e)&&e.tagName==="TEXTAREA")}function Us(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const a=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const u=Gt(e,t,"left"),i=Xe(e),d=Xe(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight?o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft&&(o=u-d.scrollMarginLeft-i.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft?o=u-d.scrollMarginLeft-i.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight&&(o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight))}if(c&&r!=="horizontal"){const u=Gt(e,t,"top"),i=Xe(e),d=Xe(t);u-d.scrollMarginTop<e.scrollTop+i.scrollPaddingTop?s=u-d.scrollMarginTop-i.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-i.scrollPaddingBottom&&(s=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+i.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function Gt(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function Xe(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Yo={...In,...Cn,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Go=l.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:a,initialFocus:c,...u}=t,i=Oe(),d=i.useState("descriptionElementId"),R=i.useState("disablePointerDismissal"),f=i.useState("floatingRootContext"),g=i.useState("popupProps"),m=i.useState("modal"),x=i.useState("mounted"),y=i.useState("nested"),S=i.useState("nestedOpenDialogCount"),b=i.useState("open"),Y=i.useState("openMethod"),v=i.useState("titleElementId"),B=i.useState("transitionStatus"),$=i.useState("role"),F=f.useState("floatingId");Do(),vn({open:b,ref:i.context.popupRef,onComplete(){b&&i.context.onOpenChangeComplete?.(!0)}});const H=c===void 0?Eo(i.context.popupRef):c,M=S>0,X=i.useStateSetter("popupElement"),_=Ae("div",t,{state:{open:b,nested:y,transitionStatus:B,nestedDialogOpen:M},props:[g,{id:F,"aria-labelledby":v,"aria-describedby":d,role:$,...So,hidden:!x,onKeyDown(P){_o.has(P.key)&&P.stopPropagation()},style:{"--nested-dialogs":S}},u],ref:[n,i.context.popupRef,X],stateAttributesMapping:Yo});return I.jsx(no,{context:f,openInteractionType:Y,disabled:!x,closeOnFocusOut:!R,initialFocus:H,returnFocus:a,modal:m!==!1,restoreFocus:"popup",children:_})});function Ko(e){return Qt(19)?e:e?"true":void 0}const $o=l.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return I.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),qo=l.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=Oe(),a=s.useState("mounted"),c=s.useState("modal"),u=s.useState("open");return a||r?I.jsx(Vn.Provider,{value:r,children:I.jsxs(Qr,{ref:n,...o,children:[a&&c===!0&&I.jsx($o,{ref:s.context.internalBackdropRef,inert:Ko(!u)}),t.children]})}):null});let Kt={},$t={},qt="";function nt(e,t){return rr(e)?e:t}function Xt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(nt(t,n)).overflowY)}function Xo(e){if(typeof document>"u")return!1;const t=U(e);return et(t).innerWidth-t.documentElement.clientWidth>0}function zo(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=U(e),r=n.documentElement,o=n.body,s=nt(r,o),a=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const i=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=c,u===i}function Jo(e){const t=U(e),n=t.documentElement,r=t.body,o=nt(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Qo(e){const t=U(e),n=t.documentElement,r=t.body,o=et(n);let s=0,a=0,c=!1;const u=ue.create();if(Me&&(o.visualViewport?.scale??1)!==1)return()=>{};function i(){const g=o.getComputedStyle(n),m=o.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,Kt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},qt=n.style.scrollBehavior,$t={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,Y=n.scrollWidth>n.clientWidth,v=g.overflowY==="scroll"||m.overflowY==="scroll",B=g.overflowX==="scroll"||m.overflowX==="scroll",$=Math.max(0,o.innerWidth-r.clientWidth),F=Math.max(0,o.innerHeight-r.clientHeight),H=parseFloat(m.marginTop)+parseFloat(m.marginBottom),M=parseFloat(m.marginLeft)+parseFloat(m.marginRight),X=nt(n,r);if(c=zo(e),c){n.style.scrollbarGutter=S,X.style.overflowY="hidden",X.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(b||v)&&(n.style.overflowY="scroll"),(Y||B)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:H||F?`calc(100dvh - ${H+F}px)`:"100dvh",width:M||$?`calc(100vw - ${M+$}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,Kt),Object.assign(r.style,$t),c||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=qt)}function R(){d(),u.request(i)}i();const f=D(o,"resize",R);return()=>{u.cancel(),d(),typeof o.removeEventListener=="function"&&f()}}class Zo{lockCount=0;restore=null;timeoutLock=Ce.create();timeoutUnlock=Ce.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=U(t),r=n.documentElement,o=n.body,s=et(r);if(Xt(s,r,o)){const c=new s.MutationObserver(()=>{Xt(s,r,o)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(o,u),this.restore=()=>c.disconnect();return}const a=St||!Xo(t);this.restore=a?Jo(t):Qo(t)}}const es=new Zo;function ts(e=!0,t=null){N(()=>{if(e)return es.acquire(t)},[e,t])}function ns({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),a=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,i]=l.useState(0),[d,R]=l.useState(0),f=u===0,g=so(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!e.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}const x=Ee(m);if(f&&!o){if(s){const y=e.context.internalBackdropRef.current,S=e.context.backdropRef.current;return y||S?y===x||S===x||A(x,a)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:f});return ts(r&&s===!0,a),e.useContextCallback("onNestedDialogOpen",(m,x)=>{i(m),R(x)}),N(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,d,t]),Io(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:d}),null}const rs={...Mo,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class os extends Wn{constructor(t,n,r){const o=new jn,s=ss(t,o,n,r);super(s,is(o),rs)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Hn(r,t,n.trigger),this.update(r)}}function ss(e,t,n,r=!1){const o={...ko(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=Ao(t,n,r),o}function is(e){return{popupRef:l.createRef(),backdropRef:l.createRef(),internalBackdropRef:l.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function as(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:i,handle:d,triggerId:R,defaultTriggerId:f=null}=t,g=e==="drawer",m=u,x=c,y="dialog",S=Oe(!0),b=S!=null,Y={modal:m,disablePointerDismissal:x,nested:b,role:y},v=Ro((X,me)=>new os({open:o,openProp:r,activeTriggerId:f,triggerIdProp:R,...Y},X,me),!0);v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",R),v.useSyncedValues(Y),v.useContextCallback("onOpenChange",s),v.useContextCallback("onOpenChangeComplete",a);const B=v.useState("open"),$=v.useState("mounted"),F=v.useState("payload");Po(v,B),Co(v);const{forceUnmount:H}=Oo(B,v);l.useImperativeHandle(i,()=>({unmount:H,close:()=>v.setOpen(!1,Se(ar))}),[H,v]);const M=B||$;return I.jsxs(On.Provider,{value:v,children:[d&&I.jsx(To,{handle:d,store:v}),M&&I.jsx(ns,{store:v,parentContext:S?.context,isDrawer:g}),typeof n=="function"?n({payload:F}):n]})}function cs(e){return as("dialog",e)}const us=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("titleElementId",i),Ae("h2",t,{ref:n,props:[{id:i},c]})});function Ys({...e}){return I.jsx(cs,{"data-slot":"dialog",...e})}function ls({...e}){return I.jsx(qo,{"data-slot":"dialog-portal",...e})}function ds({className:e,...t}){return I.jsx(Vr,{"data-slot":"dialog-overlay",className:Fe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Gs({className:e,children:t,showCloseButton:n=!0,...r}){return I.jsxs(ls,{children:[I.jsx(ds,{}),I.jsxs(Go,{"data-slot":"dialog-content",className:Fe("fixed top-1/2 left-1/2 z-50 grid grid-cols-[minmax(0,1fr)] max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&I.jsxs(Pn,{"data-slot":"dialog-close",render:I.jsx(Zt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[I.jsx(ur,{}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ks({className:e,...t}){return I.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-2",e),...t})}function $s({className:e,showCloseButton:t=!1,children:n,...r}){return I.jsxs("div",{"data-slot":"dialog-footer",className:Fe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&I.jsx(Pn,{render:I.jsx(Zt,{variant:"outline"}),children:"Close"})]})}function qs({className:e,...t}){return I.jsx(us,{"data-slot":"dialog-title",className:Fe("font-heading text-base leading-none font-medium",e),...t})}function Xs({className:e,...t}){return I.jsx(Ur,{"data-slot":"dialog-description",className:Fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}export{xn as $,vn as A,_r as B,In as C,cs as D,Ys as E,So as F,Gs as G,qs as H,Ks as I,Xs as J,$s as K,Tt as L,Ct as M,Nr as N,Bn as O,jn as P,ws as Q,Wn as R,Gr as S,Ce as T,At as U,Ps as V,Qr as W,ur as X,Ms as Y,$o as Z,Ko as _,D as a,Me as a0,no as a1,Cn as a2,_o as a3,Er as a4,Ln as a5,we as a6,gr as a7,Qe as a8,ys as a9,vs as aA,yr as aB,ln as aC,gs as aD,hs as aE,ms as aF,bs as aG,Et as aH,xr as aI,St as aJ,Fs as aK,ts as aL,an as aM,Us as aN,Ho as aO,jo as aP,Vs as aQ,Lo as aR,No as aS,Bo as aT,Wo as aU,_s as aV,Vo as aW,un as aa,Es as ab,Tn as ac,xt as ad,Ss as ae,Ve as af,Fr as ag,Ls as ah,Zr as ai,Ns as aj,vo as ak,Hn as al,yo as am,ks as an,Bs as ao,He as ap,Cs as aq,Sn as ar,Os as as,Je as at,As as au,Rr as av,kt as aw,at as ax,Ts as ay,xs as az,Go as b,Pn as c,us as d,Ur as e,qo as f,Vr as g,Hs as h,Rs as i,ko as j,Ao as k,co as l,Co as m,Oo as n,To as o,Mo as p,so as q,Io as r,Ws as s,js as t,Ro as u,$e as v,ze as w,Is as x,Jr as y,Ds as z};
@@ -1 +0,0 @@
1
- import{u as r,Q as u,d as s}from"./useBaseQuery-CN0OIcOk.js";import{A as t}from"./index-N-I90MR_.js";function a(e,o){return r({...e,enabled:!0,suspense:!0,throwOnError:s,placeholderData:void 0},u)}function i(){return a(t.me()).data}export{i as u};
@@ -1 +0,0 @@
1
- import{aU as A,r as f,j as e,B as g,aV as S,q as E,h as I,aW as F,A as N,a2 as L,D as M,F as y}from"./index-N-I90MR_.js";import{u as C}from"./useQuery-OxQw-0wS.js";import{u as P,a as U}from"./zod-BXmCiwU1.js";import{C as R}from"./card-BI3eAi_u.js";import{X as $,E as B,G as H,I as z,H as V,J as q,K}from"./dialog-CcUiqZEq.js";import{L as k,I as Y}from"./label-BasLSUbe.js";import{T as G,a as J,b as T,c as p,d as O,e as j}from"./table-DzETz1FN.js";import{C as Q}from"./ConfirmDialog-BsHHrPi0.js";import{C as W}from"./CopyButton-Drniwbyh.js";import{P as X,E as Z}from"./parts-D5D8UvJZ.js";import{b as D}from"./labels--UUyt9uB.js";import{u as _}from"./me-D4xGiOon.js";import{C as ee}from"./check-BWPSlb5c.js";import{U as se}from"./users-xtSDzXF_.js";import{P as te}from"./plus-CY7ZoXBb.js";import"./useBaseQuery-CN0OIcOk.js";import"./copy-DqKLS4Wq.js";function ke(){const{site:s}=A.useParams(),{site:l}=A.useRouteContext(),i=C(N.links(s)),c=C(N.origins(s)),[m,o]=f.useState(!1),[n,t]=f.useState(null);f.useEffect(()=>t(null),[s]);const a=i.data?.data??[],x=c.data?.origins[0]?.replace(/\/+$/,"")??"",r=n?`${x}/${n.fragment}`:"",v=e.jsxs(g,{onClick:()=>o(!0),children:[e.jsx(te,{}),"Add reviewer"]});return e.jsxs("div",{className:"p-7",children:[e.jsx(X,{title:"Reviewers",sub:`Each reviewer gets their own link to ${l.name}`,actions:v}),n&&e.jsxs("div",{className:"mb-4 flex max-w-[1040px] items-center gap-3 rounded-lg border border-ok bg-ok-soft px-3.5 py-3",role:"status",children:[e.jsx(ee,{className:"size-4 shrink-0 text-ok"}),e.jsxs("div",{className:"shrink-0",children:[e.jsxs("b",{className:"font-semibold",children:[n.name," added."]})," ",e.jsx("span",{className:"text-ink-soft",children:"Share this link — it is shown once."})]}),e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12.5px]",children:r}),e.jsx(W,{text:r,label:"Copy link",withText:!0}),e.jsx(g,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:()=>t(null),children:e.jsx($,{})})]}),i.isSuccess&&a.length===0?e.jsx(R,{className:"max-w-[1040px]",children:e.jsx(Z,{icon:e.jsx(se,{className:"size-5"}),title:"No reviewers yet",action:v,children:"Add your client and send them their link. They never need an account."})}):e.jsx(R,{className:"max-w-[1040px] overflow-hidden py-0",children:e.jsxs(G,{children:[e.jsx(J,{children:e.jsxs(T,{children:[e.jsx(p,{children:"Name"}),e.jsx(p,{children:"Status"}),e.jsx(p,{children:"Uses"}),e.jsx(p,{children:"Last seen"}),e.jsx(p,{className:"w-0"})]})}),e.jsx(O,{children:a.map(u=>e.jsx(ne,{link:u,uid:s,onRevoked:()=>t(h=>h?.id===u.id?null:h)},u.id))})]})}),e.jsx("p",{className:"m-0 mt-3 max-w-[1040px] text-[12.5px] text-muted-foreground",children:"Revoking ends every session minted from the link within 10 seconds. The comments a reviewer left stay."}),e.jsx(re,{uid:s,open:m,onOpenChange:o,onMinted:t})]})}function ne({link:s,uid:l,onRevoked:i}){const c=S(l),m=E(_().user.role,"settings"),[o,n]=f.useState(!1),t=!!s.revokedAt,a=!t&&new Date(s.expiresAt).getTime()<=Date.now(),x=t||a,r=Math.max(0,Math.ceil((new Date(s.expiresAt).getTime()-Date.now())/864e5));return e.jsxs(T,{className:I(x&&"text-muted-foreground"),children:[e.jsx(j,{className:"font-medium",children:s.name}),e.jsx(j,{children:t?e.jsxs("span",{children:["Revoked ",D(s.revokedAt)]}):a?e.jsx("span",{children:"Expired"}):e.jsxs("span",{children:[e.jsx("span",{className:"rounded-full bg-ok-soft px-2 py-0.5 text-[11.5px] font-medium text-ok",children:"Active"}),e.jsxs("span",{className:"ml-2 text-[12px] text-muted-foreground",children:["expires in ",r," day",r===1?"":"s"]})]})}),e.jsx(j,{children:s.useCount}),e.jsx(j,{className:"text-muted-foreground",children:s.lastUsedAt?D(s.lastUsedAt):"never"}),e.jsxs(j,{className:"text-right",children:[!t&&m&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>n(!0),children:"Revoke"}),e.jsx(Q,{open:o,onOpenChange:n,title:`Revoke ${s.name}'s link?`,description:`Every session minted from it ends within 10 seconds. The comments ${s.name} left stay. This cannot be undone — adding them again makes a new link.`,confirmLabel:"Revoke",busy:c.isPending,onConfirm:()=>{n(!1),i(),c.mutate(s.id)}})]})]})}const ae=M({name:y().trim().min(1,"Their name"),days:y(),roundId:y().optional()});function re({uid:s,open:l,onOpenChange:i,onMinted:c}){const m=F(s),o=C({...N.rounds(s),enabled:l}),[n,t]=f.useState(""),{register:a,handleSubmit:x,formState:r,reset:v}=P({resolver:U(ae),defaultValues:{days:"14",roundId:""}}),u=x(async d=>{t("");const b=Number(d.days);try{const w=await m.mutateAsync({name:d.name,...Number.isFinite(b)&&b>0?{expiresAt:new Date(Date.now()+b*864e5).toISOString()}:{},...d.roundId?{roundId:d.roundId}:{}});c(w),v(),i(!1)}catch(w){t(L(w))}}),h="h-8 w-full rounded-md border border-input bg-card px-2.5 text-[13.5px] text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50";return e.jsx(B,{open:l,onOpenChange:i,children:e.jsx(H,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(z,{children:[e.jsx(V,{children:"New reviewer"}),e.jsx(q,{children:"Your client's name, as you will see it on their comments. A link is generated once and shown to you once."})]}),n&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-name",children:"Name"}),e.jsx(Y,{id:"reviewer-name",placeholder:"Marta, Kilnwork","aria-invalid":!!r.errors.name,...a("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-days",children:"Link expires in"}),e.jsxs("select",{id:"reviewer-days",className:h,...a("days"),children:[e.jsx("option",{value:"7",children:"7 days"}),e.jsx("option",{value:"14",children:"14 days"}),e.jsx("option",{value:"30",children:"30 days"}),e.jsx("option",{value:"90",children:"90 days"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"You can revoke it at any time before that."})]}),o.data&&o.data.data.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-round",children:"Pin to a round"}),e.jsxs("select",{id:"reviewer-round",className:h,...a("roundId"),children:[e.jsx("option",{value:"",children:"Any round"}),o.data.data.map(d=>e.jsx("option",{value:d.id,children:d.name},d.id))]})]}),e.jsxs(K,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:r.isSubmitting,children:r.isSubmitting?"Adding…":"Add reviewer"})]})]})})})}export{ke as component};
@@ -1 +0,0 @@
1
- import{r as l,i as Fe,ak as de,ab as Me,e as ue,ac as Ye,E as me,k as he,j as e,al as Ue,f as Q,aa as je,aY as Qe,h as pe,q as ge,aZ as Je,a_ as Xe,B as T,A as Te,a$ as Ze,b0 as et,b1 as tt,p as st,b2 as nt}from"./index-N-I90MR_.js";import{u as Le}from"./useQuery-OxQw-0wS.js";import{q as Ve,h as Ke,p as He,u as $e,j as at,c as it,n as ot,g as Re,f as rt,k as dt,l as lt,a as ct,I as ae,L as q}from"./label-BasLSUbe.js";import{a2 as ut,Q as mt,S as ft,N as ht,A as pt,aN as Ce,aI as we,aC as le,ay as ce,aO as ke,aP as Ie,a3 as gt,aQ as Ne,az as xt,aA as bt,aR as Se,aS as Ee,aT as Pe,aU as Ae,aV as vt,aW as yt,X as jt}from"./dialog-CcUiqZEq.js";import{u as Rt,C as Ct}from"./CompositeList-CP60mNVK.js";import{s as wt,i as kt}from"./serializeValue-DRMAHja_.js";import{u as It}from"./useValueChanged-CtiAjxsm.js";import{C as Nt}from"./CompositeItem-BTXT0lX3.js";import{u as St}from"./FieldItemContext-D0PwWPOC.js";import{u as Et}from"./useAriaLabelledBy-G2WKNZQz.js";import{C as Be}from"./ConfirmDialog-BsHHrPi0.js";import{C as Pt}from"./CopyButton-Drniwbyh.js";import{I as At}from"./InstallTag-w7NKoYXb.js";import{B as Dt}from"./badge-VIGkRs4v.js";import{a as ee,A as Ot,P as Ft}from"./parts-D5D8UvJZ.js";import{u as xe}from"./me-D4xGiOon.js";import{S as De}from"./switch-Bsz6KmWY.js";import{S as Mt}from"./SaveState-Cd1Ay9eR.js";import{P as Tt}from"./plus-CY7ZoXBb.js";import"./useBaseQuery-CN0OIcOk.js";import"./check-BWPSlb5c.js";import"./copy-DqKLS4Wq.js";import"./useRender-B_SZ1tbi.js";import"./card-BI3eAi_u.js";import"./labels--UUyt9uB.js";const Lt=l.createContext(void 0);function Vt(s=!1){const t=l.useContext(Lt);if(!t&&!s)throw new Error(Fe(86));return t}function Kt(s,t){return s.matches(":disabled")?!1:!t||s.form===t?!0:s.form===null&&!s.hasAttribute("form")}const fe={checked(s){return s?{"data-checked":""}:{"data-unchecked":""}},...ut,...Ve},ze="data-composite-item-active",Ge=l.createContext(void 0);function Ht(){return l.useContext(Ge)}const We=l.createContext(void 0);function $t(){const s=l.useContext(We);if(s===void 0)throw new Error(Fe(52));return s}const Bt=l.forwardRef(function(t,n){const{render:d,className:a,disabled:c=!1,readOnly:r=!1,required:p=!1,"aria-labelledby":x,value:o,inputRef:L,nativeButton:h=!1,id:O,style:y,...j}=t,w=Ht(),{disabled:E,readOnly:_,required:b,form:$,checkedValue:R,touched:F=!1,validation:B,name:k,setCheckedValue:W=de,setTouched:Y=de,registerInputRef:i=de}=w??{},{setTouched:g,setFilled:v,state:I,disabled:P}=Ke(),A=St(),{labelId:K,getDescriptionProps:J}=He(),m=P||A.disabled||E||c,f=_||r,V=b||p,H=$,N=w?R===o:o==="",M=l.useRef(null),S=l.useRef(null),z=B?.registerInput,G=l.useCallback(C=>z?.(C,{controlRef:M,value:void 0}),[z]),X=Me(L,S,i,G);ue(()=>{S.current?.checked&&v(!0)},[v]),ue(()=>{if(S.current){if(m&&N){i(null);return}i(S.current)}},[N,m,i]);const te=$e(),se=at({id:O,implicit:!1,controlRef:M}),ne=h?void 0:se,ie=Et(x,K,S,!h,ne),oe={role:"radio","aria-checked":N,"aria-labelledby":ie,[ze]:N?"":void 0,id:h?se:te,onKeyDown(C){C.key==="Enter"&&C.preventDefault()},onClick(C){if(C.defaultPrevented||m||f)return;C.preventDefault();const Z=S.current;Z&&Ue(Z,C)},onFocus(C){C.defaultPrevented||m||f||!F||(S.current?.click(),Y(!1))}},{getButtonProps:re,buttonRef:u}=Ye({disabled:m,native:h,composite:!1}),D={type:"radio",ref:X,form:H,id:ne,name:k,tabIndex:-1,style:k?mt:ft,"aria-hidden":!0,...o!==void 0?{value:wt(o)}:me,disabled:m,checked:N,required:V,readOnly:f,onChange(C){if(C.nativeEvent.defaultPrevented||m||f||o===void 0)return;const Z=it(ot,C.nativeEvent);W(o,Z),!Z.isCanceled&&g(!0)},onClick(C){C.stopPropagation()},onFocus(){M.current?.focus()}},U=l.useMemo(()=>({...I,required:V,disabled:m,readOnly:f,checked:N}),[I,m,f,N,V]),qe=U,be=w!==void 0,ve=[n,M,u],ye=[oe,j,re,J,B?C=>B.getValidationProps(m,C):me],_e=he("span",t,{enabled:!be,state:U,ref:ve,props:ye,stateAttributesMapping:fe});return e.jsxs(We.Provider,{value:qe,children:[be?e.jsx(Nt,{tag:"span",render:d,className:a,style:y,state:U,refs:ve,props:ye,stateAttributesMapping:fe}):_e,e.jsx("input",{...D,suppressHydrationWarning:!0})]})}),zt=l.forwardRef(function(t,n){const{render:d,className:a,style:c,keepMounted:r=!1,...p}=t,x=$t(),o=x.checked,{mounted:L,transitionStatus:h,setMounted:O}=ht(o),y={...x,transitionStatus:h},j=l.useRef(null),w=r||L,E=he("span",t,{ref:[n,j],state:y,props:p,stateAttributesMapping:fe});return pt({open:o,ref:j,onComplete(){o||O(!1)}}),w?E:null}),Gt=[];function Wt(s){const{loopFocus:t=!0,orientation:n="both",grid:d,onLoop:a,direction:c,highlightedIndex:r,onHighlightedIndexChange:p,rootRef:x,enableHomeAndEndKeys:o=!1,stopEventPropagation:L,disabledIndices:h,modifierKeys:O=Gt}=s,[y,j]=l.useState(0),w=d!=null,E=l.useRef(null),_=Me(E,x),b=l.useRef([]),$=l.useRef(!1),R=r??y,F=Q((i,g=!1)=>{if((p??j)(i),g){const v=b.current[i];Ce(E.current,v,c,n)}}),B=Q(i=>{if(i.size===0||$.current)return;$.current=!0;const g=Array.from(i.keys()),v=g.find(P=>P?.hasAttribute(ze))??null,I=v?i.get(v)?.index??-1:-1;if(I!==-1)F(I);else if(we(g,R,h)){const P=le(g,{disabledIndices:h});ce(g,P)||F(P)}Ce(E.current,v,c,n)});ue(()=>{if(h==null||r!=null||!$.current)return;const i=b.current;if(we(i,R,h)){const g=le(i,{disabledIndices:h});ce(i,g)||F(g)}},[h,r,R,b,F]);const k=Q((i,g,v)=>a?a(i,g,v,b):v),W=Q(i=>{const g=i.key===ke||i.key===Ie;if(!gt.has(i.key)||!o&&g||qt(i,O)||!E.current)return;const I=c==="rtl",P=I?Pe:Ae,A=I?Ae:Pe,K=n==="vertical"?Se:P,J=n==="vertical"?Ee:A,m=Re(i.nativeEvent);if(m!=null&&Ne(m)&&!kt(m)){const S=m.selectionStart,z=m.selectionEnd,G=m.value;if(S==null||i.shiftKey||S!==z||i.key!==J&&S<G.length||i.key!==K&&S>0)return}let f=R;const V=xt(b,h),H=bt(b,h);d!=null&&(f=d({disabledIndices:h,elementsRef:b,event:i,highlightedIndex:R,loopFocus:t,maxIndex:H,minIndex:V,onLoop:k,orientation:n,rtl:I}));const N=n!=="vertical"&&i.key===P||n!=="horizontal"&&i.key===Se,M=n!=="vertical"&&i.key===A||n!=="horizontal"&&i.key===Ee;o&&(i.key===ke?f=V:i.key===Ie&&(f=H)),f===R&&(N||M)&&(t&&f===H&&N?(f=V,a&&(f=a(i,R,f,b))):t&&f===V&&M?(f=H,a&&(f=a(i,R,f,b))):f=le(b.current,{startingIndex:f,decrement:M,disabledIndices:h})),f!==R&&!ce(b.current,f)&&(L&&i.stopPropagation(),(w||g||N||M)&&i.preventDefault(),F(f,!0),queueMicrotask(()=>{b.current[f]?.focus()}))});return{props:{ref:_,onFocus(i){const g=E.current,v=Re(i.nativeEvent);!g||v==null||!Ne(v)||v.setSelectionRange(0,v.value.length)},onKeyDown:W},highlightedIndex:R,onHighlightedIndexChange:F,elementsRef:b,onMapChange:B,relayKeyboardEvent:W}}function qt(s,t){for(const n of vt)if(!t.includes(n)&&s.getModifierState(n))return!0;return!1}function _t(s){const{render:t,className:n,style:d,refs:a=je,props:c=je,state:r=me,stateAttributesMapping:p,highlightedIndex:x,onHighlightedIndexChange:o,orientation:L,grid:h,loopFocus:O,onLoop:y,enableHomeAndEndKeys:j,onMapChange:w,stopEventPropagation:E=!0,rootRef:_,disabledIndices:b,modifierKeys:$,highlightItemOnHover:R=!1,tag:F="div",...B}=s,k=Rt(),{props:W,highlightedIndex:Y,onHighlightedIndexChange:i,elementsRef:g,onMapChange:v,relayKeyboardEvent:I}=Wt({grid:h,loopFocus:O,onLoop:y,orientation:L,highlightedIndex:x,onHighlightedIndexChange:o,rootRef:_,stopEventPropagation:E,enableHomeAndEndKeys:j,direction:k,disabledIndices:b,modifierKeys:$}),P=he(F,s,{state:r,ref:a,props:[W,...c,B],stateAttributesMapping:p}),A=l.useMemo(()=>({highlightedIndex:Y,onHighlightedIndexChange:i,highlightItemOnHover:R,relayKeyboardEvent:I}),[Y,i,R,I]);return e.jsx(Qe.Provider,{value:A,children:e.jsx(Ct,{elementsRef:g,onMapChange:K=>{w?.(K),v(K)},children:P})})}const Yt=[yt],Ut=l.forwardRef(function(t,n){const{render:d,className:a,disabled:c,readOnly:r,required:p,onValueChange:x,value:o,defaultValue:L,form:h,name:O,inputRef:y,id:j,style:w,...E}=t,{setTouched:_,setFocused:b,validationMode:$,name:R,disabled:F,state:B,validation:k,setDirty:W,setFilled:Y,validityData:i}=Ke(),{labelId:g}=He(),{clearErrors:v,elementRef:I}=rt(),P=Vt(!0),A=F||c,K=R??O,J=$e(j),[m,f]=dt({controlled:o,default:L,name:"RadioGroup",state:"value"}),[V,H]=l.useState(!1),N=Q((u,D)=>{x?.(u,D),!D.isCanceled&&f(u)}),M=k.getInputControl,S=l.useMemo(()=>({get current(){return M()}}),[M]),z=l.useRef(null),G=l.useRef(null);function X(u){let D;return y&&(typeof y=="function"?D=y(u):y.current=u),z.current=u,D}const te=Q(u=>{if(!u||u.disabled)return;G.current||(G.current=u);const D=z.current,U=u.checked||D==null||D.disabled?X(u):void 0;return()=>{G.current===u&&(G.current=null),z.current===u?U?(U(),z.current=null):X(null):U?.()}}),se=Q(()=>{const u=I.current;if(!u)return m??null;for(const D of k.registeredInputs.keys())if(D.checked&&Kt(D,u))return m??null;return null});lt(S,J,m??null,se,!A,O),It(m,()=>{v(K),W(m!==i.initialValue),Y(m!=null),k.change(m);const u=G.current;m==null&&u&&!u.disabled&&X(u)});const ne=g??P?.legendId,ie={...B,disabled:A??!1,required:p??!1,readOnly:r??!1},oe=l.useMemo(()=>({checkedValue:m,disabled:A,form:h,validation:k,name:K,readOnly:r,registerInputRef:te,required:p,setCheckedValue:N,setTouched:H,touched:V}),[m,A,h,k,K,r,te,p,N,H,V]),re={id:j,role:"radiogroup","aria-required":p||void 0,"aria-disabled":A||void 0,"aria-readonly":r||void 0,"aria-labelledby":ne,onFocus(){b(!0)},onBlur(u){ct(u.currentTarget,u.relatedTarget)||(_(!0),b(!1),$==="onBlur"&&k.commit(m))},onKeyDownCapture(u){u.key.startsWith("Arrow")&&(H(!0),b(!0))}};return e.jsx(Ge.Provider,{value:oe,children:e.jsx(_t,{render:d,className:a,style:w,state:ie,props:[re,E,u=>k.getValidationProps(A??!1,u)],refs:[n],stateAttributesMapping:Ve,enableHomeAndEndKeys:!1,modifierKeys:Yt})})});function Qt({className:s,...t}){return e.jsx(Ut,{"data-slot":"radio-group",className:pe("grid w-full gap-2",s),...t})}function Jt({className:s,...t}){return e.jsx(Bt,{"data-slot":"radio-group-item",className:pe("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...t,children:e.jsx(zt,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:e.jsx("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}function Xt({uid:s}){const t=xe(),n=Le(Te.rounds(s)),d=ge(t.user.role,"settings"),a=n.data?.data??[],c=a.filter(r=>!r.closed&&!r.archived).length;return e.jsxs(ee,{title:"Rounds",description:e.jsx(e.Fragment,{children:"One pass of feedback each, and several can run at once — your own QA beside the client's. A new comment goes to the round its reviewer is looking at. Archive a finished round to put it away; delete removes its comments too."}),children:[!d&&e.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:"Only an owner or an admin can change rounds."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col divide-y divide-border p-0","aria-label":"Rounds",children:[a.map(r=>e.jsx(Zt,{uid:s,round:r,manager:d,last:!r.closed&&!r.archived&&c===1},r.id)),n.isSuccess&&a.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:"No rounds yet."})]})]})}const Oe="Open another round first — new comments need somewhere to go.";function Zt({uid:s,round:t,manager:n,last:d}){const a=Je(s),c=Xe(s),[r,p]=l.useState(!1),[x,o]=l.useState(t.name),[L,h]=l.useState(!1),O=t.archived?"archived":t.closed?"closed":"open",y=a.isPending||c.isPending;return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 py-2.5 first:pt-0 last:pb-0",children:[r?e.jsxs("form",{className:"flex min-w-0 flex-1 items-center gap-2",onSubmit:j=>{j.preventDefault();const w=x.trim();if(!w||w===t.name)return p(!1);a.mutate({id:t.id,name:w},{onSuccess:()=>p(!1)})},children:[e.jsx(ae,{"aria-label":`New name for ${t.name}`,value:x,maxLength:80,autoFocus:!0,onChange:j=>o(j.target.value),onKeyDown:j=>j.key==="Escape"&&p(!1)}),e.jsx(T,{type:"submit",size:"sm",disabled:!x.trim()||a.isPending,children:"Save"}),e.jsx(T,{type:"button",size:"sm",variant:"ghost",onClick:()=>p(!1),children:"Cancel"})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-[13.5px] font-medium",children:t.name}),e.jsx(Dt,{variant:"outline",className:"text-[11px]",children:O})]}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] text-muted-foreground",children:["Round ",t.number," · ",t.threads," ",t.threads===1?"comment":"comments",t.unresolved>0?` · ${t.unresolved} unresolved`:""]})]}),n&&!r&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1",title:d?Oe:void 0,children:[e.jsx(T,{size:"sm",variant:"ghost","aria-label":`Rename ${t.name}`,disabled:y,onClick:()=>{o(t.name),p(!0)},children:"Rename"}),!t.archived&&e.jsx(T,{size:"sm",variant:"ghost","aria-label":`${t.closed?"Reopen":"Close"} ${t.name}`,disabled:y||d,onClick:()=>a.mutate({id:t.id,closed:!t.closed}),children:t.closed?"Reopen":"Close"}),e.jsx(T,{size:"sm",variant:"ghost","aria-label":`${t.archived?"Restore":"Archive"} ${t.name}`,disabled:y||d,onClick:()=>a.mutate({id:t.id,archived:!t.archived}),children:t.archived?"Restore":"Archive"}),e.jsx(T,{size:"sm",variant:"ghost",className:"text-destructive","aria-label":`Delete ${t.name}`,disabled:y||d,onClick:()=>h(!0),children:"Delete…"})]}),n&&d&&!r&&e.jsx("p",{className:"m-0 w-full text-[12px] text-muted-foreground",children:Oe}),e.jsx(Be,{open:L,onOpenChange:h,title:`Delete ${t.name}?`,description:t.threads>0?e.jsxs(e.Fragment,{children:["This deletes the round and"," ",e.jsxs("b",{className:"font-semibold text-foreground",children:[t.threads," ",t.threads===1?"comment":"comments"," and their screenshots"]}),". Reviewers stop seeing them straight away. To keep them out of sight instead, archive the round."]}):e.jsxs(e.Fragment,{children:["This round has no comments. Its number, Round ",t.number,", is not used again."]}),confirmLabel:"Delete round",confirmWord:t.name,busy:c.isPending,onConfirm:()=>c.mutate({id:t.id,confirm:t.name},{onSuccess:()=>h(!1)})})]})}const es=[{id:"open",title:"Everyone on the site",note:"The toolbar appears for every visitor on the addresses above. Simplest for a staging URL nobody else knows."},{id:"link-required",title:"Only reviewers with a link",note:"You add a reviewer and send them their link. Use this when staging is publicly reachable, or when one reviewer needs revoking without shutting the whole site."}];function ts(){const{site:s}=Ze.useParams(),t=xe(),n=t.projects.find(o=>o.uid===s),d=ge(t.user.role,"settings"),a=Le(Te.origins(s)),c=et(s),[r,p]=l.useState(null),x=o=>c.mutate(o,{onSuccess:()=>p(Date.now())});return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(Ft,{title:"Settings",sub:n.name,actions:e.jsx(Mt,{saving:c.isPending,savedAt:r})}),e.jsxs(ee,{title:"Site",description:"Its name, its ID for the tag, and where the widget may run.",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{children:"Site ID"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md bg-muted px-2.5 py-1.5 font-mono text-[12.5px] text-ink-soft",children:n.uid}),e.jsx(Pt,{text:n.uid,label:"Copy the site ID"})]})]}),e.jsx(ss,{name:n.name,onSave:o=>x({name:o})}),e.jsx(ns,{domain:a.data?.domain??null,loaded:a.isSuccess,onSave:o=>x({domain:o})}),e.jsx(as,{list:a.data?.origins??[],loaded:a.isSuccess,hasDomain:!!a.data?.domain,onChange:o=>x({origins:o})})]}),e.jsxs(ee,{title:"Widget",description:"Whether it runs, who the toolbar appears for, what guests may do, and the tag itself.",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(q,{htmlFor:"widget-on",className:"text-[13px] font-medium",children:"Widget on this site"}),e.jsx("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:"Off hides the toolbar for everyone and refuses new comments. The tag can stay in the site's code."})]}),e.jsx(De,{id:"widget-on","aria-label":"Widget on this site",checked:n.status!=="paused",onCheckedChange:o=>x({status:o?"active":"paused"})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(q,{htmlFor:"guests-status",className:"text-[13px] font-medium",children:"Guests can change status"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:["People who comment without an account or a review link can move a comment between Open, In progress, In review and Resolved.",!d&&" Only an owner or an admin can change this."]})]}),e.jsx(De,{id:"guests-status","aria-label":"Guests can change status",checked:n.guestsCanChangeStatus!==!1,disabled:!d,onCheckedChange:o=>x({guestsCanChangeStatus:o})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(q,{children:"Who can comment"}),e.jsx(Qt,{value:n.writeMode,onValueChange:o=>x({writeMode:String(o)}),className:"gap-2",children:es.map(o=>e.jsxs("label",{className:pe("flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5",n.writeMode===o.id&&"border-brand bg-brand-soft"),children:[e.jsx(Jt,{value:o.id,className:"mt-0.5","aria-label":o.title}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:o.title}),e.jsx("span",{className:"block text-[12px] leading-normal text-muted-foreground",children:o.note})]})]},o.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{children:"The tag"}),e.jsx(At,{uid:n.uid}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["Paste it before ",e.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed."]})]})]}),e.jsx(Xt,{uid:s}),e.jsx(is,{uid:s,name:n.name,archived:!!n.archived,locked:!!n.locked}),e.jsx(os,{uid:s,name:n.name})]})}function ss({name:s,onSave:t}){const[n,d]=l.useState(s);l.useEffect(()=>d(s),[s]);const a=n.trim().length>0&&n.trim()!==s;return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:c=>{c.preventDefault(),a&&t(n.trim())},children:[e.jsx(q,{htmlFor:"site-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{id:"site-name",value:n,onChange:c=>d(c.target.value)}),a&&e.jsx(T,{type:"submit",variant:"outline",children:"Save"})]})]})}function ns({domain:s,loaded:t,onSave:n}){const[d,a]=l.useState(s??"");l.useEffect(()=>a(s??""),[s]);const c=d.trim()!==(s??"");return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:r=>{r.preventDefault(),c&&n(d.trim()||null)},children:[e.jsx(q,{htmlFor:"site-domain",children:"Domain"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ae,{id:"site-domain",placeholder:"kilnwork.studio",value:d,onChange:r=>a(r.target.value),disabled:!t}),c&&e.jsx(T,{type:"submit",variant:"outline",children:d.trim()?"Save domain":"Clear domain"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build."})]})}function as({list:s,loaded:t,hasDomain:n,onChange:d}){const[a,c]=l.useState("");return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(q,{htmlFor:"site-origin-add",children:"Also allowed"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Exact addresses the domain does not cover — a client's other host, a preview on somebody else's suffix."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:[s.map(r=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md border border-border px-2 py-1 font-mono text-[12px]",children:r}),e.jsx(T,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${r}`,disabled:s.length<=1&&!n,onClick:()=>d(s.filter(p=>p!==r)),children:e.jsx(jt,{})})]},r)),t&&s.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:n?"None besides the domain.":"No address yet."})]}),e.jsxs("form",{className:"flex gap-2",onSubmit:r=>{r.preventDefault();const p=a.trim();p&&(d([...s,p]),c(""))},children:[e.jsx(ae,{id:"site-origin-add",placeholder:"https://staging.example.com",value:a,onChange:r=>c(r.target.value)}),e.jsxs(T,{type:"submit",variant:"outline",disabled:!a.trim(),children:[e.jsx(Tt,{}),"Add"]})]})]})}function is({uid:s,name:t,archived:n,locked:d}){const a=tt(s);return e.jsx(ee,{title:n?"Restore this site":"Archive this site",description:n?"Its widget takes comments again and it counts toward the plan. Restoring needs room on the plan.":"For a site you have finished with. Every comment is kept and can be read, the widget stops taking new ones, and the site no longer counts toward the plan.",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:n?`${t} is archived.`:d?`${t} is read-only because the studio is over its plan. Archiving another site frees a place.`:"You can restore it at any time."}),e.jsx(T,{type:"button",variant:"outline",loading:a.isPending,onClick:()=>a.mutate(n?"restore":"archive"),children:n?`Restore ${t}`:`Archive ${t}`})]})})}function os({uid:s,name:t}){const[n,d]=l.useState(!1),a=st(),c=nt(s);return e.jsxs(ee,{danger:!0,title:"Delete this site",description:e.jsxs(e.Fragment,{children:["The site stops appearing and its widget stops being served."," ",e.jsx("b",{className:"font-semibold text-foreground",children:"Nothing your client wrote is destroyed"})," — the comments stay in the database, so a mistake here is recoverable."]}),children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:"You will be asked to type the site's name."}),e.jsxs(T,{type:"button",variant:"outline",className:"border-destructive text-destructive",onClick:()=>d(!0),children:["Delete ",t,"…"]})]}),e.jsx(Be,{open:n,onOpenChange:d,title:`Delete ${t}?`,description:"The site stops appearing and its widget stops being served. Nothing your client wrote is destroyed — the comments stay in the database.",confirmLabel:"Delete",confirmWord:t,busy:c.isPending,onConfirm:()=>c.mutate(void 0,{onSuccess:()=>{d(!1),a({to:"/sites"})}})})]})}const Ds=()=>ge(xe().user.role,"settings")?e.jsx(ts,{}):e.jsx(Ot,{title:"Settings",children:e.jsx("p",{className:"m-0",children:"A site's addresses, who may comment, the widget and its rounds are set by an owner or an admin of the studio."})});export{Ds as component};
@@ -1 +0,0 @@
1
- function r(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}function i(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}export{r as i,i as s};
@@ -1 +0,0 @@
1
- import{q as w,a1 as y,r as p,j as e,B as m,L as N,p as A,d as S,s as $,C as k,D as C,F as g}from"./index-N-I90MR_.js";import{u as E,a as _}from"./zod-BXmCiwU1.js";import{C as D}from"./card-BI3eAi_u.js";import{E as F,G as I,I as L,H as P,J as T,K as z}from"./dialog-CcUiqZEq.js";import{L as f,I as j}from"./label-BasLSUbe.js";import{P as q,E as H}from"./parts-D5D8UvJZ.js";import{b as K}from"./labels--UUyt9uB.js";import{u as R}from"./me-D4xGiOon.js";import{P as b}from"./plus-CY7ZoXBb.js";import{L as B}from"./layout-grid-0UvojwDX.js";import{I as G}from"./image-off-Ccb5M8cE.js";import"./useBaseQuery-CN0OIcOk.js";function ae(){const s=R(),i=w(s.user.role,"settings"),{add:d}=y.useSearch(),[x,n]=p.useState(!!d&&i);p.useEffect(()=>{d&&i&&n(!0)},[d,i]);const a=s.projects.filter(r=>!r.archived),l=s.projects.filter(r=>r.archived),h=a.reduce((r,o)=>r+o.unresolved,0),t=s.limits.projects.limit,c=t!==null&&a.length>=t,u=t!==null&&a.length>t;return e.jsxs("div",{className:"p-7",children:[e.jsx(q,{title:"Sites",sub:a.length?`${a.length}${t!==null?` of ${t}`:""} site${a.length===1&&t===null?"":"s"} · ${h} open`:t!==null?`0 of ${t} sites`:void 0,actions:i?e.jsxs(m,{onClick:()=>n(!0),disabled:c,title:c?`This studio's plan allows ${t} sites.`:void 0,children:[e.jsx(b,{}),"Add a site"]}):void 0}),u&&e.jsxs("div",{role:"status",className:"mb-5 max-w-[1100px] rounded-md border border-border bg-warn-soft px-4 py-3 text-[13px]",children:["This studio has ",a.length," sites and its plan includes ",t,". The newest ",a.length-t," ",a.length-t===1?"is":"are"," ","read-only: comments can be read, nothing new comes in."," ",i?"Archive a site you have finished with, or move to a plan with more.":"An owner or an admin can archive a site or change the plan."]}),a.length===0?e.jsx(D,{className:"max-w-[1100px]",children:e.jsx(H,{icon:e.jsx(B,{className:"size-5"}),title:"No sites yet",action:i?e.jsxs(m,{onClick:()=>n(!0),children:[e.jsx(b,{}),"Add a site"]}):void 0,children:i?"A site is one client website. Add it, paste the tag, and comments start arriving here.":"A site is one client website. An owner or an admin adds it, and its comments appear here."})}):e.jsx("div",{className:"grid max-w-[1100px] grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:a.map(r=>e.jsx(v,{p:r},r.uid))}),l.length>0&&e.jsxs("section",{className:"mt-10 max-w-[1100px]","aria-labelledby":"archived-sites",children:[e.jsx("h2",{id:"archived-sites",className:"m-0 mb-1 text-[14px] font-semibold",children:"Archived"}),e.jsx("p",{className:"m-0 mb-4 text-[12.5px] text-muted-foreground",children:"Finished or put away. Every comment is kept and can be read; nothing new comes in, and they do not count toward the plan."}),e.jsx("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:l.map(r=>e.jsx(v,{p:r},r.uid))})]}),e.jsx(U,{open:x,onOpenChange:n})]})}function v({p:s}){const i=s.archived?"Archived":s.locked?"Read-only":s.status==="paused"?"Paused":null;return e.jsxs(N,{to:"/s/$site/comments",params:{site:s.uid},className:"block overflow-hidden rounded-lg border border-border bg-card text-foreground transition-shadow hover:shadow-[0_1px_2px_rgb(24_23_22/.06),0_8px_24px_rgb(24_23_22/.08)]",children:[e.jsx("div",{className:`flex h-[150px] items-center justify-center border-b border-border bg-background${s.archived?" opacity-70 grayscale":""}`,children:s.previewUrl?e.jsx("img",{src:s.previewUrl,alt:"",className:"size-full object-cover object-top"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-muted",children:e.jsx(G,{className:"size-4"})}),"No screenshot yet"]})}),e.jsxs("div",{className:"px-3.5 pb-3.5 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.jsx("span",{className:"truncate",children:s.name}),i&&e.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-px text-[10.5px] font-medium uppercase tracking-wide text-muted-foreground",children:i})]}),s.domain&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[12px] text-muted-foreground",children:s.domain}),e.jsx("div",{className:"mt-2 text-[12.5px] text-ink-soft",children:s.threads===0?"Nothing filed yet":`${s.unresolved} open of ${s.threads}${s.lastActivityAt?` · ${K(s.lastActivityAt)}`:""}`})]})]})}const Q=C({name:g().trim().min(1,"A name"),domain:g().trim().min(1,"Its domain")});function U({open:s,onOpenChange:i}){const d=A(),x=S(),[n,a]=p.useState(""),{register:l,handleSubmit:h,formState:t,reset:c}=E({resolver:_(Q)}),u=h(async r=>{a("");try{const o=await $.createProject(r.name,"",r.domain);await x.invalidateQueries({queryKey:["me"]}),c(),i(!1),d({to:"/s/$site/comments",params:{site:o.uid}})}catch(o){a(o instanceof k?o.message:"Could not add the site.")}});return e.jsx(F,{open:s,onOpenChange:i,children:e.jsx(I,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(L,{children:[e.jsx(P,{children:"Add a site"}),e.jsx(T,{children:"One client website. The tag it needs is shown right after."})]}),n&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"site-name",children:"Name"}),e.jsx(j,{id:"site-name",placeholder:"Kilnwork","aria-invalid":!!t.errors.name,...l("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"site-domain",children:"Domain"}),e.jsx(j,{id:"site-domain",placeholder:"kilnwork.studio","aria-invalid":!!t.errors.domain,...l("domain")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in Settings."})]}),e.jsxs(z,{children:[e.jsx(m,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(m,{type:"submit",loading:t.isSubmitting,children:t.isSubmitting?"Adding…":"Add site"})]})]})})})}export{ae as component};
@@ -1 +0,0 @@
1
- import{j as t,O as o}from"./index-N-I90MR_.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +0,0 @@
1
- import{q as N,j as e,w as k,a4 as w,r as d,B as p,S as A,d as C,a5 as F,a2 as E,A as m,a6 as R,s as D}from"./index-N-I90MR_.js";import{u as h}from"./useQuery-OxQw-0wS.js";import{L as O,I as v}from"./label-BasLSUbe.js";import{I as P,S as q}from"./InstanceRows-BIZM7ybm.js";import{A as z,P as G,a as g}from"./parts-D5D8UvJZ.js";import{u as S}from"./me-D4xGiOon.js";import{S as I}from"./SaveState-Cd1Ay9eR.js";import{b as L}from"./studio-CpQminn4.js";import{c as T}from"./update-duXzIzFS.js";import"./useBaseQuery-CN0OIcOk.js";import"./dialog-CcUiqZEq.js";import"./ConfirmDialog-BsHHrPi0.js";import"./labels--UUyt9uB.js";import"./card-BI3eAi_u.js";function U(){const s=S(),t=h(m.meta()),i=h(m.members()),r=L(),n=N(s.user.role,"studio"),u=k(s),c=w(s),o=!h(m.setupState()).data?.billingUrl,[l,a]=d.useState(s.org.name),[b,y]=d.useState(null);d.useEffect(()=>a(s.org.name),[s.org.name]);const j=n&&l.trim().length>0&&l.trim()!==s.org.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(G,{title:"General",sub:s.org.name,actions:e.jsx(I,{saving:r.isPending,savedAt:b})}),e.jsx(g,{title:"Studio",description:"The name at the top of every screen.",children:e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:f=>{f.preventDefault(),j&&r.mutate(l.trim(),{onSuccess:()=>y(Date.now())})},children:[e.jsx(O,{htmlFor:"studio-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{id:"studio-name",value:l,readOnly:!n,onChange:f=>a(f.target.value)}),j&&e.jsx(p,{type:"submit",variant:"outline",children:"Save"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:n?"Shown at the top of the sidebar, above every site.":"Only an owner can change it."})]})}),u?e.jsx(g,{title:"This instance",description:"What is running, and where.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Version"}),e.jsxs("dd",{className:"m-0",children:[t.data?.version??"—"," ",e.jsx(_,{version:t.data?.version??""})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsx("dd",{className:"m-0",children:e.jsx(B,{owner:n})}),t.data?.commit&&t.data.commit!=="unknown"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Commit"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:[t.data.commit.slice(0,12),t.data.modified?" · modified":""]})]}),o&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites · members"}),e.jsxs("dd",{className:"m-0",children:[s.projects.length," · ",i.data?.data.length??"—"]})]})]})}):o?e.jsx(g,{title:"This studio",description:"What is in it.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites"}),e.jsx("dd",{className:"m-0",children:s.projects.length}),e.jsx("dt",{className:"text-muted-foreground",children:"Members"}),e.jsx("dd",{className:"m-0",children:i.data?.data.length??"—"})]})}):null,c==="instance"?e.jsx(P,{owner:n}):c==="usage"?e.jsx(q,{}):null]})}function _({version:s}){const[t,i]=d.useState({s:"idle"});return t.s==="idle"?e.jsxs(e.Fragment,{children:["·"," ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>{i({s:"checking"}),T(s).then(r=>i({s:"done",r})).catch(()=>i({s:"failed"}))},children:"Check for updates"})," ",e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"— from your browser, never from the server"})]}):t.s==="checking"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:["· ",e.jsx(A,{className:"size-3"})," checking…"]}):t.s==="failed"?e.jsx("span",{className:"text-muted-foreground",children:"· could not reach npm"}):e.jsx("span",{className:"text-muted-foreground",children:t.r?.newer?`· ${t.r.latest} is out`:"· up to date"})}function B({owner:s}){const t=C(),i=h(m.instance()),[r,n]=d.useState(null),[u,c]=d.useState(""),x=F({mutationFn:a=>D.setAddress(a),onSuccess:a=>{t.setQueryData(m.instance().queryKey,a),n(null),c(""),R.success("Address saved — every new link is built from it")},onError:a=>c(E(a))}),o=i.data?.address;if(!o)return e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:location.origin});const l=o.source==="env";return r===null||!s||l?e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:o.url}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:l?"· set by the environment (SNAGSET_BASE_URL)":o.source==="stored"?"· set at claim; every link is built from it":"· this machine's default"}),s&&!l&&e.jsx(p,{variant:"ghost",size:"sm",onClick:()=>n(o.url),children:"Change…"})]}):e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:a=>{a.preventDefault(),x.mutate(r.trim())},children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(v,{"aria-label":"Address",value:r,onChange:a=>n(a.target.value),className:"h-8 max-w-[360px] font-mono text-[12px]",autoFocus:!0}),e.jsx(p,{type:"submit",size:"sm",loading:x.isPending,disabled:!r.trim(),children:x.isPending?"Saving…":"Save"}),e.jsx(p,{type:"button",variant:"ghost",size:"sm",onClick:()=>n(null),children:"Cancel"})]}),u&&e.jsx("span",{className:"text-[12px] text-destructive",children:u}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"https:// unless it is this machine; the origin only. Review links, issues and emails are built from it."})]})}const ae=()=>N(S().user.role,"settings")?e.jsx(U,{}):e.jsx(z,{title:"General"});export{ae as component};
@@ -1 +0,0 @@
1
- import{q as M,j as e,L as U,w as te,d as se,r as i,a5 as P,a6 as T,a2 as K,s as F,a7 as D,B as x,$ as ne,C as G,A as oe}from"./index-N-I90MR_.js";import{u as q}from"./useQuery-OxQw-0wS.js";import{B as _}from"./badge-VIGkRs4v.js";import{E,G as O,I as R,H as W,J,K as H}from"./dialog-CcUiqZEq.js";import{L as S,I}from"./label-BasLSUbe.js";import{C as ae}from"./ConfirmDialog-BsHHrPi0.js";import{A as re,P as ie,a as ce}from"./parts-D5D8UvJZ.js";import{u as V}from"./me-D4xGiOon.js";import{C as B}from"./CopyButton-Drniwbyh.js";import{b as le}from"./labels--UUyt9uB.js";import{M as de}from"./McpTokens-BAlNfNd7.js";import"./useBaseQuery-CN0OIcOk.js";import"./useRender-B_SZ1tbi.js";import"./card-BI3eAi_u.js";import"./check-BWPSlb5c.js";import"./copy-DqKLS4Wq.js";import"./switch-Bsz6KmWY.js";import"./useAriaLabelledBy-G2WKNZQz.js";import"./useValueChanged-CtiAjxsm.js";const he={ok:{label:"Healthy",tone:"ok"},needs_reauth:{label:"Needs a new token",tone:"bad"},error:{label:"Failing",tone:"bad"}};function me(){const o=V(),l=M(o.user.role,"settings"),f=M(o.user.role,"studio")&&te(o),j=q(oe.integrations()),A=se(),N=()=>A.invalidateQueries({queryKey:["integrations"]}),[d,g]=i.useState(null),[c,b]=i.useState(null),[k,u]=i.useState(null),v=P({mutationFn:t=>F.regenerateGitHubWebhook(t),onSuccess:({webhook:t},r)=>u({site:r,provider:"github",hook:t,fresh:!1}),onError:t=>T.error(K(t))}),C=P({mutationFn:({uid:t,provider:r})=>F.testTracker(t,r).then(L=>({...L,provider:r})),onSuccess:t=>{T[t.ok?"success":"error"](t.ok?`${D[t.provider]} can see ${t.target}`:t.detail??`${D[t.provider]} refused the token`),N()},onError:t=>T.error(K(t))}),y=P({mutationFn:({uid:t,provider:r})=>F.disconnectTracker(t,r),onSuccess:()=>{b(null),N()},onError:t=>T.error(K(t))}),w=j.data?.data??[],m=t=>w.filter(r=>r.provider===t),p=o.projects.filter(t=>!t.archived&&!t.locked),a=t=>p.filter(r=>!m(t).some(L=>L.site===r.uid)),s=l?o.limits.integrations?p.length===0?"site":null:"plan":null;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(ie,{title:"Integrations",sub:"Mirrors converge on the comment's status here; Slack only announces"}),s&&e.jsxs("div",{role:"note",className:"flex max-w-[1040px] flex-wrap items-center gap-x-4 gap-y-2 rounded-lg border border-border bg-muted/40 px-4 py-3 text-[13px]",children:[e.jsx("span",{className:"min-w-0 flex-1",children:s==="plan"?o.user.role==="owner"?"This studio's plan does not include integrations. A plan that does lets you connect each site to GitHub, Linear, Jira and Slack.":"This studio's plan does not include integrations. An owner can change the plan.":o.projects.length===0?"An integration connects one site to one repository, team, project or channel. Add a site first, then connect it here.":"An integration connects one site at a time, and every site here is archived or read-only. Restore one, or add a site, then connect it here."}),s==="plan"?o.user.role==="owner"&&e.jsx(x,{variant:"outline",size:"sm",render:e.jsx(U,{to:"/studio/plan"}),children:"See plans"}):e.jsx(x,{variant:"outline",size:"sm",render:e.jsx(U,{to:"/sites"}),children:"Go to Sites"})]}),["github","linear","jira","slack"].map(t=>{const r=m(t),L=a(t);return e.jsxs(ce,{title:D[t],description:t==="github"?"A comment becomes an issue in the site's repository, with the brief as its body; resolving it here closes the issue there, and closing it there resolves it here. A fine-grained token per site — no OAuth app to register.":t==="linear"?"A comment becomes an issue in the site's team, with the brief as its body; our status moves it between the team's workflow states by type, and a webhook from Linear moves it back. A personal API key per site — no OAuth app to register.":t==="jira"?"A comment becomes an issue in the site's Jira project, with the brief as its description; our status moves it through the workflow by status category, and a webhook from Jira moves it back. An API token with the account's email — what Atlassian gives a self-hoster.":"One message per comment in a channel, edited in place as the status moves — never a second message, never a reply. A bot token from an app you create in a click from our manifest; Slack sends nothing back.",children:[j.isPending&&e.jsx(ne,{rows:2}),j.isSuccess&&r.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(_,{variant:"outline",children:"Not connected"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:t==="github"?"No site is connected to a repository yet.":t==="linear"?"No site is connected to a team yet.":t==="jira"?"No site is connected to a project yet.":"No site is connected to a channel yet."})]}),r.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(n=>{const h=he[n.health]??{label:n.health,tone:"warn"};return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("span",{className:"font-medium",children:n.siteName??n.site}),e.jsx("span",{className:"text-muted-foreground",children:"→"}),e.jsx("code",{className:"font-mono text-[12.5px]",children:n.provider==="github"?`${n.owner}/${n.repo}`:n.provider==="linear"?`${n.teamKey} · ${n.teamName}`:n.provider==="jira"?`${n.projectKey} · ${n.projectName}`:`#${n.channelName} · ${n.teamName}`}),e.jsx(_,{variant:"outline",className:h.tone==="ok"?"border-ok text-ok":h.tone==="bad"?"border-destructive text-destructive":"",children:h.label}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[n.provider==="slack"?n.createOn==="thread.created"?"A message for every new comment":"Messages when you ask, from the brief":n.createOn==="thread.created"?"An issue for every new comment":"Issues when you ask, from the brief",n.provider==="github"&&n.labels.length?` · labels ${n.labels.join(", ")}`:"",n.provider!=="github"&&n.provider!=="slack"&&!n.hasWebhookSecret?` · no webhook secret yet, so ${D[n.provider]} cannot move comments here`:""," · ",le(n.updatedAt)]}),n.lastError&&e.jsx("span",{className:"basis-full text-[12px] text-destructive",children:n.lastError}),l&&e.jsxs("span",{className:"ml-auto flex gap-1",children:[n.provider==="github"?e.jsx(x,{variant:"ghost",size:"sm",loading:v.isPending,onClick:()=>v.mutate(n.site),children:"Webhook…"}):n.provider==="slack"?null:e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>u({site:n.site,provider:n.provider,hook:{url:`${location.origin}/api/v1/integrations/${n.provider}/inbound`},fresh:!1}),children:"Webhook…"}),e.jsx(x,{variant:"ghost",size:"sm",loading:C.isPending,onClick:()=>C.mutate({uid:n.site,provider:n.provider}),children:"Test"}),e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>b(n),children:"Disconnect"})]})]},`${n.provider}:${n.site}`)})}),l&&!s&&L.length>0&&e.jsx("div",{children:e.jsx(x,{variant:"outline",size:"sm",onClick:()=>g(t),children:"Connect a site…"})})]},t)}),e.jsx(de,{owner:l,instanceOwner:f,sites:o.projects}),e.jsx(ue,{open:d==="github",onOpenChange:t=>!t&&g(null),sites:a("github"),onDone:(t,r)=>{N(),r&&u({site:t,provider:"github",hook:r,fresh:!0})}}),e.jsx(xe,{open:d==="linear",onOpenChange:t=>!t&&g(null),sites:a("linear"),onDone:(t,r)=>{N(),u({site:t,provider:"linear",hook:r,fresh:!0})}}),e.jsx(ge,{open:d==="jira",onOpenChange:t=>!t&&g(null),sites:a("jira"),onDone:(t,r)=>{N(),u({site:t,provider:"jira",hook:r,fresh:!0})}}),e.jsx(fe,{open:d==="slack",onOpenChange:t=>!t&&g(null),sites:a("slack"),onDone:()=>void N()}),e.jsx(pe,{state:k,onClose:()=>u(null),siteName:t=>w.find(r=>r.site===t)?.siteName??"the site"}),e.jsx(ae,{open:c!==null,onOpenChange:t=>!t&&b(null),title:`Disconnect ${c?.siteName??"this site"} from ${c?D[c.provider]:"the tracker"}?`,description:c?.provider==="slack"?e.jsx(e.Fragment,{children:"Messages already posted stay in the channel; no new ones are posted and they stop being updated. The token is forgotten."}):e.jsx(e.Fragment,{children:"Issues already made keep their links; no new ones are made and status stops mirroring. The token is forgotten."}),confirmLabel:"Disconnect",busy:y.isPending,onConfirm:async()=>{c&&await y.mutateAsync({uid:c.site,provider:c.provider})}})]})}function ue({open:o,onOpenChange:l,sites:f,onDone:j}){const[A,N]=i.useState(""),[d,g]=i.useState(""),[c,b]=i.useState(""),[k,u]=i.useState(""),[v,C]=i.useState(!1),[y,w]=i.useState(""),m=P({mutationFn:s=>F.connectTracker(s,"github",{repository:d.trim(),token:c.trim(),labels:k,createOn:v?"thread.created":"manual"})}),p=A||f[0]?.uid||"",a=async s=>{s.preventDefault(),w("");try{const t=await m.mutateAsync(p);g(""),b(""),u(""),C(!1),l(!1),j(p,t.webhook&&"secret"in t.webhook?t.webhook:void 0),T.success("GitHub connected")}catch(t){w(t instanceof G?t.message:"Could not reach the server.")}};return e.jsx(E,{open:o,onOpenChange:l,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:s=>void a(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(W,{children:"Connect a site to GitHub"}),e.jsxs(J,{children:["A fine-grained personal access token with ",e.jsx("b",{children:"Issues: read and write"})," on that one repository. It is checked against the repository before it is saved, and stored encrypted with this instance's secret key."]})]}),y&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:y}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"gh-site",children:"Site"}),e.jsx("select",{id:"gh-site",value:p,onChange:s=>N(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:f.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"gh-repo",children:"Repository"}),e.jsx(I,{id:"gh-repo",placeholder:"kilnwork/site",value:d,onChange:s=>g(s.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"gh-token",children:"Token"}),e.jsx(I,{id:"gh-token",type:"password",placeholder:"github_pat_…",value:c,onChange:s=>b(s.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"gh-labels",children:"Labels"}),e.jsx(I,{id:"gh-labels",placeholder:"review, bug",value:k,onChange:s=>u(s.target.value)}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Applied to every issue this makes. Optional."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:v,onChange:s=>C(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:'Off by default: a reviewer walking a site leaves twenty comments and half are "never mind". Make issues from the brief when you mean it.'})]})]}),e.jsxs(H,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:m.isPending,disabled:!d.trim()||!c.trim()||!p,children:m.isPending?"Checking…":"Connect"})]})]})})})}function pe({state:o,onClose:l,siteName:f}){const j=o&&"secret"in o.hook?o.hook.secret:null;return e.jsx(E,{open:o!==null,onOpenChange:A=>!A&&l(),children:e.jsxs(O,{children:[e.jsxs(R,{children:[e.jsx(W,{children:o?.fresh?"Connected — now the webhook":"Webhook for "+(o?f(o.site):"")}),e.jsx(J,{children:o?.provider==="linear"?"Issues moved in Linear move the comment here. In Linear › Settings › API › Webhooks, create one for the team with this URL and Issue events; then paste its signing secret when connecting or replacing the connection.":o?.provider==="jira"?"Issues moved in Jira move the comment here. In Jira › Settings › System › Webhooks, create one with this URL, the events Issue updated and Issue deleted, and a secret; then paste the same secret when connecting or replacing the connection.":`Issues closed or reopened on GitHub move the comment here. Add a webhook to the repository — Settings › Webhooks › Add webhook — with these values. The secret is shown this once${o?.fresh?"":", and the previous one has stopped working"}.`})]}),o&&e.jsxs("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Payload URL"}),e.jsxs("dd",{className:"m-0 flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1 font-mono text-[12px]",children:o.hook.url}),e.jsx(B,{text:o.hook.url,label:"Copy the payload URL"})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Content type"}),e.jsx("dd",{className:"m-0",children:e.jsx("code",{className:"font-mono text-[12px]",children:"application/json"})}),j&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Secret"}),e.jsxs("dd",{className:"m-0 flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-secret",children:j}),e.jsx(B,{text:j,label:"Copy the secret"})]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Events"}),e.jsx("dd",{className:"m-0",children:o.provider==="linear"?"Issues":o.provider==="jira"?"Issue: updated, deleted":"Let me select individual events → Issues"})]}),e.jsx(H,{children:e.jsx(x,{type:"button",onClick:l,children:"Done"})})]})})}function xe({open:o,onOpenChange:l,sites:f,onDone:j}){const[A,N]=i.useState(""),[d,g]=i.useState(""),[c,b]=i.useState(""),[k,u]=i.useState(""),[v,C]=i.useState(!1),[y,w]=i.useState(""),m=P({mutationFn:s=>F.connectTracker(s,"linear",{team:d.trim(),apiKey:c.trim(),...k.trim()?{webhookSecret:k.trim()}:{},createOn:v?"thread.created":"manual"})}),p=A||f[0]?.uid||"",a=async s=>{s.preventDefault(),w("");try{const t=await m.mutateAsync(p);g(""),b(""),u(""),C(!1),l(!1),j(p,t.webhook??{url:`${location.origin}/api/v1/integrations/linear/inbound`}),T.success("Linear connected")}catch(t){w(t instanceof G?t.message:"Could not reach the server.")}};return e.jsx(E,{open:o,onOpenChange:l,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:s=>void a(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(W,{children:"Connect a site to Linear"}),e.jsx(J,{children:"A personal API key from Linear › Settings › API, belonging to a member of the team. It is checked against the team before it is saved, and stored encrypted with this instance's secret key."})]}),y&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:y}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"ln-site",children:"Site"}),e.jsx("select",{id:"ln-site",value:p,onChange:s=>N(s.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:f.map(s=>e.jsx("option",{value:s.uid,children:s.name},s.uid))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"ln-team",children:"Team key"}),e.jsx(I,{id:"ln-team",placeholder:"ENG",value:d,onChange:s=>g(s.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"The prefix of the team's issues, like the ENG in ENG-123."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"ln-key",children:"API key"}),e.jsx(I,{id:"ln-key",type:"password",placeholder:"lin_api_…",value:c,onChange:s=>b(s.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"ln-secret",children:"Webhook signing secret"}),e.jsx(I,{id:"ln-secret",type:"password",placeholder:"from Linear's webhook, optional",value:k,onChange:s=>u(s.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Lets Linear move comments here when issues move there. The URL to give Linear is shown after connecting."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:v,onChange:s=>C(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Make issues from the brief when you mean it."})]})]}),e.jsxs(H,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:m.isPending,disabled:!d.trim()||!c.trim()||!p,children:m.isPending?"Checking…":"Connect"})]})]})})})}function ge({open:o,onOpenChange:l,sites:f,onDone:j}){const[A,N]=i.useState(""),[d,g]=i.useState(""),[c,b]=i.useState(""),[k,u]=i.useState(""),[v,C]=i.useState(""),[y,w]=i.useState(""),[m,p]=i.useState(!1),[a,s]=i.useState(""),t=P({mutationFn:h=>F.connectTracker(h,"jira",{siteUrl:d.trim(),project:c.trim(),email:k.trim(),apiToken:v.trim(),...y.trim()?{webhookSecret:y.trim()}:{},createOn:m?"thread.created":"manual"})}),r=A||f[0]?.uid||"",L=async h=>{h.preventDefault(),s("");try{const $=await t.mutateAsync(r);b(""),C(""),w(""),p(!1),l(!1),j(r,$.webhook??{url:`${location.origin}/api/v1/integrations/jira/inbound`}),T.success("Jira connected")}catch($){s($ instanceof G?$.message:"Could not reach the server.")}},n=(h,$,Q,Y,X,Z="text",z)=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:`jr-${h}`,children:$}),e.jsx(I,{id:`jr-${h}`,type:Z,placeholder:X,value:Q,onChange:ee=>Y(ee.target.value),autoComplete:"off"}),z&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:z})]});return e.jsx(E,{open:o,onOpenChange:l,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:h=>void L(h),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(W,{children:"Connect a site to Jira"}),e.jsx(J,{children:"An API token from id.atlassian.com › Security, with the email of the account it belongs to. It is checked against the project before it is saved, and stored encrypted with this instance's secret key."})]}),a&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:a}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"jr-site",children:"Site"}),e.jsx("select",{id:"jr-site",value:r,onChange:h=>N(h.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:f.map(h=>e.jsx("option",{value:h.uid,children:h.name},h.uid))})]}),n("url","Jira site",d,g,"https://kilnwork.atlassian.net"),n("project","Project key",c,b,"KAN","text","The prefix of the project's issues, like the KAN in KAN-12."),n("email","Account email",k,u,"you@kilnwork.studio","email"),n("token","API token",v,C,"","password"),n("secret","Webhook secret",y,w,"the secret you typed into Jira's webhook, optional","password","Lets Jira move comments here when issues move there. The URL to give Jira is shown after connecting."),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:m,onChange:h=>p(h.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Make issues from the brief when you mean it."})]})]}),e.jsxs(H,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:t.isPending,disabled:!d.trim()||!c.trim()||!k.trim()||!v.trim()||!r,children:t.isPending?"Checking…":"Connect"})]})]})})})}function fe({open:o,onOpenChange:l,sites:f,onDone:j}){const[A,N]=i.useState(""),[d,g]=i.useState(""),[c,b]=i.useState(""),[k,u]=i.useState(!0),[v,C]=i.useState(""),y=q({queryKey:["integrations","slack","manifest"],queryFn:()=>F.slackManifest(),enabled:o,staleTime:1/0}),w=P({mutationFn:a=>F.connectTracker(a,"slack",{channel:d.trim(),token:c.trim(),createOn:k?"thread.created":"manual"})}),m=A||f[0]?.uid||"",p=async a=>{a.preventDefault(),C("");try{await w.mutateAsync(m),g(""),b(""),u(!0),l(!1),j(m),T.success("Slack connected")}catch(s){C(s instanceof G?s.message:"Could not reach the server.")}};return e.jsx(E,{open:o,onOpenChange:l,children:e.jsx(O,{children:e.jsxs("form",{onSubmit:a=>void p(a),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(W,{children:"Connect a site to Slack"}),e.jsx(J,{children:"Create the app in your workspace from our manifest — one click, the scopes are filled in — install it, and paste its Bot User OAuth Token. The token is checked against the channel before it is saved, and stored encrypted with this instance's secret key."})]}),v&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:v}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"sl-site",children:"Site"}),e.jsx("select",{id:"sl-site",value:m,onChange:a=>N(a.target.value),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px]",children:f.map(a=>e.jsx("option",{value:a.uid,children:a.name},a.uid))})]}),e.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border px-3 py-2 text-[13px]",children:[e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block font-medium",children:"1. Create the app"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Opens api.slack.com with the manifest pasted; then Install to Workspace."})]}),e.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:!y.data,render:e.jsx("a",{href:y.data?.url??"#",target:"_blank",rel:"noreferrer"}),children:"Create app…"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"sl-token",children:"2. Bot User OAuth Token"}),e.jsx(I,{id:"sl-token",type:"password",placeholder:"xoxb-…",value:c,onChange:a=>b(a.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"On the app's OAuth & Permissions page after installing."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"sl-channel",children:"3. Channel"}),e.jsx(I,{id:"sl-channel",placeholder:"#reviews",value:d,onChange:a=>g(a.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"A public channel by name; a private one needs the app invited first, then its name works too."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:k,onChange:a=>u(a.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"A message for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"On by default: a channel is where people are told. Turn it off to post from the brief when you mean it."})]})]}),e.jsxs(H,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:w.isPending,disabled:!d.trim()||!c.trim()||!m,children:w.isPending?"Checking…":"Connect"})]})]})})})}const Re=()=>M(V().user.role,"settings")?e.jsx(me,{}):e.jsx(re,{title:"Integrations",children:e.jsxs("p",{className:"m-0",children:["Connecting a site to GitHub, Linear, Jira or Slack is done by an owner or an admin. Your own agent tokens are on"," ",e.jsx(U,{to:"/you",className:"text-brand hover:underline",children:"You"}),"."]})});export{Re as component};
@@ -1 +0,0 @@
1
- import{j as e,aj as S,r as N,S as $,h as c,B as y,A as _}from"./index-N-I90MR_.js";import{u as b}from"./useQuery-OxQw-0wS.js";import{b as u}from"./InstanceRows-BIZM7ybm.js";import{A as C,P}from"./parts-D5D8UvJZ.js";import{u as f}from"./me-D4xGiOon.js";import{C as R}from"./check-BWPSlb5c.js";import"./useBaseQuery-CN0OIcOk.js";import"./dialog-CcUiqZEq.js";import"./label-BasLSUbe.js";import"./ConfirmDialog-BsHHrPi0.js";import"./labels--UUyt9uB.js";import"./card-BI3eAi_u.js";function Y(){const s=f(),{said:n}=S.useSearch(),a=b(_.setupState()),l=a.data?.billingUrl??null,i=b({queryKey:["plan-state",l],enabled:!!l,queryFn:async()=>{const t=await fetch(`${l.replace(/\/+$/,"")}/state`,{credentials:"include",headers:{accept:"application/json"}});if(!t.ok)throw new Error(String(t.status));return await t.json()}}),r=i.data,[d,w]=N.useState(!1),v=!!r?.plans.some(t=>t.yearly),h=r?.plans.find(t=>t.current);return e.jsxs("div",{className:"flex flex-col gap-8 p-7",children:[e.jsx(P,{title:"Plan & billing",sub:s.org.name}),n&&e.jsx("p",{role:"status",className:"m-0 max-w-[1040px] rounded-md border border-border bg-card px-3 py-2 text-[13px]",children:n}),a.isSuccess&&!l?e.jsx("p",{className:"m-0 text-muted-foreground",children:"This instance has no plans: everything is included."}):i.isError?e.jsx("p",{className:"m-0 text-muted-foreground",children:"The plans could not be loaded. Reload to try again."}):r?e.jsxs("div",{className:"flex max-w-[1040px] flex-col",children:[e.jsxs("section",{"aria-label":"Your plan",className:"grid grid-cols-1 gap-5 rounded-xl border border-border bg-card px-6 py-5 sm:grid-cols-[minmax(0,1fr)_auto]",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"m-0 text-[11.5px] font-medium uppercase tracking-wider text-muted-foreground",children:"Your plan"}),e.jsxs("p",{className:"m-0 mt-1 text-[28px] font-bold leading-tight",children:[r.current?.name??h?.name,e.jsx("span",{className:"ml-2 text-[15px] font-normal text-muted-foreground",children:r.current?.price??h?.price})]}),r.current?.period&&e.jsx("p",{className:"m-0 mt-1 text-[13px] text-ink-soft",children:r.current.period})]}),r.manage&&e.jsx("div",{children:e.jsx(x,{base:l,form:r.manage})}),e.jsx("div",{className:"sm:col-span-2",children:e.jsx(A,{})}),r.current?.warning&&e.jsx("p",{role:"status",className:"m-0 rounded-md bg-warn-soft px-3.5 py-2.5 text-[13px] sm:col-span-2",children:r.current.warning}),r.nudge&&e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-lg bg-brand-soft px-3.5 py-2.5 sm:col-span-2",children:[e.jsx("p",{className:"m-0 min-w-[220px] flex-1 text-[13px]",children:r.nudge.text}),e.jsx(x,{base:l,form:r.nudge.action})]})]}),e.jsxs("div",{className:"mb-4 mt-9 flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h2",{id:"compare",className:"m-0 text-[17px] font-semibold",children:"Compare plans"}),v&&e.jsx("div",{role:"radiogroup","aria-label":"Billing period",className:"inline-flex rounded-full border border-border bg-card p-0.5",children:[!1,!0].map(t=>e.jsx("button",{type:"button",role:"radio","aria-checked":d===t,onClick:()=>w(t),className:c("rounded-full px-3.5 py-1 text-[13px]",d===t?"bg-foreground text-background":"text-ink-soft"),children:t?e.jsxs(e.Fragment,{children:["Yearly ",e.jsx("span",{className:c("font-medium",d?"opacity-80":"text-brand"),children:"2 months free"})]}):"Monthly"},String(t)))})]}),e.jsx("div",{"aria-labelledby":"compare",className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:r.plans.map(t=>{const m=d&&t.yearly?t.yearly:null,g=m?m.actions:t.actions,k=t.relation==="downgrade";return e.jsxs("div",{className:c("relative flex min-w-0 flex-col gap-4 rounded-xl border bg-card p-5",t.recommended?"border-brand shadow-[0_0_0_1px_var(--color-brand),0_10px_30px_rgb(61_97_217/.12)]":"border-border"),children:[(t.current||t.recommended)&&e.jsx("span",{className:c("absolute -top-2.5 left-5 rounded-full px-2.5 py-px text-[11.5px] font-semibold",t.current?"bg-foreground text-background":"bg-brand text-white"),children:t.current?"Your plan":"Recommended"}),e.jsxs("div",{children:[e.jsx("h3",{className:"m-0 text-[16px] font-semibold",children:t.name}),t.pitch&&e.jsx("p",{className:"m-0 mt-0.5 text-[13px] text-muted-foreground",children:t.pitch})]}),e.jsxs("p",{className:"m-0 text-[34px] font-bold leading-none tracking-tight",children:[m?.amount??t.amount??t.price,(m?.unit??t.unit)&&e.jsx("span",{className:"ml-1 text-[13px] font-normal tracking-normal text-muted-foreground",children:m?.unit??t.unit})]}),e.jsx("ul",{className:"m-0 flex flex-1 list-none flex-col gap-2 p-0",children:t.features.map(o=>e.jsxs("li",{className:c("flex gap-2 text-[13.5px]",t.added?.includes(o)&&"font-semibold"),children:[e.jsx(R,{className:"mt-0.5 size-4 shrink-0 text-ok","aria-hidden":!0}),o]},o))}),t.current?e.jsx(y,{type:"button",variant:"outline",disabled:!0,className:"w-full",children:"Current plan"}):k?g.map(o=>e.jsx(M,{base:l,form:o,warning:t.warning??null},o.label)):g.map(o=>e.jsx(x,{base:l,form:{...o,primary:!!t.recommended||o.primary},wide:!0},o.label))]},t.id)})}),e.jsxs("p",{className:"m-0 mt-5 text-center text-[13px] text-muted-foreground",children:[r.footer?e.jsxs("b",{className:"font-semibold text-foreground",children:[r.footer.split(". ")[0],"."]}):r.intro," ",r.footer?.split(". ").slice(1).join(". ")]}),r.notes.length>0&&e.jsx("p",{className:"m-0 mt-1.5 text-center text-[12px] text-muted-foreground",children:r.notes.join(" ")})]}):e.jsx($,{})]})}function M({base:s,form:n,warning:a}){const[l,i]=N.useState(!1);return a&&l?e.jsxs("div",{className:"flex flex-col gap-2 rounded-md bg-warn-soft px-3 py-2.5 text-[12.5px]",children:[e.jsx("p",{className:"m-0",children:a}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(x,{base:s,form:{...n,label:"Downgrade anyway",primary:!1}}),e.jsx("button",{type:"button",className:"text-[13px] text-muted-foreground underline underline-offset-2",onClick:()=>i(!1),children:"Keep my plan"})]})]}):a?e.jsx("button",{type:"button",className:"self-center text-[13px] text-muted-foreground underline underline-offset-[3px]",onClick:()=>i(!0),children:n.label}):e.jsxs("form",{method:"post",action:new URL(n.action,s).toString(),className:"m-0 self-center",children:[Object.entries(n.fields).map(([r,d])=>e.jsx("input",{type:"hidden",name:r,value:d},r)),e.jsx("button",{type:"submit",className:"text-[13px] text-muted-foreground underline underline-offset-[3px]",children:n.label})]})}function x({base:s,form:n,wide:a}){return e.jsxs("form",{method:"post",action:new URL(n.action,s).toString(),className:"m-0",children:[Object.entries(n.fields).map(([l,i])=>e.jsx("input",{type:"hidden",name:l,value:i},l)),e.jsx(y,{type:"submit",variant:n.primary?"default":"outline",className:a?"w-full":void 0,children:n.label})]})}function A(){const{limits:s}=f(),n=[{label:"Sites",text:j(s.projects.used,s.projects.limit,"site","sites"),share:p(s.projects.used,s.projects.limit)},{label:"Members",text:j(s.members.used,s.members.limit,"member","members"),share:p(s.members.used,s.members.limit)},{label:"Screenshots",text:s.screenshots?s.storage.limit===null?`${u(s.storage.used)} used`:`${u(s.storage.used)} of ${u(s.storage.limit)}`:"Not on this plan",share:s.screenshots?p(s.storage.used,s.storage.limit):null}];return e.jsx("dl",{className:"m-0 grid grid-cols-1 gap-5 border-t border-border pt-4 sm:grid-cols-3",children:n.map(a=>e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("dt",{className:"text-[12px] text-muted-foreground",children:a.label}),e.jsx("dd",{className:"m-0 text-[13px]",children:a.text}),a.share!==null&&e.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted","aria-hidden":!0,children:e.jsx("div",{className:c("h-full rounded-full",a.share>=1?"bg-destructive":"bg-brand"),style:{width:`${Math.min(100,Math.round(a.share*100))}%`}})})]},a.label))})}const p=(s,n)=>n===null||n===0?null:s/n,j=(s,n,a,l)=>n===null?`${s} ${s===1?a:l}, unlimited`:`${s} of ${n} ${n===1?a:l}`,Q=()=>f().user.role==="owner"?e.jsx(Y,{}):e.jsx(C,{title:"Plan & billing"});export{Q as component};
@@ -1 +0,0 @@
1
- import{u as r,Q as u}from"./useBaseQuery-CN0OIcOk.js";function a(e,s){return r(e,u)}export{a as u};
@@ -1 +0,0 @@
1
- import{k as n}from"./index-N-I90MR_.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};
@@ -1,11 +0,0 @@
1
- import{c as z,V as E,p as F,d as B,r as l,j as e,G as L,h as k,B as n,s as w,A as x,C as S}from"./index-N-I90MR_.js";import{C as f}from"./card-BI3eAi_u.js";import{L as C,I as q}from"./label-BasLSUbe.js";import{I as P}from"./InstallTag-w7NKoYXb.js";import{C as R}from"./check-BWPSlb5c.js";import{A}from"./arrow-left-BePtugkE.js";import"./copy-DqKLS4Wq.js";/**
2
- * @license lucide-react v1.39.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 T=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],j=z("arrow-right",T);/**
7
- * @license lucide-react v1.39.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 _=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],G=z("party-popper",_),I=["Site","Address","Install"];function J(){const{me:D,site:r}=E.useRouteContext(),b=F(),o=B(),[a,c]=l.useState(0),[d,K]=l.useState(r.name==="First project"?"":r.name),[h,M]=l.useState(""),[i,u]=l.useState(!1),[m,y]=l.useState(!1),[v,p]=l.useState(""),Q=async()=>{u(!0),y(!0),p("");try{await w.deleteSite(r.uid),o.removeQueries({queryKey:["origins",r.uid]}),await o.invalidateQueries({queryKey:x.me().queryKey}),await o.fetchQuery(x.me()),b({to:"/sites",replace:!0})}catch(t){p(t instanceof S?t.message:"Something went wrong. Try again."),u(!1),y(!1)}},N=async(t,s)=>{u(!0),p("");try{await w.editSite(r.uid,t),t.domain&&o.setQueryData(x.origins(r.uid).queryKey,{domain:t.domain,origins:[]}),await o.invalidateQueries({queryKey:x.me().queryKey}),await o.fetchQuery(x.me()),s()}catch(g){p(g instanceof S?g.message:"Could not reach the server.")}finally{u(!1)}};return e.jsx("div",{className:"relative min-h-dvh bg-background",children:e.jsxs(L,{width:600,children:[e.jsxs("div",{className:"absolute right-6 top-5 text-[12.5px] text-muted-foreground",children:["Signed in as ",D.user.email]}),a<3&&e.jsx("ol",{className:"m-0 mb-6 flex list-none items-center gap-3.5 p-0","aria-label":"Steps",children:I.map((t,s)=>e.jsxs("li",{className:"flex items-center gap-2.5 text-[13.5px] font-medium",children:[e.jsx("span",{className:k("flex size-7 items-center justify-center rounded-full border-[1.5px] text-[12.5px]",s<a&&"border-brand bg-brand text-brand-foreground",s===a&&"border-brand text-brand ring-[3px] ring-brand-soft",s>a&&"border-line-strong text-muted-foreground"),"aria-current":s===a?"step":void 0,children:s<a?e.jsx(R,{className:"size-3.5"}):s+1}),e.jsx("span",{className:s===a?"text-foreground":"text-muted-foreground",children:t}),s<I.length-1&&e.jsx("span",{className:k("h-px w-[90px]",s<a?"bg-brand":"bg-border")})]},t))}),v&&e.jsx("p",{role:"alert",className:"m-0 mb-4 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:v}),a===0&&e.jsx(f,{className:"gap-4 p-7",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:t=>{t.preventDefault(),!(!d.trim()||i)&&N({name:d.trim()},()=>c(1))},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:"What is the site called?"}),e.jsx("p",{className:"m-0 mt-2 text-muted-foreground",children:"One client website. You can add more from Sites later."})]}),e.jsxs("fieldset",{disabled:i,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"first-name",children:"Name"}),e.jsx(q,{id:"first-name",placeholder:"Kilnwork",value:d,onChange:t=>K(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(n,{type:"button",variant:"ghost",loading:m,disabled:i&&!m,onClick:()=>void Q(),children:"Skip for now"}),e.jsxs(n,{type:"submit",loading:i&&!m,disabled:!d.trim()||m,children:[i&&!m?"Saving…":"Continue",e.jsx(j,{})]})]})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No site yet? Skip, and add one from Sites when it is ready."})]})}),a===1&&e.jsx(f,{className:"gap-4 p-7",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:t=>{t.preventDefault(),!(!h.trim()||i)&&N({domain:h.trim()},()=>c(2))},children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:["Where does ",d||r.name," live?"]}),e.jsx("p",{className:"m-0 mt-2 text-muted-foreground",children:"Its domain. Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in the site's settings."})]}),e.jsxs("fieldset",{disabled:i,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"first-domain",children:"Domain"}),e.jsx(q,{id:"first-domain",placeholder:"kilnwork.studio",value:h,onChange:t=>M(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs(n,{type:"button",variant:"ghost",onClick:()=>c(0),children:[e.jsx(A,{}),"Back"]}),e.jsx("div",{className:"flex-1"}),e.jsxs(n,{type:"submit",loading:i,disabled:!h.trim(),children:[i?"Saving…":"Continue",e.jsx(j,{})]})]})]})]})}),a===2&&e.jsxs(f,{className:"gap-4 p-7",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:"Install the widget"}),e.jsxs("p",{className:"m-0 mt-2 text-muted-foreground",children:["Paste this before ",e.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed, and deploy."]})]}),e.jsx(P,{uid:r.uid}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs(n,{type:"button",variant:"ghost",onClick:()=>c(1),children:[e.jsx(A,{}),"Back"]}),e.jsx("div",{className:"flex-1"}),e.jsxs(n,{type:"button",onClick:()=>c(3),children:["Done",e.jsx(j,{})]})]})]}),a===3&&e.jsxs(f,{className:"items-center gap-4 p-8 text-center",children:[e.jsx("span",{className:"flex size-11 items-center justify-center rounded-[10px] bg-brand-soft text-brand",children:e.jsx(G,{className:"size-5"})}),e.jsxs("h1",{className:"m-0 text-[21px] font-semibold leading-tight tracking-tight",children:[d||r.name," is set up"]}),e.jsx("p",{className:"m-0 text-muted-foreground",children:"Three things left, in this order."}),e.jsx("ol",{className:"m-0 flex w-full list-none flex-col gap-2 p-0 text-left",children:[["Deploy the site with the tag on every page","Comments start arriving here the moment a page loads it."],["Add a reviewer and send them their link","Your client gets their own link; you can revoke it without touching the site."],["Start the first round","A round is one pass of feedback. Starting the next one closes the last."]].map(([t,s],g)=>e.jsxs("li",{className:"flex gap-3 rounded-md border border-border px-3 py-2.5",children:[e.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full border border-line-strong text-[11px] text-muted-foreground",children:g+1}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:t}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s})]})]},t))}),e.jsxs(n,{size:"lg",className:"mt-2 w-full",onClick:()=>void b({to:"/s/$site/comments",params:{site:r.uid},replace:!0}),children:["Go to Comments",e.jsx(j,{})]})]})]})})}export{J as component};
@@ -1 +0,0 @@
1
- import{r,x as b,j as e,h as y,y as N,B as j,q as f,a2 as S}from"./index-N-I90MR_.js";import{L as c,I as d}from"./label-BasLSUbe.js";import{P as C,a as h}from"./parts-D5D8UvJZ.js";import{S as P}from"./SaveState-Cd1Ay9eR.js";import{M as A}from"./McpTokens-BAlNfNd7.js";import{u as k}from"./me-D4xGiOon.js";import{u as M,a as F}from"./studio-CpQminn4.js";import{M as E,S as T,a as D}from"./sun-BBapmFM7.js";import"./card-BI3eAi_u.js";import"./labels--UUyt9uB.js";import"./useQuery-OxQw-0wS.js";import"./useBaseQuery-CN0OIcOk.js";import"./badge-VIGkRs4v.js";import"./useRender-B_SZ1tbi.js";import"./dialog-CcUiqZEq.js";import"./switch-Bsz6KmWY.js";import"./useAriaLabelledBy-G2WKNZQz.js";import"./useValueChanged-CtiAjxsm.js";import"./ConfirmDialog-BsHHrPi0.js";import"./CopyButton-Drniwbyh.js";import"./check-BWPSlb5c.js";import"./copy-DqKLS4Wq.js";function z({items:t}){const[a,n]=r.useState(b);return e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":"Theme",children:t.map(s=>e.jsxs("button",{type:"button",role:"radio","aria-checked":a===s.value,onClick:()=>{N(s.value),n(s.value)},className:y("inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",a===s.value&&"border-line-strong bg-muted text-foreground"),children:[s.icon,s.label]},s.value))})}function re(){const t=k(),a=M(),[n,s]=r.useState(t.user.name),[u,i]=r.useState(null);r.useEffect(()=>s(t.user.name),[t.user.name]);const m=n.trim()!==t.user.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(C,{title:"You",sub:"Your own account on this studio",actions:e.jsx(P,{saving:a.isPending,savedAt:u})}),e.jsxs(h,{title:"Profile",description:"How you appear on replies and in the members list.",children:[e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:l=>{l.preventDefault(),m&&a.mutate(n.trim(),{onSuccess:()=>i(Date.now())})},children:[e.jsx(c,{htmlFor:"your-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{id:"your-name",value:n,onChange:l=>s(l.target.value)}),m&&e.jsx(j,{type:"submit",variant:"outline",children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"your-email",children:"Email"}),e.jsx(d,{id:"your-email",value:t.user.email,readOnly:!0,className:"bg-muted text-ink-soft"}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["How you sign in, and how the server finds you. An owner changes it with"," ",e.jsx("code",{className:"font-mono",children:"snagset passwd"}),"."]})]})]}),e.jsx(h,{title:"Password",description:"Changing it keeps this session and ends every other one.",children:e.jsx(H,{})}),!f(t.user.role,"settings")&&f(t.user.role,"review")&&e.jsx(A,{owner:!0,mine:!0,instanceOwner:!1,sites:t.projects}),e.jsx(h,{title:"Appearance",description:"Also in your menu at the bottom of the sidebar.",children:e.jsx(z,{items:[{value:"system",label:"System",icon:e.jsx(E,{className:"size-3.5"})},{value:"light",label:"Light",icon:e.jsx(T,{className:"size-3.5"})},{value:"dark",label:"Dark",icon:e.jsx(D,{className:"size-3.5"})}]})})]})}function H(){const t=F(),[a,n]=r.useState(""),[s,u]=r.useState(""),[i,m]=r.useState(""),[l,g]=r.useState(""),[v,p]=r.useState(!1),x=a.length>0&&s.length>=12&&s===i;return e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:async o=>{if(o.preventDefault(),!(!x||t.isPending)){g("");try{await t.mutateAsync({current:a,next:s}),n(""),u(""),m(""),p(!0)}catch(w){g(S(w))}}},children:[l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-current",children:"Current password"}),e.jsx(d,{id:"pw-current",type:"password",autoComplete:"current-password",value:a,onChange:o=>{n(o.target.value),p(!1)}})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-next",children:"New password"}),e.jsx(d,{id:"pw-next",type:"password",autoComplete:"new-password",value:s,onChange:o=>{u(o.target.value),p(!1)}}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. No composition rules — length is what matters."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(c,{htmlFor:"pw-again",children:"Confirm new password"}),e.jsx(d,{id:"pw-again",type:"password",autoComplete:"new-password",value:i,onChange:o=>{m(o.target.value),p(!1)}}),i.length>0&&s!==i&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Those do not match yet."})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(j,{type:"submit",loading:t.isPending,disabled:!x,children:t.isPending?"Changing…":v&&!x?"Changed":"Change password"})})]})}export{re as component};