@snagset/server 0.1.60 → 0.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-Cbbgho1I.js → CompositeItem-CkiEeVQd.js} +1 -1
- package/static/dashboard/assets/{CompositeList-U-qk8UP6.js → CompositeList-OHWH8W1h.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-_B1eNA1i.js → ConfirmDialog-Db4AvUN5.js} +1 -1
- package/static/dashboard/assets/{CopyButton-CIoiqDbz.js → CopyButton-r38fWUwx.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-DrmapX6T.js → FieldItemContext-qjC5pLGs.js} +1 -1
- package/static/dashboard/assets/{InstallTag-C4m3dgQN.js → InstallTag-DYeR38Ex.js} +1 -1
- package/static/dashboard/assets/{InstanceRows-Cu43MthB.js → InstanceRows-DnLIQuI5.js} +1 -1
- package/static/dashboard/assets/{McpTokens-y9bU9w2F.js → McpTokens-BmJUgHlN.js} +1 -1
- package/static/dashboard/assets/{Picker-0Wc1iFQj.js → Picker-95_pkfVu.js} +1 -1
- package/static/dashboard/assets/{SaveState-B4LwnOrc.js → SaveState-DmbisglJ.js} +1 -1
- package/static/dashboard/assets/{_app-DL2c5AyL.js → _app-BB6wQ2Q0.js} +1 -1
- package/static/dashboard/assets/{_app-CQSx4Ud0.js → _app-BjmAfJVc.js} +1 -1
- package/static/dashboard/assets/{activity-CkDNq67c.js → activity-DNpom_Jb.js} +1 -1
- package/static/dashboard/assets/{arrow-left-kr0TdNCI.js → arrow-left-Bw5uUs0F.js} +1 -1
- package/static/dashboard/assets/{avatar-DQ2PBAkd.js → avatar-C6Rr20S0.js} +1 -1
- package/static/dashboard/assets/{badge-5vfpTOMk.js → badge-CicACH6l.js} +1 -1
- package/static/dashboard/assets/{card-DEnJVYTc.js → card-CzVTF25b.js} +1 -1
- package/static/dashboard/assets/{check-BhmdAbBD.js → check-BlRwZrSR.js} +1 -1
- package/static/dashboard/assets/{chevron-down-CkYqA6Tw.js → chevron-down-865lxBex.js} +1 -1
- package/static/dashboard/assets/{chevron-right-BSOkA3zX.js → chevron-right-2YkP20tJ.js} +1 -1
- package/static/dashboard/assets/{copy-DefIRiwo.js → copy-DSJQda7h.js} +1 -1
- package/static/dashboard/assets/{createBaseUIEventDetails-BDbAfTsh.js → createBaseUIEventDetails-CTYgZt5m.js} +1 -1
- package/static/dashboard/assets/{dialog-Dsu0e02Q.js → dialog-DZbUuBSr.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-BMaIF-mT.js → dropdown-menu-By49qibi.js} +1 -1
- package/static/dashboard/assets/{forgot-BuErlHeu.js → forgot-C-nxI2th.js} +1 -1
- package/static/dashboard/assets/{getPseudoElementBounds-Df0qQn0E.js → getPseudoElementBounds-CFaDUKhY.js} +1 -1
- package/static/dashboard/assets/{image-off-_kTeT3Bb.js → image-off-u_JoVfOy.js} +1 -1
- package/static/dashboard/assets/{index-B_3U6pyz.js → index-X11XkRkb.js} +3 -3
- package/static/dashboard/assets/{inertValue-Dl2ZzbZu.js → inertValue-CLaAaX62.js} +1 -1
- package/static/dashboard/assets/{invite-DpmMNgTf.js → invite-Dn8Q_z-a.js} +1 -1
- package/static/dashboard/assets/{label-BPkAzYEe.js → label-8lYoT07T.js} +1 -1
- package/static/dashboard/assets/{layout-grid-CbZa6REW.js → layout-grid-C-a8O8B6.js} +1 -1
- package/static/dashboard/assets/me-DnLqgT3l.js +1 -0
- package/static/dashboard/assets/{parts-BZnB0y34.js → parts-DVVBI72d.js} +1 -1
- package/static/dashboard/assets/{plus-CopH4JTI.js → plus-CS6tYH0S.js} +1 -1
- package/static/dashboard/assets/{reset-CYrrEwsu.js → reset-Cga9iuj2.js} +1 -1
- package/static/dashboard/assets/{s._site-j6OX54re.js → s._site-SxnfgkOI.js} +1 -1
- package/static/dashboard/assets/{s._site.comments-Cgn2xgc5.js → s._site.comments-B9MVihwE.js} +1 -1
- package/static/dashboard/assets/{s._site.reviewers-B_TpRGpR.js → s._site.reviewers-BavfDGJ3.js} +1 -1
- package/static/dashboard/assets/{s._site.settings-CfenEkX3.js → s._site.settings-CSqVsJgO.js} +1 -1
- package/static/dashboard/assets/{setup-CXMNChwN.js → setup-Duptw7Cj.js} +1 -1
- package/static/dashboard/assets/{sign-in-Cw4pIFDX.js → sign-in-zTZ603o2.js} +1 -1
- package/static/dashboard/assets/{sign-up-CumNkOCM.js → sign-up-CmHICQCh.js} +1 -1
- package/static/dashboard/assets/{sites-dYYYlsEx.js → sites-Ba4z7pZr.js} +1 -1
- package/static/dashboard/assets/studio-BJqd3NIo.js +1 -0
- package/static/dashboard/assets/{studio-C-cl-Bid.js → studio-pFbLfSmh.js} +1 -1
- package/static/dashboard/assets/{studio.index-Bpv89ttE.js → studio.index-C3Q-z9vR.js} +1 -1
- package/static/dashboard/assets/studio.integrations-DNCgc9H5.js +16 -0
- package/static/dashboard/assets/{studio.members-Bmyx_q-i.js → studio.members-BmKyP0gU.js} +1 -1
- package/static/dashboard/assets/{studio.plan-Chh-cjMh.js → studio.plan-CrdqMbik.js} +1 -1
- package/static/dashboard/assets/{sun-xwDuvNCi.js → sun-CK52_1CD.js} +1 -1
- package/static/dashboard/assets/{switch-9hlceDWy.js → switch-CHmJ_Ipt.js} +1 -1
- package/static/dashboard/assets/{table-BtGHQI2k.js → table-DoCG5L_o.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-x5XF8M1H.js → useAriaLabelledBy-DcwFG0Pf.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-BWQygP2V.js → useBaseQuery-C_54ul4D.js} +1 -1
- package/static/dashboard/assets/{useCompositeItem-uwStRlwJ.js → useCompositeItem-6LQEohxr.js} +1 -1
- package/static/dashboard/assets/useQuery-CCJBm2EJ.js +1 -0
- package/static/dashboard/assets/useRender-BZe0PUs7.js +1 -0
- package/static/dashboard/assets/{useScrollLock-Bxg3WK_6.js → useScrollLock-DDlrhOw8.js} +1 -1
- package/static/dashboard/assets/{useValueChanged-B2j76Odc.js → useValueChanged-BuDWW6rb.js} +1 -1
- package/static/dashboard/assets/{users-CkVdOVuU.js → users-BkLZaCQc.js} +1 -1
- package/static/dashboard/assets/{welcome-CSLvCL-G.js → welcome-C-lgK9ve.js} +1 -1
- package/static/dashboard/assets/{widget-signin-D2hoyT51.js → widget-signin-DiXUP4GV.js} +1 -1
- package/static/dashboard/assets/{you-CzmFaW7t.js → you-BHn-aWRM.js} +1 -1
- package/static/dashboard/assets/{zod-BqdlirRI.js → zod-D1EnJi4o.js} +1 -1
- package/static/dashboard/index.html +1 -1
- package/static/widget/build.json +2 -2
- package/static/widget/snag.js +1 -1
- package/static/widget/snag.runtime.js +1 -1
- package/static/dashboard/assets/me-Ffh61LTY.js +0 -1
- package/static/dashboard/assets/studio-BFe4RbS0.js +0 -1
- package/static/dashboard/assets/studio.integrations-CEERZTjS.js +0 -16
- package/static/dashboard/assets/useQuery-HUEWFxW8.js +0 -1
- package/static/dashboard/assets/useRender-BMKPZM38.js +0 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as u,aG as t,k as c}from"./index-
|
|
1
|
+
import{E as u,aG as t,k as c}from"./index-X11XkRkb.js";import{u as E}from"./useCompositeItem-6LQEohxr.js";function M(e){const{render:d,className:l,style:C,state:s=u,props:o=t,refs:r=t,metadata:a,stateAttributesMapping:m,tag:p="div",...i}=e,{compositeProps:n,compositeRef:f}=E({metadata:a});return c(p,e,{state:s,ref:[f,...r],props:[n,...o,i],stateAttributesMapping:m})}export{M as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,e as L,f as g,ai as S,j}from"./index-
|
|
1
|
+
import{r as c,e as L,f as g,ai as S,j}from"./index-X11XkRkb.js";const k=c.createContext(void 0);function F(){return c.useContext(k)?.direction??"ltr"}const y=c.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function T(){return c.useContext(y)}function G(u={}){const{guess:o,label:e,metadata:s,textRef:p,index:t}=u,{register:i,unregister:a,subscribeMapChange:m,nextIndexRef:R}=T(),f=c.useRef(-1),[v,b]=c.useState(t==null&&o?()=>{if(f.current===-1){const l=R.current;R.current+=1,f.current=l}return f.current}:-1),I=t??v,h=c.useRef(null),E=c.useCallback(l=>{const C=h.current;C&&a(C),h.current=l,l&&i(l,{metadata:s??null,index:t??null,label:e,textRef:p})},[t,i,a,s,e,p]);return L(()=>{if(t==null)return m(l=>{const C=h.current?l.get(h.current)?.index:null;C!=null&&b(C)})},[t,m]),{ref:E,index:I}}function V(u){const{children:o,elementsRef:e,labelsRef:s,onMapChange:p}=u,t=g(p),[,i]=c.useState(!1),a=S(U).current,m=S(A).current,R=c.useRef(0),f=c.useRef(!0),v=c.useRef([]),b=c.useRef(null),I=g(()=>{f.current||(f.current=!0,i(n=>!n))}),h=g((n,d)=>{m.set(n,d),I()}),E=g(n=>{m.delete(n),I()}),l=g(n=>{const d=new Map;return e.current.length=0,s&&(s.current.length=0),n.forEach(r=>{d.set(r.element,{...r.registration.metadata??{},index:r.index}),e.current[r.index]=r.element,s&&(s.current[r.index]=r.registration.label!==void 0?r.registration.label:r.registration.textRef?.current?.textContent??r.element.textContent)}),R.current=e.current.length,d});function C(n){if(b.current?.disconnect(),b.current=null,typeof MutationObserver!="function"||n.length<2)return;const d=new MutationObserver(x=>{if(!z(x))return;let M=null;for(const w of n)if(w.isConnected){if(M&&D(M,w)>0){d.disconnect(),I();return}M=w}});b.current=d;const r=new Set;for(let x=1;x<n.length;x+=1){const M=_(n[x-1],n[x]);M&&r.add(M)}r.forEach(x=>d.observe(x,{childList:!0}))}const N=g(()=>{const[n,d]=W(m),r=l(n);C(d),v.current=n,f.current=!1,a.forEach(x=>x(r)),t(r)});L(()=>(f.current||l(v.current),()=>{e.current=[],s&&(s.current=[])}),[e,s,l]),L(()=>{f.current&&N()}),L(()=>()=>{b.current?.disconnect(),f.current=!0},[]);const O=g(n=>(a.add(n),()=>{a.delete(n)})),P=c.useMemo(()=>({register:h,unregister:E,subscribeMapChange:O,nextIndexRef:R}),[h,E,O,R]);return j.jsx(y.Provider,{value:P,children:o})}function A(){return new Map}function U(){return new Set}function W(u){const o=new Set,e=[],s=[];u.forEach((t,i)=>{if(!i.isConnected)return;const a=t.index,m={index:a??-1,element:i,registration:t};a===null?s.push(m):a>=0&&(o.add(a),e.push(m))});let p=0;return s.sort((t,i)=>D(t.element,i.element)),s.forEach(t=>{for(;o.has(p);)p+=1;t.index=p,e.push(t),p+=1}),o.size>0&&e.sort((t,i)=>t.index-i.index),[e,s.map(t=>t.element)]}function _(u,o){let e=u.parentElement;for(;e&&!e.contains(o);)e=e.parentElement;return e}function z(u){for(const o of u)for(let e=0;e<o.removedNodes.length;e+=1)if(o.removedNodes[e].isConnected)return!0;return!1}function D(u,o){return u.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}export{V as C,F as a,G as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e,B as u}from"./index-
|
|
1
|
+
import{r as i,j as e,B as u}from"./index-X11XkRkb.js";import{i as C,j as v,l as b,k as D,m as y,n as N}from"./dialog-DZbUuBSr.js";import{I as k}from"./label-8lYoT07T.js";import{C as T}from"./check-BlRwZrSR.js";import{C as B}from"./copy-DSJQda7h.js";function F({open:l,onOpenChange:o,title:x,description:n,children:g,confirmLabel:h,confirmWord:s,busy:t=!1,onConfirm:j}){const[r,c]=i.useState(""),[d,m]=i.useState(!1),f=i.useId();i.useEffect(()=>{l&&c("")},[l]);const p=!s||r.trim()===s;return e.jsx(C,{open:l,onOpenChange:a=>{!a&&t||o(a)},children:e.jsx(v,{showCloseButton:!1,children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),p&&!t&&j()},children:[e.jsxs(b,{children:[e.jsx(D,{children:x}),n&&e.jsx(y,{children:n})]}),g,s&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("p",{className:"m-0 flex flex-wrap items-center gap-1 text-sm font-medium",children:["Type",e.jsxs("button",{type:"button",disabled:t,title:"Copy the name",className:"inline-flex items-center gap-1 rounded-sm bg-muted px-1.5 py-0.5 font-semibold text-foreground hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring",onClick:()=>{navigator.clipboard?.writeText(s).catch(()=>{}),m(!0),setTimeout(()=>m(!1),1500),document.getElementById(f)?.focus()},children:[s,d?e.jsx(T,{className:"size-3.5 text-muted-foreground"}):e.jsx(B,{className:"size-3.5 text-muted-foreground"}),e.jsx("span",{className:"sr-only",children:d?" copied":" — copy"})]}),"to confirm"]}),e.jsx(k,{id:f,"aria-label":`Type ${s} to confirm`,value:r,autoComplete:"off",spellCheck:!1,disabled:t,onChange:a=>c(a.target.value)})]}),e.jsxs(N,{children:[e.jsx(u,{type:"button",variant:"outline",disabled:t,onClick:()=>o(!1),children:"Cancel"}),e.jsx(u,{type:"submit",variant:"destructive",loading:t,disabled:!p,children:t?"Working…":h})]})]})})})}export{F as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as t,B as c}from"./index-
|
|
1
|
+
import{r as n,j as t,B as c}from"./index-X11XkRkb.js";import{C}from"./check-BlRwZrSR.js";import{C as m}from"./copy-DSJQda7h.js";function l({text:r,label:e="Copy",withText:s=!1,size:a="icon-sm",className:p}){const[o,i]=n.useState(!1);return t.jsxs(c,{type:"button",variant:"outline",size:s?"sm":a,className:p,"aria-label":o?"Copied":e,onClick:()=>{navigator.clipboard?.writeText(r).catch(()=>{}),i(!0),setTimeout(()=>i(!1),1500)},children:[o?t.jsx(C,{}):t.jsx(m,{}),s&&(o?"Copied":e)]})}export{l as C};
|
package/static/dashboard/assets/{FieldItemContext-DrmapX6T.js → FieldItemContext-qjC5pLGs.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t}from"./index-
|
|
1
|
+
import{r as t}from"./index-X11XkRkb.js";const e=t.createContext({disabled:!1});function r(){return t.useContext(e)}export{r as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,i as je,e as Z,f as _,k as oe,j as n,aJ as Ne,aj as Le,al as Oe,aG as ue,E as Ve,b4 as ze,h as re,o as He,B as Ke,b5 as Be}from"./index-B_3U6pyz.js";import{k as _e,c as Pe,C as pe,D as ge,d as Fe,u as we,m as $e,o as be,a as We,n as Ye,g as he}from"./createBaseUIEventDetails-BDbAfTsh.js";import{C as ke,u as Je,a as Ue}from"./CompositeList-U-qk8UP6.js";import{i as Ge}from"./isElementDisabled-CwHw_lZC.js";import{a as qe,u as Qe,t as Xe,i as Ze,s as me,k as ve,h as le,e as ce,H as xe,E as Re,C as et,l as Ce,g as tt,f as nt,A as ye,m as Ie,n as Ee,o as Te,M as at}from"./inertValue-Dl2ZzbZu.js";import{u as st}from"./useCompositeItem-uwStRlwJ.js";import{C as ot}from"./check-BhmdAbBD.js";import{C as rt}from"./copy-DefIRiwo.js";const Se=a.createContext(void 0);function fe(){const t=a.useContext(Se);if(t===void 0)throw new Error(je(64));return t}const ie={tabActivationDirection:t=>({"data-activation-direction":t})},it=a.forwardRef(function(o,r){const{className:C,defaultValue:i=0,onValueChange:j,orientation:u="horizontal",render:A,value:E,style:P,...w}=o,m=o.defaultValue!==void 0,O=a.useRef([]),[D,x]=a.useState(()=>new Map),[l,R]=_e({controlled:E,default:i,name:"Tabs",state:"value"}),y=E!==void 0,[s,T]=a.useState(()=>new Map),f=a.useRef(void 0),g=a.useCallback(p=>de(s,p),[s]),[V,L]=a.useState(()=>({previousValue:l,tabActivationDirection:"none"})),{previousValue:c,tabActivationDirection:I}=V;let e=I,d=!1;c!==l&&(e=Me(c,l,u,s),d=c!=null&&l!=null&&g(l)==null);const b=d?c:l,k=c!==b||I!==e;Z(()=>{k&&L({previousValue:b,tabActivationDirection:e})},[b,k,e]);const S=_((p,M)=>{const W=Me(l,p,u,s);M.activationDirection=W,j?.(p,M),!M.isCanceled&&R(p)}),H=_((p,M)=>{j?.(p,Pe(M,void 0,void 0,{activationDirection:"none"}))}),F=_((p,M)=>(x(W=>{const q=new Map(W);return q.set(p,M),q}),()=>{x(W=>{if(W.get(p)!==M)return W;const q=new Map(W);return q.delete(p),q})})),J=a.useCallback(p=>D.get(p),[D]),N=a.useCallback(p=>{for(const M of s.values())if(p===M.value)return M.id},[s]),h=a.useMemo(()=>({getTabElementBySelectedValue:g,getTabIdByPanelValue:N,getTabPanelIdByValue:J,onValueChange:S,orientation:u,registerMountedTabPanel:F,setTabMap:T,tabActivationDirection:e,value:l}),[g,N,J,S,u,F,T,e,l]),z=a.useMemo(()=>{for(const p of s.values())if(p.value===l)return p},[s,l]),$=a.useMemo(()=>{for(const p of s.values())if(!p.disabled)return p.value},[s]),K=a.useRef(!m),U=a.useRef(i),G=a.useRef(m),v=a.useRef(!1);Z(()=>{if(y)return;function p(X,ee){R(X),L({previousValue:X,tabActivationDirection:"none"}),H(X,ee),K.current=!1}if(s.size===0){v.current&&l!==null&&!f.current?.isConnected&&p(null,ge);return}v.current=!0,f.current=s.keys().next().value;const M=z?.disabled,W=z==null&&l!==null;if(!M&&l===U.current&&(G.current=!1),G.current&&M&&l===U.current)return;const q=K.current;if(M||W){const X=$??null;if(l===X){K.current=!1;return}let ee=ge;q?ee=pe:M&&(ee=Fe),p(X,ee);return}q&&z!=null&&(H(l,pe),K.current=!1)},[$,y,H,z,R,s,l]);const Q=oe("div",o,{state:{orientation:u,tabActivationDirection:e},ref:r,props:w,stateAttributesMapping:ie});return n.jsx(Se.Provider,{value:h,children:n.jsx(ke,{elementsRef:O,children:Q})})});function de(t,o){for(const[r,C]of t.entries())if(o===C.value)return r;return null}function Me(t,o,r,C){if(t==null||o==null)return"none";const[i,j,u]=r==="horizontal"?["left","left","right"]:["top","up","down"],A=de(C,t),E=de(C,o);if(A==null||E==null)return A!==E&&(typeof t=="number"||typeof t=="string")&&typeof t==typeof o?o>t?u:j:"none";const P=A.getBoundingClientRect()[i],w=E.getBoundingClientRect()[i];return w<P?j:w>P?u:"none"}const Ae="data-composite-item-active",De=a.createContext(void 0);function lt(){const t=a.useContext(De);if(t===void 0)throw new Error(je(65));return t}const ct=a.forwardRef(function(o,r){const{className:C,disabled:i=!1,render:j,value:u,id:A,nativeButton:E=!0,style:P,...w}=o,{value:m,getTabPanelIdByValue:O,onValueChange:D,orientation:x,tabActivationDirection:l}=fe(),{activateOnFocus:R,registerTabResizeObserverElement:y,tabsListElement:s}=lt(),{highlightedIndex:T,onHighlightedIndexChange:f}=Ne(),g=we(A),V=a.useMemo(()=>({disabled:i,id:g,value:u}),[i,g,u]),{compositeProps:L,compositeRef:c,index:I}=st({metadata:V}),e=u===m,d=a.useRef(!1),b=a.useRef(null),k=_(v=>{b.current?.(),b.current=v?y(v):null});Z(()=>{if(d.current){d.current=!1;return}if(!(e&&I>-1&&T!==I))return;const v=s;if(v!=null){const B=$e(be(v));if(B&&We(v,B))return}i||f(I)},[e,I,T,f,i,s]);const{getButtonProps:S,buttonRef:H}=Le({disabled:i,native:E,focusableWhenDisabled:!0}),F=O(u),J=a.useRef(!1),N=a.useRef(!1);function h(v){D(u,Pe(Ye,v.nativeEvent,void 0,{activationDirection:"none"}))}function z(v){e||i||h(v)}function $(v){e||i||R&&(!J.current||N.current)&&h(v)}function K(v){if(e||i)return;J.current=!0,N.current=v.button===0;const B=be(v.currentTarget);function Q(){J.current=!1,N.current=!1,B.removeEventListener("pointerup",Q),B.removeEventListener("pointercancel",Q)}B.addEventListener("pointerup",Q),B.addEventListener("pointercancel",Q)}return oe("button",o,{state:{disabled:i,active:e,orientation:x,tabActivationDirection:l},ref:[r,H,c,k],props:[L,{role:"tab","aria-controls":F,"aria-selected":e,id:g,onClick:z,onFocus:$,onPointerDown:K,[Ae]:e?"":void 0,onKeyDownCapture(){d.current=!0}},w,S],stateAttributesMapping:ie})}),ut={...ie,...Xe},dt=a.forwardRef(function(o,r){const{className:C,value:i,render:j,keepMounted:u=!1,style:A,...E}=o,{value:P,getTabIdByPanelValue:w,orientation:m,tabActivationDirection:O,registerMountedTabPanel:D}=fe(),x=we(),{ref:l,index:R}=Je(),y=i===P,{mounted:s,transitionStatus:T,setMounted:f}=qe(y),g=!s,V=w(i),L={hidden:g,orientation:m,tabActivationDirection:O,transitionStatus:T},c=a.useRef(null),I=oe("div",o,{state:L,ref:[r,l,c],props:[{"aria-labelledby":V,hidden:g,id:x,role:"tabpanel",tabIndex:y?0:-1,inert:Ze(!y),"data-index":R},E],stateAttributesMapping:ut});return Qe({open:y,ref:c,onComplete(){y||f(!1)}}),Z(()=>{if(!(x==null||g&&!u))return D(i,x)},[g,u,i,x,D]),u||s?I:null}),ft=[];function pt(t){const{loopFocus:o=!0,orientation:r="both",grid:C,onLoop:i,direction:j,highlightedIndex:u,onHighlightedIndexChange:A,rootRef:E,enableHomeAndEndKeys:P=!1,stopEventPropagation:w,disabledIndices:m,modifierKeys:O=ft}=t,[D,x]=a.useState(0),l=C!=null,R=a.useRef(null),y=Oe(R,E),s=a.useRef([]),T=a.useRef(!1),f=u??D,g=_((e,d=!1)=>{if((A??x)(e),d){const b=s.current[e];me(R.current,b,j,r)}}),V=_(e=>{if(e.size===0||T.current)return;T.current=!0;const d=Array.from(e.keys()),b=d.find(S=>S?.hasAttribute(Ae))??null,k=b?e.get(b)?.index??-1:-1;if(k!==-1)g(k);else if(ve(d,f,m)){const S=le(d,{disabledIndices:m});ce(d,S)||g(S)}me(R.current,b,j,r)});Z(()=>{if(m==null||u!=null||!T.current)return;const e=s.current;if(ve(e,f,m)){const d=le(e,{disabledIndices:m});ce(e,d)||g(d)}},[m,u,f,s,g]);const L=_((e,d,b)=>i?i(e,d,b,s):b),c=_(e=>{const d=e.key===xe||e.key===Re;if(!et.has(e.key)||!P&&d||gt(e,O)||!R.current)return;const k=j==="rtl",S=k?Ee:Te,H=k?Te:Ee,F=r==="vertical"?ye:S,J=r==="vertical"?Ie:H,N=he(e.nativeEvent);if(N!=null&&Ce(N)&&!Ge(N)){const G=N.selectionStart,v=N.selectionEnd,B=N.value;if(G==null||e.shiftKey||G!==v||e.key!==J&&G<B.length||e.key!==F&&G>0)return}let h=f;const z=tt(s,m),$=nt(s,m);C!=null&&(h=C({disabledIndices:m,elementsRef:s,event:e,highlightedIndex:f,loopFocus:o,maxIndex:$,minIndex:z,onLoop:L,orientation:r,rtl:k}));const K=r!=="vertical"&&e.key===S||r!=="horizontal"&&e.key===ye,U=r!=="vertical"&&e.key===H||r!=="horizontal"&&e.key===Ie;P&&(e.key===xe?h=z:e.key===Re&&(h=$)),h===f&&(K||U)&&(o&&h===$&&K?(h=z,i&&(h=i(e,f,h,s))):o&&h===z&&U?(h=$,i&&(h=i(e,f,h,s))):h=le(s.current,{startingIndex:h,decrement:U,disabledIndices:m})),h!==f&&!ce(s.current,h)&&(w&&e.stopPropagation(),(l||d||K||U)&&e.preventDefault(),g(h,!0),queueMicrotask(()=>{s.current[h]?.focus()}))});return{props:{ref:y,onFocus(e){const d=R.current,b=he(e.nativeEvent);!d||b==null||!Ce(b)||b.setSelectionRange(0,b.value.length)},onKeyDown:c},highlightedIndex:f,onHighlightedIndexChange:g,elementsRef:s,onMapChange:V,relayKeyboardEvent:c}}function gt(t,o){for(const r of at)if(!o.includes(r)&&t.getModifierState(r))return!0;return!1}function bt(t){const{render:o,className:r,style:C,refs:i=ue,props:j=ue,state:u=Ve,stateAttributesMapping:A,highlightedIndex:E,onHighlightedIndexChange:P,orientation:w,grid:m,loopFocus:O,onLoop:D,enableHomeAndEndKeys:x,onMapChange:l,stopEventPropagation:R=!0,rootRef:y,disabledIndices:s,modifierKeys:T,highlightItemOnHover:f=!1,tag:g="div",...V}=t,L=Ue(),{props:c,highlightedIndex:I,onHighlightedIndexChange:e,elementsRef:d,onMapChange:b,relayKeyboardEvent:k}=pt({grid:m,loopFocus:O,onLoop:D,orientation:w,highlightedIndex:E,onHighlightedIndexChange:P,rootRef:y,stopEventPropagation:R,enableHomeAndEndKeys:x,direction:L,disabledIndices:s,modifierKeys:T}),S=oe(g,t,{state:u,ref:i,props:[c,...j,V],stateAttributesMapping:A}),H=a.useMemo(()=>({highlightedIndex:I,onHighlightedIndexChange:e,highlightItemOnHover:f,relayKeyboardEvent:k}),[I,e,f,k]);return n.jsx(ze.Provider,{value:H,children:n.jsx(ke,{elementsRef:d,onMapChange:F=>{l?.(F),b(F)},children:S})})}const ht=a.forwardRef(function(o,r){const{activateOnFocus:C=!1,className:i,loopFocus:j=!0,render:u,style:A,...E}=o,{orientation:P,setTabMap:w,tabActivationDirection:m}=fe(),[O,D]=a.useState(0),[x,l]=a.useState(null),R=a.useRef(new Set),y=a.useRef(new Set),s=a.useRef(null);Z(()=>{if(typeof ResizeObserver>"u")return;const c=new ResizeObserver(()=>{R.current.forEach(I=>{I()})});return s.current=c,x&&c.observe(x),y.current.forEach(I=>{c.observe(I)}),()=>{c.disconnect(),s.current=null}},[x]);const T=_(c=>(R.current.add(c),()=>{R.current.delete(c)})),f=_(c=>(y.current.add(c),s.current?.observe(c),()=>{y.current.delete(c),s.current?.unobserve(c)})),g={orientation:P,tabActivationDirection:m},V={"aria-orientation":P==="vertical"?"vertical":void 0,role:"tablist"},L=a.useMemo(()=>({activateOnFocus:C,registerIndicatorUpdateListener:T,registerTabResizeObserverElement:f,tabsListElement:x}),[C,T,f,x]);return n.jsx(De.Provider,{value:L,children:n.jsx(bt,{render:u,className:i,style:A,state:g,refs:[r,l],props:[V,E],stateAttributesMapping:ie,highlightedIndex:O,enableHomeAndEndKeys:!0,loopFocus:j,orientation:P,onHighlightedIndexChange:D,onMapChange:w,disabledIndices:ue})})});function mt({className:t,orientation:o="horizontal",...r}){return n.jsx(it,{"data-slot":"tabs","data-orientation":o,className:re("group/tabs flex gap-2 data-horizontal:flex-col",t),...r})}const vt=He("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function xt({className:t,variant:o="default",...r}){return n.jsx(ht,{"data-slot":"tabs-list","data-variant":o,className:re(vt({variant:o}),t),...r})}function te({className:t,...o}){return n.jsx(ct,{"data-slot":"tabs-trigger",className:re("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...o})}function ne({className:t,...o}){return n.jsx(dt,{"data-slot":"tabs-content",className:re("flex-1 text-sm outline-none",t),...o})}function Rt(t){return`<script src="${location.origin}/snag.js" ${Be("site")}="${t}" defer><\/script>`}function Y({code:t,label:o}){const[r,C]=a.useState(!1);return n.jsxs("div",{className:"relative rounded-md border border-border bg-background px-3 py-2.5 pr-11 font-mono text-[12.5px] leading-relaxed",children:[n.jsx("code",{className:"whitespace-pre-wrap break-all",children:t}),n.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"absolute right-1.5 top-1.5","aria-label":r?"Copied":o,onClick:()=>{navigator.clipboard?.writeText(t),C(!0),setTimeout(()=>C(!1),1500)},children:r?n.jsx(ot,{}):n.jsx(rt,{})})]})}const se="npm install snagset";function ae({children:t}){return n.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:t})}function wt({uid:t}){const o=location.origin,r=`host="${o}" site="${t}"`;return n.jsxs(mt,{defaultValue:"html",className:"gap-3",children:[n.jsxs(xt,{className:"w-full",children:[n.jsx(te,{value:"html",children:"HTML"}),n.jsx(te,{value:"next",children:"Next.js"}),n.jsx(te,{value:"react",children:"React"}),n.jsx(te,{value:"vue",children:"Vue"}),n.jsx(te,{value:"js",children:"JS"})]}),n.jsxs(ne,{value:"html",className:"flex flex-col gap-2",children:[n.jsx(Y,{code:Rt(t),label:"Copy the tag"}),n.jsxs(ae,{children:["Paste it before ",n.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed. On WordPress, Webflow, Framer or Squarespace, put it in the site's footer or custom code setting."]})]}),n.jsxs(ne,{value:"next",className:"flex flex-col gap-2",children:[n.jsx(Y,{code:se,label:"Copy the install command"}),n.jsx(Y,{code:`// app/layout.tsx
|
|
1
|
+
import{r as a,i as je,e as Z,f as _,k as oe,j as n,aJ as Ne,aj as Le,al as Oe,aG as ue,E as Ve,b4 as ze,h as re,o as He,B as Ke,b5 as Be}from"./index-X11XkRkb.js";import{k as _e,c as Pe,C as pe,D as ge,d as Fe,u as we,m as $e,o as be,a as We,n as Ye,g as he}from"./createBaseUIEventDetails-CTYgZt5m.js";import{C as ke,u as Je,a as Ue}from"./CompositeList-OHWH8W1h.js";import{i as Ge}from"./isElementDisabled-CwHw_lZC.js";import{a as qe,u as Qe,t as Xe,i as Ze,s as me,k as ve,h as le,e as ce,H as xe,E as Re,C as et,l as Ce,g as tt,f as nt,A as ye,m as Ie,n as Ee,o as Te,M as at}from"./inertValue-CLaAaX62.js";import{u as st}from"./useCompositeItem-6LQEohxr.js";import{C as ot}from"./check-BlRwZrSR.js";import{C as rt}from"./copy-DSJQda7h.js";const Se=a.createContext(void 0);function fe(){const t=a.useContext(Se);if(t===void 0)throw new Error(je(64));return t}const ie={tabActivationDirection:t=>({"data-activation-direction":t})},it=a.forwardRef(function(o,r){const{className:C,defaultValue:i=0,onValueChange:j,orientation:u="horizontal",render:A,value:E,style:P,...w}=o,m=o.defaultValue!==void 0,O=a.useRef([]),[D,x]=a.useState(()=>new Map),[l,R]=_e({controlled:E,default:i,name:"Tabs",state:"value"}),y=E!==void 0,[s,T]=a.useState(()=>new Map),f=a.useRef(void 0),g=a.useCallback(p=>de(s,p),[s]),[V,L]=a.useState(()=>({previousValue:l,tabActivationDirection:"none"})),{previousValue:c,tabActivationDirection:I}=V;let e=I,d=!1;c!==l&&(e=Me(c,l,u,s),d=c!=null&&l!=null&&g(l)==null);const b=d?c:l,k=c!==b||I!==e;Z(()=>{k&&L({previousValue:b,tabActivationDirection:e})},[b,k,e]);const S=_((p,M)=>{const W=Me(l,p,u,s);M.activationDirection=W,j?.(p,M),!M.isCanceled&&R(p)}),H=_((p,M)=>{j?.(p,Pe(M,void 0,void 0,{activationDirection:"none"}))}),F=_((p,M)=>(x(W=>{const q=new Map(W);return q.set(p,M),q}),()=>{x(W=>{if(W.get(p)!==M)return W;const q=new Map(W);return q.delete(p),q})})),J=a.useCallback(p=>D.get(p),[D]),N=a.useCallback(p=>{for(const M of s.values())if(p===M.value)return M.id},[s]),h=a.useMemo(()=>({getTabElementBySelectedValue:g,getTabIdByPanelValue:N,getTabPanelIdByValue:J,onValueChange:S,orientation:u,registerMountedTabPanel:F,setTabMap:T,tabActivationDirection:e,value:l}),[g,N,J,S,u,F,T,e,l]),z=a.useMemo(()=>{for(const p of s.values())if(p.value===l)return p},[s,l]),$=a.useMemo(()=>{for(const p of s.values())if(!p.disabled)return p.value},[s]),K=a.useRef(!m),U=a.useRef(i),G=a.useRef(m),v=a.useRef(!1);Z(()=>{if(y)return;function p(X,ee){R(X),L({previousValue:X,tabActivationDirection:"none"}),H(X,ee),K.current=!1}if(s.size===0){v.current&&l!==null&&!f.current?.isConnected&&p(null,ge);return}v.current=!0,f.current=s.keys().next().value;const M=z?.disabled,W=z==null&&l!==null;if(!M&&l===U.current&&(G.current=!1),G.current&&M&&l===U.current)return;const q=K.current;if(M||W){const X=$??null;if(l===X){K.current=!1;return}let ee=ge;q?ee=pe:M&&(ee=Fe),p(X,ee);return}q&&z!=null&&(H(l,pe),K.current=!1)},[$,y,H,z,R,s,l]);const Q=oe("div",o,{state:{orientation:u,tabActivationDirection:e},ref:r,props:w,stateAttributesMapping:ie});return n.jsx(Se.Provider,{value:h,children:n.jsx(ke,{elementsRef:O,children:Q})})});function de(t,o){for(const[r,C]of t.entries())if(o===C.value)return r;return null}function Me(t,o,r,C){if(t==null||o==null)return"none";const[i,j,u]=r==="horizontal"?["left","left","right"]:["top","up","down"],A=de(C,t),E=de(C,o);if(A==null||E==null)return A!==E&&(typeof t=="number"||typeof t=="string")&&typeof t==typeof o?o>t?u:j:"none";const P=A.getBoundingClientRect()[i],w=E.getBoundingClientRect()[i];return w<P?j:w>P?u:"none"}const Ae="data-composite-item-active",De=a.createContext(void 0);function lt(){const t=a.useContext(De);if(t===void 0)throw new Error(je(65));return t}const ct=a.forwardRef(function(o,r){const{className:C,disabled:i=!1,render:j,value:u,id:A,nativeButton:E=!0,style:P,...w}=o,{value:m,getTabPanelIdByValue:O,onValueChange:D,orientation:x,tabActivationDirection:l}=fe(),{activateOnFocus:R,registerTabResizeObserverElement:y,tabsListElement:s}=lt(),{highlightedIndex:T,onHighlightedIndexChange:f}=Ne(),g=we(A),V=a.useMemo(()=>({disabled:i,id:g,value:u}),[i,g,u]),{compositeProps:L,compositeRef:c,index:I}=st({metadata:V}),e=u===m,d=a.useRef(!1),b=a.useRef(null),k=_(v=>{b.current?.(),b.current=v?y(v):null});Z(()=>{if(d.current){d.current=!1;return}if(!(e&&I>-1&&T!==I))return;const v=s;if(v!=null){const B=$e(be(v));if(B&&We(v,B))return}i||f(I)},[e,I,T,f,i,s]);const{getButtonProps:S,buttonRef:H}=Le({disabled:i,native:E,focusableWhenDisabled:!0}),F=O(u),J=a.useRef(!1),N=a.useRef(!1);function h(v){D(u,Pe(Ye,v.nativeEvent,void 0,{activationDirection:"none"}))}function z(v){e||i||h(v)}function $(v){e||i||R&&(!J.current||N.current)&&h(v)}function K(v){if(e||i)return;J.current=!0,N.current=v.button===0;const B=be(v.currentTarget);function Q(){J.current=!1,N.current=!1,B.removeEventListener("pointerup",Q),B.removeEventListener("pointercancel",Q)}B.addEventListener("pointerup",Q),B.addEventListener("pointercancel",Q)}return oe("button",o,{state:{disabled:i,active:e,orientation:x,tabActivationDirection:l},ref:[r,H,c,k],props:[L,{role:"tab","aria-controls":F,"aria-selected":e,id:g,onClick:z,onFocus:$,onPointerDown:K,[Ae]:e?"":void 0,onKeyDownCapture(){d.current=!0}},w,S],stateAttributesMapping:ie})}),ut={...ie,...Xe},dt=a.forwardRef(function(o,r){const{className:C,value:i,render:j,keepMounted:u=!1,style:A,...E}=o,{value:P,getTabIdByPanelValue:w,orientation:m,tabActivationDirection:O,registerMountedTabPanel:D}=fe(),x=we(),{ref:l,index:R}=Je(),y=i===P,{mounted:s,transitionStatus:T,setMounted:f}=qe(y),g=!s,V=w(i),L={hidden:g,orientation:m,tabActivationDirection:O,transitionStatus:T},c=a.useRef(null),I=oe("div",o,{state:L,ref:[r,l,c],props:[{"aria-labelledby":V,hidden:g,id:x,role:"tabpanel",tabIndex:y?0:-1,inert:Ze(!y),"data-index":R},E],stateAttributesMapping:ut});return Qe({open:y,ref:c,onComplete(){y||f(!1)}}),Z(()=>{if(!(x==null||g&&!u))return D(i,x)},[g,u,i,x,D]),u||s?I:null}),ft=[];function pt(t){const{loopFocus:o=!0,orientation:r="both",grid:C,onLoop:i,direction:j,highlightedIndex:u,onHighlightedIndexChange:A,rootRef:E,enableHomeAndEndKeys:P=!1,stopEventPropagation:w,disabledIndices:m,modifierKeys:O=ft}=t,[D,x]=a.useState(0),l=C!=null,R=a.useRef(null),y=Oe(R,E),s=a.useRef([]),T=a.useRef(!1),f=u??D,g=_((e,d=!1)=>{if((A??x)(e),d){const b=s.current[e];me(R.current,b,j,r)}}),V=_(e=>{if(e.size===0||T.current)return;T.current=!0;const d=Array.from(e.keys()),b=d.find(S=>S?.hasAttribute(Ae))??null,k=b?e.get(b)?.index??-1:-1;if(k!==-1)g(k);else if(ve(d,f,m)){const S=le(d,{disabledIndices:m});ce(d,S)||g(S)}me(R.current,b,j,r)});Z(()=>{if(m==null||u!=null||!T.current)return;const e=s.current;if(ve(e,f,m)){const d=le(e,{disabledIndices:m});ce(e,d)||g(d)}},[m,u,f,s,g]);const L=_((e,d,b)=>i?i(e,d,b,s):b),c=_(e=>{const d=e.key===xe||e.key===Re;if(!et.has(e.key)||!P&&d||gt(e,O)||!R.current)return;const k=j==="rtl",S=k?Ee:Te,H=k?Te:Ee,F=r==="vertical"?ye:S,J=r==="vertical"?Ie:H,N=he(e.nativeEvent);if(N!=null&&Ce(N)&&!Ge(N)){const G=N.selectionStart,v=N.selectionEnd,B=N.value;if(G==null||e.shiftKey||G!==v||e.key!==J&&G<B.length||e.key!==F&&G>0)return}let h=f;const z=tt(s,m),$=nt(s,m);C!=null&&(h=C({disabledIndices:m,elementsRef:s,event:e,highlightedIndex:f,loopFocus:o,maxIndex:$,minIndex:z,onLoop:L,orientation:r,rtl:k}));const K=r!=="vertical"&&e.key===S||r!=="horizontal"&&e.key===ye,U=r!=="vertical"&&e.key===H||r!=="horizontal"&&e.key===Ie;P&&(e.key===xe?h=z:e.key===Re&&(h=$)),h===f&&(K||U)&&(o&&h===$&&K?(h=z,i&&(h=i(e,f,h,s))):o&&h===z&&U?(h=$,i&&(h=i(e,f,h,s))):h=le(s.current,{startingIndex:h,decrement:U,disabledIndices:m})),h!==f&&!ce(s.current,h)&&(w&&e.stopPropagation(),(l||d||K||U)&&e.preventDefault(),g(h,!0),queueMicrotask(()=>{s.current[h]?.focus()}))});return{props:{ref:y,onFocus(e){const d=R.current,b=he(e.nativeEvent);!d||b==null||!Ce(b)||b.setSelectionRange(0,b.value.length)},onKeyDown:c},highlightedIndex:f,onHighlightedIndexChange:g,elementsRef:s,onMapChange:V,relayKeyboardEvent:c}}function gt(t,o){for(const r of at)if(!o.includes(r)&&t.getModifierState(r))return!0;return!1}function bt(t){const{render:o,className:r,style:C,refs:i=ue,props:j=ue,state:u=Ve,stateAttributesMapping:A,highlightedIndex:E,onHighlightedIndexChange:P,orientation:w,grid:m,loopFocus:O,onLoop:D,enableHomeAndEndKeys:x,onMapChange:l,stopEventPropagation:R=!0,rootRef:y,disabledIndices:s,modifierKeys:T,highlightItemOnHover:f=!1,tag:g="div",...V}=t,L=Ue(),{props:c,highlightedIndex:I,onHighlightedIndexChange:e,elementsRef:d,onMapChange:b,relayKeyboardEvent:k}=pt({grid:m,loopFocus:O,onLoop:D,orientation:w,highlightedIndex:E,onHighlightedIndexChange:P,rootRef:y,stopEventPropagation:R,enableHomeAndEndKeys:x,direction:L,disabledIndices:s,modifierKeys:T}),S=oe(g,t,{state:u,ref:i,props:[c,...j,V],stateAttributesMapping:A}),H=a.useMemo(()=>({highlightedIndex:I,onHighlightedIndexChange:e,highlightItemOnHover:f,relayKeyboardEvent:k}),[I,e,f,k]);return n.jsx(ze.Provider,{value:H,children:n.jsx(ke,{elementsRef:d,onMapChange:F=>{l?.(F),b(F)},children:S})})}const ht=a.forwardRef(function(o,r){const{activateOnFocus:C=!1,className:i,loopFocus:j=!0,render:u,style:A,...E}=o,{orientation:P,setTabMap:w,tabActivationDirection:m}=fe(),[O,D]=a.useState(0),[x,l]=a.useState(null),R=a.useRef(new Set),y=a.useRef(new Set),s=a.useRef(null);Z(()=>{if(typeof ResizeObserver>"u")return;const c=new ResizeObserver(()=>{R.current.forEach(I=>{I()})});return s.current=c,x&&c.observe(x),y.current.forEach(I=>{c.observe(I)}),()=>{c.disconnect(),s.current=null}},[x]);const T=_(c=>(R.current.add(c),()=>{R.current.delete(c)})),f=_(c=>(y.current.add(c),s.current?.observe(c),()=>{y.current.delete(c),s.current?.unobserve(c)})),g={orientation:P,tabActivationDirection:m},V={"aria-orientation":P==="vertical"?"vertical":void 0,role:"tablist"},L=a.useMemo(()=>({activateOnFocus:C,registerIndicatorUpdateListener:T,registerTabResizeObserverElement:f,tabsListElement:x}),[C,T,f,x]);return n.jsx(De.Provider,{value:L,children:n.jsx(bt,{render:u,className:i,style:A,state:g,refs:[r,l],props:[V,E],stateAttributesMapping:ie,highlightedIndex:O,enableHomeAndEndKeys:!0,loopFocus:j,orientation:P,onHighlightedIndexChange:D,onMapChange:w,disabledIndices:ue})})});function mt({className:t,orientation:o="horizontal",...r}){return n.jsx(it,{"data-slot":"tabs","data-orientation":o,className:re("group/tabs flex gap-2 data-horizontal:flex-col",t),...r})}const vt=He("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function xt({className:t,variant:o="default",...r}){return n.jsx(ht,{"data-slot":"tabs-list","data-variant":o,className:re(vt({variant:o}),t),...r})}function te({className:t,...o}){return n.jsx(ct,{"data-slot":"tabs-trigger",className:re("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",t),...o})}function ne({className:t,...o}){return n.jsx(dt,{"data-slot":"tabs-content",className:re("flex-1 text-sm outline-none",t),...o})}function Rt(t){return`<script src="${location.origin}/snag.js" ${Be("site")}="${t}" defer><\/script>`}function Y({code:t,label:o}){const[r,C]=a.useState(!1);return n.jsxs("div",{className:"relative rounded-md border border-border bg-background px-3 py-2.5 pr-11 font-mono text-[12.5px] leading-relaxed",children:[n.jsx("code",{className:"whitespace-pre-wrap break-all",children:t}),n.jsx(Ke,{variant:"ghost",size:"icon-sm",className:"absolute right-1.5 top-1.5","aria-label":r?"Copied":o,onClick:()=>{navigator.clipboard?.writeText(t),C(!0),setTimeout(()=>C(!1),1500)},children:r?n.jsx(ot,{}):n.jsx(rt,{})})]})}const se="npm install snagset";function ae({children:t}){return n.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:t})}function wt({uid:t}){const o=location.origin,r=`host="${o}" site="${t}"`;return n.jsxs(mt,{defaultValue:"html",className:"gap-3",children:[n.jsxs(xt,{className:"w-full",children:[n.jsx(te,{value:"html",children:"HTML"}),n.jsx(te,{value:"next",children:"Next.js"}),n.jsx(te,{value:"react",children:"React"}),n.jsx(te,{value:"vue",children:"Vue"}),n.jsx(te,{value:"js",children:"JS"})]}),n.jsxs(ne,{value:"html",className:"flex flex-col gap-2",children:[n.jsx(Y,{code:Rt(t),label:"Copy the tag"}),n.jsxs(ae,{children:["Paste it before ",n.jsx("code",{className:"font-mono",children:"</body>"})," on every page you want reviewed. On WordPress, Webflow, Framer or Squarespace, put it in the site's footer or custom code setting."]})]}),n.jsxs(ne,{value:"next",className:"flex flex-col gap-2",children:[n.jsx(Y,{code:se,label:"Copy the install command"}),n.jsx(Y,{code:`// app/layout.tsx
|
|
2
2
|
import { Snagset } from "snagset/next";
|
|
3
3
|
|
|
4
4
|
<body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as U,r as f,a5 as y,s as v,a6 as j,a2 as S,j as e,B as x,A as w,C as M}from"./index-
|
|
1
|
+
import{d as U,r as f,a5 as y,s as v,a6 as j,a2 as S,j as e,B as x,A as w,C as M}from"./index-X11XkRkb.js";import{u as L}from"./useQuery-CCJBm2EJ.js";import{i as B,j as K,l as R,k as I,m as P,n as E}from"./dialog-DZbUuBSr.js";import{L as k,I as C}from"./label-8lYoT07T.js";import{C as z}from"./ConfirmDialog-Db4AvUN5.js";import{a as N}from"./parts-DVVBI72d.js";import{v as A}from"./useScrollLock-DDlrhOw8.js";import{u as _}from"./me-DnLqgT3l.js";function ee({owner:t}){const r=L(w.instance()),l=U(),s=()=>l.invalidateQueries({queryKey:w.instance().queryKey}),[g,m]=f.useState(!1),[b,p]=f.useState(!1),[h,u]=f.useState(null),d=y({mutationFn:v.disconnectStorage,onSuccess:()=>void s(),onError:c=>j.error(S(c))}),n=y({mutationFn:v.disconnectMail,onSuccess:()=>void s(),onError:c=>j.error(S(c))}),i=y({mutationFn:v.testMail,onSuccess:c=>j.success(`Sent to ${c.to}`),onError:c=>j.error(S(c))}),a=r.data?.storage,o=r.data?.mail;return e.jsxs(e.Fragment,{children:[e.jsxs(N,{title:"Storage",description:"The bucket screenshots and files go to. Without one the widget runs in annotation mode.",children:[!r.data&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:r.isError?"Could not read it.":"Reading…"}),a&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{tone:a.connected?"ok":a.unreadable?"bad":"off",text:a.connected?`Connected · ${a.bucket} at ${(a.endpoint??"").replace(/^https?:\/\//,"")}${a.connectedAt?` · since ${A(a.connectedAt)}`:""}`:a.unreadable?"A bucket is stored but its keys will not decrypt — the secret key changed. Connect it again.":"Not connected — annotation mode. Comments and anchors work; screenshots are not offered."}),e.jsx(O,{}),a.source==="env"?e.jsx($,{what:"SNAGSET_STORAGE_S3_*"}):t?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"outline",size:"sm",onClick:()=>m(!0),children:a.connected||a.unreadable?"Replace…":"Connect a bucket…"}),(a.connected||a.unreadable)&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>u("storage"),children:"Disconnect"})]}):null]})]}),e.jsx(N,{title:"Mail",description:"How notifications go out. Without a transport they are off, and the instance says so.",children:o&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{tone:o.configured?"ok":o.unreadable?"bad":"off",text:o.configured?`${o.scheme==="resend"?"Resend":`SMTP · ${o.host??""}`} · from ${o.from}${o.updatedAt?` · since ${A(o.updatedAt)}`:""}`:o.unreadable?"A transport is stored but its secret will not decrypt — the secret key changed. Connect it again.":"No transport — notifications are off."}),o.source==="env"?e.jsx($,{what:"SNAGSET_MAIL_URL"}):t?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(x,{variant:"outline",size:"sm",onClick:()=>p(!0),children:o.configured||o.unreadable?"Replace…":"Connect a transport…"}),o.configured&&e.jsx(x,{variant:"outline",size:"sm",loading:i.isPending,onClick:()=>i.mutate(),children:i.isPending?"Sending…":"Send a test email"}),(o.configured||o.unreadable)&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>u("mail"),children:"Disconnect"})]}):(o.configured&&t===!1,null)]})}),e.jsx(q,{open:g,onOpenChange:m,onDone:()=>void s()}),e.jsx(G,{open:b,onOpenChange:p,onDone:()=>void s()}),e.jsx(z,{open:h!==null,onOpenChange:c=>!c&&u(null),title:h==="storage"?"Disconnect the bucket?":"Disconnect the mail transport?",description:h==="storage"?"Screenshots stop being offered. Nothing in the bucket is deleted, and reconnecting the same bucket brings the pictures back.":"Notifications stop going out until a transport is connected again.",confirmLabel:"Disconnect",busy:d.isPending||n.isPending,onConfirm:async()=>{h==="storage"?await d.mutateAsync():await n.mutateAsync(),u(null)}})]})}function T(){const{storage:t}=_().limits;return t.limit===null?null:`${F(t.used)} of ${F(t.limit)} used across the studio's sites.`}function O(){const t=T();return t===null?null:e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:t})}function te(){const t=T();return t===null?null:e.jsx(N,{title:"Storage",description:"Screenshots and files, against the studio's plan.",children:e.jsx("p",{className:"m-0 text-[13px]",children:t})})}function D({tone:t,text:r}){return e.jsxs("p",{className:"m-0 flex items-center gap-2 text-[13px]",children:[e.jsx("span",{className:`size-2 shrink-0 rounded-full ${t==="ok"?"bg-ok":t==="bad"?"bg-destructive":"bg-line-strong"}`,"aria-hidden":"true"}),e.jsx("span",{children:r})]})}function $({what:t}){return e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:["Set by the environment (",e.jsx("code",{className:"font-mono",children:t}),"). Change it there; the dashboard shows it and does not offer to edit it."]})}function q({open:t,onOpenChange:r,onDone:l}){const[s,g]=f.useState({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),[m,b]=f.useState(""),p=y({mutationFn:v.connectStorage}),h=n=>i=>g({...s,[n]:i.target.value}),u=async n=>{n.preventDefault(),b("");try{await p.mutateAsync({endpoint:s.endpoint.trim(),bucket:s.bucket.trim(),accessKeyId:s.accessKeyId.trim(),secretAccessKey:s.secretAccessKey,...s.region.trim()?{region:s.region.trim()}:{},...s.publicBaseUrl.trim()?{publicBaseUrl:s.publicBaseUrl.trim()}:{}}),g({endpoint:"",bucket:"",region:"",accessKeyId:"",secretAccessKey:"",publicBaseUrl:""}),r(!1),l(),j.success("Bucket connected — screenshots are on")}catch(i){b(i instanceof M?i.message:"Could not reach the server.")}},d=(n,i,a,o="text",c)=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:`st-${n}`,children:i}),e.jsx(C,{id:`st-${n}`,type:o,placeholder:a,value:s[n],onChange:h(n),autoComplete:"off"}),c&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:c})]});return e.jsx(B,{open:t,onOpenChange:r,children:e.jsx(K,{children:e.jsxs("form",{onSubmit:n=>void u(n),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(I,{children:"Connect a bucket"}),e.jsx(P,{children:"Any S3-compatible bucket. It is probed — write, read, delete — before anything is saved, and the keys are stored encrypted with this instance's secret key."})]}),m&&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:m}),d("endpoint","Endpoint","https://ams3.digitaloceanspaces.com"),d("bucket","Bucket","snagset"),d("region","Region","auto","text","Leave empty for providers that do not use one."),d("accessKeyId","Access key ID",""),d("secretAccessKey","Secret access key","","password"),d("publicBaseUrl","Public base URL","","text","Optional — only if the bucket is served from a CDN address."),e.jsxs(E,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:p.isPending,children:p.isPending?"Probing…":"Connect"})]})]})})})}function G({open:t,onOpenChange:r,onDone:l}){const[s,g]=f.useState(""),[m,b]=f.useState(""),[p,h]=f.useState(""),u=y({mutationFn:v.connectMail}),d=async n=>{n.preventDefault(),h("");try{await u.mutateAsync({url:s.trim(),from:m.trim()}),g(""),b(""),r(!1),l(),j.success("Transport connected — send a test email to be sure")}catch(i){h(i instanceof M?i.message:"Could not reach the server.")}};return e.jsx(B,{open:t,onOpenChange:r,children:e.jsx(K,{children:e.jsxs("form",{onSubmit:n=>void d(n),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(R,{children:[e.jsx(I,{children:"Connect a mail transport"}),e.jsx(P,{children:"Resend is the easy one — the provider owns SPF and DKIM. SMTP works with any provider. The URL is stored encrypted with this instance's secret key."})]}),p&&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:p}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"mail-url",children:"Transport"}),e.jsx(C,{id:"mail-url",type:"password",placeholder:"resend://re_… or smtp://user:pass@host:587",value:s,onChange:n=>g(n.target.value),autoComplete:"off"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"mail-from",children:"From"}),e.jsx(C,{id:"mail-from",placeholder:"Snagset <review@kilnwork.studio>",value:m,onChange:n=>b(n.target.value)}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"The address every notification is sent from. Resend needs a verified domain for it."})]}),e.jsxs(E,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e.jsx(x,{type:"submit",loading:u.isPending,disabled:!s.trim()||!m.trim(),children:u.isPending?"Saving…":"Connect"})]})]})})})}function F(t){const r=["B","KB","MB","GB","TB"];let l=t,s=0;for(;l>=1024&&s<r.length-1;)l/=1024,s+=1;return`${s===0?l:l.toFixed(l>=10?0:1)} ${r[s]}`}export{ee as I,te as S,F as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as Q,r as p,a5 as P,j as e,$ as J,B as b,a6 as A,a2 as D,A as M,s as R,aa as K,C as z}from"./index-B_3U6pyz.js";import{P as E}from"./Picker-0Wc1iFQj.js";import{u as G}from"./useQuery-HUEWFxW8.js";import{B as O}from"./badge-5vfpTOMk.js";import{i as F,j as _,l as $,k as B,m as I,n as q}from"./dialog-Dsu0e02Q.js";import{L as C,I as H}from"./label-BPkAzYEe.js";import{S as W}from"./switch-9hlceDWy.js";import{C as U}from"./ConfirmDialog-_B1eNA1i.js";import{C as w}from"./CopyButton-CIoiqDbz.js";import{a as Y}from"./parts-BZnB0y34.js";import{v as V}from"./useScrollLock-Bxg3WK_6.js";function me({owner:n,instanceOwner:i,operator:g,sites:v,mine:h=!1}){const o=Q(),a=G(M.mcpTokens()),[x,u]=p.useState(!1),[l,m]=p.useState(null),[c,j]=p.useState(null),k=P({mutationFn:t=>R.revokeMcpToken(t),onSuccess:()=>{j(null),o.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),f=a.data?.data??[],N=f.filter(t=>!t.revokedAt),d=a.data?.http??null,y=P({mutationFn:t=>R.setMcpHttp(t),onSuccess:(t,s)=>{o.setQueryData(M.instance().queryKey,t),o.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(s?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),S=t=>{const s=new Set(t),r=s.has("comments:write")||s.has("threads:write");return!r&&!s.has("context:read")?"Read-only":r?`Writes: ${[s.has("comments:write")?"reply":"",s.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(Y,{title:h?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),d&&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(C,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[d.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),d.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":i?"":g?" Only an owner can switch it.":" Only whoever runs this server can switch it."]})]}),e.jsx(W,{id:"mcp-http-on","aria-label":"Remote transport",checked:d.enabled,disabled:!i||d.source==="env"||y.isPending,onCheckedChange:t=>y.mutate(t)})]}),a.isSuccess&&N.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{variant:"outline",children:f.length>0?"No active tokens":"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:h?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),f.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:f.map(t=>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] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(O,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":S(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${V(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>j(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(b,{variant:"outline",size:"sm",onClick:()=>u(!0),children:"New token…"})}),e.jsx(X,{open:x,onOpenChange:u,sites:v,http:a.data?.http??null,onDone:t=>{o.invalidateQueries({queryKey:["mcp-tokens"]}),m(t)}}),e.jsx(Z,{state:l,http:a.data?.http??null,onClose:()=>m(null)}),e.jsx(U,{open:c!==null,onOpenChange:t=>!t&&j(null),title:`Revoke “${c?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:k.isPending,onConfirm:async()=>{c&&await k.mutateAsync(c.id)}})]})}function X({open:n,onOpenChange:i,sites:g,http:v,onDone:h}){const[o,a]=p.useState(""),[x,u]=p.useState(""),[l,m]=p.useState(["threads:read","source:map"]),[c,j]=p.useState(""),[k,f]=p.useState(!1),[N,d]=p.useState(""),y=P({mutationFn:()=>R.mintMcpToken({name:o.trim(),...x?{site:x}:{},scopes:l,...c?{expiresInDays:Number(c)}:{},...k?{allowRemoteWrites:!0}:{}})}),S=(s,r)=>m(T=>r?[...new Set([...T,s])]:T.filter(L=>L!==s)),t=async s=>{s.preventDefault(),d("");try{const r=await y.mutateAsync();a(""),u(""),m(["threads:read","source:map"]),j(""),f(!1),i(!1),h(r)}catch(r){d(r instanceof z?r.message:"Could not reach the server.")}};return e.jsx(F,{open:n,onOpenChange:i,children:e.jsx(_,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs($,{children:[e.jsx(B,{children:"New agent token"}),e.jsx(I,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),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(C,{htmlFor:"mcp-name",children:"Name"}),e.jsx(H,{id:"mcp-name",placeholder:"Claude Code",value:o,onChange:s=>a(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-site",children:"Site"}),e.jsx(E,{id:"mcp-site",value:x,onChange:u,options:[{value:"",label:"All sites"},...g.map(s=>({value:s.uid,label:s.name}))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),K.map(s=>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:l.includes(s.scope),onChange:r=>S(s.scope,r.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),v?.enabled&&(l.includes("comments:write")||l.includes("threads:write"))&&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:s=>f(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-expires",children:"Expires"}),e.jsx(E,{id:"mcp-expires",value:c,onChange:j,options:[{value:"",label:"Never"},{value:"30",label:"In 30 days"},{value:"90",label:"In 90 days"},{value:"365",label:"In a year"}]})]}),e.jsxs(q,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:y.isPending,disabled:!o.trim()||l.length===0,children:y.isPending?"Minting…":"Create token"})]})]})})})}function Z({state:n,http:i,onClose:g}){const v=typeof location<"u"?location.origin:"",h={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:v,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},o=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:h}}},null,2),a=["claude mcp add snagset",...Object.entries(h).map(([m,c])=>`-e ${m}=${c}`),"--","npx -y @snagset/mcp"].join(" "),x=`Bearer ${n?.secret??""}`,u=["claude mcp add","--transport http","snagset",i?.url??"",`--header "Authorization: ${x}"`].join(" "),l=JSON.stringify({mcpServers:{snagset:{type:"http",url:i?.url??"",headers:{Authorization:x}}}},null,2);return e.jsx(F,{open:n!==null,onOpenChange:m=>!m&&g(),children:e.jsxs(_,{className:"sm:max-w-xl",children:[e.jsxs($,{children:[e.jsxs(B,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(I,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(w,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(w,{text:a,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a})]}),i?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(w,{text:l,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:l}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(w,{text:o,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(q,{children:e.jsx(b,{type:"button",onClick:g,children:"Done"})})]})})}export{me as M};
|
|
1
|
+
import{d as Q,r as p,a5 as P,j as e,$ as J,B as b,a6 as A,a2 as D,A as M,s as R,aa as K,C as z}from"./index-X11XkRkb.js";import{P as E}from"./Picker-95_pkfVu.js";import{u as G}from"./useQuery-CCJBm2EJ.js";import{B as O}from"./badge-CicACH6l.js";import{i as F,j as _,l as $,k as B,m as I,n as q}from"./dialog-DZbUuBSr.js";import{L as C,I as H}from"./label-8lYoT07T.js";import{S as W}from"./switch-CHmJ_Ipt.js";import{C as U}from"./ConfirmDialog-Db4AvUN5.js";import{C as w}from"./CopyButton-r38fWUwx.js";import{a as Y}from"./parts-DVVBI72d.js";import{v as V}from"./useScrollLock-DDlrhOw8.js";function me({owner:n,instanceOwner:i,operator:g,sites:v,mine:h=!1}){const o=Q(),a=G(M.mcpTokens()),[x,u]=p.useState(!1),[l,m]=p.useState(null),[c,j]=p.useState(null),k=P({mutationFn:t=>R.revokeMcpToken(t),onSuccess:()=>{j(null),o.invalidateQueries({queryKey:["mcp-tokens"]})},onError:t=>A.error(D(t))}),f=a.data?.data??[],N=f.filter(t=>!t.revokedAt),d=a.data?.http??null,y=P({mutationFn:t=>R.setMcpHttp(t),onSuccess:(t,s)=>{o.setQueryData(M.instance().queryKey,t),o.invalidateQueries({queryKey:["mcp-tokens"]}),A.success(s?"Remote transport on — the token dialog shows its config":"Remote transport off — the endpoint answers 404 again")},onError:t=>A.error(D(t))}),S=t=>{const s=new Set(t),r=s.has("comments:write")||s.has("threads:write");return!r&&!s.has("context:read")?"Read-only":r?`Writes: ${[s.has("comments:write")?"reply":"",s.has("threads:write")?"mark ready":""].filter(Boolean).join(", ")}`:"Read-only, with capture context"};return e.jsxs(Y,{title:h?"Your agent tokens":"MCP",description:"A coding agent — Claude Code, Cursor, any MCP client — reads the same brief this dashboard copies, maps a comment to the file in its checkout, and can reply or mark a fix ready. It never resolves: whoever reported a snag decides when it is fixed. A token per agent, shown once, revocable here.",children:[a.isPending&&e.jsx(J,{rows:2}),d&&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(C,{htmlFor:"mcp-http-on",className:"text-[13px] font-medium",children:"Remote transport"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:[d.enabled?e.jsxs(e.Fragment,{children:["On. An agent anywhere talks to this studio at ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," with a token as a bearer. No source mapping there; a write needs a token minted for it."]}):e.jsxs(e.Fragment,{children:["Off. Agents reach this studio only from a machine with the checkout. On, ",e.jsx("code",{className:"font-mono text-[11.5px]",children:d.url})," serves the same tools to an agent anywhere, with a token as a bearer."]}),d.source==="env"?" Set by the environment (SNAGSET_MCP_HTTP_ENABLED).":i?"":g?" Only an owner can switch it.":" Only whoever runs this server can switch it."]})]}),e.jsx(W,{id:"mcp-http-on","aria-label":"Remote transport",checked:d.enabled,disabled:!i||d.source==="env"||y.isPending,onCheckedChange:t=>y.mutate(t)})]}),a.isSuccess&&N.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{variant:"outline",children:f.length>0?"No active tokens":"No tokens"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:h?"You have no agent tokens yet.":"No agent can read this studio yet."})]}),f.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":"Agent tokens",children:f.map(t=>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] ${t.revokedAt?"opacity-60":""}`,children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("code",{className:"font-mono text-[12.5px] text-muted-foreground",children:[t.prefix,"…"]}),e.jsx(O,{variant:"outline",className:t.revokedAt?"":"border-ok text-ok",children:t.revokedAt?"Revoked":S(t.scopes)}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[t.site?t.site.name:"All sites"," · ",t.lastUsedAt?`last used ${V(t.lastUsedAt)}`:"never used",t.expiresAt&&!t.revokedAt?` · expires ${new Date(t.expiresAt).toLocaleDateString()}`:"",t.createdBy?` · by ${t.createdBy}`:""]}),t.canRevoke&&e.jsx("span",{className:"ml-auto flex gap-1",children:e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>j(t),children:"Revoke"})})]},t.id))}),n&&e.jsx("div",{children:e.jsx(b,{variant:"outline",size:"sm",onClick:()=>u(!0),children:"New token…"})}),e.jsx(X,{open:x,onOpenChange:u,sites:v,http:a.data?.http??null,onDone:t=>{o.invalidateQueries({queryKey:["mcp-tokens"]}),m(t)}}),e.jsx(Z,{state:l,http:a.data?.http??null,onClose:()=>m(null)}),e.jsx(U,{open:c!==null,onOpenChange:t=>!t&&j(null),title:`Revoke “${c?.name??""}”?`,description:e.jsx(e.Fragment,{children:"The agent holding it loses access on its next request. Its past replies stay, under its name. This cannot be undone — mint a new token instead."}),confirmLabel:"Revoke",busy:k.isPending,onConfirm:async()=>{c&&await k.mutateAsync(c.id)}})]})}function X({open:n,onOpenChange:i,sites:g,http:v,onDone:h}){const[o,a]=p.useState(""),[x,u]=p.useState(""),[l,m]=p.useState(["threads:read","source:map"]),[c,j]=p.useState(""),[k,f]=p.useState(!1),[N,d]=p.useState(""),y=P({mutationFn:()=>R.mintMcpToken({name:o.trim(),...x?{site:x}:{},scopes:l,...c?{expiresInDays:Number(c)}:{},...k?{allowRemoteWrites:!0}:{}})}),S=(s,r)=>m(T=>r?[...new Set([...T,s])]:T.filter(L=>L!==s)),t=async s=>{s.preventDefault(),d("");try{const r=await y.mutateAsync();a(""),u(""),m(["threads:read","source:map"]),j(""),f(!1),i(!1),h(r)}catch(r){d(r instanceof z?r.message:"Could not reach the server.")}};return e.jsx(F,{open:n,onOpenChange:i,children:e.jsx(_,{children:e.jsxs("form",{onSubmit:s=>void t(s),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs($,{children:[e.jsx(B,{children:"New agent token"}),e.jsx(I,{children:"Read-only by default, plus mapping a comment to a file in the agent's own checkout. Tick more only for an agent you want writing here — and it still cannot resolve anything."})]}),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(C,{htmlFor:"mcp-name",children:"Name"}),e.jsx(H,{id:"mcp-name",placeholder:"Claude Code",value:o,onChange:s=>a(s.target.value),autoComplete:"off",maxLength:80}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"What a client sees on the agent's replies, so name the agent, not the person."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-site",children:"Site"}),e.jsx(E,{id:"mcp-site",value:x,onChange:u,options:[{value:"",label:"All sites"},...g.map(s=>({value:s.uid,label:s.name}))]})]}),e.jsxs("fieldset",{className:"m-0 flex flex-col gap-2 border-0 p-0",children:[e.jsx("legend",{className:"mb-1 text-[13px] font-medium",children:"Scopes"}),K.map(s=>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:l.includes(s.scope),onChange:r=>S(s.scope,r.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:s.label}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:s.hint})]})]},s.scope))]}),v?.enabled&&(l.includes("comments:write")||l.includes("threads:write"))&&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:s=>f(s.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"May write over the remote transport"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off by default. Over POST /mcp the agent is not on a machine you can see; a write there is a decision."})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(C,{htmlFor:"mcp-expires",children:"Expires"}),e.jsx(E,{id:"mcp-expires",value:c,onChange:j,options:[{value:"",label:"Never"},{value:"30",label:"In 30 days"},{value:"90",label:"In 90 days"},{value:"365",label:"In a year"}]})]}),e.jsxs(q,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(b,{type:"submit",loading:y.isPending,disabled:!o.trim()||l.length===0,children:y.isPending?"Minting…":"Create token"})]})]})})})}function Z({state:n,http:i,onClose:g}){const v=typeof location<"u"?location.origin:"",h={SNAGSET_MCP_TOKEN:n?.secret??"",SNAGSET_MCP_HOST:v,...n?.token.site?{SNAGSET_MCP_PROJECT:n.token.site.uid}:{}},o=JSON.stringify({mcpServers:{snagset:{command:"npx",args:["-y","@snagset/mcp"],env:h}}},null,2),a=["claude mcp add snagset",...Object.entries(h).map(([m,c])=>`-e ${m}=${c}`),"--","npx -y @snagset/mcp"].join(" "),x=`Bearer ${n?.secret??""}`,u=["claude mcp add","--transport http","snagset",i?.url??"",`--header "Authorization: ${x}"`].join(" "),l=JSON.stringify({mcpServers:{snagset:{type:"http",url:i?.url??"",headers:{Authorization:x}}}},null,2);return e.jsx(F,{open:n!==null,onOpenChange:m=>!m&&g(),children:e.jsxs(_,{className:"sm:max-w-xl",children:[e.jsxs($,{children:[e.jsxs(B,{children:["Token for “",n?.token.name??"","”"]}),e.jsx(I,{children:"Shown this once — only its hash is stored. Put it in the agent's config, then start the agent from the site's checkout so it can map comments to files."})]}),n&&e.jsxs("div",{className:"flex flex-col gap-4 text-[13px]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-2 py-1.5 font-mono text-[12px]","data-testid":"mcp-token",children:n.secret}),e.jsx(w,{text:n.secret,label:"Copy the token"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Claude Code"}),e.jsx(w,{text:a,label:"Copy the Claude Code command"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:a})]}),i?.enabled&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Remote — an agent that is not on a machine with the checkout"}),e.jsx(w,{text:l,label:"Copy the remote config"})]}),e.jsx("pre",{className:"m-0 whitespace-pre-wrap break-all rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:u}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:l}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"No source mapping there — nothing to search. Writes need the token minted with remote writes allowed."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:"Cursor, Claude Desktop, any MCP client"}),e.jsx(w,{text:o,label:"Copy the JSON config"})]}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md bg-muted px-3 py-2 font-mono text-[12px]",children:o}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Cursor reads it from .cursor/mcp.json in the project; Claude Desktop from its claude_desktop_config.json."})]})]}),e.jsx(q,{children:e.jsx(b,{type:"button",onClick:g,children:"Done"})})]})})}export{me as M};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Xt,ai as Nt,e as xe,l as Gt,r as s,i as vt,j as h,aG as At,f as He,m as ht,E as Kt,al as Jt,aj as Ot,k as Te,g as ft,h as Fe}from"./index-
|
|
1
|
+
import{c as Xt,ai as Nt,e as xe,l as Gt,r as s,i as vt,j as h,aG as At,f as He,m as ht,E as Kt,al as Jt,aj as Ot,k as Te,g as ft,h as Fe}from"./index-X11XkRkb.js";import{C as Lt}from"./chevron-down-865lxBex.js";import{C as Qt}from"./check-BlRwZrSR.js";import{J as Zt,a7 as en,P as tn,R as nn,a8 as c,l as Ht,g as on,F as sn,x as rn,y as ln,m as nt,a9 as an,a4 as cn,t as un,N as dn,O as fn,Q as pn,C as gn,a as mn,M as hn,q as xn,aa as bn}from"./useScrollLock-DDlrhOw8.js";import{i as Sn}from"./isElementDisabled-CwHw_lZC.js";import{w as vn,e as yn,h as Ft,A as Dt,k as Ct,l as Rn,x as wn,s as In,c as Ie,n as st,j as Tn,f as Mn,o as xt,a as pt,z as En,B as An,r as gt}from"./createBaseUIEventDetails-CTYgZt5m.js";import{a as yt,u as it,i as Cn,d as Pn,t as Rt,C as Vn}from"./inertValue-CLaAaX62.js";import{s as bt}from"./serializeValue-B8e3iXO-.js";import{u as jn}from"./useValueChanged-BuDWW6rb.js";import{d as Nn,h as On,e as Ln,f as Hn,i as Fn,c as Dn,u as kn,a as Un,b as Bn,p as _n,r as zn,g as Wn}from"./getPseudoElementBounds-CFaDUKhY.js";import{C as Yn,a as qn,u as $n}from"./CompositeList-OHWH8W1h.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,a9 as o}from"./index-
|
|
1
|
+
import{r,j as e,a9 as o}from"./index-X11XkRkb.js";function l({saving:s,savedAt:t}){const[i,a]=r.useState(!1);return r.useEffect(()=>{if(!t)return;a(!0);const n=setTimeout(()=>a(!1),1800);return()=>clearTimeout(n)},[t]),s?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[12.5px] text-muted-foreground","aria-live":"polite",children:[e.jsx(o,{className:"size-3.5 animate-spin","aria-hidden":"true"}),"Saving"]}):e.jsx("span",{className:"text-[12.5px] text-muted-foreground","aria-live":"polite",children:i?"Saved":""})}export{l as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as ft,a as xt,b as mt,c as O,d as je,r as o,e as L,f as ce,g as bt,j as e,B as Z,h as w,i as ne,m as ye,E as vt,k as Se,l as fe,n as jt,o as yt,p as ae,q as K,S as St,s as ee,t as $e,v as wt,L as _,w as Nt,M as Ct,x as kt,y as Tt,z as Pt,A as Be,O as Rt}from"./index-
|
|
1
|
+
import{u as ft,a as xt,b as mt,c as O,d as je,r as o,e as L,f as ce,g as bt,j as e,B as Z,h as w,i as ne,m as ye,E as vt,k as Se,l as fe,n as jt,o as yt,p as ae,q as K,S as St,s as ee,t as $e,v as wt,L as _,w as Nt,M as Ct,x as kt,y as Tt,z as Pt,A as Be,O as Rt}from"./index-X11XkRkb.js";import{u as we}from"./useQuery-CCJBm2EJ.js";import{D as Mt,a as Et,b as Ot,X as Dt,c as It,d as At,e as _t,f as zt,p as Ht,g as Lt,h as $t,i as Fe,j as Ue,k as qe,l as Bt,m as Ft,n as Ut}from"./dialog-DZbUuBSr.js";import{T as qt,i as Ve,a as Vt,R as Gt,b as Kt,P as Yt,f as Wt,u as Xt,c as Qt,d as Jt,e as Zt,g as es,h as ts,j as ss,k as ns,l as as,m as rs,t as os,n as is,o as ls,F as ds,p as cs,q as us,S as ps,r as gs,s as hs}from"./useScrollLock-DDlrhOw8.js";import{c as B,n as Ge,g as fs,a as xe,t as xs,d as ms,i as bs,u as vs,b as ue}from"./createBaseUIEventDetails-CTYgZt5m.js";import{g as me,u as js,a as ys,b as Ss,s as ws,c as Ns,d as Cs,S as Ke,E as J,D as re,e as oe,f as ie,h as Ne,i as te,j as I,k as G,l as ks,m as pe}from"./dropdown-menu-By49qibi.js";import{u as Ts,a as Ps,g as Rs}from"./getPseudoElementBounds-CFaDUKhY.js";import{u as Ms}from"./inertValue-CLaAaX62.js";import{u as Ye}from"./useRender-BZe0PUs7.js";import{A as Es,a as Os}from"./avatar-C6Rr20S0.js";import{L as Ds,I as Is}from"./label-8lYoT07T.js";import{u as le}from"./me-DnLqgT3l.js";import{L as se}from"./layout-grid-C-a8O8B6.js";import{U as be}from"./users-BkLZaCQc.js";import{c as As}from"./update-duXzIzFS.js";import{P as We}from"./plus-CS6tYH0S.js";import{M as _s,S as zs,a as Hs}from"./sun-CK52_1CD.js";import"./useBaseQuery-C_54ul4D.js";import"./check-BlRwZrSR.js";import"./CompositeList-OHWH8W1h.js";import"./CompositeItem-CkiEeVQd.js";import"./useCompositeItem-6LQEohxr.js";import"./useValueChanged-BuDWW6rb.js";function Ls(t){const s=ft({warn:t?.router===void 0}),n=t?.router||s;return xt(n.stores.__store,mt(t,n))}/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,u as n,G as a,B as r}from"./index-
|
|
1
|
+
import{j as e,u as n,G as a,B as r}from"./index-X11XkRkb.js";function i({error:s}){const t=n(),o=s instanceof Error?s.message:"Something went wrong.";return e.jsx(a,{children:e.jsxs("div",{className:"flex flex-col items-start gap-3",children:[e.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Could not load the dashboard"}),e.jsx("p",{className:"m-0 text-muted-foreground",children:o}),e.jsx(r,{variant:"outline",size:"sm",onClick:()=>void t.invalidate(),children:"Try again"})]})})}const m=({error:s})=>e.jsx(i,{error:s});export{m as errorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as p,Z as f,_ as g,p as v,j as e,B as x,$ as N,L as P,a0 as j}from"./index-
|
|
1
|
+
import{Y as p,Z as f,_ as g,p as v,j as e,B as x,$ as N,L as P,a0 as j}from"./index-X11XkRkb.js";import{P as y}from"./Picker-95_pkfVu.js";import{Q as b,u as w}from"./useBaseQuery-C_54ul4D.js";import{P as S,S as R}from"./parts-DVVBI72d.js";import{v as E,w as k,S as F}from"./useScrollLock-DDlrhOw8.js";import{u as M}from"./me-DnLqgT3l.js";import"./chevron-down-865lxBex.js";import"./check-BlRwZrSR.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-CTYgZt5m.js";import"./inertValue-CLaAaX62.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-BuDWW6rb.js";import"./getPseudoElementBounds-CFaDUKhY.js";import"./CompositeList-OHWH8W1h.js";import"./card-CzVTF25b.js";var A=class extends b{constructor(s,r){super(s,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,r){const{state:n}=s,l=super.createResult(s,r),{isFetching:o,isRefetching:i,isError:u,isRefetchError:d}=l,t=n.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",m=u&&t==="backward",h=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(r,n.data),hasPreviousPage:p(r,n.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:m,isFetchingPreviousPage:h,isRefetchError:d&&!c&&!m,isRefetching:i&&!a&&!h}}};function C(s,r){return w(s,A)}const D=[{value:"unresolved",label:"Needs attention"},...k.map(s=>({value:s,label:F[s]})),{value:"all",label:"Everything"}];function L(s,r=new Date){const n=new Date(s),l=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),o=Math.round((l(r)-l(n))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function V(){const s=M(),{status:r="unresolved",site:n}=g.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),i=C(j(r,n)),u=i.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=L(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(S,{title:"Activity",sub:`Every site, newest first${n?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[D.map(t=>e.jsx(x,{size:"sm",variant:r===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsx(y,{"aria-label":"Site",size:"sm",className:"w-auto min-w-40 text-foreground",value:n??"",onChange:t=>o({site:t||void 0}),options:[{value:"",label:"All sites"},...s.projects.map(t=>({value:t.uid,label:t.name}))]})]})]}),i.isPending&&e.jsx(N,{rows:4}),i.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),i.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:r==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":r==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(P,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(R,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:E(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),i.hasNextPage&&e.jsx("div",{children:e.jsx(x,{variant:"outline",size:"sm",disabled:i.isFetchingNextPage,onClick:()=>void i.fetchNextPage(),children:i.isFetchingNextPage?"Reading…":"Show older"})})]})}export{V as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,i as b,k as f,j as d,h as m}from"./index-
|
|
1
|
+
import{r as a,i as b,k as f,j as d,h as m}from"./index-X11XkRkb.js";import{m as A}from"./useScrollLock-DDlrhOw8.js";const x=a.createContext(void 0);function k(){const e=a.useContext(x);if(e===void 0)throw new Error(b(13));return e}const g={imageLoadingStatus:()=>null},z=a.forwardRef(function(t,r){const{className:v,render:p,style:s,...c}=t,[n,o]=a.useState("idle"),i={imageLoadingStatus:n},u=a.useMemo(()=>({imageLoadingStatus:n,setImageLoadingStatus:o}),[n,o]),l=f("span",t,{state:i,ref:r,props:c,stateAttributesMapping:g});return d.jsx(x.Provider,{value:u,children:l})}),R=a.forwardRef(function(t,r){const{className:v,render:p,delay:s=0,style:c,...n}=t,{imageLoadingStatus:o}=k(),[i,u]=a.useState(s===0),l=A();return a.useEffect(()=>(s>0?l.start(s,()=>u(!0)):u(!0),l.clear),[l,s]),f("span",t,{state:{imageLoadingStatus:o},ref:r,props:n,stateAttributesMapping:g,enabled:o!=="loaded"&&(s===0||i)})});function h({className:e,size:t="default",...r}){return d.jsx(z,{"data-slot":"avatar","data-size":t,className:m("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),...r})}function M({className:e,...t}){return d.jsx(R,{"data-slot":"avatar-fallback",className:m("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{h as A,M as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as a,h as n,o}from"./index-
|
|
1
|
+
import{m as a,h as n,o}from"./index-X11XkRkb.js";import{u as d}from"./useRender-BZe0PUs7.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,h as t}from"./index-
|
|
1
|
+
import{j as s,h as t}from"./index-X11XkRkb.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,ak as o,i as R,E as v,bb as w,ai as C,f as T,e as m,l as h,b6 as D}from"./index-
|
|
1
|
+
import{r,ak as o,i as R,E as v,bb as w,ai as C,f as T,e as m,l as h,b6 as D}from"./index-X11XkRkb.js";function k(e){return e?.ownerDocument||document}const F={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},x={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},S={disabled:!1,...x},B={valid(e){return e===null?null:e?{"data-valid":""}:{"data-invalid":""}}},y={invalid:void 0,name:void 0,validityData:{state:F,errors:[],error:"",value:"",initialValue:null},setValidityData:o,disabled:void 0,setTouched:o,setDirty:o,setFilled:o,setFocused:o,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:S,registerFieldControl:o,validation:{getValidationProps:(e,t=v)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:o,getInputControl:()=>null,commit:async()=>{},change:o}},L=r.createContext(y);function A(e=!0){const t=r.useContext(L);if(t.setValidityData===o&&!e)throw new Error(R(28));return t}const P=r.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:o,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function $(){return r.useContext(P)}let b=0;function _(e,t="mui"){const[n,s]=r.useState(e),i=e||n;return r.useEffect(()=>{n==null&&(b+=1,s(`${t}-${b}`))},[n,t]),i}const E=w.useId;function M(e,t){if(E!==void 0){const n=E();return e??(t?`${t}-${n}`:n)}return _(e,t)}function O(e){return M(e,"base-ui")}const U=r.createContext({controlId:void 0,registerControlId:o,labelId:void 0,setLabelId:o,messageIds:[],setMessageIds:o,getDescriptionProps:e=>e});function V(){return r.useContext(U)}function z(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:l}=V(),a=O(t),u=n?i:void 0,c=C(()=>Symbol()),d=r.useRef(!1),I=r.useRef(t!=null),g=T(()=>{!d.current||l===o||(d.current=!1,l(c.current,void 0))});return m(()=>{if(l===o)return;let f;if(n){const p=s?.current;h(p)&&p.closest("label")!=null?f=t??null:f=u??a}else if(t!=null)I.current=!0,f=t;else if(I.current)f=a;else{g();return}if(f===void 0){g();return}d.current=!0,l(c.current,f)},[t,s,u,l,n,a,c,g]),r.useEffect(()=>g,[g]),i??a}function Y(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function j(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&D(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function q(e){return"composedPath"in e?e.composedPath()[0]:e.target}function G({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=r.useRef(e!==void 0),[l,a]=r.useState(t),u=i?e:l,c=r.useCallback(d=>{i||a(d)},[]);return[u,c]}function H(e,t,n,s,i=!0,l){const{registerFieldControl:a}=A(),u=C(()=>Symbol());m(()=>{const c=u.current;if(!i){a(c,void 0);return}a(c,{controlRef:e,getValue:s,id:t,name:l,value:n})},[e,i,s,t,l,a,u,n]),m(()=>{const c=u.current;return()=>{a(c,void 0)}},[a,u])}const J="none",K="trigger-press",W="trigger-hover",X="trigger-focus",Q="outside-press",Z="item-press",ee="close-press",te="focus-out",ne="escape-key",se="list-navigation",oe="cancel-open",ae="sibling-open",re="disabled",ie="missing",le="initial",ue="imperative-action",ce="window-resize";function de(e,t,n,s){let i=!1,l=!1;const a=s??v;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){l=!0},get isCanceled(){return i},get isPropagationAllowed(){return l},trigger:n,...a}}export{z as A,ce as B,le as C,ie as D,ee as E,j as a,W as b,de as c,re as d,$ as e,B as f,q as g,A as h,ue as i,V as j,G as k,H as l,Y as m,J as n,k as o,X as p,ne as q,Z as r,Q as s,K as t,O as u,ae as v,M as w,te as x,se as y,oe as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as J,r as g,i as A,k as I,aj as Q,E as N,j as a,e as X,B as _,h as O}from"./index-
|
|
1
|
+
import{c as J,r as g,i as A,k as I,aj as Q,E as N,j as a,e as X,B as _,h as O}from"./index-X11XkRkb.js";import{p as G,a7 as z,P as L,q as Z,an as ee,F as te,M as ne,N as oe,Q as se,g as ae,al as re,h as ie,R as le,Y as ue,u as de,ao as pe,c as ce,d as ge,e as fe}from"./useScrollLock-DDlrhOw8.js";import{c as V,E as me,u as H,g as xe,a as Pe,i as Ce}from"./createBaseUIEventDetails-CTYgZt5m.js";import{t as he,u as Se,C as De,i as Oe}from"./inertValue-CLaAaX62.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ut,r as a,k as me,ak as lt,g as _t,l as ue,aF as dt,ai as ft,f as de,e as ve,n as _e,i as Ee,am as Gt,aj as pt,m as Me,al as Ut,j as D,E as Le,aG as Vt,aH as Yt,aI as Xt,aJ as Kt,h as Ie}from"./index-
|
|
1
|
+
import{c as ut,r as a,k as me,ak as lt,g as _t,l as ue,aF as dt,ai as ft,f as de,e as ve,n as _e,i as Ee,am as Gt,aj as pt,m as Me,al as Ut,j as D,E as Le,aG as Vt,aH as Yt,aI as Xt,aJ as Kt,h as Ie}from"./index-X11XkRkb.js";import{C as zt}from"./check-BlRwZrSR.js";import{i as Ge,z as Wt,m as Re,A as ke,B as gt,C as $t,a as le,D as qt,E as Fe,G as Jt,H as Qt,T as Ue,I as Ke,J as ze,K as Zt,L as Ve,l as ye,M as en,p as tn,N as nn,O as on,o as rn,Q as sn,U as an,R as cn,V as mt,P as un,f as ln,W as ht,c as dn,d as fn,X as pn,Y as gn,Z as mn,g as hn,_ as vn,F as bn,h as En,e as Rn,$ as xn,a0 as Cn,a1 as yn,a2 as Tn,a3 as Mn,j as Pn,k as In,a4 as nt,a5 as ot,a6 as Sn}from"./useScrollLock-DDlrhOw8.js";import{m as rt,o as be,a as ee,c as Z,p as Pe,g as Ae,t as vt,q as bt,b as ie,r as We,u as je,s as On,v as Te,k as wn,w as st,x as Ye,y as kn,i as Fn,z as Nn}from"./createBaseUIEventDetails-CTYgZt5m.js";import{u as Et,C as Dn,a as Ln}from"./CompositeList-OHWH8W1h.js";import{b as An,g as jn,u as Hn,c as Bn,a as _n,d as Gn,e as Un,f as Vn,i as Yn,h as Xn}from"./getPseudoElementBounds-CFaDUKhY.js";import{p as Kn,g as zn}from"./dialog-DZbUuBSr.js";import{C as Wn}from"./CompositeItem-CkiEeVQd.js";import{b as $n,t as qn,u as Rt,C as Jn,c as Qn,i as Zn,a as eo}from"./inertValue-CLaAaX62.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,s as h,C as p,j as e,G as m,L as d,B as f,D as g,F as j}from"./index-
|
|
1
|
+
import{r as l,s as h,C as p,j as e,G as m,L as d,B as f,D as g,F as j}from"./index-X11XkRkb.js";import{u as N,a as b}from"./zod-D1EnJi4o.js";import{L as k,I as y}from"./label-8lYoT07T.js";import"./createBaseUIEventDetails-CTYgZt5m.js";const S=g({email:j().trim().email("An email address")});function E(){const[s,r]=l.useState(""),[n,a]=l.useState(""),{register:c,handleSubmit:x,formState:t}=N({resolver:b(S)}),u=x(async({email:i})=>{r("");try{await h.requestReset(i),a(i)}catch(o){r(o instanceof p?o.message:"Could not reach the server. Try again.")}});return n?e.jsx(m,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Check your mail"}),e.jsxs("p",{className:"m-0 text-muted-foreground",children:["If ",e.jsx("span",{className:"text-foreground",children:n})," has an account here, a link is on its way. It works once and expires in an hour."]}),e.jsxs("p",{className:"m-0 text-[13px] text-muted-foreground",children:["Nothing after a minute? Check the spelling and the spam folder, or"," ",e.jsx("button",{type:"button",className:"text-foreground underline underline-offset-4",onClick:()=>a(""),children:"try another address"}),"."]}),e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(d,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Back to sign in"})})]})}):e.jsx(m,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:"Forgot your password?"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Enter your email. A link is sent to it, and the link lets you choose a new password."})]}),s&&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:s}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"email",children:"Email"}),e.jsx(y,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!t.errors.email,...c("email")}),t.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:t.errors.email.message})]}),e.jsx(f,{type:"submit",size:"lg",loading:t.isSubmitting,children:t.isSubmitting?"Sending…":"Send me the link"}),e.jsx("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:e.jsx(d,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Back to sign in"})})]})})}export{E as component};
|