PageSourceSearch

https://hideaway.chat/assets/share-packages-service-V0vhUTYJ.js

js hideaway.chat collected 2026-10-09 17:55:22 UTC 2,061 bytes, 1 lines download raw bytes

1import{r as t}from"./runtime-CXNh-kxh.js";import{t as i}from"./public-links-CbjS7WkX.js";import{a as p}from"./Button-CrUKVqFn.js";import"./vendor-react-B5Pseaix.js";import"./HideawayBrand-B6JCvqDo.js";function d(a){return`/shared/packages/${encodeURIComponent(a)}`}function h(a){return i(d(a),"file")}function c(){const a=p(),r={"Content-Type":"application/json"};return a?.accessToken&&(r.Authorization=`Bearer ${a.accessToken}`),a?.userId&&(r["X-Hideaway-User-Id"]=a.userId),r}async function n(a,r){const e=await a.json().catch(()=>({}));if(!a.ok){const o=new Error(e.error||e.code||r);throw o.code=e.code,o.status=a.status,o}return e}async function w(a,r,e){const o=await fetch(t(`/api/links/share-packages/${encodeURIComponent(a)}`),{headers:{...c(),"Cache-Control":"no-store",...r?{"X-Hideaway-Share-Password":r}:{},...e?.suppressOwnerViewActivity?{"X-Hideaway-Suppress-View":"1"}:{}}}),s=await n(o,"Failed to load share package");if(!s.package)throw new Error("Share package not found");return s.package}async function y(a){const r=await fetch(t("/api/links/share-packages"),{method:"POST",headers:c(),body:JSON.stringify({package:a})}),e=await n(r,"Failed to save share package");if(!e.package)throw new Error("Share package save returned no package");return{package:e.package,shareUrl:e.shareUrl||h(e.package.id)}}async function S(a){const r=await fetch(t(`/api/links/share-packages/${encodeURIComponent(a)}/revoke`),{method:"POST",headers:c()}),e=await n(r,"Failed to revoke share package");if(!e.package)throw new Error("Share package revoke returned no package");return e.package}async function m(a){const r=await fetch(t(`/api/links/share-packages/${encodeURIComponent(a.packageId)}/activity`),{method:"POST",headers:c(),body:JSON.stringify(a)}),e=await n(r,"Failed to record share activity");if(!e.package)throw new Error("Share package activity returned no package");return e.package}export{d as buildSharePackagePath,h as buildSharePackageUrl,w as fetchSharePackage,m as recordSharePackageActivity,S as revokeSharePackage,y as saveSharePackage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.