@snagset/server 0.1.59 → 0.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/integrations/trello.js +16 -0
  2. package/dist/integrations/trello.js.map +1 -1
  3. package/dist/routes/integrations.js +11 -1
  4. package/dist/routes/integrations.js.map +1 -1
  5. package/package.json +1 -1
  6. package/static/dashboard/assets/{CompositeItem-XBuzWv1L.js → CompositeItem-Cbbgho1I.js} +1 -1
  7. package/static/dashboard/assets/{CompositeList-C2IVT2Po.js → CompositeList-U-qk8UP6.js} +1 -1
  8. package/static/dashboard/assets/{ConfirmDialog-B9o4voIS.js → ConfirmDialog-_B1eNA1i.js} +1 -1
  9. package/static/dashboard/assets/{CopyButton-DLU4a9od.js → CopyButton-CIoiqDbz.js} +1 -1
  10. package/static/dashboard/assets/{FieldItemContext-CM5jeOco.js → FieldItemContext-DrmapX6T.js} +1 -1
  11. package/static/dashboard/assets/{InstallTag-CZO85i-P.js → InstallTag-C4m3dgQN.js} +1 -1
  12. package/static/dashboard/assets/{InstanceRows-D-tveODw.js → InstanceRows-Cu43MthB.js} +1 -1
  13. package/static/dashboard/assets/{McpTokens-DikOatOF.js → McpTokens-y9bU9w2F.js} +1 -1
  14. package/static/dashboard/assets/{Picker-lokRYiMC.js → Picker-0Wc1iFQj.js} +1 -1
  15. package/static/dashboard/assets/{SaveState-e4RnpJbD.js → SaveState-B4LwnOrc.js} +1 -1
  16. package/static/dashboard/assets/{_app-6KTAiiJs.js → _app-CQSx4Ud0.js} +1 -1
  17. package/static/dashboard/assets/{_app-Dqyx0uzh.js → _app-DL2c5AyL.js} +1 -1
  18. package/static/dashboard/assets/{activity-D87uMIpc.js → activity-CkDNq67c.js} +1 -1
  19. package/static/dashboard/assets/{arrow-left-Txus48to.js → arrow-left-kr0TdNCI.js} +1 -1
  20. package/static/dashboard/assets/{avatar-d0V38Rww.js → avatar-DQ2PBAkd.js} +1 -1
  21. package/static/dashboard/assets/{badge-BpJT5EUT.js → badge-5vfpTOMk.js} +1 -1
  22. package/static/dashboard/assets/{card-BqU7TCLe.js → card-DEnJVYTc.js} +1 -1
  23. package/static/dashboard/assets/{check-T8owKS6W.js → check-BhmdAbBD.js} +1 -1
  24. package/static/dashboard/assets/{chevron-down-CPxjYKx7.js → chevron-down-CkYqA6Tw.js} +1 -1
  25. package/static/dashboard/assets/{chevron-right-BOLW380q.js → chevron-right-BSOkA3zX.js} +1 -1
  26. package/static/dashboard/assets/{copy-D7ySfk8w.js → copy-DefIRiwo.js} +1 -1
  27. package/static/dashboard/assets/{createBaseUIEventDetails-D5nICp6F.js → createBaseUIEventDetails-BDbAfTsh.js} +1 -1
  28. package/static/dashboard/assets/{dialog-C8j9bKc9.js → dialog-Dsu0e02Q.js} +1 -1
  29. package/static/dashboard/assets/{dropdown-menu-7_qYsjof.js → dropdown-menu-BMaIF-mT.js} +1 -1
  30. package/static/dashboard/assets/{forgot-L_4h7Uc5.js → forgot-BuErlHeu.js} +1 -1
  31. package/static/dashboard/assets/{getPseudoElementBounds-r9s2Gh_c.js → getPseudoElementBounds-Df0qQn0E.js} +1 -1
  32. package/static/dashboard/assets/{image-off-DEk2KdgQ.js → image-off-_kTeT3Bb.js} +1 -1
  33. package/static/dashboard/assets/{index-DBw3b5Rd.js → index-B_3U6pyz.js} +3 -3
  34. package/static/dashboard/assets/{inertValue-DPJM1mgv.js → inertValue-Dl2ZzbZu.js} +1 -1
  35. package/static/dashboard/assets/{invite-BQzST24s.js → invite-DpmMNgTf.js} +1 -1
  36. package/static/dashboard/assets/{label-BqqDq1Bf.js → label-BPkAzYEe.js} +1 -1
  37. package/static/dashboard/assets/{layout-grid-BaI-ZaQt.js → layout-grid-CbZa6REW.js} +1 -1
  38. package/static/dashboard/assets/me-Ffh61LTY.js +1 -0
  39. package/static/dashboard/assets/{parts-Dh3j93KT.js → parts-BZnB0y34.js} +1 -1
  40. package/static/dashboard/assets/{plus-DLkZ3d4a.js → plus-CopH4JTI.js} +1 -1
  41. package/static/dashboard/assets/{reset-25I5KwzQ.js → reset-CYrrEwsu.js} +1 -1
  42. package/static/dashboard/assets/{s._site-AdxvCMDp.js → s._site-j6OX54re.js} +1 -1
  43. package/static/dashboard/assets/{s._site.comments-Bn8q0GfW.js → s._site.comments-Cgn2xgc5.js} +1 -1
  44. package/static/dashboard/assets/{s._site.reviewers-DhplEadn.js → s._site.reviewers-B_TpRGpR.js} +1 -1
  45. package/static/dashboard/assets/{s._site.settings-DkxPhD29.js → s._site.settings-CfenEkX3.js} +1 -1
  46. package/static/dashboard/assets/{setup-BT2ymvDA.js → setup-CXMNChwN.js} +1 -1
  47. package/static/dashboard/assets/{sign-in--bQ1djiP.js → sign-in-Cw4pIFDX.js} +1 -1
  48. package/static/dashboard/assets/{sign-up-Tosf460o.js → sign-up-CumNkOCM.js} +1 -1
  49. package/static/dashboard/assets/{sites-Bk7faXQx.js → sites-dYYYlsEx.js} +1 -1
  50. package/static/dashboard/assets/studio-BFe4RbS0.js +1 -0
  51. package/static/dashboard/assets/{studio-BXY-BYUr.js → studio-C-cl-Bid.js} +1 -1
  52. package/static/dashboard/assets/{studio.index-iCwNlbml.js → studio.index-Bpv89ttE.js} +1 -1
  53. package/static/dashboard/assets/studio.integrations-CEERZTjS.js +16 -0
  54. package/static/dashboard/assets/{studio.members-BnuODZjt.js → studio.members-Bmyx_q-i.js} +1 -1
  55. package/static/dashboard/assets/{studio.plan-B2BnZVlI.js → studio.plan-Chh-cjMh.js} +1 -1
  56. package/static/dashboard/assets/{sun-DZ77z3mK.js → sun-xwDuvNCi.js} +1 -1
  57. package/static/dashboard/assets/{switch-DNodWtiG.js → switch-9hlceDWy.js} +1 -1
  58. package/static/dashboard/assets/{table-_kCW8sw7.js → table-BtGHQI2k.js} +1 -1
  59. package/static/dashboard/assets/{useAriaLabelledBy-CIrxFX1m.js → useAriaLabelledBy-x5XF8M1H.js} +1 -1
  60. package/static/dashboard/assets/{useBaseQuery-n1C4QVXL.js → useBaseQuery-BWQygP2V.js} +1 -1
  61. package/static/dashboard/assets/{useCompositeItem-YAQuEkY3.js → useCompositeItem-uwStRlwJ.js} +1 -1
  62. package/static/dashboard/assets/useQuery-HUEWFxW8.js +1 -0
  63. package/static/dashboard/assets/useRender-BMKPZM38.js +1 -0
  64. package/static/dashboard/assets/{useScrollLock-BPMFXP7l.js → useScrollLock-Bxg3WK_6.js} +1 -1
  65. package/static/dashboard/assets/{useValueChanged-w_Y86K5W.js → useValueChanged-B2j76Odc.js} +1 -1
  66. package/static/dashboard/assets/{users-ZI_E8YXB.js → users-CkVdOVuU.js} +1 -1
  67. package/static/dashboard/assets/{welcome-CBYYDde-.js → welcome-CSLvCL-G.js} +1 -1
  68. package/static/dashboard/assets/{widget-signin-Of2xQvu-.js → widget-signin-D2hoyT51.js} +1 -1
  69. package/static/dashboard/assets/{you-ey1-XO69.js → you-CzmFaW7t.js} +1 -1
  70. package/static/dashboard/assets/{zod-D8TwVQUn.js → zod-BqdlirRI.js} +1 -1
  71. package/static/dashboard/index.html +1 -1
  72. package/static/widget/build.json +2 -2
  73. package/static/widget/snag.js +1 -1
  74. package/static/widget/snag.runtime.js +1 -1
  75. package/static/dashboard/assets/me-BuXPSKyo.js +0 -1
  76. package/static/dashboard/assets/studio-C5_LeEu7.js +0 -1
  77. package/static/dashboard/assets/studio.integrations-25ah_0to.js +0 -16
  78. package/static/dashboard/assets/useQuery-rfvcXYjq.js +0 -1
  79. package/static/dashboard/assets/useRender-Rc2aDa9D.js +0 -1
@@ -1 +1 @@
1
- import{aP as S,r as p,aG as I,ai as T,f as M,n as E,e as b,aF as L,b9 as R}from"./index-DBw3b5Rd.js";function U(t,s){return s<0||s>=t.length}function X(t,s){return P(t.current,{disabledIndices:s})}function j(t,s){return P(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:s})}function P(t,{startingIndex:s=-1,decrement:n=!1,disabledIndices:r,amount:e=1}={}){let i=s;do i+=n?-e:e;while(i>=0&&i<=t.length-1&&O(t,i,r));return i}function O(t,s,n){if(typeof n=="function"?n(s):n?.includes(s)??!1)return!0;const e=t[s];return e?!y(e)||e.matches(":disabled")?!0:!n&&(e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"):!1}function m(t){return t.visibility==="hidden"||t.visibility==="collapse"}function y(t,s=t?S(t):null){return!t||!t.isConnected||!s||m(s)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():s.display!=="none"&&s.display!=="contents"}function k(t){p.useEffect(t,I)}const d=null;class F{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=s=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let e=0;e<n.length;e+=1)n[e]?.(s)};request(s){const n=this.nextId;return this.nextId+=1,this.callbacks.push(s),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(s){const n=s-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let g=new F;class f{static create(){return new f}static request(s){return g.request(s)}static cancel(s){return g.cancel(s)}currentId=d;request(s){this.cancel(),this.currentId=g.request(()=>{this.currentId=d,s()})}cancel=()=>{this.currentId!==d&&(g.cancel(this.currentId),this.currentId=d)};disposeEffect=()=>this.cancel}function W(){const t=T(f.create).current;return k(t.disposeEffect),t}function w(t){return t==null?t:"current"in t?t.current:t}function x(t,s=!1){const n=W();return M((r,e=null)=>{n.cancel();const i=w(t);if(i==null)return;const l=i,u=()=>{E.flushSync(r)};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function o(){Promise.all(l.getAnimations().map(a=>a.finished)).then(()=>{e?.aborted||u()},()=>{if(e?.aborted)return;if(l.getAnimations().some(c=>c.pending||c.playState!=="finished")){o();return}u()})}if(s){const a="data-starting-style";if(!l.hasAttribute(a)){n.request(o);return}const c=new MutationObserver(()=>{l.hasAttribute(a)||(c.disconnect(),o())});c.observe(l,{attributes:!0,attributeFilter:[a]}),e?.addEventListener("abort",()=>c.disconnect(),{once:!0});return}n.request(o)})}function z(t){const{enabled:s=!0,open:n,ref:r,onComplete:e}=t,i=M(e),l=x(r,n);p.useEffect(()=>{if(!s)return;const u=new AbortController;return l(i,u.signal),()=>{u.abort()}},[s,n,i,l])}let C=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const H={"data-starting-style":""},N={"data-ending-style":""},$={transitionStatus(t){return t==="starting"?H:t==="ending"?N:null}};function J(t,s=!1,n=!1){const[r,e]=p.useState(t&&s?"idle":void 0),[i,l]=p.useState(t);return t&&!i&&(l(!0),e("starting")),!t&&i&&r!=="ending"&&!n&&e("ending"),!t&&!i&&r==="ending"&&e(void 0),b(()=>{if(!t&&i&&r!=="ending"&&n){const u=f.request(()=>{e("ending")});return()=>{f.cancel(u)}}},[t,i,r,n]),b(()=>{if(!t||s)return;const u=f.request(()=>{e(void 0)});return()=>{f.cancel(u)}},[s,t]),b(()=>{if(!t||!s)return;t&&i&&r!=="idle"&&e("starting");const u=f.request(()=>{e("idle")});return()=>{f.cancel(u)}},[s,t,i,r]),{mounted:i,setMounted:l,transitionStatus:r}}const B="ArrowUp",q="ArrowDown",v="ArrowLeft",D="ArrowRight",_="Home",Y="End",Q=new Set([B,q,v,D,_,Y]),V="Shift",Z=[V,"Control","Alt","Meta"];function G(t){return L(t)&&t.tagName==="INPUT"}function tt(t){return!!(G(t)&&t.selectionStart!=null||L(t)&&t.tagName==="TEXTAREA")}function st(t,s,n,r){if(!t||!s||!s.scrollTo)return;let e=t.scrollLeft,i=t.scrollTop;const l=t.clientWidth<t.scrollWidth,u=t.clientHeight<t.scrollHeight;if(l&&r!=="vertical"){const o=A(t,s,"left"),a=h(t),c=h(s);n==="ltr"&&(o+s.offsetWidth+c.scrollMarginRight>t.scrollLeft+t.clientWidth-a.scrollPaddingRight?e=o+s.offsetWidth+c.scrollMarginRight-t.clientWidth+a.scrollPaddingRight:o-c.scrollMarginLeft<t.scrollLeft+a.scrollPaddingLeft&&(e=o-c.scrollMarginLeft-a.scrollPaddingLeft)),n==="rtl"&&(o-c.scrollMarginLeft<t.scrollLeft+a.scrollPaddingLeft?e=o-c.scrollMarginLeft-a.scrollPaddingLeft:o+s.offsetWidth+c.scrollMarginRight>t.scrollLeft+t.clientWidth-a.scrollPaddingRight&&(e=o+s.offsetWidth+c.scrollMarginRight-t.clientWidth+a.scrollPaddingRight))}if(u&&r!=="horizontal"){const o=A(t,s,"top"),a=h(t),c=h(s);o-c.scrollMarginTop<t.scrollTop+a.scrollPaddingTop?i=o-c.scrollMarginTop-a.scrollPaddingTop:o+s.offsetHeight+c.scrollMarginBottom>t.scrollTop+t.clientHeight-a.scrollPaddingBottom&&(i=o+s.offsetHeight+c.scrollMarginBottom-t.clientHeight+a.scrollPaddingBottom)}t.scrollTo({left:e,top:i,behavior:"auto"})}function A(t,s,n){const r=n==="left"?"offsetLeft":"offsetTop";let e=0;for(;s.offsetParent&&(e+=s[r],s.offsetParent!==t);)s=s.offsetParent;return e}function h(t){const s=getComputedStyle(t);return{scrollMarginTop:parseFloat(s.scrollMarginTop)||0,scrollMarginRight:parseFloat(s.scrollMarginRight)||0,scrollMarginBottom:parseFloat(s.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(s.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(s.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(s.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(s.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(s.scrollPaddingLeft)||0}}function et(t){return R(19)?t:t?"true":void 0}export{q as A,Q as C,Y as E,_ as H,Z as M,V as S,C as T,J as a,k as b,x as c,W as d,U as e,j as f,X as g,P as h,et as i,y as j,O as k,tt as l,B as m,v as n,D as o,f as p,w as r,st as s,$ as t,z as u};
1
+ import{aP as S,r as p,aG as I,ai as T,f as M,n as E,e as b,aF as L,b9 as R}from"./index-B_3U6pyz.js";function U(t,s){return s<0||s>=t.length}function X(t,s){return P(t.current,{disabledIndices:s})}function j(t,s){return P(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:s})}function P(t,{startingIndex:s=-1,decrement:n=!1,disabledIndices:r,amount:e=1}={}){let i=s;do i+=n?-e:e;while(i>=0&&i<=t.length-1&&O(t,i,r));return i}function O(t,s,n){if(typeof n=="function"?n(s):n?.includes(s)??!1)return!0;const e=t[s];return e?!y(e)||e.matches(":disabled")?!0:!n&&(e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"):!1}function m(t){return t.visibility==="hidden"||t.visibility==="collapse"}function y(t,s=t?S(t):null){return!t||!t.isConnected||!s||m(s)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():s.display!=="none"&&s.display!=="contents"}function k(t){p.useEffect(t,I)}const d=null;class F{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=s=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let e=0;e<n.length;e+=1)n[e]?.(s)};request(s){const n=this.nextId;return this.nextId+=1,this.callbacks.push(s),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(s){const n=s-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let g=new F;class f{static create(){return new f}static request(s){return g.request(s)}static cancel(s){return g.cancel(s)}currentId=d;request(s){this.cancel(),this.currentId=g.request(()=>{this.currentId=d,s()})}cancel=()=>{this.currentId!==d&&(g.cancel(this.currentId),this.currentId=d)};disposeEffect=()=>this.cancel}function W(){const t=T(f.create).current;return k(t.disposeEffect),t}function w(t){return t==null?t:"current"in t?t.current:t}function x(t,s=!1){const n=W();return M((r,e=null)=>{n.cancel();const i=w(t);if(i==null)return;const l=i,u=()=>{E.flushSync(r)};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function o(){Promise.all(l.getAnimations().map(a=>a.finished)).then(()=>{e?.aborted||u()},()=>{if(e?.aborted)return;if(l.getAnimations().some(c=>c.pending||c.playState!=="finished")){o();return}u()})}if(s){const a="data-starting-style";if(!l.hasAttribute(a)){n.request(o);return}const c=new MutationObserver(()=>{l.hasAttribute(a)||(c.disconnect(),o())});c.observe(l,{attributes:!0,attributeFilter:[a]}),e?.addEventListener("abort",()=>c.disconnect(),{once:!0});return}n.request(o)})}function z(t){const{enabled:s=!0,open:n,ref:r,onComplete:e}=t,i=M(e),l=x(r,n);p.useEffect(()=>{if(!s)return;const u=new AbortController;return l(i,u.signal),()=>{u.abort()}},[s,n,i,l])}let C=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const H={"data-starting-style":""},N={"data-ending-style":""},$={transitionStatus(t){return t==="starting"?H:t==="ending"?N:null}};function J(t,s=!1,n=!1){const[r,e]=p.useState(t&&s?"idle":void 0),[i,l]=p.useState(t);return t&&!i&&(l(!0),e("starting")),!t&&i&&r!=="ending"&&!n&&e("ending"),!t&&!i&&r==="ending"&&e(void 0),b(()=>{if(!t&&i&&r!=="ending"&&n){const u=f.request(()=>{e("ending")});return()=>{f.cancel(u)}}},[t,i,r,n]),b(()=>{if(!t||s)return;const u=f.request(()=>{e(void 0)});return()=>{f.cancel(u)}},[s,t]),b(()=>{if(!t||!s)return;t&&i&&r!=="idle"&&e("starting");const u=f.request(()=>{e("idle")});return()=>{f.cancel(u)}},[s,t,i,r]),{mounted:i,setMounted:l,transitionStatus:r}}const B="ArrowUp",q="ArrowDown",v="ArrowLeft",D="ArrowRight",_="Home",Y="End",Q=new Set([B,q,v,D,_,Y]),V="Shift",Z=[V,"Control","Alt","Meta"];function G(t){return L(t)&&t.tagName==="INPUT"}function tt(t){return!!(G(t)&&t.selectionStart!=null||L(t)&&t.tagName==="TEXTAREA")}function st(t,s,n,r){if(!t||!s||!s.scrollTo)return;let e=t.scrollLeft,i=t.scrollTop;const l=t.clientWidth<t.scrollWidth,u=t.clientHeight<t.scrollHeight;if(l&&r!=="vertical"){const o=A(t,s,"left"),a=h(t),c=h(s);n==="ltr"&&(o+s.offsetWidth+c.scrollMarginRight>t.scrollLeft+t.clientWidth-a.scrollPaddingRight?e=o+s.offsetWidth+c.scrollMarginRight-t.clientWidth+a.scrollPaddingRight:o-c.scrollMarginLeft<t.scrollLeft+a.scrollPaddingLeft&&(e=o-c.scrollMarginLeft-a.scrollPaddingLeft)),n==="rtl"&&(o-c.scrollMarginLeft<t.scrollLeft+a.scrollPaddingLeft?e=o-c.scrollMarginLeft-a.scrollPaddingLeft:o+s.offsetWidth+c.scrollMarginRight>t.scrollLeft+t.clientWidth-a.scrollPaddingRight&&(e=o+s.offsetWidth+c.scrollMarginRight-t.clientWidth+a.scrollPaddingRight))}if(u&&r!=="horizontal"){const o=A(t,s,"top"),a=h(t),c=h(s);o-c.scrollMarginTop<t.scrollTop+a.scrollPaddingTop?i=o-c.scrollMarginTop-a.scrollPaddingTop:o+s.offsetHeight+c.scrollMarginBottom>t.scrollTop+t.clientHeight-a.scrollPaddingBottom&&(i=o+s.offsetHeight+c.scrollMarginBottom-t.clientHeight+a.scrollPaddingBottom)}t.scrollTo({left:e,top:i,behavior:"auto"})}function A(t,s,n){const r=n==="left"?"offsetLeft":"offsetTop";let e=0;for(;s.offsetParent&&(e+=s[r],s.offsetParent!==t);)s=s.offsetParent;return e}function h(t){const s=getComputedStyle(t);return{scrollMarginTop:parseFloat(s.scrollMarginTop)||0,scrollMarginRight:parseFloat(s.scrollMarginRight)||0,scrollMarginBottom:parseFloat(s.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(s.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(s.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(s.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(s.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(s.scrollPaddingLeft)||0}}function et(t){return R(19)?t:t?"true":void 0}export{q as A,Q as C,Y as E,_ as H,Z as M,V as S,C as T,J as a,k as b,x as c,W as d,U as e,j as f,X as g,P as h,et as i,y as j,O as k,tt as l,B as m,v as n,D as o,f as p,w as r,st as s,$ as t,z as u};
@@ -1 +1 @@
1
- import{R as A,r as u,j as e,H as J,G as b,L as B,p as v,I as y,B as N,s as C,z as S,J as k,C as f,D as I,F as g}from"./index-DBw3b5Rd.js";import{u as L,a as E}from"./zod-D8TwVQUn.js";import{L as j,I as w}from"./label-BqqDq1Bf.js";import"./createBaseUIEventDetails-D5nICp6F.js";function G(){const s=A.useLoaderData(),[t,o]=u.useState(!1);return s.ok?!!s.me&&(!s.invite.email||s.invite.email.toLowerCase()===s.me.toLowerCase())&&!t?e.jsx(F,{token:s.token,invite:s.invite,me:s.me,onOther:()=>o(!0)}):e.jsx($,{token:s.token,invite:s.invite}):e.jsx(Y,{code:s.code,message:s.message})}function F({token:s,invite:t,me:o,onOther:i}){const d=v(),[r,x]=u.useState(""),[n,p]=u.useState(!1),a=t.org.name||"a studio",c=async()=>{x(""),p(!0);try{await C.acceptInvite({token:s,email:o}),S("in"),k.clear(),d({to:"/sites",replace:!0})}catch(l){if(l instanceof f&&l.code==="account_exists")return i();x(l instanceof f?l.message:"Could not reach the server. Try again."),p(!1)}};return e.jsx(b,{width:400,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:["Join ",a]}),e.jsxs("p",{className:"m-0 mt-1.5 text-muted-foreground",children:[t.invitedBy?`${t.invitedBy} invited you`:"You were invited"," to join ",a," as ",y(t.role),". You are signed in as"," ",e.jsx("span",{className:"break-all text-foreground",children:o}),"."]})]}),r&&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:r}),e.jsx(N,{type:"button",size:"lg",loading:n,onClick:c,children:n?"Joining…":`Join ${a}`}),!t.email&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx("button",{type:"button",onClick:i,className:"cursor-pointer border-0 bg-transparent p-0 text-foreground underline underline-offset-4",children:"Join with another address"})})]})})}function Y({code:s,message:t}){const{title:o,signIn:i}=J(s);return e.jsx(b,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:o}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:t}),i&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(B,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})})]})})}const R=I({name:g().trim().max(120).optional(),email:g().trim().email("An email address"),password:g().min(1,"A password")});function $({token:s,invite:t}){const o=v(),[i,d]=u.useState(""),[r,x]=u.useState(!1),{register:n,handleSubmit:p,formState:a}=L({resolver:E(R),defaultValues:{email:t.email??"",name:""}}),c=t.org.name||"a studio",l=p(async m=>{if(d(""),!r&&m.password.length<12){d("The password must be at least 12 characters. A short phrase of real words is fine.");return}try{await C.acceptInvite({token:s,password:m.password,...m.name?{name:m.name}:{},...t.email?{}:{email:m.email}}),S("in"),k.clear(),o({to:"/sites",replace:!0})}catch(h){h instanceof f&&h.code==="account_exists"&&x(!0),d(h instanceof f?h.message:"Could not reach the server. Try again.")}});return e.jsx(b,{width:400,children:e.jsxs("form",{onSubmit:l,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:["Join ",c]}),e.jsxs("p",{className:"m-0 mt-1.5 text-muted-foreground",children:[t.invitedBy?`${t.invitedBy} invited you`:"You were invited"," to join ",c," as ",y(t.role),".",r?" Sign in with the account you already have here.":" Choose your password and you're in."]})]}),i&&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:i}),e.jsxs("fieldset",{disabled:a.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{htmlFor:"email",children:"Email"}),e.jsx(w,{id:"email",type:"email",autoComplete:"username",readOnly:!!t.email,"aria-invalid":!!a.errors.email,...n("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),!r&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(j,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(w,{id:"name",autoComplete:"name",...n("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{htmlFor:"password",children:r?"Your password":"Choose a password"}),e.jsx(w,{id:"password",type:"password",autoComplete:r?"current-password":"new-password","aria-invalid":!!a.errors.password,...n("password")}),!r&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsx(N,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Joining…":`Join ${c}`})]})]})})}export{G as component};
1
+ import{R as A,r as u,j as e,H as J,G as b,L as B,p as v,I as y,B as N,s as C,z as S,J as k,C as f,D as I,F as g}from"./index-B_3U6pyz.js";import{u as L,a as E}from"./zod-BqdlirRI.js";import{L as j,I as w}from"./label-BPkAzYEe.js";import"./createBaseUIEventDetails-BDbAfTsh.js";function G(){const s=A.useLoaderData(),[t,o]=u.useState(!1);return s.ok?!!s.me&&(!s.invite.email||s.invite.email.toLowerCase()===s.me.toLowerCase())&&!t?e.jsx(F,{token:s.token,invite:s.invite,me:s.me,onOther:()=>o(!0)}):e.jsx($,{token:s.token,invite:s.invite}):e.jsx(Y,{code:s.code,message:s.message})}function F({token:s,invite:t,me:o,onOther:i}){const d=v(),[r,x]=u.useState(""),[n,p]=u.useState(!1),a=t.org.name||"a studio",c=async()=>{x(""),p(!0);try{await C.acceptInvite({token:s,email:o}),S("in"),k.clear(),d({to:"/sites",replace:!0})}catch(l){if(l instanceof f&&l.code==="account_exists")return i();x(l instanceof f?l.message:"Could not reach the server. Try again."),p(!1)}};return e.jsx(b,{width:400,children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:["Join ",a]}),e.jsxs("p",{className:"m-0 mt-1.5 text-muted-foreground",children:[t.invitedBy?`${t.invitedBy} invited you`:"You were invited"," to join ",a," as ",y(t.role),". You are signed in as"," ",e.jsx("span",{className:"break-all text-foreground",children:o}),"."]})]}),r&&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:r}),e.jsx(N,{type:"button",size:"lg",loading:n,onClick:c,children:n?"Joining…":`Join ${a}`}),!t.email&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx("button",{type:"button",onClick:i,className:"cursor-pointer border-0 bg-transparent p-0 text-foreground underline underline-offset-4",children:"Join with another address"})})]})})}function Y({code:s,message:t}){const{title:o,signIn:i}=J(s);return e.jsx(b,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:o}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:t}),i&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(B,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})})]})})}const R=I({name:g().trim().max(120).optional(),email:g().trim().email("An email address"),password:g().min(1,"A password")});function $({token:s,invite:t}){const o=v(),[i,d]=u.useState(""),[r,x]=u.useState(!1),{register:n,handleSubmit:p,formState:a}=L({resolver:E(R),defaultValues:{email:t.email??"",name:""}}),c=t.org.name||"a studio",l=p(async m=>{if(d(""),!r&&m.password.length<12){d("The password must be at least 12 characters. A short phrase of real words is fine.");return}try{await C.acceptInvite({token:s,password:m.password,...m.name?{name:m.name}:{},...t.email?{}:{email:m.email}}),S("in"),k.clear(),o({to:"/sites",replace:!0})}catch(h){h instanceof f&&h.code==="account_exists"&&x(!0),d(h instanceof f?h.message:"Could not reach the server. Try again.")}});return e.jsx(b,{width:400,children:e.jsxs("form",{onSubmit:l,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:["Join ",c]}),e.jsxs("p",{className:"m-0 mt-1.5 text-muted-foreground",children:[t.invitedBy?`${t.invitedBy} invited you`:"You were invited"," to join ",c," as ",y(t.role),".",r?" Sign in with the account you already have here.":" Choose your password and you're in."]})]}),i&&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:i}),e.jsxs("fieldset",{disabled:a.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{htmlFor:"email",children:"Email"}),e.jsx(w,{id:"email",type:"email",autoComplete:"username",readOnly:!!t.email,"aria-invalid":!!a.errors.email,...n("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),!r&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(j,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(w,{id:"name",autoComplete:"name",...n("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{htmlFor:"password",children:r?"Your password":"Choose a password"}),e.jsx(w,{id:"password",type:"password",autoComplete:r?"current-password":"new-password","aria-invalid":!!a.errors.password,...n("password")}),!r&&e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsx(N,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Joining…":`Join ${c}`})]})]})})}export{G as component};
@@ -1 +1 @@
1
- import{r as f,e as y,f as S,k as U,j as p,h}from"./index-DBw3b5Rd.js";import{h as K,e as $,j as q,A as z,m as G,o as H,k as J,l as O,c as Q,n as W,f as X}from"./createBaseUIEventDetails-D5nICp6F.js";const Y=f.forwardRef(function(a,i){const{render:_,className:ee,id:E,name:b,value:n,disabled:F=!1,onValueChange:w,defaultValue:m,autoFocus:u=!1,style:te,...I}=a,{state:k,name:V,disabled:P,setTouched:g,setDirty:j,validityData:D,setFocused:l,setFilled:s,validationMode:N,validation:t}=K(),{clearErrors:T}=$(),o=P||F,v=V??b,L={...k,disabled:o},{labelId:M}=q(),x=z({id:E});y(()=>{const e=n!=null;t.inputRef.current?.value||e&&n!==""?s(!0):e&&n===""&&s(!1)},[t.inputRef,s,n]);const c=f.useRef(null);y(()=>{u&&c.current===G(H(c.current))&&l(!0)},[u,l]);const[A]=J({controlled:n,default:m,name:"FieldControl",state:"value"}),C=n!==void 0,R=C?A:void 0,B=S(()=>t.inputRef.current?.value);return O(t.inputRef,x,R,B,!o,b),U("input",a,{ref:[i,c],state:L,props:[{id:x,disabled:o,name:v,ref:t.inputRef,"aria-labelledby":M,autoFocus:u,...C?{value:R}:{defaultValue:m},onChange(e){const d=e.currentTarget.value;w?.(d,Q(W,e.nativeEvent)),j(d!==(D.initialValue??"")),s(d!==""),e.nativeEvent.defaultPrevented||(T(v),t.change(d))},onFocus(){l(!0)},onBlur(e){g(!0),l(!1),N==="onBlur"&&t.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName==="INPUT"&&e.key==="Enter"&&(g(!0),t.commit(e.currentTarget.value))}},I,e=>t.getValidationProps(o,e)],stateAttributesMapping:X})}),Z=f.forwardRef(function(a,i){return p.jsx(Y,{ref:i,...a})});function ie({className:r,type:a,...i}){return p.jsx(Z,{type:a,"data-slot":"input",className:h("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-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",r),...i})}function le({className:r,...a}){return p.jsx("label",{"data-slot":"label",className:h("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",r),...a})}export{ie as I,le as L};
1
+ import{r as f,e as y,f as S,k as U,j as p,h}from"./index-B_3U6pyz.js";import{h as K,e as $,j as q,A as z,m as G,o as H,k as J,l as O,c as Q,n as W,f as X}from"./createBaseUIEventDetails-BDbAfTsh.js";const Y=f.forwardRef(function(a,i){const{render:_,className:ee,id:E,name:b,value:n,disabled:F=!1,onValueChange:w,defaultValue:m,autoFocus:u=!1,style:te,...I}=a,{state:k,name:V,disabled:P,setTouched:g,setDirty:j,validityData:D,setFocused:l,setFilled:s,validationMode:N,validation:t}=K(),{clearErrors:T}=$(),o=P||F,v=V??b,L={...k,disabled:o},{labelId:M}=q(),x=z({id:E});y(()=>{const e=n!=null;t.inputRef.current?.value||e&&n!==""?s(!0):e&&n===""&&s(!1)},[t.inputRef,s,n]);const c=f.useRef(null);y(()=>{u&&c.current===G(H(c.current))&&l(!0)},[u,l]);const[A]=J({controlled:n,default:m,name:"FieldControl",state:"value"}),C=n!==void 0,R=C?A:void 0,B=S(()=>t.inputRef.current?.value);return O(t.inputRef,x,R,B,!o,b),U("input",a,{ref:[i,c],state:L,props:[{id:x,disabled:o,name:v,ref:t.inputRef,"aria-labelledby":M,autoFocus:u,...C?{value:R}:{defaultValue:m},onChange(e){const d=e.currentTarget.value;w?.(d,Q(W,e.nativeEvent)),j(d!==(D.initialValue??"")),s(d!==""),e.nativeEvent.defaultPrevented||(T(v),t.change(d))},onFocus(){l(!0)},onBlur(e){g(!0),l(!1),N==="onBlur"&&t.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName==="INPUT"&&e.key==="Enter"&&(g(!0),t.commit(e.currentTarget.value))}},I,e=>t.getValidationProps(o,e)],stateAttributesMapping:X})}),Z=f.forwardRef(function(a,i){return p.jsx(Y,{ref:i,...a})});function ie({className:r,type:a,...i}){return p.jsx(Z,{type:a,"data-slot":"input",className:h("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-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",r),...i})}function le({className:r,...a}){return p.jsx("label",{"data-slot":"label",className:h("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",r),...a})}export{ie as I,le as L};
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-DBw3b5Rd.js";/**
1
+ import{c as t}from"./index-B_3U6pyz.js";/**
2
2
  * @license lucide-react v1.39.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{u as r,Q as u,d as s}from"./useBaseQuery-BWQygP2V.js";import{A as t}from"./index-B_3U6pyz.js";function a(e,o){return r({...e,enabled:!0,suspense:!0,throwOnError:s,placeholderData:void 0},u)}function i(){return a(t.me()).data}export{i as u};
@@ -1,4 +1,4 @@
1
- import{c,j as e,h as a}from"./index-DBw3b5Rd.js";import{C as m}from"./card-BqU7TCLe.js";import{S as l,ap as x,r as d}from"./useScrollLock-BPMFXP7l.js";/**
1
+ import{c,j as e,h as a}from"./index-B_3U6pyz.js";import{C as m}from"./card-DEnJVYTc.js";import{S as l,ap as x,r as d}from"./useScrollLock-Bxg3WK_6.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 e}from"./index-DBw3b5Rd.js";/**
1
+ import{c as e}from"./index-B_3U6pyz.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{u as c,a as g,b as j,K as b,r as m,j as e,N as w,p as N,s as v,z as S,J as y,C as L,G as u,B as C,P as E,L as k,Q as A,D as F,F as R}from"./index-DBw3b5Rd.js";import{u as P,a as B}from"./zod-D8TwVQUn.js";import{L as l,I as d}from"./label-BqqDq1Bf.js";import"./createBaseUIEventDetails-D5nICp6F.js";function z(s){const t=c();return g(t.stores.location,j(s,t))}function O(){const s=b.useLoaderData(),t=c(),a=z({select:r=>w(r.hash)});return m.useEffect(()=>{a!==s.hash&&t.invalidate()},[a,s.hash,t]),s.ok?e.jsx(I,{token:s.token,email:s.email}):e.jsx(D,{code:s.code,message:s.message})}function D({code:s,message:t}){const{title:a,next:r}=E(s);return e.jsx(u,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:a}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:t}),e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(k,{to:r==="sign-in"?"/sign-in":"/forgot",className:"text-foreground underline underline-offset-4",children:A[r]})})]})})}const G=F({password:R().min(12,"At least 12 characters")});function I({token:s,email:t}){const a=N(),[r,i]=m.useState(""),{register:x,handleSubmit:p,formState:o}=P({resolver:B(G)}),h=p(async({password:f})=>{i("");try{await v.confirmReset(s,f),S("in"),y.clear(),a({to:"/sites",replace:!0})}catch(n){i(n instanceof L?n.message:"Could not reach the server. Try again.")}});return e.jsx(u,{children:e.jsxs("form",{onSubmit:h,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:"Choose a new password"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Setting it signs you in here, and signs you out everywhere the old one was used."})]}),r&&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:r}),e.jsxs("fieldset",{disabled:o.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(l,{htmlFor:"email",children:"Email"}),e.jsx(d,{id:"email",type:"email",autoComplete:"username",readOnly:!0,value:t})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(l,{htmlFor:"password",children:"New password"}),e.jsx(d,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!o.errors.password,...x("password")}),o.errors.password?e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:o.errors.password.message}):e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsx(C,{type:"submit",size:"lg",loading:o.isSubmitting,children:o.isSubmitting?"Setting…":"Set the password and sign in"})]})]})})}export{O as component};
1
+ import{u as c,a as g,b as j,K as b,r as m,j as e,N as w,p as N,s as v,z as S,J as y,C as L,G as u,B as C,P as E,L as k,Q as A,D as F,F as R}from"./index-B_3U6pyz.js";import{u as P,a as B}from"./zod-BqdlirRI.js";import{L as l,I as d}from"./label-BPkAzYEe.js";import"./createBaseUIEventDetails-BDbAfTsh.js";function z(s){const t=c();return g(t.stores.location,j(s,t))}function O(){const s=b.useLoaderData(),t=c(),a=z({select:r=>w(r.hash)});return m.useEffect(()=>{a!==s.hash&&t.invalidate()},[a,s.hash,t]),s.ok?e.jsx(I,{token:s.token,email:s.email}):e.jsx(D,{code:s.code,message:s.message})}function D({code:s,message:t}){const{title:a,next:r}=E(s);return e.jsx(u,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{className:"m-0 text-[22px] font-semibold tracking-tight",children:a}),e.jsx("p",{role:"alert",className:"m-0 text-muted-foreground",children:t}),e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:e.jsx(k,{to:r==="sign-in"?"/sign-in":"/forgot",className:"text-foreground underline underline-offset-4",children:A[r]})})]})})}const G=F({password:R().min(12,"At least 12 characters")});function I({token:s,email:t}){const a=N(),[r,i]=m.useState(""),{register:x,handleSubmit:p,formState:o}=P({resolver:B(G)}),h=p(async({password:f})=>{i("");try{await v.confirmReset(s,f),S("in"),y.clear(),a({to:"/sites",replace:!0})}catch(n){i(n instanceof L?n.message:"Could not reach the server. Try again.")}});return e.jsx(u,{children:e.jsxs("form",{onSubmit:h,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:"Choose a new password"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Setting it signs you in here, and signs you out everywhere the old one was used."})]}),r&&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:r}),e.jsxs("fieldset",{disabled:o.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(l,{htmlFor:"email",children:"Email"}),e.jsx(d,{id:"email",type:"email",autoComplete:"username",readOnly:!0,value:t})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(l,{htmlFor:"password",children:"New password"}),e.jsx(d,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!o.errors.password,...x("password")}),o.errors.password?e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:o.errors.password.message}):e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsx(C,{type:"submit",size:"lg",loading:o.isSubmitting,children:o.isSubmitting?"Setting…":"Set the password and sign in"})]})]})})}export{O as component};
@@ -1 +1 @@
1
- import{a3 as r,j as e,L as a,O as o}from"./index-DBw3b5Rd.js";import{u as d}from"./me-BuXPSKyo.js";import"./useBaseQuery-n1C4QVXL.js";function u(){const{site:t}=r.useParams(),s=d().projects.find(n=>n.uid===t),i=s?.archived?"This site is archived. Its comments can be read; nothing new comes in and nothing can be changed.":s?.locked?"This site is read-only: the studio has more sites than its plan includes. Archive a site, or move to a plan with more.":null;return e.jsxs(e.Fragment,{children:[i&&e.jsxs("div",{role:"status",className:"mx-7 mt-5 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border bg-warn-soft px-4 py-2.5 text-[13px]",children:[e.jsx("span",{className:"flex-1",children:i}),e.jsx(a,{to:"/s/$site/settings",params:{site:t},className:"font-medium text-foreground underline underline-offset-2",children:s?.archived?"Restore it":"Site settings"})]}),e.jsx(o,{})]})}export{u as component};
1
+ import{a3 as r,j as e,L as a,O as o}from"./index-B_3U6pyz.js";import{u as d}from"./me-Ffh61LTY.js";import"./useBaseQuery-BWQygP2V.js";function u(){const{site:t}=r.useParams(),s=d().projects.find(n=>n.uid===t),i=s?.archived?"This site is archived. Its comments can be read; nothing new comes in and nothing can be changed.":s?.locked?"This site is read-only: the studio has more sites than its plan includes. Archive a site, or move to a plan with more.":null;return e.jsxs(e.Fragment,{children:[i&&e.jsxs("div",{role:"status",className:"mx-7 mt-5 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md border border-border bg-warn-soft px-4 py-2.5 text-[13px]",children:[e.jsx("span",{className:"flex-1",children:i}),e.jsx(a,{to:"/s/$site/settings",params:{site:t},className:"font-medium text-foreground underline underline-offset-2",children:s?.archived?"Restore it":"Site settings"})]}),e.jsx(o,{})]})}export{u as component};
@@ -1,4 +1,4 @@
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-DBw3b5Rd.js";import{u as we}from"./useQuery-rfvcXYjq.js";import{C as cs}from"./check-T8owKS6W.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-D5nICp6F.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-BPMFXP7l.js";import{u as ft}from"./FieldItemContext-CM5jeOco.js";import{u as gt}from"./useAriaLabelledBy-CIrxFX1m.js";import{u as bt}from"./useValueChanged-w_Y86K5W.js";import{a as jt,u as vt,t as yt}from"./inertValue-DPJM1mgv.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-7_qYsjof.js";import{L as Ke,I as Be}from"./label-BqqDq1Bf.js";import{A as ge,a as be}from"./avatar-d0V38Rww.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-C8j9bKc9.js";import{C as bs}from"./ConfirmDialog-B9o4voIS.js";import{b as We,S as js,E as qe}from"./parts-Dh3j93KT.js";import{C as Ce}from"./chevron-down-CPxjYKx7.js";import{C as wt}from"./copy-D7ySfk8w.js";import{I as Ct}from"./image-off-DEk2KdgQ.js";import{C as St}from"./chevron-right-BOLW380q.js";import{I as $t}from"./InstallTag-CZO85i-P.js";import{u as Mt}from"./me-BuXPSKyo.js";import{A as At}from"./arrow-left-Txus48to.js";import"./useBaseQuery-n1C4QVXL.js";import"./CompositeList-C2IVT2Po.js";import"./getPseudoElementBounds-r9s2Gh_c.js";import"./CompositeItem-XBuzWv1L.js";import"./useCompositeItem-YAQuEkY3.js";import"./card-BqU7TCLe.js";import"./isElementDisabled-CwHw_lZC.js";/**
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-B_3U6pyz.js";import{u as we}from"./useQuery-HUEWFxW8.js";import{C as cs}from"./check-BhmdAbBD.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-BDbAfTsh.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-Bxg3WK_6.js";import{u as ft}from"./FieldItemContext-DrmapX6T.js";import{u as gt}from"./useAriaLabelledBy-x5XF8M1H.js";import{u as bt}from"./useValueChanged-B2j76Odc.js";import{a as jt,u as vt,t as yt}from"./inertValue-Dl2ZzbZu.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-BMaIF-mT.js";import{L as Ke,I as Be}from"./label-BPkAzYEe.js";import{A as ge,a as be}from"./avatar-DQ2PBAkd.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-Dsu0e02Q.js";import{C as bs}from"./ConfirmDialog-_B1eNA1i.js";import{b as We,S as js,E as qe}from"./parts-BZnB0y34.js";import{C as Ce}from"./chevron-down-CkYqA6Tw.js";import{C as wt}from"./copy-DefIRiwo.js";import{I as Ct}from"./image-off-_kTeT3Bb.js";import{C as St}from"./chevron-right-BSOkA3zX.js";import{I as $t}from"./InstallTag-C4m3dgQN.js";import{u as Mt}from"./me-Ffh61LTY.js";import{A as At}from"./arrow-left-kr0TdNCI.js";import"./useBaseQuery-BWQygP2V.js";import"./CompositeList-U-qk8UP6.js";import"./getPseudoElementBounds-Df0qQn0E.js";import"./CompositeItem-Cbbgho1I.js";import"./useCompositeItem-uwStRlwJ.js";import"./card-DEnJVYTc.js";import"./isElementDisabled-CwHw_lZC.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{aK as A,r as f,j as e,B as g,aL as I,q as P,h as L,aM as M,A as N,a2 as F,D as U,F as y}from"./index-DBw3b5Rd.js";import{u as C}from"./useQuery-rfvcXYjq.js";import{u as $,a as B,C as R}from"./zod-D8TwVQUn.js";import{P as D}from"./Picker-lokRYiMC.js";import{C as S}from"./card-BqU7TCLe.js";import{X as z,i as H,j as q,l as K,k as V,m as Y,n as O}from"./dialog-C8j9bKc9.js";import{L as k,I as Q}from"./label-BqqDq1Bf.js";import{T as X,a as G,b as E,c as p,d as J,e as j}from"./table-_kCW8sw7.js";import{C as W}from"./ConfirmDialog-B9o4voIS.js";import{C as Z}from"./CopyButton-DLU4a9od.js";import{P as _,E as ee}from"./parts-Dh3j93KT.js";import{v as T}from"./useScrollLock-BPMFXP7l.js";import{u as se}from"./me-BuXPSKyo.js";import{C as ae}from"./check-T8owKS6W.js";import{U as te}from"./users-ZI_E8YXB.js";import{P as ne}from"./plus-DLkZ3d4a.js";import"./useBaseQuery-n1C4QVXL.js";import"./chevron-down-CPxjYKx7.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-D5nICp6F.js";import"./inertValue-DPJM1mgv.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-w_Y86K5W.js";import"./getPseudoElementBounds-r9s2Gh_c.js";import"./CompositeList-C2IVT2Po.js";import"./copy-D7ySfk8w.js";function Le(){const{site:s}=A.useParams(),{site:l}=A.useRouteContext(),o=C(N.links(s)),m=C(N.origins(s)),[u,i]=f.useState(!1),[t,a]=f.useState(null);f.useEffect(()=>a(null),[s]);const d=o.data?.data??[],h=m.data?.origins[0]?.replace(/\/+$/,"")??"",r=t?`${h}/${t.fragment}`:"",v=e.jsxs(g,{onClick:()=>i(!0),children:[e.jsx(ne,{}),"Add reviewer"]});return e.jsxs("div",{className:"p-7",children:[e.jsx(_,{title:"Reviewers",sub:`Each reviewer gets their own link to ${l.name}`,actions:v}),t&&e.jsxs("div",{className:"mb-4 flex max-w-[1040px] items-center gap-3 rounded-lg border border-ok bg-ok-soft px-3.5 py-3",role:"status",children:[e.jsx(ae,{className:"size-4 shrink-0 text-ok"}),e.jsxs("div",{className:"shrink-0",children:[e.jsxs("b",{className:"font-semibold",children:[t.name," added."]})," ",e.jsx("span",{className:"text-ink-soft",children:"Share this link — it is shown once."})]}),e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12.5px]",children:r}),e.jsx(Z,{text:r,label:"Copy link",withText:!0}),e.jsx(g,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:()=>a(null),children:e.jsx(z,{})})]}),o.isSuccess&&d.length===0?e.jsx(S,{className:"max-w-[1040px]",children:e.jsx(ee,{icon:e.jsx(te,{className:"size-5"}),title:"No reviewers yet",action:v,children:"Add your client and send them their link. They never need an account."})}):e.jsx(S,{className:"max-w-[1040px] overflow-hidden py-0",children:e.jsxs(X,{children:[e.jsx(G,{children:e.jsxs(E,{children:[e.jsx(p,{children:"Name"}),e.jsx(p,{children:"Status"}),e.jsx(p,{children:"Uses"}),e.jsx(p,{children:"Last seen"}),e.jsx(p,{className:"w-0"})]})}),e.jsx(J,{children:d.map(c=>e.jsx(re,{link:c,uid:s,onRevoked:()=>a(b=>b?.id===c.id?null:b)},c.id))})]})}),e.jsx("p",{className:"m-0 mt-3 max-w-[1040px] text-[12.5px] text-muted-foreground",children:"Revoking ends every session minted from the link within 10 seconds. The comments a reviewer left stay."}),e.jsx(ie,{uid:s,open:u,onOpenChange:i,onMinted:a})]})}function re({link:s,uid:l,onRevoked:o}){const m=I(l),u=P(se().user.role,"settings"),[i,t]=f.useState(!1),a=!!s.revokedAt,d=!a&&new Date(s.expiresAt).getTime()<=Date.now(),h=a||d,r=Math.max(0,Math.ceil((new Date(s.expiresAt).getTime()-Date.now())/864e5));return e.jsxs(E,{className:L(h&&"text-muted-foreground"),children:[e.jsx(j,{className:"font-medium",children:s.name}),e.jsx(j,{children:a?e.jsxs("span",{children:["Revoked ",T(s.revokedAt)]}):d?e.jsx("span",{children:"Expired"}):e.jsxs("span",{children:[e.jsx("span",{className:"rounded-full bg-ok-soft px-2 py-0.5 text-[11.5px] font-medium text-ok",children:"Active"}),e.jsxs("span",{className:"ml-2 text-[12px] text-muted-foreground",children:["expires in ",r," day",r===1?"":"s"]})]})}),e.jsx(j,{children:s.useCount}),e.jsx(j,{className:"text-muted-foreground",children:s.lastUsedAt?T(s.lastUsedAt):"never"}),e.jsxs(j,{className:"text-right",children:[!a&&u&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:"Revoke"}),e.jsx(W,{open:i,onOpenChange:t,title:`Revoke ${s.name}'s link?`,description:`Every session minted from it ends within 10 seconds. The comments ${s.name} left stay. This cannot be undone — adding them again makes a new link.`,confirmLabel:"Revoke",busy:m.isPending,onConfirm:()=>{t(!1),o(),m.mutate(s.id)}})]})]})}const oe=U({name:y().trim().min(1,"Their name"),days:y(),roundId:y().optional()});function ie({uid:s,open:l,onOpenChange:o,onMinted:m}){const u=M(s),i=C({...N.rounds(s),enabled:l}),[t,a]=f.useState(""),{register:d,handleSubmit:h,formState:r,reset:v,control:c}=$({resolver:B(oe),defaultValues:{days:"14",roundId:""}}),b=h(async n=>{a("");const x=Number(n.days);try{const w=await u.mutateAsync({name:n.name,...Number.isFinite(x)&&x>0?{expiresAt:new Date(Date.now()+x*864e5).toISOString()}:{},...n.roundId?{roundId:n.roundId}:{}});m(w),v(),o(!1)}catch(w){a(F(w))}});return e.jsx(H,{open:l,onOpenChange:o,children:e.jsx(q,{children:e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(K,{children:[e.jsx(V,{children:"New reviewer"}),e.jsx(Y,{children:"Your client's name, as you will see it on their comments. A link is generated once and shown to you once."})]}),t&&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}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-name",children:"Name"}),e.jsx(Q,{id:"reviewer-name",placeholder:"Marta, Kilnwork","aria-invalid":!!r.errors.name,...d("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-days",children:"Link expires in"}),e.jsx(R,{control:c,name:"days",render:({field:n})=>e.jsx(D,{id:"reviewer-days",value:String(n.value),onChange:n.onChange,options:[{value:"7",label:"7 days"},{value:"14",label:"14 days"},{value:"30",label:"30 days"},{value:"90",label:"90 days"}]})}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"You can revoke it at any time before that."})]}),i.data&&i.data.data.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-round",children:"Pin to a round"}),e.jsx(R,{control:c,name:"roundId",render:({field:n})=>e.jsx(D,{id:"reviewer-round",value:n.value??"",onChange:n.onChange,options:[{value:"",label:"Any round"},...i.data.data.map(x=>({value:x.id,label:x.name}))]})})]}),e.jsxs(O,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:r.isSubmitting,children:r.isSubmitting?"Adding…":"Add reviewer"})]})]})})})}export{Le as component};
1
+ import{aK as A,r as f,j as e,B as g,aL as I,q as P,h as L,aM as M,A as N,a2 as F,D as U,F as y}from"./index-B_3U6pyz.js";import{u as C}from"./useQuery-HUEWFxW8.js";import{u as $,a as B,C as R}from"./zod-BqdlirRI.js";import{P as D}from"./Picker-0Wc1iFQj.js";import{C as S}from"./card-DEnJVYTc.js";import{X as z,i as H,j as q,l as K,k as V,m as Y,n as O}from"./dialog-Dsu0e02Q.js";import{L as k,I as Q}from"./label-BPkAzYEe.js";import{T as X,a as G,b as E,c as p,d as J,e as j}from"./table-BtGHQI2k.js";import{C as W}from"./ConfirmDialog-_B1eNA1i.js";import{C as Z}from"./CopyButton-CIoiqDbz.js";import{P as _,E as ee}from"./parts-BZnB0y34.js";import{v as T}from"./useScrollLock-Bxg3WK_6.js";import{u as se}from"./me-Ffh61LTY.js";import{C as ae}from"./check-BhmdAbBD.js";import{U as te}from"./users-CkVdOVuU.js";import{P as ne}from"./plus-CopH4JTI.js";import"./useBaseQuery-BWQygP2V.js";import"./chevron-down-CkYqA6Tw.js";import"./isElementDisabled-CwHw_lZC.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./inertValue-Dl2ZzbZu.js";import"./serializeValue-B8e3iXO-.js";import"./useValueChanged-B2j76Odc.js";import"./getPseudoElementBounds-Df0qQn0E.js";import"./CompositeList-U-qk8UP6.js";import"./copy-DefIRiwo.js";function Le(){const{site:s}=A.useParams(),{site:l}=A.useRouteContext(),o=C(N.links(s)),m=C(N.origins(s)),[u,i]=f.useState(!1),[t,a]=f.useState(null);f.useEffect(()=>a(null),[s]);const d=o.data?.data??[],h=m.data?.origins[0]?.replace(/\/+$/,"")??"",r=t?`${h}/${t.fragment}`:"",v=e.jsxs(g,{onClick:()=>i(!0),children:[e.jsx(ne,{}),"Add reviewer"]});return e.jsxs("div",{className:"p-7",children:[e.jsx(_,{title:"Reviewers",sub:`Each reviewer gets their own link to ${l.name}`,actions:v}),t&&e.jsxs("div",{className:"mb-4 flex max-w-[1040px] items-center gap-3 rounded-lg border border-ok bg-ok-soft px-3.5 py-3",role:"status",children:[e.jsx(ae,{className:"size-4 shrink-0 text-ok"}),e.jsxs("div",{className:"shrink-0",children:[e.jsxs("b",{className:"font-semibold",children:[t.name," added."]})," ",e.jsx("span",{className:"text-ink-soft",children:"Share this link — it is shown once."})]}),e.jsx("code",{className:"min-w-0 flex-1 truncate rounded-md border border-border bg-card px-2.5 py-1.5 font-mono text-[12.5px]",children:r}),e.jsx(Z,{text:r,label:"Copy link",withText:!0}),e.jsx(g,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:()=>a(null),children:e.jsx(z,{})})]}),o.isSuccess&&d.length===0?e.jsx(S,{className:"max-w-[1040px]",children:e.jsx(ee,{icon:e.jsx(te,{className:"size-5"}),title:"No reviewers yet",action:v,children:"Add your client and send them their link. They never need an account."})}):e.jsx(S,{className:"max-w-[1040px] overflow-hidden py-0",children:e.jsxs(X,{children:[e.jsx(G,{children:e.jsxs(E,{children:[e.jsx(p,{children:"Name"}),e.jsx(p,{children:"Status"}),e.jsx(p,{children:"Uses"}),e.jsx(p,{children:"Last seen"}),e.jsx(p,{className:"w-0"})]})}),e.jsx(J,{children:d.map(c=>e.jsx(re,{link:c,uid:s,onRevoked:()=>a(b=>b?.id===c.id?null:b)},c.id))})]})}),e.jsx("p",{className:"m-0 mt-3 max-w-[1040px] text-[12.5px] text-muted-foreground",children:"Revoking ends every session minted from the link within 10 seconds. The comments a reviewer left stay."}),e.jsx(ie,{uid:s,open:u,onOpenChange:i,onMinted:a})]})}function re({link:s,uid:l,onRevoked:o}){const m=I(l),u=P(se().user.role,"settings"),[i,t]=f.useState(!1),a=!!s.revokedAt,d=!a&&new Date(s.expiresAt).getTime()<=Date.now(),h=a||d,r=Math.max(0,Math.ceil((new Date(s.expiresAt).getTime()-Date.now())/864e5));return e.jsxs(E,{className:L(h&&"text-muted-foreground"),children:[e.jsx(j,{className:"font-medium",children:s.name}),e.jsx(j,{children:a?e.jsxs("span",{children:["Revoked ",T(s.revokedAt)]}):d?e.jsx("span",{children:"Expired"}):e.jsxs("span",{children:[e.jsx("span",{className:"rounded-full bg-ok-soft px-2 py-0.5 text-[11.5px] font-medium text-ok",children:"Active"}),e.jsxs("span",{className:"ml-2 text-[12px] text-muted-foreground",children:["expires in ",r," day",r===1?"":"s"]})]})}),e.jsx(j,{children:s.useCount}),e.jsx(j,{className:"text-muted-foreground",children:s.lastUsedAt?T(s.lastUsedAt):"never"}),e.jsxs(j,{className:"text-right",children:[!a&&u&&e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>t(!0),children:"Revoke"}),e.jsx(W,{open:i,onOpenChange:t,title:`Revoke ${s.name}'s link?`,description:`Every session minted from it ends within 10 seconds. The comments ${s.name} left stay. This cannot be undone — adding them again makes a new link.`,confirmLabel:"Revoke",busy:m.isPending,onConfirm:()=>{t(!1),o(),m.mutate(s.id)}})]})]})}const oe=U({name:y().trim().min(1,"Their name"),days:y(),roundId:y().optional()});function ie({uid:s,open:l,onOpenChange:o,onMinted:m}){const u=M(s),i=C({...N.rounds(s),enabled:l}),[t,a]=f.useState(""),{register:d,handleSubmit:h,formState:r,reset:v,control:c}=$({resolver:B(oe),defaultValues:{days:"14",roundId:""}}),b=h(async n=>{a("");const x=Number(n.days);try{const w=await u.mutateAsync({name:n.name,...Number.isFinite(x)&&x>0?{expiresAt:new Date(Date.now()+x*864e5).toISOString()}:{},...n.roundId?{roundId:n.roundId}:{}});m(w),v(),o(!1)}catch(w){a(F(w))}});return e.jsx(H,{open:l,onOpenChange:o,children:e.jsx(q,{children:e.jsxs("form",{onSubmit:b,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(K,{children:[e.jsx(V,{children:"New reviewer"}),e.jsx(Y,{children:"Your client's name, as you will see it on their comments. A link is generated once and shown to you once."})]}),t&&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}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-name",children:"Name"}),e.jsx(Q,{id:"reviewer-name",placeholder:"Marta, Kilnwork","aria-invalid":!!r.errors.name,...d("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-days",children:"Link expires in"}),e.jsx(R,{control:c,name:"days",render:({field:n})=>e.jsx(D,{id:"reviewer-days",value:String(n.value),onChange:n.onChange,options:[{value:"7",label:"7 days"},{value:"14",label:"14 days"},{value:"30",label:"30 days"},{value:"90",label:"90 days"}]})}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"You can revoke it at any time before that."})]}),i.data&&i.data.data.length>0&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(k,{htmlFor:"reviewer-round",children:"Pin to a round"}),e.jsx(R,{control:c,name:"roundId",render:({field:n})=>e.jsx(D,{id:"reviewer-round",value:n.value??"",onChange:n.onChange,options:[{value:"",label:"Any round"},...i.data.data.map(x=>({value:x.id,label:x.name}))]})})]}),e.jsxs(O,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),e.jsx(g,{type:"submit",loading:r.isSubmitting,children:r.isSubmitting?"Adding…":"Add reviewer"})]})]})})})}export{Le as component};
@@ -1 +1 @@
1
- import{r as l,i as je,ak as re,al as Ae,e as xe,aj as Oe,E as ge,k as ye,j as e,am as Te,f as de,h as ce,q as ue,a_ as Ve,a$ as Me,B as b,A as Ce,b0 as $e,b1 as Be,b2 as Ge,p as Le,b3 as qe}from"./index-DBw3b5Rd.js";import{u as we}from"./useQuery-rfvcXYjq.js";import{I as Y,L as S}from"./label-BqqDq1Bf.js";import{f as Re,h as ke,j as Ne,u as Se,A as ze,c as We,n as He,e as Ke,k as Ue,l as Ye,a as _e}from"./createBaseUIEventDetails-D5nICp6F.js";import{t as Qe,a as Je,u as Xe,S as Ze}from"./inertValue-DPJM1mgv.js";import{A as et,C as tt,I as st}from"./InstallTag-CZO85i-P.js";import{u as nt}from"./useValueChanged-w_Y86K5W.js";import{x as at,y as it}from"./useScrollLock-BPMFXP7l.js";import{C as ot}from"./CompositeItem-XBuzWv1L.js";import{u as rt}from"./FieldItemContext-CM5jeOco.js";import{u as dt}from"./useAriaLabelledBy-CIrxFX1m.js";import{s as lt}from"./serializeValue-B8e3iXO-.js";import{C as Ie}from"./ConfirmDialog-B9o4voIS.js";import{C as ct}from"./CopyButton-DLU4a9od.js";import{B as ut}from"./badge-BpJT5EUT.js";import{a as q,A as mt,P as ft}from"./parts-Dh3j93KT.js";import{u as me}from"./me-BuXPSKyo.js";import{S as ve}from"./switch-DNodWtiG.js";import{S as pt}from"./SaveState-e4RnpJbD.js";import{X as ht}from"./dialog-C8j9bKc9.js";import{P as xt}from"./plus-DLkZ3d4a.js";import"./useBaseQuery-n1C4QVXL.js";import"./CompositeList-C2IVT2Po.js";import"./isElementDisabled-CwHw_lZC.js";import"./useCompositeItem-YAQuEkY3.js";import"./check-T8owKS6W.js";import"./copy-D7ySfk8w.js";import"./useRender-Rc2aDa9D.js";import"./card-BqU7TCLe.js";const gt=l.createContext(void 0);function vt(s=!1){const t=l.useContext(gt);if(!t&&!s)throw new Error(je(86));return t}function bt(s,t){return s.matches(":disabled")?!1:!t||s.form===t?!0:s.form===null&&!s.hasAttribute("form")}const le={checked(s){return s?{"data-checked":""}:{"data-unchecked":""}},...Qe,...Re},Pe=l.createContext(void 0);function jt(){return l.useContext(Pe)}const De=l.createContext(void 0);function yt(){const s=l.useContext(De);if(s===void 0)throw new Error(je(52));return s}const Ct=l.forwardRef(function(t,n){const{render:r,className:i,disabled:c=!1,readOnly:o=!1,required:m=!1,"aria-labelledby":f,value:a,inputRef:I,nativeButton:h=!1,id:R,style:x,...g}=t,j=jt(),{disabled:T,readOnly:_,required:V,form:Q,checkedValue:J,touched:X=!1,validation:M,name:y,setCheckedValue:Z=re,setTouched:ee=re,registerInputRef:A=re}=j??{},{setTouched:te,setFilled:z,state:W,disabled:se}=ke(),k=rt(),{labelId:$,getDescriptionProps:ne}=Ne(),u=se||k.disabled||T||c,N=_||o,O=V||m,B=Q,C=j?J===a:a==="",P=l.useRef(null),w=l.useRef(null),D=M?.registerInput,E=l.useCallback(p=>D?.(p,{controlRef:P,value:void 0}),[D]),G=Ae(I,w,A,E);xe(()=>{w.current?.checked&&z(!0)},[z]),xe(()=>{if(w.current){if(u&&C){A(null);return}A(w.current)}},[C,u,A]);const H=Se(),K=ze({id:R,implicit:!1,controlRef:P}),U=h?void 0:K,ae=dt(f,$,w,!h,U),ie={role:"radio","aria-checked":C,"aria-labelledby":ae,[et]:C?"":void 0,id:h?K:H,onKeyDown(p){p.key==="Enter"&&p.preventDefault()},onClick(p){if(p.defaultPrevented||u||N)return;p.preventDefault();const L=w.current;L&&Te(L,p)},onFocus(p){p.defaultPrevented||u||N||!X||(w.current?.click(),ee(!1))}},{getButtonProps:oe,buttonRef:d}=Oe({disabled:u,native:h,composite:!1}),v={type:"radio",ref:G,form:B,id:U,name:y,tabIndex:-1,style:y?at:it,"aria-hidden":!0,...a!==void 0?{value:lt(a)}:ge,disabled:u,checked:C,required:O,readOnly:N,onChange(p){if(p.nativeEvent.defaultPrevented||u||N||a===void 0)return;const L=We(He,p.nativeEvent);Z(a,L),!L.isCanceled&&te(!0)},onClick(p){p.stopPropagation()},onFocus(){P.current?.focus()}},F=l.useMemo(()=>({...W,required:O,disabled:u,readOnly:N,checked:C}),[W,u,N,C,O]),Ee=F,fe=j!==void 0,pe=[n,P,d],he=[ie,g,oe,ne,M?p=>M.getValidationProps(u,p):ge],Fe=ye("span",t,{enabled:!fe,state:F,ref:pe,props:he,stateAttributesMapping:le});return e.jsxs(De.Provider,{value:Ee,children:[fe?e.jsx(ot,{tag:"span",render:r,className:i,style:x,state:F,refs:pe,props:he,stateAttributesMapping:le}):Fe,e.jsx("input",{...v,suppressHydrationWarning:!0})]})}),wt=l.forwardRef(function(t,n){const{render:r,className:i,style:c,keepMounted:o=!1,...m}=t,f=yt(),a=f.checked,{mounted:I,transitionStatus:h,setMounted:R}=Je(a),x={...f,transitionStatus:h},g=l.useRef(null),j=o||I,T=ye("span",t,{ref:[n,g],state:x,props:m,stateAttributesMapping:le});return Xe({open:a,ref:g,onComplete(){a||R(!1)}}),j?T:null}),Rt=[Ze],kt=l.forwardRef(function(t,n){const{render:r,className:i,disabled:c,readOnly:o,required:m,onValueChange:f,value:a,defaultValue:I,form:h,name:R,inputRef:x,id:g,style:j,...T}=t,{setTouched:_,setFocused:V,validationMode:Q,name:J,disabled:X,state:M,validation:y,setDirty:Z,setFilled:ee,validityData:A}=ke(),{labelId:te}=Ne(),{clearErrors:z,elementRef:W}=Ke(),se=vt(!0),k=X||c,$=J??R,ne=Se(g),[u,N]=Ue({controlled:a,default:I,name:"RadioGroup",state:"value"}),[O,B]=l.useState(!1),C=de((d,v)=>{f?.(d,v),!v.isCanceled&&N(d)}),P=y.getInputControl,w=l.useMemo(()=>({get current(){return P()}}),[P]),D=l.useRef(null),E=l.useRef(null);function G(d){let v;return x&&(typeof x=="function"?v=x(d):x.current=d),D.current=d,v}const H=de(d=>{if(!d||d.disabled)return;E.current||(E.current=d);const v=D.current,F=d.checked||v==null||v.disabled?G(d):void 0;return()=>{E.current===d&&(E.current=null),D.current===d?F?(F(),D.current=null):G(null):F?.()}}),K=de(()=>{const d=W.current;if(!d)return u??null;for(const v of y.registeredInputs.keys())if(v.checked&&bt(v,d))return u??null;return null});Ye(w,ne,u??null,K,!k,R),nt(u,()=>{z($),Z(u!==A.initialValue),ee(u!=null),y.change(u);const d=E.current;u==null&&d&&!d.disabled&&G(d)});const U=te??se?.legendId,ae={...M,disabled:k??!1,required:m??!1,readOnly:o??!1},ie=l.useMemo(()=>({checkedValue:u,disabled:k,form:h,validation:y,name:$,readOnly:o,registerInputRef:H,required:m,setCheckedValue:C,setTouched:B,touched:O}),[u,k,h,y,$,o,H,m,C,B,O]),oe={id:g,role:"radiogroup","aria-required":m||void 0,"aria-disabled":k||void 0,"aria-readonly":o||void 0,"aria-labelledby":U,onFocus(){V(!0)},onBlur(d){_e(d.currentTarget,d.relatedTarget)||(_(!0),V(!1),Q==="onBlur"&&y.commit(u))},onKeyDownCapture(d){d.key.startsWith("Arrow")&&(B(!0),V(!0))}};return e.jsx(Pe.Provider,{value:ie,children:e.jsx(tt,{render:r,className:i,style:j,state:ae,props:[oe,T,d=>y.getValidationProps(k??!1,d)],refs:[n],stateAttributesMapping:Re,enableHomeAndEndKeys:!1,modifierKeys:Rt})})});function Nt({className:s,...t}){return e.jsx(kt,{"data-slot":"radio-group",className:ce("grid w-full gap-2",s),...t})}function St({className:s,...t}){return e.jsx(Ct,{"data-slot":"radio-group-item",className:ce("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...t,children:e.jsx(wt,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:e.jsx("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}function It({uid:s}){const t=me(),n=we(Ce.rounds(s)),r=ue(t.user.role,"settings"),i=n.data?.data??[],c=i.filter(o=>!o.closed&&!o.archived).length;return e.jsxs(q,{title:"Rounds",description:e.jsx(e.Fragment,{children:"One pass of feedback each, and several can run at once — your own QA beside the client's. A new comment goes to the round its reviewer is looking at. Archive a finished round to put it away; delete removes its comments too."}),children:[!r&&e.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:"Only an owner or an admin can change rounds."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col divide-y divide-border p-0","aria-label":"Rounds",children:[i.map(o=>e.jsx(Pt,{uid:s,round:o,manager:r,last:!o.closed&&!o.archived&&c===1},o.id)),n.isSuccess&&i.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:"No rounds yet."})]})]})}const be="Open another round first — new comments need somewhere to go.";function Pt({uid:s,round:t,manager:n,last:r}){const i=Ve(s),c=Me(s),[o,m]=l.useState(!1),[f,a]=l.useState(t.name),[I,h]=l.useState(!1),R=t.archived?"archived":t.closed?"closed":"open",x=i.isPending||c.isPending;return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 py-2.5 first:pt-0 last:pb-0",children:[o?e.jsxs("form",{className:"flex min-w-0 flex-1 items-center gap-2",onSubmit:g=>{g.preventDefault();const j=f.trim();if(!j||j===t.name)return m(!1);i.mutate({id:t.id,name:j},{onSuccess:()=>m(!1)})},children:[e.jsx(Y,{"aria-label":`New name for ${t.name}`,value:f,maxLength:80,autoFocus:!0,onChange:g=>a(g.target.value),onKeyDown:g=>g.key==="Escape"&&m(!1)}),e.jsx(b,{type:"submit",size:"sm",disabled:!f.trim()||i.isPending,children:"Save"}),e.jsx(b,{type:"button",size:"sm",variant:"ghost",onClick:()=>m(!1),children:"Cancel"})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-[13.5px] font-medium",children:t.name}),e.jsx(ut,{variant:"outline",className:"text-[11px]",children:R})]}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] text-muted-foreground",children:["Round ",t.number," · ",t.threads," ",t.threads===1?"comment":"comments",t.unresolved>0?` · ${t.unresolved} unresolved`:""]})]}),n&&!o&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1",title:r?be:void 0,children:[e.jsx(b,{size:"sm",variant:"ghost","aria-label":`Rename ${t.name}`,disabled:x,onClick:()=>{a(t.name),m(!0)},children:"Rename"}),!t.archived&&e.jsx(b,{size:"sm",variant:"ghost","aria-label":`${t.closed?"Reopen":"Close"} ${t.name}`,disabled:x||r,onClick:()=>i.mutate({id:t.id,closed:!t.closed}),children:t.closed?"Reopen":"Close"}),e.jsx(b,{size:"sm",variant:"ghost","aria-label":`${t.archived?"Restore":"Archive"} ${t.name}`,disabled:x||r,onClick:()=>i.mutate({id:t.id,archived:!t.archived}),children:t.archived?"Restore":"Archive"}),e.jsx(b,{size:"sm",variant:"ghost",className:"text-destructive","aria-label":`Delete ${t.name}`,disabled:x||r,onClick:()=>h(!0),children:"Delete…"})]}),n&&r&&!o&&e.jsx("p",{className:"m-0 w-full text-[12px] text-muted-foreground",children:be}),e.jsx(Ie,{open:I,onOpenChange:h,title:`Delete ${t.name}?`,description:t.threads>0?e.jsxs(e.Fragment,{children:["This deletes the round and"," ",e.jsxs("b",{className:"font-semibold text-foreground",children:[t.threads," ",t.threads===1?"comment":"comments"," and their screenshots"]}),". Reviewers stop seeing them straight away. To keep them out of sight instead, archive the round."]}):e.jsxs(e.Fragment,{children:["This round has no comments. Its number, Round ",t.number,", is not used again."]}),confirmLabel:"Delete round",confirmWord:t.name,busy:c.isPending,onConfirm:()=>c.mutate({id:t.id,confirm:t.name},{onSuccess:()=>h(!1)})})]})}const Dt=[{id:"open",title:"Everyone on the site",note:"The toolbar appears for every visitor on the addresses above. Simplest for a staging URL nobody else knows."},{id:"link-required",title:"Only reviewers with a link",note:"You add a reviewer and send them their link. Use this when staging is publicly reachable, or when one reviewer needs revoking without shutting the whole site."}];function Et(){const{site:s}=$e.useParams(),t=me(),n=t.projects.find(a=>a.uid===s),r=ue(t.user.role,"settings"),i=we(Ce.origins(s)),c=Be(s),[o,m]=l.useState(null),f=a=>c.mutate(a,{onSuccess:()=>m(Date.now())});return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(ft,{title:"Site settings",sub:n.name,actions:e.jsx(pt,{saving:c.isPending,savedAt:o})}),e.jsxs(q,{title:"Site",description:"Its name, its ID for the tag, and where the widget may run.",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{children:"Site ID"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md bg-muted px-2.5 py-1.5 font-mono text-[12.5px] text-ink-soft",children:n.uid}),e.jsx(ct,{text:n.uid,label:"Copy the site ID"})]})]}),e.jsx(Ft,{name:n.name,onSave:a=>f({name:a})}),e.jsx(At,{domain:i.data?.domain??null,loaded:i.isSuccess,onSave:a=>f({domain:a})}),e.jsx(Ot,{list:i.data?.origins??[],loaded:i.isSuccess,hasDomain:!!i.data?.domain,onChange:a=>f({origins:a})})]}),e.jsxs(q,{title:"Widget",description:"Whether it runs, who the toolbar appears for, what guests may do, and the tag itself.",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"widget-on",className:"text-[13px] font-medium",children:"Widget on this site"}),e.jsx("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:"Off hides the toolbar for everyone and refuses new comments. The tag can stay in the site's code."})]}),e.jsx(ve,{id:"widget-on","aria-label":"Widget on this site",checked:n.status!=="paused",onCheckedChange:a=>f({status:a?"active":"paused"})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"guests-status",className:"text-[13px] font-medium",children:"Guests can change status"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:["People who comment without an account or a review link can move a comment between Open, In progress, In review and Resolved.",!r&&" Only an owner or an admin can change this."]})]}),e.jsx(ve,{id:"guests-status","aria-label":"Guests can change status",checked:n.guestsCanChangeStatus!==!1,disabled:!r,onCheckedChange:a=>f({guestsCanChangeStatus:a})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(S,{children:"Who can comment"}),e.jsx(Nt,{value:n.writeMode,onValueChange:a=>f({writeMode:String(a)}),className:"gap-2",children:Dt.map(a=>e.jsxs("label",{className:ce("flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5",n.writeMode===a.id&&"border-brand bg-brand-soft"),children:[e.jsx(St,{value:a.id,className:"mt-0.5","aria-label":a.title}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:a.title}),e.jsx("span",{className:"block text-[12px] leading-normal text-muted-foreground",children:a.note})]})]},a.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{children:"Install"}),e.jsx(st,{uid:n.uid})]})]}),e.jsx(It,{uid:s}),e.jsx(Tt,{uid:s,name:n.name,archived:!!n.archived,locked:!!n.locked}),e.jsx(Vt,{uid:s,name:n.name})]})}function Ft({name:s,onSave:t}){const[n,r]=l.useState(s);l.useEffect(()=>r(s),[s]);const i=n.trim().length>0&&n.trim()!==s;return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:c=>{c.preventDefault(),i&&t(n.trim())},children:[e.jsx(S,{htmlFor:"site-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Y,{id:"site-name",value:n,onChange:c=>r(c.target.value)}),i&&e.jsx(b,{type:"submit",variant:"outline",children:"Save"})]})]})}function At({domain:s,loaded:t,onSave:n}){const[r,i]=l.useState(s??"");l.useEffect(()=>i(s??""),[s]);const c=r.trim()!==(s??"");return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:o=>{o.preventDefault(),c&&n(r.trim()||null)},children:[e.jsx(S,{htmlFor:"site-domain",children:"Domain"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Y,{id:"site-domain",placeholder:"kilnwork.studio",value:r,onChange:o=>i(o.target.value),disabled:!t}),c&&e.jsx(b,{type:"submit",variant:"outline",children:r.trim()?"Save domain":"Clear domain"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build."})]})}function Ot({list:s,loaded:t,hasDomain:n,onChange:r}){const[i,c]=l.useState("");return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"site-origin-add",children:"Also allowed"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Exact addresses the domain does not cover — a client's other host, a preview on somebody else's suffix."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:[s.map(o=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md border border-border px-2 py-1 font-mono text-[12px]",children:o}),e.jsx(b,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${o}`,disabled:s.length<=1&&!n,onClick:()=>r(s.filter(m=>m!==o)),children:e.jsx(ht,{})})]},o)),t&&s.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:n?"None besides the domain.":"No address yet."})]}),e.jsxs("form",{className:"flex gap-2",onSubmit:o=>{o.preventDefault();const m=i.trim();m&&(r([...s,m]),c(""))},children:[e.jsx(Y,{id:"site-origin-add",placeholder:"https://staging.example.com",value:i,onChange:o=>c(o.target.value)}),e.jsxs(b,{type:"submit",variant:"outline",disabled:!i.trim(),children:[e.jsx(xt,{}),"Add"]})]})]})}function Tt({uid:s,name:t,archived:n,locked:r}){const i=Ge(s);return e.jsx(q,{title:n?"Restore this site":"Archive this site",description:n?"Its widget takes comments again and it counts toward the plan. Restoring needs room on the plan.":"For a site you have finished with. Every comment is kept and can be read, the widget stops taking new ones, and the site no longer counts toward the plan.",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:n?`${t} is archived.`:r?`${t} is read-only because the studio is over its plan. Archiving another site frees a place.`:"You can restore it at any time."}),e.jsx(b,{type:"button",variant:"outline",loading:i.isPending,onClick:()=>i.mutate(n?"restore":"archive"),children:n?`Restore ${t}`:`Archive ${t}`})]})})}function Vt({uid:s,name:t}){const[n,r]=l.useState(!1),i=Le(),c=qe(s);return e.jsxs(q,{danger:!0,title:"Delete this site",description:e.jsxs(e.Fragment,{children:["The site stops appearing and its widget stops being served."," ",e.jsx("b",{className:"font-semibold text-foreground",children:"Nothing your client wrote is destroyed"})," — the comments stay in the database, so a mistake here is recoverable. Its screenshots are kept for 30 days and then removed."]}),children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:"You will be asked to type the site's name."}),e.jsxs(b,{type:"button",variant:"outline",className:"border-destructive text-destructive",onClick:()=>r(!0),children:["Delete ",t,"…"]})]}),e.jsx(Ie,{open:n,onOpenChange:r,title:`Delete ${t}?`,description:"The site stops appearing and its widget stops being served. Nothing your client wrote is destroyed — the comments stay in the database. Its screenshots are kept for 30 days and then removed.",confirmLabel:"Delete",confirmWord:t,busy:c.isPending,onConfirm:()=>c.mutate(void 0,{onSuccess:()=>{r(!1),i({to:"/sites"})}})})]})}const ms=()=>ue(me().user.role,"settings")?e.jsx(Et,{}):e.jsx(mt,{title:"Site settings",children:e.jsx("p",{className:"m-0",children:"A site's addresses, who may comment, the widget and its rounds are set by an owner or an admin of the studio."})});export{ms as component};
1
+ import{r as l,i as je,ak as re,al as Ae,e as xe,aj as Oe,E as ge,k as ye,j as e,am as Te,f as de,h as ce,q as ue,a_ as Ve,a$ as Me,B as b,A as Ce,b0 as $e,b1 as Be,b2 as Ge,p as Le,b3 as qe}from"./index-B_3U6pyz.js";import{u as we}from"./useQuery-HUEWFxW8.js";import{I as Y,L as S}from"./label-BPkAzYEe.js";import{f as Re,h as ke,j as Ne,u as Se,A as ze,c as We,n as He,e as Ke,k as Ue,l as Ye,a as _e}from"./createBaseUIEventDetails-BDbAfTsh.js";import{t as Qe,a as Je,u as Xe,S as Ze}from"./inertValue-Dl2ZzbZu.js";import{A as et,C as tt,I as st}from"./InstallTag-C4m3dgQN.js";import{u as nt}from"./useValueChanged-B2j76Odc.js";import{x as at,y as it}from"./useScrollLock-Bxg3WK_6.js";import{C as ot}from"./CompositeItem-Cbbgho1I.js";import{u as rt}from"./FieldItemContext-DrmapX6T.js";import{u as dt}from"./useAriaLabelledBy-x5XF8M1H.js";import{s as lt}from"./serializeValue-B8e3iXO-.js";import{C as Ie}from"./ConfirmDialog-_B1eNA1i.js";import{C as ct}from"./CopyButton-CIoiqDbz.js";import{B as ut}from"./badge-5vfpTOMk.js";import{a as q,A as mt,P as ft}from"./parts-BZnB0y34.js";import{u as me}from"./me-Ffh61LTY.js";import{S as ve}from"./switch-9hlceDWy.js";import{S as pt}from"./SaveState-B4LwnOrc.js";import{X as ht}from"./dialog-Dsu0e02Q.js";import{P as xt}from"./plus-CopH4JTI.js";import"./useBaseQuery-BWQygP2V.js";import"./CompositeList-U-qk8UP6.js";import"./isElementDisabled-CwHw_lZC.js";import"./useCompositeItem-uwStRlwJ.js";import"./check-BhmdAbBD.js";import"./copy-DefIRiwo.js";import"./useRender-BMKPZM38.js";import"./card-DEnJVYTc.js";const gt=l.createContext(void 0);function vt(s=!1){const t=l.useContext(gt);if(!t&&!s)throw new Error(je(86));return t}function bt(s,t){return s.matches(":disabled")?!1:!t||s.form===t?!0:s.form===null&&!s.hasAttribute("form")}const le={checked(s){return s?{"data-checked":""}:{"data-unchecked":""}},...Qe,...Re},Pe=l.createContext(void 0);function jt(){return l.useContext(Pe)}const De=l.createContext(void 0);function yt(){const s=l.useContext(De);if(s===void 0)throw new Error(je(52));return s}const Ct=l.forwardRef(function(t,n){const{render:r,className:i,disabled:c=!1,readOnly:o=!1,required:m=!1,"aria-labelledby":f,value:a,inputRef:I,nativeButton:h=!1,id:R,style:x,...g}=t,j=jt(),{disabled:T,readOnly:_,required:V,form:Q,checkedValue:J,touched:X=!1,validation:M,name:y,setCheckedValue:Z=re,setTouched:ee=re,registerInputRef:A=re}=j??{},{setTouched:te,setFilled:z,state:W,disabled:se}=ke(),k=rt(),{labelId:$,getDescriptionProps:ne}=Ne(),u=se||k.disabled||T||c,N=_||o,O=V||m,B=Q,C=j?J===a:a==="",P=l.useRef(null),w=l.useRef(null),D=M?.registerInput,E=l.useCallback(p=>D?.(p,{controlRef:P,value:void 0}),[D]),G=Ae(I,w,A,E);xe(()=>{w.current?.checked&&z(!0)},[z]),xe(()=>{if(w.current){if(u&&C){A(null);return}A(w.current)}},[C,u,A]);const H=Se(),K=ze({id:R,implicit:!1,controlRef:P}),U=h?void 0:K,ae=dt(f,$,w,!h,U),ie={role:"radio","aria-checked":C,"aria-labelledby":ae,[et]:C?"":void 0,id:h?K:H,onKeyDown(p){p.key==="Enter"&&p.preventDefault()},onClick(p){if(p.defaultPrevented||u||N)return;p.preventDefault();const L=w.current;L&&Te(L,p)},onFocus(p){p.defaultPrevented||u||N||!X||(w.current?.click(),ee(!1))}},{getButtonProps:oe,buttonRef:d}=Oe({disabled:u,native:h,composite:!1}),v={type:"radio",ref:G,form:B,id:U,name:y,tabIndex:-1,style:y?at:it,"aria-hidden":!0,...a!==void 0?{value:lt(a)}:ge,disabled:u,checked:C,required:O,readOnly:N,onChange(p){if(p.nativeEvent.defaultPrevented||u||N||a===void 0)return;const L=We(He,p.nativeEvent);Z(a,L),!L.isCanceled&&te(!0)},onClick(p){p.stopPropagation()},onFocus(){P.current?.focus()}},F=l.useMemo(()=>({...W,required:O,disabled:u,readOnly:N,checked:C}),[W,u,N,C,O]),Ee=F,fe=j!==void 0,pe=[n,P,d],he=[ie,g,oe,ne,M?p=>M.getValidationProps(u,p):ge],Fe=ye("span",t,{enabled:!fe,state:F,ref:pe,props:he,stateAttributesMapping:le});return e.jsxs(De.Provider,{value:Ee,children:[fe?e.jsx(ot,{tag:"span",render:r,className:i,style:x,state:F,refs:pe,props:he,stateAttributesMapping:le}):Fe,e.jsx("input",{...v,suppressHydrationWarning:!0})]})}),wt=l.forwardRef(function(t,n){const{render:r,className:i,style:c,keepMounted:o=!1,...m}=t,f=yt(),a=f.checked,{mounted:I,transitionStatus:h,setMounted:R}=Je(a),x={...f,transitionStatus:h},g=l.useRef(null),j=o||I,T=ye("span",t,{ref:[n,g],state:x,props:m,stateAttributesMapping:le});return Xe({open:a,ref:g,onComplete(){a||R(!1)}}),j?T:null}),Rt=[Ze],kt=l.forwardRef(function(t,n){const{render:r,className:i,disabled:c,readOnly:o,required:m,onValueChange:f,value:a,defaultValue:I,form:h,name:R,inputRef:x,id:g,style:j,...T}=t,{setTouched:_,setFocused:V,validationMode:Q,name:J,disabled:X,state:M,validation:y,setDirty:Z,setFilled:ee,validityData:A}=ke(),{labelId:te}=Ne(),{clearErrors:z,elementRef:W}=Ke(),se=vt(!0),k=X||c,$=J??R,ne=Se(g),[u,N]=Ue({controlled:a,default:I,name:"RadioGroup",state:"value"}),[O,B]=l.useState(!1),C=de((d,v)=>{f?.(d,v),!v.isCanceled&&N(d)}),P=y.getInputControl,w=l.useMemo(()=>({get current(){return P()}}),[P]),D=l.useRef(null),E=l.useRef(null);function G(d){let v;return x&&(typeof x=="function"?v=x(d):x.current=d),D.current=d,v}const H=de(d=>{if(!d||d.disabled)return;E.current||(E.current=d);const v=D.current,F=d.checked||v==null||v.disabled?G(d):void 0;return()=>{E.current===d&&(E.current=null),D.current===d?F?(F(),D.current=null):G(null):F?.()}}),K=de(()=>{const d=W.current;if(!d)return u??null;for(const v of y.registeredInputs.keys())if(v.checked&&bt(v,d))return u??null;return null});Ye(w,ne,u??null,K,!k,R),nt(u,()=>{z($),Z(u!==A.initialValue),ee(u!=null),y.change(u);const d=E.current;u==null&&d&&!d.disabled&&G(d)});const U=te??se?.legendId,ae={...M,disabled:k??!1,required:m??!1,readOnly:o??!1},ie=l.useMemo(()=>({checkedValue:u,disabled:k,form:h,validation:y,name:$,readOnly:o,registerInputRef:H,required:m,setCheckedValue:C,setTouched:B,touched:O}),[u,k,h,y,$,o,H,m,C,B,O]),oe={id:g,role:"radiogroup","aria-required":m||void 0,"aria-disabled":k||void 0,"aria-readonly":o||void 0,"aria-labelledby":U,onFocus(){V(!0)},onBlur(d){_e(d.currentTarget,d.relatedTarget)||(_(!0),V(!1),Q==="onBlur"&&y.commit(u))},onKeyDownCapture(d){d.key.startsWith("Arrow")&&(B(!0),V(!0))}};return e.jsx(Pe.Provider,{value:ie,children:e.jsx(tt,{render:r,className:i,style:j,state:ae,props:[oe,T,d=>y.getValidationProps(k??!1,d)],refs:[n],stateAttributesMapping:Re,enableHomeAndEndKeys:!1,modifierKeys:Rt})})});function Nt({className:s,...t}){return e.jsx(kt,{"data-slot":"radio-group",className:ce("grid w-full gap-2",s),...t})}function St({className:s,...t}){return e.jsx(Ct,{"data-slot":"radio-group-item",className:ce("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...t,children:e.jsx(wt,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:e.jsx("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}function It({uid:s}){const t=me(),n=we(Ce.rounds(s)),r=ue(t.user.role,"settings"),i=n.data?.data??[],c=i.filter(o=>!o.closed&&!o.archived).length;return e.jsxs(q,{title:"Rounds",description:e.jsx(e.Fragment,{children:"One pass of feedback each, and several can run at once — your own QA beside the client's. A new comment goes to the round its reviewer is looking at. Archive a finished round to put it away; delete removes its comments too."}),children:[!r&&e.jsx("p",{className:"m-0 text-[12.5px] text-muted-foreground",children:"Only an owner or an admin can change rounds."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col divide-y divide-border p-0","aria-label":"Rounds",children:[i.map(o=>e.jsx(Pt,{uid:s,round:o,manager:r,last:!o.closed&&!o.archived&&c===1},o.id)),n.isSuccess&&i.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:"No rounds yet."})]})]})}const be="Open another round first — new comments need somewhere to go.";function Pt({uid:s,round:t,manager:n,last:r}){const i=Ve(s),c=Me(s),[o,m]=l.useState(!1),[f,a]=l.useState(t.name),[I,h]=l.useState(!1),R=t.archived?"archived":t.closed?"closed":"open",x=i.isPending||c.isPending;return e.jsxs("li",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 py-2.5 first:pt-0 last:pb-0",children:[o?e.jsxs("form",{className:"flex min-w-0 flex-1 items-center gap-2",onSubmit:g=>{g.preventDefault();const j=f.trim();if(!j||j===t.name)return m(!1);i.mutate({id:t.id,name:j},{onSuccess:()=>m(!1)})},children:[e.jsx(Y,{"aria-label":`New name for ${t.name}`,value:f,maxLength:80,autoFocus:!0,onChange:g=>a(g.target.value),onKeyDown:g=>g.key==="Escape"&&m(!1)}),e.jsx(b,{type:"submit",size:"sm",disabled:!f.trim()||i.isPending,children:"Save"}),e.jsx(b,{type:"button",size:"sm",variant:"ghost",onClick:()=>m(!1),children:"Cancel"})]}):e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-[13.5px] font-medium",children:t.name}),e.jsx(ut,{variant:"outline",className:"text-[11px]",children:R})]}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] text-muted-foreground",children:["Round ",t.number," · ",t.threads," ",t.threads===1?"comment":"comments",t.unresolved>0?` · ${t.unresolved} unresolved`:""]})]}),n&&!o&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1",title:r?be:void 0,children:[e.jsx(b,{size:"sm",variant:"ghost","aria-label":`Rename ${t.name}`,disabled:x,onClick:()=>{a(t.name),m(!0)},children:"Rename"}),!t.archived&&e.jsx(b,{size:"sm",variant:"ghost","aria-label":`${t.closed?"Reopen":"Close"} ${t.name}`,disabled:x||r,onClick:()=>i.mutate({id:t.id,closed:!t.closed}),children:t.closed?"Reopen":"Close"}),e.jsx(b,{size:"sm",variant:"ghost","aria-label":`${t.archived?"Restore":"Archive"} ${t.name}`,disabled:x||r,onClick:()=>i.mutate({id:t.id,archived:!t.archived}),children:t.archived?"Restore":"Archive"}),e.jsx(b,{size:"sm",variant:"ghost",className:"text-destructive","aria-label":`Delete ${t.name}`,disabled:x||r,onClick:()=>h(!0),children:"Delete…"})]}),n&&r&&!o&&e.jsx("p",{className:"m-0 w-full text-[12px] text-muted-foreground",children:be}),e.jsx(Ie,{open:I,onOpenChange:h,title:`Delete ${t.name}?`,description:t.threads>0?e.jsxs(e.Fragment,{children:["This deletes the round and"," ",e.jsxs("b",{className:"font-semibold text-foreground",children:[t.threads," ",t.threads===1?"comment":"comments"," and their screenshots"]}),". Reviewers stop seeing them straight away. To keep them out of sight instead, archive the round."]}):e.jsxs(e.Fragment,{children:["This round has no comments. Its number, Round ",t.number,", is not used again."]}),confirmLabel:"Delete round",confirmWord:t.name,busy:c.isPending,onConfirm:()=>c.mutate({id:t.id,confirm:t.name},{onSuccess:()=>h(!1)})})]})}const Dt=[{id:"open",title:"Everyone on the site",note:"The toolbar appears for every visitor on the addresses above. Simplest for a staging URL nobody else knows."},{id:"link-required",title:"Only reviewers with a link",note:"You add a reviewer and send them their link. Use this when staging is publicly reachable, or when one reviewer needs revoking without shutting the whole site."}];function Et(){const{site:s}=$e.useParams(),t=me(),n=t.projects.find(a=>a.uid===s),r=ue(t.user.role,"settings"),i=we(Ce.origins(s)),c=Be(s),[o,m]=l.useState(null),f=a=>c.mutate(a,{onSuccess:()=>m(Date.now())});return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(ft,{title:"Site settings",sub:n.name,actions:e.jsx(pt,{saving:c.isPending,savedAt:o})}),e.jsxs(q,{title:"Site",description:"Its name, its ID for the tag, and where the widget may run.",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{children:"Site ID"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md bg-muted px-2.5 py-1.5 font-mono text-[12.5px] text-ink-soft",children:n.uid}),e.jsx(ct,{text:n.uid,label:"Copy the site ID"})]})]}),e.jsx(Ft,{name:n.name,onSave:a=>f({name:a})}),e.jsx(At,{domain:i.data?.domain??null,loaded:i.isSuccess,onSave:a=>f({domain:a})}),e.jsx(Ot,{list:i.data?.origins??[],loaded:i.isSuccess,hasDomain:!!i.data?.domain,onChange:a=>f({origins:a})})]}),e.jsxs(q,{title:"Widget",description:"Whether it runs, who the toolbar appears for, what guests may do, and the tag itself.",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"widget-on",className:"text-[13px] font-medium",children:"Widget on this site"}),e.jsx("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:"Off hides the toolbar for everyone and refuses new comments. The tag can stay in the site's code."})]}),e.jsx(ve,{id:"widget-on","aria-label":"Widget on this site",checked:n.status!=="paused",onCheckedChange:a=>f({status:a?"active":"paused"})})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-md border border-border px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx(S,{htmlFor:"guests-status",className:"text-[13px] font-medium",children:"Guests can change status"}),e.jsxs("p",{className:"m-0 mt-0.5 text-[12px] leading-normal text-muted-foreground",children:["People who comment without an account or a review link can move a comment between Open, In progress, In review and Resolved.",!r&&" Only an owner or an admin can change this."]})]}),e.jsx(ve,{id:"guests-status","aria-label":"Guests can change status",checked:n.guestsCanChangeStatus!==!1,disabled:!r,onCheckedChange:a=>f({guestsCanChangeStatus:a})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(S,{children:"Who can comment"}),e.jsx(Nt,{value:n.writeMode,onValueChange:a=>f({writeMode:String(a)}),className:"gap-2",children:Dt.map(a=>e.jsxs("label",{className:ce("flex cursor-pointer items-start gap-2.5 rounded-md border border-border px-3 py-2.5",n.writeMode===a.id&&"border-brand bg-brand-soft"),children:[e.jsx(St,{value:a.id,className:"mt-0.5","aria-label":a.title}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-[13px] font-medium",children:a.title}),e.jsx("span",{className:"block text-[12px] leading-normal text-muted-foreground",children:a.note})]})]},a.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{children:"Install"}),e.jsx(st,{uid:n.uid})]})]}),e.jsx(It,{uid:s}),e.jsx(Tt,{uid:s,name:n.name,archived:!!n.archived,locked:!!n.locked}),e.jsx(Vt,{uid:s,name:n.name})]})}function Ft({name:s,onSave:t}){const[n,r]=l.useState(s);l.useEffect(()=>r(s),[s]);const i=n.trim().length>0&&n.trim()!==s;return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:c=>{c.preventDefault(),i&&t(n.trim())},children:[e.jsx(S,{htmlFor:"site-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Y,{id:"site-name",value:n,onChange:c=>r(c.target.value)}),i&&e.jsx(b,{type:"submit",variant:"outline",children:"Save"})]})]})}function At({domain:s,loaded:t,onSave:n}){const[r,i]=l.useState(s??"");l.useEffect(()=>i(s??""),[s]);const c=r.trim()!==(s??"");return e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:o=>{o.preventDefault(),c&&n(r.trim()||null)},children:[e.jsx(S,{htmlFor:"site-domain",children:"Domain"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Y,{id:"site-domain",placeholder:"kilnwork.studio",value:r,onChange:o=>i(o.target.value),disabled:!t}),c&&e.jsx(b,{type:"submit",variant:"outline",children:r.trim()?"Save domain":"Clear domain"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build."})]})}function Ot({list:s,loaded:t,hasDomain:n,onChange:r}){const[i,c]=l.useState("");return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(S,{htmlFor:"site-origin-add",children:"Also allowed"}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Exact addresses the domain does not cover — a client's other host, a preview on somebody else's suffix."}),e.jsxs("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:[s.map(o=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"rounded-md border border-border px-2 py-1 font-mono text-[12px]",children:o}),e.jsx(b,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${o}`,disabled:s.length<=1&&!n,onClick:()=>r(s.filter(m=>m!==o)),children:e.jsx(ht,{})})]},o)),t&&s.length===0&&e.jsx("li",{className:"text-[12.5px] text-muted-foreground",children:n?"None besides the domain.":"No address yet."})]}),e.jsxs("form",{className:"flex gap-2",onSubmit:o=>{o.preventDefault();const m=i.trim();m&&(r([...s,m]),c(""))},children:[e.jsx(Y,{id:"site-origin-add",placeholder:"https://staging.example.com",value:i,onChange:o=>c(o.target.value)}),e.jsxs(b,{type:"submit",variant:"outline",disabled:!i.trim(),children:[e.jsx(xt,{}),"Add"]})]})]})}function Tt({uid:s,name:t,archived:n,locked:r}){const i=Ge(s);return e.jsx(q,{title:n?"Restore this site":"Archive this site",description:n?"Its widget takes comments again and it counts toward the plan. Restoring needs room on the plan.":"For a site you have finished with. Every comment is kept and can be read, the widget stops taking new ones, and the site no longer counts toward the plan.",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:n?`${t} is archived.`:r?`${t} is read-only because the studio is over its plan. Archiving another site frees a place.`:"You can restore it at any time."}),e.jsx(b,{type:"button",variant:"outline",loading:i.isPending,onClick:()=>i.mutate(n?"restore":"archive"),children:n?`Restore ${t}`:`Archive ${t}`})]})})}function Vt({uid:s,name:t}){const[n,r]=l.useState(!1),i=Le(),c=qe(s);return e.jsxs(q,{danger:!0,title:"Delete this site",description:e.jsxs(e.Fragment,{children:["The site stops appearing and its widget stops being served."," ",e.jsx("b",{className:"font-semibold text-foreground",children:"Nothing your client wrote is destroyed"})," — the comments stay in the database, so a mistake here is recoverable. Its screenshots are kept for 30 days and then removed."]}),children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("p",{className:"m-0 flex-1 text-[13px] text-ink-soft",children:"You will be asked to type the site's name."}),e.jsxs(b,{type:"button",variant:"outline",className:"border-destructive text-destructive",onClick:()=>r(!0),children:["Delete ",t,"…"]})]}),e.jsx(Ie,{open:n,onOpenChange:r,title:`Delete ${t}?`,description:"The site stops appearing and its widget stops being served. Nothing your client wrote is destroyed — the comments stay in the database. Its screenshots are kept for 30 days and then removed.",confirmLabel:"Delete",confirmWord:t,busy:c.isPending,onConfirm:()=>c.mutate(void 0,{onSuccess:()=>{r(!1),i({to:"/sites"})}})})]})}const ms=()=>ue(me().user.role,"settings")?e.jsx(Et,{}):e.jsx(mt,{title:"Site settings",children:e.jsx("p",{className:"m-0",children:"A site's addresses, who may comment, the widget and its rounds are set by an owner or an admin of the studio."})});export{ms as component};
@@ -1 +1 @@
1
- import{T as x,p as h,r as g,s as f,z as j,J as N,C as w,j as e,G as b,B as y,D as S,F as r}from"./index-DBw3b5Rd.js";import{u as v,a as F}from"./zod-D8TwVQUn.js";import{L as i,I as o}from"./label-BqqDq1Bf.js";import"./createBaseUIEventDetails-D5nICp6F.js";const A=S({email:r().trim().email("An email address"),password:r().min(12,"At least 12 characters"),orgName:r().trim().max(120).optional()});function z(){const{claim:d}=x.useSearch(),c=h(),[l,m]=g.useState(""),{register:a,handleSubmit:p,formState:s}=v({resolver:F(A)}),u=p(async t=>{m("");try{await f.setup({token:d??"",orgName:t.orgName||"My studio",projectName:"",email:t.email,password:t.password,address:location.origin}),j("in"),N.clear(),c({to:"/welcome",replace:!0})}catch(n){m(n instanceof w?n.message:"Something went wrong. Try again.")}});return e.jsx(b,{width:400,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:"Set up Snagset"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"This instance has not been claimed yet. The account you make here is the only one, until you add another."})]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("fieldset",{disabled:s.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!s.errors.email,...a("email")}),s.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:s.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!s.errors.password,...a("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. There is no reset email on a fresh install — keep it."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...a("orgName")})]}),e.jsx(y,{type:"submit",size:"lg",loading:s.isSubmitting,children:s.isSubmitting?"Setting up…":"Create my account"})]})]})})}export{z as component};
1
+ import{T as x,p as h,r as g,s as f,z as j,J as N,C as w,j as e,G as b,B as y,D as S,F as r}from"./index-B_3U6pyz.js";import{u as v,a as F}from"./zod-BqdlirRI.js";import{L as i,I as o}from"./label-BPkAzYEe.js";import"./createBaseUIEventDetails-BDbAfTsh.js";const A=S({email:r().trim().email("An email address"),password:r().min(12,"At least 12 characters"),orgName:r().trim().max(120).optional()});function z(){const{claim:d}=x.useSearch(),c=h(),[l,m]=g.useState(""),{register:a,handleSubmit:p,formState:s}=v({resolver:F(A)}),u=p(async t=>{m("");try{await f.setup({token:d??"",orgName:t.orgName||"My studio",projectName:"",email:t.email,password:t.password,address:location.origin}),j("in"),N.clear(),c({to:"/welcome",replace:!0})}catch(n){m(n instanceof w?n.message:"Something went wrong. Try again.")}});return e.jsx(b,{width:400,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:"Set up Snagset"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"This instance has not been claimed yet. The account you make here is the only one, until you add another."})]}),l&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:l}),e.jsxs("fieldset",{disabled:s.isSubmitting,className:"m-0 flex min-w-0 flex-col gap-4 border-0 p-0",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!s.errors.email,...a("email")}),s.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:s.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!s.errors.password,...a("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. There is no reset email on a fresh install — keep it."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...a("orgName")})]}),e.jsx(y,{type:"submit",size:"lg",loading:s.isSubmitting,children:s.isSubmitting?"Setting up…":"Create my account"})]})]})})}export{z as component};
@@ -1 +1 @@
1
- import{U as N,p as y,r as l,A as m,s as S,z as C,C as F,j as e,G as k,B as E,L as c,h as L,D as R,F as u}from"./index-DBw3b5Rd.js";import{u as x}from"./useQuery-rfvcXYjq.js";import{u as z,a as A}from"./zod-D8TwVQUn.js";import{L as p,I as h}from"./label-BqqDq1Bf.js";import{C as I}from"./chevron-right-BOLW380q.js";import"./useBaseQuery-n1C4QVXL.js";import"./createBaseUIEventDetails-D5nICp6F.js";const U=R({email:u().trim().min(1,"Your email"),password:u().min(1,"Your password")});function Q(){const{redirect:f}=N.useSearch(),a=y(),[o,i]=l.useState(""),[s,g]=l.useState(!1),{register:n,handleSubmit:j,formState:r}=z({resolver:A(U)});x({...m.claimed(),enabled:!0}).data===!1&&a({to:"/setup",replace:!0});const t=x(m.setupState()),b=j(async({email:v,password:w})=>{i("");try{await S.login(v,w),C("in"),a({to:f??"/sites",replace:!0})}catch(d){i(d instanceof F?d.message:"Could not reach the server.")}});return e.jsx(k,{children:e.jsxs("form",{onSubmit:b,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:"Sign in"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"The studio side. Reviewers don't sign in — they open a link."})]}),o&&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:o}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(p,{htmlFor:"email",children:"Email"}),e.jsx(h,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!r.errors.email,...n("email")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(p,{htmlFor:"password",children:"Password"}),e.jsx(h,{id:"password",type:"password",autoComplete:"current-password","aria-invalid":!!r.errors.password,...n("password")})]}),e.jsx(E,{type:"submit",size:"lg",loading:r.isSubmitting,children:r.isSubmitting?"Signing in…":"Sign in"}),t.data?.mail?e.jsx("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:e.jsx(c,{to:"/forgot",className:"text-foreground underline underline-offset-4",children:"Forgot your password?"})}):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":s,onClick:()=>g(!s),children:[e.jsx(I,{className:L("size-3.5 text-muted-foreground transition-transform",s&&"rotate-90")}),"Forgot your password?"]}),t.data?.signup&&e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["New here?"," ",t.data.signupUrl?e.jsx("a",{href:t.data.signupUrl,className:"text-foreground underline underline-offset-4",children:"Create a studio"}):e.jsx(c,{to:"/sign-up",className:"text-foreground underline underline-offset-4",children:"Create a studio"})]}),s&&!t.data?.mail&&e.jsxs("div",{className:"flex flex-col gap-2 text-[12.5px] leading-relaxed text-muted-foreground",children:[e.jsx("p",{className:"m-0",children:"This instance has no mail set up, so there's no reset email — and whoever has a shell on the server already holds more authority than a reset link would grant. From that machine:"}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md border border-border bg-card px-3 py-2 font-mono text-[12px] text-foreground",children:e.jsx("code",{children:`printf '%s' "$NEW" | snagset passwd you@example.com`})}),e.jsx("p",{className:"m-0",children:"Every existing session for that account is signed out when it runs."})]})]})})}export{Q as component};
1
+ import{U as N,p as y,r as l,A as m,s as S,z as C,C as F,j as e,G as k,B as E,L as c,h as L,D as R,F as u}from"./index-B_3U6pyz.js";import{u as x}from"./useQuery-HUEWFxW8.js";import{u as z,a as A}from"./zod-BqdlirRI.js";import{L as p,I as h}from"./label-BPkAzYEe.js";import{C as I}from"./chevron-right-BSOkA3zX.js";import"./useBaseQuery-BWQygP2V.js";import"./createBaseUIEventDetails-BDbAfTsh.js";const U=R({email:u().trim().min(1,"Your email"),password:u().min(1,"Your password")});function Q(){const{redirect:f}=N.useSearch(),a=y(),[o,i]=l.useState(""),[s,g]=l.useState(!1),{register:n,handleSubmit:j,formState:r}=z({resolver:A(U)});x({...m.claimed(),enabled:!0}).data===!1&&a({to:"/setup",replace:!0});const t=x(m.setupState()),b=j(async({email:v,password:w})=>{i("");try{await S.login(v,w),C("in"),a({to:f??"/sites",replace:!0})}catch(d){i(d instanceof F?d.message:"Could not reach the server.")}});return e.jsx(k,{children:e.jsxs("form",{onSubmit:b,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:"Sign in"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"The studio side. Reviewers don't sign in — they open a link."})]}),o&&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:o}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(p,{htmlFor:"email",children:"Email"}),e.jsx(h,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!r.errors.email,...n("email")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(p,{htmlFor:"password",children:"Password"}),e.jsx(h,{id:"password",type:"password",autoComplete:"current-password","aria-invalid":!!r.errors.password,...n("password")})]}),e.jsx(E,{type:"submit",size:"lg",loading:r.isSubmitting,children:r.isSubmitting?"Signing in…":"Sign in"}),t.data?.mail?e.jsx("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:e.jsx(c,{to:"/forgot",className:"text-foreground underline underline-offset-4",children:"Forgot your password?"})}):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":s,onClick:()=>g(!s),children:[e.jsx(I,{className:L("size-3.5 text-muted-foreground transition-transform",s&&"rotate-90")}),"Forgot your password?"]}),t.data?.signup&&e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["New here?"," ",t.data.signupUrl?e.jsx("a",{href:t.data.signupUrl,className:"text-foreground underline underline-offset-4",children:"Create a studio"}):e.jsx(c,{to:"/sign-up",className:"text-foreground underline underline-offset-4",children:"Create a studio"})]}),s&&!t.data?.mail&&e.jsxs("div",{className:"flex flex-col gap-2 text-[12.5px] leading-relaxed text-muted-foreground",children:[e.jsx("p",{className:"m-0",children:"This instance has no mail set up, so there's no reset email — and whoever has a shell on the server already holds more authority than a reset link would grant. From that machine:"}),e.jsx("pre",{className:"m-0 overflow-x-auto rounded-md border border-border bg-card px-3 py-2 font-mono text-[12px] text-foreground",children:e.jsx("code",{children:`printf '%s' "$NEW" | snagset passwd you@example.com`})}),e.jsx("p",{className:"m-0",children:"Every existing session for that account is signed out when it runs."})]})]})})}export{Q as component};
@@ -1 +1 @@
1
- import{p,r as u,s as h,z as g,J as f,C as j,j as e,G as N,B as w,L as v,D as y,F as t}from"./index-DBw3b5Rd.js";import{u as b,a as S}from"./zod-D8TwVQUn.js";import{L as i,I as o}from"./label-BqqDq1Bf.js";import"./createBaseUIEventDetails-D5nICp6F.js";const C=y({email:t().trim().email("An email address"),password:t().min(12,"At least 12 characters"),name:t().trim().max(120).optional(),orgName:t().trim().max(120).optional()});function E(){const d=p(),[n,l]=u.useState(""),{register:r,handleSubmit:c,formState:a}=b({resolver:S(C)}),x=c(async s=>{l("");try{await h.register({email:s.email,password:s.password,...s.name?{name:s.name}:{},orgName:s.orgName||"My studio"}),g("in"),f.clear(),d({to:"/welcome",replace:!0})}catch(m){l(m instanceof j?m.message:"Something went wrong. Try again.")}});return e.jsx(N,{width:400,children:e.jsxs("form",{onSubmit:x,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:"Create a studio"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Your account, and the studio your sites live in. Reviewers never sign up — they open a link."})]}),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(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!a.errors.email,...r("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!a.errors.password,...r("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"name",autoComplete:"name",...r("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...r("orgName")})]}),e.jsx(w,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Creating…":"Create my studio"}),e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["Already have an account?"," ",e.jsx(v,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})]})]})})}export{E as component};
1
+ import{p,r as u,s as h,z as g,J as f,C as j,j as e,G as N,B as w,L as v,D as y,F as t}from"./index-B_3U6pyz.js";import{u as b,a as S}from"./zod-BqdlirRI.js";import{L as i,I as o}from"./label-BPkAzYEe.js";import"./createBaseUIEventDetails-BDbAfTsh.js";const C=y({email:t().trim().email("An email address"),password:t().min(12,"At least 12 characters"),name:t().trim().max(120).optional(),orgName:t().trim().max(120).optional()});function E(){const d=p(),[n,l]=u.useState(""),{register:r,handleSubmit:c,formState:a}=b({resolver:S(C)}),x=c(async s=>{l("");try{await h.register({email:s.email,password:s.password,...s.name?{name:s.name}:{},orgName:s.orgName||"My studio"}),g("in"),f.clear(),d({to:"/welcome",replace:!0})}catch(m){l(m instanceof j?m.message:"Something went wrong. Try again.")}});return e.jsx(N,{width:400,children:e.jsxs("form",{onSubmit:x,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:"Create a studio"}),e.jsx("p",{className:"m-0 mt-1.5 text-muted-foreground",children:"Your account, and the studio your sites live in. Reviewers never sign up — they open a link."})]}),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(i,{htmlFor:"email",children:"Your email"}),e.jsx(o,{id:"email",type:"email",autoComplete:"username","aria-invalid":!!a.errors.email,...r("email")}),a.errors.email&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:a.errors.email.message})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(i,{htmlFor:"password",children:"Password"}),e.jsx(o,{id:"password",type:"password",autoComplete:"new-password","aria-invalid":!!a.errors.password,...r("password")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"At least 12 characters. A short phrase of real words is fine."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"name",children:["Your name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"name",autoComplete:"name",...r("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs(i,{htmlFor:"orgName",children:["Studio name ",e.jsx("span",{className:"font-normal text-muted-foreground",children:"optional"})]}),e.jsx(o,{id:"orgName",placeholder:"My studio",...r("orgName")})]}),e.jsx(w,{type:"submit",size:"lg",loading:a.isSubmitting,children:a.isSubmitting?"Creating…":"Create my studio"}),e.jsxs("p",{className:"m-0 text-center text-[13px] text-muted-foreground",children:["Already have an account?"," ",e.jsx(v,{to:"/sign-in",className:"text-foreground underline underline-offset-4",children:"Sign in"})]})]})})}export{E as component};
@@ -1 +1 @@
1
- import{q as w,a1 as y,r as p,j as e,B as m,L as N,p as A,d as k,s as S,C as $,D as C,F as g}from"./index-DBw3b5Rd.js";import{u as _,a as D}from"./zod-D8TwVQUn.js";import{C as E}from"./card-BqU7TCLe.js";import{i as F,j as L,l as P,k as I,m as T,n as z}from"./dialog-C8j9bKc9.js";import{L as f,I as j}from"./label-BqqDq1Bf.js";import{P as q,E as R}from"./parts-Dh3j93KT.js";import{v as B}from"./useScrollLock-BPMFXP7l.js";import{u as H}from"./me-BuXPSKyo.js";import{P as v}from"./plus-DLkZ3d4a.js";import{L as K}from"./layout-grid-BaI-ZaQt.js";import{I as Q}from"./image-off-DEk2KdgQ.js";import"./createBaseUIEventDetails-D5nICp6F.js";import"./inertValue-DPJM1mgv.js";import"./useBaseQuery-n1C4QVXL.js";function ne(){const s=H(),i=w(s.user.role,"settings"),{add:d}=y.useSearch(),[x,n]=p.useState(!!d&&i);p.useEffect(()=>{d&&i&&n(!0)},[d,i]);const a=s.projects.filter(r=>!r.archived),l=s.projects.filter(r=>r.archived),h=a.reduce((r,o)=>r+o.unresolved,0),t=s.limits.projects.limit,c=t!==null&&a.length>=t,u=t!==null&&a.length>t;return e.jsxs("div",{className:"p-7",children:[e.jsx(q,{title:"Sites",sub:a.length?`${a.length}${t!==null?` of ${t}`:""} site${a.length===1&&t===null?"":"s"} · ${h} open`:t!==null?`0 of ${t} sites`:void 0,actions:i?e.jsxs(m,{onClick:()=>n(!0),disabled:c,title:c?`This studio's plan allows ${t} sites.`:void 0,children:[e.jsx(v,{}),"Add a site"]}):void 0}),u&&e.jsxs("div",{role:"status",className:"mb-5 max-w-[1100px] rounded-md border border-border bg-warn-soft px-4 py-3 text-[13px]",children:["This studio has ",a.length," sites and its plan includes ",t,". The newest ",a.length-t," ",a.length-t===1?"is":"are"," ","read-only: comments can be read, nothing new comes in."," ",i?"Archive a site you have finished with, or move to a plan with more.":"An owner or an admin can archive a site or change the plan."]}),a.length===0?e.jsx(E,{className:"max-w-[1100px]",children:e.jsx(R,{icon:e.jsx(K,{className:"size-5"}),title:"No sites yet",action:i?e.jsxs(m,{onClick:()=>n(!0),children:[e.jsx(v,{}),"Add a site"]}):void 0,children:i?"A site is one client website. Add it, paste the tag, and comments start arriving here.":"A site is one client website. An owner or an admin adds it, and its comments appear here."})}):e.jsx("div",{className:"grid max-w-[1100px] grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:a.map(r=>e.jsx(b,{p:r},r.uid))}),l.length>0&&e.jsxs("section",{className:"mt-10 max-w-[1100px]","aria-labelledby":"archived-sites",children:[e.jsx("h2",{id:"archived-sites",className:"m-0 mb-1 text-[14px] font-semibold",children:"Archived"}),e.jsx("p",{className:"m-0 mb-4 text-[12.5px] text-muted-foreground",children:"Finished or put away. Every comment is kept and can be read; nothing new comes in, and they do not count toward the plan."}),e.jsx("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:l.map(r=>e.jsx(b,{p:r},r.uid))})]}),e.jsx(G,{open:x,onOpenChange:n})]})}function b({p:s}){const i=s.archived?"Archived":s.locked?"Read-only":s.status==="paused"?"Paused":null;return e.jsxs(N,{to:"/s/$site/comments",params:{site:s.uid},className:"block overflow-hidden rounded-lg border border-border bg-card text-foreground transition-shadow hover:shadow-[0_1px_2px_rgb(24_23_22/.06),0_8px_24px_rgb(24_23_22/.08)]",children:[e.jsx("div",{className:`flex h-[150px] items-center justify-center border-b border-border bg-background${s.archived?" opacity-70 grayscale":""}`,children:s.previewUrl?e.jsx("img",{src:s.previewUrl,alt:"",className:"size-full object-cover object-top"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-muted",children:e.jsx(Q,{className:"size-4"})}),"No screenshot yet"]})}),e.jsxs("div",{className:"px-3.5 pb-3.5 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.jsx("span",{className:"truncate",children:s.name}),i&&e.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-px text-[10.5px] font-medium uppercase tracking-wide text-muted-foreground",children:i})]}),s.domain&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[12px] text-muted-foreground",children:s.domain}),e.jsx("div",{className:"mt-2 text-[12.5px] text-ink-soft",children:s.threads===0?"Nothing filed yet":`${s.unresolved} open of ${s.threads}${s.lastActivityAt?` · ${B(s.lastActivityAt)}`:""}`})]})]})}const U=C({name:g().trim().min(1,"A name"),domain:g().trim().min(1,"Its domain")});function G({open:s,onOpenChange:i}){const d=A(),x=k(),[n,a]=p.useState(""),{register:l,handleSubmit:h,formState:t,reset:c}=_({resolver:D(U)}),u=h(async r=>{a("");try{const o=await S.createProject(r.name,"",r.domain);await x.invalidateQueries({queryKey:["me"]}),c(),i(!1),d({to:"/s/$site/comments",params:{site:o.uid}})}catch(o){a(o instanceof $?o.message:"Could not add the site.")}});return e.jsx(F,{open:s,onOpenChange:i,children:e.jsx(L,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(P,{children:[e.jsx(I,{children:"Add a site"}),e.jsx(T,{children:"One client website. The tag it needs is shown right after."})]}),n&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"site-name",children:"Name"}),e.jsx(j,{id:"site-name",placeholder:"Kilnwork","aria-invalid":!!t.errors.name,...l("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"site-domain",children:"Domain"}),e.jsx(j,{id:"site-domain",placeholder:"kilnwork.studio","aria-invalid":!!t.errors.domain,...l("domain")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in Settings."})]}),e.jsxs(z,{children:[e.jsx(m,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(m,{type:"submit",loading:t.isSubmitting,children:t.isSubmitting?"Adding…":"Add site"})]})]})})})}export{ne as component};
1
+ import{q as w,a1 as y,r as p,j as e,B as m,L as N,p as A,d as k,s as S,C as $,D as C,F as g}from"./index-B_3U6pyz.js";import{u as _,a as D}from"./zod-BqdlirRI.js";import{C as E}from"./card-DEnJVYTc.js";import{i as F,j as L,l as P,k as I,m as T,n as z}from"./dialog-Dsu0e02Q.js";import{L as f,I as j}from"./label-BPkAzYEe.js";import{P as q,E as R}from"./parts-BZnB0y34.js";import{v as B}from"./useScrollLock-Bxg3WK_6.js";import{u as H}from"./me-Ffh61LTY.js";import{P as v}from"./plus-CopH4JTI.js";import{L as K}from"./layout-grid-CbZa6REW.js";import{I as Q}from"./image-off-_kTeT3Bb.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./inertValue-Dl2ZzbZu.js";import"./useBaseQuery-BWQygP2V.js";function ne(){const s=H(),i=w(s.user.role,"settings"),{add:d}=y.useSearch(),[x,n]=p.useState(!!d&&i);p.useEffect(()=>{d&&i&&n(!0)},[d,i]);const a=s.projects.filter(r=>!r.archived),l=s.projects.filter(r=>r.archived),h=a.reduce((r,o)=>r+o.unresolved,0),t=s.limits.projects.limit,c=t!==null&&a.length>=t,u=t!==null&&a.length>t;return e.jsxs("div",{className:"p-7",children:[e.jsx(q,{title:"Sites",sub:a.length?`${a.length}${t!==null?` of ${t}`:""} site${a.length===1&&t===null?"":"s"} · ${h} open`:t!==null?`0 of ${t} sites`:void 0,actions:i?e.jsxs(m,{onClick:()=>n(!0),disabled:c,title:c?`This studio's plan allows ${t} sites.`:void 0,children:[e.jsx(v,{}),"Add a site"]}):void 0}),u&&e.jsxs("div",{role:"status",className:"mb-5 max-w-[1100px] rounded-md border border-border bg-warn-soft px-4 py-3 text-[13px]",children:["This studio has ",a.length," sites and its plan includes ",t,". The newest ",a.length-t," ",a.length-t===1?"is":"are"," ","read-only: comments can be read, nothing new comes in."," ",i?"Archive a site you have finished with, or move to a plan with more.":"An owner or an admin can archive a site or change the plan."]}),a.length===0?e.jsx(E,{className:"max-w-[1100px]",children:e.jsx(R,{icon:e.jsx(K,{className:"size-5"}),title:"No sites yet",action:i?e.jsxs(m,{onClick:()=>n(!0),children:[e.jsx(v,{}),"Add a site"]}):void 0,children:i?"A site is one client website. Add it, paste the tag, and comments start arriving here.":"A site is one client website. An owner or an admin adds it, and its comments appear here."})}):e.jsx("div",{className:"grid max-w-[1100px] grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:a.map(r=>e.jsx(b,{p:r},r.uid))}),l.length>0&&e.jsxs("section",{className:"mt-10 max-w-[1100px]","aria-labelledby":"archived-sites",children:[e.jsx("h2",{id:"archived-sites",className:"m-0 mb-1 text-[14px] font-semibold",children:"Archived"}),e.jsx("p",{className:"m-0 mb-4 text-[12.5px] text-muted-foreground",children:"Finished or put away. Every comment is kept and can be read; nothing new comes in, and they do not count toward the plan."}),e.jsx("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3",children:l.map(r=>e.jsx(b,{p:r},r.uid))})]}),e.jsx(G,{open:x,onOpenChange:n})]})}function b({p:s}){const i=s.archived?"Archived":s.locked?"Read-only":s.status==="paused"?"Paused":null;return e.jsxs(N,{to:"/s/$site/comments",params:{site:s.uid},className:"block overflow-hidden rounded-lg border border-border bg-card text-foreground transition-shadow hover:shadow-[0_1px_2px_rgb(24_23_22/.06),0_8px_24px_rgb(24_23_22/.08)]",children:[e.jsx("div",{className:`flex h-[150px] items-center justify-center border-b border-border bg-background${s.archived?" opacity-70 grayscale":""}`,children:s.previewUrl?e.jsx("img",{src:s.previewUrl,alt:"",className:"size-full object-cover object-top"}):e.jsxs("div",{className:"flex flex-col items-center gap-1 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-muted",children:e.jsx(Q,{className:"size-4"})}),"No screenshot yet"]})}),e.jsxs("div",{className:"px-3.5 pb-3.5 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.jsx("span",{className:"truncate",children:s.name}),i&&e.jsx("span",{className:"rounded-sm bg-muted px-1.5 py-px text-[10.5px] font-medium uppercase tracking-wide text-muted-foreground",children:i})]}),s.domain&&e.jsx("div",{className:"mt-0.5 truncate font-mono text-[12px] text-muted-foreground",children:s.domain}),e.jsx("div",{className:"mt-2 text-[12.5px] text-ink-soft",children:s.threads===0?"Nothing filed yet":`${s.unresolved} open of ${s.threads}${s.lastActivityAt?` · ${B(s.lastActivityAt)}`:""}`})]})]})}const U=C({name:g().trim().min(1,"A name"),domain:g().trim().min(1,"Its domain")});function G({open:s,onOpenChange:i}){const d=A(),x=k(),[n,a]=p.useState(""),{register:l,handleSubmit:h,formState:t,reset:c}=_({resolver:D(U)}),u=h(async r=>{a("");try{const o=await S.createProject(r.name,"",r.domain);await x.invalidateQueries({queryKey:["me"]}),c(),i(!1),d({to:"/s/$site/comments",params:{site:o.uid}})}catch(o){a(o instanceof $?o.message:"Could not add the site.")}});return e.jsx(F,{open:s,onOpenChange:i,children:e.jsx(L,{children:e.jsxs("form",{onSubmit:u,className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(P,{children:[e.jsx(I,{children:"Add a site"}),e.jsx(T,{children:"One client website. The tag it needs is shown right after."})]}),n&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:n}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"site-name",children:"Name"}),e.jsx(j,{id:"site-name",placeholder:"Kilnwork","aria-invalid":!!t.errors.name,...l("name")})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{htmlFor:"site-domain",children:"Domain"}),e.jsx(j,{id:"site-domain",placeholder:"kilnwork.studio","aria-invalid":!!t.errors.domain,...l("domain")}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:"Every subdomain, scheme and port of it may run the widget — staging, previews, and localhost while you build. Exact addresses elsewhere can be added in Settings."})]}),e.jsxs(z,{children:[e.jsx(m,{type:"button",variant:"outline",onClick:()=>i(!1),children:"Cancel"}),e.jsx(m,{type:"submit",loading:t.isSubmitting,children:t.isSubmitting?"Adding…":"Add site"})]})]})})})}export{ne as component};
@@ -0,0 +1 @@
1
+ import{j as t,O as o}from"./index-B_3U6pyz.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +1 @@
1
- import{d as o,A as s,a5 as u,s as i,a6 as y,a2 as c}from"./index-DBw3b5Rd.js";function Q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameOrg(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,org:{...r.org,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameMe(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,user:{...r.user,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:s.members().queryKey})}})}function f(){return u({mutationFn:e=>i.changePassword(e.current,e.next)})}function l(){const e=o();return u({mutationFn:t=>i.createInvite(t),onSuccess:()=>void e.invalidateQueries({queryKey:s.invites().queryKey})})}function w(){const e=o(),t=s.invites().queryKey;return u({mutationFn:a=>i.revokeInvite(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,data:r.data.filter(n=>n.id!==a)}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function v(){return u({mutationFn:e=>i.sendInvite(e.id,e.token)})}function K(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.setMemberRole(a.email,a.role),onMutate:async({email:a,role:r})=>{await e.cancelQueries({queryKey:t});const n=e.getQueryData(t);return n&&e.setQueryData(t,{data:n.data.map(m=>m.email===a?{...m,role:r}:m)}),{was:n}},onSuccess:(a,{email:r})=>{e.setQueryData(t,a),a.data.find(n=>n.email===r)?.you&&e.invalidateQueries({queryKey:s.me().queryKey})},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}function D(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.removeMember(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{data:r.data.filter(n=>n.email!==a)}),{was:r}},onSuccess:a=>e.setQueryData(t,a),onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}export{f as a,Q as b,K as c,D as d,w as e,l as f,v as g,q as u};
1
+ import{d as o,A as s,a5 as u,s as i,a6 as y,a2 as c}from"./index-B_3U6pyz.js";function Q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameOrg(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,org:{...r.org,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function q(){const e=o(),t=s.me().queryKey;return u({mutationFn:a=>i.renameMe(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,user:{...r.user,name:a}}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>{e.invalidateQueries({queryKey:t}),e.invalidateQueries({queryKey:s.members().queryKey})}})}function f(){return u({mutationFn:e=>i.changePassword(e.current,e.next)})}function l(){const e=o();return u({mutationFn:t=>i.createInvite(t),onSuccess:()=>void e.invalidateQueries({queryKey:s.invites().queryKey})})}function w(){const e=o(),t=s.invites().queryKey;return u({mutationFn:a=>i.revokeInvite(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{...r,data:r.data.filter(n=>n.id!==a)}),{was:r}},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))},onSettled:()=>e.invalidateQueries({queryKey:t})})}function v(){return u({mutationFn:e=>i.sendInvite(e.id,e.token)})}function K(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.setMemberRole(a.email,a.role),onMutate:async({email:a,role:r})=>{await e.cancelQueries({queryKey:t});const n=e.getQueryData(t);return n&&e.setQueryData(t,{data:n.data.map(m=>m.email===a?{...m,role:r}:m)}),{was:n}},onSuccess:(a,{email:r})=>{e.setQueryData(t,a),a.data.find(n=>n.email===r)?.you&&e.invalidateQueries({queryKey:s.me().queryKey})},onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}function D(){const e=o(),t=s.members().queryKey;return u({mutationFn:a=>i.removeMember(a),onMutate:async a=>{await e.cancelQueries({queryKey:t});const r=e.getQueryData(t);return r&&e.setQueryData(t,{data:r.data.filter(n=>n.email!==a)}),{was:r}},onSuccess:a=>e.setQueryData(t,a),onError:(a,r,n)=>{n?.was&&e.setQueryData(t,n.was),y.error(c(a))}})}export{f as a,Q as b,K as c,D as d,w as e,l as f,v as g,q as u};
@@ -1 +1 @@
1
- import{q as y,j as e,t as C,a4 as k,r as c,B as x,S as A,d as E,a5 as F,a2 as O,A as h,a6 as R,s as D,a7 as I}from"./index-DBw3b5Rd.js";import{u as p}from"./useQuery-rfvcXYjq.js";import{L as P,I as N}from"./label-BqqDq1Bf.js";import{I as U,S as L}from"./InstanceRows-D-tveODw.js";import{A as T,P as q,a as f}from"./parts-Dh3j93KT.js";import{u as S}from"./me-BuXPSKyo.js";import{S as z}from"./SaveState-e4RnpJbD.js";import{C as B}from"./ConfirmDialog-B9o4voIS.js";import{b as _}from"./studio-BXY-BYUr.js";import{c as M}from"./update-duXzIzFS.js";import"./useBaseQuery-n1C4QVXL.js";import"./createBaseUIEventDetails-D5nICp6F.js";import"./dialog-C8j9bKc9.js";import"./useScrollLock-BPMFXP7l.js";import"./inertValue-DPJM1mgv.js";import"./card-BqU7TCLe.js";import"./check-T8owKS6W.js";import"./copy-D7ySfk8w.js";function Q(){const t=S(),s=p(h.meta()),o=p(h.members()),a=_(),r=y(t.user.role,"studio"),u=C(t),m=k(t),i=p(h.setupState()),l=!i.data?.billingUrl,d=t.user.role==="owner"?i.data?.closeUrl??null:null,[n,j]=c.useState(t.org.name),[b,w]=c.useState(null);c.useEffect(()=>j(t.org.name),[t.org.name]);const v=r&&n.trim().length>0&&n.trim()!==t.org.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(q,{title:"Studio settings",sub:t.org.name,actions:e.jsx(z,{saving:a.isPending,savedAt:b})}),e.jsx(f,{title:"Studio",description:"The name at the top of every screen.",children:e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:g=>{g.preventDefault(),v&&a.mutate(n.trim(),{onSuccess:()=>w(Date.now())})},children:[e.jsx(P,{htmlFor:"studio-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{id:"studio-name",value:n,readOnly:!r,onChange:g=>j(g.target.value)}),v&&e.jsx(x,{type:"submit",variant:"outline",children:"Save"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:r?"Shown at the top of the sidebar, above every site.":"Only an owner can change it."})]})}),u?e.jsx(f,{title:"This instance",description:"What is running, and where.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Version"}),e.jsxs("dd",{className:"m-0",children:[s.data?.version??"—"," ",e.jsx(G,{version:s.data?.version??""})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsx("dd",{className:"m-0",children:e.jsx(H,{owner:r})}),s.data?.commit&&s.data.commit!=="unknown"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Commit"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:[s.data.commit.slice(0,12),s.data.modified?" · modified":""]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites · members"}),e.jsxs("dd",{className:"m-0",children:[t.projects.length," · ",o.data?.data.length??"—"]})]})]})}):l?e.jsx(f,{title:"This studio",description:"What is in it.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites"}),e.jsx("dd",{className:"m-0",children:t.projects.length}),e.jsx("dt",{className:"text-muted-foreground",children:"Members"}),e.jsx("dd",{className:"m-0",children:o.data?.data.length??"—"})]})}):null,m==="instance"?e.jsx(U,{owner:r}):m==="usage"?e.jsx(L,{}):null,d&&e.jsx(W,{url:d,name:t.org.name})]})}function W({url:t,name:s}){const[o,a]=c.useState(!1),[r,u]=c.useState(!1),m=()=>{u(!0);const i=document.createElement("form");i.method="post",i.action=t;for(const[l,d]of[["csrf",I()],["confirm",s]]){const n=document.createElement("input");n.type="hidden",n.name=l,n.value=d,i.append(n)}document.body.append(i),i.submit()};return e.jsxs(f,{danger:!0,title:"Close this studio",description:"Its sites stop, and after a grace period it is erased with everything in it.",children:[e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-4",children:e.jsxs(x,{variant:"outline",className:"border-destructive text-destructive",onClick:()=>a(!0),children:["Close ",s,"…"]})}),e.jsx(B,{open:o,onOpenChange:a,title:`Close ${s}`,description:"Closing stops the studio now and erases it thirty days later.",confirmLabel:"Close this studio",confirmWord:s,busy:r,onConfirm:m,children:e.jsxs("ul",{className:"m-0 flex list-disc flex-col gap-1.5 pl-5 text-[13px] text-ink-soft",children:[e.jsx("li",{children:"Every site stops at once: the widget leaves your clients' pages, nobody can comment, and the dashboard closes for everyone in the studio."}),e.jsx("li",{children:"If the studio pays for a plan, it is cancelled now, with no refund for the rest of the period."}),e.jsx("li",{children:"For thirty days you can reopen it, with every site as it was."}),e.jsx("li",{children:"After that it is erased for good: its sites, threads, comments and screenshots. People who belong to no other studio lose their account with it."})]})})]})}function G({version:t}){const[s,o]=c.useState({s:"idle"});return s.s==="idle"?e.jsxs(e.Fragment,{children:["·"," ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>{o({s:"checking"}),M(t).then(a=>o({s:"done",r:a})).catch(()=>o({s:"failed"}))},children:"Check for updates"})," ",e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"— from your browser, never from the server"})]}):s.s==="checking"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:["· ",e.jsx(A,{className:"size-3"})," checking…"]}):s.s==="failed"?e.jsx("span",{className:"text-muted-foreground",children:"· could not reach npm"}):e.jsx("span",{className:"text-muted-foreground",children:s.r?.newer?`· ${s.r.latest} is out`:"· up to date"})}function H({owner:t}){const s=E(),o=p(h.instance()),[a,r]=c.useState(null),[u,m]=c.useState(""),i=F({mutationFn:n=>D.setAddress(n),onSuccess:n=>{s.setQueryData(h.instance().queryKey,n),r(null),m(""),R.success("Address saved — every new link is built from it")},onError:n=>m(O(n))}),l=o.data?.address;if(!l)return e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:location.origin});const d=l.source==="env";return a===null||!t||d?e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:l.url}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:d?"· set by the environment (SNAGSET_BASE_URL)":l.source==="stored"?"· set at claim; every link is built from it":"· this machine's default"}),t&&!d&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>r(l.url),children:"Change…"})]}):e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:n=>{n.preventDefault(),i.mutate(a.trim())},children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(N,{"aria-label":"Address",value:a,onChange:n=>r(n.target.value),className:"h-8 max-w-[360px] font-mono text-[12px]",autoFocus:!0}),e.jsx(x,{type:"submit",size:"sm",loading:i.isPending,disabled:!a.trim(),children:i.isPending?"Saving…":"Save"}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(null),children:"Cancel"})]}),u&&e.jsx("span",{className:"text-[12px] text-destructive",children:u}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"https:// unless it is this machine; the origin only. Review links, issues and emails are built from it."})]})}const me=()=>y(S().user.role,"settings")?e.jsx(Q,{}):e.jsx(T,{title:"Studio settings"});export{me as component};
1
+ import{q as y,j as e,t as C,a4 as k,r as c,B as x,S as A,d as E,a5 as F,a2 as O,A as h,a6 as R,s as D,a7 as I}from"./index-B_3U6pyz.js";import{u as p}from"./useQuery-HUEWFxW8.js";import{L as P,I as N}from"./label-BPkAzYEe.js";import{I as U,S as L}from"./InstanceRows-Cu43MthB.js";import{A as T,P as q,a as f}from"./parts-BZnB0y34.js";import{u as S}from"./me-Ffh61LTY.js";import{S as z}from"./SaveState-B4LwnOrc.js";import{C as B}from"./ConfirmDialog-_B1eNA1i.js";import{b as _}from"./studio-C-cl-Bid.js";import{c as M}from"./update-duXzIzFS.js";import"./useBaseQuery-BWQygP2V.js";import"./createBaseUIEventDetails-BDbAfTsh.js";import"./dialog-Dsu0e02Q.js";import"./useScrollLock-Bxg3WK_6.js";import"./inertValue-Dl2ZzbZu.js";import"./card-DEnJVYTc.js";import"./check-BhmdAbBD.js";import"./copy-DefIRiwo.js";function Q(){const t=S(),s=p(h.meta()),o=p(h.members()),a=_(),r=y(t.user.role,"studio"),u=C(t),m=k(t),i=p(h.setupState()),l=!i.data?.billingUrl,d=t.user.role==="owner"?i.data?.closeUrl??null:null,[n,j]=c.useState(t.org.name),[b,w]=c.useState(null);c.useEffect(()=>j(t.org.name),[t.org.name]);const v=r&&n.trim().length>0&&n.trim()!==t.org.name;return e.jsxs("div",{className:"flex flex-col gap-10 p-7",children:[e.jsx(q,{title:"Studio settings",sub:t.org.name,actions:e.jsx(z,{saving:a.isPending,savedAt:b})}),e.jsx(f,{title:"Studio",description:"The name at the top of every screen.",children:e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:g=>{g.preventDefault(),v&&a.mutate(n.trim(),{onSuccess:()=>w(Date.now())})},children:[e.jsx(P,{htmlFor:"studio-name",children:"Name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{id:"studio-name",value:n,readOnly:!r,onChange:g=>j(g.target.value)}),v&&e.jsx(x,{type:"submit",variant:"outline",children:"Save"})]}),e.jsx("p",{className:"m-0 text-[12px] text-muted-foreground",children:r?"Shown at the top of the sidebar, above every site.":"Only an owner can change it."})]})}),u?e.jsx(f,{title:"This instance",description:"What is running, and where.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Version"}),e.jsxs("dd",{className:"m-0",children:[s.data?.version??"—"," ",e.jsx(G,{version:s.data?.version??""})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Address"}),e.jsx("dd",{className:"m-0",children:e.jsx(H,{owner:r})}),s.data?.commit&&s.data.commit!=="unknown"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Commit"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:[s.data.commit.slice(0,12),s.data.modified?" · modified":""]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites · members"}),e.jsxs("dd",{className:"m-0",children:[t.projects.length," · ",o.data?.data.length??"—"]})]})]})}):l?e.jsx(f,{title:"This studio",description:"What is in it.",children:e.jsxs("dl",{className:"m-0 grid grid-cols-[130px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Sites"}),e.jsx("dd",{className:"m-0",children:t.projects.length}),e.jsx("dt",{className:"text-muted-foreground",children:"Members"}),e.jsx("dd",{className:"m-0",children:o.data?.data.length??"—"})]})}):null,m==="instance"?e.jsx(U,{owner:r}):m==="usage"?e.jsx(L,{}):null,d&&e.jsx(W,{url:d,name:t.org.name})]})}function W({url:t,name:s}){const[o,a]=c.useState(!1),[r,u]=c.useState(!1),m=()=>{u(!0);const i=document.createElement("form");i.method="post",i.action=t;for(const[l,d]of[["csrf",I()],["confirm",s]]){const n=document.createElement("input");n.type="hidden",n.name=l,n.value=d,i.append(n)}document.body.append(i),i.submit()};return e.jsxs(f,{danger:!0,title:"Close this studio",description:"Its sites stop, and after a grace period it is erased with everything in it.",children:[e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-4",children:e.jsxs(x,{variant:"outline",className:"border-destructive text-destructive",onClick:()=>a(!0),children:["Close ",s,"…"]})}),e.jsx(B,{open:o,onOpenChange:a,title:`Close ${s}`,description:"Closing stops the studio now and erases it thirty days later.",confirmLabel:"Close this studio",confirmWord:s,busy:r,onConfirm:m,children:e.jsxs("ul",{className:"m-0 flex list-disc flex-col gap-1.5 pl-5 text-[13px] text-ink-soft",children:[e.jsx("li",{children:"Every site stops at once: the widget leaves your clients' pages, nobody can comment, and the dashboard closes for everyone in the studio."}),e.jsx("li",{children:"If the studio pays for a plan, it is cancelled now, with no refund for the rest of the period."}),e.jsx("li",{children:"For thirty days you can reopen it, with every site as it was."}),e.jsx("li",{children:"After that it is erased for good: its sites, threads, comments and screenshots. People who belong to no other studio lose their account with it."})]})})]})}function G({version:t}){const[s,o]=c.useState({s:"idle"});return s.s==="idle"?e.jsxs(e.Fragment,{children:["·"," ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>{o({s:"checking"}),M(t).then(a=>o({s:"done",r:a})).catch(()=>o({s:"failed"}))},children:"Check for updates"})," ",e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"— from your browser, never from the server"})]}):s.s==="checking"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:["· ",e.jsx(A,{className:"size-3"})," checking…"]}):s.s==="failed"?e.jsx("span",{className:"text-muted-foreground",children:"· could not reach npm"}):e.jsx("span",{className:"text-muted-foreground",children:s.r?.newer?`· ${s.r.latest} is out`:"· up to date"})}function H({owner:t}){const s=E(),o=p(h.instance()),[a,r]=c.useState(null),[u,m]=c.useState(""),i=F({mutationFn:n=>D.setAddress(n),onSuccess:n=>{s.setQueryData(h.instance().queryKey,n),r(null),m(""),R.success("Address saved — every new link is built from it")},onError:n=>m(O(n))}),l=o.data?.address;if(!l)return e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:location.origin});const d=l.source==="env";return a===null||!t||d?e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono text-[12px] text-ink-soft",children:l.url}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:d?"· set by the environment (SNAGSET_BASE_URL)":l.source==="stored"?"· set at claim; every link is built from it":"· this machine's default"}),t&&!d&&e.jsx(x,{variant:"ghost",size:"sm",onClick:()=>r(l.url),children:"Change…"})]}):e.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:n=>{n.preventDefault(),i.mutate(a.trim())},children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(N,{"aria-label":"Address",value:a,onChange:n=>r(n.target.value),className:"h-8 max-w-[360px] font-mono text-[12px]",autoFocus:!0}),e.jsx(x,{type:"submit",size:"sm",loading:i.isPending,disabled:!a.trim(),children:i.isPending?"Saving…":"Save"}),e.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(null),children:"Cancel"})]}),u&&e.jsx("span",{className:"text-[12px] text-destructive",children:u}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"https:// unless it is this machine; the origin only. Review links, issues and emails are built from it."})]})}const me=()=>y(S().user.role,"settings")?e.jsx(Q,{}):e.jsx(T,{title:"Studio settings"});export{me as component};