@dropins/storefront-pdp 0.5.0-alpha2 → 0.5.0-alpha4

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.
@@ -91,6 +91,7 @@ export declare const MOCK_DATA_BUNDLE: {
91
91
  export declare const MOCK_DATA_BUNDLE_TRANSFORMED: {
92
92
  name: string;
93
93
  sku: string;
94
+ isBundle: boolean;
94
95
  addToCartAllowed: boolean;
95
96
  inStock: boolean;
96
97
  shortDescription: string;
@@ -1,4 +1,7 @@
1
1
  import { ProductModel } from '../../data/models';
2
2
 
3
- export declare const getProductData: (sku: string) => Promise<ProductModel | null>;
3
+ export declare const getProductData: (sku: string, options?: {
4
+ preselectFirstOption?: boolean;
5
+ optionsUIDs?: string[];
6
+ }) => Promise<ProductModel | null>;
4
7
  //# sourceMappingURL=getProductData.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { ProductModel } from '../../data/models';
2
2
 
3
- export declare const getRefinedProduct: (sku: string, optionUIDs: string[], anchorOptions?: string[], isBundle?: boolean) => Promise<ProductModel | null>;
3
+ export declare const getRefinedProduct: (sku: string, optionUIDs: string[], anchorOptions?: string[]) => Promise<ProductModel | null>;
4
4
  //# sourceMappingURL=getRefinedProduct.d.ts.map
@@ -1,4 +1,4 @@
1
- import{c as B}from"./initialize.js";import{FetchGraphQL as et}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:gt,setFetchGraphQlHeader:ht,removeFetchGraphQlHeader:wt,setFetchGraphQlHeaders:xt,fetchGraphQl:q,getConfig:_t}=new et().getMethods();function K(e,r){var i,u,o;const n=e?{name:e.name,sku:e.sku,addToCartAllowed:e.addToCartAllowed,inStock:e.inStock,shortDescription:e.shortDescription,metaDescription:e.metaDescription,metaKeyword:e.metaKeyword,metaTitle:e.metaTitle,description:e.description,images:rt(e),prices:mt(e,!!r),attributes:nt(e),options:ut(e),optionUIDs:at(e),url:e.url,urlKey:e.urlKey,externalId:e.externalId,externalParentId:e.externalParentId,variantSku:e.variantSku}:null,t=(o=(u=(i=B.getConfig())==null?void 0:i.models)==null?void 0:u.ProductDetails)==null?void 0:o.transform;return t&&n?t(n):n}function rt(e){var r,n;return(n=(r=e.images)==null?void 0:r.filter(t=>{var i;return!((i=t.roles)!=null&&i.includes("hide_from_pdp"))}))==null?void 0:n.map(t=>(t.url=t.url.replace(/^https?:/,""),t))}function nt(e){var r,n;return(n=(r=e.attributes)==null?void 0:r.filter(({roles:t})=>(t==null?void 0:t.indexOf("visible_in_pdp"))!==-1))==null?void 0:n.map(({label:t,value:i,name:u})=>({id:u,label:t,value:i.toString().split(",").join(", ")}))}function ut(e){const{options:r,optionUIDs:n}=e;return r==null?void 0:r.map(({id:t,title:i,required:u,multi:o,values:m})=>{var d,s;const a=(d=m==null?void 0:m[0])==null?void 0:d.__typename;let l=m==null?void 0:m[0].type;const c=((s=m==null?void 0:m[0])==null?void 0:s.__typename)==="ProductViewOptionValueProduct";return l?l=l.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):l="dropdown",{id:t,type:l,typename:a,label:i,required:u,multiple:o,items:c?it(m,n):ot(m,n,l)}})}function it(e,r){return e==null?void 0:e.map(({id:n,title:t,inStock:i,isDefault:u,product:o})=>({id:n,inStock:i,label:t,selected:(r==null?void 0:r.indexOf(n))>-1||u,value:n,product:o}))}function ot(e,r,n){return e==null?void 0:e.map(({id:t,title:i,inStock:u,value:o})=>({id:t,inStock:u,label:i,selected:(r==null?void 0:r.indexOf(t))>-1,value:(n==null?void 0:n.toLowerCase())==="dropdown"?t:o==null?void 0:o.replace(/^https?:/,"")}))}function mt(e,r){var E,x,H,I,L;const{price:n,priceRange:t,options:i,optionUIDs:u}=e;let{__typename:o}=e;function m(){var g;const P=n.regular.amount.value,f=((g=n.final)==null?void 0:g.amount.value)??n.regular.amount.value,y=n.regular.amount.currency==="NONE"?"USD":n==null?void 0:n.regular.amount.currency;return[P,f,f,y]}function a(){var _,b,S,V,T,C,D,A,F,$,G,M;const P=(_=t==null?void 0:t.minimum)==null?void 0:_.final.amount.value,f=(b=t==null?void 0:t.maximum)==null?void 0:b.final.amount.value;let y;((V=(S=t==null?void 0:t.minimum)==null?void 0:S.regular)==null?void 0:V.amount.value)===((C=(T=t==null?void 0:t.maximum)==null?void 0:T.regular)==null?void 0:C.amount.value)&&(y=(A=(D=t==null?void 0:t.minimum)==null?void 0:D.regular)==null?void 0:A.amount.value);const g=(($=(F=t==null?void 0:t.minimum)==null?void 0:F.final)==null?void 0:$.amount.currency)==="NONE"?"USD":(M=(G=t==null?void 0:t.minimum)==null?void 0:G.final)==null?void 0:M.amount.currency;return[y,P,f,g]}function l(){var S,V,T,C,D,A,F,$,G,M,X,Y;let P=0,f=0;i==null||i.forEach(k=>{var z;const j=k==null?void 0:k.values;if(j&&Array.isArray(j)){const h=j.map(p=>{var Q,N,J,W;return(W=(J=(N=(Q=p==null?void 0:p.product)==null?void 0:Q.price)==null?void 0:N.regular)==null?void 0:J.amount)==null?void 0:W.value}).filter(p=>p!==void 0),v=h.length>0?Math.max(...h):0;P+=v}else P+=0;(z=k==null?void 0:k.values)==null||z.forEach(h=>{var v,p,Q,N;u!=null&&u.includes(h.id)&&(f+=(N=(Q=(p=(v=h==null?void 0:h.product)==null?void 0:v.price)==null?void 0:p.final)==null?void 0:Q.amount)==null?void 0:N.value)})});const y=(S=t==null?void 0:t.minimum)==null?void 0:S.final.amount.value,g=(V=t==null?void 0:t.maximum)==null?void 0:V.final.amount.value;let _;((C=(T=t==null?void 0:t.minimum)==null?void 0:T.regular)==null?void 0:C.amount.value)===((A=(D=t==null?void 0:t.maximum)==null?void 0:D.regular)==null?void 0:A.amount.value)&&(_=($=(F=t==null?void 0:t.minimum)==null?void 0:F.regular)==null?void 0:$.amount.value);const b=((M=(G=t==null?void 0:t.minimum)==null?void 0:G.final)==null?void 0:M.amount.currency)==="NONE"?"USD":(Y=(X=t==null?void 0:t.minimum)==null?void 0:X.final)==null?void 0:Y.amount.currency;return r&&!u?[_,y,g,b]:P===(t==null?void 0:t.maximum.regular.amount.value)?[f,f,f,b]:[_,y,g,b]}const[c,d,s,w]=o==="SimpleProductView"?m():r?l():a(),O=o==="SimpleProductView"?(E=n==null?void 0:n.roles)==null?void 0:E.includes("visible"):((H=(x=t==null?void 0:t.maximum)==null?void 0:x.roles)==null?void 0:H.includes("visible"))&&((L=(I=t==null?void 0:t.minimum)==null?void 0:I.roles)==null?void 0:L.includes("visible"));return s&&d===s?{regular:{amount:c,currency:w,variant:c&&d!==c?"strikethrough":"default"},final:{amount:s,currency:w,variant:"default"},visible:O}:{final:{minimumAmount:d,maximumAmount:s,currency:w},visible:O}}function at(e){var n;let{optionUIDs:r}=e;return(n=e==null?void 0:e.options)==null||n.map(({values:t})=>{var u;((u=t==null?void 0:t[0])==null?void 0:u.__typename)==="ProductViewOptionValueProduct"&&!r&&(r=[],t==null||t.map(({id:o,isDefault:m})=>{m&&(r==null?void 0:r.indexOf(o))===-1&&r.push(o)}))}),r}const lt=`
1
+ import{c as j}from"./initialize.js";import{FetchGraphQL as re}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:we,setFetchGraphQlHeader:he,removeFetchGraphQlHeader:Se,setFetchGraphQlHeaders:_e,fetchGraphQl:R,getConfig:ke}=new re().getMethods();var N=(t=>(t.ComplexProduct="complex",t.SimpleProduct="simple",t))(N||{}),ee=(t=>(t.ComplexProductView="ComplexProductView",t.SimpleProductView="SimpleProductView",t))(ee||{});function K(t,u){var m,l,s,c,a,f,d;const i=((c=(s=(l=(m=t==null?void 0:t.options)==null?void 0:m[0])==null?void 0:l.values)==null?void 0:s[0])==null?void 0:c.__typename)==="ProductViewOptionValueProduct",r=ce(t,i,u==null?void 0:u.preselectFirstOption),e=(t==null?void 0:t.__typename)===ee.SimpleProductView?N.SimpleProduct:N.ComplexProduct,n=t?{name:t.name,sku:t.sku,isBundle:i,addToCartAllowed:t.addToCartAllowed,inStock:t.inStock,shortDescription:t.shortDescription,metaDescription:t.metaDescription,metaKeyword:t.metaKeyword,metaTitle:t.metaTitle,description:t.description,images:ne(t),prices:me(t,i,r),attributes:ue(t),options:ie(t,i),optionUIDs:r,url:t.url,urlKey:t.urlKey,externalId:t.externalId,externalParentId:t.externalParentId,variantSku:t.variantSku,productType:e}:null,o=(d=(f=(a=j.getConfig())==null?void 0:a.models)==null?void 0:f.ProductDetails)==null?void 0:d.transform;return o&&n?o(n):n}function ne(t){var u,i;return(i=(u=t.images)==null?void 0:u.filter(r=>{var e;return!((e=r.roles)!=null&&e.includes("hide_from_pdp"))}))==null?void 0:i.map(r=>(r.url=r.url.replace(/^https?:/,""),r))}function ue(t){var u,i;return(i=(u=t.attributes)==null?void 0:u.filter(({roles:r})=>(r==null?void 0:r.indexOf("visible_in_pdp"))!==-1))==null?void 0:i.map(({label:r,value:e,name:n})=>({id:n,label:r,value:e.toString().split(",").join(", ")}))}function ie(t,u){const{options:i,optionUIDs:r}=t;return i==null?void 0:i.map(({id:e,title:n,required:o,multi:m,values:l})=>{var a;const s=(a=l==null?void 0:l[0])==null?void 0:a.__typename;let c=l==null?void 0:l[0].type;return c?c=c.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):c="dropdown",{id:e,type:c,typename:s,label:n,required:o,multiple:m,items:u?oe(l,r):le(l,r,c)}})}function oe(t,u){return t==null?void 0:t.map(({id:i,title:r,inStock:e,isDefault:n,product:o})=>({id:i,inStock:e,label:r,selected:(u==null?void 0:u.indexOf(i))>-1||n,value:i,product:o}))}function le(t,u,i){return t==null?void 0:t.map(({id:r,title:e,inStock:n,value:o})=>({id:r,inStock:n,label:e,selected:(u==null?void 0:u.indexOf(r))>-1,value:(i==null?void 0:i.toLowerCase())==="dropdown"?r:o==null?void 0:o.replace(/^https?:/,"")}))}function me(t,u,i){var q,H,L,B,X;const{price:r,priceRange:e,options:n,optionUIDs:o=i}=t;let{__typename:m}=t;function l(){var x;const y=r.regular.amount.value,P=((x=r.final)==null?void 0:x.amount.value)??r.regular.amount.value,g=r.regular.amount.currency==="NONE"?"USD":r==null?void 0:r.regular.amount.currency;return[y,P,P,g]}function s(){var _,k,b,E,C,D,V,F,T,v,A,$;const y=(_=e==null?void 0:e.minimum)==null?void 0:_.final.amount.value,P=(k=e==null?void 0:e.maximum)==null?void 0:k.final.amount.value;let g;((E=(b=e==null?void 0:e.minimum)==null?void 0:b.regular)==null?void 0:E.amount.value)===((D=(C=e==null?void 0:e.maximum)==null?void 0:C.regular)==null?void 0:D.amount.value)&&(g=(F=(V=e==null?void 0:e.minimum)==null?void 0:V.regular)==null?void 0:F.amount.value);const x=((v=(T=e==null?void 0:e.minimum)==null?void 0:T.final)==null?void 0:v.amount.currency)==="NONE"?"USD":($=(A=e==null?void 0:e.minimum)==null?void 0:A.final)==null?void 0:$.amount.currency;return[g,y,P,x]}function c(){var b,E,C,D,V,F,T,v,A,$,Y,U;let y=0,P=0;n==null||n.forEach(O=>{var z;const I=O==null?void 0:O.values;if(I&&Array.isArray(I)){const w=I.map(p=>{var G,M,J,W;return(W=(J=(M=(G=p==null?void 0:p.product)==null?void 0:G.price)==null?void 0:M.regular)==null?void 0:J.amount)==null?void 0:W.value}).filter(p=>p!==void 0),Q=w.length>0?Math.max(...w):0;y+=Q}(z=O==null?void 0:O.values)==null||z.forEach(w=>{var Q,p,G,M;o!=null&&o.includes(w.id)&&(P+=(M=(G=(p=(Q=w==null?void 0:w.product)==null?void 0:Q.price)==null?void 0:p.final)==null?void 0:G.amount)==null?void 0:M.value)})});const g=(b=e==null?void 0:e.minimum)==null?void 0:b.final.amount.value,x=(E=e==null?void 0:e.maximum)==null?void 0:E.final.amount.value;let _;((D=(C=e==null?void 0:e.minimum)==null?void 0:C.regular)==null?void 0:D.amount.value)===((F=(V=e==null?void 0:e.maximum)==null?void 0:V.regular)==null?void 0:F.amount.value)&&(_=(v=(T=e==null?void 0:e.minimum)==null?void 0:T.regular)==null?void 0:v.amount.value);const k=(($=(A=e==null?void 0:e.minimum)==null?void 0:A.final)==null?void 0:$.amount.currency)==="NONE"?"USD":(U=(Y=e==null?void 0:e.minimum)==null?void 0:Y.final)==null?void 0:U.amount.currency;return u&&(o==null?void 0:o.length)<1?[_,g,x,k]:y===(e==null?void 0:e.maximum.regular.amount.value)?[P,P,P,k]:[_,g,x,k]}const[a,f,d,h]=m==="SimpleProductView"?l():u?c():s(),S=m==="SimpleProductView"?(q=r==null?void 0:r.roles)==null?void 0:q.includes("visible"):((L=(H=e==null?void 0:e.maximum)==null?void 0:H.roles)==null?void 0:L.includes("visible"))&&((X=(B=e==null?void 0:e.minimum)==null?void 0:B.roles)==null?void 0:X.includes("visible"));return d&&f===d?{regular:{amount:a,currency:h,variant:a&&f!==a?"strikethrough":"default"},final:{amount:d,currency:h,variant:"default"},visible:S}:{final:{minimumAmount:f,maximumAmount:d,currency:h},visible:S}}function ce(t,u,i){var r;return u?((r=t==null?void 0:t.options)==null?void 0:r.map(({values:n})=>{var l;const o=((l=n==null?void 0:n.find(({isDefault:s})=>s))==null?void 0:l.id)??null,m=i?n[0].id:null;return o||m})).filter(n=>n!==null):t==null?void 0:t.optionUIDs}const se=`
2
2
  fragment ProductOptionFragment on ProductViewOption {
3
3
  id
4
4
  title
@@ -47,7 +47,7 @@ fragment ProductOptionFragment on ProductViewOption {
47
47
  }
48
48
  }
49
49
  }
50
- `,R=`
50
+ `,te=`
51
51
  fragment ProductFragment on ProductView {
52
52
  __typename
53
53
  id
@@ -138,16 +138,16 @@ fragment ProductFragment on ProductView {
138
138
  }
139
139
  }
140
140
 
141
- ${lt}
142
- `,tt=`
141
+ ${se}
142
+ `,ae=`
143
143
  query GET_PRODUCT_DATA($skus: [String]) {
144
144
  products(skus: $skus) {
145
145
  ...ProductFragment
146
146
  }
147
147
  }
148
148
 
149
- ${R}
150
- `;function Z(e){return e.some(r=>(r==null?void 0:r.__typename)==="ProductViewOptionValueProduct")}const bt=async e=>{var u,o,m,a,l,c,d;const r=(a=(m=(o=(u=B)==null?void 0:u.getConfig())==null?void 0:o.models)==null?void 0:m.ProductDetails)==null?void 0:a.initialData;let n=(l=r==null?void 0:r.options)==null?void 0:l.some(s=>Z(s.values));if(r)return K(r,!!n);const{data:t}=await q(tt,{method:"GET",variables:{skus:[e]}}),i=(c=t==null?void 0:t.products)==null?void 0:c[0];return n=(d=i==null?void 0:i.options)==null?void 0:d.some(s=>Z(s.values)),K(i,!!n)},ct=`
149
+ ${te}
150
+ `,Oe=async(t,u)=>{var n,o,m,l,s;const i=(l=(m=(o=(n=j)==null?void 0:n.getConfig())==null?void 0:o.models)==null?void 0:m.ProductDetails)==null?void 0:l.initialData;if(i)return K(i);const{data:r}=await R(ae,{method:"GET",variables:{skus:[t]}}),e=(s=r==null?void 0:r.products)==null?void 0:s[0];return u!=null&&u.optionsUIDs&&(e.optionUIDs=u.optionsUIDs),K(e,{preselectFirstOption:u==null?void 0:u.preselectFirstOption})},de=`
151
151
  query REFINE_PRODUCT_QUERY(
152
152
  $optionIds: [String!]!
153
153
  $sku: String!
@@ -168,13 +168,13 @@ query REFINE_PRODUCT_QUERY(
168
168
  # %extendedPlaceholder%
169
169
  }
170
170
 
171
- ${R}
172
- `;async function U(e,r,n){var m;if(n)return{...(m=(await q(tt,{method:"GET",variables:{skus:[e]}})).data)==null?void 0:m.products[0],optionUIDs:r};const t=st(r),i=dt(t,e),u=ct.replace("# %extendedPlaceholder%",i),{data:o}=await q(u,{method:"GET",variables:{optionIds:r,sku:e}});return o}const kt=async(e,r,n,t)=>{var s,w,O,E;let i;if(i=await U(e,r,t),!i)return null;if(t)return K({...i,optionUIDs:r},!0);let{products:u,refineProduct:o,...m}=i;const a=u==null?void 0:u[0],l=ft(Object.values(m),a.options,n);if(n!=null&&n.length&&o===null){r=Pt(l,r,n);const x=await U(e,r);o=x==null?void 0:x.refineProduct}const c=K({...o||a,sku:a.sku,name:a.name,externalParentId:a==null?void 0:a.externalId,options:l,optionUIDs:r,variantSku:(o==null?void 0:o.__typename)==="SimpleProductView"?o==null?void 0:o.sku:void 0}),d=(E=(O=(w=(s=B)==null?void 0:s.getConfig())==null?void 0:w.models)==null?void 0:O.ProductDetails)==null?void 0:E.fallbackData;return d?d(a,c):c};function st(e){if(e.length<2)return[e];const r=[];return e.forEach(n=>{const t=[];e.forEach(i=>{n!==i&&t.push(i)}),r.push(t)}),r}function dt(e,r){return e.map((n,t)=>`
173
- ProductOption${t}: refineProduct(
171
+ ${te}
172
+ `;async function Z(t,u){const i=fe(u),r=Pe(i,t),e=de.replace("# %extendedPlaceholder%",r),{data:n}=await R(e,{method:"GET",variables:{optionIds:u,sku:t}});return n}const be=async(t,u,i)=>{var a,f,d,h;const r=await Z(t,u);if(!r)return null;let{products:e,refineProduct:n,...o}=r;const m=e==null?void 0:e[0],l=pe(Object.values(o),m.options,i);if(i!=null&&i.length&&n===null){u=ye(l,u,i);const S=await Z(t,u);n=S==null?void 0:S.refineProduct}const s=K({...n||m,sku:m.sku,name:m.name,externalParentId:m==null?void 0:m.externalId,options:l,optionUIDs:u,variantSku:(n==null?void 0:n.__typename)==="SimpleProductView"?n==null?void 0:n.sku:void 0}),c=(h=(d=(f=(a=j)==null?void 0:a.getConfig())==null?void 0:f.models)==null?void 0:d.ProductDetails)==null?void 0:h.fallbackData;return c?c(m,s):s};function fe(t){if(t.length<2)return[t];const u=[];return t.forEach(i=>{const r=[];t.forEach(e=>{i!==e&&r.push(e)}),u.push(r)}),u}function Pe(t,u){return t.map((i,r)=>`
173
+ ProductOption${r}: refineProduct(
174
174
  optionIds: [
175
- ${n.map(i=>`"${i}"`).join(", ")}
175
+ ${i.map(e=>`"${e}"`).join(", ")}
176
176
  ]
177
- sku: "${r}"
177
+ sku: "${u}"
178
178
  ) {
179
179
  ... on ComplexProductView {
180
180
  options {
@@ -182,4 +182,4 @@ ${R}
182
182
  }
183
183
  }
184
184
  }
185
- `).join("")}function ft(e,r,n){const t=Object.values(e).filter(u=>!!u).reduce((u,o)=>o.options?[...u,...o.options]:[...u],[]),i=new Map(r.map(u=>[u.id,u]));return t.forEach(u=>{n!=null&&n.includes(u.id)||i.set(u.id,u)}),[...i.values()]}function Pt(e,r,n){const t=[];let i;return e.forEach(u=>{var o,m,a,l;n.includes(u.id)?i=((m=(o=u.values)==null?void 0:o.find(c=>r.includes(c==null?void 0:c.id)))==null?void 0:m.id)||((a=u.values[0])==null?void 0:a.id):i=(l=u.values[0])==null?void 0:l.id,t.push(i)}),t}export{ht as a,xt as b,bt as c,kt as d,q as f,_t as g,wt as r,gt as s};
185
+ `).join("")}function pe(t,u,i){const r=Object.values(t).filter(n=>!!n).reduce((n,o)=>o.options?[...n,...o.options]:[...n],[]),e=new Map(u.map(n=>[n.id,n]));return r.forEach(n=>{i!=null&&i.includes(n.id)||e.set(n.id,n)}),[...e.values()]}function ye(t,u,i){const r=[];let e;return t.forEach(n=>{var o,m,l,s;i.includes(n.id)?e=((m=(o=n.values)==null?void 0:o.find(c=>u.includes(c==null?void 0:c.id)))==null?void 0:m.id)||((l=n.values[0])==null?void 0:l.id):e=(s=n.values[0])==null?void 0:s.id,r.push(e)}),r}export{he as a,_e as b,Oe as c,be as d,R as f,ke as g,Se as r,we as s};
@@ -1 +1 @@
1
- import{jsxs as j,jsx as n,Fragment as Ae}from"@dropins/tools/preact-jsx-runtime.js";import*as fe from"@dropins/tools/preact-compat.js";import{useState as G,Children as he,useRef as Le,useMemo as Ne,useEffect as C,useCallback as se}from"@dropins/tools/preact-compat.js";import{debounce as Oe,classes as $,VComponent as F,toLanguageTag as Me,Slot as Q}from"@dropins/tools/lib.js";import{Button as Pe,Icon as Se,Price as ge,Picker as qe,ColorSwatch as je,ImageSwatch as Xe,TextSwatch as Fe,Incrementer as Ge,Breadcrumbs as De,Image as xe}from"@dropins/tools/components.js";import{useText as X}from"@dropins/tools/i18n.js";import{cloneElement as Ye}from"@dropins/tools/preact.js";import{c as Te,d as Be}from"../chunks/getRefinedProduct.js";import{events as ke}from"@dropins/tools/event-bus.js";import{c as We}from"../chunks/initialize.js";import"@dropins/tools/fetch-graphql.js";const Ke=e=>fe.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},fe.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Ve=e=>fe.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},fe.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),fe.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),Ze=24,Ee=16,ve=2,Qe="32";var ze=(e=>(e[e.small=16]="small",e[e.medium=24]="medium",e[e.large=64]="large",e))(ze||{});const ye=({show:e=1,scrollbar:i=!1,peak:m=!1,arrows:p=!1,controls:s="dots",arrowsOnMainImage:y=!1,loop:u=!1,gap:P=null,direction:a="horizontal",width:Y="100%",height:o="100%",defaultIndex:b=0,className:R,children:M,thumbnails:W=null,isZoomed:Z,...re})=>{const le=X("PDP.Carousel.label").label,r=X("PDP.Carousel.Slide.label").label,w=X("PDP.Carousel.Previous.label").label,_=X("PDP.Carousel.Next.label").label,L=X("PDP.Carousel.Controls.label").label,O=X("PDP.Carousel.Controls.Button.label").label,[v,g]=G(()=>$e(e)),d=Math.ceil(he.count(M)/v),E=m?Ze:0,t=P?ze[P]:0,V=he.count(M)%v,[S,ae]=G(u?J()?b-1:b+1:b),K=Le([]),[te,z]=G(0),[ce,ue]=G(0),_e=Ne(()=>he.toArray(W),[W]),U=Ne(()=>{const l=he.toArray(M).reduce((c,D,N)=>N%v===0?[...c,[D]]:[...c.slice(0,-1),[...c[c.length-1],D]],[]);return!u||l.length===1?l:u&&he.count(M)%v===0?[l[d-1]].concat(l).concat([l[0],l[1]]):[he.toArray(M).slice(-v)].concat(l).concat([l[0],l[1]])},[M,v,d,u]),oe=Le(null),ne=Le(null),k=s==="thumbnailsRow"||s==="thumbnailsColumn";C(()=>{const l=document.body,c=Oe(()=>{var x,ie;z(((x=oe.current)==null?void 0:x.offsetWidth)??0),ue(((ie=oe.current)==null?void 0:ie.offsetHeight)??0);const N=window.innerWidth,I=$e(e,N);I!==v&&g(I)},50),D=new ResizeObserver(c);return D.observe(l),()=>{D.unobserve(l)}},[v,e]);const ee=se(l=>{const c=u?l-1:l,D=K==null?void 0:K.current[0],N=(D==null?void 0:D.offsetWidth)+Ee,I=(D==null?void 0:D.offsetHeight)+Ee,x=ne.current,ie=s==="thumbnailsRow",we=s==="thumbnailsColumn",de=ie?x==null?void 0:x.offsetWidth:x==null?void 0:x.offsetHeight,q=ie?N:I;(ie||we)&&de&&(q*(c+1)>de&&(x.style.scrollBehavior="smooth",ie?x.scrollLeft=J()?x.scrollWidth-x.clientWidth-(c+ve)*q:(c+ve)*q:x.scrollTop=(c+ve)*q),(J()&&(ie?x.scrollLeft:x.scrollTop)<=-q*c||!J()&&(ie?x.scrollLeft:x.scrollTop)>q*c)&&(x.style.scrollBehavior="smooth",ie?x.scrollLeft=J()?-(c-ve)*q:(c-ve)*q:x.scrollTop=(c-ve)*q))},[s,u]);C(()=>{ee(S)},[S,ee]);const T=se((l,c,D)=>{k&&ee(l);const N=oe.current,I=E?N.offsetWidth-E:N.offsetWidth-E+t;if(!Array.from(N.querySelectorAll("[data-index]")).filter(de=>{const q=Number(de.getAttribute("data-index"));return!isNaN(q)&&q>-1})[l])return;if(D){const de=l===0?d:0,q=I*(d+(V||v)/v);if(J()){if(N.scrollLeft<=0&&N.scrollLeft>-(I-5)){T(1,!0);return}if(N.scrollLeft<I-q&&N.scrollLeft>=-q){T(d,!0);return}N.style.scrollBehavior="auto",N.scrollLeft=de===0?0:-q,T(de===0?1:d,!0)}else{if(N.scrollLeft>=0&&N.scrollLeft<I-5){T(1,!0);return}if(N.scrollLeft>q-I&&N.scrollLeft<=q){T(d,!0);return}N.style.scrollBehavior="auto",N.scrollLeft=de===0?0:q,T(de===0?1:d,!0);return}}const we=(N.offsetWidth-t)/v*U[l].length-E;N.style.scrollBehavior=c?"smooth":"auto",N.scrollLeft=J()?-(U[l].length===v?I*l:I*(l-1)-we):U[l].length===v?I*l:I*(l-1)+we},[t,d,E,v,V,U,ee,s]),pe=se(()=>{if(u){const c=S-1;T(c,!0,J()?S===d-1:S===1);return}const l=S<=0?0:S-1;T(l,!0)},[S,T,u]),me=se(()=>{const l=U.length-1;if(u){const D=S+1;T(D,!0,J()?S===0:S===d);return}const c=S>=l?l:S+1;T(c,!0)},[U.length,u,S,T,d]);C(()=>{const l=c=>{c.key==="ArrowLeft"&&(c.preventDefault(),J()?me():pe()),c.key==="ArrowRight"&&(c.preventDefault(),J()?pe():me())};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[me,pe]),C(()=>{T(u?b+1:b,!1)},[b,T,u]);const be=Oe(()=>{const l=oe.current,c=E?l.offsetWidth-E:l.offsetWidth-E+t,D=Math.abs(l.scrollLeft)/c,N=Math.abs(Math.round(D)-D<1?Math.round(D):Math.ceil(D));if(k&&ee(N),u){const I=c*(d+(V||v)/v),x=J()?-l.scrollLeft:l.scrollLeft;if(Math.ceil(Math.abs(x))>=Math.ceil(I)-5){l.style.scrollBehavior="auto",l.scrollLeft=J()?-l.offsetWidth+(Math.ceil(x)-Math.ceil(I)-E):l.offsetWidth+(Math.ceil(x)-Math.ceil(I)-E);return}if(Math.abs(x)===0){l.style.scrollBehavior="auto",l.scrollLeft=J()?-(I-l.offsetWidth+E):I-l.offsetWidth+E;return}}S!==N&&ae(N)},100);C(()=>{const l=oe.current;return l==null||l.addEventListener("scroll",be),()=>{l==null||l.removeEventListener("scroll",be)}},[be]);const h=(l,c,D)=>n(Pe,{className:$([["pdp-carousel__button",!l],[`pdp-carousel__button--${c}`,!l],[`pdp-carousel__button--${s}`,l]]),style:{"--height":`${ce}px`},variant:"tertiary","aria-label":c==="next"?_:w,onClick:D,disabled:u?!1:c==="next"?S>=U.length-1:S<1,children:n(Se,{className:$([["pdp-carousel__button__icon",!l],[`pdp-carousel__button__icon--${c}`,!l],[`pdp-carousel__button__icon--${s}--${c}`,l]]),size:Qe,source:Ke})}),f=p&&U.length!=1&&h(k,"prev",pe),A=p&&U.length!=1&&h(k,"next",me),B=p&&U.length!=1&&h(!1,"prev",pe),H=p&&U.length!=1&&h(!1,"next",me);return j("div",{role:"region","aria-roledescription":le,className:$(["pdp-carousel",["pdp-carousel--main-image-controls",y],["pdp-carousel--arrows",p&&!k],[`pdp-carousel--${s}`,k],R]),style:{"--flex-carousel":s==="thumbnailsColumn"?"row-reverse":"column","--gap":k?"0":"var(--spacing-small)","--width":Y},...re,children:[n("div",{ref:oe,className:$(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${a}`,["pdp-carousel__wrapper--scrollbar",i],["pdp-carousel__wrapper--peak",m]]),style:{"--total-width":s==="thumbnailsColumn"?"81.6%":"100%","--height":s==="thumbnailsColumn"?"auto":o,"--gap":P?`var(--spacing-${P})`:"0px","--per-page":v},tabIndex:0,children:U.map((l,c)=>{const D=l.length<v;return n("div",{role:"group","aria-roledescription":r,"data-index":c,className:$(["pdp-carousel__slide",`pdp-carousel__slide--${a}`,["pdp-carousel__slide--active",S===c],["pdp-carousel__slide--orphan",D]]),style:{"--length":l.length},children:l},c)})}),!k&&j(Ae,{children:[f,A]}),k&&y&&j(Ae,{children:[B,H]}),s&&U.length!=1&&j("div",{className:$([[`pdp-carousel__controls__container--${s}`,k],["pdp-carousel__controls__container--no-arrows",!p||y]]),style:{"--width":s==="thumbnailsRow"?`${te}px`:Y,"--height":`${ce}px`,"--nr-thumbnails":_e.length},children:[(k||Z)&&!y&&f,n("div",{ref:ne,className:$([[`pdp-carousel__controls__wrapper--${s}`,k],["pdp-carousel__controls__wrapper",k]]),children:n("div",{role:"group","aria-label":L,className:$(["pdp-carousel__controls",[`pdp-carousel__controls--${s}`,k]]),children:(u?U.slice(0,d):U).map((l,c)=>{const D=u?d:U.length,N=u?S-1===c:S===c;return k?j("label",{className:$(["pdp-carousel__thumbnail__container"]),ref:I=>{I&&(K.current[c]=I)},children:[n("input",{type:"radio",name:"carousel-thumbnails","aria-label":O.replace("{key}",String(c+1)).replace("{total}",String(D)),checked:N&&te!==0,onChange:()=>{T(u?c+1:c,!0)},...re,className:$(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",N&&te!==0]])}),n("span",{className:$(["pdp-carousel__thumbnail__span"]),children:_e[c]})]},c):n("button",{"aria-label":O.replace("{key}",String(c+1)).replace("{total}",String(D)),onClick:()=>{T(u?c+1:c,!0)},className:$(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",N]])},c)})})}),(k||Z)&&!y&&A]})]})};function $e(e,i=0){if(typeof e=="number")return e;const{small:m,medium:p,large:s}=e,u=[{breakpoint:1024,value:s},{breakpoint:786,value:p},{breakpoint:0,value:m}].find(({breakpoint:P})=>i>P);return u?u.value:m}function J(){return document.documentElement.dir==="rtl"}const Je=({title:e,breadcrumbs:i,galleryContent:m,infoContent:p,productContent:s,sku:y,outOfStock:u,shortDescription:P,description:a,attributes:Y,images:o,options:b,price:R,specialPrice:M,className:W,children:Z,quantity:re,actions:le,carouselConfig:r,zoomType:w="overlay",closeButton:_=!0,...L})=>{var ae,K,te,z,ce,ue,_e,U,oe;const O=X("PDP.Product.RegularPrice.label").label,v=X("PDP.Product.SpecialPrice.label").label,g=X("PDP.Product.OutOfStock.label").label,d=X("PDP.Product.Image.label").label,[E,t]=G(null),V=o!=null&&o.length?o.map((ne,k)=>{var T;const ee=((T=e==null?void 0:e.props)==null?void 0:T.children)&&(d==null?void 0:d.replace("{product}",e.props.children.toString()).replace("{key}",String(k+1)).replace("{total}",String(o.length)));return w==="zoom"?n(at,{closeButton:_,children:n(F,{node:ne,loading:k===0?"eager":"lazy",alt:ee},k)}):n(F,{node:ne,loading:k===0?"eager":"lazy",alt:ee,onClick:()=>t(k)},k)}):n("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),S=(ae=r==null?void 0:r.thumbnails)!=null&&ae.length?r.thumbnails.map((ne,k)=>{var ee;return n(F,{node:ne,loading:(r==null?void 0:r.thumbnailsLoadingMode)||"lazy",alt:((ee=e==null?void 0:e.props)==null?void 0:ee.children)&&(d==null?void 0:d.replace("{product}",e.props.children.toString()).replace("{key}",String(k+1)).replace("{total}",String(o.length)))},k)}):n("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return j("div",{...L,className:$(["pdp-product",W]),children:[i&&n(F,{node:i,className:"pdp-product__breadcrumbs"}),j("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[n("div",{className:"pdp-product__column-body",children:(K=r==null?void 0:r.controls)!=null&&K.desktop?n(ye,{className:"pdp-product__overlay__carousel",arrows:(o==null?void 0:o.length)>1,controls:(o==null?void 0:o.length)>1?r.controls.desktop:"dots",arrowsOnMainImage:r==null?void 0:r.arrowsOnMainImage,loop:(r==null?void 0:r.loopable)&&(o==null?void 0:o.length)>1,peak:((te=r==null?void 0:r.thumbnails)==null?void 0:te.length)>1&&((z=r==null?void 0:r.peak)==null?void 0:z.desktop)||!1,gap:(r==null?void 0:r.gap)||null,width:"100%",height:"100%",defaultIndex:E||0,thumbnails:S,children:V}):n(Ce,{className:"pdp-product__images",gap:"small",children:V})}),m&&n(F,{node:m,className:"pdp-product__gallery-content"})]}),j("div",{className:"pdp-product__column-container pdp-product__content-column",children:[j("div",{className:"pdp-product__column-body",children:[j("div",{className:"pdp-product__header",children:[e&&n(F,{node:e,className:"pdp-product__title"}),y&&n(F,{node:y,className:"pdp-product__sku"})]}),j("div",{className:"pdp-product__prices",children:[M&&n(F,{node:M,className:$(["pdp-product__price-special","pdp-product__price"]),"aria-label":v,role:"text"}),R&&n(F,{node:R,className:$(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":O,role:"text"})]}),(ce=r==null?void 0:r.controls)!=null&&ce.mobile&&((ue=r==null?void 0:r.controls)==null?void 0:ue.mobile)==="thumbnailsRow"?n(ye,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(o==null?void 0:o.length)>1,controls:(o==null?void 0:o.length)>1?"thumbnailsRow":null,loop:(r==null?void 0:r.loopable)&&(o==null?void 0:o.length)>1,peak:((_e=r==null?void 0:r.thumbnails)==null?void 0:_e.length)>1&&((U=r==null?void 0:r.peak)==null?void 0:U.mobile)||!1,gap:(r==null?void 0:r.gap)||null,thumbnails:S,children:V}):n(ye,{className:"pdp-product__images pdp-product__images--carousel",peak:((oe=r==null?void 0:r.peak)==null?void 0:oe.mobile)&&(o==null?void 0:o.length)>1,gap:(r==null?void 0:r.gap)||null,width:"100%",height:"auto",arrows:(o==null?void 0:o.length)>1,controls:(o==null?void 0:o.length)>1?"dots":null,loop:(r==null?void 0:r.loopable)&&(o==null?void 0:o.length)>1,children:V}),j("div",{className:$(["pdp-product__actions",["pdp-product__actions--out-of-stock",u]]),children:[u&&n("div",{className:"pdp-product__out-of-stock__text",children:g}),b&&n(F,{node:b,className:$(["pdp-product__options"])}),re&&n("div",{className:"pdp-product__quantity",children:n(F,{node:re})}),le&&n(F,{node:le,className:$(["pdp-product__buttons"])})]}),P&&n(F,{node:P,className:$(["pdp-product__short_description"])}),a&&n(F,{node:a,className:$(["pdp-product__description"])}),Y?n("div",{className:"pdp-product__attributes",children:Y}):null]}),p&&n(F,{node:p,className:"pdp-product__info-content"})]}),s&&n(F,{node:s,className:"pdp-product__content"}),E===null?null:n(et,{className:"pdp-product__overlay",onClose:()=>t(null),centered:!0,children:n(ye,{className:"pdp-product__overlay__carousel",arrows:(o==null?void 0:o.length)>1,width:"100%",height:"100%",defaultIndex:E||0,loop:(r==null?void 0:r.loopable)&&(o==null?void 0:o.length)>1,controls:(o==null?void 0:o.length)>1?"dots":null,isZoomed:!0,children:V})})]})},Ce=({children:e,gap:i=null,className:m,style:p,...s})=>{const y=he.count(e);return n("div",{...s,className:$(["pdp-gallery-grid",m]),style:{"--gap":i?`var(--spacing-${i})`:"0px",...p},children:he.map(e,(u,P)=>n("div",{className:"pdp-gallery-grid__item",children:n(F,{node:u,loading:P===0?"eager":"lazy"},u.props.src)},y+P))})},Ie=({amount:e,currency:i,locale:m,variant:p,sale:s,minimumAmount:y,maximumAmount:u,className:P,...a})=>n(Ae,{children:e||y===u?n("div",{className:"pdp-price-range",...a,children:n(ge,{amount:e||y,currency:i,locale:m,variant:p,sale:s,className:P})}):j("div",{className:"pdp-price-range",...a,children:[n(ge,{amount:y,currency:i,locale:m,className:P}),n("span",{className:"pdp-price-range__label",children:"-"}),n(ge,{amount:u,currency:i,locale:m,className:P})]})}),et=({centered:e,onClose:i,className:m,children:p,...s})=>{const y=X("PDP.Overlay.Close.label").label,u=se(()=>{i==null||i()},[i]);return C(()=>{const P=a=>{a.key==="Escape"&&u()};return document.addEventListener("keydown",P),()=>{document.removeEventListener("keydown",P)}},[u]),C(()=>{const P=document.scrollingElement,a=P.style.overflow;return P.style.overflow="hidden",()=>{P.style.overflow=a}},[]),j("div",{...s,className:$(["pdp-overlay",["pdp-overlay--centered",e],m]),children:[n("div",{className:"pdp-overlay__content",children:p}),n(Pe,{"aria-label":y,variant:"tertiary",className:"pdp-overlay__close-button",onClick:u,icon:n(Ve,{})})]})},tt=["text","image","color","dropdown"],nt=e=>e.map(i=>({...i,text:i.label,disabled:!i.inStock}));function rt(e,i){return e.reduce((m,p)=>{const s=i==null?void 0:i.find(u=>u.items.find(P=>P.id===p));if(!s)return m;const y=s.items.find(u=>u.id===p);return{...m,[s.id]:{label:y.label,value:y.id}}},{})}const lt=({options:e,hideSelectedValue:i,disablePreselections:m,selectedUIDs:p,onValues:s,onErrors:y,defaultOptions:u,selectionsToUpdate:P,className:a,children:Y,...o})=>{const b=X("PDP.Swatches.Required.label").label,R=X("PDP.Swatches.ChooseOption.label").label,[M,W]=G(()=>e==null?void 0:e.reduce((w,_)=>{const{items:L}=_,O=L==null?void 0:L.find(g=>u==null?void 0:u.includes(g.id)),v=L==null?void 0:L.find(g=>g.selected);return O?{...w,[_.id]:{label:O.label,value:O.id}}:v?{...w,[_.id]:{label:v.label,value:v.id}}:w},{}));C(()=>{var r;if(p){const w=rt(p,e);if(JSON.stringify(w)===JSON.stringify(M))return;Z(Object.keys(w)[0],(r=w[Object.keys(w)[0]])==null?void 0:r.label,p[0])}},[p]),C(()=>{P==null||P.forEach(r=>{W(w=>{var O;const _=(O=r==null?void 0:r.items)==null?void 0:O.find(v=>v.selected);return _?{...w,[r.id]:{label:_==null?void 0:_.label,value:_==null?void 0:_.id}}:w})})},[P,W]),Ne(()=>{const r=e==null?void 0:e.reduce((w,_)=>{var O;let L=!1;return(O=_==null?void 0:_.items)==null||O.forEach(v=>{var d;((d=M[_.id])==null?void 0:d.value)===v.id&&(L=!0)}),_.required&&!L&&(w[_.id]=b),w},{});return y==null||y(r),r},[M]);const Z=se((r,w,_)=>{W(L=>{let O={...L,...r&&{[r]:{label:w,value:_}}};return w===R&&delete O[r],s==null||s(O,_),O})},[s]),re=(r,w)=>{var L;const _=((L=w.selectedOptions[0])==null?void 0:L.label)??"";Z(r,_,w.value)},le=se(({items:r,id:w,required:_,type:L,selected:O,label:v})=>(r==null?void 0:r.length)>0&&n("div",{className:$(["pdp-swatches__options"]),children:(L==null?void 0:L.toLowerCase())==="dropdown"?n(qe,{"aria-label":v,placeholder:m?R:void 0,handleSelect:g=>re(w,g.target),options:nt(r),value:O}):r==null?void 0:r.map(g=>{const d={key:g.id,id:g.id,name:w,value:g.value,label:g.label,groupAriaLabel:v,selected:O===g.id,outOfStock:!g.inStock,required:_===null?!0:_,onValue:()=>{Z(w,g.label,g.id)}};switch(L){case"text":return n(Fe,{...d,label:g.label});case"image":return n(Xe,{...d,src:g.value,alt:g.label});case"color":return n(je,{...d,size:"large",color:g.value});default:return console.warn(`Invalid swatch type ${L}`),null}})}),[Z]);return n("div",{...o,className:$(["pdp-swatches",a]),children:e==null?void 0:e.map(({type:r,label:w,id:_,multiple:L,required:O,items:v})=>{var g;return tt.includes(r)||console.warn(`Invalid swatch type ${r}`),L&&console.warn("Multiple selection swatches are not currently supported."),j("div",{id:`swatch-item-${_}`,"data-slot-key":`product-swatch--${_}`,className:"pdp-swatches__field",children:[n("div",{className:"pdp-swatches__field__label",children:M[_]?i?`${w}`:`${w}: ${M[_].label}`:w}),n(le,{id:_,type:r,required:O,items:v,label:w,selected:(g=M[_])==null?void 0:g.value})]},`swatch-item-${_}`)})})},at=({children:e,scale:i=2,closeButton:m=!0})=>{const[p,s]=G(!1),[y,u]=G("pdp-zoom"),[P,a]=G(!1),[Y,o]=G({x:0,y:0}),[b,R]=G({x:0,y:0}),[M,W]=G({x:0,y:0}),Z=d=>{!p||d.type!=="touchstart"||(o({x:d.touches[0].clientX,y:d.touches[0].clientY}),R({x:M.x,y:M.y}),a(!0))},re=d=>{var ce;if(!P||d.type!=="touchmove")return;const E=(ce=d.currentTarget)==null?void 0:ce.getBoundingClientRect(),t=(100-100/i)/2,V=d.touches[0].clientX-Y.x,S=d.touches[0].clientY-Y.y,ae=V*100/(E.width*i),K=S*100/(E.height*i),te=b.x+ae,z=b.y+K;W({x:Math.max(-t,Math.min(te,t))||0,y:Math.max(-t,Math.min(z,t))||0}),d.preventDefault()},le=d=>{var K;const E=(K=d.currentTarget)==null?void 0:K.getBoundingClientRect(),t=(100-100/i)/2;let V;if("touches"in d)V=d.touches[0];else if(d instanceof MouseEvent)V=d;else return;const S=t-(V.clientX-E.left)/E.width*100,ae=t-(V.clientY-E.top)/E.height*100;W({x:Math.max(-t,Math.min(S,t))||0,y:Math.max(-t,Math.min(ae,t))||0})},r=d=>{if(!P){if(p){if(m&&"touches"in d){Z(d);return}m||s(!1)}else s(!0),le(d);d.preventDefault()}},w=d=>{if(m&&"touches"in d){re(d);return}p&&le(d)},_=()=>{if(m){a(!1);return}s(!1)},L=d=>{s(!1),d.stopPropagation()},O=p?`scale(${i}) translateX(${M.x}%) translateY(${M.y}%)`:"none",v=X("PDP.Zoom.Close.label").label,g=Ye(he.only(e),{draggable:!1,style:{"--transform":O}});return C(()=>{u(p?`pdp-zoom ${m?"pdp-zoom--no-effects":"pdp-zoom--zoomed"}`:"pdp-zoom")},[p,m]),j("figure",{className:y,onClick:r,onMouseMove:w,onMouseLeave:_,onTouchStart:r,onTouchMove:w,onTouchEnd:_,children:[g,m&&p&&n(Pe,{"aria-label":v,variant:"tertiary",className:"pdp-zoom__close-button",icon:n(Ve,{}),onClick:L})]})};function ct(e,i="en_US"){if(!Ue(e))throw Error("Invalid date string");return e.split(" ")[1]||(e=`${e} 00:00:00`),new Date(e).toLocaleDateString(Me(i)).toString()}function Ue(e){if(![/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/,/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/].some(p=>p.test(e)))return!1;const m=new Date(e);return!isNaN(m.getTime())}function ot(e){const i=new URLSearchParams(window.location.search);Object.entries(e).forEach(([p,s])=>{s===null?i.delete(p):i.set(p,String(s))});let m=window.location.pathname;m+=`?${i.toString()}`,m+=window.location.hash,window.history.replaceState({},"",m)}function it(){const e=new URLSearchParams(window.location.search),i={};return e.forEach((m,p)=>{i[p]=m}),i}function st(e){var i,m,p,s,y,u,P,a,Y,o,b,R;return{productId:Number(e==null?void 0:e.externalId),name:e==null?void 0:e.name,sku:(e==null?void 0:e.variantSku)||(e==null?void 0:e.sku),topLevelSku:e==null?void 0:e.sku,specialToDate:void 0,specialFromDate:void 0,newToDate:void 0,newFromDate:void 0,createdAt:void 0,updatedAt:void 0,manufacturer:void 0,countryOfManufacture:void 0,categories:void 0,productType:void 0,pricing:{regularPrice:((m=(i=e==null?void 0:e.prices)==null?void 0:i.regular)==null?void 0:m.amount)||0,minimalPrice:(s=(p=e==null?void 0:e.prices)==null?void 0:p.final)==null?void 0:s.minimumAmount,maximalPrice:(u=(y=e==null?void 0:e.prices)==null?void 0:y.final)==null?void 0:u.maximumAmount,specialPrice:(a=(P=e==null?void 0:e.prices)==null?void 0:P.final)==null?void 0:a.amount,tierPricing:void 0,currencyCode:((o=(Y=e==null?void 0:e.prices)==null?void 0:Y.final)==null?void 0:o.currency)||"USD"},canonicalUrl:e==null?void 0:e.url,mainImageUrl:(R=(b=e==null?void 0:e.images)==null?void 0:b[0])==null?void 0:R.url}}const dt={PRODUCT_CONTEXT:"productContext"},ht={PRODUCT_PAGE_VIEW:"product-page-view"};function He(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function ut(e,i){const m=He();m.push({[e]:null}),m.push({[e]:i})}function pt(e,i){He().push(p=>{const s=p.getState?p.getState():{};p.push({event:e,eventInfo:{...s,...i}})})}function Re(e){const i=st(e);ut(dt.PRODUCT_CONTEXT,i),pt(ht.PRODUCT_PAGE_VIEW)}const mt=({sku:e,hideSku:i,hideQuantity:m,hideShortDescription:p,hideDescription:s,hideAttributes:y,hideURLParams:u,hideSelectedOptionValue:P,slots:a,children:Y,initialData:o,carousel:b,optionsConfig:R,useACDL:M,onAddToCart:W,zoomType:Z,closeButton:re=!0,disableDropdownPreselection:le,...r})=>{var T,pe,me,be;const w=X("PDP.Product.AddToCart.label").label,_=X("PDP.Product.Incrementer.label").label,L=X("PDP.Product.Details.label").label,O=X("PDP.Swatches.ChooseOption.label").label,[v,g]=G(We.getConfig().defaultLocale||"en-US"),[d,E]=G(),[t=null,V]=G(o),[S,ae]=G(()=>{const h={sku:e,quantity:1};return t!=null&&t.optionUIDs&&(h.optionsUIDs=t.optionUIDs),h}),[K,te]=G(()=>{var h,f;return!(t!=null&&t.options&&((h=t==null?void 0:t.options)==null?void 0:h.length)>0&&((f=t==null?void 0:t.optionUIDs)==null?void 0:f.length)!==(t==null?void 0:t.options.length))}),z={data:t,values:S,valid:K};function ce(h){return h==null?void 0:h.some(f=>(f==null?void 0:f.typename)==="ProductViewOptionValueProduct")}C(()=>{const h=ke.on("pdp/setValues",f=>{ae(A=>({...A,...f}))});return()=>{h==null||h.off()}},[]),C(()=>{const h=ke.on("locale",f=>{f!==v&&(g(f),Te(e).then(V))});return()=>{h==null||h.off()}},[v,e]),C(()=>{M&&o&&Object.keys(o).length>0&&Re(o)},[o]);const ue=se(h=>{ae(f=>({...f,...h}))},[]);C(()=>{ke.emit("pdp/values",S)},[JSON.stringify(S)]);const _e=se(h=>{var B,H;let f=Object.entries(h).filter(([l,c])=>c.label!==O).map(([l,c])=>h[l].value).filter(l=>l!==void 0);!u&&(t!=null&&t.options)&&!ce(t.options)&&ot({optionsUIDs:f.join(",")}),ue({optionsUIDs:f}),te((f==null?void 0:f.length)===((B=t==null?void 0:t.options)==null?void 0:B.length));const A=(H=t==null?void 0:t.options)==null?void 0:H.some(l=>ce([l]));Be(e,f,R==null?void 0:R.anchorOptions,A).then(l=>{var c;V(l),(c=R==null?void 0:R.anchorOptions)!=null&&c.length&&U(l,f),M&&(l==null?void 0:l.variantSku)!==e&&Re(l)})},[e]),U=se((h,f)=>{var H;const A=(h==null?void 0:h.optionUIDs)??[];f.every(l=>A.includes(l))||(E(h==null?void 0:h.options),ue({optionsUIDs:A}),te((A==null?void 0:A.length)===((H=h==null?void 0:h.options)==null?void 0:H.length)))},[e]),oe=se(h=>{Object.keys(h).length!==0&&te(!1)},[]),ne=Ne(()=>{var h;return(h=t==null?void 0:t.attributes)==null?void 0:h.map(({label:f,value:A},B)=>{const H=Ue(A)?ct(A,v):A.toString();return j("li",{children:[f,": ",n("span",{dangerouslySetInnerHTML:{__html:H}})]},B)})},[t==null?void 0:t.attributes,v]),k=!m&&(t!=null&&t.inStock)?n(Q,{name:"Quantity",slot:a==null?void 0:a.Quantity,context:{...z},children:n(Ge,{name:"quantity",defaultValue:S.quantity.toString(),value:S.quantity.toString(),min:1,"aria-label":_,className:"pdp-product__quantity",onValue:h=>{ue({quantity:Number(h)})}},"quantity")}):void 0,ee=()=>{if(t!=null&&t.options)return n(Q,{name:"Options",slot:a==null?void 0:a.Options,context:{...z},children:n(lt,{selectedUIDs:S.optionsUIDs,options:t.options,defaultOptions:S.optionsUIDs,selectionsToUpdate:d,hideSelectedValue:P,disablePreselections:le,onValues:_e,onErrors:oe})})};return n("div",{...r,children:n(Je,{title:n(Q,{name:"Title",slot:a==null?void 0:a.Title,context:{...z},children:t==null?void 0:t.name}),sku:i?void 0:n(Q,{name:"SKU",slot:a==null?void 0:a.SKU,context:{...z},children:t==null?void 0:t.sku}),options:ee(),breadcrumbs:(a==null?void 0:a.Breadcrumbs)&&n(Q,{name:"Breadcrumbs",slot:a==null?void 0:a.Breadcrumbs,context:{...z,setSeparator(h){this._registerMethod((...f)=>{const A=h(...f),B=A&&n(Se,{source:A});this._setProps(H=>({...H,separator:B,children:[n(De,{separator:B,categories:H.categories})]}))})},appendLink(h){this._registerMethod((...f)=>{const{text:A,...B}=h(...f),H=n("a",{...B,children:A});this._setProps(l=>{const c=[...l.categories||[],H];return{...l,categories:c,children:[n(De,{separator:l.separator,categories:c})]}})})},appendHTMLElement(h){this._registerMethod((...f)=>{const A=h(...f),B=this._htmlElementToVNode(A);this._setProps(H=>{const l=[...H.categories||[],B];return{...H,categories:l,children:[n(De,{separator:H.separator,categories:l})]}})})}}}),quantity:k,actions:n(Q,{name:"Actions",slot:a==null?void 0:a.Actions,context:{...z,appendButton(h){this._registerMethod((...f)=>{const A=h(...f);if(!A)return;const{text:B,icon:H,...l}=A,c=n(Pe,{type:"button",...l,icon:H&&n(Se,{source:H}),children:B});this._setProps(D=>({children:[...D.children||[],c]}))})}},children:!(a!=null&&a.Actions)&&n(Pe,{size:"medium",type:"submit",icon:n(Se,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!K,"aria-label":w,onClick:()=>W==null?void 0:W(S),children:w})}),shortDescription:p?void 0:n(Q,{name:"ShortDescription",slot:a==null?void 0:a.ShortDescription,context:{...z},children:n("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:s?void 0:n(Q,{name:"Description",slot:a==null?void 0:a.Description,context:{...z},children:n("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((T=t==null?void 0:t.images)==null?void 0:T.map(({label:h,url:f})=>{var A,B;return n(xe,{title:h,alt:h,src:f,width:((A=b==null?void 0:b.imageParams)==null?void 0:A.width)??960,height:((B=b==null?void 0:b.imageParams)==null?void 0:B.height)??1191,params:(b==null?void 0:b.imageParams)??{width:960}},f)}))??[],specialPrice:(pe=t==null?void 0:t.prices)!=null&&pe.visible?n(Q,{name:"SpecialPrice",slot:a==null?void 0:a.SpecialPrice,context:{...z},children:n(Ie,{...t.prices.final,locale:Me(v)})}):void 0,price:(me=t==null?void 0:t.prices)!=null&&me.visible&&t.prices.regular&&t.prices.final.amount!==(t==null?void 0:t.prices.regular.amount)?n(Q,{name:"RegularPrice",slot:a==null?void 0:a.RegularPrice,context:{...z},children:n(Ie,{...t.prices.regular,locale:Me(v)})}):void 0,zoomType:Z,closeButton:re,carouselConfig:{...b,thumbnails:b&&Object.keys(b).length?((be=t==null?void 0:t.images)==null?void 0:be.map(({label:h,url:f})=>{var A,B;return n(xe,{title:h,alt:h,src:f,width:((A=b==null?void 0:b.thumbnailParams)==null?void 0:A.width)??200,height:((B=b==null?void 0:b.thumbnailParams)==null?void 0:B.height)??248,params:(b==null?void 0:b.thumbnailParams)??{width:200}},f)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:y?void 0:n(Q,{name:"Attributes",slot:a==null?void 0:a.Attributes,context:{...z},children:ne!=null&&ne.length?j(Ae,{children:[L,n("ul",{children:ne})]}):null}),galleryContent:(a==null?void 0:a.GalleryContent)&&n(Q,{name:"GalleryContent",slot:a.GalleryContent,context:{...z}}),infoContent:(a==null?void 0:a.InfoContent)&&n(Q,{name:"InfoContent",slot:a.InfoContent,context:{...z}}),productContent:(a==null?void 0:a.Content)&&n(Q,{name:"Content",slot:a.Content,context:{...z}})})})};mt.getInitialData=async function({sku:e,optionsConfig:i}){var P,a,Y,o,b,R,M;function m(W){return W.some(Z=>Z.__typename==="ProductViewOptionValueProduct")}let p;const s=We.getConfig(),y=((P=it().optionsUIDs)==null?void 0:P.split(","))||((o=(Y=(a=s==null?void 0:s.models)==null?void 0:a.ProductDetails)==null?void 0:Y.initialData)==null?void 0:o.optionsUIDs),u=(R=(b=s==null?void 0:s.models)==null?void 0:b.ProductDetails)==null?void 0:R.initialData;return u&&Object.keys(u).length>0&&(p=(M=u.options)==null?void 0:M.some(W=>m(W==null?void 0:W.values))),y!=null&&y.length?await Be(e,y,i==null?void 0:i.anchorOptions,p):await Te(e)};export{mt as ProductDetails,mt as default};
1
+ import{jsxs as F,jsx as n,Fragment as Ne}from"@dropins/tools/preact-jsx-runtime.js";import*as ve from"@dropins/tools/preact-compat.js";import{useState as Y,Children as he,useRef as Se,useMemo as Le,useEffect as J,useCallback as ie}from"@dropins/tools/preact-compat.js";import{debounce as Oe,classes as $,VComponent as G,toLanguageTag as Me,Slot as Z}from"@dropins/tools/lib.js";import{Button as Pe,Icon as Ae,Price as ge,Picker as He,ColorSwatch as qe,ImageSwatch as je,TextSwatch as Fe,Incrementer as Xe,Breadcrumbs as De,Image as Ee}from"@dropins/tools/components.js";import{useText as X}from"@dropins/tools/i18n.js";import{cloneElement as Ge}from"@dropins/tools/preact.js";import{c as ke,d as Te}from"../chunks/getRefinedProduct.js";import{events as xe}from"@dropins/tools/event-bus.js";import{c as Be}from"../chunks/initialize.js";import"@dropins/tools/fetch-graphql.js";const Ye=e=>ve.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ve.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),We=e=>ve.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ve.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),ve.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),Ke=24,$e=16,fe=2,Ze="32";var ze=(e=>(e[e.small=16]="small",e[e.medium=24]="medium",e[e.large=64]="large",e))(ze||{});const ye=({show:e=1,scrollbar:h=!1,peak:u=!1,arrows:m=!1,controls:o="dots",arrowsOnMainImage:w=!1,loop:p=!1,gap:P=null,direction:a="horizontal",width:R="100%",height:c="100%",defaultIndex:f=0,className:T,children:O,thumbnails:B=null,isZoomed:C,...le})=>{const te=X("PDP.Carousel.label").label,r=X("PDP.Carousel.Slide.label").label,y=X("PDP.Carousel.Previous.label").label,_=X("PDP.Carousel.Next.label").label,L=X("PDP.Carousel.Controls.label").label,M=X("PDP.Carousel.Controls.Button.label").label,[v,g]=Y(()=>Ie(e)),s=Math.ceil(he.count(O)/v),E=u?Ke:0,t=P?ze[P]:0,U=he.count(O)%v,[S,ae]=Y(p?Q()?f-1:f+1:f),K=Se([]),[ne,V]=Y(0),[se,pe]=Y(0),_e=Le(()=>he.toArray(B),[B]),H=Le(()=>{const l=he.toArray(O).reduce((i,D,N)=>N%v===0?[...i,[D]]:[...i.slice(0,-1),[...i[i.length-1],D]],[]);return!p||l.length===1?l:p&&he.count(O)%v===0?[l[s-1]].concat(l).concat([l[0],l[1]]):[he.toArray(O).slice(-v)].concat(l).concat([l[0],l[1]])},[O,v,s,p]),ce=Se(null),re=Se(null),x=o==="thumbnailsRow"||o==="thumbnailsColumn";J(()=>{const l=document.body,i=Oe(()=>{var k,oe;V(((k=ce.current)==null?void 0:k.offsetWidth)??0),pe(((oe=ce.current)==null?void 0:oe.offsetHeight)??0);const N=window.innerWidth,I=Ie(e,N);I!==v&&g(I)},50),D=new ResizeObserver(i);return D.observe(l),()=>{D.unobserve(l)}},[v,e]);const ee=ie(l=>{const i=p?l-1:l,D=K==null?void 0:K.current[0],N=(D==null?void 0:D.offsetWidth)+$e,I=(D==null?void 0:D.offsetHeight)+$e,k=re.current,oe=o==="thumbnailsRow",we=o==="thumbnailsColumn",de=oe?k==null?void 0:k.offsetWidth:k==null?void 0:k.offsetHeight,j=oe?N:I;(oe||we)&&de&&(j*(i+1)>de&&(k.style.scrollBehavior="smooth",oe?k.scrollLeft=Q()?k.scrollWidth-k.clientWidth-(i+fe)*j:(i+fe)*j:k.scrollTop=(i+fe)*j),(Q()&&(oe?k.scrollLeft:k.scrollTop)<=-j*i||!Q()&&(oe?k.scrollLeft:k.scrollTop)>j*i)&&(k.style.scrollBehavior="smooth",oe?k.scrollLeft=Q()?-(i-fe)*j:(i-fe)*j:k.scrollTop=(i-fe)*j))},[o,p]);J(()=>{ee(S)},[S,ee]);const W=ie((l,i,D)=>{x&&ee(l);const N=ce.current,I=E?N.offsetWidth-E:N.offsetWidth-E+t;if(!Array.from(N.querySelectorAll("[data-index]")).filter(de=>{const j=Number(de.getAttribute("data-index"));return!isNaN(j)&&j>-1})[l])return;if(D){const de=l===0?s:0,j=I*(s+(U||v)/v);if(Q()){if(N.scrollLeft<=0&&N.scrollLeft>-(I-5)){W(1,!0);return}if(N.scrollLeft<I-j&&N.scrollLeft>=-j){W(s,!0);return}N.style.scrollBehavior="auto",N.scrollLeft=de===0?0:-j,W(de===0?1:s,!0)}else{if(N.scrollLeft>=0&&N.scrollLeft<I-5){W(1,!0);return}if(N.scrollLeft>j-I&&N.scrollLeft<=j){W(s,!0);return}N.style.scrollBehavior="auto",N.scrollLeft=de===0?0:j,W(de===0?1:s,!0);return}}const we=(N.offsetWidth-t)/v*H[l].length-E;N.style.scrollBehavior=i?"smooth":"auto",N.scrollLeft=Q()?-(H[l].length===v?I*l:I*(l-1)-we):H[l].length===v?I*l:I*(l-1)+we},[t,s,E,v,U,H,ee,o]),ue=ie(()=>{if(p){const i=S-1;W(i,!0,Q()?S===s-1:S===1);return}const l=S<=0?0:S-1;W(l,!0)},[S,W,p]),me=ie(()=>{const l=H.length-1;if(p){const D=S+1;W(D,!0,Q()?S===0:S===s);return}const i=S>=l?l:S+1;W(i,!0)},[H.length,p,S,W,s]);J(()=>{const l=i=>{i.key==="ArrowLeft"&&(i.preventDefault(),Q()?me():ue()),i.key==="ArrowRight"&&(i.preventDefault(),Q()?ue():me())};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[me,ue]),J(()=>{W(p?f+1:f,!1)},[f,W,p]);const be=Oe(()=>{const l=ce.current,i=E?l.offsetWidth-E:l.offsetWidth-E+t,D=Math.abs(l.scrollLeft)/i,N=Math.abs(Math.round(D)-D<1?Math.round(D):Math.ceil(D));if(x&&ee(N),p){const I=i*(s+(U||v)/v),k=Q()?-l.scrollLeft:l.scrollLeft;if(Math.ceil(Math.abs(k))>=Math.ceil(I)-5){l.style.scrollBehavior="auto",l.scrollLeft=Q()?-l.offsetWidth+(Math.ceil(k)-Math.ceil(I)-E):l.offsetWidth+(Math.ceil(k)-Math.ceil(I)-E);return}if(Math.abs(k)===0){l.style.scrollBehavior="auto",l.scrollLeft=Q()?-(I-l.offsetWidth+E):I-l.offsetWidth+E;return}}S!==N&&ae(N)},100);J(()=>{const l=ce.current;return l==null||l.addEventListener("scroll",be),()=>{l==null||l.removeEventListener("scroll",be)}},[be]);const d=(l,i,D)=>n(Pe,{className:$([["pdp-carousel__button",!l],[`pdp-carousel__button--${i}`,!l],[`pdp-carousel__button--${o}`,l]]),style:{"--height":`${se}px`},variant:"tertiary","aria-label":i==="next"?_:y,onClick:D,disabled:p?!1:i==="next"?S>=H.length-1:S<1,children:n(Ae,{className:$([["pdp-carousel__button__icon",!l],[`pdp-carousel__button__icon--${i}`,!l],[`pdp-carousel__button__icon--${o}--${i}`,l]]),size:Ze,source:Ye})}),b=m&&H.length!=1&&d(x,"prev",ue),A=m&&H.length!=1&&d(x,"next",me),z=m&&H.length!=1&&d(!1,"prev",ue),q=m&&H.length!=1&&d(!1,"next",me);return F("div",{role:"region","aria-roledescription":te,className:$(["pdp-carousel",["pdp-carousel--main-image-controls",w],["pdp-carousel--arrows",m&&!x],[`pdp-carousel--${o}`,x],T]),style:{"--flex-carousel":o==="thumbnailsColumn"?"row-reverse":"column","--gap":x?"0":"var(--spacing-small)","--width":R},...le,children:[n("div",{ref:ce,className:$(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${a}`,["pdp-carousel__wrapper--scrollbar",h],["pdp-carousel__wrapper--peak",u]]),style:{"--total-width":o==="thumbnailsColumn"?"81.6%":"100%","--height":o==="thumbnailsColumn"?"auto":c,"--gap":P?`var(--spacing-${P})`:"0px","--per-page":v},tabIndex:0,children:H.map((l,i)=>{const D=l.length<v;return n("div",{role:"group","aria-roledescription":r,"data-index":i,className:$(["pdp-carousel__slide",`pdp-carousel__slide--${a}`,["pdp-carousel__slide--active",S===i],["pdp-carousel__slide--orphan",D]]),style:{"--length":l.length},children:l},i)})}),!x&&F(Ne,{children:[b,A]}),x&&w&&F(Ne,{children:[z,q]}),o&&H.length!=1&&F("div",{className:$([[`pdp-carousel__controls__container--${o}`,x],["pdp-carousel__controls__container--no-arrows",!m||w]]),style:{"--width":o==="thumbnailsRow"?`${ne}px`:R,"--height":`${se}px`,"--nr-thumbnails":_e.length},children:[(x||C)&&!w&&b,n("div",{ref:re,className:$([[`pdp-carousel__controls__wrapper--${o}`,x],["pdp-carousel__controls__wrapper",x]]),children:n("div",{role:"group","aria-label":L,className:$(["pdp-carousel__controls",[`pdp-carousel__controls--${o}`,x]]),children:(p?H.slice(0,s):H).map((l,i)=>{const D=p?s:H.length,N=p?S-1===i:S===i;return x?F("label",{className:$(["pdp-carousel__thumbnail__container"]),ref:I=>{I&&(K.current[i]=I)},children:[n("input",{type:"radio",name:"carousel-thumbnails","aria-label":M.replace("{key}",String(i+1)).replace("{total}",String(D)),checked:N&&ne!==0,onChange:()=>{W(p?i+1:i,!0)},...le,className:$(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",N&&ne!==0]])}),n("span",{className:$(["pdp-carousel__thumbnail__span"]),children:_e[i]})]},i):n("button",{"aria-label":M.replace("{key}",String(i+1)).replace("{total}",String(D)),onClick:()=>{W(p?i+1:i,!0)},className:$(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",N]])},i)})})}),(x||C)&&!w&&A]})]})};function Ie(e,h=0){if(typeof e=="number")return e;const{small:u,medium:m,large:o}=e,p=[{breakpoint:1024,value:o},{breakpoint:786,value:m},{breakpoint:0,value:u}].find(({breakpoint:P})=>h>P);return p?p.value:u}function Q(){return document.documentElement.dir==="rtl"}const Qe=({title:e,breadcrumbs:h,galleryContent:u,infoContent:m,productContent:o,sku:w,outOfStock:p,shortDescription:P,description:a,attributes:R,images:c,options:f,price:T,specialPrice:O,className:B,children:C,quantity:le,actions:te,carouselConfig:r,zoomType:y="overlay",closeButton:_=!0,...L})=>{var ae,K,ne,V,se,pe,_e,H,ce;const M=X("PDP.Product.RegularPrice.label").label,v=X("PDP.Product.SpecialPrice.label").label,g=X("PDP.Product.OutOfStock.label").label,s=X("PDP.Product.Image.label").label,[E,t]=Y(null),U=c!=null&&c.length?c.map((re,x)=>{var W;const ee=((W=e==null?void 0:e.props)==null?void 0:W.children)&&(s==null?void 0:s.replace("{product}",e.props.children.toString()).replace("{key}",String(x+1)).replace("{total}",String(c.length)));return y==="zoom"?n(lt,{closeButton:_,children:n(G,{node:re,loading:x===0?"eager":"lazy",alt:ee},x)}):n(G,{node:re,loading:x===0?"eager":"lazy",alt:ee,onClick:()=>t(x)},x)}):n("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),S=(ae=r==null?void 0:r.thumbnails)!=null&&ae.length?r.thumbnails.map((re,x)=>{var ee;return n(G,{node:re,loading:(r==null?void 0:r.thumbnailsLoadingMode)||"lazy",alt:((ee=e==null?void 0:e.props)==null?void 0:ee.children)&&(s==null?void 0:s.replace("{product}",e.props.children.toString()).replace("{key}",String(x+1)).replace("{total}",String(c.length)))},x)}):n("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return F("div",{...L,className:$(["pdp-product",B]),children:[h&&n(G,{node:h,className:"pdp-product__breadcrumbs"}),F("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[n("div",{className:"pdp-product__column-body",children:(K=r==null?void 0:r.controls)!=null&&K.desktop?n(ye,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?r.controls.desktop:"dots",arrowsOnMainImage:r==null?void 0:r.arrowsOnMainImage,loop:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,peak:((ne=r==null?void 0:r.thumbnails)==null?void 0:ne.length)>1&&((V=r==null?void 0:r.peak)==null?void 0:V.desktop)||!1,gap:(r==null?void 0:r.gap)||null,width:"100%",height:"100%",defaultIndex:E||0,thumbnails:S,children:U}):n(Je,{className:"pdp-product__images",gap:"small",children:U})}),u&&n(G,{node:u,className:"pdp-product__gallery-content"})]}),F("div",{className:"pdp-product__column-container pdp-product__content-column",children:[F("div",{className:"pdp-product__column-body",children:[F("div",{className:"pdp-product__header",children:[e&&n(G,{node:e,className:"pdp-product__title"}),w&&n(G,{node:w,className:"pdp-product__sku"})]}),F("div",{className:"pdp-product__prices",children:[O&&n(G,{node:O,className:$(["pdp-product__price-special","pdp-product__price"]),"aria-label":v,role:"text"}),T&&n(G,{node:T,className:$(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":M,role:"text"})]}),(se=r==null?void 0:r.controls)!=null&&se.mobile&&((pe=r==null?void 0:r.controls)==null?void 0:pe.mobile)==="thumbnailsRow"?n(ye,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"thumbnailsRow":null,loop:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,peak:((_e=r==null?void 0:r.thumbnails)==null?void 0:_e.length)>1&&((H=r==null?void 0:r.peak)==null?void 0:H.mobile)||!1,gap:(r==null?void 0:r.gap)||null,thumbnails:S,children:U}):n(ye,{className:"pdp-product__images pdp-product__images--carousel",peak:((ce=r==null?void 0:r.peak)==null?void 0:ce.mobile)&&(c==null?void 0:c.length)>1,gap:(r==null?void 0:r.gap)||null,width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,loop:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,children:U}),F("div",{className:$(["pdp-product__actions",["pdp-product__actions--out-of-stock",p]]),children:[p&&n("div",{className:"pdp-product__out-of-stock__text",children:g}),f&&n(G,{node:f,className:$(["pdp-product__options"])}),le&&n("div",{className:"pdp-product__quantity",children:n(G,{node:le})}),te&&n(G,{node:te,className:$(["pdp-product__buttons"])})]}),P&&n(G,{node:P,className:$(["pdp-product__short_description"])}),a&&n(G,{node:a,className:$(["pdp-product__description"])}),R?n("div",{className:"pdp-product__attributes",children:R}):null]}),m&&n(G,{node:m,className:"pdp-product__info-content"})]}),o&&n(G,{node:o,className:"pdp-product__content"}),E===null?null:n(Ce,{className:"pdp-product__overlay",onClose:()=>t(null),centered:!0,children:n(ye,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,width:"100%",height:"100%",defaultIndex:E||0,loop:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,isZoomed:!0,children:U})})]})},Je=({children:e,gap:h=null,className:u,style:m,...o})=>{const w=he.count(e);return n("div",{...o,className:$(["pdp-gallery-grid",u]),style:{"--gap":h?`var(--spacing-${h})`:"0px",...m},children:he.map(e,(p,P)=>n("div",{className:"pdp-gallery-grid__item",children:n(G,{node:p,loading:P===0?"eager":"lazy"},p.props.src)},w+P))})},Re=({amount:e,currency:h,locale:u,variant:m,sale:o,minimumAmount:w,maximumAmount:p,className:P,...a})=>n(Ne,{children:e||w===p?n("div",{className:"pdp-price-range",...a,children:n(ge,{amount:e||w,currency:h,locale:u,variant:m,sale:o,className:P})}):F("div",{className:"pdp-price-range",...a,children:[n(ge,{amount:w,currency:h,locale:u,className:P}),n("span",{className:"pdp-price-range__label",children:"-"}),n(ge,{amount:p,currency:h,locale:u,className:P})]})}),Ce=({centered:e,onClose:h,className:u,children:m,...o})=>{const w=X("PDP.Overlay.Close.label").label,p=Se(null),P=ie(()=>{h==null||h()},[h]);return J(()=>{const a=R=>{R.key==="Escape"&&P()};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[P]),J(()=>{const a=p.current;a==null||a.focus();const R=document.scrollingElement,c=R.style.overflow;return R.style.overflow="hidden",()=>{R.style.overflow=c}},[]),F("div",{...o,className:$(["pdp-overlay",["pdp-overlay--centered",e],u]),ref:p,role:"dialog","aria-describedby":"overlay-content",tabindex:0,children:[n("div",{className:"pdp-overlay__content",id:"overlay-content",children:m}),n(Pe,{"aria-label":w,variant:"tertiary",className:"pdp-overlay__close-button",onClick:P,icon:n(We,{})})]})},et=["text","image","color","dropdown"],tt=e=>e.map(h=>({...h,text:h.label,disabled:!h.inStock}));function nt(e,h){return e.reduce((u,m)=>{const o=h==null?void 0:h.find(p=>p.items.find(P=>P.id===m));if(!o)return u;const w=o.items.find(p=>p.id===m);return{...u,[o.id]:{label:w.label,value:w.id}}},{})}const rt=({options:e,hideSelectedValue:h,disablePreselections:u,selectedUIDs:m,onValues:o,onErrors:w,defaultOptions:p,selectionsToUpdate:P,className:a,children:R,...c})=>{const f=X("PDP.Swatches.Required.label").label,T=X("PDP.Swatches.ChooseOption.label").label,[O,B]=Y(()=>e==null?void 0:e.reduce((y,_)=>{const{items:L}=_,M=L==null?void 0:L.find(g=>p==null?void 0:p.includes(g.id)),v=L==null?void 0:L.find(g=>g.selected);return M?{...y,[_.id]:{label:M.label,value:M.id}}:v?{...y,[_.id]:{label:v.label,value:v.id}}:y},{}));J(()=>{if(m){const r=nt(m,e);if(JSON.stringify(r)===JSON.stringify(O))return;B(y=>{let _={...y,...r};return o==null||o(_),_})}},[m]),J(()=>{P==null||P.forEach(r=>{B(y=>{var M;const _=(M=r==null?void 0:r.items)==null?void 0:M.find(v=>v.selected);return _?{...y,[r.id]:{label:_==null?void 0:_.label,value:_==null?void 0:_.id}}:y})})},[P,B]),Le(()=>{const r=e==null?void 0:e.reduce((y,_)=>{var M;let L=!1;return(M=_==null?void 0:_.items)==null||M.forEach(v=>{var s;((s=O[_.id])==null?void 0:s.value)===v.id&&(L=!0)}),_.required&&!L&&(y[_.id]=f),y},{});return w==null||w(r),r},[O]);const C=ie((r,y,_)=>{B(L=>{let M={...L,...r&&{[r]:{label:y,value:_}}};return y===T&&delete M[r],o==null||o(M,_),M})},[o]),le=(r,y)=>{var L;const _=((L=y.selectedOptions[0])==null?void 0:L.label)??"";C(r,_,y.value)},te=ie(({items:r,id:y,required:_,type:L,selected:M,label:v})=>(r==null?void 0:r.length)>0&&n("div",{className:$(["pdp-swatches__options"]),children:(L==null?void 0:L.toLowerCase())==="dropdown"?n(He,{"aria-label":v,placeholder:u?T:void 0,handleSelect:g=>le(y,g.target),options:tt(r),value:M}):r==null?void 0:r.map(g=>{const s={key:g.id,id:g.id,name:y,value:g.value,label:g.label,groupAriaLabel:v,selected:M===g.id,outOfStock:!g.inStock,required:_===null?!0:_,onValue:()=>{C(y,g.label,g.id)}};switch(L){case"text":return n(Fe,{...s,label:g.label});case"image":return n(je,{...s,src:g.value,alt:g.label});case"color":return n(qe,{...s,size:"large",color:g.value});default:return console.warn(`Invalid swatch type ${L}`),null}})}),[C]);return n("div",{...c,className:$(["pdp-swatches",a]),children:e==null?void 0:e.map(({type:r,label:y,id:_,multiple:L,required:M,items:v})=>{var g;return et.includes(r)||console.warn(`Invalid swatch type ${r}`),L&&console.warn("Multiple selection swatches are not currently supported."),F("div",{id:`swatch-item-${_}`,"data-slot-key":`product-swatch--${_}`,className:"pdp-swatches__field",children:[n("div",{className:"pdp-swatches__field__label",children:O[_]?h?`${y}`:`${y}: ${O[_].label}`:y}),n(te,{id:_,type:r,required:M,items:v,label:y,selected:(g=O[_])==null?void 0:g.value})]},`swatch-item-${_}`)})})},lt=({children:e,scale:h=2,closeButton:u=!0})=>{const[m,o]=Y(!1),[w,p]=Y("pdp-zoom"),[P,a]=Y(!1),[R,c]=Y({x:0,y:0}),[f,T]=Y({x:0,y:0}),[O,B]=Y({x:0,y:0}),C=s=>{!m||s.type!=="touchstart"||(c({x:s.touches[0].clientX,y:s.touches[0].clientY}),T({x:O.x,y:O.y}),a(!0))},le=s=>{var se;if(!P||s.type!=="touchmove")return;const E=(se=s.currentTarget)==null?void 0:se.getBoundingClientRect(),t=(100-100/h)/2,U=s.touches[0].clientX-R.x,S=s.touches[0].clientY-R.y,ae=U*100/(E.width*h),K=S*100/(E.height*h),ne=f.x+ae,V=f.y+K;B({x:Math.max(-t,Math.min(ne,t))||0,y:Math.max(-t,Math.min(V,t))||0}),s.preventDefault()},te=s=>{var K;const E=(K=s.currentTarget)==null?void 0:K.getBoundingClientRect(),t=(100-100/h)/2;let U;if("touches"in s)U=s.touches[0];else if(s instanceof MouseEvent)U=s;else return;const S=t-(U.clientX-E.left)/E.width*100,ae=t-(U.clientY-E.top)/E.height*100;B({x:Math.max(-t,Math.min(S,t))||0,y:Math.max(-t,Math.min(ae,t))||0})},r=s=>{if(!P){if(m){if(u&&"touches"in s){C(s);return}u||o(!1)}else o(!0),te(s);s.preventDefault()}},y=s=>{if(u&&"touches"in s){le(s);return}m&&te(s)},_=()=>{if(u){a(!1);return}o(!1)},L=s=>{o(!1),s.stopPropagation()},M=m?`scale(${h}) translateX(${O.x}%) translateY(${O.y}%)`:"none",v=X("PDP.Zoom.Close.label").label,g=Ge(he.only(e),{draggable:!1,style:{"--transform":M}});return J(()=>{p(m?`pdp-zoom ${u?"pdp-zoom--no-effects":"pdp-zoom--zoomed"}`:"pdp-zoom")},[m,u]),F("figure",{className:w,onClick:r,onMouseMove:y,onMouseLeave:_,onTouchStart:r,onTouchMove:y,onTouchEnd:_,children:[g,u&&m&&n(Pe,{"aria-label":v,variant:"tertiary",className:"pdp-zoom__close-button",icon:n(We,{}),onClick:L})]})};function at(e,h="en_US"){if(!Ue(e))throw Error("Invalid date string");return e.split(" ")[1]||(e=`${e} 00:00:00`),new Date(e).toLocaleDateString(Me(h)).toString()}function Ue(e){if(![/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/,/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/].some(m=>m.test(e)))return!1;const u=new Date(e);return!isNaN(u.getTime())}function ct(e){const h=new URLSearchParams(window.location.search);Object.entries(e).forEach(([m,o])=>{o===null?h.delete(m):h.set(m,String(o))});let u=window.location.pathname;u+=`?${h.toString()}`,u+=window.location.hash,window.history.replaceState({},"",u)}function ot(){const e=new URLSearchParams(window.location.search),h={};return e.forEach((u,m)=>{h[m]=u}),h}function it(e){var h,u,m,o,w,p,P,a,R,c,f,T;return{productId:Number(e==null?void 0:e.externalId),name:e==null?void 0:e.name,sku:(e==null?void 0:e.variantSku)||(e==null?void 0:e.sku),topLevelSku:e==null?void 0:e.sku,specialToDate:void 0,specialFromDate:void 0,newToDate:void 0,newFromDate:void 0,createdAt:void 0,updatedAt:void 0,manufacturer:void 0,countryOfManufacture:void 0,categories:void 0,productType:e==null?void 0:e.productType,pricing:{regularPrice:((u=(h=e==null?void 0:e.prices)==null?void 0:h.regular)==null?void 0:u.amount)||0,minimalPrice:(o=(m=e==null?void 0:e.prices)==null?void 0:m.final)==null?void 0:o.minimumAmount,maximalPrice:(p=(w=e==null?void 0:e.prices)==null?void 0:w.final)==null?void 0:p.maximumAmount,specialPrice:(a=(P=e==null?void 0:e.prices)==null?void 0:P.final)==null?void 0:a.amount,tierPricing:void 0,currencyCode:((c=(R=e==null?void 0:e.prices)==null?void 0:R.final)==null?void 0:c.currency)||"USD"},canonicalUrl:e==null?void 0:e.url,mainImageUrl:(T=(f=e==null?void 0:e.images)==null?void 0:f[0])==null?void 0:T.url}}const st={PRODUCT_CONTEXT:"productContext"},dt={PRODUCT_PAGE_VIEW:"product-page-view"};function Ve(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function ht(e,h){const u=Ve();u.push({[e]:null}),u.push({[e]:h})}function pt(e,h){Ve().push(m=>{const o=m.getState?m.getState():{};m.push({event:e,eventInfo:{...o,...h}})})}function ut(e){const h=it(e);ht(st.PRODUCT_CONTEXT,h),pt(dt.PRODUCT_PAGE_VIEW)}const mt=({sku:e,hideSku:h,hideQuantity:u,hideShortDescription:m,hideDescription:o,hideAttributes:w,hideURLParams:p,hideSelectedOptionValue:P,slots:a,children:R,initialData:c,carousel:f,optionsConfig:T,useACDL:O,onAddToCart:B,zoomType:C,closeButton:le=!0,disableDropdownPreselection:te,...r})=>{var W,ue,me,be;const y=X("PDP.Product.AddToCart.label").label,_=X("PDP.Product.Incrementer.label").label,L=X("PDP.Product.Details.label").label,M=X("PDP.Swatches.ChooseOption.label").label,[v,g]=Y(Be.getConfig().defaultLocale||"en-US"),[s,E]=Y(),[t=null,U]=Y(c),[S,ae]=Y(()=>{const d={sku:e,quantity:1};return t!=null&&t.optionUIDs&&(d.optionsUIDs=t.optionUIDs),d}),[K,ne]=Y(()=>{var d,b;return!(t!=null&&t.options&&((d=t==null?void 0:t.options)==null?void 0:d.length)>0&&((b=t==null?void 0:t.optionUIDs)==null?void 0:b.length)!==(t==null?void 0:t.options.length))}),V={data:t,values:S,valid:K};function se(d){return d==null?void 0:d.some(b=>(b==null?void 0:b.typename)==="ProductViewOptionValueProduct")}J(()=>{const d=xe.on("pdp/setValues",b=>{ae(A=>({...A,...b}))});return()=>{d==null||d.off()}},[]),J(()=>{const d=xe.on("locale",b=>{b!==v&&(g(b),ke(e).then(U))});return()=>{d==null||d.off()}},[v,e]),J(()=>{O&&c&&Object.keys(c).length>0&&ut(c)},[c]);const pe=ie(d=>{ae(b=>({...b,...d}))},[]);J(()=>{xe.emit("pdp/values",S)},[JSON.stringify(S)]);const _e=ie(async d=>{var z,q;let b=Object.entries(d).filter(([l,i])=>i.label!==M).map(([l,i])=>d[l].value).filter(l=>l!==void 0);!p&&(t!=null&&t.options)&&!se(t.options)&&ct({optionsUIDs:b.join(",")}),pe({optionsUIDs:b}),ne((b==null?void 0:b.length)===((z=t==null?void 0:t.options)==null?void 0:z.length));const A=t!=null&&t.isBundle?await ke(e,{preselectFirstOption:!te,optionsUIDs:b}):await Te(e,b,T==null?void 0:T.anchorOptions);U(A),(q=T==null?void 0:T.anchorOptions)!=null&&q.length&&H(A,b)},[e]),H=ie((d,b)=>{var q;const A=(d==null?void 0:d.optionUIDs)??[];b.every(l=>A.includes(l))||(E(d==null?void 0:d.options),pe({optionsUIDs:A}),ne((A==null?void 0:A.length)===((q=d==null?void 0:d.options)==null?void 0:q.length)))},[e]),ce=ie(d=>{Object.keys(d).length!==0&&ne(!1)},[]),re=Le(()=>{var d;return(d=t==null?void 0:t.attributes)==null?void 0:d.map(({label:b,value:A},z)=>{const q=Ue(A)?at(A,v):A.toString();return F("li",{children:[b,": ",n("span",{dangerouslySetInnerHTML:{__html:q}})]},z)})},[t==null?void 0:t.attributes,v]),x=!u&&(t!=null&&t.inStock)?n(Z,{name:"Quantity",slot:a==null?void 0:a.Quantity,context:{...V},children:n(Xe,{name:"quantity",defaultValue:S.quantity.toString(),value:S.quantity.toString(),min:1,"aria-label":_,className:"pdp-product__quantity",onValue:d=>{pe({quantity:Number(d)})}},"quantity")}):void 0,ee=()=>{if(t!=null&&t.options)return n(Z,{name:"Options",slot:a==null?void 0:a.Options,context:{...V},children:n(rt,{selectedUIDs:S.optionsUIDs,options:t.options,defaultOptions:S.optionsUIDs,selectionsToUpdate:s,hideSelectedValue:P,disablePreselections:te,onValues:_e,onErrors:ce})})};return n("div",{...r,children:n(Qe,{title:n(Z,{name:"Title",slot:a==null?void 0:a.Title,context:{...V},children:t==null?void 0:t.name}),sku:h?void 0:n(Z,{name:"SKU",slot:a==null?void 0:a.SKU,context:{...V},children:t==null?void 0:t.sku}),options:ee(),breadcrumbs:(a==null?void 0:a.Breadcrumbs)&&n(Z,{name:"Breadcrumbs",slot:a==null?void 0:a.Breadcrumbs,context:{...V,setSeparator(d){this._registerMethod((...b)=>{const A=d(...b),z=A&&n(Ae,{source:A});this._setProps(q=>({...q,separator:z,children:[n(De,{separator:z,categories:q.categories})]}))})},appendLink(d){this._registerMethod((...b)=>{const{text:A,...z}=d(...b),q=n("a",{...z,children:A});this._setProps(l=>{const i=[...l.categories||[],q];return{...l,categories:i,children:[n(De,{separator:l.separator,categories:i})]}})})},appendHTMLElement(d){this._registerMethod((...b)=>{const A=d(...b),z=this._htmlElementToVNode(A);this._setProps(q=>{const l=[...q.categories||[],z];return{...q,categories:l,children:[n(De,{separator:q.separator,categories:l})]}})})}}}),quantity:x,actions:n(Z,{name:"Actions",slot:a==null?void 0:a.Actions,context:{...V,appendButton(d){this._registerMethod((...b)=>{const A=d(...b);if(!A)return;const{text:z,icon:q,...l}=A,i=n(Pe,{type:"button",...l,icon:q&&n(Ae,{source:q}),children:z});this._setProps(D=>({children:[...D.children||[],i]}))})}},children:!(a!=null&&a.Actions)&&n(Pe,{size:"medium",type:"submit",icon:n(Ae,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!K,"aria-label":y,onClick:()=>B==null?void 0:B(S),children:y})}),shortDescription:m?void 0:n(Z,{name:"ShortDescription",slot:a==null?void 0:a.ShortDescription,context:{...V},children:n("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:o?void 0:n(Z,{name:"Description",slot:a==null?void 0:a.Description,context:{...V},children:n("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((W=t==null?void 0:t.images)==null?void 0:W.map(({label:d,url:b})=>{var A,z;return n(Ee,{title:d,alt:d,src:b,width:((A=f==null?void 0:f.imageParams)==null?void 0:A.width)??960,height:((z=f==null?void 0:f.imageParams)==null?void 0:z.height)??1191,params:(f==null?void 0:f.imageParams)??{width:960}},b)}))??[],specialPrice:(ue=t==null?void 0:t.prices)!=null&&ue.visible?n(Z,{name:"SpecialPrice",slot:a==null?void 0:a.SpecialPrice,context:{...V},children:n(Re,{...t.prices.final,locale:Me(v)})}):void 0,price:(me=t==null?void 0:t.prices)!=null&&me.visible&&t.prices.regular&&t.prices.final.amount!==(t==null?void 0:t.prices.regular.amount)?n(Z,{name:"RegularPrice",slot:a==null?void 0:a.RegularPrice,context:{...V},children:n(Re,{...t.prices.regular,locale:Me(v)})}):void 0,zoomType:C,closeButton:le,carouselConfig:{...f,thumbnails:f&&Object.keys(f).length?((be=t==null?void 0:t.images)==null?void 0:be.map(({label:d,url:b})=>{var A,z;return n(Ee,{title:d,alt:d,src:b,width:((A=f==null?void 0:f.thumbnailParams)==null?void 0:A.width)??200,height:((z=f==null?void 0:f.thumbnailParams)==null?void 0:z.height)??248,params:(f==null?void 0:f.thumbnailParams)??{width:200}},b)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:w?void 0:n(Z,{name:"Attributes",slot:a==null?void 0:a.Attributes,context:{...V},children:re!=null&&re.length?F(Ne,{children:[L,n("ul",{children:re})]}):null}),galleryContent:(a==null?void 0:a.GalleryContent)&&n(Z,{name:"GalleryContent",slot:a.GalleryContent,context:{...V}}),infoContent:(a==null?void 0:a.InfoContent)&&n(Z,{name:"InfoContent",slot:a.InfoContent,context:{...V}}),productContent:(a==null?void 0:a.Content)&&n(Z,{name:"Content",slot:a.Content,context:{...V}})})})};mt.getInitialData=async function({sku:e,disableDropdownPreselection:h=!1,optionsConfig:u}){var P,a,R,c,f,T,O;function m(B){return B.some(C=>C.__typename==="ProductViewOptionValueProduct")}const o=Be.getConfig(),w=((P=ot().optionsUIDs)==null?void 0:P.split(","))||((c=(R=(a=o==null?void 0:o.models)==null?void 0:a.ProductDetails)==null?void 0:R.initialData)==null?void 0:c.optionsUIDs),p=(T=(f=o==null?void 0:o.models)==null?void 0:f.ProductDetails)==null?void 0:T.initialData;return p&&Object.keys(p).length>0&&((O=p.options)==null||O.some(B=>m(B==null?void 0:B.values))),w!=null&&w.length?await Te(e,w,u==null?void 0:u.anchorOptions):await ke(e,{preselectFirstOption:!h})};export{mt as ProductDetails,mt as default};
@@ -31,7 +31,7 @@ export type Product = {
31
31
  manufacturer?: string | null;
32
32
  countryOfManufacture?: string | null;
33
33
  categories?: string[] | null;
34
- productType?: string | null;
34
+ productType?: ProductType;
35
35
  pricing?: {
36
36
  regularPrice: number;
37
37
  minimalPrice?: number;
@@ -47,4 +47,12 @@ export type Product = {
47
47
  canonicalUrl?: string | null;
48
48
  mainImageUrl?: string | null;
49
49
  };
50
+ export declare enum ProductType {
51
+ ComplexProduct = "complex",
52
+ SimpleProduct = "simple"
53
+ }
54
+ export declare enum ProductViewType {
55
+ ComplexProductView = "ComplexProductView",
56
+ SimpleProductView = "SimpleProductView"
57
+ }
50
58
  //# sourceMappingURL=acdl-models.d.ts.map
@@ -1,21 +1,9 @@
1
- /**
2
- * ADOBE CONFIDENTIAL
3
- * __________________
4
- * Copyright 2023 Adobe
5
- * All Rights Reserved.
6
- * __________________
7
- * NOTICE: All information contained herein is, and remains
8
- * the property of Adobe and its suppliers, if any. The intellectual
9
- * and technical concepts contained herein are proprietary to Adobe
10
- * and its suppliers and are protected by all applicable intellectual
11
- * property laws, including trade secret and copyright laws.
12
- * Dissemination of this information or reproduction of this material
13
- * is strictly forbidden unless prior written permission is obtained
14
- * from Adobe.
15
- */
1
+ import { ProductType } from './acdl-models';
2
+
16
3
  export interface ProductModel {
17
4
  name: string;
18
5
  sku: string;
6
+ isBundle: boolean;
19
7
  addToCartAllowed: boolean;
20
8
  inStock: boolean | null;
21
9
  shortDescription?: string;
@@ -33,6 +21,7 @@ export interface ProductModel {
33
21
  externalId?: string;
34
22
  externalParentId?: string;
35
23
  variantSku?: string;
24
+ productType?: ProductType | undefined;
36
25
  }
37
26
  interface Image {
38
27
  url: string;
@@ -1,4 +1,6 @@
1
1
  import { ProductModel } from '../models';
2
2
 
3
- export declare function transformProductData(data: any, isBundle?: boolean): ProductModel | null;
3
+ export declare function transformProductData(data: any, options?: {
4
+ preselectFirstOption?: boolean;
5
+ }): ProductModel | null;
4
6
  //# sourceMappingURL=product-transform.d.ts.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-pdp", "version": "0.5.0-alpha2", "@dropins/tools": "0.33.0"}
1
+ {"name": "@dropins/storefront-pdp", "version": "0.5.0-alpha4", "@dropins/tools": "0.33.0"}