@dropins/storefront-checkout 0.1.0-alpha60 → 0.1.0-alpha61

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.
@@ -14,6 +14,6 @@
14
14
  * is strictly forbidden unless prior written permission is obtained
15
15
  * from Adobe.
16
16
  *******************************************************************/
17
- export declare const BILLING_CART_ADDRESS_FRAGMENT = "\n fragment BILLING_CART_ADDRESS_FRAGMENT on BillingCartAddress {\n id\n city\n country {\n code\n label\n }\n firstname\n lastname\n company\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n street\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n }\n";
18
- export declare const SHIPPING_CART_ADDRESS_FRAGMENT = "\n fragment SHIPPING_CART_ADDRESS_FRAGMENT on ShippingCartAddress {\n id\n firstname\n lastname\n company\n street\n city\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n country {\n code\n label\n }\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n available_shipping_methods {\n amount {\n currency\n value\n }\n available\n carrier_code\n carrier_title\n error_message\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n selected_shipping_method {\n amount {\n value\n currency\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n same_as_billing\n }\n";
17
+ export declare const BILLING_CART_ADDRESS_FRAGMENT = "\n fragment BILLING_CART_ADDRESS_FRAGMENT on BillingCartAddress {\n id\n city\n country {\n code\n label\n }\n firstname\n lastname\n company\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n street\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n prefix\n suffix\n middlename\n fax\n }\n";
18
+ export declare const SHIPPING_CART_ADDRESS_FRAGMENT = "\n fragment SHIPPING_CART_ADDRESS_FRAGMENT on ShippingCartAddress {\n id\n firstname\n lastname\n company\n street\n city\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n country {\n code\n label\n }\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n available_shipping_methods {\n amount {\n currency\n value\n }\n available\n carrier_code\n carrier_title\n error_message\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n selected_shipping_method {\n amount {\n value\n currency\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n same_as_billing\n prefix\n suffix\n middlename\n fax\n }\n";
19
19
  //# sourceMappingURL=CartAddressFragment.graphql.d.ts.map
@@ -14,6 +14,6 @@
14
14
  * is strictly forbidden unless prior written permission is obtained
15
15
  * from Adobe.
16
16
  *******************************************************************/
17
- export declare const ORDER_SUMMARY_FRAGMENT = "\n fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {\n grand_total {\n value\n currency\n }\n total_giftcard {\n currency\n value\n }\n subtotal {\n currency\n value\n }\n taxes {\n amount {\n currency\n value\n }\n rate\n }\n total_tax {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n }\n";
17
+ export declare const ORDER_SUMMARY_FRAGMENT = "\n fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {\n grand_total {\n value\n currency\n }\n total_giftcard {\n currency\n value\n }\n subtotal {\n currency\n value\n }\n taxes {\n title\n amount {\n currency\n value\n }\n rate\n }\n total_tax {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n }\n";
18
18
  export declare const ORDER_FRAGMENT: string;
19
19
  //# sourceMappingURL=OrderFragment.graphql.d.ts.map
@@ -1,13 +1,13 @@
1
1
  /*! Copyright 2024 Adobe
2
2
  All Rights Reserved. */
3
- import{s as i,M as C,d as l,l as A}from"./fetch-graphql.js";import{d as b,a as M,c}from"./store-config.js";import"./ServerErrorSignal.js";import{events as s}from"@dropins/tools/event-bus.js";import{merge as a,Initializer as T}from"@dropins/tools/lib.js";import{CHECKOUT_DATA_FRAGMENT as u,CUSTOMER_FRAGMENT as S}from"../fragments.js";const I=async(e=!1)=>{i.authenticated=e,e?await K():b.value={pending:!1,data:null}},x=e=>e==null,E=(e,t)=>e.amount.value-t.amount.value,m=e=>!(!e||!e.method_code||!e.method_title||x(e.amount.value)||!e.amount.currency),f=e=>({amount:{value:e.amount.value,currency:e.amount.currency},title:e.method_title,code:e.method_code,carrier:{code:e.carrier_code,title:e.carrier_title},value:`${e.carrier_code} - ${e.method_code}`,...e.price_excl_tax&&{amountExclTax:{value:e.price_excl_tax.value,currency:e.price_excl_tax.currency}},...e.price_incl_tax&&{amountInclTax:{value:e.price_incl_tax.value,currency:e.price_incl_tax.currency}}}),N=e=>{if(m(e))return f(e)},k=e=>{if(e)return e.filter(m).map(t=>f(t)).sort(E)},w=e=>e?!!e.code&&!!e.label:!1,z=e=>{if(!w(e))return;const{code:t,label:r,region_id:n}=e;return n?{code:t,name:r,id:n}:{code:t,name:r}},R=e=>{const{code:t,label:r}=e;return{value:t,label:r}},q=e=>e?"code"in e&&"value"in e:!1,G=e=>e.filter(q).map(t=>{const{code:r,value:n}=t;return{code:r,value:n}}),d=e=>{const t=e.street.filter(Boolean);return{id:(e==null?void 0:e.id)||void 0,city:e.city,company:e.company||void 0,country:R(e.country),customAttributes:G(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:z(e.region),street:t,telephone:e.telephone||void 0,vatId:e.vat_id||void 0}},O=e=>{if(e)return d(e)},P=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:r,selected_shipping_method:n,same_as_billing:o,...v}=t;return{...d(v),availableShippingMethods:k(r),selectedShippingMethod:N(n),sameAsBilling:o}}),ee=e=>({city:e.city,company:e.company,country_code:e.countryCode,custom_attributes:e.customAttributes.map(t=>({attribute_code:t.code,value:t.value})),firstname:e.firstName,lastname:e.lastName,postcode:e.postcode,region:e.region,region_id:e.regionId,save_in_address_book:e.saveInAddressBook??!0,street:e.street,telephone:e.telephone,vat_id:e.vatId}),$=e=>{if(e)return{code:e.code,title:e.title}},B=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:r,title:n}=t;return{code:r,title:n}})},D=e=>{var r,n,o;if(!e)return;const t={availablePaymentMethods:B(e.available_payment_methods),billingAddress:O(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:$(e.selected_payment_method),shippingAddresses:P(e.shipping_addresses),isGuest:!i.authenticated};return a(t,(o=(n=(r=_.getConfig().models)==null?void 0:r.CartModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},F=e=>{var r,n,o;if(!e)return;const t={firstName:e.firstname||"",lastName:e.lastname||"",email:e.email||""};return a(t,(o=(n=(r=_.getConfig().models)==null?void 0:r.CustomerModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},U=`
3
+ import{s as i,M as C,d as l,l as A}from"./fetch-graphql.js";import{d as x,a as b,c}from"./store-config.js";import"./ServerErrorSignal.js";import{events as s}from"@dropins/tools/event-bus.js";import{merge as u,Initializer as M}from"@dropins/tools/lib.js";import{CHECKOUT_DATA_FRAGMENT as a,CUSTOMER_FRAGMENT as T}from"../fragments.js";const S=async(e=!1)=>{i.authenticated=e,e?await K():x.value={pending:!1,data:null}},I=e=>e==null,N=(e,t)=>e.amount.value-t.amount.value,m=e=>!(!e||!e.method_code||!e.method_title||I(e.amount.value)||!e.amount.currency),f=e=>({amount:{value:e.amount.value,currency:e.amount.currency},title:e.method_title,code:e.method_code,carrier:{code:e.carrier_code,title:e.carrier_title},value:`${e.carrier_code} - ${e.method_code}`,...e.price_excl_tax&&{amountExclTax:{value:e.price_excl_tax.value,currency:e.price_excl_tax.currency}},...e.price_incl_tax&&{amountInclTax:{value:e.price_incl_tax.value,currency:e.price_incl_tax.currency}}}),E=e=>{if(m(e))return f(e)},k=e=>{if(e)return e.filter(m).map(t=>f(t)).sort(N)},w=e=>e?!!e.code&&!!e.label:!1,z=e=>{if(!w(e))return;const{code:t,label:r,region_id:n}=e;return n?{code:t,name:r,id:n}:{code:t,name:r}},R=e=>{const{code:t,label:r}=e;return{value:t,label:r}},q=e=>e?"code"in e&&"value"in e:!1,G=e=>e.filter(q).map(t=>{const{code:r,value:n}=t;return{code:r,value:n}}),p=e=>{const t=e.street.filter(Boolean);return{id:(e==null?void 0:e.id)||void 0,city:e.city,company:e.company||void 0,country:R(e.country),customAttributes:G(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:z(e.region),street:t,telephone:e.telephone||void 0,vatId:e.vat_id||void 0,prefix:e.prefix||void 0,suffix:e.suffix||void 0,middleName:e.middlename||void 0,fax:e.fax||void 0}},O=e=>{if(e)return p(e)},P=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:r,selected_shipping_method:n,same_as_billing:o,...v}=t;return{...p(v),availableShippingMethods:k(r),selectedShippingMethod:E(n),sameAsBilling:o}}),ee=e=>({city:e.city,company:e.company,country_code:e.countryCode,custom_attributes:e.customAttributes.map(t=>({attribute_code:t.code,value:t.value})),firstname:e.firstName,lastname:e.lastName,postcode:e.postcode,region:e.region,region_id:e.regionId,save_in_address_book:e.saveInAddressBook??!0,street:e.street,telephone:e.telephone,vat_id:e.vatId,prefix:e.prefix,suffix:e.suffix,middlename:e.middleName,fax:e.fax}),$=e=>{if(e)return{code:e.code,title:e.title}},B=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:r,title:n}=t;return{code:r,title:n}})},D=e=>{var r,n,o;if(!e)return;const t={availablePaymentMethods:B(e.available_payment_methods),billingAddress:O(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:$(e.selected_payment_method),shippingAddresses:P(e.shipping_addresses),isGuest:!i.authenticated};return u(t,(o=(n=(r=_.getConfig().models)==null?void 0:r.CartModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},F=e=>{var r,n,o;if(!e)return;const t={firstName:e.firstname||"",lastName:e.lastname||"",email:e.email||""};return u(t,(o=(n=(r=_.getConfig().models)==null?void 0:r.CustomerModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},U=`
4
4
  query getCart($cartId: String!) {
5
5
  cart(cart_id: $cartId) {
6
6
  ...CHECKOUT_DATA_FRAGMENT
7
7
  }
8
8
  }
9
9
 
10
- ${u}
10
+ ${a}
11
11
  `,V=`
12
12
  query getCustomerCart {
13
13
  cart: customerCart {
@@ -15,13 +15,13 @@ import{s as i,M as C,d as l,l as A}from"./fetch-graphql.js";import{d as b,a as M
15
15
  }
16
16
  }
17
17
 
18
- ${u}
19
- `,p=async()=>{const e=i.cartId,t=i.authenticated===!1,r=t?U:V,n=t?{cartId:e}:{};if(t&&!e)throw new C;return await l({type:"query",query:r,options:{method:"POST",cache:"no-cache",variables:n},path:"cart",signalType:"cart",transformer:D})},H=`
18
+ ${a}
19
+ `,d=async()=>{const e=i.cartId,t=i.authenticated===!1,r=t?U:V,n=t?{cartId:e}:{};if(t&&!e)throw new C;return await l({type:"query",query:r,options:{method:"POST",cache:"no-cache",variables:n},path:"cart",signalType:"cart",transformer:D})},H=`
20
20
  query getCustomer {
21
21
  customer {
22
22
  ...CUSTOMER_FRAGMENT
23
23
  }
24
24
  }
25
25
 
26
- ${S}
27
- `,K=async()=>{if(i.authenticated)return await l({type:"query",query:H,options:{method:"POST",cache:"no-cache"},path:"customer",signalType:"customer",transformer:F})},Q=()=>[s.on("authenticated",I,{eager:!0}),s.on("cart/initialized",h,{eager:!0}),s.on("cart/reset",L),s.on("cart/updated",y)],g=new T({init:async e=>{const t=e||{};g.config.setConfig(t),M.value.data||await A()},listeners:Q}),_=g.config,h=async e=>{if(i.initialized)return y(e);const t=e?e.id:null;i.cartId=t;const r=t?await p():null;c.value={pending:!1,data:r},i.initialized=!0,s.emit("checkout/initialized",r||null)},L=()=>{i.cartId=null,c.value={pending:!1,data:null},s.emit("checkout/updated",null)},y=async e=>{if(!i.initialized)return h(e);const t=e?e.id:null;i.cartId=t;const r=t?await p():null;c.value={pending:!1,data:r},s.emit("checkout/updated",r||null)};export{ee as a,D as b,_ as c,I as d,K as e,h as f,p as g,g as i,L as r,y as s,k as t};
26
+ ${T}
27
+ `,K=async()=>{if(i.authenticated)return await l({type:"query",query:H,options:{method:"POST",cache:"no-cache"},path:"customer",signalType:"customer",transformer:F})},Q=()=>[s.on("authenticated",S,{eager:!0}),s.on("cart/initialized",h,{eager:!0}),s.on("cart/reset",L),s.on("cart/updated",y)],g=new M({init:async e=>{const t=e||{};g.config.setConfig(t),b.value.data||await A()},listeners:Q}),_=g.config,h=async e=>{if(i.initialized)return y(e);const t=e?e.id:null;i.cartId=t;const r=t?await d():null;c.value={pending:!1,data:r},i.initialized=!0,s.emit("checkout/initialized",r||null)},L=()=>{i.cartId=null,c.value={pending:!1,data:null},s.emit("checkout/updated",null)},y=async e=>{if(!i.initialized)return h(e);const t=e?e.id:null;i.cartId=t;const r=t?await d():null;c.value={pending:!1,data:r},s.emit("checkout/updated",r||null)};export{ee as a,D as b,_ as c,S as d,K as e,h as f,d as g,g as i,L as r,y as s,k as t};
@@ -1,3 +1,3 @@
1
1
  /*! Copyright 2024 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as t,jsxs as s}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Icon as A,Header as E,Button as y,Skeleton as N,SkeletonRow as r}from"@dropins/tools/components.js";/* empty css */import"@dropins/tools/lib.js";/* empty css *//* empty css *//* empty css */import*as o from"@dropins/tools/preact-compat.js";import{useState as C,useEffect as b}from"@dropins/tools/preact-compat.js";import{useText as z,Text as v}from"@dropins/tools/i18n.js";import{s as f}from"../chunks/fetch-graphql.js";import"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import"@dropins/tools/event-bus.js";import{i as H}from"../chunks/isEmailAvailable.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";function p(e){var c;return{region:{region_id:e!=null&&e.regionId?Number(e==null?void 0:e.regionId):null,region:e==null?void 0:e.region},city:e==null?void 0:e.city,company:e==null?void 0:e.company,country_code:e==null?void 0:e.country,firstname:e==null?void 0:e.firstName,lastname:e==null?void 0:e.lastName,middlename:e==null?void 0:e.middleName,postcode:e==null?void 0:e.postCode,street:e==null?void 0:e.street,telephone:e==null?void 0:e.telephone,custom_attributesV2:((c=e==null?void 0:e.customAttributes)==null?void 0:c.map(l=>({attribute_code:l.code,value:l.value})))||[]}}const V=e=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},o.createElement("g",{clipPath:"url(#clip0_4797_15077)"},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.15 20.85L1.5 17.53V6.63L10.15 10V20.85Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.63001L10.15 3.20001L18.8 6.63001L10.15 10L1.5 6.63001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.17969 4.77002L14.8297 8.15002V11.47",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.7896 12.64V6.63L10.1396 10V20.85L14.8296 19.05",stroke:"currentColor",strokeLinejoin:"round"}),o.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M15.71 17.26C15.71 15.38 17.23 13.86 19.11 13.86C20.99 13.86 22.51 15.38 22.51 17.26C22.51 19.14 20.99 20.66 19.11 20.66C17.23 20.66 15.71 19.14 15.71 17.26Z",stroke:"currentColor"}),o.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M17.4805 17.49L18.5605 18.41L20.7205 16.33",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_4797_15077"},o.createElement("rect",{width:22,height:18.65,fill:"white",transform:"translate(1 2.70001)"})))),d=({customerName:e,isLoading:c,orderNumber:l,onSignUpClick:a})=>{const i=z({title:t(v,{id:"Checkout.OrderConfirmationHeader.title",fields:{name:e}}),defaultTitle:"Checkout.OrderConfirmationHeader.defaultTitle",order:t(v,{id:"Checkout.OrderConfirmationHeader.order",fields:{order:l}}),createAccountMessage:"Checkout.OrderConfirmationHeader.CreateAccount.message",createAccountButton:"Checkout.OrderConfirmationHeader.CreateAccount.button"});return c?t(w,{}):s("div",{className:"order-confirmation-header order-confirmation__card",children:[t(A,{source:V,size:"64",className:"order-confirmation-header__icon"}),t(E,{className:"order-confirmation-header__title",title:i.title,size:"large",divider:!1,children:e?i.title:i.defaultTitle}),l&&t("p",{className:"order-confirmation-header__order",children:i.order}),a&&s("div",{className:"order-confirmation-create-account",children:[t("p",{className:"order-confirmation-create-account__message",children:i.createAccountMessage}),t(y,{"data-testid":"create-account-button",className:"order-confirmation-create-account__button",size:"medium",variant:"secondary",type:"submit",onClick:a,children:i.createAccountButton})]})]})},w=()=>s(N,{"data-testid":"order-confirmation-header-skeleton",className:"order-confirmation-header",children:[t(r,{variant:"empty",size:"xlarge",fullWidth:!0}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{variant:"empty",size:"medium"}),t(r,{size:"small",fullWidth:!0}),t(r,{variant:"heading",size:"xsmall",fullWidth:!0})]}),U=({orderData:e,onSignUpClick:c})=>{var g;const[l,a]=C(!f.authenticated),[i,h]=C();b(()=>{f.authenticated||H(e.email).then(m=>h(!m)).catch(()=>h(!0)).finally(()=>a(!1))},[e.email]);const _=c&&!f.authenticated&&i===!1?()=>{const m=e.shippingAddress,n=e.billingAddress,L=[{code:"firstname",defaultValue:(n==null?void 0:n.firstName)||""},{code:"lastname",defaultValue:(n==null?void 0:n.lastName)||""},{code:"email",defaultValue:e.email||""}];let u;if(m){const k={...p(m),default_shipping:!0};u=[{...p(n),default_billing:!0},k]}else u=[{...p(n),default_billing:!0,default_shipping:!0}];c({inputsDefaultValueSet:L,addressesData:u})}:void 0;return t("div",{children:t(d,{customerName:(g=e.billingAddress)==null?void 0:g.firstName,isLoading:l,onSignUpClick:_,orderNumber:e.number})})};export{U as OrderConfirmationHeader,U as default};
3
+ import{jsx as e,jsxs as h}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Icon as A,Header as E,Button as y,Skeleton as N,SkeletonRow as r}from"@dropins/tools/components.js";/* empty css */import"@dropins/tools/lib.js";/* empty css *//* empty css *//* empty css */import*as o from"@dropins/tools/preact-compat.js";import{useState as s,useEffect as x}from"@dropins/tools/preact-compat.js";import{useText as b,Text as v}from"@dropins/tools/i18n.js";import{s as f}from"../chunks/fetch-graphql.js";import"../chunks/store-config.js";import"../chunks/ServerErrorSignal.js";import"@dropins/tools/event-bus.js";import{i as z}from"../chunks/isEmailAvailable.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";function p(t){var c;return{region:{region_id:t!=null&&t.regionId?Number(t==null?void 0:t.regionId):null,region:t==null?void 0:t.region},city:t==null?void 0:t.city,company:t==null?void 0:t.company,country_code:t==null?void 0:t.country,firstname:t==null?void 0:t.firstName,lastname:t==null?void 0:t.lastName,middlename:t==null?void 0:t.middleName,postcode:t==null?void 0:t.postCode,street:t==null?void 0:t.street,telephone:t==null?void 0:t.telephone,custom_attributesV2:((c=t==null?void 0:t.customAttributes)==null?void 0:c.map(l=>({attribute_code:l.code,value:l.value})))||[],prefix:t==null?void 0:t.prefix,suffix:t==null?void 0:t.suffix,fax:t==null?void 0:t.fax}}const H=t=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},o.createElement("g",{clipPath:"url(#clip0_4797_15077)"},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.15 20.85L1.5 17.53V6.63L10.15 10V20.85Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.63001L10.15 3.20001L18.8 6.63001L10.15 10L1.5 6.63001Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.17969 4.77002L14.8297 8.15002V11.47",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.7896 12.64V6.63L10.1396 10V20.85L14.8296 19.05",stroke:"currentColor",strokeLinejoin:"round"}),o.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M15.71 17.26C15.71 15.38 17.23 13.86 19.11 13.86C20.99 13.86 22.51 15.38 22.51 17.26C22.51 19.14 20.99 20.66 19.11 20.66C17.23 20.66 15.71 19.14 15.71 17.26Z",stroke:"currentColor"}),o.createElement("path",{className:"success-icon",vectorEffect:"non-scaling-stroke",d:"M17.4805 17.49L18.5605 18.41L20.7205 16.33",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_4797_15077"},o.createElement("rect",{width:22,height:18.65,fill:"white",transform:"translate(1 2.70001)"})))),V=({customerName:t,isLoading:c,orderNumber:l,onSignUpClick:m})=>{const i=b({title:e(v,{id:"Checkout.OrderConfirmationHeader.title",fields:{name:t}}),defaultTitle:"Checkout.OrderConfirmationHeader.defaultTitle",order:e(v,{id:"Checkout.OrderConfirmationHeader.order",fields:{order:l}}),createAccountMessage:"Checkout.OrderConfirmationHeader.CreateAccount.message",createAccountButton:"Checkout.OrderConfirmationHeader.CreateAccount.button"});return c?e(w,{}):h("div",{className:"order-confirmation-header order-confirmation__card",children:[e(A,{source:H,size:"64",className:"order-confirmation-header__icon"}),e(E,{className:"order-confirmation-header__title",title:i.title,size:"large",divider:!1,children:t?i.title:i.defaultTitle}),l&&e("p",{className:"order-confirmation-header__order",children:i.order}),m&&h("div",{className:"order-confirmation-create-account",children:[e("p",{className:"order-confirmation-create-account__message",children:i.createAccountMessage}),e(y,{"data-testid":"create-account-button",className:"order-confirmation-create-account__button",size:"medium",variant:"secondary",type:"submit",onClick:m,children:i.createAccountButton})]})]})},w=()=>h(N,{"data-testid":"order-confirmation-header-skeleton",className:"order-confirmation-header",children:[e(r,{variant:"empty",size:"xlarge",fullWidth:!0}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{size:"small",fullWidth:!0}),e(r,{variant:"heading",size:"xsmall",fullWidth:!0})]}),X=({orderData:t,onSignUpClick:c})=>{var k;const[l,m]=s(!f.authenticated),[i,g]=s();x(()=>{f.authenticated||z(t.email).then(a=>g(!a)).catch(()=>g(!0)).finally(()=>m(!1))},[t.email]);const _=c&&!f.authenticated&&i===!1?()=>{const a=t.shippingAddress,n=t.billingAddress,L=[{code:"firstname",defaultValue:(n==null?void 0:n.firstName)||""},{code:"lastname",defaultValue:(n==null?void 0:n.lastName)||""},{code:"email",defaultValue:t.email||""}];let u;if(a){const C={...p(a),default_shipping:!0};u=[{...p(n),default_billing:!0},C]}else u=[{...p(n),default_billing:!0,default_shipping:!0}];c({inputsDefaultValueSet:L,addressesData:u})}:void 0;return e("div",{children:e(V,{customerName:(k=t.billingAddress)==null?void 0:k.firstName,isLoading:l,onSignUpClick:_,orderNumber:t.number})})};export{X as OrderConfirmationHeader,X as default};
@@ -13,5 +13,9 @@ export interface Address {
13
13
  street: string[];
14
14
  telephone?: string;
15
15
  vatId?: string;
16
+ prefix?: string;
17
+ suffix?: string;
18
+ middleName?: string;
19
+ fax?: string;
16
20
  }
17
21
  //# sourceMappingURL=address.d.ts.map
@@ -14,6 +14,10 @@ export interface CartAddress {
14
14
  street: string[];
15
15
  telephone?: string;
16
16
  vatId?: string;
17
+ prefix?: string;
18
+ suffix?: string;
19
+ middleName?: string;
20
+ fax?: string;
17
21
  }
18
22
  export interface ShippingAddressInput {
19
23
  address?: CartAddress;
@@ -16,6 +16,9 @@ export type OrderAddressModel = {
16
16
  code: string;
17
17
  value: string;
18
18
  }[];
19
+ prefix: string;
20
+ suffix: string;
21
+ fax: string;
19
22
  } | null;
20
23
  export type OrderItemProductModel = {
21
24
  stockStatus?: string;
@@ -21,6 +21,10 @@ declare const transformShippingAddresses: (data: ({
21
21
  vat_id?: string | null | undefined;
22
22
  telephone?: string | null | undefined;
23
23
  same_as_billing: boolean;
24
+ prefix?: string | null | undefined;
25
+ suffix?: string | null | undefined;
26
+ middlename?: string | null | undefined;
27
+ fax?: string | null | undefined;
24
28
  region?: {
25
29
  __typename?: "CartAddressRegion" | undefined;
26
30
  region_id?: number | null | undefined;
package/fragments.js CHANGED
@@ -26,6 +26,10 @@ const e=`
26
26
  value
27
27
  }
28
28
  }
29
+ prefix
30
+ suffix
31
+ middlename
32
+ fax
29
33
  }
30
34
  `,t=`
31
35
  fragment SHIPPING_CART_ADDRESS_FRAGMENT on ShippingCartAddress {
@@ -92,6 +96,10 @@ const e=`
92
96
  }
93
97
  }
94
98
  same_as_billing
99
+ prefix
100
+ suffix
101
+ middlename
102
+ fax
95
103
  }
96
104
  `,d=`
97
105
  fragment CHECKOUT_DATA_FRAGMENT on Cart {
@@ -259,6 +267,7 @@ const e=`
259
267
  value
260
268
  }
261
269
  taxes {
270
+ title
262
271
  amount {
263
272
  currency
264
273
  value
@@ -1,19 +1,19 @@
1
1
  /********************************************************************
2
- * ADOBE CONFIDENTIAL
3
- * __________________
4
- *
5
- * Copyright 2024 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
- *******************************************************************/
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 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
17
  export declare const billingAddressFixture: {
18
18
  firstname: string;
19
19
  lastname: string;
@@ -33,6 +33,10 @@ export declare const billingAddressFixture: {
33
33
  };
34
34
  telephone: string;
35
35
  custom_attributes: {}[];
36
+ prefix: string;
37
+ suffix: string;
38
+ middlename: string;
39
+ fax: string;
36
40
  };
37
41
  export declare const ukBillingAddressFixture: {
38
42
  firstname: string;
@@ -48,5 +52,9 @@ export declare const ukBillingAddressFixture: {
48
52
  };
49
53
  telephone: string;
50
54
  custom_attributes: {}[];
55
+ prefix: string;
56
+ suffix: string;
57
+ middlename: string;
58
+ fax: string;
51
59
  };
52
60
  //# sourceMappingURL=billing-address.d.ts.map
@@ -31,6 +31,10 @@ export declare const cartFixture: {
31
31
  vat_id?: string | null | undefined;
32
32
  street: (string | null)[];
33
33
  telephone?: string | null | undefined;
34
+ prefix?: string | null | undefined;
35
+ suffix?: string | null | undefined;
36
+ middlename?: string | null | undefined;
37
+ fax?: string | null | undefined;
34
38
  country: {
35
39
  __typename?: "CartAddressCountry" | undefined;
36
40
  code: string;
@@ -62,6 +66,10 @@ export declare const cartFixture: {
62
66
  vat_id?: string | null | undefined;
63
67
  telephone?: string | null | undefined;
64
68
  same_as_billing: boolean;
69
+ prefix?: string | null | undefined;
70
+ suffix?: string | null | undefined;
71
+ middlename?: string | null | undefined;
72
+ fax?: string | null | undefined;
65
73
  region?: {
66
74
  __typename?: "CartAddressRegion" | undefined;
67
75
  region_id?: number | null | undefined;
@@ -1,19 +1,19 @@
1
1
  /********************************************************************
2
- * ADOBE CONFIDENTIAL
3
- * __________________
4
- *
5
- * Copyright 2024 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
- *******************************************************************/
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 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
17
  export declare const shippingAddressFixture: {
18
18
  firstname: string;
19
19
  lastname: string;
@@ -54,5 +54,9 @@ export declare const shippingAddressFixture: {
54
54
  };
55
55
  }[];
56
56
  selected_shipping_method: null;
57
+ prefix: string;
58
+ suffix: string;
59
+ middlename: string;
60
+ fax: string;
57
61
  };
58
62
  //# sourceMappingURL=shipping-address.d.ts.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-checkout", "version": "0.1.0-alpha60", "@dropins/tools": "~0.36.0"}
1
+ {"name": "@dropins/storefront-checkout", "version": "0.1.0-alpha61", "@dropins/tools": "~0.36.0"}