@colabcommerce/elements 0.9.5 → 0.9.6

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.
Files changed (2) hide show
  1. package/dist/Store.js +20 -23
  2. package/package.json +1 -1
package/dist/Store.js CHANGED
@@ -1,37 +1,34 @@
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
- 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
- /* @__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
- /* @__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__ */
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 f,L as p}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 _}from"react";import"@radix-ui/react-collapsible";import{N as v}from"./navigation-QgfKnxTJ.js";const N=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"}]]),w=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"}]]),S=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 M(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(S({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 D=b(),T=({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
+ return e(D.Provider,{value:c,children:l})},k=()=>{const e=_(D);if(void 0===e)throw new Error("useStore must be used within a StoreProvider");return e},z=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function $(e){return[e.day,e]}function I(e){return e?.timezone}function C(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return A(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?j({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function L(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=j({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 j({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 A(c)?c:null}function A(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function F(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function U(){const a=r(30),{t:n}=h(),{store:o}=k(),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(I)?.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=L(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:F(o)}),f=n("default:closes_at",{time:F(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:f}:{label:n("default:open"),detail:f}:{label:n("default:closed"),detail:u}}({now:n,today:e.find(e=>e?.day===o),openingSoonMinutes:s,closingSoonMinutes:i,t:l});const f=[1,2,3,4,5,6,0],p=new Map(e.map($));c=f.map(e=>{const t=p.get(e),a=l(`default:${z[e].toLowerCase()}`),r=e===o;let n=l("default:closed");if(t?.open){const e=C(t),a=L(t,e);n=e&&a?`${F(e)} - ${F(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 f=`default:${m}`;let p,h;t[8]!==u||t[9]!==f?(p=u(f),t[8]=u,t[9]=f,t[10]=p):p=t[10],t[11]!==c||t[12]!==d.detail||t[13]!==p?(h={statusLabel:p,statusDetail:d.detail,rows:c},t[11]=c,t[12]=d.detail,t[13]=p,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||a[4]!==n?(m=o?.store_type&&/* @__PURE__ */e("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:/* @__PURE__ */e(M,{variant:"secondary",className:"text-sm",children:n(`default:store.types.${o?.store_type?.toLowerCase()}`)})}),a[3]=o?.store_type,a[4]=n,a[5]=m):m=a[5];const u=o?.retailer_name;let f,p;a[6]!==u?(f=/* @__PURE__ */e("h1",{className:"text-4xl lg:text-5xl font-bold mb-4 text-balance",children:u}),a[6]=u,a[7]=f):f=a[7],a[8]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(p=/* @__PURE__ */e(i,{className:"w-4 h-4"}),a[8]=p):p=a[8];const g=o?.address?.city,b=o?.address?.province;let y,x;a[9]!==g||a[10]!==b?(y=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[p,
3
+ /* @__PURE__ */t("span",{className:"text-sm",children:[g,", ",b]})]}),a[9]=g,a[10]=b,a[11]=y):y=a[11],a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(x=/* @__PURE__ */e(c,{className:"w-4 h-4"}),a[12]=x):x=a[12];const _="text-sm font-medium "+(d.statusLabel===n("default:open")?"text-green-600":"text-red-600");let v,N;a[13]!==d.statusLabel||a[14]!==_?(v=/* @__PURE__ */t("div",{className:"flex items-center gap-2 text-muted-foreground",children:[x,
4
+ /* @__PURE__ */e("span",{className:_,children:d.statusLabel})]}),a[13]=d.statusLabel,a[14]=_,a[15]=v):v=a[15],a[16]!==v||a[17]!==y?(N=/* @__PURE__ */t("div",{className:"flex flex-wrap items-center gap-4 mb-6",children:[y,v]}),a[16]=v,a[17]=y,a[18]=N):N=a[18];const w=o?.retailer_name||"our store",S=o?.address?.city||"our city";let D,T,j;return a[19]!==n||a[20]!==w||a[21]!==S?(D=n("default:store_romance",{name:w,city:S}),a[19]=n,a[20]=w,a[21]=S,a[22]=D):D=a[22],a[23]!==D?(T=/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground leading-relaxed mb-6",children:D}),a[23]=D,a[24]=T):T=a[24],a[25]!==N||a[26]!==T||a[27]!==m||a[28]!==f?(j=/* @__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:[m,f,N,T]})})}),a[25]=N,a[26]=T,a[27]=m,a[28]=f,a[29]=j):j=a[29],j}function H(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 O=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function P({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=W(t),l=E(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:q(o)}),f=n("default:closes_at",{time:q(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:f}:{label:n("default:open"),detail:f}:{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:${O[e].toLowerCase()}`),r=e===l;let n=s("default:closed");if(t?.open){const e=W(t),a=E(t,e);n=e&&a?`${q(e)} - ${q(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__ */
5
5
  return e(a,{children:d.rows.map(r=>/* @__PURE__ */e(a,{children:/* @__PURE__ */t("div",{className:"flex justify-between items-center py-2 "+(r.isToday?"bg-primary/5 -mx-4 px-4 rounded-lg":""),children:[
6
6
  /* @__PURE__ */t("span",{className:"font-medium "+(r.isToday?"text-primary":""),children:[r.label,r.isToday&&/* @__PURE__ */e("span",{className:"ml-2 text-xs",children:"(Today)"})]}),
7
- /* @__PURE__ */e("span",{className:"text-muted-foreground",children:r.text})]},r.dayIdx)}))})}function V(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return B(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?q({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function Z(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=q({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 q({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 B(c)?c:null}function B(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function G(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function R(){const a=r(36),{store:n}=$(),o=`https://www.google.com/maps/dir/?api=1&destination=${n?.name}&destination_place_id=${n?.placeId}`;let l,s,u;a[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(l=/* @__PURE__ */e("h2",{className:"text-2xl font-bold mb-6",children:"Contact Information"}),a[0]=l):l=a[0],a[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(s=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(i,{className:"w-5 h-5 text-primary"})}),u=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Address"}),a[1]=s,a[2]=u):(s=a[1],u=a[2]);const p=n?.address?.street_line_one,f=n?.address?.street_line_two&&`, ${n.address.street_line_two}`;let h;a[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(h=/* @__PURE__ */e("br",{}),a[3]=h):h=a[3];const g=n?.address?.city,b=n?.address?.province,y=n?.address?.postal_code;let x,v,_,N,S,D;a[4]!==p||a[5]!==f||a[6]!==g||a[7]!==b||a[8]!==y?(x=/* @__PURE__ */t("div",{className:"text-muted-foreground",children:[p," ",f,h,g,", ",b," ",y]}),a[4]=p,a[5]=f,a[6]=g,a[7]=b,a[8]=y,a[9]=x):x=a[9],a[10]!==o?(v=/* @__PURE__ */e("a",{className:"px-0 h-auto mt-2 text-primary hover:underline py-3 ",href:o,target:"_blank",rel:"noopener noreferrer",children:"Get Directions →"}),a[10]=o,a[11]=v):v=a[11],a[12]!==v||a[13]!==x?(_=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[s,
8
- /* @__PURE__ */t("div",{children:[u,x,v]})]}),a[12]=v,a[13]=x,a[14]=_):_=a[14],a[15]!==n?.phone_number?(N=n?.phone_number&&/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[
7
+ /* @__PURE__ */e("span",{className:"text-muted-foreground",children:r.text})]},r.dayIdx)}))})}function W(e){if(!e)return null;if(e.open_at){const t=new Date(e.open_at);return Z(t)?t:null}return"number"==typeof e.open_at_hour&&"number"==typeof e.open_at_minute?V({storeHour:e.open_at_hour,storeMinute:e.open_at_minute,utcOffsetMinute:e.utc_offset_minute}):null}function E(e,t){if(!e)return null;if("number"!=typeof e.close_at_hour||"number"!=typeof e.close_at_minute)return null;let a=V({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 V({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 Z(c)?c:null}function Z(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function q(e){return new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(e).replace(":00","").replace(" AM","am").replace(" PM","pm")}function B(){const a=r(36),{store:n}=k(),o=`https://www.google.com/maps/dir/?api=1&destination=${n?.name}&destination_place_id=${n?.placeId}`;let l,s,u;a[0]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(l=/* @__PURE__ */e("h2",{className:"text-2xl font-bold mb-6",children:"Contact Information"}),a[0]=l):l=a[0],a[1]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(s=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(i,{className:"w-5 h-5 text-primary"})}),u=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Address"}),a[1]=s,a[2]=u):(s=a[1],u=a[2]);const f=n?.address?.street_line_one,p=n?.address?.street_line_two&&`, ${n.address.street_line_two}`;let h;a[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(h=/* @__PURE__ */e("br",{}),a[3]=h):h=a[3];const g=n?.address?.city,b=n?.address?.province,y=n?.address?.postal_code;let x,_,v,S,M,D;a[4]!==f||a[5]!==p||a[6]!==g||a[7]!==b||a[8]!==y?(x=/* @__PURE__ */t("div",{className:"text-muted-foreground",children:[f," ",p,h,g,", ",b," ",y]}),a[4]=f,a[5]=p,a[6]=g,a[7]=b,a[8]=y,a[9]=x):x=a[9],a[10]!==o?(_=/* @__PURE__ */e("a",{className:"px-0 h-auto mt-2 text-primary hover:underline py-3 ",href:o,target:"_blank",rel:"noopener noreferrer",children:"Get Directions →"}),a[10]=o,a[11]=_):_=a[11],a[12]!==_||a[13]!==x?(v=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[s,
8
+ /* @__PURE__ */t("div",{children:[u,x,_]})]}),a[12]=_,a[13]=x,a[14]=v):v=a[14],a[15]!==n?.phone_number?(S=n?.phone_number&&/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[
9
9
  /* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(d,{className:"w-5 h-5 text-primary"})}),
10
10
  /* @__PURE__ */t("div",{children:[
11
11
  /* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Phone"}),
12
- /* @__PURE__ */e("a",{href:`tel:${n?.phone_number?.phone_number}`,className:"text-primary hover:underline",children:n?.phone_number?.formatted})]})]}),a[15]=n?.phone_number,a[16]=N):N=a[16],a[17]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(S=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(w,{className:"w-5 h-5 text-primary"})}),D=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Website"}),a[17]=S,a[18]=D):(S=a[17],D=a[18]);const T=n?.website,k=n?.website;let z,I,L,A,C,j;a[19]!==T||a[20]!==k?(z=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[S,
12
+ /* @__PURE__ */e("a",{href:`tel:${n?.phone_number?.phone_number}`,className:"text-primary hover:underline",children:n?.phone_number?.formatted})]})]}),a[15]=n?.phone_number,a[16]=S):S=a[16],a[17]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(M=/* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:/* @__PURE__ */e(N,{className:"w-5 h-5 text-primary"})}),D=/* @__PURE__ */e("div",{className:"font-semibold mb-1",children:"Website"}),a[17]=M,a[18]=D):(M=a[17],D=a[18]);const T=n?.website,z=n?.website;let $,I,C,L,j,A;a[19]!==T||a[20]!==z?($=/* @__PURE__ */t("div",{className:"flex items-start gap-4",children:[M,
13
13
  /* @__PURE__ */t("div",{children:[D,
14
- /* @__PURE__ */e("a",{href:T,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:k})]})]}),a[19]=T,a[20]=k,a[21]=z):z=a[21],a[22]!==_||a[23]!==N||a[24]!==z?(I=/* @__PURE__ */t("div",{className:"space-y-4",children:[_,N,z]}),a[22]=_,a[23]=N,a[24]=z,a[25]=I):I=a[25],a[26]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(L=/* @__PURE__ */t(m,{className:"flex-1 sm:flex-none",children:[
15
- /* @__PURE__ */e(d,{className:"w-4 h-4 mr-2"}),"Call Now"]}),a[26]=L):L=a[26],a[27]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(A=/* @__PURE__ */t("div",{className:"flex flex-wrap gap-3 mt-6 pt-6 border-t",children:[L,
14
+ /* @__PURE__ */e("a",{href:T,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:z})]})]}),a[19]=T,a[20]=z,a[21]=$):$=a[21],a[22]!==v||a[23]!==S||a[24]!==$?(I=/* @__PURE__ */t("div",{className:"space-y-4",children:[v,S,$]}),a[22]=v,a[23]=S,a[24]=$,a[25]=I):I=a[25],a[26]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(C=/* @__PURE__ */t(m,{className:"flex-1 sm:flex-none",children:[
15
+ /* @__PURE__ */e(d,{className:"w-4 h-4 mr-2"}),"Call Now"]}),a[26]=C):C=a[26],a[27]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(L=/* @__PURE__ */t("div",{className:"flex flex-wrap gap-3 mt-6 pt-6 border-t",children:[C,
16
16
  /* @__PURE__ */t(m,{variant:"outline",className:"flex-1 sm:flex-none bg-transparent",children:[
17
- /* @__PURE__ */e(M,{className:"w-4 h-4 mr-2"}),"Send Message"]})]}),a[27]=A):A=a[27],a[28]!==I?(C=/* @__PURE__ */t(P,{className:"p-6",children:[l,I,A]}),a[28]=I,a[29]=C):C=a[29],a[30]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(j=/* @__PURE__ */t("div",{className:"flex items-center gap-3 mb-6",children:[
17
+ /* @__PURE__ */e(w,{className:"w-4 h-4 mr-2"}),"Send Message"]})]}),a[27]=L):L=a[27],a[28]!==I?(j=/* @__PURE__ */t(H,{className:"p-6",children:[l,I,L]}),a[28]=I,a[29]=j):j=a[29],a[30]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(A=/* @__PURE__ */t("div",{className:"flex items-center gap-3 mb-6",children:[
18
18
  /* @__PURE__ */e("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:/* @__PURE__ */e(c,{className:"w-5 h-5 text-primary"})}),
19
- /* @__PURE__ */e("h2",{className:"text-2xl font-bold",children:"Hours of Operation"})]}),a[30]=j):j=a[30];const F=n?.retailer_location_hours;let U,O;return a[31]!==F?(U=/* @__PURE__ */t(P,{className:"p-6",children:[j,
20
- /* @__PURE__ */e("div",{className:"space-y-3",children:/* @__PURE__ */e(E,{hours:F})})]}),a[31]=F,a[32]=U):U=a[32],a[33]!==C||a[34]!==U?(O=/* @__PURE__ */t("div",{className:"space-y-6",children:[C,U]}),a[33]=C,a[34]=U,a[35]=O):O=a[35],O}const Y=t=>{const a=r(7),{center:n,zoom:o,size:l,markers:s}=t,i=void 0===l?"400x600":l;let c;if(a[0]!==n||a[1]!==s||a[2]!==i||a[3]!==o){const e=new URLSearchParams;e.append("center",n),e.append("zoom",o),e.append("size",i),e.append("maptype","roadmap"),s.forEach(t=>{const a=`${t.lat},${t.lng}`;e.append("markers",a)}),e.append("key","AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M"),c=e.toString(),a[0]=n,a[1]=s,a[2]=i,a[3]=o,a[4]=c}else c=a[4];const d=`https://maps.googleapis.com/maps/api/staticmap?${c}`;let m;return a[5]!==d?(m=/* @__PURE__ */e("img",{src:d,alt:"Static Map"}),a[5]=d,a[6]=m):m=a[6],m};function J(){const a=r(9),{store:n}=$(),o=`${n?.address?.latitude},${n?.address?.longitude}`,l=n?.address?.latitude,s=n?.address?.longitude;let i,c,d,u;return a[0]!==l||a[1]!==s?(i=[{lat:l,lng:s}],a[0]=l,a[1]=s,a[2]=i):i=a[2],a[3]!==o||a[4]!==i?(c=/* @__PURE__ */e(Y,{center:o,zoom:15,markers:i}),a[3]=o,a[4]=i,a[5]=c):c=a[5],a[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(d=/* @__PURE__ */e("div",{className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 flex items-center justify-center",children:/* @__PURE__ */e("div",{className:"text-center",children:/* @__PURE__ */t(m,{variant:"outline",size:"sm",children:[
21
- /* @__PURE__ */e(_,{className:"w-4 h-4 mr-2"}),"View on Google Maps"]})})}),a[6]=d):d=a[6],a[7]!==c?(u=/* @__PURE__ */e(P,{className:"p-0 overflow-hidden sticky top-24",children:/* @__PURE__ */t("div",{className:"relative w-full h-[500px] bg-gradient-to-br from-primary/10 to-primary/5",children:[c,d]})}),a[7]=c,a[8]=u):u=a[8],u}function K(){const a=r(28),[n,o]=y(""),[l,s]=y("all"),{store:i}=$();let c,d,f,h,g,b,x;if(a[0]!==n||a[1]!==l||a[2]!==i?.retailer_location_products){const r=i?.retailer_location_products||[],g=[{id:"all",label:"All Products"},...Array.from(new Set(r.map(ee))).map(X)];let b,y,x,v,_,N;a[7]!==n||a[8]!==l?(b=e=>{const t=e.name.toLowerCase().includes(n.toLowerCase()),a="all"===l||e.category===l;return t&&a},a[7]=n,a[8]=l,a[9]=b):b=a[9],c=r.filter(b),a[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=/* @__PURE__ */e("h2",{className:"text-3xl font-bold mb-4",children:"Available Products"}),x=/* @__PURE__ */e("p",{className:"text-muted-foreground mb-6",children:"Browse our current inventory of quality furniture pieces. All items shown are available for immediate viewing at our showroom."}),a[10]=y,a[11]=x):(y=a[10],x=a[11]),a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(v=/* @__PURE__ */e(u,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),a[12]=v):v=a[12],a[13]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(_=e=>o(e.target.value),a[13]=_):_=a[13],a[14]!==n?(N=/* @__PURE__ */e("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:/* @__PURE__ */t("div",{className:"relative flex-1",children:[v,
22
- /* @__PURE__ */e(p,{type:"text",placeholder:"Search products...",value:n,onChange:_,className:"pl-10"})]})}),a[14]=n,a[15]=N):N=a[15];const w=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2",children:g.map(t=>/* @__PURE__ */e(m,{variant:l===t.id?"default":"outline",size:"sm",onClick:()=>s(t.id),children:t.label},t.id))});a[16]!==N||a[17]!==w?(h=/* @__PURE__ */t("div",{className:"mb-8",children:[y,x,N,w]}),a[16]=N,a[17]=w,a[18]=h):h=a[18],d="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",f=c.map(Q),a[0]=n,a[1]=l,a[2]=i?.retailer_location_products,a[3]=c,a[4]=d,a[5]=f,a[6]=h}else c=a[3],d=a[4],f=a[5],h=a[6];return a[19]!==d||a[20]!==f?(g=/* @__PURE__ */e("div",{className:d,children:f}),a[19]=d,a[20]=f,a[21]=g):g=a[21],a[22]!==c.length?(b=0===c.length&&/* @__PURE__ */e("div",{className:"text-center py-12",children:/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground",children:"No products found matching your criteria."})}),a[22]=c.length,a[23]=b):b=a[23],a[24]!==h||a[25]!==g||a[26]!==b?(x=/* @__PURE__ */t("div",{children:[h,g,b]}),a[24]=h,a[25]=g,a[26]=b,a[27]=x):x=a[27],x}function Q(a){/* @__PURE__ */
23
- return t(P,{className:"group overflow-hidden",children:[
19
+ /* @__PURE__ */e("h2",{className:"text-2xl font-bold",children:"Hours of Operation"})]}),a[30]=A):A=a[30];const F=n?.retailer_location_hours;let U,O;return a[31]!==F?(U=/* @__PURE__ */t(H,{className:"p-6",children:[A,
20
+ /* @__PURE__ */e("div",{className:"space-y-3",children:/* @__PURE__ */e(P,{hours:F})})]}),a[31]=F,a[32]=U):U=a[32],a[33]!==j||a[34]!==U?(O=/* @__PURE__ */t("div",{className:"space-y-6",children:[j,U]}),a[33]=j,a[34]=U,a[35]=O):O=a[35],O}const G=t=>{const a=r(7),{center:n,zoom:o,size:l,markers:s}=t,i=void 0===l?"400x600":l;let c;if(a[0]!==n||a[1]!==s||a[2]!==i||a[3]!==o){const e=new URLSearchParams;e.append("center",n),e.append("zoom",o),e.append("size",i),e.append("maptype","roadmap"),s.forEach(t=>{const a=`${t.lat},${t.lng}`;e.append("markers",a)}),e.append("key","AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M"),c=e.toString(),a[0]=n,a[1]=s,a[2]=i,a[3]=o,a[4]=c}else c=a[4];const d=`https://maps.googleapis.com/maps/api/staticmap?${c}`;let m;return a[5]!==d?(m=/* @__PURE__ */e("img",{src:d,alt:"Static Map"}),a[5]=d,a[6]=m):m=a[6],m};function R(){const a=r(9),{store:n}=k(),o=`${n?.address?.latitude},${n?.address?.longitude}`,l=n?.address?.latitude,s=n?.address?.longitude;let i,c,d,u;return a[0]!==l||a[1]!==s?(i=[{lat:l,lng:s}],a[0]=l,a[1]=s,a[2]=i):i=a[2],a[3]!==o||a[4]!==i?(c=/* @__PURE__ */e(G,{center:o,zoom:15,markers:i}),a[3]=o,a[4]=i,a[5]=c):c=a[5],a[6]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(d=/* @__PURE__ */e("div",{className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 flex items-center justify-center",children:/* @__PURE__ */e("div",{className:"text-center",children:/* @__PURE__ */t(m,{variant:"outline",size:"sm",children:[
21
+ /* @__PURE__ */e(v,{className:"w-4 h-4 mr-2"}),"View on Google Maps"]})})}),a[6]=d):d=a[6],a[7]!==c?(u=/* @__PURE__ */e(H,{className:"p-0 overflow-hidden sticky top-24",children:/* @__PURE__ */t("div",{className:"relative w-full h-[500px] bg-gradient-to-br from-primary/10 to-primary/5",children:[c,d]})}),a[7]=c,a[8]=u):u=a[8],u}function Y(){const a=r(28),[n,o]=y(""),[l,s]=y("all"),{store:i}=k();let c,d,p,h,g,b,x;if(a[0]!==n||a[1]!==l||a[2]!==i?.retailer_location_products){const r=i?.retailer_location_products.filter(ee)||[],g=[{id:"all",label:"All Products"},...Array.from(new Set(r.filter(X).map(Q))).map(K)];let b,y,x,_,v,N;a[7]!==n||a[8]!==l?(b=e=>{const t=e.name.toLowerCase().includes(n.toLowerCase()),a="all"===l||e.category===l;return t&&a},a[7]=n,a[8]=l,a[9]=b):b=a[9],c=r.filter(b),a[10]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(y=/* @__PURE__ */e("h2",{className:"text-3xl font-bold mb-4",children:"Available Products"}),x=/* @__PURE__ */e("p",{className:"text-muted-foreground mb-6",children:"Browse our current inventory of quality furniture pieces. All items shown are available for immediate viewing at our showroom."}),a[10]=y,a[11]=x):(y=a[10],x=a[11]),a[12]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(_=/* @__PURE__ */e(u,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),a[12]=_):_=a[12],a[13]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(v=e=>o(e.target.value),a[13]=v):v=a[13],a[14]!==n?(N=/* @__PURE__ */e("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:/* @__PURE__ */t("div",{className:"relative flex-1",children:[_,
22
+ /* @__PURE__ */e(f,{type:"text",placeholder:"Search products...",value:n,onChange:v,className:"pl-10"})]})}),a[14]=n,a[15]=N):N=a[15];const w=/* @__PURE__ */e("div",{className:"flex flex-wrap gap-2",children:g.map(t=>/* @__PURE__ */e(m,{variant:l===t.id?"default":"outline",size:"sm",onClick:()=>s(t.id),children:t.label},t.id))});a[16]!==N||a[17]!==w?(h=/* @__PURE__ */t("div",{className:"mb-8",children:[y,x,N,w]}),a[16]=N,a[17]=w,a[18]=h):h=a[18],d="grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",p=c.map(J),a[0]=n,a[1]=l,a[2]=i?.retailer_location_products,a[3]=c,a[4]=d,a[5]=p,a[6]=h}else c=a[3],d=a[4],p=a[5],h=a[6];return a[19]!==d||a[20]!==p?(g=/* @__PURE__ */e("div",{className:d,children:p}),a[19]=d,a[20]=p,a[21]=g):g=a[21],a[22]!==c.length?(b=0===c.length&&/* @__PURE__ */e("div",{className:"text-center py-12",children:/* @__PURE__ */e("p",{className:"text-lg text-muted-foreground",children:"No products found matching your criteria."})}),a[22]=c.length,a[23]=b):b=a[23],a[24]!==h||a[25]!==g||a[26]!==b?(x=/* @__PURE__ */t("div",{children:[h,g,b]}),a[24]=h,a[25]=g,a[26]=b,a[27]=x):x=a[27],x}function J(a){/* @__PURE__ */
23
+ return t(H,{className:"group overflow-hidden",children:[
24
24
  /* @__PURE__ */t("div",{className:"relative bg-muted overflow-hidden",children:[
25
- /* @__PURE__ */e("img",{src:a.images?.[0]||"/placeholder.svg",alt:a.name,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-300"}),a.available&&/* @__PURE__ */e(T,{className:"absolute top-3 left-3 bg-primary text-primary-foreground",children:"Special Order"}),!a.stocked&&/* @__PURE__ */e(T,{className:"absolute top-3 left-3 bg-red-600 text-white",children:"Out of Stock"}),
26
- /* @__PURE__ */t("div",{className:"absolute top-3 right-3 flex flex-col gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[
27
- /* @__PURE__ */e(m,{size:"icon",variant:"secondary",className:"h-9 w-9",children:/* @__PURE__ */e(S,{className:"w-4 h-4"})}),
28
- /* @__PURE__ */e(m,{size:"icon",variant:"secondary",className:"h-9 w-9",children:/* @__PURE__ */e(N,{className:"w-4 h-4"})})]})]}),
25
+ /* @__PURE__ */e("img",{src:a.images?.[0]||"/placeholder.svg",alt:a.name,fill:!0,className:"object-cover group-hover:scale-105 transition-transform duration-300"}),a.available&&/* @__PURE__ */e(M,{className:"absolute top-3 left-3 bg-primary text-primary-foreground",children:"Special Order"})]}),
29
26
  /* @__PURE__ */t("div",{className:"p-4",children:[
30
27
  /* @__PURE__ */e("h3",{className:"font-semibold mb-1 group-hover:text-primary transition-colors",children:a.name}),
31
28
  /* @__PURE__ */e("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2",children:a.description}),
32
29
  /* @__PURE__ */t("div",{className:"flex items-center justify-between",children:[
33
30
  /* @__PURE__ */e("span",{className:"text-2xl font-bold text-primary",children:a?.price&&a.price.toLocaleString()}),
34
- /* @__PURE__ */e(m,{size:"sm",disabled:!a.stocked,children:a.stocked?"View Details":"Unavailable"})]})]})]},a.id)}function X(e){return{id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}}function ee(e){return e.category}const te=a=>{const n=r(11),{storeId:o,locale:l,initialData:s}=a,i=void 0===l?"en":l,c=void 0===s?null:s;let d,m,u,p,h,g;return n[0]!==i?(d={lng:i},n[0]=i,n[1]=d):d=n[1],n[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(m=/* @__PURE__ */e(H,{}),n[2]=m):m=n[2],n[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(u=/* @__PURE__ */e("section",{className:"py-12 lg:py-16 bg-muted/30",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */t("div",{className:"grid lg:grid-cols-3 gap-8",children:[
35
- /* @__PURE__ */e("div",{className:"lg:col-span-2",children:/* @__PURE__ */e(R,{})}),
36
- /* @__PURE__ */e("div",{children:/* @__PURE__ */e(J,{})})]})})}),n[3]=u):u=n[3],n[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(p=/* @__PURE__ */e("div",{className:"cc",children:/* @__PURE__ */t("main",{className:"flex-1",children:[m,u,
37
- /* @__PURE__ */e("section",{className:"py-12 lg:py-16",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */e(K,{})})})]})}),n[4]=p):p=n[4],n[5]!==c||n[6]!==o?(h=/* @__PURE__ */e(z,{id:o,initialData:c,children:p}),n[5]=c,n[6]=o,n[7]=h):h=n[7],n[8]!==d||n[9]!==h?(g=/* @__PURE__ */e(f,{options:d,children:h}),n[8]=d,n[9]=h,n[10]=g):g=n[10],g};export{te as default};
31
+ /* @__PURE__ */e(m,{size:"sm",disabled:!a.stocked,children:"View Details"})]})]})]},a.id)}function K(e){return{id:e,label:e.charAt(0).toUpperCase()+e.slice(1)}}function Q(e){return e.category}function X(e){return e.category}function ee(e){return e.stocked||e.available}const te=a=>{const n=r(11),{storeId:o,locale:l,initialData:s}=a,i=void 0===l?"en":l,c=void 0===s?null:s;let d,m,u,f,h,g;return n[0]!==i?(d={lng:i},n[0]=i,n[1]=d):d=n[1],n[2]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(m=/* @__PURE__ */e(U,{}),n[2]=m):m=n[2],n[3]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(u=/* @__PURE__ */e("section",{className:"py-12 lg:py-16 bg-muted/30",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */t("div",{className:"grid lg:grid-cols-3 gap-8",children:[
32
+ /* @__PURE__ */e("div",{className:"lg:col-span-2",children:/* @__PURE__ */e(B,{})}),
33
+ /* @__PURE__ */e("div",{children:/* @__PURE__ */e(R,{})})]})})}),n[3]=u):u=n[3],n[4]===/* @__PURE__ */Symbol.for("react.memo_cache_sentinel")?(f=/* @__PURE__ */e("div",{className:"cc",children:/* @__PURE__ */t("main",{className:"flex-1",children:[m,u,
34
+ /* @__PURE__ */e("section",{className:"py-12 lg:py-16",children:/* @__PURE__ */e("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:/* @__PURE__ */e(Y,{})})})]})}),n[4]=f):f=n[4],n[5]!==c||n[6]!==o?(h=/* @__PURE__ */e(T,{id:o,initialData:c,children:f}),n[5]=c,n[6]=o,n[7]=h):h=n[7],n[8]!==d||n[9]!==h?(g=/* @__PURE__ */e(p,{options:d,children:h}),n[8]=d,n[9]=h,n[10]=g):g=n[10],g};export{te as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@colabcommerce/elements",
3
3
  "license": "UNLICENSED",
4
- "version": "0.9.5",
4
+ "version": "0.9.6",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",