efficient-storefront-blocks 0.109.0 → 0.111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/chunks/EditorPreviewCheckout-C42GCC3T.js +4 -0
- package/dist/chunks/{SiteEditorProvider-KN5FKGBX.js → SiteEditorProvider-P4HVFXUX.js} +1 -1
- package/dist/chunks/chunk-CPAF23MT.js +1 -0
- package/dist/chunks/chunk-FRCI3FAV.js +80 -0
- package/dist/chunks/{chunk-SUX7QH3R.js → chunk-GB6OHYUY.js} +1 -1
- package/dist/chunks/{chunk-X3ERHC7Y.js → chunk-MVJVIU2F.js} +1 -1
- package/dist/chunks/chunk-RFFTWKCU.js +340 -0
- package/dist/chunks/{fitment-data-Z3FDYFU6.js → fitment-data-EGBXHTFW.js} +1 -1
- package/dist/contract.js +8 -2
- package/dist/editor/components/BlogSource.d.ts +1 -1
- package/dist/editor/components/BlogSource.js +1 -1
- package/dist/editor/lib/efficient-backend.js +1 -1
- package/dist/index.js +32 -32
- package/dist/links.js +1 -1
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CartContext.d.ts +3 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/Events.d.ts +2 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/cart/drawer-parts.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
- package/dist/render/components/checkout/checkout-parts.d.ts +11 -0
- package/dist/render/components/checkout/checkout-parts.js +1 -1
- package/dist/render/components/checkout/checkout-state.d.ts +5 -0
- package/dist/render/components/checkout/checkout-state.js +3 -3
- package/dist/render/lib/checkout/checkout-memory.d.ts +62 -0
- package/dist/render/lib/checkout/checkout-memory.js +1 -0
- package/dist/render/lib/checkout/wallet-return.d.ts +3 -0
- package/dist/render/lib/checkout/wallet-return.js +1 -1
- package/dist/render/lib/content/event-post.d.ts +5 -0
- package/dist/render/lib/content/event-post.js +1 -0
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/wheels/price-display.d.ts +2 -0
- package/dist/render/lib/wheels/price-display.js +1 -1
- package/dist/words.d.ts +1 -0
- package/dist/words.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/EditorPreviewCheckout-IVYEDVVN.js +0 -4
- package/dist/chunks/chunk-5VN7IA5L.js +0 -1
- package/dist/chunks/chunk-G5XZ736Y.js +0 -339
- package/dist/chunks/chunk-UBOGEIFX.js +0 -74
- /package/dist/chunks/{chunk-G5XZ736Y.js.LEGAL.txt → chunk-RFFTWKCU.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as W,c as se,f as oe,h as D,m as ae,o as L}from"./chunk-SUX7QH3R.js";var q="".replace(/\/+$/,"");var K="x-forwarded-for";function le(e){let t=(e??"").split(",").map(n=>n.trim()).filter(Boolean);return t.length>0?t[t.length-1]:null}var dt="x-forwarded-host";function ce(e,t,n){let r={};return e&&(r[dt]=e),t&&n==="uncached"&&(r[K]=t),r}function ue(e){if(e?.cache==="no-store"||e?.cache==="no-cache")return"uncached";if(e?.cache==="force-cache")return"data-cached";let t=e?.next?.revalidate;return typeof t=="number"&&t>0?"data-cached":"uncached"}var de="x-storefront-site",pe="x-storefront-host",me="x-storefront-preview";function f(e){return Array.isArray(e)?e:e?.results??[]}var pt="shop_access_token",ge="shop_refresh_token",J=null;function V(){L.removeItem(pt),L.removeItem(ge)}var A={getAccess(){return J},takeLegacyRefresh(){let e=L.getItem(ge);return V(),e},setTokens(e){J=e,V()},clear(){J=null,V()}};import{efficientClientOpen as Ft}from"efficient-easel/screen/lib/session";function mt(e){return!!e.src}function C(e){let t=e.finishes.filter(mt);if(t.length===e.finishes.length)return e;let n=e.defaultFinish&&t.some(r=>r.name===e.defaultFinish)?e.defaultFinish:null;return{...e,finishes:t,defaultFinish:n}}function gt(e){return e.listable!==!1}function x(e){return e.map(C).filter(gt)}var Se=["fill","stroke","stop-color","color","flood-color","lighting-color","solid-color"],Pe=new Set(["none","transparent","currentcolor","inherit","initial","unset","context-fill","context-stroke"]),M={black:[0,0,0],white:[255,255,255],gray:[128,128,128],grey:[128,128,128],darkgray:[169,169,169],darkgrey:[169,169,169],dimgray:[105,105,105],dimgrey:[105,105,105],lightgray:[211,211,211],lightgrey:[211,211,211],gainsboro:[220,220,220],silver:[192,192,192],whitesmoke:[245,245,245]},be=12,we=/\burl\(/i,Ae=new RegExp(`(?<![-\\w])(${Se.join("|")})(\\s*=\\s*)(["'])([^"']*)\\3`,"gi"),Re=new RegExp(`((?:^|[;{\\s"'])(?:${Se.join("|")})\\s*:\\s*)([^;}"'<>]+)`,"gi"),yt=/<svg\b([^>]*)>/i,ht=/\bfill\s*[=:]/i;function ft(e){let t=e.replace(Ae,(n,r,o,l,p)=>{let i=ye(p);return i===null?n:`${r}${o}${l}${i}${l}`}).replace(Re,(n,r,o)=>{let l=ye(o);return l===null?n:`${r}${l}`});return t=t.replace(yt,(n,r)=>ht.test(r)?n:`<svg fill="#ffffff"${r}>`),t}function ye(e){let t=/!important/i.test(e),n=e.replace(/!important/gi,"").trim().toLowerCase();if(!n||we.test(n)||Pe.has(n))return null;let r=n in M?[...M[n],1]:ke(n);if(!r)return null;let[o,l,p,i]=r;if(Math.max(o,l,p)-Math.min(o,l,p)>be)return null;let s=St(255-o,255-l,255-p,i);return t?`${s} !important`:s}function St(e,t,n,r){if(r<1)return`rgba(${e}, ${t}, ${n}, ${r})`;let o=l=>l.toString(16).padStart(2,"0");return`#${o(e)}${o(t)}${o(n)}`}function ke(e){return e.startsWith("#")?Pt(e):e.startsWith("rgb")?bt(e):e.startsWith("hsl")?At(e):null}function Pt(e){let t=e.slice(1),n=1;if(t.length===3||t.length===4)t.length===4&&(n=parseInt(t[3]+t[3],16)/255),t=t.slice(0,3).split("").map(r=>r+r).join("");else if(t.length===6||t.length===8)t.length===8&&(n=parseInt(t.slice(6,8),16)/255),t=t.slice(0,6);else return null;return/^[0-9a-f]{6}$/.test(t)?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),n]:null}function bt(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),o=n.split(/[\s,]+/).filter(Boolean).slice(0,3);if(o.length<3)return null;let l=o.map(i=>i.endsWith("%")?Math.round(parseFloat(i)/100*255):Math.round(parseFloat(i)));if(l.some(i=>Number.isNaN(i)))return null;let p=r?I(r):wt(n);return[l[0],l[1],l[2],p]}function wt(e){let t=e.split(/[\s,]+/).filter(Boolean);return t.length>=4?I(t[3]):1}function I(e){let t=e.trim().endsWith("%")?parseFloat(e)/100:parseFloat(e);return Number.isNaN(t)?1:t}function At(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),o=n.split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let l=parseFloat(o[0]),p=parseFloat(o[1])/100,i=parseFloat(o[2])/100;if([l,p,i].some(w=>Number.isNaN(w)))return null;let s=r?I(r):o.length>=4?I(o[3]):1,[a,m,g]=Rt(l,p,i);return[a,m,g,s]}function Rt(e,t,n){let r=(1-Math.abs(2*n-1))*t,o=(e%360+360)%360/60,l=r*(1-Math.abs(o%2-1)),p=0,i=0,s=0;o<1?[p,i,s]=[r,l,0]:o<2?[p,i,s]=[l,r,0]:o<3?[p,i,s]=[0,r,l]:o<4?[p,i,s]=[0,l,r]:o<5?[p,i,s]=[l,0,r]:[p,i,s]=[r,0,l];let a=n-r/2;return[Math.round((p+a)*255),Math.round((i+a)*255),Math.round((s+a)*255)]}var he=512*1024;function Y(e){return/\.svg(\?|$)/i.test(e)}function kt(e){return`data:image/svg+xml,${encodeURIComponent(ft(e))}`}function Tt(e){let t=e.replace(/!important/gi,"").trim().toLowerCase();if(!t||we.test(t)||Pe.has(t))return null;let n=t in M?[...M[t],1]:ke(t);if(!n)return null;let[r,o,l]=n;return Math.max(r,o,l)-Math.min(r,o,l)>be?null:(.2126*r+.7152*o+.0722*l)/255}function _t(e){let t=[],n=r=>{let o=Tt(r);o!==null&&t.push(o)};for(let r of e.matchAll(Ae))n(r[4]);for(let r of e.matchAll(Re))n(r[2]);return t.length?t.reduce((r,o)=>r+o,0)/t.length<.5:null}var fe=/^(?:\uFEFF|\s+|<\?xml[^>]*\?>|<!--[\s\S]*?-->|<!DOCTYPE\s+svg[^>[]*>)/i;function Ct(e){let t=e;for(let n=fe.exec(t);n&&n[0].length>0;n=fe.exec(t))t=t.slice(n[0].length);return/^<svg[\s>/]/i.test(t)}async function xt(e,t){if(!Y(e))return null;try{let n=await fetch(e,{signal:t,redirect:"manual"});if(!n.ok)return null;let r=Number(n.headers.get("content-length"));if(Number.isFinite(r)&&r>he)return null;let o=await n.text();return o.length>he?null:Ct(o)?o:null}catch{return null}}async function Te(e,t){let n=await xt(e,t);return n===null?null:{reversed:kt(n),inkIsDark:_t(n)}}import{currentEaselSession as Ot,setSessionBridgedSite as Nn,setSessionDocumentSite as Dn}from"efficient-easel/screen/lib/session";function _e(){return Ot().siteId()}var Ce={title:"Find a dealer",placeholder:"Postcode or suburb",search:"Search",searching:"Searching\u2026",none:"No dealers to show yet.",notFound:"We couldn't find that place. Check the postcode or suburb and search again.",tryAgain:"We couldn't look up that place just now. Please try again.",website:"Website",map:"Dealers on the map"},k=e=>typeof e=="string"?e:"",Z=e=>typeof e=="number"&&Number.isFinite(e)?e:null,Et=["found","not_found","try_again"];function Ut(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.name!="string"||!t.name?null:{id:k(t.id)||t.name,name:t.name,address:k(t.address),city:k(t.city),state:k(t.state),postcode:k(t.postcode),country:k(t.country),phone:k(t.phone),website:k(t.website),lat:Z(t.lat),lng:Z(t.lng),distanceKm:Z(t.distanceKm)}}function xe(e){if(!e||typeof e!="object")return{near:null,dealers:[]};let t=e,n=typeof t.near=="string"&&Et.includes(t.near)?t.near:null,r=Array.isArray(t.dealers)?t.dealers:[];return{near:n,dealers:r.map(Ut).filter(o=>o!==null)}}function Mn(e){return e==="not_found"?Ce.notFound:e==="try_again"?Ce.tryAgain:null}function In(e){return e===null?null:e<10?`${e.toFixed(1)} km`:`${Math.round(e)} km`}function vn(e){return[e.city,e.state,e.postcode].filter(Boolean).join(" ")}function Fn(e){let t=e.map((a,m)=>({dealer:a,index:m})).filter(({dealer:a})=>a.lat!==null&&a.lng!==null);if(!t.length)return[];let n=t.map(({dealer:a})=>a.lat),r=t.map(({dealer:a})=>a.lng),[o,l]=[Math.min(...n),Math.max(...n)],[p,i]=[Math.min(...r),Math.max(...r)],s=(a,m,g)=>g===m?50:8+(a-m)/(g-m)*84;return t.map(({dealer:a,index:m})=>({id:a.id,index:m,left:s(a.lng,p,i),top:100-s(a.lat,o,l)}))}var Oe=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"],Ee=["AED","AFN","ALL","AMD","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG"],$n={AD:"EUR",AE:"AED",AF:"AFN",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AT:"EUR",AU:"AUD",AW:"AWG",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BH:"BHD",BI:"BIF",BM:"BMD",BN:"BND",BO:"BOB",BR:"BRL",BS:"BSD",BT:"BTN",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CD:"CDF",CH:"CHE",CL:"CLF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DO:"DOP",DZ:"DZD",EE:"EUR",EG:"EGP",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FR:"EUR",GB:"GBP",GE:"GEL",GH:"GHS",GI:"GIP",GM:"GMD",GN:"GNF",GR:"EUR",GT:"GTQ",GY:"GYD",HK:"HKD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IN:"INR",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KM:"KMF",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MG:"MGA",MK:"MKD",MM:"MMK",MN:"MNT",MO:"MOP",MR:"MRU",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PT:"EUR",PY:"PYG",QA:"QAR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SK:"EUR",SL:"SLE",SM:"EUR",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"SVC",SY:"SYP",SZ:"SZL",TH:"THB",TJ:"TJS",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYI",UZ:"UZS",VA:"EUR",VE:"VED",VN:"VND",VU:"VUV",WS:"WST",YE:"YER",ZA:"ZAR",ZM:"ZMW",ZW:"ZWG"};var Wn={firstName:"",lastName:"",email:"",company:"",slug:"",country:"",currency:""},Nt=["slug_malformed","slug_reserved","slug_taken"],j=e=>typeof e=="string"&&Nt.includes(e),qn=400,P={title:"Create your {name} workspace",freeLine:"Free to start. No card needed.",firstName:"First name",lastName:"Last name",email:"Work email",company:"Company name",address:"Workspace address",country:"Country",currency:"Currency",countryHint:"Your shop sells in this currency. The country sets its tax and shipping defaults. Both can be changed later.",checking:"Checking",available:"Available",submit:"Create workspace",sending:"Sending\u2026",agree:"By creating a workspace you agree to the {terms} and {privacy}.",terms:"Terms",privacy:"Privacy Policy",haveOne:"Already have a workspace?",find:"Find my workspace",required:"Fill this in.",companyShort:"Use at least 2 characters.",emailWrong:"Enter an email address, like name@company.com.",notOffered:"That choice is not offered. Pick another.",wrong:"Check this and try again.",slugProblem:{slug_malformed:"Use 3 to 30 lower-case letters, digits or single hyphens, starting with a letter.",slug_reserved:"That address is kept for the platform. Choose another.",slug_taken:"That address is taken. Choose another."},trouble:{closed:"Signing up is closed just now.",dailyLimit:"Too many workspaces signed up today. Try again tomorrow.",unavailable:"Signing up is not available just now. Try again later.",tooMany:"You have asked a few times in a row. Wait a minute, then try again.",unreachable:"We couldn't reach the server. Check your connection and try again.",failed:"Something went wrong and nothing was sent. Try again."},closedTitle:"Signing up is closed just now",closedBody:"New {name} workspaces cannot be made just now.",closedLeave:"Leave your email and we'll tell you when it opens.",tellMe:"Tell me when it opens",waitingDone:"Thanks. We'll email {email} when sign-up opens.",sentTitle:"Check your email",sentBody:"We sent a link to {email}. Open it to set up {company}.",sentUntil:"The link works once, until {when}. Asking again sends a new link, and the old one stops working.",sendAgain:"Send it again",sendingAgain:"Sending\u2026",sentAgain:"A new link is on its way. The old one no longer works.",change:"Change the details"};function Ue(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>t[r]??n)}function Ne(e){return e.trim().toLowerCase().replace(/_/g,"-")}function Kn(e){return e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-").replace(/^[^a-z]+/,"").slice(0,30).replace(/-+$/,"")}function Jn(e,t){let n=(e??"").trim().toLowerCase().replace(/^\.+/,"").replace(/\.+$/,"");if(n)return`.${n}`;let r=t.toLowerCase().replace(/\.$/,"").replace(/^www\./,"");return r?`.${r}`:""}var R=e=>typeof e=="string"?e:"";function De(e,t){let n=new URLSearchParams;t&&n.set("slug",t),e&&n.set("product",e);let r=n.toString();return`/api/business-sign-ups/availability/${r?`?${r}`:""}`}var Le="/api/business-sign-ups/",Me="/api/business-sign-ups/waiting-list/";function Vn(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return n.code==="sign_up_open"?{open:!0,email:null,trouble:null}:n.code==="sign_up_waiting_list_unavailable"?{open:!1,email:null,trouble:"unavailable"}:e===400&&"email"in n?{open:!1,email:P.emailWrong,trouble:null}:e===0?{open:!1,email:null,trouble:"unreachable"}:e===429?{open:!1,email:null,trouble:"tooMany"}:{open:!1,email:null,trouble:"failed"}}function Yn(e){let t=e.trim();return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?null:P.emailWrong:P.required}function Ie(e){let t=e&&typeof e=="object"?e:{};return{open:t.open===!0,country:R(t.country),currency:R(t.currency),slugAvailable:typeof t.slug_available=="boolean"?t.slug_available:null,slugProblem:j(t.slug_problem)?t.slug_problem:null}}function Zn(e){return e.slugAvailable?{state:"available"}:e.slugProblem?{state:"problem",problem:e.slugProblem}:{state:"unknown"}}function ve(e){let t=e&&typeof e=="object"?e:{};return{slug:R(t.slug),expiresAt:R(t.expires_at)}}function jn(e,t,n){return{business_name:e.company.trim(),slug:Ne(e.slug),first_name:e.firstName.trim(),last_name:e.lastName.trim(),email:e.email.trim(),...t?{product:t}:{},...n&&e.country?{country:e.country}:{},...n&&e.currency?{currency:e.currency}:{}}}function Qn(e,t){let n={};e.firstName.trim()||(n.firstName=P.required);let r=e.email.trim();r?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(n.email=P.emailWrong):n.email=P.required;let o=e.company.trim();return o?o.length<2&&(n.company=P.companyShort):n.company=P.required,Ne(e.slug)?t.state==="problem"&&(n.slug=P.slugProblem[t.problem]):n.slug=P.required,n}var Dt={business_name:"company",slug:"slug",first_name:"firstName",last_name:"lastName",email:"email",country:"country",currency:"currency"},F={self_sign_up_off:"closed",sign_up_daily_limit:"dailyLimit",sign_up_unavailable:"unavailable",sign_up_plan_missing:"unavailable"};function Xn(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.code;if(j(r))return{fields:{slug:P.slugProblem[r]},trouble:null};if(typeof r=="string"&&F[r])return{fields:{},trouble:F[r]};if(e===0)return{fields:{},trouble:"unreachable"};if(e===429)return{fields:{},trouble:"tooMany"};if(e===400){let o={};for(let l of Object.keys(n)){let p=Dt[l];p&&(o[p]=p==="slug"?P.slugProblem.slug_malformed:p==="email"?P.emailWrong:p==="country"||p==="currency"?P.notOffered:P.wrong)}if(Object.keys(o).length)return{fields:o,trouble:null}}return{fields:{},trouble:"failed"}}function Fe(e,t){try{let n=new Intl.DisplayNames(t?[t]:void 0,{type:e,fallback:"code"});return r=>n.of(r)??r}catch{return n=>n}}var Be=(e,t)=>t&&!e.includes(t)?[...e,t]:[...e],Lt=(e,t)=>{let n=new Intl.Collator(t);return e.sort((r,o)=>n.compare(r.label,o.label))};function zn(e,t){let n=Fe("region",t);return Lt(Be(Oe,e).map(r=>({value:r,label:n(r)})),t)}function er(e,t){let n=Fe("currency",t);return Be(Ee,e).sort().map(r=>{let o=n(r);return{value:r,label:o===r?r:`${r} \xB7 ${o}`}})}function tr(e,t,n){let r=new Date(e);if(!e||Number.isNaN(r.getTime()))return"";let o=i=>new Intl.DateTimeFormat(t,{timeZone:n,...i}).format(r),l=`${o({weekday:"long"})} ${o({day:"numeric"})} ${o({month:"long"})}`,p=o({hour:"numeric",minute:"2-digit",hour12:!0}).replace(/\s?([AP])M$/i,(i,s)=>` ${s.toLowerCase()}m`);return`${l}, ${p}`}var Mt=/^\/sign-up\/verify\/([^/?#]+)\/?$/;function nr(e){let t=Mt.exec(e??"");if(!t)return"";try{return decodeURIComponent(t[1])}catch{return t[1]}}var $e="/api/business-sign-ups/verifications/",It=["pending","provisioning","ready","failed"];function Q(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=R(n.code),o=R(n.slug);if(e===202||r==="sign_up_already_verified"){let l=R(n.provisioning_status),p=R(n.business_name);return It.includes(l)?l==="ready"?{kind:"ready",company:p,slug:o}:l==="failed"?{kind:"failed",company:p,slug:o}:{kind:"building",company:p,slug:o,status:l}:{kind:"gone"}}return j(r)?{kind:"taken",slug:o}:r==="sign_up_daily_limit"?{kind:"dailyLimit"}:r==="self_sign_up_off"?{kind:"closed"}:r&&F[r]?{kind:"trouble",trouble:F[r]}:e===400&&"token"in n?{kind:"gone"}:e===0?{kind:"trouble",trouble:"unreachable"}:e===429?{kind:"trouble",trouble:"tooMany"}:{kind:"trouble",trouble:"failed"}}function rr(e){return e.kind==="building"||e.kind==="trouble"&&e.trouble!=="failed"}function ir(e){return e<5?2e3:e<20?5e3:15e3}var sr=40;function or(e,t,n){let r=e.kind==="failed"?"stopped":"running";return[{words:v.confirmed,at:"done"},{words:Ue(v.reserved,{address:`${e.slug}${n}`}),at:"done"},{words:v.building,at:r},...e.kind==="failed"?[]:[{words:Ue(v.adding,{name:t}),at:"waiting"}]]}var ar=e=>e==="pending"?50:75,v={settingUp:"Setting up {company}",confirmed:"Email confirmed",reserved:"Address reserved: {address}",building:"Building your workspace",adding:"Adding {name}",aboutTen:"This takes about 10 seconds. You can close this page: we'll email you when it's ready.",readyTitle:"Your workspace is ready",workspace:"Workspace",address:"Address",plan:"Plan",planName:"{name} Free",readyNext:"We've emailed you a link to set your password. It's the next step.",failedBody:"We couldn't finish building your workspace. We've been told, and we'll email you when it's ready. You don't need to sign up again.",goneTitle:"This link has run out",goneBody:"This link is not right, or it has run out. Sign up again and we'll send a new one.",again:"Sign up again",takenTitle:"That address has gone",takenBody:"{address} was taken before you opened your link. Choose another address and we'll send a new link.",takenBodyBare:"That address was taken before you opened your link. Choose another address and we'll send a new link.",chooseAnother:"Choose another address",limitTitle:"Not today",limitNext:"Your link still works until it runs out. Open it again tomorrow.",checking:"Checking your link"},Ge="/api/business-sign-ups/workspace-finds/",He="/api/business-sign-ups/workspace-finds/openings/",vt=/^\/find\/([^/?#]+)\/?$/;function lr(e){let t=vt.exec(e??"");if(!t)return"";try{return decodeURIComponent(t[1])}catch{return t[1]}}var cr={title:"Find your workspace",intro:"Enter your work email. We'll send you the address of every workspace you belong to.",submit:"Email me my workspaces",newHere:"New to {name}?",create:"Create a workspace",sentTitle:"Check your email",sentBody:"If {email} belongs to a workspace, the links are on their way.",sentNote:"They work for 30 minutes. Nothing arrives if the address isn't in any workspace.",another:"Use another email",linkGone:"This link is not right, or it has run out. Ask for your workspaces again.",opening:"Opening your workspace"};function ur(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return n.code==="workspace_find_unavailable"?{email:null,trouble:"unavailable"}:e===400&&"email"in n?{email:P.emailWrong,trouble:null}:e===0?{email:null,trouble:"unreachable"}:e===429?{email:null,trouble:"tooMany"}:{email:null,trouble:"failed"}}function We(e){let t=e&&typeof e=="object"?R(e.sign_in_url):"";return/^https?:\/\/[^\s]+$/i.test(t)?t:""}var Bt="",S=class extends Error{constructor(t,n,r){super(n),this.status=t,this.data=r}},te="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",$t=new Set([502,503,504]),X=0,Gt="This editor runs on its host's own backend, which does not serve this request.",Ht=5e3,Wt=15e3,qt=()=>typeof window>"u"?Ht:Wt;function nt(e){let t=(e.method??"GET").toUpperCase();if(!(e.body!=null||t!=="GET"&&t!=="HEAD")&&!(e.audience!=null&&e.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(qt())}var qe=e=>e instanceof Error&&e.name==="TimeoutError",Ke=(e,t)=>$t.has(e)?te:t,Kt=["admin","venue"],rt="admin";function wr(e){rt=Kt.includes(e)?e:"admin"}function Jt(){return rt}var Vt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/,it=null;function Ar(e){it=e&&Vt.test(e)?e:null}function Yt(){return it}function Zt(e){if(typeof window>"u"||!e.startsWith("/api/v1/"))return e;let t=W();return!t||/[?&]site=/.test(e)?e:H(e,`site=${encodeURIComponent(t)}`)}async function c(e,t={}){let{token:n,baseUrl:r,headers:o,audience:l,...p}=t;if(typeof window<"u"&&!Ft())throw new S(X,Gt,null);if(typeof window>"u"&&r===void 0)throw new Error(`apiFetch(${JSON.stringify(e)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);let i=typeof FormData<"u"&&p.body instanceof FormData,s;try{s=await fetch(`${r??Bt}${Zt(e)}`,{...p,headers:{...i?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...o},signal:p.signal??nt({...p,audience:l})})}catch(g){throw g instanceof TypeError||qe(g)?new S(X,te,null):g}let a;try{a=await s.text()}catch(g){throw qe(g)?new S(X,te,null):g}let m=null;if(a)try{m=JSON.parse(a)}catch{throw new S(s.status,s.ok?"Expected JSON but received a non-JSON response":Ke(s.status,s.statusText),a)}if(!s.ok){let g=(m&&typeof m=="object"&&"detail"in m&&typeof m.detail=="string"?m.detail:null)??Ke(s.status,s.statusText);throw new S(s.status,g,m)}return m}var O=null;async function st(){return O||(O=jt().finally(()=>{O=null}),O)}async function jt(){let e=A.takeLegacyRefresh(),t=await zt.refresh(e??void 0);return A.setTokens(t.access),t.access}async function ot(){return A.getAccess()??st()}async function h(e,t={}){let n;try{n=await ot()}catch{throw A.clear(),new S(401,"Not signed in",null)}try{return await c(e,{...t,token:n})}catch(r){if(!(r instanceof S)||r.status!==401)throw r;try{let o=await st();return await c(e,{...t,token:o})}catch{throw A.clear(),r}}}var Qt=100,Je=20;function Xt(e){if(!e)return null;try{return new URL(e,"http://page.invalid").searchParams.get("page")}catch{return null}}async function Ve(e,t){let[n,r=""]=e.split("?"),o=[],l="1";for(let p=0;p<Je&&l;p++){let i=new URLSearchParams(r);i.set("page_size",String(Qt)),l!=="1"&&i.set("page",l);let s=await h(`${n}?${i.toString()}`);o.push(...f(s)),l=Xt(s.next)}return l&&console.warn(`[${t}] stopped at ${Je} pages (${o.length} rows); list may be truncated`),o}async function Ye(e,t={}){if(A.getAccess())try{return{data:await h(e,t),asShopper:!0}}catch(n){if(!(n instanceof S)||n.status!==401)throw n}return{data:await c(e,t),asShopper:!1}}async function Ze(){let e=await h("/api/auth/me/");if(e.portal!=="shop")throw A.clear(),new S(403,"This session is not valid for this shop.",null);return e}var zt={login:(e,t)=>c("/api/auth/login/",{method:"POST",body:JSON.stringify({email:e,password:t,portal:"shop"}),credentials:"include"}),refresh:e=>c("/api/auth/refresh/",{method:"POST",body:JSON.stringify(e?{refresh:e,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{A.clear();try{await c("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{let e=await ot();return await Ze(),e},me:Ze,updateMe:e=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(e)}),changePassword:(e,t)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:t,old_password:e})}),changeEmail:(e,t)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:e,current_password:t})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:e=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(e)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:e=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(e)}),updateAddress:(e,t)=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"PATCH",body:JSON.stringify(t)}),deleteAddress:e=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"DELETE"}),passwordResetRequest:e=>c("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:e})}),passwordResetConfirm:(e,t,n)=>c("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:e,token:t,new_password:n})}),brands:()=>h("/api/products/brands/"),myOrders:()=>Ve("/api/shop-portal/orders/","api.myOrders"),myOrder:e=>h(`/api/shop-portal/orders/${e}/`),cancelOrder:e=>h(`/api/shop-portal/orders/${e}/cancel/`,{method:"POST"}),myReturns:e=>Ve(`/api/shop-portal/returns/${e?`?order=${encodeURIComponent(e)}`:""}`,"api.myReturns"),createReturn:e=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(e)}),withdrawReturn:e=>h(`/api/shop-portal/returns/${e}/cancel/`,{method:"POST"}),uploadReturnPhoto:(e,t)=>{let n=new FormData;return n.append("claim_item",e),n.append("file",t),n.append("media_type",t.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:n})}};function b(e){if(typeof e=="string")return e.startsWith("/media/")?oe(e):e;if(Array.isArray(e))return e.map(b);if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=n==="captions"&&r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r).map(([o,l])=>[b(o),l])):b(r);return t}return e}var at=typeof window>"u"&&q!=="",en=at?q:"",tn=se,T=()=>({baseUrl:tn(),audience:null});function u(e,t){let n=t?`?process=${encodeURIComponent(t)}`:"";return`/api/v1${e}${n}`}var lt=100,je=50;function ie(e,t,n){let r=new URLSearchParams;for(let[o,l]of Object.entries(t))l!=null&&l!==""&&r.set(o,String(l));return r.set("pageSize",String(lt)),n&&r.set("cursor",n),`/api/v1${e}?${r.toString()}`}function nn(e,t){return ie("/wheels",{process:e},t)}var Qe=lt;function rn(e,t){return ie("/wheels",{slug:e.join(",")},t)}function sn(e,t,n){return ie("/products",{kind:e.join(","),make:t?.make,model:t?.model,year:t?.year,modification:t?.modification},n)}function on(e){if(!e)return null;try{return new URL(e,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function z(e,t,n=()=>!1,r=()=>!1){let o=[],l=null;try{for(let p=0;p<je;p++){let i=await c(await t(l),await d());if(o.push(...f(i)),l=on(i.next),!l)break;if(r(o))return o}l&&console.warn(`[${e}] stopped at ${je} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(n(p))throw p;console.warn(`[${e}] product API unavailable, returning []`,p)}return o}var Xe=e=>e instanceof S&&e.status===400;function ze(e){return e.flatMap(t=>t.kind==="alloy-wheel"?x([t]):[t])}async function ct(){return(await an()).host}async function an(){try{let{headers:e}=await import("./headers-UYHEZDAT.js"),t=await e(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,r=n(t.get(pe)??t.get("x-forwarded-host")??t.get("host")),o=n(t.get("host"));return{host:r,matchesRequestHost:r!==null&&r===o}}catch{return{host:null,matchesRequestHost:!1}}}async function ln(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return le((await e()).get(K))}catch{return null}}async function cn(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(de)||null}catch{return null}}async function un(){let e=await cn();if(e)return`site=${encodeURIComponent(e)}`;let t=await ct();return t?`host=${encodeURIComponent(t)}`:""}async function y(e){if(typeof window<"u"){let t=W();return t?H(e,`site=${encodeURIComponent(t)}`):e}return H(e,await un())}function H(e,t){return t?`${e}${e.includes("?")?"&":"?"}${t}`:e}var dn="preview";async function pn(){if(typeof window<"u")return null;try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(me)}catch{return null}}async function mn(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get("user-agent")}catch{return null}}async function ee(e,t){let n=await pn();if(n===null)return[await y(e),await d(t)];let r=H(await y(e),`${dn}=${encodeURIComponent(n)}`),{next:o,cache:l,...p}=t??{},i=await d({...p,cache:"no-store"}),s=await mn();return s&&(i.headers={...i.headers,"user-agent":s}),[r,i]}async function gn(e){if(!at)return;let[t,n]=await Promise.all([ct(),ln()]),r=ce(t,n,e);return Object.keys(r).length>0?r:void 0}async function d(e){let t=await gn(ue(e)),n={baseUrl:en,...e};return t&&(n.headers={...t,...e?.headers}),n}var E=typeof window>"u";function U(e,t){let n=new URLSearchParams;for(let[o,l]of Object.entries(t))l!==void 0&&l!==""&&n.set(o,String(l));let r=n.toString();return`/api/v1/fitment${e}${r?`?${r}`:""}`}var Or={listMakes:async e=>{if(E){let{fitmentData:n}=await import("./fitment-data-Z3FDYFU6.js");return n.makes(e)}let t=await c(U("/makes",{region:e}),T());return f(t)},listModels:async(e,t)=>{if(E){let{fitmentData:r}=await import("./fitment-data-Z3FDYFU6.js");return r.models(e,t)}let n=await c(U("/models",{make:e,region:t}),T());return f(n)},listYears:async(e,t,n)=>{if(E){let{fitmentData:o}=await import("./fitment-data-Z3FDYFU6.js");return o.years(e,t,n)}let r=await c(U("/years",{make:e,model:t,region:n}),T());return f(r)},listModifications:async(e,t,n,r)=>{if(E){let{fitmentData:l}=await import("./fitment-data-Z3FDYFU6.js");return l.modifications(e,t,n,r)}let o=await c(U("/modifications",{make:e,model:t,year:n,region:r}),T());return f(o)},getStockFitment:async(e,t,n,r,o)=>{if(E){let{fitmentData:l}=await import("./fitment-data-Z3FDYFU6.js");return l.stockFitment(e,t,n,r,o)}return c(U("/stock-fitment",{make:e,model:t,year:n,modification:r,region:o}),T())}},Er={listWheels:async(e,t={})=>{let n=await z("products.listWheels",async r=>await y(nn(e,r)),t.throwOnFailure?()=>!0:void 0,t.maxRows===void 0?void 0:r=>x([...r]).length>=t.maxRows);return x(b(n))},listWheelsBySlug:async(e,t={})=>{let n=[...new Set(e.map(i=>i.trim()).filter(Boolean))];if(n.length===0)return[];let r=[];for(let i=0;i<n.length;i+=Qe)r.push(n.slice(i,i+Qe));let o=await Promise.all(r.map(i=>z("products.listWheelsBySlug",async s=>await y(rn(i,s)),t.throwOnFailure?()=>!0:Xe))),l=new Set(n),p=o.flat().filter(i=>l.has(i.slug));return x(b(p))},listCatalog:async(e,t,n={})=>{if(e.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` \u2014 so the call would silently return the wheel catalog instead of nothing.");let r=await z("products.listCatalog",async o=>await y(sn(e,t,o)),n.throwOnFailure?()=>!0:Xe,n.maxRows===void 0?void 0:o=>ze([...o]).length>=n.maxRows);return ze(b(r))},getWheel:async e=>C(b(await c(await y(u(`/wheels/${e}`)),await d()))),getTyre:async e=>b(await c(await y(u(`/tyres/${e}`)),await d())),listBundles:async(e={})=>{try{return await c(await y(u("/bundles")),await d())}catch(t){if(e.throwOnFailure)throw t;return[]}},getBundle:async e=>c(await y(u(`/bundles/${e}`)),await d()),listGalleryBuilds:async(e={})=>{let{process:t=null,wheelSlug:n=null}=e;if(typeof window>"u"){let{listGalleryBuilds:r}=await import("./gallery-builds-data-TD3QJK7L.js");return b(r(t,n))}try{let r=new URLSearchParams;t&&r.set("process",t),n&&r.set("wheelSlug",n);let o=r.toString(),l=await c(`/api/v1/gallery-builds${o?`?${o}`:""}`,T());return b(f(l))}catch(r){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",r),[]}},getSite:async()=>c(await y(u("/site")),await d()),getSiteBySlug:async e=>c(`${u("/site")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await d():void 0),listPages:async()=>b(await c(await y(u("/pages")),await d())),listPopups:async()=>c(await y(u("/popups")),await d()),listProductTemplates:async()=>{try{return await c(await y(u("/product-templates")),await d())}catch(e){return console.warn("[products.listProductTemplates] unavailable, returning []",e),[]}},listDynamicPages:async e=>{let t=e?`?recordType=${encodeURIComponent(e)}`:"";try{return await c(await y(`${u("/dynamic-pages")}${t}`),await d())}catch(n){if(n instanceof S&&n.status===404)return[];throw n}},getRecord:async(e,t)=>{try{return await c(await y(u(`/records/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)),await d())}catch(n){if(n instanceof S&&n.status===404)return null;throw n}},listRecordKeys:async e=>{try{let t=await c(await y(u(`/records/${encodeURIComponent(e)}`)),await d({cache:"no-store"}));return Array.isArray(t?.keys)?t.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(t){if(t instanceof S&&t.status===404)return[];throw t}},listProductTypeChoices:async()=>{try{return await c(await y(u("/product-type-choices")),await d())}catch(e){return console.warn("[products.listProductTypeChoices] unavailable, returning []",e),[]}},listFieldUsage:async()=>{try{return await c(await y(u("/field-usage")),await d())}catch(e){return console.warn("[products.listFieldUsage] unavailable, returning []",e),[]}},getPage:async(e,t={})=>{let n=t.record?`?record=${encodeURIComponent(t.record)}`:"",[r,o]=await ee(u(`/pages/${e}`)+n,t.revalidate!==void 0?{next:{revalidate:t.revalidate}}:void 0);return b(await c(r,o))},listBlogPosts:async(e={},{throwOnFailure:t=!1}={})=>{let n=e.category?`?category=${encodeURIComponent(e.category)}`:"";try{return(await c(u("/blog-posts")+n,await d())).map(o=>({...o,coverImage:D(o.coverImage)??""}))}catch(r){if(t)throw r;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",r),[]}},getBlogPost:async e=>{let t=await c(u(`/blog-posts/${e}`),await d());return{...t,coverImage:D(t.coverImage)??""}},createOrder:async e=>c(u("/orders"),await d({method:"POST",body:JSON.stringify(e)})),createOrderAuthed:async e=>h(u("/orders"),await d({method:"POST",body:JSON.stringify(e)})),lookupOrder:async e=>c(u("/orders/lookup"),await d({method:"POST",body:JSON.stringify(e)})),createPaymentIntent:async e=>c(u("/payments/intent"),await d({method:"POST",body:JSON.stringify(e)})),releaseCheckout:async e=>c(u("/checkouts/release"),await d({method:"POST",body:JSON.stringify(e)})),createPaypalOrder:async e=>c(u("/payments/paypal/order"),await d({method:"POST",body:JSON.stringify(e)})),capturePaypalOrder:async e=>c(u("/payments/paypal/capture"),await d({method:"POST",body:JSON.stringify(e)})),createAfterpayCheckout:async e=>c(u("/payments/afterpay/checkout"),await d({method:"POST",body:JSON.stringify(e)})),captureAfterpayPayment:async e=>c(u("/payments/afterpay/capture"),await d({method:"POST",body:JSON.stringify(e)})),chargeSquare:async e=>c(u("/payments/square/charge"),await d({method:"POST",body:JSON.stringify(e)})),createGocardlessBillingRequest:async e=>c(u("/payments/gocardless/billing-request"),await d({method:"POST",body:JSON.stringify(e)})),completeGocardlessPayment:async e=>c(u("/payments/gocardless/complete"),await d({method:"POST",body:JSON.stringify(e)})),createZipCheckout:async e=>c(u("/payments/zip/checkout"),await d({method:"POST",body:JSON.stringify(e)})),captureZipPayment:async e=>c(u("/payments/zip/capture"),await d({method:"POST",body:JSON.stringify(e)})),createKlarnaCheckout:async e=>c(u("/payments/klarna/checkout"),await d({method:"POST",body:JSON.stringify(e)})),captureKlarnaPayment:async e=>c(u("/payments/klarna/capture"),await d({method:"POST",body:JSON.stringify(e)})),createStockAlert:async e=>c(u("/stock-alerts"),await d({method:"POST",body:JSON.stringify(e)})),createPreOrderIntent:async e=>c(u("/pre-order-intents"),await d({method:"POST",body:JSON.stringify(e)})),createNewsletterSubscription:async e=>c(u("/newsletter-subscriptions"),await d({method:"POST",body:JSON.stringify(e)})),unsubscribeNewsletter:async e=>c(u("/newsletter-unsubscribe"),await d({method:"POST",body:JSON.stringify(e)})),captureCart:async e=>c(u("/carts"),await d({method:"POST",body:JSON.stringify(e)})),restoreCart:async e=>c(u("/carts/restore"),await d({method:"POST",body:JSON.stringify(e)})),unsubscribeCartReminders:async e=>c(u("/carts/unsubscribe"),await d({method:"POST",body:JSON.stringify(e)})),listReviews:async(e={})=>{let t=new URLSearchParams;e.limit&&t.set("limit",String(e.limit)),e.designCode&&t.set("designCode",e.designCode);let n=u("/reviews"),r=t.toString();try{return await c(await y(r?`${n}?${r}`:n),await d())}catch(o){return console.warn("[products.listReviews] product API unavailable, returning []",o),[]}},submitReview:async e=>c(u("/reviews"),await d({method:"POST",body:JSON.stringify(e)})),getForm:async e=>c(u(`/forms/${encodeURIComponent(e)}`),await d()),submitForm:async(e,t)=>c(u(`/forms/${encodeURIComponent(e)}/submissions`),await d({method:"POST",body:JSON.stringify(t)})),listShippingMethods:async()=>{try{return await c(u("/shipping-methods"),await d())}catch(e){return console.warn("[products.listShippingMethods] product API unavailable, returning []",e),[]}},listCountrySubdivisions:async e=>{try{return await c(u(`/countries/${encodeURIComponent(e)}/subdivisions`),await d())}catch(t){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",t),[]}},quoteCart:async e=>{let t=u("/cart/quote"),n=await d({method:"POST",body:JSON.stringify(e)});return e.couponCode?(await Ye(t,n)).data:c(t,n)},validateCoupon:async e=>{let{data:t,asShopper:n}=await Ye(u("/coupons/validate"),await d({method:"POST",body:JSON.stringify(e)}));return{...t,askedAsShopper:n}},getHeaderSettings:async()=>{let e=nt({method:"GET"}),t=await c(...await ee(u("/header-settings"),{signal:e})),n=D(t.logoUrl),r=null,o=null;if(n&&Y(n)){let l=await Te(n,e);l&&(r=l.reversed,o=l.inkIsDark)}return{...t,logoUrl:n,logoReversed:r,logoInkIsDark:o}},getThemeSettings:async()=>c(...await ee(u("/theme-settings"))),getChatSettings:async()=>c(await y(u("/chat-settings")),await d())},Ur={listServices:async()=>{try{return await c(u("/bookings/services"),await d())}catch(e){return console.warn("[bookings.listServices] API unavailable, returning []",e),{results:[],currency:"USD"}}},getAvailability:async(e,t)=>c(u(`/bookings/availability?service=${encodeURIComponent(e)}&date=${t}`),await d()),create:async e=>c(u("/bookings"),await d({method:"POST",body:JSON.stringify(e)})),get:async e=>c(u(`/bookings/manage/${encodeURIComponent(e)}`),await d()),cancel:async e=>c(u(`/bookings/manage/${encodeURIComponent(e)}/cancel`),await d({method:"POST"})),createPaymentIntent:async e=>c(u("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:e})}))},ne=class extends Error{constructor(n,r){super(`Slug "${n}" exists on ${r} websites; a site is required to pick one.`);this.slug=n;this.count=r;this.name="AmbiguousPageSlugError"}},B=(e,t,n)=>{let r=new URLSearchParams({...t?{site:t}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${e}/${r?`?${r}`:""}`},G=e=>`/api/storefront/sites/${encodeURIComponent(e)}/`,yn=e=>`${G(e)}currencies/`,hn="/api/storefront/media/ingest/",re=class extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}};function fn(){let e=_e();if(!e)throw new re;return`${hn}?${new URLSearchParams({site:e})}`}var Sn="X-Puck-Media-Manifest",et=ae.contentHash,$={"X-Media-Manifest":et,[Sn]:et},Nr=ut({});function ut(e){return(t,n={})=>{let r=Yt(),o=e.headers||r?{...r?{"Accept-Language":r}:{},...e.headers,...n.headers}:void 0;return c(t,{...n,...e.baseUrl!==void 0?{baseUrl:e.baseUrl}:{},...o?{headers:o}:{},audience:e.audience??Jt()})}}function Pn(e={}){let t=ut(e),n=e.siteDrafts===!0,r=i=>B("header-settings",i,n),o=i=>B("theme-settings",i,n),l=i=>B("chat-settings",i,n),p=i=>B("social-settings",i,n);return{findPageBySlug:async(i,s,a)=>{let m=new URLSearchParams({slug:i});a&&m.set("site",a);let g=await t(`/api/storefront/pages/?${m.toString()}`,{token:s}),w=f(g);if(!a&&w.length>1)throw new ne(i,w.length);return w[0]??null},getPageById:(i,s)=>t(`/api/storefront/pages/${i}/`,{token:s}),saveLayout:(i,s,a,m,g)=>t(`/api/storefront/pages/${i}/`,{method:"PATCH",body:JSON.stringify({layout:s,expected_updated_at:m,...g?{client_id:g}:{}}),token:a}),duplicatePage:(i,s,a)=>t(`/api/storefront/pages/${i}/duplicate/`,{method:"POST",body:JSON.stringify({title:s.title,slug:s.slug}),token:a}),geocode:(i,s,a)=>t(`/api/storefront/geocode/?${new URLSearchParams(a?{q:i,country:a}:{q:i})}`,{token:s}),listBlockSources:i=>t("/api/storefront/block-sources/",{token:i}),listRecordTypes:i=>t("/api/storefront/record-types/",{token:i}),createPagePreviewLink:(i,s)=>t(`/api/storefront/pages/${i}/preview-link/`,{method:"POST",token:s}),claimPageEditLock:(i,s,a,m=!1)=>t(`/api/storefront/pages/${i}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:a,takeover:m}),token:s}),releasePageEditLock:(i,s)=>t(`/api/storefront/pages/${i}/edit-lock/`,{method:"DELETE",token:s}),createTemplate:(i,s,a)=>t("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:i,layout:s}),headers:$,token:a}),getTemplate:(i,s)=>t(`/api/storefront/page-templates/${i}/`,{token:s}),saveTemplateLayout:(i,s,a)=>t(`/api/storefront/page-templates/${i}/`,{method:"PATCH",body:JSON.stringify({layout:s}),headers:$,token:a}),listTemplatePages:async(i,s)=>{let a=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(i)}`,{token:s});return f(a)},findTemplatePageBySlug:async(i,s,a)=>{let m=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(i)}&slug=${encodeURIComponent(s)}`,{token:a});return f(m)[0]??null},createTemplatePage:(i,s,a)=>t("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:i,...s}),headers:$,token:a}),saveTemplatePageLayout:(i,s,a)=>t(`/api/storefront/template-pages/${i}/`,{method:"PATCH",body:JSON.stringify({layout:s}),headers:$,token:a}),deleteTemplatePage:(i,s,a)=>t(`/api/storefront/template-pages/${i}/`,{method:"DELETE",token:s,...a?.keepalive?{keepalive:!0}:{}}),listPages:async(i,s)=>{let a=new URLSearchParams({no_page:"true"});s&&a.set("site",s);let m=await t(`/api/storefront/pages/?${a.toString()}`,{token:i});return f(m)},createPage:(i,s,a,m)=>t("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:i,slug:s,layout:a}),token:m}),deletePage:(i,s)=>t(`/api/storefront/pages/${i}/`,{method:"DELETE",token:s}),getHeaderSettings:(i,s)=>t(r(s),{token:i}),listMenus:async(i,s)=>{let a=new URLSearchParams({no_page:"true"});s&&a.set("site",s);let m=await t(`/api/storefront/menus/?${a}`,{token:i});return f(m)},listBlogPosts:async(i,s={})=>{let a=new URLSearchParams({no_page:"true"});s.visibleOnly&&a.set("is_visible","true"),s.siteId&&a.set("site",s.siteId);let m=await t(`/api/storefront/blog-posts/?${a.toString()}`,{token:i});return f(m)},listFieldUsage:async(i,s)=>{let a=await t(`/api/storefront/field-usage/?site=${encodeURIComponent(s)}`,{token:i});return Array.isArray(a?.entries)?a.entries:[]},listCategories:async(i,s={})=>{let a=new URLSearchParams({no_page:"true"});s.visibleOnly&&a.set("is_visible","true"),s.siteId&&a.set("site",s.siteId);let m=await t(`/api/storefront/categories/?${a.toString()}`,{token:i});return[...f(m)].sort((w,N)=>w.sort_order-N.sort_order||w.name.localeCompare(N.name))},listForms:async(i,s={})=>{let a=new URLSearchParams({no_page:"true"});s.siteId&&a.set("site",s.siteId);let m=await t(`/api/storefront/forms/?${a.toString()}`,{token:i});return[...f(m)].sort((w,N)=>w.title.localeCompare(N.title))},listWheelSummaries:async(i,s={})=>{let a=new URLSearchParams;s.siteId&&a.set("site",s.siteId);let m=a.toString(),g=await t(`/api/storefront/wheel-curations/summaries/${m?`?${m}`:""}`,{token:i});return b(g)},listProducts:async(i,s={})=>{let a=new URLSearchParams;s.kinds?.length&&a.set("kind",s.kinds.join(",")),s.siteId&&a.set("site",s.siteId);let m=a.toString(),g=await t(`/api/storefront/products/${m?`?${m}`:""}`,{token:i});return b(g)},getWheelDetail:async(i,s,a={})=>{let m=new URLSearchParams({slug:s});return a.siteId&&m.set("site",a.siteId),C(b(await t(`/api/storefront/wheel-curations/detail/?${m.toString()}`,{token:i})))},updateHeaderSettings:(i,s,a)=>t(r(a),{method:"PATCH",body:JSON.stringify(i),token:s}),getSite:(i,s)=>t(G(i),{token:s}),listSites:async i=>{let s=await t("/api/storefront/sites/?no_page=true",{token:i});return f(s)},listSiteCurrencies:async(i,s)=>{let a=await t(yn(i),{token:s});return Array.isArray(a)?a:[]},publishSite:(i,s)=>t(`${G(i)}publish/`,{method:"POST",token:s}),getSiteLiveState:(i,s)=>t(`${G(i)}live-state/`,{token:s}),getThemeSettings:(i,s)=>t(o(s),{token:i}),updateThemeSettings:(i,s,a)=>t(o(a),{method:"PATCH",body:JSON.stringify(i),token:s}),getMyPreferences:async i=>(await t("/api/auth/me/",{token:i})).preferences??{},updateMyPreferences:(i,s)=>t("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:i}),token:s}),getChatSettings:(i,s)=>t(l(s),{token:i}),updateChatSettings:(i,s,a)=>t(l(a),{method:"PATCH",body:JSON.stringify(i),token:s}),getSocialSettings:(i,s)=>t(p(s),{token:i}),updateSocialSettings:(i,s,a)=>t(p(a),{method:"PATCH",body:JSON.stringify(i),token:s}),uploadHeaderLogo:(i,s,a)=>{let m=new FormData;return m.append("logo",i),t(r(a),{method:"PATCH",body:m,token:s})},clearHeaderLogo:(i,s)=>t(r(s),{method:"PATCH",body:JSON.stringify({logo:null}),token:i}),setHeaderLogoFromAsset:(i,s,a)=>t(r(a),{method:"PATCH",body:JSON.stringify({logo_asset_id:i}),token:s}),uploadMedia:async(i,s)=>{let a=new FormData;return a.append("file",i),t(fn(),{method:"POST",body:a,token:s})},listMedia:async(i,s)=>{let a=new URLSearchParams({no_page:"true"});s&&a.set("kind",s);let m=await t(`/api/storefront/media-assets/?${a.toString()}`,{token:i});return f(m)}}}var Dr=Pn({siteDrafts:!0});function bn(e){let t=e.trim();return t?`/api/v1/dealers?${new URLSearchParams({near:t}).toString()}`:"/api/v1/dealers"}async function Lr(e){return xe(await c(bn(e)))}var _={audience:null,baseUrl:""};async function Mr(e,t){return Ie(await c(De(e,t),_))}async function Ir(e){return ve(await c(Le,{..._,method:"POST",body:JSON.stringify(e)}))}async function vr(e){try{let t=await c($e,{..._,method:"POST",body:JSON.stringify({token:e})});return Q(202,t)}catch(t){if(t instanceof S)return Q(t.status,t.data);throw t}}async function Fr(e,t){await c(Me,{..._,method:"POST",body:JSON.stringify({email:t.trim(),...e?{product:e}:{}})})}async function Br(e,t){await c(Ge,{..._,method:"POST",body:JSON.stringify({email:t.trim(),...e?{product:e}:{}})})}async function $r(e){try{return We(await c(He,{..._,method:"POST",body:JSON.stringify({token:e})}))}catch(t){if(t instanceof S)return"";throw t}}export{q as a,f as b,ce as c,ue as d,A as e,mt as f,Y as g,_e as h,Ce as i,Mn as j,In as k,vn as l,Fn as m,$n as n,Wn as o,qn as p,P as q,Ue as r,Ne as s,Kn as t,Jn as u,Vn as v,Yn as w,Zn as x,jn as y,Qn as z,Xn as A,zn as B,er as C,tr as D,nr as E,rr as F,ir as G,sr as H,or as I,ar as J,v as K,lr as L,cr as M,ur as N,Bt as O,S as P,te as Q,X as R,wr as S,Ar as T,c as U,zt as V,ct as W,an as X,ln as Y,cn as Z,pn as _,Or as $,Er as aa,Ur as ba,ne as ca,Nr as da,Dr as ea,Lr as fa,Mr as ga,Ir as ha,vr as ia,Fr as ja,Br as ka,$r as la};
|
|
1
|
+
import{b as W,c as se,f as oe,h as D,m as ae,o as L}from"./chunk-GB6OHYUY.js";var q="".replace(/\/+$/,"");var K="x-forwarded-for";function le(e){let t=(e??"").split(",").map(n=>n.trim()).filter(Boolean);return t.length>0?t[t.length-1]:null}var dt="x-forwarded-host";function ce(e,t,n){let r={};return e&&(r[dt]=e),t&&n==="uncached"&&(r[K]=t),r}function ue(e){if(e?.cache==="no-store"||e?.cache==="no-cache")return"uncached";if(e?.cache==="force-cache")return"data-cached";let t=e?.next?.revalidate;return typeof t=="number"&&t>0?"data-cached":"uncached"}var de="x-storefront-site",pe="x-storefront-host",me="x-storefront-preview";function f(e){return Array.isArray(e)?e:e?.results??[]}var pt="shop_access_token",ge="shop_refresh_token",J=null;function V(){L.removeItem(pt),L.removeItem(ge)}var A={getAccess(){return J},takeLegacyRefresh(){let e=L.getItem(ge);return V(),e},setTokens(e){J=e,V()},clear(){J=null,V()}};import{efficientClientOpen as Ft}from"efficient-easel/screen/lib/session";function mt(e){return!!e.src}function C(e){let t=e.finishes.filter(mt);if(t.length===e.finishes.length)return e;let n=e.defaultFinish&&t.some(r=>r.name===e.defaultFinish)?e.defaultFinish:null;return{...e,finishes:t,defaultFinish:n}}function gt(e){return e.listable!==!1}function x(e){return e.map(C).filter(gt)}var Se=["fill","stroke","stop-color","color","flood-color","lighting-color","solid-color"],Pe=new Set(["none","transparent","currentcolor","inherit","initial","unset","context-fill","context-stroke"]),M={black:[0,0,0],white:[255,255,255],gray:[128,128,128],grey:[128,128,128],darkgray:[169,169,169],darkgrey:[169,169,169],dimgray:[105,105,105],dimgrey:[105,105,105],lightgray:[211,211,211],lightgrey:[211,211,211],gainsboro:[220,220,220],silver:[192,192,192],whitesmoke:[245,245,245]},be=12,we=/\burl\(/i,Ae=new RegExp(`(?<![-\\w])(${Se.join("|")})(\\s*=\\s*)(["'])([^"']*)\\3`,"gi"),Re=new RegExp(`((?:^|[;{\\s"'])(?:${Se.join("|")})\\s*:\\s*)([^;}"'<>]+)`,"gi"),yt=/<svg\b([^>]*)>/i,ht=/\bfill\s*[=:]/i;function ft(e){let t=e.replace(Ae,(n,r,o,l,p)=>{let i=ye(p);return i===null?n:`${r}${o}${l}${i}${l}`}).replace(Re,(n,r,o)=>{let l=ye(o);return l===null?n:`${r}${l}`});return t=t.replace(yt,(n,r)=>ht.test(r)?n:`<svg fill="#ffffff"${r}>`),t}function ye(e){let t=/!important/i.test(e),n=e.replace(/!important/gi,"").trim().toLowerCase();if(!n||we.test(n)||Pe.has(n))return null;let r=n in M?[...M[n],1]:ke(n);if(!r)return null;let[o,l,p,i]=r;if(Math.max(o,l,p)-Math.min(o,l,p)>be)return null;let s=St(255-o,255-l,255-p,i);return t?`${s} !important`:s}function St(e,t,n,r){if(r<1)return`rgba(${e}, ${t}, ${n}, ${r})`;let o=l=>l.toString(16).padStart(2,"0");return`#${o(e)}${o(t)}${o(n)}`}function ke(e){return e.startsWith("#")?Pt(e):e.startsWith("rgb")?bt(e):e.startsWith("hsl")?At(e):null}function Pt(e){let t=e.slice(1),n=1;if(t.length===3||t.length===4)t.length===4&&(n=parseInt(t[3]+t[3],16)/255),t=t.slice(0,3).split("").map(r=>r+r).join("");else if(t.length===6||t.length===8)t.length===8&&(n=parseInt(t.slice(6,8),16)/255),t=t.slice(0,6);else return null;return/^[0-9a-f]{6}$/.test(t)?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),n]:null}function bt(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),o=n.split(/[\s,]+/).filter(Boolean).slice(0,3);if(o.length<3)return null;let l=o.map(i=>i.endsWith("%")?Math.round(parseFloat(i)/100*255):Math.round(parseFloat(i)));if(l.some(i=>Number.isNaN(i)))return null;let p=r?I(r):wt(n);return[l[0],l[1],l[2],p]}function wt(e){let t=e.split(/[\s,]+/).filter(Boolean);return t.length>=4?I(t[3]):1}function I(e){let t=e.trim().endsWith("%")?parseFloat(e)/100:parseFloat(e);return Number.isNaN(t)?1:t}function At(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[n,r]=t.split("/"),o=n.split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let l=parseFloat(o[0]),p=parseFloat(o[1])/100,i=parseFloat(o[2])/100;if([l,p,i].some(w=>Number.isNaN(w)))return null;let s=r?I(r):o.length>=4?I(o[3]):1,[a,m,g]=Rt(l,p,i);return[a,m,g,s]}function Rt(e,t,n){let r=(1-Math.abs(2*n-1))*t,o=(e%360+360)%360/60,l=r*(1-Math.abs(o%2-1)),p=0,i=0,s=0;o<1?[p,i,s]=[r,l,0]:o<2?[p,i,s]=[l,r,0]:o<3?[p,i,s]=[0,r,l]:o<4?[p,i,s]=[0,l,r]:o<5?[p,i,s]=[l,0,r]:[p,i,s]=[r,0,l];let a=n-r/2;return[Math.round((p+a)*255),Math.round((i+a)*255),Math.round((s+a)*255)]}var he=512*1024;function Y(e){return/\.svg(\?|$)/i.test(e)}function kt(e){return`data:image/svg+xml,${encodeURIComponent(ft(e))}`}function Tt(e){let t=e.replace(/!important/gi,"").trim().toLowerCase();if(!t||we.test(t)||Pe.has(t))return null;let n=t in M?[...M[t],1]:ke(t);if(!n)return null;let[r,o,l]=n;return Math.max(r,o,l)-Math.min(r,o,l)>be?null:(.2126*r+.7152*o+.0722*l)/255}function _t(e){let t=[],n=r=>{let o=Tt(r);o!==null&&t.push(o)};for(let r of e.matchAll(Ae))n(r[4]);for(let r of e.matchAll(Re))n(r[2]);return t.length?t.reduce((r,o)=>r+o,0)/t.length<.5:null}var fe=/^(?:\uFEFF|\s+|<\?xml[^>]*\?>|<!--[\s\S]*?-->|<!DOCTYPE\s+svg[^>[]*>)/i;function Ct(e){let t=e;for(let n=fe.exec(t);n&&n[0].length>0;n=fe.exec(t))t=t.slice(n[0].length);return/^<svg[\s>/]/i.test(t)}async function xt(e,t){if(!Y(e))return null;try{let n=await fetch(e,{signal:t,redirect:"manual"});if(!n.ok)return null;let r=Number(n.headers.get("content-length"));if(Number.isFinite(r)&&r>he)return null;let o=await n.text();return o.length>he?null:Ct(o)?o:null}catch{return null}}async function Te(e,t){let n=await xt(e,t);return n===null?null:{reversed:kt(n),inkIsDark:_t(n)}}import{currentEaselSession as Ot,setSessionBridgedSite as Nn,setSessionDocumentSite as Dn}from"efficient-easel/screen/lib/session";function _e(){return Ot().siteId()}var Ce={title:"Find a dealer",placeholder:"Postcode or suburb",search:"Search",searching:"Searching\u2026",none:"No dealers to show yet.",notFound:"We couldn't find that place. Check the postcode or suburb and search again.",tryAgain:"We couldn't look up that place just now. Please try again.",website:"Website",map:"Dealers on the map"},k=e=>typeof e=="string"?e:"",Z=e=>typeof e=="number"&&Number.isFinite(e)?e:null,Et=["found","not_found","try_again"];function Ut(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.name!="string"||!t.name?null:{id:k(t.id)||t.name,name:t.name,address:k(t.address),city:k(t.city),state:k(t.state),postcode:k(t.postcode),country:k(t.country),phone:k(t.phone),website:k(t.website),lat:Z(t.lat),lng:Z(t.lng),distanceKm:Z(t.distanceKm)}}function xe(e){if(!e||typeof e!="object")return{near:null,dealers:[]};let t=e,n=typeof t.near=="string"&&Et.includes(t.near)?t.near:null,r=Array.isArray(t.dealers)?t.dealers:[];return{near:n,dealers:r.map(Ut).filter(o=>o!==null)}}function Mn(e){return e==="not_found"?Ce.notFound:e==="try_again"?Ce.tryAgain:null}function In(e){return e===null?null:e<10?`${e.toFixed(1)} km`:`${Math.round(e)} km`}function vn(e){return[e.city,e.state,e.postcode].filter(Boolean).join(" ")}function Fn(e){let t=e.map((a,m)=>({dealer:a,index:m})).filter(({dealer:a})=>a.lat!==null&&a.lng!==null);if(!t.length)return[];let n=t.map(({dealer:a})=>a.lat),r=t.map(({dealer:a})=>a.lng),[o,l]=[Math.min(...n),Math.max(...n)],[p,i]=[Math.min(...r),Math.max(...r)],s=(a,m,g)=>g===m?50:8+(a-m)/(g-m)*84;return t.map(({dealer:a,index:m})=>({id:a.id,index:m,left:s(a.lng,p,i),top:100-s(a.lat,o,l)}))}var Oe=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"],Ee=["AED","AFN","ALL","AMD","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG"],$n={AD:"EUR",AE:"AED",AF:"AFN",AL:"ALL",AM:"AMD",AO:"AOA",AR:"ARS",AT:"EUR",AU:"AUD",AW:"AWG",AZ:"AZN",BA:"BAM",BB:"BBD",BD:"BDT",BE:"EUR",BH:"BHD",BI:"BIF",BM:"BMD",BN:"BND",BO:"BOB",BR:"BRL",BS:"BSD",BT:"BTN",BW:"BWP",BY:"BYN",BZ:"BZD",CA:"CAD",CD:"CDF",CH:"CHE",CL:"CLF",CN:"CNY",CO:"COP",CR:"CRC",CU:"CUP",CV:"CVE",CY:"EUR",CZ:"CZK",DE:"EUR",DJ:"DJF",DK:"DKK",DO:"DOP",DZ:"DZD",EE:"EUR",EG:"EGP",ER:"ERN",ES:"EUR",ET:"ETB",FI:"EUR",FJ:"FJD",FK:"FKP",FR:"EUR",GB:"GBP",GE:"GEL",GH:"GHS",GI:"GIP",GM:"GMD",GN:"GNF",GR:"EUR",GT:"GTQ",GY:"GYD",HK:"HKD",HN:"HNL",HR:"EUR",HT:"HTG",HU:"HUF",ID:"IDR",IE:"EUR",IL:"ILS",IN:"INR",IQ:"IQD",IR:"IRR",IS:"ISK",IT:"EUR",JM:"JMD",JO:"JOD",JP:"JPY",KE:"KES",KG:"KGS",KH:"KHR",KM:"KMF",KP:"KPW",KR:"KRW",KW:"KWD",KY:"KYD",KZ:"KZT",LA:"LAK",LB:"LBP",LK:"LKR",LR:"LRD",LS:"LSL",LT:"EUR",LU:"EUR",LV:"EUR",LY:"LYD",MA:"MAD",MC:"EUR",MD:"MDL",ME:"EUR",MG:"MGA",MK:"MKD",MM:"MMK",MN:"MNT",MO:"MOP",MR:"MRU",MT:"EUR",MU:"MUR",MV:"MVR",MW:"MWK",MX:"MXN",MY:"MYR",MZ:"MZN",NA:"NAD",NG:"NGN",NI:"NIO",NL:"EUR",NO:"NOK",NP:"NPR",NZ:"NZD",OM:"OMR",PA:"PAB",PE:"PEN",PG:"PGK",PH:"PHP",PK:"PKR",PL:"PLN",PT:"EUR",PY:"PYG",QA:"QAR",RO:"RON",RS:"RSD",RU:"RUB",RW:"RWF",SA:"SAR",SB:"SBD",SC:"SCR",SD:"SDG",SE:"SEK",SG:"SGD",SH:"SHP",SI:"EUR",SK:"EUR",SL:"SLE",SM:"EUR",SO:"SOS",SR:"SRD",SS:"SSP",ST:"STN",SV:"SVC",SY:"SYP",SZ:"SZL",TH:"THB",TJ:"TJS",TM:"TMT",TN:"TND",TO:"TOP",TR:"TRY",TT:"TTD",TW:"TWD",TZ:"TZS",UA:"UAH",UG:"UGX",US:"USD",UY:"UYI",UZ:"UZS",VA:"EUR",VE:"VED",VN:"VND",VU:"VUV",WS:"WST",YE:"YER",ZA:"ZAR",ZM:"ZMW",ZW:"ZWG"};var Wn={firstName:"",lastName:"",email:"",company:"",slug:"",country:"",currency:""},Nt=["slug_malformed","slug_reserved","slug_taken"],j=e=>typeof e=="string"&&Nt.includes(e),qn=400,P={title:"Create your {name} workspace",freeLine:"Free to start. No card needed.",firstName:"First name",lastName:"Last name",email:"Work email",company:"Company name",address:"Workspace address",country:"Country",currency:"Currency",countryHint:"Your shop sells in this currency. The country sets its tax and shipping defaults. Both can be changed later.",checking:"Checking",available:"Available",submit:"Create workspace",sending:"Sending\u2026",agree:"By creating a workspace you agree to the {terms} and {privacy}.",terms:"Terms",privacy:"Privacy Policy",haveOne:"Already have a workspace?",find:"Find my workspace",required:"Fill this in.",companyShort:"Use at least 2 characters.",emailWrong:"Enter an email address, like name@company.com.",notOffered:"That choice is not offered. Pick another.",wrong:"Check this and try again.",slugProblem:{slug_malformed:"Use 3 to 30 lower-case letters, digits or single hyphens, starting with a letter.",slug_reserved:"That address is kept for the platform. Choose another.",slug_taken:"That address is taken. Choose another."},trouble:{closed:"Signing up is closed just now.",dailyLimit:"Too many workspaces signed up today. Try again tomorrow.",unavailable:"Signing up is not available just now. Try again later.",tooMany:"You have asked a few times in a row. Wait a minute, then try again.",unreachable:"We couldn't reach the server. Check your connection and try again.",failed:"Something went wrong and nothing was sent. Try again."},closedTitle:"Signing up is closed just now",closedBody:"New {name} workspaces cannot be made just now.",closedLeave:"Leave your email and we'll tell you when it opens.",tellMe:"Tell me when it opens",waitingDone:"Thanks. We'll email {email} when sign-up opens.",sentTitle:"Check your email",sentBody:"We sent a link to {email}. Open it to set up {company}.",sentUntil:"The link works once, until {when}. Asking again sends a new link, and the old one stops working.",sendAgain:"Send it again",sendingAgain:"Sending\u2026",sentAgain:"A new link is on its way. The old one no longer works.",change:"Change the details"};function Ue(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>t[r]??n)}function Ne(e){return e.trim().toLowerCase().replace(/_/g,"-")}function Kn(e){return e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-").replace(/^[^a-z]+/,"").slice(0,30).replace(/-+$/,"")}function Jn(e,t){let n=(e??"").trim().toLowerCase().replace(/^\.+/,"").replace(/\.+$/,"");if(n)return`.${n}`;let r=t.toLowerCase().replace(/\.$/,"").replace(/^www\./,"");return r?`.${r}`:""}var R=e=>typeof e=="string"?e:"";function De(e,t){let n=new URLSearchParams;t&&n.set("slug",t),e&&n.set("product",e);let r=n.toString();return`/api/business-sign-ups/availability/${r?`?${r}`:""}`}var Le="/api/business-sign-ups/",Me="/api/business-sign-ups/waiting-list/";function Vn(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return n.code==="sign_up_open"?{open:!0,email:null,trouble:null}:n.code==="sign_up_waiting_list_unavailable"?{open:!1,email:null,trouble:"unavailable"}:e===400&&"email"in n?{open:!1,email:P.emailWrong,trouble:null}:e===0?{open:!1,email:null,trouble:"unreachable"}:e===429?{open:!1,email:null,trouble:"tooMany"}:{open:!1,email:null,trouble:"failed"}}function Yn(e){let t=e.trim();return t?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)?null:P.emailWrong:P.required}function Ie(e){let t=e&&typeof e=="object"?e:{};return{open:t.open===!0,country:R(t.country),currency:R(t.currency),slugAvailable:typeof t.slug_available=="boolean"?t.slug_available:null,slugProblem:j(t.slug_problem)?t.slug_problem:null}}function Zn(e){return e.slugAvailable?{state:"available"}:e.slugProblem?{state:"problem",problem:e.slugProblem}:{state:"unknown"}}function ve(e){let t=e&&typeof e=="object"?e:{};return{slug:R(t.slug),expiresAt:R(t.expires_at)}}function jn(e,t,n){return{business_name:e.company.trim(),slug:Ne(e.slug),first_name:e.firstName.trim(),last_name:e.lastName.trim(),email:e.email.trim(),...t?{product:t}:{},...n&&e.country?{country:e.country}:{},...n&&e.currency?{currency:e.currency}:{}}}function Qn(e,t){let n={};e.firstName.trim()||(n.firstName=P.required);let r=e.email.trim();r?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)||(n.email=P.emailWrong):n.email=P.required;let o=e.company.trim();return o?o.length<2&&(n.company=P.companyShort):n.company=P.required,Ne(e.slug)?t.state==="problem"&&(n.slug=P.slugProblem[t.problem]):n.slug=P.required,n}var Dt={business_name:"company",slug:"slug",first_name:"firstName",last_name:"lastName",email:"email",country:"country",currency:"currency"},F={self_sign_up_off:"closed",sign_up_daily_limit:"dailyLimit",sign_up_unavailable:"unavailable",sign_up_plan_missing:"unavailable"};function Xn(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.code;if(j(r))return{fields:{slug:P.slugProblem[r]},trouble:null};if(typeof r=="string"&&F[r])return{fields:{},trouble:F[r]};if(e===0)return{fields:{},trouble:"unreachable"};if(e===429)return{fields:{},trouble:"tooMany"};if(e===400){let o={};for(let l of Object.keys(n)){let p=Dt[l];p&&(o[p]=p==="slug"?P.slugProblem.slug_malformed:p==="email"?P.emailWrong:p==="country"||p==="currency"?P.notOffered:P.wrong)}if(Object.keys(o).length)return{fields:o,trouble:null}}return{fields:{},trouble:"failed"}}function Fe(e,t){try{let n=new Intl.DisplayNames(t?[t]:void 0,{type:e,fallback:"code"});return r=>n.of(r)??r}catch{return n=>n}}var Be=(e,t)=>t&&!e.includes(t)?[...e,t]:[...e],Lt=(e,t)=>{let n=new Intl.Collator(t);return e.sort((r,o)=>n.compare(r.label,o.label))};function zn(e,t){let n=Fe("region",t);return Lt(Be(Oe,e).map(r=>({value:r,label:n(r)})),t)}function er(e,t){let n=Fe("currency",t);return Be(Ee,e).sort().map(r=>{let o=n(r);return{value:r,label:o===r?r:`${r} \xB7 ${o}`}})}function tr(e,t,n){let r=new Date(e);if(!e||Number.isNaN(r.getTime()))return"";let o=i=>new Intl.DateTimeFormat(t,{timeZone:n,...i}).format(r),l=`${o({weekday:"long"})} ${o({day:"numeric"})} ${o({month:"long"})}`,p=o({hour:"numeric",minute:"2-digit",hour12:!0}).replace(/\s?([AP])M$/i,(i,s)=>` ${s.toLowerCase()}m`);return`${l}, ${p}`}var Mt=/^\/sign-up\/verify\/([^/?#]+)\/?$/;function nr(e){let t=Mt.exec(e??"");if(!t)return"";try{return decodeURIComponent(t[1])}catch{return t[1]}}var $e="/api/business-sign-ups/verifications/",It=["pending","provisioning","ready","failed"];function Q(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=R(n.code),o=R(n.slug);if(e===202||r==="sign_up_already_verified"){let l=R(n.provisioning_status),p=R(n.business_name);return It.includes(l)?l==="ready"?{kind:"ready",company:p,slug:o}:l==="failed"?{kind:"failed",company:p,slug:o}:{kind:"building",company:p,slug:o,status:l}:{kind:"gone"}}return j(r)?{kind:"taken",slug:o}:r==="sign_up_daily_limit"?{kind:"dailyLimit"}:r==="self_sign_up_off"?{kind:"closed"}:r&&F[r]?{kind:"trouble",trouble:F[r]}:e===400&&"token"in n?{kind:"gone"}:e===0?{kind:"trouble",trouble:"unreachable"}:e===429?{kind:"trouble",trouble:"tooMany"}:{kind:"trouble",trouble:"failed"}}function rr(e){return e.kind==="building"||e.kind==="trouble"&&e.trouble!=="failed"}function ir(e){return e<5?2e3:e<20?5e3:15e3}var sr=40;function or(e,t,n){let r=e.kind==="failed"?"stopped":"running";return[{words:v.confirmed,at:"done"},{words:Ue(v.reserved,{address:`${e.slug}${n}`}),at:"done"},{words:v.building,at:r},...e.kind==="failed"?[]:[{words:Ue(v.adding,{name:t}),at:"waiting"}]]}var ar=e=>e==="pending"?50:75,v={settingUp:"Setting up {company}",confirmed:"Email confirmed",reserved:"Address reserved: {address}",building:"Building your workspace",adding:"Adding {name}",aboutTen:"This takes about 10 seconds. You can close this page: we'll email you when it's ready.",readyTitle:"Your workspace is ready",workspace:"Workspace",address:"Address",plan:"Plan",planName:"{name} Free",readyNext:"We've emailed you a link to set your password. It's the next step.",failedBody:"We couldn't finish building your workspace. We've been told, and we'll email you when it's ready. You don't need to sign up again.",goneTitle:"This link has run out",goneBody:"This link is not right, or it has run out. Sign up again and we'll send a new one.",again:"Sign up again",takenTitle:"That address has gone",takenBody:"{address} was taken before you opened your link. Choose another address and we'll send a new link.",takenBodyBare:"That address was taken before you opened your link. Choose another address and we'll send a new link.",chooseAnother:"Choose another address",limitTitle:"Not today",limitNext:"Your link still works until it runs out. Open it again tomorrow.",checking:"Checking your link"},Ge="/api/business-sign-ups/workspace-finds/",He="/api/business-sign-ups/workspace-finds/openings/",vt=/^\/find\/([^/?#]+)\/?$/;function lr(e){let t=vt.exec(e??"");if(!t)return"";try{return decodeURIComponent(t[1])}catch{return t[1]}}var cr={title:"Find your workspace",intro:"Enter your work email. We'll send you the address of every workspace you belong to.",submit:"Email me my workspaces",newHere:"New to {name}?",create:"Create a workspace",sentTitle:"Check your email",sentBody:"If {email} belongs to a workspace, the links are on their way.",sentNote:"They work for 30 minutes. Nothing arrives if the address isn't in any workspace.",another:"Use another email",linkGone:"This link is not right, or it has run out. Ask for your workspaces again.",opening:"Opening your workspace"};function ur(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return n.code==="workspace_find_unavailable"?{email:null,trouble:"unavailable"}:e===400&&"email"in n?{email:P.emailWrong,trouble:null}:e===0?{email:null,trouble:"unreachable"}:e===429?{email:null,trouble:"tooMany"}:{email:null,trouble:"failed"}}function We(e){let t=e&&typeof e=="object"?R(e.sign_in_url):"";return/^https?:\/\/[^\s]+$/i.test(t)?t:""}var Bt="",S=class extends Error{constructor(t,n,r){super(n),this.status=t,this.data=r}},te="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",$t=new Set([502,503,504]),X=0,Gt="This editor runs on its host's own backend, which does not serve this request.",Ht=5e3,Wt=15e3,qt=()=>typeof window>"u"?Ht:Wt;function nt(e){let t=(e.method??"GET").toUpperCase();if(!(e.body!=null||t!=="GET"&&t!=="HEAD")&&!(e.audience!=null&&e.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(qt())}var qe=e=>e instanceof Error&&e.name==="TimeoutError",Ke=(e,t)=>$t.has(e)?te:t,Kt=["admin","venue"],rt="admin";function wr(e){rt=Kt.includes(e)?e:"admin"}function Jt(){return rt}var Vt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/,it=null;function Ar(e){it=e&&Vt.test(e)?e:null}function Yt(){return it}function Zt(e){if(typeof window>"u"||!e.startsWith("/api/v1/"))return e;let t=W();return!t||/[?&]site=/.test(e)?e:H(e,`site=${encodeURIComponent(t)}`)}async function c(e,t={}){let{token:n,baseUrl:r,headers:o,audience:l,...p}=t;if(typeof window<"u"&&!Ft())throw new S(X,Gt,null);if(typeof window>"u"&&r===void 0)throw new Error(`apiFetch(${JSON.stringify(e)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);let i=typeof FormData<"u"&&p.body instanceof FormData,s;try{s=await fetch(`${r??Bt}${Zt(e)}`,{...p,headers:{...i?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...o},signal:p.signal??nt({...p,audience:l})})}catch(g){throw g instanceof TypeError||qe(g)?new S(X,te,null):g}let a;try{a=await s.text()}catch(g){throw qe(g)?new S(X,te,null):g}let m=null;if(a)try{m=JSON.parse(a)}catch{throw new S(s.status,s.ok?"Expected JSON but received a non-JSON response":Ke(s.status,s.statusText),a)}if(!s.ok){let g=(m&&typeof m=="object"&&"detail"in m&&typeof m.detail=="string"?m.detail:null)??Ke(s.status,s.statusText);throw new S(s.status,g,m)}return m}var O=null;async function st(){return O||(O=jt().finally(()=>{O=null}),O)}async function jt(){let e=A.takeLegacyRefresh(),t=await zt.refresh(e??void 0);return A.setTokens(t.access),t.access}async function ot(){return A.getAccess()??st()}async function h(e,t={}){let n;try{n=await ot()}catch{throw A.clear(),new S(401,"Not signed in",null)}try{return await c(e,{...t,token:n})}catch(r){if(!(r instanceof S)||r.status!==401)throw r;try{let o=await st();return await c(e,{...t,token:o})}catch{throw A.clear(),r}}}var Qt=100,Je=20;function Xt(e){if(!e)return null;try{return new URL(e,"http://page.invalid").searchParams.get("page")}catch{return null}}async function Ve(e,t){let[n,r=""]=e.split("?"),o=[],l="1";for(let p=0;p<Je&&l;p++){let i=new URLSearchParams(r);i.set("page_size",String(Qt)),l!=="1"&&i.set("page",l);let s=await h(`${n}?${i.toString()}`);o.push(...f(s)),l=Xt(s.next)}return l&&console.warn(`[${t}] stopped at ${Je} pages (${o.length} rows); list may be truncated`),o}async function Ye(e,t={}){if(A.getAccess())try{return{data:await h(e,t),asShopper:!0}}catch(n){if(!(n instanceof S)||n.status!==401)throw n}return{data:await c(e,t),asShopper:!1}}async function Ze(){let e=await h("/api/auth/me/");if(e.portal!=="shop")throw A.clear(),new S(403,"This session is not valid for this shop.",null);return e}var zt={login:(e,t)=>c("/api/auth/login/",{method:"POST",body:JSON.stringify({email:e,password:t,portal:"shop"}),credentials:"include"}),refresh:e=>c("/api/auth/refresh/",{method:"POST",body:JSON.stringify(e?{refresh:e,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{A.clear();try{await c("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{let e=await ot();return await Ze(),e},me:Ze,updateMe:e=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(e)}),changePassword:(e,t)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:t,old_password:e})}),changeEmail:(e,t)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:e,current_password:t})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:e=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(e)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:e=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(e)}),updateAddress:(e,t)=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"PATCH",body:JSON.stringify(t)}),deleteAddress:e=>h(`/api/shop-portal/delivery-locations/${e}/`,{method:"DELETE"}),passwordResetRequest:e=>c("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:e})}),passwordResetConfirm:(e,t,n)=>c("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:e,token:t,new_password:n})}),brands:()=>h("/api/products/brands/"),myOrders:()=>Ve("/api/shop-portal/orders/","api.myOrders"),myOrder:e=>h(`/api/shop-portal/orders/${e}/`),cancelOrder:e=>h(`/api/shop-portal/orders/${e}/cancel/`,{method:"POST"}),myReturns:e=>Ve(`/api/shop-portal/returns/${e?`?order=${encodeURIComponent(e)}`:""}`,"api.myReturns"),createReturn:e=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(e)}),withdrawReturn:e=>h(`/api/shop-portal/returns/${e}/cancel/`,{method:"POST"}),uploadReturnPhoto:(e,t)=>{let n=new FormData;return n.append("claim_item",e),n.append("file",t),n.append("media_type",t.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:n})}};function b(e){if(typeof e=="string")return e.startsWith("/media/")?oe(e):e;if(Array.isArray(e))return e.map(b);if(e&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=n==="captions"&&r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r).map(([o,l])=>[b(o),l])):b(r);return t}return e}var at=typeof window>"u"&&q!=="",en=at?q:"",tn=se,T=()=>({baseUrl:tn(),audience:null});function u(e,t){let n=t?`?process=${encodeURIComponent(t)}`:"";return`/api/v1${e}${n}`}var lt=100,je=50;function ie(e,t,n){let r=new URLSearchParams;for(let[o,l]of Object.entries(t))l!=null&&l!==""&&r.set(o,String(l));return r.set("pageSize",String(lt)),n&&r.set("cursor",n),`/api/v1${e}?${r.toString()}`}function nn(e,t){return ie("/wheels",{process:e},t)}var Qe=lt;function rn(e,t){return ie("/wheels",{slug:e.join(",")},t)}function sn(e,t,n){return ie("/products",{kind:e.join(","),make:t?.make,model:t?.model,year:t?.year,modification:t?.modification},n)}function on(e){if(!e)return null;try{return new URL(e,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function z(e,t,n=()=>!1,r=()=>!1){let o=[],l=null;try{for(let p=0;p<je;p++){let i=await c(await t(l),await d());if(o.push(...f(i)),l=on(i.next),!l)break;if(r(o))return o}l&&console.warn(`[${e}] stopped at ${je} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(n(p))throw p;console.warn(`[${e}] product API unavailable, returning []`,p)}return o}var Xe=e=>e instanceof S&&e.status===400;function ze(e){return e.flatMap(t=>t.kind==="alloy-wheel"?x([t]):[t])}async function ct(){return(await an()).host}async function an(){try{let{headers:e}=await import("./headers-UYHEZDAT.js"),t=await e(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,r=n(t.get(pe)??t.get("x-forwarded-host")??t.get("host")),o=n(t.get("host"));return{host:r,matchesRequestHost:r!==null&&r===o}}catch{return{host:null,matchesRequestHost:!1}}}async function ln(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return le((await e()).get(K))}catch{return null}}async function cn(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(de)||null}catch{return null}}async function un(){let e=await cn();if(e)return`site=${encodeURIComponent(e)}`;let t=await ct();return t?`host=${encodeURIComponent(t)}`:""}async function y(e){if(typeof window<"u"){let t=W();return t?H(e,`site=${encodeURIComponent(t)}`):e}return H(e,await un())}function H(e,t){return t?`${e}${e.includes("?")?"&":"?"}${t}`:e}var dn="preview";async function pn(){if(typeof window<"u")return null;try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(me)}catch{return null}}async function mn(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get("user-agent")}catch{return null}}async function ee(e,t){let n=await pn();if(n===null)return[await y(e),await d(t)];let r=H(await y(e),`${dn}=${encodeURIComponent(n)}`),{next:o,cache:l,...p}=t??{},i=await d({...p,cache:"no-store"}),s=await mn();return s&&(i.headers={...i.headers,"user-agent":s}),[r,i]}async function gn(e){if(!at)return;let[t,n]=await Promise.all([ct(),ln()]),r=ce(t,n,e);return Object.keys(r).length>0?r:void 0}async function d(e){let t=await gn(ue(e)),n={baseUrl:en,...e};return t&&(n.headers={...t,...e?.headers}),n}var E=typeof window>"u";function U(e,t){let n=new URLSearchParams;for(let[o,l]of Object.entries(t))l!==void 0&&l!==""&&n.set(o,String(l));let r=n.toString();return`/api/v1/fitment${e}${r?`?${r}`:""}`}var Or={listMakes:async e=>{if(E){let{fitmentData:n}=await import("./fitment-data-EGBXHTFW.js");return n.makes(e)}let t=await c(U("/makes",{region:e}),T());return f(t)},listModels:async(e,t)=>{if(E){let{fitmentData:r}=await import("./fitment-data-EGBXHTFW.js");return r.models(e,t)}let n=await c(U("/models",{make:e,region:t}),T());return f(n)},listYears:async(e,t,n)=>{if(E){let{fitmentData:o}=await import("./fitment-data-EGBXHTFW.js");return o.years(e,t,n)}let r=await c(U("/years",{make:e,model:t,region:n}),T());return f(r)},listModifications:async(e,t,n,r)=>{if(E){let{fitmentData:l}=await import("./fitment-data-EGBXHTFW.js");return l.modifications(e,t,n,r)}let o=await c(U("/modifications",{make:e,model:t,year:n,region:r}),T());return f(o)},getStockFitment:async(e,t,n,r,o)=>{if(E){let{fitmentData:l}=await import("./fitment-data-EGBXHTFW.js");return l.stockFitment(e,t,n,r,o)}return c(U("/stock-fitment",{make:e,model:t,year:n,modification:r,region:o}),T())}},Er={listWheels:async(e,t={})=>{let n=await z("products.listWheels",async r=>await y(nn(e,r)),t.throwOnFailure?()=>!0:void 0,t.maxRows===void 0?void 0:r=>x([...r]).length>=t.maxRows);return x(b(n))},listWheelsBySlug:async(e,t={})=>{let n=[...new Set(e.map(i=>i.trim()).filter(Boolean))];if(n.length===0)return[];let r=[];for(let i=0;i<n.length;i+=Qe)r.push(n.slice(i,i+Qe));let o=await Promise.all(r.map(i=>z("products.listWheelsBySlug",async s=>await y(rn(i,s)),t.throwOnFailure?()=>!0:Xe))),l=new Set(n),p=o.flat().filter(i=>l.has(i.slug));return x(b(p))},listCatalog:async(e,t,n={})=>{if(e.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` \u2014 so the call would silently return the wheel catalog instead of nothing.");let r=await z("products.listCatalog",async o=>await y(sn(e,t,o)),n.throwOnFailure?()=>!0:Xe,n.maxRows===void 0?void 0:o=>ze([...o]).length>=n.maxRows);return ze(b(r))},getWheel:async e=>C(b(await c(await y(u(`/wheels/${e}`)),await d()))),getTyre:async e=>b(await c(await y(u(`/tyres/${e}`)),await d())),listBundles:async(e={})=>{try{return await c(await y(u("/bundles")),await d())}catch(t){if(e.throwOnFailure)throw t;return[]}},getBundle:async e=>c(await y(u(`/bundles/${e}`)),await d()),listGalleryBuilds:async(e={})=>{let{process:t=null,wheelSlug:n=null}=e;if(typeof window>"u"){let{listGalleryBuilds:r}=await import("./gallery-builds-data-TD3QJK7L.js");return b(r(t,n))}try{let r=new URLSearchParams;t&&r.set("process",t),n&&r.set("wheelSlug",n);let o=r.toString(),l=await c(`/api/v1/gallery-builds${o?`?${o}`:""}`,T());return b(f(l))}catch(r){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",r),[]}},getSite:async()=>c(await y(u("/site")),await d()),getSiteBySlug:async e=>c(`${u("/site")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await d():void 0),listPages:async()=>b(await c(await y(u("/pages")),await d())),listPopups:async()=>c(await y(u("/popups")),await d()),listProductTemplates:async()=>{try{return await c(await y(u("/product-templates")),await d())}catch(e){return console.warn("[products.listProductTemplates] unavailable, returning []",e),[]}},listDynamicPages:async e=>{let t=e?`?recordType=${encodeURIComponent(e)}`:"";try{return await c(await y(`${u("/dynamic-pages")}${t}`),await d())}catch(n){if(n instanceof S&&n.status===404)return[];throw n}},getRecord:async(e,t)=>{try{return await c(await y(u(`/records/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)),await d())}catch(n){if(n instanceof S&&n.status===404)return null;throw n}},listRecordKeys:async e=>{try{let t=await c(await y(u(`/records/${encodeURIComponent(e)}`)),await d({cache:"no-store"}));return Array.isArray(t?.keys)?t.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(t){if(t instanceof S&&t.status===404)return[];throw t}},listProductTypeChoices:async()=>{try{return await c(await y(u("/product-type-choices")),await d())}catch(e){return console.warn("[products.listProductTypeChoices] unavailable, returning []",e),[]}},listFieldUsage:async()=>{try{return await c(await y(u("/field-usage")),await d())}catch(e){return console.warn("[products.listFieldUsage] unavailable, returning []",e),[]}},getPage:async(e,t={})=>{let n=t.record?`?record=${encodeURIComponent(t.record)}`:"",[r,o]=await ee(u(`/pages/${e}`)+n,t.revalidate!==void 0?{next:{revalidate:t.revalidate}}:void 0);return b(await c(r,o))},listBlogPosts:async(e={},{throwOnFailure:t=!1}={})=>{let n=e.category?`?category=${encodeURIComponent(e.category)}`:"";try{return(await c(u("/blog-posts")+n,await d())).map(o=>({...o,coverImage:D(o.coverImage)??""}))}catch(r){if(t)throw r;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",r),[]}},getBlogPost:async e=>{let t=await c(u(`/blog-posts/${e}`),await d());return{...t,coverImage:D(t.coverImage)??""}},createOrder:async e=>c(u("/orders"),await d({method:"POST",body:JSON.stringify(e)})),createOrderAuthed:async e=>h(u("/orders"),await d({method:"POST",body:JSON.stringify(e)})),lookupOrder:async e=>c(u("/orders/lookup"),await d({method:"POST",body:JSON.stringify(e)})),createPaymentIntent:async e=>c(u("/payments/intent"),await d({method:"POST",body:JSON.stringify(e)})),releaseCheckout:async e=>c(u("/checkouts/release"),await d({method:"POST",body:JSON.stringify(e)})),createPaypalOrder:async e=>c(u("/payments/paypal/order"),await d({method:"POST",body:JSON.stringify(e)})),capturePaypalOrder:async e=>c(u("/payments/paypal/capture"),await d({method:"POST",body:JSON.stringify(e)})),createAfterpayCheckout:async e=>c(u("/payments/afterpay/checkout"),await d({method:"POST",body:JSON.stringify(e)})),captureAfterpayPayment:async e=>c(u("/payments/afterpay/capture"),await d({method:"POST",body:JSON.stringify(e)})),chargeSquare:async e=>c(u("/payments/square/charge"),await d({method:"POST",body:JSON.stringify(e)})),createGocardlessBillingRequest:async e=>c(u("/payments/gocardless/billing-request"),await d({method:"POST",body:JSON.stringify(e)})),completeGocardlessPayment:async e=>c(u("/payments/gocardless/complete"),await d({method:"POST",body:JSON.stringify(e)})),createZipCheckout:async e=>c(u("/payments/zip/checkout"),await d({method:"POST",body:JSON.stringify(e)})),captureZipPayment:async e=>c(u("/payments/zip/capture"),await d({method:"POST",body:JSON.stringify(e)})),createKlarnaCheckout:async e=>c(u("/payments/klarna/checkout"),await d({method:"POST",body:JSON.stringify(e)})),captureKlarnaPayment:async e=>c(u("/payments/klarna/capture"),await d({method:"POST",body:JSON.stringify(e)})),createStockAlert:async e=>c(u("/stock-alerts"),await d({method:"POST",body:JSON.stringify(e)})),createPreOrderIntent:async e=>c(u("/pre-order-intents"),await d({method:"POST",body:JSON.stringify(e)})),createNewsletterSubscription:async e=>c(u("/newsletter-subscriptions"),await d({method:"POST",body:JSON.stringify(e)})),unsubscribeNewsletter:async e=>c(u("/newsletter-unsubscribe"),await d({method:"POST",body:JSON.stringify(e)})),captureCart:async e=>c(u("/carts"),await d({method:"POST",body:JSON.stringify(e)})),restoreCart:async e=>c(u("/carts/restore"),await d({method:"POST",body:JSON.stringify(e)})),unsubscribeCartReminders:async e=>c(u("/carts/unsubscribe"),await d({method:"POST",body:JSON.stringify(e)})),listReviews:async(e={})=>{let t=new URLSearchParams;e.limit&&t.set("limit",String(e.limit)),e.designCode&&t.set("designCode",e.designCode);let n=u("/reviews"),r=t.toString();try{return await c(await y(r?`${n}?${r}`:n),await d())}catch(o){return console.warn("[products.listReviews] product API unavailable, returning []",o),[]}},submitReview:async e=>c(u("/reviews"),await d({method:"POST",body:JSON.stringify(e)})),getForm:async e=>c(u(`/forms/${encodeURIComponent(e)}`),await d()),submitForm:async(e,t)=>c(u(`/forms/${encodeURIComponent(e)}/submissions`),await d({method:"POST",body:JSON.stringify(t)})),listShippingMethods:async()=>{try{return await c(u("/shipping-methods"),await d())}catch(e){return console.warn("[products.listShippingMethods] product API unavailable, returning []",e),[]}},listCountrySubdivisions:async e=>{try{return await c(u(`/countries/${encodeURIComponent(e)}/subdivisions`),await d())}catch(t){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",t),[]}},quoteCart:async e=>{let t=u("/cart/quote"),n=await d({method:"POST",body:JSON.stringify(e)});return e.couponCode?(await Ye(t,n)).data:c(t,n)},validateCoupon:async e=>{let{data:t,asShopper:n}=await Ye(u("/coupons/validate"),await d({method:"POST",body:JSON.stringify(e)}));return{...t,askedAsShopper:n}},getHeaderSettings:async()=>{let e=nt({method:"GET"}),t=await c(...await ee(u("/header-settings"),{signal:e})),n=D(t.logoUrl),r=null,o=null;if(n&&Y(n)){let l=await Te(n,e);l&&(r=l.reversed,o=l.inkIsDark)}return{...t,logoUrl:n,logoReversed:r,logoInkIsDark:o}},getThemeSettings:async()=>c(...await ee(u("/theme-settings"))),getChatSettings:async()=>c(await y(u("/chat-settings")),await d())},Ur={listServices:async()=>{try{return await c(u("/bookings/services"),await d())}catch(e){return console.warn("[bookings.listServices] API unavailable, returning []",e),{results:[],currency:"USD"}}},getAvailability:async(e,t)=>c(u(`/bookings/availability?service=${encodeURIComponent(e)}&date=${t}`),await d()),create:async e=>c(u("/bookings"),await d({method:"POST",body:JSON.stringify(e)})),get:async e=>c(u(`/bookings/manage/${encodeURIComponent(e)}`),await d()),cancel:async e=>c(u(`/bookings/manage/${encodeURIComponent(e)}/cancel`),await d({method:"POST"})),createPaymentIntent:async e=>c(u("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:e})}))},ne=class extends Error{constructor(n,r){super(`Slug "${n}" exists on ${r} websites; a site is required to pick one.`);this.slug=n;this.count=r;this.name="AmbiguousPageSlugError"}},B=(e,t,n)=>{let r=new URLSearchParams({...t?{site:t}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${e}/${r?`?${r}`:""}`},G=e=>`/api/storefront/sites/${encodeURIComponent(e)}/`,yn=e=>`${G(e)}currencies/`,hn="/api/storefront/media/ingest/",re=class extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}};function fn(){let e=_e();if(!e)throw new re;return`${hn}?${new URLSearchParams({site:e})}`}var Sn="X-Puck-Media-Manifest",et=ae.contentHash,$={"X-Media-Manifest":et,[Sn]:et},Nr=ut({});function ut(e){return(t,n={})=>{let r=Yt(),o=e.headers||r?{...r?{"Accept-Language":r}:{},...e.headers,...n.headers}:void 0;return c(t,{...n,...e.baseUrl!==void 0?{baseUrl:e.baseUrl}:{},...o?{headers:o}:{},audience:e.audience??Jt()})}}function Pn(e={}){let t=ut(e),n=e.siteDrafts===!0,r=i=>B("header-settings",i,n),o=i=>B("theme-settings",i,n),l=i=>B("chat-settings",i,n),p=i=>B("social-settings",i,n);return{findPageBySlug:async(i,s,a)=>{let m=new URLSearchParams({slug:i});a&&m.set("site",a);let g=await t(`/api/storefront/pages/?${m.toString()}`,{token:s}),w=f(g);if(!a&&w.length>1)throw new ne(i,w.length);return w[0]??null},getPageById:(i,s)=>t(`/api/storefront/pages/${i}/`,{token:s}),saveLayout:(i,s,a,m,g)=>t(`/api/storefront/pages/${i}/`,{method:"PATCH",body:JSON.stringify({layout:s,expected_updated_at:m,...g?{client_id:g}:{}}),token:a}),duplicatePage:(i,s,a)=>t(`/api/storefront/pages/${i}/duplicate/`,{method:"POST",body:JSON.stringify({title:s.title,slug:s.slug}),token:a}),geocode:(i,s,a)=>t(`/api/storefront/geocode/?${new URLSearchParams(a?{q:i,country:a}:{q:i})}`,{token:s}),listBlockSources:i=>t("/api/storefront/block-sources/",{token:i}),listRecordTypes:i=>t("/api/storefront/record-types/",{token:i}),createPagePreviewLink:(i,s)=>t(`/api/storefront/pages/${i}/preview-link/`,{method:"POST",token:s}),claimPageEditLock:(i,s,a,m=!1)=>t(`/api/storefront/pages/${i}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:a,takeover:m}),token:s}),releasePageEditLock:(i,s)=>t(`/api/storefront/pages/${i}/edit-lock/`,{method:"DELETE",token:s}),createTemplate:(i,s,a)=>t("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:i,layout:s}),headers:$,token:a}),getTemplate:(i,s)=>t(`/api/storefront/page-templates/${i}/`,{token:s}),saveTemplateLayout:(i,s,a)=>t(`/api/storefront/page-templates/${i}/`,{method:"PATCH",body:JSON.stringify({layout:s}),headers:$,token:a}),listTemplatePages:async(i,s)=>{let a=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(i)}`,{token:s});return f(a)},findTemplatePageBySlug:async(i,s,a)=>{let m=await t(`/api/storefront/template-pages/?template=${encodeURIComponent(i)}&slug=${encodeURIComponent(s)}`,{token:a});return f(m)[0]??null},createTemplatePage:(i,s,a)=>t("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:i,...s}),headers:$,token:a}),saveTemplatePageLayout:(i,s,a)=>t(`/api/storefront/template-pages/${i}/`,{method:"PATCH",body:JSON.stringify({layout:s}),headers:$,token:a}),deleteTemplatePage:(i,s,a)=>t(`/api/storefront/template-pages/${i}/`,{method:"DELETE",token:s,...a?.keepalive?{keepalive:!0}:{}}),listPages:async(i,s)=>{let a=new URLSearchParams({no_page:"true"});s&&a.set("site",s);let m=await t(`/api/storefront/pages/?${a.toString()}`,{token:i});return f(m)},createPage:(i,s,a,m)=>t("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:i,slug:s,layout:a}),token:m}),deletePage:(i,s)=>t(`/api/storefront/pages/${i}/`,{method:"DELETE",token:s}),getHeaderSettings:(i,s)=>t(r(s),{token:i}),listMenus:async(i,s)=>{let a=new URLSearchParams({no_page:"true"});s&&a.set("site",s);let m=await t(`/api/storefront/menus/?${a}`,{token:i});return f(m)},listBlogPosts:async(i,s={})=>{let a=new URLSearchParams({no_page:"true"});s.visibleOnly&&a.set("is_visible","true"),s.siteId&&a.set("site",s.siteId);let m=await t(`/api/storefront/blog-posts/?${a.toString()}`,{token:i});return f(m)},listFieldUsage:async(i,s)=>{let a=await t(`/api/storefront/field-usage/?site=${encodeURIComponent(s)}`,{token:i});return Array.isArray(a?.entries)?a.entries:[]},listCategories:async(i,s={})=>{let a=new URLSearchParams({no_page:"true"});s.visibleOnly&&a.set("is_visible","true"),s.siteId&&a.set("site",s.siteId);let m=await t(`/api/storefront/categories/?${a.toString()}`,{token:i});return[...f(m)].sort((w,N)=>w.sort_order-N.sort_order||w.name.localeCompare(N.name))},listForms:async(i,s={})=>{let a=new URLSearchParams({no_page:"true"});s.siteId&&a.set("site",s.siteId);let m=await t(`/api/storefront/forms/?${a.toString()}`,{token:i});return[...f(m)].sort((w,N)=>w.title.localeCompare(N.title))},listWheelSummaries:async(i,s={})=>{let a=new URLSearchParams;s.siteId&&a.set("site",s.siteId);let m=a.toString(),g=await t(`/api/storefront/wheel-curations/summaries/${m?`?${m}`:""}`,{token:i});return b(g)},listProducts:async(i,s={})=>{let a=new URLSearchParams;s.kinds?.length&&a.set("kind",s.kinds.join(",")),s.siteId&&a.set("site",s.siteId);let m=a.toString(),g=await t(`/api/storefront/products/${m?`?${m}`:""}`,{token:i});return b(g)},getWheelDetail:async(i,s,a={})=>{let m=new URLSearchParams({slug:s});return a.siteId&&m.set("site",a.siteId),C(b(await t(`/api/storefront/wheel-curations/detail/?${m.toString()}`,{token:i})))},updateHeaderSettings:(i,s,a)=>t(r(a),{method:"PATCH",body:JSON.stringify(i),token:s}),getSite:(i,s)=>t(G(i),{token:s}),listSites:async i=>{let s=await t("/api/storefront/sites/?no_page=true",{token:i});return f(s)},listSiteCurrencies:async(i,s)=>{let a=await t(yn(i),{token:s});return Array.isArray(a)?a:[]},publishSite:(i,s)=>t(`${G(i)}publish/`,{method:"POST",token:s}),getSiteLiveState:(i,s)=>t(`${G(i)}live-state/`,{token:s}),getThemeSettings:(i,s)=>t(o(s),{token:i}),updateThemeSettings:(i,s,a)=>t(o(a),{method:"PATCH",body:JSON.stringify(i),token:s}),getMyPreferences:async i=>(await t("/api/auth/me/",{token:i})).preferences??{},updateMyPreferences:(i,s)=>t("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:i}),token:s}),getChatSettings:(i,s)=>t(l(s),{token:i}),updateChatSettings:(i,s,a)=>t(l(a),{method:"PATCH",body:JSON.stringify(i),token:s}),getSocialSettings:(i,s)=>t(p(s),{token:i}),updateSocialSettings:(i,s,a)=>t(p(a),{method:"PATCH",body:JSON.stringify(i),token:s}),uploadHeaderLogo:(i,s,a)=>{let m=new FormData;return m.append("logo",i),t(r(a),{method:"PATCH",body:m,token:s})},clearHeaderLogo:(i,s)=>t(r(s),{method:"PATCH",body:JSON.stringify({logo:null}),token:i}),setHeaderLogoFromAsset:(i,s,a)=>t(r(a),{method:"PATCH",body:JSON.stringify({logo_asset_id:i}),token:s}),uploadMedia:async(i,s)=>{let a=new FormData;return a.append("file",i),t(fn(),{method:"POST",body:a,token:s})},listMedia:async(i,s)=>{let a=new URLSearchParams({no_page:"true"});s&&a.set("kind",s);let m=await t(`/api/storefront/media-assets/?${a.toString()}`,{token:i});return f(m)}}}var Dr=Pn({siteDrafts:!0});function bn(e){let t=e.trim();return t?`/api/v1/dealers?${new URLSearchParams({near:t}).toString()}`:"/api/v1/dealers"}async function Lr(e){return xe(await c(bn(e)))}var _={audience:null,baseUrl:""};async function Mr(e,t){return Ie(await c(De(e,t),_))}async function Ir(e){return ve(await c(Le,{..._,method:"POST",body:JSON.stringify(e)}))}async function vr(e){try{let t=await c($e,{..._,method:"POST",body:JSON.stringify({token:e})});return Q(202,t)}catch(t){if(t instanceof S)return Q(t.status,t.data);throw t}}async function Fr(e,t){await c(Me,{..._,method:"POST",body:JSON.stringify({email:t.trim(),...e?{product:e}:{}})})}async function Br(e,t){await c(Ge,{..._,method:"POST",body:JSON.stringify({email:t.trim(),...e?{product:e}:{}})})}async function $r(e){try{return We(await c(He,{..._,method:"POST",body:JSON.stringify({token:e})}))}catch(t){if(t instanceof S)return"";throw t}}export{q as a,f as b,ce as c,ue as d,A as e,mt as f,Y as g,_e as h,Ce as i,Mn as j,In as k,vn as l,Fn as m,$n as n,Wn as o,qn as p,P as q,Ue as r,Ne as s,Kn as t,Jn as u,Vn as v,Yn as w,Zn as x,jn as y,Qn as z,Xn as A,zn as B,er as C,tr as D,nr as E,rr as F,ir as G,sr as H,or as I,ar as J,v as K,lr as L,cr as M,ur as N,Bt as O,S as P,te as Q,X as R,wr as S,Ar as T,c as U,zt as V,ct as W,an as X,ln as Y,cn as Z,pn as _,Or as $,Er as aa,Ur as ba,ne as ca,Nr as da,Dr as ea,Lr as fa,Mr as ga,Ir as ha,vr as ia,Fr as ja,Br as ka,$r as la};
|