PageSourceSearch

https://www.chandlerbats.com/cdn/shopifycloud/checkout-web/assets/c1/component-ApplePayButton.B2UH0tB4.js

js chandlerbats.com collected 2026-09-28 09:23:20 UTC 8,510 bytes, 1 lines download raw bytes

1import{u as e,i as A,A as q,q as y,h as J,e as F,g as $,f as N,p as D,G as V,l as Q,S as Z}from"./esnext-vendor.B9Da21W6.js";import{S as O,an as ee,bB as te,ae as ne,co as ae,a$ as oe,cp as se,aJ as ie}from"./addresses-is-address-empty.Bn2lNY_L.js";import{k as U,b$ as _,a5 as le,c0 as re,c1 as ce,i as ue,a$ as pe,B as z,P as de,L as me,l as ye,j as ve,ax as he,I as be,m as Pe,bu as Se,a4 as fe,c2 as _e,c3 as ge,z as Ae,F as Ce}from"./hydrate.DZ4YTm7p.js";import{A as we}from"./app.DbSrjjlA.js";import{T as ke}from"./TransitionHeight.CV2XV0NY.js";import{S as j,b as Le}from"./hooks-useWalletsTimeout.CS-oFfve.js";import{c as Me}from"./localization-index.1YNaS8kx.js";import{s as G}from"./components-VatNumberValidationField.DDyS8GP9.js";import"./graphql-PaymentSessionMutation.CAXCwUvV.js";import"./hooks-useShopPayExternalAppContext.DWwMuRnz.js";import"./hooks-useReplaceShopPayInHistory.DPpLejwu.js";import"./stopwatch.CfKlh48v.js";import"./useShopPayButtonClassName.FG1djxr9.js";import"./shared-shop-theme.DIHIQUEd.js";import"./hooks-useShowShopPayOptin.Br0M25ky.js";import"./AddressPresenter.BIgrto4P.js";import"./hooks-useShouldRevealCustomization.D_kH_Ics.js";import"./hooks-useForceShopPayUrl.BFRInJvm.js";import"./ChangeCompanyLocationLink.r3PUjspg.js";import"./BillingAddressForm.pnsu7UK8.js";import"./components-RedirectionNotice.module.CsVdFi0g.js";import"./amazon-pay-useAmazonPayPaymentLine.Ju006AId.js";import"./PhoneField.C0TeiZrn.js";import"./hooks-useSuppressShopPayModalOnLoad.DFOLDSdS.js";import"./Popover.BScgzCsS.js";import"./Choice.DSKmQsTS.js";import"./Checkbox.DQyvbr9E.js";import"./shop-pay-installments-monorail.BAOukcZ1.js";import"./ShopPayLogo.C-Gy2CdB.js";import"./cross-border-hooks.xPE4TSQ5.js";import"./PayButton-helpers.Cc_ffyKs.js";import"./shared-buyer-consent.B_gDyRCR.js";import"./MarketsProDisclaimer.BqGHM17j.js";import"./IncentiveBadge.DborNHa8.js";import"./Section-SectionStyleOverride.hMiKajvE.js";import"./AutocompleteField-hooks.RGAAfjBE.js";import"./PendingShipping.CnPQOmzL.js";function xe({body:v}){return e(re,{children:e(le,{dangerouslySetInnerHTML:{__html:v.value??""},scrollableContent:"all"})})}function Ee({body:v,loading:C,error:w}){const{i18n:S}=O();return e(A,{when:w,fallback:e(A,{when:C,fallback:e(xe,{body:v}),children:e(U,{gap:"base",children:[e(_,{lines:2,lastLineSize:"large"}),e(_,{lines:3,lastLineSize:"small"}),e(_,{lines:2,lastLineSize:"base"}),e(_,{size:"extraLarge",lastLineSize:"large",lines:1}),e(_,{lines:7,lastLineSize:"small"}),e(_,{lines:3,lastLineSize:"base"})]})}),children:S.translate("bad_request.title")})}const He="VqsW7",Ie="c1X76",Be="JtAjb",g={SubscriptionConsentModal:He,Views:Ie,Pane:Be,"Pane-outgoing":"otCH1"};function Re({id:v,canConfirm:C,onConfirm:w,onHide:S,onShow:r}){const{i18n:h,shop:i}=O(),{checkoutProtocolModalEventSignal:c}=ee(),k=h.translate("payment.purchase_options_cancellation_policy_label"),L=i.merchantPolicies.find(({handle:m})=>m===j),a={handle:j,shopId:i.id,shopName:i.name,squareLogo:i.brandSettings?.squareLogo,name:k,url:L?.url??""},o=te(ce,{defaultPolicy:a,policies:[a]}),f=q(!1),s=y(()=>{f.current&&c.value==="applePaySubscriptionConsent"&&(c.value="none"),f.current=!1},[c]);J(()=>s,[s]);const n=F(!1),u=F(!1),I=q(null),b=ue(),p=pe(n.value,"slow"),l=n.value||u.value,T=!n.value||u.value,M=y(m=>{I.current=m,m&&(m.dataset.inertSupported=String("inert"in m))},[]),x=h.translate("wallets.continue_with",{walletName:h.translate("brand.apple_pay")}),E=n.value?Me(k):h.translate("payment.purchase_options_subscription_confirmation_title"),B=y(()=>{o.show(),n.value=!0},[o,n]),P=y(()=>{o.hide(),n.value=!1},[o,n]),R=y(()=>{u.value=!0,o.hide(),s(),S()},[u,o,s,S]),W=y(()=>{n.value=!1,u.value=!1,f.current=!0,c.value="applePaySubscriptionConsent",r()},[n,u,c,r]);return e(Se,{id:v,heading:e(U,{direction:"inline",alignItems:"center",gap:"base",children:[e(A,{when:n,children:e(he,{type:"button",padding:"small-400",borderRadius:"base",accessibilityLabel:h.translate("account_management.back"),onClick:P,children:e(be,{type:"arrow-left",size:"base"})})}),e(Pe,{level:1,autoFocus:!0,children:E},n.value?"policy":"consent")]}),accessibilityLabel:E,onShow:W,onHide:R,actionLayout:"stacked",primaryAction:e(ve,{variant:"primary",type:"button",inlineSize:"fill",disabled:!C.value,onClick:w,children:x}),children:e(z,{className:g.SubscriptionConsentModal,children:e(ke,{c
1ontentRef:I,children:e(z,{ref:M,className:g.Views,padding:"small-200",overflow:"hidden",children:[e(A,{when:()=>b?!n.value:p!=="entered",children:e(z,{className:$(g.Pane,n.value&&g["Pane-outgoing"]),"data-side":"backward","data-visible":!n.value&&(b||p!=="exit"),position:n.value?"absolute":"relative",inert:l,children:e(de,{children:e(Le,{buttonLabel:x,cancellationPolicyLink:L?e(me,{tone:"monochrome",onClick:B,children:e(ye,{children:k})}):void 0})})})}),e(A,{when:()=>b?n.value:p!=="exited",children:e(z,{className:$(g.Pane,!n.value&&g["Pane-outgoing"]),"data-side":"forward","data-visible":n.value&&(b||p!=="enter"),position:n.value?"relative":"absolute",inert:T,children:e(Ee,{body:o.policyBody,loading:o.loading,error:o.error})})})]})})})})}const Ne=Ce("ApplePaySubscriptionConsentModal");function St({supportedNetworks:v,color:C}){const{acceleratedWalletPaymentMethods:w,applePaySessionHandler:S,inMemoryApplePayParts:{buttonStatus:r,paymentSheetError:h}}=ne(),i=N(()=>{const t=S.value;return t?.createSession==null||t.showApplePayPaymentSheet==null?null:{createSession:t.createSession,openApplePayPaymentSheet:t.showApplePayPaymentSheet}}),c=q({status:"rendered"});D(()=>{const t=i.value!=null,H=r.value;t&&H.status==="not_rendered"?V(()=>{r.value=c.current}):!t&&H===c.current&&V(()=>{r.value={status:"not_rendered"}})}),J(()=>()=>{r.value===c.current&&(r.value={status:"not_rendered"})},[r]);const k=fe(),L=q(null),{observability:a,i18n:o,checkout:f}=O(),{wallets:s}=f,n=Q(_e()),u=N(()=>ae({hasSubscription:oe({checkout:f}),isApplePayAvailable:w.value.some(({name:t})=>t==="APPLE_PAY"),variant:n.value})),{showOverlay:I,hideOverlay:b}=ge(),p=Ae(void 0,Ne),l=F(!1),T=y(()=>{l.value=!0,a.log("apple_pay_subscription_consent_modal_opened","Apple Pay subscription consent modal opened")},[l,a]),M=y((t="dismissed")=>{l.value&&(l.value=!1,a.log("apple_pay_subscription_consent_modal_closed","Apple Pay subscription consent modal closed",{reason:t}))},[l,a]),x=()=>{a.log("apple_pay_button_clicked_while_loading","Apple Pay button clicked while already loading the payment sheet. Ignoring click.")},E=()=>{a.error(new we("Apple Pay button clicked without a ready session handler."))},B=t=>{if(s.activeSession.value?.wallet==="APPLE_PAY"){x();return}const Y=i.value;if(!Y){E();return}try{Y.openApplePayPaymentSheet(Y.createSession({supportedNetworks:v,...t&&{subscriptionConsent:t}}).session),t==="explicit_modal"&&s.activeSession.value?.wallet==="APPLE_PAY"&&a.log("apple_pay_subscription_consent_session_started","Apple Pay session started after subscription consent")}catch(d){const K={error:d,errorName:d instanceof Error?d.name:"Unknown",errorMessage:d instanceof Error?d.message:String(d),...d instanceof Error&&d.stack&&{errorStack:d.stack}};a.leaveErrorBreadcrumb("Failed to create Apple Pay session",K),h.value={type:"failed_to_create_session"},s.activeSession.value?.wallet==="APPLE_PAY"&&s.clearActiveSession({invokingWallet:"APPLE_PAY"})}},P=N(()=>u.value==="explicit_modal"),R=N(()=>l.value&&P.value&&i.value!=null&&s.activeSession.value==null);D(()=>{if(!l.value)return;(!P.value||i.value==null||s.activeSession.value!=null)&&(M("invalidated"),b(p))});const W=()=>{const t=s.activeSession.value;if(t?.wallet==="APPLE_PAY"){x();return}const H=u.value;if(P.value){if(t){a.log("apple_pay_subscription_consent_blocked_by_active_wallet","Apple Pay subscription consent blocked by another active wallet.",{activeWallet:t.wallet,requestedWallet:"APPLE_PAY"});return}if(!i.value){E();return}L.current?.focus({preventScroll:!0}),I(p);return}B(H)},m=()=>{R.value&&(a.log("apple_pay_subscription_consent_confirmed","Apple Pay subscription consent confirmed"),M("confirmed"),b(p),B("explicit_modal"))},X=i.value!=null;return e(Z,{children:[e("button",{ref:t=>{L.current=t,k("apple_pay")(t)},className:$(G.ApplePayButton,G[C],ie.borderRadius,se({focusRing:"base"})),lang:o.locale,disabled:!X,onClick:W,type:"button","aria-label":o.translate("brand.apple_pay"),"aria-haspopup":P.value?"dialog":void 0}),e(A,{when:()=>P.value||l.value,children:e(Re,{id:p,canConfirm:R,onShow:T,onHide:M,onConfirm:m})})]})}export{St as ApplePayButton};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.