import{a as o}from"./p-401e165e.js";var i;const n=["AU","BR","CA","CH","ES","HK","IE","IN","IT","JP","MY","MX","US"],t=["HK"],a=["SG"],l=a=>!t.includes(a),v=o=>!a.includes(o),d=a=>n.includes(a),s=(null===(i=window.scData)||void 0===i?void 0:i.locale)||navigator.language||(null===navigator||void 0===navigator?void 0:navigator.browserLanguage)||(navigator.languages||["en"])[0],c=async()=>{var a,l,i,n;const t=o("https://api.surecart.com/v1/public/atlas",{locale:s}),d=await fetch(t),u=await d.json(),c=null===(a=(null==u?void 0:u.data)||[])||void 0===a?void 0:a.map((({code:a,name:o})=>({value:a,label:o})));return(null===(n=null===(i=null===(l=null===window||void 0===window?void 0:window.wp)||void 0===l?void 0:l.hooks)||void 0===i?void 0:i.applyFilters)||void 0===n?void 0:n.call(i,"surecart_address_countries",c))||c},r=async a=>{const l=o(`https://api.surecart.com/v1/public/atlas/${a}`,{locale:s}),i=await fetch(l);return await i.json()},u=a=>(null==a?void 0:a.country)&&(null==a?void 0:a.line_1)&&(!l(a.country)||(null==a?void 0:a.postal_code))&&(!v(a.country)||(null==a?void 0:a.city))&&(!d(a.country)||(null==a?void 0:a.state));export{c,r as g,u as i};