@dropins/storefront-order 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{c as re,r as te}from"./chunks/requestGuestOrderCancel.js";import{f as m,h as T}from"./chunks/fetch-graphql.js";import{g as oe,r as ne,s as se,a as ce,b as ie}from"./chunks/fetch-graphql.js";import{g as de}from"./chunks/getAttributesForm.js";import{g as pe,a as Ee,r as _e}from"./chunks/requestGuestReturn.js";import{g as Te,a as Re}from"./chunks/getGuestOrder.js";import{g as ge}from"./chunks/getCustomerOrdersReturn.js";import{a as f}from"./chunks/initialize.js";import{c as he,g as De,d as Me,i as fe}from"./chunks/initialize.js";import{g as Ce}from"./chunks/getStoreConfig.js";import{h as R}from"./chunks/network-error.js";import{events as d}from"@dropins/tools/event-bus.js";import{ADDRESS_FRAGMENT as G,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as C,GIFT_CARD_DETAILS_FRAGMENT as N,ORDER_ITEM_DETAILS_FRAGMENT as x,ORDER_SUMMARY_FRAGMENT as y,PRICE_DETAILS_FRAGMENT as F,PRODUCT_DETAILS_FRAGMENT as I,ORDER_ITEM_FRAGMENT as P,GIFT_WRAPPING_FRAGMENT as b,GIFT_MESSAGE_FRAGMENT as S,APPLIED_GIFT_CARDS_FRAGMENT as v}from"./fragments.js";import{c as xe,a as ye,r as Fe}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const A=(r,t)=>r+t.amount.value,L=(r,t)=>({id:r,totalQuantity:t.totalQuantity,possibleOnepageCheckout:!0,items:t.items.map(e=>{var a,o,n,s,c,i,u,l;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:(a=e.product)==null?void 0:a.canonicalUrl,mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((c=e.product)==null?void 0:c.sku)??"",topLevelSku:(i=e.product)==null?void 0:i.sku},prices:{price:{value:e.price.value,currency:e.price.currency,regularPrice:((u=e.regularPrice)==null?void 0:u.value)??e.price.value}},configurableOptions:((l=e.selectedOptions)==null?void 0:l.map(p=>({optionLabel:p.label,valueLabel:p.value})))||[]}}),prices:{subtotalExcludingTax:{value:t.subtotalExclTax.value,currency:t.subtotalExclTax.currency},subtotalIncludingTax:{value:t.subtotalInclTax.value,currency:t.subtotalInclTax.currency}},discountAmount:t.discounts.reduce(A,0)}),$=r=>{var a,o,n;const t=r.coupons[0],e=(a=r.payments)==null?void 0:a[0];return{appliedCouponCode:(t==null?void 0:t.code)??"",email:r.email,grandTotal:r.grandTotal.value,orderId:r.number,orderType:"checkout",otherTax:0,salesTax:r.totalTax.value,shipping:{shippingMethod:((o=r.shipping)==null?void 0:o.code)??"",shippingAmount:((n=r.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:r.subtotalExclTax.value,subtotalIncludingTax:r.subtotalInclTax.value,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:r.grandTotal.value,orderId:r.number}]:[],discountAmount:r.discounts.reduce(A,0),taxAmount:r.totalTax.value}},g=r=>{var e,a;const t=(a=(e=r==null?void 0:r.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return t?f(t):null},E={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},w={PLACE_ORDER:"place-order"};function O(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function _(r,t){const e=O();e.push({[r]:null}),e.push({[r]:t})}function k(r){O().push(e=>{const a=e.getState?e.getState():{};e.push({event:r,eventInfo:{...a}})})}function h(r,t){const e=$(t),a=L(r,t);_(E.ORDER_CONTEXT,{...e}),_(E.SHOPPING_CART_CONTEXT,{...a}),k(w.PLACE_ORDER)}class U extends Error{constructor(t){super(t),this.name="PlaceOrderError"}}const D=r=>{const t=r.map(e=>e.message).join(" ");throw new U(t)},M=`
3
+ import{c as ne,r as se}from"./chunks/requestGuestOrderCancel.js";import{s as M,f as m,h as T}from"./chunks/fetch-graphql.js";import{g as ie,r as ue,a as de,b as le}from"./chunks/fetch-graphql.js";import{g as Ee}from"./chunks/getAttributesForm.js";import{g as me,a as Te,r as Re}from"./chunks/requestGuestReturn.js";import{g as ge,a as he}from"./chunks/getGuestOrder.js";import{g as De}from"./chunks/getCustomerOrdersReturn.js";import{a as G}from"./chunks/initialize.js";import{c as Me,g as Ge,d as Ce,i as Ne}from"./chunks/initialize.js";import{g as xe}from"./chunks/getStoreConfig.js";import{h as R}from"./chunks/network-error.js";import{events as d}from"@dropins/tools/event-bus.js";import{ADDRESS_FRAGMENT as C,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as N,GIFT_CARD_DETAILS_FRAGMENT as y,ORDER_ITEM_DETAILS_FRAGMENT as x,ORDER_SUMMARY_FRAGMENT as F,PRICE_DETAILS_FRAGMENT as P,PRODUCT_DETAILS_FRAGMENT as I,ORDER_ITEM_FRAGMENT as b,GIFT_WRAPPING_FRAGMENT as S,GIFT_MESSAGE_FRAGMENT as v,APPLIED_GIFT_CARDS_FRAGMENT as L}from"./fragments.js";import{verifyReCaptcha as $}from"@dropins/tools/recaptcha.js";import{c as Pe,a as Ie,r as be}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const A=(t,r)=>t+r.amount.value,w=(t,r)=>({id:t,totalQuantity:r.totalQuantity,possibleOnepageCheckout:!0,items:r.items.map(e=>{var a,o,n,s,c,i,u,l;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:(a=e.product)==null?void 0:a.canonicalUrl,mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((c=e.product)==null?void 0:c.sku)??"",topLevelSku:(i=e.product)==null?void 0:i.sku},prices:{price:{value:e.price.value,currency:e.price.currency,regularPrice:((u=e.regularPrice)==null?void 0:u.value)??e.price.value}},configurableOptions:((l=e.selectedOptions)==null?void 0:l.map(p=>({optionLabel:p.label,valueLabel:p.value})))||[]}}),prices:{subtotalExcludingTax:{value:r.subtotalExclTax.value,currency:r.subtotalExclTax.currency},subtotalIncludingTax:{value:r.subtotalInclTax.value,currency:r.subtotalInclTax.currency}},discountAmount:r.discounts.reduce(A,0)}),k=t=>{var a,o,n;const r=t.coupons[0],e=(a=t.payments)==null?void 0:a[0];return{appliedCouponCode:(r==null?void 0:r.code)??"",email:t.email,grandTotal:t.grandTotal.value,orderId:t.number,orderType:"checkout",otherTax:0,salesTax:t.totalTax.value,shipping:{shippingMethod:((o=t.shipping)==null?void 0:o.code)??"",shippingAmount:((n=t.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:t.subtotalExclTax.value,subtotalIncludingTax:t.subtotalInclTax.value,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:t.grandTotal.value,orderId:t.number}]:[],discountAmount:t.discounts.reduce(A,0),taxAmount:t.totalTax.value}},g=t=>{var e,a;const r=(a=(e=t==null?void 0:t.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return r?G(r):null},E={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},U={PLACE_ORDER:"place-order"};function h(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function _(t,r){const e=h();e.push({[t]:null}),e.push({[t]:r})}function Q(t){h().push(e=>{const a=e.getState?e.getState():{};e.push({event:t,eventInfo:{...a}})})}function O(t,r){const e=k(r),a=w(t,r);_(E.ORDER_CONTEXT,{...e}),_(E.SHOPPING_CART_CONTEXT,{...a}),Q(U.PLACE_ORDER)}class H extends Error{constructor(r){super(r),this.name="PlaceOrderError"}}const D=t=>{const r=t.map(e=>e.message).join(" ");throw new H(r)},f=`
4
4
  fragment PLACE_ORDER_FRAGMENT on CustomerOrder {
5
5
  printed_card_included
6
6
  gift_receipt_included
@@ -71,18 +71,18 @@ import{c as re,r as te}from"./chunks/requestGuestOrderCancel.js";import{f as m,h
71
71
  }
72
72
  }
73
73
 
74
- ${G}
75
74
  ${C}
76
75
  ${N}
77
- ${x}
78
76
  ${y}
77
+ ${x}
79
78
  ${F}
80
- ${I}
81
79
  ${P}
80
+ ${I}
82
81
  ${b}
83
82
  ${S}
84
83
  ${v}
85
- `,Q=`
84
+ ${L}
85
+ `,X=`
86
86
  mutation PLACE_ORDER_MUTATION($cartId: String!) {
87
87
  placeOrder(input: { cart_id: $cartId }) {
88
88
  errors {
@@ -95,8 +95,8 @@ import{c as re,r as te}from"./chunks/requestGuestOrderCancel.js";import{f as m,h
95
95
  }
96
96
  }
97
97
 
98
- ${M}
99
- `,J=async r=>{if(!r)throw new Error("No cart ID found");return m(Q,{variables:{cartId:r}}).then(t=>{var a,o,n,s,c;(a=t.errors)!=null&&a.length&&T(t.errors),(s=(n=(o=t.data)==null?void 0:o.placeOrder)==null?void 0:n.errors)!=null&&s.length&&D((c=t.data.placeOrder)==null?void 0:c.errors);const e=g(t);return e&&(d.emit("order/placed",e),d.emit("cart/reset",void 0),h(r,e)),e}).catch(R)},H=`
98
+ ${f}
99
+ `,q=async()=>{const t=await $();t&&M("X-ReCaptcha",t)},te=async t=>{if(!t)throw new Error("No cart ID found");return await q(),m(X,{method:"POST",variables:{cartId:t}}).then(r=>{var a,o,n,s,c;(a=r.errors)!=null&&a.length&&T(r.errors),(s=(n=(o=r.data)==null?void 0:o.placeOrder)==null?void 0:n.errors)!=null&&s.length&&D((c=r.data.placeOrder)==null?void 0:c.errors);const e=g(r);return e&&(d.emit("order/placed",e),d.emit("cart/reset",void 0),O(t,e)),e}).catch(R)},B=`
100
100
  mutation setPaymentMethodAndPlaceOrder($cartId: String!, $paymentMethod: PaymentMethodInput!) {
101
101
  setPaymentMethodOnCart(
102
102
  input: {
@@ -122,5 +122,5 @@ import{c as re,r as te}from"./chunks/requestGuestOrderCancel.js";import{f as m,h
122
122
  }
123
123
  }
124
124
 
125
- ${M}
126
- `,K=async(r,t)=>{if(!r)throw new Error("No cart ID found");if(!t)throw new Error("No payment method found");return m(H,{variables:{cartId:r,paymentMethod:t}}).then(e=>{var o,n,s,c,i,u;(o=e.errors)!=null&&o.length&&T(e.errors),(c=(s=(n=e.data)==null?void 0:n.placeOrder)==null?void 0:s.errors)!=null&&c.length&&D((i=e.data.placeOrder)==null?void 0:i.errors);const a=g({data:{placeOrder:(u=e.data)==null?void 0:u.placeOrder}});return a&&(d.emit("order/placed",a),d.emit("cart/reset",void 0),h(r,a)),a}).catch(R)};export{re as cancelOrder,he as config,xe as confirmCancelOrder,ye as confirmGuestReturn,m as fetchGraphQl,de as getAttributesForm,pe as getAttributesList,oe as getConfig,Te as getCustomer,ge as getCustomerOrdersReturn,Re as getGuestOrder,De as getOrderDetailsById,Ce as getStoreConfig,Me as guestOrderByToken,fe as initialize,J as placeOrder,ne as removeFetchGraphQlHeader,Fe as reorderItems,te as requestGuestOrderCancel,Ee as requestGuestReturn,_e as requestReturn,se as setEndpoint,ce as setFetchGraphQlHeader,ie as setFetchGraphQlHeaders,K as setPaymentMethodAndPlaceOrder};
125
+ ${f}
126
+ `,re=async(t,r)=>{if(!t)throw new Error("No cart ID found");if(!r)throw new Error("No payment method found");return m(B,{variables:{cartId:t,paymentMethod:r}}).then(e=>{var o,n,s,c,i,u;(o=e.errors)!=null&&o.length&&T(e.errors),(c=(s=(n=e.data)==null?void 0:n.placeOrder)==null?void 0:s.errors)!=null&&c.length&&D((i=e.data.placeOrder)==null?void 0:i.errors);const a=g({data:{placeOrder:(u=e.data)==null?void 0:u.placeOrder}});return a&&(d.emit("order/placed",a),d.emit("cart/reset",void 0),O(t,a)),a}).catch(R)};export{ne as cancelOrder,Me as config,Pe as confirmCancelOrder,Ie as confirmGuestReturn,m as fetchGraphQl,Ee as getAttributesForm,me as getAttributesList,ie as getConfig,ge as getCustomer,De as getCustomerOrdersReturn,he as getGuestOrder,Ge as getOrderDetailsById,xe as getStoreConfig,Ce as guestOrderByToken,Ne as initialize,te as placeOrder,ue as removeFetchGraphQlHeader,be as reorderItems,se as requestGuestOrderCancel,Te as requestGuestReturn,Re as requestReturn,de as setEndpoint,M as setFetchGraphQlHeader,le as setFetchGraphQlHeaders,re as setPaymentMethodAndPlaceOrder};
@@ -1,3 +1,3 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as i,jsxs as b,Fragment as u}from"@dropins/tools/preact-jsx-runtime.js";import{Price as B,Image as K,CartItem as Q,Icon as R,Incrementer as G}from"@dropins/tools/components.js";import{useCallback as H}from"@dropins/tools/preact-hooks.js";import{Slot as M,classes as Z}from"@dropins/tools/lib.js";import{O as J}from"./OrderLoaders.js";import*as S from"@dropins/tools/preact-compat.js";const U=l=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),ae=({slots:l,placeholderImage:T="",loading:$,product:e,itemType:j,taxConfig:q,translations:x,disabledIncrementer:W,onQuantity:v,showConfigurableOptions:E,routeProductDetails:P})=>{var _,D,f,L,V;const{taxExcluded:d,taxIncluded:k}=q,t=H((n,s,r)=>i(B,{amount:n,currency:s,weight:"normal",...r}),[]),N=H(n=>{var o,F;const s=(n==null?void 0:n.productName)??"",r={title:s,src:((F=(o=n==null?void 0:n.product)==null?void 0:o.thumbnail)==null?void 0:F.url)??T,alt:s,width:90,height:120,loading:"lazy"};return i(M,{slotTag:"span",contentTag:"span","data-testid":`cartSummaryItemImage-${n.id}`,name:"CartSummaryItemImage",slot:l==null?void 0:l.CartSummaryItemImage,context:{data:n,defaultImageProps:r},children:i(K,{...r})})},[T,l==null?void 0:l.CartSummaryItemImage]);if(!e)return i(J,{});let y={};const w=j==="cancelled",z=(D=(_=e==null?void 0:e.product)==null?void 0:_.stockStatus)==null?void 0:D.includes("IN_STOCK"),a=e==null?void 0:e.giftCard,A=e.totalQuantity>1?{quantity:e.totalQuantity}:{},I=e.discounted,{includeAndExcludeTax:c,includeTax:h,excludeTax:m}=e.taxCalculations,g=e==null?void 0:e.totalQuantity,O={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.senderEmail?{[x.sender]:a==null?void 0:a.senderEmail}:{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.recipientEmail?{[x.recipient]:a==null?void 0:a.recipientEmail}:{},...a!=null&&a.message?{[x.message]:a==null?void 0:a.message}:{},...e!=null&&e.downloadableLinks?{[`${(f=e==null?void 0:e.downloadableLinks)==null?void 0:f.count} ${x.downloadableCount}`]:(L=e==null?void 0:e.downloadableLinks)==null?void 0:L.result}:{}};if(k&&d){const n=t(c.originalPrice.value,c.originalPrice.currency),s=t(c.baseOriginalPrice.value*g,c.baseOriginalPrice.currency,{variant:e.discounted?"strikethrough":"default",weight:"bold"}),r=t(c.baseDiscountedPrice.value*g,c.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(c.baseExcludingTax.value*g,c.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:!0,taxIncluded:void 0,price:n,total:b(u,{children:[s,e.discounted?r:null]}),totalExcludingTax:o}}else if(!k&&d){const n=t(m.originalPrice.value,m.originalPrice.currency),s=t(m.baseOriginalPrice.value*g,m.baseOriginalPrice.currency,{variant:I?"strikethrough":"default",weight:"bold"}),r=t(m.baseDiscountedPrice.value*g,m.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(m.baseExcludingTax.value*g,m.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:void 0,taxIncluded:void 0,price:n,total:b(u,{children:[s,I?r:null]}),totalExcludingTax:o}}else if(k&&!d){const n=t(h.singleItemPrice.value,h.singleItemPrice.currency),s=t(h.baseOriginalPrice.value*g,h.baseOriginalPrice.currency,{variant:I?"strikethrough":"default",weight:"bold"}),r=t(h.baseDiscountedPrice.value*g,h.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});y={taxExcluded:void 0,taxIncluded:!0,price:n,total:b(u,{children:[s,I?r:null]})}}return i(Q,{loading:$,alert:w&&z?b("span",{children:[i(R,{source:U}),x.outOfStock]}):i(u,{}),configurations:(E==null?void 0:E(O))??O,title:P?i("a",{"data-testid":"product-name",className:Z(["cart-summary-item__title",["cart-summary-item__title--strikethrough",w]]),href:P(e),children:e==null?void 0:e.productName}):i("div",{"data-testid":"product-name",className:Z(["cart-summary-item__title",["cart-summary-item__title--strikethrough",w]]),children:e==null?void 0:e.productName}),sku:i("div",{children:(V=e==null?void 0:e.product)==null?void 0:V.sku}),...A,image:P?i("a",{href:P(e),children:N(e)}):N(e),...y,footer:b(u,{children:[v&&!W?i(G,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:n=>v==null?void 0:v(Number(n)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0,i(M,{"data-testid":"Footer",name:"Footer",slot:l==null?void 0:l.Footer,context:{item:e}})]})})};export{ae as C,U as S};
3
+ import{jsx as i,jsxs as b,Fragment as u}from"@dropins/tools/preact-jsx-runtime.js";import{Price as B,Image as K,CartItem as Q,Icon as R,Incrementer as G}from"@dropins/tools/components.js";import{useCallback as H}from"@dropins/tools/preact-hooks.js";import{Slot as M,classes as Z}from"@dropins/tools/lib.js";import{O as J}from"./OrderLoaders.js";import*as S from"@dropins/tools/preact-compat.js";const U=l=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),S.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),ae=({slots:l,placeholderImage:T="",loading:$,product:e,itemType:j,taxConfig:q,translations:x,disabledIncrementer:W,onQuantity:v,showConfigurableOptions:E,routeProductDetails:P})=>{var _,D,f,L,V;const{taxExcluded:d,taxIncluded:k}=q,t=H((n,s,r)=>i(B,{amount:n,currency:s,weight:"normal",...r}),[]),N=H(n=>{var o,F;const s=(n==null?void 0:n.productName)??"",r={title:s,src:((F=(o=n==null?void 0:n.product)==null?void 0:o.thumbnail)==null?void 0:F.url)??T,alt:s,width:90,height:120,loading:"lazy"};return i(M,{slotTag:"span",contentTag:"span","data-testid":`cartSummaryItemImage-${n.id}`,name:"CartSummaryItemImage",slot:l==null?void 0:l.CartSummaryItemImage,context:{data:n,defaultImageProps:r},children:i(K,{...r})})},[T,l==null?void 0:l.CartSummaryItemImage]);if(!e)return i(J,{});let y={};const w=j==="cancelled",z=(D=(_=e==null?void 0:e.product)==null?void 0:_.stockStatus)==null?void 0:D.includes("IN_STOCK"),a=e==null?void 0:e.giftCard,A=e.totalQuantity>1?{quantity:e.totalQuantity}:{},I=e.discounted,{includeAndExcludeTax:c,includeTax:h,excludeTax:m}=e.taxCalculations,g=e==null?void 0:e.totalQuantity,O={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.senderEmail?{[x.sender]:a==null?void 0:a.senderEmail}:{},...a!=null&&a.senderName?{[x.sender]:a==null?void 0:a.senderName}:{},...a!=null&&a.recipientEmail?{[x.recipient]:a==null?void 0:a.recipientEmail}:{},...a!=null&&a.message?{[x.message]:a==null?void 0:a.message}:{},...e!=null&&e.downloadableLinks?{[`${(f=e==null?void 0:e.downloadableLinks)==null?void 0:f.count} ${x.downloadableCount}`]:(L=e==null?void 0:e.downloadableLinks)==null?void 0:L.result}:{}};if(k&&d){const n=t(c.originalPrice.value,c.originalPrice.currency),s=t(c.baseOriginalPrice.value*g,c.baseOriginalPrice.currency,{variant:e.discounted?"strikethrough":"default",weight:"bold"}),r=t(c.baseDiscountedPrice.value*g,c.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(c.baseExcludingTax.value*g,c.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:!0,taxIncluded:void 0,price:n,total:b(u,{children:[s,e.discounted?r:null]}),totalExcludingTax:o}}else if(!k&&d){const n=t(m.originalPrice.value,m.originalPrice.currency),s=t(m.baseOriginalPrice.value*g,m.baseOriginalPrice.currency,{variant:I?"strikethrough":"default",weight:"bold"}),r=t(m.baseDiscountedPrice.value*g,m.baseDiscountedPrice.currency,{sale:!0,weight:"bold"}),o=t(m.baseExcludingTax.value*g,m.baseExcludingTax.currency,{weight:"bold"});y={taxExcluded:void 0,taxIncluded:void 0,price:n,total:b(u,{children:[s,I?r:null]}),totalExcludingTax:o}}else if(k&&!d){const n=t(h.singleItemPrice.value,h.singleItemPrice.currency),s=t(h.baseOriginalPrice.value*g,h.baseOriginalPrice.currency,{variant:I?"strikethrough":"default",weight:"bold"}),r=t(h.baseDiscountedPrice.value*g,h.baseDiscountedPrice.currency,{sale:!0,weight:"bold"});y={taxExcluded:void 0,taxIncluded:!0,price:n,total:b(u,{children:[s,I?r:null]})}}return i(Q,{loading:$,alert:w&&!z?b("span",{children:[i(R,{source:U}),x.outOfStock]}):i(u,{}),configurations:(E==null?void 0:E(O))??O,title:P?i("a",{"data-testid":"product-name",className:Z(["cart-summary-item__title",["cart-summary-item__title--strikethrough",w]]),href:P(e),children:e==null?void 0:e.productName}):i("div",{"data-testid":"product-name",className:Z(["cart-summary-item__title",["cart-summary-item__title--strikethrough",w]]),children:e==null?void 0:e.productName}),sku:i("div",{children:(V=e==null?void 0:e.product)==null?void 0:V.sku}),...A,image:P?i("a",{href:P(e),children:N(e)}):N(e),...y,footer:b(u,{children:[v&&!W?i(G,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:n=>v==null?void 0:v(Number(n)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0,i(M,{"data-testid":"Footer",name:"Footer",slot:l==null?void 0:l.Footer,context:{item:e}})]})})};export{ae as C,U as S};
@@ -1,3 +1,3 @@
1
1
  /*! Copyright 2025 Adobe
2
2
  All Rights Reserved. */
3
- import{FetchGraphQL as s}from"@dropins/tools/fetch-graphql.js";const h=e=>{const r=e.map(a=>a.message).join(" ");throw Error(r)},{setEndpoint:o,setFetchGraphQlHeader:c,removeFetchGraphQlHeader:n,setFetchGraphQlHeaders:p,fetchGraphQl:d,getConfig:g}=new s().getMethods();export{c as a,p as b,d as f,g,h,n as r,o as s};
3
+ import{FetchGraphQL as s}from"@dropins/tools/fetch-graphql.js";const h=e=>{const r=e.map(a=>a.message).join(" ");throw Error(r)},{setEndpoint:o,setFetchGraphQlHeader:c,removeFetchGraphQlHeader:n,setFetchGraphQlHeaders:p,fetchGraphQl:d,getConfig:g}=new s().getMethods();export{o as a,p as b,d as f,g,h,n as r,c as s};
@@ -0,0 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2025 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export declare const setReCaptchaToken: () => Promise<void>;
18
+ //# sourceMappingURL=setReCaptchaToken.d.ts.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-order", "version": "1.2.0", "@dropins/tools": "~1.2.0", "license": "SEE LICENSE IN LICENSE.md"}
1
+ {"name": "@dropins/storefront-order", "version": "1.2.1", "@dropins/tools": "~1.2.0", "license": "SEE LICENSE IN LICENSE.md"}