import{At as a}from"./vendor-all-0-fRSUBfCr.js";import{Vm as n,Xf as e,Zf as i,bi as s,mg as r,zm as t}from"./shared-0-C4kdVF7Y.js";import{$l as o}from"./shared-1-3-6x7RKF.js";function c(a){return a.enabled&&null!==a.expires_at&&new Date(a.expires_at)<new Date}var l=(a,e={})=>n(`/api/organizations/${a}/invite_link`,{queryKey:[i,a],enabled:!!a&&(e.enabled??!0)}),u=(n,e={})=>{const s=a();return t(`/api/organizations/${n}/invite_link`,"POST",{...e,async onSuccess(a,...t){r("success","link"),s.setQueryData([i,n],a),await(e.onSuccess?.(a,...t))},onError(a,...n){r("failure","link",a),e.onError?.(a,...n)}})},_=(n,e={})=>{const s=a();return t(`/api/organizations/${n}/invite_link`,"PUT",{...e,async onSuccess(a,...r){s.setQueryData([i,n],a),await(e.onSuccess?.(a,...r))}})},p=a=>n(`/api/organizations/invite_link_preview/${a}`,{queryKey:[e,a],enabled:!!a}),k=(a={})=>{const{track:n}=s();return t("/api/organizations/join_via_link","POST",{...a,onMutate:e=>(o(n,"join_via_link",e.arkose_session_token),a.onMutate?.(e))})};export{k as a,l as i,u as n,_ as o,p as r,c as t};