"use strict";const addQueryArgs=require("./add-query-args-49dcb630.js");var _a;const lang=(null===(_a=window.scData)||void 0===_a?void 0:_a.locale)||navigator.language||(null===navigator||void 0===navigator?void 0:navigator.browserLanguage)||(navigator.languages||["en"])[0],countryChoices=async()=>{var a,o,t,r;const e=addQueryArgs.addQueryArgs("https://api.surecart.com/v1/public/atlas",{locale:lang}),i=await fetch(e),n=await i.json(),l=null===(a=(null==n?void 0:n.data)||[])||void 0===a?void 0:a.map((({code:a,name:o})=>({value:a,label:o})));return(null===(r=null===(t=null===(o=null===window||void 0===window?void 0:window.wp)||void 0===o?void 0:o.hooks)||void 0===t?void 0:t.applyFilters)||void 0===r?void 0:r.call(t,"surecart_address_countries",l))||l},getCountryDetails=async a=>{const o=addQueryArgs.addQueryArgs(`https://api.surecart.com/v1/public/atlas/${a}`,{locale:lang}),t=await fetch(o);return await t.json()};exports.countryChoices=countryChoices,exports.getCountryDetails=getCountryDetails;