@dropins/storefront-checkout 1.1.0 → 1.3.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/getCheckoutAgreements/getCheckoutAgreements.d.ts +4 -0
- package/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts +18 -0
- package/api/getCheckoutAgreements/index.d.ts +18 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +1 -1
- package/api/index.d.ts +1 -0
- package/api.js +16 -4
- package/chunks/TermsAndConditions.js +4 -0
- package/chunks/checkout.js +3 -0
- package/chunks/setBillingAddress.js +1 -1
- package/chunks/setGuestEmailOnCart.js +3 -3
- package/chunks/setPaymentMethod.js +1 -1
- package/chunks/setShippingMethods.js +1 -1
- package/chunks/state.js +3 -0
- package/chunks/store-config.js +1 -1
- package/chunks/synchronizeCheckout.js +1 -1
- package/chunks/transform-store-config.js +3 -2
- package/chunks/withConditionalRendering.js +1 -1
- package/components/Markup/Markup.d.ts +8 -0
- package/components/Markup/index.d.ts +18 -0
- package/components/TermsAndConditions/TermsAndConditions.d.ts +10 -0
- package/components/TermsAndConditions/TermsAndConditionsSkeleton.d.ts +4 -0
- package/components/TermsAndConditions/index.d.ts +20 -0
- package/components/index.d.ts +2 -0
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner.js +1 -1
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +12 -5
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods.js +1 -1
- package/containers/TermsAndConditions/TermsAndConditions.d.ts +17 -0
- package/containers/TermsAndConditions/index.d.ts +19 -0
- package/containers/TermsAndConditions.d.ts +3 -0
- package/containers/TermsAndConditions.js +3 -0
- package/containers/index.d.ts +1 -1
- package/data/models/checkout.d.ts +34 -0
- package/data/models/index.d.ts +1 -0
- package/data/models/store-config.d.ts +16 -15
- package/data/transforms/index.d.ts +1 -0
- package/data/transforms/transform-checkout-agreements.d.ts +7 -0
- package/hooks/index.d.ts +0 -1
- package/i18n/en_US.json.d.ts +4 -3
- package/package.json +1 -1
- package/render.js +2 -2
- package/signals/EmailSignal.d.ts +26 -0
- package/signals/index.d.ts +1 -0
- package/containers/ErrorBanner/ErrorBanner.d.ts +0 -5
- package/containers/ErrorBanner/index.d.ts +0 -19
- package/containers/ErrorBanner.d.ts +0 -3
- package/containers/ErrorBanner.js +0 -3
- package/hooks/useLockScroll/index.d.ts +0 -18
- package/hooks/useLockScroll/useLockScroll.d.ts +0 -21
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
*******************************************************************/
|
|
17
|
+
export declare const GET_CHECKOUT_AGREEMENTS = "\n query GET_CHECKOUT_AGREEMENTS {\n checkoutAgreements {\n agreement_id\n checkbox_text\n content\n content_height\n is_html \n mode\n name\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=getCheckoutAgreements.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL:
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export * from './getCheckoutAgreements';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export declare const getStoreConfigQuery = "\n query getStoreConfig {\n storeConfig {\n default_country\n is_guest_checkout_enabled\n is_one_page_checkout_enabled\n shopping_cart_display_shipping\n }\n }\n";
|
|
17
|
+
export declare const getStoreConfigQuery = "\n query getStoreConfig {\n storeConfig {\n default_country\n is_checkout_agreements_enabled\n is_guest_checkout_enabled\n is_one_page_checkout_enabled\n shopping_cart_display_shipping\n }\n }\n";
|
|
18
18
|
//# sourceMappingURL=getStoreConfig.graphql.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './errors';
|
|
|
19
19
|
export * from './estimateShippingMethods';
|
|
20
20
|
export * from './fetch-graphql';
|
|
21
21
|
export * from './getCart';
|
|
22
|
+
export * from './getCheckoutAgreements';
|
|
22
23
|
export * from './getCustomer';
|
|
23
24
|
export * from './getStoreConfig';
|
|
24
25
|
export * from './initialize';
|
package/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{d as l,t as
|
|
3
|
+
import{d as l,t as I,a as T,b as M}from"./chunks/synchronizeCheckout.js";import{e as it,c as rt,g as nt,f as at,i as ot,h as dt,r as pt,s as ct}from"./chunks/synchronizeCheckout.js";import{M as A,a as y,b as O}from"./chunks/errors.js";import{F as gt,I as mt,e as ut,c as _t,d as lt,U as At}from"./chunks/errors.js";import{s as p}from"./chunks/state.js";import{g as ft}from"./chunks/state.js";import{s as x,g as G,i as _}from"./chunks/transform-store-config.js";import{D as Et,S as It,l as Tt,m as Mt,r as yt,h as Ot,j as xt,k as Gt}from"./chunks/transform-store-config.js";import"@dropins/tools/lib.js";import{a as N,t as v}from"./chunks/setShippingMethods.js";import{s as vt}from"./chunks/setShippingMethods.js";import{events as U}from"@dropins/tools/event-bus.js";import{A as $}from"./chunks/checkout.js";import{h as D}from"./chunks/setGuestEmailOnCart.js";import{i as $t,s as Dt}from"./chunks/setGuestEmailOnCart.js";import{s as Rt}from"./chunks/setBillingAddress.js";import{s as wt}from"./chunks/setPaymentMethod.js";import{CHECKOUT_DATA_FRAGMENT as S}from"./fragments.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/store-config.js";import"@dropins/tools/signals.js";const F=`
|
|
4
4
|
mutation estimateShippingMethods(
|
|
5
5
|
$cartId: String!
|
|
6
6
|
$address: EstimateAddressInput!
|
|
@@ -26,7 +26,19 @@ import{d as l,t as M,a as T,b as E}from"./chunks/synchronizeCheckout.js";import{
|
|
|
26
26
|
error_message
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
`,
|
|
29
|
+
`,R=e=>e?e.filter(t=>!!t).map(t=>({id:t.agreement_id,name:t.name,mode:$[t.mode],text:t.checkbox_text,content:{value:t.content,html:t.is_html,height:t.content_height??null}})):[],X=async e=>{var g,m,u;const t=p.cartId,{criteria:n}=e||{},{country_code:a,region_id:s,region_name:i,zip:o}=n||{},d=a||((g=p.config)==null?void 0:g.defaultCountry);if(!t)throw new A;if(!d)throw new y;const c=typeof s=="string"?parseInt(s,10):s,h=s||i?{...c&&{region_id:c},...i&&{region_code:i}}:void 0,r={country_code:d,...o&&{postcode:o},...h&&{region:h}},f={country_id:r.country_code,region:(m=r.region)==null?void 0:m.region_code,region_id:(u=r.region)==null?void 0:u.region_id,postcode:r.postcode},C=await l({type:"mutation",query:F,options:{variables:{cartId:t,address:r}},path:"estimateShippingMethods",signalType:"estimateShippingMethods",transformer:I});return setTimeout(()=>{const E={address:N(f),shippingMethod:v(x.value)};U.emit("shipping/estimate",E)},0),C},k=`
|
|
30
|
+
query GET_CHECKOUT_AGREEMENTS {
|
|
31
|
+
checkoutAgreements {
|
|
32
|
+
agreement_id
|
|
33
|
+
checkbox_text
|
|
34
|
+
content
|
|
35
|
+
content_height
|
|
36
|
+
is_html
|
|
37
|
+
mode
|
|
38
|
+
name
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`,Z=async()=>G(k,{method:"GET",cache:"no-cache"}).then(({errors:e,data:t})=>(e&&D(e),R(t.checkoutAgreements))),w=`
|
|
30
42
|
mutation SET_SHIPPING_ADDRESS_ON_CART_MUTATION(
|
|
31
43
|
$cartId: String!
|
|
32
44
|
$shippingAddressInput: ShippingAddressInput!
|
|
@@ -41,7 +53,7 @@ import{d as l,t as M,a as T,b as E}from"./chunks/synchronizeCheckout.js";import{
|
|
|
41
53
|
}
|
|
42
54
|
|
|
43
55
|
${S}
|
|
44
|
-
`,
|
|
56
|
+
`,H=`
|
|
45
57
|
mutation SET_SHIPPING_ADDRESS_ON_CART_AND_USE_AS_BILLING_MUTATION(
|
|
46
58
|
$cartId: String!
|
|
47
59
|
$shippingAddressInput: ShippingAddressInput!
|
|
@@ -64,4 +76,4 @@ import{d as l,t as M,a as T,b as E}from"./chunks/synchronizeCheckout.js";import{
|
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
${S}
|
|
67
|
-
`,
|
|
79
|
+
`,tt=async({address:e,customerAddressId:t,pickupLocationCode:n})=>{const a=p.cartId;if(!a)throw new A;const s=()=>{if(t)return{customer_address_id:t};if(n)return{pickup_location_code:n};if(!e)throw new O;return{address:T(e)}},i=_.value?H:w,o=_.value?"setBillingAddressOnCart.cart":"setShippingAddressesOnCart.cart",d={cartId:a,shippingAddressInput:s()};return await l({type:"mutation",query:i,options:{variables:d},path:o,queueName:"cartUpdate",signalType:"cart",transformer:M})};export{Et as DEFAULT_COUNTRY,gt as FetchError,mt as InvalidArgument,ut as MissingBillingAddress,A as MissingCart,y as MissingCountry,_t as MissingEmail,lt as MissingPaymentMethod,O as MissingShippinghAddress,It as STORE_CONFIG_DEFAULTS,At as UnexpectedError,it as authenticateCustomer,rt as config,X as estimateShippingMethods,G as fetchGraphQl,nt as getCart,Z as getCheckoutAgreements,Tt as getConfig,at as getCustomer,Mt as getStoreConfig,ft as getStoreConfigCache,ot as initialize,dt as initializeCheckout,$t as isEmailAvailable,yt as removeFetchGraphQlHeader,pt as resetCheckout,Rt as setBillingAddress,Ot as setEndpoint,xt as setFetchGraphQlHeader,Gt as setFetchGraphQlHeaders,Dt as setGuestEmailOnCart,wt as setPaymentMethod,tt as setShippingAddress,vt as setShippingMethodsOnCart,ct as synchronizeCheckout};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:dt,setPrototypeOf:at,isFrozen:Wt,getPrototypeOf:Bt,getOwnPropertyDescriptor:Yt}=Object;let{freeze:S,seal:O,create:Tt}=Object,{apply:Ce,construct:we}=typeof Reflect<"u"&&Reflect;S||(S=function(o){return o});O||(O=function(o){return o});Ce||(Ce=function(o,l,s){return o.apply(l,s)});we||(we=function(o,l){return new o(...l)});const se=R(Array.prototype.forEach),Xt=R(Array.prototype.lastIndexOf),rt=R(Array.prototype.pop),V=R(Array.prototype.push),jt=R(Array.prototype.splice),ce=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),st=R(String.prototype.match),$=R(String.prototype.replace),Vt=R(String.prototype.indexOf),$t=R(String.prototype.trim),L=R(Object.prototype.hasOwnProperty),A=R(RegExp.prototype.test),q=qt(TypeError);function R(r){return function(o){for(var l=arguments.length,s=new Array(l>1?l-1:0),T=1;T<l;T++)s[T-1]=arguments[T];return Ce(r,o,s)}}function qt(r){return function(){for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return we(r,l)}}function a(r,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ce;at&&at(r,null);let s=o.length;for(;s--;){let T=o[s];if(typeof T=="string"){const b=l(T);b!==T&&(Wt(o)||(o[s]=b),T=b)}r[T]=!0}return r}function Kt(r){for(let o=0;o<r.length;o++)L(r,o)||(r[o]=null);return r}function w(r){const o=Tt(null);for(const[l,s]of dt(r))L(r,l)&&(Array.isArray(s)?o[l]=Kt(s):s&&typeof s=="object"&&s.constructor===Object?o[l]=w(s):o[l]=s);return o}function K(r,o){for(;r!==null;){const s=Yt(r,o);if(s){if(s.get)return R(s.get);if(typeof s.value=="function")return R(s.value)}r=Bt(r)}function l(){return null}return l}const lt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),De=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),be=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Zt=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ie=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Jt=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ct=S(["#text"]),ft=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Me=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ut=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),le=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qt=O(/\{\{[\w\W]*|[\w\W]*\}\}/gm),en=O(/<%[\w\W]*|[\w\W]*%>/gm),tn=O(/\$\{[\w\W]*/gm),nn=O(/^data-[\-\w.\u00B7-\uFFFF]+$/),on=O(/^aria-[\-\w]+$/),_t=O(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),an=O(/^(?:\w+script|data):/i),rn=O(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Et=O(/^html$/i),sn=O(/^[a-z][.\w]*(-[.\w]+)+$/i);var mt=Object.freeze({__proto__:null,ARIA_ATTR:on,ATTR_WHITESPACE:rn,CUSTOM_ELEMENT:sn,DATA_ATTR:nn,DOCTYPE_NAME:Et,ERB_EXPR:en,IS_ALLOWED_URI:_t,IS_SCRIPT_OR_DATA:an,MUSTACHE_EXPR:Qt,TMPLIT_EXPR:tn});const Z={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ln=function(){return typeof window>"u"?null:window},cn=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let s=null;const T="data-tt-policy-suffix";l&&l.hasAttribute(T)&&(s=l.getAttribute(T));const b="dompurify"+(s?"#"+s:"");try{return o.createPolicy(b,{createHTML(x){return x},createScriptURL(x){return x}})}catch{return console.warn("TrustedTypes policy "+b+" could not be created."),null}},pt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gt(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ln();const o=i=>gt(i);if(o.version="3.2.4",o.removed=[],!r||!r.document||r.document.nodeType!==Z.document||!r.Element)return o.isSupported=!1,o;let{document:l}=r;const s=l,T=s.currentScript,{DocumentFragment:b,HTMLTemplateElement:x,Node:fe,Element:xe,NodeFilter:z,NamedNodeMap:ht=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:At,DOMParser:St,trustedTypes:J}=r,G=xe.prototype,Rt=K(G,"cloneNode"),yt=K(G,"remove"),Ot=K(G,"nextSibling"),Lt=K(G,"childNodes"),Q=K(G,"parentNode");if(typeof x=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let E,W="";const{implementation:ue,createNodeIterator:Nt,createDocumentFragment:Dt,getElementsByTagName:bt}=l,{importNode:It}=s;let g=pt();o.isSupported=typeof dt=="function"&&typeof Q=="function"&&ue&&ue.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:me,ERB_EXPR:pe,TMPLIT_EXPR:de,DATA_ATTR:Mt,ARIA_ATTR:Ct,IS_SCRIPT_OR_DATA:wt,ATTR_WHITESPACE:Pe,CUSTOM_ELEMENT:xt}=mt;let{IS_ALLOWED_URI:ve}=mt,u=null;const ke=a({},[...lt,...De,...be,...Ie,...ct]);let p=null;const Ue=a({},[...ft,...Me,...ut,...le]);let f=Object.seal(Tt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,Te=null,Fe=!0,_e=!0,He=!1,ze=!0,P=!1,Ee=!0,C=!1,ge=!1,he=!1,v=!1,ee=!1,te=!1,Ge=!0,We=!1;const Pt="user-content-";let Ae=!0,Y=!1,k={},U=null;const Be=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Xe=a({},["audio","video","img","source","image","track"]);let Se=null;const je=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ne="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xhtml";let F=I,Re=!1,ye=null;const vt=a({},[ne,oe,I],Ne);let ie=a({},["mi","mo","mn","ms","mtext"]),ae=a({},["annotation-xml"]);const kt=a({},["title","style","font","a","script"]);let X=null;const Ut=["application/xhtml+xml","text/html"],Ft="text/html";let m=null,H=null;const Ht=l.createElement("form"),Ve=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=w(e),X=Ut.indexOf(e.PARSER_MEDIA_TYPE)===-1?Ft:e.PARSER_MEDIA_TYPE,m=X==="application/xhtml+xml"?Ne:ce,u=L(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,m):ke,p=L(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,m):Ue,ye=L(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,Ne):vt,Se=L(e,"ADD_URI_SAFE_ATTR")?a(w(je),e.ADD_URI_SAFE_ATTR,m):je,Ye=L(e,"ADD_DATA_URI_TAGS")?a(w(Xe),e.ADD_DATA_URI_TAGS,m):Xe,U=L(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,m):Be,B=L(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,m):{},Te=L(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,m):{},k=L(e,"USE_PROFILES")?e.USE_PROFILES:!1,Fe=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,He=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,C=e.WHOLE_DOCUMENT||!1,v=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Ge=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ae=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,ve=e.ALLOWED_URI_REGEXP||_t,F=e.NAMESPACE||I,ie=e.MATHML_TEXT_INTEGRATION_POINTS||ie,ae=e.HTML_INTEGRATION_POINTS||ae,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),ee&&(v=!0),k&&(u=a({},ct),p=[],k.html===!0&&(a(u,lt),a(p,ft)),k.svg===!0&&(a(u,De),a(p,Me),a(p,le)),k.svgFilters===!0&&(a(u,be),a(p,Me),a(p,le)),k.mathMl===!0&&(a(u,Ie),a(p,ut),a(p,le))),e.ADD_TAGS&&(u===ke&&(u=w(u)),a(u,e.ADD_TAGS,m)),e.ADD_ATTR&&(p===Ue&&(p=w(p)),a(p,e.ADD_ATTR,m)),e.ADD_URI_SAFE_ATTR&&a(Se,e.ADD_URI_SAFE_ATTR,m),e.FORBID_CONTENTS&&(U===Be&&(U=w(U)),a(U,e.FORBID_CONTENTS,m)),Ae&&(u["#text"]=!0),C&&a(u,["html","head","body"]),u.table&&(a(u,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=e.TRUSTED_TYPES_POLICY,W=E.createHTML("")}else E===void 0&&(E=cn(J,T)),E!==null&&typeof W=="string"&&(W=E.createHTML(""));S&&S(e),H=e}},$e=a({},[...De,...be,...Zt]),qe=a({},[...Ie,...Jt]),zt=function(e){let t=Q(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const n=ce(e.tagName),c=ce(t.tagName);return ye[e.namespaceURI]?e.namespaceURI===oe?t.namespaceURI===I?n==="svg":t.namespaceURI===ne?n==="svg"&&(c==="annotation-xml"||ie[c]):!!$e[n]:e.namespaceURI===ne?t.namespaceURI===I?n==="math":t.namespaceURI===oe?n==="math"&&ae[c]:!!qe[n]:e.namespaceURI===I?t.namespaceURI===oe&&!ae[c]||t.namespaceURI===ne&&!ie[c]?!1:!qe[n]&&(kt[n]||!$e[n]):!!(X==="application/xhtml+xml"&&ye[e.namespaceURI]):!1},N=function(e){V(o.removed,{element:e});try{Q(e).removeChild(e)}catch{yt(e)}},re=function(e,t){try{V(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(v||ee)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},Ke=function(e){let t=null,n=null;if(he)e="<remove></remove>"+e;else{const d=st(e,/^[\r\n\t ]+/);n=d&&d[0]}X==="application/xhtml+xml"&&F===I&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=E?E.createHTML(e):e;if(F===I)try{t=new St().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=ue.createDocument(F,"template",null);try{t.documentElement.innerHTML=Re?W:c}catch{}}const _=t.body||t.documentElement;return e&&n&&_.insertBefore(l.createTextNode(n),_.childNodes[0]||null),F===I?bt.call(t,C?"html":"body")[0]:C?t.documentElement:_},Ze=function(e){return Nt.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof At&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof ht)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Je=function(e){return typeof fe=="function"&&e instanceof fe};function M(i,e,t){se(i,n=>{n.call(o,e,t,H)})}const Qe=function(e){let t=null;if(M(g.beforeSanitizeElements,e,null),Le(e))return N(e),!0;const n=m(e.nodeName);if(M(g.uponSanitizeElement,e,{tagName:n,allowedTags:u}),e.hasChildNodes()&&!Je(e.firstElementChild)&&A(/<[/\w]/g,e.innerHTML)&&A(/<[/\w]/g,e.textContent)||e.nodeType===Z.progressingInstruction||Ee&&e.nodeType===Z.comment&&A(/<[/\w]/g,e.data))return N(e),!0;if(!u[n]||B[n]){if(!B[n]&&tt(n)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(Ae&&!U[n]){const c=Q(e)||e.parentNode,_=Lt(e)||e.childNodes;if(_&&c){const d=_.length;for(let y=d-1;y>=0;--y){const D=Rt(_[y],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,Ot(e))}}}return N(e),!0}return e instanceof xe&&!zt(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,se([me,pe,de],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(o.removed,{element:e.cloneNode()}),e.textContent=t)),M(g.afterSanitizeElements,e,null),!1)},et=function(e,t,n){if(Ge&&(t==="id"||t==="name")&&(n in l||n in Ht))return!1;if(!(_e&&!Te[t]&&A(Mt,t))){if(!(Fe&&A(Ct,t))){if(!p[t]||Te[t]){if(!(tt(e)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&A(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Se[t]){if(!A(ve,$(n,Pe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Vt(n,"data:")===0&&Ye[e])){if(!(He&&!A(wt,$(n,Pe,"")))){if(n)return!1}}}}}}return!0},tt=function(e){return e!=="annotation-xml"&&st(e,xt)},nt=function(e){M(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:p,forceKeepAttr:void 0};let c=t.length;for(;c--;){const _=t[c],{name:d,namespaceURI:y,value:D}=_,j=m(d);let h=d==="value"?D:$t(D);if(n.attrName=j,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,M(g.uponSanitizeAttribute,e,n),h=n.attrValue,We&&(j==="id"||j==="name")&&(re(d,e),h=Pt+h),Ee&&A(/((--!?|])>)|<\/(style|title)/i,h)){re(d,e);continue}if(n.forceKeepAttr||(re(d,e),!n.keepAttr))continue;if(!ze&&A(/\/>/i,h)){re(d,e);continue}P&&se([me,pe,de],it=>{h=$(h,it," ")});const ot=m(e.nodeName);if(et(ot,j,h)){if(E&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!y)switch(J.getAttributeType(ot,j)){case"TrustedHTML":{h=E.createHTML(h);break}case"TrustedScriptURL":{h=E.createScriptURL(h);break}}try{y?e.setAttributeNS(y,d,h):e.setAttribute(d,h),Le(e)?N(e):rt(o.removed)}catch{}}}M(g.afterSanitizeAttributes,e,null)},Gt=function i(e){let t=null;const n=Ze(e);for(M(g.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)M(g.uponSanitizeShadowNode,t,null),Qe(t),nt(t),t.content instanceof b&&i(t.content);M(g.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,c=null,_=null;if(Re=!i,Re&&(i="<!-->"),typeof i!="string"&&!Je(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!o.isSupported)return i;if(ge||Oe(e),o.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=m(i.nodeName);if(!u[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof fe)t=Ke("<!---->"),n=t.ownerDocument.importNode(i,!0),n.nodeType===Z.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!v&&!P&&!C&&i.indexOf("<")===-1)return E&&te?E.createHTML(i):i;if(t=Ke(i),!t)return v?null:te?W:""}t&&he&&N(t.firstChild);const d=Ze(Y?i:t);for(;c=d.nextNode();)Qe(c),nt(c),c.content instanceof b&&Gt(c.content);if(Y)return i;if(v){if(ee)for(_=Dt.call(t.ownerDocument);t.firstChild;)_.appendChild(t.firstChild);else _=t;return(p.shadowroot||p.shadowrootmode)&&(_=It.call(s,_,!0)),_}let y=C?t.outerHTML:t.innerHTML;return C&&u["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(Et,t.ownerDocument.doctype.name)&&(y="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
4
|
+
`+y),P&&se([me,pe,de],D=>{y=$(y,D," ")}),E&&te?E.createHTML(y):y},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Oe(i),ge=!0},o.clearConfig=function(){H=null,ge=!1},o.isValidAttribute=function(i,e,t){H||Oe({});const n=m(i),c=m(e);return et(n,c,t)},o.addHook=function(i,e){typeof e=="function"&&V(g[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=Xt(g[i],e);return t===-1?void 0:jt(g[i],t,1)[0]}return rt(g[i])},o.removeHooks=function(i){g[i]=[]},o.removeAllHooks=function(){g=pt()},o}var fn=gt();export{fn as p};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{M as e,e as o}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as d}from"../fragments.js";import{a as l,d as p,b as u}from"./synchronizeCheckout.js";import{s as c}from"./
|
|
3
|
+
import{M as e,e as o}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as d}from"../fragments.js";import{a as l,d as p,b as u}from"./synchronizeCheckout.js";import{s as c}from"./state.js";import"./transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const m=`
|
|
4
4
|
mutation setBillingAddress($input: SetBillingAddressOnCartInput!) {
|
|
5
5
|
setBillingAddressOnCart(input: $input) {
|
|
6
6
|
cart {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{s as r}from"./
|
|
3
|
+
import{s as r}from"./state.js";import{g as e}from"./transform-store-config.js";import{c as s,M as l}from"./errors.js";import{j as o,d as m,b as n}from"./synchronizeCheckout.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as c}from"../fragments.js";const u=a=>!!(a!=null&&a.is_email_available),p=a=>{if(!(!a||a.length===0))throw Error(a.map(t=>t.message).join(" "))},E=`
|
|
4
4
|
query isEmailAvailable($email: String!) {
|
|
5
5
|
isEmailAvailable(email: $email) {
|
|
6
6
|
is_email_available
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,G=async a=>{if(!a)throw new s;const{data:t,errors:i}=await e(E,{method:"GET",cache:"no-cache",variables:{email:a}}).catch(o);return i&&p(i),u(t.isEmailAvailable)},h=`
|
|
10
10
|
mutation setGuestEmail($cartId: String!, $email: String!) {
|
|
11
11
|
setGuestEmailOnCart(input: { cart_id: $cartId, email: $email }) {
|
|
12
12
|
cart {
|
|
@@ -16,4 +16,4 @@ import{s as r}from"./store-config.js";import{j as e}from"./transform-store-confi
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
${c}
|
|
19
|
-
`,
|
|
19
|
+
`,_=async a=>{const t=r.cartId;if(!t)throw new l;return await m({options:{variables:{cartId:t,email:a}},path:"setGuestEmailOnCart.cart",query:h,queueName:"cartUpdate",signalType:"cart",transformer:n,type:"mutation"})};export{p as h,G as i,_ as s};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{M as e,d as r}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as o}from"../fragments.js";import{d as n,b as s}from"./synchronizeCheckout.js";import{s as m}from"./
|
|
3
|
+
import{M as e,d as r}from"./errors.js";import{CHECKOUT_DATA_FRAGMENT as o}from"../fragments.js";import{d as n,b as s}from"./synchronizeCheckout.js";import{s as m}from"./state.js";import"./transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const i=`
|
|
4
4
|
mutation setPaymentMethod(
|
|
5
5
|
$cartId: String!
|
|
6
6
|
$paymentMethod: PaymentMethodInput!
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{s as r}from"./
|
|
3
|
+
import{s as r}from"./state.js";import"./transform-store-config.js";import{M as i}from"./errors.js";import{d as n,b as e}from"./synchronizeCheckout.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as s}from"../fragments.js";const M=t=>({countryCode:t.country_id,postCode:t.postcode||"",...t.region_id?{regionId:Number(t.region_id)}:{...t.region?{region:t.region}:{}}}),T=t=>({carrierCode:t.carrier.code||"",methodCode:t.code||"",amount:t.amount,amountExclTax:t.amountExclTax,amountInclTax:t.amountInclTax}),a=`
|
|
4
4
|
mutation setShippingMethods(
|
|
5
5
|
$cartId: String!
|
|
6
6
|
$shippingMethods: [ShippingMethodInput]!
|
package/chunks/state.js
ADDED
package/chunks/store-config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
|
|
3
|
+
var I=(N=>(N.EXCLUDING_TAX="EXCLUDING_TAX",N.INCLUDING_EXCLUDING_TAX="INCLUDING_AND_EXCLUDING_TAX",N.INCLUDING_TAX="INCLUDING_TAX",N))(I||{});export{I as T};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{s as i}from"./
|
|
3
|
+
import{s as i}from"./state.js";import{f as C,g as y,c as m,e as R,m as z}from"./transform-store-config.js";import{events as c}from"@dropins/tools/event-bus.js";import{merge as A,Initializer as G}from"@dropins/tools/lib.js";import{CHECKOUT_DATA_FRAGMENT as b,CUSTOMER_FRAGMENT as O}from"../fragments.js";import{F as $,M as U}from"./errors.js";const D=async(e=!1)=>{i.authenticated=e,e?await me():C.value={pending:!1,data:null}},x={cartUpdate:{requests:[]},default:{requests:[]}};function F(e,t="default"){const r=x[t];return new Promise((n,o)=>{r.requests.push(e);const a=()=>{r.requests[0]===e?e().then(n).catch(o).finally(()=>{var l;r.requests.shift(),r.requests.length===0?(l=r.onComplete)==null||l.call(r):a()}):setTimeout(a,100)};a()})}function Q(e,t){const r=x[e];r.onComplete=t}const V=["sender_email","recipient_email"];function B(e){return e.filter(t=>!t.path||!V.some(r=>{var n;return((n=t.path)==null?void 0:n.at(-1))===r}))}const v=e=>{throw e instanceof DOMException&&e.name==="AbortError"||c.emit("error",{source:"checkout",type:"network",error:e}),e},H={cart:m,customer:C,estimateShippingMethods:R};function K(e,t){return t.split(".").reduce((r,n)=>r&&r[n]!==void 0?r[n]:void 0,e)}const _={cart:null,customer:null,estimateShippingMethods:null};async function E(e){const{defaultValueOnFail:t,options:r,path:n,query:o,queueName:a,signalType:l,transformer:p,type:P}=e,s=H[l],d=Symbol();_[l]=d,s.value={...s.value,pending:!0};try{const{data:f,errors:h}=await(P==="mutation"?F(()=>y(o,r).catch(v),a):y(o,{method:"GET",cache:"no-cache",...r}).catch(v));if(h){const g=B(h);if(g.length>0)throw new $(g)}let u=K(f,n);if(u===void 0)throw new Error(`No data found at path: ${n}`);return p&&(u=p(u)),s.value={...s.value,data:u},setTimeout(()=>{s.value={...s.value,pending:_[l]===d?!1:s.value.pending}},0),u}catch(f){if(t)return s.value={pending:!1,data:t},t;if(f.name==="AbortError")return;throw s.value={...s.value,pending:!1},f}}const j=e=>e==null,L=(e,t)=>e.amount.value-t.amount.value,M=e=>!(!e||!e.method_code||!e.method_title||j(e.amount.value)||!e.amount.currency),T=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}}}),J=e=>{if(M(e))return T(e)},W=e=>{if(e)return e.filter(M).map(t=>T(t)).sort(L)},X=e=>e?!!e.code&&!!e.label:!1,Y=e=>{if(!X(e))return;const{code:t,label:r,region_id:n}=e;return n?{code:t,name:r,id:n}:{code:t,name:r}},Z=e=>{const{code:t,label:r}=e;return{value:t,label:r}},ee=e=>e?"code"in e&&"value"in e:!1,te=e=>e.filter(ee).map(t=>{const{code:r,value:n}=t;return{code:r,value:n}}),S=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:Z(e.country),customAttributes:te(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:Y(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}},re=e=>{if(e)return S(e)},ne=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:r,selected_shipping_method:n,same_as_billing:o,...a}=t;return{...S(a),availableShippingMethods:W(r),selectedShippingMethod:J(n),sameAsBilling:o}}),Ce=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}),ie=e=>{if(e)return{code:e.code,title:e.title}},oe=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:r,title:n}=t;return{code:r,title:n}})},se=e=>{var r,n,o;if(!e)return;const t={availablePaymentMethods:oe(e.available_payment_methods),billingAddress:re(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:ie(e.selected_payment_method),shippingAddresses:ne(e.shipping_addresses),isGuest:!i.authenticated};return A(t,(o=(n=(r=N.getConfig().models)==null?void 0:r.CartModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},ce=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=N.getConfig().models)==null?void 0:r.CustomerModel)==null?void 0:n.transformer)==null?void 0:o.call(n,e))},ae=`
|
|
4
4
|
query getCart($cartId: String!) {
|
|
5
5
|
cart(cart_id: $cartId) {
|
|
6
6
|
...CHECKOUT_DATA_FRAGMENT
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{T as a}from"./store-config.js";import{signal as t,effect as
|
|
3
|
+
import{FetchGraphQL as l}from"@dropins/tools/fetch-graphql.js";import{T as a}from"./store-config.js";import"./state.js";import{signal as t,effect as u}from"@dropins/tools/signals.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const g=t(!0),p=t({pending:!1,data:void 0});u(()=>{var e;(e=p.value.data)!=null&&e.isVirtual&&(g.value=!1)});const y=t({pending:!1,data:void 0}),T=t({available:!0,error:"",initialized:!1,pending:!1,value:""}),D=t({pending:!1,data:void 0}),v=t(),N=t(void 0),U=t(),{setEndpoint:A,setFetchGraphQlHeader:I,removeFetchGraphQlHeader:L,setFetchGraphQlHeaders:X,fetchGraphQl:d,getConfig:F}=new l().getMethods(),h=`
|
|
4
4
|
query getStoreConfig {
|
|
5
5
|
storeConfig {
|
|
6
6
|
default_country
|
|
7
|
+
is_checkout_agreements_enabled
|
|
7
8
|
is_guest_checkout_enabled
|
|
8
9
|
is_one_page_checkout_enabled
|
|
9
10
|
shopping_cart_display_shipping
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
|
-
`,
|
|
13
|
+
`,_="US",n={defaultCountry:_,isCheckoutAgreementsEnabled:!0,isGuestCheckoutEnabled:!1,isOnePageCheckoutEnabled:!1,shoppingCartDisplaySetting:{shipping:a.EXCLUDING_TAX}},O=async()=>d(h,{method:"GET",cache:"no-cache"}).then(({errors:e,data:s})=>e?n:C(s.storeConfig));function f(e){switch(e){case 1:return a.EXCLUDING_TAX;case 2:return a.INCLUDING_TAX;case 3:return a.INCLUDING_EXCLUDING_TAX;default:return a.EXCLUDING_TAX}}function C(e){if(!e)return n;const{default_country:s,is_checkout_agreements_enabled:i,is_guest_checkout_enabled:o,is_one_page_checkout_enabled:r,shopping_cart_display_shipping:c}=e;return{defaultCountry:s||n.defaultCountry,isCheckoutAgreementsEnabled:i,isGuestCheckoutEnabled:o||n.isGuestCheckoutEnabled,isOnePageCheckoutEnabled:r||n.isOnePageCheckoutEnabled,shoppingCartDisplaySetting:{shipping:f(c)}}}export{_ as D,n as S,U as a,T as b,p as c,v as d,D as e,y as f,d as g,A as h,g as i,I as j,X as k,F as l,O as m,L as r,N as s};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{c as p}from"./transform-store-config.js";import"./
|
|
3
|
+
import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{c as p}from"./transform-store-config.js";import"./state.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";function u(i){return i.displayName||i.name||"Component"}const g=i=>{const o=u(i),a=({hideOnEmptyCart:s=!0,hideOnVirtualCart:r=!1,...e})=>{const t=p.value.data,l=t!==void 0&&(t===null||t.isEmpty),m=!!(t!=null&&t.isVirtual),c=s&&l||r&&m,d=`conditional-${o.toLowerCase()}`;return n("div",{className:d,children:!c&&n(i,{...e})})};return a.displayName=`Conditional(${o})`,a};export{g as w};
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
*******************************************************************/
|
|
17
|
+
export * from './Markup';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
|
|
4
|
+
export interface TermsAndConditionsProps extends HTMLAttributes<HTMLFormElement> {
|
|
5
|
+
agreements?: VNode;
|
|
6
|
+
error?: string;
|
|
7
|
+
isInitialized?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const TermsAndConditions: FunctionComponent<TermsAndConditionsProps>;
|
|
10
|
+
//# sourceMappingURL=TermsAndConditions.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
*******************************************************************/
|
|
17
|
+
export * from './TermsAndConditions';
|
|
18
|
+
export * from './TermsAndConditionsSkeleton';
|
|
19
|
+
export { TermsAndConditions as default } from './TermsAndConditions';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
package/components/index.d.ts
CHANGED
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
export * from './BillToShippingAddress';
|
|
18
18
|
export * from './EstimateShipping';
|
|
19
19
|
export * from './LoginForm';
|
|
20
|
+
export * from './Markup';
|
|
20
21
|
export * from './OutOfStock';
|
|
21
22
|
export * from './PaymentMethods';
|
|
22
23
|
export * from './PlaceOrder';
|
|
23
24
|
export * from './ServerError';
|
|
24
25
|
export * from './ShippingMethods';
|
|
26
|
+
export * from './TermsAndConditions';
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/
|
|
3
|
+
import{jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/state.js";import{i as d,c as u}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";import{s as S}from"../chunks/setBillingAddress.js";/* empty css */import{Checkbox as b,Skeleton as f,SkeletonRow as A}from"@dropins/tools/components.js";import{c as B}from"../chunks/classes.js";import{useText as x}from"@dropins/tools/i18n.js";import{w as T}from"../chunks/withConditionalRendering.js";import{useState as v,useEffect as _}from"@dropins/tools/preact-compat.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const w=({className:i,checked:e,loading:r,disabled:n,onChange:s})=>{const c=x({title:"Checkout.BillToShippingAddress.title"});return r?t(y,{}):t("div",{className:"checkout-bill-to-shipping-address",children:t(b,{checked:e,className:B(["checkout-bill-to-shipping-address__checkbox",i]),"data-testid":"bill-to-shipping-checkbox",disabled:n,label:c.title,name:"checkout-bill-to-shipping-address__checkbox",onChange:s})})},y=()=>t(f,{className:"bill-to-shipping-address__skeleton",children:t(A,{variant:"row",size:"small"})}),k=({onChange:i})=>{var g;const[e,r]=v(!0),n=d.value,s=u.value.data,c=u.value.pending,p=!!s,m=!!(s==null?void 0:s.billingAddress),l=(g=s==null?void 0:s.shippingAddresses)==null?void 0:g[0],h=l==null?void 0:l.sameAsBilling;return _(()=>{if(!e||!p)return;r(!1);const o=h??!m;d.value=o,i==null||i(o)},[p,m,h,e,i]),t(w,{checked:n,disabled:c,loading:e,onChange:async o=>{const a=o.target.checked;d.value=a,i==null||i(a),!e&&l&&a&&await S({sameAsShipping:!0}).catch(console.error)}})};k.displayName="BillToShippingAddressContainer";const V=T(k);export{V as BillToShippingAddress,V as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as k,Fragment as y,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as v,SkeletonRow as M,Price as x}from"@dropins/tools/components.js"
|
|
3
|
+
import{jsxs as k,Fragment as y,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as v,SkeletonRow as M,Price as x}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{VComponent as A,classes as I}from"@dropins/tools/lib.js";import{Text as l,useText as w}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{T as C}from"../chunks/store-config.js";import{s as z}from"../chunks/state.js";import{events as g}from"@dropins/tools/event-bus.js";import{useState as B,useEffect as f}from"@dropins/tools/preact-hooks.js";const G=({estimated:e=!1,price:a,priceExclTax:d,taxExcluded:o=!1,taxIncluded:p=!1})=>k(y,{children:[t("span",{className:"checkout-estimate-shipping__label",children:e?t(l,{id:"Checkout.EstimateShipping.estimated"}):t(l,{id:"Checkout.EstimateShipping.label"})}),t(A,{node:a,className:"checkout-estimate-shipping__price"}),p&&t("span",{"data-testid":"shipping-tax-included",className:I(["checkout-estimate-shipping__caption"]),children:t(l,{id:"Checkout.EstimateShipping.withTaxes"})}),o&&k("span",{"data-testid":"shipping-tax-included-excluded",className:I(["checkout-estimate-shipping__caption"]),children:[d," ",t(l,{id:"Checkout.EstimateShipping.withoutTaxes"})]})]}),L=()=>t(v,{"data-testid":"estimate-shipping-skeleton",children:t(M,{size:"xsmall"})}),Q=()=>{const[e,a]=B(),d=e!==void 0,o=(e==null?void 0:e.amount.value)===0,p=z.config,T=p==null?void 0:p.shoppingCartDisplaySetting.shipping,_=T===C.INCLUDING_EXCLUDING_TAX,E=T===C.INCLUDING_TAX,S=w({freeShipping:"Checkout.EstimateShipping.freeShipping",taxToBeDetermined:"Checkout.EstimateShipping.taxToBeDetermined"});f(()=>{const i=g.on("shipping/estimate",n=>{const s=n.shippingMethod,{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!0,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=g.on("checkout/initialized",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]),f(()=>{const i=g.on("checkout/updated",n=>{var u,h;const s=(h=(u=n==null?void 0:n.shippingAddresses)==null?void 0:u[0])==null?void 0:h.selectedShippingMethod;if(!s)return;const{amount:c,amountExclTax:r,amountInclTax:m}=s;a({estimated:!1,amount:c,amountExclTax:r,amountInclTax:m})},{eager:!0});return()=>{i==null||i.off()}},[]);const D=()=>o?t("span",{"data-testId":"free-shipping",children:S.freeShipping}):E&&(e!=null&&e.amountInclTax)?t(x,{"data-testid":"shipping",amount:e.amountInclTax.value,currency:e.amountInclTax.currency}):t(x,{"data-testid":"shipping",amount:e==null?void 0:e.amount.value,currency:e==null?void 0:e.amount.currency}),N=()=>e!=null&&e.amountExclTax?t(x,{"data-testid":"shipping-excluding-tax",amount:e.amountExclTax.value,currency:e.amountExclTax.currency}):t("span",{children:S.taxToBeDetermined});return t("div",{"data-testid":"estimate-shipping",className:"checkout-estimate-shipping",children:d?t(G,{estimated:e.estimated,price:D(),taxExcluded:_&&!o,taxIncluded:E&&!o,priceExclTax:N()}):t(L,{})})};export{Q as EstimateShipping,Q as default};
|
package/containers/LoginForm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e,jsxs as
|
|
3
|
+
import{jsx as e,jsxs as m,Fragment as B}from"@dropins/tools/preact-jsx-runtime.js";import{s as M}from"../chunks/state.js";import{b as t,c as T,f as $}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import{classes as w}from"@dropins/tools/lib.js";import{i as I,s as V}from"../chunks/setGuestEmailOnCart.js";import{Field as H,Input as P,Skeleton as R,SkeletonRow as b}from"@dropins/tools/components.js";/* empty css */import"../chunks/TermsAndConditions.js";import{useText as N,Text as L}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{w as j}from"../chunks/withConditionalRendering.js";import{useRef as q,useEffect as x}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const D={EMAIL:/^[a-z0-9,!#$%&'*+/=?^_`{|}~-]+(\.[a-z0-9,!#$%&'*+/=?^_`{|}~-]+)*@([a-z0-9-]+\.)+[a-z]{2,}$/i},k=o=>D.EMAIL.test(o),W=({value:o,error:n,hint:d,onChange:g,onBlur:u,onInvalid:r})=>{const i=N({LoginFormLabel:"Checkout.LoginForm.ariaLabel",LoginFormFloatingLabel:"Checkout.LoginForm.floatingLabel",LoginFormPlaceholder:"Checkout.LoginForm.placeholder"});return e(H,{error:n,hint:d,children:e(P,{"aria-label":i.LoginFormLabel,"aria-required":!0,autocomplete:"email",floatingLabel:i.LoginFormFloatingLabel,id:"customer-email",name:"customer-email",onBlur:u,onChange:g,onInvalid:r,placeholder:i.LoginFormPlaceholder,required:!0,type:"email",value:o})})},G=({onClick:o})=>m("div",{className:"checkout-login-form__sign-in",children:[e(L,{id:"Checkout.LoginForm.account"}),e("a",{"data-testid":"sign-in-link",className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:o,children:e(L,{id:"Checkout.LoginForm.signIn"})})]}),U=({className:o,customerDetails:n,email:d,error:g,hint:u,loading:r=!1,name:i,onEmailBlur:F,onEmailChange:c,onEmailInvalid:s,onSignInClick:h,onSignOutClick:v,...p})=>{const _=N({Title:"Checkout.LoginForm.title"});return r?e(J,{}):m("div",{className:"checkout-login-form","data-testid":"checkout-login-form",children:[m("div",{className:"checkout-login-form__heading",children:[e("h2",{className:"checkout-login-form__title",children:_.Title}),n?e(K,{onClick:f=>{f.preventDefault(),v==null||v()}}):e(G,{onClick:f=>{f.preventDefault(),h==null||h(d)}})]}),n?m("div",{className:"checkout-login-form__customer-details",children:[e("div",{className:"checkout-login-form__customer-name",children:`${n.firstName} ${n.lastName}`}),e("div",{className:"checkout-login-form__customer-email",children:n.email})]}):e("div",{className:"checkout-login-form__content",children:m("form",{...p,className:w(["dropin-login-form__form",o]),name:i,noValidate:!0,children:[e("button",{type:"submit",disabled:!0,style:"display: none","aria-hidden":"true"}),e(W,{value:d,error:g,hint:u,onChange:c,onBlur:F,onInvalid:s})]})})]})},J=()=>m(R,{"data-testid":"login-form-skeleton",children:[e(b,{variant:"heading",fullWidth:!0}),e(b,{size:"medium",fullWidth:!0})]}),K=({onClick:o})=>m("p",{className:"checkout-login-form__sign-out",children:[e(L,{id:"Checkout.LoginForm.switch"}),e("a",{className:"checkout-login-form__link",href:"#",target:"_blank",rel:"noreferrer",onClick:o,children:e(L,{id:"Checkout.LoginForm.signOut"})})]}),O=1e3,C=({onSignInClick:o,onSignOutClick:n,initialData:d,...g})=>{const u=q(""),r=t.value,i=T.value.data,F=(i==null?void 0:i.email)||"",c=$.value.data,s=N({LoginFormInvalidEmailError:"Checkout.LoginForm.invalidEmailError",LoginFormMissingEmailError:"Checkout.LoginForm.missingEmailError",LoginFormEmailExistsAlreadyHaveAccount:"Checkout.LoginForm.emailExists.alreadyHaveAccount",LoginFormEmailExistsSignInButton:"Checkout.LoginForm.emailExists.signInButton",LoginFormEmailExistsForFasterCheckout:"Checkout.LoginForm.emailExists.forFasterCheckout"}),h=a=>a.valid?"":a.valueMissing?s.LoginFormMissingEmailError:s.LoginFormInvalidEmailError,v=a=>k(a)?"":a===""?s.LoginFormMissingEmailError:s.LoginFormInvalidEmailError,p=a=>{const l=a.target;t.value={...t.value,available:!0,error:"",pending:!0,value:l.value}},_=a=>{const l=a.target,E=v(l.value);l.setCustomValidity(E),t.value={...t.value,error:E}},f=a=>{const l=a.target;t.value={...t.value,error:h(l.validity)}};x(()=>{!i||r.initialized||(t.value={available:!0,error:"",initialized:!0,pending:!1,value:i.email??""})},[i,r]),x(()=>{if(!r.initialized||M.authenticated)return;const a=setTimeout(()=>{if(!k(r.value)||r.value===u.current){t.value={...t.value,pending:!1};return}u.current=r.value,I(r.value).then(l=>{const E=F!==r.value;t.value={...t.value,available:l,pending:E},E&&V(r.value).catch(console.error).finally(()=>{t.value={...t.value,pending:!1}})}).catch(l=>{console.error(l),t.value={...t.value,available:!0,pending:!1}})},O);return()=>{a&&clearTimeout(a)}},[F,r]);const y=r.available?"":m(B,{children:[s.LoginFormEmailExistsAlreadyHaveAccount," ",e("a",{href:"#",onClick:a=>{a.preventDefault(),o==null||o(r.value)},children:s.LoginFormEmailExistsSignInButton})," ",s.LoginFormEmailExistsForFasterCheckout]}),z=a=>{o==null||o(k(a)?a:"")},A=c?{firstName:c.firstName,lastName:c.lastName,email:c.email}:void 0;return e(U,{...g,customerDetails:A,email:r.value,error:r.error,hint:y,loading:r.initialized===!1,onEmailBlur:_,onEmailChange:p,onEmailInvalid:f,onSignInClick:z,onSignOutClick:n})};C.displayName="LoginFormContainer";const fe=j(C);export{fe as LoginForm,fe as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as g,Icon as u}from"@dropins/tools/components.js";import{c as h}from"../chunks/classes.js";import{events as B}from"@dropins/tools/event-bus.js";import*as l from"@dropins/tools/preact-compat.js";import{useState as I,useEffect as M}from"@dropins/tools/preact-compat.js";import{w as v}from"../chunks/withConditionalRendering.js";import{useText as w,Text as x}from"@dropins/tools/i18n.js";import"../chunks/transform-store-config.js";import"../chunks/store-config.js";import"
|
|
3
|
+
import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as g,Icon as u}from"@dropins/tools/components.js";import{c as h}from"../chunks/classes.js";import{events as B}from"@dropins/tools/event-bus.js";import*as l from"@dropins/tools/preact-compat.js";import{useState as I,useEffect as M}from"@dropins/tools/preact-compat.js";import{w as v}from"../chunks/withConditionalRendering.js";import{useText as w,Text as x}from"@dropins/tools/i18n.js";import"../chunks/transform-store-config.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"../chunks/state.js";import"@dropins/tools/signals.js";import"@dropins/tools/lib.js";const H=t=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},l.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"})),C=({className:t,initialData:V,...c})=>{const[r,a]=I(0),i=w({mergedCartBannerItems:e(x,{id:"Checkout.MergedCartBanner.items",fields:{count:r},plural:r})});M(()=>{const n=B.on("cart/merged",o=>{var m;const s=(m=o==null?void 0:o.oldCartItems)==null?void 0:m.reduce((f,p)=>f+p.quantity,0);s>0&&a(s)});return()=>{n==null||n.off()}},[]);const d=()=>{a(0)};return r?e(g,{...c,"aria-label":i.mergedCartBannerItems,className:h(["checkout__banner",t]),"data-testid":"merged-cart-banner",icon:e(u,{source:H}),message:e("span",{children:i.mergedCartBannerItems}),onDismiss:d,variant:"neutral"}):null};C.displayName="MergedCartBannerContainer";const A=v(C);export{A as MergedCartBanner,A as default};
|
package/containers/OutOfStock.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
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"
|
|
3
|
+
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";import"../chunks/TermsAndConditions.js";import{classes as O}from"@dropins/tools/lib.js";import{S as d}from"../chunks/OrderError.js";import{useText as p}from"@dropins/tools/i18n.js";/* empty css *//* empty css *//* empty css */import{events as S}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=p({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})]})]})},T=({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=S.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{T as OutOfStock,T as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as n,jsxs as w}from"@dropins/tools/preact-jsx-runtime.js";import{s as z}from"../chunks/
|
|
3
|
+
import{jsx as n,jsxs as w}from"@dropins/tools/preact-jsx-runtime.js";import{s as z}from"../chunks/state.js";import{c as M,d as m}from"../chunks/transform-store-config.js";import"@dropins/tools/event-bus.js";import{classes as P,Slot as I}from"@dropins/tools/lib.js";import{s as R}from"../chunks/setPaymentMethod.js";/* empty css */import{IllustratedMessage as B,Icon as N,ProgressSpinner as U,ToggleButton as Z,Skeleton as D,SkeletonRow as f}from"@dropins/tools/components.js";import*as y from"@dropins/tools/preact-compat.js";import{useState as $,useEffect as L,useCallback as q}from"@dropins/tools/preact-compat.js";import{useText as F}from"@dropins/tools/i18n.js";import{w as G}from"../chunks/withConditionalRendering.js";import{useRef as J}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../fragments.js";import"../chunks/synchronizeCheckout.js";const K=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"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"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),Q=({code:e,loading:c,selected:s,onChange:r,title:a,icon:o})=>n(Z,{className:"checkout-payment-methods__method",label:a,name:"payment-method",value:e,selected:s,onChange:r,busy:c,icon:o?n(N,{source:o}):void 0}),X=({className:e,paymentMethodContent:c,loading:s=!1,initializing:r=!1,onChange:a=()=>{},options:o,selection:v})=>{const u=F({Title:"Checkout.PaymentMethods.title",EmptyState:"Checkout.PaymentMethods.emptyState"});return r?n(Y,{}):w("div",{className:P(["checkout-payment-methods",e]),children:[n("h2",{className:"checkout-payment-methods__title",children:u.Title}),!s&&o.length===0&&n(B,{icon:n(N,{source:K}),message:n("p",{children:u.EmptyState})}),w("div",{className:P(["checkout-payment-methods__wrapper",["checkout-payment-methods__wrapper--loading",s]]),children:[s&&n(U,{className:"checkout-payment-methods__spinner"}),n("div",{className:P(["checkout-payment-methods__methods",["checkout-payment-methods--full-width",o.length%2!==0]]),children:o==null?void 0:o.map(d=>n(Q,{code:d.code,onChange:a,selected:d.code===v,title:d.displayLabel??!0?d.title:"",icon:d.icon},d.code))}),c&&n("div",{className:"checkout-payment-methods__content",children:c})]})]})},Y=()=>w(D,{"data-testid":"payment-methods-skeleton",children:[n(f,{variant:"heading",size:"medium"}),n(f,{variant:"empty",size:"medium"}),n(f,{size:"xlarge",fullWidth:!0}),n(f,{size:"xlarge",fullWidth:!0})]}),ee=(e,c)=>{const s=J(e);return c(s.current,e)||(s.current=e),s.current},O=({slots:e,setOnChange:c={}})=>{var b,_,H,E,x;const[s]=$(c),r=e==null?void 0:e.Methods;L(()=>{e!=null&&e.Handlers&&console.warn("The `slots.Handlers` prop is deprecated and will be removed in future versions. Use the `Methods` object instead."),c&&console.warn("The `setOnChange` prop is deprecated and will be removed in future versions. Use the `Methods` object instead.")},[]);const a=M.value.data,o=!!M.value.data,v=M.value.pending,u=(a==null?void 0:a.isVirtual)??!1,d=(b=a==null?void 0:a.shippingAddresses)==null?void 0:b[0],V=(a==null?void 0:a.availablePaymentMethods)||[],p=(_=a==null?void 0:a.selectedPaymentMethod)==null?void 0:_.code,S=u?!0:!!d,l=ee(V.filter(t=>{var i;return((i=r==null?void 0:r[t.code])==null?void 0:i.enabled)!==!1}),(t,i)=>t.length!==i.length?!1:t.every((h,C)=>h.code===i[C].code)),g=q(t=>{var i;m.value=t,!(!t||!S)&&t!==p&&(s[t]===!1||((i=r==null?void 0:r[t])==null?void 0:i.setOnChange)===!1||R({code:t}).catch(console.error))},[S,r,p,s]);L(()=>{if(!o||!!!(l!=null&&l.length))return;const i=l[0].code,h=p||m.value,C=h?l.some(W=>W.code===h):!1;g(C?h:i)},[l,o,g,p]);const j=t=>{g(t)},k=m.value?((E=(H=e==null?void 0:e.Methods)==null?void 0:H[m.value])==null?void 0:E.render)||((x=e==null?void 0:e.Handlers)==null?void 0:x[m.value]):null,A=k?n(I,{name:"PaymentMethodContent",slot:k,context:{cartId:z.cartId||"",replaceHTML(t){this.replaceWith(t)}}},k):void 0,T=l.map(t=>{const i=(r==null?void 0:r[t.code])||{};return{...t,...i}});return n(X,{initializing:o===!1,loading:o&&v,onChange:j,options:T,paymentMethodContent:A,selection:m.value})};O.displayName="PaymentMethodsContainer";const ke=G(O);export{ke as PaymentMethods,ke as default};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
1
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
3
|
|
|
3
|
-
export interface
|
|
4
|
-
|
|
5
|
-
handleValidation?: () => boolean;
|
|
6
|
-
handlePlaceOrder: (ctx: PlaceOrderContext) => Promise<void>;
|
|
4
|
+
export interface ContentSlotContext {
|
|
5
|
+
code: string;
|
|
7
6
|
}
|
|
8
|
-
export interface
|
|
7
|
+
export interface HandlePlaceOrderContext {
|
|
9
8
|
code: string;
|
|
10
9
|
cartId: string;
|
|
11
10
|
}
|
|
11
|
+
export interface PlaceOrderProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
handleValidation?: () => boolean;
|
|
14
|
+
handlePlaceOrder: (ctx: HandlePlaceOrderContext) => Promise<void>;
|
|
15
|
+
slots?: {
|
|
16
|
+
Content?: SlotProps<ContentSlotContext>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
12
19
|
export declare const PlaceOrder: {
|
|
13
20
|
({ hideOnEmptyCart, hideOnVirtualCart, ...props }: import('../../hocs/withConditionalRendering').ConditionalProps & PlaceOrderProps): import("preact/compat").JSX.Element;
|
|
14
21
|
displayName: string;
|
package/containers/PlaceOrder.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as a}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Button as
|
|
3
|
+
import{jsx as a}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Button as E}from"@dropins/tools/components.js";import{classes as S,Slot as P}from"@dropins/tools/lib.js";import{w as y}from"../chunks/withConditionalRendering.js";import{s as b}from"../chunks/state.js";import{c as U,b as I,a as w,d}from"../chunks/transform-store-config.js";import{U as N}from"../chunks/errors.js";import{events as T}from"@dropins/tools/event-bus.js";import{useState as z,useCallback as l,useEffect as D}from"@dropins/tools/preact-compat.js";import{useText as H,Text as _}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";const j=({children:t,className:o,disabled:n=!1,onClick:r})=>a("div",{className:S(["checkout-place-order",o]),children:a(E,{className:"checkout-place-order__button","data-testid":"place-order-button",disabled:n,onClick:r,size:"medium",type:"submit",variant:"primary",children:t},"placeOrder")}),B=t=>t instanceof TypeError||t instanceof N,u=({disabled:t=!1,handleValidation:o,handlePlaceOrder:n,slots:r,...p})=>{const[f,C]=z(!1),{data:O,pending:k}=U.value,g=I.value.pending,h=!!O,s=H({CheckoutUnexpectedError:"Checkout.ServerError.unexpected"}),i=l(e=>{w.value=B(e)?s.CheckoutUnexpectedError:e.message},[s]),v=l(async()=>{try{if(!(o?o():!0))return;await n({cartId:b.cartId||"",code:d.value||""})}catch(e){i(e)}},[o,n,i]);return D(()=>{const e=T.on("cart/initialized",c=>{const x=(c==null?void 0:c.items)||[];C(x.some(m=>m.outOfStock||m.insufficientQuantity))},{eager:!0});return()=>{e==null||e.off()}},[]),a(j,{...p,onClick:v,disabled:t||!h||k||f||g,children:r!=null&&r.Content?a(P,{name:"Content",slot:r.Content,context:{code:d.value||""}}):a(_,{id:"Checkout.PlaceOrder.button"})})};u.displayName="PlaceOrderContainer";const Z=y(u);export{Z as PlaceOrder,Z as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as s,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as l,Icon as p,Button as f}from"@dropins/tools/components.js"
|
|
3
|
+
import{jsx as s,jsxs as n}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{IllustratedMessage as l,Icon as p,Button as f}from"@dropins/tools/components.js";import"../chunks/TermsAndConditions.js";import{classes as a}from"@dropins/tools/lib.js";/* empty css *//* empty css */import{S as h}from"../chunks/OrderError.js";import{useText as d}from"@dropins/tools/i18n.js";/* empty css */import{a as u}from"../chunks/transform-store-config.js";import"../chunks/state.js";import"@dropins/tools/event-bus.js";import{useRef as v,useEffect as m}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";const g=({className:e,contactSupport:t,errorMessage:i,onClick:c,errorMessageRef:r})=>{const o=d({Title:"Checkout.ServerError.title",Message:"Checkout.ServerError.message",ContactSupport:"Checkout.ServerError.contactSupport",Button:"Checkout.ServerError.button"});return s(l,{"aria-describedby":"checkout-server-error__message","aria-invalid":"true","aria-live":"polite",className:a(["checkout-server-error",e]),"data-testid":"checkout-server-error",heading:i??o.Title,message:n("p",{"data-testid":"checkout-server-error-message",ref:r,id:a(["checkout-server-error__message"]),children:[o.Message,s("br",{}),s("span",{children:t??o.ContactSupport})]}),icon:s(p,{className:a(["checkout-server-error__icon"]),source:h}),action:s(f,{className:a(["checkout-server-error__button"]),onClick:c,children:o.Button})})};function k(e){e.scrollIntoView({behavior:"smooth"}),e.focus()}const A=({onRetry:e,onServerError:t,autoScroll:i=!1})=>{const c=v(null),r=u.value,o=async()=>{e==null||e(),u.value=void 0};return m(()=>{r&&(t==null||t(r))},[r,t]),m(()=>{!i||!r||!c.current||k(c.current)},[r,i]),r?s(g,{errorMessageRef:c,errorMessage:r,onClick:o}):null};export{A as ServerError,A as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as n,jsxs as g,Fragment as b}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/
|
|
3
|
+
import{jsx as n,jsxs as g,Fragment as b}from"@dropins/tools/preact-jsx-runtime.js";import"../chunks/state.js";import{c as S,e as w,s as C}from"../chunks/transform-store-config.js";import{events as H}from"@dropins/tools/event-bus.js";import{classes as E,Slot as z}from"@dropins/tools/lib.js";import{t as R,s as T}from"../chunks/setShippingMethods.js";/* empty css */import{IllustratedMessage as O,Icon as P,ProgressSpinner as B,RadioButton as D,Price as I,Skeleton as V,SkeletonRow as f}from"@dropins/tools/components.js";import*as r from"@dropins/tools/preact-compat.js";import{useCallback as Z,useMemo as q,useEffect as F}from"@dropins/tools/preact-compat.js";import{useText as $}from"@dropins/tools/i18n.js";import{w as A}from"../chunks/withConditionalRendering.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/store-config.js";import"@dropins/tools/signals.js";import"../chunks/errors.js";import"../chunks/synchronizeCheckout.js";import"../fragments.js";const G=e=>r.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.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"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M15.1758 5.87573H19.0019L21.0394 10.7636",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.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"}),r.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"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.08792 7.63574H1.69824",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M7.11229 10.3619H1",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.16084 13.0402H1.92773",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.76172 16.7611H15.2809",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.38672 16.7611H5.17025",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),J=({className:e,isLoading:t=!1,onSelectionChange:s=()=>{},options:d,selection:u,...h})=>{const i=$({Title:"Checkout.ShippingMethods.title",EmptyState:"Checkout.ShippingMethods.emptyState"});return d===void 0?n(K,{}):g("div",{...h,className:E(["checkout-shipping-methods",e]),children:[n("h3",{className:"checkout-shipping-methods__title",children:i.Title}),!t&&d.length===0&&n(O,{icon:n(P,{source:G}),message:n("p",{children:i.EmptyState})}),g("div",{className:E(["checkout-shipping-methods__content"]),children:[t&&n(B,{className:"checkout-shipping-methods__spinner"}),n("div",{className:E(["checkout-shipping-methods__options",["checkout-shipping-methods__options--loading",t]]),children:d.map(o=>n(D,{"data-testid":"shipping-method-radiobutton","aria-busy":t,id:o.value,name:"shipping-method",className:"checkout-shipping-methods__method",label:g(b,{children:[n(I,{amount:o.amount.value,currency:o.amount.currency})," ",n("span",{children:o.carrier.title})]}),description:o.title,value:o.value,checked:(u==null?void 0:u.value)===o.value,onChange:()=>s(o)},o.value))})]})]})},K=()=>g(V,{"data-testid":"shipping-methods-skeleton",children:[n(f,{variant:"heading",size:"small"}),n(f,{variant:"empty",size:"small"}),n(f,{size:"medium",fullWidth:!0}),n(f,{size:"medium",fullWidth:!0})]}),L=(e,t)=>e.code===t.code&&e.carrier.code===t.carrier.code;function Q(e){const t=H.lastPayload("shipping/estimate");if(!(t!=null&&t.address))return;const s={address:t.address,shippingMethod:R(e)};H.emit("shipping/estimate",s)}function U({preSelectedMethod:e,onShippingMethodSelect:t}){const s=S.value.data,d=S.value.pending,u=w.value.data,h=w.value.pending,i=C.value,o=s==null?void 0:s.shippingAddresses,a=o==null?void 0:o[0],v=!!a,N=a==null?void 0:a.availableShippingMethods,m=a==null?void 0:a.selectedShippingMethod,l=N||u,_=Z(c=>{if(!v)return;const k={method_code:c.code,carrier_code:c.carrier.code};T([k]).catch(j=>{console.error("Setting shipping methods on cart failed:",j)})},[v]),x=c=>{C.value=c,t==null||t(c),v||Q(c)},p=q(()=>{if(!(l!=null&&l.length))return;const c=l[0],k=i||m;return k?l.some(M=>L(M,k))?k:c:l.find(W=>W.carrier.code===(e==null?void 0:e.carrierCode)&&W.code===(e==null?void 0:e.methodCode))||c},[i,m,l,e]);return F(()=>{p&&((!i||!L(p,i))&&(C.value=p,t==null||t(p)),(!m||!L(p,m))&&_(p))},[p,i,m,_,t]),{isLoading:d||h,options:l,selection:p,onSelectionChange:x}}const y=({preSelectedMethod:e,shippingMethodsSlot:t,onShippingMethodSelect:s,initialData:d,...u})=>{const{isLoading:h,options:i,selection:o,onSelectionChange:a}=U({preSelectedMethod:e,onShippingMethodSelect:s});return g(b,{children:[n(J,{...u,isLoading:h,onSelectionChange:a,options:i,selection:o}),!h&&t&&n(z,{name:"ShippingMethods",slot:t})]})};y.displayName="ShippingMethodsContainer";const kt=A(y);export{kt as ShippingMethods,kt as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AgreementMode } from '../../data/models';
|
|
2
|
+
import { Container, SlotMethod, SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
+
|
|
4
|
+
export interface TermsAndConditionsProps {
|
|
5
|
+
slots?: {
|
|
6
|
+
Agreements?: SlotProps<{
|
|
7
|
+
appendAgreement: SlotMethod<{
|
|
8
|
+
mode: AgreementMode;
|
|
9
|
+
name: string;
|
|
10
|
+
translationId?: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare const TermsAndConditions: Container<TermsAndConditionsProps>;
|
|
17
|
+
//# sourceMappingURL=TermsAndConditions.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
*******************************************************************/
|
|
17
|
+
export * from './TermsAndConditions';
|
|
18
|
+
export { TermsAndConditions as default } from './TermsAndConditions';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as e,jsxs as E}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */import{Skeleton as N,SkeletonRow as w,Checkbox as j}from"@dropins/tools/components.js";import{p as y}from"../chunks/TermsAndConditions.js";import{classes as p,VComponent as D,Slot as H}from"@dropins/tools/lib.js";/* empty css *//* empty css *//* empty css */import{A as P}from"../chunks/checkout.js";import{events as k}from"@dropins/tools/event-bus.js";import{s as R}from"../chunks/state.js";import{useEffect as g}from"@dropins/tools/preact-compat.js";import{useState as i,useCallback as A}from"@dropins/tools/preact-hooks.js";import{useText as V,MarkupText as $}from"@dropins/tools/i18n.js";const q=({html:n})=>{const r=y.sanitize(n,{ADD_ATTR:["target"]});return r===""?null:e("span",{dangerouslySetInnerHTML:{__html:r}})},L=({className:n,agreements:r,error:s,isInitialized:a=!1,...c})=>a?e("div",{className:"checkout-terms-and-conditions","data-testid":"checkout-terms-and-conditions",children:E("form",{...c,className:p(["checkout-terms-and-conditions__form",n]),name:"checkout-terms-and-conditions__form","data-testid":"checkout-terms-and-conditions-form",noValidate:!0,children:[r&&e(D,{node:r,className:p(["checkout-terms-and-conditions__agreements"]),"data-testid":"checkout-terms-and-conditions-agreements"}),s&&e("div",{className:"checkout-terms-and-conditions__error","data-testid":"checkout-terms-and-conditions-error",children:s})]})}):e(O,{}),O=()=>e(N,{"data-testid":"checkout-terms-and-conditions-skeleton",className:"checkout-terms-and-conditions-skeleton",children:e(w,{variant:"row",size:"small",fullWidth:!0})}),re=({slots:n,...r})=>{const[s,a]=i(!0),[c,_]=i(!1),[C,T]=i(!1),[x,m]=i(""),{errorMessage:l}=V({errorMessage:"Checkout.TermsAndConditions.error"}),I=A(()=>{m("")},[]),v=A(()=>{m(l)},[l]);return g(()=>{const t=k.on("checkout/initialized",()=>{var o;_(!0),a(((o=R.config)==null?void 0:o.isCheckoutAgreementsEnabled)??!0)},{eager:!0});return()=>{t==null||t.off()}},[]),g(()=>{const t=k.on("authenticated",o=>{T(o)},{eager:!0});return()=>{t==null||t.off()}},[]),!s||C?null:e(L,{...r,error:x,isInitialized:c,agreements:e(H,{name:"Agreements",slot:n==null?void 0:n.Agreements,context:{appendAgreement(t){this._registerMethod((...o)=>{const u=t(...o);if(!u)return;const{mode:M,name:h,text:d,translationId:f}=u;if(!d&&!f){console.warn(`The agreement ${h} is misconfigured. Please provide a text or a translationId.`);return}const b=d?e(q,{html:d}):e($,{id:f}),S=e(j,{checked:M===P.AUTO,label:b,name:h,required:!0,onChange:I,onInvalid:v});this._setProps(z=>({children:[...z.children||[],S]}))})}}})})};export{re as TermsAndConditions,re as default};
|
package/containers/index.d.ts
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
17
|
export * from './BillToShippingAddress';
|
|
18
|
-
export * from './ErrorBanner';
|
|
19
18
|
export * from './EstimateShipping';
|
|
20
19
|
export * from './LoginForm';
|
|
21
20
|
export * from './MergedCartBanner';
|
|
@@ -24,4 +23,5 @@ export * from './PaymentMethods';
|
|
|
24
23
|
export * from './PlaceOrder';
|
|
25
24
|
export * from './ServerError';
|
|
26
25
|
export * from './ShippingMethods';
|
|
26
|
+
export * from './TermsAndConditions';
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare enum AgreementMode {
|
|
18
|
+
MANUAL = "manual",
|
|
19
|
+
AUTO = "auto"
|
|
20
|
+
}
|
|
21
|
+
type AgreementContent = {
|
|
22
|
+
value: string;
|
|
23
|
+
html: boolean;
|
|
24
|
+
height: string | null;
|
|
25
|
+
};
|
|
26
|
+
export interface CheckoutAgreement {
|
|
27
|
+
content: AgreementContent;
|
|
28
|
+
id: number;
|
|
29
|
+
mode: AgreementMode;
|
|
30
|
+
name: string;
|
|
31
|
+
text: string;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=checkout.d.ts.map
|
package/data/models/index.d.ts
CHANGED
|
@@ -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 enum TaxDisplay {
|
|
18
18
|
EXCLUDING_TAX = "EXCLUDING_TAX",
|
|
19
19
|
INCLUDING_EXCLUDING_TAX = "INCLUDING_AND_EXCLUDING_TAX",
|
|
@@ -21,6 +21,7 @@ export declare enum TaxDisplay {
|
|
|
21
21
|
}
|
|
22
22
|
export interface StoreConfig {
|
|
23
23
|
defaultCountry: string;
|
|
24
|
+
isCheckoutAgreementsEnabled: boolean;
|
|
24
25
|
isGuestCheckoutEnabled: boolean;
|
|
25
26
|
isOnePageCheckoutEnabled: boolean;
|
|
26
27
|
shoppingCartDisplaySetting: {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*******************************************************************/
|
|
17
17
|
export * from './transform-address';
|
|
18
18
|
export * from './transform-cart';
|
|
19
|
+
export * from './transform-checkout-agreements';
|
|
19
20
|
export * from './transform-customer';
|
|
20
21
|
export * from './transform-email-availability';
|
|
21
22
|
export * from './transform-shipping-estimate';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Get_Checkout_AgreementsQuery } from '../../__generated__/types';
|
|
2
|
+
import { CheckoutAgreement as CheckoutAgreementModel } from '../models';
|
|
3
|
+
|
|
4
|
+
type CheckoutAgreements = Get_Checkout_AgreementsQuery['checkoutAgreements'];
|
|
5
|
+
export declare const transformCheckoutAgreements: (data: CheckoutAgreements) => CheckoutAgreementModel[];
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=transform-checkout-agreements.d.ts.map
|
package/hooks/index.d.ts
CHANGED
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -55,9 +55,6 @@ declare const _default: {
|
|
|
55
55
|
"title": "Your cart is empty",
|
|
56
56
|
"button": "Start shopping"
|
|
57
57
|
},
|
|
58
|
-
"ErrorBanner": {
|
|
59
|
-
"genericMessage": "Server error detected. Please check your connection and try again."
|
|
60
|
-
},
|
|
61
58
|
"MergedCartBanner": {
|
|
62
59
|
"items": {
|
|
63
60
|
"one": "1 item from a previous session was added to your cart. Please review your new subtotal.",
|
|
@@ -71,6 +68,10 @@ declare const _default: {
|
|
|
71
68
|
"taxToBeDetermined": "TBD",
|
|
72
69
|
"withTaxes": "Including taxes",
|
|
73
70
|
"withoutTaxes": "Excluding taxes"
|
|
71
|
+
},
|
|
72
|
+
"TermsAndConditions": {
|
|
73
|
+
"label": "I have read, understand, and accept our <a href='https://www.adobe.com/legal/terms.html' target='_blank'>Terms of Use, Terms of Sales, Privacy Policy, and Return Policy</a>.",
|
|
74
|
+
"error": "Please accept the Terms and Conditions to continue."
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
77
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-checkout", "version": "1.
|
|
1
|
+
{"name": "@dropins/storefront-checkout", "version": "1.3.0-beta1", "@dropins/tools": "~0.41.0", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
(function(n,o){try{if(typeof document<"u"){const t=document.createElement("style"),r=o.styleId;for(const e in o.attributes)t.setAttribute(e,o.attributes[e]);t.setAttribute("data-dropin",r),t.appendChild(document.createTextNode(n));const a=document.querySelector('style[data-dropin="sdk"]');if(a)a.after(t);else{const e=document.querySelector('link[rel="stylesheet"], style');e?e.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(`.checkout__banner{margin-bottom:var(--spacing-xlarge)}
|
|
4
|
-
.checkout-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.checkout-estimate-shipping__label,.checkout-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-estimate-shipping__price{text-align:right}.checkout-estimate-shipping__label--bold,.checkout-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.checkout-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__shipping .dropin-skeleton{grid-template-columns:1fr}.checkout-login-form__heading{display:grid;grid-template-columns:1fr max-content;grid-auto-rows:max-content}.checkout-login-form__content{grid-auto-rows:max-content}.checkout-login-form__content .dropin-field__hint a{font-weight:400}.checkout-login-form__customer-details{display:grid;grid-auto-flow:row;gap:var(--spacing-xxsmall)}.checkout-login-form__customer-name{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-login-form__customer-email{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-login-form__title{grid-column-start:1;color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);justify-self:flex-end;margin-top:var(--spacing-xxsmall)}a.checkout-login-form__link{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-left:var(--spacing-xxsmall)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-login-form__heading{grid-template-columns:repeat(1,1fr [col-start]);grid-template-rows:1fr}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:0;margin-bottom:var(--spacing-medium)}}.checkout-out-of-stock.dropin-card{border-color:var(--color-warning-500)}.checkout-out-of-stock .dropin-card__content{gap:var(--spacing-small);padding:var(--spacing-small)}.checkout-out-of-stock__title{color:var(--color-neutral-900);font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin:0;display:flex;gap:var(--spacing-xxsmall);align-items:center;justify-content:left;text-align:center}.checkout-out-of-stock__message{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0}.checkout-out-of-stock__items{display:grid;grid-template-columns:repeat(5,100px);grid-gap:var(--spacing-small);list-style:none;padding:0;margin:0}.checkout-out-of-stock__item img{width:100%;height:auto}.checkout-out-of-stock__actions{display:flex;gap:var(--spacing-small);justify-content:flex-end}a.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);background:none;border:none;padding:0;cursor:pointer}.checkout-out-of-stock__action:hover{--textColor: var(--color-brand-700);text-decoration:solid underline var(--textColor);text-underline-offset:6px}@media only screen and (width >= 320px) and (width <= 768px){.checkout-out-of-stock__items{grid-template-columns:repeat(3,100px)}}.checkout-server-error{position:relative;text-align:center}.checkout-server-error__icon .error-icon{color:var(--color-alert-500)}.checkout-server-error a{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing)}
|
|
4
|
+
.checkout-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.checkout-estimate-shipping__label,.checkout-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-estimate-shipping__price{text-align:right}.checkout-estimate-shipping__label--bold,.checkout-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.checkout-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__shipping .dropin-skeleton{grid-template-columns:1fr}.checkout-login-form__heading{display:grid;grid-template-columns:1fr max-content;grid-auto-rows:max-content}.checkout-login-form__content{grid-auto-rows:max-content}.checkout-login-form__content .dropin-field__hint a{font-weight:400}.checkout-login-form__customer-details{display:grid;grid-auto-flow:row;gap:var(--spacing-xxsmall)}.checkout-login-form__customer-name{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.checkout-login-form__customer-email{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.checkout-login-form__title{grid-column-start:1;color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);justify-self:flex-end;margin-top:var(--spacing-xxsmall)}a.checkout-login-form__link{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-left:var(--spacing-xxsmall)}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-login-form__heading{grid-template-columns:repeat(1,1fr [col-start]);grid-template-rows:1fr}.checkout-login-form__sign-in,.checkout-login-form__sign-out{grid-column-start:1;align-self:flex-start;justify-self:flex-start;margin-top:0;margin-bottom:var(--spacing-medium)}}.checkout-out-of-stock.dropin-card{border-color:var(--color-warning-500)}.checkout-out-of-stock .dropin-card__content{gap:var(--spacing-small);padding:var(--spacing-small)}.checkout-out-of-stock__title{color:var(--color-neutral-900);font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin:0;display:flex;gap:var(--spacing-xxsmall);align-items:center;justify-content:left;text-align:center}.checkout-out-of-stock__message{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0}.checkout-out-of-stock__items{display:grid;grid-template-columns:repeat(5,100px);grid-gap:var(--spacing-small);list-style:none;padding:0;margin:0}.checkout-out-of-stock__item img{width:100%;height:auto}.checkout-out-of-stock__actions{display:flex;gap:var(--spacing-small);justify-content:flex-end}a.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.checkout-out-of-stock__action{color:var(--color-brand-500);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);background:none;border:none;padding:0;cursor:pointer}.checkout-out-of-stock__action:hover{--textColor: var(--color-brand-700);text-decoration:solid underline var(--textColor);text-underline-offset:6px}@media only screen and (width >= 320px) and (width <= 768px){.checkout-out-of-stock__items{grid-template-columns:repeat(3,100px)}}.checkout-server-error{position:relative;text-align:center}.checkout-server-error__icon .error-icon{color:var(--color-alert-500)}.checkout-server-error a{font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing)}.checkout-terms-and-conditions{display:grid}.checkout-terms-and-conditions__error{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-alert-800);text-align:left;margin-top:var(--spacing-xsmall)}.checkout-terms-and-conditions__error:empty{display:none}
|
|
5
5
|
.checkout-shipping-methods__title{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-shipping-methods__content{position:relative;display:block}.checkout-shipping-methods__method{margin-bottom:var(--spacing-medium);width:fit-content;cursor:pointer;font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.checkout-shipping-methods__method:last-child{margin-bottom:0}.dropin-radio-button__label .dropin-price{color:var(--color-neutral-800);font-weight:400}.checkout-shipping-methods__options--loading{opacity:.4;pointer-events:none}.checkout-shipping-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}
|
|
6
6
|
.checkout-place-order{display:grid;padding-bottom:var(--spacing-big)}.checkout-place-order__button{align-self:flex-end;justify-self:flex-end}@media only screen and (min-width:320px) and (max-width: 768px){.checkout-place-order{background-color:var(--color-neutral-200);padding:var(--spacing-medium) var(--spacing-medium) var(--spacing-big) var(--spacing-medium)}.checkout-place-order__button{align-self:center;justify-self:stretch}}
|
|
7
7
|
.checkout-payment-methods__title{color:var(--color-neutral-800);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing);margin:0 0 var(--spacing-medium) 0}.checkout-payment-methods__wrapper{position:relative;display:grid}.checkout-payment-methods__wrapper--loading{opacity:.4;pointer-events:none}.checkout-payment-methods__methods{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-medium)}.checkout-payment-methods__content{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:var(--spacing-xbig)}.checkout-payment-methods__content>div[data-slot=PaymentMethodSlot]:not(:empty){margin-top:var(--spacing-medium)}.checkout-payment-methods--full-width{grid-template-columns:1fr}.checkout-payment-methods__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.checkout__content [data-slot=PaymentMethods]:empty{display:none}@media only screen and (min-width: 320px) and (max-width: 768px){.checkout-payment-methods__methods{grid-template-columns:1fr}}
|
|
8
8
|
.checkout-bill-to-shipping-address label{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);gap:0}`,{styleId:"checkout"});
|
|
9
|
-
import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/
|
|
9
|
+
import{jsx as f}from"@dropins/tools/preact-jsx-runtime.js";import{Render as d}from"@dropins/tools/lib.js";import"./chunks/state.js";import"./chunks/transform-store-config.js";import{events as p}from"@dropins/tools/event-bus.js";import{c as g}from"./chunks/synchronizeCheckout.js";import{UIProvider as y}from"@dropins/tools/components.js";import{useState as b,useEffect as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/store-config.js";import"@dropins/tools/signals.js";import"./fragments.js";import"./chunks/errors.js";function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w=function(t){return S(t)&&!v(t)};function S(e){return!!e&&typeof e=="object"}function v(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||M(e)}var E=typeof Symbol=="function"&&Symbol.for,j=E?Symbol.for("react.element"):60103;function M(e){return e.$$typeof===j}function P(e){return Array.isArray(e)?[]:{}}function i(e,t){return t.clone!==!1&&t.isMergeableObject(e)?o(P(e),e,t):e}function A(e,t,r){return e.concat(t).map(function(a){return i(a,r)})}function T(e,t){if(!t.customMerge)return o;var r=t.customMerge(e);return typeof r=="function"?r:o}function I(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function u(e){return Object.keys(e).concat(I(e))}function m(e,t){try{return t in e}catch{return!1}}function C(e,t){return m(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function x(e,t,r){var a={};return r.isMergeableObject(e)&&u(e).forEach(function(n){a[n]=i(e[n],r)}),u(t).forEach(function(n){C(e,n)||(m(e,n)&&r.isMergeableObject(t[n])?a[n]=T(n,r)(e[n],t[n],r):a[n]=i(t[n],r))}),a}function o(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||A,r.isMergeableObject=r.isMergeableObject||w,r.cloneUnlessOtherwiseSpecified=i;var a=Array.isArray(t),n=Array.isArray(e),s=a===n;return s?a?r.arrayMerge(e,t,r):x(e,t,r):i(t,r)}o.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(a,n){return o(a,n,r)},{})};var D=o,_=D;const L=O(_),R={title:"Checkout",LoginForm:{title:"Contact details",account:"Already have an account?",ariaLabel:"Email",invalidEmailError:"Please enter a valid email address.",missingEmailError:"Enter an email address.",emailExists:{alreadyHaveAccount:"It looks like you already have an account.",signInButton:"Sign in",forFasterCheckout:"for a faster checkout."},floatingLabel:"Email *",placeholder:"Enter your email address",signIn:"Sign In",switch:"Do you want to switch account?",signOut:"Sign Out"},ShippingMethods:{title:"Shipping options",emptyState:"This order can't be shipped to the address provided. Please review the address details you entered and make sure they're correct."},BillToShippingAddress:{title:"Bill to shipping address"},PaymentMethods:{title:"Payment",emptyState:"No payment methods available"},OutOfStock:{title:"Your cart contains items that are out of stock",message:"The following items are out of stock:",actions:{reviewCart:"Review cart",removeOutOfStock:"Remove out of stock items"},lowInventory:{one:"Last item!",many:"Only {{count}} left!"},alert:"Out of stock!"},PlaceOrder:{button:"Place Order"},ServerError:{title:"We were unable to process your order",contactSupport:"If you continue to have issues, please contact support.",unexpected:"An unexpected error occurred while processing your order. Please try again later.",button:"Try again"},EmptyCart:{title:"Your cart is empty",button:"Start shopping"},MergedCartBanner:{items:{one:"1 item from a previous session was added to your cart. Please review your new subtotal.",many:"{{count}} items from a previous session were added to your cart. Please review your new subtotal."}},EstimateShipping:{estimated:"Estimated Shipping",freeShipping:"Free",label:"Shipping",taxToBeDetermined:"TBD",withTaxes:"Including taxes",withoutTaxes:"Excluding taxes"},TermsAndConditions:{label:"I have read, understand, and accept our <a href='https://www.adobe.com/legal/terms.html' target='_blank'>Terms of Use, Terms of Sales, Privacy Policy, and Return Policy</a>.",error:"Please accept the Terms and Conditions to continue."}},U={Checkout:R},B={default:U},k=({children:e})=>{var s;const[t,r]=b(),a=(s=g.getConfig())==null?void 0:s.langDefinitions;h(()=>{const c=p.on("locale",l=>{l!==t&&r(l)},{eager:!0});return()=>{c==null||c.off()}},[t]);const n=L(B,a??{});return f(y,{lang:t,langDefinitions:n,children:e})},X=new d(f(k,{}));export{k as Provider,X as render};
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
*******************************************************************/
|
|
17
|
+
interface Email {
|
|
18
|
+
available: boolean;
|
|
19
|
+
error: string;
|
|
20
|
+
initialized: boolean;
|
|
21
|
+
pending: boolean;
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const emailSignal: import('@preact/signals-core').Signal<Email>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=EmailSignal.d.ts.map
|
package/signals/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*******************************************************************/
|
|
17
17
|
export * from './CartSignal';
|
|
18
18
|
export * from './CustomerSignal';
|
|
19
|
+
export * from './EmailSignal';
|
|
19
20
|
export * from './EstimateShippingMethodsSignal';
|
|
20
21
|
export * from './IsBillToShippingSignal';
|
|
21
22
|
export * from './SelectedPaymentMethodSignal';
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export * from './ErrorBanner';
|
|
18
|
-
export { ErrorBanner as default } from './ErrorBanner';
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! Copyright 2025 Adobe
|
|
2
|
-
All Rights Reserved. */
|
|
3
|
-
import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{AlertBanner as m,Icon as f}from"@dropins/tools/components.js";import{events as u}from"@dropins/tools/event-bus.js";import*as i from"@dropins/tools/preact-compat.js";import{useState as g,useEffect as p}from"@dropins/tools/preact-compat.js";import{useText as h}from"@dropins/tools/i18n.js";const v=o=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o},i.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),B=({initialData:o,...l})=>{const[c,s]=g(!1),t=h({message:"Checkout.ErrorBanner.genericMessage"});p(()=>{const r=u.on("error",e=>{(e==null?void 0:e.source)==="checkout"&&(e==null?void 0:e.type)==="network"&&s(!0)});return()=>{r==null||r.off()}},[]);const a=()=>{s(!1)};return c?n(m,{...l,className:"checkout__banner","data-testid":"error-banner",icon:n(f,{source:v}),message:n("span",{children:t.message}),"aria-label":t.message,onDismiss:a,variant:"warning"}):null};export{B as ErrorBanner,B as default};
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export * from './useLockScroll';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
*******************************************************************/
|
|
17
|
-
export declare const useScrollLock: () => {
|
|
18
|
-
lockScroll: () => void;
|
|
19
|
-
unlockScroll: () => void;
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=useLockScroll.d.ts.map
|