var d={exports:{}},s={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var l;function x(){if(l)return s;l=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(a,t,o){var u=null;if(o!==void 0&&(u=""+o),t.key!==void 0&&(u=""+t.key),"key"in t){o={};for(var c in t)c!=="key"&&(o[c]=t[c])}else o=t;return t=o.ref,{$$typeof:r,type:a,key:u,ref:t!==void 0?t:null,props:o}}return s.Fragment=e,s.jsx=n,s.jsxs=n,s}var E;function h(){return E||(E=1,d.exports=x()),d.exports}var m=h();const f="crew_token",v="crew_usuario";function p(){return localStorage.getItem(f)}function T(){const r=localStorage.getItem(v);if(!r)return null;try{return JSON.parse(r)}catch{return null}}function R(){localStorage.removeItem(f),localStorage.removeItem(v)}const S="/api";async function i(r,e={}){const n=p(),a={"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{},...e.headers||{}},t=await fetch(`${S}${r}`,{...e,headers:a,credentials:"include"});if(t.status===401)throw R(),window.location.href="/login",new Error("Sesión expirada");if(!t.ok){const o=await t.json().catch(()=>({error:"Error desconocido"}));throw new Error(o.error||`Error ${t.status}`)}if(t.status!==204)return t.json()}const _={get:r=>i(r),post:(r,e)=>i(r,{method:"POST",body:e?JSON.stringify(e):void 0}),put:(r,e)=>i(r,{method:"PUT",body:e?JSON.stringify(e):void 0}),patch:(r,e)=>i(r,{method:"PATCH",body:e?JSON.stringify(e):void 0}),delete:r=>i(r,{method:"DELETE"})};export{_ as a,p as b,R as c,m as j,T as o};
