var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); import{x as E,dj as de,aa as T,eG as pe,aj as F,am as L,s as he,gO as me,q as B,a as t,gP as Pe,gQ as Se,B as U,aL as ye,gR as ge,gS as $,ag as j,gT as J,gU as fe,bE as k,a7 as be,ai as W,gV as _,dF as Q,gW as Z,gX as ke,gY as Ee,dm as Ce,gZ as _e,g_ as ve,g$ as Ae,h0 as We,h1 as v,cI as ee,h2 as Le,h3 as x,h4 as Be,fL as y,af as te,b0 as ae,a5 as D,b9 as Me,bc as se,al as De,h5 as Y,h6 as we,h7 as xe,fH as Te,y as M,h8 as z,aP as Oe,I as Ie,bA as Re,h9 as Ne,o as He,d as A,ha as Ge,aM as Fe,aV as Ue,a4 as Ye,U as ze,aN as ne,hb as Ve,T as Xe,hc as Ke,hd as qe,he as $e,hf as je,w as Je,hg as Qe,hh as Ze,hi as et,d7 as oe,a9 as tt,hj as at,ae as st,a1 as nt,hk as ot,hl as rt,hm as it,hn as re,ho as lt,hp as ct,b as ut,S as V,hq as dt,b2 as pt,a2 as ht,A as mt,hr as Pt,cP as St,hs as yt}from"./app.rndyD_a3.js";import{u as gt,a as ie,S as ft}from"./useEditorShopPayNavigation.TAC5XOwD.js";import{P as bt}from"./VaultedPayment.CuX2OVNi.js";function pa(){const e=E(),a=de(),{shopPayEnabled:n}=T(),{value:s}=pe(),o=F().rememberMe,l=!!s?.rememberMe||o.value,[r,i]=L(l),{negotiate:d}=he(),h=me()?.saveShippingAddressCheckboxEnabled??!0,g=!!a,f=F().shippingAddress.value,S=!n&&h&&!g&&!f.oneTimeUse,m=B(b=>{i(b),o.value=b,d({})},[d,o]);return S?t(Pe,{id:"save_shipping_information",name:"save_shipping_information",checked:r,onChange:m,children:e("customer_account.save_my_information_label","Save this information for next time")}):null}const kt=["GooglePay","PayPal","Venmo"];function ha({id:e}){return Se({id:e,stage:({pendingComponents:a})=>kt.some(s=>a.has(s))?U.Usable:U.Complete}),null}const Et="vT2w7",Ct="f1x20",_t="hKWGx",X={ApplePayButton:Et,dark:Ct,light:_t};function vt({supportedNetworks:e,color:a}){const n=E(),{locale:s}=ye().i18n,o=ge(),l=$(),r=j(J),i=fe(),{paymentSheetError:d}=k().inMemoryApplePayParts,u=be(),h=()=>{try{i(o({supportedNetworks:e}).session)}catch(g){u.leaveBreadcrumb("Failed to create Apple Pay session",{error:g}),d.value={type:"failed_to_create_session"}}};return t("button",{ref:l("apple_pay"),className:W(X.ApplePayButton,X[a],_.borderRadius,_.focusOutline,{[_.shadow]:r}),lang:s,onClick:h,type:"button","aria-label":n("brand.apple_pay","Apple Pay")})}const At="Xicuw",K={Button:At,"Button--contrast":"oHCaH"},Wt="shop-pay-button";function Lt(){const e=Q(),{id:a}=T(),n=Z(),s=gt({foregroundColor:ke}),o=Ee(),l=Ce(),r=_e(o,l),{telemetry:{lastClickedWallet:i}}=k(),d=ve(Ae.DirectCheckoutCheckout),u=$(),h=j(J),g=We(v.ShopifyPay),{setEditorShopPay:f}=ie(),S=B(()=>{const p=parseInt(ee(a),10),C=Le(v.ShopifyPay,x.Success,p,n);e?.record(C),g(),i.value="SHOP_PAY"},[a,e,n,i,g]),m=B(p=>{if(f){p.preventDefault(),f(!0);return}S()},[S,f]),b=W(K.Button,{[K["Button--contrast"]]:!s&&!r},_.borderRadius,_.focusOutline,{[_.shadow]:h});return t("a",{id:Wt,href:d,ref:u("shop_pay"),className:b,"aria-label":"Shop Pay",onClick:m,children:t(ft,{size:"medium"})})}const Bt="o1z23",Mt="_4aXW0",Dt="DUnBb",wt="kTI19",xt="JH5oc",Tt="pUo2R",Ot="_5SdgT",It="RKgRy",Rt="iRnuh",Nt="QKTth",Ht="Pnahu",Gt="OTERX",Ft="WTXfy",Ut="qLVAT",Yt="XHLFs",c={Header:Bt,Text:Mt,Layout:Dt,StackWrapper:wt,SkeletonWrapper:xt,ButtonWrapper:Tt,loading:Ot,subsequentLoad:It,Stack:Rt,SimulatedWalletStack:Nt,ShopPayEmphasis:Ht,Container:Gt,DrawerLink:Ft,InnerDrawerLink:Ut,DrawerHideButtons:Yt};function zt(){const e=k();return Be.map(n=>Vt(e,n)).some(Boolean)}function Vt(e,a){const n=!!e.walletPaymentMethods.find(o=>o.name===a),s=(()=>{switch(a){case"PAYPAL_EXPRESS":return e.inMemoryPayPalParts.acceleratedCheckoutButtonStatus.peek();case"GOOGLE_PAY":return e.inMemoryGooglePayParts.buttonStatus.peek();case y.AmazonPay:case y.BuyWithPrime:return e.inMemoryAmazonPayParts.buttonStatus.peek();default:return}})();return n&&s?.status==="not_rendered"}function Xt(){const e=E();return t(Me,{open:!0,blocking:!0,accessibilityLabel:e("wallets.payment_in_progress_title","Payment in progress"),padding:"none",children:t(te,{spacing:"loose",padding:"large200",children:[t(ae,{level:1,children:e("wallets.payment_in_progress_title","Payment in progress")}),t(D,{children:e("wallets.payment_in_progress_body","Your payment is being processed. Your order will be completed soon.")})]})})}function Kt(){const e=se(),a=De(),{walletUsedForSubmissionSignal:n,receiptErrorSignal:s}=k(),o=Y(we()),l=Y(xe()),{inMemoryApplePayParts:{asPaymentMethod:r}}=k(),i=r.peek(),d=Te(a?.status==="failed"&&a.failure.type==="payment"&&e?a?.failure:void 0);M(()=>{if(a?.status==="processing"||a?.status==="polling_for_order")return;const u=n.peek();if(u){if(n.value=void 0,a?.status!=="failed"){s.value=void 0;return}u==="APPLE_PAY"&&l.current(),a.failure.type==="payment"&&u&&!i&&o.current(),(u==="APPLE_PAY"||u==="GOOGLE_PAY")&&(s.value=d)}},[a,s,n,i,l,d,o]),M(()=>function(){s.value=void 0},[s])}const qt="express-checkout-wallets-wrapper",$t=/(iPhone|iPod|iPad|Mac OS)/i,jt=/((iPhone|iPod|iPad).*AppleWebKit(?!.*(Safari|instagram|FBAV|FB_IAB)))/i,Jt=/(ShopifyCheckoutSDK|CheckoutSheetProtocol)/i;function Qt(){const{userAgent:e}=Ve(),a=jt.test(e);return!($t.test(e)&&Jt.test(e)||a)}function Zt(){const{inMemoryPayPalParts:e,inMemoryVenmoParts:a,inMemoryGooglePayParts:n,inMemoryAmazonPayParts:s,walletPaymentMethods:o}=k(),l=Xe(()=>o.flatMap(r=>{switch(r.name){case"PAYPAL_EXPRESS":{const i=[{name:v.PayPalV6,buttonStatusSignal:e.acceleratedCheckoutButtonStatus}];return r.venmoEnabled&&i.push({name:v.Venmo,buttonStatusSignal:a.buttonStatus}),i}case"GOOGLE_PAY":return{name:v.GooglePay,buttonStatusSignal:n.buttonStatus};case y.AmazonPay:return{name:y.AmazonPay,buttonStatusSignal:s.buttonStatus};case y.BuyWithPrime:return{name:y.BuyWithPrime,buttonStatusSignal:s.buttonStatus};default:return[]}}),[o,n.buttonStatus,s.buttonStatus,e.acceleratedCheckoutButtonStatus,a.buttonStatus]);Ke(l,qe)}function ea({buttonCount:e,children:a,waitUntilLoaded:n=!0,walletPaymentMethods:s}){const[o,l]=L(z()),[r,i]=L(!0),d=Qt(),u=Oe(),h=E(),{inMemoryApplePayParts:{paymentSheetError:g}}=k(),f=zt();Zt();const S=n?f:!1,[m,b]=L(!1),p=Ie(),{id:C}=T(),O=Q(),I=Z(),R=Re();Ne(s,e);const N=B((P,w)=>{const ce=parseInt(ee(C),10),ue=je({state:w,shopId:ce,nascarData:{...P,walletsRenderedCount:e},paymentMethods:s});O?.record(ue)},[C,O,e,s]),H=s.some(P=>P.name==="SHOP_PAY")&&d;Kt(),!S&&!m&&(b(!0),l(P=>z()-P)),M(()=>{m&&R.histogram({name:"wallets_container_render_time",value:o,attributes:{PCIv4:s.some(P=>P.name===y.AmazonPay||P.name===y.BuyWithPrime||P.name==="GOOGLE_PAY"||P.name==="PAYPAL_EXPRESS")}})},[m,R,o]);const G=h("alternative_payment_method_banner.express_checkout","Express checkout"),le=He("worker-version")!=="fast";return t(ne,{accessibilityLabel:G,children:[t(A,{className:c.Container,"data-count":e,children:[t("div",{className:c.Header,children:t(Ge,{className:c.Text,children:G})}),t("div",{className:c.StackWrapper,children:[t("div",{className:c.Layout,children:[t(ta,{loading:S||!u,hideWallets:r,shopPayEmphasis:H,children:[...Array(e).keys()].filter((P,w)=>w<=3).map(P=>t(Fe,{delay:le},P))}),t("div",{id:qt,className:W(c.Stack,c.ButtonWrapper,{[c.loading]:S,[c.subsequentLoad]:S&&m,[c.DrawerHideButtons]:r,[c.ShopPayEmphasis]:H}),children:u&&a})]}),t("div",{className:c.DrawerLink,children:t(Ue,{accessibilityLive:"polite",textDecoration:"none",onClick:()=>{r?(i(!1),N(I,x.NascarDrawerOpen)):(i(!0),N(I,x.NascarDrawerClose))},children:t("div",{className:c.InnerDrawerLink,children:[t(D,{children:r?h("alternative_payment_method_banner.show_more_options","Show more options"):h("alternative_payment_method_banner.hide_more_options","Hide more options")}),t(Ye,{type:r?"chevron-down":"chevron-up",size:"small-200"})]})})}),p&&t(ze,{isForExpressCheckout:!0})]})]}),g?.value?.type==="payment_cancelled_while_processing"&&t(Xt,{})]})}function ta({children:e,loading:a=!1,hideWallets:n,shopPayEmphasis:s}){return $e(a,"base")==="exited"?null:t("div",{className:W(c.Stack,c.SkeletonWrapper,{[c.ShopPayEmphasis]:s,[c.DrawerHideButtons]:n}),children:e})}const aa="_2SmAP",sa="eFu6h",q={MessageWrapper:aa,SimulatedWalletWrapper:sa},na=e=>e;function ma(){const e=Je("simulated"),a=E(),{inMemoryVenmoParts:{buttonStatus:n},walletPaymentMethods:s,buttonCount:o}=k(),l=Qe(),r=Ze(),{setEditorShopPay:i}=ie(),d=et(s,n.value),{expressCheckout:{button:{cornerRadius:u}={}}}=oe(),h=tt("Checkout::Dynamic::Render","WALLETS1"),g=at(),f=e&&g&&!s.length;if(!r)return null;const S=!e;let m=s.map(p=>t(ra,{method:p,triggerProgression:l},p.name));if(d){const p=ia({triggerProgression:l});m=[...m,p]}const b=f?t(A,{padding:"large200",cornerRadius:"base",blockAlignment:"center",inlineAlignment:"center",minInlineSize:"fill",className:q.MessageWrapper,children:t(D,{color:"subdued",children:a("payment.simulated_express_checkout","Wallets are unavailable in the editor preview due to your region or browser")})}):m.map((p,C)=>p.key==="VENMO"?null:p.key==="SHOP_PAY"&&i?p:t(A,{className:q.SimulatedWalletWrapper,children:t(A,{className:W([c.walletButton,c.Stack,c.SimulatedWalletStack]),inert:!0,children:p})},p.key??C));return t("div",{style:{...oa(u)},children:[t(st,{extensions:h,spacing:"large200",render:na}),h.length>0&&t(nt,{spacing:"large200"}),t(ea,{buttonCount:f?1:o,waitUntilLoaded:S,walletPaymentMethods:s,children:e?b:m})]})}function oa(e){return e&&{"--x-express-checkout-button-border-radius":lt(ct.borderRadius)(e)}}function ra({method:e,triggerProgression:a}){const n=ot();switch(e.name){case"APPLE_PAY":return t(vt,{supportedNetworks:e.supportedNetworks,color:n});case"PAYPAL_EXPRESS":return t(re,{progressToNextPage:a});case"SHOP_PAY":return t(Lt,{});case"GOOGLE_PAY":return t(it,{});case y.AmazonPay:return t(rt,{});case y.BuyWithPrime:return t(bt,{wallet:y.BuyWithPrime});default:return null}}function ia({triggerProgression:e}){return t(re,{fundingSource:"venmo",buttonColor:"blue",progressToNextPage:e},"VENMO")}function Pa(){const e=E(),{divider:{borderStyle:a,borderWidth:n}}=ut(),{main:{divider:{borderStyle:s=a,borderWidth:o=n}={},section:l,spacing:r}}=oe(),i=V.default(["large100","none","large300","none"]),u=dt(l)?V.default([r??"base","none"]).when({viewportInlineSize:{min:"extraSmall"}},[r??"large200","none"]):i;return t(A,{padding:u,children:t(pt,{borderStyle:s,borderWidth:o,children:t(ht,{textAlign:"center",children:t(D,{color:"subdued",children:e("alternative_payment_method_banner.or","OR")})})})})}function Sa(e){const a=mt(null),{expressCheckoutHeightSignal:n,expressCheckoutFirstLoadsSignal:s}=Pt(),o=n.value,l=St(),r=s.value;return M(()=>{const i=a.current?.clientHeight,d=i!==void 0&&i!==o&&!r,u=e.map(h=>h.name);d&&l("expressCheckoutSetChange",{timestamp:new Date,paymentMethods:u}),s.value=!1,n.value=i||0},[o,e,l,r,s,n]),a}function ya(){const a=E()("contact.delivery_option_title","Delivery method"),n=yt(),s=se();return n?t(ne,{accessibilityLabel:a,children:t(te,{children:[s?null:t(ae,{level:1,children:a}),n]})}):null}export{ya as D,ma as E,ha as P,pa as S,Pa as a,Sa as u}; }