@snagset/server 0.1.55 → 0.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +3 -0
- package/dist/app.js.map +1 -1
- package/dist/config.generated.js +2 -1
- package/dist/config.generated.js.map +1 -1
- package/dist/db/migrations/0019_trello_provider.no-txn.sql +11 -0
- package/dist/integrations/inbound.js +2 -0
- package/dist/integrations/inbound.js.map +1 -1
- package/dist/integrations/outbox.js +22 -3
- package/dist/integrations/outbox.js.map +1 -1
- package/dist/integrations/store.js +2 -2
- package/dist/integrations/store.js.map +1 -1
- package/dist/integrations/trello.js +147 -0
- package/dist/integrations/trello.js.map +1 -0
- package/dist/jobs/set.js +2 -0
- package/dist/jobs/set.js.map +1 -1
- package/dist/routes/integrations.js +181 -6
- package/dist/routes/integrations.js.map +1 -1
- package/dist/routes/threads.js.map +1 -1
- package/package.json +1 -1
- package/static/dashboard/assets/{CompositeItem-CvulL3yx.js → CompositeItem-B0Gv-UGy.js} +1 -1
- package/static/dashboard/assets/{CompositeList-Cc2N74pm.js → CompositeList-DJzkqbsI.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-U7sGR-7r.js → ConfirmDialog-DrJjmykZ.js} +1 -1
- package/static/dashboard/assets/{CopyButton-BPRG72bK.js → CopyButton-N4ZGq5sM.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-BB4olvUX.js → FieldItemContext-Btlb65DI.js} +1 -1
- package/static/dashboard/assets/{InstallTag-07IMzmgd.js → InstallTag-ErmrqxJG.js} +1 -1
- package/static/dashboard/assets/{InstanceRows-2HV0g2Tc.js → InstanceRows-qItZIB6E.js} +1 -1
- package/static/dashboard/assets/{McpTokens-j7R5vQdJ.js → McpTokens-BANlGby-.js} +1 -1
- package/static/dashboard/assets/{Picker-DWjVDWI6.js → Picker-BGDXZjRG.js} +1 -1
- package/static/dashboard/assets/{SaveState-BhDPRdEB.js → SaveState-C5sUD5wu.js} +1 -1
- package/static/dashboard/assets/{_app-CsF903Bg.js → _app-Bskz-yjz.js} +1 -1
- package/static/dashboard/assets/{_app-CmSSR7Fr.js → _app-QhVaTUQt.js} +1 -1
- package/static/dashboard/assets/{activity-CiElrW9b.js → activity-RabDpuwi.js} +1 -1
- package/static/dashboard/assets/{arrow-left-BpbzTF1L.js → arrow-left-DJWxyBo6.js} +1 -1
- package/static/dashboard/assets/{avatar-B1TDu8wQ.js → avatar-CN3-8DpI.js} +1 -1
- package/static/dashboard/assets/{badge-DNL0s8ND.js → badge-C54dE8rx.js} +1 -1
- package/static/dashboard/assets/{card-BV6fjgTi.js → card-Dxk95cVf.js} +1 -1
- package/static/dashboard/assets/{check-nWqm4QA9.js → check-CK4ao5He.js} +1 -1
- package/static/dashboard/assets/{chevron-down-B0SxNOjK.js → chevron-down-OtEbsKDP.js} +1 -1
- package/static/dashboard/assets/{chevron-right-5IvSSfyx.js → chevron-right-DsIeYYan.js} +1 -1
- package/static/dashboard/assets/{copy-BlkC45lz.js → copy-oQJtUs23.js} +1 -1
- package/static/dashboard/assets/{createBaseUIEventDetails-DJQs5QD1.js → createBaseUIEventDetails-CtitjO53.js} +1 -1
- package/static/dashboard/assets/{dialog-wNx4TYmI.js → dialog-PoGeAS0T.js} +1 -1
- package/static/dashboard/assets/{dropdown-menu-Dg6I8B9T.js → dropdown-menu-CnT2RuY9.js} +1 -1
- package/static/dashboard/assets/{forgot-BskfFbWy.js → forgot-C2yLPZRe.js} +1 -1
- package/static/dashboard/assets/{getPseudoElementBounds-BI6SgJKV.js → getPseudoElementBounds-1HRS6at-.js} +1 -1
- package/static/dashboard/assets/{image-off-CmXQl4Bm.js → image-off-DUeMoP3X.js} +1 -1
- package/static/dashboard/assets/{index-DJIyUCPa.js → index-DCtWnS4U.js} +3 -3
- package/static/dashboard/assets/{inertValue-DFM3yqxg.js → inertValue-DvQ1EW5I.js} +1 -1
- package/static/dashboard/assets/{invite-Gb1SSWEm.js → invite-CGRft1Wf.js} +1 -1
- package/static/dashboard/assets/{label-BO35zXgP.js → label-Br7CuW71.js} +1 -1
- package/static/dashboard/assets/{layout-grid-DHSlCLw7.js → layout-grid-D8FSCXx_.js} +1 -1
- package/static/dashboard/assets/me-Bz7e5FMG.js +1 -0
- package/static/dashboard/assets/{parts-Cf55Yb70.js → parts-BE9o8mAH.js} +1 -1
- package/static/dashboard/assets/{plus-AlvHtj_r.js → plus-CZbLvWG1.js} +1 -1
- package/static/dashboard/assets/{reset-VLjsnDUf.js → reset-ZYeb2Axs.js} +1 -1
- package/static/dashboard/assets/{s._site-BOIQF8cS.js → s._site-DT0FXe9C.js} +1 -1
- package/static/dashboard/assets/s._site.comments-Ci3k9e5e.js +49 -0
- package/static/dashboard/assets/{s._site.reviewers-C2y2wYcP.js → s._site.reviewers-CMYsq2DL.js} +1 -1
- package/static/dashboard/assets/{s._site.settings-Cp8YeA4h.js → s._site.settings-CWNTmj8T.js} +1 -1
- package/static/dashboard/assets/{setup-DZSbxR5u.js → setup-C7sY4SXb.js} +1 -1
- package/static/dashboard/assets/{sign-in-BP-OTd-h.js → sign-in-DzeEwdj0.js} +1 -1
- package/static/dashboard/assets/{sign-up-Jei-X8L6.js → sign-up-iJvFq_R3.js} +1 -1
- package/static/dashboard/assets/{sites-nxU5wRJD.js → sites-DiBJvBBN.js} +1 -1
- package/static/dashboard/assets/studio-CK_HRLS5.js +1 -0
- package/static/dashboard/assets/{studio-BXjjp00e.js → studio-QR3vjisG.js} +1 -1
- package/static/dashboard/assets/{studio.index-5Z2JWyir.js → studio.index-B2WSVF56.js} +1 -1
- package/static/dashboard/assets/studio.integrations-BYz4cDCb.js +16 -0
- package/static/dashboard/assets/{studio.members-UOCj4scg.js → studio.members-DPqoth_D.js} +1 -1
- package/static/dashboard/assets/{studio.plan-CXzTImV1.js → studio.plan-C3t2S9GZ.js} +1 -1
- package/static/dashboard/assets/{sun-DhMBVtvb.js → sun-ChMFVIDA.js} +1 -1
- package/static/dashboard/assets/{switch-BbV1tcPM.js → switch-D0flLg1r.js} +1 -1
- package/static/dashboard/assets/{table-BlJV8zDx.js → table-PCTyuzaU.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-DfnIJQvt.js → useAriaLabelledBy-Bu-GFL0B.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-ic0hLoWO.js → useBaseQuery-Cw1dAAOb.js} +1 -1
- package/static/dashboard/assets/{useCompositeItem-Dj-Nx-92.js → useCompositeItem-CHXWc-fj.js} +1 -1
- package/static/dashboard/assets/useQuery-B9Vos2vJ.js +1 -0
- package/static/dashboard/assets/useRender-BJibc2kV.js +1 -0
- package/static/dashboard/assets/{useScrollLock-tzg3KUOw.js → useScrollLock-d8peZTpK.js} +1 -1
- package/static/dashboard/assets/{useValueChanged-S18DT6ky.js → useValueChanged-CEhqkcjS.js} +1 -1
- package/static/dashboard/assets/{users-CklOnVh9.js → users-DGXcs62X.js} +1 -1
- package/static/dashboard/assets/{welcome-DmIcYw0Y.js → welcome-FVEqWF-E.js} +1 -1
- package/static/dashboard/assets/{widget-signin-B3lImWqb.js → widget-signin-CDnZ1WcR.js} +1 -1
- package/static/dashboard/assets/{you-CIO1vIEc.js → you-DaUXbySS.js} +1 -1
- package/static/dashboard/assets/{zod-C59-1wE1.js → zod-Cs-QZqu7.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-Bu3DC102.js +0 -1
- package/static/dashboard/assets/s._site.comments-CTk77ILo.js +0 -49
- package/static/dashboard/assets/studio-C1Um7zxi.js +0 -1
- package/static/dashboard/assets/studio.integrations-BjFXv6iz.js +0 -16
- package/static/dashboard/assets/useQuery-qBadQDJJ.js +0 -1
- package/static/dashboard/assets/useRender-TrgqqhB3.js +0 -1
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import{c as re,r as x,i as Is,ai as Bs,aj as Ps,e as Qe,ak as Xe,al as _s,m as Fs,E as Ls,k as os,j as e,am as Os,g as Vs,h as A,B as $,an as is,ao as qs,a8 as Ze,ap as Ye,a6 as ls,C as Us,aq as es,p as Ks,ar as Ws,as as ss,at as Hs,au as Gs,av as Js,aw as Qs,ax as Xs,ay as Zs,az as Ys,aA as et,aB as st,aC as tt,q as Re,aD as Ne,L as ds,D as nt,ae as ts,F as pe,aE as at,A as Te}from"./index-DJIyUCPa.js";import{u as we}from"./useQuery-qBadQDJJ.js";import{C as cs}from"./check-nWqm4QA9.js";import{f as rt,e as ot,h as it,j as lt,u as ns,k as dt,l as ct,c as ut,n as mt}from"./createBaseUIEventDetails-DJQs5QD1.js";import{x as ht,y as xt,S as fe,r as pt,v as Pe,w as Ee,s as Me}from"./useScrollLock-tzg3KUOw.js";import{u as ft}from"./FieldItemContext-BB4olvUX.js";import{u as gt}from"./useAriaLabelledBy-DfnIJQvt.js";import{u as bt}from"./useValueChanged-S18DT6ky.js";import{a as jt,u as vt,t as yt}from"./inertValue-DFM3yqxg.js";import{D as te,e as ne,f as ae,h as he,i as $e,j as W,k as us,E as as,l as Ie,m as J,S as kt}from"./dropdown-menu-Dg6I8B9T.js";import{L as Ke,I as Be}from"./label-BO35zXgP.js";import{A as ge,a as be}from"./avatar-B1TDu8wQ.js";import{i as ms,j as hs,l as xs,k as ps,m as fs,n as gs,X as Nt}from"./dialog-wNx4TYmI.js";import{C as bs}from"./ConfirmDialog-U7sGR-7r.js";import{b as We,S as js,E as qe}from"./parts-Cf55Yb70.js";import{C as Ce}from"./chevron-down-B0SxNOjK.js";import{C as wt}from"./copy-BlkC45lz.js";import{I as Ct}from"./image-off-CmXQl4Bm.js";import{C as St}from"./chevron-right-5IvSSfyx.js";import{I as $t}from"./InstallTag-07IMzmgd.js";import{u as Mt}from"./me-Bu3DC102.js";import{A as At}from"./arrow-left-BpbzTF1L.js";import"./useBaseQuery-ic0hLoWO.js";import"./CompositeList-Cc2N74pm.js";import"./getPseudoElementBounds-BI6SgJKV.js";import"./CompositeItem-CvulL3yx.js";import"./useCompositeItem-Dj-Nx-92.js";import"./card-BV6fjgTi.js";import"./isElementDisabled-CwHw_lZC.js";/**
|
|
2
|
-
* @license lucide-react v1.39.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Dt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],zt=re("columns-2",Dt);/**
|
|
7
|
-
* @license lucide-react v1.39.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Rt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Tt=re("ellipsis",Rt);/**
|
|
12
|
-
* @license lucide-react v1.39.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Et=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],It=re("inbox",Et);/**
|
|
17
|
-
* @license lucide-react v1.39.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Bt=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Pt=re("list",Bt);/**
|
|
22
|
-
* @license lucide-react v1.39.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const _t=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ft=re("pencil",_t);/**
|
|
27
|
-
* @license lucide-react v1.39.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const Lt=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Ot=re("rotate-cw",Lt);/**
|
|
32
|
-
* @license lucide-react v1.39.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const Vt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],vs=re("trash-2",Vt);/**
|
|
37
|
-
* @license lucide-react v1.39.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const qt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Ut=re("user-plus",qt);/**
|
|
42
|
-
* @license lucide-react v1.39.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Kt=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Wt=re("user-round",Kt);function Ht(s){if(!s)return null;for(const n of s.elements){const r=n.tagName;if(r==="BUTTON"||r==="INPUT"){const o=n;if(o.type==="submit")return o}}return null}function ys(s){return{checked(n){return s.indeterminate?{}:n?{"data-checked":""}:{"data-unchecked":""}},...rt}}const Gt=x.createContext(void 0);function Jt(){return x.useContext(Gt)}const ks=x.createContext(void 0);function Qt(){const s=x.useContext(ks);if(s===void 0)throw new Error(Is(14));return s}const Xt="data-parent",Zt=x.forwardRef(function(n,r){const{checked:o,className:p,defaultChecked:l=!1,"aria-labelledby":d,disabled:y=!1,form:m,id:h,indeterminate:g=!1,inputRef:f,name:c,onCheckedChange:N,parent:a=!1,readOnly:w=!1,render:B,required:k=!1,uncheckedValue:b,value:R,nativeButton:T=!1,style:V,...M}=n,{clearErrors:v}=ot(),{disabled:D,name:Q,setDirty:q,setFilled:U,setFocused:C,setTouched:E,state:L,validationMode:je,validityData:oe,validation:F}=it(),ve=ft(),{labelId:u,controlId:O,registerControlId:z,getDescriptionProps:Ae}=lt(),I=Jt(),H=I?.allValues===void 0?void 0:I.parent,ie=H!==void 0,P=D||ve.disabled||I?.disabled||y,X=Q??c,_=R??X,De=ns(),Z=ns();let G=h||O;ie&&(a?G=Z:_!==void 0?G=`${H.id}-${_}`:G||=Z);let t={};ie&&(a?t=H.getParentProps():_!==void 0&&(t=H.getChildProps(_)));const{checked:i=o,indeterminate:S=g,onCheckedChange:Y,...le}=t,ee=I?.value,de=x.useRef(null),xe=Bs(()=>Symbol()),_e=x.useRef(!1),{getButtonProps:Ss,buttonRef:$s}=Ps({disabled:P,native:T}),ye=I?.validation??F,[K,Ms]=dt({controlled:_!==void 0&&ee!==void 0&&!a?ee.includes(_):i,default:l,name:"Checkbox",state:"checked"}),Fe=ie?!!i:K,ke=ie&&S||g;Qe(()=>{z!==Xe&&(_e.current=!0,z(xe.current,G))},[G,z,xe]),x.useEffect(()=>{const j=xe.current;return()=>{!_e.current||z===Xe||(_e.current=!1,z(j,void 0))}},[z,xe]),ct(de,De,K,void 0,!I&&!P,c);const ce=x.useRef(null),Ge=ye.registerInput,Je=I?_:void 0,As=x.useCallback(j=>Ge(j,{controlRef:de,value:Je}),[Ge,Je]),Ds=_s(f,ce,a?void 0:As),zs=gt(d,u,ce,!T,G??void 0);Qe(()=>{ce.current&&(ce.current.indeterminate=ke,K&&U(!0))},[K,ke,U]),bt(K,()=>{I||(v(X),U(K),q(K!==oe.initialValue),ye.change(K))});const Rs=Fs({checked:K,disabled:P,form:m,name:a?void 0:X,id:T?void 0:G??void 0,required:k,ref:Ds,style:X?ht:xt,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(j){if(j.nativeEvent.defaultPrevented)return;if(w){j.preventDefault();return}const se=j.currentTarget.checked,ue=ut(mt,j.nativeEvent);if(N?.(se,ue),!ue.isCanceled&&(Y?.(se,ue),!ue.isCanceled&&(Ms(se),_!==void 0&&I!==void 0&&!a&&!ie))){const me=se?[...I.value,_]:I.value.filter(ze=>ze!==_);I.setValue(me,ue)}},onClick(j){j.stopPropagation()},onFocus(){de.current?.focus()}},R!==void 0?{value:(I?K&&R:R)||""}:Ls,Ae,j=>ye.getValidationProps(P,j));x.useEffect(()=>{if(!H||_===void 0)return;const j=H.disabledStatesRef.current;return j.set(_,P),()=>{j.delete(_)}},[H,P,_]);const Le=x.useMemo(()=>({...L,checked:Fe,disabled:P,readOnly:w,required:k,indeterminate:ke}),[L,Fe,P,w,k,ke]),Ts=ys(Le),Es=os("span",n,{state:Le,ref:[$s,de,r],props:[{id:T?G??void 0:De,role:"checkbox","aria-checked":ke?"mixed":Fe,"aria-readonly":w||void 0,"aria-required":k||void 0,"aria-labelledby":zs,[Xt]:a?"":void 0,onFocus(){P||C(!0)},onBlur(){const j=ce.current;j&&(E(!0),C(!1),je==="onBlur"&&ye.commit(I?ee:j.checked))},onKeyDown(j){if(j.key!=="Enter"||(j.preventBaseUIHandler(),j.defaultPrevented))return;const se=ce.current?.form??null,ue=j.currentTarget,me=j.nativeEvent,ze=j.preventDefault,Oe=me.preventDefault;let Ve=!1;j.preventDefault=()=>{Ve=!0,ze.call(j)},me.preventDefault=()=>{Ve=!0,Oe.call(me)},Oe.call(me),Vs(ue).queueMicrotask(()=>{j.preventDefault=ze,me.preventDefault=Oe,Ve||Ht(se)?.click()})},onClick(j){if(w||P)return;j.preventDefault();const se=ce.current;se&&Os(se,j)}},M,le,Ss,Ae,j=>ye.getValidationProps(P,j)],stateAttributesMapping:Ts});return e.jsxs(ks.Provider,{value:Le,children:[Es,!K&&!I&&X&&!a&&b!==void 0&&e.jsx("input",{type:"hidden",form:m,name:X,value:b,disabled:P}),e.jsx("input",{...Rs,suppressHydrationWarning:!0})]})}),Yt=x.forwardRef(function(n,r){const{render:o,className:p,style:l,keepMounted:d=!1,...y}=n,m=Qt(),h=m.checked||m.indeterminate,{mounted:g,transitionStatus:f,setMounted:c}=jt(h),N=x.useRef(null),a={...m,transitionStatus:f};vt({open:h,ref:N,onComplete(){h||c(!1)}});const B={...ys(m),...yt},k=d||g,b=os("span",n,{ref:[r,N],state:a,stateAttributesMapping:B,props:y});return k?b:null});function en({className:s,...n}){return e.jsx(Zt,{"data-slot":"checkbox",className:A("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...n,children:e.jsx(Yt,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e.jsx(cs,{})})})}function Ns({className:s,...n}){return e.jsx("textarea",{"data-slot":"textarea",className:A("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",s),...n})}function sn({rounds:s,active:n,onPick:r,onStart:o,starting:p}){const l=s.find(f=>f.number===n),d=(s[0]?.number??0)+1,[y,m]=x.useState(!1),[h,g]=x.useState("");return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-line-strong bg-muted px-2.5 text-[12.5px] font-semibold text-foreground","aria-label":"Round"}),children:[e.jsx(Ot,{className:"size-3.5"}),l?.name??`Round ${n}`,e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ae,{align:"start",className:"w-[260px]",children:[e.jsxs(he,{children:[e.jsx($e,{children:"Rounds"}),s.map(f=>e.jsxs(W,{onClick:()=>r(f.number),children:[e.jsx("span",{className:"truncate",children:f.name}),e.jsxs("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:[f.closed?"closed":"open",f.unresolved>0?` · ${f.unresolved} to go`:""]})]},f.id))]}),e.jsx(us,{}),e.jsx(W,{onClick:()=>{g(`Round ${d}`),m(!0)},children:"Start a new round…"})]})]}),l&&e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[l.closed?"closed":"open",l.unresolved>0?` · ${l.unresolved} to go`:l.closed?"":" · all clear"]}),e.jsx(ms,{open:y,onOpenChange:m,children:e.jsx(hs,{children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),!(!h.trim()||p)&&(o(h.trim()),m(!1))},children:[e.jsxs(xs,{children:[e.jsx(ps,{children:"Start a new round"}),e.jsx(fs,{children:"A round is one pass of feedback, and it runs beside the others: starting one closes none of them. Reviewers pick a round in the widget and their comments go to it. Close or archive rounds in Settings."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(Ke,{htmlFor:"round-name",children:"Name"}),e.jsx(Be,{id:"round-name",value:h,onChange:f=>g(f.target.value),autoFocus:!0})]}),e.jsxs(gs,{children:[e.jsx($,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsx($,{type:"submit",disabled:!h.trim()||p,children:p?"Starting…":"Start the round"})]})]})})})]})}function ws({rounds:s,onMove:n,busy:r}){return s.length===0?null:e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{variant:"outline",size:"sm",disabled:r}),children:"Move to round…"}),e.jsx(ae,{align:"start",className:"w-[240px]",children:e.jsxs(he,{children:[e.jsx($e,{children:"Move to round"}),s.map(o=>e.jsxs(W,{onClick:()=>n(o.number),children:[e.jsx("span",{className:"truncate",children:o.name}),e.jsx("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:o.closed?"closed":"open"})]},o.id))]})})]})}const tn={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"};function nn(s,n,r={}){const o=r.fence??((v,D)=>D),p=r.statusLabel??(v=>tn[v]??v),l=s.anchor??{},d=s.context??{},y=l.page,m=y?.route??s.route??"/",h=y?.origin??n.origin??"",g=y?.pathname??m,f=h?`${h}${g}`:g,c=typeof l.label=="string"?o("label",l.label):"",N=l.element??l,a=[];a.push(`# ${s.key}${c?` — ${c}`:""}`),a.push(""),a.push(`${n.name} · ${p(s.status)} · left by ${s.createdBy?.name?o("name",s.createdBy.name):"someone"} on ${s.createdAt.slice(0,10)}`+(s.assignee?` · assigned to ${o("name",s.assignee.name)}`:"")),a.push(""),a.push("## Where to look"),a.push(""),a.push(`- Page: ${f}`),h&&a.push(`- Open on the page: ${h}${g}?${is("t")}=${encodeURIComponent(s.key)}`),c&&a.push(`- Element: ${c}`);const w=typeof l.css=="string"?l.css:typeof N.selector=="string"?N.selector:"";if(w&&a.push(`- Selector: \`${o("selector",w)}\``),typeof l.domid=="string"&&a.push(`- DOM id: \`#${o("selector",l.domid)}\``),typeof N.role=="string"){const v=typeof N.accessibleName=="string"?` “${o("label",N.accessibleName)}”`:"";a.push(`- Role: ${o("label",N.role)}${v}`)}typeof N.testId=="string"&&a.push(`- Test id: ${o("label",N.testId)}`);const B=l.text;B?.exact&&a.push(`- Text: “${o("label",B.exact)}”`),a.push(`- Anchor: ${s.anchorState??"unknown"}`),a.push(""),a.push("## What's wrong"),a.push("");const k=(s.comments??[]).filter(v=>v.body!==null);k.length===0&&a.push("> (no comment — a pin with no words)");for(const v of k){const D=v.author?.name?o("name",v.author.name):"Anonymous";a.push(`> **${D}${v.author?.kind==="agent"?" (agent)":""}** — ${v.createdAt.slice(0,16).replace("T"," ")}`);for(const Q of o("body",String(v.body)).split(`
|
|
47
|
-
`))a.push(`> ${Q}`);a.push(">")}a[a.length-1]===">"&&a.pop(),a.push(""),a.push("## Environment"),a.push("");const b=d.derived,R=d.viewport;(b?.browser||b?.os)&&a.push(`- Browser: ${[b.browser,b.os,b.device].filter(Boolean).join(" · ")}`),R?.w&&a.push(`- Viewport: ${R.w} × ${R.h}${R.dpr?` @${Math.round(R.dpr*10)/10}x`:""}`),d.prefersColorScheme&&a.push(`- Colour scheme: ${d.prefersColorScheme}`),d.language&&a.push(`- Language: ${d.language}`),d.ua&&a.push(`- User agent: ${o("label",String(d.ua))}`);const T=d.build;T&&Object.keys(T).length&&a.push(`- Build: ${Object.entries(T).map(([v,D])=>`${v}=${o("label",String(D))}`).join(", ")}`),a.push("");const V=d.breadcrumbs;if(V?.length){a.push(`## Breadcrumbs (${V.length}, oldest first)`),a.push("");for(const v of V)a.push(`- \`${String(v.t).slice(11,19)}\` ${v.type}${v.level?`/${v.level}`:""}: ${o("breadcrumb",String(v.message))}`);a.push("")}const M=s.attachments?.find(v=>v.kind==="screenshot")??s.attachments?.[0];if(M){a.push("## Screenshot"),a.push(""),a.push("Examine this screenshot for visual context — it is the viewport at the moment of the click."),a.push("");const v=M.url.startsWith("http")?M.url:`${n.dashboardOrigin??""}${M.url}`;a.push(``),a.push("")}return a.join(`
|
|
48
|
-
`).trimEnd()+`
|
|
49
|
-
`}function an(s,n){return nn(s,n,{statusLabel:r=>pt(r)?fe[r]:r})}function rn({thread:s,site:n,onStatus:r,onReply:o,replying:p,onClose:l,pool:d,onAssign:y,onAddPerson:m,trackers:h,onCreateIssue:g,creatingIssue:f,onEditComment:c,onDeleteComment:N,onDeleteThread:a,move:w,moderator:B=!0}){const k=s.anchor??{},b=s.context??{},R=typeof k.label=="string"?k.label:"",T=k.page,V=T?.route??s.route??"/",M=T?.origin??n.origin,v=M?`${M}${T?.pathname??V}?${is("t")}=${encodeURIComponent(s.key)}`:"",D=s.attachments?.find(u=>u.kind==="screenshot")??s.attachments?.[0],[Q,q]=x.useState(""),[U,C]=x.useState(""),[E,L]=x.useState(!1),[je,oe]=x.useState(!1),F=d.find(u=>u.isMe)?.id,ve=()=>{navigator.clipboard?.writeText(an(s,{name:n.name,...M?{origin:M}:{},dashboardOrigin:location.origin})),ls.success("Copied as a brief")};return e.jsxs("article",{className:"flex min-h-0 flex-1 flex-col","aria-label":`${s.key} — ${R||"a comment"}`,children:[e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border/60 px-4 py-2.5",children:[e.jsx("span",{className:"whitespace-nowrap font-mono text-[12px] text-muted-foreground",children:s.key}),e.jsx(ln,{status:s.status,onStatus:r}),e.jsx(hn,{assignee:s.assignee??null,pool:d,onAssign:y,onAddPerson:m}),(h??[]).map(u=>{const O=s.refs?.find(z=>z.provider===u&&z.kind===qs[u]&&z.status!=="detached");if(O){const z=u==="github"?`Issue #${O.externalId}`:u==="jira"?O.externalId:u==="slack"?"Slack message":/\/issue\/([A-Z][A-Z0-9]*-\d+)/.exec(O.url)?.[1]??`${Ze[u]} issue`;return e.jsxs($,{variant:"ghost",size:"sm",render:e.jsx("a",{href:O.url,target:"_blank",rel:"noreferrer"}),children:[e.jsx(as,{}),z]},u)}return g?e.jsx($,{variant:"ghost",size:"sm",disabled:!!f,onClick:()=>g(u),children:f===u?u==="slack"?"Posting…":"Creating…":u==="slack"?"Post to Slack":`Create ${Ze[u]} issue`},u):null}),e.jsx("div",{className:"flex-1"}),w&&e.jsx(ws,{rounds:w.rounds,onMove:w.onMove,busy:w.busy}),e.jsxs($,{variant:"ghost",size:"sm",onClick:ve,children:[e.jsx(wt,{}),"Copy as brief"]}),a&&e.jsx($,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${s.key}`,title:"Delete this thread",onClick:()=>L(!0),children:e.jsx(vs,{})}),e.jsx($,{variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:e.jsx(Nt,{})})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto px-4 py-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[16px] font-semibold leading-snug tracking-tight",children:R||"A comment on this page"}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[12.5px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:V}),M&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("a",{href:`${M}${T?.pathname??V}`,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-brand hover:underline",children:[M.replace(/^https?:\/\//,""),e.jsx(as,{className:"size-3"})]})]}),v&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("a",{href:v,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:"Open on the page"})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[!s.comments[0]?.body&&e.jsx("p",{className:"m-0 text-muted-foreground",children:"A pin with no words — the element says what it is about."}),s.comments.filter(u=>u.body!==null).map(u=>e.jsx(on,{comment:u,reply:u!==s.comments[0],mine:Ye(u,F),...c?{onEdit:O=>c(u.id,O)}:{},...N&&(B||Ye(u,F))?{onDelete:()=>N(u.id)}:{}},u.id)),e.jsxs("form",{className:"flex gap-2.5",onSubmit:async u=>{u.preventDefault();const O=Q.trim();if(!(!O||p)){C("");try{await o(O),q("")}catch(z){C(z instanceof Error?z.message:"Could not send that reply.")}}},children:[e.jsx(ge,{className:"size-6 shrink-0",children:e.jsx(be,{className:"bg-primary text-[10px] font-semibold text-primary-foreground",children:"you"})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 rounded-md border border-input bg-card p-2",children:[e.jsx(Ns,{"aria-label":"Reply",placeholder:`Reply to ${s.createdBy.name||"the reviewer"}…`,value:Q,onChange:u=>q(u.target.value),rows:2,className:"min-h-0 resize-none border-0 bg-transparent p-1 shadow-none focus-visible:ring-0"}),U&&e.jsx("p",{role:"alert",className:"m-0 text-[12px] text-destructive",children:U}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.status==="resolved"?e.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("open"),children:"Reopen"}):e.jsxs(e.Fragment,{children:[s.status!=="review"&&e.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("review"),children:"Mark in review"}),e.jsx($,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("resolved"),children:"Mark resolved"})]}),e.jsx($,{type:"submit",size:"sm",disabled:!Q.trim()||p,children:p?"Sending…":"Reply"})]})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(We,{children:"Screenshot"}),D?e.jsxs(e.Fragment,{children:[e.jsx("a",{href:D.url,target:"_blank",rel:"noreferrer",className:"block overflow-hidden rounded-lg border border-border bg-background",children:e.jsx("img",{src:D.url,alt:`The page when ${s.key} was left`,width:D.width,height:D.height,loading:"lazy",className:"block h-auto w-full"})}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:[D.width??"?"," × ",D.height??"?",b.prefersColorScheme?` · ${b.prefersColorScheme}`:""," · taken at the click, ",Pe(s.createdAt)," ·"," ",e.jsx("a",{href:D.url,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:"open full size"})]})]}):e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-dashed border-border px-3 py-3 text-[12.5px] text-muted-foreground",children:[e.jsx(Ct,{className:"size-4 shrink-0"}),e.jsx("span",{children:"No screenshot for this one — either no bucket was connected when it was left, or the reviewer turned the picture off. The element and the environment below are unaffected."})]}),e.jsx(cn,{ctx:b})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(We,{children:"Element"}),e.jsxs("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[R&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Label"}),e.jsx("dd",{className:"m-0",children:R})]}),typeof k.css=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Selector"}),e.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-ink-soft",children:k.css})]}),typeof k.domid=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"DOM id"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:["#",k.domid]})]}),typeof k.role=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Role"}),e.jsxs("dd",{className:"m-0",children:[k.role,typeof k.accessibleName=="string"?` “${k.accessibleName}”`:""]})]}),k.text?.exact&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Text"}),e.jsxs("dd",{className:"m-0",children:["“",String(k.text.exact),"”"]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Anchor"}),e.jsx("dd",{className:"m-0",children:e.jsx(dn,{state:s.anchorState})})]})]}),e.jsx(un,{ctx:b}),e.jsx(mn,{ctx:b})]}),a&&e.jsx(bs,{open:E,onOpenChange:L,title:`Delete ${s.key}?`,description:"Removes this comment thread and its screenshot for everyone. Linked issues in your tracker are not deleted.",confirmLabel:"Delete thread",busy:je,onConfirm:async()=>{oe(!0);try{await a(),L(!1)}catch{}finally{oe(!1)}}})]})}function on({comment:s,reply:n,mine:r,onEdit:o,onDelete:p}){const[l,d]=x.useState(!1),[y,m]=x.useState(""),[h,g]=x.useState(!1),[f,c]=x.useState(!1),[N,a]=x.useState(!1),w=r&&!!o,B=!!p,k=async()=>{const b=y.trim();if(!(!b||h||!o)){if(b===s.body){d(!1);return}g(!0);try{await o(b),d(!1)}catch{}finally{g(!1)}}};return e.jsxs("div",{className:"flex gap-2.5",children:[e.jsx(ge,{className:"size-6 shrink-0",children:e.jsx(be,{className:A("text-[10px] font-semibold",s.author.kind==="agent"?"bg-muted text-ink-soft":"bg-brand-soft text-brand"),children:Me(s.author.name,"?")})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-2 text-[12px] text-muted-foreground",children:[e.jsx("b",{className:"text-[13px] font-semibold text-foreground",children:s.author.name||"Anonymous"}),s.author.kind==="agent"&&e.jsx("span",{className:"rounded-sm bg-muted px-1 text-[10.5px] font-medium uppercase tracking-wide",children:"agent"}),e.jsx("span",{children:Pe(s.createdAt)}),(w||B)&&!l&&e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{variant:"ghost",size:"icon-xs",className:"ml-auto self-center text-muted-foreground","aria-label":`Actions for ${s.author.name||"Anonymous"}’s comment`}),children:e.jsx(Tt,{})}),e.jsxs(ae,{align:"end",className:"min-w-36",children:[w&&e.jsxs(W,{onClick:()=>{m(s.body??""),d(!0)},children:[e.jsx(Ft,{}),"Edit"]}),B&&e.jsxs(W,{variant:"destructive",onClick:()=>c(!0),children:[e.jsx(vs,{}),"Delete"]})]})]})]}),l?e.jsxs("form",{className:"mt-1 flex flex-col gap-2",onSubmit:b=>{b.preventDefault(),k()},children:[e.jsx(Ns,{"aria-label":"Edit your comment",value:y,autoFocus:!0,rows:3,disabled:h,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),k()),b.key==="Escape"&&!h&&(b.preventDefault(),d(!1))}}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx($,{type:"button",variant:"ghost",size:"sm",disabled:h,onClick:()=>d(!1),children:"Cancel"}),e.jsx($,{type:"submit",size:"sm",loading:h,disabled:!y.trim(),children:h?"Saving…":"Save"})]})]}):e.jsx("p",{className:"m-0 whitespace-pre-wrap text-[13.5px] leading-normal",children:s.body})]}),B&&e.jsx(bs,{open:f,onOpenChange:c,title:"Delete this comment?",description:n?"The reply is removed for everyone.":"The comment is removed for everyone. The pin and its replies stay.",confirmLabel:"Delete comment",busy:N,onConfirm:async()=>{a(!0);try{await p(),c(!1)}catch{}finally{a(!1)}}})]})}function ln({status:s,onStatus:n}){return e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx("button",{type:"button",className:"inline-flex items-center rounded-full","aria-label":"Status"}),children:e.jsx(js,{status:s})}),e.jsx(ae,{align:"start",className:"w-[180px]",children:e.jsx(Ie,{value:s,onValueChange:r=>n(r),children:Ee.map(r=>e.jsx(J,{value:r,children:fe[r]},r))})})]})}function dn({state:s}){const n=s==="anchored"?"bg-ok-soft text-ok":s==="approximate"?"bg-muted text-ink-soft":"bg-warn-soft text-destructive",r=s==="anchored"?"Anchored":s==="approximate"?"Approximate":s==="orphaned"?"Orphaned":s;return e.jsx("span",{className:A("rounded-full px-2 py-0.5 text-[11.5px] font-medium",n),children:r})}function cn({ctx:s}){const n=s.capture;if(!n)return null;const r=[];return n.screenshot&&n.screenshot!=="ok"&&r.push(`Screenshot ${n.screenshot}${n.reasons?.length?` — ${n.reasons.join("; ")}`:""}`),n.breadcrumbs&&n.breadcrumbs!=="ok"&&r.push(`Breadcrumbs ${n.breadcrumbs}`),n.blindSpots?.length&&r.push(`${n.blindSpots.length} blind spot${n.blindSpots.length===1?"":"s"}: ${n.blindSpots.join("; ")}`),n.droppedCategories?.length&&r.push(`Dropped: ${n.droppedCategories.join(", ")}`),r.length?e.jsx("ul",{className:"m-0 list-none p-0 text-[12px] text-caution",children:r.map(o=>e.jsx("li",{children:o},o))}):null}function un({ctx:s}){const n=s.derived,r=s.viewport,o=s.build,p=[];return n?.browser||n?.os?p.push(["Browser",[n.browser,n.os,n.device].filter(Boolean).join(" · ")]):s.ua&&p.push(["User agent",String(s.ua)]),r?.w&&p.push(["Viewport",`${r.w} × ${r.h}${r.dpr?` @${Math.round(r.dpr*10)/10}x`:""}`]),s.language&&p.push(["Language",String(s.language)]),o&&Object.keys(o).length&&p.push(["Build",Object.entries(o).map(([l,d])=>`${l} ${String(d)}`).join(" · ")]),p.length?e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(We,{children:"Environment"}),e.jsx("button",{type:"button",className:"text-[11.5px] text-brand hover:underline",onClick:()=>{navigator.clipboard?.writeText(JSON.stringify(s,null,2)),ls.success("Copied the environment")},children:"copy as JSON"})]}),e.jsx("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:p.map(([l,d])=>e.jsxs("span",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:l}),e.jsx("dd",{className:A("m-0",l==="Build"&&"font-mono text-[12px] text-ink-soft"),children:d})]},l))})]}):null}function mn({ctx:s}){const n=s.breadcrumbs,[r,o]=x.useState(!1);if(!n?.length)return null;const p=n.filter(l=>l.level==="error"||l.type==="error").length;return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-left text-[13px] text-ink-soft","aria-expanded":r,onClick:()=>o(!r),children:[e.jsx(St,{className:A("size-3.5 text-muted-foreground transition-transform",r&&"rotate-90")}),n.length," breadcrumb",n.length===1?"":"s",p>0?` · ${p} error${p===1?"":"s"} before the click`:"",e.jsx("span",{className:"ml-auto text-[12px] text-muted-foreground",children:r?"hide":"show"})]}),r&&e.jsx("ol",{className:"m-0 flex list-none flex-col gap-1 p-0 font-mono text-[11.5px]",children:n.map((l,d)=>e.jsxs("li",{className:A("flex gap-2",(l.level==="error"||l.type==="error")&&"text-destructive"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:l.t.slice(11,19)}),e.jsxs("span",{className:"shrink-0 w-14 text-muted-foreground",children:[l.type,l.level?`/${l.level}`:""]}),e.jsx("span",{className:"min-w-0 break-words",children:l.message})]},d))})]})}function hn({assignee:s,pool:n,onAssign:r,onAddPerson:o}){const[p,l]=x.useState(!1),d=n.find(c=>c.isMe),y=n.filter(c=>c.isTeam),m=n.filter(c=>!c.isTeam&&!c.isAgent),h=n.filter(c=>!c.isTeam&&c.isAgent),g=c=>r({id:c.id,name:c.name,kind:c.kind,isTeam:c.isTeam}),f=c=>e.jsxs(W,{onClick:()=>g(c),children:[e.jsx(ge,{className:"size-4",children:e.jsx(be,{className:A("text-[8px] font-semibold",c.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(c.name,c.email)})}),e.jsx("span",{className:"truncate",children:c.isMe?`${c.name} (you)`:c.name}),s?.id===c.id&&e.jsx(cs,{className:"ml-auto size-3.5"})]},c.id);return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(ne,{render:e.jsx($,{variant:"ghost",size:"sm","aria-label":s?`Assignee: ${s.name}`:"Assignee"}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(ge,{className:"size-4",children:e.jsx(be,{className:A("text-[8px] font-semibold",s.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(s.name)})}),e.jsx("span",{className:"max-w-[150px] truncate",children:s.name})]}):e.jsxs(e.Fragment,{children:[e.jsx(Wt,{}),"Assign"]})}),e.jsxs(ae,{align:"start",className:"min-w-56",children:[d&&s?.id!==d.id||s?e.jsxs(he,{children:[d&&s?.id!==d.id&&e.jsx(W,{onClick:()=>g(d),children:"Assign to me"}),s&&e.jsx(W,{onClick:()=>r(null),children:"Unassign"})]}):null,y.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"The studio"}),y.map(f)]}),m.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"People who commented"}),m.map(f)]}),h.length>0&&e.jsxs(he,{children:[e.jsx($e,{children:"Agents"}),h.map(f)]}),e.jsx(us,{}),e.jsx(he,{children:e.jsxs(W,{onClick:()=>l(!0),children:[e.jsx(Ut,{}),"Add a person…"]})})]})]}),e.jsx(xn,{open:p,onOpenChange:l,onAdd:async c=>{const N=await o(c);g(N)}})]})}function xn({open:s,onOpenChange:n,onAdd:r}){const[o,p]=x.useState(""),[l,d]=x.useState(""),[y,m]=x.useState(!1),[h,g]=x.useState(""),f=async c=>{if(c.preventDefault(),!(!o.trim()||y)){m(!0),g("");try{await r({name:o.trim(),...l.trim()?{email:l.trim()}:{}}),p(""),d(""),n(!1)}catch(N){g(N instanceof Us?N.message:"Could not add the person.")}finally{m(!1)}}};return e.jsx(ms,{open:s,onOpenChange:n,children:e.jsx(hs,{children:e.jsxs("form",{onSubmit:c=>void f(c),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(xs,{children:[e.jsx(ps,{children:"Add a person"}),e.jsx(fs,{children:"Somebody to assign comments to who has not commented yet — your client, before they have said anything. If they later open a review link with this email, their comments join up."})]}),h&&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:h}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(Ke,{htmlFor:"person-name",children:"Name"}),e.jsx(Be,{id:"person-name",placeholder:"Sofia",value:o,onChange:c=>p(c.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(Ke,{htmlFor:"person-email",children:"Email (optional)"}),e.jsx(Be,{id:"person-email",type:"email",placeholder:"sofia@acme.com",value:l,onChange:c=>d(c.target.value)})]}),e.jsxs(gs,{children:[e.jsx($,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),e.jsx($,{type:"submit",loading:y,disabled:!o.trim(),children:y?"Adding…":"Add and assign"})]})]})})})}nt({thread:pe().optional(),status:pe().optional(),page:pe().optional(),q:pe().optional(),sort:ts(["newest","oldest"]).optional(),round:at().int().positive().optional(),assignee:pe().optional(),by:pe().optional(),view:ts(["board"]).optional()});const Cs={open:"bg-status-open",progress:"bg-status-progress",review:"bg-status-review",resolved:"bg-status-resolved"};function Jn(){const{site:s}=es.useParams(),n=es.useSearch(),r=Ks(),o=Mt(),p=o.projects.find(t=>t.uid===s),l=we(Te.origins(s)),d=we(Te.rounds(s)),y=we(Te.assignees(s)),m=we(Te.siteIntegrations(s)),h=y.data?.data??[],g=h.find(t=>t.isMe)?.id,f=n.round??(d.data?Ws(d.data.data):void 0),c=(d.data?.data??[]).filter(t=>!t.archived||t.number===f),N=x.useMemo(()=>({...f!==void 0?{round:f}:{},...n.page?{route:n.page}:{},...n.q?{q:n.q}:{}}),[f,n.page,n.q]),a=we({...ss(s,N),enabled:d.isSuccess}),w=ss(s,N).queryKey,B=Hs(s,w),k=Gs(w),b=Js(s,w),R=Qs(s),T=Xs(s,w),V=Zs(s),M=Ys(s),v=et(w),D=st(w),Q=tt(s,w),[q,U]=x.useState(new Set),C=t=>void r({to:"/s/$site/comments",params:{site:s},search:i=>({...i,...t}),replace:!0}),E=a.data?.data??[],L=x.useMemo(()=>new Set((n.status??"").split(",").filter(Boolean)),[n.status]),je=x.useMemo(()=>{const t=new Map;for(const i of E)t.set(i.status,(t.get(i.status)??0)+1);return t},[E]),oe=x.useMemo(()=>[...new Set(E.map(t=>He(t)))].sort(),[E]),F=x.useMemo(()=>{let t=L.size?E.filter(i=>L.has(i.status)):E;return n.assignee==="unassigned"?t=t.filter(i=>!i.assignee):n.assignee==="me"?t=t.filter(i=>!!g&&i.assignee?.id===g):n.assignee&&(t=t.filter(i=>i.assignee?.id===n.assignee)),n.by==="me"?t=t.filter(i=>!!g&&i.createdBy.id===g):n.by&&(t=t.filter(i=>rs(i.createdBy.name)===n.by)),n.sort==="oldest"&&(t=[...t].reverse()),t},[E,L,n.sort,n.assignee,n.by,g]),ve=x.useMemo(()=>{const t=new Map;for(const i of F){const S=He(i);t.has(S)||t.set(S,[]),t.get(S).push(i)}return[...t.entries()]},[F]),u=n.thread?E.find(t=>t.key===n.thread)??null:null,O=L.size>0||!!n.page||!!n.q||!!n.assignee||!!n.by,z=x.useMemo(()=>{const t=new Map;for(const i of E){if(i.createdBy.id&&i.createdBy.id===g)continue;const S=rs(i.createdBy.name);S&&!t.has(S)&&t.set(S,i.createdBy.name.trim())}return[...t].sort((i,S)=>i[1].localeCompare(S[1]))},[E,g]),Ae=c.filter(t=>t.number!==f&&t.unresolved>0),I=Re(o.user.role,"review"),H=Re(o.user.role,"moderate"),ie=t=>!!g&&t.comments.every(i=>i.body===null||i.author.id===g),P=I?c.filter(t=>!t.archived&&t.number!==f):[],X=(t,i)=>M.mutate({ids:t,round:i},{onSuccess:()=>{U(new Set),n.thread&&t.includes(u?.id??"")&&C({thread:void 0})}}),_=t=>{const i=new Set(L);i.has(t)?i.delete(t):i.add(t),C({status:[...i].join(",")||void 0})},De=async t=>{const i=[...q];U(new Set);for(const S of i)await B.mutateAsync({id:S,status:t}).catch(()=>{})};x.useEffect(()=>{const t=i=>{if(i.metaKey||i.ctrlKey||i.altKey)return;const S=i.target;if(S&&(S.closest("input,textarea,select,[contenteditable]")||S.isContentEditable))return;const Y=i.key.toLowerCase();if(Y!=="j"&&Y!=="k"&&Y!=="e"||F.length===0)return;if(i.preventDefault(),Y==="e"){if(!u)return;B.mutate({id:u.id,status:u.status==="resolved"?"open":"resolved"});return}const le=u?F.findIndex(xe=>xe.id===u.id):-1,ee=Y==="j"?Math.min(le+1,F.length-1):Math.max(le-1,0),de=F[le===-1?0:ee];de&&C({thread:de.key})};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)});const Z=n.view==="board",G=x.useMemo(()=>Ee.map(t=>({status:t,items:F.filter(i=>i.status===t)})),[F]);return e.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] min-h-0 flex-col",children:[e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border/60 px-4 py-2",children:q.size>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[13px] font-medium",children:[q.size," selected"]}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"Move to"}),Ee.map(t=>e.jsx($,{variant:"outline",size:"sm",onClick:()=>void De(t),children:fe[t]},t)),e.jsx(ws,{rounds:P,busy:M.isPending,onMove:t=>X([...q],t)}),e.jsx($,{variant:"ghost",size:"sm",onClick:()=>U(new Set),children:"Clear"})]}):e.jsxs(e.Fragment,{children:[c.length>0&&f!==void 0&&e.jsx(sn,{rounds:c,active:f,onPick:t=>C({round:t,thread:void 0}),onStart:t=>V.mutate(t,{onSuccess:i=>C({round:i.number,thread:void 0,status:void 0})}),starting:V.isPending}),e.jsx("span",{className:"mx-1 h-[18px] w-px bg-border"}),e.jsxs(Ue,{on:L.size===0,onClick:()=>C({status:void 0}),children:["All ",e.jsx("span",{className:"text-muted-foreground",children:E.length})]}),Ee.map(t=>e.jsxs(Ue,{on:L.has(t),onClick:()=>_(t),children:[e.jsx("span",{className:A("size-[7px] rounded-full",Cs[t])}),fe[t]," ",e.jsx("span",{className:"text-muted-foreground",children:je.get(t)??0})]},t)),e.jsx("div",{className:"flex-1"}),e.jsxs(Ue,{on:Z,onClick:()=>C({view:Z?void 0:"board"}),children:[Z?e.jsx(Pt,{className:"size-3.5"}):e.jsx(zt,{className:"size-3.5"}),Z?"List":"Board"]}),e.jsx(fn,{value:n.q??"",onChange:t=>C({q:t||void 0})}),oe.length>1&&e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.page)}),children:[n.page??"All pages",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ae,{align:"end",children:[e.jsx(W,{onClick:()=>C({page:void 0}),children:"All pages"}),oe.map(t=>e.jsx(W,{onClick:()=>C({page:t}),children:e.jsx("span",{className:"font-mono text-[12px]",children:t})},t))]})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.by),"aria-label":"Filter by who commented"}),children:[n.by==="me"?"By me":n.by?`By ${z.find(([t])=>t===n.by)?.[1]??"someone"}`:"Comments by",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ie,{value:n.by??"any",onValueChange:t=>C({by:t==="any"?void 0:t}),children:[e.jsx(J,{value:"any",children:"Anyone"}),g&&e.jsx(J,{value:"me",children:"Me"}),z.map(([t,i])=>e.jsx(J,{value:t,children:i},t))]})})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!!n.assignee),"aria-label":"Filter by assignee"}),children:[pn(n.assignee,h),e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ie,{value:n.assignee??"any",onValueChange:t=>C({assignee:t==="any"?void 0:t}),children:[e.jsx(J,{value:"any",children:"Anyone"}),e.jsx(J,{value:"unassigned",children:"Unassigned"}),g&&e.jsx(J,{value:"me",children:"Me"}),h.filter(t=>!t.isMe).map(t=>e.jsx(J,{value:t.id,children:t.name},t.id))]})})]}),e.jsxs(te,{children:[e.jsxs(ne,{render:e.jsx("button",{type:"button",className:Se(!1)}),children:[n.sort==="oldest"?"Oldest":"Newest",e.jsx(Ce,{className:"size-3 text-muted-foreground"})]}),e.jsx(ae,{align:"end",children:e.jsxs(Ie,{value:n.sort??"newest",onValueChange:t=>C({sort:t==="oldest"?"oldest":void 0}),children:[e.jsx(J,{value:"newest",children:"Newest first"}),e.jsx(J,{value:"oldest",children:"Oldest first"})]})})]})]})}),Ae.map(t=>e.jsxs("button",{type:"button",className:"shrink-0 border-b border-border/60 bg-brand-soft px-4 py-1.5 text-left text-[12.5px] text-foreground",onClick:()=>C({round:t.number,thread:void 0}),children:[e.jsxs("b",{className:"font-semibold",children:[t.unresolved," unresolved"]})," in ",t.name," — still open, not carried over."," ",e.jsx("span",{className:"text-brand",children:"Go there"})]},t.id)),e.jsxs("div",{className:A("grid min-h-0 flex-1",u?"grid-cols-1 lg:grid-cols-[minmax(0,1fr)_520px]":"grid-cols-1"),children:[e.jsxs("div",{className:A("min-h-0 overflow-auto lg:border-r lg:border-border",u&&"hidden lg:block"),children:[a.isPending&&e.jsx(bn,{}),a.isError&&e.jsx(qe,{title:"Could not load the comments",children:a.error.message}),a.isSuccess&&E.length===0&&!O&&e.jsx("div",{className:"mx-auto max-w-[560px] py-8",children:e.jsxs(qe,{icon:e.jsx(It,{className:"size-5"}),title:"No comments yet",children:[e.jsxs("p",{className:"m-0",children:["When someone leaves a comment on ",p.name," it appears here, grouped by page."]}),e.jsx("div",{className:"mt-4 text-left",children:e.jsx($t,{uid:s})})]})}),a.isSuccess&&E.length>0&&F.length===0&&e.jsx(qe,{title:"Nothing matches",action:e.jsx($,{variant:"outline",size:"sm",onClick:()=>C({status:void 0,page:void 0,q:void 0,assignee:void 0,by:void 0}),children:"Show all"}),children:"No comment matches that filter."}),Z&&a.isSuccess&&F.length>0&&e.jsx(jn,{columns:G,uid:s,selectedId:u?.id??null,onMove:(t,i)=>B.mutate({id:t,status:i})}),!Z&&ve.map(([t,i])=>e.jsxs("div",{children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-2 border-b border-border/60 bg-background px-4 py-2 font-mono text-[12px] text-ink-soft",children:[t," ",e.jsxs("span",{className:"font-sans text-muted-foreground",children:["· ",i.length]})]}),i.map(S=>e.jsx(gn,{t:S,uid:s,on:u?.id===S.id,picked:q.has(S.id),picking:q.size>0,onPick:Y=>U(le=>{const ee=new Set(le);return Y?ee.add(S.id):ee.delete(S.id),ee})},S.id))]},t))]}),u&&e.jsxs("div",{className:"flex min-h-0 flex-col overflow-hidden bg-card",children:[e.jsx("div",{className:"lg:hidden",children:e.jsxs($,{variant:"ghost",size:"sm",className:"m-2",onClick:()=>C({thread:void 0}),children:[e.jsx(At,{}),"Back to the list"]})}),e.jsx(rn,{thread:u,site:{name:p.name,...l.data?.origins[0]?{origin:l.data.origins[0]}:{}},onStatus:t=>B.mutate({id:u.id,status:t}),onReply:t=>k.mutateAsync({id:u.id,body:t}),replying:k.isPending,pool:h,onAssign:t=>b.mutate({id:u.id,assignee:t}),onAddPerson:t=>R.mutateAsync(t),trackers:(m.data?.data??[]).map(t=>t.provider),...Re(o.user.role,"settings")?{onCreateIssue:t=>T.mutate({id:u.id,provider:t})}:{},creatingIssue:T.isPending?T.variables?.provider:void 0,onEditComment:(t,i)=>v.mutateAsync({threadId:u.id,commentId:t,body:i}),onDeleteComment:t=>D.mutateAsync({threadId:u.id,commentId:t}),moderator:H,...H||Re(o.user.role,"review")&&ie(u)?{onDeleteThread:async()=>{await Q.mutateAsync(u.id),C({thread:void 0})}}:{},...P.length?{move:{rounds:P,busy:M.isPending,onMove:t=>X([u.id],t)}}:{},onClose:()=>C({thread:void 0})})]})]})]})}function pn(s,n){return s?s==="unassigned"?"Unassigned":s==="me"?"Me":n.find(r=>r.id===s)?.name??"Assignee":"Assignee"}function rs(s){return s.trim().toLowerCase()}function He(s){return s.anchor?.page?.route??s.route??"/"}function Se(s){return A("inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",s&&"border-line-strong bg-muted text-foreground")}function Ue({on:s,onClick:n,children:r}){return e.jsx("button",{type:"button",className:Se(s),"aria-pressed":s,onClick:n,children:r})}function fn({value:s,onChange:n}){const[r,o]=x.useState(s);return e.jsxs("form",{className:"relative",onSubmit:p=>{p.preventDefault(),n(r.trim())},children:[e.jsx(kt,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),e.jsx(Be,{type:"search","aria-label":"Search comments",placeholder:"Search",value:r,onChange:p=>o(p.target.value),onBlur:()=>r.trim()!==s&&n(r.trim()),className:"h-7 w-[170px] pl-7 text-[12.5px]"})]})}function gn({t:s,uid:n,on:r,picked:o,picking:p,onPick:l}){const d=s.comments[0]?.body??(typeof s.anchor?.label=="string"?s.anchor.label:"(no comment)"),y=s.comments[0]?.body&&typeof s.anchor?.label=="string"?s.anchor.label:"";return e.jsxs("div",{className:A("group grid h-12 grid-cols-[22px_56px_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border/60 bg-card px-4 hover:bg-accent/60",r&&"bg-brand-soft hover:bg-brand-soft"),children:[e.jsx("span",{className:A("flex items-center",!p&&"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:e.jsx(en,{checked:o,onCheckedChange:m=>l(!!m),"aria-label":`Select ${s.key}`})}),e.jsxs(ds,{to:"/s/$site/comments",params:{site:n},search:m=>({...m,thread:s.key}),className:"contents text-foreground",children:[e.jsx("span",{className:"font-mono text-[11.5px] text-muted-foreground",children:s.key}),e.jsxs("span",{className:"truncate text-[13.5px]",children:[d,y&&e.jsx("small",{className:"ml-2 text-[12px] text-muted-foreground",children:y})]}),e.jsxs("span",{className:"flex items-center gap-2.5 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"hidden sm:inline",children:s.createdBy.name||"someone"}),s.assignee&&e.jsx(ge,{className:"size-5",title:`Assigned to ${s.assignee.name}`,children:e.jsx(be,{className:A("text-[9px] font-semibold",s.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(s.assignee.name)})}),e.jsx(js,{status:s.status}),e.jsx("span",{className:"w-11 whitespace-nowrap text-right",children:Pe(s.updatedAt)})]})]})]})}function bn(){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"flex items-center border-b border-border/60 bg-background px-4 py-2",children:e.jsx(Ne,{className:"h-3 w-16"})}),[70,55,80,62].map((s,n)=>e.jsxs("div",{className:"grid h-12 grid-cols-[22px_56px_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx("span",{}),e.jsx(Ne,{className:"h-3 w-10"}),e.jsx(Ne,{className:"h-3",style:{width:`${s}%`}}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(Ne,{className:"h-3 w-11"}),e.jsx(Ne,{className:"h-[18px] w-16 rounded-full"})]})]},n))]})}function jn({columns:s,uid:n,selectedId:r,onMove:o}){const[p,l]=x.useState(null);return e.jsx("div",{className:"flex h-full min-h-0 gap-3 overflow-x-auto p-3",children:s.map(({status:d,items:y})=>e.jsxs("section",{"aria-label":fe[d],onDragOver:m=>{m.preventDefault(),l(d)},onDragLeave:()=>l(m=>m===d?null:m),onDrop:m=>{m.preventDefault(),l(null);const h=m.dataTransfer.getData("text/plain");h&&o(h,d)},className:A("flex w-[280px] shrink-0 flex-col rounded-lg border border-border bg-muted/40",p===d&&"border-brand bg-brand-soft"),children:[e.jsxs("h3",{className:"m-0 flex items-center gap-2 px-3 py-2 text-[12px] font-medium",children:[e.jsx("span",{className:A("size-[7px] rounded-full",Cs[d])}),fe[d],e.jsx("span",{className:"text-muted-foreground",children:y.length})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-2 pt-0",children:[y.length===0&&e.jsx("p",{className:"m-0 px-1 py-3 text-[12px] text-muted-foreground",children:"Nothing here."}),y.map(m=>e.jsxs(ds,{to:"/s/$site/comments",params:{site:n},search:h=>({...h,thread:m.key}),draggable:!0,onDragStart:h=>{h.dataTransfer.setData("text/plain",m.id),h.dataTransfer.effectAllowed="move"},className:A("flex cursor-grab flex-col gap-1.5 rounded-md border border-border bg-card p-2.5 text-foreground no-underline active:cursor-grabbing",r===m.id&&"border-brand ring-1 ring-brand"),children:[e.jsx("span",{className:"line-clamp-3 text-[13px]",children:m.comments[0]?.body??(typeof m.anchor?.label=="string"?m.anchor.label:"(no comment)")}),e.jsxs("span",{className:"flex items-center gap-2 text-[11.5px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:m.key}),e.jsx("span",{className:"truncate",children:He(m)}),e.jsx("span",{className:"flex-1"}),m.assignee&&e.jsx(ge,{className:"size-4",title:`Assigned to ${m.assignee.name}`,children:e.jsx(be,{className:A("text-[8px] font-semibold",m.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Me(m.assignee.name)})}),e.jsx("span",{children:Pe(m.updatedAt)})]})]},m.id))]})]},d))})}export{Jn as component,pt as isStatus};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,O as o}from"./index-DJIyUCPa.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as K,d as U,r as l,a5 as R,s as F,a6 as E,a8 as S,j as e,B as g,C as xe,h as pe,A as ge,a9 as Ae,q,L as B,t as ce,a2 as de,$ as Fe}from"./index-DJIyUCPa.js";import{P as J}from"./Picker-DWjVDWI6.js";import{u as Q}from"./useQuery-qBadQDJJ.js";import{B as me}from"./badge-DNL0s8ND.js";import{i as Y,j as V,l as X,k as Z,m as ee,n as te}from"./dialog-wNx4TYmI.js";import{I as O,L as _}from"./label-BO35zXgP.js";import{C as $e}from"./ConfirmDialog-U7sGR-7r.js";import{A as Te,P as Pe,a as Ie}from"./parts-Cf55Yb70.js";import{u as fe}from"./me-Bu3DC102.js";import{v as P}from"./useScrollLock-tzg3KUOw.js";import{M as De}from"./McpTokens-j7R5vQdJ.js";import{C as he}from"./CopyButton-BPRG72bK.js";import{C as je}from"./check-nWqm4QA9.js";import"./chevron-down-B0SxNOjK.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-DJQs5QD1.js";import"./inertValue-DFM3yqxg.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-S18DT6ky.js";import"./getPseudoElementBounds-BI6SgJKV.js";import"./CompositeList-Cc2N74pm.js";import"./useBaseQuery-ic0hLoWO.js";import"./useRender-TrgqqhB3.js";import"./copy-BlkC45lz.js";import"./card-BV6fjgTi.js";import"./switch-BbV1tcPM.js";import"./useAriaLabelledBy-DfnIJQvt.js";/**
|
|
2
|
-
* @license lucide-react v1.39.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Oe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ee=K("circle-alert",Oe);/**
|
|
7
|
-
* @license lucide-react v1.39.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Re=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],We=K("eye-off",Re);/**
|
|
12
|
-
* @license lucide-react v1.39.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Le=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_e=K("eye",Le),be="https://snagset.com/docs/integrations/",ue={github:"Repository",linear:"Team",jira:"Project"};function se({id:t,value:o,onChange:c,placeholder:r}){const[m,f]=l.useState(!1);return e.jsxs("div",{className:"relative",children:[e.jsx(O,{id:t,type:m?"text":"password",placeholder:r,value:o,onChange:d=>c(d.target.value),autoComplete:"off",spellCheck:!1,className:"pr-9 font-mono text-[12.5px]"}),e.jsx("button",{type:"button",onClick:()=>f(d=>!d),"aria-label":m?"Hide":"Show","aria-pressed":m,className:"absolute inset-y-0 right-0 flex w-9 items-center justify-center rounded-r-md text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",children:m?e.jsx(We,{className:"size-4"}):e.jsx(_e,{className:"size-4"})})]})}function ze({at:t}){const o=["Access","Connect","Way back"];return e.jsx("ol",{className:"m-0 flex list-none items-center gap-2 p-0 text-[12px]","aria-label":"Steps",children:o.map((c,r)=>{const m=r+1;return e.jsxs("li",{"aria-current":m===t?"step":void 0,className:"flex items-center gap-2",children:[e.jsx("span",{className:pe("flex size-5 items-center justify-center rounded-full border text-[11px] tabular-nums",m<t&&"border-transparent bg-primary text-primary-foreground",m===t&&"border-primary text-foreground",m>t&&"border-border text-muted-foreground"),children:m<t?e.jsx(je,{className:"size-3"}):m}),e.jsx("span",{className:m===t?"font-medium text-foreground":"text-muted-foreground",children:c}),r<o.length-1&&e.jsx("span",{className:"h-px w-5 bg-border","aria-hidden":!0})]},c)})})}function $({id:t,label:o,hint:c,children:r}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:t,children:o}),r,c&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:c})]})}function ke({children:t}){return 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:t})}function T({href:t,children:o}){return e.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-2",children:o})}const G=t=>t instanceof xe?t.message:"Could not reach the server.";function He({provider:t,jiraSite:o}){const c=t==="github"?[e.jsxs(e.Fragment,{children:["Open ",e.jsx(T,{href:"https://github.com/settings/personal-access-tokens/new",children:"GitHub › Fine-grained tokens › Generate new token"}),"."]}),e.jsx(e.Fragment,{children:"Repository access: only the site's repository. Permissions › Issues: Read and write."}),e.jsx(e.Fragment,{children:"Generate, copy the token, paste it below."})]:t==="linear"?[e.jsxs(e.Fragment,{children:["Open ",e.jsx(T,{href:"https://linear.app/settings/account/security",children:"Linear › Settings › Security & access"}),"."]}),e.jsx(e.Fragment,{children:"Under Personal API keys, make a new key. It acts as you, so you must be in the team."}),e.jsx(e.Fragment,{children:"Copy the key, paste it below."})]:[e.jsxs(e.Fragment,{children:["Open ",e.jsx(T,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:"Atlassian account › Security › API tokens"}),"."]}),e.jsx(e.Fragment,{children:'Create API token — the plain one, not "with scopes". Name it Snagset.'}),e.jsxs(e.Fragment,{children:["Copy it, paste it below with the email you sign in to ",o?o.replace(/^https?:\/\//,""):"Jira"," with."]})];return e.jsx("ol",{className:"m-0 flex list-decimal flex-col gap-1 pl-5 text-[13px] text-muted-foreground",children:c.map((r,m)=>e.jsx("li",{children:r},m))})}function ye({provider:t,site:o,shownSecret:c,target:r,onSecret:m}){const f=U(),d=`${location.origin}/api/v1/integrations/${t}/inbound`,[k]=l.useState(()=>Date.now()),[p,v]=l.useState(""),[j,N]=l.useState(""),u=Q({...ge.integrations(),refetchInterval:3e3}).data?.data.find(a=>a.site===o&&a.provider===t),b=R({mutationFn:a=>F.setWebhookSecret(o,t,a),onSuccess:a=>{N(""),v(""),m(a.webhook.secret??null),f.invalidateQueries({queryKey:["integrations"]}),E.success(t==="linear"?"Signing secret saved":"New secret made — the old one has stopped working")},onError:a=>N(G(a))}),y=u?.lastDeliveryAt?Date.parse(u.lastDeliveryAt):0,w=u?.lastRefusedAt?Date.parse(u.lastRefusedAt):0,x=t==="linear"&&u&&!u.hasWebhookSecret?"nosecret":y?"ok":w?"refused":"waiting",h=x==="ok"&&w>y,s=t==="github"?"GitHub sends a test delivery the moment the webhook is saved.":t==="linear"?`Then move any issue in ${r.label} to another status once.`:`Then move any issue in ${r.label} once.`;return e.jsxs("div",{className:"flex min-w-0 flex-col gap-4",children:[j&&e.jsx(ke,{children:j}),e.jsx("ol",{className:"m-0 flex list-decimal flex-col gap-1 pl-5 text-[13px] text-muted-foreground",children:t==="github"?e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open"," ",e.jsx(T,{href:r.repo?`https://github.com/${r.repo}/settings/hooks/new`:"https://github.com",children:"the repository's Settings › Webhooks › Add webhook"}),"."]}),e.jsx("li",{children:"Paste the address and the secret below; content type application/json."}),e.jsx("li",{children:'"Let me select individual events" → tick Issues only. Add webhook.'})]}):t==="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open ",e.jsx(T,{href:"https://linear.app/settings/api",children:"Linear › Settings › API"}),", then Webhooks › New webhook."]}),e.jsxs("li",{children:["Paste the address; pick the team ",r.label,"; under data change events tick Issues. Create."]}),e.jsx("li",{children:"Linear shows a signing secret: copy it and paste it below."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("li",{children:["Open"," ",e.jsx(T,{href:r.jiraSite?`${r.jiraSite}/plugins/servlet/webhooks`:"https://admin.atlassian.com",children:"Jira › Settings › System › WebHooks"})," ","› Create a WebHook. It needs a Jira admin."]}),e.jsx("li",{children:"Paste the address and the secret below."}),e.jsx("li",{children:"Under Issue, tick updated and deleted. Create."})]})}),e.jsxs("dl",{className:"m-0 grid grid-cols-[88px_minmax(0,1fr)] items-center gap-x-3 gap-y-2.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsxs("dd",{className:"m-0 flex min-w-0 items-center gap-2",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-url",children:d}),e.jsx(he,{text:d,label:"Copy the address"})]}),t!=="linear"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Secret"}),e.jsx("dd",{className:"m-0 flex min-w-0 items-center gap-2",children:c?e.jsxs(e.Fragment,{children:[e.jsx("code",{className:"min-w-0 flex-1 break-all rounded-md bg-muted px-2 py-1 font-mono text-[12px]","data-testid":"webhook-secret",children:c}),e.jsx(he,{text:c,label:"Copy the secret"})]}):e.jsxs("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-2 text-muted-foreground",children:["Shown once, when it was made.",e.jsx(g,{type:"button",size:"sm",variant:"outline",loading:b.isPending,onClick:()=>b.mutate(void 0),children:"Make a new secret"})]})})]}),t==="github"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Content type"}),e.jsx("dd",{className:"m-0 font-mono text-[12px]",children:"application/json"})]})]}),c&&e.jsx("p",{className:"m-0 -mt-2 text-[12px] text-muted-foreground",children:"Copy it now: it is not shown again. A new one can be made here any time."}),t==="linear"&&e.jsx($,{id:"wb-secret",label:"Signing secret",hint:u?.hasWebhookSecret?"Saved. Paste a new one to replace it.":"From the webhook Linear just made.",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(se,{id:"wb-secret",value:p,onChange:v,placeholder:"lin_wh_…"})}),e.jsx(g,{type:"button",variant:"outline",disabled:!p.trim(),loading:b.isPending,onClick:()=>b.mutate(p.trim()),children:"Save"})]})}),e.jsxs("div",{role:"status","aria-live":"polite","data-testid":"webhook-check","data-state":x,className:pe("flex items-start gap-2.5 rounded-md border px-3 py-2.5 text-[13px]",x==="ok"&&"border-emerald-500/40 bg-emerald-500/10",x==="refused"&&"border-destructive/40 bg-warn-soft",(x==="waiting"||x==="nosecret")&&"border-border bg-muted/40"),children:[x==="ok"?e.jsx(je,{className:"mt-0.5 size-4 shrink-0 text-emerald-600"}):x==="refused"?e.jsx(Ee,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):e.jsx(Ae,{className:"mt-0.5 size-4 shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none"}),e.jsx("span",{className:"min-w-0",children:x==="ok"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"The webhook works."})," Last delivery ",P(u.lastDeliveryAt),y>=k?", just now.":".",h&&e.jsxs("span",{className:"mt-1 block text-muted-foreground",children:["A later delivery was refused (",P(u.lastRefusedAt),"): ",u.lastRefusedError," If you did not change the secret, it may not have come from ",S[t],"."]})]}):x==="refused"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"A delivery arrived and was refused"})," (",P(u.lastRefusedAt),"). ",u.lastRefusedError,e.jsxs("span",{className:"mt-1 block text-muted-foreground",children:["A refused delivery is unsigned, so it may not be from ",S[t],". Check the delivery log on ",S[t],"'s webhook before changing anything."]})]}):x==="nosecret"?e.jsx(e.Fragment,{children:"Waiting for the signing secret. Without it, Linear's deliveries are refused."}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-medium",children:"Waiting for the first delivery."})," ",s]})})]})]})}function Me({provider:t,open:o,onOpenChange:c,sites:r}){const m=U(),f=S[t],[d,k]=l.useState(1),[p,v]=l.useState(""),[j,N]=l.useState(""),[C,u]=l.useState(""),[b,y]=l.useState(""),[w,x]=l.useState(""),[h,s]=l.useState([]),[a,A]=l.useState(""),[n,I]=l.useState(""),[ne,ae]=l.useState(!1),[we,z]=l.useState(null),[ve,ie]=l.useState(""),[oe,W]=l.useState("");l.useEffect(()=>{o||(k(1),v(""),N(""),u(""),y(""),x(""),s([]),A(""),I(""),ae(!1),z(null),ie(""),W(""))},[o]);const D=p||r[0]?.uid||"",L=C.trim().replace(/\/+$/,"").replace(/^(?!https?:\/\/)/,"https://"),Ne=t==="github"?{token:j.trim()}:t==="linear"?{apiKey:j.trim()}:{siteUrl:L,email:b.trim(),apiToken:j.trim()},H=R({mutationFn:()=>F.discoverTracker(t,Ne),onSuccess:i=>{W(""),x(i.who),s(i.options),A(i.options.find(Ce=>Ce.canWrite!==!1)?.value??i.options[0]?.value??""),k(2)},onError:i=>W(G(i))}),M=R({mutationFn:()=>{const i=ne?"thread.created":"manual";return t==="github"?F.connectTracker(D,"github",{repository:a.trim(),token:j.trim(),labels:n.trim(),createOn:i}):t==="linear"?F.connectTracker(D,"linear",{team:a.trim(),apiKey:j.trim(),createOn:i}):F.connectTracker(D,"jira",{siteUrl:L,project:a.trim(),email:b.trim(),apiToken:j.trim(),createOn:i})},onSuccess:i=>{W(""),N(""),z(i.webhook?.secret??null),ie(D),m.invalidateQueries({queryKey:["integrations"]}),E.success(`${f} connected`),k(3)},onError:i=>W(G(i))}),re=!!D&&!!j.trim()&&(t!=="jira"||!!C.trim()&&!!b.trim()),le=h.find(i=>i.value===a),Se=le?.label??a;return e.jsx(Y,{open:o,onOpenChange:c,children:e.jsx(V,{className:"sm:max-w-[560px]",children:e.jsxs("form",{className:"flex min-w-0 flex-col gap-4",noValidate:!0,onSubmit:i=>{i.preventDefault(),d===1&&re?H.mutate():d===2&&a.trim()?M.mutate():d===3&&c(!1)},children:[e.jsxs(X,{children:[e.jsxs(Z,{children:["Connect a site to ",f]}),e.jsxs(ee,{children:[d===1?`Give Snagset access to ${f}. The key is checked now and stored encrypted with this instance's secret key.`:d===2?`Signed in to ${f}${w?` as ${w}`:""}. Choose where this site's comments go.`:`Connected. Now the way back: a webhook, so that moving an issue in ${f} moves the comment here.`," ",e.jsx(T,{href:`${be}#${t}`,children:"Step-by-step guide"})]})]}),e.jsx(ze,{at:d}),oe&&d!==3&&e.jsx(ke,{children:oe}),d===1&&e.jsxs(e.Fragment,{children:[e.jsx($,{id:"ct-site",label:"Site",children:e.jsx(J,{id:"ct-site",value:D,onChange:v,options:r.map(i=>({value:i.uid,label:i.name}))})}),e.jsx(He,{provider:t,jiraSite:L}),t==="jira"&&e.jsxs(e.Fragment,{children:[e.jsx($,{id:"ct-jira-site",label:"Jira site",hint:"The address you open Jira at.",children:e.jsx(O,{id:"ct-jira-site",placeholder:"https://kilnwork.atlassian.net",value:C,onChange:i=>u(i.target.value),autoComplete:"off"})}),e.jsx($,{id:"ct-email",label:"Account email",children:e.jsx(O,{id:"ct-email",type:"email",placeholder:"you@kilnwork.studio",value:b,onChange:i=>y(i.target.value),autoComplete:"off"})})]}),e.jsx($,{id:"ct-token",label:t==="github"?"Token":t==="linear"?"API key":"API token",children:e.jsx(se,{id:"ct-token",value:j,onChange:N,placeholder:t==="github"?"github_pat_…":t==="linear"?"lin_api_…":""})})]}),d===2&&e.jsxs(e.Fragment,{children:[h.length>0?e.jsx($,{id:"ct-target",label:ue[t],hint:le?.canWrite===!1?"This token can only read that repository: give it Issues › Read and write, or pick another.":t==="jira"?"Jira calls these spaces; the key in brackets is the prefix on its issues.":void 0,children:e.jsx(J,{id:"ct-target",value:a,onChange:A,options:h.map(i=>({value:i.value,label:i.label}))})}):e.jsx($,{id:"ct-target",label:ue[t],hint:`${f} listed nothing this key can see. Type it instead: ${t==="github"?"owner/name":"the prefix on its issues, like ENG"}.`,children:e.jsx(O,{id:"ct-target",value:a,onChange:i=>A(i.target.value),autoComplete:"off"})}),t==="github"&&e.jsx($,{id:"ct-labels",label:"Labels",hint:"Optional, comma-separated. Put on every issue Snagset opens.",children:e.jsx(O,{id:"ct-labels",placeholder:"review",value:n,onChange:i=>I(i.target.value),autoComplete:"off"})}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:ne,onChange:i=>ae(i.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"An issue for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Off: you make an issue from a comment's brief when you mean it. On: every new comment opens one."})]})]})]}),d===3&&e.jsx(ye,{provider:t,site:ve,shownSecret:we,onSecret:z,target:{label:Se,...t==="jira"?{jiraSite:L}:{},...t==="github"?{repo:a}:{}}}),e.jsxs(te,{children:[d===1&&e.jsxs(e.Fragment,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:H.isPending,disabled:!re,children:H.isPending?"Checking…":"Check access"})]}),d===2&&e.jsxs(e.Fragment,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>k(1),children:"Back"}),e.jsx(g,{type:"submit",loading:M.isPending,disabled:!a.trim(),children:M.isPending?"Connecting…":"Connect"})]}),d===3&&e.jsx(g,{type:"submit",children:"Done"})]})]})})})}function qe({state:t,onClose:o}){const[c,r]=l.useState(null);return l.useEffect(()=>{t||r(null)},[t]),e.jsx(Y,{open:t!==null,onOpenChange:m=>!m&&o(),children:e.jsx(V,{className:"sm:max-w-[560px]",children:t&&e.jsxs(e.Fragment,{children:[e.jsxs(X,{children:[e.jsxs(Z,{children:[S[t.provider]," webhook for ",t.siteName]}),e.jsxs(ee,{children:["The way back: moving an issue in ",S[t.provider]," moves the comment here. ",e.jsx(T,{href:`${be}#${t.provider}`,children:"Step-by-step guide"})]})]}),e.jsx(ye,{provider:t.provider,site:t.site,shownSecret:c,onSecret:r,target:t.target}),e.jsx(te,{children:e.jsx(g,{type:"button",onClick:o,children:"Done"})})]})})})}const Be={ok:{label:"Healthy",tone:"ok"},needs_reauth:{label:"Needs a new token",tone:"bad"},error:{label:"Failing",tone:"bad"}};function Je(){const t=fe(),o=q(t.user.role,"settings"),c=q(t.user.role,"studio")&&ce(t),r=Q(ge.integrations()),m=U(),f=()=>m.invalidateQueries({queryKey:["integrations"]}),[d,k]=l.useState(null),[p,v]=l.useState(null),[j,N]=l.useState(null),C=R({mutationFn:({uid:s,provider:a})=>F.testTracker(s,a).then(A=>({...A,provider:a})),onSuccess:s=>{E[s.ok?"success":"error"](s.ok?`${S[s.provider]} can see ${s.target}`:s.detail??`${S[s.provider]} refused the token`),f()},onError:s=>E.error(de(s))}),u=R({mutationFn:({uid:s,provider:a})=>F.disconnectTracker(s,a),onSuccess:()=>{v(null),f()},onError:s=>E.error(de(s))}),b=r.data?.data??[],y=s=>b.filter(a=>a.provider===s),w=t.projects.filter(s=>!s.archived&&!s.locked),x=s=>w.filter(a=>!y(s).some(A=>A.site===a.uid)),h=o?t.limits.integrations?w.length===0?"site":null:"plan":null;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(Pe,{title:"Integrations",sub:"Your coding agent first, then the trackers that mirror a comment's status, then Slack, which only announces"}),e.jsx(De,{owner:o,instanceOwner:c,operator:ce(t),sites:t.projects}),h&&e.jsxs("div",{role:"note",className:"flex max-w-[1040px] flex-wrap items-center gap-x-4 gap-y-2 rounded-lg border border-border bg-muted/40 px-4 py-3 text-[13px]",children:[e.jsx("span",{className:"min-w-0 flex-1",children:h==="plan"?t.user.role==="owner"?"This studio's plan does not include integrations. A plan that does lets you connect each site to GitHub, Linear, Jira and Slack.":"This studio's plan does not include integrations. An owner can change the plan.":t.projects.length===0?"An integration connects one site to one repository, team, project or channel. Add a site first, then connect it here.":"An integration connects one site at a time, and every site here is archived or read-only. Restore one, or add a site, then connect it here."}),h==="plan"?t.user.role==="owner"&&e.jsx(g,{variant:"outline",size:"sm",render:e.jsx(B,{to:"/studio/plan"}),children:"See plans"}):e.jsx(g,{variant:"outline",size:"sm",render:e.jsx(B,{to:"/sites"}),children:"Go to Sites"})]}),["github","linear","jira","slack"].map(s=>{const a=y(s),A=x(s);return e.jsxs(Ie,{title:S[s],description:s==="github"?"A comment becomes an issue in the site's repository, with the brief as its body; resolving it here closes the issue there, and closing it there resolves it here. A fine-grained token per site — no OAuth app to register.":s==="linear"?"A comment becomes an issue in the site's team, with the brief as its body; our status moves it between the team's workflow states by type, and a webhook from Linear moves it back. A personal API key per site — no OAuth app to register.":s==="jira"?"A comment becomes an issue in the site's Jira project, with the brief as its description; our status moves it through the workflow by status category, and a webhook from Jira moves it back. An API token with the account's email — what Atlassian gives a self-hoster.":"One message per comment in a channel, edited in place as the status moves — never a second message, never a reply. A bot token from an app you create in a click from our manifest; Slack sends nothing back.",children:[r.isPending&&e.jsx(Fe,{rows:2}),r.isSuccess&&a.length===0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(me,{variant:"outline",children:"Not connected"}),e.jsx("span",{className:"text-[13px] text-muted-foreground",children:s==="github"?"No site is connected to a repository yet.":s==="linear"?"No site is connected to a team yet.":s==="jira"?"No site is connected to a project yet.":"No site is connected to a channel yet."})]}),a.length>0&&e.jsx("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:a.map(n=>{const I=Be[n.health]??{label:n.health,tone:"warn"};return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border px-3 py-2.5 text-[13px]",children:[e.jsx("span",{className:"font-medium",children:n.siteName??n.site}),e.jsx("span",{className:"text-muted-foreground",children:"→"}),e.jsx("code",{className:"font-mono text-[12.5px]",children:n.provider==="github"?`${n.owner}/${n.repo}`:n.provider==="linear"?`${n.teamKey} · ${n.teamName}`:n.provider==="jira"?`${n.projectKey} · ${n.projectName}`:`#${n.channelName} · ${n.teamName}`}),e.jsx(me,{variant:"outline",className:I.tone==="ok"?"border-ok text-ok":I.tone==="bad"?"border-destructive text-destructive":"",children:I.label}),e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[n.provider==="slack"?n.createOn==="thread.created"?"A message for every new comment":"Messages when you ask, from the brief":n.createOn==="thread.created"?"An issue for every new comment":"Issues when you ask, from the brief",n.provider==="github"&&n.labels.length?` · labels ${n.labels.join(", ")}`:""," · ",P(n.updatedAt)]}),n.provider!=="slack"&&e.jsx(Ke,{r:n}),n.lastError&&e.jsx("span",{className:"basis-full text-[12px] text-destructive",children:n.lastError}),o&&e.jsxs("span",{className:"ml-auto flex gap-1",children:[n.provider!=="slack"&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>N({provider:n.provider,site:n.site,siteName:n.siteName??n.site,target:n.provider==="github"?{label:`${n.owner}/${n.repo}`,repo:`${n.owner}/${n.repo}`}:n.provider==="linear"?{label:n.teamName}:{label:n.projectName,jiraSite:n.siteUrl}}),children:"Webhook…"}),e.jsx(g,{variant:"ghost",size:"sm",loading:C.isPending,onClick:()=>C.mutate({uid:n.site,provider:n.provider}),children:"Test"}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>v(n),children:"Disconnect"})]})]},`${n.provider}:${n.site}`)})}),o&&!h&&A.length>0&&e.jsx("div",{children:e.jsx(g,{variant:"outline",size:"sm",onClick:()=>k(s),children:"Connect a site…"})})]},s)}),["github","linear","jira"].map(s=>e.jsx(Me,{provider:s,open:d===s,onOpenChange:a=>!a&&k(null),sites:x(s)},s)),e.jsx(Ge,{open:d==="slack",onOpenChange:s=>!s&&k(null),sites:x("slack"),onDone:()=>void f()}),e.jsx(qe,{state:j,onClose:()=>N(null)}),e.jsx($e,{open:p!==null,onOpenChange:s=>!s&&v(null),title:`Disconnect ${p?.siteName??"this site"} from ${p?S[p.provider]:"the tracker"}?`,description:p?.provider==="slack"?e.jsx(e.Fragment,{children:"Messages already posted stay in the channel; no new ones are posted and they stop being updated. The token is forgotten."}):e.jsx(e.Fragment,{children:"Issues already made keep their links; no new ones are made and status stops mirroring. The token is forgotten."}),confirmLabel:"Disconnect",busy:u.isPending,onConfirm:async()=>{p&&await u.mutateAsync({uid:p.site,provider:p.provider})}})]})}function Ge({open:t,onOpenChange:o,sites:c,onDone:r}){const[m,f]=l.useState(""),[d,k]=l.useState(""),[p,v]=l.useState(""),[j,N]=l.useState(!0),[C,u]=l.useState(""),b=Q({queryKey:["integrations","slack","manifest"],queryFn:()=>F.slackManifest(),enabled:t,staleTime:1/0}),y=R({mutationFn:h=>F.connectTracker(h,"slack",{channel:d.trim(),token:p.trim(),createOn:j?"thread.created":"manual"})}),w=m||c[0]?.uid||"",x=async h=>{h.preventDefault(),u("");try{await y.mutateAsync(w),k(""),v(""),N(!0),o(!1),r(w),E.success("Slack connected")}catch(s){u(s instanceof xe?s.message:"Could not reach the server.")}};return e.jsx(Y,{open:t,onOpenChange:o,children:e.jsx(V,{children:e.jsxs("form",{onSubmit:h=>void x(h),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(X,{children:[e.jsx(Z,{children:"Connect a site to Slack"}),e.jsx(ee,{children:"Create the app in your workspace from our manifest — one click, the scopes are filled in — install it, and paste its Bot User OAuth Token. The token is checked against the channel before it is saved, and stored encrypted with this instance's secret key."})]}),C&&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:C}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:"sl-site",children:"Site"}),e.jsx(J,{id:"sl-site",value:w,onChange:f,options:c.map(h=>({value:h.uid,label:h.name}))})]}),e.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-border px-3 py-2 text-[13px]",children:[e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block font-medium",children:"1. Create the app"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"Opens api.slack.com with the manifest pasted; then Install to Workspace."})]}),e.jsx(g,{type:"button",variant:"outline",size:"sm",disabled:!b.data,render:e.jsx("a",{href:b.data?.url??"#",target:"_blank",rel:"noreferrer"}),children:"Create app…"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:"sl-token",children:"2. Bot User OAuth Token"}),e.jsx(se,{id:"sl-token",placeholder:"xoxb-…",value:p,onChange:v}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"On the app's OAuth & Permissions page after installing."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(_,{htmlFor:"sl-channel",children:"3. Channel"}),e.jsx(O,{id:"sl-channel",placeholder:"#reviews",value:d,onChange:h=>k(h.target.value),autoComplete:"off"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"A public channel by name; a private one needs the app invited first, then its name works too."})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-[13px]",children:[e.jsx("input",{type:"checkbox",className:"mt-0.5",checked:j,onChange:h=>N(h.target.checked)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-medium",children:"A message for every new comment"}),e.jsx("span",{className:"block text-[12px] text-muted-foreground",children:"On by default: a channel is where people are told. Turn it off to post from the brief when you mean it."})]})]}),e.jsxs(te,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:y.isPending,disabled:!d.trim()||!p.trim()||!w,children:y.isPending?"Checking…":"Connect"})]})]})})})}function Ke({r:t}){const o=S[t.provider];if(t.lastDeliveryAt){const c=t.lastRefusedAt&&Date.parse(t.lastRefusedAt)>Date.parse(t.lastDeliveryAt);return e.jsxs("span",{className:"basis-full text-[12px] text-muted-foreground",children:["Webhook works · last delivery ",P(t.lastDeliveryAt),c?` · a later one was refused ${P(t.lastRefusedAt)}`:""]})}return t.lastRefusedAt?e.jsxs("span",{className:"basis-full text-[12px] text-destructive",children:["Webhook refused ",P(t.lastRefusedAt),": ",t.lastRefusedError," Unsigned, so check ",o,"'s webhook log first."]}):t.provider==="linear"&&!t.hasWebhookSecret?e.jsxs("span",{className:"basis-full text-[12px] text-muted-foreground",children:["No webhook yet, so ",o," cannot move comments here. Webhook… sets it up."]}):e.jsx("span",{className:"basis-full text-[12px] text-muted-foreground",children:"No webhook delivery seen yet. Webhook… shows how to set it up."})}const yt=()=>q(fe().user.role,"settings")?e.jsx(Je,{}):e.jsx(Te,{title:"Integrations",children:e.jsxs("p",{className:"m-0",children:["Connecting a site to GitHub, Linear, Jira or Slack is done by an owner or an admin. Your own agent tokens are on"," ",e.jsx(B,{to:"/you",className:"text-brand hover:underline",children:"You"}),"."]})});export{yt as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as r,Q as u}from"./useBaseQuery-ic0hLoWO.js";function a(e,s){return r(e,u)}export{a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as n}from"./index-DJIyUCPa.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};
|