@colabcommerce/elements 0.9.3 → 0.9.4

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/README.md CHANGED
@@ -34,10 +34,11 @@ const MyStoreLocator = () => {
34
34
 
35
35
  #### Props
36
36
 
37
- | Prop | Type | Default |
37
+ | Prop | Type | Default |
38
38
  | --------------- | ------- | ------- |
39
- | organizationId | String | null
40
- | locale | String | 'en'
39
+ | organizationId | String | null
40
+ | locale | String | 'en'
41
+
41
42
 
42
43
  ### StoreDetails
43
44
 
package/dist/QuoteForm.js CHANGED
@@ -1,15 +1,17 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as a}from"react/compiler-runtime";import{createContext as l,useState as o,useContext as s,useRef as r,useId as n,useEffect as c}from"react";import{u as i,a as d,b as m}from"./useStoreLocatorConfig-r4Y_2t-M.js";import*as u from"@radix-ui/react-popover";import*as h from"@radix-ui/react-scroll-area";import"@radix-ui/react-slot";import{b as p,c as f,u as x,I as g,A as v,a as y,M as b,m as N,i as _,j as S,k as w,L as k,n as I,l as C,B as L}from"./index-DvX0QvFh.js";import{useTranslation as A}from"react-i18next";import{c as j,S as z,M,B as D,C as F,a as O,L as P}from"./translations-6mspyPRw.js";import"@radix-ui/react-collapsible";const T=l(),q=t=>{const l=a(34),{organizationId:s,locale:r,baseUrl:n,products:c,filterBy:u,children:h}=t,p=void 0===n?"/retailers":n;let f;l[0]!==c?(f=void 0===c?[]:c,l[0]=c,l[1]=f):f=l[1];const x=f;let g;l[2]!==u?(g=void 0===u?{stocked:["sku"],available:["sku"]}:u,l[2]=u,l[3]=g):g=l[3];const v=g,[y,b]=o(0),[N,_]=o(null),[S,w]=o(null),[k,I]=o(null),[C,L]=o(!1),[A,j]=o("300mi"),[z,M]=o(null),[D,F]=o("geolocation");let O;l[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(O={autoGeoLocate:!1},l[4]=O):O=l[4];const{location:P}=i(O),q="geolocation"===D?P:z||P;let U;l[5]!==q||l[6]!==s||l[7]!==A?(U={organizationId:s,location:q,page:1,radius:A,pageSize:10},l[5]=q,l[6]=s,l[7]=A,l[8]=U):U=l[8];const{stores:E,meta:$,isLoading:B,error:H}=d(U),{config:R,isLoading:W,error:Z}=m(s);let J;l[9]!==p||l[10]!==R||l[11]!==Z||l[12]!==W||l[13]!==v||l[14]!==S||l[15]!==r||l[16]!==q||l[17]!==C||l[18]!==k||l[19]!==$||l[20]!==s||l[21]!==x||l[22]!==H||l[23]!==B||l[24]!==z||l[25]!==A||l[26]!==N||l[27]!==y||l[28]!==E||l[29]!==D?(J={stepIndex:y,setStepIndex:b,selectedStoreId:N,setSelectedStoreId:_,focusedStoreId:S,setFocusedStoreId:w,organizationId:s,location:q,locale:r,stores:E,meta:$,searchIsLoading:B,searchError:H,config:R,configIsLoading:W,configError:Z,messageDialogOpen:C,setMessageDialogOpen:L,messageStoreId:k,setMessageStoreId:I,baseUrl:p,searchRadius:A,setSearchRadius:j,searchLocation:z,setSearchLocation:M,useLocationType:D,setUseLocationType:F,products:x,filterBy:v},l[9]=p,l[10]=R,l[11]=Z,l[12]=W,l[13]=v,l[14]=S,l[15]=r,l[16]=q,l[17]=C,l[18]=k,l[19]=$,l[20]=s,l[21]=x,l[22]=H,l[23]=B,l[24]=z,l[25]=A,l[26]=N,l[27]=y,l[28]=E,l[29]=D,l[30]=J):J=l[30];const K=J;let V;return l[31]!==h||l[32]!==K?(V=/* @__PURE__ */e(T.Provider,{value:K,children:h}),l[31]=h,l[32]=K,l[33]=V):V=l[33],V},U=()=>s(T),E=j("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),$=j("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function B(e){return e?.label??e?.description??e?.text??e?.placePrediction?.text?.text??e?.placePrediction?.structuredFormat?.mainText?.text??""}function H(){const l=a(77),{t:s}=A(),[i,d]=o("");o(!1);const[m,x]=o(!1),[g,v]=o(-1),{location:y,setSearchLocation:b,setUseLocationType:N}=U();let _,S,w;l[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(_={lat:37.7937,lng:-122.3965},l[0]=_):_=l[0],l[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(S=["locality","postal_code"],l[1]=S):S=l[1],l[2]!==i?(w={query:i,apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",center:_,radiusMeters:1e4,types:S},l[2]=i,l[3]=w):w=l[3];const{results:k,isLoading:I,error:C}=p(w);let L;l[4]!==k?(L=Array.isArray(k)?k:[],l[4]=k,l[5]=L):L=l[5];const j=L,D=r(null),F=n(),O=g>=0?`${F}-opt-${g}`:void 0;let P,T,q;l[6]!==I||l[7]!==j.length||l[8]!==m?(P=()=>{m&&(I||v(j.length?0:-1))},T=[m,I,j.length],l[6]=I,l[7]=j.length,l[8]=m,l[9]=P,l[10]=T):(P=l[9],T=l[10]),c(P,T),l[11]!==b||l[12]!==N?(q=e=>{const t=B(e);if(!t)return;d(t),x(!1),requestAnimationFrame(()=>D.current?.focus());const a={latitude:e.location?.lat??null,longitude:e.location?.lng??null,accuracy:null,altitude:0,altitudeAccuracy:null,heading:null,speed:null,city:e.city??null,region:e.region??null,country:e.country??null,postal:e.postalCode??null,timezone:null,ip:null,type:"search",raw:e};b(a),N("search")},l[11]=b,l[12]=N,l[13]=q):q=l[13];const E=q;let $;l[14]!==g||l[15]!==E||l[16]!==j||l[17]!==m?($=e=>{if(m||"ArrowDown"!==e.key&&"ArrowUp"!==e.key){if(m)e:switch(e.key){case"ArrowDown":e.preventDefault(),v(e=>Math.min(e+1,j.length-1));break e;case"ArrowUp":e.preventDefault(),v(Z);break e;case"Enter":g>=0&&j[g]&&(e.preventDefault(),E(j[g]));break e;case"Escape":e.preventDefault(),x(!1)}}else x(!0)},l[14]=g,l[15]=E,l[16]=j,l[17]=m,l[18]=$):$=l[18];const H=$;let J;l[19]!==N?(J=()=>{N("geolocation"),x(!1),d("")},l[19]=N,l[20]=J):J=l[20];const K=J;let V;l[21]!==C||l[22]!==I||l[23]!==j.length||l[24]!==m||l[25]!==i?(V=m&&!I&&!C&&i.trim().length>0&&0===j.length,l[21]=C,l[22]=I,l[23]=j.length,l[24]=m,l[25]=i,l[26]=V):V=l[26];const G=V;let Q,Y,X,ee,te,ae,le,oe,se,re,ne,ce,ie,de,me,ue,he;return l[27]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(Q=/* @__PURE__ */e(z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),l[27]=Q):Q=l[27],l[28]!==y||l[29]!==s?(Y=y?.city?s("default:location_search_placeholder_w_location",{location:y.city}):s("default:location_search_placeholder"),l[28]=y,l[29]=s,l[30]=Y):Y=l[30],l[31]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(X=e=>{d(e.target.value),x(!0)},ee=()=>x(!0),l[31]=X,l[32]=ee):(X=l[31],ee=l[32]),l[33]!==O||l[34]!==F||l[35]!==H||l[36]!==m||l[37]!==i||l[38]!==Y?(te=/* @__PURE__ */e(u.Anchor,{asChild:!0,children:/* @__PURE__ */t("div",{className:"flex-1 relative",children:[Q,
2
- /* @__PURE__ */e(f,{ref:D,type:"text",placeholder:Y,value:i,onChange:X,onFocus:ee,onKeyDown:H,className:"pl-10 h-12",role:"combobox","aria-autocomplete":"list","aria-expanded":m,"aria-controls":F,"aria-activedescendant":O})]})}),l[33]=O,l[34]=F,l[35]=H,l[36]=m,l[37]=i,l[38]=Y,l[39]=te):te=l[39],l[40]!==C?(ae=C?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm rounded-md border border-destructive/30 bg-destructive/10 text-destructive",children:String(C)}):null,l[40]=C,l[41]=ae):ae=l[41],l[42]!==I||l[43]!==s?(le=I?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:s("default:loading")}):null,l[42]=I,l[43]=s,l[44]=le):le=l[44],l[45]!==G||l[46]!==s?(oe=G?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:s("default:no_results")}):null,l[45]=G,l[46]=s,l[47]=oe):oe=l[47],l[48]!==g||l[49]!==E||l[50]!==C||l[51]!==I||l[52]!==j||l[53]!==F?(se=!I&&!C&&j.map((a,l)=>{const o=l===g,s=B(a),r=(n=a,n?.secondary??n?.secondary_text??n?.placePrediction?.structuredFormat?.secondaryText?.text??n?.placePrediction?.structuredFormat?.secondaryText??"");var n;const c=function(e,t){return e?.id??e?.place_id??e?.placePrediction?.placeId??t}(a,`${l}`);return s?/* @__PURE__ */t("div",{id:`${F}-opt-${l}`,role:"option","aria-selected":o,onMouseEnter:()=>v(l),onMouseDown:R,onClick:()=>E(a),className:["cursor-pointer rounded-lg px-3 py-2",o?"bg-muted":"hover:bg-muted/60"].join(" "),children:[
3
- /* @__PURE__ */e("div",{className:"text-sm text-left font-medium leading-tight",children:s}),r?/* @__PURE__ */e("div",{className:"text-xs text-left text-muted-foreground mt-1 leading-tight",children:r}):null]},c):null}),l[48]=g,l[49]=E,l[50]=C,l[51]=I,l[52]=j,l[53]=F,l[54]=se):se=l[54],l[55]!==F||l[56]!==ae||l[57]!==le||l[58]!==oe||l[59]!==se?(re=/* @__PURE__ */e(h.Viewport,{children:/* @__PURE__ */t("div",{id:F,role:"listbox",className:"p-2",children:[ae,le,oe,se]})}),l[55]=F,l[56]=ae,l[57]=le,l[58]=oe,l[59]=se,l[60]=re):re=l[60],l[61]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ne=/* @__PURE__ */e(h.Scrollbar,{orientation:"vertical",className:"flex select-none touch-none p-0.5 bg-transparent",children:/* @__PURE__ */e(h.Thumb,{className:"flex-1 bg-border rounded-full"})}),l[61]=ne):ne=l[61],l[62]!==re?(ce=/* @__PURE__ */e(u.Content,{sideOffset:6,align:"start",onOpenAutoFocus:W,className:"w-[var(--radix-popover-trigger-width)] max-w-[560px] rounded-xl border rounded bg-background shadow-lg overflow-hidden",children:/* @__PURE__ */t(h.Root,{className:"max-h-80",children:[re,ne]})}),l[62]=re,l[63]=ce):ce=l[63],l[64]!==m||l[65]!==te||l[66]!==ce?(ie=/* @__PURE__ */e("div",{className:"flex flex-row gap-4",children:/* @__PURE__ */t(u.Root,{open:m,onOpenChange:x,children:[te,ce]})}),l[64]=m,l[65]=te,l[66]=ce,l[67]=ie):ie=l[67],l[68]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(de=/* @__PURE__ */e(M,{className:"w-4 h-4"}),l[68]=de):de=l[68],l[69]!==s?(me=s("default:use_my_location"),l[69]=s,l[70]=me):me=l[70],l[71]!==K||l[72]!==me?(ue=/* @__PURE__ */t("div",{className:"mt-2 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[de,
4
- /* @__PURE__ */e("button",{className:"text-primary hover:underline font-medium",type:"button",onClick:K,children:me})]}),l[71]=K,l[72]=me,l[73]=ue):ue=l[73],l[74]!==ie||l[75]!==ue?(he=/* @__PURE__ */e("div",{className:"max-w-3xl mx-auto",children:/* @__PURE__ */t("div",{className:"rounded-xl p-6",children:[ie,ue]})}),l[74]=ie,l[75]=ue,l[76]=he):he=l[76],he}function R(e){return e.preventDefault()}function W(e){return e.preventDefault()}function Z(e){return Math.max(e-1,0)}const J=l=>{const s=a(29),{store:r,isSelected:n,onClick:c,onSelect:i}=l,[,d]=o(!1),[m,u]=x();let h;s[0]!==c||s[1]!==r.id?(h=()=>{c&&c(r.id)},s[0]=c,s[1]=r.id,s[2]=h):h=s[2];const p=h;let f;s[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=()=>d(!1),s[3]=f):f=s[3];const y=f,b=n;let N;s[4]!==i||s[5]!==r.id?(N=e=>{e.stopPropagation(),i&&i(r.id)},s[4]=i,s[5]=r.id,s[6]=N):N=s[6];const _=N,S=1*r.address?.latitude,w=1*r.address?.longitude;let k;s[7]!==S||s[8]!==w?(k={lat:S,lng:w},s[7]=S,s[8]=w,s[9]=k):k=s[9];const I="w-8 h-8 hover:cursor-pointer "+(n?"text-primary fill-white z-10":"z-1 fill-white text-muted-foreground");let C,L,A;return s[10]!==I?(C=/* @__PURE__ */e(M,{className:I,size:32}),s[10]=I,s[11]=C):C=s[11],s[12]!==_||s[13]!==u||s[14]!==b||s[15]!==r.address?.city||s[16]!==r.address?.postal_code||s[17]!==r.address?.province||s[18]!==r.address?.street_line_one||s[19]!==r.address?.street_line_two||s[20]!==r.retailer_name?(L=b&&/* @__PURE__ */t(g,{anchor:u,headerContent:/* @__PURE__ */e("h3",{className:"font-bold text-sm align-center text-left mb-2",children:r.retailer_name}),onClose:y,children:[
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{c as l}from"react/compiler-runtime";import{createContext as o,useState as s,useContext as r,useRef as n,useId as c,useEffect as i}from"react";import{u as d,a as m}from"./useStoreLocatorConfig-CLD8ogGE.js";import{u}from"./useGeolocation-BEKRqeV7.js";import*as h from"@radix-ui/react-popover";import*as p from"@radix-ui/react-scroll-area";import"@radix-ui/react-slot";import{b as f,c as x,u as g,I as v,A as y,a as b,M as N,m as _,i as S,j as w,k,L as I,n as C,l as L,B as A}from"./index-CPPzJjs-.js";import{useTranslation as j}from"react-i18next";import{c as z,S as M,M as D,B as F,C as O,a as P,L as T}from"./translations-WfjA8013.js";import"@radix-ui/react-collapsible";const q=o(),U=t=>{const a=l(36),{organizationId:o,locale:r,baseUrl:n,products:c,productKey:i,filterBy:h,children:p}=t,f=void 0===n?"/retailers":n;let x;a[0]!==c?(x=void 0===c?[]:c,a[0]=c,a[1]=x):x=a[1];const g=x;let v;a[2]!==h?(v=void 0===h?{stocked:["sku"],available:["sku"]}:h,a[2]=h,a[3]=v):v=a[3];const y=v,[b,N]=s(0),[_,S]=s(null),[w,k]=s(null),[I,C]=s(null),[L,A]=s(!1),[j,z]=s("300mi"),[M,D]=s(null),[F,O]=s("geolocation");let P;a[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(P={autoGeoLocate:!1},a[4]=P):P=a[4];const{location:T,Locate:U}=u(P),E="geolocation"===F?T:M||T;let B;a[5]!==E||a[6]!==o||a[7]!==j?(B={organizationId:o,location:E,page:1,radius:j,pageSize:10},a[5]=E,a[6]=o,a[7]=j,a[8]=B):B=a[8];const{stores:$,meta:H,isLoading:K,error:R}=d(B),{config:W,isLoading:Z,error:J}=m(o);let G;a[9]!==U||a[10]!==f||a[11]!==W||a[12]!==J||a[13]!==Z||a[14]!==y||a[15]!==w||a[16]!==r||a[17]!==E||a[18]!==L||a[19]!==I||a[20]!==H||a[21]!==o||a[22]!==i||a[23]!==g||a[24]!==R||a[25]!==K||a[26]!==M||a[27]!==j||a[28]!==_||a[29]!==b||a[30]!==$||a[31]!==F?(G={stepIndex:b,setStepIndex:N,selectedStoreId:_,setSelectedStoreId:S,focusedStoreId:w,setFocusedStoreId:k,organizationId:o,location:E,locale:r,stores:$,meta:H,searchIsLoading:K,searchError:R,config:W,configIsLoading:Z,configError:J,messageDialogOpen:L,setMessageDialogOpen:A,messageStoreId:I,setMessageStoreId:C,baseUrl:f,searchRadius:j,setSearchRadius:z,searchLocation:M,setSearchLocation:D,useLocationType:F,setUseLocationType:O,products:g,productKey:i,filterBy:y,Locate:U},a[9]=U,a[10]=f,a[11]=W,a[12]=J,a[13]=Z,a[14]=y,a[15]=w,a[16]=r,a[17]=E,a[18]=L,a[19]=I,a[20]=H,a[21]=o,a[22]=i,a[23]=g,a[24]=R,a[25]=K,a[26]=M,a[27]=j,a[28]=_,a[29]=b,a[30]=$,a[31]=F,a[32]=G):G=a[32];const V=G;let Q;return a[33]!==p||a[34]!==V?(Q=/* @__PURE__ */e(q.Provider,{value:V,children:p}),a[33]=p,a[34]=V,a[35]=Q):Q=a[35],Q},E=()=>r(q),B=z("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),$=z("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function H(e){return e?.label??e?.description??e?.text??e?.placePrediction?.text?.text??e?.placePrediction?.structuredFormat?.mainText?.text??""}function K(){const o=l(66),{t:r}=j(),[d,m]=s("");s(!1);const[u,g]=s(!1),[v,y]=s(-1),{location:b,setSearchLocation:N,setUseLocationType:_,Locate:S}=E();let w,k,I;o[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(w={lat:37.7937,lng:-122.3965},o[0]=w):w=o[0],o[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(k=["locality","postal_code"],o[1]=k):k=o[1],o[2]!==d?(I={query:d,apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",center:w,radiusMeters:1e4,types:k},o[2]=d,o[3]=I):I=o[3];const{results:C,isLoading:L,error:A}=f(I);let z;o[4]!==C?(z=Array.isArray(C)?C:[],o[4]=C,o[5]=z):z=o[5];const F=z,O=n(null),P=c(),T=v>=0?`${P}-opt-${v}`:void 0;let q,U,B;o[6]!==L||o[7]!==F.length||o[8]!==u?(q=()=>{u&&(L||y(F.length?0:-1))},U=[u,L,F.length],o[6]=L,o[7]=F.length,o[8]=u,o[9]=q,o[10]=U):(q=o[9],U=o[10]),i(q,U),o[11]!==N||o[12]!==_?(B=e=>{const t=H(e);if(!t)return;m(t),g(!1),requestAnimationFrame(()=>O.current?.focus());const a={latitude:e.location?.lat??null,longitude:e.location?.lng??null,accuracy:null,altitude:0,altitudeAccuracy:null,heading:null,speed:null,city:e.city??null,region:e.region??null,country:e.country??null,postal:e.postalCode??null,timezone:null,ip:null,type:"search",raw:e};N(a),_("search")},o[11]=N,o[12]=_,o[13]=B):B=o[13];const $=B;let K;o[14]!==v||o[15]!==$||o[16]!==F||o[17]!==u?(K=e=>{if(u||"ArrowDown"!==e.key&&"ArrowUp"!==e.key){if(u)e:switch(e.key){case"ArrowDown":e.preventDefault(),y(e=>Math.min(e+1,F.length-1));break e;case"ArrowUp":e.preventDefault(),y(Z);break e;case"Enter":v>=0&&F[v]&&(e.preventDefault(),$(F[v]));break e;case"Escape":e.preventDefault(),g(!1)}}else g(!0)},o[14]=v,o[15]=$,o[16]=F,o[17]=u,o[18]=K):K=o[18];const J=K;let G;o[19]!==S||o[20]!==_?(G=()=>{_("geolocation"),g(!1),m(""),S()},o[19]=S,o[20]=_,o[21]=G):G=o[21];const V=G;let Q;o[22]!==A||o[23]!==L||o[24]!==F.length||o[25]!==u||o[26]!==d?(Q=u&&!L&&!A&&d.trim().length>0&&0===F.length,o[22]=A,o[23]=L,o[24]=F.length,o[25]=u,o[26]=d,o[27]=Q):Q=o[27];const Y=Q,X=L||!!A||Y||F.length>0;let ee,te,ae,le,oe,se,re,ne,ce,ie,de,me;return o[28]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ee=/* @__PURE__ */e(M,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),o[28]=ee):ee=o[28],o[29]!==b||o[30]!==r?(te=b?.city?r("default:location_search_placeholder_w_location",{location:b.city}):r("default:location_search_placeholder"),o[29]=b,o[30]=r,o[31]=te):te=o[31],o[32]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ae=e=>{m(e.target.value),g(!0)},le=()=>g(!0),o[32]=ae,o[33]=le):(ae=o[32],le=o[33]),o[34]!==T||o[35]!==P||o[36]!==J||o[37]!==u||o[38]!==d||o[39]!==te?(oe=/* @__PURE__ */e(h.Anchor,{asChild:!0,children:/* @__PURE__ */t("div",{className:"flex-1 relative",children:[ee,
2
+ /* @__PURE__ */e(x,{ref:O,type:"text",placeholder:te,value:d,onChange:ae,onFocus:le,onKeyDown:J,className:"pl-10 h-12",role:"combobox","aria-autocomplete":"list","aria-expanded":u,"aria-controls":P,"aria-activedescendant":T})]})}),o[34]=T,o[35]=P,o[36]=J,o[37]=u,o[38]=d,o[39]=te,o[40]=oe):oe=o[40],o[41]!==v||o[42]!==$||o[43]!==A||o[44]!==L||o[45]!==F||o[46]!==P||o[47]!==X||o[48]!==Y||o[49]!==r?(se=X?/* @__PURE__ */t(a,{children:[
3
+ /* @__PURE__ */e(p.Viewport,{children:/* @__PURE__ */t("div",{id:P,role:"listbox",className:"p-2",children:[A?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm rounded-md border border-destructive/30 bg-destructive/10 text-destructive",children:String(A)}):null,L?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:r("default:loading")}):null,Y?/* @__PURE__ */e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:r("default:no_results")}):null,!L&&!A&&F.map((a,l)=>{const o=l===v,s=H(a),r=(n=a,n?.secondary??n?.secondary_text??n?.placePrediction?.structuredFormat?.secondaryText?.text??n?.placePrediction?.structuredFormat?.secondaryText??"");var n;const c=function(e,t){return e?.id??e?.place_id??e?.placePrediction?.placeId??t}(a,`${l}`);return s?/* @__PURE__ */t("div",{id:`${P}-opt-${l}`,role:"option","aria-selected":o,onMouseEnter:()=>y(l),onMouseDown:R,onClick:()=>$(a),className:["cursor-pointer rounded-lg px-3 py-2",o?"bg-muted":"hover:bg-muted/60"].join(" "),children:[
4
+ /* @__PURE__ */e("div",{className:"text-sm text-left font-medium leading-tight",children:s}),r?/* @__PURE__ */e("div",{className:"text-xs text-left text-muted-foreground mt-1 leading-tight",children:r}):null]},c):null})]})}),
5
+ /* @__PURE__ */e(p.Scrollbar,{orientation:"vertical",className:"flex select-none touch-none p-0.5 bg-transparent",children:/* @__PURE__ */e(p.Thumb,{className:"flex-1 bg-border rounded-full"})})]}):null,o[41]=v,o[42]=$,o[43]=A,o[44]=L,o[45]=F,o[46]=P,o[47]=X,o[48]=Y,o[49]=r,o[50]=se):se=o[50],o[51]!==se?(re=/* @__PURE__ */e(h.Content,{sideOffset:6,align:"start",onOpenAutoFocus:W,className:"w-[var(--radix-popover-trigger-width)] max-w-[560px] rounded-xl border rounded bg-background shadow-lg overflow-hidden",children:/* @__PURE__ */e(p.Root,{className:"max-h-80",children:se})}),o[51]=se,o[52]=re):re=o[52],o[53]!==u||o[54]!==oe||o[55]!==re?(ne=/* @__PURE__ */e("div",{className:"flex flex-row gap-4",children:/* @__PURE__ */t(h.Root,{open:u,onOpenChange:g,children:[oe,re]})}),o[53]=u,o[54]=oe,o[55]=re,o[56]=ne):ne=o[56],o[57]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(ce=/* @__PURE__ */e(D,{className:"w-4 h-4"}),o[57]=ce):ce=o[57],o[58]!==r?(ie=r("default:use_my_location"),o[58]=r,o[59]=ie):ie=o[59],o[60]!==V||o[61]!==ie?(de=/* @__PURE__ */t("div",{className:"mt-2 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[ce,
6
+ /* @__PURE__ */e("button",{className:"text-primary hover:underline font-medium",type:"button",onClick:V,children:ie})]}),o[60]=V,o[61]=ie,o[62]=de):de=o[62],o[63]!==ne||o[64]!==de?(me=/* @__PURE__ */e("div",{className:"max-w-3xl mx-auto",children:/* @__PURE__ */t("div",{className:"rounded-xl p-6",children:[ne,de]})}),o[63]=ne,o[64]=de,o[65]=me):me=o[65],me}function R(e){return e.preventDefault()}function W(e){return e.preventDefault()}function Z(e){return Math.max(e-1,0)}const J=a=>{const o=l(29),{store:r,isSelected:n,onClick:c,onSelect:i}=a,[,d]=s(!1),[m,u]=g();let h;o[0]!==c||o[1]!==r.id?(h=()=>{c&&c(r.id)},o[0]=c,o[1]=r.id,o[2]=h):h=o[2];const p=h;let f;o[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=()=>d(!1),o[3]=f):f=o[3];const x=f,b=n;let N;o[4]!==i||o[5]!==r.id?(N=e=>{e.stopPropagation(),i&&i(r.id)},o[4]=i,o[5]=r.id,o[6]=N):N=o[6];const _=N,S=1*r.address?.latitude,w=1*r.address?.longitude;let k;o[7]!==S||o[8]!==w?(k={lat:S,lng:w},o[7]=S,o[8]=w,o[9]=k):k=o[9];const I="w-8 h-8 hover:cursor-pointer "+(n?"text-primary fill-white z-10":"z-1 fill-white text-muted-foreground");let C,L,A;return o[10]!==I?(C=/* @__PURE__ */e(D,{className:I,size:32}),o[10]=I,o[11]=C):C=o[11],o[12]!==_||o[13]!==u||o[14]!==b||o[15]!==r.address?.city||o[16]!==r.address?.postal_code||o[17]!==r.address?.province||o[18]!==r.address?.street_line_one||o[19]!==r.address?.street_line_two||o[20]!==r.retailer_name?(L=b&&/* @__PURE__ */t(v,{anchor:u,headerContent:/* @__PURE__ */e("h3",{className:"cc-iw-title font-bold text-sm align-center text-left mb-2",style:{color:"#111827"},children:r.retailer_name}),onClose:x,children:[
5
7
  /* @__PURE__ */t("p",{className:"text-xs text-left text-muted-foreground",children:[r.address?.street_line_one,r.address?.street_line_two?`, ${r.address?.street_line_two}`:""]}),
6
8
  /* @__PURE__ */t("p",{className:"text-xs text-left text-muted-foreground mb-2",children:[r.address?.city,", ",r.address?.province," ",r.address?.postal_code]}),
7
- /* @__PURE__ */e("div",{className:"flex flex-row gap-2 mb-1",children:/* @__PURE__ */e(D,{className:"flex-1 md:flex-row",size:"sm",onClick:_,children:"Select"})})]}),s[12]=_,s[13]=u,s[14]=b,s[15]=r.address?.city,s[16]=r.address?.postal_code,s[17]=r.address?.province,s[18]=r.address?.street_line_one,s[19]=r.address?.street_line_two,s[20]=r.retailer_name,s[21]=L):L=s[21],s[22]!==p||s[23]!==m||s[24]!==r.name||s[25]!==k||s[26]!==C||s[27]!==L?(A=/* @__PURE__ */t(v,{position:k,ref:m,title:r.name,onClick:p,children:[C,L]}),s[22]=p,s[23]=m,s[24]=r.name,s[25]=k,s[26]=C,s[27]=L,s[28]=A):A=s[28],A},K=()=>{const l=a(46),{location:o,stores:s,focusedStoreId:r,setFocusedStoreId:n,setSelectedStoreId:i,setStepIndex:d}=U(),m=y();let u;l[0]!==m?(u=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e+1)},l[0]=m,l[1]=u):u=l[1];const h=u;let p;l[2]!==m?(p=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e-1)},l[2]=m,l[3]=p):p=l[3];const f=p;let x,g,v,N,_;l[4]!==o||l[5]!==m?(x=()=>{m&&o?.latitude&&o?.longitude&&(m.panTo({lat:o.latitude,lng:o.longitude}),m.setZoom(9))},g=[o,m],l[4]=o,l[5]=m,l[6]=x,l[7]=g):(x=l[6],g=l[7]),c(x,g),l[8]!==r||l[9]!==m||l[10]!==s?(v=()=>{if(!m||!r)return;const e=s.find(e=>e.id===r);e&&e.address&&m.panTo({lat:1*e.address.latitude,lng:1*e.address.longitude})},N=[r,s,m],l[8]=r,l[9]=m,l[10]=s,l[11]=v,l[12]=N):(v=l[11],N=l[12]),c(v,N),l[13]!==n?(_=e=>{n(e)},l[13]=n,l[14]=_):_=l[14];const S=_;let w;l[15]!==i||l[16]!==d?(w=e=>{i(e),d(1)},l[15]=i,l[16]=d,l[17]=w):w=l[17];const k=w;let I,C,L,A,j,z,M,D,F,O,P;if(l[18]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(I={width:"100%",height:"300px"},C={lat:22.54992,lng:0},l[18]=I,l[19]=C):(I=l[18],C=l[19]),l[20]!==r||l[21]!==S||l[22]!==k||l[23]!==s){let t;l[25]!==r||l[26]!==S||l[27]!==k?(t=t=>/* @__PURE__ */e(J,{store:t,isSelected:r===t.id,onClick:S,onSelect:k},t.id),l[25]=r,l[26]=S,l[27]=k,l[28]=t):t=l[28],L=s.map(t),l[20]=r,l[21]=S,l[22]=k,l[23]=s,l[24]=L}else L=l[24];return l[29]!==L?(A=/* @__PURE__ */e("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/5 to-muted",children:/* @__PURE__ */e("div",{className:"text-center w-full",children:/* @__PURE__ */e(b,{style:I,defaultCenter:C,defaultZoom:3,gestureHandling:"greedy",disableDefaultUI:!0,mapId:"b1e4f5f5f8c7e2d9",children:L})})}),l[29]=L,l[30]=A):A=l[30],l[31]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(j=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),l[31]=j):j=l[31],l[32]!==h?(z=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:h,children:j}),l[32]=h,l[33]=z):z=l[33],l[34]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(M=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})}),l[34]=M):M=l[34],l[35]!==f?(D=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:f,children:M}),l[35]=f,l[36]=D):D=l[36],l[37]!==z||l[38]!==D?(F=/* @__PURE__ */t("div",{className:"absolute top-4 right-4 flex flex-col gap-2",children:[z,D]}),l[37]=z,l[38]=D,l[39]=F):F=l[39],l[40]!==s.length?(O=/* @__PURE__ */t("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 bg-card border shadow-lg rounded-full px-4 py-2 text-sm font-medium",children:[
8
- /* @__PURE__ */e("span",{className:"text-primary",children:s.length})," stores found"]}),l[40]=s.length,l[41]=O):O=l[41],l[42]!==A||l[43]!==F||l[44]!==O?(P=/* @__PURE__ */e("div",{className:"relative",children:/* @__PURE__ */t("div",{className:"bg-muted rounded-xl overflow-hidden border shadow-md h-[300px]",children:[A,F,O]})}),l[42]=A,l[43]=F,l[44]=O,l[45]=P):P=l[45],P},V=l=>{const o=a(65),{id:s,name:r,addressLineOne:n,city:c,province:i,postalCode:d,hours:m,distance:u,services:h,isFocused:p,handleFocus:f,handleSelect:x,requestedProducts:g,locationProducts:v}=l;let y;o[0]!==h?(y=void 0===h?[]:h,o[0]=h,o[1]=y):y=o[1];const b=y;let S;o[2]!==g?(S=void 0===g?[]:g,o[2]=g,o[3]=S):S=o[3];const w=S;let k;o[4]!==v?(k=void 0===v?[]:v,o[4]=v,o[5]=k):k=o[5];const I=k,{t:C}=A(),{availabilitySummary:L}=((e,t,a=["sku"])=>{const l={};t.map(t=>{const o=e.find(e=>a.some(a=>e[a]===t[a]));l[t.sku]=o?{stocked:o.stocked,available:o.available}:{stocked:!1,available:!1}});const o=Object.values(l).every(e=>e.stocked),s=Object.values(l).every(e=>e.available),r=Object.values(l).every(e=>!e.stocked),n=Object.values(l).every(e=>!e.available);let c="mixed";return o?c="allStocked":s?c="allAvailable":r&&n&&(c="none"),{availability:l,allAvailable:s,allStocked:o,noneStocked:r,noneAvailable:n,availabilitySummary:c}})(I,w);let j;o[6]!==x||o[7]!==s?(j=e=>{e.stopPropagation(),x(s)},o[6]=x,o[7]=s,o[8]=j):j=o[8];const z=j,O="bg-card border rounded-xl p-6 transition-all hover:shadow-lg cursor-pointer "+(p?"ring-2 ring-primary shadow-lg":"");let P,T,q,U,B,H,R,W,Z,J,K,V,Q,Y,X,ee,te,ae,le,oe,se;return o[9]!==f||o[10]!==s?(P=()=>f(s),o[9]=f,o[10]=s,o[11]=P):P=o[11],o[12]!==r?(T=/* @__PURE__ */e("div",{className:"flex items-start justify-between gap-4 mb-3",children:/* @__PURE__ */e("div",{children:/* @__PURE__ */e("h3",{className:"font-bold text-lg text-left mb-1",children:r})})}),o[12]=r,o[13]=T):T=o[13],o[14]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(q=/* @__PURE__ */e(M,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),o[14]=q):q=o[14],o[15]!==n?(U=/* @__PURE__ */e("p",{className:"font-medium text-left",children:n}),o[15]=n,o[16]=U):U=o[16],o[17]!==c||o[18]!==d||o[19]!==i?(B=/* @__PURE__ */t("p",{className:"text-muted-foreground text-left",children:[c,", ",i," ",d]}),o[17]=c,o[18]=d,o[19]=i,o[20]=B):B=o[20],o[21]!==u||o[22]!==C?(H=C("default:distance_away",{distance:N(u).toFixed(1),distanceUnit:"miles"}),o[21]=u,o[22]=C,o[23]=H):H=o[23],o[24]!==H?(R=/* @__PURE__ */e("p",{className:"text-primary font-medium mt-1 text-left",children:H}),o[24]=H,o[25]=R):R=o[25],o[26]!==U||o[27]!==B||o[28]!==R?(W=/* @__PURE__ */t("div",{className:"flex items-start gap-2",children:[q,
9
- /* @__PURE__ */t("div",{children:[U,B,R]})]}),o[26]=U,o[27]=B,o[28]=R,o[29]=W):W=o[29],o[30]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(Z=/* @__PURE__ */e("div",{className:"mt-2.5",children:/* @__PURE__ */e(F,{className:"w-4 h-4 text-muted-foreground"})}),o[30]=Z):Z=o[30],o[31]!==m?(J=/* @__PURE__ */t("div",{className:"flex items-top gap-2",children:[Z,
10
- /* @__PURE__ */e("span",{className:"text-muted-foreground",children:/* @__PURE__ */e(_,{hours:m})})]}),o[31]=m,o[32]=J):J=o[32],o[33]!==W||o[34]!==J?(K=/* @__PURE__ */t("div",{className:"space-y-2 text-sm",children:[W,J]}),o[33]=W,o[34]=J,o[35]=K):K=o[35],o[36]!==L?(V="allStocked"===L&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-green-50 text-green-600 text-xs font-medium rounded-full",children:[
11
- /* @__PURE__ */e(E,{className:"w-4 h-4 text-green-600 me-1"}),"All Items Stocked"]}),o[36]=L,o[37]=V):V=o[37],o[38]!==L?(Q="allAvailable"===L&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-medium rounded-full",children:[
12
- /* @__PURE__ */e($,{className:"w-4 me-1 h-4 text-orange-600"}),"Available by Special Order"]}),o[38]=L,o[39]=Q):Q=o[39],o[40]!==L?(Y="mixed"===L&&/* @__PURE__ */t("div",{children:[
9
+ /* @__PURE__ */e("div",{className:"flex flex-row gap-2 mb-1",children:/* @__PURE__ */e(F,{className:"flex-1 md:flex-row",size:"sm",onClick:_,children:"Select"})})]}),o[12]=_,o[13]=u,o[14]=b,o[15]=r.address?.city,o[16]=r.address?.postal_code,o[17]=r.address?.province,o[18]=r.address?.street_line_one,o[19]=r.address?.street_line_two,o[20]=r.retailer_name,o[21]=L):L=o[21],o[22]!==p||o[23]!==m||o[24]!==r.name||o[25]!==k||o[26]!==C||o[27]!==L?(A=/* @__PURE__ */t(y,{position:k,ref:m,title:r.name,onClick:p,children:[C,L]}),o[22]=p,o[23]=m,o[24]=r.name,o[25]=k,o[26]=C,o[27]=L,o[28]=A):A=o[28],A},G=()=>{const a=l(46),{location:o,stores:s,focusedStoreId:r,setFocusedStoreId:n,setSelectedStoreId:c,setStepIndex:d}=E(),m=b();let u;a[0]!==m?(u=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e+1)},a[0]=m,a[1]=u):u=a[1];const h=u;let p;a[2]!==m?(p=()=>{if(!m)return;const e=m.getZoom();m.setZoom(e-1)},a[2]=m,a[3]=p):p=a[3];const f=p;let x,g,v,y,_;a[4]!==o||a[5]!==m?(x=()=>{m&&o?.latitude&&o?.longitude&&(m.panTo({lat:o.latitude,lng:o.longitude}),m.setZoom(9))},g=[o,m],a[4]=o,a[5]=m,a[6]=x,a[7]=g):(x=a[6],g=a[7]),i(x,g),a[8]!==r||a[9]!==m||a[10]!==s?(v=()=>{if(!m||!r)return;const e=s.find(e=>e.id===r);e&&e.address&&m.panTo({lat:1*e.address.latitude,lng:1*e.address.longitude})},y=[r,s,m],a[8]=r,a[9]=m,a[10]=s,a[11]=v,a[12]=y):(v=a[11],y=a[12]),i(v,y),a[13]!==n?(_=e=>{n(e)},a[13]=n,a[14]=_):_=a[14];const S=_;let w;a[15]!==c||a[16]!==d?(w=e=>{c(e),d(1)},a[15]=c,a[16]=d,a[17]=w):w=a[17];const k=w;let I,C,L,A,j,z,M,D,F,O,P;if(a[18]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(I={width:"100%",height:"300px"},C={lat:22.54992,lng:0},a[18]=I,a[19]=C):(I=a[18],C=a[19]),a[20]!==r||a[21]!==S||a[22]!==k||a[23]!==s){let t;a[25]!==r||a[26]!==S||a[27]!==k?(t=t=>/* @__PURE__ */e(J,{store:t,isSelected:r===t.id,onClick:S,onSelect:k},t.id),a[25]=r,a[26]=S,a[27]=k,a[28]=t):t=a[28],L=s.map(t),a[20]=r,a[21]=S,a[22]=k,a[23]=s,a[24]=L}else L=a[24];return a[29]!==L?(A=/* @__PURE__ */e("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/5 to-muted",children:/* @__PURE__ */e("div",{className:"text-center w-full",children:/* @__PURE__ */e(N,{style:I,defaultCenter:C,defaultZoom:3,gestureHandling:"greedy",disableDefaultUI:!0,mapId:"b1e4f5f5f8c7e2d9",children:L})})}),a[29]=L,a[30]=A):A=a[30],a[31]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(j=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),a[31]=j):j=a[31],a[32]!==h?(z=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:h,children:j}),a[32]=h,a[33]=z):z=a[33],a[34]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(M=/* @__PURE__ */e("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})}),a[34]=M):M=a[34],a[35]!==f?(D=/* @__PURE__ */e("button",{className:"bg-card border shadow-md rounded-lg p-2 hover:bg-accent transition-colors",onClick:f,children:M}),a[35]=f,a[36]=D):D=a[36],a[37]!==z||a[38]!==D?(F=/* @__PURE__ */t("div",{className:"absolute top-4 right-4 flex flex-col gap-2",children:[z,D]}),a[37]=z,a[38]=D,a[39]=F):F=a[39],a[40]!==s.length?(O=/* @__PURE__ */t("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 bg-card border shadow-lg rounded-full px-4 py-2 text-sm font-medium",children:[
10
+ /* @__PURE__ */e("span",{className:"text-primary",children:s.length})," stores found"]}),a[40]=s.length,a[41]=O):O=a[41],a[42]!==A||a[43]!==F||a[44]!==O?(P=/* @__PURE__ */e("div",{className:"relative",children:/* @__PURE__ */t("div",{className:"bg-muted rounded-xl overflow-hidden border shadow-md h-[300px]",children:[A,F,O]})}),a[42]=A,a[43]=F,a[44]=O,a[45]=P):P=a[45],P},V=a=>{const o=l(61),{id:s,name:r,addressLineOne:n,city:c,province:i,postalCode:d,hours:m,distance:u,services:h,isFocused:p,handleFocus:f,handleSelect:x,requestedProducts:g,locationProducts:v,filterBy:y}=a,b=void 0===h?[]:h;let N;o[0]!==g?(N=void 0===g?[]:g,o[0]=g,o[1]=N):N=o[1];const w=N;let k;o[2]!==v?(k=void 0===v?[]:v,o[2]=v,o[3]=k):k=o[3];const I=k,C=void 0===y?"sku":y,{t:L}=j(),{availabilitySummary:A}=((e,t,a=["sku"])=>{const l={};t.map(t=>{const o=e.find(e=>a.some(a=>e[a]===t.key));l[t.sku]=o?{stocked:o.stocked,available:o.available}:{stocked:!1,available:!1}});const o=Object.values(l).every(e=>e.stocked),s=Object.values(l).every(e=>e.available),r=Object.values(l).every(e=>!e.stocked),n=Object.values(l).every(e=>!e.available);let c="mixed";return o?c="allStocked":s?c="allAvailable":r&&n&&(c="none"),{availability:l,allAvailable:s,allStocked:o,noneStocked:r,noneAvailable:n,availabilitySummary:c}})(I,w,C);let z;o[4]!==x||o[5]!==s?(z=e=>{e.stopPropagation(),x(s)},o[4]=x,o[5]=s,o[6]=z):z=o[6];const M=z,P="bg-card border rounded-xl p-6 transition-all hover:shadow-lg cursor-pointer "+(p?"ring-2 ring-primary shadow-lg":"");let T,q,U,E,H,K,R,W,Z,J,G,V,X,ee;o[7]!==f||o[8]!==s?(T=()=>f(s),o[7]=f,o[8]=s,o[9]=T):T=o[9],o[10]!==r?(q=/* @__PURE__ */e("div",{className:"flex items-start justify-between gap-4 mb-3",children:/* @__PURE__ */e("div",{children:/* @__PURE__ */e("h3",{className:"font-bold text-lg text-left mb-1",children:r})})}),o[10]=r,o[11]=q):q=o[11],o[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(U=/* @__PURE__ */e(D,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),o[12]=U):U=o[12],o[13]!==n?(E=/* @__PURE__ */e("p",{className:"font-medium text-left",children:n}),o[13]=n,o[14]=E):E=o[14],o[15]!==c||o[16]!==d||o[17]!==i?(H=/* @__PURE__ */t("p",{className:"text-muted-foreground text-left",children:[c,", ",i," ",d]}),o[15]=c,o[16]=d,o[17]=i,o[18]=H):H=o[18],o[19]!==u||o[20]!==L?(K=L("default:distance_away",{distance:_(u).toFixed(1),distanceUnit:"miles"}),o[19]=u,o[20]=L,o[21]=K):K=o[21],o[22]!==K?(R=/* @__PURE__ */e("p",{className:"text-primary font-medium mt-1 text-left",children:K}),o[22]=K,o[23]=R):R=o[23],o[24]!==E||o[25]!==H||o[26]!==R?(W=/* @__PURE__ */t("div",{className:"flex items-start gap-2",children:[U,
11
+ /* @__PURE__ */t("div",{children:[E,H,R]})]}),o[24]=E,o[25]=H,o[26]=R,o[27]=W):W=o[27],o[28]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(Z=/* @__PURE__ */e("div",{className:"mt-2.5",children:/* @__PURE__ */e(O,{className:"w-4 h-4 text-muted-foreground"})}),o[28]=Z):Z=o[28],o[29]!==m?(J=/* @__PURE__ */t("div",{className:"flex items-top gap-2",children:[Z,
12
+ /* @__PURE__ */e("span",{className:"text-muted-foreground",children:/* @__PURE__ */e(S,{hours:m})})]}),o[29]=m,o[30]=J):J=o[30],o[31]!==W||o[32]!==J?(G=/* @__PURE__ */t("div",{className:"space-y-2 text-sm",children:[W,J]}),o[31]=W,o[32]=J,o[33]=G):G=o[33],o[34]!==A?(V="allStocked"===A&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-green-50 text-green-600 text-xs font-medium rounded-full",children:[
13
+ /* @__PURE__ */e(B,{className:"w-4 h-4 text-green-600 me-1"}),"All Items Stocked"]}),o[34]=A,o[35]=V):V=o[35],o[36]!==A?(X="allAvailable"===A&&/* @__PURE__ */t("div",{className:"flex items-center shrink mt-3 px-3 py-1 bg-orange-50 text-orange-600 text-xs font-medium rounded-full",children:[
14
+ /* @__PURE__ */e($,{className:"w-4 me-1 h-4 text-orange-600"}),"Available by Special Order"]}),o[36]=A,o[37]=X):X=o[37],o[38]!==A?(ee="mixed"===A&&/* @__PURE__ */t("div",{children:[
13
15
  /* @__PURE__ */t("div",{className:"flex items-center gap-2 mt-4 text-sm",children:[
14
16
  /* @__PURE__ */e("span",{className:"font-bold w-28 text-wrap",children:"Braxton"}),
15
17
  /* @__PURE__ */t("span",{className:"flex items-center px-3 py-1 bg-orange-50 text-orange-600 text-xs font-medium rounded-full",children:[
@@ -17,8 +19,13 @@ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as a}from"react/compi
17
19
  /* @__PURE__ */t("div",{className:"flex items-center gap-2 mt-4 text-sm",children:[
18
20
  /* @__PURE__ */e("span",{className:"font-bold w-28 text-wrap",children:"Juno"}),
19
21
  /* @__PURE__ */t("span",{className:"flex items-center px-3 py-1 bg-green-50 text-green-600 text-xs font-medium rounded-full",children:[
20
- /* @__PURE__ */e(E,{className:"w-4 me-1 h-4 text-green-600"}),"Stocked"]})]})]}),o[40]=L,o[41]=Y):Y=o[41],o[42]!==b?(X=b.map(G),o[42]=b,o[43]=X):X=o[43],o[44]!==X?(ee=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2 mt-4",children:X}),o[44]=X,o[45]=ee):ee=o[45],o[46]!==T||o[47]!==K||o[48]!==V||o[49]!==Q||o[50]!==Y||o[51]!==ee?(te=/* @__PURE__ */t("div",{className:"flex-1",children:[T,K,V,Q,Y,ee]}),o[46]=T,o[47]=K,o[48]=V,o[49]=Q,o[50]=Y,o[51]=ee,o[52]=te):te=o[52],o[53]!==C?(ae=C("default:select_store"),o[53]=C,o[54]=ae):ae=o[54],o[55]!==z||o[56]!==ae?(le=/* @__PURE__ */e("div",{className:"flex md:flex-col gap-2",children:/* @__PURE__ */e(D,{onClick:z,variant:"default",className:"whitespace-nowrap",children:ae})}),o[55]=z,o[56]=ae,o[57]=le):le=o[57],o[58]!==te||o[59]!==le?(oe=/* @__PURE__ */t("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[te,le]}),o[58]=te,o[59]=le,o[60]=oe):oe=o[60],o[61]!==oe||o[62]!==O||o[63]!==P?(se=/* @__PURE__ */e("div",{className:O,onClick:P,children:oe}),o[61]=oe,o[62]=O,o[63]=P,o[64]=se):se=o[64],se};function G(t){/* @__PURE__ */
21
- return e("span",{className:"px-3 py-1 bg-primary/10 text-primary text-xs font-medium rounded-full",children:t},t)}function Q(){const l=a(27),{stores:o,location:s,products:r,setStepIndex:n,setSelectedStoreId:c,searchIsLoading:i,searchError:d,baseUrl:m,focusedStoreId:u,setFocusedStoreId:h}=U();let p;l[0]!==c||l[1]!==n?(p=e=>{c(e),n(1)},l[0]=c,l[1]=n,l[2]=p):p=l[2];const f=p;let x,g,v,y,b;return l[3]!==d||l[4]!==i||l[5]!==o?(x=!i&&!d&&0===o.length&&/* @__PURE__ */e(S,{}),l[3]=d,l[4]=i,l[5]=o,l[6]=x):x=l[6],l[7]!==i?(g=i&&/* @__PURE__ */e("div",{className:"flex items-center justify-center h-48",children:/* @__PURE__ */e(k,{})}),l[7]=i,l[8]=g):g=l[8],l[9]!==m||l[10]!==u||l[11]!==f||l[12]!==s||l[13]!==r||l[14]!==d||l[15]!==i||l[16]!==h||l[17]!==o?(v=!i&&!d&&o.map(t=>/* @__PURE__ */e(V,{id:t.id,name:t.retailer_name,placeId:t.place_id,addressLineOne:t.address?.street_line_one,addressLineTwo:t.address?.street_line_two,city:t.address?.city,province:t.address?.province,postalCode:t.address?.postal_code,country:t.address?.country,distance:w(s.latitude,s.longitude,t.address?.latitude,t.address?.longitude),phone:t.phone_number,hours:t.retailer_location_hours,services:[t.store_type],isFocused:u===t.id,handleFocus:h,href:`${m}/${t.id}`,handleSelect:f,locationProducts:t.retailer_location_products,requestedProducts:r},t.id)),l[9]=m,l[10]=u,l[11]=f,l[12]=s,l[13]=r,l[14]=d,l[15]=i,l[16]=h,l[17]=o,l[18]=v):v=l[18],l[19]!==d||l[20]!==i?(y=!i&&d&&/* @__PURE__ */e("div",{className:"text-red-600 text-center",children:"An error occurred while searching for stores. Please try again."}),l[19]=d,l[20]=i,l[21]=y):y=l[21],l[22]!==x||l[23]!==g||l[24]!==v||l[25]!==y?(b=/* @__PURE__ */t("div",{className:"space-y-4",children:[x,g,v,y]}),l[22]=x,l[23]=g,l[24]=v,l[25]=y,l[26]=b):b=l[26],b}const Y=t=>{const l=a(9),{onClose:o,onSuccess:s}=t,{organizationId:r,location:n,selectedStoreId:c,products:i}=U();let d;l[0]!==s?(d=(e,t)=>{s&&s({formValues:e,lead:t})},l[0]=s,l[1]=d):d=l[1];const m=d;let u;return l[2]!==m||l[3]!==n||l[4]!==o||l[5]!==r||l[6]!==i||l[7]!==c?(u=/* @__PURE__ */e(I,{onClose:o,products:i,activityType:"LeadActivity::QuoteRequest",onSuccess:m,location:n,organizationId:r,selectedLocationId:c}),l[2]=m,l[3]=n,l[4]=o,l[5]=r,l[6]=i,l[7]=c,l[8]=u):u=l[8],u};function X(t){const l=a(8),{active:o,children:s,className:r}=t,n=o?"open":"closed";let c,i,d;return l[0]!==r?(c=O("absolute inset-0","transition duration-300 ease-out will-change-transform","data-[state=closed]:pointer-events-none",r),l[0]=r,l[1]=c):c=l[1],l[2]!==s?(i=/* @__PURE__ */e("div",{className:"w-full h-[100%]",children:s}),l[2]=s,l[3]=i):i=l[3],l[4]!==n||l[5]!==c||l[6]!==i?(d=/* @__PURE__ */e("div",{"data-state":n,className:c,children:i}),l[4]=n,l[5]=c,l[6]=i,l[7]=d):d=l[7],d}const ee=l=>{const o=a(31),{onClose:s,onSuccess:r}=l,{stepIndex:n,setStepIndex:c}=U();let i;o[0]!==s?(i=()=>{s&&s()},o[0]=s,o[1]=i):i=o[1];const d=i;let m;o[2]!==r||o[3]!==c?(m=e=>{c(2),r&&r(e)},o[2]=r,o[3]=c,o[4]=m):m=o[4];const u=m,h=0===n;let p,f,x,g;o[5]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(p=O("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6"),o[5]=p):p=o[5],o[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=/* @__PURE__ */e(H,{}),o[6]=f):f=o[6],o[7]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(x=/* @__PURE__ */t("div",{className:"relative px-1 h-screen overflow-y-scroll",children:[f,
22
- /* @__PURE__ */e("div",{className:"pb-8",children:/* @__PURE__ */e(C,{apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",children:/* @__PURE__ */e(K,{})})}),
23
- /* @__PURE__ */e(Q,{})]}),o[7]=x):x=o[7],o[8]!==h?(g=/* @__PURE__ */e(X,{active:h,className:p,children:x}),o[8]=h,o[9]=g):g=o[9];const v=1===n;let y,b,N,_;o[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=O("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),o[10]=y):y=o[10],o[11]!==c?(b=()=>c(0),o[11]=c,o[12]=b):b=o[12],o[13]!==u||o[14]!==b?(N=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */e(Y,{onClose:b,onSuccess:u})}),o[13]=u,o[14]=b,o[15]=N):N=o[15],o[16]!==N||o[17]!==v?(_=/* @__PURE__ */e(X,{active:v,className:y,children:N}),o[16]=N,o[17]=v,o[18]=_):_=o[18];const S=2===n;let w,k,I,A,j,z;return o[19]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(w=O("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),o[19]=w):w=o[19],o[20]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(k=/* @__PURE__ */e("h2",{className:"text-2xl font-semibold mb-4",children:"Thank you!"}),I=/* @__PURE__ */e("p",{className:"mb-8",children:"Your quote request has been submitted successfully. We will get back to you shortly."}),o[20]=k,o[21]=I):(k=o[20],I=o[21]),o[22]!==d?(A=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */t("div",{className:"text-center py-20 px-4",children:[k,I,
24
- /* @__PURE__ */e(L,{onClick:d,children:"Close"})]})}),o[22]=d,o[23]=A):A=o[23],o[24]!==S||o[25]!==A?(j=/* @__PURE__ */e(X,{active:S,className:w,children:A}),o[24]=S,o[25]=A,o[26]=j):j=o[26],o[27]!==_||o[28]!==j||o[29]!==g?(z=/* @__PURE__ */e("div",{className:"relative overflow-hidden h-[100%] py-1",children:/* @__PURE__ */t("div",{className:"h-[100%] relative",children:[g,_,j]})}),o[27]=_,o[28]=j,o[29]=g,o[30]=z):z=o[30],z},te=t=>{const l=a(17),{organizationId:o,products:s,locale:r,onClose:n,onSuccess:c}=t;let i,d,m,u,h;return l[0]!==r?(i={lng:r},l[0]=r,l[1]=i):i=l[1],l[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(d={height:"100%"},l[2]=d):d=l[2],l[3]!==r||l[4]!==n||l[5]!==c||l[6]!==o||l[7]!==s?(m=/* @__PURE__ */e("div",{className:"cc",style:d,children:/* @__PURE__ */e(ee,{organizationId:o,products:s,locale:r,onClose:n,onSuccess:c})}),l[3]=r,l[4]=n,l[5]=c,l[6]=o,l[7]=s,l[8]=m):m=l[8],l[9]!==r||l[10]!==o||l[11]!==s||l[12]!==m?(u=/* @__PURE__ */e(q,{organizationId:o,products:s,locale:r,children:m}),l[9]=r,l[10]=o,l[11]=s,l[12]=m,l[13]=u):u=l[13],l[14]!==i||l[15]!==u?(h=/* @__PURE__ */e(P,{options:i,children:u}),l[14]=i,l[15]=u,l[16]=h):h=l[16],h};export{te as default};
22
+ /* @__PURE__ */e(B,{className:"w-4 me-1 h-4 text-green-600"}),"Stocked"]})]})]}),o[38]=A,o[39]=ee):ee=o[39];const te=b.filter(Q).map(Y);let ae,le,oe,se,re,ne;return o[40]!==te?(ae=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2 mt-4",children:te}),o[40]=te,o[41]=ae):ae=o[41],o[42]!==q||o[43]!==G||o[44]!==V||o[45]!==X||o[46]!==ee||o[47]!==ae?(le=/* @__PURE__ */t("div",{className:"flex-1",children:[q,G,V,X,ee,ae]}),o[42]=q,o[43]=G,o[44]=V,o[45]=X,o[46]=ee,o[47]=ae,o[48]=le):le=o[48],o[49]!==L?(oe=L("default:select_store"),o[49]=L,o[50]=oe):oe=o[50],o[51]!==M||o[52]!==oe?(se=/* @__PURE__ */e("div",{className:"flex md:flex-col gap-2",children:/* @__PURE__ */e(F,{onClick:M,variant:"default",className:"whitespace-nowrap",children:oe})}),o[51]=M,o[52]=oe,o[53]=se):se=o[53],o[54]!==le||o[55]!==se?(re=/* @__PURE__ */t("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[le,se]}),o[54]=le,o[55]=se,o[56]=re):re=o[56],o[57]!==re||o[58]!==P||o[59]!==T?(ne=/* @__PURE__ */e("div",{className:P,onClick:T,children:re}),o[57]=re,o[58]=P,o[59]=T,o[60]=ne):ne=o[60],ne};function Q(e){return e}function Y(t){/* @__PURE__ */
23
+ return e("span",{className:"px-3 py-1 bg-primary/10 text-primary text-xs font-medium rounded-full",children:t},t)}function X(){const a=l(28),{stores:o,location:s,products:r,setStepIndex:n,productKey:c,setSelectedStoreId:i,searchIsLoading:d,searchError:m,baseUrl:u,focusedStoreId:h,setFocusedStoreId:p}=E();let f;a[0]!==i||a[1]!==n?(f=e=>{i(e),n(1)},a[0]=i,a[1]=n,a[2]=f):f=a[2];const x=f;let g,v,y,b,N;return a[3]!==m||a[4]!==d||a[5]!==o?(g=!d&&!m&&0===o.length&&/* @__PURE__ */e(w,{}),a[3]=m,a[4]=d,a[5]=o,a[6]=g):g=a[6],a[7]!==d?(v=d&&/* @__PURE__ */e("div",{className:"flex items-center justify-center h-48",children:/* @__PURE__ */e(I,{})}),a[7]=d,a[8]=v):v=a[8],a[9]!==u||a[10]!==h||a[11]!==x||a[12]!==s||a[13]!==c||a[14]!==r||a[15]!==m||a[16]!==d||a[17]!==p||a[18]!==o?(y=!d&&!m&&o.map(t=>/* @__PURE__ */e(V,{id:t.id,name:t.retailer_name,placeId:t.place_id,addressLineOne:t.address?.street_line_one,addressLineTwo:t.address?.street_line_two,city:t.address?.city,province:t.address?.province,postalCode:t.address?.postal_code,country:t.address?.country,distance:k(s.latitude,s.longitude,t.address?.latitude,t.address?.longitude),phone:t.phone_number,hours:t.retailer_location_hours,services:[t.store_type],isFocused:h===t.id,handleFocus:p,href:`${u}/${t.id}`,handleSelect:x,locationProducts:t.retailer_location_products,requestedProducts:r,filterBy:[c]},t.id)),a[9]=u,a[10]=h,a[11]=x,a[12]=s,a[13]=c,a[14]=r,a[15]=m,a[16]=d,a[17]=p,a[18]=o,a[19]=y):y=a[19],a[20]!==m||a[21]!==d?(b=!d&&m&&/* @__PURE__ */e("div",{className:"text-red-600 text-center",children:"An error occurred while searching for stores. Please try again."}),a[20]=m,a[21]=d,a[22]=b):b=a[22],a[23]!==g||a[24]!==v||a[25]!==y||a[26]!==b?(N=/* @__PURE__ */t("div",{className:"space-y-4",children:[g,v,y,b]}),a[23]=g,a[24]=v,a[25]=y,a[26]=b,a[27]=N):N=a[27],N}const ee=a=>{const o=l(30),{onClose:s,onSuccess:r}=a,{organizationId:n,location:c,selectedStoreId:i,products:d,stores:m,productKey:u}=E();let h,p,f,x,g,v;if(o[0]!==c||o[1]!==s||o[2]!==r||o[3]!==n||o[4]!==u||o[5]!==d||o[6]!==i||o[7]!==m){let a;o[12]!==i?(a=e=>e.id===i,o[12]=i,o[13]=a):a=o[13];const l=m.find(a),g=l?.retailer_location_products?.filter(e=>d.map(te).includes(e[u]));let v;o[14]!==r?(v=(e,t)=>{r&&r({formValues:e,lead:t})},o[14]=r,o[15]=v):v=o[15];const y=v;f=/* @__PURE__ */t("div",{className:"mb-3",children:["Selected location ",
24
+ /* @__PURE__ */e("strong",{children:l?.retailer_name})]}),o[16]!==y||o[17]!==c||o[18]!==s||o[19]!==n||o[20]!==d||o[21]!==i?(x=/* @__PURE__ */e(C,{onClose:s,products:d,activityType:"LeadActivity::QuoteRequest",onSuccess:y,location:c,organizationId:n,selectedLocationId:i}),o[16]=y,o[17]=c,o[18]=s,o[19]=n,o[20]=d,o[21]=i,o[22]=x):x=o[22],h="mt-5",p=g?.map(a=>/* @__PURE__ */t("div",{className:"grid grid-cols-2 gap-4",children:[
25
+ /* @__PURE__ */e("img",{src:a.images[0],alt:a.name,className:"w-full"}),
26
+ /* @__PURE__ */t("div",{children:[
27
+ /* @__PURE__ */e("div",{className:"font-semibold fs-lg",children:a.name}),
28
+ /* @__PURE__ */e("div",{children:a.category})]})]},a[u])),o[0]=c,o[1]=s,o[2]=r,o[3]=n,o[4]=u,o[5]=d,o[6]=i,o[7]=m,o[8]=h,o[9]=p,o[10]=f,o[11]=x}else h=o[8],p=o[9],f=o[10],x=o[11];return o[23]!==h||o[24]!==p?(g=/* @__PURE__ */e("div",{className:h,children:p}),o[23]=h,o[24]=p,o[25]=g):g=o[25],o[26]!==f||o[27]!==x||o[28]!==g?(v=/* @__PURE__ */t("div",{children:[f,x,g]}),o[26]=f,o[27]=x,o[28]=g,o[29]=v):v=o[29],v};function te(e){return e.key}function ae(t){const a=l(8),{active:o,children:s,className:r}=t,n=o?"open":"closed";let c,i,d;return a[0]!==r?(c=P("absolute inset-0","transition duration-300 ease-out will-change-transform","data-[state=closed]:pointer-events-none",r),a[0]=r,a[1]=c):c=a[1],a[2]!==s?(i=/* @__PURE__ */e("div",{className:"w-full h-[100%]",children:s}),a[2]=s,a[3]=i):i=a[3],a[4]!==n||a[5]!==c||a[6]!==i?(d=/* @__PURE__ */e("div",{"data-state":n,className:c,children:i}),a[4]=n,a[5]=c,a[6]=i,a[7]=d):d=a[7],d}const le=a=>{const o=l(31),{onClose:s,onSuccess:r}=a,{stepIndex:n,setStepIndex:c}=E();let i;o[0]!==s?(i=()=>{s&&s()},o[0]=s,o[1]=i):i=o[1];const d=i;let m;o[2]!==r||o[3]!==c?(m=e=>{c(2),r&&r(e)},o[2]=r,o[3]=c,o[4]=m):m=o[4];const u=m,h=0===n;let p,f,x,g;o[5]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(p=P("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6"),o[5]=p):p=o[5],o[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=/* @__PURE__ */e(K,{}),o[6]=f):f=o[6],o[7]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(x=/* @__PURE__ */t("div",{className:"relative px-1 h-screen overflow-y-scroll",children:[f,
29
+ /* @__PURE__ */e("div",{className:"pb-8",children:/* @__PURE__ */e(L,{apiKey:"AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M",children:/* @__PURE__ */e(G,{})})}),
30
+ /* @__PURE__ */e(X,{})]}),o[7]=x):x=o[7],o[8]!==h?(g=/* @__PURE__ */e(ae,{active:h,className:p,children:x}),o[8]=h,o[9]=g):g=o[9];const v=1===n;let y,b,N,_;o[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=P("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),o[10]=y):y=o[10],o[11]!==c?(b=()=>c(0),o[11]=c,o[12]=b):b=o[12],o[13]!==u||o[14]!==b?(N=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */e(ee,{onClose:b,onSuccess:u})}),o[13]=u,o[14]=b,o[15]=N):N=o[15],o[16]!==N||o[17]!==v?(_=/* @__PURE__ */e(ae,{active:v,className:y,children:N}),o[16]=N,o[17]=v,o[18]=_):_=o[18];const S=2===n;let w,k,I,C,j,z;return o[19]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(w=P("data-[state=open]:opacity-100 data-[state=open]:translate-x-0","data-[state=closed]:opacity-0 data-[state=closed]:-translate-x-6","flex items-center"),o[19]=w):w=o[19],o[20]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(k=/* @__PURE__ */e("h2",{className:"text-2xl font-semibold mb-4",children:"Thank you!"}),I=/* @__PURE__ */e("p",{className:"mb-8",children:"Your quote request has been submitted successfully. We will get back to you shortly."}),o[20]=k,o[21]=I):(k=o[20],I=o[21]),o[22]!==d?(C=/* @__PURE__ */e("div",{className:"px-1",children:/* @__PURE__ */t("div",{className:"text-center py-20 px-4",children:[k,I,
31
+ /* @__PURE__ */e(A,{onClick:d,children:"Close"})]})}),o[22]=d,o[23]=C):C=o[23],o[24]!==S||o[25]!==C?(j=/* @__PURE__ */e(ae,{active:S,className:w,children:C}),o[24]=S,o[25]=C,o[26]=j):j=o[26],o[27]!==_||o[28]!==j||o[29]!==g?(z=/* @__PURE__ */e("div",{className:"relative overflow-hidden h-[100%] py-1",children:/* @__PURE__ */t("div",{className:"h-[100%] relative",children:[g,_,j]})}),o[27]=_,o[28]=j,o[29]=g,o[30]=z):z=o[30],z},oe=t=>{const a=l(17),{organizationId:o,products:s,locale:r,onClose:n,onSuccess:c}=t;let i,d,m,u,h;return a[0]!==r?(i={lng:r},a[0]=r,a[1]=i):i=a[1],a[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(d={height:"100%"},a[2]=d):d=a[2],a[3]!==r||a[4]!==n||a[5]!==c||a[6]!==o||a[7]!==s?(m=/* @__PURE__ */e("div",{className:"cc",style:d,children:/* @__PURE__ */e(le,{organizationId:o,products:s,locale:r,onClose:n,onSuccess:c})}),a[3]=r,a[4]=n,a[5]=c,a[6]=o,a[7]=s,a[8]=m):m=a[8],a[9]!==r||a[10]!==o||a[11]!==s||a[12]!==m?(u=/* @__PURE__ */e(U,{organizationId:o,products:s,locale:r,children:m}),a[9]=r,a[10]=o,a[11]=s,a[12]=m,a[13]=u):u=a[13],a[14]!==i||a[15]!==u?(h=/* @__PURE__ */e(T,{options:i,children:u}),a[14]=i,a[15]=u,a[16]=h):h=a[16],h};export{oe as default};
package/dist/Store.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import{Slot as n}from"@radix-ui/react-slot";import{c as o,a as l,b as s,M as i,C as c,P as d,B as m,S as u,I as p,L as f}from"./translations-6mspyPRw.js";import{useTranslation as h}from"react-i18next";import*as g from"react";import{createContext as b,useState as y,useEffect as x,useContext as v}from"react";import"@radix-ui/react-collapsible";import{N as _}from"./navigation-DpGLbcKb.js";const N=o("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),w=o("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),S=o("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),M=o("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),D=s("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90"}},defaultVariants:{variant:"default"}});function T(t){const a=r(12);let o,s,i,c;a[0]!==t?(({className:o,variant:c,asChild:i,...s}=t),a[0]=t,a[1]=o,a[2]=s,a[3]=i,a[4]=c):(o=a[1],s=a[2],i=a[3],c=a[4]);const d=void 0!==i&&i?n:"span";let m,u;return a[5]!==o||a[6]!==c?(m=l(D({variant:c}),o),a[5]=o,a[6]=c,a[7]=m):m=a[7],a[8]!==d||a[9]!==s||a[10]!==m?(u=/* @__PURE__ */e(d,{"data-slot":"badge",className:m,...s}),a[8]=d,a[9]=s,a[10]=m,a[11]=u):u=a[11],u}const k=b(),z=({organizationId:t,id:a,locale:r,baseUrl:n="/retailers",initialData:o=null,children:l})=>{const[s,i]=y(o?.company_retailer_location||null);x(()=>{!async function(){if(a)try{const e=await fetch(`https://api.colabcommerce.com/widget_api/company_retailer_locations/${a}`);if(!e.ok)throw new Error(`Error fetching retailer: ${e.statusText}`);const t=await e.json();i(t?.company_retailer_location||null)}catch(e){i(null)}else i(null)}()},[t,a,n]);const c={organizationId:t,id:a,locale:r,baseUrl:n,store:s};/* @__PURE__ */
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import{Slot as n}from"@radix-ui/react-slot";import{c as o,a as l,b as s,M as i,C as c,P as d,B as m,S as u,I as p,L as f}from"./translations-WfjA8013.js";import{useTranslation as h}from"react-i18next";import*as g from"react";import{createContext as b,useState as y,useEffect as x,useContext as v}from"react";import"@radix-ui/react-collapsible";import{N as _}from"./navigation-QgfKnxTJ.js";const N=o("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),w=o("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),S=o("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),M=o("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),D=s("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90"}},defaultVariants:{variant:"default"}});function T(t){const a=r(12);let o,s,i,c;a[0]!==t?(({className:o,variant:c,asChild:i,...s}=t),a[0]=t,a[1]=o,a[2]=s,a[3]=i,a[4]=c):(o=a[1],s=a[2],i=a[3],c=a[4]);const d=void 0!==i&&i?n:"span";let m,u;return a[5]!==o||a[6]!==c?(m=l(D({variant:c}),o),a[5]=o,a[6]=c,a[7]=m):m=a[7],a[8]!==d||a[9]!==s||a[10]!==m?(u=/* @__PURE__ */e(d,{"data-slot":"badge",className:m,...s}),a[8]=d,a[9]=s,a[10]=m,a[11]=u):u=a[11],u}const k=b(),z=({organizationId:t,id:a,locale:r,baseUrl:n="/retailers",initialData:o=null,children:l})=>{const[s,i]=y(o?.company_retailer_location||null);x(()=>{!async function(){if(a)try{const e=await fetch(`https://api.colabcommerce.com/widget_api/company_retailer_locations/${a}`);if(!e.ok)throw new Error(`Error fetching retailer: ${e.statusText}`);const t=await e.json();i(t?.company_retailer_location||null)}catch(e){i(null)}else i(null)}()},[t,a,n]);const c={organizationId:t,id:a,locale:r,baseUrl:n,store:s};/* @__PURE__ */
2
2
  return e(k.Provider,{value:c,children:l})},$=()=>{const e=v(k);if(void 0===e)throw new Error("useStore must be used within a StoreProvider");return e},I=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function L(e){return[e.day,e]}function A(e){return e?.timezone}function C(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return U(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?F({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function j(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=F({storeHour:e.close_at_hour,storeMinute:e.close_at_minute,utcOffsetMinute:e.utc_offset_minute,anchorDate:t||void 0});return a&&t?(a.getTime()<=t.getTime()&&(a=new Date(a.getTime()+864e5)),a):a}function F({storeHour:e,storeMinute:t,utcOffsetMinute:a,anchorDate:r}){const n=r?new Date(r):/* @__PURE__ */new Date,o=n.getFullYear(),l=n.getMonth(),s=n.getDate(),i=Date.UTC(o,l,s,e,t,0)-60*a*1e3,c=new Date(i);return U(c)?c:null}function U(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function O(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function H(){const a=r(33),{t:n}=h(),{store:o}=$(),l=o?.retailer_location_hours;let s;a[0]!==n||a[1]!==l?(s={hours:l,t:n},a[0]=n,a[1]=l,a[2]=s):s=a[2];const{computed:d}=function(e){const t=r(17),{hours:a,openingSoonMinutes:n,closingSoonMinutes:o,t:l}=e,s=void 0===n?60:n,i=void 0===o?60:o;let c,d,m,u;if(t[0]!==i||t[1]!==a||t[2]!==s||t[3]!==l){const e=Array.isArray(a)?a:[],r=e.find(A)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,n=/* @__PURE__ */new Date,o=function(e,t){switch(new Intl.DateTimeFormat("en-US",{weekday:"short",timeZone:t}).format(e)){case"Sun":return 0;case"Mon":return 1;case"Tue":return 2;case"Wed":return 3;case"Thu":return 4;case"Fri":return 5;case"Sat":return 6;default:return new Date(e).getDay()}}(n,r);d=function({now:e,today:t,openingSoonMinutes:a,closingSoonMinutes:r,t:n}){if(!t||!t.open)return{label:n("default:closed"),detail:""};const o=C(t),l=j(t,o);if(!o||!l)return{label:n("default:open"),detail:""};const s=e.getTime(),i=o.getTime(),c=l.getTime(),d=i-60*a*1e3,m=c-60*r*1e3,u=n("default:opens_at",{time:O(o)}),p=n("default:closes_at",{time:O(l)});return s<i?s>=d?{label:n("default:opening_soon"),detail:u}:{label:n("default:closed"),detail:u}:s>=i&&s<c?s>=m?{label:n("default:closing_soon"),detail:p}:{label:n("default:open"),detail:p}:{label:n("default:closed"),detail:u}}({now:n,today:e.find(e=>e?.day===o),openingSoonMinutes:s,closingSoonMinutes:i,t:l});const p=[1,2,3,4,5,6,0],f=new Map(e.map(L));c=p.map(e=>{const t=f.get(e),a=l(`default:${I[e].toLowerCase()}`),r=e===o;let n=l("default:closed");if(t?.open){const e=C(t),a=j(t,e);n=e&&a?`${O(e)} - ${O(a)}`:l("default:open")}return{dayIdx:e,label:a,text:n,isToday:r}}),u=l,m=d.label.toLowerCase().replace(" ","_"),t[0]=i,t[1]=a,t[2]=s,t[3]=l,t[4]=c,t[5]=d,t[6]=m,t[7]=u}else c=t[4],d=t[5],m=t[6],u=t[7];const p=`default:${m}`;let f,h;t[8]!==u||t[9]!==p?(f=u(p),t[8]=u,t[9]=p,t[10]=f):f=t[10],t[11]!==c||t[12]!==d.detail||t[13]!==f?(h={statusLabel:f,statusDetail:d.detail,rows:c},t[11]=c,t[12]=d.detail,t[13]=f,t[14]=h):h=t[14];const g=h;let b;return t[15]!==g?(b={computed:g},t[15]=g,t[16]=b):b=t[16],b}(s);let m;a[3]!==o?.store_type?(m=o?.store_type?.toLowerCase(),a[3]=o?.store_type,a[4]=m):m=a[4];const u=`default:store.types.${m}`;let p,f;a[5]!==n||a[6]!==u?(p=n(u),a[5]=n,a[6]=u,a[7]=p):p=a[7],a[8]!==p?(f=/* @__PURE__ */e("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:/* @__PURE__ */e(T,{variant:"secondary",className:"text-sm",children:p})}),a[8]=p,a[9]=f):f=a[9];const g=o?.retailer_name;let b,y;a[10]!==g?(b=/* @__PURE__ */e("h1",{className:"text-4xl lg:text-5xl font-bold mb-4 text-balance",children:g}),a[10]=g,a[11]=b):b=a[11],a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=/* @__PURE__ */e(i,{className:"w-4 h-4"}),a[12]=y):y=a[12];const x=o?.address?.city,v=o?.address?.province;let _,N;a[13]!==v||a[14]!==x?(_=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[y,
3
3
  /* @__PURE__ */t("span",{className:"text-sm",children:[x,", ",v]})]}),a[13]=v,a[14]=x,a[15]=_):_=a[15],a[16]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(N=/* @__PURE__ */e(c,{className:"w-4 h-4"}),a[16]=N):N=a[16];const w="text-sm font-medium "+(d.statusLabel===n("default:open")?"text-green-600":"text-red-600");let S,M;a[17]!==d.statusLabel||a[18]!==w?(S=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[N,
4
4
  /* @__PURE__ */e("span",{className:w,children:d.statusLabel})]}),a[17]=d.statusLabel,a[18]=w,a[19]=S):S=a[19],a[20]!==_||a[21]!==S?(M=/* @__PURE__ */t("div",{className:"flex flex-wrap items-center gap-4 mb-6",children:[_,S]}),a[20]=_,a[21]=S,a[22]=M):M=a[22];const D=o?.retailer_name||"our store";let k,z,F;return a[23]!==n||a[24]!==D?(k=n("default:store_romance",{name:D}),a[23]=n,a[24]=D,a[25]=k):k=a[25],a[26]!==k?(z=/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground leading-relaxed mb-6",children:k}),a[26]=k,a[27]=z):z=a[27],a[28]!==M||a[29]!==z||a[30]!==f||a[31]!==b?(F=/* @__PURE__ */e("section",{className:"bg-gradient-to-b from-primary/5 to-background py-12 lg:py-16",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */t("div",{className:"max-w-4xl",children:[f,b,M,z]})})}),a[28]=M,a[29]=z,a[30]=f,a[31]=b,a[32]=F):F=a[32],F}function P(t){const a=r(8);let n,o,s,i;return a[0]!==t?(({className:n,...o}=t),a[0]=t,a[1]=n,a[2]=o):(n=a[1],o=a[2]),a[3]!==n?(s=l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),a[3]=n,a[4]=s):s=a[4],a[5]!==o||a[6]!==s?(i=/* @__PURE__ */e("div",{"data-slot":"card",className:s,...o}),a[5]=o,a[6]=s,a[7]=i):i=a[7],i}const W=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function E({hours:r,openingSoonMinutes:n=60,closingSoonMinutes:o=60,className:l=""}){const{t:s}=h(),[i,c]=g.useState(!1),d=g.useMemo(()=>{const e=Array.isArray(r)?r:[],t=e.find(e=>e?.timezone)?.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone,a=/* @__PURE__ */new Date,l=function(e,t){switch(new Intl.DateTimeFormat("en-US",{weekday:"short",timeZone:t}).format(e)){case"Sun":return 0;case"Mon":return 1;case"Tue":return 2;case"Wed":return 3;case"Thu":return 4;case"Fri":return 5;case"Sat":return 6;default:return new Date(e).getDay()}}(a,t),i=function({now:e,today:t,openingSoonMinutes:a,closingSoonMinutes:r,t:n}){if(!t||!t.open)return{label:n("default:closed"),detail:""};const o=V(t),l=Z(t,o);if(!o||!l)return{label:n("default:open"),detail:""};const s=e.getTime(),i=o.getTime(),c=l.getTime(),d=i-60*a*1e3,m=c-60*r*1e3,u=n("default:opens_at",{time:G(o)}),p=n("default:closes_at",{time:G(l)});return s<i?s>=d?{label:n("default:opening_soon"),detail:u}:{label:n("default:closed"),detail:u}:s>=i&&s<c?s>=m?{label:n("default:closing_soon"),detail:p}:{label:n("default:open"),detail:p}:{label:n("default:closed"),detail:u}}({now:a,today:e.find(e=>e?.day===l),openingSoonMinutes:n,closingSoonMinutes:o,t:s}),c=new Map(e.map(e=>[e.day,e])),d=[1,2,3,4,5,6,0].map(e=>{const t=c.get(e),a=s(`default:${W[e].toLowerCase()}`),r=e===l;let n=s("default:closed");if(t?.open){const e=V(t),a=Z(t,e);n=e&&a?`${G(e)} - ${G(a)}`:s("default:open")}return{dayIdx:e,label:a,text:n,isToday:r}});return{statusLabel:s(`default:${i.label.toLowerCase().replace(" ","_")}`),statusDetail:i.detail,rows:d}},[r,n,o]);/* @__PURE__ */