@dropins/storefront-checkout 0.1.0-alpha49 → 0.1.0-alpha50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/api/errors/errors.d.ts +3 -0
  2. package/api/estimateShippingMethods/estimateShippingMethods.d.ts +1 -1
  3. package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +16 -16
  4. package/api/getCart/graphql/getCart.graphql.d.ts +16 -16
  5. package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +16 -16
  6. package/api/index.d.ts +0 -3
  7. package/api/initialize/initialize.d.ts +6 -1
  8. package/api/initializeCheckout/initializeCheckout.d.ts +3 -17
  9. package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +15 -15
  10. package/api/setBillingAddress/setBillingAddress.d.ts +2 -11
  11. package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +15 -15
  12. package/api/setShippingAddress/setShippingAddress.d.ts +3 -45
  13. package/api/utils/dispatchApiCall.d.ts +0 -16
  14. package/api.js +37 -1
  15. package/chunks/Heading.js +1 -0
  16. package/chunks/classes.js +1 -0
  17. package/chunks/fetch-graphql.js +10 -0
  18. package/chunks/getCart.graphql.js +7 -4
  19. package/chunks/getCustomer.js +2 -2
  20. package/chunks/placeOrder2.js +131 -0
  21. package/chunks/resetCustomer.js +1 -36
  22. package/chunks/setBillingAddress.js +5 -7
  23. package/chunks/setGuestEmailOnCart.js +3 -3
  24. package/chunks/setPaymentMethod.js +2 -2
  25. package/chunks/setShippingMethods.js +2 -2
  26. package/chunks/store-config.js +1 -0
  27. package/chunks/withConditionalRendering.js +1 -1
  28. package/components/BillToShippingAddress/BillToShippingAddress.d.ts +3 -3
  29. package/components/LoginForm/Email.d.ts +8 -8
  30. package/components/LoginForm/LoginForm.d.ts +14 -10
  31. package/components/LoginForm/SignIn.d.ts +3 -4
  32. package/components/LoginForm/SignOut.d.ts +3 -3
  33. package/components/PaymentMethods/PaymentMethods.d.ts +4 -3
  34. package/components/index.d.ts +0 -2
  35. package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +18 -6
  36. package/containers/BillToShippingAddress/index.d.ts +15 -16
  37. package/containers/BillToShippingAddress.js +1 -1
  38. package/containers/ErrorBanner/ErrorBanner.d.ts +2 -2
  39. package/containers/ErrorBanner.js +1 -1
  40. package/containers/EstimateShipping.js +1 -1
  41. package/containers/LoginForm/LoginForm.d.ts +2 -3
  42. package/containers/LoginForm/index.d.ts +15 -16
  43. package/containers/LoginForm.js +1 -1
  44. package/containers/MergedCartBanner/MergedCartBanner.d.ts +2 -2
  45. package/containers/MergedCartBanner.js +1 -1
  46. package/containers/OutOfStock.js +1 -1
  47. package/containers/PaymentMethods.js +1 -1
  48. package/containers/PlaceOrder/PlaceOrder.d.ts +1 -5
  49. package/containers/PlaceOrder.js +1 -1
  50. package/containers/ServerError.js +1 -1
  51. package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +15 -15
  52. package/containers/ShippingMethods.js +1 -1
  53. package/containers/index.d.ts +0 -2
  54. package/data/models/address.d.ts +11 -15
  55. package/data/models/api.d.ts +29 -0
  56. package/data/models/cart.d.ts +9 -5
  57. package/data/models/customer.d.ts +3 -14
  58. package/data/models/index.d.ts +19 -17
  59. package/data/models/region.d.ts +15 -15
  60. package/data/models/store-config.d.ts +0 -3
  61. package/data/transforms/index.d.ts +16 -18
  62. package/data/transforms/transform-address.d.ts +7 -5
  63. package/hocs/index.d.ts +16 -15
  64. package/hooks/index.d.ts +16 -16
  65. package/hooks/useStableList/index.d.ts +2 -0
  66. package/hooks/useStableList/useStableList.d.ts +2 -0
  67. package/i18n/en_US.json.d.ts +0 -18
  68. package/lib/index.d.ts +16 -15
  69. package/lib/validation.d.ts +5 -0
  70. package/msw/fixtures/fragments/cart.d.ts +3 -0
  71. package/msw/fixtures/fragments/index.d.ts +15 -18
  72. package/msw/fixtures/queries/index.d.ts +0 -3
  73. package/package.json +1 -1
  74. package/render.js +4 -4
  75. package/signals/IsBillToShippingSignal.d.ts +16 -20
  76. package/signals/index.d.ts +0 -3
  77. package/utils/index.d.ts +0 -6
  78. package/utils/refetchEstimatedShippingMethods/refetchEstimatedShippingMethods.d.ts +1 -0
  79. package/__generated__/types.d.ts +0 -15365
  80. package/api/fetchAddressFormFields/fetchAddressFormFields.d.ts +0 -18
  81. package/api/fetchAddressFormFields/fixtures.d.ts +0 -5
  82. package/api/fetchAddressFormFields/graphql/fetchAddressFormFields.graphql.d.ts +0 -18
  83. package/api/fetchAddressFormFields/index.d.ts +0 -19
  84. package/api/getCountries/fixtures.d.ts +0 -6
  85. package/api/getCountries/getCountries.d.ts +0 -18
  86. package/api/getCountries/graphql/getCountries.graphql.d.ts +0 -18
  87. package/api/getCountries/index.d.ts +0 -18
  88. package/api/getRegions/fixtures.d.ts +0 -5
  89. package/api/getRegions/getRegions.d.ts +0 -5
  90. package/api/getRegions/graphql/getRegions.graphql.d.ts +0 -18
  91. package/api/getRegions/index.d.ts +0 -18
  92. package/chunks/BillToShippingAddress.js +0 -1
  93. package/chunks/ShippingMethods.js +0 -1
  94. package/chunks/fixtures.js +0 -15
  95. package/chunks/getMultilineValues.js +0 -43
  96. package/chunks/placeOrder.js +0 -131
  97. package/chunks/setShippingAddress.js +0 -16
  98. package/chunks/transform-shipping-methods.js +0 -1
  99. package/components/AddressForm/AddressForm.d.ts +0 -22
  100. package/components/AddressForm/constants.d.ts +0 -20
  101. package/components/AddressForm/index.d.ts +0 -23
  102. package/components/AddressForm/useAddressBackup.d.ts +0 -8
  103. package/components/AddressForm/useAddressForm.d.ts +0 -39
  104. package/components/AddressForm/useCheckoutAddressEventEmitter.d.ts +0 -10
  105. package/components/AddressForm/usePreselectedFields.d.ts +0 -9
  106. package/components/AddressForm/utils.d.ts +0 -13
  107. package/components/FieldsForm/FieldsForm.d.ts +0 -13
  108. package/components/FieldsForm/FieldsFormSkeleton.d.ts +0 -4
  109. package/components/FieldsForm/fieldFactory.d.ts +0 -9
  110. package/components/FieldsForm/fixtures.d.ts +0 -5
  111. package/components/FieldsForm/index.d.ts +0 -22
  112. package/components/FieldsForm/validation.d.ts +0 -18
  113. package/containers/BillToShippingAddress/constants.d.ts +0 -18
  114. package/containers/BillingForm/BillingForm.d.ts +0 -9
  115. package/containers/BillingForm/constants.d.ts +0 -18
  116. package/containers/BillingForm/index.d.ts +0 -20
  117. package/containers/BillingForm.d.ts +0 -3
  118. package/containers/BillingForm.js +0 -1
  119. package/containers/LoginForm/constants.d.ts +0 -18
  120. package/containers/ShippingForm/ShippingForm.d.ts +0 -12
  121. package/containers/ShippingForm/constants.d.ts +0 -18
  122. package/containers/ShippingForm/index.d.ts +0 -20
  123. package/containers/ShippingForm.d.ts +0 -3
  124. package/containers/ShippingForm.js +0 -1
  125. package/data/models/address-form-fields.d.ts +0 -52
  126. package/data/transforms/transform-address-form-fields.d.ts +0 -66
  127. package/data/transforms/transform-countries.d.ts +0 -5
  128. package/data/transforms/transform-regions.d.ts +0 -8
  129. package/hooks/useValidity/index.d.ts +0 -18
  130. package/hooks/useValidity/useValidity.d.ts +0 -35
  131. package/msw/fixtures/fragments/american-regions.d.ts +0 -4
  132. package/msw/fixtures/fragments/countries.d.ts +0 -4
  133. package/msw/fixtures/fragments/form-fields.d.ts +0 -4
  134. package/msw/fixtures/queries/fetch-address-form-fields.d.ts +0 -4
  135. package/msw/fixtures/queries/get-countries.d.ts +0 -4
  136. package/msw/fixtures/queries/get-regions.d.ts +0 -4
  137. package/signals/AddressFormFieldsSignal.d.ts +0 -7
  138. package/signals/CountryListSignal.d.ts +0 -7
  139. package/signals/RegionsSignal.d.ts +0 -12
  140. package/utils/autocompleteFieldCodes/autocompleteFieldCodes.d.ts +0 -34
  141. package/utils/autocompleteFieldCodes/index.d.ts +0 -18
  142. package/utils/getMultilineValues/getMultilineValues.d.ts +0 -19
  143. package/utils/getMultilineValues/index.d.ts +0 -18
  144. package/utils/parseRegionId/index.d.ts +0 -18
  145. package/utils/parseRegionId/parseRegionId.d.ts +0 -18
  146. package/utils/processFormFields/index.d.ts +0 -18
  147. package/utils/processFormFields/processFormFields.d.ts +0 -21
  148. package/utils/scrollToElement/index.d.ts +0 -18
  149. package/utils/scrollToElement/scrollToElement.d.ts +0 -18
  150. package/utils/validateForms/index.d.ts +0 -18
  151. package/utils/validateForms/validateForms.d.ts +0 -18
@@ -1 +1 @@
1
- import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as f,Icon as u}from"@dropins/tools/components.js";import{events as g}from"@dropins/tools/event-bus.js";import*as i from"@dropins/tools/preact-compat.js";import{useState as p,useEffect as I}from"@dropins/tools/preact-compat.js";import{useText as h,Text as v}from"@dropins/tools/i18n.js";const B=t=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),E=t=>{const[r,s]=p(0),a=h({mergedCartBannerItems:e(v,{id:"Checkout.MergedCartBanner.items",fields:{count:r},plural:r})});I(()=>{const n=g.on("cart/merged",o=>{var m;const l=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((C,d)=>C+d.quantity,0);l>0&&s(l)});return()=>{n==null||n.off()}},[]);const c=()=>{s(0)};return r?e(f,{...t,className:"checkout__banner","data-testid":"merged-cart-banner",icon:e(u,{source:B}),message:e("span",{children:a.mergedCartBannerItems}),"aria-label":a.mergedCartBannerItems,onDismiss:c,variant:"neutral"}):null};export{E as MergedCartBanner,E as default};
1
+ import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as u,Icon as g}from"@dropins/tools/components.js";import{c as p}from"../chunks/classes.js";import{events as I}from"@dropins/tools/event-bus.js";import*as i from"@dropins/tools/preact-compat.js";import{useState as h,useEffect as v}from"@dropins/tools/preact-compat.js";import{useText as B,Text as M}from"@dropins/tools/i18n.js";const w=t=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 12C0 5.37931 5.37931 0 12 0C18.6207 0 24 5.37931 24 12C24 18.6207 18.6207 24 12 24C5.37931 24 0 18.6207 0 12ZM11.8885 5.06101C11.1405 5.06101 10.5357 5.66579 10.5357 6.4138V6.57295C10.5835 7.27321 11.1882 7.81433 11.8885 7.76658H12.0795C12.7797 7.70292 13.289 7.09815 13.2413 6.4138C13.2413 5.66579 12.6365 5.06101 11.8885 5.06101ZM13.1935 16.8223H14.1007C14.2599 16.8223 14.4031 16.9655 14.4031 17.1247V17.7294C14.4031 17.9045 14.2599 18.0318 14.1007 18.0318H9.8832C9.70813 18.0318 9.58081 17.8886 9.58081 17.7294V17.1247C9.58081 16.9496 9.72405 16.8223 9.8832 16.8223H10.7904V10.7905H9.8832C9.70813 10.7905 9.58081 10.6472 9.58081 10.4881V9.88329C9.58081 9.70823 9.72405 9.58091 9.8832 9.58091H12.5888C12.923 9.58091 13.1935 9.85146 13.1935 10.1857V16.8223Z",fill:"currentColor"})),b=({className:t,initialData:x,...c})=>{const[r,s]=h(0),a=B({mergedCartBannerItems:e(M,{id:"Checkout.MergedCartBanner.items",fields:{count:r},plural:r})});v(()=>{const n=I.on("cart/merged",o=>{var m;const l=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((d,f)=>d+f.quantity,0);l>0&&s(l)});return()=>{n==null||n.off()}},[]);const C=()=>{s(0)};return r?e(u,{...c,"aria-label":a.mergedCartBannerItems,className:p(["checkout__banner",t]),"data-testid":"merged-cart-banner",icon:e(g,{source:w}),message:e("span",{children:a.mergedCartBannerItems}),onDismiss:C,variant:"neutral"}):null};export{b as MergedCartBanner,b as default};
@@ -1 +1 @@
1
- import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/ShippingMethods.js";import{events as k}from"@dropins/tools/event-bus.js";import"@dropins/tools/preact-hooks.js";import"../chunks/fixtures.js";import{classes as l}from"@dropins/tools/lib.js";import{Card as h,Icon as O,Image as d}from"@dropins/tools/components.js";/* empty css */import{S as p}from"../chunks/OrderError.js";import{useText as S}from"@dropins/tools/i18n.js";/* empty css */import{useState as v,useCallback as _,useEffect as g}from"@dropins/tools/preact-compat.js";import"../chunks/getMultilineValues.js";import"../chunks/transform-shipping-methods.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const N=({className:i,items:r,onRemoveOutOfStock:o,routeCart:m,...a})=>{const s=S({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return n(h,{className:l(["checkout-out-of-stock",i]),"data-testid":"checkout-out-of-stock",variant:"secondary",...a,children:[n("h4",{className:"checkout-out-of-stock__title",children:[e(O,{source:p,size:"16",stroke:"1"}),s.title]}),e("p",{className:"checkout-out-of-stock__message",children:s.message}),e("ol",{className:"checkout-out-of-stock__items",children:r.map(u=>e("li",{"data-testid":"out-of-stock-item",className:"checkout-out-of-stock__item",children:e(d,{loading:"eager",src:u.image.src,alt:u.image.alt,width:"100",height:"100",params:{width:100}})},u.sku))}),n("div",{className:"checkout-out-of-stock__actions",children:[m&&e("a",{"data-testid":"review-cart",className:"checkout-out-of-stock__action",href:m,children:s.reviewCart}),o&&e("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:o,children:s.removeOutOfStock})]})]})},F=({onCartProductsUpdate:i,routeCart:r})=>{const[o,m]=v([]),a=t=>t.outOfStock||t.insufficientQuantity,s=_(()=>{if(!i)return;const t=o.filter(c=>c.outOfStock).map(c=>({uid:c.uid,quantity:0}));i(t)},[o,i]);if(g(()=>{const t=k.on("cart/data",c=>{const f=(c==null?void 0:c.items)||[];m(f.filter(a))},{eager:!0});return()=>{t==null||t.off()}},[]),o.length===0)return null;const u=!o.some(t=>t.insufficientQuantity);return e(N,{items:o,onRemoveOutOfStock:u?s:void 0,routeCart:r==null?void 0:r()})};export{F as OutOfStock,F as default};
1
+ import{jsxs as n,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Card as k,Icon as l,Image as h}from"@dropins/tools/components.js";/* empty css */import{classes as O}from"@dropins/tools/lib.js";import{S as d}from"../chunks/OrderError.js";import{useText as S}from"@dropins/tools/i18n.js";import"@dropins/tools/preact-hooks.js";/* empty css */import{events as p}from"@dropins/tools/event-bus.js";import{useState as v,useCallback as _,useEffect as g}from"@dropins/tools/preact-compat.js";const N=({className:i,items:r,onRemoveOutOfStock:o,routeCart:a,...m})=>{const s=S({title:"Checkout.OutOfStock.title",message:"Checkout.OutOfStock.message",reviewCart:"Checkout.OutOfStock.actions.reviewCart",removeOutOfStock:"Checkout.OutOfStock.actions.removeOutOfStock"});return n(k,{className:O(["checkout-out-of-stock",i]),"data-testid":"checkout-out-of-stock",variant:"secondary",...m,children:[n("h4",{className:"checkout-out-of-stock__title",children:[e(l,{source:d,size:"16",stroke:"1"}),s.title]}),e("p",{className:"checkout-out-of-stock__message",children:s.message}),e("ol",{className:"checkout-out-of-stock__items",children:r.map(u=>e("li",{"data-testid":"out-of-stock-item",className:"checkout-out-of-stock__item",children:e(h,{loading:"eager",src:u.image.src,alt:u.image.alt,width:"100",height:"100",params:{width:100}})},u.sku))}),n("div",{className:"checkout-out-of-stock__actions",children:[a&&e("a",{"data-testid":"review-cart",className:"checkout-out-of-stock__action",href:a,children:s.reviewCart}),o&&e("button",{className:"checkout-out-of-stock__action","data-testid":"remove-out-of-stock",type:"button",onClick:o,children:s.removeOutOfStock})]})]})},z=({onCartProductsUpdate:i,routeCart:r})=>{const[o,a]=v([]),m=t=>t.outOfStock||t.insufficientQuantity,s=_(()=>{if(!i)return;const t=o.filter(c=>c.outOfStock).map(c=>({uid:c.uid,quantity:0}));i(t)},[o,i]);if(g(()=>{const t=p.on("cart/data",c=>{const f=(c==null?void 0:c.items)||[];a(f.filter(m))},{eager:!0});return()=>{t==null||t.off()}},[]),o.length===0)return null;const u=!o.some(t=>t.insufficientQuantity);return e(N,{items:o,onRemoveOutOfStock:u?s:void 0,routeCart:r==null?void 0:r()})};export{z as OutOfStock,z as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as k,Fragment as z}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{q as b}from"../chunks/fixtures.js";import{s as R}from"../chunks/setPaymentMethod.js";import{H as U}from"../chunks/ShippingMethods.js";import"@dropins/tools/preact-hooks.js";import{classes as C,Slot as x}from"@dropins/tools/lib.js";import{IllustratedMessage as $,Icon as q,ProgressSpinner as B,ToggleButton as O,Skeleton as Z,SkeletonRow as y}from"@dropins/tools/components.js";/* empty css *//* empty css */import*as f from"@dropins/tools/preact-compat.js";import{useState as g,useCallback as _,useEffect as P}from"@dropins/tools/preact-compat.js";import{useText as F}from"@dropins/tools/i18n.js";import{w as G}from"../chunks/withConditionalRendering.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";import"../chunks/transform-shipping-methods.js";import"../chunks/getMultilineValues.js";const J=e=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.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"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),K=({code:e,isLoading:n,isSelected:i,onChange:m,title:s})=>t(O,{className:"checkout-payment-methods__method",label:s,name:"payment-method",value:e,selected:i,onChange:m,busy:n}),Q=({className:e,paymentMethodContent:n,isLoading:i,onChange:m=()=>{},options:s,selection:d})=>{const u=F({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return s===void 0?t(X,{}):k("div",{className:C(["checkout-payment-methods",e]),children:[t(U,{level:2,className:"checkout-payment-methods__title",children:u.Title}),!i&&s.length===0&&t($,{icon:t(q,{source:J}),message:t("p",{children:u.EmptyState})}),k("div",{className:C(["checkout-payment-methods__wrapper"]),children:[i&&t(B,{className:"checkout-payment-methods__spinner"}),t("div",{className:C(["checkout-payment-methods__methods",["checkout-payment-methods--loading",i],["checkout-payment-methods--full-width",s.length%2!==0]]),children:s==null?void 0:s.map(l=>t(K,{code:l.code,onChange:m,isSelected:l.code===d,title:l.title},l.code))}),n&&t("div",{className:"checkout-payment-methods__content",children:n})]})]})},X=()=>k(Z,{"data-testid":"payment-methods-skeleton",children:[t(y,{variant:"heading",size:"medium"}),t(y,{variant:"empty",size:"medium"}),t(y,{size:"xlarge",fullWidth:!0}),t(y,{size:"xlarge",fullWidth:!0})]}),T={free:e=>{const n=document.createElement("div");n.innerText="",e.replaceHTML(n)},checkmo:e=>{const n=document.createElement("div");n.innerText="",e.replaceHTML(n)}};function Y({slots:e}){var E;const[n,i]=g(),[m,s]=g(),[d,u]=g(T),[l,V]=g(!0),{data:o}=b.value,N=(o==null?void 0:o.id)??"",v=!!o,H=!!((E=o==null?void 0:o.shippingAddresses)!=null&&E[0]),w=!((o==null?void 0:o.isVirtual)??!1),c=o==null?void 0:o.availablePaymentMethods,a=o==null?void 0:o.selectedPaymentMethod,p=_(async r=>{try{if(i(r),!H&&w||r===(a==null?void 0:a.code))return;await R(r)}catch(h){console.error("setting payment method failed:",h)}},[H,w,a]);P(()=>{v&&(a!=null&&a.code?(c==null?void 0:c.some(h=>h.code===a.code))?i(a.code):c!=null&&c.length?p(c[0].code):i(void 0):c[0]&&p(m||c[0].code))},[c,v,a,p,m]);const W=async r=>{await p(r),a!=null&&a.code||s(r)},S=_((r,h)=>{if(!r){console.warn("Payment method handler is ignored because it has no code");return}if(!h){console.warn("Payment method handler is ignored because it is empty");return}u(A=>({...A,[r]:h}))},[]);P(()=>{e!=null&&e.Handlers&&Object.entries(e.Handlers).forEach(([r,h])=>{S(r,h)})},[S,e==null?void 0:e.Handlers]);const I=e!=null&&e.Main?t(x,{name:"PaymentMethods",slot:e==null?void 0:e.Main,context:{replaceHTML(r){this.replaceWith(r),V(!1)}}}):null,M=n?d[n]:null,j=M?t(x,{name:"PaymentMethodContent",slot:M,context:{cartId:N,replaceHTML(r){this.replaceWith(r)}}},M):void 0;return P(()=>{!l&&d!=T&&console.warn("Payment method handlers you have added are ignored because the default content has been replaced")},[l,d]),{availablePaymentMethods:c,selectedPaymentMethod:n,onPaymentMethodChange:W,paymentMethodContent:j,mainSlotContent:I,isDefaultContentUsed:l}}const L=e=>{const{availablePaymentMethods:n,selectedPaymentMethod:i,onPaymentMethodChange:m,paymentMethodContent:s,mainSlotContent:d,isDefaultContentUsed:u}=Y(e);return k(z,{children:[d&&t(d.type,{ref:d.ref,...d.props}),u&&t(Q,{options:n,selection:i,onChange:m,paymentMethodContent:s,isLoading:b.value.pending})]})};L.displayName="PaymentMethodsContainer";const ke=G(L);export{ke as PaymentMethods,ke as default};
1
+ import{jsx as n,jsxs as M,Fragment as R}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{c as C}from"../chunks/store-config.js";import{s as D}from"../chunks/fetch-graphql.js";import{s as $}from"../chunks/setPaymentMethod.js";/* empty css */import{IllustratedMessage as B,Icon as U,ProgressSpinner as Z,ToggleButton as F,Skeleton as q,SkeletonRow as y}from"@dropins/tools/components.js";/* empty css */import{classes as H,Slot as L}from"@dropins/tools/lib.js";import{H as G}from"../chunks/Heading.js";import{useRef as J}from"@dropins/tools/preact-hooks.js";/* empty css */import*as g from"@dropins/tools/preact-compat.js";import{useState as S,useCallback as T,useEffect as w}from"@dropins/tools/preact-compat.js";import{useText as K}from"@dropins/tools/i18n.js";import{w as Q}from"../chunks/withConditionalRendering.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";const X=e=>g.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.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"}),g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Y=({code:e,loading:a,selected:r,onChange:d,title:h})=>n(F,{className:"checkout-payment-methods__method",label:h,name:"payment-method",value:e,selected:r,onChange:d,busy:a}),ee=({className:e,paymentMethodContent:a,loading:r=!1,initializing:d=!1,onChange:h=()=>{},options:s,selection:k})=>{const o=K({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return d?n(te,{}):M("div",{className:H(["checkout-payment-methods",e]),children:[n(G,{level:2,className:"checkout-payment-methods__title",children:o.Title}),!r&&s.length===0&&n(B,{icon:n(U,{source:X}),message:n("p",{children:o.EmptyState})}),M("div",{className:H(["checkout-payment-methods__wrapper"]),children:[r&&n(Z,{className:"checkout-payment-methods__spinner"}),n("div",{className:H(["checkout-payment-methods__methods",["checkout-payment-methods--loading",r],["checkout-payment-methods--full-width",s.length%2!==0]]),children:s==null?void 0:s.map(i=>n(Y,{code:i.code,onChange:h,selected:i.code===k,title:i.title},i.code))}),a&&n("div",{className:"checkout-payment-methods__content",children:a})]})]})},te=()=>M(q,{"data-testid":"payment-methods-skeleton",children:[n(y,{variant:"heading",size:"medium"}),n(y,{variant:"empty",size:"medium"}),n(y,{size:"xlarge",fullWidth:!0}),n(y,{size:"xlarge",fullWidth:!0})]}),N={free:e=>{const a=document.createElement("div");a.innerText="",e.replaceHTML(a)},checkmo:e=>{const a=document.createElement("div");a.innerText="",e.replaceHTML(a)}},ne=(e,a)=>{const r=J(e);return a(r.current,e)||(r.current=e),r.current},V=({slots:e})=>{var x,_;const[a,r]=S(),[d,h]=S(N),[s,k]=S(!0),o=C.value.data,i=!!C.value.data,W=C.value.pending,j=(o==null?void 0:o.isVirtual)??!1,z=(x=o==null?void 0:o.shippingAddresses)==null?void 0:x[0],A=(o==null?void 0:o.availablePaymentMethods)||[],l=(_=o==null?void 0:o.selectedPaymentMethod)==null?void 0:_.code,E=j?!0:!!z,m=ne(A,(t,c)=>t.length!==c.length?!1:t.every((p,v)=>p.code===c[v].code)),u=T(t=>{r(t),!(!t||!E)&&t!==l&&$(t).catch(console.error)},[E,l]);w(()=>{if(!i)return;if(!!!(m!=null&&m.length)){u(void 0);return}const c=m[0].code;if(!l){u(c);return}const p=m.some(v=>v.code===l);u(p?l:c)},[m,i,l,u]);const I=t=>{u(t)},b=T((t,c)=>{if(!t){console.warn("Payment method handler is ignored because it has no code");return}if(!c){console.warn("Payment method handler is ignored because it is empty");return}h(p=>({...p,[t]:c}))},[]);w(()=>{e!=null&&e.Handlers&&Object.entries(e.Handlers).forEach(([t,c])=>{b(t,c)})},[b,e==null?void 0:e.Handlers]);const f=e!=null&&e.Main?n(L,{name:"PaymentMethods",slot:e==null?void 0:e.Main,context:{replaceHTML(t){this.replaceWith(t),k(!1)}}}):null,P=a?d[a]:null,O=P?n(L,{name:"PaymentMethodContent",slot:P,context:{cartId:D.cartId||"",replaceHTML(t){this.replaceWith(t)}}},P):void 0;return w(()=>{!s&&d!=N&&console.warn("Payment method handlers you have added are ignored because the default content has been replaced")},[s,d]),M(R,{children:[f&&n(f.type,{ref:f.ref,...f.props}),s&&n(ee,{initializing:i===!1,loading:i&&W,onChange:I,options:m,paymentMethodContent:O,selection:a})]})};V.displayName="PaymentMethodsContainer";const ve=Q(V);export{ve as PaymentMethods,ve as default};
@@ -1,11 +1,7 @@
1
1
  import { HTMLAttributes } from 'preact/compat';
2
2
 
3
- export declare enum CheckoutForms {
4
- BILLING = "billing_address",
5
- LOGIN = "login-form",
6
- SHIPPING = "shipping_address"
7
- }
8
3
  export interface PlaceOrderProps extends HTMLAttributes<HTMLDivElement> {
4
+ handleValidation?: () => boolean;
9
5
  onPlaceOrder?: (ctx: PlaceOrderContext) => Promise<void>;
10
6
  }
11
7
  export interface PlaceOrderContext {
@@ -1 +1 @@
1
- import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import{events as O}from"@dropins/tools/event-bus.js";import{U as k,q as E,n as b}from"../chunks/fixtures.js";import{p as x}from"../chunks/placeOrder.js";import{classes as f}from"@dropins/tools/lib.js";/* empty css */import{Button as S}from"@dropins/tools/components.js";import{Text as C,useText as I}from"@dropins/tools/i18n.js";import{w as P}from"../chunks/withConditionalRendering.js";import{useState as w,useCallback as p,useEffect as U}from"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const F=e=>e instanceof TypeError||e instanceof k,L=e=>{e.scrollIntoView({behavior:"smooth"}),e.focus()},N=e=>(Array.from(document.forms)||[]).filter(t=>e.includes(t.name)).filter(t=>t.offsetParent!==null).filter(t=>!t.checkValidity()),T=({className:e,onClick:s,disabled:t=!1})=>c("div",{className:f(["checkout-place-order",e]),children:c(S,{className:f(["checkout-place-order__button",e]),"data-testid":"place-order-button",disabled:t,onClick:s,size:"medium",type:"submit",variant:"primary",children:c(C,{id:"Checkout.PlaceOrder.button"})},"placeOrder")});var h=(e=>(e.BILLING="billing_address",e.LOGIN="login-form",e.SHIPPING="shipping_address",e))(h||{});const _=({onPlaceOrder:e})=>{var m;const[s,t]=w(!1),{data:n,pending:v}=E.value,g=!!n,a=((m=n==null?void 0:n.selectedPaymentMethod)==null?void 0:m.code)||"",l=I({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),d=p(r=>{const o=F(r)?l.CheckoutUnexpectedError:r.message;b.value=o},[l]),y=p(async()=>{const r=N(Object.values(h));if(r.length>0){const i=r[0].querySelector(":invalid");i&&L(i)}else try{e?await e({code:a}):await x()}catch(o){d(o)}},[e,a,d]);return U(()=>{const r=O.on("cart/initialized",o=>{const i=(o==null?void 0:o.items)||[];t(i.some(u=>u.outOfStock||u.insufficientQuantity))},{eager:!0});return()=>{r==null||r.off()}},[]),c(T,{onClick:y,disabled:!g||v||s})},D=P(_);export{h as CheckoutForms,D as PlaceOrder,D as default};
1
+ import{jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{events as x}from"@dropins/tools/event-bus.js";import{c as E,b as g}from"../chunks/store-config.js";import{U as P}from"../chunks/fetch-graphql.js";import{p as b}from"../chunks/placeOrder2.js";import{classes as l}from"@dropins/tools/lib.js";/* empty css */import{Button as v}from"@dropins/tools/components.js";import{Text as S,useText as U}from"@dropins/tools/i18n.js";import{w}from"../chunks/withConditionalRendering.js";import{useState as T,useCallback as p,useEffect as z}from"@dropins/tools/preact-compat.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const H=({className:e,onClick:t,disabled:n=!1})=>s("div",{className:l(["checkout-place-order",e]),children:s(v,{className:l(["checkout-place-order__button",e]),"data-testid":"place-order-button",disabled:n,onClick:t,size:"medium",type:"submit",variant:"primary",children:s(S,{id:"Checkout.PlaceOrder.button"})},"placeOrder")}),I=e=>e instanceof TypeError||e instanceof P,f=({handleValidation:e,onPlaceOrder:t})=>{var d;const[n,h]=T(!1),{data:c,pending:O}=E.value,k=!!c,a=((d=c==null?void 0:c.selectedPaymentMethod)==null?void 0:d.code)||"",i=U({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),m=p(r=>{const o=I(r)?i.CheckoutUnexpectedError:r.message;g.value=o},[i]),C=p(async()=>{try{if(!(e?e():!0))return;t?await t({code:a}):await b()}catch(r){m(r)}},[e,t,a,m]);return z(()=>{const r=x.on("cart/initialized",o=>{const y=(o==null?void 0:o.items)||[];h(y.some(u=>u.outOfStock||u.insufficientQuantity))},{eager:!0});return()=>{r==null||r.off()}},[]),s(H,{onClick:C,disabled:!k||O||n})};f.displayName="PlaceOrderContainer";const G=w(f);export{G as PlaceOrder,G as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{n as i}from"../chunks/fixtures.js";import{a as u}from"../chunks/getCustomer.js";import"../chunks/ShippingMethods.js";import{useEffect as p}from"@dropins/tools/preact-hooks.js";import{classes as s}from"@dropins/tools/lib.js";import{IllustratedMessage as l,Icon as d,Button as h}from"@dropins/tools/components.js";/* empty css *//* empty css */import{S as v}from"../chunks/OrderError.js";import{useText as k}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";import"../chunks/transform-shipping-methods.js";import"../chunks/getMultilineValues.js";import"@dropins/tools/preact-compat.js";const f=({className:r,errorMessage:e,contactSupport:a,...c})=>{const{onClick:m}=c,o=k({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return t(l,{"aria-invalid":"true","aria-describedby":"checkout-server-error__message","aria-live":"polite",className:s(["checkout-server-error",r]),"data-testid":"checkout-server-error",heading:e??o.Title,message:n("p",{id:s(["checkout-server-error__message"]),children:[o.Message,t("br",{}),t("span",{children:a??o.ContactSupport})]}),icon:t(d,{className:s(["checkout-server-error__icon"]),source:v}),action:t(h,{className:s(["checkout-server-error__button"]),onClick:m,children:o.Button})})},$=({onServerError:r})=>{const e=i.value,a=async()=>{i.value=void 0,await u()};return p(()=>{e&&(r==null||r())},[e,r]),e?t(f,{errorMessage:e,onClick:a}):null};export{$ as ServerError,$ as default};
1
+ import{jsx as t,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{b as i}from"../chunks/store-config.js";import"../chunks/fetch-graphql.js";import{g as u}from"../chunks/getCustomer.js";/* empty css */import{IllustratedMessage as p,Icon as l,Button as d}from"@dropins/tools/components.js";/* empty css */import{classes as s}from"@dropins/tools/lib.js";import{useEffect as h}from"@dropins/tools/preact-hooks.js";/* empty css */import{S as v}from"../chunks/OrderError.js";import{useText as k}from"@dropins/tools/i18n.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";import"@dropins/tools/preact-compat.js";const f=({className:r,errorMessage:e,contactSupport:a,...c})=>{const{onClick:m}=c,o=k({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return t(p,{"aria-invalid":"true","aria-describedby":"checkout-server-error__message","aria-live":"polite",className:s(["checkout-server-error",r]),"data-testid":"checkout-server-error",heading:e??o.Title,message:n("p",{id:s(["checkout-server-error__message"]),children:[o.Message,t("br",{}),t("span",{children:a??o.ContactSupport})]}),icon:t(l,{className:s(["checkout-server-error__icon"]),source:v}),action:t(d,{className:s(["checkout-server-error__button"]),onClick:m,children:o.Button})})},O=({onServerError:r})=>{const e=i.value,a=async()=>{await u(),i.value=void 0};return h(()=>{e&&(r==null||r())},[e,r]),e?t(f,{errorMessage:e,onClick:a}):null};export{O as ServerError,O as default};
@@ -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
  declare function useShippingEstimateEventEmitter(): void;
18
18
  export default useShippingEstimateEventEmitter;
19
19
  //# sourceMappingURL=useShippingEstimateEventEmitter.d.ts.map
@@ -1 +1 @@
1
- import{jsx as o,jsxs as S,Fragment as B}from"@dropins/tools/preact-jsx-runtime.js";import{e as P}from"../chunks/getMultilineValues.js";import{events as I}from"@dropins/tools/event-bus.js";import{v as C,w as y,q as N,t as q,x as Z}from"../chunks/fixtures.js";import{s as $}from"../chunks/setShippingMethods.js";import{H as F}from"../chunks/ShippingMethods.js";import{useState as R,useEffect as j}from"@dropins/tools/preact-hooks.js";import{classes as w,Slot as G}from"@dropins/tools/lib.js";import{IllustratedMessage as J,Icon as K,ProgressSpinner as Q,RadioButton as X,Price as Y,Skeleton as D,SkeletonRow as H}from"@dropins/tools/components.js";/* empty css *//* empty css */import*as d from"@dropins/tools/preact-compat.js";import{useCallback as U,useMemo as ee,useEffect as z}from"@dropins/tools/preact-compat.js";import{useText as te}from"@dropins/tools/i18n.js";import{w as ne}from"../chunks/withConditionalRendering.js";import"../chunks/transform-shipping-methods.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";const oe=e=>({countryCode:e.country_id,postCode:e.postcode||"",...e.region_id?{regionId:Number(e.region_id)}:{...e.region?{region:e.region}:{}}}),ie=e=>({carrierCode:e.carrier.code||"",methodCode:e.code||"",amount:e.amount,amountExclTax:e.amountExclTax,amountInclTax:e.amountInclTax}),re=e=>d.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),d.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),se=({className:e,isLoading:t=!1,onSelectionChange:i=()=>{},options:r,selection:c,...s})=>{const u=te({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return r===void 0?o(ce,{}):S("div",{...s,className:w(["checkout-shipping-methods",e]),children:[o(F,{level:3,className:"checkout-shipping-methods__title",children:u.Title}),!t&&r.length===0&&o(J,{icon:o(K,{source:re}),message:o("p",{children:u.EmptyState})}),S("div",{className:w(["checkout-shipping-methods__content"]),children:[t&&o(Q,{className:"checkout-shipping-methods__spinner"}),o("div",{className:w(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:r.map(n=>o(X,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:n.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:S(B,{children:[o(Y,{amount:n.amount.value,currency:n.amount.currency})," ",o("span",{children:n.carrier.title})]}),description:n.title,value:n.value,checked:(c==null?void 0:c.value)===n.value,onChange:()=>i(n)},n.value))})]})]})},ce=()=>S(D,{"data-testid":"shipping-methods-skeleton",children:[o(H,{variant:"heading",size:"small"}),o(H,{variant:"empty",size:"small"}),o(H,{size:"medium",fullWidth:!0}),o(H,{size:"medium",fullWidth:!0})]});function ae(){var a;const[e,t]=R(),[i,r]=R();j(()=>{I.on("checkout/address",({address:M,type:L,isValid:g})=>{L==="shipping"&&t({address:M,isValid:g})})},[]),j(()=>{r(C.value)},[C.value]),j(()=>{y.value.pending?r(void 0):r(C.value)},[y.value.pending]);const{country_id:c,region_id:s,region:u,postcode:n}=(e==null?void 0:e.address)||{},k=!!e,p=N.value.data,E=!!((a=p==null?void 0:p.shippingAddresses)!=null&&a[0]),v=e==null?void 0:e.isValid;j(()=>{E||v||!i||!k||I.emit("shipping/estimate",{address:oe({country_id:c,region_id:s,region:u,postcode:n}),shippingMethod:ie(i)})},[i,c,s,u,n,k,E,v])}const b=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code;function le({onCheckoutDataUpdate:e,preSelectedMethod:t,onShippingMethodSelect:i}){const r=q.value.data,c=!r,s=N.value.data,u=N.value.pending,n=y.value.data,k=y.value.pending,p=C.value,E=s==null?void 0:s.id,v=s==null?void 0:s.shippingAddresses,a=v==null?void 0:v[0],M=!!a,L=a==null?void 0:a.availableShippingMethods,g=a==null?void 0:a.selectedShippingMethod,h=L||n,T=U(l=>{if(!M)return;const f={method_code:l.code,carrier_code:l.carrier.code};$([f]).then(()=>{e==null||e()}).catch(x=>{console.error("setting shipping methods on cart failed:",x)})},[M,e]),A=l=>{C.value=l,i==null||i(l)},m=ee(()=>{if(!(h!=null&&h.length))return;const l=h[0],f=p||g;return f?h.some(_=>b(_,f))?f:l:h.find(W=>W.carrier.code===(t==null?void 0:t.carrierCode)&&W.code===(t==null?void 0:t.methodCode))||l},[p,g,h,t]);return z(()=>{m&&((!p||!b(m,p))&&(C.value=m,i==null||i(m)),(!g||!b(m,g))&&T(m))},[m,p,g,T,i]),z(()=>{if(!E||L)return;const{country:l,selectedRegion:f,selectedRegionId:x}=Z.value,_=l||(r==null?void 0:r.defaultCountry);_&&P({criteria:{country_code:_,region_name:f,region_id:x}}).catch(O=>{y.value={pending:!1,data:[]},console.error("shipping methods estimation failed:",O)})},[E,L,r]),{isLoading:u||c||k,options:h,selection:m,onSelectionChange:A}}const V=({preSelectedMethod:e,onCheckoutDataUpdate:t,shippingMethodsSlot:i,onShippingMethodSelect:r,...c})=>{const{isLoading:s,options:u,selection:n,onSelectionChange:k}=le({preSelectedMethod:e,onCheckoutDataUpdate:t,onShippingMethodSelect:r});return ae(),S(B,{children:[o(se,{...c,className:"checkout-shipping-methods",isLoading:s,onSelectionChange:k,options:u,selection:n}),!s&&o(G,{name:"ShippingMethods",slot:i})]})};V.displayName="ShippingMethodsContainer";const He=ne(V);export{He as ShippingMethods,He as default};
1
+ import{jsx as i,jsxs as L,Fragment as z}from"@dropins/tools/preact-jsx-runtime.js";import{events as T}from"@dropins/tools/event-bus.js";import{s as v,e as M,c as W,a as V}from"../chunks/store-config.js";import"../chunks/fetch-graphql.js";import{s as A}from"../chunks/setShippingMethods.js";/* empty css */import{IllustratedMessage as O,Icon as P,ProgressSpinner as Z,RadioButton as $,Price as q,Skeleton as F,SkeletonRow as _}from"@dropins/tools/components.js";/* empty css */import{classes as j,Slot as G}from"@dropins/tools/lib.js";import{H as J}from"../chunks/Heading.js";import{useState as I,useEffect as S}from"@dropins/tools/preact-hooks.js";/* empty css */import*as u from"@dropins/tools/preact-compat.js";import{useCallback as K,useMemo as Q,useEffect as X}from"@dropins/tools/preact-compat.js";import{useText as Y}from"@dropins/tools/i18n.js";import{w as D}from"../chunks/withConditionalRendering.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getCart.graphql.js";const U=e=>({countryCode:e.country_id,postCode:e.postcode||"",...e.region_id?{regionId:Number(e.region_id)}:{...e.region?{region:e.region}:{}}}),ee=e=>({carrierCode:e.carrier.code||"",methodCode:e.code||"",amount:e.amount,amountExclTax:e.amountExclTax,amountInclTax:e.amountInclTax}),te=e=>u.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.47266 4.90002H15.1851V10.9645H21.2495L23 12.715V17.6124H20.073",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76151 16.7898C9.76151 18.0525 8.72845 19.076 7.46582 19.076C6.20318 19.076 5.17969 18.0429 5.17969 16.7803C5.17969 15.5176 6.20318 14.4941 7.46582 14.4941C8.72845 14.4941 9.75195 15.5176 9.76151 16.7803C9.76151 16.7803 9.76151 16.7803 9.76151 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8726 16.7898C19.8726 18.062 18.8491 19.0855 17.5769 19.0855C16.3047 19.0855 15.2812 18.062 15.2812 16.7898C15.2812 15.5176 16.3047 14.4941 17.5769 14.4941C18.8491 14.4941 19.8726 15.5176 19.8726 16.7898Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),u.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),ne=({className:e,isLoading:t=!1,onSelectionChange:n=()=>{},options:s,selection:p,...a})=>{const c=Y({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return s===void 0?i(oe,{}):L("div",{...a,className:j(["checkout-shipping-methods",e]),children:[i(J,{level:3,className:"checkout-shipping-methods__title",children:c.Title}),!t&&s.length===0&&i(O,{icon:i(P,{source:te}),message:i("p",{children:c.EmptyState})}),L("div",{className:j(["checkout-shipping-methods__content"]),children:[t&&i(Z,{className:"checkout-shipping-methods__spinner"}),i("div",{className:j(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:s.map(o=>i($,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:o.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:L(z,{children:[i(q,{amount:o.amount.value,currency:o.amount.currency})," ",i("span",{children:o.carrier.title})]}),description:o.title,value:o.value,checked:(p==null?void 0:p.value)===o.value,onChange:()=>n(o)},o.value))})]})]})},oe=()=>L(F,{"data-testid":"shipping-methods-skeleton",children:[i(_,{variant:"heading",size:"small"}),i(_,{variant:"empty",size:"small"}),i(_,{size:"medium",fullWidth:!0}),i(_,{size:"medium",fullWidth:!0})]});function ie(){var C;const[e,t]=I(),[n,s]=I();S(()=>{T.on("checkout/estimate-shipping-address",({address:x,isValid:g})=>{t({address:x,isValid:g})})},[]),S(()=>{s(v.value)},[v.value]),S(()=>{M.value.pending?s(void 0):s(v.value)},[M.value.pending]);const{country_id:p,region_id:a,region:c,postcode:o}=(e==null?void 0:e.address)||{},f=!!e,r=W.value.data,k=!!((C=r==null?void 0:r.shippingAddresses)!=null&&C[0]),l=e==null?void 0:e.isValid;S(()=>{k||l||!n||!f||T.emit("shipping/estimate",{address:U({country_id:p,region_id:a,region:c,postcode:o}),shippingMethod:ee(n)})},[n,p,a,c,o,f,k,l])}const H=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code;function re({onCheckoutDataUpdate:e,preSelectedMethod:t,onShippingMethodSelect:n}){const p=!V.value.data,a=W.value.data,c=W.value.pending,o=M.value.data,f=M.value.pending,r=v.value,k=a==null?void 0:a.shippingAddresses,l=k==null?void 0:k[0],C=!!l,x=l==null?void 0:l.availableShippingMethods,g=l==null?void 0:l.selectedShippingMethod,d=x||o,y=K(h=>{if(!C)return;const E={method_code:h.code,carrier_code:h.carrier.code};A([E]).then(()=>{e==null||e()}).catch(b=>{console.error("setting shipping methods on cart failed:",b)})},[C,e]),R=h=>{v.value=h,n==null||n(h)},m=Q(()=>{if(!(d!=null&&d.length))return;const h=d[0],E=r||g;return E?d.some(w=>H(w,E))?E:h:d.find(N=>N.carrier.code===(t==null?void 0:t.carrierCode)&&N.code===(t==null?void 0:t.methodCode))||h},[r,g,d,t]);return X(()=>{m&&((!r||!H(m,r))&&(v.value=m,n==null||n(m)),(!g||!H(m,g))&&y(m))},[m,r,g,y,n]),{isLoading:c||p||f,options:d,selection:m,onSelectionChange:R}}const B=({preSelectedMethod:e,onCheckoutDataUpdate:t,shippingMethodsSlot:n,onShippingMethodSelect:s,initialData:p,...a})=>{const{isLoading:c,options:o,selection:f,onSelectionChange:r}=re({preSelectedMethod:e,onCheckoutDataUpdate:t,onShippingMethodSelect:s});return ie(),L(z,{children:[i(ne,{...a,isLoading:c,onSelectionChange:r,options:o,selection:f}),!c&&n&&i(G,{name:"ShippingMethods",slot:n})]})};B.displayName="ShippingMethodsContainer";const Me=D(B);export{Me as ShippingMethods,Me as default};
@@ -14,7 +14,6 @@
14
14
  * is strictly forbidden unless prior written permission is obtained
15
15
  * from Adobe.
16
16
  *******************************************************************/
17
- export * from './BillingForm';
18
17
  export * from './BillToShippingAddress';
19
18
  export * from './ErrorBanner';
20
19
  export * from './EstimateShipping';
@@ -24,6 +23,5 @@ export * from './OutOfStock';
24
23
  export * from './PaymentMethods';
25
24
  export * from './PlaceOrder';
26
25
  export * from './ServerError';
27
- export * from './ShippingForm';
28
26
  export * from './ShippingMethods';
29
27
  //# sourceMappingURL=index.d.ts.map
@@ -1,21 +1,17 @@
1
- import { Region, Country, ShippingMethod, CustomAttribute } from '.';
1
+ import { Region, Country, CustomAttribute } from '.';
2
2
 
3
- export type Address = {
3
+ export interface Address {
4
+ id?: number;
5
+ city: string;
6
+ company?: string;
7
+ country: Country;
8
+ customAttributes: CustomAttribute[];
4
9
  firstName: string;
5
10
  lastName: string;
6
- company?: string;
7
- street: string[];
8
- city: string;
9
11
  postCode?: string;
10
- vatId?: string;
11
- telephone?: string;
12
12
  region?: Region;
13
- country: Country;
14
- customAttributes: CustomAttribute[];
15
- };
16
- export type ShippingAddress = Address & {
17
- availableShippingMethods?: ShippingMethod[];
18
- selectedShippingMethod?: ShippingMethod;
19
- };
20
- export type BillingAddress = Address;
13
+ street: string[];
14
+ telephone?: string;
15
+ vatId?: string;
16
+ }
21
17
  //# sourceMappingURL=address.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { CustomAttribute } from './custom-attribute';
2
+
3
+ export interface CartAddress {
4
+ city: string;
5
+ company?: string;
6
+ countryCode: string;
7
+ customAttributes: CustomAttribute[];
8
+ firstName: string;
9
+ lastName: string;
10
+ postcode?: string;
11
+ region?: string;
12
+ regionId?: number;
13
+ saveInAddressBook?: boolean;
14
+ street: string[];
15
+ telephone?: string;
16
+ vatId?: string;
17
+ }
18
+ export interface ShippingAddressInput {
19
+ address?: CartAddress;
20
+ customerAddressId?: number;
21
+ pickupLocationCode?: string;
22
+ }
23
+ export interface BillingAddressInput {
24
+ address?: CartAddress;
25
+ customerAddressId?: number;
26
+ sameAsShipping?: boolean;
27
+ useForShipping?: boolean;
28
+ }
29
+ //# sourceMappingURL=api.d.ts.map
@@ -1,14 +1,18 @@
1
- import { PaymentMethod } from './payment-method';
2
- import { ShippingAddress, BillingAddress } from './address';
1
+ import { Address, PaymentMethod, ShippingMethod } from '.';
3
2
 
4
- export type Cart = {
3
+ export interface ShippingAddress extends Address {
4
+ availableShippingMethods?: ShippingMethod[];
5
+ selectedShippingMethod?: ShippingMethod;
6
+ sameAsBilling?: boolean;
7
+ }
8
+ export interface Cart {
5
9
  availablePaymentMethods?: PaymentMethod[];
6
- billingAddress?: BillingAddress;
10
+ billingAddress?: Address;
7
11
  email?: string;
8
12
  id: string;
9
13
  isEmpty: boolean;
10
14
  isVirtual: boolean;
11
15
  selectedPaymentMethod?: PaymentMethod;
12
16
  shippingAddresses?: ShippingAddress[];
13
- };
17
+ }
14
18
  //# sourceMappingURL=cart.d.ts.map
@@ -1,19 +1,8 @@
1
- import { Region, Country, CustomAttribute } from '.';
1
+ import { Address } from '.';
2
2
 
3
- export type CustomerAddress = {
3
+ export interface CustomerAddress extends Address {
4
4
  id: string;
5
- firstName: string;
6
- lastName: string;
7
- company?: string;
8
- street: string[];
9
- city: string;
10
- postCode?: string;
11
- vatId?: string;
12
- telephone?: string;
13
- region?: Region;
14
- country: Country;
15
- customAttributes: CustomAttribute[];
16
- };
5
+ }
17
6
  export type Customer = {
18
7
  firstName: string;
19
8
  lastName: string;
@@ -1,30 +1,32 @@
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 * from './acdl';
18
- export * from './address-form-fields';
18
+ export * from './address';
19
+ export * from './api';
19
20
  export * from './cart';
20
21
  export * from './country';
21
22
  export * from './custom-attribute';
22
23
  export * from './customer';
23
24
  export * from './email-availability';
25
+ export * from './order';
26
+ export * from './payment-method';
24
27
  export * from './price';
25
28
  export * from './region';
26
29
  export * from './shipping-estimate';
27
30
  export * from './shipping-method';
28
31
  export * from './store-config';
29
- export * from './order';
30
32
  //# sourceMappingURL=index.d.ts.map
@@ -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 type Region = {
18
18
  code: string;
19
19
  id?: number;
@@ -21,9 +21,6 @@ export declare enum TaxDisplay {
21
21
  }
22
22
  export interface StoreConfig {
23
23
  defaultCountry: string;
24
- countriesWithRequiredRegion: string[];
25
- displayStateIfOptional: boolean;
26
- countriesWithOptionalZipCode: string[];
27
24
  isGuestCheckoutEnabled: boolean;
28
25
  isOnePageCheckoutEnabled: boolean;
29
26
  shoppingCartDisplaySetting: {
@@ -1,27 +1,25 @@
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 * from './transform-acdl';
18
- export * from './transform-address-form-fields';
18
+ export * from './transform-address';
19
19
  export * from './transform-cart';
20
- export * from './transform-countries';
21
20
  export * from './transform-customer';
22
21
  export * from './transform-email-availability';
23
22
  export * from './transform-order';
24
- export * from './transform-regions';
25
23
  export * from './transform-shipping-estimate';
26
24
  export * from './transform-shipping-methods';
27
25
  export * from './transform-store-config';
@@ -1,6 +1,5 @@
1
- import { GetCartQuery } from '../../__generated__/types';
2
- import { ShippingAddress as ShippingAddressModel, BillingAddress as BillingAddressModel } from '../models/address';
3
- import { CustomAttribute as CustomAttributeModel } from '../models';
1
+ import { CartAddressInput, GetCartQuery } from '../../__generated__/types';
2
+ import { Address as AddressModel, CustomAttribute as CustomAttributeModel, ShippingAddress as ShippingAddressModel, CartAddress as CartAddressModel } from '../models';
4
3
 
5
4
  type ShippingAddresses = NonNullable<GetCartQuery['cart']>['shipping_addresses'];
6
5
  type ShippingAddress = ShippingAddresses[0];
@@ -9,9 +8,10 @@ type BillingAddress = NonNullable<GetCartQuery['cart']>['billing_address'];
9
8
  type NonNullableBillingAddress = NonNullable<BillingAddress>;
10
9
  type CustomAttributes = NonNullableShippingAddress['custom_attributes'] | NonNullableBillingAddress['custom_attributes'];
11
10
  export declare const transformCustomAttributes: (data: CustomAttributes) => CustomAttributeModel[];
12
- declare const transformBillingAddress: (data: BillingAddress) => BillingAddressModel | undefined;
11
+ declare const transformBillingAddress: (data: BillingAddress) => AddressModel | undefined;
13
12
  declare const transformShippingAddresses: (data: ({
14
13
  __typename?: "ShippingCartAddress" | undefined;
14
+ id?: number | null | undefined;
15
15
  firstname: string;
16
16
  lastname: string;
17
17
  company?: string | null | undefined;
@@ -20,6 +20,7 @@ declare const transformShippingAddresses: (data: ({
20
20
  postcode?: string | null | undefined;
21
21
  vat_id?: string | null | undefined;
22
22
  telephone?: string | null | undefined;
23
+ same_as_billing: boolean;
23
24
  region?: {
24
25
  __typename?: "CartAddressRegion" | undefined;
25
26
  region_id?: number | null | undefined;
@@ -85,5 +86,6 @@ declare const transformShippingAddresses: (data: ({
85
86
  };
86
87
  } | null | undefined;
87
88
  } | null)[]) => ShippingAddressModel[] | undefined;
88
- export { ShippingAddress, BillingAddress, transformBillingAddress, transformShippingAddresses, };
89
+ declare const transformCartAddressModelToInput: (address: CartAddressModel) => CartAddressInput;
90
+ export { BillingAddress, ShippingAddress, transformCartAddressModelToInput, transformBillingAddress, transformShippingAddresses, };
89
91
  //# sourceMappingURL=transform-address.d.ts.map
package/hocs/index.d.ts CHANGED
@@ -1,17 +1,18 @@
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
+ export * from './withConditionalRendering';
17
18
  //# sourceMappingURL=index.d.ts.map
package/hooks/index.d.ts CHANGED
@@ -1,20 +1,20 @@
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 * from './useBreakpoint';
18
18
  export * from './useLockScroll';
19
- export * from './useValidity';
19
+ export * from './useStableList';
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './useStableList';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const useStableList: <T>(list: T[], isEqual: (a: T[], b: T[]) => boolean) => T[];
2
+ //# sourceMappingURL=useStableList.d.ts.map