import{c as n}from"./auth-C4kx9BHk.js";async function o(s,t){var a;const e=await n("/api/v1/items",{method:"POST",body:JSON.stringify({url:s,title:t})});if(e.status===409){const i=await e.json();return{status:"duplicate",existingId:i.detail.existing_id,title:((a=i.detail)==null?void 0:a.title)||null}}if(!e.ok)throw new Error(`Save failed: ${e.status}`);return{status:"saved",item:await e.json()}}async function c(s){const t=await n(`/api/v1/items/check-url?url=${encodeURIComponent(s)}`);if(!t.ok)throw new Error(`Check failed: ${t.status}`);return t.json()}export{c,o as s};
