1import{a as o,G as e}from"./164ad2e3.DgUUtBtV.js";import{D as t,E as s,A as i,G as r,H as a}from"./4c290a1e.D9lE9kmU.js";import{n as c}from"./6f1b819b.Bha_HLC8.js";import{g as n}from"./3ca8ef7e.DT3qvctx.js";import"./2c1ab0fe.D_oO1jU7.js";import"./app.bDJ3v-8C.js";import"./65f3d4da.8ZfwXSRH.js";import"./60a453ce.BIyixFcg.js";import"./0a7dffce.BMM606kb.js";import"./bb728e1c.BObJOhlA.js";import"./cadec7c0.nE7SeHjK.js";import"./8599b02a.yKiXuwTF.js";import"./08a3b809.CkE7TqUZ.js";import"./e477f96c.dvrL9dgG.js";import"./6a2fc6d6.F1jyoAIB.js";import"./ccdf3592.Jq-5VsnW.js";import"./cf29e63b.CnWxVFH5.js";import"./5587f402.B4N8qnlk.js";import"./bff2ff9b.DxpvVf7S.js";import"./acc74f72.CxyRLT4l.js";import"./2255f8fa.DZJKRP_r.js";import"./b8733b27.CelQ77Wt.js";import"./e39bc11c.BNw-kv3c.js";import"./ac5a19ff.CrIDx928.js";function d(o){return{resolvePickupLocality:e=>p(e,o),announcePickupLocality:e=>f(e,o)}}async function p(o,e){return m(o,(await n(e)).current.call,e)}async function m(o,t,{shop:s,source:n,i18n:d}){const p=i(),m={locale:d.locale,requestToken:p,shopId:r(s.id),sourceId:n.sourceId||"",checkoutSessionIdentifier:n.checkoutSessionIdentifier||""},{data:f}=await t.search(o.postal_code,{...m,countryCode:o.address_country,location:void 0},e),u=(await Promise.all(f.slice(0,5).map((o=>t.fetchAddress(o.addressId,{...m,completionService:o.completionService,extendedFields:!1}))))).filter((e=>e.countryCode===o.address_country&&c(e.postalCode)===c(o.postal_code)&&(!o.address_region||e.zoneCode===o.address_region)&&e.coordinates&&Number.isFinite(e.coordinates.latitude)&&Number.isFinite(e.coordinates.longitude)&&Math.abs(e.coordinates.latitude)<=90&&Math.abs(e.coordinates.longitude)<=180));if(1!==new Set(u.map((({coordinates:o})=>JSON.stringify(o)))).size)return;const l=u[0];return a({countryCode:l.countryCode,zoneCode:l.zoneCode,postalCode:l.postalCode,city:l.city,coordinates:l.coordinates})}function f(e,i){const r=t(e.countryCode?i.checkout.address.countryDetails.get(e.countryCode):void 0,i.i18n);o({content:s(e,r,["company","firstName","lastName","phone","countryCode","zoneCode"]),role:"status"})}export{f as announcePickupLocality,d as createPickupLocalityServices,p as lookupPickupLocality,m as resolvePickupLocality};
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.