1import{ep as y,eq as p,cH as m,eR as d,c$ as v,bt as t,ew as q}from"./BQpWByWK.js";import{u as l}from"./BDYPYTBS.js";import{r as c}from"./KI3naYzN.js";import{b as h}from"./DXbo10_u.js";import{u as i}from"./CUadyxDe.js";import{u as R}from"./4ocfwtbW.js";const n=()=>q().public.apiBase||void 0;function L(a){const e=typeof a=="string"?v(a):a,{region:r}=i(),{data:u,pending:f,error:g}=R(`product-detail-${e.value}`,async()=>{if(!e.value)return null;let o=null;try{o=await $fetch(`/api/app/shopping/product/${e.value}`,{baseURL:n(),credentials:"include",headers:t()})}catch{return null}return c(o?.nowUtc),o},{watch:[e],default:()=>null}),s=async()=>{if(!e.value)return!1;try{return u.value=await $fetch(`/api/app/shopping/product/${e.value}`,{baseURL:n(),credentials:"include",headers:t(),query:{region:r.value}}),c(u.value?.nowUtc),!0}catch{return!1}};return m(s),d(e,s),d(r,s),{data:u,isLoading:f,error:g,refresh:s}}function S(){const{region:a}=i();return y({queryKey:["shopping-cart",h,a],queryFn:async()=>{const e=await $fetch("/api/app/shopping/cart",{baseURL:n(),credentials:"include",headers:t(),query:{region:a.value}});return c(e?.nowUtc),e},placeholderData:e=>e,retry:!1})}function F(){return y({queryKey:["shopping-cart-count"],queryFn:async()=>await $fetch("/api/app/shopping/cart/count",{baseURL:n(),credentials:"include",headers:t()}),staleTime:1e4})}function P(){const a=p(),{region:e}=i();return l({mutationFn:async r=>await $fetch("/api/app/shopping/cart/add",{method:"POST",baseURL:n(),credentials:"include",headers:t(),query:{region:e.value},body:r}),onSuccess:r=>{r&&a.setQueryData(["shopping-cart",h,e.value],r),a.invalidateQueries({queryKey:["shopping-cart"]}),a.invalidateQueries({queryKey:["shopping-cart-count"]})}})}function T(){const a=p(),{region:e}=i();return l({mutationFn:async r=>await $fetch("/api/app/shopping/cart/remove",{method:"POST",baseURL:n(),credentials:"include",headers:t(),query:{region:e.value},body:r}),onSuccess:()=>{a.invalidateQueries({queryKey:["shopping-cart"]}),a.invalidateQueries({queryKey:["shopping-cart-count"]})}})}function D(){const a=p(),{region:e}=i();return l({mutationFn:async()=>await $fetch("/api/app/shopping/cart/clear",{method:"POST",baseURL:n(),credentials:"include",headers:t(),query:{region:e.value}}),onSuccess:()=>{a.invalidateQueries({queryKey:["shopping-cart"]}),a.invalidateQueries({queryKey:["shopping-cart-count"]})}})}export{S as a,F as b,D as c,L as d,T as e,P as u};
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.