import{l as a,m as i,n}from"./index-Cc987VYg.js";const l={getCountries:async t=>{const{data:e}=await a.get(i.COUNTRIES,{params:t});return e},getCountry:async t=>{const{data:e}=await a.get(i.COUNTRY_DETAIL(t));return e}},r={getStates:async t=>{const{data:e}=await a.get(i.STATES,{params:t});return e},getState:async t=>{const{data:e}=await a.get(i.STATE_DETAIL(t));return e}},u={getCities:async t=>{const{data:e}=await a.get(i.CITIES,{params:t});return e},getCity:async t=>{const{data:e}=await a.get(i.CITY_DETAIL(t));return e}},s={countries:{all:["countries"],lists:()=>[...s.countries.all,"list"],list:t=>[...s.countries.lists(),t],details:()=>[...s.countries.all,"detail"],detail:t=>[...s.countries.details(),t]},states:{all:["states"],lists:()=>[...s.states.all,"list"],list:t=>[...s.states.lists(),t],details:()=>[...s.states.all,"detail"],detail:t=>[...s.states.details(),t]},cities:{all:["cities"],lists:()=>[...s.cities.all,"list"],list:t=>[...s.cities.lists(),t],details:()=>[...s.cities.all,"detail"],detail:t=>[...s.cities.details(),t]}};function o(t){return n({queryKey:s.countries.list(t),queryFn:()=>l.getCountries(t)})}function d(t){return n({queryKey:s.states.list(t),queryFn:()=>r.getStates(t),enabled:!!t?.country})}function y(t){return n({queryKey:s.cities.list(t),queryFn:()=>u.getCities(t),enabled:!!t?.state})}export{d as a,y as b,o as u};
