1import{r as s,j as g}from"./index-BfSZzoVO.js";import{c as a,P as d}from"./checkout-money-CPilayGU.js";const m={UK:{currency:"GBP",symbol:"£",locale:"en-GB",freeShippingThreshold:76,freeGiftThreshold:200,shippingBanner:"Free UK shipping on orders over £60",shippingBadge:"Free shipping over £60",phone:"+44",deliveryTime:"2â4 business days",carrier:"Royal Mail Tracked",vatLabel:"inc. VAT",shippingCostUsd:5.589,shippingSmallestUnit:a("UK"),ambiguousCurrency:!1},US:{currency:"USD",symbol:"$",locale:"en-US",freeShippingThreshold:79,freeGiftThreshold:200,shippingBanner:"Free US shipping on orders over $79",shippingBadge:"Free shipping over $79",phone:"+1",deliveryTime:"5â10 business days",carrier:"USPS",vatLabel:"",shippingCostUsd:10,shippingSmallestUnit:a("US"),ambiguousCurrency:!1},AU:{currency:"AUD",symbol:"A$",locale:"en-AU",freeShippingThreshold:65,freeGiftThreshold:200,shippingBanner:"Free Australia shipping on orders over A$99",shippingBadge:"Free shipping over A$99",phone:"+61",deliveryTime:"7â14 business days",carrier:"Australia Post",vatLabel:"inc. GST",shippingCostUsd:9.97,shippingSmallestUnit:a("AU"),ambiguousCurrency:!0},CA:{currency:"CAD",symbol:"C$",locale:"en-CA",freeShippingThreshold:65,freeGiftThreshold:200,shippingBanner:"Free Canada shipping on orders over C$89",shippingBadge:"Free shipping over C$89",ph
1one:"+1",deliveryTime:"7â12 business days",carrier:"Canada Post",vatLabel:"",shippingCostUsd:9.97,shippingSmallestUnit:a("CA"),ambiguousCurrency:!0},NZ:{currency:"NZD",symbol:"NZ$",locale:"en-NZ",freeShippingThreshold:66,freeGiftThreshold:200,shippingBanner:"Free NZ shipping on orders over NZ$109",shippingBadge:"Free shipping over NZ$109",phone:"+64",deliveryTime:"10â16 business days",carrier:"NZ Post",vatLabel:"inc. GST",shippingCostUsd:9.97,shippingSmallestUnit:a("NZ"),ambiguousCurrency:!0},EU:{currency:"EUR",symbol:"â¬",locale:"en-EU",freeShippingThreshold:71,freeGiftThreshold:200,shippingBanner:"Free EU shipping on orders over â¬65",shippingBadge:"Free shipping over â¬65",phone:"",deliveryTime:"5â10 business days",carrier:"DHL / DPD",vatLabel:"inc. VAT",shippingCostUsd:10,shippingSmallestUnit:a("EU"),ambiguousCurrency:!1},ROW:{currency:"USD",symbol:"$",locale:"en-US",freeShippingThreshold:99,freeGiftThreshold:200,shippingBanner:"Free international shipping on orders over $99",shippingBadge:"Free shipping over $99",phone:"",deliveryTime:"10â21 business days",carrier:"Royal Mail International",vatLabel:"",shippingCostUsd:10,shippingSmallestUnit:a("ROW"),ambiguousCurrency:!1}},C=[{code:"US",label:"United States"},{code:"UK",label:"United Kingdom"},{code:"AU",label:"Australia"},{code:"CA",label:"Canada"},{code:"NZ",label:"New Zealand"},{code:"EU",label:"Europe"},{code:"ROW",label:"Rest of World"}],c="cn_geo_v2",h="cn_geo_override",l="cn_geo_ts_v2",y=6*60*60*1e3,f=60*60*1e3;function p(){try{const n=localStorage.getItem(h);if(n)return n;const e=parseInt(localStorage.getItem(l)||"0",10),t=localStorage.getItem(c);if(!t)return null;const r=t==="ROW"?f:y;if(Date.now()-e<r)return t}catch{}return null}function U(n){const e=m[n],t=d[n];return{...e,country:n,formatPrice:r=>{const i=isFinite(r)&&!isNaN(r)?r:0,o=Math.ceil(i*t);try{return new Intl.NumberFormat(e.locale,{style:"currency",currency:e.currency,minimumFractionDigits:0,maximumFractionDigits:0}).format(o)}catch{return`${e.symbol}${o}`}},formatPriceDecimal:r=>{const o=(isFinite(r)&&!isNaN(r)?r:0)*t;try{return new Intl.NumberFormat(e.locale,{style:"currency",currency:e.currency,minimumFractionDigits:2,maximumFractionDigits:2}).format(o)}catch{return`${e.symbol}${o.toFixed(2)}`}}}}function S(){const[n,e]=s.useState(()=>{const r=p();if(r)return r;try{const i=window.__geo;if(i)return i}catch{}return"UK"});s.useEffect(()=>{const r=p();if(r){s.startTransition(()=>e(r));return}try{const i=window.__geo;if(i){try{localStorage.setItem(c,i),localStorage.setItem(l,String(Date.now()))}catch{}s.startTransition(()=>e(i));return}}catch{}fetch("/api/geo/detect").then(i=>i.json()).then(i=>{const o=i.country||"UK";try{localStorage.setItem(c,o),localStorage.setItem(l,String(Date.now()))}catch{}s.startTransition(()=>e(o))}).catch(()=>s.startTransition(()=>e("UK")))},[]);const t=r=>{try{localStorage.setItem(h,r)}catch{}e(r)};return{...U(n),setCountryOverride:t}}const u=s.createContext(null);function T({children:n,forceCountry:e}){const t=S();return s.useEffect(()=>{e&&t.country!==e&&t.setCountryOverride(e)},[e]),g.jsx(u.Provider,{value:t,children:n})}function E(){const n=s.useContext(u);if(!n)throw new Error("useGeoContext must be used within GeoProvider");return n}export{C as A,T as G,E 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.