@dropins/storefront-order 0.1.0-alpha15 → 0.1.0-alpha16

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.
@@ -13,7 +13,7 @@ export declare const Shipping: ({ translations, shoppingOrdersDisplayShipping, o
13
13
  shoppingOrdersDisplayShipping: TaxTypes;
14
14
  order: OrderDataModel;
15
15
  translations: translationsTypes;
16
- }) => import("preact").JSX.Element;
16
+ }) => import("preact").JSX.Element | null;
17
17
  export declare const Discounts: ({ translations, order, totalGiftcardValue, totalGiftcardCurrency, }: {
18
18
  totalGiftcardValue: number;
19
19
  totalGiftcardCurrency: string;
@@ -1 +1 @@
1
- import{jsx as t,jsxs as d,Fragment as j}from"@dropins/tools/preact-jsx-runtime.js";import{classes as f}from"@dropins/tools/lib.js";import{useMemo as L,useCallback as O,useState as k,useEffect as D}from"@dropins/tools/preact-hooks.js";import{events as S}from"@dropins/tools/event-bus.js";import{c as W}from"../chunks/convertCase.js";import{g as P}from"../chunks/getAttributesForm.js";import{Card as Z,Header as z,Price as B,Icon as $}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import*as i from"@dropins/tools/preact-compat.js";import{D as q}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact.js";import{useText as F}from"@dropins/tools/i18n.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const K=a=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),R=a=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),G=({loading:a,order:e,withHeader:g=!0,title:c,paymentIconsMap:h={},normalizeAddress:m})=>{var A,M,E,N,T;const n=F({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",billingMethodsTitle:"Order.CustomerDetails.billingMethods.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping"}),p=L(()=>({checkmo:K,card:R,...h}),[h]),_=O(H=>{var w;return(w=m[H])==null?void 0:w.map((s,V)=>t("p",{children:s.label?`${s.label}: ${Array.isArray(s.value)?s.value.join(" "):s==null?void 0:s.value}`:Array.isArray(s.value)?s.value.join(" "):s==null?void 0:s.value},V))},[m]);if(!e||a)return t(q,{});const o=(e==null?void 0:e.email)??"",l=(A=e==null?void 0:e.shipping)==null?void 0:A.code,r=(M=e==null?void 0:e.shipping)==null?void 0:M.amount,C=(E=e==null?void 0:e.shipping)==null?void 0:E.currency,u=e==null?void 0:e.payments,v=u&&u.length>0,b=v?(N=u[0])==null?void 0:N.name:"",y=v?(T=u[0])==null?void 0:T.code:"",x=v&&b!=="";return d(Z,{"data-testid":"order-details",variant:"secondary",className:f(["order-customer-details-content"]),children:[g?t(z,{title:c??n.headerText}):null,d("div",{className:"order-customer-details-content__container",children:[d("div",{className:"order-customer-details-content__container-email",children:[t("div",{className:"order-customer-details-content__container-title",children:n.emailTitle}),t("p",{children:o})]}),d("div",{className:"order-customer-details-content__container-shipping_address",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:_("shippingAddress")})]}),d("div",{className:"order-customer-details-content__container-billing_address",children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:_("billingAddress")})]}),d("div",{className:"order-customer-details-content__container-shipping_methods",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingMethodsTitle}),l?t(j,{children:r?d("p",{"data-testid":"shipping_methods_price",children:[t(B,{amount:r,currency:C})," ",l]}):t("p",{"data-testid":"shipping_methods_placeholder",children:n.freeShipping})}):null]}),d("div",{className:"order-customer-details-content__container-payment_methods",children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingMethodsTitle}),x&&d("p",{"data-testid":"billing_methods_description",className:f([["order-customer-details-content__container-payment_methods--icon",!!p[y]]]),children:[t($,{source:p[y]}),b]})]})]})]})},I=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],J=({orderData:a})=>{const[e,g]=k(!0),[c,h]=k(a),[m,n]=k([]);D(()=>{const o=S.on("order/data",l=>{h(l)},{eager:!0});return()=>{o==null||o.off()}},[]),D(()=>{P("shortRequest").then(o=>{if(o){const l=o.map(({name:r,orderNumber:C,label:u})=>({name:W(r),orderNumber:C,label:I.includes(r)?null:u}));n(l)}}).finally(()=>{g(!1)})},[]);const p=O(o=>{if(!m.length||!c||!c[o])return[];const l=Object.fromEntries(Object.entries(c[o]).map(([r,C])=>[r.toLowerCase(),C]));return m.filter(({name:r})=>l[r.toLowerCase()]).map(r=>({name:r.name,orderNumber:r.orderNumber,value:l[r.name.toLowerCase()],label:r.label}))},[m,c]),_=L(()=>({billingAddress:p("billingAddress"),shippingAddress:p("shippingAddress")}),[p]);return{order:c,normalizeAddress:_,loading:e}},de=({paymentIconsMap:a,orderData:e,title:g,className:c})=>{const{order:h,normalizeAddress:m,loading:n}=J({orderData:e});return t("div",{className:f(["order-customer-details",c]),children:t(G,{loading:n,order:h,title:g,paymentIconsMap:a,normalizeAddress:m})})};export{de as CustomerDetails,de as default};
1
+ import{jsx as t,jsxs as d}from"@dropins/tools/preact-jsx-runtime.js";import{classes as g}from"@dropins/tools/lib.js";import{useMemo as x,useCallback as H,useState as A,useEffect as O}from"@dropins/tools/preact-hooks.js";import{events as W}from"@dropins/tools/event-bus.js";import{c as P}from"../chunks/convertCase.js";import{g as Z}from"../chunks/getAttributesForm.js";import{Card as z,Header as B,Price as $,Icon as q}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import*as a from"@dropins/tools/preact-compat.js";import{D as K}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact.js";import{useText as R}from"@dropins/tools/i18n.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const F=l=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),G=l=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),I=({loading:l,order:e,withHeader:_=!0,title:c,paymentIconsMap:h={},normalizeAddress:m})=>{var E,N,w,T,D;const n=R({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",billingMethodsTitle:"Order.CustomerDetails.billingMethods.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping"}),p=x(()=>({checkmo:F,card:G,...h}),[h]),v=H(j=>{var L;return(L=m[j])==null?void 0:L.map((r,S)=>t("p",{children:r.label?`${r.label}: ${Array.isArray(r.value)?r.value.join(" "):r==null?void 0:r.value}`:Array.isArray(r.value)?r.value.join(" "):r==null?void 0:r.value},S))},[m]);if(!e||l)return t(K,{});const o=(e==null?void 0:e.email)??"",i=(E=e==null?void 0:e.shipping)==null?void 0:E.code,s=(N=e==null?void 0:e.shipping)==null?void 0:N.amount,C=(w=e==null?void 0:e.shipping)==null?void 0:w.currency,u=e==null?void 0:e.payments,f=u&&u.length>0,y=f?(T=u[0])==null?void 0:T.name:"",M=f?(D=u[0])==null?void 0:D.code:"",V=f&&y!=="",k=v("shippingAddress")??[],b=v("billingAddress")??[];return d(z,{"data-testid":"order-details",variant:"secondary",className:g(["order-customer-details-content"]),children:[_?t(B,{title:c??n.headerText}):null,d("div",{className:g(["order-customer-details-content__container",["order-customer-details-content__container--no-margin",k.length||b.length]]),children:[d("div",{className:"order-customer-details-content__container-email",children:[t("div",{className:"order-customer-details-content__container-title",children:n.emailTitle}),t("p",{children:o})]}),k.length?d("div",{className:"order-customer-details-content__container-shipping_address",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:k})]}):null,b.length?d("div",{className:g(["order-customer-details-content__container-billing_address",["order-customer-details-content__container-billing_address--fullwidth",!k.length]]),children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:b})]}):null,i?d("div",{className:"order-customer-details-content__container-shipping_methods",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingMethodsTitle}),s?d("p",{"data-testid":"shipping_methods_price",children:[t($,{amount:s,currency:C})," ",i]}):t("p",{"data-testid":"shipping_methods_placeholder",children:n.freeShipping})]}):null,V?d("div",{className:g(["order-customer-details-content__container-payment_methods",["order-customer-details-content__container-payment_methods--fullwidth",!i]]),children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingMethodsTitle}),d("p",{"data-testid":"billing_methods_description",className:g([["order-customer-details-content__container-payment_methods--icon",!!p[M]]]),children:[t(q,{source:p[M]}),y]})]}):null]})]})},J=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],Q=({orderData:l})=>{const[e,_]=A(!0),[c,h]=A(l),[m,n]=A([]);O(()=>{const o=W.on("order/data",i=>{h(i)},{eager:!0});return()=>{o==null||o.off()}},[]),O(()=>{Z("shortRequest").then(o=>{if(o){const i=o.map(({name:s,orderNumber:C,label:u})=>({name:P(s),orderNumber:C,label:J.includes(s)?null:u}));n(i)}}).finally(()=>{_(!1)})},[]);const p=H(o=>{if(!m.length||!c||!c[o])return[];const i=Object.fromEntries(Object.entries(c[o]).map(([s,C])=>[s.toLowerCase(),C]));return m.filter(({name:s})=>i[s.toLowerCase()]).map(s=>({name:s.name,orderNumber:s.orderNumber,value:i[s.name.toLowerCase()],label:s.label}))},[m,c]),v=x(()=>({billingAddress:p("billingAddress"),shippingAddress:p("shippingAddress")}),[p]);return{order:c,normalizeAddress:v,loading:e}},me=({paymentIconsMap:l,orderData:e,title:_,className:c})=>{const{order:h,normalizeAddress:m,loading:n}=Q({orderData:e});return t("div",{className:g(["order-customer-details",c]),children:t(I,{loading:n,order:h,title:_,paymentIconsMap:l,normalizeAddress:m})})};export{me as CustomerDetails,me as default};
@@ -1 +1 @@
1
- import{jsxs as i,jsx as c,Fragment as v}from"@dropins/tools/preact-jsx-runtime.js";import{classes as H}from"@dropins/tools/lib.js";import{useState as _,useEffect as T}from"@dropins/tools/preact-hooks.js";import{events as V}from"@dropins/tools/event-bus.js";import{s as C}from"../chunks/setTaxStatus.js";import{g as N}from"../chunks/getStoreConfig.js";import{Price as d,Icon as b,Accordion as f,AccordionSection as E,Card as D,Header as k}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import*as y from"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{a as z}from"../chunks/OrderLoaders.js";import{useText as B}from"@dropins/tools/i18n.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const A=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),I=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),j=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"#3D3D3D"})),P=({translations:e,order:a,subTotalValue:t,shoppingOrdersDisplaySubtotal:n})=>{var l,r;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.subtotal}),c(d,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(l=a==null?void 0:a.subtotal)==null?void 0:l.currency,amount:t})]}),i("div",{className:"order-cost-summary-content__description--subheader",children:[!n.taxExcluded&&n.taxIncluded?c("span",{children:e.incl}):null,n.taxExcluded&&n.taxIncluded?i(v,{children:[c(d,{currency:(r=a==null?void 0:a.subtotal)==null?void 0:r.currency,amount:t,size:"small"})," ",c("span",{children:e.excl})]}):null]})]})},W=({translations:e,shoppingOrdersDisplayShipping:a,order:t,totalShipping:n})=>{var l,r,o,s;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.shipping}),(l=t==null?void 0:t.totalShipping)!=null&&l.value?c(d,{weight:"normal",currency:(r=t==null?void 0:t.totalShipping)==null?void 0:r.currency,amount:n}):c("span",{children:e.freeShipping})]}),i("div",{className:"order-cost-summary-content__description--subheader",children:[a.taxIncluded&&a.taxExcluded?i(v,{children:[c(d,{weight:"normal",currency:(o=t==null?void 0:t.totalShipping)==null?void 0:o.currency,amount:(s=t==null?void 0:t.totalShipping)==null?void 0:s.value,size:"small"}),i("span",{children:[" ",e.excl]})]}):null,a.taxIncluded&&!a.taxExcluded?c("span",{children:e.incl}):null]})]})},q=({translations:e,order:a,totalGiftcardValue:t,totalGiftcardCurrency:n})=>{var l,r,o;return!((l=a==null?void 0:a.discounts)!=null&&l.length)&&!t?null:i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.discount}),c("span",{children:(r=a==null?void 0:a.discounts)!=null&&r.length?(o=a==null?void 0:a.discounts)==null?void 0:o.map(({amount:s},m)=>{const u=(s==null?void 0:s.value)??0;return c(d,{weight:"normal",sale:!0,currency:s==null?void 0:s.currency,amount:-(u+t)},m)}):null})]}),!(a!=null&&a.discounts.length)&&t?i("div",{className:"order-cost-summary-content__description--subheader",children:[i("span",{children:[c(b,{source:j,size:"16"}),c("span",{children:e.discountSubtitle.toLocaleUpperCase()})]}),c(d,{weight:"normal",sale:!0,currency:n,amount:-t})]}):null]})},F=({order:e})=>{var a;return c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--coupon",children:(a=e==null?void 0:e.coupons)==null?void 0:a.map((t,n)=>i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:t.code}),c("span",{children:"TBD"})]},n))})},U=({translations:e,renderTaxAccordion:a,totalAccordionTaxValue:t,order:n})=>{var o,s,m;const[l,r]=_(!1);return a?c(f,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:A,iconClose:I,children:i(E,{onStateChange:r,title:e.accordionTitle,secondaryText:c(v,{children:l?null:c(d,{weight:"normal",amount:t,currency:(s=n==null?void 0:n.totalTax)==null?void 0:s.currency})}),renderContentWhenClosed:!1,children:[(m=n==null?void 0:n.taxes)==null?void 0:m.map((u,x)=>{var p,h;return i("div",{className:"order-cost-summary-content__accordion-row",children:[c("p",{children:u==null?void 0:u.title}),c("p",{children:c(d,{weight:"normal",amount:(p=u==null?void 0:u.amount)==null?void 0:p.value,currency:(h=u==null?void 0:u.amount)==null?void 0:h.currency})})]},x)}),i("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[c("p",{children:e.accordionTotalTax}),c("p",{children:c(d,{weight:"normal",amount:t,currency:n.totalTax.currency,size:"medium"})})]})]})}):c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.tax}),c(d,{currency:(o=n==null?void 0:n.totalTax)==null?void 0:o.currency,amount:n==null?void 0:n.totalTax.value,weight:"normal",size:"small"})]})})},G=({translations:e,shoppingOrdersDisplaySubtotal:a,order:t})=>{var n,l,r,o;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.total}),c(d,{currency:(n=t==null?void 0:t.grandTotal)==null?void 0:n.currency,amount:(l=t==null?void 0:t.grandTotal)==null?void 0:l.value,weight:"bold",size:"medium"})]}),a.taxExcluded&&a.taxIncluded?i("div",{className:"order-cost-summary-content__description--subheader",children:[c("span",{children:e.totalExcludingTaxes}),c(d,{currency:(r=t==null?void 0:t.grandTotal)==null?void 0:r.currency,amount:((o=t==null?void 0:t.grandTotal)==null?void 0:o.value)-(t==null?void 0:t.totalTax.value),weight:"normal",size:"small"})]}):null]})},R=({translations:e,loading:a,storeConfig:t,order:n,withHeader:l=!0})=>{var p,h,S,O,w,L;if(a||!n)return c(z,{});const r=((p=n==null?void 0:n.totalGiftcard)==null?void 0:p.value)??0,o=((h=n.totalGiftcard)==null?void 0:h.currency)??"",s=((S=n.subtotal)==null?void 0:S.value)??0,m=((O=n.totalShipping)==null?void 0:O.value)??0,u=!!((w=n==null?void 0:n.taxes)!=null&&w.length)&&(t==null?void 0:t.shoppingOrdersDisplayFullSummary),x=u?(L=n==null?void 0:n.taxes)==null?void 0:L.reduce((Z,g)=>{var M;return+((M=g==null?void 0:g.amount)==null?void 0:M.value)+Z},0):0;return i(D,{variant:"secondary",className:H(["order-cost-summary-content"]),children:[l?c(k,{title:e.headerText}):null,i("div",{className:"order-cost-summary-content__wrapper",children:[c(P,{translations:e,order:n,subTotalValue:s,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal}),c(W,{translations:e,order:n,totalShipping:m,shoppingOrdersDisplayShipping:t==null?void 0:t.shoppingOrdersDisplayShipping}),c(q,{translations:e,order:n,totalGiftcardValue:r,totalGiftcardCurrency:o}),c(F,{order:n}),c(U,{order:n,translations:e,renderTaxAccordion:u,totalAccordionTaxValue:x}),c(G,{translations:e,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal,order:n})]})]})},J=({orderData:e})=>{const[a,t]=_(!0),[n,l]=_(e),[r,o]=_(null);return T(()=>{N().then(s=>{if(s){const{shoppingCartDisplayPrice:m,shoppingOrdersDisplayShipping:u,shoppingOrdersDisplaySubtotal:x,...p}=s;o(h=>({...h,...p,shoppingCartDisplayPrice:C(m),shoppingOrdersDisplayShipping:C(u),shoppingOrdersDisplaySubtotal:C(x)}))}}).finally(()=>{t(!1)})},[]),T(()=>{const s=V.on("order/data",m=>{l(m)},{eager:!0});return()=>{s==null||s.off()}},[]),{loading:a,storeConfig:r,order:n}},rt=({withHeader:e,orderData:a,children:t,className:n,...l})=>{const{loading:r,storeConfig:o,order:s}=J({orderData:a}),m=B({headerText:"Order.OrderCostSummary.headerText",subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes"});return c("div",{...l,className:H(["order-cost-summary",n]),children:c(R,{order:s,withHeader:e,loading:r,storeConfig:o,translations:m})})};export{rt as OrderCostSummary,rt as default};
1
+ import{jsxs as s,jsx as c,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{classes as H}from"@dropins/tools/lib.js";import{useState as g,useEffect as T}from"@dropins/tools/preact-hooks.js";import{events as V}from"@dropins/tools/event-bus.js";import{s as C}from"../chunks/setTaxStatus.js";import{g as N}from"../chunks/getStoreConfig.js";import{Price as d,Icon as f,Accordion as b,AccordionSection as E,Card as D,Header as k}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import*as x from"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{a as z}from"../chunks/OrderLoaders.js";import{useText as B}from"@dropins/tools/i18n.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const I=a=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},x.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),A=a=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},x.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),j=a=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},x.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"#3D3D3D"})),P=({translations:a,order:e,subTotalValue:t,shoppingOrdersDisplaySubtotal:n})=>{var i,l;return s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.subtotal}),c(d,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(i=e==null?void 0:e.subtotal)==null?void 0:i.currency,amount:t})]}),s("div",{className:"order-cost-summary-content__description--subheader",children:[!n.taxExcluded&&n.taxIncluded?c("span",{children:a.incl}):null,n.taxExcluded&&n.taxIncluded?s(S,{children:[c(d,{currency:(l=e==null?void 0:e.subtotal)==null?void 0:l.currency,amount:t,size:"small"})," ",c("span",{children:a.excl})]}):null]})]})},W=({translations:a,shoppingOrdersDisplayShipping:e,order:t,totalShipping:n})=>{var i,l,o,u;return t!=null&&t.isVirtual?null:s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.shipping}),(i=t==null?void 0:t.totalShipping)!=null&&i.value?c(d,{weight:"normal",currency:(l=t==null?void 0:t.totalShipping)==null?void 0:l.currency,amount:n}):c("span",{children:a.freeShipping})]}),s("div",{className:"order-cost-summary-content__description--subheader",children:[e.taxIncluded&&e.taxExcluded?s(S,{children:[c(d,{weight:"normal",currency:(o=t==null?void 0:t.totalShipping)==null?void 0:o.currency,amount:(u=t==null?void 0:t.totalShipping)==null?void 0:u.value,size:"small"}),s("span",{children:[" ",a.excl]})]}):null,e.taxIncluded&&!e.taxExcluded?c("span",{children:a.incl}):null]})]})},q=({translations:a,order:e,totalGiftcardValue:t,totalGiftcardCurrency:n})=>{var l,o,u,p,r;const i=(l=e==null?void 0:e.discounts)==null?void 0:l.every(m=>m.amount.value===0);return!((o=e==null?void 0:e.discounts)!=null&&o.length)&&(i||!t||t<1)||(u=e==null?void 0:e.discounts)!=null&&u.length&&i?null:s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.discount}),c("span",{children:(p=e==null?void 0:e.discounts)!=null&&p.length?(r=e==null?void 0:e.discounts)==null?void 0:r.map(({amount:m},h)=>{const _=((m==null?void 0:m.value)??0)+t;return _===0?null:c(d,{weight:"normal",sale:!0,currency:m==null?void 0:m.currency,amount:-_},h)}):null})]}),t>0?s("div",{className:"order-cost-summary-content__description--subheader",children:[s("span",{children:[c(f,{source:j,size:"16"}),c("span",{children:a.discountSubtitle.toLocaleUpperCase()})]}),c(d,{weight:"normal",sale:!0,currency:n,amount:-t})]}):null]})},F=({order:a})=>{var e;return c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--coupon",children:(e=a==null?void 0:a.coupons)==null?void 0:e.map((t,n)=>s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:t.code}),c("span",{children:"TBD"})]},n))})},U=({translations:a,renderTaxAccordion:e,totalAccordionTaxValue:t,order:n})=>{var o,u,p;const[i,l]=g(!1);return e?c(b,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:I,iconClose:A,children:s(E,{onStateChange:l,title:a.accordionTitle,secondaryText:c(S,{children:i?null:c(d,{weight:"normal",amount:t,currency:(u=n==null?void 0:n.totalTax)==null?void 0:u.currency})}),renderContentWhenClosed:!1,children:[(p=n==null?void 0:n.taxes)==null?void 0:p.map((r,m)=>{var h,y;return s("div",{className:"order-cost-summary-content__accordion-row",children:[c("p",{children:r==null?void 0:r.title}),c("p",{children:c(d,{weight:"normal",amount:(h=r==null?void 0:r.amount)==null?void 0:h.value,currency:(y=r==null?void 0:r.amount)==null?void 0:y.currency})})]},m)}),s("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[c("p",{children:a.accordionTotalTax}),c("p",{children:c(d,{weight:"normal",amount:t,currency:n.totalTax.currency,size:"medium"})})]})]})}):c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.tax}),c(d,{currency:(o=n==null?void 0:n.totalTax)==null?void 0:o.currency,amount:n==null?void 0:n.totalTax.value,weight:"normal",size:"small"})]})})},R=({translations:a,shoppingOrdersDisplaySubtotal:e,order:t})=>{var n,i,l,o;return s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.total}),c(d,{currency:(n=t==null?void 0:t.grandTotal)==null?void 0:n.currency,amount:(i=t==null?void 0:t.grandTotal)==null?void 0:i.value,weight:"bold",size:"medium"})]}),e.taxExcluded&&e.taxIncluded?s("div",{className:"order-cost-summary-content__description--subheader",children:[c("span",{children:a.totalExcludingTaxes}),c(d,{currency:(l=t==null?void 0:t.grandTotal)==null?void 0:l.currency,amount:((o=t==null?void 0:t.grandTotal)==null?void 0:o.value)-(t==null?void 0:t.totalTax.value),weight:"normal",size:"small"})]}):null]})},G=({translations:a,loading:e,storeConfig:t,order:n,withHeader:i=!0})=>{var h,y,_,O,w,L;if(e||!n)return c(z,{});const l=((h=n==null?void 0:n.totalGiftcard)==null?void 0:h.value)??0,o=((y=n.totalGiftcard)==null?void 0:y.currency)??"",u=((_=n.subtotal)==null?void 0:_.value)??0,p=((O=n.totalShipping)==null?void 0:O.value)??0,r=!!((w=n==null?void 0:n.taxes)!=null&&w.length)&&(t==null?void 0:t.shoppingOrdersDisplayFullSummary),m=r?(L=n==null?void 0:n.taxes)==null?void 0:L.reduce((Z,v)=>{var M;return+((M=v==null?void 0:v.amount)==null?void 0:M.value)+Z},0):0;return s(D,{variant:"secondary",className:H(["order-cost-summary-content"]),children:[i?c(k,{title:a.headerText}):null,s("div",{className:"order-cost-summary-content__wrapper",children:[c(P,{translations:a,order:n,subTotalValue:u,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal}),c(W,{translations:a,order:n,totalShipping:p,shoppingOrdersDisplayShipping:t==null?void 0:t.shoppingOrdersDisplayShipping}),c(q,{translations:a,order:n,totalGiftcardValue:l,totalGiftcardCurrency:o}),c(F,{order:n}),c(U,{order:n,translations:a,renderTaxAccordion:r,totalAccordionTaxValue:m}),c(R,{translations:a,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal,order:n})]})]})},J=({orderData:a})=>{const[e,t]=g(!0),[n,i]=g(a),[l,o]=g(null);return T(()=>{N().then(u=>{if(u){const{shoppingCartDisplayPrice:p,shoppingOrdersDisplayShipping:r,shoppingOrdersDisplaySubtotal:m,...h}=u;o(y=>({...y,...h,shoppingCartDisplayPrice:C(p),shoppingOrdersDisplayShipping:C(r),shoppingOrdersDisplaySubtotal:C(m)}))}}).finally(()=>{t(!1)})},[]),T(()=>{const u=V.on("order/data",p=>{i(p)},{eager:!0});return()=>{u==null||u.off()}},[]),{loading:e,storeConfig:l,order:n}},ut=({withHeader:a,orderData:e,children:t,className:n,...i})=>{const{loading:l,storeConfig:o,order:u}=J({orderData:e}),p=B({headerText:"Order.OrderCostSummary.headerText",subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes"});return c("div",{...i,className:H(["order-cost-summary",n]),children:c(G,{order:u,withHeader:a,loading:l,storeConfig:o,translations:p})})};export{ut as OrderCostSummary,ut as default};
@@ -1 +1 @@
1
- import{jsxs as s,jsx as e,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as x,classes as F}from"@dropins/tools/lib.js";import{Card as f,Header as m,Accordion as w,AccordionSection as G,ContentGrid as q,Image as $}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{useText as V,Text as H}from"@dropins/tools/i18n.js";import{C as W}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import{useState as z,useEffect as B}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as J}from"@dropins/tools/event-bus.js";var T=(n=>(n.PENDING="pending",n.SHIPPING="shipping",n.COMPLETE="complete",n.PROCESSING="processing",n.HOLD="on hold",n.CANCELED="Canceled",n.SUSPECTED_FRAUD="suspected fraud",n.PAYMENT_REVIEW="payment review",n))(T||{});const K=({slots:n,orderData:i,collapseThreshold:t=10,routeProductDetails:c})=>{var I,u,v,O,L;const d=V({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",notYetShippedImagesTitle:"Order.ShippingStatusCard.notYetShippedImagesTitle",noInfoTitle:"Order.OrderStatusContent.noInfoTitle"}),g=c?"a":"span",a=(I=i==null?void 0:i.status)==null?void 0:I.toLocaleLowerCase(),M=((u=i==null?void 0:i.shipments)==null?void 0:u.length)===1&&(a==null?void 0:a.includes(T.COMPLETE)),l=(v=i==null?void 0:i.items)==null?void 0:v.filter(r=>(r==null?void 0:r.quantityShipped)===0);if(!i||a!=null&&a.includes(T.CANCELED))return null;if(!((O=i==null?void 0:i.shipments)!=null&&O.length))return s(f,{variant:"secondary",className:"order-shipping-status-card",children:[e(m,{title:d.shippingInfoTitle}),e("div",{className:"order-shipping-status-card__header",children:s("div",{className:"order-shipping-status-card__header--content",children:[i!=null&&i.carrier?e("p",{children:i==null?void 0:i.carrier}):null,e("p",{children:d.noInfoTitle})]})})]});const R=e(H,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:l==null?void 0:l.length});return s(S,{children:[(L=i==null?void 0:i.shipments)==null?void 0:L.map(({tracking:r,items:h,id:o},U)=>{const Y=e(H,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:h==null?void 0:h.length});return s(f,{variant:"secondary",className:"order-shipping-status-card",children:[e(m,{title:d.shippingCardTitle}),r==null?void 0:r.map(p=>{var C;return s("div",{className:"order-shipping-status-card__header",role:"status",children:[s("div",{className:"order-shipping-status-card__header--content",children:[s("p",{children:[d.carrier," ",(C=p==null?void 0:p.carrier)==null?void 0:C.toLocaleUpperCase()," | ",p==null?void 0:p.number]}),e("p",{children:p==null?void 0:p.title})]}),n!=null&&n.DeliveryTrackActions?e(x,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:n==null?void 0:n.DeliveryTrackActions,context:{trackInformation:p}}):null]},p.number)}),M?null:e(w,{actionIconPosition:"right","data-testid":"dropinAccordion",children:e(G,{"data-position":U+1,defaultOpen:t>=(h==null?void 0:h.length),title:s(S,{children:[`${d.notYetShippedImagesTitle} (${h==null?void 0:h.length} `,Y,")"]}),children:e(q,{maxColumns:6,emptyGridContent:e(S,{}),className:"order-shipping-status-card__images",children:h==null?void 0:h.map(p=>{var y,_,A,b,E,N;const C=(A=(_=(y=p==null?void 0:p.orderItem)==null?void 0:y.product)==null?void 0:_.thumbnail)==null?void 0:A.label,j=(N=(E=(b=p==null?void 0:p.orderItem)==null?void 0:b.product)==null?void 0:E.thumbnail)==null?void 0:N.url;return e(g,{href:(c==null?void 0:c(p))??"#",children:e($,{alt:C,src:j||"",width:85,height:114})},p.id)})})})}),n!=null&&n.DeliveryTimeLine?e(x,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:n==null?void 0:n.DeliveryTimeLine,context:{}}):null]},o)}),l!=null&&l.length?s(f,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[e(m,{title:d.notYetShippedTitle}),e(w,{actionIconPosition:"right",children:e(G,{defaultOpen:t>=(l==null?void 0:l.length),title:s(S,{children:[`${d.notYetShippedImagesTitle} (${l==null?void 0:l.length} `,R,")"]}),children:e("div",{className:"order-shipping-status-card__images",children:l==null?void 0:l.map(r=>{var h,o;return e(g,{href:(c==null?void 0:c(r))??"#",children:e($,{alt:(h=r.thumbnail)==null?void 0:h.label,src:((o=r.thumbnail)==null?void 0:o.url)||"",width:85,height:114})},r.id)})})})})]}):null]})},Q=({orderData:n})=>{const[i,t]=z(n);return B(()=>{const c=J.on("order/data",d=>{t(d)},{eager:!0});return()=>{c==null||c.off()}},[]),{order:i}},rn=({slots:n,className:i,collapseThreshold:t,orderData:c,routeProductDetails:d})=>{const{order:g}=Q({orderData:c});return e("div",{className:F(["order-shipping-status",i]),children:g?e(K,{slots:n,orderData:g,collapseThreshold:t,routeProductDetails:d}):e(W,{withCard:!1})})};export{rn as ShippingStatus,rn as default};
1
+ import{jsxs as d,jsx as e,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as V,classes as q}from"@dropins/tools/lib.js";import{Card as m,Header as T,Accordion as $,AccordionSection as H,ContentGrid as W,Image as M}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{useText as z,Text as R}from"@dropins/tools/i18n.js";import{C as B}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import{useState as I,useEffect as J}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as K}from"@dropins/tools/event-bus.js";var v=(i=>(i.PENDING="pending",i.SHIPPING="shipping",i.COMPLETE="complete",i.PROCESSING="processing",i.HOLD="on hold",i.CANCELED="Canceled",i.SUSPECTED_FRAUD="suspected fraud",i.PAYMENT_REVIEW="payment review",i))(v||{});const Q=({slots:i,orderData:n,collapseThreshold:g=10,routeProductDetails:c})=>{var O,L,y,_,A;const t=z({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",notYetShippedImagesTitle:"Order.ShippingStatusCard.notYetShippedImagesTitle",noInfoTitle:"Order.OrderStatusContent.noInfoTitle"}),a=c?"a":"span",r=(O=n==null?void 0:n.status)==null?void 0:O.toLocaleLowerCase(),f=((L=n==null?void 0:n.shipments)==null?void 0:L.length)===1&&(r==null?void 0:r.includes(v.COMPLETE)),p=(y=n==null?void 0:n.items)==null?void 0:y.filter(s=>(s==null?void 0:s.quantityShipped)===0);if(!n||r!=null&&r.includes(v.CANCELED))return null;if(!((_=n==null?void 0:n.shipments)!=null&&_.length))return d(m,{variant:"secondary",className:"order-shipping-status-card",children:[e(T,{title:t.shippingInfoTitle}),e("div",{className:"order-shipping-status-card__header",children:d("div",{className:"order-shipping-status-card__header--content",children:[n!=null&&n.carrier?e("p",{children:n==null?void 0:n.carrier}):null,e("p",{children:t.noInfoTitle})]})})]});const U=e(R,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:p==null?void 0:p.length});return d(S,{children:[(A=n==null?void 0:n.shipments)==null?void 0:A.map(({tracking:s,items:h,id:u},Y)=>{const j=e(R,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:h==null?void 0:h.length});return d(m,{variant:"secondary",className:"order-shipping-status-card",children:[e(T,{title:t.shippingCardTitle}),s==null?void 0:s.map(l=>{var C;return d("div",{className:"order-shipping-status-card__header",role:"status",children:[d("div",{className:"order-shipping-status-card__header--content",children:[d("p",{children:[t.carrier," ",(C=l==null?void 0:l.carrier)==null?void 0:C.toLocaleUpperCase()," | ",l==null?void 0:l.number]}),e("p",{children:l==null?void 0:l.title})]}),i!=null&&i.DeliveryTrackActions?e(V,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:i==null?void 0:i.DeliveryTrackActions,context:{trackInformation:l}}):null]},l.number)}),f?null:e($,{actionIconPosition:"right","data-testid":"dropinAccordion",children:e(H,{"data-position":Y+1,defaultOpen:g>=(h==null?void 0:h.length),title:d(S,{children:[`${t.notYetShippedImagesTitle} (${h==null?void 0:h.length} `,j,")"]}),children:e(W,{maxColumns:6,emptyGridContent:e(S,{}),className:"order-shipping-status-card__images",children:h==null?void 0:h.map(l=>{var b,E,N,x,w,G;const C=(N=(E=(b=l==null?void 0:l.orderItem)==null?void 0:b.product)==null?void 0:E.thumbnail)==null?void 0:N.label,F=(G=(w=(x=l==null?void 0:l.orderItem)==null?void 0:x.product)==null?void 0:w.thumbnail)==null?void 0:G.url;return e(a,{href:(c==null?void 0:c(l))??"#",children:e(M,{alt:C,src:F||"",width:85,height:114})},l.id)})})})}),i!=null&&i.DeliveryTimeLine?e(V,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:i==null?void 0:i.DeliveryTimeLine,context:{}}):null]},u)}),p!=null&&p.length?d(m,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[e(T,{title:t.notYetShippedTitle}),e($,{actionIconPosition:"right",children:e(H,{defaultOpen:g>=(p==null?void 0:p.length),title:d(S,{children:[`${t.notYetShippedImagesTitle} (${p==null?void 0:p.length} `,U,")"]}),children:e("div",{className:"order-shipping-status-card__images",children:p==null?void 0:p.map(s=>{var h,u;return e(a,{href:(c==null?void 0:c(s))??"#",children:e(M,{alt:(h=s.thumbnail)==null?void 0:h.label,src:((u=s.thumbnail)==null?void 0:u.url)||"",width:85,height:114})},s.id)})})})})]}):null]})},X=({orderData:i})=>{const[n,g]=I(!0),[c,t]=I(i),[a,r]=I(!1);return J(()=>{const o=K.on("order/data",f=>{t(f),r(f==null?void 0:f.isVirtual),g(!1)},{eager:!0});return()=>{o==null||o.off()}},[]),{loading:n,order:c,isVirtualProduct:a}},si=({slots:i,className:n,collapseThreshold:g,orderData:c,routeProductDetails:t})=>{const{loading:a,order:r,isVirtualProduct:o}=X({orderData:c});return!a&&o?null:e("div",{className:q(["order-shipping-status",n]),children:!a&&r?e(Q,{slots:i,orderData:r,collapseThreshold:g,routeProductDetails:t}):e(B,{withCard:!1})})};export{si as ShippingStatus,si as default};
@@ -19,6 +19,7 @@ export type OrderAddressModel = {
19
19
  }[];
20
20
  } | null;
21
21
  export type OrderItemProductModel = {
22
+ __typename: string;
22
23
  stockStatus?: string;
23
24
  canonicalUrl?: string;
24
25
  urlKey?: string;
@@ -2,6 +2,8 @@ import { OrderDataModel } from '../../data/models';
2
2
  import { UseShippingStatusProps } from '../../types';
3
3
 
4
4
  export declare const useShippingStatus: ({ orderData }: UseShippingStatusProps) => {
5
+ loading: boolean;
5
6
  order: OrderDataModel | undefined;
7
+ isVirtualProduct: boolean;
6
8
  };
7
9
  //# sourceMappingURL=useShippingStatus.d.ts.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-order", "version": "0.1.0-alpha15", "@dropins/elsie": "0.34.0"}
1
+ {"name": "@dropins/storefront-order", "version": "0.1.0-alpha16", "@dropins/elsie": "0.34.0"}
package/render.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(n,e){try{if(typeof document<"u"){const r=document.createElement("style"),a=e.styleId;for(const t in e.attributes)r.setAttribute(t,e.attributes[t]);r.setAttribute("data-dropin",a),r.appendChild(document.createTextNode(n));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})('.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "postcode" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--postcode{grid-area:postcode}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p{margin:0;padding:0;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important;overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-actions__wrapper--empty{display:none}.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:grid;flex-direction:column;gap:var(--spacing-medium)}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:auto;grid-template-rows:auto auto auto;gap:var(--spacing-medium);grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2}.order-customer-details-content__container-billing_address{grid-area:2 / 2 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images{overflow:auto}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:65px;height:65px}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0;padding:0}.dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-cancel-reasons-form__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}.order-order-cancel__modal{margin:auto}.order-order-cancel__modal .dropin-modal__header{display:grid;grid-template-columns:1fr auto}.order-order-cancel__title{color:var(--color-neutral-900);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-order-cancel__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel__modal .dropin-modal__header-close-button{align-self:center}.order-order-cancel__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}@media only screen and (min-width: 768px){.dropin-modal__body--medium.order-order-cancel__modal>.dropin-modal__header-title{margin:0 var(--spacing-xxbig) var(--spacing-medium)}}',{styleId:"order"});
1
+ (function(n,e){try{if(typeof document<"u"){const r=document.createElement("style"),a=e.styleId;for(const t in e.attributes)r.setAttribute(t,e.attributes[t]);r.setAttribute("data-dropin",a),r.appendChild(document.createTextNode(n));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})('.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "postcode" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--postcode{grid-area:postcode}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-order-status-content__wrapper .order-order-status-content__wrapper-description p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important;overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-actions__wrapper--empty{display:none}.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:block;flex-direction:column}.order-customer-details-content__container-shipping_address,.order-customer-details-content__container-billing_address{margin:var(--spacing-medium) 0}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:auto;grid-template-rows:auto auto auto;grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container--no-margin p{margin-bottom:0}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address{grid-area:2 / 2 / 3 / 3;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address--fullwidth{grid-area:2 / 1 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}.order-customer-details-content__container-payment_methods--fullwidth{grid-area:3 / 1 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images{overflow:auto}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:65px;height:65px}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0;padding:0}.order-order-product-list-content .dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-cancel-reasons-form__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}.order-order-cancel__modal{margin:auto}.order-order-cancel__modal .dropin-modal__header{display:grid;grid-template-columns:1fr auto}.order-order-cancel__title{color:var(--color-neutral-900);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-order-cancel__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel__modal .dropin-modal__header-close-button{align-self:center}.order-order-cancel__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}@media only screen and (min-width: 768px){.dropin-modal__body--medium.order-order-cancel__modal>.dropin-modal__header-title{margin:0 var(--spacing-xxbig) var(--spacing-medium)}}',{styleId:"order"});
2
2
  import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as a}from"@dropins/tools/lib.js";import{useState as n,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as l}from"@dropins/tools/components.js";import{events as c}from"@dropins/tools/event-bus.js";const u={OrderCostSummary:{headerText:"Order summary",subtotal:{title:"Subtotal"},shipping:{title:"Shipping",freeShipping:"Free shipping"},tax:{accordionTitle:"Taxes",accordionTotalTax:"Tax Total",totalExcludingTaxes:"Total excluding taxes",title:"Tax",incl:"Including taxes",excl:"Excluding taxes"},discount:{title:"Discount",subtitle:"discounted"},total:{title:"Total"}},Returns:{minifiedView:{returnsList:{viewAllOrdersButton:"View all returns",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Recent returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},resturnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}},fullSizeView:{returnsList:{viewAllOrdersButton:"View all orders",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},resturnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}}},OrderProductListContent:{cancelledTitle:"Cancelled",allOrdersTitle:"Your order",downloadableCount:"Files",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},GiftCard:{sender:"Sender",recipient:"Recipient",message:"Note"}},OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",postcode:"Zip Code",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping info",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:"Package contents",notYetShippedItem:{singular:"item",plural:"items"}},OrderStatusContent:{noInfoTitle:"Check back later for more details.",actions:{cancel:"Cancel order",return:"Return or replace",reorder:"Reorder"},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days.",messageWithoutDate:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"cancellation requested",message:"The cancellation has been requested on {DATE}. Check your email for further instructions.",messageWithoutDate:"The cancellation has been requested. Check your email for further instructions."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},billingMethods:{title:"Payment method"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},OrderCancelForm:{title:"Cancel order",description:"Select a reason for canceling the order",label:"Reason for cancel",button:"Submit Cancellation",errorHeading:"Error",errorDescription:"There was an error processing your order cancellation."}},p={Order:u},m={default:p},h=({children:t})=>{const[o,i]=n("en_US");return d(()=>{const e=c.on("locale",s=>{i(s)},{eager:!0});return()=>{e==null||e.off()}},[]),r(l,{lang:o,langDefinitions:m,children:t})},T=new a(r(h,{}));export{T as render};
@@ -25,8 +25,8 @@ export interface CustomerDetailsContentProps extends Omit<CustomerDetailsProps,
25
25
  loading: boolean;
26
26
  order?: OrderDataModel;
27
27
  normalizeAddress?: {
28
- billingAddress: NormalizeAddressProps[][];
29
- shippingAddress: NormalizeAddressProps[][];
28
+ billingAddress: NormalizeAddressProps[];
29
+ shippingAddress: NormalizeAddressProps[];
30
30
  };
31
31
  }
32
32
  export interface CustomerAddressesModel {