1import{_ as D}from"./app-BuBvwvnO.js";const H="application/json",R="Content-Type",y=Symbol(),P=Symbol();function C(t={}){var e;const o=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(o).find(([i])=>i.toLowerCase()===R.toLowerCase()))===null||e===void 0?void 0:e[1]}function w(t){return/^application\/.*json.*/.test(t)}const p=function(t,e,o=!1){return Object.entries(e).reduce((i,[n,a])=>{const u=t[n];return Array.isArray(u)&&Array.isArray(a)?i[n]=o?[...u,...a]:a:typeof u=="object"&&typeof a=="object"?i[n]=p(u,a,o):i[n]=a,i},{...t})},m={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,o=!1,...i){const n=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!n)throw new Error(t+" is not defined");return o&&n?new n(...i):n}};function L(t,e=!1){m.options=e?t:p(m.options,t)}function F(t,e=!1){m.polyfills=e?t:p(m.polyfills,t)}function N(t){m.errorType=t}const k=t=>e=>t.reduceRight((o,i)=>i(o),e)||e;class S extends Error{}const J=t=>{const e=Object.create(null);t=t._addons.reduce((r,s)=>s.beforeRequest&&s.beforeRequest(r,t._options,e)||r,t);const{_url:o,_options:i,_config:n,_catchers:a,_resolvers:u,_middlewares:E,_addons:T}=t,d=new Map(a),x=p(n.options,i);let j=o;const v=k(E)((r,s)=>(j=r,n.polyfill("fetch")(r,s)))(o,x),b=new Error,O=v.catch(r=>{throw{[y]:r}}).then(r=>{var s;if(!r.ok){const c=new S;if(c.cause=b,c.stack=c.stack+` 2CAUSE: `+b.stack,c.response=r,c.status=r.status,c.url=j,r.type==="opaque")throw c;const l=n.errorType==="json"||((s=r.headers.get("Content-Type"))===null||s===void 0?void 0:s.split(";")[0])==="application/json";return(n.errorType?l?r.text():r[n.errorType]():Promise.resolve(r.body)).then(f=>{if(c.message=typeof f=="string"?f:r.statusText,f)if(l&&typeof f=="string"){c.text=f;try{c.json=JSON.parse(f)}catch{}}else c[n.errorType]=f;throw c})}return r}),A=r=>r.catch(s=>{const c=Object.prototype.hasOwnProperty.call(s,y),l=c?s[y]:s,g=l?.status&&d.get(l.status)||d.get(l?.name)||c&&d.has(y)&&d.get(y);if(g)return g(l,t);const f=d.get(P);if(f)return f(l,t);throw l}),_=r=>s=>A(r?O.then(c=>c&&c[r]()).then(c=>s?s(c):c):O.then(c=>s?s(c):c)),q={_wretchReq:t,_fetchReq:v,_sharedState:e,res:_(null),json:_("json"),blob:_("blob"),formData:_("formData"),arrayBuffer:_("arrayBuffer"),text:_("text"),error(r,s){return d.set(r,s),this},badRequest(r){return this.error(400,r)},unauthorized(r){return this.error(401,r)},forbidden(r){return this.error(403,r)},notFound(r){return this.error(404,r)},timeout(r){return this.error(408,r)},internalError(r){return this.error(500,r)},fetchError(r){return this.error(y,r)}},M=T.reduce((r,s)=>({...r,...typeof s.resolver=="function"?s.resolver(r):s.resolver}),q);return u.reduce((r,s)=>s(r,t),M)},W={_url:"",_options:{},_config:m,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:p(this._config.polyfills,t)}}},url(t,e=!1){if(e)return{...this,_url:t};const o=this._url.split("?");return{...this,_url:o.length>1?o[0]+t+"?"+o[1]:this._url+t}},options(t,e=!1){return{...this,_options:e?t:p(this._options,t)}},headers(t){const e=t?Array.isArray(t)?Object.fromEntries(t):"entries"in t?Object.fromEntries(t.entries()):t:{};return{...this,_options:p(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[R]:t})},auth(t){return this.headers({Authorization:t})},catcher(t,e){const o=new Map(this._catchers);return o.set(t,e),{...this,_catchers:o}},catcherFallback(t){return this.catcher(P,t)},resolve(t,e=!1){return{...this,_resolvers:e?[t]:[...this._resolvers,t]}},defer(t,e=!1){return{...this,_deferred:e?[t]:[...this._deferred,t]}},middlewares(t,e=!1){return{...this,_middlewares:e?t:[...this._middlewares,...t]}},fetch(t=this._options.method,e="",o=null){let i=this.url(e).options({method:t});const n=C(i._options.headers),a=this._config.polyfill("FormData",!1),u=typeof o=="object"&&!(a&&o instanceof a)&&(!i._options.headers||!n||w(n));return i=o?u?i.json(o,n):i.body(o):i,J(i._deferred.reduce((E,T)=>T(E,E._url,E._options),i))},get(t=""){return this.fetch("GET",t)},delete(t=""){return this.fetch("DELETE",t)},put(t,e=""){return this.fetch("PUT",e,t)},post(t,e=""){return this.fetch("POST",e,t)},patch(t,e=""){return this.fetch("PATCH",e,t)},head(t=""){return this.fetch("HEAD",t)},opts(t=""){return this.fetch("OPTIONS",t)},body(t){return{...this,_options:{...this._options,body:t}}},json(t,e){const o=C(this._options.headers);return this.content(e||w(o)&&o||H).body(JSON.stringify(t))}};function h(t="",e={}){return{...W,_url:t,_options:e}}h.default=h;h.options=L;h.errorType=N;h.polyfills=F;h.WretchError=S;const z=function(t){return function(e,o){return t(e,o).then(async function(i){let[n,a]=await Promise.all([i.clone().json(),D(()=>import("./sweetalert2.esm.all-B_30QS3d.js"),[])]);return a=a.default,typeof n?.notification=="object"&&n?.notification!==null&&a.fire({text:n.notification.message,icon:n.notification.type}),i})}};h.options({headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content"),"X-Requested-With":"XMLHttpRequest"}});function U(...t){return h(...t).middlewares([z])}export{U as default};
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.